specweave 0.18.1 ā 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/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-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 +7 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/epic-content-builder.js +42 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js.map +1 -1
- 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.js +1 -1
- 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 +8 -6
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +78 -117
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +1 -1
- 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/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/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.map +1 -1
- package/dist/src/core/sync/enhanced-content-builder.js +2 -1
- 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/types/config.d.ts +94 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +16 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +6 -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/package.json +1 -1
- package/plugins/specweave/COMMANDS.md +13 -4
- 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/hooks/hooks.json +4 -0
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -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-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 +10 -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 +38 -0
- package/plugins/specweave-github/lib/epic-content-builder.ts +59 -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.ts +1 -1
- 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,517 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave:fix-duplicates
|
|
3
|
+
description: Automatically detect and resolve duplicate increments with smart conflict resolution
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fix Duplicate Increments
|
|
7
|
+
|
|
8
|
+
**Intelligent conflict resolution**: Automatically detects duplicate increments and resolves conflicts by selecting the winner, merging valuable content, and cleaning up losers.
|
|
9
|
+
|
|
10
|
+
## Philosophy
|
|
11
|
+
|
|
12
|
+
**Data safety first** - This command provides multiple safety layers:
|
|
13
|
+
- ā
Shows resolution plan before making changes
|
|
14
|
+
- ā
Dry-run mode for preview
|
|
15
|
+
- ā
Merges valuable content before deletion
|
|
16
|
+
- ā
Creates detailed resolution reports
|
|
17
|
+
- ā
Requires confirmation unless `--force` flag
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Detect and fix all duplicates interactively
|
|
23
|
+
/specweave:fix-duplicates
|
|
24
|
+
|
|
25
|
+
# Preview what would be done (dry-run)
|
|
26
|
+
/specweave:fix-duplicates --dry-run
|
|
27
|
+
|
|
28
|
+
# Auto-fix with content merging
|
|
29
|
+
/specweave:fix-duplicates --merge
|
|
30
|
+
|
|
31
|
+
# Force fix without confirmation (use with caution!)
|
|
32
|
+
/specweave:fix-duplicates --force --merge
|
|
33
|
+
|
|
34
|
+
# Fix specific increment number
|
|
35
|
+
/specweave:fix-duplicates 0031
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Options
|
|
39
|
+
|
|
40
|
+
- `<increment-number>`: Optional. Fix only duplicates of specific increment number (e.g., "31", "0031")
|
|
41
|
+
- `--dry-run`: Show what would be done without making changes
|
|
42
|
+
- `--merge`: Merge valuable content from losers to winner before deletion
|
|
43
|
+
- `--force`: Skip confirmation prompts (for automated scripts)
|
|
44
|
+
- `--strategy <name>`: Override default resolution strategy (advanced)
|
|
45
|
+
|
|
46
|
+
## How It Works
|
|
47
|
+
|
|
48
|
+
### Step 1: Detection
|
|
49
|
+
|
|
50
|
+
Scans `.specweave/increments/` and all special folders:
|
|
51
|
+
- Active increments (`.specweave/increments/NNNN-*`)
|
|
52
|
+
- Archive (`.specweave/increments/_archive/`)
|
|
53
|
+
- Abandoned (`.specweave/increments/_abandoned/`)
|
|
54
|
+
- Backlog (`.specweave/increments/_backlog/`)
|
|
55
|
+
|
|
56
|
+
Detects duplicates by increment number (e.g., all folders starting with `0031-`).
|
|
57
|
+
|
|
58
|
+
### Step 2: Winner Selection
|
|
59
|
+
|
|
60
|
+
**Automatic prioritization algorithm**:
|
|
61
|
+
|
|
62
|
+
1. **Status priority** (highest wins):
|
|
63
|
+
- active = 5 points
|
|
64
|
+
- completed = 4 points
|
|
65
|
+
- paused = 3 points
|
|
66
|
+
- backlog = 2 points
|
|
67
|
+
- abandoned = 1 point
|
|
68
|
+
|
|
69
|
+
2. **Most recent activity** (tiebreaker):
|
|
70
|
+
- Uses `lastActivity` from metadata.json
|
|
71
|
+
- Falls back to directory modification time
|
|
72
|
+
|
|
73
|
+
3. **Completeness** (second tiebreaker):
|
|
74
|
+
- More files = more complete
|
|
75
|
+
- Larger total size = more complete
|
|
76
|
+
|
|
77
|
+
4. **Location preference** (final tiebreaker):
|
|
78
|
+
- Active folder > Paused > Archive > Abandoned
|
|
79
|
+
|
|
80
|
+
**Example**:
|
|
81
|
+
```
|
|
82
|
+
Increment 0031 exists in 3 locations:
|
|
83
|
+
1. active/0031-external-tool-sync (status: active, activity: 2025-11-14) ā WINNER
|
|
84
|
+
2. archive/0031-external-tool-sync (status: completed, activity: 2025-11-12)
|
|
85
|
+
3. abandoned/0031-old-attempt (status: abandoned, activity: 2025-10-01)
|
|
86
|
+
|
|
87
|
+
Winner: Location 1 (active status + most recent activity)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 3: Content Merging (Optional)
|
|
91
|
+
|
|
92
|
+
When `--merge` flag is enabled:
|
|
93
|
+
|
|
94
|
+
1. **Merge reports/ folder**:
|
|
95
|
+
- Copy all files from losers' `reports/` to winner's `reports/`
|
|
96
|
+
- Rename conflicting files: `REPORT.md` ā `REPORT-{timestamp}.md`
|
|
97
|
+
- Preserves completion summaries, session notes, analysis
|
|
98
|
+
|
|
99
|
+
2. **Merge metadata.json**:
|
|
100
|
+
- Take union of external links (GitHub, JIRA, ADO)
|
|
101
|
+
- Preserve all external issue numbers
|
|
102
|
+
- Keep winner's primary metadata (status, dates)
|
|
103
|
+
|
|
104
|
+
3. **Create resolution report**:
|
|
105
|
+
- `reports/DUPLICATE-RESOLUTION-{timestamp}.md`
|
|
106
|
+
- Documents what was merged from where
|
|
107
|
+
- Lists all deleted paths
|
|
108
|
+
|
|
109
|
+
**Example merge**:
|
|
110
|
+
```
|
|
111
|
+
Winner: .specweave/increments/0031-external-tool-sync/
|
|
112
|
+
reports/
|
|
113
|
+
āā IMPLEMENTATION-COMPLETE.md (original)
|
|
114
|
+
āā SESSION-NOTES-2025-11-12.md (merged from archive)
|
|
115
|
+
āā DUPLICATE-RESOLUTION-20251115-070000.md (NEW)
|
|
116
|
+
|
|
117
|
+
Loser 1: .specweave/increments/_archive/0031-external-tool-sync/
|
|
118
|
+
reports/
|
|
119
|
+
āā SESSION-NOTES-2025-11-12.md ā MERGED to winner
|
|
120
|
+
|
|
121
|
+
Loser 2: .specweave/increments/_abandoned/0031-old-attempt/
|
|
122
|
+
(No valuable content to merge)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Step 4: Deletion
|
|
126
|
+
|
|
127
|
+
**Safety measures**:
|
|
128
|
+
- Shows confirmation prompt: `Delete {path}? This will permanently remove {N} files. [y/N]`
|
|
129
|
+
- Default answer: `N` (no deletion unless confirmed)
|
|
130
|
+
- `--force` flag skips prompts (for CI/automated scripts)
|
|
131
|
+
- Dry-run mode never deletes (shows preview only)
|
|
132
|
+
|
|
133
|
+
## Examples
|
|
134
|
+
|
|
135
|
+
### Example 1: Interactive Fix (Recommended)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
/specweave:fix-duplicates
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Output**:
|
|
142
|
+
```
|
|
143
|
+
š Scanning for duplicate increments...
|
|
144
|
+
|
|
145
|
+
Found 2 duplicates:
|
|
146
|
+
|
|
147
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
148
|
+
Duplicate 1: Increment 0031-external-tool-status-sync
|
|
149
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
150
|
+
|
|
151
|
+
Locations:
|
|
152
|
+
1. ā (recommended) active/0031-external-tool-status-sync
|
|
153
|
+
Status: active | Activity: 2025-11-14 | Files: 12
|
|
154
|
+
Reason: Active status + most recent
|
|
155
|
+
|
|
156
|
+
2. ā archive/0031-external-tool-sync
|
|
157
|
+
Status: completed | Activity: 2025-11-12 | Files: 10
|
|
158
|
+
|
|
159
|
+
Resolution Plan:
|
|
160
|
+
⢠Keep: active/0031-external-tool-status-sync
|
|
161
|
+
⢠Delete: archive/0031-external-tool-sync
|
|
162
|
+
|
|
163
|
+
Delete archive/0031-external-tool-sync? [y/N]: y
|
|
164
|
+
|
|
165
|
+
ā
Resolved duplicate 0031
|
|
166
|
+
⢠Kept: active/0031-external-tool-status-sync
|
|
167
|
+
⢠Deleted: archive/0031-external-tool-sync (10 files removed)
|
|
168
|
+
|
|
169
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
170
|
+
Summary
|
|
171
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
172
|
+
|
|
173
|
+
Duplicates found: 2
|
|
174
|
+
Duplicates resolved: 2
|
|
175
|
+
Files deleted: 15
|
|
176
|
+
Space freed: 2.3 MB
|
|
177
|
+
|
|
178
|
+
š Resolution reports:
|
|
179
|
+
⢠active/0031-external-tool-status-sync/reports/DUPLICATE-RESOLUTION-20251115-070000.md
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Example 2: Dry-Run Preview
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
/specweave:fix-duplicates --dry-run
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Output**:
|
|
189
|
+
```
|
|
190
|
+
š DRY RUN - No files will be deleted
|
|
191
|
+
|
|
192
|
+
Found 2 duplicates:
|
|
193
|
+
|
|
194
|
+
Duplicate 1: Increment 0031
|
|
195
|
+
[DRY RUN] Would keep: active/0031-external-tool-status-sync
|
|
196
|
+
[DRY RUN] Would delete: archive/0031-external-tool-sync (10 files)
|
|
197
|
+
|
|
198
|
+
Duplicate 2: Increment 0032
|
|
199
|
+
[DRY RUN] Would keep: active/0032-increment-number-gap-prevention
|
|
200
|
+
[DRY RUN] Would delete: active/0032-prevent-increment-number-gaps (8 files)
|
|
201
|
+
|
|
202
|
+
Summary:
|
|
203
|
+
Would resolve: 2 duplicates
|
|
204
|
+
Would delete: 18 files
|
|
205
|
+
Would free: 2.5 MB
|
|
206
|
+
|
|
207
|
+
Run without --dry-run to proceed:
|
|
208
|
+
/specweave:fix-duplicates --merge
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Example 3: Auto-Fix with Merge
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
/specweave:fix-duplicates --merge --force
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Output**:
|
|
218
|
+
```
|
|
219
|
+
š Scanning for duplicate increments...
|
|
220
|
+
|
|
221
|
+
Found 2 duplicates:
|
|
222
|
+
|
|
223
|
+
Duplicate 1: Increment 0031
|
|
224
|
+
ā Winner: active/0031-external-tool-status-sync
|
|
225
|
+
š¦ Merging content from losers...
|
|
226
|
+
⢠Merged: reports/SESSION-NOTES-2025-11-12.md
|
|
227
|
+
⢠Created: reports/DUPLICATE-RESOLUTION-20251115-070000.md
|
|
228
|
+
ā Deleted: archive/0031-external-tool-sync
|
|
229
|
+
|
|
230
|
+
Duplicate 2: Increment 0032
|
|
231
|
+
ā Winner: active/0032-increment-number-gap-prevention
|
|
232
|
+
ā ļø No content to merge (loser empty)
|
|
233
|
+
ā Deleted: active/0032-prevent-increment-number-gaps
|
|
234
|
+
|
|
235
|
+
ā
All duplicates resolved!
|
|
236
|
+
|
|
237
|
+
Summary:
|
|
238
|
+
Resolved: 2 duplicates
|
|
239
|
+
Merged: 1 file
|
|
240
|
+
Deleted: 2 paths (18 files)
|
|
241
|
+
Space freed: 2.5 MB
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Example 4: Fix Specific Increment
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
/specweave:fix-duplicates 0031
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Output**:
|
|
251
|
+
```
|
|
252
|
+
š Scanning for duplicates of increment 0031...
|
|
253
|
+
|
|
254
|
+
Found 1 duplicate:
|
|
255
|
+
|
|
256
|
+
Duplicate: Increment 0031-external-tool-status-sync
|
|
257
|
+
Locations:
|
|
258
|
+
1. ā active/0031-external-tool-status-sync (recommended)
|
|
259
|
+
2. ā archive/0031-external-tool-sync
|
|
260
|
+
|
|
261
|
+
Delete archive/0031-external-tool-sync? [y/N]: y
|
|
262
|
+
|
|
263
|
+
ā
Duplicate 0031 resolved
|
|
264
|
+
⢠Kept: active/0031-external-tool-status-sync
|
|
265
|
+
⢠Deleted: archive/0031-external-tool-sync
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Error Handling
|
|
269
|
+
|
|
270
|
+
### No Duplicates Found
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
š Scanning for duplicate increments...
|
|
274
|
+
|
|
275
|
+
ā
No duplicates found!
|
|
276
|
+
|
|
277
|
+
All increments have unique numbers and locations.
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### User Declines Deletion
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
Delete archive/0031-external-tool-sync? [y/N]: n
|
|
284
|
+
|
|
285
|
+
āļø Skipped deletion of archive/0031-external-tool-sync
|
|
286
|
+
|
|
287
|
+
Summary:
|
|
288
|
+
Duplicates found: 2
|
|
289
|
+
Duplicates resolved: 0
|
|
290
|
+
User declined: 2
|
|
291
|
+
|
|
292
|
+
š” Tip: Use --force to skip confirmation prompts
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Filesystem Error
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
ā Error resolving duplicate 0031:
|
|
299
|
+
Failed to delete archive/0031-external-tool-sync
|
|
300
|
+
Reason: Permission denied
|
|
301
|
+
|
|
302
|
+
Recommendation:
|
|
303
|
+
1. Check file permissions
|
|
304
|
+
2. Close any programs using these files
|
|
305
|
+
3. Retry with sudo (if appropriate)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Resolution Report Format
|
|
309
|
+
|
|
310
|
+
**File**: `reports/DUPLICATE-RESOLUTION-{timestamp}.md`
|
|
311
|
+
|
|
312
|
+
```markdown
|
|
313
|
+
# Duplicate Resolution Report
|
|
314
|
+
|
|
315
|
+
**Increment**: 0031-external-tool-status-sync
|
|
316
|
+
**Resolved**: 2025-11-15 07:00:00 UTC
|
|
317
|
+
**Command**: /specweave:fix-duplicates --merge
|
|
318
|
+
|
|
319
|
+
## Detected Duplicates
|
|
320
|
+
|
|
321
|
+
Increment 0031 existed in 2 locations:
|
|
322
|
+
1. active/0031-external-tool-status-sync (status: active, activity: 2025-11-14)
|
|
323
|
+
2. archive/0031-external-tool-sync (status: completed, activity: 2025-11-12)
|
|
324
|
+
|
|
325
|
+
## Winner Selection
|
|
326
|
+
|
|
327
|
+
**Winner**: active/0031-external-tool-status-sync
|
|
328
|
+
|
|
329
|
+
**Reason**: Active status (5 points) + Most recent activity (2025-11-14)
|
|
330
|
+
|
|
331
|
+
## Content Merged
|
|
332
|
+
|
|
333
|
+
Merged from archive/0031-external-tool-sync:
|
|
334
|
+
- reports/SESSION-NOTES-2025-11-12.md ā reports/SESSION-NOTES-2025-11-12.md
|
|
335
|
+
- metadata.json (union of external links)
|
|
336
|
+
|
|
337
|
+
## Deleted Paths
|
|
338
|
+
|
|
339
|
+
- archive/0031-external-tool-sync (10 files, 1.2 MB)
|
|
340
|
+
|
|
341
|
+
## Metadata Union
|
|
342
|
+
|
|
343
|
+
**GitHub**:
|
|
344
|
+
- Issue #45 (from winner)
|
|
345
|
+
- Issue #42 (from archive) ā merged
|
|
346
|
+
|
|
347
|
+
**JIRA**:
|
|
348
|
+
- PROJ-123 (from winner)
|
|
349
|
+
|
|
350
|
+
## Summary
|
|
351
|
+
|
|
352
|
+
- Duplicates resolved: 1
|
|
353
|
+
- Files merged: 1
|
|
354
|
+
- Paths deleted: 1
|
|
355
|
+
- Space freed: 1.2 MB
|
|
356
|
+
- Total time: 0.5s
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
## Implementation
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
import { Task } from '@claude/types';
|
|
363
|
+
|
|
364
|
+
const task = new Task('fix-duplicates', 'Fix duplicate increments');
|
|
365
|
+
|
|
366
|
+
task.run(async () => {
|
|
367
|
+
const { detectAllDuplicates } = await import('../../../dist/src/core/increment/duplicate-detector.js');
|
|
368
|
+
const { resolveConflict } = await import('../../../dist/src/core/increment/conflict-resolver.js');
|
|
369
|
+
|
|
370
|
+
// Parse arguments
|
|
371
|
+
const args = process.argv.slice(2);
|
|
372
|
+
const incrementNumber = args.find(arg => /^\d+$/.test(arg));
|
|
373
|
+
|
|
374
|
+
// Parse options
|
|
375
|
+
const options = {
|
|
376
|
+
dryRun: args.includes('--dry-run'),
|
|
377
|
+
merge: args.includes('--merge'),
|
|
378
|
+
force: args.includes('--force'),
|
|
379
|
+
strategy: args.includes('--strategy') ? args[args.indexOf('--strategy') + 1] : undefined
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
// Detect duplicates
|
|
383
|
+
console.log('š Scanning for duplicate increments...\n');
|
|
384
|
+
const report = await detectAllDuplicates(process.cwd());
|
|
385
|
+
|
|
386
|
+
// Filter by increment number if specified
|
|
387
|
+
let duplicates = report.duplicates;
|
|
388
|
+
if (incrementNumber) {
|
|
389
|
+
const paddedNumber = incrementNumber.padStart(4, '0');
|
|
390
|
+
duplicates = duplicates.filter(d => d.incrementNumber === paddedNumber);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (duplicates.length === 0) {
|
|
394
|
+
console.log('ā
No duplicates found!\n');
|
|
395
|
+
console.log('All increments have unique numbers and locations.');
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
console.log(`Found ${duplicates.length} duplicate${duplicates.length > 1 ? 's' : ''}:\n`);
|
|
400
|
+
|
|
401
|
+
// Display resolution plan
|
|
402
|
+
if (options.dryRun) {
|
|
403
|
+
console.log('š DRY RUN - No files will be deleted\n');
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Resolve each duplicate
|
|
407
|
+
const results = [];
|
|
408
|
+
for (const duplicate of duplicates) {
|
|
409
|
+
console.log('ā'.repeat(60));
|
|
410
|
+
console.log(`Duplicate: Increment ${duplicate.incrementNumber}`);
|
|
411
|
+
console.log('ā'.repeat(60));
|
|
412
|
+
|
|
413
|
+
// Show locations
|
|
414
|
+
console.log('\nLocations:');
|
|
415
|
+
duplicate.locations.forEach((loc, index) => {
|
|
416
|
+
const isWinner = loc === duplicate.recommendedWinner;
|
|
417
|
+
const marker = isWinner ? 'ā (recommended)' : 'ā';
|
|
418
|
+
console.log(` ${index + 1}. ${marker} ${path.basename(loc.path)}`);
|
|
419
|
+
console.log(` Status: ${loc.metadata?.status || 'unknown'} | Activity: ${loc.metadata?.lastActivity || 'unknown'} | Files: ${loc.fileCount}`);
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// Show resolution reason
|
|
423
|
+
console.log(`\nResolution reason: ${duplicate.resolutionReason}`);
|
|
424
|
+
|
|
425
|
+
// Resolve conflict
|
|
426
|
+
try {
|
|
427
|
+
const result = await resolveConflict(duplicate, options);
|
|
428
|
+
results.push(result);
|
|
429
|
+
|
|
430
|
+
if (options.dryRun) {
|
|
431
|
+
console.log(`\n[DRY RUN] Would keep: ${path.basename(result.winner)}`);
|
|
432
|
+
console.log(`[DRY RUN] Would delete: ${result.deleted.map(p => path.basename(p)).join(', ')}`);
|
|
433
|
+
} else {
|
|
434
|
+
console.log(`\nā
Resolved duplicate ${duplicate.incrementNumber}`);
|
|
435
|
+
console.log(` ⢠Kept: ${path.basename(result.winner)}`);
|
|
436
|
+
console.log(` ⢠Deleted: ${result.deleted.map(p => path.basename(p)).join(', ')}`);
|
|
437
|
+
if (result.merged.length > 0) {
|
|
438
|
+
console.log(` ⢠Merged: ${result.merged.length} file(s)`);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
} catch (error) {
|
|
442
|
+
console.error(`\nā Error resolving duplicate ${duplicate.incrementNumber}:`);
|
|
443
|
+
console.error(` ${error.message}`);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
console.log();
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// Summary
|
|
450
|
+
console.log('ā'.repeat(60));
|
|
451
|
+
console.log('Summary');
|
|
452
|
+
console.log('ā'.repeat(60));
|
|
453
|
+
|
|
454
|
+
const totalDeleted = results.reduce((sum, r) => sum + r.deleted.length, 0);
|
|
455
|
+
const totalMerged = results.reduce((sum, r) => sum + r.merged.length, 0);
|
|
456
|
+
|
|
457
|
+
if (options.dryRun) {
|
|
458
|
+
console.log(`\nWould resolve: ${results.length} duplicate${results.length > 1 ? 's' : ''}`);
|
|
459
|
+
console.log(`Would delete: ${totalDeleted} path${totalDeleted > 1 ? 's' : ''}`);
|
|
460
|
+
if (totalMerged > 0) {
|
|
461
|
+
console.log(`Would merge: ${totalMerged} file${totalMerged > 1 ? 's' : ''}`);
|
|
462
|
+
}
|
|
463
|
+
console.log('\nRun without --dry-run to proceed:');
|
|
464
|
+
console.log(' /specweave:fix-duplicates --merge');
|
|
465
|
+
} else {
|
|
466
|
+
console.log(`\nDuplicates resolved: ${results.length}`);
|
|
467
|
+
console.log(`Paths deleted: ${totalDeleted}`);
|
|
468
|
+
if (totalMerged > 0) {
|
|
469
|
+
console.log(`Files merged: ${totalMerged}`);
|
|
470
|
+
}
|
|
471
|
+
console.log('\nš Resolution reports:');
|
|
472
|
+
results.forEach(r => {
|
|
473
|
+
console.log(` ⢠${r.reportPath}`);
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
export default task;
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
## Configuration
|
|
482
|
+
|
|
483
|
+
No configuration needed - all options are provided via command-line flags.
|
|
484
|
+
|
|
485
|
+
## Related Commands
|
|
486
|
+
|
|
487
|
+
- `/specweave:archive <id>` - Archive specific increment (prevents duplicates)
|
|
488
|
+
- `/specweave:restore <id>` - Restore increment from archive
|
|
489
|
+
- `/specweave:status` - View all increment statuses
|
|
490
|
+
|
|
491
|
+
## Safety Notes
|
|
492
|
+
|
|
493
|
+
### ā ļø Important Warnings
|
|
494
|
+
|
|
495
|
+
1. **Backup before bulk operations**: If fixing many duplicates, consider git commit first
|
|
496
|
+
2. **Review dry-run output**: Always run with `--dry-run` first to preview changes
|
|
497
|
+
3. **Merge valuable content**: Use `--merge` flag to preserve reports and session notes
|
|
498
|
+
4. **Force flag caution**: `--force` skips confirmations - use only in automated scripts
|
|
499
|
+
|
|
500
|
+
### š What Gets Preserved
|
|
501
|
+
|
|
502
|
+
**Always preserved** (in winner):
|
|
503
|
+
- spec.md, plan.md, tasks.md (core files)
|
|
504
|
+
- metadata.json (merged external links if `--merge`)
|
|
505
|
+
- All files in winner's directory
|
|
506
|
+
|
|
507
|
+
**Conditionally preserved** (if `--merge`):
|
|
508
|
+
- reports/ folder from losers ā merged to winner
|
|
509
|
+
- External links (GitHub, JIRA, ADO) ā union in metadata.json
|
|
510
|
+
|
|
511
|
+
**Always deleted**:
|
|
512
|
+
- Losing increment directories and all their contents
|
|
513
|
+
- Creates resolution report documenting what was deleted
|
|
514
|
+
|
|
515
|
+
---
|
|
516
|
+
|
|
517
|
+
**Best Practice**: Run with `--dry-run --merge` first to see what would happen, then run without `--dry-run` to apply changes.
|
|
@@ -449,9 +449,10 @@ Proceeding with hotfix 0006...
|
|
|
449
449
|
|
|
450
450
|
### Step 1: Find next increment number
|
|
451
451
|
|
|
452
|
-
- Scan `.specweave/increments/` directory
|
|
453
|
-
-
|
|
454
|
-
-
|
|
452
|
+
- Scan `.specweave/increments/` directory (active increments)
|
|
453
|
+
- Scan `.specweave/increments/_archive/` directory (archived/abandoned increments)
|
|
454
|
+
- Find highest number across both directories (e.g., 032)
|
|
455
|
+
- Next increment: 033
|
|
455
456
|
|
|
456
457
|
### Step 2: Detect tech stack (CRITICAL - framework-agnostic)
|
|
457
458
|
- Settings auto-detected
|