Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,54 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.38.3] - 2026-04-27

Overview: Synced upstream GSD to v1.38.5 and translated all Claude Code artifacts to OpenCode equivalents across 200+ files. Added `gsd-edit-phase` command and `edit-phase` workflow for modifying existing roadmap phases in place. Introduced post-merge gate to execute-phase workflow. Fixed SDK runtime detection defaults to use `claude` instead of `OpenCode` throughout the query layer. Added missing `<objective>` sections to command files to satisfy CI validation.

### Added

- `gsd-edit-phase` command in `gsd-opencode/commands/gsd/gsd-edit-phase.md` for editing any field of an existing roadmap phase in place, preserving number and position
- `edit-phase` workflow in `gsd-opencode/get-shit-done/workflows/edit-phase.md` supporting field-level edits, full regeneration from clarified intent, guarded edits for in-progress/completed phases, depends-on validation, and diff confirmation before writing
- Post-merge gate in `gsd-opencode/get-shit-done/workflows/execute-phase/steps/post-merge-gate.md` for execute-phase workflow
- `roadmap-update-plan-progress.test.ts` with 192 lines of unit tests for the `planCountPattern` regex fix in `gsd-opencode/sdk/src/query/`

### Changed

- Synced upstream GSD submodule from v1.38.2 to v1.38.5, copying 49 files from `original/get-shit-done/`
- Translated 415+ files (6355+ replacements) from Claude Code to OpenCode equivalents using `assets/configs/config.json` and new `assets/configs/v1.38.5.json` supplemental config
- Added `mode: subagent` declaration to 33 agent definition files in `gsd-opencode/agents/`
- Replaced `task()` function calls with `@subagent_type` shorthand syntax across commands, workflows, references, and templates
- Changed SDK runtime detection default from `OpenCode` to `claude` across query layer in `gsd-opencode/sdk/src/query/helpers.ts`, `gsd-opencode/sdk/src/query/init.ts`, `gsd-opencode/sdk/src/query/skills.ts`, and `gsd-opencode/sdk/src/types.ts`
- Updated agent references from `.OpenCode/skills/` to `.claude/skills/` in `gsd-opencode/agents/gsd-code-fixer.md`, `gsd-opencode/agents/gsd-code-reviewer.md`, and `gsd-opencode/agents/gsd-ai-researcher.md`
- Updated agent contract references from `OpenCode-code#13898` to `claude-code#13898` in `gsd-opencode/agents/gsd-advisor-researcher.md` and `gsd-opencode/agents/gsd-ai-researcher.md`
- Updated AI-SPEC.md template section 4 implementation guidance examples from `OpenCode-sonnet-4-6` to `claude-sonnet-4-6` in `gsd-opencode/agents/gsd-ai-researcher.md`
- Updated `gsd-code-fixer.md` agent to run inside isolated git worktrees using `mktemp`-based paths to prevent racing the foreground session, with unconditional cleanup on exit
- Updated `gsd-code-reviewer.md` agent to use adversarial stance starting hypothesis that submitted implementations contain defects, with required BLOCKER/WARNING finding classifications
- Updated `discuss-phase` workflow with 1169 lines of changes to discussion mode handling in `gsd-opencode/get-shit-done/workflows/discuss-phase.md`
- Updated `execute-phase` workflow with 370 lines of changes to execution handling in `gsd-opencode/get-shit-done/workflows/execute-phase.md`
- Updated `plan-phase` workflow with 334 lines of changes to planning pipeline in `gsd-opencode/get-shit-done/workflows/plan-phase.md`
- Updated `quick` workflow with 55 lines of changes to quick task execution in `gsd-opencode/get-shit-done/workflows/quick.md`
- Updated `review` workflow with 123 lines of changes to code review process in `gsd-opencode/get-shit-done/workflows/review.md`
- Updated `verify-phase` workflow with 116 lines of changes to verification handling in `gsd-opencode/get-shit-done/workflows/verify-phase.md`
- Updated `new-milestone` workflow with 92 lines of changes to milestone creation in `gsd-opencode/get-shit-done/workflows/new-milestone.md`
- Updated `settings` workflow with 186 lines of changes to settings management in `gsd-opencode/get-shit-done/workflows/settings.md`
- Updated `update` workflow with 50 lines of changes to update process in `gsd-opencode/get-shit-done/workflows/update.md`
- Updated `transition` workflow with 22 lines of changes to phase transitions in `gsd-opencode/get-shit-done/workflows/transition.md`
- Updated `map-codebase` workflow with 50 lines of changes to codebase mapping in `gsd-opencode/get-shit-done/workflows/map-codebase.md`
- Updated `insert-phase` workflow with 33 lines of changes to phase insertion in `gsd-opencode/get-shit-done/workflows/insert-phase.md`
- Updated SDK query layer handlers in `gsd-opencode/sdk/src/query/` including `helpers.ts` (12 lines), `profile-output.ts` (12 lines), `decisions.ts` (4 lines), `state-project-load.ts` (4 lines), `index.ts` (6 lines), `skills.ts` (6 lines), `skill-manifest.ts` (12 lines), `gsd-tools.ts` (6 lines), `init.ts` (2 lines), `init-complex.ts` (2 lines), `docs-init.ts` (2 lines), `init-runner.ts` (2 lines), `phase-prompt.ts` (4 lines), and `types.ts` (4 lines)
- Updated SDK test suite files in `gsd-opencode/sdk/src/` including `helpers.test.ts` (20 lines), `skills.test.ts` (26 lines), `cli.test.ts` (20 lines), `init-runner.test.ts` (10 lines), `gsd-tools.test.ts` (18 lines), and various integration tests
- Updated `gsd-insert-phase.md` command to remove `write: true` permission in `gsd-opencode/commands/gsd/gsd-insert-phase.md`
- Updated `gsd-debug.md` command to use `workflow.tdd_mode` config path instead of `tdd_mode` in `gsd-opencode/commands/gsd/gsd-debug.md`
- Added `<objective>` sections to `gsd-graphify.md`, `gsd-intel.md`, and `gsd-set-profile.md` command files to satisfy CI validation
- Added supplemental translation config `assets/configs/v1.38.5.json` for remaining `task()` call conversions
- Updated `assets/antipatterns.toml` forbidden regex from `task\(\n` to more precise pattern to avoid false positives in documentation examples

### Fixed

- SDK runtime detection defaulting to `OpenCode` instead of `claude` when no signals present, affecting agent directory resolution and config fallback behavior
- `planCountPattern` regex in roadmap progress handler overwriting the next line when **Plans:** appeared on its own line followed by a bullet list

## [1.38.2] - 2026-04-26

Overview: Added complete GSD SDK with TypeScript source, compiled distribution, query layer, golden fixtures, and comprehensive test suite. Fixed SDK runtime dependency resolution by adding @anthropic-ai/claude-agent-sdk and ws to parent package.json. Updated installer to handle SDK runtime dependencies for pre-built distributions.
Expand Down
2 changes: 1 addition & 1 deletion assets/antipatterns.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ forbidden_strings = [
'model: haiku'
]
forbidden_regexp_strings = [
'task\(\n'
'^task\(\s*\n\s*(prompt|subagent_type|description)'
]
16 changes: 10 additions & 6 deletions assets/bin/gsd-copy-from-original.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/env node

/**
* gsd-copy-from-original.js - CLI entry point for syncing from TÂCHES repository
* gsd-copy-from-original.js - CLI entry point for syncing from original GSD repository
*
* Syncs files from the original TÂCHES repository (git submodule) to gsd-opencode.
* Syncs files from the original GSD repository (git submodule) to gsd-opencode.
* This is a maintenance tool for keeping the OpenCode adaptation in sync with upstream.
*
* IMPORTANT: This script does NOT apply CC→OC transformations.
* Transformations are handled separately by translate.js (Phase 10).
*
* This script always overwrites target files with upstream content. Divergence
* detection is disabled because translations are expected to alter target files
* after each sync cycle.
*
* Usage: node gsd-copy-from-original.js [options]
*
* Options:
* --apply Apply changes (copy files)
* -f, --force Overwrite diverged files without warning
* --filter <pattern> Filter files by name pattern (e.g., "VALID*")
* -v, --verbose Show detailed output
* -h, --help Show help message
Expand Down Expand Up @@ -136,9 +139,11 @@ async function main(options) {

const verbose = options.verbose;
const apply = options.apply;
const force = options.force;
const filter = options.filter;

// Always use force mode — translation is expected to alter target files
const force = true;

// By default, run in preview mode (dry-run)
const dryRun = !apply;

Expand Down Expand Up @@ -301,9 +306,8 @@ async function main(options) {
// Configure CLI
program
.name('gsd-copy-from-original')
.description('Sync files from original TÂCHES repository to gsd-opencode')
.description('Sync files from original GSD repository to gsd-opencode (always overwrites target files)')
.option('--apply', 'Apply changes (copy files)', false)
.option('-f, --force', 'Overwrite diverged files without warning', false)
.option('--filter <pattern>', 'Filter files by name pattern (e.g., "VALID*")')
.option('-v, --verbose', 'Show detailed output', false)
.option('--project-root <path>', 'Project root directory', process.cwd())
Expand Down
69 changes: 69 additions & 0 deletions assets/configs/v1.38.5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"_description": "Supplemental translation rules for v1.38.5 -- fixes remaining task() calls",
"include": ["gsd-opencode/**"],
"exclude": [
"node_modules/**",
".git/**",
".translate-backups/**",
"**/oc-*",
"**/*-oc-*"
],
"rules": [
{
"_comment": "1. task() with expression prompt (+), subagent_type, conditional isolation, description (diagnose-issues pattern)",
"pattern": "task\\(\\s*\\n\\s*prompt=([\\w]+\\s*\\+\\s*\"[^\"]+\"),\\s*\\n\\s*subagent_type=\"(gsd-[^\"]+)\",\\s*\\n\\s*\\$\\{[^}]+\\?\\s*'[^']*'\\s*:\\s*''\\},?\\s*\\n\\s*description=\"[^\"]*\"\\s*\\n\\s*\\)",
"replacement": "@$2 $1",
"isRegex": true,
"caseSensitive": true,
"description": "Replace diagnose-issues style task() with expression prompt"
},
{
"_comment": "2. task() with subagent_type=\"general\", multiline prompt, model, description (advisor pattern)",
"pattern": "task\\(\\s*\\n\\s*prompt=\"([\\s\\S]*?)\",\\s*\\n\\s*subagent_type=\"general\",\\s*\\n\\s*model=\"[^\"]*\",\\s*\\n\\s*description=\"[^\"]*\"\\s*\\n\\s*\\)",
"replacement": "@gsd-advisor-researcher \"$1\"",
"isRegex": true,
"caseSensitive": true,
"description": "Replace advisor task() with subagent_type=general to @gsd-advisor-researcher"
},
{
"_comment": "3. task() with subagent_type first, description, prompt (codebase-drift-gate pattern)",
"pattern": "task\\(\\s*\\n\\s*subagent_type=\"(gsd-[^\"]+)\",\\s*\\n\\s*description=\"[^\"]*\",\\s*\\n\\s*prompt=\"([^\"]+)\"\\s*\\n\\s*\\)",
"replacement": "@$1 \"$2\"",
"isRegex": true,
"caseSensitive": true,
"description": "Replace codebase-drift-gate style task()"
},
{
"_comment": "4. task() with prompt, subagent_type, model only (scan.md pattern)",
"pattern": "task\\(\\s*\\n\\s*prompt=\"([^\"]+)\",\\s*\\n\\s*subagent_type=\"(gsd-[^\"]+)\",\\s*\\n\\s*model=\"[^\"]*\"\\s*\\n\\s*\\)",
"replacement": "@$2 \"$1\"",
"isRegex": true,
"caseSensitive": true,
"description": "Replace scan.md style task()"
},
{
"_comment": "5. task() with description, prompt (with ternary), subagent_type, model (execute-phase verifier pattern)",
"pattern": "task\\(\\s*\\n\\s*description=\"[^\"]*\",\\s*\\n\\s*prompt=\"([\\s\\S]*?)\",\\s*\\n\\s*subagent_type=\"(gsd-[^\"]+)\",\\s*\\n\\s*model=\"[^\"]*\"\\s*\\n\\s*\\)",
"replacement": "@$2 \"$1\"",
"isRegex": true,
"caseSensitive": true,
"description": "Replace execute-phase verifier style task()"
},
{
"_comment": "6. task() with variable prompt {above}, subagent_type, model, trailing comma (plan-phase pattern-mapper)",
"pattern": "task\\(\\s*\\n\\s*prompt=\"\\{above\\}\",\\s*\\n\\s*subagent_type=\"(gsd-[^\"]+)\",\\s*\\n\\s*model=\"[^\"]*\",\\s*\\n\\s*\\)",
"replacement": "@$1 {above}",
"isRegex": true,
"caseSensitive": true,
"description": "Replace plan-phase pattern-mapper task()"
},
{
"_comment": "7. general-purpose anti-pattern reference",
"pattern": "`general-purpose`",
"replacement": "`gsd-general`",
"isRegex": false,
"caseSensitive": true,
"description": "Replace general-purpose agent reference in anti-patterns"
}
]
}
2 changes: 1 addition & 1 deletion gsd-opencode/agents/gsd-advisor-researcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ When you need library or framework documentation, check in this order:
- Resolve library ID: `mcp__context7__resolve-library-id` with `libraryName`
- Fetch docs: `mcp__context7__get-library-docs` with `context7CompatibleLibraryId` and `topic`

2. If Context7 MCP is not available (upstream bug anthropics/OpenCode-code#13898 strips MCP
2. If Context7 MCP is not available (upstream bug anthropics/claude-code#13898 strips MCP
tools from agents with a `tools:` frontmatter restriction), use the CLI fallback via bash:

Step 1 — Resolve library ID:
Expand Down
6 changes: 3 additions & 3 deletions gsd-opencode/agents/gsd-ai-researcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ When you need library or framework documentation, check in this order:
- Resolve library ID: `mcp__context7__resolve-library-id` with `libraryName`
- Fetch docs: `mcp__context7__get-library-docs` with `context7CompatibleLibraryId` and `topic`

2. If Context7 MCP is not available (upstream bug anthropics/OpenCode-code#13898 strips MCP
2. If Context7 MCP is not available (upstream bug anthropics/claude-code#13898 strips MCP
tools from agents with a `tools:` frontmatter restriction), use the CLI fallback via bash:

Step 1 — Resolve library ID:
Expand Down Expand Up @@ -73,7 +73,7 @@ Use context7 MCP first (fastest). Fall back to webfetch.
| LangChain | https://python.langchain.com/docs |
| LangGraph | https://langchain-ai.github.io/langgraph |
| OpenAI Agents SDK | https://openai.github.io/openai-agents-python |
| OpenCode Agent SDK | https://docs.anthropic.com/en/docs/OpenCode-code/sdk |
| OpenCode Agent SDK | https://docs.anthropic.com/en/docs/claude-code/sdk |
| AutoGen / AG2 | https://ag2ai.github.io/ag2 |
| Google ADK | https://google.github.io/adk-docs |
| Haystack | https://docs.haystack.deepset.ai |
Expand All @@ -98,7 +98,7 @@ Update AI-SPEC.md at `ai_spec_path`:

**Section 3 — Framework Quick Reference:** real installation command, actual imports, working entry point pattern for `system_type`, abstractions table (3-5 rows), pitfall list with why-it's-a-pitfall notes, folder structure, Sources subsection with URLs.

**Section 4 — Implementation Guidance:** specific model (e.g., `OpenCode-sonnet-4-6`, `gpt-4o`) with params, core pattern as code snippet with inline comments, tool use config, state management approach, context window strategy.
**Section 4 — Implementation Guidance:** specific model (e.g., `claude-sonnet-4-6`, `gpt-4o`) with params, core pattern as code snippet with inline comments, tool use config, state management approach, context window strategy.
</step>

<step name="write_section_4b">
Expand Down
39 changes: 37 additions & 2 deletions gsd-opencode/agents/gsd-code-fixer.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Before fixing code, discover project context:

**Project instructions:** read `./AGENTS.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions during fixes.

**Project skills:** Check `.OpenCode/skills/` or `.agents/skills/` directory if either exists:
**Project skills:** Check `.claude/skills/` or `.agents/skills/` directory if either exists:
1. List available skills (subdirectories)
2. read `SKILL.md` for each skill (lightweight index ~130 lines)
3. Load specific `rules/*.md` files as needed during implementation
Expand Down Expand Up @@ -216,6 +216,39 @@ If a finding references multiple files (in Fix section or Issue section):

<execution_flow>

<step name="setup_worktree">
**Isolation: create a dedicated git worktree BEFORE touching any files.**

This agent runs as a background process that makes commits. Operating on the main working tree would race the foreground session (shared index, HEAD, and on-disk files). Instead, every instance runs in its own isolated worktree.

```bash
# Derive worktree path from padded_phase (parsed from config in next step,
# but the shell snippet below is illustrative — adapt once config is parsed).
# In practice: parse padded_phase from config first, then run:
branch=$(git branch --show-current)
test -n "$branch" || { echo "Detached HEAD is not supported for review-fix (#2686)"; exit 1; }
wt=$(mktemp -d "/tmp/sv-${padded_phase}-reviewfix-XXXXXX")
git worktree add "$wt" "$branch"
cd "$wt"
```

Concrete steps:
1. Parse `padded_phase` from the `<config>` block (needed for the path).
2. Resolve the current branch: `branch=$(git branch --show-current)`. If empty (detached HEAD), print an error and exit — detached-HEAD state is not supported; commits made in a detached-HEAD worktree would not advance the branch.
3. Create a unique worktree path: `wt=$(mktemp -d "/tmp/sv-${padded_phase}-reviewfix-XXXXXX")`. The `mktemp` suffix ensures concurrent runs for the same phase do not collide.
4. Run `git worktree add "$wt" "$branch"` — this attaches the worktree to the current branch so commits advance it.
5. All subsequent file reads, edits, and commits happen inside `$wt`.

**If `git worktree add` fails**, surface the error and exit — do not force-remove the path, as another concurrent run may be holding it.

**Cleanup (ALWAYS — even on failure):** After writing REVIEW-FIX.md and before returning to the orchestrator, run:
```bash
git worktree remove "$wt" --force
```

This cleanup is unconditional — register it mentally as a finally-block obligation. If the agent exits early (config error, no findings, etc.), still run `git worktree remove "$wt" --force` before exit.
</step>

<step name="load_context">
**1. read mandatory files:** Load all files from `<required_reading>` block if present.

Expand All @@ -240,7 +273,7 @@ If status is `"clean"` or `"skipped"`:
- Exit code 0 (not an error, just nothing to do)

**5. Load project context:**
read `./AGENTS.md` and check for `.OpenCode/skills/` or `.agents/skills/` (as described in `<project_context>`).
read `./AGENTS.md` and check for `.claude/skills/` or `.agents/skills/` (as described in `<project_context>`).
</step>

<step name="parse_findings">
Expand Down Expand Up @@ -444,6 +477,8 @@ _Iteration: {N}_

<critical_rules>

**ALWAYS run inside the isolated worktree** — set up via `branch=$(git branch --show-current)` + `wt=$(mktemp -d "/tmp/sv-${padded_phase}-reviewfix-XXXXXX")` + `git worktree add "$wt" "$branch"` at the very start (see `setup_worktree` step). Using `mktemp` ensures concurrent runs do not collide. Attaching to `$branch` (not `HEAD`) ensures commits advance the branch. Every file read, edit, and commit must happen inside `$wt`. Run `git worktree remove "$wt" --force` unconditionally when done (treat it as a finally block). If `git worktree add` fails, exit with an error rather than force-removing a path another run may hold. This prevents racing the foreground session on the shared main working tree (#2686).

**ALWAYS use the write tool to create files** — never use `bash(cat << 'EOF')` or heredoc commands for file creation.

**DO read the actual source file** before applying any fix — never blindly apply REVIEW.md suggestions without understanding current code state.
Expand Down
Loading
Loading