gsd-opencode 1.30.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/agents/gsd-debugger.md +0 -1
  2. package/agents/gsd-doc-verifier.md +207 -0
  3. package/agents/gsd-doc-writer.md +608 -0
  4. package/agents/gsd-executor.md +22 -1
  5. package/agents/gsd-phase-researcher.md +41 -0
  6. package/agents/gsd-plan-checker.md +82 -0
  7. package/agents/gsd-planner.md +123 -194
  8. package/agents/gsd-security-auditor.md +129 -0
  9. package/agents/gsd-ui-auditor.md +40 -0
  10. package/agents/gsd-user-profiler.md +2 -2
  11. package/agents/gsd-verifier.md +84 -18
  12. package/commands/gsd/gsd-add-backlog.md +1 -1
  13. package/commands/gsd/gsd-analyze-dependencies.md +34 -0
  14. package/commands/gsd/gsd-autonomous.md +6 -2
  15. package/commands/gsd/gsd-cleanup.md +5 -0
  16. package/commands/gsd/gsd-debug.md +24 -21
  17. package/commands/gsd/gsd-discuss-phase.md +7 -2
  18. package/commands/gsd/gsd-docs-update.md +48 -0
  19. package/commands/gsd/gsd-execute-phase.md +4 -0
  20. package/commands/gsd/gsd-help.md +2 -0
  21. package/commands/gsd/gsd-join-discord.md +2 -1
  22. package/commands/gsd/gsd-manager.md +1 -0
  23. package/commands/gsd/gsd-new-project.md +4 -0
  24. package/commands/gsd/gsd-plan-phase.md +5 -0
  25. package/commands/gsd/gsd-quick.md +5 -3
  26. package/commands/gsd/gsd-reapply-patches.md +171 -39
  27. package/commands/gsd/gsd-research-phase.md +2 -12
  28. package/commands/gsd/gsd-review-backlog.md +1 -0
  29. package/commands/gsd/gsd-review.md +3 -2
  30. package/commands/gsd/gsd-secure-phase.md +35 -0
  31. package/commands/gsd/gsd-thread.md +1 -1
  32. package/commands/gsd/gsd-workstreams.md +7 -2
  33. package/get-shit-done/bin/gsd-tools.cjs +42 -8
  34. package/get-shit-done/bin/lib/commands.cjs +68 -14
  35. package/get-shit-done/bin/lib/config.cjs +18 -10
  36. package/get-shit-done/bin/lib/core.cjs +383 -80
  37. package/get-shit-done/bin/lib/docs.cjs +267 -0
  38. package/get-shit-done/bin/lib/frontmatter.cjs +47 -2
  39. package/get-shit-done/bin/lib/init.cjs +85 -5
  40. package/get-shit-done/bin/lib/milestone.cjs +21 -0
  41. package/get-shit-done/bin/lib/model-profiles.cjs +2 -0
  42. package/get-shit-done/bin/lib/phase.cjs +232 -189
  43. package/get-shit-done/bin/lib/profile-output.cjs +97 -1
  44. package/get-shit-done/bin/lib/roadmap.cjs +137 -113
  45. package/get-shit-done/bin/lib/schema-detect.cjs +238 -0
  46. package/get-shit-done/bin/lib/security.cjs +5 -3
  47. package/get-shit-done/bin/lib/state.cjs +366 -44
  48. package/get-shit-done/bin/lib/verify.cjs +158 -14
  49. package/get-shit-done/bin/lib/workstream.cjs +6 -2
  50. package/get-shit-done/references/agent-contracts.md +79 -0
  51. package/get-shit-done/references/artifact-types.md +113 -0
  52. package/get-shit-done/references/context-budget.md +49 -0
  53. package/get-shit-done/references/continuation-format.md +15 -15
  54. package/get-shit-done/references/domain-probes.md +125 -0
  55. package/get-shit-done/references/gate-prompts.md +100 -0
  56. package/get-shit-done/references/model-profiles.md +2 -2
  57. package/get-shit-done/references/planner-gap-closure.md +62 -0
  58. package/get-shit-done/references/planner-reviews.md +39 -0
  59. package/get-shit-done/references/planner-revision.md +87 -0
  60. package/get-shit-done/references/planning-config.md +15 -0
  61. package/get-shit-done/references/revision-loop.md +97 -0
  62. package/get-shit-done/references/ui-brand.md +2 -2
  63. package/get-shit-done/references/universal-anti-patterns.md +58 -0
  64. package/get-shit-done/references/workstream-flag.md +56 -3
  65. package/get-shit-done/templates/SECURITY.md +61 -0
  66. package/get-shit-done/templates/VALIDATION.md +3 -3
  67. package/get-shit-done/templates/claude-md.md +27 -4
  68. package/get-shit-done/templates/config.json +4 -0
  69. package/get-shit-done/templates/debug-subagent-prompt.md +2 -6
  70. package/get-shit-done/templates/planner-subagent-prompt.md +2 -10
  71. package/get-shit-done/workflows/add-phase.md +2 -2
  72. package/get-shit-done/workflows/add-todo.md +1 -1
  73. package/get-shit-done/workflows/analyze-dependencies.md +96 -0
  74. package/get-shit-done/workflows/audit-milestone.md +8 -12
  75. package/get-shit-done/workflows/autonomous.md +158 -13
  76. package/get-shit-done/workflows/check-todos.md +2 -2
  77. package/get-shit-done/workflows/complete-milestone.md +13 -4
  78. package/get-shit-done/workflows/diagnose-issues.md +8 -6
  79. package/get-shit-done/workflows/discovery-phase.md +1 -1
  80. package/get-shit-done/workflows/discuss-phase-assumptions.md +22 -4
  81. package/get-shit-done/workflows/discuss-phase-power.md +291 -0
  82. package/get-shit-done/workflows/discuss-phase.md +149 -11
  83. package/get-shit-done/workflows/docs-update.md +1093 -0
  84. package/get-shit-done/workflows/execute-phase.md +362 -66
  85. package/get-shit-done/workflows/execute-plan.md +1 -1
  86. package/get-shit-done/workflows/help.md +9 -6
  87. package/get-shit-done/workflows/insert-phase.md +2 -2
  88. package/get-shit-done/workflows/manager.md +27 -26
  89. package/get-shit-done/workflows/map-codebase.md +10 -32
  90. package/get-shit-done/workflows/new-milestone.md +14 -8
  91. package/get-shit-done/workflows/new-project.md +48 -25
  92. package/get-shit-done/workflows/next.md +1 -1
  93. package/get-shit-done/workflows/note.md +1 -1
  94. package/get-shit-done/workflows/pause-work.md +73 -10
  95. package/get-shit-done/workflows/plan-milestone-gaps.md +2 -2
  96. package/get-shit-done/workflows/plan-phase.md +184 -32
  97. package/get-shit-done/workflows/progress.md +20 -20
  98. package/get-shit-done/workflows/quick.md +102 -84
  99. package/get-shit-done/workflows/research-phase.md +2 -6
  100. package/get-shit-done/workflows/resume-project.md +4 -4
  101. package/get-shit-done/workflows/review.md +56 -3
  102. package/get-shit-done/workflows/secure-phase.md +154 -0
  103. package/get-shit-done/workflows/settings.md +13 -2
  104. package/get-shit-done/workflows/ship.md +13 -4
  105. package/get-shit-done/workflows/transition.md +6 -6
  106. package/get-shit-done/workflows/ui-phase.md +4 -14
  107. package/get-shit-done/workflows/ui-review.md +25 -7
  108. package/get-shit-done/workflows/update.md +165 -16
  109. package/get-shit-done/workflows/validate-phase.md +1 -11
  110. package/get-shit-done/workflows/verify-phase.md +127 -6
  111. package/get-shit-done/workflows/verify-work.md +69 -21
  112. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ # Domain-Aware Probing Patterns
2
+
3
+ Shared reference for `/gsd-begin`, `/gsd-discuss-phase`, and domain exploration workflows.
4
+
5
+ When the user mentions a technology area, use these probes to ask insightful follow-up questions. Don't run through them as a checklist -- pick the 2-3 most relevant based on context. The goal is to surface hidden assumptions and trade-offs the user may not have considered yet.
6
+
7
+ ---
8
+
9
+ ## Authentication
10
+
11
+ | User mentions | Agent probes with domain knowledge |
12
+ |---|---|
13
+ | "login" or "auth" | OAuth (which providers?), JWT, or session-based? Do you need social login or just email/password? |
14
+ | "users" or "accounts" | MFA required? Password reset flow? Email verification? |
15
+ | "sessions" | Session duration and refresh strategy? Server-side sessions or stateless tokens? |
16
+ | "roles" or "permissions" | RBAC, ABAC, or simple role checks? How many distinct roles? |
17
+ | "API keys" | Key rotation strategy? Scoped permissions per key? Rate limiting per key? |
18
+
19
+ ---
20
+
21
+ ## Real-Time Updates
22
+
23
+ | User mentions | Agent probes with domain knowledge |
24
+ |---|---|
25
+ | "real-time" or "live updates" | WebSockets, SSE, or polling? What specifically needs to be real-time vs. eventual? |
26
+ | "notifications" | Push notifications (browser/mobile), in-app only, or both? Persistence and read receipts? |
27
+ | "collaboration" or "multiplayer" | Conflict resolution strategy? Operational transforms or CRDTs? Expected concurrent users? |
28
+ | "chat" or "messaging" | Message history and search? Typing indicators? read receipts? |
29
+ | "streaming" | Reconnection strategy? What happens when the connection drops -- queue or discard? |
30
+
31
+ ---
32
+
33
+ ## Dashboard
34
+
35
+ | User mentions | Agent probes with domain knowledge |
36
+ |---|---|
37
+ | "dashboard" | What data sources feed it? How many distinct views? |
38
+ | "charts" or "graphs" | Interactive or static? Drill-down capability? Export to CSV/PDF? |
39
+ | "metrics" or "KPIs" | Refresh strategy -- real-time, periodic polling, or on-demand? Acceptable staleness? |
40
+ | "admin panel" | Role-based visibility? Which actions beyond viewing (edit, delete, approve)? |
41
+ | "mobile" or "responsive" | Simplified mobile view or full parity? Touch interactions for charts? |
42
+
43
+ ---
44
+
45
+ ## API Design
46
+
47
+ | User mentions | Agent probes with domain knowledge |
48
+ |---|---|
49
+ | "API" | REST, GraphQL, or RPC-style? Internal only or public-facing? |
50
+ | "endpoints" or "routes" | Versioning strategy (URL path, header, query param)? Breaking change policy? |
51
+ | "pagination" | Cursor-based or offset? Expected result set sizes? Stable ordering guarantee? |
52
+ | "rate limiting" | Per-user, per-IP, or per-API-key? Burst allowance? How to communicate limits to clients? |
53
+ | "errors" | Structured error format? Error codes vs. messages? How much detail in production errors? |
54
+
55
+ ---
56
+
57
+ ## Database
58
+
59
+ | User mentions | Agent probes with domain knowledge |
60
+ |---|---|
61
+ | "database" or "storage" | SQL or NoSQL? What drives the choice -- relational integrity, flexibility, scale? |
62
+ | "ORM" or "queries" | ORM (which one?) or raw queries? Query builder as middle ground? |
63
+ | "migrations" | Migration tool? Rollback strategy? How do you handle data migrations vs. schema migrations? |
64
+ | "seeding" or "test data" | Seed data for development? Realistic fake data or minimal fixtures? |
65
+ | "scale" or "performance" | read/write ratio? read replicas? Connection pooling strategy? |
66
+
67
+ ---
68
+
69
+ ## Search
70
+
71
+ | User mentions | Agent probes with domain knowledge |
72
+ |---|---|
73
+ | "search" | Full-text or exact match? Dedicated search engine (Elasticsearch, Meilisearch) or database-level? |
74
+ | "filtering" or "facets" | Faceted filtering? How many filter dimensions? Combined filters (AND/OR)? |
75
+ | "autocomplete" or "typeahead" | Debounce strategy? Minimum character threshold? Result ranking? |
76
+ | "indexing" | Index size and update frequency? Real-time indexing or batch? Acceptable index lag? |
77
+ | "fuzzy" or "typo tolerance" | Fuzzy matching? Synonym support? Language-specific stemming? |
78
+
79
+ ---
80
+
81
+ ## File Upload/Storage
82
+
83
+ | User mentions | Agent probes with domain knowledge |
84
+ |---|---|
85
+ | "upload" or "file upload" | Local filesystem or cloud (S3, GCS, Azure Blob)? Direct upload or through server? |
86
+ | "images" or "media" | Processing pipeline -- resize, compress, thumbnail generation? Format conversion? |
87
+ | "size limits" | Max file size? Max total storage per user? What happens when limits are hit? |
88
+ | "CDN" | CDN for delivery? Cache invalidation for updated files? Signed URLs for access control? |
89
+ | "documents" or "attachments" | Virus scanning? Preview generation? Versioning of uploaded files? |
90
+
91
+ ---
92
+
93
+ ## Caching
94
+
95
+ | User mentions | Agent probes with domain knowledge |
96
+ |---|---|
97
+ | "caching" or "performance" | Where to cache -- browser, CDN, application layer, database query cache? |
98
+ | "invalidation" | Invalidation strategy -- TTL, event-driven, or manual? Cache-aside vs. write-through? |
99
+ | "stale data" | Acceptable staleness window? Stale-while-revalidate pattern? |
100
+ | "Redis" or "Memcached" | Cache topology -- single node or clustered? Persistence needed or pure cache? |
101
+ | "CDN" or "edge" | Edge caching for static assets? Dynamic content at the edge? Cache key strategy? |
102
+
103
+ ---
104
+
105
+ ## Testing
106
+
107
+ | User mentions | Agent probes with domain knowledge |
108
+ |---|---|
109
+ | "testing" or "tests" | Unit, integration, and E2E balance? Where do you invest most testing effort? |
110
+ | "mocking" or "stubs" | Mock external services or use test containers? Database mocking strategy? |
111
+ | "CI" or "pipeline" | Tests in CI? Parallel test execution? Test-on-PR or test-on-push? |
112
+ | "coverage" | Coverage targets? Coverage as gate or advisory? Which metrics (line, branch, function)? |
113
+ | "E2E" or "browser testing" | Playwright, Cypress, or other? Headed vs. headless? Visual regression testing? |
114
+
115
+ ---
116
+
117
+ ## Deployment
118
+
119
+ | User mentions | Agent probes with domain knowledge |
120
+ |---|---|
121
+ | "deploy" or "hosting" | Container, serverless, or traditional VM/VPS? Managed platform (Vercel, Railway) or self-hosted? |
122
+ | "CI/CD" or "pipeline" | GitHub Actions, GitLab CI, or other? Deploy on merge to main or manual trigger? |
123
+ | "environments" | How many environments (dev, staging, prod)? Environment parity strategy? |
124
+ | "rollback" | Rollback strategy? Blue-green, canary, or instant rollback? Database rollback considerations? |
125
+ | "secrets" or "config" | Secret management -- env vars, vault, or platform-native? Per-environment config strategy? |
@@ -0,0 +1,100 @@
1
+ # Gate Prompt Patterns
2
+
3
+ Reusable prompt patterns for structured gate checks in workflows and agents.
4
+
5
+ **For checkpoint box format details, see `references/ui-brand.md`** -- checkpoint boxes use double-line border drawing with 62-character inner width.
6
+
7
+ ## Rules
8
+
9
+ - `header` must be max 12 characters
10
+ - `multiSelect` is always `false` for gate checks
11
+ - Always handle the "Other" case (user typed a freeform response instead of selecting)
12
+ - Max 4 options per prompt -- if more are needed, use a 2-step flow
13
+
14
+ ---
15
+
16
+ ## Pattern: approve-revise-abort
17
+ 3-option gate for plan approval, gap-closure approval.
18
+ - question: "Approve these {noun}?"
19
+ - header: "Approve?"
20
+ - options: Approve | Request changes | Abort
21
+
22
+ ## Pattern: yes-no
23
+ Simple 2-option confirmation for re-planning, rebuild, replace plans, commit.
24
+ - question: "{Specific question about the action}"
25
+ - header: "Confirm"
26
+ - options: Yes | No
27
+
28
+ ## Pattern: stale-continue
29
+ 2-option refresh gate for staleness warnings, timestamp freshness.
30
+ - question: "{Artifact} may be outdated. Refresh or continue?"
31
+ - header: "Stale"
32
+ - options: Refresh | Continue anyway
33
+
34
+ ## Pattern: yes-no-pick
35
+ 3-option selection for seed selection, item inclusion.
36
+ - question: "Include {items} in planning?"
37
+ - header: "Include?"
38
+ - options: Yes, all | Let me pick | No
39
+
40
+ ## Pattern: multi-option-failure
41
+ 4-option failure handler for build failures.
42
+ - question: "Plan {id} failed. How should we proceed?"
43
+ - header: "Failed"
44
+ - options: Retry | Skip | Rollback | Abort
45
+
46
+ ## Pattern: multi-option-escalation
47
+ 4-option escalation for review escalation (max retries exceeded).
48
+ - question: "Phase {N} has failed verification {attempt} times. How should we proceed?"
49
+ - header: "Escalate"
50
+ - options: Accept gaps | Re-plan (via /gsd-plan-phase) | Debug (via /gsd-debug) | Retry
51
+
52
+ ## Pattern: multi-option-gaps
53
+ 4-option gap handler for review gaps-found.
54
+ - question: "{count} verification gaps need attention. How should we proceed?"
55
+ - header: "Gaps"
56
+ - options: Auto-fix | Override | Manual | Skip
57
+
58
+ ## Pattern: multi-option-priority
59
+ 4-option priority selection for milestone gap priority.
60
+ - question: "Which gaps should we address?"
61
+ - header: "Priority"
62
+ - options: Must-fix only | Must + should | Everything | Let me pick
63
+
64
+ ## Pattern: toggle-confirm
65
+ 2-option confirmation for enabling/disabling boolean features.
66
+ - question: "Enable {feature_name}?"
67
+ - header: "Toggle"
68
+ - options: Enable | Disable
69
+
70
+ ## Pattern: action-routing
71
+ Up to 4 suggested next actions with selection (status, resume workflows).
72
+ - question: "What would you like to do next?"
73
+ - header: "Next Step"
74
+ - options: {primary action} | {alternative 1} | {alternative 2} | Something else
75
+ - Note: Dynamically generate options from workflow state. Always include "Something else" as last option.
76
+
77
+ ## Pattern: scope-confirm
78
+ 3-option confirmation for quick task scope validation.
79
+ - question: "This task looks complex. Proceed as quick task or use full planning?"
80
+ - header: "Scope"
81
+ - options: Quick task | Full plan (via /gsd-plan-phase) | Revise
82
+
83
+ ## Pattern: depth-select
84
+ 3-option depth selection for planning workflow preferences.
85
+ - question: "How thorough should planning be?"
86
+ - header: "Depth"
87
+ - options: Quick (3-5 phases, skip research) | Standard (5-8 phases, default) | Comprehensive (8-12 phases, deep research)
88
+
89
+ ## Pattern: context-handling
90
+ 3-option handler for existing CONTEXT.md in discuss workflow.
91
+ - question: "Phase {N} already has a CONTEXT.md. How should we handle it?"
92
+ - header: "Context"
93
+ - options: Overwrite | Append | Cancel
94
+
95
+ ## Pattern: gray-area-option
96
+ Dynamic template for presenting gray area choices in discuss workflow.
97
+ - question: "{Gray area title}"
98
+ - header: "Decision"
99
+ - options: {Option 1} | {Option 2} | Let OpenCode decide
100
+ - Note: Options generated at runtime. Always include "Let OpenCode decide" as last option.
@@ -39,11 +39,11 @@ Model profiles control which OpenCode model each GSD agent uses. This allows bal
39
39
 
40
40
  **inherit** - Follow the current session model
41
41
  - All agents resolve to `inherit`
42
- - Best when you switch models interactively (for example OpenCode `/model`)
42
+ - Best when you switch models interactively (for example OpenCode or Kilo `/model`)
43
43
  - **Required when using non-Anthropic providers** (OpenRouter, local models, etc.) — otherwise GSD may call Anthropic models directly, incurring unexpected costs
44
44
  - Use when: you want GSD to follow your currently selected runtime model
45
45
 
46
- ## Using Non-OpenCode Runtimes (Codex, OpenCode, Gemini CLI)
46
+ ## Using Non-OpenCode Runtimes (Codex, OpenCode, Gemini CLI, Kilo)
47
47
 
48
48
  When installed for a non-OpenCode runtime, the GSD installer sets `resolve_model_ids: "omit"` in `~/.gsd/defaults.json`. This returns an empty model parameter for all agents, so each agent uses the runtime's default model. No manual setup is needed.
49
49
 
@@ -0,0 +1,62 @@
1
+ # Gap Closure Mode — Planner Reference
2
+
3
+ Triggered by `--gaps` flag. Creates plans to address verification or UAT failures.
4
+
5
+ **Important: Skip deferred items.** When reading VERIFICATION.md, only the `gaps:` section contains actionable items that need closure plans. The `deferred:` section (if present) lists items explicitly addressed in later milestone phases — these are NOT gaps and must be ignored during gap closure planning. Creating plans for deferred items wastes effort on work already scheduled for future phases.
6
+
7
+ **1. Find gap sources:**
8
+
9
+ Use init context (from load_project_state) which provides `phase_dir`:
10
+
11
+ ```bash
12
+ # Check for VERIFICATION.md (code verification gaps)
13
+ ls "$phase_dir"/*-VERIFICATION.md 2>/dev/null
14
+
15
+ # Check for UAT.md with diagnosed status (user testing gaps)
16
+ grep -l "status: diagnosed" "$phase_dir"/*-UAT.md 2>/dev/null
17
+ ```
18
+
19
+ **2. Parse gaps:** Each gap has: truth (failed behavior), reason, artifacts (files with issues), missing (things to add/fix).
20
+
21
+ **3. Load existing SUMMARYs** to understand what's already built.
22
+
23
+ **4. Find next plan number:** If plans 01-03 exist, next is 04.
24
+
25
+ **5. Group gaps into plans** by: same artifact, same concern, dependency order (can't wire if artifact is stub → fix stub first).
26
+
27
+ **6. Create gap closure tasks:**
28
+
29
+ ```xml
30
+ <task name="{fix_description}" type="auto">
31
+ <files>{artifact.path}</files>
32
+ <action>
33
+ {For each item in gap.missing:}
34
+ - {missing item}
35
+
36
+ Reference existing code: {from SUMMARYs}
37
+ Gap reason: {gap.reason}
38
+ </action>
39
+ <verify>{How to confirm gap is closed}</verify>
40
+ <done>{Observable truth now achievable}</done>
41
+ </task>
42
+ ```
43
+
44
+ **7. Assign waves using standard dependency analysis** (same as `assign_waves` step):
45
+ - Plans with no dependencies → wave 1
46
+ - Plans that depend on other gap closure plans → max(dependency waves) + 1
47
+ - Also consider dependencies on existing (non-gap) plans in the phase
48
+
49
+ **8. write PLAN.md files:**
50
+
51
+ ```yaml
52
+ ---
53
+ phase: XX-name
54
+ plan: NN # Sequential after existing
55
+ type: execute
56
+ wave: N # Computed from depends_on (see assign_waves)
57
+ depends_on: [...] # Other plans this depends on (gap or existing)
58
+ files_modified: [...]
59
+ autonomous: true
60
+ gap_closure: true # Flag for tracking
61
+ ---
62
+ ```
@@ -0,0 +1,39 @@
1
+ # Reviews Mode — Planner Reference
2
+
3
+ Triggered when orchestrator sets Mode to `reviews`. Replanning from scratch with REVIEWS.md feedback as additional context.
4
+
5
+ **Mindset:** Fresh planner with review insights — not a surgeon making patches, but an architect who has read peer critiques.
6
+
7
+ ### Step 1: Load REVIEWS.md
8
+ read the reviews file from `<files_to_read>`. Parse:
9
+ - Per-reviewer feedback (strengths, concerns, suggestions)
10
+ - Consensus Summary (agreed concerns = highest priority to address)
11
+ - Divergent Views (investigate, make a judgment call)
12
+
13
+ ### Step 2: Categorize Feedback
14
+ Group review feedback into:
15
+ - **Must address**: HIGH severity consensus concerns
16
+ - **Should address**: MEDIUM severity concerns from 2+ reviewers
17
+ - **Consider**: Individual reviewer suggestions, LOW severity items
18
+
19
+ ### Step 3: Plan Fresh with Review Context
20
+ Create new plans following the standard planning process, but with review feedback as additional constraints:
21
+ - Each HIGH severity consensus concern MUST have a task that addresses it
22
+ - MEDIUM concerns should be addressed where feasible without over-engineering
23
+ - Note in task actions: "Addresses review concern: {concern}" for traceability
24
+
25
+ ### Step 4: Return
26
+ Use standard PLANNING COMPLETE return format, adding a reviews section:
27
+
28
+ ```markdown
29
+ ### Review Feedback Addressed
30
+
31
+ | Concern | Severity | How Addressed |
32
+ |---------|----------|---------------|
33
+ | {concern} | HIGH | Plan {N}, task {M}: {how} |
34
+
35
+ ### Review Feedback Deferred
36
+ | Concern | Reason |
37
+ |---------|--------|
38
+ | {concern} | {why — out of scope, disagree, etc.} |
39
+ ```
@@ -0,0 +1,87 @@
1
+ # Revision Mode — Planner Reference
2
+
3
+ Triggered when orchestrator provides `<revision_context>` with checker issues. NOT starting fresh — making targeted updates to existing plans.
4
+
5
+ **Mindset:** Surgeon, not architect. Minimal changes for specific issues.
6
+
7
+ ### Step 1: Load Existing Plans
8
+
9
+ ```bash
10
+ cat .planning/phases/$PHASE-*/$PHASE-*-PLAN.md
11
+ ```
12
+
13
+ Build mental model of current plan structure, existing tasks, must_haves.
14
+
15
+ ### Step 2: Parse Checker Issues
16
+
17
+ Issues come in structured format:
18
+
19
+ ```yaml
20
+ issues:
21
+ - plan: "16-01"
22
+ dimension: "task_completeness"
23
+ severity: "blocker"
24
+ description: "task 2 missing <verify> element"
25
+ fix_hint: "Add verification command for build output"
26
+ ```
27
+
28
+ Group by plan, dimension, severity.
29
+
30
+ ### Step 3: Revision Strategy
31
+
32
+ | Dimension | Strategy |
33
+ |-----------|----------|
34
+ | requirement_coverage | Add task(s) for missing requirement |
35
+ | task_completeness | Add missing elements to existing task |
36
+ | dependency_correctness | Fix depends_on, recompute waves |
37
+ | key_links_planned | Add wiring task or update action |
38
+ | scope_sanity | Split into multiple plans |
39
+ | must_haves_derivation | Derive and add must_haves to frontmatter |
40
+
41
+ ### Step 4: Make Targeted Updates
42
+
43
+ **DO:** edit specific flagged sections, preserve working parts, update waves if dependencies change.
44
+
45
+ **DO NOT:** Rewrite entire plans for minor issues, add unnecessary tasks, break existing working plans.
46
+
47
+ ### Step 5: Validate Changes
48
+
49
+ - [ ] All flagged issues addressed
50
+ - [ ] No new issues introduced
51
+ - [ ] Wave numbers still valid
52
+ - [ ] Dependencies still correct
53
+ - [ ] Files on disk updated
54
+
55
+ ### Step 6: Commit
56
+
57
+ ```bash
58
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "fix($PHASE): revise plans based on checker feedback" --files .planning/phases/$PHASE-*/$PHASE-*-PLAN.md
59
+ ```
60
+
61
+ ### Step 7: Return Revision Summary
62
+
63
+ ```markdown
64
+ ## REVISION COMPLETE
65
+
66
+ **Issues addressed:** {N}/{M}
67
+
68
+ ### Changes Made
69
+
70
+ | Plan | Change | Issue Addressed |
71
+ |------|--------|-----------------|
72
+ | 16-01 | Added <verify> to task 2 | task_completeness |
73
+ | 16-02 | Added logout task | requirement_coverage (AUTH-02) |
74
+
75
+ ### Files Updated
76
+
77
+ - .planning/phases/16-xxx/16-01-PLAN.md
78
+ - .planning/phases/16-xxx/16-02-PLAN.md
79
+
80
+ {If any issues NOT addressed:}
81
+
82
+ ### Unaddressed Issues
83
+
84
+ | Issue | Reason |
85
+ |-------|--------|
86
+ | {issue} | {why - needs user input, architectural change, etc.} |
87
+ ```
@@ -10,9 +10,17 @@ Configuration options for `.planning/` directory behavior.
10
10
  },
11
11
  "git": {
12
12
  "branching_strategy": "none",
13
+ "base_branch": null,
13
14
  "phase_branch_template": "gsd/phase-{phase}-{slug}",
14
15
  "milestone_branch_template": "gsd/{milestone}-{slug}",
15
16
  "quick_branch_template": null
17
+ },
18
+ "manager": {
19
+ "flags": {
20
+ "discuss": "",
21
+ "plan": "",
22
+ "execute": ""
23
+ }
16
24
  }
17
25
  ```
18
26
 
@@ -21,9 +29,16 @@ Configuration options for `.planning/` directory behavior.
21
29
  | `commit_docs` | `true` | Whether to commit planning artifacts to git |
22
30
  | `search_gitignored` | `false` | Add `--no-ignore` to broad rg searches |
23
31
  | `git.branching_strategy` | `"none"` | Git branching approach: `"none"`, `"phase"`, or `"milestone"` |
32
+ | `git.base_branch` | `null` (auto-detect) | Target branch for PRs and merges (e.g. `"master"`, `"develop"`). When `null`, auto-detects from `git symbolic-ref refs/remotes/origin/HEAD`, falling back to `"main"`. |
24
33
  | `git.phase_branch_template` | `"gsd/phase-{phase}-{slug}"` | Branch template for phase strategy |
25
34
  | `git.milestone_branch_template` | `"gsd/{milestone}-{slug}"` | Branch template for milestone strategy |
26
35
  | `git.quick_branch_template` | `null` | Optional branch template for quick-task runs |
36
+ | `workflow.use_worktrees` | `true` | Whether executor agents run in isolated git worktrees. Set to `false` to disable worktrees — agents execute sequentially on the main working tree instead. Recommended for solo developers or when worktree merges cause issues. |
37
+ | `workflow.subagent_timeout` | `300000` | Timeout in milliseconds for parallel subagent tasks (e.g. codebase mapping). Increase for large codebases or slower models. Default: 300000 (5 minutes). |
38
+ | `manager.flags.discuss` | `""` | Flags passed to `/gsd-discuss-phase` when dispatched from manager (e.g. `"--auto --analyze"`) |
39
+ | `manager.flags.plan` | `""` | Flags passed to plan workflow when dispatched from manager |
40
+ | `manager.flags.execute` | `""` | Flags passed to execute workflow when dispatched from manager |
41
+ | `response_language` | `null` | Language for user-facing questions and prompts across all phases/subagents (e.g. `"Portuguese"`, `"Japanese"`, `"Spanish"`). When set, all spawned agents include a directive to respond in this language. |
27
42
  </config_schema>
28
43
 
29
44
  <commit_docs_behavior>
@@ -0,0 +1,97 @@
1
+ # Revision Loop Pattern
2
+
3
+ Standard pattern for iterative agent revision with feedback. Used when a checker/validator finds issues and the producing agent needs to revise its output.
4
+
5
+ ---
6
+
7
+ ## Pattern: Check-Revise-Escalate (max 3 iterations)
8
+
9
+ This pattern applies whenever:
10
+ 1. An agent produces output (plans, imports, gap-closure plans)
11
+ 2. A checker/validator evaluates that output
12
+ 3. Issues are found that need revision
13
+
14
+ ### Flow
15
+
16
+ ```
17
+ prev_issue_count = Infinity
18
+ iteration = 0
19
+
20
+ LOOP:
21
+ 1. Run checker/validator on current output
22
+ 2. read checker results
23
+ 3. If PASSED or only INFO-level issues:
24
+ -> Accept output, exit loop
25
+ 4. If BLOCKER or WARNING issues found:
26
+ a. iteration += 1
27
+ b. If iteration > 3:
28
+ -> Escalate to user (see "After 3 Iterations" below)
29
+ c. Parse issue count from checker output
30
+ d. If issue_count >= prev_issue_count:
31
+ -> Escalate to user: "Revision loop stalled (issue count not decreasing)"
32
+ e. prev_issue_count = issue_count
33
+ f. Re-spawn the producing agent with checker feedback appended
34
+ g. After revision completes, go to LOOP
35
+ ```
36
+
37
+ ### Issue Count Tracking
38
+
39
+ Track the number of BLOCKER + WARNING issues returned by the checker on each iteration. If the count does not decrease between consecutive iterations, the producing agent is stuck and further iterations will not help. Break early and escalate to the user.
40
+
41
+ Display iteration progress before each revision spawn:
42
+ `Revision iteration {N}/3 -- {blocker_count} blockers, {warning_count} warnings`
43
+
44
+ ### Re-spawn Prompt Structure
45
+
46
+ When re-spawning the producing agent for revision, pass the checker's YAML-formatted issues. The checker's output contains a `## Issues` heading followed by a YAML block. Parse this block and pass it verbatim to the revision agent.
47
+
48
+ ```
49
+ <checker_issues>
50
+ The issues below are in YAML format. Each has: dimension, severity, finding,
51
+ affected_field, suggested_fix. Address ALL BLOCKER issues. Address WARNING
52
+ issues where feasible.
53
+
54
+ {YAML issues block from checker output -- passed verbatim}
55
+ </checker_issues>
56
+
57
+ <revision_instructions>
58
+ Address ALL BLOCKER and WARNING issues identified above.
59
+ - For each BLOCKER: make the required change
60
+ - For each WARNING: address or explain why it's acceptable
61
+ - Do NOT introduce new issues while fixing existing ones
62
+ - Preserve all content not flagged by the checker
63
+ This is revision iteration {N} of max 3. Previous iteration had {prev_count}
64
+ issues. You must reduce the count or the loop will terminate.
65
+ </revision_instructions>
66
+ ```
67
+
68
+ ### After 3 Iterations
69
+
70
+ If issues persist after 3 revision cycles:
71
+
72
+ 1. Present remaining issues to the user
73
+ 2. Use gate prompt (pattern: yes-no from `references/gate-prompts.md`):
74
+ question: "Issues remain after 3 revision attempts. Proceed with current output?"
75
+ header: "Proceed?"
76
+ options:
77
+ - label: "Proceed anyway" description: "Accept output with remaining issues"
78
+ - label: "Adjust approach" description: "Discuss a different approach"
79
+ 3. If "Proceed anyway": accept current output and continue
80
+ 4. If "Adjust approach" or "Other": discuss with user, then re-enter the producing step with updated context
81
+
82
+ ### Workflow-Specific Variations
83
+
84
+ | Workflow | Producer Agent | Checker Agent | Notes |
85
+ |----------|---------------|---------------|-------|
86
+ | plan-phase | gsd-planner | gsd-plan-checker | Revision prompt via planner-revision.md |
87
+ | execute-phase | gsd-executor | gsd-verifier | Post-execution verification |
88
+ | discuss-phase | orchestrator | gsd-plan-checker | Inline revision by orchestrator |
89
+
90
+ ---
91
+
92
+ ## Important Notes
93
+
94
+ - **INFO-level issues are always acceptable** -- they don't trigger revision
95
+ - **Each iteration gets a fresh agent spawn** -- don't try to continue in the same context
96
+ - **Checker feedback must be inlined** -- the revision agent needs to see exactly what failed
97
+ - **Don't silently swallow issues** -- always present the final state to the user after exiting the loop
@@ -108,9 +108,9 @@ Always at end of major completions.
108
108
 
109
109
  **{Identifier}: {Name}** — {one-line description}
110
110
 
111
- `{copy-paste command}`
111
+ `/new` then:
112
112
 
113
- *`/new` first → fresh context window*
113
+ `{copy-paste command}`
114
114
 
115
115
  ───────────────────────────────────────────────────────────────
116
116
 
@@ -0,0 +1,58 @@
1
+ # Universal Anti-Patterns
2
+
3
+ Rules that apply to ALL workflows and agents. Individual workflows may have additional specific anti-patterns.
4
+
5
+ ---
6
+
7
+ ## Context Budget Rules
8
+
9
+ 1. **Never** read agent definition files (`agents/*.md`) -- `@<custom_agent>` call auto-loads them. Reading agent definitions into the orchestrator wastes context for content automatically injected into subagent sessions.
10
+ 2. **Never** inline large files into subagent prompts -- tell agents to read files from disk instead. Agents have their own context windows.
11
+ 3. **read depth scales with context window** -- check `context_window_tokens` in `.planning/config.json`. At < 500000: read only frontmatter, status fields, or summaries. At >= 500000 (1M model): full body reads permitted when content is needed for inline decisions. See `references/context-budget.md` for the complete table.
12
+ 4. **Delegate** heavy work to subagents -- the orchestrator routes, it does not build, analyze, research, investigate, or verify.
13
+ 5. **Proactive pause warning**: If you have already consumed significant context (large file reads, multiple subagent results), warn the user: "Context budget is getting heavy. Consider checkpointing progress."
14
+
15
+ ## File Reading Rules
16
+
17
+ 6. **SUMMARY.md read depth scales with context window** -- at context_window_tokens < 500000: read frontmatter only from prior phase SUMMARYs. At >= 500000: full body reads permitted for direct-dependency phases. Transitive dependencies (2+ phases back) remain frontmatter-only regardless.
18
+ 7. **Never** read full PLAN.md files from other phases -- only current phase plans.
19
+ 8. **Never** read `.planning/logs/` files -- only the health workflow reads these.
20
+ 9. **Do not** re-read full file contents when frontmatter is sufficient -- frontmatter contains status, key_files, commits, and provides fields. Exception: at >= 500000, re-reading full body is acceptable when semantic content is needed.
21
+
22
+ ## Subagent Rules
23
+
24
+ 10. **NEVER** use non-GSD agent types (`general`, `Explore`, `Plan`, `bash`, `feature-dev`, etc.) -- ALWAYS use `@gsd-{agent}` call (e.g., `@gsd-phase-researcher`, `@gsd-executor`, `@gsd-planner`). GSD agents have project-aware prompts, audit logging, and workflow context. Generic agents bypass all of this.
25
+ 11. **Do not** re-litigate decisions that are already locked in CONTEXT.md (or PROJECT.md ## Context section) -- respect locked decisions unconditionally.
26
+
27
+ ## Questioning Anti-Patterns
28
+
29
+ Reference: `references/questioning.md` for the full anti-pattern list.
30
+
31
+ 12. **Do not** walk through checklists -- checklist walking (asking items one by one from a list) is the #1 anti-pattern. Instead, use progressive depth: start broad, dig where interesting.
32
+ 13. **Do not** use corporate speak -- avoid jargon like "stakeholder alignment", "synergize", "deliverables". Use plain language.
33
+ 14. **Do not** apply premature constraints -- don't narrow the solution space before understanding the problem. Ask about the problem first, then constrain.
34
+
35
+ ## State Management Anti-Patterns
36
+
37
+ 15. **No direct write/edit to STATE.md or ROADMAP.md for mutations.** Always use `gsd-tools.cjs` CLI commands (`state update`, `state advance-plan`, `roadmap update-status`) for mutations. Direct write tool usage bypasses safe update logic and is unsafe in multi-session environments. Exception: first-time creation of STATE.md from template is allowed.
38
+
39
+ ## Behavioral Rules
40
+
41
+ 16. **Do not** create artifacts the user did not approve -- always confirm before writing new planning documents.
42
+ 17. **Do not** modify files outside the workflow's stated scope -- check the plan's files_modified list.
43
+ 18. **Do not** suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
44
+ 19. **Do not** use `git add .` or `git add -A` -- stage specific files only.
45
+ 20. **Do not** include sensitive information (API keys, passwords, tokens) in planning documents or commits.
46
+
47
+ ## Error Recovery Rules
48
+
49
+ 21. **Git lock detection**: Before any git operation, if it fails with "Unable to create lock file", check for stale `.git/index.lock` and advise the user to remove it (do not remove automatically).
50
+ 22. **Config fallback awareness**: Config loading returns `null` silently on invalid JSON. If your workflow depends on config values, check for null and warn the user: "config.json is invalid or missing -- running with defaults."
51
+ 23. **Partial state recovery**: If STATE.md references a phase directory that doesn't exist, do not proceed silently. Warn the user and suggest diagnosing the mismatch.
52
+
53
+ ## GSD-Specific Rules
54
+
55
+ 24. **Do not** check for `mode === 'auto'` or `mode === 'autonomous'` -- GSD uses `yolo` config flag. Check `yolo: true` for autonomous mode, absence or `false` for interactive mode.
56
+ 25. **Always use `gsd-tools.cjs`** (not `gsd-tools.js` or any other variant) -- GSD uses CommonJS for Node.js CLI compatibility.
57
+ 26. **Plan files MUST follow `{padded_phase}-{NN}-PLAN.md` pattern** (e.g., `01-01-PLAN.md`). Never use `PLAN-01.md`, `plan-01.md`, or any other variation -- gsd-tools detection depends on this exact pattern.
58
+ 27. **Do not start executing the next plan before writing the SUMMARY.md for the current plan** -- downstream plans may reference it via `@` includes.