specweave 0.24.11 → 0.26.2
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 +742 -26
- package/bin/specweave.js +14 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js +2 -2
- package/dist/plugins/specweave-github/lib/CodeValidator.js.map +1 -1
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +28 -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 +64 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-issue-updater.js +1 -1
- package/dist/plugins/specweave-github/lib/github-issue-updater.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
- package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-sync-increment-changes.js +1 -1
- package/dist/plugins/specweave-github/lib/github-sync-increment-changes.js.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +7 -6
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js +1 -1
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js.map +1 -1
- package/dist/src/adapters/adapter-base.js +1 -1
- package/dist/src/adapters/adapter-base.js.map +1 -1
- package/dist/src/adapters/adapter-loader.js +1 -1
- package/dist/src/adapters/adapter-loader.js.map +1 -1
- package/dist/src/adapters/agents-md-generator.js +1 -1
- package/dist/src/adapters/agents-md-generator.js.map +1 -1
- package/dist/src/adapters/claude/adapter.js +1 -1
- package/dist/src/adapters/claude/adapter.js.map +1 -1
- package/dist/src/adapters/claude-md-generator.js +1 -1
- package/dist/src/adapters/claude-md-generator.js.map +1 -1
- package/dist/src/adapters/codex/adapter.js +1 -1
- package/dist/src/adapters/codex/adapter.js.map +1 -1
- package/dist/src/adapters/cursor/adapter.js +1 -1
- package/dist/src/adapters/cursor/adapter.js.map +1 -1
- package/dist/src/adapters/doc-generator.js +1 -1
- package/dist/src/adapters/doc-generator.js.map +1 -1
- package/dist/src/adapters/gemini/adapter.js +1 -1
- package/dist/src/adapters/gemini/adapter.js.map +1 -1
- package/dist/src/adapters/generic/adapter.js +1 -1
- package/dist/src/adapters/generic/adapter.js.map +1 -1
- package/dist/src/cli/commands/cicd-monitor.js +1 -1
- package/dist/src/cli/commands/cicd-monitor.js.map +1 -1
- package/dist/src/cli/commands/delete-feature.d.ts +14 -0
- package/dist/src/cli/commands/delete-feature.d.ts.map +1 -0
- package/dist/src/cli/commands/delete-feature.js +87 -0
- package/dist/src/cli/commands/delete-feature.js.map +1 -0
- package/dist/src/cli/commands/detect-specs.js +1 -1
- package/dist/src/cli/commands/detect-specs.js.map +1 -1
- package/dist/src/cli/commands/import-external.js +1 -1
- package/dist/src/cli/commands/import-external.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +45 -47
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/install.js +1 -1
- package/dist/src/cli/commands/install.js.map +1 -1
- package/dist/src/cli/commands/list.js +1 -1
- package/dist/src/cli/commands/list.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-multiproject.js +1 -1
- package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.js +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -1
- package/dist/src/cli/commands/plan/agent-invoker.js +1 -1
- package/dist/src/cli/commands/repair-status-desync.js +1 -1
- package/dist/src/cli/commands/repair-status-desync.js.map +1 -1
- package/dist/src/cli/commands/revert-wip-limit.js +1 -1
- package/dist/src/cli/commands/revert-wip-limit.js.map +1 -1
- package/dist/src/cli/commands/sync-specs.js +1 -1
- package/dist/src/cli/commands/sync-specs.js.map +1 -1
- package/dist/src/cli/helpers/init/initial-increment-generator.js +1 -1
- package/dist/src/cli/helpers/init/initial-increment-generator.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +15 -36
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +12 -31
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/types.d.ts +6 -1
- package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -1
- package/dist/src/config/import-config.js +1 -1
- package/dist/src/config/import-config.js.map +1 -1
- package/dist/src/config/types.d.ts +203 -1208
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/core/ac-test-validator-cli.js +1 -1
- package/dist/src/core/ac-test-validator-cli.js.map +1 -1
- package/dist/src/core/ac-test-validator.js +1 -1
- package/dist/src/core/ac-test-validator.js.map +1 -1
- package/dist/src/core/brownfield/analyzer.js +1 -1
- package/dist/src/core/brownfield/analyzer.js.map +1 -1
- package/dist/src/core/brownfield/importer.js +1 -1
- package/dist/src/core/brownfield/importer.js.map +1 -1
- package/dist/src/core/cicd/config-loader.js +1 -1
- package/dist/src/core/cicd/config-loader.js.map +1 -1
- package/dist/src/core/cicd/notifier.js +1 -1
- package/dist/src/core/cicd/notifier.js.map +1 -1
- package/dist/src/core/cicd/parent-repo-validator.js +1 -1
- package/dist/src/core/cicd/parent-repo-validator.js.map +1 -1
- package/dist/src/core/cicd/state-manager.js +1 -1
- package/dist/src/core/cicd/state-manager.js.map +1 -1
- package/dist/src/core/config/types.d.ts +46 -12
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +0 -5
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/config-manager.js +1 -1
- package/dist/src/core/config-manager.js.map +1 -1
- package/dist/src/core/cost-tracker.js +1 -1
- package/dist/src/core/cost-tracker.js.map +1 -1
- package/dist/src/core/deduplication/command-deduplicator.js +1 -1
- package/dist/src/core/deduplication/command-deduplicator.js.map +1 -1
- package/dist/src/core/feature-deleter/audit-logger.d.ts +30 -0
- package/dist/src/core/feature-deleter/audit-logger.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/audit-logger.js +77 -0
- package/dist/src/core/feature-deleter/audit-logger.js.map +1 -0
- package/dist/src/core/feature-deleter/confirmation-manager.d.ts +39 -0
- package/dist/src/core/feature-deleter/confirmation-manager.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/confirmation-manager.js +89 -0
- package/dist/src/core/feature-deleter/confirmation-manager.js.map +1 -0
- package/dist/src/core/feature-deleter/deletion-transaction.d.ts +51 -0
- package/dist/src/core/feature-deleter/deletion-transaction.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/deletion-transaction.js +185 -0
- package/dist/src/core/feature-deleter/deletion-transaction.js.map +1 -0
- package/dist/src/core/feature-deleter/git-service.d.ts +43 -0
- package/dist/src/core/feature-deleter/git-service.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/git-service.js +127 -0
- package/dist/src/core/feature-deleter/git-service.js.map +1 -0
- package/dist/src/core/feature-deleter/github-service.d.ts +36 -0
- package/dist/src/core/feature-deleter/github-service.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/github-service.js +102 -0
- package/dist/src/core/feature-deleter/github-service.js.map +1 -0
- package/dist/src/core/feature-deleter/index.d.ts +35 -0
- package/dist/src/core/feature-deleter/index.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/index.js +199 -0
- package/dist/src/core/feature-deleter/index.js.map +1 -0
- package/dist/src/core/feature-deleter/types.d.ts +179 -0
- package/dist/src/core/feature-deleter/types.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/types.js +7 -0
- package/dist/src/core/feature-deleter/types.js.map +1 -0
- package/dist/src/core/feature-deleter/validator.d.ts +46 -0
- package/dist/src/core/feature-deleter/validator.d.ts.map +1 -0
- package/dist/src/core/feature-deleter/validator.js +231 -0
- package/dist/src/core/feature-deleter/validator.js.map +1 -0
- package/dist/src/core/hooks/HealthReporter.js +1 -1
- package/dist/src/core/hooks/HealthReporter.js.map +1 -1
- package/dist/src/core/hooks/HookAutoFixer.js +1 -1
- package/dist/src/core/hooks/HookAutoFixer.js.map +1 -1
- package/dist/src/core/hooks/HookScanner.js +1 -1
- package/dist/src/core/hooks/HookScanner.js.map +1 -1
- package/dist/src/core/i18n/language-manager.js +1 -1
- package/dist/src/core/i18n/language-manager.js.map +1 -1
- package/dist/src/core/i18n/locale-manager.js +1 -1
- package/dist/src/core/i18n/locale-manager.js.map +1 -1
- package/dist/src/core/i18n/system-prompt-injector.js +1 -1
- package/dist/src/core/i18n/system-prompt-injector.js.map +1 -1
- package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
- package/dist/src/core/increment/ac-status-manager.js +18 -4
- package/dist/src/core/increment/ac-status-manager.js.map +1 -1
- package/dist/src/core/increment/active-increment-manager.js +1 -1
- package/dist/src/core/increment/active-increment-manager.js.map +1 -1
- package/dist/src/core/increment/completion-validator.js +1 -1
- package/dist/src/core/increment/completion-validator.js.map +1 -1
- package/dist/src/core/increment/conflict-resolver.js +1 -1
- package/dist/src/core/increment/conflict-resolver.js.map +1 -1
- package/dist/src/core/increment/desync-detector.js +1 -1
- package/dist/src/core/increment/desync-detector.js.map +1 -1
- package/dist/src/core/increment/discipline-checker.js +1 -1
- package/dist/src/core/increment/discipline-checker.js.map +1 -1
- package/dist/src/core/increment/duplicate-detector.js +1 -1
- package/dist/src/core/increment/duplicate-detector.js.map +1 -1
- package/dist/src/core/increment/increment-archiver.js +1 -1
- package/dist/src/core/increment/increment-archiver.js.map +1 -1
- package/dist/src/core/increment/increment-reopener.js +1 -1
- package/dist/src/core/increment/increment-reopener.js.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +1 -1
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/metadata-validator.js +1 -1
- package/dist/src/core/increment/metadata-validator.js.map +1 -1
- package/dist/src/core/increment/recent-work-scanner.js +1 -1
- package/dist/src/core/increment/recent-work-scanner.js.map +1 -1
- package/dist/src/core/increment/spec-frontmatter-updater.js +1 -1
- package/dist/src/core/increment/spec-frontmatter-updater.js.map +1 -1
- package/dist/src/core/increment/status-auto-transition.js +1 -1
- package/dist/src/core/increment/status-auto-transition.js.map +1 -1
- package/dist/src/core/increment-status.js +1 -1
- package/dist/src/core/increment-status.js.map +1 -1
- package/dist/src/core/living-docs/content-distributor.js +1 -1
- package/dist/src/core/living-docs/content-distributor.js.map +1 -1
- package/dist/src/core/living-docs/cross-linker.js +1 -1
- package/dist/src/core/living-docs/cross-linker.js.map +1 -1
- package/dist/src/core/living-docs/feature-archiver.js +1 -1
- package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
- package/dist/src/core/living-docs/feature-id-manager.js +1 -1
- package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +14 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +72 -13
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/living-docs/project-detector.js +1 -1
- package/dist/src/core/living-docs/project-detector.js.map +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.js +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -1
- package/dist/src/core/logging/prompt-logger.js +1 -1
- package/dist/src/core/logging/prompt-logger.js.map +1 -1
- package/dist/src/core/plugin-loader.js +1 -1
- package/dist/src/core/plugin-loader.js.map +1 -1
- package/dist/src/core/project-manager.js +1 -1
- package/dist/src/core/project-manager.js.map +1 -1
- package/dist/src/core/qa/qa-runner.js +1 -1
- package/dist/src/core/qa/qa-runner.js.map +1 -1
- package/dist/src/core/repo-structure/folder-detector.js +1 -1
- package/dist/src/core/repo-structure/folder-detector.js.map +1 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.js +20 -5
- package/dist/src/core/repo-structure/repo-bulk-discovery.js.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +29 -14
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/repo-structure/setup-state-manager.js +1 -1
- package/dist/src/core/repo-structure/setup-state-manager.js.map +1 -1
- package/dist/src/core/spec-detector.js +1 -1
- package/dist/src/core/spec-detector.js.map +1 -1
- package/dist/src/core/specs/spec-metadata-manager.js +1 -1
- package/dist/src/core/specs/spec-metadata-manager.js.map +1 -1
- package/dist/src/core/status-line/status-line-updater.js +1 -1
- package/dist/src/core/status-line/status-line-updater.js.map +1 -1
- package/dist/src/core/status-line-validator.js +1 -1
- package/dist/src/core/status-line-validator.js.map +1 -1
- package/dist/src/core/sync/bidirectional-engine.js +1 -1
- package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
- package/dist/src/core/sync/profile-manager.js +1 -1
- package/dist/src/core/sync/profile-manager.js.map +1 -1
- package/dist/src/core/sync/project-context.js +1 -1
- package/dist/src/core/sync/project-context.js.map +1 -1
- package/dist/src/core/sync/sync-event-logger.js +1 -1
- package/dist/src/core/sync/sync-event-logger.js.map +1 -1
- package/dist/src/core/types/config.js +1 -1
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/us-completion-detector.d.ts +124 -0
- package/dist/src/core/us-completion-detector.d.ts.map +1 -0
- package/dist/src/core/us-completion-detector.js +270 -0
- package/dist/src/core/us-completion-detector.js.map +1 -0
- package/dist/src/core/utils/permission-checker.js +1 -1
- package/dist/src/core/utils/permission-checker.js.map +1 -1
- package/dist/src/core/workflow/autonomous-executor.js +1 -1
- package/dist/src/core/workflow/autonomous-executor.js.map +1 -1
- package/dist/src/core/workflow/backlog-scanner.js +1 -1
- package/dist/src/core/workflow/backlog-scanner.js.map +1 -1
- package/dist/src/core/workflow/cost-estimator.js +1 -1
- package/dist/src/core/workflow/cost-estimator.js.map +1 -1
- package/dist/src/core/workflow/state-manager.js +1 -1
- package/dist/src/core/workflow/state-manager.js.map +1 -1
- package/dist/src/importers/duplicate-detector.js +1 -1
- package/dist/src/importers/duplicate-detector.js.map +1 -1
- package/dist/src/importers/item-converter.js +1 -1
- package/dist/src/importers/item-converter.js.map +1 -1
- package/dist/src/init/architecture/types.d.ts +33 -140
- package/dist/src/init/architecture/types.d.ts.map +1 -1
- package/dist/src/init/compliance/types.d.ts +30 -27
- package/dist/src/init/compliance/types.d.ts.map +1 -1
- package/dist/src/init/repo/types.d.ts +11 -34
- package/dist/src/init/repo/types.d.ts.map +1 -1
- package/dist/src/init/research/src/config/types.d.ts +15 -82
- package/dist/src/init/research/src/config/types.d.ts.map +1 -1
- package/dist/src/init/research/types.d.ts +38 -93
- package/dist/src/init/research/types.d.ts.map +1 -1
- package/dist/src/init/team/types.d.ts +4 -42
- package/dist/src/init/team/types.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.js +3 -3
- package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.js +1 -1
- package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
- package/dist/src/living-docs/id-registry.js +1 -1
- package/dist/src/living-docs/id-registry.js.map +1 -1
- package/dist/src/sync/external-item-sync-service.js +1 -1
- package/dist/src/sync/external-item-sync-service.js.map +1 -1
- package/dist/src/sync/format-preservation-sync.d.ts.map +1 -1
- package/dist/src/sync/format-preservation-sync.js +23 -5
- package/dist/src/sync/format-preservation-sync.js.map +1 -1
- package/dist/src/sync/frontmatter-updater.d.ts +57 -0
- package/dist/src/sync/frontmatter-updater.d.ts.map +1 -0
- package/dist/src/sync/frontmatter-updater.js +147 -0
- package/dist/src/sync/frontmatter-updater.js.map +1 -0
- package/dist/src/sync/sync-coordinator.d.ts +22 -1
- package/dist/src/sync/sync-coordinator.d.ts.map +1 -1
- package/dist/src/sync/sync-coordinator.js +268 -21
- package/dist/src/sync/sync-coordinator.js.map +1 -1
- package/dist/src/sync/sync-metadata.js +1 -1
- package/dist/src/sync/sync-metadata.js.map +1 -1
- package/dist/src/types/living-docs-us-file.d.ts +18 -0
- package/dist/src/types/living-docs-us-file.d.ts.map +1 -1
- package/dist/src/types/living-docs-us-file.js.map +1 -1
- package/dist/src/utils/agents-md-compiler.js +1 -1
- package/dist/src/utils/agents-md-compiler.js.map +1 -1
- package/dist/src/utils/auto-install.js +1 -1
- package/dist/src/utils/auto-install.js.map +1 -1
- package/dist/src/utils/cost-reporter.js +1 -1
- package/dist/src/utils/cost-reporter.js.map +1 -1
- package/dist/src/utils/docs-preview/config-generator.js +1 -1
- package/dist/src/utils/docs-preview/config-generator.js.map +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.js +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -1
- package/dist/src/utils/docs-preview/package-installer.js +1 -1
- package/dist/src/utils/docs-preview/package-installer.js.map +1 -1
- package/dist/src/utils/docs-preview/sidebar-builder.js +1 -1
- package/dist/src/utils/docs-preview/sidebar-builder.js.map +1 -1
- package/dist/src/utils/env-file-generator.js +1 -1
- package/dist/src/utils/env-file-generator.js.map +1 -1
- package/dist/src/utils/external-resource-validator.js +1 -1
- package/dist/src/utils/external-resource-validator.js.map +1 -1
- package/dist/src/utils/fs-native.d.ts +51 -5
- package/dist/src/utils/fs-native.d.ts.map +1 -1
- package/dist/src/utils/fs-native.js +100 -5
- package/dist/src/utils/fs-native.js.map +1 -1
- package/dist/src/utils/plugin-validator.js +1 -1
- package/dist/src/utils/plugin-validator.js.map +1 -1
- package/dist/src/utils/project-detection.js +1 -1
- package/dist/src/utils/project-detection.js.map +1 -1
- package/dist/src/utils/project-validator.js +1 -1
- package/dist/src/utils/project-validator.js.map +1 -1
- package/dist/src/utils/spec-parser.js +1 -1
- package/dist/src/utils/spec-parser.js.map +1 -1
- package/dist/src/utils/spec-splitter.js +1 -1
- package/dist/src/utils/spec-splitter.js.map +1 -1
- package/dist/src/validators/ac-coverage-validator.js +1 -1
- package/dist/src/validators/ac-coverage-validator.js.map +1 -1
- package/package.json +5 -6
- package/plugins/specweave/.claude-plugin/plugin.json +17 -11
- package/plugins/specweave/agents/architect/AGENT.md +115 -45
- package/plugins/specweave/agents/code-standards-detective/AGENT.md +47 -0
- package/plugins/specweave/agents/docs-writer/AGENT.md +134 -1
- package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +1 -0
- package/plugins/specweave/agents/infrastructure/AGENT.md +48 -1
- package/plugins/specweave/agents/performance/AGENT.md +46 -0
- package/plugins/specweave/agents/pm/AGENT.md +115 -3
- package/plugins/specweave/agents/qa-lead/AGENT.md +40 -1
- package/plugins/specweave/agents/reflective-reviewer/AGENT.md +5 -0
- package/plugins/specweave/agents/security/AGENT.md +45 -0
- package/plugins/specweave/agents/tdd-orchestrator/AGENT.md +128 -1
- package/plugins/specweave/agents/tech-lead/AGENT.md +138 -1
- package/plugins/specweave/agents/test-aware-planner/AGENT.md +76 -6
- package/plugins/specweave/agents/translator/AGENT.md +132 -0
- package/plugins/specweave/commands/specweave-sync-progress.md +616 -0
- package/plugins/specweave/hooks/hooks.json +0 -9
- package/plugins/specweave/hooks/lib/update-status-line.sh +19 -0
- package/plugins/specweave/hooks/post-edit-write-consolidated.sh +335 -0
- package/plugins/specweave/hooks/post-increment-completion.sh +133 -0
- package/plugins/specweave/hooks/post-metadata-change.sh +58 -19
- package/plugins/specweave/hooks/post-task-completion.sh +100 -9
- package/plugins/specweave/hooks/pre-edit-spec.sh +0 -11
- package/plugins/specweave/hooks/pre-edit-write-consolidated.sh +225 -0
- package/plugins/specweave/hooks/pre-task-completion.sh +11 -0
- package/plugins/specweave/hooks/pre-write-spec.sh +0 -11
- package/plugins/specweave/hooks/shared/bulk-operation-detector.sh +167 -0
- package/plugins/specweave/lib/hooks/consolidated-sync.js +78 -3
- package/plugins/specweave/lib/hooks/us-completion-orchestrator.js +135 -0
- package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +18 -4
- package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -1
- package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +1 -1
- package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -1
- package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +1 -1
- package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -1
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +1 -1
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
- package/plugins/specweave/skills/code-reviewer/SKILL.md +1 -1
- package/plugins/specweave/skills/progress-sync/SKILL.md +405 -0
- package/plugins/specweave-ado/lib/ado-project-detector.js +1 -1
- package/plugins/specweave-ado/lib/ado-project-detector.ts +1 -1
- package/plugins/specweave-ado/lib/conflict-resolver.js +1 -1
- package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
- package/plugins/specweave-backend/agents/database-optimizer/AGENT.md +1 -1
- package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +5 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -15
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +480 -0
- package/plugins/specweave-github/hooks/README.md +34 -25
- package/plugins/specweave-github/lib/CodeValidator.js +1 -1
- package/plugins/specweave-github/lib/CodeValidator.ts +2 -2
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
- package/plugins/specweave-github/lib/github-client-v2.js +59 -1
- package/plugins/specweave-github/lib/github-client-v2.ts +82 -1
- package/plugins/specweave-github/lib/github-issue-updater.js +1 -1
- package/plugins/specweave-github/lib/github-issue-updater.ts +1 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
- package/plugins/specweave-github/lib/github-sync-bidirectional.ts +1 -1
- package/plugins/specweave-github/lib/github-sync-increment-changes.js +1 -1
- package/plugins/specweave-github/lib/github-sync-increment-changes.ts +1 -1
- package/plugins/specweave-github/lib/user-story-issue-builder.js +4 -4
- package/plugins/specweave-github/lib/user-story-issue-builder.ts +7 -6
- package/plugins/specweave-infrastructure/agents/devops/AGENT.md +48 -1
- package/plugins/specweave-infrastructure/agents/network-engineer/AGENT.md +6 -1
- package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +6 -1
- package/plugins/specweave-infrastructure/agents/performance-engineer/AGENT.md +6 -1
- package/plugins/specweave-infrastructure/agents/sre/AGENT.md +5 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.js +1 -1
- package/plugins/specweave-jira/lib/jira-epic-sync.ts +1 -1
- package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +5 -0
- package/plugins/specweave-kubernetes/agents/kubernetes-architect/AGENT.md +47 -2
- package/plugins/specweave-ml/agents/data-scientist/AGENT.md +1 -1
- package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +5 -0
- package/plugins/specweave-ml/agents/mlops-engineer/AGENT.md +6 -1
- package/plugins/specweave-payments/agents/payment-integration/AGENT.md +1 -1
- package/plugins/specweave-release/commands/specweave-release-npm.md +130 -2
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +198 -0
- package/plugins/specweave-ado/hooks/hooks.json +0 -15
- package/plugins/specweave-github/hooks/hooks.json +0 -15
- package/plugins/specweave-jira/hooks/hooks.json +0 -15
- package/plugins/specweave-release/hooks/hooks.json +0 -15
package/CLAUDE.md
CHANGED
|
@@ -61,13 +61,31 @@ git push origin develop
|
|
|
61
61
|
**Solution**: Use the automated refresh script!
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
#
|
|
64
|
+
# FROM GITHUB (default, recommended) - Pulls latest from GitHub
|
|
65
65
|
bash scripts/refresh-marketplace.sh
|
|
66
66
|
|
|
67
|
-
#
|
|
68
|
-
bash scripts/refresh-marketplace.sh --
|
|
67
|
+
# LOCAL DEVELOPMENT - Uses your local changes (ONLY for active development!)
|
|
68
|
+
bash scripts/refresh-marketplace.sh --local
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
**🚨 CRITICAL: Always Use GitHub Mode Unless Actively Developing!**
|
|
72
|
+
|
|
73
|
+
**Why GitHub mode is mandatory:**
|
|
74
|
+
- ✅ **Separate Installation**: Creates proper copy at `~/.claude/plugins/marketplaces/specweave/`
|
|
75
|
+
- ✅ **Stable Source**: Pulls from committed GitHub code, not unstable local changes
|
|
76
|
+
- ✅ **No Path Coupling**: Clear separation between source and runtime
|
|
77
|
+
- ✅ **Production-Ready**: What end users will experience
|
|
78
|
+
|
|
79
|
+
**Why local mode is dangerous:**
|
|
80
|
+
- ❌ **Filesystem Coupling**: `installLocation` = source directory (no separate copy!)
|
|
81
|
+
- ❌ **Stale Hook Risk**: Any git operations, file deletions, or uncommitted changes affect "installed" plugins
|
|
82
|
+
- ❌ **Path Confusion**: Claude Code expects hooks at `~/.claude/plugins/marketplaces/` but they're in your working directory
|
|
83
|
+
- ❌ **Instability**: Leads to "hook not found" errors like you just experienced
|
|
84
|
+
|
|
85
|
+
**Rule of thumb:**
|
|
86
|
+
- **Development workflow**: Commit → Push → `bash scripts/refresh-marketplace.sh` (GitHub mode) → Test
|
|
87
|
+
- **Emergency local testing**: Use `--local` ONLY when you need to test uncommitted changes, then immediately switch back to GitHub mode
|
|
88
|
+
|
|
71
89
|
**What it does**:
|
|
72
90
|
1. ✅ Removes existing marketplace
|
|
73
91
|
2. ✅ Clears all plugin caches
|
|
@@ -78,22 +96,22 @@ bash scripts/refresh-marketplace.sh --github
|
|
|
78
96
|
**Output Example**:
|
|
79
97
|
```
|
|
80
98
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
81
|
-
SpecWeave Marketplace Refresh (
|
|
99
|
+
SpecWeave Marketplace Refresh (github mode)
|
|
82
100
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
83
101
|
|
|
84
102
|
📦 Step 1: Removing existing marketplace...
|
|
85
103
|
✓ Marketplace removed
|
|
86
104
|
|
|
87
105
|
🧹 Step 2: Clearing plugin caches...
|
|
88
|
-
✓ Marketplace cache cleared
|
|
89
106
|
✓ Installed plugins cache backed up
|
|
90
107
|
|
|
91
108
|
📥 Step 3: Adding marketplace...
|
|
92
|
-
|
|
93
|
-
|
|
109
|
+
Pulling latest from GitHub: anton-abyzov/specweave
|
|
110
|
+
Cloning via SSH: git@github.com:anton-abyzov/specweave.git
|
|
111
|
+
✓ GitHub marketplace added
|
|
94
112
|
|
|
95
113
|
📋 Step 4: Reading plugin list...
|
|
96
|
-
✓ Found
|
|
114
|
+
✓ Found 27 plugins
|
|
97
115
|
|
|
98
116
|
⚙️ Step 5: Installing all plugins...
|
|
99
117
|
Installing specweave...
|
|
@@ -120,29 +138,127 @@ Next steps:
|
|
|
120
138
|
```
|
|
121
139
|
|
|
122
140
|
**When to use**:
|
|
123
|
-
- ✅ After
|
|
124
|
-
- ✅ After
|
|
125
|
-
- ✅
|
|
126
|
-
- ✅
|
|
127
|
-
-
|
|
141
|
+
- ✅ After pushing changes to GitHub (GitHub mode - default)
|
|
142
|
+
- ✅ After pulling latest from GitHub (GitHub mode)
|
|
143
|
+
- ✅ When plugins aren't loading correctly (GitHub mode)
|
|
144
|
+
- ✅ After adding new plugins (commit → push → refresh with GitHub mode)
|
|
145
|
+
- ⚠️ To test uncommitted local changes (local mode - use sparingly!)
|
|
128
146
|
|
|
129
147
|
**Time**: ~30 seconds (vs 5-10 minutes manual)
|
|
130
148
|
|
|
149
|
+
**Verification after refresh**:
|
|
150
|
+
```bash
|
|
151
|
+
# Check marketplace source (should be "github")
|
|
152
|
+
cat ~/.claude/plugins/known_marketplaces.json | jq -r '.specweave.source'
|
|
153
|
+
|
|
154
|
+
# Should output: {"source": "github", "repo": "anton-abyzov/specweave"}
|
|
155
|
+
# NOT: {"source": "directory", "path": "/Users/..."}
|
|
156
|
+
```
|
|
157
|
+
|
|
131
158
|
**Requirements**: `jq` installed (`brew install jq`)
|
|
132
159
|
|
|
133
160
|
---
|
|
134
161
|
|
|
162
|
+
### 1b. NPM Release Workflow (NEW! 🚀)
|
|
163
|
+
|
|
164
|
+
**Two release modes**: Default (GitHub Actions) and Direct (`--only` flag)
|
|
165
|
+
|
|
166
|
+
#### Default Mode (Recommended)
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Push to GitHub → GitHub Actions publishes to npm
|
|
170
|
+
/specweave-release:npm
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**What happens**:
|
|
174
|
+
1. ✅ Bumps patch version (e.g., 0.24.11 → 0.24.12)
|
|
175
|
+
2. ✅ Creates git commit + tag
|
|
176
|
+
3. ✅ Pushes to GitHub
|
|
177
|
+
4. ✅ Triggers GitHub Actions workflow
|
|
178
|
+
5. ✅ GitHub Actions publishes to npm (1-2 min)
|
|
179
|
+
|
|
180
|
+
**Use when**: Regular releases, want CI validation
|
|
181
|
+
|
|
182
|
+
#### Direct Mode (`--only` flag)
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Publish directly to npm (bypasses GitHub Actions)
|
|
186
|
+
/specweave-release:npm --only
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**What happens**:
|
|
190
|
+
1. ✅ Bumps patch version
|
|
191
|
+
2. ✅ Creates git commit + tag
|
|
192
|
+
3. ✅ Builds package (`npm run rebuild`)
|
|
193
|
+
4. ✅ **Publishes to npm immediately**
|
|
194
|
+
5. ✅ Pushes git changes to GitHub (optional)
|
|
195
|
+
|
|
196
|
+
**Use when**:
|
|
197
|
+
- 🔥 Emergency releases (hotfix needed NOW)
|
|
198
|
+
- ⚡ Want immediate feedback (no CI wait)
|
|
199
|
+
- 🧪 Testing release process locally
|
|
200
|
+
- 💻 GitHub Actions unavailable
|
|
201
|
+
|
|
202
|
+
**Example output**:
|
|
203
|
+
```
|
|
204
|
+
✅ Published directly to npm!
|
|
205
|
+
|
|
206
|
+
📦 Version: v0.24.12
|
|
207
|
+
🔗 NPM: https://www.npmjs.com/package/specweave
|
|
208
|
+
🏷️ Git Tag: v0.24.12 (created locally)
|
|
209
|
+
|
|
210
|
+
What happened:
|
|
211
|
+
- ✅ Version bumped and committed
|
|
212
|
+
- ✅ Git tag created locally
|
|
213
|
+
- ✅ Package built (npm run rebuild)
|
|
214
|
+
- ✅ Published to npm directly
|
|
215
|
+
- ✅ Git changes pushed to GitHub
|
|
216
|
+
|
|
217
|
+
Note: Published via direct push (bypassed GitHub Actions)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Safety**:
|
|
221
|
+
- ✅ Both modes do pre-flight checks (branch, uncommitted changes)
|
|
222
|
+
- ✅ Both create proper git commits/tags
|
|
223
|
+
- ✅ Direct mode rebuilds before publishing
|
|
224
|
+
- ✅ Default mode is preferred for regular releases
|
|
225
|
+
|
|
226
|
+
**Time comparison**:
|
|
227
|
+
- Default mode: 2-3 minutes (includes CI)
|
|
228
|
+
- Direct mode (`--only`): 30 seconds
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
135
232
|
### 2. Increment Folder Structure
|
|
136
233
|
|
|
137
|
-
**
|
|
234
|
+
**CRITICAL RULES**:
|
|
235
|
+
|
|
236
|
+
**At `.specweave/increments/` root - ONLY 3 things allowed**:
|
|
237
|
+
1. Numbered increment folders: `####-increment-name/` (e.g., `0053-safe-feature-deletion/`)
|
|
238
|
+
2. Archive folder: `_archive/`
|
|
239
|
+
3. README.md (optional documentation)
|
|
240
|
+
|
|
241
|
+
**❌ NOT ALLOWED at root**: `_working/`, `reports/`, `logs/`, `scripts/`, or ANY other folders/files
|
|
242
|
+
|
|
243
|
+
**Inside each increment folder - ONLY 4 files at root**: `spec.md`, `plan.md`, `tasks.md`, `metadata.json`
|
|
138
244
|
|
|
139
245
|
**Everything else → subfolders**: `reports/`, `scripts/`, `logs/`
|
|
140
246
|
|
|
141
247
|
```bash
|
|
248
|
+
# ❌ WRONG: .specweave/increments/_working/fix/
|
|
249
|
+
# ❌ WRONG: .specweave/increments/reports/
|
|
142
250
|
# ❌ WRONG: .specweave/increments/0046/analysis-report.md
|
|
143
251
|
# ✅ CORRECT: .specweave/increments/0046/reports/analysis-report.md
|
|
144
252
|
```
|
|
145
253
|
|
|
254
|
+
**Validation**:
|
|
255
|
+
```bash
|
|
256
|
+
# Check for violations at root (should output NOTHING)
|
|
257
|
+
ls -1 .specweave/increments/ | grep -v "^[0-9]" | grep -v "^_archive" | grep -v "^README.md"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**See**: `.specweave/docs/internal/governance/increment-folder-structure.md` (complete standard)
|
|
261
|
+
|
|
146
262
|
---
|
|
147
263
|
|
|
148
264
|
### 3. Protected Directories
|
|
@@ -281,6 +397,109 @@ Edit("spec.md", "...", "...\n\n## Acceptance Criteria\n\n...")
|
|
|
281
397
|
|
|
282
398
|
---
|
|
283
399
|
|
|
400
|
+
### 7b. AC Sync Parser - Task Status Format (CRITICAL - v0.25.2+) 🔥
|
|
401
|
+
|
|
402
|
+
**CRITICAL BUG FIXED 2025-11-24**: AC sync hook was only detecting list format checkboxes, missing field format entirely!
|
|
403
|
+
|
|
404
|
+
**The Bug**: Parser in `ac-status-manager.ts` only looked for `- [x]` list items, completely missing `**Status**: [x] completed` field format introduced in v0.23.0. This caused ALL 70 ACs in increment 0053 to show false "0% tasks complete" even though tasks.md showed 37/37 completed!
|
|
405
|
+
|
|
406
|
+
**Impact**:
|
|
407
|
+
- ❌ Data integrity violation (metadata.json polluted with false conflicts)
|
|
408
|
+
- ❌ Violated Source of Truth principle (tasks.md said "done", hook said "0%")
|
|
409
|
+
- ❌ Potential for closing increments with incomplete work (hook gave false positives)
|
|
410
|
+
|
|
411
|
+
**Root Cause** (before fix):
|
|
412
|
+
```typescript
|
|
413
|
+
// ac-status-manager.ts:137 (BROKEN - only detected list format!)
|
|
414
|
+
if (currentTaskId && line.includes('- [')) { // ❌ MISSED FIELD FORMAT!
|
|
415
|
+
if (line.includes('- [ ]')) {
|
|
416
|
+
hasUncheckedBoxes = true;
|
|
417
|
+
} else if (line.includes('- [x]')) {
|
|
418
|
+
hasCheckedBoxes = true;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**The Fix** (v0.25.2):
|
|
424
|
+
```typescript
|
|
425
|
+
// Now supports BOTH formats!
|
|
426
|
+
if (currentTaskId) {
|
|
427
|
+
// 1. List format: - [x] or - [ ]
|
|
428
|
+
if (line.includes('- [')) {
|
|
429
|
+
if (line.includes('- [ ]')) {
|
|
430
|
+
hasUncheckedBoxes = true;
|
|
431
|
+
} else if (line.includes('- [x]')) {
|
|
432
|
+
hasCheckedBoxes = true;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
// 2. Field format: **Status**: [x] completed (NEW!)
|
|
436
|
+
else if (line.match(/\*\*Status\*\*:\s*\[x\]/i)) {
|
|
437
|
+
hasCheckedBoxes = true;
|
|
438
|
+
}
|
|
439
|
+
// 3. Field format: **Status**: [ ] pending (NEW!)
|
|
440
|
+
else if (line.match(/\*\*Status\*\*:\s*\[\s\]/i)) {
|
|
441
|
+
hasUncheckedBoxes = true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
**Supported Task Formats** (both work now):
|
|
447
|
+
|
|
448
|
+
**Format 1: List items** (legacy, still supported):
|
|
449
|
+
```markdown
|
|
450
|
+
### T-001: Task Title
|
|
451
|
+
**Satisfies ACs**: AC-US1-01
|
|
452
|
+
- [x] Completed
|
|
453
|
+
- [x] Done
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
**Format 2: Field format** (v0.23.0+, NOW WORKS!):
|
|
457
|
+
```markdown
|
|
458
|
+
### T-001: Task Title
|
|
459
|
+
**User Story**: US-001
|
|
460
|
+
**Satisfies ACs**: AC-US1-01
|
|
461
|
+
**Priority**: P1
|
|
462
|
+
**Status**: [x] completed ← THIS NOW WORKS!
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Validation** (ensure fix is present):
|
|
466
|
+
```bash
|
|
467
|
+
# Check parser supports field format
|
|
468
|
+
grep -A 5 "Check for field format" src/core/increment/ac-status-manager.ts
|
|
469
|
+
|
|
470
|
+
# Should see: line.match(/\*\*Status\*\*:\s*\[x\]/i)
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**Regression Tests** (5 new tests added):
|
|
474
|
+
```bash
|
|
475
|
+
npm test -- ac-status-manager.test.ts -t "Task status field format"
|
|
476
|
+
|
|
477
|
+
# Tests:
|
|
478
|
+
# 1. Field format detection (completed)
|
|
479
|
+
# 2. Field format detection (incomplete)
|
|
480
|
+
# 3. Mixed format support (field + list)
|
|
481
|
+
# 4. Case-insensitive matching
|
|
482
|
+
# 5. Real-world increment 0053 format
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**Incident** (2025-11-24, Increment 0053):
|
|
486
|
+
- All 70 ACs showed "AC-USXX-YY: [x] but only 0/1 tasks complete (0%)"
|
|
487
|
+
- tasks.md clearly showed 37/37 tasks with `**Status**: [x] completed`
|
|
488
|
+
- Hook logged 280 conflict messages (4 acSyncEvents × 70 conflicts each)
|
|
489
|
+
- Fix: Updated parser → rebuilt → verified 0 conflicts
|
|
490
|
+
|
|
491
|
+
**Prevention**:
|
|
492
|
+
- ✅ 5 comprehensive regression tests (tests/unit/ac-status-manager.test.ts:855-1051)
|
|
493
|
+
- ✅ Tests include real-world increment 0053 format
|
|
494
|
+
- ✅ CI/CD runs all 43 AC status manager tests on every commit
|
|
495
|
+
- ✅ Emergency recovery guide: `.specweave/docs/internal/emergency-procedures/AC-SYNC-CONFLICT-FIX-2025-11-24.md`
|
|
496
|
+
|
|
497
|
+
**CRITICAL**: When introducing new task formats, ALWAYS update ALL parsers and add regression tests!
|
|
498
|
+
|
|
499
|
+
**See**: Emergency fix report (AC-SYNC-CONFLICT-FIX-2025-11-24.md), increment 0053 metadata.json (acSyncEvents)
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
284
503
|
### 8. Logger Abstraction (NEVER `console.*`)
|
|
285
504
|
|
|
286
505
|
**Rule**: ALL `src/` code uses logger injection, NEVER `console.log/error/warn`
|
|
@@ -641,8 +860,10 @@ await provider.createRepository({ owner, name, description, visibility }, token)
|
|
|
641
860
|
|
|
642
861
|
**Platform Support**:
|
|
643
862
|
- ✅ GitHub (fully supported): `github-provider.ts`
|
|
644
|
-
-
|
|
645
|
-
-
|
|
863
|
+
- ✅ GitLab (fully supported): `gitlab-provider.ts`
|
|
864
|
+
- ✅ Bitbucket (fully supported): `bitbucket-provider.ts`
|
|
865
|
+
- ✅ Azure DevOps (fully supported): `azure-devops-provider.ts`
|
|
866
|
+
- ✅ Local Git (fully supported): `local-provider.ts`
|
|
646
867
|
|
|
647
868
|
**Adding new platform**:
|
|
648
869
|
1. Create `src/core/repo-structure/providers/{platform}-provider.ts`
|
|
@@ -701,11 +922,26 @@ plugins/ # Skills, agents, commands, hooks
|
|
|
701
922
|
|
|
702
923
|
---
|
|
703
924
|
|
|
704
|
-
## 9a. Hook Performance & Safety (CRITICAL - v0.
|
|
925
|
+
## 9a. Hook Performance & Safety (CRITICAL - v0.25.0)
|
|
705
926
|
|
|
706
|
-
**Critical incidents**:
|
|
927
|
+
**Critical incidents**:
|
|
928
|
+
- 2025-11-22 - Multiple Claude Code crashes due to hook overhead
|
|
929
|
+
- 2025-11-23 - Hook process storm (6 hooks per Edit/Write → 300 processes/min)
|
|
930
|
+
- 2025-11-24 (AM) - PROJECT_ROOT order bug (recursion guard at wrong path → crashes)
|
|
931
|
+
- **2025-11-24 (PM) - TodoWrite crash: US sync triggers unguarded external tool cascade → infinite recursion** ⚠️
|
|
707
932
|
|
|
708
|
-
**Root cause**:
|
|
933
|
+
**Root cause**:
|
|
934
|
+
- **Original**: Process exhaustion from spawning 6 bash processes per Edit/Write operation
|
|
935
|
+
- **NEW (v0.25.1)**: US completion orchestrator triggers `livingDocsSync.syncIncrement()` which calls `syncToExternalTools()` without checking `SKIP_GITHUB_SYNC` → Edit/Write operations → new hook chains → infinite recursion → crash
|
|
936
|
+
|
|
937
|
+
**LONG-TERM FIX (v0.25.0)**: Hook Consolidation
|
|
938
|
+
- **Reduced from 6 → 4 hooks per Edit/Write** (33% reduction)
|
|
939
|
+
- **Consolidated hooks**:
|
|
940
|
+
- `pre-edit-write-consolidated.sh` (replaces pre-edit-spec + pre-write-spec)
|
|
941
|
+
- `post-edit-write-consolidated.sh` (replaces post-edit-spec + post-write-spec)
|
|
942
|
+
- `post-metadata-change.sh` (enhanced with ultra-fast early exit)
|
|
943
|
+
- **Performance**: 50% reduction in hook overhead
|
|
944
|
+
- **See**: ADR-0070 (Hook Consolidation)
|
|
709
945
|
|
|
710
946
|
**Emergency fixes implemented (v0.24.3)**:
|
|
711
947
|
|
|
@@ -744,13 +980,14 @@ exit 0 # ALWAYS exit 0, never block workflow
|
|
|
744
980
|
### Hook Safety Checklist (MANDATORY)
|
|
745
981
|
|
|
746
982
|
**✅ EVERY hook MUST have**:
|
|
747
|
-
1.
|
|
748
|
-
2.
|
|
749
|
-
3.
|
|
750
|
-
4.
|
|
751
|
-
5.
|
|
752
|
-
6.
|
|
753
|
-
7.
|
|
983
|
+
1. `PROJECT_ROOT` defined BEFORE any path variables (CRITICAL - v0.26.1)
|
|
984
|
+
2. Kill switch check (`SPECWEAVE_DISABLE_HOOKS`)
|
|
985
|
+
3. Circuit breaker check (3 failure threshold)
|
|
986
|
+
4. File locking (prevent concurrent runs)
|
|
987
|
+
5. Debouncing (5s minimum)
|
|
988
|
+
6. Error isolation (`set +e`, `exit 0`)
|
|
989
|
+
7. Background work wrapped in subshell
|
|
990
|
+
8. Circuit breaker updates on success/failure
|
|
754
991
|
|
|
755
992
|
**❌ NEVER in hooks**:
|
|
756
993
|
- `set -e` (causes crashes)
|
|
@@ -831,6 +1068,158 @@ done
|
|
|
831
1068
|
|
|
832
1069
|
**See**: `.specweave/increments/0050-*/reports/ARCHITECTURAL-FIX-ACTIVE-INCREMENT-FILTERING.md`
|
|
833
1070
|
|
|
1071
|
+
### Hook Variable Initialization Order (v0.26.1 - CRITICAL FIX)
|
|
1072
|
+
|
|
1073
|
+
**CRITICAL BUG PATTERN**: Variables used in path construction MUST be defined BEFORE they're used!
|
|
1074
|
+
|
|
1075
|
+
**Incident** (2025-11-24): Claude Code crashed 3x due to `PROJECT_ROOT` being used before definition in `post-task-completion.sh`.
|
|
1076
|
+
|
|
1077
|
+
**The Bug**:
|
|
1078
|
+
```bash
|
|
1079
|
+
# ❌ WRONG: Uses $PROJECT_ROOT before it's defined
|
|
1080
|
+
RECURSION_GUARD_FILE="$PROJECT_ROOT/.specweave/state/.hook-recursion-guard" # Line 71
|
|
1081
|
+
# ... 40 lines later ...
|
|
1082
|
+
PROJECT_ROOT="$(find_project_root ...)" # Line 112 - TOO LATE!
|
|
1083
|
+
|
|
1084
|
+
# Result: Guard file created at wrong path (/.specweave/state/...)
|
|
1085
|
+
```
|
|
1086
|
+
|
|
1087
|
+
**What Happened**:
|
|
1088
|
+
1. Guard file created at **invalid path** (`/.specweave/state/.hook-recursion-guard`)
|
|
1089
|
+
2. Other hooks check guard at **correct path** (`/full/project/path/.specweave/state/...`)
|
|
1090
|
+
3. Guard not found → hooks don't exit early → **INFINITE RECURSION**
|
|
1091
|
+
4. PreToolUse hook fired 3x → Claude Code crashed
|
|
1092
|
+
|
|
1093
|
+
**✅ CORRECT Pattern**:
|
|
1094
|
+
```bash
|
|
1095
|
+
# 1. Define find_project_root() function FIRST (line 40)
|
|
1096
|
+
find_project_root() { ... }
|
|
1097
|
+
|
|
1098
|
+
# 2. Set PROJECT_ROOT IMMEDIATELY (line 50)
|
|
1099
|
+
PROJECT_ROOT="$(find_project_root ...)"
|
|
1100
|
+
|
|
1101
|
+
# 3. NOW use PROJECT_ROOT in paths (line 60+)
|
|
1102
|
+
RECURSION_GUARD_FILE="$PROJECT_ROOT/.specweave/state/.hook-recursion-guard"
|
|
1103
|
+
```
|
|
1104
|
+
|
|
1105
|
+
**Validation** (automated script):
|
|
1106
|
+
```bash
|
|
1107
|
+
# Run the validation script (validates all hooks automatically)
|
|
1108
|
+
bash scripts/validate-hook-variable-order.sh
|
|
1109
|
+
|
|
1110
|
+
# Expected output: ✅ ALL HOOKS VALIDATED SUCCESSFULLY
|
|
1111
|
+
# If fails: Script shows exactly which hooks have wrong variable order
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
**Enforcement** (✅ DONE - v0.26.1):
|
|
1115
|
+
- ✅ Pre-commit hook added: runs `validate-hook-variable-order.sh` on every commit
|
|
1116
|
+
- ✅ Regression tests added: `tests/unit/hooks/recursion-guard.test.ts` (29 tests)
|
|
1117
|
+
- ✅ Validates all hooks with RECURSION_GUARD_FILE have correct variable order
|
|
1118
|
+
- ✅ Blocks commits where `PROJECT_ROOT` is defined after `RECURSION_GUARD_FILE`
|
|
1119
|
+
|
|
1120
|
+
**Manual validation**:
|
|
1121
|
+
```bash
|
|
1122
|
+
# Check specific hook manually
|
|
1123
|
+
hook="plugins/specweave/hooks/post-task-completion.sh"
|
|
1124
|
+
guard_line=$(grep -n "^RECURSION_GUARD_FILE=" "$hook" | cut -d: -f1)
|
|
1125
|
+
root_line=$(grep -n "^PROJECT_ROOT=" "$hook" | cut -d: -f1)
|
|
1126
|
+
echo "PROJECT_ROOT: line $root_line"
|
|
1127
|
+
echo "RECURSION_GUARD_FILE: line $guard_line"
|
|
1128
|
+
# root_line MUST be < guard_line
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
**See**:
|
|
1132
|
+
- `.specweave/increments/0051-*/reports/PROJECT-ROOT-ORDER-BUG-2025-11-24.md`
|
|
1133
|
+
- `scripts/validate-hook-variable-order.sh` (validation script)
|
|
1134
|
+
- `tests/unit/hooks/recursion-guard.test.ts` (regression tests)
|
|
1135
|
+
|
|
1136
|
+
---
|
|
1137
|
+
|
|
1138
|
+
### TodoWrite Crash (v0.25.1 - EMERGENCY FIX) ⚠️
|
|
1139
|
+
|
|
1140
|
+
**CRITICAL BUG**: Marking tasks complete via TodoWrite crashes Claude Code due to unguarded external tool sync cascade.
|
|
1141
|
+
|
|
1142
|
+
**Incident** (2025-11-24 PM): User reported Claude Code crash when marking tasks complete in increment 0053-safe-feature-deletion.
|
|
1143
|
+
|
|
1144
|
+
**Root Cause**:
|
|
1145
|
+
1. US completion orchestrator (`us-completion-orchestrator.js`) detects all 6 USs as "newly complete" (perfect storm when last task marked)
|
|
1146
|
+
2. Calls `livingDocsSync.syncIncrement()` without checking `SKIP_US_SYNC` flag
|
|
1147
|
+
3. Living docs sync calls `syncToExternalTools()` without checking `SKIP_GITHUB_SYNC` flag
|
|
1148
|
+
4. External tool sync creates/updates GitHub issues (Edit/Write operations)
|
|
1149
|
+
5. Edit/Write hooks trigger NEW hook chains (recursion guard doesn't protect Edit/Write events)
|
|
1150
|
+
6. **Infinite recursion** → Process exhaustion → Claude Code crash
|
|
1151
|
+
|
|
1152
|
+
**Crash Flow**:
|
|
1153
|
+
```
|
|
1154
|
+
TodoWrite → post-task-completion.sh
|
|
1155
|
+
→ consolidated-sync.js (operation 5/6)
|
|
1156
|
+
→ us-completion-orchestrator.js
|
|
1157
|
+
→ livingDocsSync.syncIncrement()
|
|
1158
|
+
→ syncToExternalTools() ← NO GUARD!
|
|
1159
|
+
→ syncToGitHub()
|
|
1160
|
+
→ Edit/Write operations
|
|
1161
|
+
→ NEW HOOK CHAIN
|
|
1162
|
+
→ INFINITE RECURSION
|
|
1163
|
+
→ 💥 CRASH
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
**Emergency Hotfix** (v0.25.1 - ✅ DEPLOYED):
|
|
1167
|
+
```bash
|
|
1168
|
+
# File: plugins/specweave/hooks/post-task-completion.sh (line 463)
|
|
1169
|
+
export SKIP_US_SYNC=true
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
**Impact**:
|
|
1173
|
+
- ✅ **NO MORE CRASHES**: TodoWrite is now safe
|
|
1174
|
+
- ⚠️ **Manual sync required**: Must run `/specweave:sync-progress` after completing tasks
|
|
1175
|
+
- ✅ **Living docs still work**: AC sync, tasks.md updates, status line all function
|
|
1176
|
+
|
|
1177
|
+
**Verification**:
|
|
1178
|
+
```bash
|
|
1179
|
+
# 1. Check hotfix applied
|
|
1180
|
+
grep "SKIP_US_SYNC=true" plugins/specweave/hooks/post-task-completion.sh
|
|
1181
|
+
|
|
1182
|
+
# 2. Test task completion
|
|
1183
|
+
TodoWrite([{ content: "T-001", status: "completed" }])
|
|
1184
|
+
|
|
1185
|
+
# 3. Verify no crash
|
|
1186
|
+
tail -50 .specweave/logs/hooks-debug.log | grep "SKIP_US_SYNC"
|
|
1187
|
+
# Expected: ℹ️ User story sync skipped (SKIP_US_SYNC=true)
|
|
1188
|
+
|
|
1189
|
+
# 4. Manual sync when ready
|
|
1190
|
+
/specweave:sync-progress 0053
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
**Long-Term Fix** (v0.26.0 - PLANNED):
|
|
1194
|
+
- **Tier 1**: Add `SKIP_EXTERNAL_SYNC` check in `LivingDocsSync.syncIncrement()`
|
|
1195
|
+
- **Tier 2**: Universal recursion guard (ALL hooks check same guard file)
|
|
1196
|
+
- **Tier 3**: Smart throttling (60-second window for US sync)
|
|
1197
|
+
- **Result**: Restore automatic US sync (now safe with guard rails!)
|
|
1198
|
+
|
|
1199
|
+
**Recovery** (If crash occurs):
|
|
1200
|
+
```bash
|
|
1201
|
+
# 1. Kill stuck processes
|
|
1202
|
+
ps aux | grep -E "consolidated-sync|us-completion" | awk '{print $2}' | xargs kill -9
|
|
1203
|
+
|
|
1204
|
+
# 2. Disable hooks
|
|
1205
|
+
export SPECWEAVE_DISABLE_HOOKS=1
|
|
1206
|
+
|
|
1207
|
+
# 3. Clean locks
|
|
1208
|
+
rm -rf .specweave/state/.hook-*.lock
|
|
1209
|
+
rm -f .specweave/state/.hook-recursion-guard
|
|
1210
|
+
|
|
1211
|
+
# 4. Apply hotfix (see above)
|
|
1212
|
+
|
|
1213
|
+
# 5. Re-enable hooks
|
|
1214
|
+
unset SPECWEAVE_DISABLE_HOOKS
|
|
1215
|
+
```
|
|
1216
|
+
|
|
1217
|
+
**See**:
|
|
1218
|
+
- `.specweave/increments/0053-safe-feature-deletion/reports/EXECUTIVE-SUMMARY-CRASH-FIX-2025-11-24.md` (Executive summary)
|
|
1219
|
+
- `.specweave/increments/0053-safe-feature-deletion/reports/ROOT-CAUSE-ANALYSIS-TODOWRITE-CRASH-2025-11-24.md` (Detailed analysis)
|
|
1220
|
+
- `.specweave/docs/internal/emergency-procedures/TODOWRITE-CRASH-RECOVERY.md` (Recovery guide)
|
|
1221
|
+
- `.specweave/docs/internal/architecture/adr/0129-us-sync-guard-rails.md` (ADR-0129)
|
|
1222
|
+
|
|
834
1223
|
---
|
|
835
1224
|
|
|
836
1225
|
## Development Workflow
|
|
@@ -840,10 +1229,19 @@ done
|
|
|
840
1229
|
/specweave:increment "feature" # Plan
|
|
841
1230
|
/specweave:do # Execute
|
|
842
1231
|
/specweave:progress # Status
|
|
1232
|
+
/specweave:sync-progress # Comprehensive sync (tasks → docs → external tools)
|
|
843
1233
|
/specweave:done 0002 # Close (validates)
|
|
844
1234
|
/specweave:validate 0001 # Validate
|
|
845
1235
|
/specweave:qa 0001 # Quality check
|
|
846
1236
|
/specweave:pause/resume/abandon # State management
|
|
1237
|
+
|
|
1238
|
+
# Feature deletion
|
|
1239
|
+
specweave delete-feature FS-042 --dry-run # Preview deletion
|
|
1240
|
+
specweave delete-feature FS-042 # Safe deletion (requires confirmation)
|
|
1241
|
+
specweave delete-feature FS-042 --force # Force delete (orphans active increments)
|
|
1242
|
+
specweave delete-feature FS-042 --no-git # Skip git operations
|
|
1243
|
+
specweave delete-feature FS-042 --no-github # Skip GitHub issue cleanup
|
|
1244
|
+
specweave delete-feature FS-042 --yes # Skip confirmations (except elevated)
|
|
847
1245
|
```
|
|
848
1246
|
|
|
849
1247
|
**Local setup**:
|
|
@@ -983,6 +1381,324 @@ await configManager.update({ issueTracker: { provider: 'jira', domain: 'example.
|
|
|
983
1381
|
|
|
984
1382
|
---
|
|
985
1383
|
|
|
1384
|
+
## Comprehensive Progress Sync (v0.25.0+)
|
|
1385
|
+
|
|
1386
|
+
**Command**: `/specweave:sync-progress`
|
|
1387
|
+
|
|
1388
|
+
**Purpose**: Single-button multi-system synchronization. Orchestrates complete flow from task completion → living docs → external tools (GitHub/JIRA/ADO).
|
|
1389
|
+
|
|
1390
|
+
### What It Does
|
|
1391
|
+
|
|
1392
|
+
**Comprehensive Sync Flow**:
|
|
1393
|
+
```
|
|
1394
|
+
tasks.md (source of truth)
|
|
1395
|
+
↓
|
|
1396
|
+
spec.md ACs (marked complete)
|
|
1397
|
+
↓
|
|
1398
|
+
Living docs (user stories updated)
|
|
1399
|
+
↓
|
|
1400
|
+
External tools (GitHub/JIRA/ADO synced)
|
|
1401
|
+
↓
|
|
1402
|
+
Status line cache (updated display)
|
|
1403
|
+
```
|
|
1404
|
+
|
|
1405
|
+
**One command replaces 4 manual steps**:
|
|
1406
|
+
```bash
|
|
1407
|
+
# OLD: Manual multi-step sync (error-prone)
|
|
1408
|
+
/specweave:sync-acs 0053
|
|
1409
|
+
/specweave:sync-specs 0053
|
|
1410
|
+
/specweave-github:sync 0053
|
|
1411
|
+
/specweave:update-status
|
|
1412
|
+
|
|
1413
|
+
# NEW: Single comprehensive sync ✅
|
|
1414
|
+
/specweave:sync-progress 0053
|
|
1415
|
+
```
|
|
1416
|
+
|
|
1417
|
+
### Usage
|
|
1418
|
+
|
|
1419
|
+
```bash
|
|
1420
|
+
# Auto-detect active increment
|
|
1421
|
+
/specweave:sync-progress
|
|
1422
|
+
|
|
1423
|
+
# Explicit increment ID
|
|
1424
|
+
/specweave:sync-progress 0053
|
|
1425
|
+
|
|
1426
|
+
# Dry-run mode (preview without executing)
|
|
1427
|
+
/specweave:sync-progress 0053 --dry-run
|
|
1428
|
+
|
|
1429
|
+
# Skip external tools (local-only sync)
|
|
1430
|
+
/specweave:sync-progress 0053 --no-github --no-jira --no-ado
|
|
1431
|
+
```
|
|
1432
|
+
|
|
1433
|
+
### When to Use
|
|
1434
|
+
|
|
1435
|
+
**✅ Use /specweave:sync-progress when**:
|
|
1436
|
+
1. After completing tasks in tasks.md
|
|
1437
|
+
2. Before closing increment (`/specweave:done`)
|
|
1438
|
+
3. Want to update status line with latest progress
|
|
1439
|
+
4. Need to sync to external tools (GitHub/JIRA/ADO)
|
|
1440
|
+
5. After bulk task completion
|
|
1441
|
+
|
|
1442
|
+
**❌ Don't use when**:
|
|
1443
|
+
1. Only need to sync ACs → Use `/specweave:sync-acs`
|
|
1444
|
+
2. Only need to sync docs → Use `/specweave:sync-specs`
|
|
1445
|
+
3. Only need to sync GitHub → Use `/specweave-github:sync`
|
|
1446
|
+
|
|
1447
|
+
### Multi-Phase Orchestration
|
|
1448
|
+
|
|
1449
|
+
**Phase 1: Tasks → ACs (spec.md)**
|
|
1450
|
+
- Reads completed tasks from tasks.md
|
|
1451
|
+
- Finds linked ACs via `**Satisfies ACs**` field
|
|
1452
|
+
- Marks ACs as complete: `[ ]` → `[x]`
|
|
1453
|
+
- Updates metadata.json with AC count
|
|
1454
|
+
|
|
1455
|
+
**Phase 2: Spec → Living Docs**
|
|
1456
|
+
- Syncs spec.md to living docs structure
|
|
1457
|
+
- Updates user story completion status
|
|
1458
|
+
- Generates/updates feature ID if needed
|
|
1459
|
+
|
|
1460
|
+
**Phase 3: Living Docs → External Tools**
|
|
1461
|
+
- **GitHub**: Closes completed user story issues, updates epic checklist
|
|
1462
|
+
- **JIRA**: Updates story status, transitions workflow
|
|
1463
|
+
- **Azure DevOps**: Updates work item state, adds comments
|
|
1464
|
+
|
|
1465
|
+
**Phase 4: Status Line Cache**
|
|
1466
|
+
- Updates status line with latest completion %
|
|
1467
|
+
|
|
1468
|
+
### Flags
|
|
1469
|
+
|
|
1470
|
+
| Flag | Purpose | Example |
|
|
1471
|
+
|------|---------|---------|
|
|
1472
|
+
| `--dry-run` | Preview without executing | `--dry-run` |
|
|
1473
|
+
| `--no-github` | Skip GitHub sync | `--no-github` |
|
|
1474
|
+
| `--no-jira` | Skip JIRA sync | `--no-jira` |
|
|
1475
|
+
| `--no-ado` | Skip Azure DevOps sync | `--no-ado` |
|
|
1476
|
+
| `--force` | Force sync even if validation fails | `--force` |
|
|
1477
|
+
|
|
1478
|
+
### Error Handling
|
|
1479
|
+
|
|
1480
|
+
**Graceful Degradation**:
|
|
1481
|
+
- **Critical errors** (AC sync, docs sync): Abort entire sync
|
|
1482
|
+
- **Non-critical errors** (GitHub, JIRA, ADO): Log warning, continue
|
|
1483
|
+
|
|
1484
|
+
**Philosophy**: Core sync (tasks → docs) must succeed. External tool sync is best-effort.
|
|
1485
|
+
|
|
1486
|
+
### Example Workflow
|
|
1487
|
+
|
|
1488
|
+
**Typical increment workflow with progress sync**:
|
|
1489
|
+
|
|
1490
|
+
```bash
|
|
1491
|
+
# 1. Plan increment
|
|
1492
|
+
/specweave:increment "Safe feature deletion"
|
|
1493
|
+
|
|
1494
|
+
# 2. Execute tasks
|
|
1495
|
+
/specweave:do
|
|
1496
|
+
|
|
1497
|
+
# [Complete 5 tasks...]
|
|
1498
|
+
|
|
1499
|
+
# 3. Sync progress after batch
|
|
1500
|
+
/specweave:sync-progress
|
|
1501
|
+
|
|
1502
|
+
# [Complete remaining 32 tasks...]
|
|
1503
|
+
|
|
1504
|
+
# 4. Final sync before closure
|
|
1505
|
+
/specweave:sync-progress 0053
|
|
1506
|
+
|
|
1507
|
+
# 5. Validate quality
|
|
1508
|
+
/specweave:validate 0053 --quality
|
|
1509
|
+
|
|
1510
|
+
# 6. Close increment
|
|
1511
|
+
/specweave:done 0053
|
|
1512
|
+
```
|
|
1513
|
+
|
|
1514
|
+
### External Tool Auto-Detection
|
|
1515
|
+
|
|
1516
|
+
**Automatic detection** from `.specweave/config.json`:
|
|
1517
|
+
- GitHub: `"provider": "github"`
|
|
1518
|
+
- JIRA: `"provider": "jira"`
|
|
1519
|
+
- Azure DevOps: `"provider": "azure-devops"`
|
|
1520
|
+
|
|
1521
|
+
**Only configured tools are synced**:
|
|
1522
|
+
```
|
|
1523
|
+
✅ GitHub integration detected → Will sync
|
|
1524
|
+
ℹ️ No JIRA integration → Skip
|
|
1525
|
+
ℹ️ No ADO integration → Skip
|
|
1526
|
+
```
|
|
1527
|
+
|
|
1528
|
+
### Troubleshooting
|
|
1529
|
+
|
|
1530
|
+
**"No active increment found"**:
|
|
1531
|
+
```bash
|
|
1532
|
+
# Provide increment ID explicitly
|
|
1533
|
+
/specweave:sync-progress 0053
|
|
1534
|
+
```
|
|
1535
|
+
|
|
1536
|
+
**"AC sync had warnings: 5 ACs not found"**:
|
|
1537
|
+
```bash
|
|
1538
|
+
# Embed ACs from living docs into spec.md
|
|
1539
|
+
/specweave:embed-acs 0053
|
|
1540
|
+
|
|
1541
|
+
# Then retry sync
|
|
1542
|
+
/specweave:sync-progress 0053
|
|
1543
|
+
```
|
|
1544
|
+
|
|
1545
|
+
**"GitHub rate limit exceeded"** (non-critical):
|
|
1546
|
+
- Docs are synced successfully
|
|
1547
|
+
- Retry GitHub sync later when rate limit resets:
|
|
1548
|
+
```bash
|
|
1549
|
+
/specweave-github:sync 0053
|
|
1550
|
+
```
|
|
1551
|
+
|
|
1552
|
+
**See**:
|
|
1553
|
+
- Skill: `progress-sync` (comprehensive guide)
|
|
1554
|
+
- Increment 0053 (added in this increment)
|
|
1555
|
+
|
|
1556
|
+
---
|
|
1557
|
+
|
|
1558
|
+
## Safe Feature Deletion (v0.25.0+)
|
|
1559
|
+
|
|
1560
|
+
**Command**: `specweave delete-feature <feature-id>`
|
|
1561
|
+
|
|
1562
|
+
Safe deletion of features with multi-gate validation, automatic cleanup, and audit logging.
|
|
1563
|
+
|
|
1564
|
+
### Usage
|
|
1565
|
+
|
|
1566
|
+
```bash
|
|
1567
|
+
# Preview deletion (recommended first step)
|
|
1568
|
+
specweave delete-feature FS-042 --dry-run
|
|
1569
|
+
|
|
1570
|
+
# Safe deletion (requires confirmation)
|
|
1571
|
+
specweave delete-feature FS-042
|
|
1572
|
+
|
|
1573
|
+
# Force deletion (bypasses active increment validation)
|
|
1574
|
+
specweave delete-feature FS-042 --force
|
|
1575
|
+
|
|
1576
|
+
# Skip git operations
|
|
1577
|
+
specweave delete-feature FS-042 --no-git
|
|
1578
|
+
|
|
1579
|
+
# Skip GitHub issue cleanup
|
|
1580
|
+
specweave delete-feature FS-042 --no-github
|
|
1581
|
+
|
|
1582
|
+
# Skip confirmations (except elevated confirmation in force mode)
|
|
1583
|
+
specweave delete-feature FS-042 --yes
|
|
1584
|
+
```
|
|
1585
|
+
|
|
1586
|
+
### Safety Features
|
|
1587
|
+
|
|
1588
|
+
**4-Tier Validation**:
|
|
1589
|
+
1. **Feature Detection**: Scans living docs and user stories
|
|
1590
|
+
2. **Active Increment Check**: Blocks deletion if active increments reference feature (safe mode)
|
|
1591
|
+
3. **Git Status Check**: Ensures clean working directory
|
|
1592
|
+
4. **GitHub Issue Scan**: Finds related issues for cleanup
|
|
1593
|
+
|
|
1594
|
+
**3-Phase Commit Pattern**:
|
|
1595
|
+
1. **Validation Phase**: All safety checks
|
|
1596
|
+
2. **Staging Phase**: Reversible (file backup, git staging)
|
|
1597
|
+
3. **Commit Phase**: Irreversible (git commit, GitHub cleanup, audit log)
|
|
1598
|
+
|
|
1599
|
+
**Multi-Gate Confirmation**:
|
|
1600
|
+
- Primary Confirmation: y/N prompt for all deletions
|
|
1601
|
+
- Elevated Confirmation: Type "delete" for force mode (orphans active increments)
|
|
1602
|
+
- GitHub Confirmation: Separate prompt for closing GitHub issues
|
|
1603
|
+
|
|
1604
|
+
### What Gets Deleted
|
|
1605
|
+
|
|
1606
|
+
✅ Living docs: `.specweave/docs/internal/specs/_features/FS-XXX/FEATURE.md`
|
|
1607
|
+
✅ User stories: `.specweave/docs/internal/specs/{project}/FS-XXX/us-*.md`
|
|
1608
|
+
✅ README files: `.specweave/docs/internal/specs/{project}/FS-XXX/README.md`
|
|
1609
|
+
✅ GitHub issues: Issues matching `[FS-XXX][US-YYY]` pattern (optional)
|
|
1610
|
+
|
|
1611
|
+
❌ NOT deleted: Increments (only metadata.json updated if orphaned)
|
|
1612
|
+
|
|
1613
|
+
### Modes
|
|
1614
|
+
|
|
1615
|
+
**Safe Mode (default)**:
|
|
1616
|
+
- Blocks deletion if active increments reference feature
|
|
1617
|
+
- Requires clean git working directory
|
|
1618
|
+
- Requires explicit confirmation
|
|
1619
|
+
|
|
1620
|
+
**Force Mode (`--force`)**:
|
|
1621
|
+
- Allows deletion with active increments
|
|
1622
|
+
- Updates orphaned increment metadata.json (removes feature_id)
|
|
1623
|
+
- Requires elevated confirmation (type "delete")
|
|
1624
|
+
|
|
1625
|
+
**Dry-Run Mode (`--dry-run`)**:
|
|
1626
|
+
- Preview deletion without executing
|
|
1627
|
+
- Shows all files to be deleted
|
|
1628
|
+
- Shows git operations
|
|
1629
|
+
- Shows GitHub issues to be closed
|
|
1630
|
+
|
|
1631
|
+
### Audit Logging
|
|
1632
|
+
|
|
1633
|
+
All deletions logged to `.specweave/logs/feature-deletions.log` (JSON Lines format):
|
|
1634
|
+
|
|
1635
|
+
```json
|
|
1636
|
+
{
|
|
1637
|
+
"featureId": "FS-042",
|
|
1638
|
+
"timestamp": "2025-11-24T01:45:00.000Z",
|
|
1639
|
+
"user": "john-doe",
|
|
1640
|
+
"mode": "safe",
|
|
1641
|
+
"filesDeleted": 6,
|
|
1642
|
+
"commitSha": "abc123def",
|
|
1643
|
+
"githubIssuesClosed": 3,
|
|
1644
|
+
"orphanedIncrements": [],
|
|
1645
|
+
"status": "success"
|
|
1646
|
+
}
|
|
1647
|
+
```
|
|
1648
|
+
|
|
1649
|
+
**Log rotation**: Automatically rotates at 10MB threshold.
|
|
1650
|
+
|
|
1651
|
+
### Error Handling
|
|
1652
|
+
|
|
1653
|
+
**Non-blocking errors** (logged as warnings):
|
|
1654
|
+
- GitHub API rate limits (exponential backoff retry)
|
|
1655
|
+
- GitHub issue cleanup failures
|
|
1656
|
+
- Audit log write failures
|
|
1657
|
+
|
|
1658
|
+
**Blocking errors** (prevent deletion):
|
|
1659
|
+
- Feature not found
|
|
1660
|
+
- Active increments in safe mode
|
|
1661
|
+
- Git working directory not clean (without `--no-git`)
|
|
1662
|
+
- Invalid feature ID format (must be FS-XXX)
|
|
1663
|
+
|
|
1664
|
+
### Examples
|
|
1665
|
+
|
|
1666
|
+
```bash
|
|
1667
|
+
# Recommended workflow
|
|
1668
|
+
specweave delete-feature FS-042 --dry-run # Preview
|
|
1669
|
+
specweave delete-feature FS-042 # Execute (with confirmation)
|
|
1670
|
+
|
|
1671
|
+
# Force delete feature with active increment 0050
|
|
1672
|
+
specweave delete-feature FS-042 --force # Requires typing "delete"
|
|
1673
|
+
|
|
1674
|
+
# Delete without git commit (manual git workflow)
|
|
1675
|
+
specweave delete-feature FS-042 --no-git
|
|
1676
|
+
|
|
1677
|
+
# Delete with auto-yes (CI/CD pipelines)
|
|
1678
|
+
specweave delete-feature FS-042 --yes --dry-run # Still shows preview
|
|
1679
|
+
```
|
|
1680
|
+
|
|
1681
|
+
### Important Notes
|
|
1682
|
+
|
|
1683
|
+
**GitHub Integration**:
|
|
1684
|
+
- Owner/repo auto-detected from `git remote get-url origin`
|
|
1685
|
+
- If no GitHub remote → GitHub cleanup silently skipped (non-blocking)
|
|
1686
|
+
- Pattern detection: `https://github.com/owner/repo.git` or `git@github.com:owner/repo.git`
|
|
1687
|
+
|
|
1688
|
+
**No Undo**:
|
|
1689
|
+
- Deletion is permanent (files deleted from filesystem)
|
|
1690
|
+
- Recovery: `git log --all --full-history -- path/to/deleted/file` → `git checkout <commit> -- path`
|
|
1691
|
+
- Audit log: `.specweave/logs/feature-deletions.log` (includes commit SHA)
|
|
1692
|
+
|
|
1693
|
+
**Force Mode Risk**:
|
|
1694
|
+
- Orphaned increments lose `feature_id` in metadata.json
|
|
1695
|
+
- Breaking change: `/specweave:sync-specs` won't sync orphaned increments
|
|
1696
|
+
- Recovery: Manually restore `feature_id` in metadata.json
|
|
1697
|
+
|
|
1698
|
+
**See**: Increment 0053-safe-feature-deletion for implementation details.
|
|
1699
|
+
|
|
1700
|
+
---
|
|
1701
|
+
|
|
986
1702
|
## Quick Reference
|
|
987
1703
|
|
|
988
1704
|
**Commands**: `/specweave:increment`, `/specweave:do`, `/specweave:done`, `/specweave:progress`, `/specweave:validate`, `/specweave:qa`
|