specky-sdd 3.4.0-rc.9 → 3.5.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 (218) hide show
  1. package/.apm/agents/design-architect.agent.md +0 -2
  2. package/.apm/agents/implementer.agent.md +0 -2
  3. package/.apm/agents/quality-reviewer.agent.md +0 -2
  4. package/.apm/agents/release-engineer.agent.md +0 -2
  5. package/.apm/agents/requirements-engineer.agent.md +1 -3
  6. package/.apm/agents/research-analyst.agent.md +0 -2
  7. package/.apm/agents/sdd-clarify.agent.md +0 -2
  8. package/.apm/agents/sdd-init.agent.md +0 -2
  9. package/.apm/agents/spec-engineer.agent.md +2 -4
  10. package/.apm/agents/specky-onboarding.agent.md +3 -5
  11. package/.apm/agents/specky-orchestrator.agent.md +1 -3
  12. package/.apm/agents/task-planner.agent.md +0 -2
  13. package/.apm/agents/test-verifier.agent.md +0 -2
  14. package/.apm/hooks/scripts/branch-validator.sh +33 -28
  15. package/.apm/hooks/scripts/phase-gate.sh +1 -1
  16. package/.apm/hooks/scripts/pipeline-guard.sh +64 -31
  17. package/.apm/hooks/scripts/session-banner.sh +9 -1
  18. package/.apm/instructions/copilot-instructions.instructions.md +2 -2
  19. package/.apm/skills/sdd-markdown-standard/SKILL.md +2 -2
  20. package/.apm/skills/sdd-pipeline/SKILL.md +37 -34
  21. package/.apm/skills/sdd-pipeline/references/model-routing.md +34 -51
  22. package/.apm/skills/specky-onboarding/SKILL.md +2 -2
  23. package/.apm/skills/specky-orchestrator/SKILL.md +14 -12
  24. package/CHANGELOG.md +319 -0
  25. package/README.md +121 -72
  26. package/SECURITY.md +62 -41
  27. package/apm.yml +2 -2
  28. package/config.yml +9 -3
  29. package/dist/cli/commands/doctor.d.ts.map +1 -1
  30. package/dist/cli/commands/doctor.js +43 -9
  31. package/dist/cli/commands/doctor.js.map +1 -1
  32. package/dist/cli/commands/init.d.ts.map +1 -1
  33. package/dist/cli/commands/init.js +40 -1
  34. package/dist/cli/commands/init.js.map +1 -1
  35. package/dist/cli/commands/serve.d.ts.map +1 -1
  36. package/dist/cli/commands/serve.js +3 -2
  37. package/dist/cli/commands/serve.js.map +1 -1
  38. package/dist/cli/index.js +6 -2
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/cli/lib/asset-copier.d.ts.map +1 -1
  41. package/dist/cli/lib/asset-copier.js +18 -2
  42. package/dist/cli/lib/asset-copier.js.map +1 -1
  43. package/dist/cli/lib/gitignore-writer.d.ts +14 -0
  44. package/dist/cli/lib/gitignore-writer.d.ts.map +1 -0
  45. package/dist/cli/lib/gitignore-writer.js +93 -0
  46. package/dist/cli/lib/gitignore-writer.js.map +1 -0
  47. package/dist/cli/lib/mcp-writer.d.ts.map +1 -1
  48. package/dist/cli/lib/mcp-writer.js +5 -1
  49. package/dist/cli/lib/mcp-writer.js.map +1 -1
  50. package/dist/cli/lib/paths.d.ts +1 -0
  51. package/dist/cli/lib/paths.d.ts.map +1 -1
  52. package/dist/cli/lib/paths.js +1 -0
  53. package/dist/cli/lib/paths.js.map +1 -1
  54. package/dist/cli/lib/settings-merger.d.ts +17 -1
  55. package/dist/cli/lib/settings-merger.d.ts.map +1 -1
  56. package/dist/cli/lib/settings-merger.js +21 -29
  57. package/dist/cli/lib/settings-merger.js.map +1 -1
  58. package/dist/config.d.ts +53 -21
  59. package/dist/config.d.ts.map +1 -1
  60. package/dist/config.js +135 -120
  61. package/dist/config.js.map +1 -1
  62. package/dist/constants.d.ts +3 -30
  63. package/dist/constants.d.ts.map +1 -1
  64. package/dist/constants.js +3 -38
  65. package/dist/constants.js.map +1 -1
  66. package/dist/copilot-hooks.json +343 -0
  67. package/dist/index.js +97 -9
  68. package/dist/index.js.map +1 -1
  69. package/dist/schemas/common.d.ts.map +1 -1
  70. package/dist/schemas/common.js +10 -0
  71. package/dist/schemas/common.js.map +1 -1
  72. package/dist/schemas/utility.d.ts +1 -1
  73. package/dist/services/analysis-engine.d.ts +39 -0
  74. package/dist/services/analysis-engine.d.ts.map +1 -0
  75. package/dist/services/analysis-engine.js +107 -0
  76. package/dist/services/analysis-engine.js.map +1 -0
  77. package/dist/services/audit-logger.d.ts +67 -4
  78. package/dist/services/audit-logger.d.ts.map +1 -1
  79. package/dist/services/audit-logger.js +183 -9
  80. package/dist/services/audit-logger.js.map +1 -1
  81. package/dist/services/cross-analyzer.d.ts.map +1 -1
  82. package/dist/services/cross-analyzer.js +4 -3
  83. package/dist/services/cross-analyzer.js.map +1 -1
  84. package/dist/services/doc-generator.d.ts.map +1 -1
  85. package/dist/services/doc-generator.js +6 -4
  86. package/dist/services/doc-generator.js.map +1 -1
  87. package/dist/services/document-converter.d.ts +2 -1
  88. package/dist/services/document-converter.d.ts.map +1 -1
  89. package/dist/services/document-converter.js +12 -10
  90. package/dist/services/document-converter.js.map +1 -1
  91. package/dist/services/ears-validator.d.ts +6 -1
  92. package/dist/services/ears-validator.d.ts.map +1 -1
  93. package/dist/services/ears-validator.js +56 -21
  94. package/dist/services/ears-validator.js.map +1 -1
  95. package/dist/services/feature-package-generator.d.ts +32 -0
  96. package/dist/services/feature-package-generator.d.ts.map +1 -0
  97. package/dist/services/feature-package-generator.js +340 -0
  98. package/dist/services/feature-package-generator.js.map +1 -0
  99. package/dist/services/file-manager.d.ts +4 -0
  100. package/dist/services/file-manager.d.ts.map +1 -1
  101. package/dist/services/file-manager.js +21 -6
  102. package/dist/services/file-manager.js.map +1 -1
  103. package/dist/services/metrics-generator.d.ts.map +1 -1
  104. package/dist/services/metrics-generator.js +5 -4
  105. package/dist/services/metrics-generator.js.map +1 -1
  106. package/dist/services/pbt-generator.d.ts.map +1 -1
  107. package/dist/services/pbt-generator.js +10 -5
  108. package/dist/services/pbt-generator.js.map +1 -1
  109. package/dist/services/rbac-engine.d.ts.map +1 -1
  110. package/dist/services/rbac-engine.js +1 -0
  111. package/dist/services/rbac-engine.js.map +1 -1
  112. package/dist/services/state-machine.d.ts +23 -0
  113. package/dist/services/state-machine.d.ts.map +1 -1
  114. package/dist/services/state-machine.js +128 -53
  115. package/dist/services/state-machine.js.map +1 -1
  116. package/dist/services/template-engine.d.ts.map +1 -1
  117. package/dist/services/template-engine.js +2 -1
  118. package/dist/services/template-engine.js.map +1 -1
  119. package/dist/services/test-generator.d.ts.map +1 -1
  120. package/dist/services/test-generator.js +7 -5
  121. package/dist/services/test-generator.js.map +1 -1
  122. package/dist/services/work-item-exporter.d.ts.map +1 -1
  123. package/dist/services/work-item-exporter.js +7 -11
  124. package/dist/services/work-item-exporter.js.map +1 -1
  125. package/dist/tools/analysis.d.ts.map +1 -1
  126. package/dist/tools/analysis.js +1 -9
  127. package/dist/tools/analysis.js.map +1 -1
  128. package/dist/tools/audit.d.ts +4 -0
  129. package/dist/tools/audit.d.ts.map +1 -0
  130. package/dist/tools/audit.js +25 -0
  131. package/dist/tools/audit.js.map +1 -0
  132. package/dist/tools/checkpoint.d.ts.map +1 -1
  133. package/dist/tools/checkpoint.js +1 -3
  134. package/dist/tools/checkpoint.js.map +1 -1
  135. package/dist/tools/context.d.ts.map +1 -1
  136. package/dist/tools/context.js +1 -6
  137. package/dist/tools/context.js.map +1 -1
  138. package/dist/tools/documentation.d.ts.map +1 -1
  139. package/dist/tools/documentation.js +1 -9
  140. package/dist/tools/documentation.js.map +1 -1
  141. package/dist/tools/environment.d.ts.map +1 -1
  142. package/dist/tools/environment.js +1 -9
  143. package/dist/tools/environment.js.map +1 -1
  144. package/dist/tools/infrastructure.d.ts.map +1 -1
  145. package/dist/tools/infrastructure.js +1 -9
  146. package/dist/tools/infrastructure.js.map +1 -1
  147. package/dist/tools/input.d.ts.map +1 -1
  148. package/dist/tools/input.js +1 -9
  149. package/dist/tools/input.js.map +1 -1
  150. package/dist/tools/integration.d.ts.map +1 -1
  151. package/dist/tools/integration.js +8 -22
  152. package/dist/tools/integration.js.map +1 -1
  153. package/dist/tools/metrics.d.ts.map +1 -1
  154. package/dist/tools/metrics.js +1 -9
  155. package/dist/tools/metrics.js.map +1 -1
  156. package/dist/tools/pbt.d.ts.map +1 -1
  157. package/dist/tools/pbt.js +1 -9
  158. package/dist/tools/pbt.js.map +1 -1
  159. package/dist/tools/pipeline.d.ts.map +1 -1
  160. package/dist/tools/pipeline.js +80 -66
  161. package/dist/tools/pipeline.js.map +1 -1
  162. package/dist/tools/quality.d.ts.map +1 -1
  163. package/dist/tools/quality.js +7 -15
  164. package/dist/tools/quality.js.map +1 -1
  165. package/dist/tools/rbac.d.ts.map +1 -1
  166. package/dist/tools/rbac.js +19 -12
  167. package/dist/tools/rbac.js.map +1 -1
  168. package/dist/tools/routing.d.ts.map +1 -1
  169. package/dist/tools/routing.js +1 -6
  170. package/dist/tools/routing.js.map +1 -1
  171. package/dist/tools/testing.d.ts.map +1 -1
  172. package/dist/tools/testing.js +1 -9
  173. package/dist/tools/testing.js.map +1 -1
  174. package/dist/tools/tool-enforcement.d.ts +33 -0
  175. package/dist/tools/tool-enforcement.d.ts.map +1 -0
  176. package/dist/tools/tool-enforcement.js +214 -0
  177. package/dist/tools/tool-enforcement.js.map +1 -0
  178. package/dist/tools/tool-result.d.ts +18 -0
  179. package/dist/tools/tool-result.d.ts.map +1 -0
  180. package/dist/tools/tool-result.js +36 -0
  181. package/dist/tools/tool-result.js.map +1 -0
  182. package/dist/tools/transcript.d.ts.map +1 -1
  183. package/dist/tools/transcript.js +50 -24
  184. package/dist/tools/transcript.js.map +1 -1
  185. package/dist/tools/turnkey.d.ts.map +1 -1
  186. package/dist/tools/turnkey.js +22 -14
  187. package/dist/tools/turnkey.js.map +1 -1
  188. package/dist/tools/utility.d.ts.map +1 -1
  189. package/dist/tools/utility.js +2 -9
  190. package/dist/tools/utility.js.map +1 -1
  191. package/dist/tools/visualization.d.ts.map +1 -1
  192. package/dist/tools/visualization.js +1 -9
  193. package/dist/tools/visualization.js.map +1 -1
  194. package/dist/utils/http-auth.d.ts +9 -0
  195. package/dist/utils/http-auth.d.ts.map +1 -0
  196. package/dist/utils/http-auth.js +23 -0
  197. package/dist/utils/http-auth.js.map +1 -0
  198. package/dist/utils/id-contracts.d.ts +8 -0
  199. package/dist/utils/id-contracts.d.ts.map +1 -0
  200. package/dist/utils/id-contracts.js +23 -0
  201. package/dist/utils/id-contracts.js.map +1 -0
  202. package/dist/utils/runtime-context.d.ts +5 -0
  203. package/dist/utils/runtime-context.d.ts.map +1 -0
  204. package/dist/utils/runtime-context.js +37 -0
  205. package/dist/utils/runtime-context.js.map +1 -0
  206. package/dist/utils/slug.d.ts +14 -0
  207. package/dist/utils/slug.d.ts.map +1 -0
  208. package/dist/utils/slug.js +22 -0
  209. package/dist/utils/slug.js.map +1 -0
  210. package/dist/utils/token-table.d.ts +41 -0
  211. package/dist/utils/token-table.d.ts.map +1 -0
  212. package/dist/utils/token-table.js +103 -0
  213. package/dist/utils/token-table.js.map +1 -0
  214. package/package.json +3 -3
  215. package/.claude-plugin/hooks.json +0 -5
  216. package/.claude-plugin/plugin.json +0 -28
  217. package/dist/templates/onboarding.md +0 -49
  218. package/templates/onboarding.md +0 -49
@@ -2,8 +2,6 @@
2
2
  name: design-architect
3
3
  description: Phase 4 agent that writes DESIGN.md with system architecture, API contracts, data models, and Mermaid diagrams. All design decisions trace to specification requirements.
4
4
 
5
- model: claude-opus-4-7
6
- model_fallback: ["claude-opus-4-6", "claude-sonnet-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: blue
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "sdd_write_design", "sdd_generate_all_diagrams", "sdd_generate_diagram"]
9
7
  ---
@@ -2,8 +2,6 @@
2
2
  name: implementer
3
3
  description: Use this agent to generate implementation plans, quality checklists, test stubs, and infrastructure scaffolding from specifications.
4
4
 
5
- model: claude-sonnet-4-6
6
- model_fallback: ["codex", "gpt-5", "claude-opus-4-6"]
7
5
  color: blue
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "MultiEdit", "Bash", "sdd_implement", "sdd_checklist", "sdd_generate_tests", "sdd_generate_pbt", "sdd_generate_iac", "sdd_generate_dockerfile", "sdd_generate_devcontainer", "sdd_setup_local_env", "sdd_setup_codespaces"]
9
7
  ---
@@ -2,8 +2,6 @@
2
2
  name: quality-reviewer
3
3
  description: Phase 6 agent that runs completeness audit, cross-analysis, and compliance checks. Produces ANALYSIS.md with gate decision (APPROVE/CONDITIONAL/REJECT) and COMPLIANCE.md.
4
4
 
5
- model: claude-opus-4-7
6
- model_fallback: ["claude-opus-4-6", "claude-sonnet-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: red
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "Bash", "sdd_run_analysis", "sdd_cross_analyze", "sdd_compliance_check", "sdd_check_sync", "sdd_metrics"]
9
7
  ---
@@ -2,8 +2,6 @@
2
2
  name: release-engineer
3
3
  description: Use this agent to prepare features for release — run blocking gates, generate documentation, create PR, and export work items.
4
4
 
5
- model: claude-haiku-4-5
6
- model_fallback: ["claude-sonnet-4-6", "gpt-4.5"]
7
5
  color: green
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "Bash", "sdd_create_pr", "sdd_generate_all_docs", "sdd_generate_docs", "sdd_generate_api_docs", "sdd_generate_runbook", "sdd_generate_onboarding", "sdd_export_work_items"]
9
7
  ---
@@ -2,10 +2,8 @@
2
2
  name: requirements-engineer
3
3
  description: Use this agent to analyze raw input and produce validated FRD and NFRD documents ready for sdd_init.
4
4
 
5
- model: claude-opus-4-7
6
- model_fallback: ["claude-opus-4-6", "claude-sonnet-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: magenta
8
- tools: ["Read", "Glob", "Grep", "Write", "Edit", "sdd_discover", "sdd_import_document", "sdd_import_transcript", "sdd_batch_import", "sdd_validate_ears"]
6
+ tools: ["Read", "Glob", "Grep", "Write", "Edit", "sdd_init", "sdd_discover", "sdd_import_document", "sdd_import_transcript", "sdd_batch_import", "sdd_validate_ears"]
9
7
  ---
10
8
 
11
9
  <example>
@@ -2,8 +2,6 @@
2
2
  name: research-analyst
3
3
  description: Use this agent to gather technical context before specification. Scans codebases, imports documents, and produces RESEARCH.md.
4
4
 
5
- model: claude-sonnet-4-6
6
- model_fallback: ["claude-opus-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: cyan
8
6
  tools: ["Read", "Glob", "Grep", "Bash", "WebFetch", "WebSearch", "sdd_scan_codebase", "sdd_discover", "sdd_research", "sdd_import_document", "sdd_import_transcript", "sdd_check_ecosystem"]
9
7
  ---
@@ -2,8 +2,6 @@
2
2
  name: sdd-clarify
3
3
  description: Use this agent to find and resolve ambiguities in requirements, validate EARS patterns, and produce a clarification log.
4
4
 
5
- model: claude-opus-4-7
6
- model_fallback: ["claude-opus-4-6", "claude-sonnet-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: yellow
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "sdd_clarify", "sdd_validate_ears", "sdd_turnkey_spec"]
9
7
  ---
@@ -2,8 +2,6 @@
2
2
  name: sdd-init
3
3
  description: Use this agent to initialize the SDD pipeline for a new feature. Creates the .specs/ directory structure and CONSTITUTION.md.
4
4
 
5
- model: claude-haiku-4-5
6
- model_fallback: ["claude-sonnet-4-6", "gpt-4.5"]
7
5
  color: green
8
6
  tools: ["Read", "Glob", "Grep", "Bash", "sdd_init", "sdd_scan_codebase"]
9
7
  ---
@@ -2,18 +2,16 @@
2
2
  name: spec-engineer
3
3
  description: Phase 2 agent that writes SPECIFICATION.md using EARS notation. Every requirement gets a unique REQ-ID, one of the 6 EARS patterns, and measurable acceptance criteria.
4
4
 
5
- model: claude-opus-4-7
6
- model_fallback: ["claude-opus-4-6", "claude-sonnet-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: magenta
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "sdd_write_spec", "sdd_turnkey_spec", "sdd_validate_ears", "sdd_figma_to_spec"]
9
7
  ---
10
8
 
11
9
  <example>
12
- Context: Research phase is complete, ready to specify
10
+ Context: Discovery is complete, ready to specify
13
11
  user: "Write the specification for feature 001"
14
12
  assistant: "I'll create SPECIFICATION.md with EARS requirements and validate all patterns."
15
13
  <commentary>
16
- Post-research specification writing is Phase 2.
14
+ Post-discovery specification writing is the Specify phase.
17
15
  </commentary>
18
16
  </example>
19
17
 
@@ -2,10 +2,8 @@
2
2
  name: specky-onboarding
3
3
  description: Default entry point and interactive wizard for Specky SDD. Detects project context, explains the plugin, guides through project type selection, work mode, and branch setup. Triggered when user says "specky" without specifics.
4
4
 
5
- model: claude-haiku-4-5
6
- model_fallback: ["claude-sonnet-4-6", "gpt-4.5"]
7
5
  color: green
8
- tools: ["Read", "Glob", "Grep", "Bash", "Write", "sdd_get_status", "sdd_scan_codebase", "sdd_check_ecosystem", "sdd_context_status"]
6
+ tools: ["Read", "Glob", "Grep", "Bash", "Write", "sdd_get_status", "sdd_scan_codebase", "sdd_check_ecosystem", "sdd_context_status", "sdd_auto_pipeline", "sdd_batch_import", "sdd_create_branch", "sdd_discover", "sdd_figma_to_spec", "sdd_import_document", "sdd_import_transcript"]
9
7
  ---
10
8
 
11
9
  <example>
@@ -67,8 +65,8 @@ You are the Specky SDD onboarding wizard. You are the **default entry point** wh
67
65
  - 13 agents with purpose and phase
68
66
  - 22 prompts grouped by use case
69
67
  - 8 skills with trigger conditions
70
- - 57 MCP tools by category
71
- - 14 hook scripts (10 advisory + 4 validation)
68
+ - 58 MCP tools by category
69
+ - 16 hook scripts (12 advisory + 4 blocking)
72
70
 
73
71
  **Hard rules:**
74
72
  - Always detect existing context first (never assume empty project)
@@ -2,8 +2,6 @@
2
2
  name: specky-orchestrator
3
3
  description: Master agent that coordinates the full SDD 10-phase pipeline end-to-end, routing to phase agents, validating artifacts between phases, and enforcing hooks and LGTM gates.
4
4
 
5
- model: claude-sonnet-4-6
6
- model_fallback: ["claude-opus-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: purple
8
6
  tools: ["Read", "Glob", "Grep", "Bash", "Task", "sdd_get_status", "sdd_advance_phase", "sdd_checkpoint", "sdd_validate_ears", "sdd_model_routing", "sdd_context_status"]
9
7
  ---
@@ -60,4 +58,4 @@ You are the Specky SDD pipeline orchestrator. You coordinate the full 10-phase p
60
58
  - Always pause at LGTM gates (Phases 2, 4, 5) for human review
61
59
  - Always checkpoint before advancing to next phase
62
60
  - Never modify artifacts — you coordinate, not author
63
- - Report model routing hint per phase (Haiku/Sonnet/Opus)
61
+ - Report model routing hint per phase using capability classes (fast, balanced, reasoning-focused). Let the user pick any available model.
@@ -2,8 +2,6 @@
2
2
  name: task-planner
3
3
  description: Phase 5 agent that writes TASKS.md with dependency-resolved task sequences, REQ-ID traceability, complexity estimates, and parallel markers. Also generates CHECKLIST.md.
4
4
 
5
- model: claude-sonnet-4-6
6
- model_fallback: ["claude-opus-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: orange
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "sdd_write_tasks", "sdd_checklist"]
9
7
  ---
@@ -2,8 +2,6 @@
2
2
  name: test-verifier
3
3
  description: Use this agent to verify test coverage, detect phantom completions, and check spec-code drift.
4
4
 
5
- model: claude-opus-4-7
6
- model_fallback: ["claude-opus-4-6", "claude-sonnet-4-6", "gpt-5", "gpt-4.5"]
7
5
  color: yellow
8
6
  tools: ["Read", "Glob", "Grep", "Edit", "Write", "Bash", "sdd_verify_tests", "sdd_verify_tasks", "sdd_check_sync", "sdd_validate_ears", "sdd_get_status"]
9
7
  ---
@@ -2,12 +2,15 @@
2
2
  # branch-validator.sh — Validate git branch matches expected pattern for current tool.
3
3
  #
4
4
  # Type: Mixed (see below) | Trigger: PreToolUse | All phases
5
- # • Advisory (exit 0, warn) for sdd_* pipeline tools
6
- # • BLOCKING (exit 2) for Write|Edit|MultiEdit when a pipeline is active
7
- # on a non-spec branch — prevents the SIFAP-style bypass where user
8
- # edits code from impl/* instead of spec/NNN-*.
5
+ # • Advisory (exit 0, warn) for sdd_* pipeline tools (always).
6
+ # • For native edit tools (Write|Edit|MultiEdit) on a wrong branch during
7
+ # an active pipeline:
8
+ # - default (SPECKY_GUARD unset OR "off"/"advisory") → warn, exit 0
9
+ # - SPECKY_GUARD=strict → exit 2 (BLOCK)
9
10
  #
10
- # Escape hatch: SPECKY_GUARD=off allows bypass with warning (deprecated v3.6).
11
+ # Rationale (rc.13): rc.10-rc.12 defaulted Write|Edit|MultiEdit to BLOCKING,
12
+ # which burned pilots who run `specky init` and then edit anything from
13
+ # develop/main. Enforcement is now explicit opt-in.
11
14
 
12
15
  set -euo pipefail
13
16
 
@@ -15,51 +18,53 @@ TOOL="${SDD_TOOL_NAME:-unknown}"
15
18
  CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n' || true)
16
19
  [ -z "$CURRENT_BRANCH" ] && CURRENT_BRANCH="unknown"
17
20
 
18
- # ── BLOCKING path for native edit tools when pipeline is active ──
21
+ # Mode selection (rc.13): strict = block, anything else = advisory.
22
+ SPECKY_GUARD_MODE="${SPECKY_GUARD:-advisory}"
23
+ if [ "$SPECKY_GUARD_MODE" = "off" ]; then
24
+ SPECKY_GUARD_MODE="advisory"
25
+ fi
26
+
27
+ # ── Branch enforcement for native edit tools when pipeline is active ──
19
28
  if [[ "$TOOL" == "Write" || "$TOOL" == "Edit" || "$TOOL" == "MultiEdit" ]]; then
20
- # Check if a pipeline is active (same logic as pipeline-guard)
21
29
  LATEST=$(ls -td .specs/*/ 2>/dev/null | head -1 || true)
22
30
  if [ -z "$LATEST" ]; then exit 0; fi
23
31
  STATE="$LATEST/.sdd-state.json"
24
32
  if [ ! -f "$STATE" ]; then exit 0; fi
25
33
 
26
- # Escape hatch
27
- if [ "${SPECKY_GUARD:-on}" = "off" ]; then
28
- echo "⚠️ [branch-validator] SPECKY_GUARD=off — allowing edit on '$CURRENT_BRANCH'" >&2
29
- exit 0
30
- fi
31
-
32
34
  PHASE="?"
33
35
  if command -v jq >/dev/null 2>&1; then
34
36
  PHASE=$(jq -r '.phase // "?"' "$STATE" 2>/dev/null || echo "?")
35
37
  fi
36
38
 
39
+ FEATURE=$(basename "$LATEST")
40
+
41
+ emit_violation() {
42
+ local expected="$1"
43
+ if [ "$SPECKY_GUARD_MODE" = "strict" ]; then
44
+ echo "" >&2
45
+ echo "🚫 [branch-validator] BLOCKED — $TOOL on '$CURRENT_BRANCH' (phase $PHASE expects $expected) [SPECKY_GUARD=strict]" >&2
46
+ echo " Feature: $FEATURE" >&2
47
+ echo " Fix: git checkout $expected (or: git checkout -b spec/$FEATURE)" >&2
48
+ echo " Disable: unset SPECKY_GUARD" >&2
49
+ exit 2
50
+ fi
51
+ echo "⚠️ [branch-validator] $TOOL on '$CURRENT_BRANCH' during phase $PHASE (expected $expected). Enforce with: export SPECKY_GUARD=strict" >&2
52
+ }
53
+
37
54
  case "$PHASE" in
38
55
  0|1|2|3|4|5|6|7)
39
56
  if [[ "$CURRENT_BRANCH" != spec/* ]]; then
40
- echo "" >&2
41
- echo "🚫 [branch-validator] BLOCKED — edit on non-spec branch during active pipeline" >&2
42
- echo "" >&2
43
- echo " Branch: $CURRENT_BRANCH" >&2
44
- echo " Phase: $PHASE (expects spec/NNN-*)" >&2
45
- echo " Feature: $(basename "$LATEST")" >&2
46
- echo "" >&2
47
- echo " Fix: git checkout -b spec/$(basename "$LATEST")" >&2
48
- echo " Bypass: export SPECKY_GUARD=off (deprecated, removed v3.6)" >&2
49
- echo "" >&2
50
- exit 2
57
+ emit_violation "spec/$FEATURE"
51
58
  fi
52
59
  ;;
53
60
  8)
54
61
  if [[ "$CURRENT_BRANCH" != "develop" ]]; then
55
- echo "🚫 [branch-validator] BLOCKED — Phase 8 requires 'develop' branch (you are on '$CURRENT_BRANCH')" >&2
56
- exit 2
62
+ emit_violation "develop"
57
63
  fi
58
64
  ;;
59
65
  9)
60
66
  if [[ "$CURRENT_BRANCH" != "stage" ]]; then
61
- echo "🚫 [branch-validator] BLOCKED — Phase 9 requires 'stage' branch (you are on '$CURRENT_BRANCH')" >&2
62
- exit 2
67
+ emit_violation "stage"
63
68
  fi
64
69
  ;;
65
70
  esac
@@ -56,7 +56,7 @@ case "$TOOL" in
56
56
  sdd_write_tasks)
57
57
  check_created "TASKS.md" "TASKS.md"
58
58
  check_has_content "TASKS.md" "REQ-[A-Z]+-[0-9]+" "REQ-ID traceability" 1
59
- check_has_content "TASKS.md" "TASK-[0-9]+" "Task IDs" 3
59
+ check_has_content "TASKS.md" "T-?[0-9]{3}" "Task IDs" 3
60
60
  ;;
61
61
  sdd_verify_tests|sdd_verify_tasks)
62
62
  check_created "VERIFICATION.md" "VERIFICATION.md"
@@ -1,14 +1,19 @@
1
1
  #!/bin/bash
2
- # pipeline-guard.sh — Enforce Rule #8: all work flows through @specky-orchestrator.
2
+ # pipeline-guard.sh — Remind about Rule #8: all work flows through @specky-orchestrator.
3
3
  # Target: Claude Code (.claude/hooks/) + GitHub Copilot (.github/hooks/specky/)
4
- # Type: BLOCKING (exit 2) | Trigger: UserPromptSubmit
4
+ # Type: ADVISORY by default (warn, exit 0) | Trigger: UserPromptSubmit
5
5
  # Phase: any — runs on every user prompt when .specs/ has an active pipeline
6
6
  #
7
- # Behavior:
8
- # • If no .specs/ OR no active .sdd-state.json → exit 0 (pipeline-guard OFF).
9
- # • If SPECKY_GUARD=off env var is set → exit 0 with warning.
10
- # • If user prompt mentions orchestrator / onboarding / specky exit 0.
11
- # • If user prompt looks like a free-form code/build/edit request → exit 2 (BLOCK).
7
+ # Behavior (rc.13 — flipped polarity after field incident):
8
+ # • If no .specs/ OR no active .sdd-state.json → exit 0 silently.
9
+ # • Default (SPECKY_GUARD unset OR "off"/"advisory")print warning, exit 0.
10
+ # • Only when SPECKY_GUARD=strict exit 2 (BLOCK) on free-form edit prompts.
11
+ #
12
+ # Rationale: rc.10-rc.12 defaulted this to BLOCKING, which fired on every
13
+ # developer prompt containing common words (create, add, fix, test, install…).
14
+ # Copilot surfaced every block as "Blocked by Pre-Tool Use hook", making the
15
+ # IDE unusable. Enforcement is now explicit opt-in until the UX for
16
+ # resuming/routing through @specky-orchestrator is polished.
12
17
  #
13
18
  # The user's prompt is read from stdin (Claude Code passes prompt as JSON on stdin)
14
19
  # OR from env var $CLAUDE_USER_PROMPT (Copilot). We try both.
@@ -18,12 +23,34 @@
18
23
 
19
24
  set -euo pipefail
20
25
 
21
- # ── Escape hatch ─────────────────────────────────────────
22
- if [ "${SPECKY_GUARD:-on}" = "off" ]; then
23
- echo "⚠️ [pipeline-guard] SPECKY_GUARD=off bypass allowed (deprecated, removed in v3.6)" >&2
26
+ # ── rc.14: Copilot compatibility guard ───────────────────
27
+ # VS Code Copilot reads .claude/settings.json hooks and treats SessionStart/
28
+ # UserPromptSubmit as PreToolUse. When that happens, this script is invoked for
29
+ # every tool call (Read, Glob, Grep…). The script tries to read the user prompt
30
+ # from stdin but Copilot sends tool-call data instead → jq fails → cat hangs
31
+ # → 5s timeout → "Blocked by Pre-Tool Use hook".
32
+ #
33
+ # Detection: Claude Code sets CLAUDE_PROJECT_DIR for its hooks. Copilot doesn't.
34
+ # Also: if SDD_TOOL_NAME is set, we're being called as PreToolUse (not our event).
35
+ if [ -z "${CLAUDE_PROJECT_DIR:-}" ] && [ -n "${SDD_TOOL_NAME:-}" ]; then
36
+ exit 0
37
+ fi
38
+ # Fallback: if no stdin is available and no CLAUDE_USER_PROMPT, skip gracefully.
39
+ # Non-interactive stdin may contain a real prompt JSON payload in Claude Code
40
+ # or in the test harness, so only skip when stdin is interactive.
41
+ if [ -z "${CLAUDE_USER_PROMPT:-}" ] && [ -z "${CLAUDE_PROJECT_DIR:-}" ] && [ -t 0 ]; then
24
42
  exit 0
25
43
  fi
26
44
 
45
+ # ── Mode selection ───────────────────────────────────────
46
+ # strict → block free-form edit prompts (exit 2)
47
+ # advisory|off|<unset> → warn only (exit 0)
48
+ SPECKY_GUARD_MODE="${SPECKY_GUARD:-advisory}"
49
+ if [ "$SPECKY_GUARD_MODE" = "off" ]; then
50
+ # Back-compat alias: treat explicit "off" as advisory (still warn).
51
+ SPECKY_GUARD_MODE="advisory"
52
+ fi
53
+
27
54
  # ── Check if pipeline is active ──────────────────────────
28
55
  LATEST=$(ls -td .specs/*/ 2>/dev/null | head -1 || true)
29
56
  if [ -z "$LATEST" ]; then
@@ -72,29 +99,35 @@ if echo "$PROMPT_LC" | grep -qE '^(what|why|how|where|when|show|list|explain|des
72
99
  exit 0
73
100
  fi
74
101
 
75
- # ── Blocklist: free-form code / build / edit requests ──
76
- # Keywords that trigger when a pipeline is active.
102
+ # ── Edit-intent detection ──
103
+ # Keywords that hint at free-form code/build/edit requests when a pipeline is active.
77
104
  # Pattern: keyword must be preceded and followed by a non-alphanumeric (or bounds).
78
105
  if echo "$PROMPT_LC" | grep -qE '(^|[^a-z0-9])(implement|create|build|write|code|fix|add|refactor|deploy|release|merge|commit|push|test|install|setup|configure)([^a-z0-9]|$)'; then
79
- echo "" >&2
80
- echo "🚫 [pipeline-guard] BLOCKED — active Specky pipeline detected" >&2
81
- echo "" >&2
82
- echo " Feature: $FEATURE" >&2
83
- echo " Phase: $PHASE" >&2
84
- echo " State: $STATE" >&2
85
- echo "" >&2
86
- echo " Rule #8 (copilot-instructions.md): ALL work must flow through @specky-orchestrator." >&2
87
- echo "" >&2
88
- echo " What to do:" >&2
89
- echo " • Resume: invoke @specky-orchestrator (Copilot) or /specky-orchestrate (Claude)" >&2
90
- echo " • Status: npx specky status" >&2
91
- echo " • Help: invoke @specky-onboarding (Copilot) or /specky-onboarding (Claude)" >&2
92
- echo "" >&2
93
- echo " Emergency bypass (logs warning, deprecated in v3.6):" >&2
94
- echo " export SPECKY_GUARD=off" >&2
95
- echo "" >&2
96
- exit 2
106
+ if [ "$SPECKY_GUARD_MODE" = "strict" ]; then
107
+ echo "" >&2
108
+ echo "🚫 [pipeline-guard] BLOCKED — active Specky pipeline detected (SPECKY_GUARD=strict)" >&2
109
+ echo "" >&2
110
+ echo " Feature: $FEATURE" >&2
111
+ echo " Phase: $PHASE" >&2
112
+ echo " State: $STATE" >&2
113
+ echo "" >&2
114
+ echo " Rule #8 (copilot-instructions.md): ALL work must flow through @specky-orchestrator." >&2
115
+ echo "" >&2
116
+ echo " What to do:" >&2
117
+ echo " • Resume: invoke @specky-orchestrator (Copilot) or /specky-orchestrate (Claude)" >&2
118
+ echo " • Status: specky status (or: npx specky status)" >&2
119
+ echo " • Help: invoke @specky-onboarding (Copilot) or /specky-onboarding (Claude)" >&2
120
+ echo "" >&2
121
+ echo " Disable enforcement (default):" >&2
122
+ echo " unset SPECKY_GUARD # or: export SPECKY_GUARD=advisory" >&2
123
+ echo "" >&2
124
+ exit 2
125
+ fi
126
+
127
+ # Advisory mode (default): warn but allow.
128
+ echo "⚠️ [pipeline-guard] active Specky pipeline ($FEATURE, phase $PHASE) — consider routing through @specky-orchestrator." >&2
129
+ echo " Enforce blocking with: export SPECKY_GUARD=strict" >&2
97
130
  fi
98
131
 
99
- # Default: allow (ambiguous prompt — err on side of not blocking legitimate work)
132
+ # Default: allow.
100
133
  exit 0
@@ -10,6 +10,14 @@
10
10
 
11
11
  set -euo pipefail
12
12
 
13
+ # ── rc.14: Copilot compatibility guard ───────────────────
14
+ # VS Code Copilot reads .claude/settings.json hooks and treats SessionStart as
15
+ # PreToolUse. This script is advisory-only but Copilot surfaces any output from
16
+ # a hook as a block warning. Skip entirely when not in Claude Code context.
17
+ if [ -z "${CLAUDE_PROJECT_DIR:-}" ]; then
18
+ exit 0
19
+ fi
20
+
13
21
  SPECS_DIR=".specs"
14
22
  [ -d "$SPECS_DIR" ] || exit 0
15
23
 
@@ -43,7 +51,7 @@ printf "│ Branch: %-50s│\n" "$BRANCH"
43
51
  echo "├─────────────────────────────────────────────────────────────┤"
44
52
  echo "│ Resume: @specky-orchestrator (Copilot) │"
45
53
  echo "│ /specky-orchestrate (Claude Code) │"
46
- echo "│ Status: npx specky status │"
54
+ echo "│ Status: specky status (or npx specky status) │"
47
55
  echo "│ New work: @specky-onboarding │"
48
56
  echo "╰─────────────────────────────────────────────────────────────╯"
49
57
  echo ""
@@ -6,7 +6,7 @@ This project uses Spec-Driven Development (SDD) via the Specky pipeline.
6
6
 
7
7
  1. **EARS notation is mandatory.** Every requirement must follow one of the 6 EARS patterns.
8
8
  2. **REQ-ID traceability is non-negotiable.** Every test, task, and design decision traces to a REQ-ID.
9
- 3. **Model routing matters.** Use Haiku for scaffolding (Phase 0, 9), Sonnet for iteration (Phase 1, 5-7), Opus for reasoning (Phase 2-4, 8).
9
+ 3. **Model routing matters.** Use a fast model class for lightweight scaffolding (Phase 0, 9), a balanced model class for iterative delivery (Phase 1, 5-7), and a reasoning-focused model class for complex analysis and design (Phase 2-4, 8). The user chooses any available model.
10
10
  4. **Never skip hooks.** Blocking hooks (security-scan, release-gate) must pass before release.
11
11
  5. **Artifacts live in `.specs/NNN-feature/`.** CONSTITUTION.md, RESEARCH.md, SPECIFICATION.md, DESIGN.md, TASKS.md, VERIFICATION.md, ANALYSIS.md.
12
12
  6. **One branch per spec.** Create `spec/NNN-feature-name` from `develop` for all pipeline work (Phases 0-7). All `.specs/` artifacts are created on this branch. Merge to `develop` after verification, then `stage` for QA and release gates, then `main` for production. Never commit spec work directly to develop, stage, or main.
@@ -61,7 +61,7 @@ Hooks fire automatically on MCP tool calls:
61
61
 
62
62
  ## MCP Server
63
63
 
64
- The specky-sdd MCP server (57 tools) is configured in .vscode/mcp.json and runs via npx.
64
+ The specky-sdd MCP server (58 tools) is configured in .vscode/mcp.json and runs via npx.
65
65
 
66
66
  ## EARS Patterns
67
67
 
@@ -193,7 +193,7 @@ version: "1.2.3"
193
193
  revision_history:
194
194
  - version: "1.2.3"
195
195
  date: "2026-04-15"
196
- author: "Claude Opus"
196
+ author: "GitHub Copilot"
197
197
  changes: "Added security requirements REQ-SEC-001 to REQ-SEC-005"
198
198
  - version: "1.2.2"
199
199
  date: "2026-04-14"
@@ -201,7 +201,7 @@ revision_history:
201
201
  changes: "Clarified API response format in REQ-API-003"
202
202
  - version: "1.2.1"
203
203
  date: "2026-04-13"
204
- author: "Claude Opus"
204
+ author: "GitHub Copilot"
205
205
  changes: "Fixed typo in REQ-AUTH-002"
206
206
  ```
207
207
 
@@ -51,32 +51,32 @@ EARS (Easy Approach to Requirements Syntax) provides five core patterns plus a c
51
51
  6. **Complex** — Combination patterns for intricate business logic.
52
52
  - Example: "If user role is editor, when publish button is clicked, then system shall validate content and if valid shall queue for approval."
53
53
 
54
- ## Model Routing Table
54
+ ## Model Recommendation Table
55
55
 
56
- Route specification and implementation tasks to models based on phase complexity:
56
+ Recommend a model capability class per phase. Do not hardcode a vendor-specific model ID. Let the user choose any available model.
57
57
 
58
- | Phase | Model | Reasoning |
59
- |-------|-------|-----------|
60
- | 0 (Init) | Haiku | Basic scope definition, lightweight |
61
- | 1 (Discover) | Sonnet | Multi-source synthesis, ecosystem analysis |
62
- | 2 (Specify) | Opus | Complex requirement formalization, EARS patterns |
63
- | 3 (Clarify) | Opus | Interactive refinement, stakeholder context |
64
- | 4 (Design) | Opus | Architecture decisions, multi-component systems |
65
- | 5 (Tasks) | Sonnet | Work breakdown, dependency mapping |
66
- | 6 (Analyze) | Sonnet | Cross-artifact analysis, compliance checks |
67
- | 7 (Implement) | Sonnet | Code scaffolding, quality checklists |
68
- | 8 (Verify) | Opus | Coverage analysis, drift detection |
69
- | 9 (Release) | Haiku | Final gates, documentation assembly |
58
+ | Phase | Recommended Class | Reasoning |
59
+ |-------|-------------------|-----------|
60
+ | 0 (Init) | Fast | Basic scope definition and scaffolding |
61
+ | 1 (Discover) | Balanced | Multi-source synthesis and ecosystem analysis |
62
+ | 2 (Specify) | Reasoning-focused | Complex requirement formalization and EARS patterns |
63
+ | 3 (Clarify) | Reasoning-focused | Ambiguity detection and refinement |
64
+ | 4 (Design) | Reasoning-focused | Architecture decisions and trade-off analysis |
65
+ | 5 (Tasks) | Balanced | Work breakdown and dependency mapping |
66
+ | 6 (Analyze) | Balanced | Cross-artifact analysis and compliance checks |
67
+ | 7 (Implement) | Balanced | Iterative implementation with executable feedback |
68
+ | 8 (Verify) | Reasoning-focused | Coverage analysis and drift detection |
69
+ | 9 (Release) | Fast | Deterministic final gates and documentation assembly |
70
70
 
71
- ## Extended Thinking Impact
71
+ ## Extended Reasoning Guidance
72
72
 
73
73
  Reference: **arXiv:2502.08235** — "Extended Thinking and Specification Quality in Large Language Models"
74
74
 
75
- Key finding for Phase 7 (Implementation): Enabling extended thinking (chain-of-thought) reduces quality by 30% while increasing cost by 43% in code generation tasks. Recommendation: Use standard inference for Phase 7 scaffolding; reserve extended thinking for Phase 8 verification.
75
+ For Phase 7 (Implementation), prioritize fast feedback loops over long reasoning traces. Reserve deeper reasoning for ambiguous design and verification tasks.
76
76
 
77
77
  ## Hook System
78
78
 
79
- The pipeline includes 14 automation hooks for customization:
79
+ The pipeline includes 16 automation hooks for customization:
80
80
 
81
81
  **Blocking Hooks** (workflow stops if hook fails — exit code 2):
82
82
  1. `artifact-validator` — Pre-tool: blocks if required artifacts missing
@@ -126,11 +126,14 @@ Hooks are configured in `sdd-hooks.json` with PreToolUse and PostToolUse matcher
126
126
 
127
127
  **Agent-based:**
128
128
  ```
129
- @specky-sdd-agent init feature-name
130
- @specky-sdd-agent specify --input=RESEARCH.md
131
- @specky-sdd-agent implement --model=sonnet
129
+ @specky-orchestrator (end-to-end pipeline coordinator)
130
+ @sdd-init feature-name (Phase 0 — initialize feature)
131
+ @spec-engineer (Phase 2 — write SPECIFICATION.md)
132
+ @implementer (Phase 7 — scaffold code + tests)
132
133
  ```
133
134
 
135
+ See [copilot-instructions.instructions.md](../../instructions/copilot-instructions.instructions.md) for the full agent catalog.
136
+
134
137
  ## Workflow Entry Points
135
138
 
136
139
  - **Greenfield** — Start at Phase 0 with new project initialization
@@ -221,17 +224,17 @@ git push origin main --tags
221
224
 
222
225
  ## Agent Routing
223
226
 
224
- | Phase | Agent | Model |
225
- |-------|-------|-------|
226
- | Pre | @specky-onboarding | Haiku |
227
- | All | @specky-orchestrator | Sonnet |
228
- | 0 | @sdd-init | Haiku |
229
- | 1 | @research-analyst | Sonnet |
230
- | 2 | @spec-engineer | Opus |
231
- | 3 | @sdd-clarify | Opus |
232
- | 4 | @design-architect | Opus |
233
- | 5 | @task-planner | Sonnet |
234
- | 6 | @quality-reviewer | Sonnet |
235
- | 7 | @implementer | Sonnet |
236
- | 8 | @test-verifier | Opus |
237
- | 9 | @release-engineer | Haiku |
227
+ | Phase | Agent | Recommended Class |
228
+ |-------|-------|-------------------|
229
+ | Pre | @specky-onboarding | Fast |
230
+ | All | @specky-orchestrator | Balanced |
231
+ | 0 | @sdd-init | Fast |
232
+ | 1 | @research-analyst | Balanced |
233
+ | 2 | @spec-engineer | Reasoning-focused |
234
+ | 3 | @sdd-clarify | Reasoning-focused |
235
+ | 4 | @design-architect | Reasoning-focused |
236
+ | 5 | @task-planner | Balanced |
237
+ | 6 | @quality-reviewer | Balanced |
238
+ | 7 | @implementer | Balanced |
239
+ | 8 | @test-verifier | Reasoning-focused |
240
+ | 9 | @release-engineer | Fast |