specweave 0.18.0 ā 0.20.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.md +229 -1817
- package/README.md +68 -0
- package/bin/specweave.js +62 -6
- package/dist/locales/de/.gitkeep +0 -0
- package/dist/locales/de/cli.json +108 -0
- package/dist/locales/en/cli.json +287 -0
- package/dist/locales/en/errors.json +7 -0
- package/dist/locales/en/templates.json +6 -0
- package/dist/locales/es/.gitkeep +0 -0
- package/dist/locales/es/cli.json +41 -0
- package/dist/locales/fr/.gitkeep +0 -0
- package/dist/locales/fr/cli.json +108 -0
- package/dist/locales/ja/.gitkeep +0 -0
- package/dist/locales/ja/cli.json +108 -0
- package/dist/locales/ko/.gitkeep +0 -0
- package/dist/locales/ko/cli.json +108 -0
- package/dist/locales/pt/.gitkeep +0 -0
- package/dist/locales/pt/cli.json +108 -0
- package/dist/locales/ru/.gitkeep +0 -0
- package/dist/locales/ru/cli.json +269 -0
- package/dist/locales/zh/.gitkeep +0 -0
- package/dist/locales/zh/cli.json +108 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +3 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
- package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts +21 -0
- package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/update-ac-status.js +162 -0
- package/dist/plugins/specweave/lib/hooks/update-ac-status.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js +65 -6
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts +25 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js +191 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/completion-calculator.d.ts +112 -0
- package/dist/plugins/specweave-github/lib/completion-calculator.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/completion-calculator.js +301 -0
- package/dist/plugins/specweave-github/lib/completion-calculator.js.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts +3 -3
- package/dist/plugins/specweave-github/lib/duplicate-detector.js +3 -3
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts +70 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js +258 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +14 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.js +51 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +2 -2
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.js +20 -5
- package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts +87 -0
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-feature-sync.js +412 -0
- package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -0
- 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 +64 -13
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/progress-comment-builder.d.ts +78 -0
- package/dist/plugins/specweave-github/lib/progress-comment-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/progress-comment-builder.js +237 -0
- package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -0
- package/dist/plugins/specweave-github/lib/user-story-content-builder.d.ts +97 -0
- package/dist/plugins/specweave-github/lib/user-story-content-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/user-story-content-builder.js +301 -0
- package/dist/plugins/specweave-github/lib/user-story-content-builder.js.map +1 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts +83 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +386 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +28 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +156 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +1 -0
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts +57 -0
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts.map +1 -0
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js +248 -0
- package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js.map +1 -0
- package/dist/plugins/specweave-kafka/lib/cli/types.d.ts +82 -0
- package/dist/plugins/specweave-kafka/lib/cli/types.d.ts.map +1 -0
- package/dist/plugins/specweave-kafka/lib/cli/types.js +13 -0
- package/dist/plugins/specweave-kafka/lib/cli/types.js.map +1 -0
- package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts +49 -0
- package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts.map +1 -0
- package/dist/plugins/specweave-kafka/lib/mcp/detector.js +316 -0
- package/dist/plugins/specweave-kafka/lib/mcp/detector.js.map +1 -0
- package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts +70 -0
- package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts.map +1 -0
- package/dist/plugins/specweave-kafka/lib/mcp/types.js +23 -0
- package/dist/plugins/specweave-kafka/lib/mcp/types.js.map +1 -0
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts +85 -0
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts.map +1 -0
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.js +281 -0
- package/dist/plugins/specweave-kafka/lib/utils/partitioning.js.map +1 -0
- package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts +75 -0
- package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts.map +1 -0
- package/dist/plugins/specweave-kafka/lib/utils/sizing.js +238 -0
- package/dist/plugins/specweave-kafka/lib/utils/sizing.js.map +1 -0
- package/dist/spec-parser.js +629 -0
- package/dist/src/cli/commands/import-docs.js +4 -4
- package/dist/src/cli/commands/import-docs.js.map +1 -1
- package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -1
- package/dist/src/cli/commands/init-multiproject.js +17 -18
- package/dist/src/cli/commands/init-multiproject.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +107 -3
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-multiproject.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-to-multiproject.js +8 -4
- package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
- package/dist/src/cli/commands/switch-project.d.ts.map +1 -1
- package/dist/src/cli/commands/switch-project.js +9 -26
- package/dist/src/cli/commands/switch-project.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-content.js +3 -0
- package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
- package/dist/src/core/deduplication/command-deduplicator.d.ts +166 -0
- package/dist/src/core/deduplication/command-deduplicator.d.ts.map +1 -0
- package/dist/src/core/deduplication/command-deduplicator.js +254 -0
- package/dist/src/core/deduplication/command-deduplicator.js.map +1 -0
- package/dist/src/core/increment/active-increment-manager.d.ts +42 -15
- package/dist/src/core/increment/active-increment-manager.d.ts.map +1 -1
- package/dist/src/core/increment/active-increment-manager.js +113 -46
- package/dist/src/core/increment/active-increment-manager.js.map +1 -1
- package/dist/src/core/increment/conflict-resolver.d.ts +40 -0
- package/dist/src/core/increment/conflict-resolver.d.ts.map +1 -0
- package/dist/src/core/increment/conflict-resolver.js +219 -0
- package/dist/src/core/increment/conflict-resolver.js.map +1 -0
- package/dist/src/core/increment/discipline-checker.d.ts.map +1 -1
- package/dist/src/core/increment/discipline-checker.js +7 -1
- package/dist/src/core/increment/discipline-checker.js.map +1 -1
- package/dist/src/core/increment/duplicate-detector.d.ts +52 -0
- package/dist/src/core/increment/duplicate-detector.d.ts.map +1 -0
- package/dist/src/core/increment/duplicate-detector.js +276 -0
- package/dist/src/core/increment/duplicate-detector.js.map +1 -0
- package/dist/src/core/increment/increment-archiver.d.ts +90 -0
- package/dist/src/core/increment/increment-archiver.d.ts.map +1 -0
- package/dist/src/core/increment/increment-archiver.js +368 -0
- package/dist/src/core/increment/increment-archiver.js.map +1 -0
- package/dist/src/core/increment/increment-reopener.d.ts +165 -0
- package/dist/src/core/increment/increment-reopener.d.ts.map +1 -0
- package/dist/src/core/increment/increment-reopener.js +390 -0
- package/dist/src/core/increment/increment-reopener.js.map +1 -0
- package/dist/src/core/increment/metadata-manager.d.ts +26 -1
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +143 -5
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/recent-work-scanner.d.ts +121 -0
- package/dist/src/core/increment/recent-work-scanner.d.ts.map +1 -0
- package/dist/src/core/increment/recent-work-scanner.js +303 -0
- package/dist/src/core/increment/recent-work-scanner.js.map +1 -0
- package/dist/src/core/increment/types.d.ts +1 -0
- package/dist/src/core/increment/types.d.ts.map +1 -1
- package/dist/src/core/increment-utils.d.ts +112 -0
- package/dist/src/core/increment-utils.d.ts.map +1 -0
- package/dist/src/core/increment-utils.js +210 -0
- package/dist/src/core/increment-utils.js.map +1 -0
- package/dist/src/core/living-docs/ac-project-specific-generator.d.ts +65 -0
- package/dist/src/core/living-docs/ac-project-specific-generator.d.ts.map +1 -0
- package/dist/src/core/living-docs/ac-project-specific-generator.js +175 -0
- package/dist/src/core/living-docs/ac-project-specific-generator.js.map +1 -0
- package/dist/src/core/living-docs/feature-archiver.d.ts +130 -0
- package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -0
- package/dist/src/core/living-docs/feature-archiver.js +549 -0
- package/dist/src/core/living-docs/feature-archiver.js.map +1 -0
- package/dist/src/core/living-docs/feature-id-manager.d.ts +81 -0
- package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -0
- package/dist/src/core/living-docs/feature-id-manager.js +339 -0
- package/dist/src/core/living-docs/feature-id-manager.js.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts +144 -83
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js +488 -270
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
- package/dist/src/core/living-docs/index.d.ts +6 -0
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +6 -0
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/project-detector.d.ts +6 -0
- package/dist/src/core/living-docs/project-detector.d.ts.map +1 -1
- package/dist/src/core/living-docs/project-detector.js +35 -1
- package/dist/src/core/living-docs/project-detector.js.map +1 -1
- package/dist/src/core/living-docs/spec-distributor.d.ts +100 -26
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +1 -1
- package/dist/src/core/living-docs/spec-distributor.js +1275 -258
- package/dist/src/core/living-docs/spec-distributor.js.map +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts +109 -0
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts.map +1 -0
- package/dist/src/core/living-docs/task-project-specific-generator.js +221 -0
- package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -0
- package/dist/src/core/living-docs/types.d.ts +143 -0
- package/dist/src/core/living-docs/types.d.ts.map +1 -1
- package/dist/src/core/project-manager.d.ts +2 -17
- package/dist/src/core/project-manager.d.ts.map +1 -1
- package/dist/src/core/project-manager.js +68 -48
- package/dist/src/core/project-manager.js.map +1 -1
- package/dist/src/core/spec-content-sync.d.ts +1 -1
- package/dist/src/core/spec-content-sync.d.ts.map +1 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts +32 -54
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -1
- package/dist/src/core/sync/enhanced-content-builder.js +142 -138
- package/dist/src/core/sync/enhanced-content-builder.js.map +1 -1
- package/dist/src/core/sync/performance-optimizer.d.ts +153 -0
- package/dist/src/core/sync/performance-optimizer.d.ts.map +1 -0
- package/dist/src/core/sync/performance-optimizer.js +220 -0
- package/dist/src/core/sync/performance-optimizer.js.map +1 -0
- package/dist/src/core/sync/retry-handler.d.ts +98 -0
- package/dist/src/core/sync/retry-handler.d.ts.map +1 -0
- package/dist/src/core/sync/retry-handler.js +196 -0
- package/dist/src/core/sync/retry-handler.js.map +1 -0
- package/dist/src/core/sync/spec-content-sync.d.ts +88 -0
- package/dist/src/core/sync/spec-content-sync.d.ts.map +1 -0
- package/dist/src/core/sync/spec-content-sync.js +5 -0
- package/dist/src/core/sync/spec-content-sync.js.map +1 -0
- package/dist/src/core/sync/types.d.ts +52 -0
- package/dist/src/core/sync/types.d.ts.map +1 -0
- package/dist/src/core/sync/types.js +5 -0
- package/dist/src/core/sync/types.js.map +1 -0
- package/dist/src/core/types/config.d.ts +125 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +25 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +10 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/increment-metadata.js +10 -1
- package/dist/src/core/types/increment-metadata.js.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.js +4 -8
- package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.js +4 -8
- package/dist/src/integrations/jira/jira-mapper.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/plugins/specweave/COMMANDS.md +13 -4
- package/plugins/specweave/agents/pm/AGENT.md +159 -12
- package/plugins/specweave/commands/specweave-abandon.md +22 -20
- package/plugins/specweave/commands/specweave-archive-features.md +121 -0
- package/plugins/specweave/commands/specweave-archive-increments.md +82 -0
- package/plugins/specweave/commands/specweave-archive.md +363 -0
- package/plugins/specweave/commands/specweave-backlog.md +211 -0
- package/plugins/specweave/commands/specweave-fix-duplicates.md +517 -0
- package/plugins/specweave/commands/specweave-increment.md +4 -3
- package/plugins/specweave/commands/specweave-progress.md +176 -27
- package/plugins/specweave/commands/specweave-reopen.md +391 -0
- package/plugins/specweave/commands/specweave-restore-feature.md +90 -0
- package/plugins/specweave/commands/specweave-restore.md +309 -0
- package/plugins/specweave/commands/specweave-resume.md +51 -23
- package/plugins/specweave/commands/specweave-status.md +41 -7
- package/plugins/specweave/commands/specweave-sync-specs.md +425 -0
- package/plugins/specweave/commands/specweave.md +70 -405
- package/plugins/specweave/hooks/hooks.json +4 -0
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
- package/plugins/specweave/hooks/post-increment-planning.sh +26 -2
- package/plugins/specweave/hooks/post-task-completion.sh +39 -0
- package/plugins/specweave/hooks/pre-command-deduplication.sh +83 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +1 -1
- package/plugins/specweave/lib/hooks/sync-living-docs.js +2 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +4 -0
- package/plugins/specweave/lib/hooks/update-ac-status.js +102 -0
- package/plugins/specweave/lib/hooks/update-ac-status.ts +192 -0
- package/plugins/specweave/skills/archive-increments/SKILL.md +198 -0
- package/plugins/specweave/skills/increment-planner/scripts/feature-utils.js +14 -0
- package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +244 -0
- package/plugins/specweave-ado/lib/ado-spec-content-sync.js +49 -5
- package/plugins/specweave-ado/lib/ado-spec-content-sync.ts +72 -6
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-confluent/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-confluent/README.md +375 -0
- package/plugins/specweave-confluent/agents/confluent-architect/AGENT.md +306 -0
- package/plugins/specweave-confluent/skills/confluent-kafka-connect/SKILL.md +453 -0
- package/plugins/specweave-confluent/skills/confluent-ksqldb/SKILL.md +470 -0
- package/plugins/specweave-confluent/skills/confluent-schema-registry/SKILL.md +316 -0
- package/plugins/specweave-github/agents/github-task-splitter/AGENT.md +2 -2
- package/plugins/specweave-github/agents/user-story-updater/AGENT.md +148 -0
- package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +1 -1
- package/plugins/specweave-github/commands/specweave-github-update-user-story.md +156 -0
- package/plugins/specweave-github/hooks/post-task-completion.sh +42 -9
- package/plugins/specweave-github/lib/completion-calculator.js +262 -0
- package/plugins/specweave-github/lib/completion-calculator.ts +434 -0
- package/plugins/specweave-github/lib/duplicate-detector.js +3 -3
- package/plugins/specweave-github/lib/duplicate-detector.ts +4 -4
- package/plugins/specweave-github/lib/epic-content-builder.js +265 -0
- package/plugins/specweave-github/lib/epic-content-builder.ts +376 -0
- package/plugins/specweave-github/lib/github-client-v2.js +49 -0
- package/plugins/specweave-github/lib/github-client-v2.ts +59 -0
- package/plugins/specweave-github/lib/github-epic-sync.js +23 -24
- package/plugins/specweave-github/lib/github-epic-sync.ts +30 -5
- package/plugins/specweave-github/lib/github-feature-sync.js +381 -0
- package/plugins/specweave-github/lib/github-feature-sync.ts +568 -0
- package/plugins/specweave-github/lib/github-spec-content-sync.js +40 -10
- package/plugins/specweave-github/lib/github-spec-content-sync.ts +82 -14
- package/plugins/specweave-github/lib/progress-comment-builder.js +229 -0
- package/plugins/specweave-github/lib/progress-comment-builder.ts +324 -0
- package/plugins/specweave-github/lib/user-story-content-builder.js +299 -0
- package/plugins/specweave-github/lib/user-story-content-builder.ts +413 -0
- package/plugins/specweave-github/lib/user-story-issue-builder.js +344 -0
- package/plugins/specweave-github/lib/user-story-issue-builder.ts +543 -0
- package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +189 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
- package/plugins/specweave-jira/lib/{enhanced-jira-sync.ts.disabled ā enhanced-jira-sync.ts} +26 -52
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +26 -0
- package/plugins/specweave-kafka/IMPLEMENTATION-COMPLETE.md +483 -0
- package/plugins/specweave-kafka/README.md +242 -0
- package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +235 -0
- package/plugins/specweave-kafka/agents/kafka-devops/AGENT.md +209 -0
- package/plugins/specweave-kafka/agents/kafka-observability/AGENT.md +266 -0
- package/plugins/specweave-kafka/commands/deploy.md +99 -0
- package/plugins/specweave-kafka/commands/dev-env.md +176 -0
- package/plugins/specweave-kafka/commands/mcp-configure.md +101 -0
- package/plugins/specweave-kafka/commands/monitor-setup.md +96 -0
- package/plugins/specweave-kafka/docker/kafka-local/docker-compose.yml +187 -0
- package/plugins/specweave-kafka/docker/redpanda/docker-compose.yml +199 -0
- package/plugins/specweave-kafka/docker/templates/consumer-nodejs.js +225 -0
- package/plugins/specweave-kafka/docker/templates/consumer-python.py +220 -0
- package/plugins/specweave-kafka/docker/templates/producer-nodejs.js +168 -0
- package/plugins/specweave-kafka/docker/templates/producer-python.py +167 -0
- package/plugins/specweave-kafka/lib/adapters/apache-kafka-adapter.js +438 -0
- package/plugins/specweave-kafka/lib/adapters/apache-kafka-adapter.ts +541 -0
- package/plugins/specweave-kafka/lib/adapters/platform-adapter.js +47 -0
- package/plugins/specweave-kafka/lib/adapters/platform-adapter.ts +343 -0
- package/plugins/specweave-kafka/lib/cli/kcat-wrapper.js +258 -0
- package/plugins/specweave-kafka/lib/cli/kcat-wrapper.ts +298 -0
- package/plugins/specweave-kafka/lib/cli/types.js +10 -0
- package/plugins/specweave-kafka/lib/cli/types.ts +92 -0
- package/plugins/specweave-kafka/lib/connectors/connector-catalog.js +305 -0
- package/plugins/specweave-kafka/lib/connectors/connector-catalog.ts +528 -0
- package/plugins/specweave-kafka/lib/documentation/diagram-generator.js +114 -0
- package/plugins/specweave-kafka/lib/documentation/diagram-generator.ts +195 -0
- package/plugins/specweave-kafka/lib/documentation/exporter.js +210 -0
- package/plugins/specweave-kafka/lib/documentation/exporter.ts +338 -0
- package/plugins/specweave-kafka/lib/documentation/schema-catalog-generator.js +60 -0
- package/plugins/specweave-kafka/lib/documentation/schema-catalog-generator.ts +130 -0
- package/plugins/specweave-kafka/lib/documentation/topology-generator.js +143 -0
- package/plugins/specweave-kafka/lib/documentation/topology-generator.ts +290 -0
- package/plugins/specweave-kafka/lib/mcp/detector.js +298 -0
- package/plugins/specweave-kafka/lib/mcp/detector.ts +352 -0
- package/plugins/specweave-kafka/lib/mcp/types.js +21 -0
- package/plugins/specweave-kafka/lib/mcp/types.ts +77 -0
- package/plugins/specweave-kafka/lib/multi-cluster/cluster-config-manager.js +193 -0
- package/plugins/specweave-kafka/lib/multi-cluster/cluster-config-manager.ts +362 -0
- package/plugins/specweave-kafka/lib/multi-cluster/cluster-switcher.js +188 -0
- package/plugins/specweave-kafka/lib/multi-cluster/cluster-switcher.ts +359 -0
- package/plugins/specweave-kafka/lib/multi-cluster/health-aggregator.js +195 -0
- package/plugins/specweave-kafka/lib/multi-cluster/health-aggregator.ts +380 -0
- package/plugins/specweave-kafka/lib/observability/opentelemetry-kafka.js +209 -0
- package/plugins/specweave-kafka/lib/observability/opentelemetry-kafka.ts +358 -0
- package/plugins/specweave-kafka/lib/patterns/advanced-ksqldb-patterns.js +354 -0
- package/plugins/specweave-kafka/lib/patterns/advanced-ksqldb-patterns.ts +563 -0
- package/plugins/specweave-kafka/lib/patterns/circuit-breaker-resilience.js +259 -0
- package/plugins/specweave-kafka/lib/patterns/circuit-breaker-resilience.ts +516 -0
- package/plugins/specweave-kafka/lib/patterns/dead-letter-queue.js +233 -0
- package/plugins/specweave-kafka/lib/patterns/dead-letter-queue.ts +423 -0
- package/plugins/specweave-kafka/lib/patterns/exactly-once-semantics.js +266 -0
- package/plugins/specweave-kafka/lib/patterns/exactly-once-semantics.ts +445 -0
- package/plugins/specweave-kafka/lib/patterns/flink-kafka-integration.js +312 -0
- package/plugins/specweave-kafka/lib/patterns/flink-kafka-integration.ts +561 -0
- package/plugins/specweave-kafka/lib/patterns/multi-dc-replication.js +289 -0
- package/plugins/specweave-kafka/lib/patterns/multi-dc-replication.ts +607 -0
- package/plugins/specweave-kafka/lib/patterns/rate-limiting-backpressure.js +264 -0
- package/plugins/specweave-kafka/lib/patterns/rate-limiting-backpressure.ts +498 -0
- package/plugins/specweave-kafka/lib/patterns/stream-processing-optimization.js +263 -0
- package/plugins/specweave-kafka/lib/patterns/stream-processing-optimization.ts +549 -0
- package/plugins/specweave-kafka/lib/patterns/tiered-storage-compaction.js +205 -0
- package/plugins/specweave-kafka/lib/patterns/tiered-storage-compaction.ts +399 -0
- package/plugins/specweave-kafka/lib/performance/performance-optimizer.js +249 -0
- package/plugins/specweave-kafka/lib/performance/performance-optimizer.ts +427 -0
- package/plugins/specweave-kafka/lib/security/kafka-security.js +252 -0
- package/plugins/specweave-kafka/lib/security/kafka-security.ts +494 -0
- package/plugins/specweave-kafka/lib/utils/capacity-planner.js +203 -0
- package/plugins/specweave-kafka/lib/utils/capacity-planner.ts +469 -0
- package/plugins/specweave-kafka/lib/utils/config-validator.js +419 -0
- package/plugins/specweave-kafka/lib/utils/config-validator.ts +564 -0
- package/plugins/specweave-kafka/lib/utils/partitioning.js +329 -0
- package/plugins/specweave-kafka/lib/utils/partitioning.ts +473 -0
- package/plugins/specweave-kafka/lib/utils/sizing.js +221 -0
- package/plugins/specweave-kafka/lib/utils/sizing.ts +374 -0
- package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-broker-metrics.json +628 -0
- package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-cluster-overview.json +564 -0
- package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-consumer-lag.json +509 -0
- package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-jvm-metrics.json +674 -0
- package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-topic-metrics.json +578 -0
- package/plugins/specweave-kafka/monitoring/grafana/provisioning/dashboards/kafka.yml +17 -0
- package/plugins/specweave-kafka/monitoring/grafana/provisioning/datasources/prometheus.yml +17 -0
- package/plugins/specweave-kafka/monitoring/prometheus/kafka-alerts.yml +415 -0
- package/plugins/specweave-kafka/monitoring/prometheus/kafka-jmx-exporter.yml +256 -0
- package/plugins/specweave-kafka/package.json +41 -0
- package/plugins/specweave-kafka/skills/kafka-architecture/SKILL.md +647 -0
- package/plugins/specweave-kafka/skills/kafka-cli-tools/SKILL.md +433 -0
- package/plugins/specweave-kafka/skills/kafka-iac-deployment/SKILL.md +449 -0
- package/plugins/specweave-kafka/skills/kafka-kubernetes/SKILL.md +667 -0
- package/plugins/specweave-kafka/skills/kafka-mcp-integration/SKILL.md +273 -0
- package/plugins/specweave-kafka/skills/kafka-observability/SKILL.md +576 -0
- package/plugins/specweave-kafka/templates/config/broker-production.properties +254 -0
- package/plugins/specweave-kafka/templates/config/consumer-low-latency.properties +112 -0
- package/plugins/specweave-kafka/templates/config/producer-high-throughput.properties +120 -0
- package/plugins/specweave-kafka/templates/migration/mirrormaker2-config.properties +234 -0
- package/plugins/specweave-kafka/templates/monitoring/grafana/multi-cluster-dashboard.json +686 -0
- package/plugins/specweave-kafka/terraform/apache-kafka/main.tf +347 -0
- package/plugins/specweave-kafka/terraform/apache-kafka/outputs.tf +107 -0
- package/plugins/specweave-kafka/terraform/apache-kafka/templates/kafka-broker-init.sh.tpl +216 -0
- package/plugins/specweave-kafka/terraform/apache-kafka/variables.tf +156 -0
- package/plugins/specweave-kafka/terraform/aws-msk/main.tf +362 -0
- package/plugins/specweave-kafka/terraform/aws-msk/outputs.tf +93 -0
- package/plugins/specweave-kafka/terraform/aws-msk/templates/server.properties.tpl +32 -0
- package/plugins/specweave-kafka/terraform/aws-msk/variables.tf +235 -0
- package/plugins/specweave-kafka/terraform/azure-event-hubs/main.tf +281 -0
- package/plugins/specweave-kafka/terraform/azure-event-hubs/outputs.tf +118 -0
- package/plugins/specweave-kafka/terraform/azure-event-hubs/variables.tf +148 -0
- package/plugins/specweave-kafka/tsconfig.json +21 -0
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-kafka-streams/README.md +310 -0
- package/plugins/specweave-kafka-streams/skills/kafka-streams-topology/SKILL.md +539 -0
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-n8n/README.md +354 -0
- package/plugins/specweave-n8n/skills/n8n-kafka-workflows/SKILL.md +504 -0
- package/plugins/specweave-release/commands/specweave-release-platform.md +1 -1
- package/plugins/specweave-release/hooks/post-task-completion.sh +2 -2
- package/src/templates/AGENTS.md.template +601 -7
- package/src/templates/CLAUDE.md.template +188 -88
- package/plugins/specweave-ado/commands/specweave-ado-sync-spec.md +0 -255
- package/plugins/specweave-github/commands/specweave-github-sync-epic.md +0 -248
- package/plugins/specweave-github/commands/specweave-github-sync-from.md +0 -147
- package/plugins/specweave-github/commands/specweave-github-sync-spec.md +0 -208
- package/plugins/specweave-github/commands/specweave-github-sync-tasks.md +0 -530
- package/plugins/specweave-jira/commands/specweave-jira-sync-epic.md +0 -267
- package/plugins/specweave-jira/commands/specweave-jira-sync-spec.md +0 -240
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Feature Sync - Universal Hierarchy Implementation
|
|
3
|
+
*
|
|
4
|
+
* Architecture (CORRECT):
|
|
5
|
+
* - Feature (FS-033) ā GitHub Milestone (Container)
|
|
6
|
+
* - User Story (US-001, US-002, etc.) ā GitHub Issue (Trackable item)
|
|
7
|
+
* - Tasks (T-001, T-002, etc.) ā Checkboxes in User Story issue body
|
|
8
|
+
*
|
|
9
|
+
* This implements the TRUE Universal Hierarchy architecture for GitHub.
|
|
10
|
+
*
|
|
11
|
+
* Key Differences from old github-epic-sync.ts:
|
|
12
|
+
* - ā OLD: Feature/Increment ā GitHub Issue (WRONG!)
|
|
13
|
+
* - ā
NEW: User Story ā GitHub Issue (CORRECT!)
|
|
14
|
+
* - ā
Creates ONE issue PER user story file (not one per increment)
|
|
15
|
+
* - ā
Reads us-*.md files from specs/{project}/FS-XXX/
|
|
16
|
+
*/
|
|
17
|
+
import { GitHubClientV2 } from './github-client-v2.js';
|
|
18
|
+
export declare class GitHubFeatureSync {
|
|
19
|
+
private client;
|
|
20
|
+
private specsDir;
|
|
21
|
+
private projectRoot;
|
|
22
|
+
private calculator;
|
|
23
|
+
constructor(client: GitHubClientV2, specsDir: string, projectRoot: string);
|
|
24
|
+
/**
|
|
25
|
+
* Sync Feature folder to GitHub (Milestone + User Story Issues)
|
|
26
|
+
*
|
|
27
|
+
* Process:
|
|
28
|
+
* 1. Create/update GitHub Milestone for Feature
|
|
29
|
+
* 2. Find all us-*.md files across all projects
|
|
30
|
+
* 3. Create/update GitHub Issue for EACH user story
|
|
31
|
+
* 4. Update frontmatter with GitHub issue links
|
|
32
|
+
*/
|
|
33
|
+
syncFeatureToGitHub(featureId: string): Promise<{
|
|
34
|
+
milestoneNumber: number;
|
|
35
|
+
milestoneUrl: string;
|
|
36
|
+
issuesCreated: number;
|
|
37
|
+
issuesUpdated: number;
|
|
38
|
+
userStoriesProcessed: number;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Find Feature folder in specs directory
|
|
42
|
+
*/
|
|
43
|
+
private findFeatureFolder;
|
|
44
|
+
/**
|
|
45
|
+
* Parse FEATURE.md frontmatter
|
|
46
|
+
*/
|
|
47
|
+
private parseFeatureMd;
|
|
48
|
+
/**
|
|
49
|
+
* Find all User Story files for this feature across all projects
|
|
50
|
+
*/
|
|
51
|
+
private findUserStories;
|
|
52
|
+
/**
|
|
53
|
+
* Find all project folders (default, backend, frontend, etc.)
|
|
54
|
+
*/
|
|
55
|
+
private findProjectFolders;
|
|
56
|
+
/**
|
|
57
|
+
* Create GitHub Milestone for Feature
|
|
58
|
+
*/
|
|
59
|
+
private createMilestone;
|
|
60
|
+
/**
|
|
61
|
+
* Create GitHub Issue for User Story with AC/Task Verification
|
|
62
|
+
*
|
|
63
|
+
* ā
VERIFICATION GATE FIX:
|
|
64
|
+
* - Verifies actual completion before closing
|
|
65
|
+
* - Prevents premature closure on creation
|
|
66
|
+
*/
|
|
67
|
+
private createUserStoryIssue;
|
|
68
|
+
/**
|
|
69
|
+
* Update existing GitHub Issue for User Story with AC/Task Verification
|
|
70
|
+
*
|
|
71
|
+
* ā
VERIFICATION GATE FIX:
|
|
72
|
+
* - OLD: Closed based on frontmatter `status: complete`
|
|
73
|
+
* - NEW: Closes ONLY if all ACs and tasks are [x]
|
|
74
|
+
*
|
|
75
|
+
* This prevents Issue #574 type bugs (premature closure)
|
|
76
|
+
*/
|
|
77
|
+
private updateUserStoryIssue;
|
|
78
|
+
/**
|
|
79
|
+
* Update FEATURE.md with GitHub Milestone link
|
|
80
|
+
*/
|
|
81
|
+
private updateFeatureMd;
|
|
82
|
+
/**
|
|
83
|
+
* Update User Story frontmatter with GitHub issue link
|
|
84
|
+
*/
|
|
85
|
+
private updateUserStoryFrontmatter;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=github-feature-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-feature-sync.d.ts","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/github-feature-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA+BvD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAuB;gBAE7B,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAOzE;;;;;;;;OAQG;IACG,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QACpD,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAC;IAsIF;;OAEG;YACW,iBAAiB;IAU/B;;OAEG;YACW,cAAc;IAW5B;;OAEG;YACW,eAAe;IA4C7B;;OAEG;YACW,kBAAkB;IAgBhC;;OAEG;YACW,eAAe;IA+B7B;;;;;;OAMG;YACW,oBAAoB;IAoElC;;;;;;;;OAQG;YACW,oBAAoB;IA2ElC;;OAEG;YACW,eAAe;IA+B7B;;OAEG;YACW,0BAA0B;CA8BzC"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Feature Sync - Universal Hierarchy Implementation
|
|
3
|
+
*
|
|
4
|
+
* Architecture (CORRECT):
|
|
5
|
+
* - Feature (FS-033) ā GitHub Milestone (Container)
|
|
6
|
+
* - User Story (US-001, US-002, etc.) ā GitHub Issue (Trackable item)
|
|
7
|
+
* - Tasks (T-001, T-002, etc.) ā Checkboxes in User Story issue body
|
|
8
|
+
*
|
|
9
|
+
* This implements the TRUE Universal Hierarchy architecture for GitHub.
|
|
10
|
+
*
|
|
11
|
+
* Key Differences from old github-epic-sync.ts:
|
|
12
|
+
* - ā OLD: Feature/Increment ā GitHub Issue (WRONG!)
|
|
13
|
+
* - ā
NEW: User Story ā GitHub Issue (CORRECT!)
|
|
14
|
+
* - ā
Creates ONE issue PER user story file (not one per increment)
|
|
15
|
+
* - ā
Reads us-*.md files from specs/{project}/FS-XXX/
|
|
16
|
+
*/
|
|
17
|
+
import { readdir, readFile, writeFile } from 'fs/promises';
|
|
18
|
+
import { existsSync } from 'fs';
|
|
19
|
+
import * as path from 'path';
|
|
20
|
+
import * as yaml from 'yaml';
|
|
21
|
+
import { UserStoryIssueBuilder } from './user-story-issue-builder.js';
|
|
22
|
+
import { CompletionCalculator } from './completion-calculator.js';
|
|
23
|
+
import { execFileNoThrow } from '../../../src/utils/execFileNoThrow.js';
|
|
24
|
+
export class GitHubFeatureSync {
|
|
25
|
+
constructor(client, specsDir, projectRoot) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
this.specsDir = specsDir;
|
|
28
|
+
this.projectRoot = projectRoot;
|
|
29
|
+
this.calculator = new CompletionCalculator(projectRoot);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sync Feature folder to GitHub (Milestone + User Story Issues)
|
|
33
|
+
*
|
|
34
|
+
* Process:
|
|
35
|
+
* 1. Create/update GitHub Milestone for Feature
|
|
36
|
+
* 2. Find all us-*.md files across all projects
|
|
37
|
+
* 3. Create/update GitHub Issue for EACH user story
|
|
38
|
+
* 4. Update frontmatter with GitHub issue links
|
|
39
|
+
*/
|
|
40
|
+
async syncFeatureToGitHub(featureId) {
|
|
41
|
+
console.log(`\nš Syncing Feature ${featureId} to GitHub...`);
|
|
42
|
+
// 1. Load Feature FEATURE.md
|
|
43
|
+
const featureFolder = await this.findFeatureFolder(featureId);
|
|
44
|
+
if (!featureFolder) {
|
|
45
|
+
throw new Error(`Feature ${featureId} not found in ${this.specsDir}`);
|
|
46
|
+
}
|
|
47
|
+
const featurePath = path.join(featureFolder, 'FEATURE.md');
|
|
48
|
+
const featureData = await this.parseFeatureMd(featurePath);
|
|
49
|
+
console.log(` š¦ Feature: ${featureData.title}`);
|
|
50
|
+
console.log(` š Status: ${featureData.status}`);
|
|
51
|
+
// 2. Create or update GitHub Milestone
|
|
52
|
+
let milestoneNumber = featureData.external_tools?.github?.id;
|
|
53
|
+
let milestoneUrl = featureData.external_tools?.github?.url;
|
|
54
|
+
if (!milestoneNumber) {
|
|
55
|
+
console.log(` š Creating GitHub Milestone...`);
|
|
56
|
+
const milestone = await this.createMilestone(featureData);
|
|
57
|
+
milestoneNumber = milestone.number;
|
|
58
|
+
milestoneUrl = milestone.url;
|
|
59
|
+
console.log(` ā
Created Milestone #${milestoneNumber}`);
|
|
60
|
+
// Update FEATURE.md with Milestone ID
|
|
61
|
+
await this.updateFeatureMd(featurePath, {
|
|
62
|
+
type: 'milestone',
|
|
63
|
+
id: milestoneNumber,
|
|
64
|
+
url: milestoneUrl,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
console.log(` ā»ļø Using existing Milestone #${milestoneNumber}`);
|
|
69
|
+
milestoneUrl = featureData.external_tools?.github?.url || milestoneUrl;
|
|
70
|
+
}
|
|
71
|
+
// 3. Find all User Story files across all projects
|
|
72
|
+
const userStories = await this.findUserStories(featureId);
|
|
73
|
+
console.log(`\n š Found ${userStories.length} User Stories to sync...`);
|
|
74
|
+
// 4. Sync each User Story as GitHub Issue
|
|
75
|
+
let issuesCreated = 0;
|
|
76
|
+
let issuesUpdated = 0;
|
|
77
|
+
for (const userStory of userStories) {
|
|
78
|
+
console.log(`\n š¹ Processing ${userStory.id}: ${userStory.title}`);
|
|
79
|
+
// Build issue content using UserStoryIssueBuilder
|
|
80
|
+
const repoInfo = {
|
|
81
|
+
owner: this.client.getOwner(),
|
|
82
|
+
repo: this.client.getRepo(),
|
|
83
|
+
branch: 'develop' // TODO: detect from git
|
|
84
|
+
};
|
|
85
|
+
const builder = new UserStoryIssueBuilder(userStory.filePath, this.projectRoot, featureId, repoInfo);
|
|
86
|
+
const issueContent = await builder.buildIssueBody();
|
|
87
|
+
// ā
FIX: Add status to issue content for sync
|
|
88
|
+
issueContent.status = userStory.status;
|
|
89
|
+
// ā
TRIPLE IDEMPOTENCY CHECK
|
|
90
|
+
// This ensures 100% safety when running sync multiple times
|
|
91
|
+
// Check 1: User Story frontmatter has issue number
|
|
92
|
+
if (userStory.existingIssue) {
|
|
93
|
+
console.log(` ā»ļø Issue #${userStory.existingIssue} exists in frontmatter`);
|
|
94
|
+
try {
|
|
95
|
+
// Verify issue still exists on GitHub
|
|
96
|
+
await this.client.getIssue(userStory.existingIssue);
|
|
97
|
+
// Issue exists, update it with verification
|
|
98
|
+
await this.updateUserStoryIssue(userStory.existingIssue, issueContent, userStory.filePath);
|
|
99
|
+
issuesUpdated++;
|
|
100
|
+
console.log(` ā
Updated Issue #${userStory.existingIssue}`);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
// Issue deleted on GitHub, fall through to create new
|
|
105
|
+
console.log(` ā ļø Issue #${userStory.existingIssue} deleted on GitHub, creating new`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Check 2: Search GitHub for issue by title
|
|
109
|
+
const existingByTitle = await this.client.searchIssueByTitle(issueContent.title);
|
|
110
|
+
if (existingByTitle) {
|
|
111
|
+
console.log(` ā»ļø Found existing issue by title: #${existingByTitle.number}`);
|
|
112
|
+
// Link it in frontmatter
|
|
113
|
+
await this.updateUserStoryFrontmatter(userStory.filePath, existingByTitle.number);
|
|
114
|
+
// Update content with verification
|
|
115
|
+
await this.updateUserStoryIssue(existingByTitle.number, issueContent, userStory.filePath);
|
|
116
|
+
issuesUpdated++;
|
|
117
|
+
console.log(` ā
Linked and updated Issue #${existingByTitle.number}`);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
// Check 3: No existing issue found, create new
|
|
121
|
+
console.log(` š Creating new issue: ${issueContent.title}`);
|
|
122
|
+
const milestoneTitle = `${featureData.id}: ${featureData.title}`;
|
|
123
|
+
const issueNumber = await this.createUserStoryIssue(issueContent, milestoneTitle, userStory.filePath);
|
|
124
|
+
issuesCreated++;
|
|
125
|
+
console.log(` ā
Created Issue #${issueNumber}`);
|
|
126
|
+
// Update User Story frontmatter
|
|
127
|
+
await this.updateUserStoryFrontmatter(userStory.filePath, issueNumber);
|
|
128
|
+
}
|
|
129
|
+
console.log(`\nā
Feature sync complete!`);
|
|
130
|
+
console.log(` Milestone: ${milestoneUrl}`);
|
|
131
|
+
console.log(` User Stories: ${userStories.length}`);
|
|
132
|
+
console.log(` Issues created: ${issuesCreated}`);
|
|
133
|
+
console.log(` Issues updated: ${issuesUpdated}`);
|
|
134
|
+
return {
|
|
135
|
+
milestoneNumber: milestoneNumber,
|
|
136
|
+
milestoneUrl: milestoneUrl,
|
|
137
|
+
issuesCreated,
|
|
138
|
+
issuesUpdated,
|
|
139
|
+
userStoriesProcessed: userStories.length,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Find Feature folder in specs directory
|
|
144
|
+
*/
|
|
145
|
+
async findFeatureFolder(featureId) {
|
|
146
|
+
// Check _features folder first
|
|
147
|
+
const featuresFolder = path.join(this.specsDir, '_features', featureId);
|
|
148
|
+
if (existsSync(featuresFolder)) {
|
|
149
|
+
return featuresFolder;
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Parse FEATURE.md frontmatter
|
|
155
|
+
*/
|
|
156
|
+
async parseFeatureMd(featurePath) {
|
|
157
|
+
const content = await readFile(featurePath, 'utf-8');
|
|
158
|
+
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
159
|
+
if (!match) {
|
|
160
|
+
throw new Error(`${featurePath}: Missing YAML frontmatter`);
|
|
161
|
+
}
|
|
162
|
+
return yaml.parse(match[1]);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Find all User Story files for this feature across all projects
|
|
166
|
+
*/
|
|
167
|
+
async findUserStories(featureId) {
|
|
168
|
+
const userStories = [];
|
|
169
|
+
// Find all project folders
|
|
170
|
+
const projectFolders = await this.findProjectFolders();
|
|
171
|
+
for (const projectFolder of projectFolders) {
|
|
172
|
+
const featureSpecsFolder = path.join(projectFolder, featureId);
|
|
173
|
+
if (!existsSync(featureSpecsFolder)) {
|
|
174
|
+
continue; // Feature not present in this project
|
|
175
|
+
}
|
|
176
|
+
// Read all us-*.md files
|
|
177
|
+
const files = await readdir(featureSpecsFolder);
|
|
178
|
+
const usFiles = files.filter((f) => f.startsWith('us-') && f.endsWith('.md'));
|
|
179
|
+
for (const file of usFiles.sort()) {
|
|
180
|
+
const filePath = path.join(featureSpecsFolder, file);
|
|
181
|
+
const content = await readFile(filePath, 'utf-8');
|
|
182
|
+
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
183
|
+
if (!match) {
|
|
184
|
+
console.warn(` ā ļø ${file}: Missing frontmatter, skipping`);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const frontmatter = yaml.parse(match[1]);
|
|
188
|
+
const projectName = path.basename(projectFolder);
|
|
189
|
+
userStories.push({
|
|
190
|
+
id: frontmatter.id || file.match(/us-(\d+)/)?.[0]?.toUpperCase() || 'UNKNOWN',
|
|
191
|
+
title: frontmatter.title || 'Untitled User Story',
|
|
192
|
+
filePath,
|
|
193
|
+
project: projectName,
|
|
194
|
+
status: frontmatter.status || 'not-started',
|
|
195
|
+
existingIssue: frontmatter.external?.github?.issue || null,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return userStories;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Find all project folders (default, backend, frontend, etc.)
|
|
203
|
+
*/
|
|
204
|
+
async findProjectFolders() {
|
|
205
|
+
const folders = [];
|
|
206
|
+
const specsRoot = this.specsDir;
|
|
207
|
+
// Read all directories in specs root
|
|
208
|
+
const entries = await readdir(specsRoot, { withFileTypes: true });
|
|
209
|
+
for (const entry of entries) {
|
|
210
|
+
if (entry.isDirectory() && !entry.name.startsWith('_')) {
|
|
211
|
+
folders.push(path.join(specsRoot, entry.name));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return folders;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Create GitHub Milestone for Feature
|
|
218
|
+
*/
|
|
219
|
+
async createMilestone(featureData) {
|
|
220
|
+
const title = `${featureData.id}: ${featureData.title}`;
|
|
221
|
+
const description = `Feature ${featureData.id}\n\nStatus: ${featureData.status}\nCreated: ${featureData.created}`;
|
|
222
|
+
const result = await execFileNoThrow('gh', [
|
|
223
|
+
'api',
|
|
224
|
+
'repos/:owner/:repo/milestones',
|
|
225
|
+
'-X',
|
|
226
|
+
'POST',
|
|
227
|
+
'-f',
|
|
228
|
+
`title=${title}`,
|
|
229
|
+
'-f',
|
|
230
|
+
`description=${description}`,
|
|
231
|
+
'-f',
|
|
232
|
+
'state=open',
|
|
233
|
+
]);
|
|
234
|
+
if (result.exitCode !== 0) {
|
|
235
|
+
throw new Error(`Failed to create Milestone: ${result.stderr || result.stdout}`);
|
|
236
|
+
}
|
|
237
|
+
const milestone = JSON.parse(result.stdout);
|
|
238
|
+
return {
|
|
239
|
+
number: milestone.number,
|
|
240
|
+
url: milestone.html_url,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Create GitHub Issue for User Story with AC/Task Verification
|
|
245
|
+
*
|
|
246
|
+
* ā
VERIFICATION GATE FIX:
|
|
247
|
+
* - Verifies actual completion before closing
|
|
248
|
+
* - Prevents premature closure on creation
|
|
249
|
+
*/
|
|
250
|
+
async createUserStoryIssue(issueContent, milestoneTitle, userStoryPath) {
|
|
251
|
+
// Step 1: Create issue (always open initially - gh CLI limitation)
|
|
252
|
+
const result = await execFileNoThrow('gh', [
|
|
253
|
+
'issue',
|
|
254
|
+
'create',
|
|
255
|
+
'--title',
|
|
256
|
+
issueContent.title,
|
|
257
|
+
'--body',
|
|
258
|
+
issueContent.body,
|
|
259
|
+
'--milestone',
|
|
260
|
+
milestoneTitle,
|
|
261
|
+
...issueContent.labels.flatMap((label) => ['--label', label]),
|
|
262
|
+
]);
|
|
263
|
+
if (result.exitCode !== 0) {
|
|
264
|
+
throw new Error(`Failed to create GitHub Issue: ${result.stderr || result.stdout}`);
|
|
265
|
+
}
|
|
266
|
+
// Parse issue number from output
|
|
267
|
+
// Format: "https://github.com/owner/repo/issues/123"
|
|
268
|
+
const match = result.stdout.match(/issues\/(\d+)/);
|
|
269
|
+
if (!match) {
|
|
270
|
+
throw new Error(`Failed to parse issue number from: ${result.stdout}`);
|
|
271
|
+
}
|
|
272
|
+
const issueNumber = parseInt(match[1], 10);
|
|
273
|
+
// Step 2: VERIFICATION GATE - Close only if ACs/tasks verified
|
|
274
|
+
const completion = await this.calculator.calculateCompletion(userStoryPath);
|
|
275
|
+
if (completion.overallComplete) {
|
|
276
|
+
// ā
SAFE TO CLOSE - All ACs and tasks verified [x]
|
|
277
|
+
await execFileNoThrow('gh', [
|
|
278
|
+
'issue',
|
|
279
|
+
'close',
|
|
280
|
+
issueNumber.toString(),
|
|
281
|
+
'--comment',
|
|
282
|
+
this.calculator.buildCompletionComment(completion),
|
|
283
|
+
]);
|
|
284
|
+
console.log(` ā
Created and verified complete: ${completion.acsCompleted}/${completion.acsTotal} ACs, ${completion.tasksCompleted}/${completion.tasksTotal} tasks`);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
// ā ļø INCOMPLETE - Leave open with progress comment
|
|
288
|
+
await execFileNoThrow('gh', [
|
|
289
|
+
'issue',
|
|
290
|
+
'comment',
|
|
291
|
+
issueNumber.toString(),
|
|
292
|
+
'--body',
|
|
293
|
+
this.calculator.buildProgressComment(completion),
|
|
294
|
+
]);
|
|
295
|
+
console.log(` š Created: ${completion.acsPercentage.toFixed(0)}% ACs, ${completion.tasksPercentage.toFixed(0)}% tasks`);
|
|
296
|
+
}
|
|
297
|
+
return issueNumber;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Update existing GitHub Issue for User Story with AC/Task Verification
|
|
301
|
+
*
|
|
302
|
+
* ā
VERIFICATION GATE FIX:
|
|
303
|
+
* - OLD: Closed based on frontmatter `status: complete`
|
|
304
|
+
* - NEW: Closes ONLY if all ACs and tasks are [x]
|
|
305
|
+
*
|
|
306
|
+
* This prevents Issue #574 type bugs (premature closure)
|
|
307
|
+
*/
|
|
308
|
+
async updateUserStoryIssue(issueNumber, issueContent, userStoryPath) {
|
|
309
|
+
// Update issue body
|
|
310
|
+
await execFileNoThrow('gh', [
|
|
311
|
+
'issue',
|
|
312
|
+
'edit',
|
|
313
|
+
issueNumber.toString(),
|
|
314
|
+
'--title',
|
|
315
|
+
issueContent.title,
|
|
316
|
+
'--body',
|
|
317
|
+
issueContent.body,
|
|
318
|
+
]);
|
|
319
|
+
// ā
VERIFICATION GATE: Calculate ACTUAL completion from checkboxes
|
|
320
|
+
const completion = await this.calculator.calculateCompletion(userStoryPath);
|
|
321
|
+
// Get current issue state
|
|
322
|
+
const issueData = await this.client.getIssue(issueNumber);
|
|
323
|
+
const currentlyClosed = issueData.state === 'closed';
|
|
324
|
+
// DECISION LOGIC: Close/Reopen/Update based on VERIFIED completion
|
|
325
|
+
if (completion.overallComplete) {
|
|
326
|
+
// ā
SAFE TO CLOSE - All ACs and tasks verified [x]
|
|
327
|
+
if (!currentlyClosed) {
|
|
328
|
+
await execFileNoThrow('gh', [
|
|
329
|
+
'issue',
|
|
330
|
+
'close',
|
|
331
|
+
issueNumber.toString(),
|
|
332
|
+
'--comment',
|
|
333
|
+
this.calculator.buildCompletionComment(completion),
|
|
334
|
+
]);
|
|
335
|
+
console.log(` ā
Verified complete: ${completion.acsCompleted}/${completion.acsTotal} ACs, ${completion.tasksCompleted}/${completion.tasksTotal} tasks`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
// ā ļø INCOMPLETE - Keep open or reopen if needed
|
|
340
|
+
if (currentlyClosed) {
|
|
341
|
+
// Issue was closed prematurely - REOPEN
|
|
342
|
+
await execFileNoThrow('gh', [
|
|
343
|
+
'issue',
|
|
344
|
+
'reopen',
|
|
345
|
+
issueNumber.toString(),
|
|
346
|
+
'--comment',
|
|
347
|
+
this.calculator.buildReopenComment(completion, 'Work verification failed'),
|
|
348
|
+
]);
|
|
349
|
+
console.log(` ā ļø Reopened: ${completion.blockingAcs.length + completion.blockingTasks.length} items incomplete`);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
// Update progress comment
|
|
353
|
+
await execFileNoThrow('gh', [
|
|
354
|
+
'issue',
|
|
355
|
+
'comment',
|
|
356
|
+
issueNumber.toString(),
|
|
357
|
+
'--body',
|
|
358
|
+
this.calculator.buildProgressComment(completion),
|
|
359
|
+
]);
|
|
360
|
+
console.log(` š Progress: ${completion.acsPercentage.toFixed(0)}% ACs, ${completion.tasksPercentage.toFixed(0)}% tasks`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Note: Labels are not updated to avoid overwriting manually added labels
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Update FEATURE.md with GitHub Milestone link
|
|
367
|
+
*/
|
|
368
|
+
async updateFeatureMd(featurePath, milestone) {
|
|
369
|
+
const content = await readFile(featurePath, 'utf-8');
|
|
370
|
+
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
371
|
+
if (!match) {
|
|
372
|
+
throw new Error(`${featurePath}: Missing YAML frontmatter`);
|
|
373
|
+
}
|
|
374
|
+
const frontmatter = yaml.parse(match[1]);
|
|
375
|
+
// Update external_tools.github
|
|
376
|
+
if (!frontmatter.external_tools) {
|
|
377
|
+
frontmatter.external_tools = {};
|
|
378
|
+
}
|
|
379
|
+
frontmatter.external_tools.github = milestone;
|
|
380
|
+
// Rebuild content
|
|
381
|
+
const newFrontmatter = yaml.stringify(frontmatter);
|
|
382
|
+
const bodyContent = content.slice(match[0].length);
|
|
383
|
+
const newContent = `---\n${newFrontmatter}---${bodyContent}`;
|
|
384
|
+
await writeFile(featurePath, newContent, 'utf-8');
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Update User Story frontmatter with GitHub issue link
|
|
388
|
+
*/
|
|
389
|
+
async updateUserStoryFrontmatter(userStoryPath, issueNumber) {
|
|
390
|
+
const content = await readFile(userStoryPath, 'utf-8');
|
|
391
|
+
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
392
|
+
if (!match) {
|
|
393
|
+
throw new Error(`${userStoryPath}: Missing YAML frontmatter`);
|
|
394
|
+
}
|
|
395
|
+
const frontmatter = yaml.parse(match[1]);
|
|
396
|
+
// Update external.github
|
|
397
|
+
if (!frontmatter.external) {
|
|
398
|
+
frontmatter.external = {};
|
|
399
|
+
}
|
|
400
|
+
if (!frontmatter.external.github) {
|
|
401
|
+
frontmatter.external.github = {};
|
|
402
|
+
}
|
|
403
|
+
frontmatter.external.github.issue = issueNumber;
|
|
404
|
+
frontmatter.external.github.url = `https://github.com/anton-abyzov/specweave/issues/${issueNumber}`;
|
|
405
|
+
// Rebuild content
|
|
406
|
+
const newFrontmatter = yaml.stringify(frontmatter);
|
|
407
|
+
const bodyContent = content.slice(match[0].length);
|
|
408
|
+
const newContent = `---\n${newFrontmatter}---${bodyContent}`;
|
|
409
|
+
await writeFile(userStoryPath, newContent, 'utf-8');
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=github-feature-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-feature-sync.js","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/github-feature-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OA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CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAErD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,GAAG,aAAa,4BAA4B,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzC,yBAAyB;QACzB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;YAC1B,WAAW,CAAC,QAAQ,GAAG,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACjC,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;QACnC,CAAC;QACD,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,WAAW,CAAC;QAChD,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,oDAAoD,WAAW,EAAE,CAAC;QAEpG,kBAAkB;QAClB,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,QAAQ,cAAc,MAAM,WAAW,EAAE,CAAC;QAE7D,MAAM,SAAS,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-spec-content-sync.d.ts","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/github-spec-content-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAQL,iBAAiB,EAClB,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"github-spec-content-sync.d.ts","sourceRoot":"","sources":["../../../../plugins/specweave-github/lib/github-spec-content-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAQL,iBAAiB,EAClB,MAAM,wCAAwC,CAAC;AAKhD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA4CD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,iBAAiB,CAAC,CA4D5B;AAgPD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAShF"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { GitHubClientV2 } from './github-client-v2.js';
|
|
12
12
|
import { parseSpecContent, detectContentChanges, buildExternalDescription, hasExternalLink, updateSpecWithExternalLink, } from '../../../src/core/spec-content-sync.js';
|
|
13
|
+
import { ProgressCommentBuilder } from './progress-comment-builder.js';
|
|
13
14
|
import path from 'path';
|
|
14
15
|
import fs from 'fs/promises';
|
|
15
16
|
/**
|
|
@@ -161,6 +162,11 @@ async function createGitHubIssue(client, spec, options) {
|
|
|
161
162
|
}
|
|
162
163
|
/**
|
|
163
164
|
* Update existing GitHub issue with spec content
|
|
165
|
+
*
|
|
166
|
+
* ARCHITECTURE: IMMUTABLE DESCRIPTIONS (Phase 4)
|
|
167
|
+
* - Issue description is NEVER edited after creation
|
|
168
|
+
* - All content updates communicated via progress comments
|
|
169
|
+
* - Metadata updates only (labels, milestone, assignees)
|
|
164
170
|
*/
|
|
165
171
|
async function updateGitHubIssue(client, spec, issueNumber, options) {
|
|
166
172
|
const { specPath, dryRun, verbose } = options;
|
|
@@ -195,30 +201,34 @@ async function updateGitHubIssue(client, spec, issueNumber, options) {
|
|
|
195
201
|
console.log(` - ${change}`);
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
|
-
// Build updated content using compact format
|
|
199
|
-
const newTitle = `[${spec.identifier.compact}] ${spec.title}`;
|
|
200
|
-
const newBody = buildExternalDescription(spec);
|
|
201
204
|
if (dryRun) {
|
|
202
|
-
console.log('\nš Dry run - would
|
|
203
|
-
console.log(` Title: ${newTitle}`);
|
|
204
|
-
console.log(` Body:\n${newBody}`);
|
|
205
|
+
console.log('\nš Dry run - would post progress comment');
|
|
205
206
|
return {
|
|
206
207
|
success: true,
|
|
207
|
-
action: 'updated',
|
|
208
|
+
action: 'updated-via-comment',
|
|
208
209
|
externalId: issueNumber.toString(),
|
|
209
210
|
externalUrl: issue.html_url,
|
|
210
211
|
};
|
|
211
212
|
}
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
//
|
|
215
|
-
//
|
|
213
|
+
// IMMUTABLE DESCRIPTION PATTERN:
|
|
214
|
+
// ā OLD: Update issue body (overwrites description)
|
|
215
|
+
// ā
NEW: Post progress comment (preserves description)
|
|
216
|
+
// Update metadata only (labels via GitHub CLI - no direct API method)
|
|
217
|
+
const labels = [
|
|
218
|
+
'specweave',
|
|
219
|
+
'spec',
|
|
220
|
+
spec.project,
|
|
221
|
+
spec.metadata.priority || 'P2'
|
|
222
|
+
].filter(Boolean);
|
|
223
|
+
await client.addLabels(issueNumber, labels);
|
|
224
|
+
// Post progress comment (NOT edit body)
|
|
225
|
+
await postProgressComment(client, specPath, issueNumber, spec, verbose);
|
|
216
226
|
if (verbose) {
|
|
217
|
-
console.log(`ā
|
|
227
|
+
console.log(`ā
Posted progress comment to issue #${issueNumber}`);
|
|
218
228
|
}
|
|
219
229
|
return {
|
|
220
230
|
success: true,
|
|
221
|
-
action: 'updated',
|
|
231
|
+
action: 'updated-via-comment',
|
|
222
232
|
externalId: issueNumber.toString(),
|
|
223
233
|
externalUrl: issue.html_url,
|
|
224
234
|
};
|
|
@@ -231,6 +241,47 @@ async function updateGitHubIssue(client, spec, issueNumber, options) {
|
|
|
231
241
|
};
|
|
232
242
|
}
|
|
233
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Post progress comment to GitHub issue (IMMUTABLE DESCRIPTION PATTERN)
|
|
246
|
+
*
|
|
247
|
+
* This replaces the old pattern of editing issue body.
|
|
248
|
+
* Benefits:
|
|
249
|
+
* - Preserves original issue description
|
|
250
|
+
* - Creates audit trail of changes
|
|
251
|
+
* - Stakeholders get notifications on updates
|
|
252
|
+
*/
|
|
253
|
+
async function postProgressComment(client, specPath, issueNumber, spec, verbose = false) {
|
|
254
|
+
try {
|
|
255
|
+
// Extract increment ID from spec path or identifier
|
|
256
|
+
// Examples:
|
|
257
|
+
// - .specweave/increments/0031-external-tool-sync/spec.md ā 0031
|
|
258
|
+
// - .specweave/docs/internal/specs/default/FS-031/us-001-*.md ā FS-031
|
|
259
|
+
let incrementId = 'unknown';
|
|
260
|
+
// Try to extract from spec path
|
|
261
|
+
const incrementMatch = specPath.match(/increments\/([^/]+)/);
|
|
262
|
+
if (incrementMatch) {
|
|
263
|
+
incrementId = incrementMatch[1];
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
// Fallback: use spec identifier
|
|
267
|
+
incrementId = spec.identifier.compact;
|
|
268
|
+
}
|
|
269
|
+
// Build progress comment using ProgressCommentBuilder
|
|
270
|
+
const builder = new ProgressCommentBuilder(specPath);
|
|
271
|
+
const comment = await builder.buildProgressComment(incrementId);
|
|
272
|
+
// Post comment (using addComment method)
|
|
273
|
+
await client.addComment(issueNumber, comment);
|
|
274
|
+
if (verbose) {
|
|
275
|
+
console.log(` š Progress comment posted (${comment.length} chars)`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
// Non-blocking: Log error but don't fail the sync
|
|
280
|
+
if (verbose) {
|
|
281
|
+
console.error(` ā ļø Failed to post progress comment: ${error.message}`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
234
285
|
/**
|
|
235
286
|
* Count user stories in issue body
|
|
236
287
|
*/
|