specweave 1.0.261 → 1.0.263

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 (133) hide show
  1. package/.claude-plugin/README.md +0 -2
  2. package/CLAUDE.md +27 -27
  3. package/bin/specweave.js +14 -85
  4. package/dist/dashboard/assets/index-Cv1XUAKk.css +1 -0
  5. package/dist/dashboard/assets/index-DHOztQSu.js +11 -0
  6. package/dist/dashboard/index.html +2 -2
  7. package/dist/src/adapters/README.md +1 -1
  8. package/dist/src/adapters/agents-md-generator.js +1 -1
  9. package/dist/src/adapters/agents-md-generator.js.map +1 -1
  10. package/dist/src/adapters/claude/README.md +8 -8
  11. package/dist/src/adapters/claude/adapter.js +2 -2
  12. package/dist/src/adapters/claude-md-generator.js +2 -2
  13. package/dist/src/adapters/claude-md-generator.js.map +1 -1
  14. package/dist/src/adapters/cursor/README.md +7 -7
  15. package/dist/src/adapters/generic/README.md +2 -2
  16. package/dist/src/cli/commands/create-increment.d.ts +1 -1
  17. package/dist/src/cli/commands/create-increment.js +1 -1
  18. package/dist/src/cli/commands/update.d.ts.map +1 -1
  19. package/dist/src/cli/commands/update.js +64 -1
  20. package/dist/src/cli/commands/update.js.map +1 -1
  21. package/dist/src/cli/helpers/init/api-docs-config.js +7 -7
  22. package/dist/src/cli/helpers/init/api-docs-config.js.map +1 -1
  23. package/dist/src/core/config/types.d.ts +18 -0
  24. package/dist/src/core/config/types.d.ts.map +1 -1
  25. package/dist/src/core/config/types.js +4 -0
  26. package/dist/src/core/config/types.js.map +1 -1
  27. package/dist/src/core/external-tools/external-items-display.d.ts.map +1 -1
  28. package/dist/src/core/external-tools/external-items-display.js +1 -11
  29. package/dist/src/core/external-tools/external-items-display.js.map +1 -1
  30. package/dist/src/core/increment/increment-archiver.js +1 -1
  31. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  32. package/dist/src/core/increment/metadata-manager.js +2 -2
  33. package/dist/src/core/increment/metadata-manager.js.map +1 -1
  34. package/dist/src/core/increment/template-creator.d.ts +1 -1
  35. package/dist/src/core/increment/template-creator.js +4 -4
  36. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +2 -2
  37. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
  38. package/dist/src/core/lazy-loading/llm-plugin-detector.js +15 -5
  39. package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
  40. package/dist/src/core/living-docs/feature-consistency-validator.js +1 -1
  41. package/dist/src/core/living-docs/feature-consistency-validator.js.map +1 -1
  42. package/dist/src/core/living-docs/scaffolding/scaffold.js +3 -3
  43. package/dist/src/core/notifications/command-integration.d.ts.map +1 -1
  44. package/dist/src/core/notifications/command-integration.js +0 -1
  45. package/dist/src/core/notifications/command-integration.js.map +1 -1
  46. package/dist/src/core/reflection/reflect-handler.js +2 -2
  47. package/dist/src/core/reflection/reflect-handler.js.map +1 -1
  48. package/dist/src/core/validators/ac-presence-validator.d.ts +1 -1
  49. package/dist/src/core/validators/ac-presence-validator.js +3 -3
  50. package/dist/src/core/validators/ac-presence-validator.js.map +1 -1
  51. package/dist/src/dashboard/server/command-runner.d.ts.map +1 -1
  52. package/dist/src/dashboard/server/command-runner.js +2 -2
  53. package/dist/src/dashboard/server/command-runner.js.map +1 -1
  54. package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
  55. package/dist/src/dashboard/server/dashboard-server.js +22 -10
  56. package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
  57. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +9 -1
  58. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -1
  59. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +140 -13
  60. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -1
  61. package/dist/src/dashboard/server/data/plugin-scanner.d.ts +1 -1
  62. package/dist/src/dashboard/server/data/plugin-scanner.d.ts.map +1 -1
  63. package/dist/src/dashboard/server/data/plugin-scanner.js +2 -2
  64. package/dist/src/dashboard/server/data/plugin-scanner.js.map +1 -1
  65. package/dist/src/utils/agents-md-compiler.js +1 -1
  66. package/dist/src/utils/agents-md-compiler.js.map +1 -1
  67. package/dist/src/utils/find-project-root.d.ts +5 -4
  68. package/dist/src/utils/find-project-root.d.ts.map +1 -1
  69. package/dist/src/utils/find-project-root.js +8 -10
  70. package/dist/src/utils/find-project-root.js.map +1 -1
  71. package/dist/src/utils/generate-skills-index.js +3 -3
  72. package/dist/src/utils/notification-constants.js +1 -1
  73. package/dist/src/utils/notification-constants.js.map +1 -1
  74. package/package.json +1 -1
  75. package/plugins/FINAL-AUDIT-RECOMMENDATIONS.md +3 -3
  76. package/plugins/specweave/PLUGIN.md +0 -22
  77. package/plugins/specweave/commands/analytics.md +1 -1
  78. package/plugins/specweave/commands/discrepancies.md +0 -1
  79. package/plugins/specweave/commands/living-docs.md +0 -1
  80. package/plugins/specweave/commands/reconcile.md +1 -1
  81. package/plugins/specweave/hooks/hooks.json +19 -0
  82. package/plugins/specweave/hooks/pre-compact.sh +39 -0
  83. package/plugins/specweave/hooks/stop-sync.sh +23 -1
  84. package/plugins/specweave/hooks/universal/fail-fast-wrapper.sh +4 -0
  85. package/plugins/specweave/hooks/user-prompt-submit.sh +193 -59
  86. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use-analytics.sh +83 -0
  87. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +7 -0
  88. package/plugins/specweave/hooks/v2/guards/spec-template-enforcement-guard.sh +1 -1
  89. package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +25 -6
  90. package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +21 -3
  91. package/plugins/specweave/hooks/v2/lib/check-provider-enabled.sh +52 -0
  92. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +2 -2
  93. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
  94. package/plugins/specweave/scripts/track-analytics.sh +4 -0
  95. package/plugins/specweave/skills/do/SKILL.md +1 -1
  96. package/plugins/specweave/skills/done/SKILL.md +1 -1
  97. package/plugins/specweave/skills/framework/SKILL.md +4 -4
  98. package/plugins/specweave/skills/increment/SKILL.md +192 -25
  99. package/plugins/specweave/skills/next/SKILL.md +36 -630
  100. package/plugins/specweave/skills/pm/phases/00-deep-interview.md +2 -2
  101. package/plugins/specweave/skills/progress-sync/SKILL.md +7 -25
  102. package/plugins/specweave/skills/spec-generator/SKILL.md +44 -626
  103. package/plugins/specweave/skills/tdd-green/SKILL.md +10 -798
  104. package/plugins/specweave/skills/tdd-red/SKILL.md +8 -136
  105. package/plugins/specweave/skills/tdd-refactor/SKILL.md +15 -147
  106. package/plugins/specweave-github/hooks/github-auto-create-handler.sh +23 -5
  107. package/src/templates/AGENTS.md.template +11 -11
  108. package/src/templates/CLAUDE.md.template +1 -1
  109. package/dist/dashboard/assets/index-CDl14O5G.css +0 -1
  110. package/dist/dashboard/assets/index-CmqBqnWd.js +0 -11
  111. package/plugins/specweave/commands/api-docs.md +0 -672
  112. package/plugins/specweave/commands/check-hooks.md +0 -241
  113. package/plugins/specweave/commands/embed-acs.md +0 -445
  114. package/plugins/specweave/commands/external.md +0 -145
  115. package/plugins/specweave/commands/import-docs.md +0 -212
  116. package/plugins/specweave/commands/migrate-config.md +0 -104
  117. package/plugins/specweave/commands/notifications.md +0 -94
  118. package/plugins/specweave/commands/plugin-validator.md +0 -429
  119. package/plugins/specweave/commands/revert-wip-limit.md +0 -82
  120. package/plugins/specweave/commands/sync-acs.md +0 -342
  121. package/plugins/specweave/commands/sync-specs.md +0 -339
  122. package/plugins/specweave/commands/sync-tasks.md +0 -255
  123. package/plugins/specweave/commands/update-scope.md +0 -351
  124. package/plugins/specweave/commands/validate-features.md +0 -207
  125. package/plugins/specweave/skills/archive-increments/SKILL.md +0 -209
  126. package/plugins/specweave/skills/code-review/SKILL.md +0 -598
  127. package/plugins/specweave/skills/increment-planner/SKILL.md +0 -238
  128. package/plugins/specweave/skills/increment-work-router/SKILL.md +0 -562
  129. package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +0 -423
  130. package/plugins/specweave/skills/pm-closure-validation/SKILL.md +0 -542
  131. package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +0 -245
  132. package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +0 -228
  133. package/plugins/specweave/skills/umbrella-repo-detector/SKILL.md +0 -301
@@ -13,10 +13,11 @@
13
13
  * @module utils/find-project-root
14
14
  */
15
15
  /**
16
- * Find project root by searching for .specweave directory
16
+ * Find project root by searching for .specweave/config.json
17
17
  *
18
18
  * Walks up the directory tree from startDir until it finds a directory
19
- * containing .specweave folder.
19
+ * containing .specweave/config.json. Requires config.json to distinguish
20
+ * real projects from stale .specweave/ folders (created by runtime bugs).
20
21
  *
21
22
  * @param startDir - Directory to start searching from (defaults to process.cwd())
22
23
  * @returns Project root path or null if not found
@@ -24,10 +25,10 @@
24
25
  * @example
25
26
  * // From /projects/my-app/src/components
26
27
  * findProjectRoot()
27
- * // Returns: "/projects/my-app" (if .specweave exists there)
28
+ * // Returns: "/projects/my-app" (if .specweave/config.json exists there)
28
29
  *
29
30
  * @example
30
- * // No .specweave found anywhere in tree
31
+ * // No .specweave/config.json found anywhere in tree
31
32
  * findProjectRoot()
32
33
  * // Returns: null
33
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"find-project-root.d.ts","sourceRoot":"","sources":["../../../src/utils/find-project-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAmB/E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,GAAE,MAAsB,GAAG,OAAO,CAElF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE,MAAsB,GAC/B,MAAM,GAAG,IAAI,CAKf"}
1
+ {"version":3,"file":"find-project-root.d.ts","sourceRoot":"","sources":["../../../src/utils/find-project-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAiB/E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,GAAE,MAAsB,GAAG,OAAO,CAElF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE,MAAsB,GAC/B,MAAM,GAAG,IAAI,CAKf"}
@@ -15,10 +15,11 @@
15
15
  import * as fs from 'fs';
16
16
  import path from 'path';
17
17
  /**
18
- * Find project root by searching for .specweave directory
18
+ * Find project root by searching for .specweave/config.json
19
19
  *
20
20
  * Walks up the directory tree from startDir until it finds a directory
21
- * containing .specweave folder.
21
+ * containing .specweave/config.json. Requires config.json to distinguish
22
+ * real projects from stale .specweave/ folders (created by runtime bugs).
22
23
  *
23
24
  * @param startDir - Directory to start searching from (defaults to process.cwd())
24
25
  * @returns Project root path or null if not found
@@ -26,10 +27,10 @@ import path from 'path';
26
27
  * @example
27
28
  * // From /projects/my-app/src/components
28
29
  * findProjectRoot()
29
- * // Returns: "/projects/my-app" (if .specweave exists there)
30
+ * // Returns: "/projects/my-app" (if .specweave/config.json exists there)
30
31
  *
31
32
  * @example
32
- * // No .specweave found anywhere in tree
33
+ * // No .specweave/config.json found anywhere in tree
33
34
  * findProjectRoot()
34
35
  * // Returns: null
35
36
  */
@@ -38,16 +39,13 @@ export function findProjectRoot(startDir = process.cwd()) {
38
39
  const root = path.parse(current).root;
39
40
  while (current !== root) {
40
41
  const specweavePath = path.join(current, '.specweave');
41
- if (fs.existsSync(specweavePath) && fs.statSync(specweavePath).isDirectory()) {
42
+ if (fs.existsSync(specweavePath) &&
43
+ fs.statSync(specweavePath).isDirectory() &&
44
+ fs.existsSync(path.join(specweavePath, 'config.json'))) {
42
45
  return current;
43
46
  }
44
47
  current = path.dirname(current);
45
48
  }
46
- // Check root directory as well
47
- const rootSpecweave = path.join(root, '.specweave');
48
- if (fs.existsSync(rootSpecweave) && fs.statSync(rootSpecweave).isDirectory()) {
49
- return root;
50
- }
51
49
  return null;
52
50
  }
53
51
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"find-project-root.js","sourceRoot":"","sources":["../../../src/utils/find-project-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAC9D,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;IAEtC,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;QACxB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACvD,IAAI,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C,QAAQ,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IACvE,OAAO,eAAe,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,WAAoB;IAClD,MAAM,IAAI,GAAG,WAAW,IAAI,eAAe,EAAE,CAAC;IAC9C,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACpD,OAAO,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB,CACpC,YAAoB,EACpB,WAAmB,OAAO,CAAC,GAAG,EAAE;IAEhC,MAAM,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC"}
@@ -230,9 +230,9 @@ function generateIndexMarkdown(skills) {
230
230
  \`\`\`
231
231
  User asks: "Plan a new feature for user authentication"
232
232
 
233
- Step 1: Scan this index → Find "increment-planner" skill
233
+ Step 1: Scan this index → Find "increment" skill
234
234
  Step 2: Check keywords → Matches "feature planning", "create increment"
235
- Step 3: Load skill → cat .claude/skills/increment-planner/SKILL.md
235
+ Step 3: Load skill → cat .claude/skills/increment/SKILL.md
236
236
  Step 4: Execute → Follow the increment planning workflow
237
237
  \`\`\`
238
238
 
@@ -300,7 +300,7 @@ Step 4: Execute → Follow the increment planning workflow
300
300
 
301
301
  | Your Task | Relevant Skill | Keywords |
302
302
  |-----------|---------------|----------|
303
- | "Plan a new feature" | \`increment-planner\` | "feature planning", "create increment" |
303
+ | "Plan a new feature" | \`increment\` | "feature planning", "create increment" |
304
304
  | "Sync to JIRA" | \`jira-sync\` | "JIRA sync", "create JIRA issue" |
305
305
  | "Create diagram" | \`diagrams-architect\` | "architecture diagram", "C4 diagram" |
306
306
  | "Build React UI" | \`frontend\` | "React", "components", "UI" |
@@ -75,7 +75,7 @@ export function buildNotificationMessage(type, context) {
75
75
  case 'sync_complete':
76
76
  return `Sync finished. ${context.items ? `Updated ${context.items} items.` : 'All items synced.'}`;
77
77
  case 'import_complete':
78
- return `Import finished. ${context.items ? `Imported ${context.items} items.` : 'Check /sw:external for results.'}`;
78
+ return `Import finished. ${context.items ? `Imported ${context.items} items.` : 'Import complete.'}`;
79
79
  case 'error':
80
80
  return `Error: ${context.reason ?? 'Unknown error'}. Check logs for details.`;
81
81
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"notification-constants.js","sourceRoot":"","sources":["../../../src/utils/notification-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iCAAiC;IACjC,OAAO,EAAE,KAAK;IACd,iCAAiC;IACjC,IAAI,EAAE,OAAO;IACb,kCAAkC;IAClC,OAAO,EAAE,WAAW;IACpB,6EAA6E;IAC7E,QAAQ,EAAE,WAAW;CACb,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,4CAA4C;IAC5C,YAAY,EAAE,yBAAyB;IACvC,6BAA6B;IAC7B,WAAW,EAAE,wBAAwB;IACrC,wBAAwB;IACxB,YAAY,EAAE,yBAAyB;IACvC,6BAA6B;IAC7B,eAAe,EAAE,4BAA4B;IAC7C,qBAAqB;IACrB,aAAa,EAAE,0BAA0B;IACzC,uBAAuB;IACvB,eAAe,EAAE,4BAA4B;IA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AuB;IACrD,yEAAyE;IACzE,wDAAwD;IACxD,OAAO,SAAS,CAAC;IAEjB,kBAAkB;IAClB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;IAC1B,4BAA4B;IAC5B,8BAA8B;IAC9B,yCAAyC;IACzC,wBAAwB;IACxB,sCAAsC;IACtC,0BAA0B;IAC1B,yCAAyC;IACzC,kBAAkB;IAClB,0CAA0C;IAC1C,aAAa;IACb,sCAAsC;IACtC,IAAI;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAsB;IACpD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,kBAAkB,CAAC,YAAY,CAAC;QAEzC,KAAK,cAAc;YACjB,OAAO,kBAAkB,CAAC,YAAY,CAAC;QAEzC,KAAK,aAAa;YAChB,OAAO,kBAAkB,CAAC,WAAW,CAAC;QAExC,KAAK,eAAe;YAClB,OAAO,kBAAkB,CAAC,eAAe,CAAC;QAE5C,KAAK,mBAAmB;YACtB,OAAO,kBAAkB,CAAC,YAAY,CAAC;QAEzC,KAAK,eAAe;YAClB,OAAO,kBAAkB,CAAC,aAAa,CAAC;QAE1C,KAAK,iBAAiB;YACpB,OAAO,kBAAkB,CAAC,eAAe,CAAC;QAE5C,KAAK,OAAO;YACV,OAAO,kBAAkB,CAAC,KAAK,CAAC;QAElC;YACE,OAAO,WAAW,CAAC;IACvB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"notification-constants.js","sourceRoot":"","sources":["../../../src/utils/notification-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iCAAiC;IACjC,OAAO,EAAE,KAAK;IACd,iCAAiC;IACjC,IAAI,EAAE,OAAO;IACb,kCAAkC;IAClC,OAAO,EAAE,WAAW;IACpB,6EAA6E;IAC7E,QAAQ,EAAE,WAAW;CACb,CAAC;AAEX;;GAEG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
  "name": "specweave",
3
- "version": "1.0.261",
3
+ "version": "1.0.263",
4
4
  "description": "Spec-driven development framework for AI coding agents. First-class support for Claude Code — compatible with any LLM-powered coding tool. Living documentation, autonomous execution, quality gates, and multilingual support (9 languages).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -71,7 +71,7 @@ These have **explicit task instructions** (e.g., "create tests", "generate code"
71
71
  | `tech-lead` | ✅ "Implements code ONE FILE AT A TIME" | ✅ Keep |
72
72
  | `docs-writer` | ✅ "Generates docs ONE SECTION AT A TIME" | ✅ Keep |
73
73
  | `devops` (sw-infra) | ✅ "Generates IaC ONE LAYER AT A TIME" | ✅ Keep |
74
- | `increment-planner` | ✅ Creates increment structure | ✅ Keep |
74
+ | `increment` | ✅ Creates increment structure | ✅ Keep |
75
75
  | `test-aware-planner` | ✅ Generates tasks.md with tests | ✅ Keep |
76
76
  | `tdd-orchestrator` | ✅ Coordinates TDD workflow | ✅ Keep |
77
77
  | (etc.) | | |
@@ -154,8 +154,8 @@ disable-model-invocation: true
154
154
  | `reflect.md` | `reflect/SKILL.md` | **Complementary** | Command is workflow, skill is knowledge |
155
155
  | `translate.md` | `translator/SKILL.md` | **Complementary** | Command is batch workflow, skill is expertise |
156
156
  | `qa.md` | `sw-testing:qa-engineer` | **Complementary** | Command runs CLI, skill creates tests |
157
- | `plan.md` | `increment-planner/SKILL.md` | **Complementary** | Command for existing, skill for new increments |
158
- | `tdd-cycle.md` | `tdd-orchestrator/SKILL.md` | **Complementary** | Command starts workflow, skill orchestrates |
157
+ | `plan.md` | `increment/SKILL.md` | **Complementary** | Command for existing, skill for new increments |
158
+ | `tdd-cycle.md` | `tdd-cycle/SKILL.md` | **Complementary** | Command starts workflow, skill orchestrates |
159
159
 
160
160
  ### Conclusion: No True Duplicates Found
161
161
 
@@ -14,11 +14,9 @@ SpecWeave framework core plugin. Provides increment planning (PM, Architect, Tec
14
14
  |-------|-------------|
15
15
  | pm | Product Manager for spec-driven development with user stories, acceptance criteria, and MVP planning |
16
16
  | architect | System architect for scalable, maintainable technical designs and ADRs |
17
- | pm-closure-validation | PM validation for increment closure with 3-gate quality checks |
18
17
  | roadmap-planner | Product roadmap and feature prioritization with RICE, MoSCoW, and Kano frameworks |
19
18
  | spec-generator | Generates comprehensive specifications (spec.md, plan.md, tasks.md) for increments |
20
19
  | test-aware-planner | Generate tasks.md with embedded BDD test plans |
21
- | tdd-orchestrator | TDD orchestrator for strict red-green-refactor discipline |
22
20
  | code-simplifier | Code refinement agent that simplifies and improves code clarity |
23
21
  | performance | Performance engineering for web apps, databases, and distributed systems |
24
22
  | security | Security engineer for vulnerability assessment and secure code review |
@@ -32,11 +30,6 @@ SpecWeave framework core plugin. Provides increment planning (PM, Architect, Tec
32
30
  | translator | LLM-native translation skill for SpecWeave content |
33
31
  | framework | Expert on SpecWeave framework structure, rules, and conventions |
34
32
  | detector | Detects SpecWeave context and provides workflow documentation |
35
- | increment-work-router | Smart work continuation that routes to /sw:do or /sw:increment |
36
- | smart-reopen-detector | Detects issues with recently completed work and suggests reopening |
37
- | archive-increments | Intelligent increment archiving with 10-10-10 rule |
38
- | umbrella-repo-detector | Detects multi-repo architecture patterns |
39
- | multi-project-spec-mapper | Maps user stories to correct projects (FE, BE, MOBILE, INFRA) |
40
33
  | progress-sync | Progress synchronization for multi-system sync |
41
34
  | grill | Critical code review before increment completion |
42
35
  | self-validating-example | Example skill demonstrating self-validating REST API generation |
@@ -68,30 +61,20 @@ SpecWeave framework core plugin. Provides increment planning (PM, Architect, Tec
68
61
  | /sw:reopen | Reopen a completed increment for additional work |
69
62
  | /sw:backlog | Move an increment to backlog |
70
63
  | /sw:plan | Generate plan.md and tasks.md using Architect Agent |
71
- | /sw:increment-planner | Plan and create increments with PM and Architect collaboration |
72
64
  | /sw:increment-quality-judge-v2 | AI-powered quality assessment with BMAD risk scoring |
73
65
  | /sw:tdd-cycle | Execute comprehensive TDD workflow with strict discipline |
74
66
  | /sw:tdd-red | Write comprehensive failing tests (TDD red phase) |
75
67
  | /sw:tdd-green | Implement minimal code to make tests pass (TDD green phase) |
76
68
  | /sw:tdd-refactor | Refactor code with comprehensive test safety net |
77
69
  | /sw:sync-docs | Strategic documentation sync (review or export) |
78
- | /sw:sync-specs | Sync increment specifications to living docs structure |
79
- | /sw:sync-tasks | Sync tasks.md with actual completion status |
80
70
  | /sw:sync-progress | Comprehensive progress sync to all systems |
81
71
  | /sw:sync-status | Detect and fix status desyncs |
82
- | /sw:sync-acs | Synchronize acceptance criteria checkbox status |
83
- | /sw:embed-acs | Auto-embed Acceptance Criteria from living docs |
84
72
  | /sw:living-docs | Launch Living Docs Builder independently |
85
- | /sw:import-docs | Import brownfield documentation |
86
73
  | /sw:import-external | Auto-import external work items (GitHub/JIRA/ADO) |
87
- | /sw:external | View external items dashboard |
88
- | /sw:notifications | View and manage sync notifications |
89
74
  | /sw:discrepancies | View and manage code-to-spec discrepancies |
90
75
  | /sw:discrepancy-to-increment | Convert discrepancies into new increment |
91
- | /sw:update-scope | Update living completion report with scope changes |
92
76
  | /sw:fix-duplicates | Detect and resolve duplicate increments |
93
77
  | /sw:reconcile | Reconcile increment ID collisions after merge |
94
- | /sw:revert-wip-limit | Revert WIP limit to original value |
95
78
  | /sw:reflect | Analyze session and extract learnings to CLAUDE.md |
96
79
  | /sw:reflect-on | Enable automatic reflection on session end |
97
80
  | /sw:reflect-off | Disable automatic reflection |
@@ -106,16 +89,11 @@ SpecWeave framework core plugin. Provides increment planning (PM, Architect, Tec
106
89
  | /sw:docs-writer | Technical documentation writer |
107
90
  | /sw:translate | Translate SpecWeave project content |
108
91
  | /sw:skill | Create and validate Claude Code skills |
109
- | /sw:check-hooks | Comprehensive hook health check |
110
- | /sw:validate-features | Validate feature folder consistency |
111
- | /sw:api-docs | Generate API documentation (OpenAPI, Postman) |
112
92
  | /sw:npm | Full patch release with npm publish |
113
93
  | /sw-media:image | AI image generation (Google Imagen 4 / Pollinations.ai) |
114
94
  | /sw-media:video | AI video generation (Google Veo 3.1 / Pollinations.ai) |
115
95
  | /sw-media:remotion | Programmatic video from React with Remotion |
116
96
  | /sw:analytics | Show usage analytics dashboard |
117
- | /sw:plugin-validator | Validate SpecWeave plugin installation |
118
- | /sw:migrate-config | Migrate configuration to split secrets/config format |
119
97
 
120
98
  ## Installation
121
99
 
@@ -95,7 +95,7 @@ Success Rate: 98.5%
95
95
  28 │ /sw:validate
96
96
 
97
97
  ⚡ Top Skills:
98
- 45 │ increment-planner
98
+ 45 │ increment
99
99
  34 │ spec-generator
100
100
  28 │ qa-engineer
101
101
 
@@ -140,4 +140,3 @@ Remaining: 4 discrepancies
140
140
  ## Related
141
141
 
142
142
  - `/sw:sync-monitor`: Dashboard showing discrepancy count
143
- - `/sw:notifications`: View discrepancy notifications
@@ -561,7 +561,6 @@ Some repositories may be missing from analysis.
561
561
  ## See Also
562
562
 
563
563
  - `/sw:jobs` - Monitor all background jobs
564
- - `/sw:import-docs` - Import existing documentation
565
564
 
566
565
  ---
567
566
 
@@ -413,7 +413,7 @@ The reconcile command should:
413
413
 
414
414
  - `/sw:fix-duplicates` - Remove actual duplicates (same increment in multiple locations)
415
415
  - `/sw:status` - View all increments
416
- - `/sw:sync-specs` - Sync living docs after reconciliation
416
+ - `/sw:sync-docs` - Sync living docs after reconciliation
417
417
  - `/sw-github:sync` - Update GitHub references after reconciliation
418
418
 
419
419
  ## Best Practices
@@ -31,6 +31,16 @@
31
31
  ]
32
32
  }
33
33
  ],
34
+ "PreCompact": [
35
+ {
36
+ "hooks": [
37
+ {
38
+ "type": "command",
39
+ "command": "bash -c 'W=\"${CLAUDE_PLUGIN_ROOT}/hooks/universal/fail-fast-wrapper.sh\"; S=\"${CLAUDE_PLUGIN_ROOT}/hooks/pre-compact.sh\"; [[ -x \"$W\" ]] && exec \"$W\" \"$S\" || (cat >/dev/null && printf \"{\\\"continue\\\":true}\")'"
40
+ }
41
+ ]
42
+ }
43
+ ],
34
44
  "PostToolUse": [
35
45
  {
36
46
  "matcher": "Edit|Write",
@@ -41,6 +51,15 @@
41
51
  "command": "bash -c 'W=\"${CLAUDE_PLUGIN_ROOT}/hooks/universal/fail-fast-wrapper.sh\"; S=\"${CLAUDE_PLUGIN_ROOT}/hooks/v2/dispatchers/post-tool-use.sh\"; [[ -x \"$W\" ]] && exec \"$W\" \"$S\" || (cat >/dev/null && printf \"{\\\"continue\\\":true}\")'"
42
52
  }
43
53
  ]
54
+ },
55
+ {
56
+ "matcher": "Skill|Task",
57
+ "hooks": [
58
+ {
59
+ "type": "command",
60
+ "command": "bash -c 'W=\"${CLAUDE_PLUGIN_ROOT}/hooks/universal/fail-fast-wrapper.sh\"; S=\"${CLAUDE_PLUGIN_ROOT}/hooks/v2/dispatchers/post-tool-use-analytics.sh\"; [[ -x \"$W\" ]] && exec \"$W\" \"$S\" || (cat >/dev/null && printf \"{\\\"continue\\\":true}\")'"
61
+ }
62
+ ]
44
63
  }
45
64
  ],
46
65
  "Stop": [
@@ -0,0 +1,39 @@
1
+ #!/bin/bash
2
+ # pre-compact.sh - Context pressure signal handler (v1.0.262)
3
+ #
4
+ # Fires when Claude Code approaches context limits (before compaction).
5
+ # Writes pressure state for UserPromptSubmit hook to read and reduce budget.
6
+ #
7
+ # Escalation: 1st compaction → "elevated", 2nd+ → "critical"
8
+ set +e
9
+
10
+ [[ "${SPECWEAVE_DISABLE_HOOKS:-0}" == "1" ]] && echo '{"continue":true}' && exit 0
11
+
12
+ # Find project root
13
+ PROJECT_ROOT="$PWD"
14
+ while [[ "$PROJECT_ROOT" != "/" ]] && [[ ! -d "$PROJECT_ROOT/.specweave" ]]; do
15
+ PROJECT_ROOT=$(dirname "$PROJECT_ROOT")
16
+ done
17
+ [[ ! -d "$PROJECT_ROOT/.specweave" ]] && echo '{"continue":true}' && exit 0
18
+
19
+ STATE_DIR="$PROJECT_ROOT/.specweave/state"
20
+ PRESSURE_FILE="$STATE_DIR/context-pressure.json"
21
+ mkdir -p "$STATE_DIR" 2>/dev/null
22
+
23
+ # Read previous compaction count for escalation
24
+ PREV_COUNT=0
25
+ if [[ -f "$PRESSURE_FILE" ]] && command -v jq >/dev/null 2>&1; then
26
+ PREV_COUNT=$(jq -r '.compactionCount // 0' "$PRESSURE_FILE" 2>/dev/null || echo "0")
27
+ fi
28
+ NEW_COUNT=$((PREV_COUNT + 1))
29
+
30
+ # Determine level: 1 compaction = elevated, 2+ = critical
31
+ LEVEL="elevated"
32
+ [[ "$NEW_COUNT" -ge 2 ]] && LEVEL="critical"
33
+
34
+ cat > "$PRESSURE_FILE" <<EOF
35
+ {"level":"$LEVEL","compactionCount":$NEW_COUNT,"lastCompaction":"$(date -Iseconds)"}
36
+ EOF
37
+
38
+ echo '{"continue":true}'
39
+ exit 0
@@ -152,7 +152,7 @@ SYNC_COUNT=0
152
152
  SYNC_FAILED=0
153
153
 
154
154
  # Determine best event type for an increment from queued events
155
- # Priority: done/completed > created > reopened > sync (catch-all)
155
+ # Priority: done > created > user-story.completed > reopened > user-story.reopened > sync (catch-all)
156
156
  get_best_event_type() {
157
157
  local inc_id="$1"
158
158
  if [ -f "$EVENT_TYPES_FILE" ]; then
@@ -160,8 +160,12 @@ get_best_event_type() {
160
160
  echo "increment.done"
161
161
  elif grep -q "^${inc_id}|increment\.created$" "$EVENT_TYPES_FILE" 2>/dev/null; then
162
162
  echo "increment.created"
163
+ elif grep -q "^${inc_id}|user-story\.completed$" "$EVENT_TYPES_FILE" 2>/dev/null; then
164
+ echo "user-story.completed"
163
165
  elif grep -q "^${inc_id}|increment\.reopened$" "$EVENT_TYPES_FILE" 2>/dev/null; then
164
166
  echo "increment.reopened"
167
+ elif grep -q "^${inc_id}|user-story\.reopened$" "$EVENT_TYPES_FILE" 2>/dev/null; then
168
+ echo "user-story.reopened"
165
169
  else
166
170
  echo "increment.sync"
167
171
  fi
@@ -170,6 +174,9 @@ get_best_event_type() {
170
174
  fi
171
175
  }
172
176
 
177
+ # Resolve github-sync-handler path (for user-story event routing)
178
+ GITHUB_SYNC_HANDLER="$HANDLER_DIR/github-sync-handler.sh"
179
+
173
180
  for INC_ID in $INCREMENTS_TO_SYNC; do
174
181
  [ -z "$INC_ID" ] && continue
175
182
 
@@ -184,6 +191,21 @@ for INC_ID in $INCREMENTS_TO_SYNC; do
184
191
  SYNC_FAILED=$((SYNC_FAILED + 1))
185
192
  log "Sync failed: $INC_ID"
186
193
  fi
194
+
195
+ # Route user-story events to github-sync-handler (v1.0.262+)
196
+ # github-sync-handler understands user-story.completed/reopened with INC_ID:US_ID data
197
+ if [ -f "$GITHUB_SYNC_HANDLER" ] && [ -f "$EVENT_TYPES_FILE" ]; then
198
+ while IFS='|' read -r _inc_id us_event_type; do
199
+ [ -z "$us_event_type" ] && continue
200
+ # Extract US data (INC_ID:US_ID) from pending.jsonl for this event
201
+ US_DATA=$(grep -o "\"type\":\"${us_event_type}\"[^}]*\"data\":\"[^\"]*\"" "$PENDING_FILE" 2>/dev/null \
202
+ | grep -o '"data":"[^"]*"' | cut -d'"' -f4 | head -1)
203
+ if [ -n "$US_DATA" ]; then
204
+ log "Routing user-story event to github-sync-handler: $us_event_type $US_DATA"
205
+ run_with_timeout 30 bash "$GITHUB_SYNC_HANDLER" "$us_event_type" "$US_DATA"
206
+ fi
207
+ done < <(grep "^${INC_ID}|user-story\." "$EVENT_TYPES_FILE" 2>/dev/null | sort -u)
208
+ fi
187
209
  done
188
210
 
189
211
  # ============================================================================
@@ -49,6 +49,10 @@ case "$script_name" in
49
49
  # May run tests + LLM evaluation + validation
50
50
  HOOK_TIMEOUT="${HOOK_TIMEOUT_STOP_AUTO:-120}"
51
51
  ;;
52
+ pre-compact.sh)
53
+ # Pressure signal is ultra-fast (just writes a JSON file)
54
+ HOOK_TIMEOUT="${HOOK_TIMEOUT_PRE_COMPACT:-5}"
55
+ ;;
52
56
  stop-*.sh)
53
57
  # Other stop hooks (reflect, sync, grill) are usually fast
54
58
  HOOK_TIMEOUT="${HOOK_TIMEOUT_STOP:-15}"