specweave 0.24.13 → 0.26.3
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 +586 -18
- 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.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.js +17 -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 +39 -49
- 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 +13 -46
- 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/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-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/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/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/sync-metadata.js +1 -1
- package/dist/src/sync/sync-metadata.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/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/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/post-increment-completion.sh +133 -0
- package/plugins/specweave/hooks/post-metadata-change.sh +28 -23
- package/plugins/specweave/hooks/post-task-completion.sh +7 -0
- package/plugins/specweave/hooks/pre-edit-write-consolidated.sh +44 -7
- package/plugins/specweave/hooks/shared/bulk-operation-detector.sh +167 -0
- package/plugins/specweave/lib/hooks/consolidated-sync.js +19 -2
- 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-multi-project-sync.js +0 -1
- 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/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 +13 -1
- package/plugins/specweave-github/lib/github-client-v2.ts +17 -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/enhanced-jira-sync.js +3 -3
- 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/agents/pm/AGENT.md.bak +0 -1893
- package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
- package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
- package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +0 -245
- package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +0 -149
- package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +0 -163
- package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
- package/plugins/specweave/hooks/post-first-increment.sh.bak +0 -61
- package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
- package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
- package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
- package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
- package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
- package/plugins/specweave/hooks/post-spec-update.sh.bak +0 -158
- package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
- package/plugins/specweave/hooks/post-user-story-complete.sh.bak +0 -179
- package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
- package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +0 -83
- package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
- package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
- package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
- package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
- package/plugins/specweave/hooks/user-prompt-submit.sh.bak +0 -386
- package/plugins/specweave/lib/hooks/auto-transition.js.bak +0 -50
- package/plugins/specweave/lib/hooks/auto-transition.ts.bak +0 -84
- package/plugins/specweave/lib/hooks/git-diff-analyzer.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.bak +0 -89
- package/plugins/specweave/lib/hooks/git-diff-analyzer.js.bak +0 -142
- package/plugins/specweave/lib/hooks/git-diff-analyzer.ts.bak +0 -269
- package/plugins/specweave/lib/hooks/invoke-translator-skill.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.bak +0 -60
- package/plugins/specweave/lib/hooks/invoke-translator-skill.js.bak +0 -155
- package/plugins/specweave/lib/hooks/invoke-translator-skill.ts.bak +0 -264
- package/plugins/specweave/lib/hooks/prepare-reflection-context.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.bak +0 -42
- package/plugins/specweave/lib/hooks/prepare-reflection-context.js.bak +0 -110
- package/plugins/specweave/lib/hooks/prepare-reflection-context.ts.bak +0 -178
- package/plugins/specweave/lib/hooks/reflection-config-loader.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.bak +0 -45
- package/plugins/specweave/lib/hooks/reflection-config-loader.js.bak +0 -92
- package/plugins/specweave/lib/hooks/reflection-config-loader.ts.bak +0 -156
- package/plugins/specweave/lib/hooks/reflection-parser.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/reflection-parser.d.ts.bak +0 -33
- package/plugins/specweave/lib/hooks/reflection-parser.js.bak +0 -301
- package/plugins/specweave/lib/hooks/reflection-parser.ts.bak +0 -484
- package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.bak +0 -56
- package/plugins/specweave/lib/hooks/reflection-prompt-builder.js.bak +0 -182
- package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts.bak +0 -306
- package/plugins/specweave/lib/hooks/reflection-storage.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/reflection-storage.d.ts.bak +0 -64
- package/plugins/specweave/lib/hooks/reflection-storage.js.bak +0 -231
- package/plugins/specweave/lib/hooks/reflection-storage.ts.bak +0 -369
- package/plugins/specweave/lib/hooks/run-self-reflection.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/run-self-reflection.d.ts.bak +0 -43
- package/plugins/specweave/lib/hooks/run-self-reflection.js.bak +0 -132
- package/plugins/specweave/lib/hooks/run-self-reflection.ts.bak +0 -258
- package/plugins/specweave/lib/hooks/sync-cache.js.bak +0 -294
- package/plugins/specweave/lib/hooks/sync-living-docs.d.js.bak +0 -1
- package/plugins/specweave/lib/hooks/sync-living-docs.d.ts.bak +0 -27
- package/plugins/specweave/lib/hooks/sync-living-docs.js.bak +0 -339
- package/plugins/specweave/lib/hooks/sync-us-tasks.js.bak +0 -476
- package/plugins/specweave/lib/hooks/translate-file.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/translate-file.d.ts.bak +0 -59
- package/plugins/specweave/lib/hooks/translate-file.js.bak +0 -289
- package/plugins/specweave/lib/hooks/translate-file.ts.bak +0 -428
- package/plugins/specweave/lib/hooks/translate-living-docs.d.js.bak +0 -0
- package/plugins/specweave/lib/hooks/translate-living-docs.d.ts.bak +0 -13
- package/plugins/specweave/lib/hooks/translate-living-docs.js.bak +0 -119
- package/plugins/specweave/lib/hooks/translate-living-docs.ts.bak +0 -224
- package/plugins/specweave/lib/hooks/update-ac-status.js.bak +0 -51
- package/plugins/specweave/lib/hooks/update-ac-status.ts.bak +0 -103
- package/plugins/specweave/lib/hooks/update-tasks-md.d.js.bak +0 -1
- package/plugins/specweave/lib/hooks/update-tasks-md.d.ts.bak +0 -29
- package/plugins/specweave/lib/hooks/update-tasks-md.js.bak +0 -296
- package/plugins/specweave/lib/hooks/update-tasks-md.ts.bak +0 -489
- package/plugins/specweave-ado/hooks/hooks.json +0 -15
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
- package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -718
- package/plugins/specweave-github/hooks/hooks.json +0 -15
- package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
- package/plugins/specweave-jira/hooks/hooks.json +0 -15
- package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -600
- package/plugins/specweave-release/hooks/hooks.json +0 -15
- package/plugins/specweave-release/hooks/post-task-completion.sh.backup +0 -110
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import fs from "fs-extra";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { IssueSeverity } from "./types/reflection-types";
|
|
4
|
-
function generateReflectionMarkdown(result) {
|
|
5
|
-
const sections = [];
|
|
6
|
-
sections.push(`# Self-Reflection: ${result.taskName}`);
|
|
7
|
-
sections.push("");
|
|
8
|
-
sections.push(`**Completed**: ${result.completed}`);
|
|
9
|
-
if (result.duration) {
|
|
10
|
-
sections.push(`**Duration**: ${result.duration}`);
|
|
11
|
-
}
|
|
12
|
-
sections.push(`**Files Modified**: ${result.filesModified.count} files, +${result.filesModified.linesAdded} -${result.filesModified.linesRemoved}`);
|
|
13
|
-
sections.push("");
|
|
14
|
-
sections.push("---");
|
|
15
|
-
sections.push("");
|
|
16
|
-
sections.push("## \u2705 What Was Accomplished");
|
|
17
|
-
sections.push("");
|
|
18
|
-
if (result.accomplishments.length > 0) {
|
|
19
|
-
for (const accomplishment of result.accomplishments) {
|
|
20
|
-
sections.push(`- ${accomplishment}`);
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
sections.push("(No accomplishments recorded)");
|
|
24
|
-
}
|
|
25
|
-
sections.push("");
|
|
26
|
-
sections.push("---");
|
|
27
|
-
sections.push("");
|
|
28
|
-
sections.push("## \u{1F3AF} Quality Assessment");
|
|
29
|
-
sections.push("");
|
|
30
|
-
sections.push("### \u2705 Strengths");
|
|
31
|
-
sections.push("");
|
|
32
|
-
if (result.strengths.length > 0) {
|
|
33
|
-
for (const strength of result.strengths) {
|
|
34
|
-
sections.push(`- \u2705 ${strength}`);
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
sections.push("(No strengths recorded)");
|
|
38
|
-
}
|
|
39
|
-
sections.push("");
|
|
40
|
-
sections.push("### \u26A0\uFE0F Issues Identified");
|
|
41
|
-
sections.push("");
|
|
42
|
-
if (result.issues.length === 0) {
|
|
43
|
-
sections.push("\u2705 No critical issues detected. Code follows best practices.");
|
|
44
|
-
} else {
|
|
45
|
-
const criticalIssues = result.issues.filter((i) => i.severity === IssueSeverity.CRITICAL);
|
|
46
|
-
const highIssues = result.issues.filter((i) => i.severity === IssueSeverity.HIGH);
|
|
47
|
-
const mediumIssues = result.issues.filter((i) => i.severity === IssueSeverity.MEDIUM);
|
|
48
|
-
const lowIssues = result.issues.filter((i) => i.severity === IssueSeverity.LOW);
|
|
49
|
-
const issueGroups = [
|
|
50
|
-
{ issues: criticalIssues, severity: IssueSeverity.CRITICAL },
|
|
51
|
-
{ issues: highIssues, severity: IssueSeverity.HIGH },
|
|
52
|
-
{ issues: mediumIssues, severity: IssueSeverity.MEDIUM },
|
|
53
|
-
{ issues: lowIssues, severity: IssueSeverity.LOW }
|
|
54
|
-
];
|
|
55
|
-
for (const group of issueGroups) {
|
|
56
|
-
if (group.issues.length === 0) continue;
|
|
57
|
-
for (const issue of group.issues) {
|
|
58
|
-
sections.push(`**${issue.severity} (${issue.category})**`);
|
|
59
|
-
sections.push(`- \u274C ${issue.description}`);
|
|
60
|
-
sections.push(` - **Impact**: ${issue.impact}`);
|
|
61
|
-
sections.push(` - **Recommendation**: ${issue.recommendation}`);
|
|
62
|
-
if (issue.location) {
|
|
63
|
-
const locationStr = issue.location.line ? `${issue.location.file}:${issue.location.line}` : issue.location.file;
|
|
64
|
-
sections.push(` - **Location**: \`${locationStr}\``);
|
|
65
|
-
if (issue.location.snippet) {
|
|
66
|
-
sections.push(" - **Code Snippet**:");
|
|
67
|
-
sections.push(" ```");
|
|
68
|
-
sections.push(` ${issue.location.snippet}`);
|
|
69
|
-
sections.push(" ```");
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
sections.push("");
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
sections.push("---");
|
|
77
|
-
sections.push("");
|
|
78
|
-
sections.push("## \u{1F527} Recommended Follow-Up Actions");
|
|
79
|
-
sections.push("");
|
|
80
|
-
const hasActions = result.recommendedActions.priority1.length > 0 || result.recommendedActions.priority2.length > 0 || result.recommendedActions.priority3.length > 0;
|
|
81
|
-
if (!hasActions) {
|
|
82
|
-
sections.push("\u2705 No follow-up actions required. Ready to proceed.");
|
|
83
|
-
} else {
|
|
84
|
-
if (result.recommendedActions.priority1.length > 0) {
|
|
85
|
-
sections.push("**Priority 1 (MUST FIX - before closing increment)**:");
|
|
86
|
-
for (let i = 0; i < result.recommendedActions.priority1.length; i++) {
|
|
87
|
-
sections.push(`${i + 1}. ${result.recommendedActions.priority1[i]}`);
|
|
88
|
-
}
|
|
89
|
-
sections.push("");
|
|
90
|
-
}
|
|
91
|
-
if (result.recommendedActions.priority2.length > 0) {
|
|
92
|
-
sections.push("**Priority 2 (SHOULD FIX - this increment)**:");
|
|
93
|
-
for (let i = 0; i < result.recommendedActions.priority2.length; i++) {
|
|
94
|
-
sections.push(`${i + 1}. ${result.recommendedActions.priority2[i]}`);
|
|
95
|
-
}
|
|
96
|
-
sections.push("");
|
|
97
|
-
}
|
|
98
|
-
if (result.recommendedActions.priority3.length > 0) {
|
|
99
|
-
sections.push("**Priority 3 (NICE TO HAVE - future increment)**:");
|
|
100
|
-
for (let i = 0; i < result.recommendedActions.priority3.length; i++) {
|
|
101
|
-
sections.push(`${i + 1}. ${result.recommendedActions.priority3[i]}`);
|
|
102
|
-
}
|
|
103
|
-
sections.push("");
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
sections.push("---");
|
|
107
|
-
sections.push("");
|
|
108
|
-
const hasLessons = result.lessonsLearned.whatWentWell.length > 0 || result.lessonsLearned.whatCouldImprove.length > 0 || result.lessonsLearned.forNextTime.length > 0;
|
|
109
|
-
if (hasLessons) {
|
|
110
|
-
sections.push("## \u{1F4DA} Lessons Learned");
|
|
111
|
-
sections.push("");
|
|
112
|
-
if (result.lessonsLearned.whatWentWell.length > 0) {
|
|
113
|
-
sections.push("**What went well**:");
|
|
114
|
-
for (const lesson of result.lessonsLearned.whatWentWell) {
|
|
115
|
-
sections.push(`- ${lesson}`);
|
|
116
|
-
}
|
|
117
|
-
sections.push("");
|
|
118
|
-
}
|
|
119
|
-
if (result.lessonsLearned.whatCouldImprove.length > 0) {
|
|
120
|
-
sections.push("**What could improve**:");
|
|
121
|
-
for (const lesson of result.lessonsLearned.whatCouldImprove) {
|
|
122
|
-
sections.push(`- ${lesson}`);
|
|
123
|
-
}
|
|
124
|
-
sections.push("");
|
|
125
|
-
}
|
|
126
|
-
if (result.lessonsLearned.forNextTime.length > 0) {
|
|
127
|
-
sections.push("**For next time**:");
|
|
128
|
-
for (const lesson of result.lessonsLearned.forNextTime) {
|
|
129
|
-
sections.push(`- ${lesson}`);
|
|
130
|
-
}
|
|
131
|
-
sections.push("");
|
|
132
|
-
}
|
|
133
|
-
sections.push("---");
|
|
134
|
-
sections.push("");
|
|
135
|
-
}
|
|
136
|
-
sections.push("## \u{1F4CA} Metrics");
|
|
137
|
-
sections.push("");
|
|
138
|
-
sections.push(`- **Code Quality**: ${result.metrics.codeQuality}/10`);
|
|
139
|
-
sections.push(`- **Security**: ${result.metrics.security}/10`);
|
|
140
|
-
if (result.metrics.testCoverage !== void 0) {
|
|
141
|
-
sections.push(`- **Test Coverage**: ${result.metrics.testCoverage}%`);
|
|
142
|
-
} else {
|
|
143
|
-
sections.push(`- **Test Coverage**: N/A`);
|
|
144
|
-
}
|
|
145
|
-
sections.push(`- **Technical Debt**: ${result.metrics.technicalDebt}`);
|
|
146
|
-
sections.push(`- **Performance**: ${result.metrics.performance.replace(/_/g, " ")}`);
|
|
147
|
-
sections.push("");
|
|
148
|
-
if (result.relatedTasks && result.relatedTasks.length > 0) {
|
|
149
|
-
sections.push("---");
|
|
150
|
-
sections.push("");
|
|
151
|
-
sections.push("## \u{1F517} Related Tasks");
|
|
152
|
-
sections.push("");
|
|
153
|
-
for (const task of result.relatedTasks) {
|
|
154
|
-
sections.push(`- ${task}`);
|
|
155
|
-
}
|
|
156
|
-
sections.push("");
|
|
157
|
-
}
|
|
158
|
-
sections.push("---");
|
|
159
|
-
sections.push("");
|
|
160
|
-
sections.push("**Auto-generated by**: SpecWeave Self-Reflection System");
|
|
161
|
-
sections.push(`**Model**: Claude 3.5 ${result.metadata.model.charAt(0).toUpperCase() + result.metadata.model.slice(1)}`);
|
|
162
|
-
sections.push(`**Reflection Time**: ${result.metadata.reflectionTime} seconds`);
|
|
163
|
-
sections.push(`**Estimated Cost**: ~$${result.metadata.estimatedCost.toFixed(3)}`);
|
|
164
|
-
sections.push("");
|
|
165
|
-
return sections.join("\n");
|
|
166
|
-
}
|
|
167
|
-
function getReflectionLogDir(incrementId, projectRoot) {
|
|
168
|
-
const rootDir = projectRoot || process.cwd();
|
|
169
|
-
return path.join(
|
|
170
|
-
rootDir,
|
|
171
|
-
".specweave",
|
|
172
|
-
"increments",
|
|
173
|
-
incrementId,
|
|
174
|
-
"logs",
|
|
175
|
-
"reflections"
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
function getReflectionFilename(taskId, timestamp) {
|
|
179
|
-
const date = timestamp || /* @__PURE__ */ new Date();
|
|
180
|
-
const dateStr = date.toISOString().split("T")[0];
|
|
181
|
-
const sanitizedTaskId = taskId.replace(/[^a-zA-Z0-9-]/g, "-");
|
|
182
|
-
return `task-${sanitizedTaskId}-reflection-${dateStr}.md`;
|
|
183
|
-
}
|
|
184
|
-
function saveReflection(result, incrementId, taskId, projectRoot) {
|
|
185
|
-
const logDir = getReflectionLogDir(incrementId, projectRoot);
|
|
186
|
-
fs.mkdirpSync(logDir);
|
|
187
|
-
const filename = getReflectionFilename(taskId);
|
|
188
|
-
const filepath = path.join(logDir, filename);
|
|
189
|
-
const markdown = generateReflectionMarkdown(result);
|
|
190
|
-
try {
|
|
191
|
-
fs.writeFileSync(filepath, markdown, "utf-8");
|
|
192
|
-
return filepath;
|
|
193
|
-
} catch (error) {
|
|
194
|
-
throw new Error(`Failed to save reflection: ${error.message}`);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
function listReflections(incrementId, projectRoot) {
|
|
198
|
-
const logDir = getReflectionLogDir(incrementId, projectRoot);
|
|
199
|
-
if (!fs.existsSync(logDir)) {
|
|
200
|
-
return [];
|
|
201
|
-
}
|
|
202
|
-
const files = fs.readdirSync(logDir).filter((file) => file.endsWith(".md")).map((file) => path.join(logDir, file)).sort((a, b) => {
|
|
203
|
-
const statA = fs.statSync(a);
|
|
204
|
-
const statB = fs.statSync(b);
|
|
205
|
-
return statB.mtime.getTime() - statA.mtime.getTime();
|
|
206
|
-
});
|
|
207
|
-
return files;
|
|
208
|
-
}
|
|
209
|
-
function readReflection(filepath) {
|
|
210
|
-
try {
|
|
211
|
-
return fs.readFileSync(filepath, "utf-8");
|
|
212
|
-
} catch (error) {
|
|
213
|
-
throw new Error(`Failed to read reflection: ${error.message}`);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function deleteReflection(filepath) {
|
|
217
|
-
try {
|
|
218
|
-
fs.removeSync(filepath);
|
|
219
|
-
} catch (error) {
|
|
220
|
-
throw new Error(`Failed to delete reflection: ${error.message}`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
export {
|
|
224
|
-
deleteReflection,
|
|
225
|
-
generateReflectionMarkdown,
|
|
226
|
-
getReflectionFilename,
|
|
227
|
-
getReflectionLogDir,
|
|
228
|
-
listReflections,
|
|
229
|
-
readReflection,
|
|
230
|
-
saveReflection
|
|
231
|
-
};
|
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reflection Storage Manager
|
|
3
|
-
*
|
|
4
|
-
* Writes reflection results to markdown files in increment logs
|
|
5
|
-
* Stores reflections in .specweave/increments/{id}/logs/reflections/
|
|
6
|
-
*
|
|
7
|
-
* @module reflection-storage
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import fs from 'fs-extra';
|
|
11
|
-
import path from 'path';
|
|
12
|
-
import { ReflectionResult, IssueSeverity } from './types/reflection-types';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Generate markdown content from reflection result
|
|
16
|
-
* Follows the exact format specified in reflective-reviewer agent
|
|
17
|
-
*
|
|
18
|
-
* @param result Reflection result object
|
|
19
|
-
* @returns Markdown-formatted reflection content
|
|
20
|
-
*/
|
|
21
|
-
export function generateReflectionMarkdown(result: ReflectionResult): string {
|
|
22
|
-
const sections: string[] = [];
|
|
23
|
-
|
|
24
|
-
// Header
|
|
25
|
-
sections.push(`# Self-Reflection: ${result.taskName}`);
|
|
26
|
-
sections.push('');
|
|
27
|
-
sections.push(`**Completed**: ${result.completed}`);
|
|
28
|
-
|
|
29
|
-
if (result.duration) {
|
|
30
|
-
sections.push(`**Duration**: ${result.duration}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
sections.push(`**Files Modified**: ${result.filesModified.count} files, +${result.filesModified.linesAdded} -${result.filesModified.linesRemoved}`);
|
|
34
|
-
sections.push('');
|
|
35
|
-
sections.push('---');
|
|
36
|
-
sections.push('');
|
|
37
|
-
|
|
38
|
-
// What Was Accomplished
|
|
39
|
-
sections.push('## ✅ What Was Accomplished');
|
|
40
|
-
sections.push('');
|
|
41
|
-
|
|
42
|
-
if (result.accomplishments.length > 0) {
|
|
43
|
-
for (const accomplishment of result.accomplishments) {
|
|
44
|
-
sections.push(`- ${accomplishment}`);
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
sections.push('(No accomplishments recorded)');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
sections.push('');
|
|
51
|
-
sections.push('---');
|
|
52
|
-
sections.push('');
|
|
53
|
-
|
|
54
|
-
// Quality Assessment
|
|
55
|
-
sections.push('## 🎯 Quality Assessment');
|
|
56
|
-
sections.push('');
|
|
57
|
-
|
|
58
|
-
// Strengths
|
|
59
|
-
sections.push('### ✅ Strengths');
|
|
60
|
-
sections.push('');
|
|
61
|
-
|
|
62
|
-
if (result.strengths.length > 0) {
|
|
63
|
-
for (const strength of result.strengths) {
|
|
64
|
-
sections.push(`- ✅ ${strength}`);
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
sections.push('(No strengths recorded)');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
sections.push('');
|
|
71
|
-
|
|
72
|
-
// Issues Identified
|
|
73
|
-
sections.push('### ⚠️ Issues Identified');
|
|
74
|
-
sections.push('');
|
|
75
|
-
|
|
76
|
-
if (result.issues.length === 0) {
|
|
77
|
-
sections.push('✅ No critical issues detected. Code follows best practices.');
|
|
78
|
-
} else {
|
|
79
|
-
// Group issues by severity
|
|
80
|
-
const criticalIssues = result.issues.filter(i => i.severity === IssueSeverity.CRITICAL);
|
|
81
|
-
const highIssues = result.issues.filter(i => i.severity === IssueSeverity.HIGH);
|
|
82
|
-
const mediumIssues = result.issues.filter(i => i.severity === IssueSeverity.MEDIUM);
|
|
83
|
-
const lowIssues = result.issues.filter(i => i.severity === IssueSeverity.LOW);
|
|
84
|
-
|
|
85
|
-
const issueGroups = [
|
|
86
|
-
{ issues: criticalIssues, severity: IssueSeverity.CRITICAL },
|
|
87
|
-
{ issues: highIssues, severity: IssueSeverity.HIGH },
|
|
88
|
-
{ issues: mediumIssues, severity: IssueSeverity.MEDIUM },
|
|
89
|
-
{ issues: lowIssues, severity: IssueSeverity.LOW }
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
for (const group of issueGroups) {
|
|
93
|
-
if (group.issues.length === 0) continue;
|
|
94
|
-
|
|
95
|
-
for (const issue of group.issues) {
|
|
96
|
-
sections.push(`**${issue.severity} (${issue.category})**`);
|
|
97
|
-
sections.push(`- ❌ ${issue.description}`);
|
|
98
|
-
sections.push(` - **Impact**: ${issue.impact}`);
|
|
99
|
-
sections.push(` - **Recommendation**: ${issue.recommendation}`);
|
|
100
|
-
|
|
101
|
-
if (issue.location) {
|
|
102
|
-
const locationStr = issue.location.line
|
|
103
|
-
? `${issue.location.file}:${issue.location.line}`
|
|
104
|
-
: issue.location.file;
|
|
105
|
-
sections.push(` - **Location**: \`${locationStr}\``);
|
|
106
|
-
|
|
107
|
-
if (issue.location.snippet) {
|
|
108
|
-
sections.push(' - **Code Snippet**:');
|
|
109
|
-
sections.push(' ```');
|
|
110
|
-
sections.push(` ${issue.location.snippet}`);
|
|
111
|
-
sections.push(' ```');
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
sections.push('');
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
sections.push('---');
|
|
121
|
-
sections.push('');
|
|
122
|
-
|
|
123
|
-
// Recommended Follow-Up Actions
|
|
124
|
-
sections.push('## 🔧 Recommended Follow-Up Actions');
|
|
125
|
-
sections.push('');
|
|
126
|
-
|
|
127
|
-
const hasActions =
|
|
128
|
-
result.recommendedActions.priority1.length > 0 ||
|
|
129
|
-
result.recommendedActions.priority2.length > 0 ||
|
|
130
|
-
result.recommendedActions.priority3.length > 0;
|
|
131
|
-
|
|
132
|
-
if (!hasActions) {
|
|
133
|
-
sections.push('✅ No follow-up actions required. Ready to proceed.');
|
|
134
|
-
} else {
|
|
135
|
-
if (result.recommendedActions.priority1.length > 0) {
|
|
136
|
-
sections.push('**Priority 1 (MUST FIX - before closing increment)**:');
|
|
137
|
-
for (let i = 0; i < result.recommendedActions.priority1.length; i++) {
|
|
138
|
-
sections.push(`${i + 1}. ${result.recommendedActions.priority1[i]}`);
|
|
139
|
-
}
|
|
140
|
-
sections.push('');
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (result.recommendedActions.priority2.length > 0) {
|
|
144
|
-
sections.push('**Priority 2 (SHOULD FIX - this increment)**:');
|
|
145
|
-
for (let i = 0; i < result.recommendedActions.priority2.length; i++) {
|
|
146
|
-
sections.push(`${i + 1}. ${result.recommendedActions.priority2[i]}`);
|
|
147
|
-
}
|
|
148
|
-
sections.push('');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (result.recommendedActions.priority3.length > 0) {
|
|
152
|
-
sections.push('**Priority 3 (NICE TO HAVE - future increment)**:');
|
|
153
|
-
for (let i = 0; i < result.recommendedActions.priority3.length; i++) {
|
|
154
|
-
sections.push(`${i + 1}. ${result.recommendedActions.priority3[i]}`);
|
|
155
|
-
}
|
|
156
|
-
sections.push('');
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
sections.push('---');
|
|
161
|
-
sections.push('');
|
|
162
|
-
|
|
163
|
-
// Lessons Learned (optional - may be empty for QUICK depth)
|
|
164
|
-
const hasLessons =
|
|
165
|
-
result.lessonsLearned.whatWentWell.length > 0 ||
|
|
166
|
-
result.lessonsLearned.whatCouldImprove.length > 0 ||
|
|
167
|
-
result.lessonsLearned.forNextTime.length > 0;
|
|
168
|
-
|
|
169
|
-
if (hasLessons) {
|
|
170
|
-
sections.push('## 📚 Lessons Learned');
|
|
171
|
-
sections.push('');
|
|
172
|
-
|
|
173
|
-
if (result.lessonsLearned.whatWentWell.length > 0) {
|
|
174
|
-
sections.push('**What went well**:');
|
|
175
|
-
for (const lesson of result.lessonsLearned.whatWentWell) {
|
|
176
|
-
sections.push(`- ${lesson}`);
|
|
177
|
-
}
|
|
178
|
-
sections.push('');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (result.lessonsLearned.whatCouldImprove.length > 0) {
|
|
182
|
-
sections.push('**What could improve**:');
|
|
183
|
-
for (const lesson of result.lessonsLearned.whatCouldImprove) {
|
|
184
|
-
sections.push(`- ${lesson}`);
|
|
185
|
-
}
|
|
186
|
-
sections.push('');
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (result.lessonsLearned.forNextTime.length > 0) {
|
|
190
|
-
sections.push('**For next time**:');
|
|
191
|
-
for (const lesson of result.lessonsLearned.forNextTime) {
|
|
192
|
-
sections.push(`- ${lesson}`);
|
|
193
|
-
}
|
|
194
|
-
sections.push('');
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
sections.push('---');
|
|
198
|
-
sections.push('');
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Metrics
|
|
202
|
-
sections.push('## 📊 Metrics');
|
|
203
|
-
sections.push('');
|
|
204
|
-
sections.push(`- **Code Quality**: ${result.metrics.codeQuality}/10`);
|
|
205
|
-
sections.push(`- **Security**: ${result.metrics.security}/10`);
|
|
206
|
-
|
|
207
|
-
if (result.metrics.testCoverage !== undefined) {
|
|
208
|
-
sections.push(`- **Test Coverage**: ${result.metrics.testCoverage}%`);
|
|
209
|
-
} else {
|
|
210
|
-
sections.push(`- **Test Coverage**: N/A`);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
sections.push(`- **Technical Debt**: ${result.metrics.technicalDebt}`);
|
|
214
|
-
sections.push(`- **Performance**: ${result.metrics.performance.replace(/_/g, ' ')}`);
|
|
215
|
-
sections.push('');
|
|
216
|
-
|
|
217
|
-
// Related Tasks (optional)
|
|
218
|
-
if (result.relatedTasks && result.relatedTasks.length > 0) {
|
|
219
|
-
sections.push('---');
|
|
220
|
-
sections.push('');
|
|
221
|
-
sections.push('## 🔗 Related Tasks');
|
|
222
|
-
sections.push('');
|
|
223
|
-
for (const task of result.relatedTasks) {
|
|
224
|
-
sections.push(`- ${task}`);
|
|
225
|
-
}
|
|
226
|
-
sections.push('');
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// Footer
|
|
230
|
-
sections.push('---');
|
|
231
|
-
sections.push('');
|
|
232
|
-
sections.push('**Auto-generated by**: SpecWeave Self-Reflection System');
|
|
233
|
-
sections.push(`**Model**: Claude 3.5 ${result.metadata.model.charAt(0).toUpperCase() + result.metadata.model.slice(1)}`);
|
|
234
|
-
sections.push(`**Reflection Time**: ${result.metadata.reflectionTime} seconds`);
|
|
235
|
-
sections.push(`**Estimated Cost**: ~$${result.metadata.estimatedCost.toFixed(3)}`);
|
|
236
|
-
sections.push('');
|
|
237
|
-
|
|
238
|
-
return sections.join('\n');
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Get reflection log directory for an increment
|
|
243
|
-
* @param incrementId Increment identifier (e.g., "0016-self-reflection-system")
|
|
244
|
-
* @param projectRoot Project root directory (optional, auto-detected if not provided)
|
|
245
|
-
* @returns Path to reflection logs directory
|
|
246
|
-
*/
|
|
247
|
-
export function getReflectionLogDir(
|
|
248
|
-
incrementId: string,
|
|
249
|
-
projectRoot?: string
|
|
250
|
-
): string {
|
|
251
|
-
const rootDir = projectRoot || process.cwd();
|
|
252
|
-
return path.join(
|
|
253
|
-
rootDir,
|
|
254
|
-
'.specweave',
|
|
255
|
-
'increments',
|
|
256
|
-
incrementId,
|
|
257
|
-
'logs',
|
|
258
|
-
'reflections'
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Generate filename for reflection log
|
|
264
|
-
* @param taskId Task identifier (e.g., "T-005")
|
|
265
|
-
* @param timestamp Optional timestamp (defaults to current date)
|
|
266
|
-
* @returns Filename (e.g., "task-T-005-reflection-2025-11-10.md")
|
|
267
|
-
*/
|
|
268
|
-
export function getReflectionFilename(
|
|
269
|
-
taskId: string,
|
|
270
|
-
timestamp?: Date
|
|
271
|
-
): string {
|
|
272
|
-
const date = timestamp || new Date();
|
|
273
|
-
const dateStr = date.toISOString().split('T')[0]; // YYYY-MM-DD
|
|
274
|
-
const sanitizedTaskId = taskId.replace(/[^a-zA-Z0-9-]/g, '-');
|
|
275
|
-
return `task-${sanitizedTaskId}-reflection-${dateStr}.md`;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Save reflection result to markdown file
|
|
280
|
-
* Creates directory structure if it doesn't exist
|
|
281
|
-
*
|
|
282
|
-
* @param result Reflection result to save
|
|
283
|
-
* @param incrementId Increment identifier
|
|
284
|
-
* @param taskId Task identifier
|
|
285
|
-
* @param projectRoot Project root directory (optional)
|
|
286
|
-
* @returns Path to saved reflection file
|
|
287
|
-
* @throws Error if file cannot be written
|
|
288
|
-
*/
|
|
289
|
-
export function saveReflection(
|
|
290
|
-
result: ReflectionResult,
|
|
291
|
-
incrementId: string,
|
|
292
|
-
taskId: string,
|
|
293
|
-
projectRoot?: string
|
|
294
|
-
): string {
|
|
295
|
-
// Ensure reflection logs directory exists
|
|
296
|
-
const logDir = getReflectionLogDir(incrementId, projectRoot);
|
|
297
|
-
fs.mkdirpSync(logDir);
|
|
298
|
-
|
|
299
|
-
// Generate filename
|
|
300
|
-
const filename = getReflectionFilename(taskId);
|
|
301
|
-
const filepath = path.join(logDir, filename);
|
|
302
|
-
|
|
303
|
-
// Generate markdown content
|
|
304
|
-
const markdown = generateReflectionMarkdown(result);
|
|
305
|
-
|
|
306
|
-
// Write to file
|
|
307
|
-
try {
|
|
308
|
-
fs.writeFileSync(filepath, markdown, 'utf-8');
|
|
309
|
-
return filepath;
|
|
310
|
-
} catch (error: any) {
|
|
311
|
-
throw new Error(`Failed to save reflection: ${error.message}`);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* List all reflection files for an increment
|
|
317
|
-
* @param incrementId Increment identifier
|
|
318
|
-
* @param projectRoot Project root directory (optional)
|
|
319
|
-
* @returns Array of reflection file paths (sorted by date, newest first)
|
|
320
|
-
*/
|
|
321
|
-
export function listReflections(
|
|
322
|
-
incrementId: string,
|
|
323
|
-
projectRoot?: string
|
|
324
|
-
): string[] {
|
|
325
|
-
const logDir = getReflectionLogDir(incrementId, projectRoot);
|
|
326
|
-
|
|
327
|
-
if (!fs.existsSync(logDir)) {
|
|
328
|
-
return [];
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const files = fs.readdirSync(logDir)
|
|
332
|
-
.filter(file => file.endsWith('.md'))
|
|
333
|
-
.map(file => path.join(logDir, file))
|
|
334
|
-
.sort((a, b) => {
|
|
335
|
-
// Sort by modification time (newest first)
|
|
336
|
-
const statA = fs.statSync(a);
|
|
337
|
-
const statB = fs.statSync(b);
|
|
338
|
-
return statB.mtime.getTime() - statA.mtime.getTime();
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
return files;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Read reflection from file
|
|
346
|
-
* @param filepath Path to reflection markdown file
|
|
347
|
-
* @returns Markdown content as string
|
|
348
|
-
* @throws Error if file cannot be read
|
|
349
|
-
*/
|
|
350
|
-
export function readReflection(filepath: string): string {
|
|
351
|
-
try {
|
|
352
|
-
return fs.readFileSync(filepath, 'utf-8');
|
|
353
|
-
} catch (error: any) {
|
|
354
|
-
throw new Error(`Failed to read reflection: ${error.message}`);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Delete reflection file
|
|
360
|
-
* @param filepath Path to reflection markdown file
|
|
361
|
-
* @throws Error if file cannot be deleted
|
|
362
|
-
*/
|
|
363
|
-
export function deleteReflection(filepath: string): void {
|
|
364
|
-
try {
|
|
365
|
-
fs.removeSync(filepath);
|
|
366
|
-
} catch (error: any) {
|
|
367
|
-
throw new Error(`Failed to delete reflection: ${error.message}`);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
File without changes
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core Reflection Engine
|
|
3
|
-
*
|
|
4
|
-
* Orchestrates the self-reflection process:
|
|
5
|
-
* 1. Load configuration
|
|
6
|
-
* 2. Get modified files
|
|
7
|
-
* 3. Build prompt
|
|
8
|
-
* 4. Invoke reflective-reviewer agent
|
|
9
|
-
* 5. Parse response
|
|
10
|
-
* 6. Store reflection
|
|
11
|
-
*
|
|
12
|
-
* @module run-self-reflection
|
|
13
|
-
*/
|
|
14
|
-
import { ReflectionContext, ReflectionExecutionResult } from './types/reflection-types';
|
|
15
|
-
/**
|
|
16
|
-
* Run self-reflection analysis
|
|
17
|
-
* Main entry point for the reflection system
|
|
18
|
-
*
|
|
19
|
-
* @param context Reflection context with increment, task, and files
|
|
20
|
-
* @returns Reflection execution result (success or error)
|
|
21
|
-
*/
|
|
22
|
-
export declare function runSelfReflection(context: ReflectionContext): Promise<ReflectionExecutionResult>;
|
|
23
|
-
/**
|
|
24
|
-
* Create reflection context from hook environment
|
|
25
|
-
* Helper function for hook integration
|
|
26
|
-
*
|
|
27
|
-
* @param incrementId Increment identifier
|
|
28
|
-
* @param taskId Task identifier
|
|
29
|
-
* @param projectRoot Project root directory (optional, auto-detected)
|
|
30
|
-
* @returns Reflection context ready for runSelfReflection
|
|
31
|
-
*/
|
|
32
|
-
export declare function createReflectionContext(incrementId: string, taskId: string, projectRoot?: string): ReflectionContext;
|
|
33
|
-
/**
|
|
34
|
-
* Run reflection with automatic context creation
|
|
35
|
-
* Convenience function for hook integration
|
|
36
|
-
*
|
|
37
|
-
* @param incrementId Increment identifier
|
|
38
|
-
* @param taskId Task identifier
|
|
39
|
-
* @param projectRoot Project root directory (optional)
|
|
40
|
-
* @returns Reflection execution result
|
|
41
|
-
*/
|
|
42
|
-
export declare function runReflectionAuto(incrementId: string, taskId: string, projectRoot?: string): Promise<ReflectionExecutionResult>;
|
|
43
|
-
//# sourceMappingURL=run-self-reflection.d.ts.map
|