diff --git a/agents/gsd-debug-session-manager.md b/agents/gsd-debug-session-manager.md index 24455e580..9d1a1c148 100644 --- a/agents/gsd-debug-session-manager.md +++ b/agents/gsd-debug-session-manager.md @@ -1,7 +1,7 @@ --- name: gsd-debug-session-manager description: Manages multi-cycle /gsd-debug checkpoint and continuation loop in isolated context. Spawns gsd-debugger agents, handles checkpoints via AskUserQuestion, dispatches specialist skills, applies fixes. Returns compact summary to main context. Spawned by /gsd-debug command. -tools: Read, Write, Bash, Grep, Glob, Task, AskUserQuestion +tools: Read, Write, Bash, Grep, Glob, Agent, AskUserQuestion color: orange # hooks: # PostToolUse: diff --git a/commands/gsd/add-tests.md b/commands/gsd/add-tests.md index 128c30ba9..11f93c631 100644 --- a/commands/gsd/add-tests.md +++ b/commands/gsd/add-tests.md @@ -9,7 +9,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion argument-instructions: | Parse the argument as a phase number (integer, decimal, or letter-suffix), plus optional free-text instructions. diff --git a/commands/gsd/ai-integration-phase.md b/commands/gsd/ai-integration-phase.md index 95dca04f5..f35932bfc 100644 --- a/commands/gsd/ai-integration-phase.md +++ b/commands/gsd/ai-integration-phase.md @@ -8,7 +8,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - WebFetch - WebSearch - AskUserQuestion diff --git a/commands/gsd/audit-milestone.md b/commands/gsd/audit-milestone.md index 05a445d2f..3f83605ea 100644 --- a/commands/gsd/audit-milestone.md +++ b/commands/gsd/audit-milestone.md @@ -7,7 +7,7 @@ allowed-tools: - Glob - Grep - Bash - - Task + - Agent - Write --- diff --git a/commands/gsd/autonomous.md b/commands/gsd/autonomous.md index 38d97c4a8..ae2b76dc3 100644 --- a/commands/gsd/autonomous.md +++ b/commands/gsd/autonomous.md @@ -9,7 +9,6 @@ allowed-tools: - Glob - Grep - AskUserQuestion - - Task - Agent --- diff --git a/commands/gsd/code-review.md b/commands/gsd/code-review.md index 1ec71d4f7..7d1484776 100644 --- a/commands/gsd/code-review.md +++ b/commands/gsd/code-review.md @@ -8,7 +8,7 @@ allowed-tools: - Glob - Grep - Write - - Task + - Agent --- Review source files changed during a phase for bugs, security vulnerabilities, and code quality problems. diff --git a/commands/gsd/debug.md b/commands/gsd/debug.md index 08416d9b9..1fefac827 100644 --- a/commands/gsd/debug.md +++ b/commands/gsd/debug.md @@ -6,7 +6,7 @@ allowed-tools: - Read - Write - Bash - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/discuss-phase.md b/commands/gsd/discuss-phase.md index 2a59027fc..d254e1452 100644 --- a/commands/gsd/discuss-phase.md +++ b/commands/gsd/discuss-phase.md @@ -9,7 +9,7 @@ allowed-tools: - Glob - Grep - AskUserQuestion - - Task + - Agent - mcp__context7__resolve-library-id - mcp__context7__query-docs --- diff --git a/commands/gsd/docs-update.md b/commands/gsd/docs-update.md index 0aebdad6b..238a7d210 100644 --- a/commands/gsd/docs-update.md +++ b/commands/gsd/docs-update.md @@ -9,7 +9,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/eval-review.md b/commands/gsd/eval-review.md index 3e1791d90..b8c524548 100644 --- a/commands/gsd/eval-review.md +++ b/commands/gsd/eval-review.md @@ -8,7 +8,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/execute-phase.md b/commands/gsd/execute-phase.md index 831539e5d..a2fcfa5d7 100644 --- a/commands/gsd/execute-phase.md +++ b/commands/gsd/execute-phase.md @@ -9,7 +9,7 @@ allowed-tools: - Glob - Grep - Bash - - Task + - Agent - TodoWrite - AskUserQuestion --- diff --git a/commands/gsd/explore.md b/commands/gsd/explore.md index 411fc409e..72fe13cdd 100644 --- a/commands/gsd/explore.md +++ b/commands/gsd/explore.md @@ -7,7 +7,7 @@ allowed-tools: - Bash - Grep - Glob - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/import.md b/commands/gsd/import.md index ccb91a01b..351d3b332 100644 --- a/commands/gsd/import.md +++ b/commands/gsd/import.md @@ -10,7 +10,7 @@ allowed-tools: - Glob - Grep - AskUserQuestion - - Task + - Agent --- diff --git a/commands/gsd/ingest-docs.md b/commands/gsd/ingest-docs.md index 0d3eeadfe..3d8b146fa 100644 --- a/commands/gsd/ingest-docs.md +++ b/commands/gsd/ingest-docs.md @@ -10,7 +10,7 @@ allowed-tools: - Glob - Grep - AskUserQuestion - - Task + - Agent --- diff --git a/commands/gsd/manager.md b/commands/gsd/manager.md index 24fab8bab..24bf9923a 100644 --- a/commands/gsd/manager.md +++ b/commands/gsd/manager.md @@ -10,7 +10,7 @@ allowed-tools: - Grep - AskUserQuestion - Skill - - Task + - Agent --- Single-terminal command center for managing a milestone. Shows a dashboard of all phases with visual status indicators, recommends optimal next actions, and dispatches work — discuss runs inline, plan/execute run as background agents. diff --git a/commands/gsd/map-codebase.md b/commands/gsd/map-codebase.md index 68dedd72a..967987ef3 100644 --- a/commands/gsd/map-codebase.md +++ b/commands/gsd/map-codebase.md @@ -8,7 +8,7 @@ allowed-tools: - Glob - Grep - Write - - Task + - Agent --- diff --git a/commands/gsd/new-milestone.md b/commands/gsd/new-milestone.md index 7c30b0465..855d511a3 100644 --- a/commands/gsd/new-milestone.md +++ b/commands/gsd/new-milestone.md @@ -6,7 +6,7 @@ allowed-tools: - Read - Write - Bash - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/new-project.md b/commands/gsd/new-project.md index 6f9e1d211..98eaead55 100644 --- a/commands/gsd/new-project.md +++ b/commands/gsd/new-project.md @@ -6,7 +6,7 @@ allowed-tools: - Read - Bash - Write - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/plan-phase.md b/commands/gsd/plan-phase.md index 4457dc34f..cb22c2462 100644 --- a/commands/gsd/plan-phase.md +++ b/commands/gsd/plan-phase.md @@ -9,7 +9,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion - WebFetch - mcp__context7__* diff --git a/commands/gsd/profile-user.md b/commands/gsd/profile-user.md index 97a6d3ecb..4b14beaef 100644 --- a/commands/gsd/profile-user.md +++ b/commands/gsd/profile-user.md @@ -9,7 +9,7 @@ allowed-tools: - Glob - Grep - AskUserQuestion - - Task + - Agent --- diff --git a/commands/gsd/quick.md b/commands/gsd/quick.md index fb3113a41..47fc48ae3 100644 --- a/commands/gsd/quick.md +++ b/commands/gsd/quick.md @@ -9,7 +9,7 @@ allowed-tools: - Glob - Grep - Bash - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/secure-phase.md b/commands/gsd/secure-phase.md index 7ebe1ee8a..7ab7d2c46 100644 --- a/commands/gsd/secure-phase.md +++ b/commands/gsd/secure-phase.md @@ -9,7 +9,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/ui-phase.md b/commands/gsd/ui-phase.md index bf0469276..83335c33e 100644 --- a/commands/gsd/ui-phase.md +++ b/commands/gsd/ui-phase.md @@ -8,7 +8,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - WebFetch - AskUserQuestion - mcp__context7__* diff --git a/commands/gsd/ui-review.md b/commands/gsd/ui-review.md index 0f228f24f..c2b3c942b 100644 --- a/commands/gsd/ui-review.md +++ b/commands/gsd/ui-review.md @@ -8,7 +8,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/validate-phase.md b/commands/gsd/validate-phase.md index 279d23a14..7029e4c9e 100644 --- a/commands/gsd/validate-phase.md +++ b/commands/gsd/validate-phase.md @@ -9,7 +9,7 @@ allowed-tools: - Bash - Glob - Grep - - Task + - Agent - AskUserQuestion --- diff --git a/commands/gsd/verify-work.md b/commands/gsd/verify-work.md index d64d2b29a..2e5dd2883 100644 --- a/commands/gsd/verify-work.md +++ b/commands/gsd/verify-work.md @@ -9,7 +9,7 @@ allowed-tools: - Grep - Edit - Write - - Task + - Agent --- Validate built features through conversational testing with persistent state. diff --git a/get-shit-done/workflows/audit-fix.md b/get-shit-done/workflows/audit-fix.md index 7ee07670f..86c6447f9 100644 --- a/get-shit-done/workflows/audit-fix.md +++ b/get-shit-done/workflows/audit-fix.md @@ -95,13 +95,13 @@ For each **auto-fixable** finding (up to `--max`, ordered by severity desc): **a. Spawn executor agent:** ``` -Task( +Agent( prompt="Fix finding {ID}: {description}. Files: {file_refs}. Make the minimal change to resolve this specific finding. Do not refactor surrounding code.", subagent_type="gsd-executor" ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **b. Run tests:** ```bash diff --git a/get-shit-done/workflows/audit-milestone.md b/get-shit-done/workflows/audit-milestone.md index 715c4c21d..4e7d93831 100644 --- a/get-shit-done/workflows/audit-milestone.md +++ b/get-shit-done/workflows/audit-milestone.md @@ -67,7 +67,7 @@ With phase context collected: Extract `MILESTONE_REQ_IDS` from REQUIREMENTS.md traceability table — all REQ-IDs assigned to phases in this milestone. ``` -Task( +Agent( prompt="Check cross-phase integration and E2E flows. Phases: {phase_dirs} @@ -86,7 +86,7 @@ ${AGENT_SKILLS_CHECKER}", ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ## 4. Collect Results diff --git a/get-shit-done/workflows/code-review-fix.md b/get-shit-done/workflows/code-review-fix.md index 46a75215e..27e8b5656 100644 --- a/get-shit-done/workflows/code-review-fix.md +++ b/get-shit-done/workflows/code-review-fix.md @@ -186,10 +186,10 @@ echo "Applying fixes from ${REVIEW_PATH}..." echo "Fix scope: ${FIX_SCOPE}" ``` -Use Task() to spawn agent: +Use Agent() to spawn agent: ``` -Task(subagent_type="gsd-code-fixer", prompt=" +Agent(subagent_type="gsd-code-fixer", prompt=" ${REVIEW_PATH} @@ -207,11 +207,11 @@ Read REVIEW.md findings, apply fixes, commit each atomically, write REVIEW-FIX.m ") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Agent failure handling:** -If Task() fails: +If Agent() fails: ``` Error: Code fix agent failed: ${error_message} ``` @@ -272,7 +272,7 @@ if [ "$AUTO_MODE" = "true" ]; then # Spawn gsd-code-reviewer agent to re-review # (This overwrites REVIEW_PATH with latest review state) - Task(subagent_type="gsd-code-reviewer", prompt=" + Agent(subagent_type="gsd-code-reviewer", prompt=" depth: ${REVIEW_DEPTH} phase_dir: ${PHASE_DIR} @@ -283,7 +283,7 @@ ${FILES_CONFIG} Re-review the phase at ${REVIEW_DEPTH} depth. Write findings to ${REVIEW_PATH}. Do NOT commit the output — the orchestrator handles that. ") - # ORCHESTRATOR RULE — CODEX RUNTIME: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result before proceeding. + # ORCHESTRATOR RULE — CODEX RUNTIME: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result before proceeding. # Check new REVIEW.md status NEW_STATUS=$(REVIEW_PATH="${REVIEW_PATH}" node -e " @@ -306,7 +306,7 @@ Do NOT commit the output — the orchestrator handles that. # Still has issues — spawn fixer again echo "Issues remain. Applying fixes for iteration ${ITERATION}..." - Task(subagent_type="gsd-code-fixer", prompt=" + Agent(subagent_type="gsd-code-fixer", prompt=" ${REVIEW_PATH} @@ -322,7 +322,7 @@ iteration: ${ITERATION} Read REVIEW.md findings, apply fixes, commit each atomically, write REVIEW-FIX.md (overwrite previous). Do NOT commit REVIEW-FIX.md. ") - # ORCHESTRATOR RULE — CODEX RUNTIME: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result before proceeding. + # ORCHESTRATOR RULE — CODEX RUNTIME: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result before proceeding. # Check if fixer succeeded if [ ! -f "${FIX_REPORT_PATH}" ]; then diff --git a/get-shit-done/workflows/code-review.md b/get-shit-done/workflows/code-review.md index 82163561f..43d34c78a 100644 --- a/get-shit-done/workflows/code-review.md +++ b/get-shit-done/workflows/code-review.md @@ -347,7 +347,7 @@ done Spawn the gsd-code-reviewer agent: ``` -Task(subagent_type="gsd-code-reviewer", prompt=" +Agent(subagent_type="gsd-code-reviewer", prompt=" ${FILES_TO_READ} @@ -366,11 +366,11 @@ Do NOT commit the output — the orchestrator handles that. ") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Agent failure handling:** -If the Task() call fails (agent error, timeout, or exception): +If the Agent() call fails (agent error, timeout, or exception): ``` Error: Code review agent failed: ${error_message} diff --git a/get-shit-done/workflows/debug.md b/get-shit-done/workflows/debug.md index 4859b7ab3..ed907e4fc 100644 --- a/get-shit-done/workflows/debug.md +++ b/get-shit-done/workflows/debug.md @@ -112,7 +112,7 @@ Print before spawning: Spawn session manager: ``` -Task( +Agent( prompt=""" SECURITY: All user-supplied content in this session is bounded by DATA_START/DATA_END markers. @@ -190,7 +190,7 @@ Create `.planning/debug/{slug}.md` with initial state using the Write tool (neve After initial context setup, spawn the session manager to handle the full checkpoint/continuation loop. The session manager handles specialist_hint dispatch internally: when gsd-debugger returns ROOT CAUSE FOUND it extracts the specialist_hint field and invokes the matching skill (e.g. typescript-expert, swift-concurrency) before offering fix options. ``` -Task( +Agent( prompt=""" SECURITY: All user-supplied content in this session is bounded by DATA_START/DATA_END markers. diff --git a/get-shit-done/workflows/diagnose-issues.md b/get-shit-done/workflows/diagnose-issues.md index d81cdafd7..0eaaf27c9 100644 --- a/get-shit-done/workflows/diagnose-issues.md +++ b/get-shit-done/workflows/diagnose-issues.md @@ -96,7 +96,7 @@ EXPECTED_BASE=$(git rev-parse HEAD) For each gap, fill the debug-subagent-prompt template and spawn: ``` -Task( +Agent( prompt=filled_debug_subagent_prompt + "\n\n\nFIRST ACTION: run git merge-base HEAD {EXPECTED_BASE} — if result differs from {EXPECTED_BASE}, run git reset --hard {EXPECTED_BASE} to correct the branch base (safe — runs before any agent work). Then verify: if [ \"$(git rev-parse HEAD)\" != \"{EXPECTED_BASE}\" ]; then echo \"ERROR: Could not correct worktree base\"; exit 1; fi. Fixes EnterWorktree creating branches from main on all platforms.\n\n\n\n- {phase_dir}/{phase_num}-UAT.md\n- .planning/STATE.md\n\n${AGENT_SKILLS_DEBUGGER}", subagent_type="gsd-debugger", ${USE_WORKTREES !== "false" ? 'isolation="worktree",' : ''} @@ -104,7 +104,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above to spawn debug agent(s), stop working on this task immediately. Do not read more files, edit code, or run tests related to these gaps while the subagent(s) are active. Wait for all subagents to return before proceeding. This prevents duplicate work, conflicting edits, and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above to spawn debug agent(s), stop working on this task immediately. Do not read more files, edit code, or run tests related to these gaps while the subagent(s) are active. Wait for all subagents to return before proceeding. This prevents duplicate work, conflicting edits, and wasted context. **All agents spawn in single message** (parallel execution). diff --git a/get-shit-done/workflows/discuss-phase-assumptions.md b/get-shit-done/workflows/discuss-phase-assumptions.md index 211b0b632..63446cd75 100644 --- a/get-shit-done/workflows/discuss-phase-assumptions.md +++ b/get-shit-done/workflows/discuss-phase-assumptions.md @@ -254,7 +254,7 @@ If no USER-PROFILE.md: calibration_tier = "standard" **Spawn Explore subagent:** ``` -Task(subagent_type="gsd-assumptions-analyzer", prompt=""" +Agent(subagent_type="gsd-assumptions-analyzer", prompt=""" Analyze the codebase for Phase {PHASE}: {phase_name}. Phase goal: {roadmap_description} @@ -294,7 +294,7 @@ ${AGENT_SKILLS_ANALYZER} """) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, analyze the codebase, or process assumptions while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, analyze the codebase, or process assumptions while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Parse the subagent's response. Extract: - `assumptions[]` — each with area, statement, evidence, consequence, confidence @@ -312,7 +312,7 @@ Parse the subagent's response. Extract: If research topics were flagged, spawn a general-purpose research agent: ``` -Task(subagent_type="general-purpose", prompt=""" +Agent(subagent_type="general-purpose", prompt=""" Research the following topics for Phase {PHASE}: {phase_name}. Topics needing research: @@ -327,7 +327,7 @@ Use Context7 (resolve-library-id then query-docs) for library-specific questions Use WebSearch for ecosystem/best-practice questions. """) -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not independently research any of these topics while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not independently research any of these topics while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work and wasted context. Only resume when the subagent result is available. ``` Merge findings back into assumptions: diff --git a/get-shit-done/workflows/discuss-phase/modes/advisor.md b/get-shit-done/workflows/discuss-phase/modes/advisor.md index b9a9a28ed..961256dcd 100644 --- a/get-shit-done/workflows/discuss-phase/modes/advisor.md +++ b/get-shit-done/workflows/discuss-phase/modes/advisor.md @@ -87,10 +87,10 @@ research agents. 1. Display brief status: `Researching {N} areas...` -2. For EACH user-selected gray area, spawn a `Task()` in parallel: +2. For EACH user-selected gray area, spawn a `Agent()` in parallel: ``` - Task( + Agent( prompt="First, read @~/.claude/agents/gsd-advisor-researcher.md for your role and instructions. {area_name}: {area_description from gray area identification} @@ -106,10 +106,10 @@ research agents. ) ``` - All `Task()` calls spawn simultaneously — do NOT wait for one before + All `Agent()` calls spawn simultaneously — do NOT wait for one before starting the next. - > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all Task() calls above to spawn research agents, do NOT independently research or analyze any of the gray areas while the subagents are active. Wait for all subagents to return before synthesizing results. This prevents duplicate work and wasted context. + > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all Agent() calls above to spawn research agents, do NOT independently research or analyze any of the gray areas while the subagents are active. Wait for all subagents to return before synthesizing results. This prevents duplicate work and wasted context. 3. After ALL agents return, **synthesize results** before presenting: diff --git a/get-shit-done/workflows/docs-update.md b/get-shit-done/workflows/docs-update.md index 954c34809..2a1a42218 100644 --- a/get-shit-done/workflows/docs-update.md +++ b/get-shit-done/workflows/docs-update.md @@ -382,7 +382,7 @@ Use `run_in_background=true` for all three to enable parallel execution. **Agent 1: README** ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -404,7 +404,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Agent 2: ARCHITECTURE** ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -426,7 +426,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Agent 3: CONFIGURATION** ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -448,7 +448,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **CRITICAL:** Agent prompts must contain ONLY the `` block, the `${AGENT_SKILLS}` variable, and the return instruction. Do not include project planning context, workflow prose, or any internal tooling references in agent prompts. -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all Wave 1 Task() calls above with `run_in_background=true`, do NOT generate any documentation independently while the subagents are active. Wait for all Wave 1 agents to complete before proceeding. This prevents duplicate work and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all Wave 1 Agent() calls above with `run_in_background=true`, do NOT generate any documentation independently while the subagents are active. Wait for all Wave 1 agents to complete before proceeding. This prevents duplicate work and wasted context. Continue to collect_wave_1. @@ -511,7 +511,7 @@ Use `run_in_background=true` for all Wave 2 agents to enable parallel execution **Agent: GETTING-STARTED** ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -537,7 +537,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Agent: DEVELOPMENT** ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -563,7 +563,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Agent: TESTING** ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -589,7 +589,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Conditional Agent: API** (only if `has_api_routes` was true — spawn only if API.md was queued) ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -615,7 +615,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Conditional Agent: DEPLOYMENT** (only if `has_deploy_config` was true — spawn only if DEPLOYMENT.md was queued) ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -642,7 +642,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **Conditional Agent: CONTRIBUTING** (only if `is_open_source` was true — spawn only if CONTRIBUTING.md was queued) ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -667,7 +667,7 @@ Write the doc file directly. Return confirmation only — do not return doc cont **CRITICAL:** Agent prompts must contain ONLY the `` block, the `${AGENT_SKILLS}` variable, and the return instruction. Do not include project planning context, workflow prose, or any internal tooling references in agent prompts. -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all Wave 2 Task() calls above with `run_in_background=true`, do NOT generate any documentation independently while the subagents are active. Wait for all Wave 2 agents to complete before proceeding. This prevents duplicate work and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all Wave 2 Agent() calls above with `run_in_background=true`, do NOT generate any documentation independently while the subagents are active. Wait for all Wave 2 agents to complete before proceeding. This prevents duplicate work and wasted context. Continue to collect_wave_2. @@ -731,7 +731,7 @@ Determine mode: Spawn a `gsd-doc-writer` agent with `run_in_background=true`: ``` -Task( +Agent( subagent_type="gsd-doc-writer", model="{doc_writer_model}", run_in_background=true, @@ -751,7 +751,7 @@ Write {package_dir}/README.md directly. Return confirmation only — do not retu ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all per-package Task() calls above with `run_in_background=true`, do NOT generate any package READMEs independently while the subagents are active. Wait for all agents to complete via TaskOutput before proceeding. This prevents duplicate work and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all per-package Agent() calls above with `run_in_background=true`, do NOT generate any package READMEs independently while the subagents are active. Wait for all agents to complete via TaskOutput before proceeding. This prevents duplicate work and wasted context. Collect confirmations via TaskOutput for all package agents. Note failures in the final report. diff --git a/get-shit-done/workflows/execute-phase.md b/get-shit-done/workflows/execute-phase.md index 23e45b6a7..704e2111e 100644 --- a/get-shit-done/workflows/execute-phase.md +++ b/get-shit-done/workflows/execute-phase.md @@ -8,7 +8,7 @@ Orchestrator coordinates, not executes. Each subagent loads the full execute-pla **Subagent spawning is runtime-specific:** -- **Claude Code:** Uses `Task(subagent_type="gsd-executor", ...)` — blocks until complete, returns result +- **Claude Code:** Uses `Agent(subagent_type="gsd-executor", ...)` — blocks until complete, returns result - **Copilot:** Subagent spawning does not reliably return completion signals. **Default to sequential inline execution**: read and follow execute-plan.md directly for each plan instead of spawning parallel agents. Only attempt parallel spawning if the user @@ -73,7 +73,7 @@ AGENT_SKILLS=$(gsd-sdk query agent-skills gsd-executor) Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `phase_req_ids`, `response_language`. -**Model resolution:** If `executor_model` is `"inherit"`, omit the `model=` parameter from all `Task()` calls — do NOT pass `model="inherit"` to Task. Omitting the `model=` parameter causes Claude Code to inherit the current orchestrator model automatically. Only set `model=` when `executor_model` is an explicit model name (e.g., `"claude-sonnet-4-6"`, `"claude-opus-4-7"`). +**Model resolution:** If `executor_model` is `"inherit"`, omit the `model=` parameter from all `Agent()` calls — do NOT pass `model="inherit"` to Task. Omitting the `model=` parameter causes Claude Code to inherit the current orchestrator model automatically. Only set `model=` when `executor_model` is an explicit model name (e.g., `"claude-sonnet-4-6"`, `"claude-opus-4-7"`). **If `response_language` is set:** Include `response_language: {value}` in all spawned subagent prompts so any user-facing output stays in the configured language. @@ -124,7 +124,7 @@ When `parallelization` is false, plans within a wave execute sequentially. **Runtime detection for Copilot:** Check if the current runtime is Copilot by testing for the `@gsd-executor` agent pattern -or absence of the `Task()` subagent API. If running under Copilot, force sequential inline +or absence of the `Agent()` subagent API. If running under Copilot, force sequential inline execution regardless of the `parallelization` setting — Copilot's subagent completion signals are unreliable (see ``). Set `COPILOT_SEQUENTIAL=true` internally and skip the `execute_waves` step in favor of `check_interactive_mode`'s @@ -455,7 +455,7 @@ increases monotonically across waves. `{status}` is `complete` (success), 3. **Spawn executor agents:** **Emit a plan-start heartbeat (literal line, no tool call) immediately before - each `Task()` dispatch (#2410):** + each `Agent()` dispatch (#2410):** ``` [checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} starting ({P}/{Q} plans done) @@ -473,7 +473,7 @@ increases monotonically across waves. `{status}` is `complete` (success), ``` **Sequential dispatch for parallel execution (waves with 2+ agents):** - When spawning multiple agents in a wave, dispatch each `Task()` call **one at a time + When spawning multiple agents in a wave, dispatch each `Agent()` call **one at a time with `run_in_background: true`** — do NOT send all Task calls in a single message. `git worktree add` acquires an exclusive lock on `.git/config.lock`, so simultaneous calls race for this lock and fail. Sequential dispatch ensures each worktree finishes @@ -481,15 +481,15 @@ increases monotonically across waves. `{status}` is `complete` (success), natural spacing), while all agents still **run in parallel** once created. ``` - # CORRECT: dispatch one Task() per message, each with run_in_background: true + # CORRECT: dispatch one Agent() per message, each with run_in_background: true # → worktrees created sequentially, agents execute in parallel # - # WRONG: multiple Task() calls in a single message + # WRONG: multiple Agent() calls in a single message # → simultaneous git worktree add → .git/config.lock contention → failures ``` ``` - Task( + Agent( subagent_type="gsd-executor", description="Execute plan {plan_number} of phase {phase_number}", # Only include model= when executor_model is an explicit model name. @@ -593,7 +593,7 @@ increases monotonically across waves. `{status}` is `complete` (success), ) ``` - > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above to spawn executor agent(s), stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. + > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above to spawn executor agent(s), stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Sequential mode** (`USE_WORKTREES_FOR_PLAN` is `false` — either project-level `USE_WORKTREES=false`, or per-plan submodule intersection forced it false in step 2.5): @@ -633,7 +633,7 @@ increases monotonically across waves. `{status}` is `complete` (success), [checkpoint] phase {PHASE_NUMBER} wave {N}/{M} plan {plan_id} checkpoint ({P}/{Q} plans done) ``` - **Completion signal fallback (Copilot and runtimes where Task() may not return):** + **Completion signal fallback (Copilot and runtimes where Agent() may not return):** If a spawned agent does not return a completion signal but appears to have finished its work, do NOT block indefinitely. Instead, verify completion via spot-checks: @@ -652,7 +652,7 @@ increases monotonically across waves. `{status}` is `complete` (success), activity. If commits are still appearing, wait longer. If no activity, report the plan as failed and route to the failure handler in step 6. - **This fallback applies automatically to all runtimes.** Claude Code's Task() normally + **This fallback applies automatically to all runtimes.** Claude Code's Agent() normally returns synchronously, but the fallback ensures resilience if it doesn't. 5. **Post-wave hook validation (parallel mode only):** Hooks run on every executor commit by default (#2924); this post-wave run only fires when `workflow.worktree_skip_hooks=true` opted out of per-commit hooks: @@ -1354,7 +1354,7 @@ VERIFIER_SKILLS=$(gsd-sdk query agent-skills gsd-verifier) ``` ``` -Task( +Agent( description="Verify phase {phase_number} goal achievement", prompt="Verify phase {phase_number} goal achievement. Phase directory: {phase_dir} @@ -1381,7 +1381,7 @@ ${VERIFIER_SKILLS}", ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Read status: ```bash diff --git a/get-shit-done/workflows/execute-phase/steps/codebase-drift-gate.md b/get-shit-done/workflows/execute-phase/steps/codebase-drift-gate.md index ce13ec7f3..3b6bb942b 100644 --- a/get-shit-done/workflows/execute-phase/steps/codebase-drift-gate.md +++ b/get-shit-done/workflows/execute-phase/steps/codebase-drift-gate.md @@ -51,7 +51,7 @@ AGENT_SKILLS_MAPPER=$(gsd-sdk query agent-skills gsd-codebase-mapper) Then spawn `gsd-codebase-mapper` agents with the `--paths` hint: ```text -Task( +Agent( subagent_type="gsd-codebase-mapper", description="Incremental codebase remap (drift)", prompt="Focus: arch @@ -64,7 +64,7 @@ ${AGENT_SKILLS_MAPPER}" ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. If the spawn fails or the agent reports an error: log `Codebase drift auto-remap failed: {reason}` and continue to `verify_phase_goal`. The phase diff --git a/get-shit-done/workflows/execute-phase/steps/per-plan-worktree-gate.md b/get-shit-done/workflows/execute-phase/steps/per-plan-worktree-gate.md index 49a60a501..d5c93ca9c 100644 --- a/get-shit-done/workflows/execute-phase/steps/per-plan-worktree-gate.md +++ b/get-shit-done/workflows/execute-phase/steps/per-plan-worktree-gate.md @@ -1,6 +1,6 @@ # Per-plan worktree decision (#2772) -Run this for **each plan in the current wave** before its `Task()` dispatch. The output `USE_WORKTREES_FOR_PLAN` gates the dispatch branch (worktree mode vs sequential mode) for that plan only — other plans in the same wave can still take the worktree path. +Run this for **each plan in the current wave** before its `Agent()` dispatch. The output `USE_WORKTREES_FOR_PLAN` gates the dispatch branch (worktree mode vs sequential mode) for that plan only — other plans in the same wave can still take the worktree path. `SUBMODULE_PATHS` is computed once in the `initialize` step (parsed from `.gitmodules`). diff --git a/get-shit-done/workflows/execute-plan.md b/get-shit-done/workflows/execute-plan.md index 4a39dc457..ddefce0c5 100644 --- a/get-shit-done/workflows/execute-plan.md +++ b/get-shit-done/workflows/execute-plan.md @@ -81,7 +81,7 @@ Otherwise: Apply checkpoint-based routing below. | Verify-only | B (segmented) | Segments between checkpoints. After none/human-verify → SUBAGENT. After decision/human-action → MAIN | | Decision | C (main) | Execute entirely in main context | -**Pattern A:** init_agent_tracking → capture `EXPECTED_BASE=$(git rev-parse HEAD)` → spawn Task(subagent_type="gsd-executor", model=executor_model) with prompt: execute plan at [path], autonomous, all tasks + SUMMARY + commit, follow deviation/auth rules, report: plan name, tasks, SUMMARY path, commit hash → track agent_id → wait → update tracking → report. **Include `isolation="worktree"` only if `workflow.use_worktrees` is not `false`** (read via `config-get workflow.use_worktrees`). **When using `isolation="worktree"`, include a `` block in the prompt** instructing the executor to: (1) FIRST assert `git symbolic-ref HEAD` resolves to a per-agent branch (NOT a protected ref like `main`/`master`/`develop`/`trunk`/`release/*`) and HALT with a blocker if not — never self-recover via `git update-ref refs/heads/` (#2924); (2) only after that assertion passes, run `git merge-base HEAD {EXPECTED_BASE}` and, if the result differs from `{EXPECTED_BASE}`, hard-reset the branch with `git reset --hard {EXPECTED_BASE}` before starting work, then verify with `[ "$(git rev-parse HEAD)" != "{EXPECTED_BASE}" ] && exit 1`. The HEAD assertion (Step 1) MUST run before any reset/checkout. This corrects a known issue where `EnterWorktree` creates branches from `main` instead of the feature branch HEAD (affects all platforms — #2015) and prevents the destructive HEAD-on-master self-recovery path (#2924). +**Pattern A:** init_agent_tracking → capture `EXPECTED_BASE=$(git rev-parse HEAD)` → spawn Agent(subagent_type="gsd-executor", model=executor_model) with prompt: execute plan at [path], autonomous, all tasks + SUMMARY + commit, follow deviation/auth rules, report: plan name, tasks, SUMMARY path, commit hash → track agent_id → wait → update tracking → report. **Include `isolation="worktree"` only if `workflow.use_worktrees` is not `false`** (read via `config-get workflow.use_worktrees`). **When using `isolation="worktree"`, include a `` block in the prompt** instructing the executor to: (1) FIRST assert `git symbolic-ref HEAD` resolves to a per-agent branch (NOT a protected ref like `main`/`master`/`develop`/`trunk`/`release/*`) and HALT with a blocker if not — never self-recover via `git update-ref refs/heads/` (#2924); (2) only after that assertion passes, run `git merge-base HEAD {EXPECTED_BASE}` and, if the result differs from `{EXPECTED_BASE}`, hard-reset the branch with `git reset --hard {EXPECTED_BASE}` before starting work, then verify with `[ "$(git rev-parse HEAD)" != "{EXPECTED_BASE}" ] && exit 1`. The HEAD assertion (Step 1) MUST run before any reset/checkout. This corrects a known issue where `EnterWorktree` creates branches from `main` instead of the feature branch HEAD (affects all platforms — #2015) and prevents the destructive HEAD-on-master self-recovery path (#2924). **Pattern B:** Execute segment-by-segment. Autonomous segments: spawn subagent for assigned tasks only (no SUMMARY/commit). Checkpoints: main context. After all segments: aggregate, create SUMMARY, commit. See segment_execution. diff --git a/get-shit-done/workflows/explore.md b/get-shit-done/workflows/explore.md index 622bef15b..9fb4bd047 100644 --- a/get-shit-done/workflows/explore.md +++ b/get-shit-done/workflows/explore.md @@ -60,13 +60,13 @@ This would take ~30 seconds and might surface useful context. If yes, spawn a research agent: ``` -Task( +Agent( prompt="Quick research: {specific_question}. Return 3-5 key findings, no more than 200 words.", subagent_type="gsd-phase-researcher" ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Share findings and continue the conversation. diff --git a/get-shit-done/workflows/import.md b/get-shit-done/workflows/import.md index a6f99aa60..04f51e695 100644 --- a/get-shit-done/workflows/import.md +++ b/get-shit-done/workflows/import.md @@ -192,13 +192,13 @@ Write the PLAN.md file to the target directory. Delegate validation to gsd-plan-checker: ``` -Task({ +Agent({ subagent_type: "gsd-plan-checker", prompt: "Validate: .planning/phases/{phase}/{plan}-PLAN.md — check frontmatter completeness, task structure, and GSD conventions. Report any issues." }) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. If the checker returns errors: - Display the errors to the user diff --git a/get-shit-done/workflows/ingest-docs.md b/get-shit-done/workflows/ingest-docs.md index 1b8619703..1e48251e0 100644 --- a/get-shit-done/workflows/ingest-docs.md +++ b/get-shit-done/workflows/ingest-docs.md @@ -178,7 +178,7 @@ Collect the one-line confirmations from each classifier. If any classifier error Spawn `gsd-doc-synthesizer` once: ``` -Task({ +Agent({ subagent_type: "gsd-doc-synthesizer", prompt: " CLASSIFICATIONS_DIR: .planning/intel/classifications/ @@ -196,7 +196,7 @@ Task({ }) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read or synthesize any classified documents independently while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read or synthesize any classified documents independently while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. The synthesizer writes: - `.planning/intel/decisions.md`, `.planning/intel/requirements.md`, `.planning/intel/constraints.md`, `.planning/intel/context.md` @@ -245,7 +245,7 @@ Audit PROJECT.md field requirements that `gsd-roadmapper` expects. For fields de Delegate to `gsd-roadmapper`: ``` -Task({ +Agent({ subagent_type: "gsd-roadmapper", prompt: " Mode: new-project-from-ingest @@ -264,7 +264,7 @@ Task({ }) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more intel files, write planning artifacts, or create ROADMAP.md independently while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more intel files, write planning artifacts, or create ROADMAP.md independently while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. diff --git a/get-shit-done/workflows/manager.md b/get-shit-done/workflows/manager.md index ca1b891af..67ccd3460 100644 --- a/get-shit-done/workflows/manager.md +++ b/get-shit-done/workflows/manager.md @@ -244,7 +244,7 @@ After discuss completes, loop back to dashboard step. Planning runs autonomously. Spawn a background agent that delegates to the Skill pipeline with any configured flags: ``` -Task( +Agent( description="Plan phase {N}: {phase_name}", run_in_background=true, prompt="You are running the GSD plan-phase workflow for phase {N} of the project. @@ -263,7 +263,7 @@ Important: You are running in the background. Do NOT use AskUserQuestion — mak ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above with `run_in_background=true`, do NOT do any planning work for this phase independently. Return to the dashboard immediately and wait for the background agent to report back. Only resume planning-related work when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above with `run_in_background=true`, do NOT do any planning work for this phase independently. Return to the dashboard immediately and wait for the background agent to report back. Only resume planning-related work when the subagent result is available. Display: @@ -278,7 +278,7 @@ Loop back to dashboard step. Execution runs autonomously. Spawn a background agent that delegates to the Skill pipeline with any configured flags: ``` -Task( +Agent( description="Execute phase {N}: {phase_name}", run_in_background=true, prompt="You are running the GSD execute-phase workflow for phase {N} of the project. @@ -297,7 +297,7 @@ Important: You are running in the background. Do NOT use AskUserQuestion — mak ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above with `run_in_background=true`, do NOT do any execution work for this phase independently. Return to the dashboard immediately and wait for the background agent to report back. Only resume execution-related work when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above with `run_in_background=true`, do NOT do any execution work for this phase independently. Return to the dashboard immediately and wait for the background agent to report back. Only resume execution-related work when the subagent result is available. Display: diff --git a/get-shit-done/workflows/map-codebase.md b/get-shit-done/workflows/map-codebase.md index ca1fa8b9b..5bd4020e1 100644 --- a/get-shit-done/workflows/map-codebase.md +++ b/get-shit-done/workflows/map-codebase.md @@ -146,7 +146,7 @@ Use Task tool with `subagent_type="gsd-codebase-mapper"`, `model="{mapper_model} **Agent 1: Tech Focus** ``` -Task( +Agent( subagent_type="gsd-codebase-mapper", model="{mapper_model}", run_in_background=true, @@ -172,7 +172,7 @@ ${AGENT_SKILLS_MAPPER}" **Agent 2: Architecture Focus** ``` -Task( +Agent( subagent_type="gsd-codebase-mapper", model="{mapper_model}", run_in_background=true, @@ -198,7 +198,7 @@ ${AGENT_SKILLS_MAPPER}" **Agent 3: Quality Focus** ``` -Task( +Agent( subagent_type="gsd-codebase-mapper", model="{mapper_model}", run_in_background=true, @@ -224,7 +224,7 @@ ${AGENT_SKILLS_MAPPER}" **Agent 4: Concerns Focus** ``` -Task( +Agent( subagent_type="gsd-codebase-mapper", model="{mapper_model}", run_in_background=true, @@ -246,7 +246,7 @@ ${AGENT_SKILLS_MAPPER}" ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 Task() calls above with `run_in_background=true`, do NOT read any source files, analyze the codebase, or write any mapping documents independently while the subagents are active. Wait for all 4 agents to complete before proceeding to collect_confirmations. This prevents duplicate work and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 Agent() calls above with `run_in_background=true`, do NOT read any source files, analyze the codebase, or write any mapping documents independently while the subagents are active. Wait for all 4 agents to complete before proceeding to collect_confirmations. This prevents duplicate work and wasted context. Continue to collect_confirmations. diff --git a/get-shit-done/workflows/new-milestone.md b/get-shit-done/workflows/new-milestone.md index 2bc54825e..b106942d2 100644 --- a/get-shit-done/workflows/new-milestone.md +++ b/get-shit-done/workflows/new-milestone.md @@ -298,7 +298,7 @@ Spawn 4 parallel gsd-project-researcher agents. Each uses this template with dim **Common structure for all 4 researchers:** ``` -Task(prompt=" +Agent(prompt=" Project Research — {DIMENSION} for [new features]. @@ -336,12 +336,12 @@ Use template: ~/.claude/get-shit-done/templates/research-project/{FILE} | GATES | Versions current (verify with Context7), rationale explains WHY, integration considered | Categories clear, complexity noted, dependencies identified | Integration points identified, new vs modified explicit, build order considers deps | Pitfalls specific to adding these features, integration pitfalls covered, prevention actionable | | FILE | STACK.md | FEATURES.md | ARCHITECTURE.md | PITFALLS.md | -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 researcher Task() calls above, do NOT read research files or synthesize content independently while the subagents are active. Wait for all 4 researchers to complete before spawning the synthesizer. This prevents duplicate work and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 researcher Agent() calls above, do NOT read research files or synthesize content independently while the subagents are active. Wait for all 4 researchers to complete before spawning the synthesizer. This prevents duplicate work and wasted context. After all 4 complete, spawn synthesizer: ``` -Task(prompt=" +Agent(prompt=" Synthesize research outputs into SUMMARY.md. @@ -359,7 +359,7 @@ Commit after writing. ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Display key findings from SUMMARY.md: ``` @@ -462,7 +462,7 @@ gsd-sdk query commit "docs: define milestone v[X.Y] requirements" --files .plann - Otherwise, continue from the previous milestone's last phase number (v1.0 ended at phase 5 → v1.1 starts at phase 6) ``` -Task(prompt=" +Agent(prompt=" - .planning/PROJECT.md @@ -493,7 +493,7 @@ Write files first, then return. ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Handle return:** diff --git a/get-shit-done/workflows/new-project.md b/get-shit-done/workflows/new-project.md index 069041f74..9cc1bec11 100644 --- a/get-shit-done/workflows/new-project.md +++ b/get-shit-done/workflows/new-project.md @@ -755,7 +755,7 @@ Display spawning indicator: Spawn 4 parallel gsd-project-researcher agents with path references: ``` -Task(prompt=" +Agent(prompt=" Project Research — Stack dimension for [domain]. @@ -795,7 +795,7 @@ Use template: ~/.claude/get-shit-done/templates/research-project/STACK.md ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Stack research") -Task(prompt=" +Agent(prompt=" Project Research — Features dimension for [domain]. @@ -835,7 +835,7 @@ Use template: ~/.claude/get-shit-done/templates/research-project/FEATURES.md ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Features research") -Task(prompt=" +Agent(prompt=" Project Research — Architecture dimension for [domain]. @@ -875,7 +875,7 @@ Use template: ~/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Architecture research") -Task(prompt=" +Agent(prompt=" Project Research — Pitfalls dimension for [domain]. @@ -916,12 +916,12 @@ Use template: ~/.claude/get-shit-done/templates/research-project/PITFALLS.md ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Pitfalls research") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 researcher Task() calls above, do NOT read research files or synthesize content independently while the subagents are active. Wait for all 4 researchers to complete before spawning the synthesizer. This prevents duplicate work and wasted context. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 researcher Agent() calls above, do NOT read research files or synthesize content independently while the subagents are active. Wait for all 4 researchers to complete before spawning the synthesizer. This prevents duplicate work and wasted context. After all 4 agents complete, spawn synthesizer to create SUMMARY.md: ``` -Task(prompt=" +Agent(prompt=" Synthesize research outputs into SUMMARY.md. @@ -943,7 +943,7 @@ Commit after writing. ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Display research complete banner and key findings: @@ -1132,7 +1132,7 @@ Display stage banner: Spawn gsd-roadmapper agent with path references: ``` -Task(prompt=" +Agent(prompt=" @@ -1160,7 +1160,7 @@ Write files first, then return. This ensures artifacts persist even if context i ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap") ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Handle roadmapper return:** @@ -1231,7 +1231,7 @@ Use AskUserQuestion: - Re-spawn roadmapper with revision context: ``` - Task(prompt=" + Agent(prompt=" User feedback on roadmap: [user's notes] @@ -1248,7 +1248,7 @@ Use AskUserQuestion: ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Revise roadmap") ``` - > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. + > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. - Present revised roadmap - Loop until user approves diff --git a/get-shit-done/workflows/plan-phase.md b/get-shit-done/workflows/plan-phase.md index 21a7ffa8d..8c806dda9 100644 --- a/get-shit-done/workflows/plan-phase.md +++ b/get-shit-done/workflows/plan-phase.md @@ -423,7 +423,7 @@ Write to: {phase_dir}/{phase_num}-RESEARCH.md ``` ``` -Task( +Agent( prompt=research_prompt, subagent_type="gsd-phase-researcher", model="{researcher_model}", @@ -431,7 +431,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ### Handle Researcher Return @@ -738,14 +738,14 @@ Extract the list of files to be created/modified from CONTEXT.md and RESEARCH.md Spawn with: ``` -Task( +Agent( prompt="{above}", subagent_type="gsd-pattern-mapper", model="{researcher_model}", ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Handle return:** - **`## PATTERN MAPPING COMPLETE`:** Update `PATTERNS_PATH` to the created file path, continue to step 8. @@ -869,7 +869,7 @@ Every task MUST include these fields — they are NOT optional: **If `CHUNKED_MODE` is `false` (default):** Spawn the planner as a single long-lived Task: ``` -Task( +Agent( prompt=filled_prompt, subagent_type="gsd-planner", model="{planner_model}", @@ -877,9 +877,9 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. -**If `CHUNKED_MODE` is `true`:** Skip the Task() call above — proceed to step 8.5 instead. +**If `CHUNKED_MODE` is `true`:** Skip the Agent() call above — proceed to step 8.5 instead. ## 8.5. Chunked Planning Mode @@ -916,7 +916,7 @@ Spawn the planner in **outline-only** mode — it must write only the outline ma PLAN.md files: ```javascript -Task( +Agent( prompt="{same planning_context as step 8, plus:} **Chunked mode: outline-only.** @@ -933,7 +933,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Handle return: - **`## OUTLINE COMPLETE`:** Read `PLAN-OUTLINE.md`, extract plan list. Continue to 8.5.2. @@ -961,7 +961,7 @@ For each plan entry extracted from `PLAN-OUTLINE.md`: 3. Spawn the planner in **single-plan** mode — it must write exactly one PLAN.md file: ```javascript - Task( + Agent( prompt="{same planning_context as step 8, plus:} **Chunked mode: single-plan.** @@ -977,7 +977,7 @@ For each plan entry extracted from `PLAN-OUTLINE.md`: ) ``` - > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. + > **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. 4. **Verify disk:** Check `${PHASE_DIR}/{plan_id}-PLAN.md` exists. If missing: offer 1) Retry, 2) Stop. @@ -1000,13 +1000,13 @@ to step 9. ## 9a. Filesystem Fallback (Planner) -**Triggered when:** Task() returns but the return contains no recognized marker (`## PLANNING COMPLETE`, `## PHASE SPLIT RECOMMENDED`, `## ⚠ Source Audit`, `## CHECKPOINT REACHED`, `## PLANNING INCONCLUSIVE`). +**Triggered when:** Agent() returns but the return contains no recognized marker (`## PLANNING COMPLETE`, `## PHASE SPLIT RECOMMENDED`, `## ⚠ Source Audit`, `## CHECKPOINT REACHED`, `## PLANNING INCONCLUSIVE`). ```bash DISK_PLANS=$(ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null | wc -l | tr -d ' ') ``` -**If `DISK_PLANS` > 0:** The planner wrote plans to disk but the Task() return was empty or +**If `DISK_PLANS` > 0:** The planner wrote plans to disk but the Agent() return was empty or truncated (the Windows stdio hang pattern — the subagent finished but the return never arrived). Display: @@ -1127,7 +1127,7 @@ ${AGENT_SKILLS_CHECKER} ``` ``` -Task( +Agent( prompt=checker_prompt, subagent_type="gsd-plan-checker", model="{checker_model}", @@ -1135,7 +1135,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ## 11. Handle Checker Return @@ -1164,7 +1164,7 @@ If thinking_partner disabled: skip this block entirely. ## 11a. Filesystem Fallback (Checker) -**Triggered when:** Checker Task() returns but the return contains neither `## VERIFICATION PASSED` nor `## ISSUES FOUND`. +**Triggered when:** Checker Agent() returns but the return contains neither `## VERIFICATION PASSED` nor `## ISSUES FOUND`. ```bash DISK_PLANS=$(ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null | wc -l | tr -d ' ') @@ -1242,7 +1242,7 @@ Return what changed. ``` ``` -Task( +Agent( prompt=revision_prompt, subagent_type="gsd-planner", model="{planner_model}", @@ -1250,7 +1250,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. After planner returns -> spawn checker again (step 10), increment iteration_count. diff --git a/get-shit-done/workflows/quick.md b/get-shit-done/workflows/quick.md index cbb0b5d00..ead62d44a 100644 --- a/get-shit-done/workflows/quick.md +++ b/get-shit-done/workflows/quick.md @@ -402,7 +402,7 @@ Display banner: Spawn a single focused researcher (not 4 parallel researchers like full phases — quick tasks need targeted research, not broad domain surveys): ``` -Task( +Agent( prompt=" @@ -443,7 +443,7 @@ Return: ## RESEARCH COMPLETE with file path ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. After researcher returns: 1. Verify research exists at `${QUICK_DIR}/${quick_id}-RESEARCH.md` @@ -460,7 +460,7 @@ If research file not found, warn but continue: "Research agent did not produce o **If NOT `$VALIDATE_MODE`:** Use standard `quick` mode. ``` -Task( +Agent( prompt=" @@ -501,7 +501,7 @@ Return: ## PLANNING COMPLETE with plan path ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. After planner returns: 1. Verify plan exists at `${QUICK_DIR}/${quick_id}-PLAN.md` @@ -559,7 +559,7 @@ ${DISCUSS_MODE ? '- Context compliance: Does the plan honor locked decisions fro ``` ``` -Task( +Agent( prompt=checker_prompt, subagent_type="gsd-plan-checker", model="{checker_model}", @@ -567,7 +567,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. **Handle checker return:** @@ -606,7 +606,7 @@ Return what changed. ``` ``` -Task( +Agent( prompt=revision_prompt, subagent_type="gsd-planner", model="{planner_model}", @@ -614,7 +614,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. After planner returns → spawn checker again, increment iteration_count. @@ -668,7 +668,7 @@ EXPECTED_BASE=$(git rev-parse HEAD) Spawn gsd-executor with plan reference: ``` -Task( +Agent( prompt=" Execute quick task ${quick_id}. @@ -761,7 +761,7 @@ SUMMARY.md and stop — the user must rerun with worktrees disabled. ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. After executor returns: 1. **Worktree cleanup:** If the executor ran with `isolation="worktree"`, merge the worktree branch back and clean up: @@ -907,7 +907,7 @@ If `CHANGED_FILES` is empty, skip with "No source files changed — skipping cod **Invoke review:** ``` -Task( +Agent( prompt="Review these files for bugs, security issues, and code quality. Files: ${CHANGED_FILES} Output: ${QUICK_DIR}/${quick_id}-REVIEW.md @@ -917,7 +917,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. If review produces findings, display advisory message. **Error handling:** Failures are non-blocking — catch and proceed. @@ -937,7 +937,7 @@ Display banner: ``` ``` -Task( +Agent( prompt="Verify quick task goal achievement. Task directory: ${QUICK_DIR} Task goal: ${DESCRIPTION} @@ -955,7 +955,7 @@ Check must_haves against actual codebase. Create VERIFICATION.md at ${QUICK_DIR} ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Read verification status: ```bash diff --git a/get-shit-done/workflows/scan.md b/get-shit-done/workflows/scan.md index 823a3605b..3b4951ddd 100644 --- a/get-shit-done/workflows/scan.md +++ b/get-shit-done/workflows/scan.md @@ -72,14 +72,14 @@ mkdir -p .planning/codebase Spawn a single `gsd-codebase-mapper` agent with the selected focus area: ``` -Task( +Agent( prompt="Scan this codebase with focus: {focus}. Write results to .planning/codebase/. Produce only: {document_list}", subagent_type="gsd-codebase-mapper", model="{resolved_model}" ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ## Step 5: Report diff --git a/get-shit-done/workflows/secure-phase.md b/get-shit-done/workflows/secure-phase.md index 1a306ed83..6ad0a2a63 100644 --- a/get-shit-done/workflows/secure-phase.md +++ b/get-shit-done/workflows/secure-phase.md @@ -93,7 +93,7 @@ Call AskUserQuestion with threat table and options: - `register_authored_at_plan_time: false` (retroactive-STRIDE mode) — **Retroactive-STRIDE: build a STRIDE register from implementation files first, then verify mitigations.** The phase was authored before formal threat modelling; the auditor must construct the register from scratch before verifying. ``` -Task( +Agent( prompt="Read ~/.claude/agents/gsd-security-auditor.md for instructions.\n\n" + "{PLAN, SUMMARY, impl files, SECURITY.md}" + "{threat register}" + @@ -106,7 +106,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Handle return: - `## SECURED` → record closures → Step 6 diff --git a/get-shit-done/workflows/settings.md b/get-shit-done/workflows/settings.md index f029d61ef..aea40ceb1 100644 --- a/get-shit-done/workflows/settings.md +++ b/get-shit-done/workflows/settings.md @@ -186,7 +186,7 @@ AskUserQuestion([ multiSelect: false, options: [ { label: "No (Recommended)", description: "Manual /clear + paste between stages" }, - { label: "Yes", description: "Chain stages via Task() subagents (same isolation)" } + { label: "Yes", description: "Chain stages via Agent() subagents (same isolation)" } ] }, { diff --git a/get-shit-done/workflows/ui-phase.md b/get-shit-done/workflows/ui-phase.md index affa168e3..849f016b4 100644 --- a/get-shit-done/workflows/ui-phase.md +++ b/get-shit-done/workflows/ui-phase.md @@ -156,7 +156,7 @@ padded_phase: {padded_phase} Omit null file paths from ``. ``` -Task( +Agent( prompt=ui_research_prompt, subagent_type="gsd-ui-researcher", model="{UI_RESEARCHER_MODEL}", @@ -164,7 +164,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ## 6. Handle Researcher Return @@ -209,7 +209,7 @@ ui_safety_gate: {ui_safety_gate config value} ``` ``` -Task( +Agent( prompt=ui_checker_prompt, subagent_type="gsd-ui-checker", model="{UI_CHECKER_MODEL}", @@ -217,7 +217,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ## 8. Handle Checker Return diff --git a/get-shit-done/workflows/ui-review.md b/get-shit-done/workflows/ui-review.md index 31bdab71f..335653130 100644 --- a/get-shit-done/workflows/ui-review.md +++ b/get-shit-done/workflows/ui-review.md @@ -99,7 +99,7 @@ padded_phase: {padded_phase} Omit null file paths. ``` -Task( +Agent( prompt=ui_audit_prompt, subagent_type="gsd-ui-auditor", model="{UI_AUDITOR_MODEL}", @@ -107,7 +107,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. ## 4. Handle Return diff --git a/get-shit-done/workflows/validate-phase.md b/get-shit-done/workflows/validate-phase.md index ebd601e01..f418cf618 100644 --- a/get-shit-done/workflows/validate-phase.md +++ b/get-shit-done/workflows/validate-phase.md @@ -93,7 +93,7 @@ Call AskUserQuestion with gap table and options: ## 5. Spawn gsd-nyquist-auditor ``` -Task( +Agent( prompt="Read ~/.claude/agents/gsd-nyquist-auditor.md for instructions.\n\n" + "{PLAN, SUMMARY, impl files, VALIDATION.md}" + "{gap list}" + @@ -106,7 +106,7 @@ Task( ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. Handle return: - `## GAPS FILLED` → record tests + map updates, Step 6 diff --git a/get-shit-done/workflows/verify-work.md b/get-shit-done/workflows/verify-work.md index 26812ca12..6a6dc9f6e 100644 --- a/get-shit-done/workflows/verify-work.md +++ b/get-shit-done/workflows/verify-work.md @@ -523,7 +523,7 @@ Display: Spawn gsd-planner in --gaps mode: ``` -Task( +Agent( prompt=""" @@ -551,7 +551,7 @@ Plans must be executable prompts. ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. On return: - **PLANNING COMPLETE:** Proceed to `verify_gap_plans` @@ -575,7 +575,7 @@ Initialize: `iteration_count = 1` Spawn gsd-plan-checker: ``` -Task( +Agent( prompt=""" @@ -602,7 +602,7 @@ Return one of: ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. On return: - **VERIFICATION PASSED:** Proceed to `present_ready` @@ -619,7 +619,7 @@ Display: `Sending back to planner for revision... (iteration {N}/3)` Spawn gsd-planner with revision context: ``` -Task( +Agent( prompt=""" @@ -648,7 +648,7 @@ Do NOT replan from scratch unless issues are fundamental. ) ``` -> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. +> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available. After planner returns → spawn checker again (verify_gap_plans logic) Increment iteration_count diff --git a/tests/bug-3168-task-to-agent-rename.test.cjs b/tests/bug-3168-task-to-agent-rename.test.cjs new file mode 100644 index 000000000..81afb58e9 --- /dev/null +++ b/tests/bug-3168-task-to-agent-rename.test.cjs @@ -0,0 +1,114 @@ +'use strict'; + +// allow-test-rule: source-text-is-the-product +// commands/gsd/*.md, get-shit-done/workflows/*.md, and agents/gsd-*.md are +// deployed product files. Checking their text IS checking the runtime contract. + +/** + * #3168 — Incomplete Task→Agent dispatcher rename causes silent inline fallback. + * + * The Claude Code subagent-dispatcher tool is named `Agent`. The `Task*` namespace + * (TaskCreate, TaskList, TaskGet, TaskUpdate, TaskOutput, TaskStop) is the task + * tracker — a distinct tool set. GSD workflows were partially migrated and still + * reference `Task(` and `- Task` in allowed-tools/tools frontmatter in most files. + */ + +const { test, describe } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +const ROOT = path.join(__dirname, '..'); +const COMMANDS_DIR = path.join(ROOT, 'commands', 'gsd'); +const WORKFLOWS_DIR = path.join(ROOT, 'get-shit-done', 'workflows'); +const AGENTS_DIR = path.join(ROOT, 'agents'); + +// Task tracker names — these must NOT be renamed +const TASK_TRACKER_PATTERN = /\bTask(?:Create|List|Get|Update|Output|Stop)\b/; + +function readMdFiles(dir, prefix) { + return fs.readdirSync(dir) + .filter(f => f.endsWith('.md') && (!prefix || f.startsWith(prefix))) + .map(f => ({ name: f, path: path.join(dir, f), content: fs.readFileSync(path.join(dir, f), 'utf-8') })); +} + +function extractFrontmatterTools(content) { + const fm = content.match(/^---\n([\s\S]*?)\n---/); + if (!fm) return []; + const toolsMatch = fm[1].match(/^allowed-tools:\s*\n((?:[ \t]+-[^\n]*\n?)*)/m) || + fm[1].match(/^tools:\s*(.+)$/m); + if (!toolsMatch) return []; + const toolsBlock = toolsMatch[1]; + if (toolsBlock.includes('\n')) { + return toolsBlock.match(/[-\s]*([A-Za-z_*][A-Za-z0-9_*]*)/g) + .map(t => t.replace(/^[-\s]+/, '').trim()) + .filter(Boolean); + } + return toolsBlock.split(',').map(t => t.trim()).filter(Boolean); +} + +describe('#3168 — commands/gsd: allowed-tools must use Agent not Task', () => { + const commands = readMdFiles(COMMANDS_DIR); + + for (const cmd of commands) { + test(`${cmd.name}: allowed-tools must not list Task without Agent`, () => { + const tools = extractFrontmatterTools(cmd.content); + const hasTask = tools.includes('Task'); + const hasAgent = tools.includes('Agent'); + assert.ok( + !hasTask || hasAgent, + `${cmd.name}: allowed-tools lists "Task" but not "Agent" — dispatcher tool is "Agent", not "Task"\n tools: [${tools.join(', ')}]`, + ); + assert.ok( + !hasTask, + `${cmd.name}: allowed-tools still lists "Task" — remove it (Agent is the dispatcher tool)\n tools: [${tools.join(', ')}]`, + ); + }); + } +}); + +describe('#3168 — workflows: prose must use Agent( not Task( for dispatcher calls', () => { + const workflows = []; + function collectMd(dir) { + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + if (entry.isDirectory()) collectMd(path.join(dir, entry.name)); + else if (entry.name.endsWith('.md')) workflows.push({ name: entry.name, path: path.join(dir, entry.name), content: fs.readFileSync(path.join(dir, entry.name), 'utf-8') }); + } + } + collectMd(WORKFLOWS_DIR); + + for (const wf of workflows) { + test(`${wf.name}: must not contain dispatcher Task( calls`, () => { + const lines = wf.content.split('\n'); + const violations = []; + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + // Skip code fences that show old examples + if (line.trim().startsWith('```') || line.trim().startsWith('#')) continue; + // Match Task( that is NOT a tracker call (TaskCreate, TaskList, etc.) + if (/\bTask\(/.test(line) && !TASK_TRACKER_PATTERN.test(line)) { + violations.push(` line ${i + 1}: ${line.trim()}`); + } + } + assert.deepStrictEqual( + violations, + [], + `${wf.name}: found dispatcher Task( calls that should be Agent(:\n${violations.join('\n')}`, + ); + }); + } +}); + +describe('#3168 — agents: tools frontmatter must use Agent not Task', () => { + const agents = readMdFiles(AGENTS_DIR, 'gsd-'); + + for (const agent of agents) { + test(`${agent.name}: tools must not list Task`, () => { + const tools = extractFrontmatterTools(agent.content); + assert.ok( + !tools.includes('Task'), + `${agent.name}: tools frontmatter lists "Task" — should be "Agent"\n tools: [${tools.join(', ')}]`, + ); + }); + } +});