specweave 0.22.13 â 0.23.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.
- package/.claude-plugin/README.md +2 -2
- package/CLAUDE.md +447 -52
- package/README.md +33 -10
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +4 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-sync.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +9 -0
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +10 -1
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
- package/dist/plugins/specweave-github/lib/progress-comment-builder.js +2 -2
- package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -1
- package/dist/plugins/specweave-github/lib/types.d.ts +1 -1
- package/dist/src/cli/commands/import-external.d.ts +22 -0
- package/dist/src/cli/commands/import-external.d.ts.map +1 -0
- package/dist/src/cli/commands/import-external.js +282 -0
- package/dist/src/cli/commands/import-external.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +359 -1
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/helpers/github-repo-selector.d.ts +59 -0
- package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -0
- package/dist/src/cli/helpers/github-repo-selector.js +265 -0
- package/dist/src/cli/helpers/github-repo-selector.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +41 -24
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/config/import-config.d.ts +69 -0
- package/dist/src/config/import-config.d.ts.map +1 -0
- package/dist/src/config/import-config.js +136 -0
- package/dist/src/config/import-config.js.map +1 -0
- package/dist/src/config/types.d.ts +26 -26
- package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
- package/dist/src/core/increment/ac-status-manager.js +4 -2
- package/dist/src/core/increment/ac-status-manager.js.map +1 -1
- package/dist/src/core/increment/completion-validator.d.ts +30 -1
- package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
- package/dist/src/core/increment/completion-validator.js +151 -3
- package/dist/src/core/increment/completion-validator.js.map +1 -1
- package/dist/src/core/increment/increment-archiver.d.ts +25 -0
- package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
- package/dist/src/core/increment/increment-archiver.js +130 -3
- package/dist/src/core/increment/increment-archiver.js.map +1 -1
- package/dist/src/core/living-docs/feature-archiver.d.ts +37 -0
- package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
- package/dist/src/core/living-docs/feature-archiver.js +262 -18
- package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
- package/dist/src/core/living-docs/feature-id-manager.d.ts +17 -0
- package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
- package/dist/src/core/living-docs/feature-id-manager.js +25 -0
- package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +16 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +56 -1
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts +2 -2
- package/dist/src/core/living-docs/task-project-specific-generator.js +2 -2
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts +2 -2
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.js +3 -15
- package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +3 -6
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/spec-content-sync.d.ts +4 -1
- package/dist/src/core/spec-content-sync.d.ts.map +1 -1
- package/dist/src/core/spec-content-sync.js +139 -4
- package/dist/src/core/spec-content-sync.js.map +1 -1
- package/dist/src/core/spec-task-mapper.d.ts.map +1 -1
- package/dist/src/core/spec-task-mapper.js +9 -8
- package/dist/src/core/spec-task-mapper.js.map +1 -1
- package/dist/src/core/status-line-validator.d.ts +63 -0
- package/dist/src/core/status-line-validator.d.ts.map +1 -0
- package/dist/src/core/status-line-validator.js +253 -0
- package/dist/src/core/status-line-validator.js.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts +10 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
- package/dist/src/core/sync/bidirectional-engine.js +10 -1
- package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
- package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
- package/dist/src/core/sync/profile-manager.js +3 -0
- package/dist/src/core/sync/profile-manager.js.map +1 -1
- package/dist/src/core/sync/project-context.d.ts.map +1 -1
- package/dist/src/core/sync/project-context.js +3 -0
- package/dist/src/core/sync/project-context.js.map +1 -1
- package/dist/src/core/sync/status-sync-engine.d.ts +1 -1
- package/dist/src/core/sync/status-sync-engine.js +1 -1
- package/dist/src/core/sync/sync-event-logger.d.ts +15 -1
- package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -1
- package/dist/src/core/sync/sync-event-logger.js +39 -1
- package/dist/src/core/sync/sync-event-logger.js.map +1 -1
- package/dist/src/core/types/origin-metadata.d.ts +153 -0
- package/dist/src/core/types/origin-metadata.d.ts.map +1 -0
- package/dist/src/core/types/origin-metadata.js +166 -0
- package/dist/src/core/types/origin-metadata.js.map +1 -0
- package/dist/src/core/types/sync-config-validator.d.ts +57 -0
- package/dist/src/core/types/sync-config-validator.d.ts.map +1 -0
- package/dist/src/core/types/sync-config-validator.js +116 -0
- package/dist/src/core/types/sync-config-validator.js.map +1 -0
- package/dist/src/core/types/sync-profile.d.ts +8 -2
- package/dist/src/core/types/sync-profile.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.js.map +1 -1
- package/dist/src/core/types/sync-settings.d.ts +73 -0
- package/dist/src/core/types/sync-settings.d.ts.map +1 -0
- package/dist/src/core/types/sync-settings.js +90 -0
- package/dist/src/core/types/sync-settings.js.map +1 -0
- package/dist/src/core/utils/permission-checker.d.ts +100 -0
- package/dist/src/core/utils/permission-checker.d.ts.map +1 -0
- package/dist/src/core/utils/permission-checker.js +166 -0
- package/dist/src/core/utils/permission-checker.js.map +1 -0
- package/dist/src/generators/spec/spec-parser.js +3 -3
- package/dist/src/generators/spec/spec-parser.js.map +1 -1
- package/dist/src/generators/spec/task-parser.js +4 -4
- package/dist/src/generators/spec/task-parser.js.map +1 -1
- package/dist/src/id-generators/task-id-generator.d.ts +96 -0
- package/dist/src/id-generators/task-id-generator.d.ts.map +1 -0
- package/dist/src/id-generators/task-id-generator.js +143 -0
- package/dist/src/id-generators/task-id-generator.js.map +1 -0
- package/dist/src/id-generators/us-id-generator.d.ts +96 -0
- package/dist/src/id-generators/us-id-generator.d.ts.map +1 -0
- package/dist/src/id-generators/us-id-generator.js +143 -0
- package/dist/src/id-generators/us-id-generator.js.map +1 -0
- package/dist/src/importers/ado-importer.d.ts +43 -0
- package/dist/src/importers/ado-importer.d.ts.map +1 -0
- package/dist/src/importers/ado-importer.js +234 -0
- package/dist/src/importers/ado-importer.js.map +1 -0
- package/dist/src/importers/duplicate-detector.d.ts +107 -0
- package/dist/src/importers/duplicate-detector.d.ts.map +1 -0
- package/dist/src/importers/duplicate-detector.js +189 -0
- package/dist/src/importers/duplicate-detector.js.map +1 -0
- package/dist/src/importers/external-importer.d.ts +96 -0
- package/dist/src/importers/external-importer.d.ts.map +1 -0
- package/dist/src/importers/external-importer.js +13 -0
- package/dist/src/importers/external-importer.js.map +1 -0
- package/dist/src/importers/github-importer.d.ts +37 -0
- package/dist/src/importers/github-importer.d.ts.map +1 -0
- package/dist/src/importers/github-importer.js +161 -0
- package/dist/src/importers/github-importer.js.map +1 -0
- package/dist/src/importers/import-coordinator.d.ts +105 -0
- package/dist/src/importers/import-coordinator.d.ts.map +1 -0
- package/dist/src/importers/import-coordinator.js +224 -0
- package/dist/src/importers/import-coordinator.js.map +1 -0
- package/dist/src/importers/item-converter.d.ts +96 -0
- package/dist/src/importers/item-converter.d.ts.map +1 -0
- package/dist/src/importers/item-converter.js +246 -0
- package/dist/src/importers/item-converter.js.map +1 -0
- package/dist/src/importers/jira-importer.d.ts +42 -0
- package/dist/src/importers/jira-importer.d.ts.map +1 -0
- package/dist/src/importers/jira-importer.js +221 -0
- package/dist/src/importers/jira-importer.js.map +1 -0
- package/dist/src/importers/rate-limiter.d.ts +128 -0
- package/dist/src/importers/rate-limiter.d.ts.map +1 -0
- package/dist/src/importers/rate-limiter.js +200 -0
- package/dist/src/importers/rate-limiter.js.map +1 -0
- package/dist/src/init/compliance/types.d.ts +2 -2
- package/dist/src/init/repo/types.d.ts +2 -2
- package/dist/src/integrations/ado/ado-client.d.ts +6 -0
- package/dist/src/integrations/ado/ado-client.d.ts.map +1 -1
- package/dist/src/integrations/ado/ado-client.js +23 -0
- package/dist/src/integrations/ado/ado-client.js.map +1 -1
- package/dist/src/integrations/jira/jira-client.d.ts +6 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +38 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
- package/dist/src/integrations/jira/jira-mapper.js +1 -1
- package/dist/src/living-docs/fs-id-allocator.d.ts +149 -0
- package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -0
- package/dist/src/living-docs/fs-id-allocator.js +325 -0
- package/dist/src/living-docs/fs-id-allocator.js.map +1 -0
- package/dist/src/living-docs/id-registry.d.ts +124 -0
- package/dist/src/living-docs/id-registry.d.ts.map +1 -0
- package/dist/src/living-docs/id-registry.js +230 -0
- package/dist/src/living-docs/id-registry.js.map +1 -0
- package/dist/src/progress/us-progress-tracker.d.ts +68 -0
- package/dist/src/progress/us-progress-tracker.d.ts.map +1 -0
- package/dist/src/progress/us-progress-tracker.js +120 -0
- package/dist/src/progress/us-progress-tracker.js.map +1 -0
- package/dist/src/sync/external-item-sync-service.d.ts +150 -0
- package/dist/src/sync/external-item-sync-service.d.ts.map +1 -0
- package/dist/src/sync/external-item-sync-service.js +241 -0
- package/dist/src/sync/external-item-sync-service.js.map +1 -0
- package/dist/src/sync/format-preservation-sync.d.ts +90 -0
- package/dist/src/sync/format-preservation-sync.d.ts.map +1 -0
- package/dist/src/sync/format-preservation-sync.js +173 -0
- package/dist/src/sync/format-preservation-sync.js.map +1 -0
- package/dist/src/sync/index.d.ts +8 -0
- package/dist/src/sync/index.d.ts.map +1 -0
- package/dist/src/sync/index.js +6 -0
- package/dist/src/sync/index.js.map +1 -0
- package/dist/src/sync/sync-coordinator.d.ts +49 -0
- package/dist/src/sync/sync-coordinator.d.ts.map +1 -0
- package/dist/src/sync/sync-coordinator.js +248 -0
- package/dist/src/sync/sync-coordinator.js.map +1 -0
- package/dist/src/sync/sync-metadata.d.ts +75 -0
- package/dist/src/sync/sync-metadata.d.ts.map +1 -0
- package/dist/src/sync/sync-metadata.js +100 -0
- package/dist/src/sync/sync-metadata.js.map +1 -0
- package/dist/src/types/living-docs-us-file.d.ts +63 -0
- package/dist/src/types/living-docs-us-file.d.ts.map +1 -0
- package/dist/src/types/living-docs-us-file.js +27 -0
- package/dist/src/types/living-docs-us-file.js.map +1 -0
- package/dist/src/validators/format-preservation-validator.d.ts +127 -0
- package/dist/src/validators/format-preservation-validator.d.ts.map +1 -0
- package/dist/src/validators/format-preservation-validator.js +187 -0
- package/dist/src/validators/format-preservation-validator.js.map +1 -0
- package/package.json +3 -2
- package/plugins/specweave/.claude-plugin/plugin.json +36 -2
- package/plugins/specweave/agents/architect/AGENT.md +11 -2
- package/plugins/specweave/agents/test-aware-planner/AGENT.md +81 -25
- package/plugins/specweave/commands/specweave-archive-features.md +11 -1
- package/plugins/specweave/commands/specweave-import-external.md +407 -0
- package/plugins/specweave/commands/specweave-progress.md +45 -97
- package/plugins/specweave/hooks/post-edit-spec.sh +41 -0
- package/plugins/specweave/hooks/post-increment-completion.sh +168 -26
- package/plugins/specweave/hooks/post-increment-planning.sh +148 -4
- package/plugins/specweave/hooks/post-spec-update.sh +0 -0
- package/plugins/specweave/hooks/post-task-completion.sh +75 -5
- package/plugins/specweave/hooks/post-write-spec.sh +37 -0
- package/plugins/specweave/lib/hooks/auto-transition.js +1 -1
- package/plugins/specweave/lib/hooks/auto-transition.ts +1 -1
- package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
- package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
- package/plugins/specweave/lib/hooks/sync-cache.js +294 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.js +67 -2
- package/plugins/specweave/lib/hooks/sync-us-tasks.js +200 -14
- package/plugins/specweave/lib/hooks/translate-file.js +1 -1
- package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
- package/plugins/specweave/lib/hooks/update-ac-status.js +1 -1
- package/plugins/specweave/lib/hooks/update-ac-status.ts +1 -1
- package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
- package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +345 -0
- package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +106 -0
- package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +220 -0
- package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +60 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +192 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
- package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +276 -0
- package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +163 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +541 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
- package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +157 -0
- package/plugins/specweave/lib/vendor/core/types/increment-metadata.js +191 -0
- package/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
- package/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
- package/plugins/specweave/lib/vendor/generators/spec/task-parser.js +301 -0
- package/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
- package/plugins/specweave/lib/vendor/utils/logger.d.ts +48 -0
- package/plugins/specweave/lib/vendor/utils/logger.js +53 -0
- package/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
- package/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
- package/plugins/specweave/lib/vendor/utils/translation.js +414 -0
- package/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
- package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-backend/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-confluent/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-docs/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-figma/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/commands/specweave-github-update-user-story.md +1 -1
- package/plugins/specweave-github/hooks/post-task-completion.sh +37 -22
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
- package/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +1 -1
- package/plugins/specweave-github/lib/github-spec-content-sync.js +2 -1
- package/plugins/specweave-github/lib/github-spec-content-sync.ts +4 -1
- package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
- package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.ts +10 -1
- package/plugins/specweave-github/lib/progress-comment-builder.js +1 -1
- package/plugins/specweave-github/lib/progress-comment-builder.ts +2 -2
- package/plugins/specweave-github/lib/types.ts +1 -1
- package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +1 -1
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-mobile/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-payments/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-testing/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ui/.claude-plugin/plugin.json +1 -1
- package/src/templates/.env.example +5 -0
- package/src/templates/config-permissions-guide.md +413 -0
- package/src/templates/config.json.template +68 -0
- package/src/templates/tasks.md.template +180 -201
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -5442
|
@@ -37,31 +37,33 @@ fi
|
|
|
37
37
|
ISSUE_NUMBER=$(jq -r '.github.issue // empty' "$METADATA_FILE" 2>/dev/null)
|
|
38
38
|
|
|
39
39
|
if [ -z "$ISSUE_NUMBER" ] || [ "$ISSUE_NUMBER" = "null" ]; then
|
|
40
|
-
# No GitHub issue linked - skip GitHub closure but
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# Check if gh CLI is available
|
|
47
|
-
if ! command -v gh &> /dev/null; then
|
|
48
|
-
echo "â ī¸ $HOOK_NAME: GitHub CLI (gh) not found - skipping issue closure" >&2
|
|
49
|
-
exit 0
|
|
40
|
+
# No GitHub issue linked - skip GitHub closure but continue with sync
|
|
41
|
+
echo "âšī¸ No GitHub issue linked to increment $INCREMENT_ID"
|
|
42
|
+
SKIP_GITHUB_CLOSURE=true
|
|
43
|
+
else
|
|
44
|
+
SKIP_GITHUB_CLOSURE=false
|
|
50
45
|
fi
|
|
51
46
|
|
|
52
|
-
#
|
|
53
|
-
|
|
47
|
+
# ============================================================================
|
|
48
|
+
# GITHUB ISSUE CLOSURE (if linked)
|
|
49
|
+
# ============================================================================
|
|
54
50
|
|
|
55
|
-
if [ "$
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
if [ "$SKIP_GITHUB_CLOSURE" = "false" ]; then
|
|
52
|
+
# Check if gh CLI is available
|
|
53
|
+
if ! command -v gh &> /dev/null; then
|
|
54
|
+
echo "â ī¸ $HOOK_NAME: GitHub CLI (gh) not found - skipping issue closure" >&2
|
|
55
|
+
else
|
|
56
|
+
# Check if issue is already closed
|
|
57
|
+
ISSUE_STATE=$(gh issue view "$ISSUE_NUMBER" --json state --jq '.state' 2>/dev/null || echo "")
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
echo "
|
|
59
|
+
if [ "$ISSUE_STATE" = "CLOSED" ]; then
|
|
60
|
+
echo "â GitHub issue #$ISSUE_NUMBER already closed"
|
|
61
|
+
else
|
|
62
|
+
# Close the GitHub issue with completion message
|
|
63
|
+
echo "đ Closing GitHub issue #$ISSUE_NUMBER for increment $INCREMENT_ID..."
|
|
62
64
|
|
|
63
|
-
# Create completion comment
|
|
64
|
-
COMPLETION_COMMENT="## â
Increment Complete
|
|
65
|
+
# Create completion comment
|
|
66
|
+
COMPLETION_COMMENT="## â
Increment Complete
|
|
65
67
|
|
|
66
68
|
Increment \`$INCREMENT_ID\` has been marked as complete.
|
|
67
69
|
|
|
@@ -74,16 +76,156 @@ Increment \`$INCREMENT_ID\` has been marked as complete.
|
|
|
74
76
|
---
|
|
75
77
|
đ¤ Auto-closed by SpecWeave post-increment-completion hook"
|
|
76
78
|
|
|
77
|
-
# Close issue with comment
|
|
78
|
-
gh issue close "$ISSUE_NUMBER" --comment "$COMPLETION_COMMENT" 2>/dev/null || {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
79
|
+
# Close issue with comment
|
|
80
|
+
gh issue close "$ISSUE_NUMBER" --comment "$COMPLETION_COMMENT" 2>/dev/null || {
|
|
81
|
+
echo "â ī¸ Failed to close issue #$ISSUE_NUMBER" >&2
|
|
82
|
+
}
|
|
82
83
|
|
|
83
|
-
echo "â
GitHub issue #$ISSUE_NUMBER closed successfully"
|
|
84
|
+
echo "â
GitHub issue #$ISSUE_NUMBER closed successfully"
|
|
85
|
+
fi
|
|
86
|
+
fi
|
|
87
|
+
fi
|
|
84
88
|
|
|
85
89
|
# Update status line cache (increment no longer open)
|
|
86
90
|
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
87
91
|
bash "$HOOK_DIR/lib/update-status-line.sh" 2>/dev/null || true
|
|
88
92
|
|
|
93
|
+
# ============================================================================
|
|
94
|
+
# SYNC LIVING DOCS (NEW in v0.24.0 - Critical Missing Feature)
|
|
95
|
+
# ============================================================================
|
|
96
|
+
# After increment completes, perform FULL living docs sync to ensure:
|
|
97
|
+
# - Feature specs finalized with all user stories marked complete
|
|
98
|
+
# - ADRs created/updated with final architecture decisions
|
|
99
|
+
# - Architecture docs updated with implementation details
|
|
100
|
+
# - Delivery docs updated with what was shipped
|
|
101
|
+
# - Internal/public docs reflect completed work
|
|
102
|
+
#
|
|
103
|
+
# This is the FINAL, COMPREHENSIVE sync that happens once per increment.
|
|
104
|
+
# (Task-level sync in post-task-completion.sh handles incremental updates)
|
|
105
|
+
#
|
|
106
|
+
# Architecture Decision: Non-blocking execution
|
|
107
|
+
# - If sync fails, log error but don't crash hook (GitHub issue already closed)
|
|
108
|
+
# - Living docs can be manually synced later with /specweave:sync-docs
|
|
109
|
+
# - Failure mode: Graceful degradation (increment still completes)
|
|
110
|
+
|
|
111
|
+
if command -v node &> /dev/null; then
|
|
112
|
+
echo ""
|
|
113
|
+
echo "đ Performing final living docs sync for increment $INCREMENT_ID..."
|
|
114
|
+
|
|
115
|
+
# ========================================================================
|
|
116
|
+
# EXTRACT FEATURE ID (v0.23.0+)
|
|
117
|
+
# ========================================================================
|
|
118
|
+
# Extract epic field from spec.md frontmatter (e.g., epic: FS-047)
|
|
119
|
+
# This ensures sync uses the explicitly defined feature ID rather than
|
|
120
|
+
# auto-generating one, maintaining traceability with living docs structure.
|
|
121
|
+
|
|
122
|
+
FEATURE_ID=""
|
|
123
|
+
SPEC_MD_PATH="$INCREMENT_DIR/spec.md"
|
|
124
|
+
|
|
125
|
+
if [ -f "$SPEC_MD_PATH" ]; then
|
|
126
|
+
# Extract epic field from YAML frontmatter
|
|
127
|
+
FEATURE_ID=$(awk '
|
|
128
|
+
BEGIN { in_frontmatter=0 }
|
|
129
|
+
/^---$/ {
|
|
130
|
+
if (in_frontmatter == 0) {
|
|
131
|
+
in_frontmatter=1; next
|
|
132
|
+
} else {
|
|
133
|
+
exit
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
in_frontmatter == 1 && /^epic:/ {
|
|
137
|
+
gsub(/^epic:[ \t]*/, "");
|
|
138
|
+
gsub(/["'\'']/, "");
|
|
139
|
+
print;
|
|
140
|
+
exit
|
|
141
|
+
}
|
|
142
|
+
' "$SPEC_MD_PATH" | tr -d '\r\n')
|
|
143
|
+
|
|
144
|
+
if [ -n "$FEATURE_ID" ]; then
|
|
145
|
+
echo " đ Using feature ID from spec.md: $FEATURE_ID"
|
|
146
|
+
else
|
|
147
|
+
echo " âšī¸ No epic field found in spec.md - will auto-generate feature ID"
|
|
148
|
+
fi
|
|
149
|
+
else
|
|
150
|
+
echo " â ī¸ spec.md not found at $SPEC_MD_PATH" >&2
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# ========================================================================
|
|
154
|
+
# EXTRACT PROJECT ID (v0.20.0+)
|
|
155
|
+
# ========================================================================
|
|
156
|
+
# Extract activeProject from config.json (defaults to "default")
|
|
157
|
+
# Supports multi-project mode where specs are organized by project.
|
|
158
|
+
|
|
159
|
+
PROJECT_ID="default"
|
|
160
|
+
CONFIG_PATH="$PROJECT_ROOT/.specweave/config.json"
|
|
161
|
+
|
|
162
|
+
if [ -f "$CONFIG_PATH" ]; then
|
|
163
|
+
if command -v jq >/dev/null 2>&1; then
|
|
164
|
+
ACTIVE_PROJECT=$(jq -r '.activeProject // "default"' "$CONFIG_PATH" 2>/dev/null || echo "default")
|
|
165
|
+
if [ -n "$ACTIVE_PROJECT" ] && [ "$ACTIVE_PROJECT" != "null" ]; then
|
|
166
|
+
PROJECT_ID="$ACTIVE_PROJECT"
|
|
167
|
+
fi
|
|
168
|
+
fi
|
|
169
|
+
fi
|
|
170
|
+
echo " đ Project ID: $PROJECT_ID"
|
|
171
|
+
|
|
172
|
+
# ========================================================================
|
|
173
|
+
# LOCATE SYNC SCRIPT
|
|
174
|
+
# ========================================================================
|
|
175
|
+
# Find sync-living-docs.js in order of preference:
|
|
176
|
+
# 1. In-place compiled (development, esbuild output)
|
|
177
|
+
# 2. Local dist (development, tsc output)
|
|
178
|
+
# 3. node_modules (installed as dependency)
|
|
179
|
+
# 4. Plugin marketplace (Claude Code global installation)
|
|
180
|
+
|
|
181
|
+
SYNC_SCRIPT=""
|
|
182
|
+
if [ -f "$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
183
|
+
# Development: Use in-place compiled hooks (esbuild, not tsc)
|
|
184
|
+
SYNC_SCRIPT="$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
185
|
+
echo " đ§ Using in-place compiled hook (development mode)"
|
|
186
|
+
elif [ -f "$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
187
|
+
# Development: Use project's compiled files (has node_modules)
|
|
188
|
+
SYNC_SCRIPT="$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
189
|
+
echo " đ§ Using local dist (development mode)"
|
|
190
|
+
elif [ -f "$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
191
|
+
# Installed as dependency: Use node_modules version
|
|
192
|
+
SYNC_SCRIPT="$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
193
|
+
echo " đĻ Using node_modules version"
|
|
194
|
+
elif [ -n "${CLAUDE_PLUGIN_ROOT}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js" ]; then
|
|
195
|
+
# Fallback: Plugin marketplace (may fail if deps missing)
|
|
196
|
+
SYNC_SCRIPT="${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js"
|
|
197
|
+
echo " đ Using plugin marketplace version"
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
# ========================================================================
|
|
201
|
+
# EXECUTE SYNC
|
|
202
|
+
# ========================================================================
|
|
203
|
+
# Run living docs sync with feature ID and project ID
|
|
204
|
+
# Non-blocking: Errors logged but don't crash hook
|
|
205
|
+
|
|
206
|
+
if [ -n "$SYNC_SCRIPT" ]; then
|
|
207
|
+
# Pass FEATURE_ID and PROJECT_ID as environment variables if available
|
|
208
|
+
if [ -n "$FEATURE_ID" ]; then
|
|
209
|
+
(cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$INCREMENT_ID") 2>&1 || {
|
|
210
|
+
echo " â ī¸ Failed to sync living docs (non-blocking - you can run /specweave:sync-docs manually)" >&2
|
|
211
|
+
}
|
|
212
|
+
else
|
|
213
|
+
# No explicit feature ID - sync will auto-generate
|
|
214
|
+
(cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$INCREMENT_ID") 2>&1 || {
|
|
215
|
+
echo " â ī¸ Failed to sync living docs (non-blocking - you can run /specweave:sync-docs manually)" >&2
|
|
216
|
+
}
|
|
217
|
+
fi
|
|
218
|
+
echo " â
Living docs sync complete"
|
|
219
|
+
echo ""
|
|
220
|
+
else
|
|
221
|
+
echo " â ī¸ sync-living-docs.js not found in any location - skipping living docs sync" >&2
|
|
222
|
+
echo " đĄ To manually sync: /specweave:sync-docs update" >&2
|
|
223
|
+
echo ""
|
|
224
|
+
fi
|
|
225
|
+
else
|
|
226
|
+
echo " â ī¸ Node.js not found - skipping living docs sync" >&2
|
|
227
|
+
echo " đĄ Install Node.js to enable automatic living docs sync" >&2
|
|
228
|
+
echo ""
|
|
229
|
+
fi
|
|
230
|
+
|
|
89
231
|
exit 0
|
|
@@ -684,16 +684,44 @@ EOF
|
|
|
684
684
|
|
|
685
685
|
translate_living_docs_specs "$increment_id"
|
|
686
686
|
|
|
687
|
-
#
|
|
687
|
+
# ============================================================================
|
|
688
|
+
# INCREMENT-LEVEL GITHUB ISSUE CREATION (DEPRECATED v0.24.0+)
|
|
689
|
+
# ============================================================================
|
|
690
|
+
#
|
|
691
|
+
# â ī¸ DEPRECATED: SpecWeave now syncs ONLY at User Story level.
|
|
692
|
+
#
|
|
693
|
+
# Feature/Increment-level issues like "[FS-047] Title" are NO LONGER created.
|
|
694
|
+
# Instead, use:
|
|
695
|
+
# /specweave-github:sync FS-047
|
|
696
|
+
#
|
|
697
|
+
# This creates PROPER User Story-level issues:
|
|
698
|
+
# [FS-047][US-001] User Story Title
|
|
699
|
+
# [FS-047][US-002] User Story Title
|
|
700
|
+
# etc.
|
|
701
|
+
#
|
|
702
|
+
# @see .specweave/increments/0047-us-task-linkage/reports/GITHUB-TITLE-FORMAT-FIX-PLAN.md
|
|
703
|
+
# ============================================================================
|
|
704
|
+
|
|
705
|
+
# 7. Increment-level GitHub issue creation (DEPRECATED - disabled by default)
|
|
688
706
|
log_info ""
|
|
689
707
|
log_info "đ Checking GitHub issue auto-creation..."
|
|
690
708
|
|
|
691
|
-
# Check if
|
|
692
|
-
local
|
|
709
|
+
# Check if upsert permission is enabled in config (v0.24.0+: Three-Permission Architecture)
|
|
710
|
+
local can_upsert=$(cat "$CONFIG_FILE" 2>/dev/null | grep -A 5 '"sync"' | grep -A 5 '"settings"' | grep -o '"canUpsertInternalItems"[[:space:]]*:[[:space:]]*\(true\|false\)' | grep -o '\(true\|false\)' || echo "false")
|
|
693
711
|
|
|
694
|
-
|
|
712
|
+
# DEPRECATED: Override to false unless explicitly enabled via env var
|
|
713
|
+
# This entire section is deprecated - use /specweave-github:sync for User Story-level issues
|
|
714
|
+
if [ "$SPECWEAVE_ENABLE_INCREMENT_GITHUB_SYNC" != "true" ]; then
|
|
715
|
+
can_upsert="false"
|
|
716
|
+
log_debug "Increment GitHub sync disabled (use /specweave-github:sync for User Story-level issues)"
|
|
717
|
+
fi
|
|
718
|
+
|
|
719
|
+
log_debug "Can upsert internal items (deprecated increment sync): $can_upsert"
|
|
720
|
+
local auto_create="$can_upsert" # Backward compatibility alias
|
|
695
721
|
|
|
696
722
|
if [ "$auto_create" = "true" ]; then
|
|
723
|
+
log_info " â ī¸ WARNING: Increment-level sync is DEPRECATED"
|
|
724
|
+
log_info " â
Use /specweave-github:sync for [FS-XXX][US-YYY] format"
|
|
697
725
|
log_info " đĻ Auto-create enabled, checking for GitHub CLI..."
|
|
698
726
|
|
|
699
727
|
# ============================================================================
|
|
@@ -830,6 +858,122 @@ EOF_MINIMAL
|
|
|
830
858
|
fi
|
|
831
859
|
fi
|
|
832
860
|
|
|
861
|
+
# ============================================================================
|
|
862
|
+
# LIVING DOCS SYNC (NEW - v0.23.0+, Increment 0047)
|
|
863
|
+
# ============================================================================
|
|
864
|
+
# CRITICAL: Sync increment spec to living docs structure IMMEDIATELY
|
|
865
|
+
# after increment creation (not just on task completion)
|
|
866
|
+
#
|
|
867
|
+
# Why this matters:
|
|
868
|
+
# - Creates FS-XXX feature folder with User Story files
|
|
869
|
+
# - Syncs acceptance criteria and task linkages
|
|
870
|
+
# - Enables traceability from the moment increment is planned
|
|
871
|
+
#
|
|
872
|
+
# Previous behavior (BROKEN):
|
|
873
|
+
# - Living docs only synced AFTER first task completion
|
|
874
|
+
# - New increments had empty living docs until tasks marked complete
|
|
875
|
+
# - Manual /specweave:sync-docs required for every new increment
|
|
876
|
+
#
|
|
877
|
+
# New behavior (FIXED):
|
|
878
|
+
# - Living docs auto-sync during increment creation
|
|
879
|
+
# - FS-XXX folder created with all User Stories immediately
|
|
880
|
+
# - No manual intervention needed
|
|
881
|
+
#
|
|
882
|
+
# @see .specweave/increments/0047-us-task-linkage/ (US-Task Linkage)
|
|
883
|
+
# ============================================================================
|
|
884
|
+
|
|
885
|
+
log_info ""
|
|
886
|
+
log_info "đ Syncing living docs for new increment..."
|
|
887
|
+
|
|
888
|
+
if command -v node &> /dev/null && [ -n "$increment_id" ]; then
|
|
889
|
+
# Extract feature ID from spec.md frontmatter (epic: FS-047)
|
|
890
|
+
local FEATURE_ID=""
|
|
891
|
+
local spec_md_path="$increment_dir/spec.md"
|
|
892
|
+
|
|
893
|
+
if [ -f "$spec_md_path" ]; then
|
|
894
|
+
FEATURE_ID=$(awk '
|
|
895
|
+
BEGIN { in_frontmatter=0 }
|
|
896
|
+
/^---$/ {
|
|
897
|
+
if (in_frontmatter == 0) {
|
|
898
|
+
in_frontmatter=1; next
|
|
899
|
+
} else {
|
|
900
|
+
exit
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
in_frontmatter == 1 && /^epic:/ {
|
|
904
|
+
gsub(/^epic:[ \t]*/, "");
|
|
905
|
+
gsub(/["'\'']/, "");
|
|
906
|
+
print;
|
|
907
|
+
exit
|
|
908
|
+
}
|
|
909
|
+
' "$spec_md_path" | tr -d '\r\n')
|
|
910
|
+
|
|
911
|
+
if [ -n "$FEATURE_ID" ]; then
|
|
912
|
+
log_debug " đ Extracted feature ID: $FEATURE_ID"
|
|
913
|
+
else
|
|
914
|
+
log_debug " â ī¸ No epic field in spec.md, sync will auto-generate ID"
|
|
915
|
+
fi
|
|
916
|
+
fi
|
|
917
|
+
|
|
918
|
+
# Extract project ID from config (defaults to "default")
|
|
919
|
+
local PROJECT_ID="default"
|
|
920
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
921
|
+
if command -v jq >/dev/null 2>&1; then
|
|
922
|
+
local active_project=$(jq -r '.multiProject.activeProject // .project.name // "default"' "$CONFIG_FILE" 2>/dev/null)
|
|
923
|
+
if [ -n "$active_project" ] && [ "$active_project" != "null" ]; then
|
|
924
|
+
PROJECT_ID="$active_project"
|
|
925
|
+
fi
|
|
926
|
+
fi
|
|
927
|
+
fi
|
|
928
|
+
log_debug " đ Project ID: $PROJECT_ID"
|
|
929
|
+
|
|
930
|
+
# Determine sync script location (same logic as post-task-completion.sh)
|
|
931
|
+
local SYNC_SCRIPT=""
|
|
932
|
+
if [ -f "$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
933
|
+
SYNC_SCRIPT="$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
934
|
+
log_debug " Using in-place compiled hook: $SYNC_SCRIPT"
|
|
935
|
+
elif [ -f "$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
936
|
+
SYNC_SCRIPT="$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
937
|
+
log_debug " Using local dist: $SYNC_SCRIPT"
|
|
938
|
+
elif [ -f "$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
|
|
939
|
+
SYNC_SCRIPT="$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
|
|
940
|
+
log_debug " Using node_modules: $SYNC_SCRIPT"
|
|
941
|
+
elif [ -n "${CLAUDE_PLUGIN_ROOT}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js" ]; then
|
|
942
|
+
SYNC_SCRIPT="${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js"
|
|
943
|
+
log_debug " Using plugin marketplace: $SYNC_SCRIPT"
|
|
944
|
+
fi
|
|
945
|
+
|
|
946
|
+
if [ -n "$SYNC_SCRIPT" ]; then
|
|
947
|
+
log_info " đ Syncing $increment_id to living docs..."
|
|
948
|
+
|
|
949
|
+
# Run living docs sync (non-blocking, best-effort)
|
|
950
|
+
if [ -n "$FEATURE_ID" ]; then
|
|
951
|
+
(cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$increment_id") 2>&1 | \
|
|
952
|
+
grep -E "â
|â|â ī¸|đ" | while read -r line; do echo " $line"; done || {
|
|
953
|
+
log_info " â ī¸ Living docs sync failed (non-blocking)"
|
|
954
|
+
log_debug "Sync error, but continuing hook execution"
|
|
955
|
+
}
|
|
956
|
+
else
|
|
957
|
+
(cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$increment_id") 2>&1 | \
|
|
958
|
+
grep -E "â
|â|â ī¸|đ" | while read -r line; do echo " $line"; done || {
|
|
959
|
+
log_info " â ī¸ Living docs sync failed (non-blocking)"
|
|
960
|
+
log_debug "Sync error, but continuing hook execution"
|
|
961
|
+
}
|
|
962
|
+
fi
|
|
963
|
+
|
|
964
|
+
log_info " â
Living docs sync complete!"
|
|
965
|
+
else
|
|
966
|
+
log_info " â ī¸ sync-living-docs.js not found, skipping auto-sync"
|
|
967
|
+
log_info " đĄ Run /specweave:sync-docs manually to sync living docs"
|
|
968
|
+
fi
|
|
969
|
+
else
|
|
970
|
+
if ! command -v node &> /dev/null; then
|
|
971
|
+
log_debug " â ī¸ Node.js not found, skipping living docs sync"
|
|
972
|
+
else
|
|
973
|
+
log_debug " â ī¸ No increment ID, skipping living docs sync"
|
|
974
|
+
fi
|
|
975
|
+
fi
|
|
976
|
+
|
|
833
977
|
# Note: Spec-level sync (SPECS â GitHub Projects/JIRA Epics) is handled separately
|
|
834
978
|
# See: /specweave-github:sync-spec, /specweave-jira:sync-spec, /specweave-ado:sync-spec
|
|
835
979
|
|
|
File without changes
|
|
@@ -200,7 +200,68 @@ fi
|
|
|
200
200
|
|
|
201
201
|
if command -v node &> /dev/null; then
|
|
202
202
|
if [ -n "$CURRENT_INCREMENT" ]; then
|
|
203
|
-
|
|
203
|
+
# ========================================================================
|
|
204
|
+
# SKIP ARCHIVED INCREMENTS (CRITICAL - prevents folder recreation)
|
|
205
|
+
# ========================================================================
|
|
206
|
+
# If increment is archived, skip living docs sync entirely
|
|
207
|
+
# This prevents recreating archived feature folders in active location
|
|
208
|
+
# See: ULTRATHINK-ARCHIVE-REORGANIZATION-BUG.md for full analysis
|
|
209
|
+
if [ -d ".specweave/increments/_archive/$CURRENT_INCREMENT" ]; then
|
|
210
|
+
echo "[$(date)] âī¸ Skipping living docs sync for archived increment $CURRENT_INCREMENT" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
211
|
+
else
|
|
212
|
+
echo "[$(date)] đ Checking living docs sync for $CURRENT_INCREMENT" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
213
|
+
|
|
214
|
+
# ========================================================================
|
|
215
|
+
# EXTRACT FEATURE ID (NEW in v0.23.0 - Increment 0047: US-Task Linkage)
|
|
216
|
+
# ========================================================================
|
|
217
|
+
# Extract epic field from spec.md frontmatter (e.g., epic: FS-047)
|
|
218
|
+
# This ensures sync uses the explicitly defined feature ID rather than
|
|
219
|
+
# auto-generating one, maintaining traceability with living docs structure.
|
|
220
|
+
|
|
221
|
+
FEATURE_ID=""
|
|
222
|
+
SPEC_MD_PATH=".specweave/increments/$CURRENT_INCREMENT/spec.md"
|
|
223
|
+
|
|
224
|
+
if [ -f "$SPEC_MD_PATH" ]; then
|
|
225
|
+
# Extract epic field from YAML frontmatter
|
|
226
|
+
FEATURE_ID=$(awk '
|
|
227
|
+
BEGIN { in_frontmatter=0 }
|
|
228
|
+
/^---$/ {
|
|
229
|
+
if (in_frontmatter == 0) {
|
|
230
|
+
in_frontmatter=1; next
|
|
231
|
+
} else {
|
|
232
|
+
exit
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
in_frontmatter == 1 && /^epic:/ {
|
|
236
|
+
gsub(/^epic:[ \t]*/, "");
|
|
237
|
+
gsub(/["'\'']/, "");
|
|
238
|
+
print;
|
|
239
|
+
exit
|
|
240
|
+
}
|
|
241
|
+
' "$SPEC_MD_PATH" | tr -d '\r\n')
|
|
242
|
+
|
|
243
|
+
if [ -n "$FEATURE_ID" ]; then
|
|
244
|
+
echo "[$(date)] đ Extracted feature ID from spec.md: $FEATURE_ID" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
245
|
+
else
|
|
246
|
+
echo "[$(date)] â ī¸ No epic field found in spec.md frontmatter" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
247
|
+
echo "[$(date)] âšī¸ Sync will auto-generate feature ID from increment number" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
248
|
+
fi
|
|
249
|
+
else
|
|
250
|
+
echo "[$(date)] â ī¸ spec.md not found at $SPEC_MD_PATH" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
251
|
+
fi
|
|
252
|
+
|
|
253
|
+
# Extract project ID from config or metadata (defaults to "default")
|
|
254
|
+
PROJECT_ID="default"
|
|
255
|
+
if [ -f ".specweave/config.json" ]; then
|
|
256
|
+
# Try to extract activeProject from config
|
|
257
|
+
if command -v jq >/dev/null 2>&1; then
|
|
258
|
+
ACTIVE_PROJECT=$(jq -r '.activeProject // "default"' ".specweave/config.json" 2>/dev/null || echo "default")
|
|
259
|
+
if [ -n "$ACTIVE_PROJECT" ] && [ "$ACTIVE_PROJECT" != "null" ]; then
|
|
260
|
+
PROJECT_ID="$ACTIVE_PROJECT"
|
|
261
|
+
fi
|
|
262
|
+
fi
|
|
263
|
+
fi
|
|
264
|
+
echo "[$(date)] đ Project ID: $PROJECT_ID" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
204
265
|
|
|
205
266
|
# Determine which sync script to use (project local or global)
|
|
206
267
|
SYNC_SCRIPT=""
|
|
@@ -223,13 +284,22 @@ if command -v node &> /dev/null; then
|
|
|
223
284
|
fi
|
|
224
285
|
|
|
225
286
|
if [ -n "$SYNC_SCRIPT" ]; then
|
|
226
|
-
# Run living docs sync (non-blocking, best-effort)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
287
|
+
# Run living docs sync with feature ID (non-blocking, best-effort)
|
|
288
|
+
# Pass FEATURE_ID and PROJECT_ID as environment variables if available
|
|
289
|
+
if [ -n "$FEATURE_ID" ]; then
|
|
290
|
+
(cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$CURRENT_INCREMENT") 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
|
|
291
|
+
echo "[$(date)] â ī¸ Failed to sync living docs (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
292
|
+
}
|
|
293
|
+
else
|
|
294
|
+
# No explicit feature ID - sync will auto-generate
|
|
295
|
+
(cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$CURRENT_INCREMENT") 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
|
|
296
|
+
echo "[$(date)] â ī¸ Failed to sync living docs (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
297
|
+
}
|
|
298
|
+
fi
|
|
230
299
|
else
|
|
231
300
|
echo "[$(date)] â ī¸ sync-living-docs.js not found in any location" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
232
301
|
fi
|
|
302
|
+
fi # Close the archive check 'else' block
|
|
233
303
|
fi
|
|
234
304
|
fi
|
|
235
305
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Post-Write Hook: Update Status Line After spec.md or tasks.md Writes
|
|
4
|
+
#
|
|
5
|
+
# Triggers: After Write tool creates/replaces spec.md or tasks.md
|
|
6
|
+
# Action: Updates status line cache to reflect latest AC/task progress
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
# Find project root
|
|
11
|
+
find_project_root() {
|
|
12
|
+
local dir="$PWD"
|
|
13
|
+
while [[ "$dir" != "/" ]]; do
|
|
14
|
+
if [[ -d "$dir/.specweave" ]]; then
|
|
15
|
+
echo "$dir"
|
|
16
|
+
return 0
|
|
17
|
+
fi
|
|
18
|
+
dir=$(dirname "$dir")
|
|
19
|
+
done
|
|
20
|
+
echo "$PWD"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
PROJECT_ROOT=$(find_project_root)
|
|
24
|
+
|
|
25
|
+
# Get the file that was written from TOOL_USE_CONTENT environment variable
|
|
26
|
+
WRITTEN_FILE="${TOOL_USE_CONTENT:-}"
|
|
27
|
+
|
|
28
|
+
# Only update status line if spec.md or tasks.md was written
|
|
29
|
+
if [[ "$WRITTEN_FILE" == *"/spec.md"* ]] || [[ "$WRITTEN_FILE" == *"/tasks.md"* ]]; then
|
|
30
|
+
# Check if the write is in an increment folder
|
|
31
|
+
if [[ "$WRITTEN_FILE" == *"/.specweave/increments/"* ]]; then
|
|
32
|
+
# Run status line update
|
|
33
|
+
"$PROJECT_ROOT/plugins/specweave/hooks/lib/update-status-line.sh" &>/dev/null || true
|
|
34
|
+
fi
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
exit 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { AutoTransitionManager } from "
|
|
2
|
+
import { AutoTransitionManager } from "../vendor/core/increment/auto-transition-manager.js";
|
|
3
3
|
async function main() {
|
|
4
4
|
const event = process.argv[2];
|
|
5
5
|
const incrementId = process.argv[3];
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* node auto-transition.ts auto-correct 0039-ultra-smart-next-command
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { AutoTransitionManager } from '
|
|
22
|
+
import { AutoTransitionManager } from '../vendor/core/increment/auto-transition-manager.js';
|
|
23
23
|
|
|
24
24
|
async function main() {
|
|
25
25
|
const event = process.argv[2];
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
prepareTranslation,
|
|
5
5
|
postProcessTranslation,
|
|
6
6
|
getLanguageName
|
|
7
|
-
} from "
|
|
7
|
+
} from "../vendor/utils/translation.js";
|
|
8
8
|
async function invokeTranslatorSkill(content, sourceLang, targetLang = "en") {
|
|
9
9
|
try {
|
|
10
10
|
const prepared = prepareTranslation(content, sourceLang, targetLang);
|