Conversation
Add OpenCode AI assistant integration alongside existing Claude, Gemini, Codex, Cursor, and Copilot support. Changes: - Add "opencode" entry to aiHelpers map with skillsDir=true flag - Implement createOpenCodeSkills() for nested directory structure: .opencode/skills/<skill-name>/SKILL.md - Add skill name validation using OpenCode's required regex: ^[a-z0-9]+(-[a-z0-9]+)*$ - Implement installOpenCodePlugin() for JavaScript-based hooks in .opencode/plugins/taskwing-hooks.js - Plugin implements session.created and session.idle hooks using Bun shell API (ctx.$) to invoke taskwing CLI commands - Add comprehensive tests for all OpenCode functionality OpenCode uses different patterns than other AI tools: - Skills instead of slash commands (nested directories with SKILL.md) - JavaScript plugins instead of JSON settings for hooks - YAML frontmatter with "name" and "description" fields
Add `taskwing mcp install opencode` command to configure OpenCode's MCP integration by creating opencode.json at the project root. Implementation: - Add OpenCodeMCPServerConfig and OpenCodeConfig structs for config format - Implement installOpenCode() and upsertOpenCodeMCPServer() functions - Add "opencode" case to mcpInstallCmd switch and "all" target - Update help text to include opencode option OpenCode config format differences from other tools: - File location: project root (opencode.json), not subdirectory - Top-level "$schema" key for validation - "mcp" object (not "mcpServers") - Command as JSON array ["taskwing", "mcp"] (not string) - Type must be "local" for command execution Includes comprehensive tests: - Success case with JSON structure validation - Command array format verification - Existing config preservation - Idempotency - No secrets validation - Input validation (empty path/name, invalid type, empty command) - Malformed JSON handling
Add tests for IngestFindings covering: - Basic finding ingestion - OpenCode skill metadata patterns - Empty/nil findings (no-op cases) - Multiple node types (decision, pattern, constraint, feature, documentation) - Workspace-aware tagging for monorepo support Also add repository integration tests for: - NewDefaultRepository create/retrieve operations - SQLite persistence across close/reopen cycles
- Add 'opencode' case in installMCPServers() calling installOpenCode() - Add 'opencode' to aiConfigOrder and aiConfigs for AI selection UI - OpenCode uses project-local config (opencode.json) like Cursor/Copilot Tests: - TestInstallMCPServers_OpenCode - verifies opencode.json creation - TestInstallMCPServers_AllIncludesOpenCode - verifies multiple AI install - TestAIConfigOrder_IncludesOpenCode - verifies AI selection list - TestAIConfigs_OpenCodeEntry - verifies config values
Implement checkOpenCodeMCP() to validate OpenCode configuration:
- Validates opencode.json exists and has valid JSON structure
- Checks for taskwing-mcp entry with correct type ("local") and command format
- Validates .opencode/skills/*/SKILL.md files:
- YAML frontmatter presence
- Required fields (name, description)
- Name field matches directory name
Tests: 14 new tests covering valid/invalid scenarios for:
- opencode.json (missing, invalid JSON, empty MCP, missing taskwing-mcp, wrong type)
- Skills (missing frontmatter, missing fields, name mismatch, multiple valid)
- Add tests/integration/opencode_test.go with E2E tests: - TestOpenCode_BootstrapAndDoctor validates artifacts creation - TestOpenCode_MCPServerConfig validates config structure - Tests use local binary (go run .), NOT system-installed taskwing - Add integration-opencode CI job to .github/workflows/ci.yml - Runs on main merges and PRs - Builds binary before running tests - Add make test-opencode target to Makefile - Document OpenCode in docs/TUTORIAL.md: - Add OpenCode section with setup, skills, and hooks info - Update AI selection prompt examples - Add development notes about local dev MCP
… register in bootstrap
Staticcheck S1009: len() for nil maps is defined as zero, so the nil check is unnecessary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.