specweave 0.23.16 → 0.24.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 (227) hide show
  1. package/.claude-plugin/marketplace.json +93 -38
  2. package/CLAUDE.md +159 -11
  3. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  4. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +57 -0
  5. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  6. package/dist/src/cli/commands/sync-spec-content.js +3 -0
  7. package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
  8. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  9. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  10. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  11. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  13. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  15. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  16. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  17. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  18. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  19. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  20. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  21. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  22. package/dist/src/cli/helpers/smart-filter.js +265 -0
  23. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  24. package/dist/src/core/progress/progress-tracker.d.ts +4 -1
  25. package/dist/src/core/progress/progress-tracker.d.ts.map +1 -1
  26. package/dist/src/core/progress/progress-tracker.js +33 -4
  27. package/dist/src/core/progress/progress-tracker.js.map +1 -1
  28. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  29. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  30. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  31. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  32. package/dist/src/core/qa/risk-calculator.js +2 -2
  33. package/dist/src/core/spec-content-sync.d.ts +1 -1
  34. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  35. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  36. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  37. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  38. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  39. package/dist/src/integrations/ado/ado-dependency-loader.d.ts +1 -1
  40. package/dist/src/integrations/ado/ado-dependency-loader.d.ts.map +1 -1
  41. package/dist/src/integrations/ado/ado-dependency-loader.js +39 -7
  42. package/dist/src/integrations/ado/ado-dependency-loader.js.map +1 -1
  43. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  44. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  45. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  46. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  47. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  48. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  49. package/dist/src/integrations/jira/filter-processor.js +207 -0
  50. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  51. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  52. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  53. package/dist/src/integrations/jira/jira-client.js +33 -0
  54. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  55. package/dist/src/utils/ac-embedder.d.ts +63 -0
  56. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  57. package/dist/src/utils/ac-embedder.js +217 -0
  58. package/dist/src/utils/ac-embedder.js.map +1 -0
  59. package/dist/src/utils/env-manager.d.ts +86 -0
  60. package/dist/src/utils/env-manager.d.ts.map +1 -0
  61. package/dist/src/utils/env-manager.js +188 -0
  62. package/dist/src/utils/env-manager.js.map +1 -0
  63. package/package.json +1 -1
  64. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  65. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  66. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  67. package/plugins/specweave/commands/specweave-do.md +37 -0
  68. package/plugins/specweave/commands/specweave-done.md +159 -0
  69. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  70. package/plugins/specweave/commands/specweave-next.md +148 -3
  71. package/plugins/specweave/commands/specweave-qa.md +2 -2
  72. package/plugins/specweave/hooks/lib/migrate-increment-work.sh +1 -1
  73. package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +245 -0
  74. package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
  75. package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +149 -0
  76. package/plugins/specweave/hooks/lib/update-status-line.sh +34 -4
  77. package/plugins/specweave/hooks/lib/validate-spec-status.sh +1 -1
  78. package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +163 -0
  79. package/plugins/specweave/hooks/post-first-increment.sh +1 -1
  80. package/plugins/specweave/hooks/post-first-increment.sh.bak +61 -0
  81. package/plugins/specweave/hooks/post-spec-update.sh +1 -1
  82. package/plugins/specweave/hooks/post-spec-update.sh.bak +158 -0
  83. package/plugins/specweave/hooks/post-user-story-complete.sh +1 -1
  84. package/plugins/specweave/hooks/post-user-story-complete.sh.bak +179 -0
  85. package/plugins/specweave/hooks/pre-command-deduplication.sh +1 -1
  86. package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +83 -0
  87. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  88. package/plugins/specweave/hooks/user-prompt-submit.sh +1 -1
  89. package/plugins/specweave/hooks/user-prompt-submit.sh.bak +386 -0
  90. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  91. package/plugins/specweave/skills/specweave-framework/SKILL.md +1 -1
  92. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  93. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +23 -0
  94. package/plugins/specweave-ado/agents/ado-multi-project-mapper/AGENT.md +23 -0
  95. package/plugins/specweave-ado/agents/ado-sync-judge/AGENT.md +23 -0
  96. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  97. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  98. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  99. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  100. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  101. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  102. package/plugins/specweave-backend/agents/database-optimizer/AGENT.md +23 -0
  103. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  104. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  105. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  106. package/plugins/specweave-confluent/agents/confluent-architect/AGENT.md +23 -0
  107. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  108. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  109. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  110. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  111. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  112. package/plugins/specweave-core/commands/code-review.md +213 -0
  113. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  114. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  115. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  116. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  117. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  118. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  119. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  120. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  121. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  122. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  123. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  124. package/plugins/specweave-diagrams/agents/diagrams-architect/AGENT.md +23 -0
  125. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  126. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  127. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  128. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  129. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  130. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  131. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  132. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  133. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  134. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  135. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  136. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  137. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  138. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
  139. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  140. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  141. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  142. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  143. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  144. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  145. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  146. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  147. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  148. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  149. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  150. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  151. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  152. package/plugins/specweave-github/agents/github-manager/AGENT.md +23 -0
  153. package/plugins/specweave-github/agents/github-task-splitter/AGENT.md +25 -0
  154. package/plugins/specweave-github/agents/user-story-updater/AGENT.md +25 -0
  155. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
  156. package/plugins/specweave-github/lib/github-spec-content-sync.js +49 -0
  157. package/plugins/specweave-github/lib/github-spec-content-sync.ts +67 -0
  158. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  159. package/plugins/specweave-infrastructure/agents/devops/AGENT.md +26 -0
  160. package/plugins/specweave-infrastructure/agents/network-engineer/AGENT.md +26 -0
  161. package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +26 -0
  162. package/plugins/specweave-infrastructure/agents/performance-engineer/AGENT.md +26 -0
  163. package/plugins/specweave-infrastructure/agents/sre/AGENT.md +26 -0
  164. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  165. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +26 -0
  166. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  167. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  168. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  169. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  170. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  171. package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +26 -0
  172. package/plugins/specweave-kafka/agents/kafka-devops/AGENT.md +26 -0
  173. package/plugins/specweave-kafka/agents/kafka-observability/AGENT.md +26 -0
  174. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  175. package/plugins/specweave-kubernetes/agents/kubernetes-architect/AGENT.md +26 -0
  176. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  177. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  178. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  179. package/plugins/specweave-ml/.claude-plugin/plugin.json +3 -3
  180. package/plugins/specweave-ml/agents/data-scientist/AGENT.md +26 -0
  181. package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +26 -0
  182. package/plugins/specweave-ml/agents/mlops-engineer/AGENT.md +26 -0
  183. package/plugins/specweave-mobile/agents/mobile-architect/AGENT.md +26 -0
  184. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  185. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  186. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  187. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  188. package/plugins/specweave-payments/agents/payment-integration/AGENT.md +26 -0
  189. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +20 -0
  190. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  191. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  192. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  193. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  194. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  195. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  196. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  197. package/plugins/specweave-release/agents/release-manager/AGENT.md +27 -0
  198. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  199. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  200. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  201. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
  202. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  203. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  204. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  205. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  206. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  207. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  208. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  209. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  210. package/plugins/specweave-testing/commands/test-init.md +409 -0
  211. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  212. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  213. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  214. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  215. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  216. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  217. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  218. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  219. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  220. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  221. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  222. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  223. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  224. package/plugins/specweave/commands/check-hooks.md +0 -257
  225. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  226. package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -340
  227. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+ # SpecWeave Post-First-Increment Hook
3
+ #
4
+ # Triggers after the first increment is completed
5
+ # Congratulates the user on completing their first increment
6
+ #
7
+ # NON-INTERACTIVE: Just shows a message (hooks run in background)
8
+
9
+ set -euo pipefail
10
+
11
+ # Get project root (where .specweave/ lives)
12
+ PROJECT_ROOT="$(pwd)"
13
+
14
+ # Check if .specweave directory exists
15
+ if [ ! -d ".specweave" ]; then
16
+ # Not in SpecWeave project, skip
17
+ exit 0
18
+ fi
19
+
20
+ # Check if this is the first increment completion
21
+ # Count completed increments in .specweave/increments/
22
+ COMPLETED_COUNT=0
23
+ if [ -d ".specweave/increments" ]; then
24
+ # Count directories that have COMPLETION-REPORT.md or completion metadata
25
+ for inc_dir in .specweave/increments/[0-9][0-9][0-9][0-9]-*/; do
26
+ if [ -d "$inc_dir" ]; then
27
+ if [ -f "${inc_dir}reports/COMPLETION-REPORT.md" ] || \
28
+ [ -f "${inc_dir}COMPLETION-SUMMARY.md" ] || \
29
+ ([ -f "${inc_dir}metadata.json" ] && grep -q '"status".*"completed"' "${inc_dir}metadata.json" 2>/dev/null); then
30
+ COMPLETED_COUNT=$((COMPLETED_COUNT + 1))
31
+ fi
32
+ fi
33
+ done
34
+ fi
35
+
36
+ # Only trigger on first completion
37
+ if [ "$COMPLETED_COUNT" -ne 1 ]; then
38
+ exit 0
39
+ fi
40
+
41
+ # Show congratulations message (non-interactive)
42
+ echo ""
43
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
44
+ echo "🎉 Congratulations! You completed your first increment!"
45
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
46
+ echo ""
47
+ echo "✅ Your increment has been documented in:"
48
+ echo " .specweave/increments/[increment-id]/"
49
+ echo ""
50
+ echo "📚 View your documentation:"
51
+ echo " - Specs: .specweave/docs/internal/specs/"
52
+ echo " - Architecture: .specweave/docs/internal/architecture/"
53
+ echo ""
54
+ echo "🚀 Next steps:"
55
+ echo " - Review your increment: /specweave:status"
56
+ echo " - Start next increment: /specweave:increment \"feature name\""
57
+ echo ""
58
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
59
+ echo ""
60
+
61
+ exit 0
@@ -27,7 +27,7 @@
27
27
  #
28
28
  ###############################################################################
29
29
 
30
- set -euo pipefail
30
+ set +e # EMERGENCY FIX: Changed from set -euo pipefail to prevent Claude Code crashes
31
31
 
32
32
  # Arguments
33
33
  SPEC_FILE_PATH="${1:-}"
@@ -0,0 +1,158 @@
1
+ #!/bin/bash
2
+
3
+ ###############################################################################
4
+ # SpecWeave Post-Spec-Update Hook
5
+ #
6
+ # CRITICAL ARCHITECTURE:
7
+ # - Fires when .specweave/docs/internal/specs/spec-*.md is updated
8
+ # - Auto-syncs to linked external tool (GitHub Project/Jira Epic/ADO Feature)
9
+ # - Replaces increment-based sync (which was wrong!)
10
+ #
11
+ # Trigger Points:
12
+ # 1. After /specweave:sync-docs update (spec updated from increment)
13
+ # 2. After manual spec.md edits (user updates living docs directly)
14
+ # 3. After bidirectional sync from external tool
15
+ #
16
+ # What It Does:
17
+ # - Detects which spec was updated
18
+ # - Checks if spec is linked to external tool (frontmatter: externalLinks)
19
+ # - Syncs changes to GitHub Project / Jira Epic / ADO Feature
20
+ # - Updates user stories, acceptance criteria, progress
21
+ #
22
+ # Usage:
23
+ # post-spec-update.sh <spec-file-path>
24
+ #
25
+ # Example:
26
+ # post-spec-update.sh .specweave/docs/internal/specs/spec-001-core-framework.md
27
+ #
28
+ ###############################################################################
29
+
30
+ set -euo pipefail
31
+
32
+ # Arguments
33
+ SPEC_FILE_PATH="${1:-}"
34
+
35
+ # Validate arguments
36
+ if [[ -z "$SPEC_FILE_PATH" ]]; then
37
+ echo "❌ Error: Spec file path required"
38
+ echo "Usage: post-spec-update.sh <spec-file-path>"
39
+ exit 1
40
+ fi
41
+
42
+ # Check if spec file exists
43
+ if [[ ! -f "$SPEC_FILE_PATH" ]]; then
44
+ echo "❌ Error: Spec file not found: $SPEC_FILE_PATH"
45
+ exit 1
46
+ fi
47
+
48
+ # Extract spec ID from file path
49
+ # Example: .specweave/docs/internal/specs/spec-001-core-framework.md → spec-001
50
+ SPEC_ID=$(basename "$SPEC_FILE_PATH" .md)
51
+
52
+ echo ""
53
+ echo "🔗 Post-Spec-Update Hook"
54
+ echo " Spec: $SPEC_ID"
55
+ echo " File: $SPEC_FILE_PATH"
56
+
57
+ # Load config to check if auto-sync is enabled
58
+ CONFIG_FILE=".specweave/config.json"
59
+ if [[ ! -f "$CONFIG_FILE" ]]; then
60
+ echo " ℹ️ No config file found, skipping auto-sync"
61
+ exit 0
62
+ fi
63
+
64
+ # Check if auto-sync is enabled
65
+ AUTO_SYNC=$(jq -r '.hooks.post_spec_update.auto_sync // true' "$CONFIG_FILE")
66
+
67
+ if [[ "$AUTO_SYNC" != "true" ]]; then
68
+ echo " ℹ️ Auto-sync disabled in config, skipping"
69
+ exit 0
70
+ fi
71
+
72
+ # Parse spec frontmatter to detect external links
73
+ # Use gray-matter or similar to extract YAML frontmatter
74
+ # For now, use simple grep/sed approach
75
+
76
+ # Check if GitHub link exists
77
+ GITHUB_LINK=$(grep -A 10 "^externalLinks:" "$SPEC_FILE_PATH" | grep -A 5 "github:" | grep "projectId:" | sed 's/.*projectId: *//; s/ *$//' || echo "")
78
+
79
+ # Check if Jira link exists
80
+ JIRA_LINK=$(grep -A 10 "^externalLinks:" "$SPEC_FILE_PATH" | grep -A 5 "jira:" | grep "epicKey:" | sed 's/.*epicKey: *//; s/ *$//' || echo "")
81
+
82
+ # Check if ADO link exists
83
+ ADO_LINK=$(grep -A 10 "^externalLinks:" "$SPEC_FILE_PATH" | grep -A 5 "ado:" | grep "featureId:" | sed 's/.*featureId: *//; s/ *$//' || echo "")
84
+
85
+ # Determine which provider to sync
86
+ PROVIDER=""
87
+ if [[ -n "$GITHUB_LINK" ]]; then
88
+ PROVIDER="github"
89
+ EXTERNAL_ID="$GITHUB_LINK"
90
+ elif [[ -n "$JIRA_LINK" ]]; then
91
+ PROVIDER="jira"
92
+ EXTERNAL_ID="$JIRA_LINK"
93
+ elif [[ -n "$ADO_LINK" ]]; then
94
+ PROVIDER="ado"
95
+ EXTERNAL_ID="$ADO_LINK"
96
+ fi
97
+
98
+ # No external link found - skip sync
99
+ if [[ -z "$PROVIDER" ]]; then
100
+ echo " ℹ️ Spec not linked to external tool, skipping sync"
101
+ echo " Hint: Use /specweave-github:sync-spec or /specweave-jira:sync-spec to link"
102
+ exit 0
103
+ fi
104
+
105
+ echo " 🔗 Detected external link: $PROVIDER (ID: $EXTERNAL_ID)"
106
+
107
+ # Sync to external tool based on provider
108
+ case "$PROVIDER" in
109
+ github)
110
+ echo " 🔄 Syncing to GitHub Project..."
111
+
112
+ # Check if GitHub CLI is available
113
+ if ! command -v gh &> /dev/null; then
114
+ echo " ⚠️ GitHub CLI (gh) not found, skipping sync"
115
+ exit 0
116
+ fi
117
+
118
+ # TODO: Call GitHub spec sync
119
+ # For now, just log the action
120
+ echo " ✅ GitHub sync queued (implementation pending)"
121
+ ;;
122
+
123
+ jira)
124
+ echo " 🔄 Syncing to Jira Epic..."
125
+
126
+ # Check if Jira config exists
127
+ if [[ -z "${JIRA_DOMAIN:-}" ]]; then
128
+ echo " ⚠️ Jira not configured (.env), skipping sync"
129
+ exit 0
130
+ fi
131
+
132
+ # TODO: Call Jira spec sync
133
+ echo " ✅ Jira sync queued (implementation pending)"
134
+ ;;
135
+
136
+ ado)
137
+ echo " 🔄 Syncing to Azure DevOps Feature..."
138
+
139
+ # Check if ADO config exists
140
+ if [[ -z "${ADO_ORGANIZATION:-}" ]]; then
141
+ echo " ⚠️ ADO not configured (.env), skipping sync"
142
+ exit 0
143
+ fi
144
+
145
+ # TODO: Call ADO spec sync
146
+ echo " ✅ ADO sync queued (implementation pending)"
147
+ ;;
148
+
149
+ *)
150
+ echo " ⚠️ Unknown provider: $PROVIDER"
151
+ exit 0
152
+ ;;
153
+ esac
154
+
155
+ echo " ✅ Post-spec-update hook complete"
156
+ echo ""
157
+
158
+ exit 0
@@ -27,7 +27,7 @@
27
27
  #
28
28
  ###############################################################################
29
29
 
30
- set -euo pipefail
30
+ set +e # EMERGENCY FIX: Changed from set -euo pipefail to prevent Claude Code crashes
31
31
 
32
32
  # Arguments
33
33
  SPEC_ID="${1:-}"
@@ -0,0 +1,179 @@
1
+ #!/bin/bash
2
+
3
+ ###############################################################################
4
+ # SpecWeave Post-User-Story-Complete Hook
5
+ #
6
+ # CRITICAL ARCHITECTURE:
7
+ # - Fires when user story marked complete in spec.md (AC checkbox checked)
8
+ # - Updates external PM tool (GitHub Issue/Jira Story/ADO User Story)
9
+ # - Moves GitHub card to "Done" / Closes Jira story / Completes ADO story
10
+ #
11
+ # Trigger Points:
12
+ # 1. After user manually checks AC checkbox in spec.md
13
+ # 2. After bidirectional sync updates AC status
14
+ # 3. After increment completion syncs to spec
15
+ #
16
+ # What It Does:
17
+ # - Detects which user story was completed (all AC checkboxes checked)
18
+ # - Finds corresponding external item (GitHub Issue/Jira Story/ADO User Story)
19
+ # - Updates item status to "Done" / "Closed"
20
+ # - Adds completion comment with timestamp
21
+ #
22
+ # Usage:
23
+ # post-user-story-complete.sh <spec-id> <user-story-id>
24
+ #
25
+ # Example:
26
+ # post-user-story-complete.sh spec-001 US-001
27
+ #
28
+ ###############################################################################
29
+
30
+ set -euo pipefail
31
+
32
+ # Arguments
33
+ SPEC_ID="${1:-}"
34
+ USER_STORY_ID="${2:-}"
35
+
36
+ # Validate arguments
37
+ if [[ -z "$SPEC_ID" || -z "$USER_STORY_ID" ]]; then
38
+ echo "❌ Error: Spec ID and User Story ID required"
39
+ echo "Usage: post-user-story-complete.sh <spec-id> <user-story-id>"
40
+ exit 1
41
+ fi
42
+
43
+ echo ""
44
+ echo "🎉 Post-User-Story-Complete Hook"
45
+ echo " Spec: $SPEC_ID"
46
+ echo " User Story: $USER_STORY_ID"
47
+
48
+ # Find spec file
49
+ SPEC_FILE=""
50
+ if [[ -f ".specweave/docs/internal/specs/$SPEC_ID.md" ]]; then
51
+ SPEC_FILE=".specweave/docs/internal/specs/$SPEC_ID.md"
52
+ elif [[ -f ".specweave/docs/internal/projects/default/specs/$SPEC_ID.md" ]]; then
53
+ SPEC_FILE=".specweave/docs/internal/projects/default/specs/$SPEC_ID.md"
54
+ else
55
+ echo "❌ Error: Spec file not found for $SPEC_ID"
56
+ exit 1
57
+ fi
58
+
59
+ # Load config to check if auto-sync is enabled
60
+ CONFIG_FILE=".specweave/config.json"
61
+ if [[ ! -f "$CONFIG_FILE" ]]; then
62
+ echo " ℹ️ No config file found, skipping auto-sync"
63
+ exit 0
64
+ fi
65
+
66
+ # Check if auto-sync is enabled
67
+ AUTO_SYNC=$(jq -r '.hooks.post_user_story_complete.auto_sync // true' "$CONFIG_FILE")
68
+
69
+ if [[ "$AUTO_SYNC" != "true" ]]; then
70
+ echo " ℹ️ Auto-sync disabled in config, skipping"
71
+ exit 0
72
+ fi
73
+
74
+ # Parse spec frontmatter to detect external links
75
+ # Check if GitHub link exists
76
+ GITHUB_LINK=$(grep -A 10 "^externalLinks:" "$SPEC_FILE" | grep -A 5 "github:" | grep "projectId:" | sed 's/.*projectId: *//; s/ *$//' || echo "")
77
+
78
+ # Check if Jira link exists
79
+ JIRA_LINK=$(grep -A 10 "^externalLinks:" "$SPEC_FILE" | grep -A 5 "jira:" | grep "epicKey:" | sed 's/.*epicKey: *//; s/ *$//' || echo "")
80
+
81
+ # Check if ADO link exists
82
+ ADO_LINK=$(grep -A 10 "^externalLinks:" "$SPEC_FILE" | grep -A 5 "ado:" | grep "featureId:" | sed 's/.*featureId: *//; s/ *$//' || echo "")
83
+
84
+ # Determine which provider to sync
85
+ PROVIDER=""
86
+ if [[ -n "$GITHUB_LINK" ]]; then
87
+ PROVIDER="github"
88
+ EXTERNAL_ID="$GITHUB_LINK"
89
+ elif [[ -n "$JIRA_LINK" ]]; then
90
+ PROVIDER="jira"
91
+ EXTERNAL_ID="$JIRA_LINK"
92
+ elif [[ -n "$ADO_LINK" ]]; then
93
+ PROVIDER="ado"
94
+ EXTERNAL_ID="$ADO_LINK"
95
+ fi
96
+
97
+ # No external link found - skip sync
98
+ if [[ -z "$PROVIDER" ]]; then
99
+ echo " ℹ️ Spec not linked to external tool, skipping sync"
100
+ exit 0
101
+ fi
102
+
103
+ echo " 🔗 Detected external link: $PROVIDER"
104
+
105
+ # Update external tool based on provider
106
+ case "$PROVIDER" in
107
+ github)
108
+ echo " 🔄 Updating GitHub Issue for $USER_STORY_ID..."
109
+
110
+ # Check if GitHub CLI is available
111
+ if ! command -v gh &> /dev/null; then
112
+ echo " ⚠️ GitHub CLI (gh) not found, skipping sync"
113
+ exit 0
114
+ fi
115
+
116
+ # Find GitHub Issue for this user story
117
+ # Search for issue with title pattern "[USER_STORY_ID]"
118
+ REPO=$(git remote get-url origin | sed -E 's/.*github\.com[:/]([^/]+\/[^/]+)(\.git)?$/\1/')
119
+
120
+ # Search for issue
121
+ ISSUE_NUMBER=$(gh issue list --repo "$REPO" --search "\"[$USER_STORY_ID]\" in:title" --json number --jq '.[0].number' 2>/dev/null || echo "")
122
+
123
+ if [[ -z "$ISSUE_NUMBER" ]]; then
124
+ echo " ⚠️ GitHub Issue not found for $USER_STORY_ID"
125
+ exit 0
126
+ fi
127
+
128
+ echo " 📝 Found GitHub Issue #$ISSUE_NUMBER"
129
+
130
+ # Close issue
131
+ gh issue close "$ISSUE_NUMBER" --repo "$REPO" --comment "✅ User story completed
132
+
133
+ 🤖 Auto-closed by SpecWeave hook
134
+ Completed at: $(date -u +%Y-%m-%dT%H:%M:%SZ)" 2>/dev/null || {
135
+ echo " ⚠️ Failed to close issue"
136
+ exit 0
137
+ }
138
+
139
+ echo " ✅ GitHub Issue #$ISSUE_NUMBER closed"
140
+ ;;
141
+
142
+ jira)
143
+ echo " 🔄 Updating Jira Story for $USER_STORY_ID..."
144
+
145
+ # Check if Jira config exists
146
+ if [[ -z "${JIRA_DOMAIN:-}" ]]; then
147
+ echo " ⚠️ Jira not configured (.env), skipping sync"
148
+ exit 0
149
+ fi
150
+
151
+ # TODO: Find Jira Story by title pattern
152
+ # TODO: Transition story to "Done" status
153
+ echo " ✅ Jira story transition queued (implementation pending)"
154
+ ;;
155
+
156
+ ado)
157
+ echo " 🔄 Updating ADO User Story for $USER_STORY_ID..."
158
+
159
+ # Check if ADO config exists
160
+ if [[ -z "${ADO_ORGANIZATION:-}" ]]; then
161
+ echo " ⚠️ ADO not configured (.env), skipping sync"
162
+ exit 0
163
+ fi
164
+
165
+ # TODO: Find ADO User Story by title pattern
166
+ # TODO: Update state to "Closed"
167
+ echo " ✅ ADO user story update queued (implementation pending)"
168
+ ;;
169
+
170
+ *)
171
+ echo " ⚠️ Unknown provider: $PROVIDER"
172
+ exit 0
173
+ ;;
174
+ esac
175
+
176
+ echo " ✅ Post-user-story-complete hook complete"
177
+ echo ""
178
+
179
+ exit 0
@@ -4,7 +4,7 @@
4
4
  # Fires BEFORE any command executes (UserPromptSubmit hook)
5
5
  # Purpose: Prevent duplicate command invocations within configurable time window
6
6
 
7
- set -euo pipefail
7
+ set +e # EMERGENCY FIX: Changed from set -euo pipefail to prevent Claude Code crashes
8
8
 
9
9
  # ==============================================================================
10
10
  # PROJECT ROOT DETECTION
@@ -0,0 +1,83 @@
1
+ #!/bin/bash
2
+
3
+ # SpecWeave Pre-Command Deduplication Hook
4
+ # Fires BEFORE any command executes (UserPromptSubmit hook)
5
+ # Purpose: Prevent duplicate command invocations within configurable time window
6
+
7
+ set -euo pipefail
8
+
9
+ # ==============================================================================
10
+ # PROJECT ROOT DETECTION
11
+ # ==============================================================================
12
+
13
+ # Find project root by searching upward for .specweave/ directory
14
+ find_project_root() {
15
+ local dir="$1"
16
+ while [ "$dir" != "/" ]; do
17
+ if [ -d "$dir/.specweave" ]; then
18
+ echo "$dir"
19
+ return 0
20
+ fi
21
+ dir="$(dirname "$dir")"
22
+ done
23
+ # Fallback: try current directory
24
+ if [ -d "$(pwd)/.specweave" ]; then
25
+ pwd
26
+ else
27
+ echo "$(pwd)"
28
+ fi
29
+ }
30
+
31
+ PROJECT_ROOT="$(find_project_root "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")"
32
+ cd "$PROJECT_ROOT" 2>/dev/null || true
33
+
34
+ # Read input JSON from stdin
35
+ INPUT=$(cat)
36
+
37
+ # ==============================================================================
38
+ # DEDUPLICATION CHECK: Block duplicate commands within 1 second
39
+ # ==============================================================================
40
+
41
+ # Check if deduplication module is available
42
+ if command -v node >/dev/null 2>&1 && [[ -f "dist/src/core/deduplication/command-deduplicator.js" ]]; then
43
+ # Use dedicated wrapper script for ES module compatibility
44
+ DEDUP_RESULT=$(echo "$INPUT" | node scripts/check-deduplication.js 2>/dev/null || echo "OK")
45
+
46
+ # Parse result
47
+ STATUS=$(echo "$DEDUP_RESULT" | head -1)
48
+
49
+ if [[ "$STATUS" == "DUPLICATE" ]]; then
50
+ # Get stats
51
+ STATS=$(echo "$DEDUP_RESULT" | tail -1)
52
+
53
+ # Extract command and stats for readable message
54
+ COMMAND=$(echo "$STATS" | grep -o '"lastCommand":"[^"]*"' | cut -d'"' -f4 || echo "unknown")
55
+ TOTAL_BLOCKED=$(echo "$STATS" | grep -o '"totalDuplicatesBlocked":[0-9]*' | cut -d':' -f2 || echo "1")
56
+ CACHE_SIZE=$(echo "$STATS" | grep -o '"currentCacheSize":[0-9]*' | cut -d':' -f2 || echo "1")
57
+
58
+ # Build error message WITHOUT embedding JSON (avoid escaping issues)
59
+ MESSAGE=$(cat <<'EOF'
60
+ {
61
+ "decision": "block",
62
+ "reason": "🚫 DUPLICATE COMMAND DETECTED\n\nCommand: `COMMAND_PLACEHOLDER`\nTime window: 1 second\n\nThis command was just executed! To prevent unintended duplicates, this invocation has been blocked.\n\n💡 If you meant to run this command again:\n 1. Wait 1 second\n 2. Run the command again\n\nDeduplication Stats:\n- Total duplicates blocked: BLOCKED_PLACEHOLDER\n- Commands in cache: CACHE_PLACEHOLDER"
63
+ }
64
+ EOF
65
+ )
66
+ # Replace placeholders (avoids JSON escaping issues)
67
+ # Use | as sed delimiter to avoid conflicts with / in command names
68
+ echo "$MESSAGE" | sed "s|COMMAND_PLACEHOLDER|$COMMAND|g" | sed "s|BLOCKED_PLACEHOLDER|$TOTAL_BLOCKED|g" | sed "s|CACHE_PLACEHOLDER|$CACHE_SIZE|g"
69
+ exit 0
70
+ fi
71
+ fi
72
+
73
+ # ==============================================================================
74
+ # PASS THROUGH: No duplicate detected, proceed with command
75
+ # ==============================================================================
76
+
77
+ cat <<EOF
78
+ {
79
+ "decision": "approve"
80
+ }
81
+ EOF
82
+
83
+ exit 0
@@ -0,0 +1,168 @@
1
+ #!/bin/bash
2
+ #
3
+ # Pre-Increment-Start Hook
4
+ #
5
+ # Validates increment readiness before allowing `/specweave:do` to start work.
6
+ #
7
+ # **Critical Checks**:
8
+ # 1. spec.md contains Acceptance Criteria
9
+ # 2. AC count matches metadata.json
10
+ # 3. No duplicate task files (tasks.md, tasks-detailed.md)
11
+ # 4. Increment structure is valid
12
+ #
13
+ # **Triggered by**: /specweave:do command (before starting implementation)
14
+ #
15
+ # **Exit codes**:
16
+ # - 0: Validation passed, safe to start
17
+ # - 1: Validation failed, BLOCK start
18
+ #
19
+ # **See**: ADR-0062 (AC Embedding Architecture)
20
+ #
21
+
22
+ set -euo pipefail
23
+
24
+ # Get increment path from environment or argument
25
+ INCREMENT_PATH="${1:-}"
26
+
27
+ if [ -z "$INCREMENT_PATH" ]; then
28
+ echo "❌ Error: INCREMENT_PATH not provided"
29
+ echo "Usage: $0 <increment-path>"
30
+ exit 1
31
+ fi
32
+
33
+ if [ ! -d "$INCREMENT_PATH" ]; then
34
+ echo "❌ Error: Increment path not found: $INCREMENT_PATH"
35
+ exit 1
36
+ fi
37
+
38
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
39
+ echo "PRE-START VALIDATION: $(basename "$INCREMENT_PATH")"
40
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
41
+ echo ""
42
+
43
+ VALIDATION_PASSED=true
44
+
45
+ # Check 1: spec.md exists
46
+ if [ ! -f "$INCREMENT_PATH/spec.md" ]; then
47
+ echo "❌ CRITICAL: spec.md not found"
48
+ VALIDATION_PASSED=false
49
+ fi
50
+
51
+ # Check 2: Acceptance Criteria section exists
52
+ if [ -f "$INCREMENT_PATH/spec.md" ]; then
53
+ if ! grep -q "## Acceptance Criteria" "$INCREMENT_PATH/spec.md"; then
54
+ echo "❌ CRITICAL: spec.md missing '## Acceptance Criteria' section"
55
+ echo ""
56
+ echo " spec.md MUST contain inline Acceptance Criteria for AC sync to work."
57
+ echo " Even when using 'structure: user-stories', ACs must be embedded in spec.md."
58
+ echo ""
59
+ echo " 💡 SUGGESTED FIX:"
60
+ echo " Run: /specweave:embed-acs $(basename "$INCREMENT_PATH")"
61
+ echo ""
62
+ VALIDATION_PASSED=false
63
+ fi
64
+ fi
65
+
66
+ # Check 3: Count ACs in spec.md
67
+ AC_COUNT=0
68
+ if [ -f "$INCREMENT_PATH/spec.md" ]; then
69
+ AC_COUNT=$(grep -cE "^- \[[x ]\] \*\*AC-US[0-9]+-[0-9]+\*\*:" "$INCREMENT_PATH/spec.md" || true)
70
+ fi
71
+
72
+ if [ "$AC_COUNT" -eq 0 ]; then
73
+ echo "❌ CRITICAL: spec.md contains 0 Acceptance Criteria"
74
+ echo ""
75
+ echo " Cannot start increment with no ACs defined."
76
+ echo ""
77
+ echo " 💡 SUGGESTED FIX:"
78
+ echo " 1. Add ACs manually to spec.md, OR"
79
+ echo " 2. Run: /specweave:embed-acs $(basename "$INCREMENT_PATH") (auto-embed from living docs)"
80
+ echo ""
81
+ VALIDATION_PASSED=false
82
+ else
83
+ echo "✅ Acceptance Criteria: $AC_COUNT ACs found in spec.md"
84
+ fi
85
+
86
+ # Check 4: Validate AC count matches metadata.json
87
+ if [ -f "$INCREMENT_PATH/metadata.json" ]; then
88
+ EXPECTED_AC_COUNT=$(jq -r '.total_acs // 0' "$INCREMENT_PATH/metadata.json")
89
+
90
+ if [ "$EXPECTED_AC_COUNT" -ne "$AC_COUNT" ]; then
91
+ echo "⚠️ WARNING: AC count mismatch"
92
+ echo " spec.md: $AC_COUNT ACs"
93
+ echo " metadata.json: $EXPECTED_AC_COUNT ACs"
94
+ echo ""
95
+ echo " This may cause status line desyncs."
96
+ echo ""
97
+ # Don't block, just warn (metadata.json may be stale)
98
+ else
99
+ echo "✅ AC Count: Matches metadata.json ($EXPECTED_AC_COUNT ACs)"
100
+ fi
101
+ fi
102
+
103
+ # Check 5: No duplicate task files
104
+ TASK_FILES=$(find "$INCREMENT_PATH" -maxdepth 1 -name "tasks*.md" -type f | wc -l)
105
+ if [ "$TASK_FILES" -gt 1 ]; then
106
+ echo "❌ CRITICAL: Multiple task files detected (MUST be only ONE tasks.md)"
107
+ find "$INCREMENT_PATH" -maxdepth 1 -name "tasks*.md" -type f -exec basename {} \;
108
+ echo ""
109
+ echo " 💡 SUGGESTED FIX:"
110
+ echo " Keep tasks.md, move others to reports/ directory"
111
+ echo ""
112
+ VALIDATION_PASSED=false
113
+ else
114
+ echo "✅ Structure: Single tasks.md file (no duplicates)"
115
+ fi
116
+
117
+ # Check 6: Validate frontmatter for 'structure: user-stories' pattern
118
+ if [ -f "$INCREMENT_PATH/spec.md" ]; then
119
+ if grep -q "structure: user-stories" "$INCREMENT_PATH/spec.md"; then
120
+ if [ "$AC_COUNT" -eq 0 ]; then
121
+ echo ""
122
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
123
+ echo "🚨 CRITICAL ARCHITECTURE VIOLATION"
124
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
125
+ echo ""
126
+ echo "spec.md uses 'structure: user-stories' but contains NO inline ACs."
127
+ echo ""
128
+ echo "**Why this is critical**:"
129
+ echo " - AC sync hooks expect ACs in spec.md (not living docs)"
130
+ echo " - Without inline ACs, status line will show 0% completion"
131
+ echo " - Tasks-to-AC traceability will be broken"
132
+ echo ""
133
+ echo "**Architecture requirement (ADR-0062)**:"
134
+ echo " spec.md is ALWAYS the source of truth for ACs,"
135
+ echo " even when living docs exist as documentation layer."
136
+ echo ""
137
+ echo "**IMMEDIATE ACTION REQUIRED**:"
138
+ echo " Run: /specweave:embed-acs $(basename "$INCREMENT_PATH")"
139
+ echo ""
140
+ echo "This will auto-embed ACs from living docs into spec.md."
141
+ echo ""
142
+ VALIDATION_PASSED=false
143
+ else
144
+ echo "✅ Living Docs Structure: ACs properly embedded in spec.md"
145
+ fi
146
+ fi
147
+ fi
148
+
149
+ echo ""
150
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
151
+
152
+ if [ "$VALIDATION_PASSED" = true ]; then
153
+ echo "✅ PRE-START VALIDATION: PASSED"
154
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
155
+ echo ""
156
+ echo "Increment is ready to start. Proceeding with /specweave:do..."
157
+ exit 0
158
+ else
159
+ echo "❌ PRE-START VALIDATION: FAILED"
160
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
161
+ echo ""
162
+ echo "Cannot start increment due to validation failures above."
163
+ echo ""
164
+ echo "Fix the issues and try again, or run validation manually:"
165
+ echo " /specweave:validate $(basename "$INCREMENT_PATH")"
166
+ echo ""
167
+ exit 1
168
+ fi
@@ -4,7 +4,7 @@
4
4
  # Fires BEFORE user's command executes (prompt-based hook)
5
5
  # Purpose: Discipline validation, context injection, command suggestions
6
6
 
7
- set -euo pipefail
7
+ set +e # EMERGENCY FIX: Changed from set -euo pipefail to prevent Claude Code crashes
8
8
 
9
9
  # Read input JSON from stdin
10
10
  INPUT=$(cat)