specweave 0.11.0 ā 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/CLAUDE.md +131 -144
- package/README.md +48 -21
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +21 -70
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/hooks/lib/git-diff-analyzer.d.ts +89 -0
- package/dist/hooks/lib/git-diff-analyzer.d.ts.map +1 -0
- package/dist/hooks/lib/git-diff-analyzer.js +226 -0
- package/dist/hooks/lib/git-diff-analyzer.js.map +1 -0
- package/dist/hooks/lib/prepare-reflection-context.d.ts +42 -0
- package/dist/hooks/lib/prepare-reflection-context.d.ts.map +1 -0
- package/dist/hooks/lib/prepare-reflection-context.js +123 -0
- package/dist/hooks/lib/prepare-reflection-context.js.map +1 -0
- package/dist/hooks/lib/reflection-config-loader.d.ts +45 -0
- package/dist/hooks/lib/reflection-config-loader.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-config-loader.js +132 -0
- package/dist/hooks/lib/reflection-config-loader.js.map +1 -0
- package/dist/hooks/lib/reflection-parser.d.ts +33 -0
- package/dist/hooks/lib/reflection-parser.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-parser.js +419 -0
- package/dist/hooks/lib/reflection-parser.js.map +1 -0
- package/dist/hooks/lib/reflection-prompt-builder.d.ts +56 -0
- package/dist/hooks/lib/reflection-prompt-builder.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-prompt-builder.js +239 -0
- package/dist/hooks/lib/reflection-prompt-builder.js.map +1 -0
- package/dist/hooks/lib/reflection-storage.d.ts +64 -0
- package/dist/hooks/lib/reflection-storage.d.ts.map +1 -0
- package/dist/hooks/lib/reflection-storage.js +305 -0
- package/dist/hooks/lib/reflection-storage.js.map +1 -0
- package/dist/hooks/lib/run-self-reflection.d.ts +43 -0
- package/dist/hooks/lib/run-self-reflection.d.ts.map +1 -0
- package/dist/hooks/lib/run-self-reflection.js +203 -0
- package/dist/hooks/lib/run-self-reflection.js.map +1 -0
- package/dist/hooks/lib/types/reflection-types.d.ts +164 -0
- package/dist/hooks/lib/types/reflection-types.d.ts.map +1 -0
- package/dist/hooks/lib/types/reflection-types.js +73 -0
- package/dist/hooks/lib/types/reflection-types.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts +89 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js +226 -0
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts +60 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js +201 -0
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts +42 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js +123 -0
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts +45 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js +132 -0
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts +33 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js +419 -0
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts +56 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js +239 -0
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts +64 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js +305 -0
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts +43 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js +203 -0
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +27 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +116 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts +59 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.js +350 -0
- package/dist/plugins/specweave/lib/hooks/translate-file.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts +13 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js +175 -0
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts +164 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js +73 -0
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js.map +1 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts +29 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js +203 -0
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts +94 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.js +219 -0
- package/dist/plugins/specweave-ado/lib/ado-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.d.ts +124 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.js +382 -0
- package/dist/plugins/specweave-ado/lib/ado-client-v2.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client.d.ts +112 -0
- package/dist/plugins/specweave-ado/lib/ado-client.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-client.js +257 -0
- package/dist/plugins/specweave-ado/lib/ado-client.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.d.ts +40 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.js +370 -0
- package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/project-selector.d.ts +42 -0
- package/dist/plugins/specweave-ado/lib/project-selector.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/project-selector.js +211 -0
- package/dist/plugins/specweave-ado/lib/project-selector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.d.ts +54 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.js +122 -0
- package/dist/plugins/specweave-github/lib/github-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +104 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js +408 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +10 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client.js +24 -0
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.d.ts +29 -0
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.js +268 -0
- package/dist/plugins/specweave-github/lib/github-hierarchical-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/index.js.map +1 -1
- package/dist/plugins/specweave-github/lib/repo-selector.d.ts +49 -0
- package/dist/plugins/specweave-github/lib/repo-selector.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/repo-selector.js +216 -0
- package/dist/plugins/specweave-github/lib/repo-selector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/subtask-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-parser.js.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/types.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts +50 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.js +84 -0
- package/dist/plugins/specweave-jira/lib/jira-board-resolver.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.d.ts +33 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.js +206 -0
- package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/project-selector.d.ts +42 -0
- package/dist/plugins/specweave-jira/lib/project-selector.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/project-selector.js +216 -0
- package/dist/plugins/specweave-jira/lib/project-selector.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.d.ts +67 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.js +252 -0
- package/dist/plugins/specweave-jira/lib/reorganization-detector.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts +29 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.js +219 -0
- package/dist/plugins/specweave-jira/lib/setup-wizard.js.map +1 -0
- package/dist/src/adapters/adapter-base.d.ts +71 -0
- package/dist/src/adapters/adapter-base.d.ts.map +1 -0
- package/dist/src/adapters/adapter-base.js +139 -0
- package/dist/src/adapters/adapter-base.js.map +1 -0
- package/dist/src/adapters/adapter-interface.d.ts +149 -0
- package/dist/src/adapters/adapter-interface.d.ts.map +1 -0
- package/dist/src/adapters/adapter-interface.js +8 -0
- package/dist/src/adapters/adapter-interface.js.map +1 -0
- package/dist/src/adapters/adapter-loader.d.ts +91 -0
- package/dist/src/adapters/adapter-loader.d.ts.map +1 -0
- package/dist/src/adapters/adapter-loader.js +238 -0
- package/dist/src/adapters/adapter-loader.js.map +1 -0
- package/dist/src/adapters/agents-md-generator.d.ts +48 -0
- package/dist/src/adapters/agents-md-generator.d.ts.map +1 -0
- package/dist/src/adapters/agents-md-generator.js +193 -0
- package/dist/src/adapters/agents-md-generator.js.map +1 -0
- package/dist/src/adapters/claude/adapter.d.ts +128 -0
- package/dist/src/adapters/claude/adapter.d.ts.map +1 -0
- package/dist/src/adapters/claude/adapter.js +415 -0
- package/dist/src/adapters/claude/adapter.js.map +1 -0
- package/dist/src/adapters/claude-md-generator.d.ts +78 -0
- package/dist/src/adapters/claude-md-generator.d.ts.map +1 -0
- package/dist/src/adapters/claude-md-generator.js +307 -0
- package/dist/src/adapters/claude-md-generator.js.map +1 -0
- package/dist/src/adapters/codex/adapter.d.ts +50 -0
- package/dist/src/adapters/codex/adapter.d.ts.map +1 -0
- package/dist/src/adapters/codex/adapter.js +316 -0
- package/dist/src/adapters/codex/adapter.js.map +1 -0
- package/dist/src/adapters/cursor/adapter.d.ts +98 -0
- package/dist/src/adapters/cursor/adapter.d.ts.map +1 -0
- package/dist/src/adapters/cursor/adapter.js +406 -0
- package/dist/src/adapters/cursor/adapter.js.map +1 -0
- package/dist/src/adapters/doc-generator.d.ts +69 -0
- package/dist/src/adapters/doc-generator.d.ts.map +1 -0
- package/dist/src/adapters/doc-generator.js +247 -0
- package/dist/src/adapters/doc-generator.js.map +1 -0
- package/dist/src/adapters/gemini/adapter.d.ts +50 -0
- package/dist/src/adapters/gemini/adapter.d.ts.map +1 -0
- package/dist/src/adapters/gemini/adapter.js +281 -0
- package/dist/src/adapters/gemini/adapter.js.map +1 -0
- package/dist/src/adapters/generic/adapter.d.ts +86 -0
- package/dist/src/adapters/generic/adapter.d.ts.map +1 -0
- package/dist/src/adapters/generic/adapter.js +338 -0
- package/dist/src/adapters/generic/adapter.js.map +1 -0
- package/dist/src/cli/commands/abandon.d.ts +13 -0
- package/dist/src/cli/commands/abandon.d.ts.map +1 -0
- package/dist/src/cli/commands/abandon.js +15 -0
- package/dist/src/cli/commands/abandon.js.map +1 -0
- package/dist/src/cli/commands/import-docs.d.ts +21 -0
- package/dist/src/cli/commands/import-docs.d.ts.map +1 -0
- package/dist/src/cli/commands/import-docs.js +146 -0
- package/dist/src/cli/commands/import-docs.js.map +1 -0
- package/dist/src/cli/commands/init-multiproject.d.ts +11 -0
- package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -0
- package/dist/src/cli/commands/init-multiproject.js +202 -0
- package/dist/src/cli/commands/init-multiproject.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +9 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -0
- package/dist/src/cli/commands/init.js +1205 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/install.d.ts +9 -0
- package/dist/src/cli/commands/install.d.ts.map +1 -0
- package/dist/src/cli/commands/install.js +127 -0
- package/dist/src/cli/commands/install.js.map +1 -0
- package/dist/src/cli/commands/list.d.ts +8 -0
- package/dist/src/cli/commands/list.d.ts.map +1 -0
- package/dist/src/cli/commands/list.js +119 -0
- package/dist/src/cli/commands/list.js.map +1 -0
- package/dist/src/cli/commands/migrate-to-multiproject.d.ts +37 -0
- package/dist/src/cli/commands/migrate-to-multiproject.d.ts.map +1 -0
- package/dist/src/cli/commands/migrate-to-multiproject.js +189 -0
- package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -0
- package/dist/src/cli/commands/migrate-to-profiles.d.ts +25 -0
- package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -0
- package/dist/src/cli/commands/migrate-to-profiles.js +350 -0
- package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -0
- package/dist/src/cli/commands/pause.d.ts +13 -0
- package/dist/src/cli/commands/pause.d.ts.map +1 -0
- package/dist/src/cli/commands/pause.js +15 -0
- package/dist/src/cli/commands/pause.js.map +1 -0
- package/dist/src/cli/commands/qa.d.ts +54 -0
- package/dist/src/cli/commands/qa.d.ts.map +1 -0
- package/dist/src/cli/commands/qa.js +98 -0
- package/dist/src/cli/commands/qa.js.map +1 -0
- package/dist/src/cli/commands/resume.d.ts +12 -0
- package/dist/src/cli/commands/resume.d.ts.map +1 -0
- package/dist/src/cli/commands/resume.js +14 -0
- package/dist/src/cli/commands/resume.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +12 -0
- package/dist/src/cli/commands/status.d.ts.map +1 -0
- package/dist/src/cli/commands/status.js +23 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/switch-project.d.ts +13 -0
- package/dist/src/cli/commands/switch-project.d.ts.map +1 -0
- package/dist/src/cli/commands/switch-project.js +91 -0
- package/dist/src/cli/commands/switch-project.js.map +1 -0
- package/dist/src/cli/commands/validate-jira.d.ts +35 -0
- package/dist/src/cli/commands/validate-jira.d.ts.map +1 -0
- package/dist/src/cli/commands/validate-jira.js +112 -0
- package/dist/src/cli/commands/validate-jira.js.map +1 -0
- package/dist/src/cli/commands/validate-plugins.d.ts +41 -0
- package/dist/src/cli/commands/validate-plugins.d.ts.map +1 -0
- package/dist/src/cli/commands/validate-plugins.js +171 -0
- package/dist/src/cli/commands/validate-plugins.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +57 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js +243 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/github.d.ts +65 -0
- package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/github.js +426 -0
- package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts +22 -0
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/index.js +314 -0
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts +61 -0
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/jira.js +404 -0
- package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/types.d.ts +107 -0
- package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/types.js +16 -0
- package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/utils.d.ts +112 -0
- package/dist/src/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/utils.js +247 -0
- package/dist/src/cli/helpers/issue-tracker/utils.js.map +1 -0
- package/dist/src/core/agent-model-manager.d.ts +52 -0
- package/dist/src/core/agent-model-manager.d.ts.map +1 -0
- package/dist/src/core/agent-model-manager.js +120 -0
- package/dist/src/core/agent-model-manager.js.map +1 -0
- package/dist/src/core/brownfield/analyzer.d.ts +86 -0
- package/dist/src/core/brownfield/analyzer.d.ts.map +1 -0
- package/dist/src/core/brownfield/analyzer.js +365 -0
- package/dist/src/core/brownfield/analyzer.js.map +1 -0
- package/dist/src/core/brownfield/importer.d.ts +76 -0
- package/dist/src/core/brownfield/importer.d.ts.map +1 -0
- package/dist/src/core/brownfield/importer.js +287 -0
- package/dist/src/core/brownfield/importer.js.map +1 -0
- package/dist/src/core/config-manager.d.ts +47 -0
- package/dist/src/core/config-manager.d.ts.map +1 -0
- package/dist/src/core/config-manager.js +136 -0
- package/dist/src/core/config-manager.js.map +1 -0
- package/dist/src/core/cost-tracker.d.ts +108 -0
- package/dist/src/core/cost-tracker.d.ts.map +1 -0
- package/dist/src/core/cost-tracker.js +281 -0
- package/dist/src/core/cost-tracker.js.map +1 -0
- package/dist/src/core/credentials-manager.d.ts +107 -0
- package/dist/src/core/credentials-manager.d.ts.map +1 -0
- package/dist/src/core/credentials-manager.js +457 -0
- package/dist/src/core/credentials-manager.js.map +1 -0
- package/dist/src/core/i18n/language-detector.d.ts +29 -0
- package/dist/src/core/i18n/language-detector.d.ts.map +1 -0
- package/dist/src/core/i18n/language-detector.js +143 -0
- package/dist/src/core/i18n/language-detector.js.map +1 -0
- package/dist/src/core/i18n/language-manager.d.ts +101 -0
- package/dist/src/core/i18n/language-manager.d.ts.map +1 -0
- package/dist/src/core/i18n/language-manager.js +232 -0
- package/dist/src/core/i18n/language-manager.js.map +1 -0
- package/dist/src/core/i18n/language-registry.d.ts +44 -0
- package/dist/src/core/i18n/language-registry.d.ts.map +1 -0
- package/dist/src/core/i18n/language-registry.js +234 -0
- package/dist/src/core/i18n/language-registry.js.map +1 -0
- package/dist/src/core/i18n/locale-manager.d.ts +62 -0
- package/dist/src/core/i18n/locale-manager.d.ts.map +1 -0
- package/dist/src/core/i18n/locale-manager.js +137 -0
- package/dist/src/core/i18n/locale-manager.js.map +1 -0
- package/dist/src/core/i18n/system-prompt-injector.d.ts +33 -0
- package/dist/src/core/i18n/system-prompt-injector.d.ts.map +1 -0
- package/dist/src/core/i18n/system-prompt-injector.js +131 -0
- package/dist/src/core/i18n/system-prompt-injector.js.map +1 -0
- package/dist/src/core/i18n/types.d.ts +151 -0
- package/dist/src/core/i18n/types.d.ts.map +1 -0
- package/dist/src/core/i18n/types.js +11 -0
- package/dist/src/core/i18n/types.js.map +1 -0
- package/dist/src/core/increment/limits.d.ts +68 -0
- package/dist/src/core/increment/limits.d.ts.map +1 -0
- package/dist/src/core/increment/limits.js +224 -0
- package/dist/src/core/increment/limits.js.map +1 -0
- package/dist/src/core/increment/metadata-manager.d.ts +114 -0
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -0
- package/dist/src/core/increment/metadata-manager.js +320 -0
- package/dist/src/core/increment/metadata-manager.js.map +1 -0
- package/dist/src/core/increment/status-commands.d.ts +43 -0
- package/dist/src/core/increment/status-commands.d.ts.map +1 -0
- package/dist/src/core/increment/status-commands.js +277 -0
- package/dist/src/core/increment/status-commands.js.map +1 -0
- package/dist/src/core/increment-status.d.ts +72 -0
- package/dist/src/core/increment-status.d.ts.map +1 -0
- package/dist/src/core/increment-status.js +227 -0
- package/dist/src/core/increment-status.js.map +1 -0
- package/dist/src/core/model-selector.d.ts +57 -0
- package/dist/src/core/model-selector.d.ts.map +1 -0
- package/dist/src/core/model-selector.js +115 -0
- package/dist/src/core/model-selector.js.map +1 -0
- package/dist/src/core/phase-detector.d.ts +62 -0
- package/dist/src/core/phase-detector.d.ts.map +1 -0
- package/dist/src/core/phase-detector.js +229 -0
- package/dist/src/core/phase-detector.js.map +1 -0
- package/dist/src/core/plugin-loader.d.ts +131 -0
- package/dist/src/core/plugin-loader.d.ts.map +1 -0
- package/dist/src/core/plugin-loader.js +421 -0
- package/dist/src/core/plugin-loader.js.map +1 -0
- package/dist/src/core/project-manager.d.ts +127 -0
- package/dist/src/core/project-manager.d.ts.map +1 -0
- package/dist/src/core/project-manager.js +524 -0
- package/dist/src/core/project-manager.js.map +1 -0
- package/dist/src/core/project-structure-detector.d.ts +92 -0
- package/dist/src/core/project-structure-detector.d.ts.map +1 -0
- package/dist/src/core/project-structure-detector.js +289 -0
- package/dist/src/core/project-structure-detector.js.map +1 -0
- package/dist/src/core/qa/qa-runner.d.ts +16 -0
- package/dist/src/core/qa/qa-runner.d.ts.map +1 -0
- package/dist/src/core/qa/qa-runner.js +404 -0
- package/dist/src/core/qa/qa-runner.js.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts +53 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.js +268 -0
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -0
- package/dist/src/core/qa/risk-calculator.d.ts +126 -0
- package/dist/src/core/qa/risk-calculator.d.ts.map +1 -0
- package/dist/src/core/qa/risk-calculator.js +247 -0
- package/dist/src/core/qa/risk-calculator.js.map +1 -0
- package/dist/src/core/qa/types.d.ts +315 -0
- package/dist/src/core/qa/types.d.ts.map +1 -0
- package/dist/src/core/qa/types.js +8 -0
- package/dist/src/core/qa/types.js.map +1 -0
- package/dist/src/core/rfc-generator-v2.d.ts +149 -0
- package/dist/src/core/rfc-generator-v2.d.ts.map +1 -0
- package/dist/src/core/rfc-generator-v2.js +399 -0
- package/dist/src/core/rfc-generator-v2.js.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts +110 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.js +356 -0
- package/dist/src/core/sync/bidirectional-engine.js.map +1 -0
- package/dist/src/core/sync/folder-mapper.d.ts +71 -0
- package/dist/src/core/sync/folder-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/folder-mapper.js +168 -0
- package/dist/src/core/sync/folder-mapper.js.map +1 -0
- package/dist/src/core/sync/profile-manager.d.ts +72 -0
- package/dist/src/core/sync/profile-manager.d.ts.map +1 -0
- package/dist/src/core/sync/profile-manager.js +338 -0
- package/dist/src/core/sync/profile-manager.js.map +1 -0
- package/dist/src/core/sync/profile-selector.d.ts +52 -0
- package/dist/src/core/sync/profile-selector.d.ts.map +1 -0
- package/dist/src/core/sync/profile-selector.js +179 -0
- package/dist/src/core/sync/profile-selector.js.map +1 -0
- package/dist/src/core/sync/profile-validator.d.ts +52 -0
- package/dist/src/core/sync/profile-validator.d.ts.map +1 -0
- package/dist/src/core/sync/profile-validator.js +225 -0
- package/dist/src/core/sync/profile-validator.js.map +1 -0
- package/dist/src/core/sync/project-context.d.ts +81 -0
- package/dist/src/core/sync/project-context.d.ts.map +1 -0
- package/dist/src/core/sync/project-context.js +354 -0
- package/dist/src/core/sync/project-context.js.map +1 -0
- package/dist/src/core/sync/rate-limiter.d.ts +116 -0
- package/dist/src/core/sync/rate-limiter.d.ts.map +1 -0
- package/dist/src/core/sync/rate-limiter.js +308 -0
- package/dist/src/core/sync/rate-limiter.js.map +1 -0
- package/dist/src/core/sync/time-range-selector.d.ts +48 -0
- package/dist/src/core/sync/time-range-selector.d.ts.map +1 -0
- package/dist/src/core/sync/time-range-selector.js +224 -0
- package/dist/src/core/sync/time-range-selector.js.map +1 -0
- package/dist/src/core/types/config.d.ts +90 -0
- package/dist/src/core/types/config.d.ts.map +1 -0
- package/dist/src/core/types/config.js +37 -0
- package/dist/src/core/types/config.js.map +1 -0
- package/dist/src/core/types/increment-metadata.d.ts +120 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -0
- package/dist/src/core/types/increment-metadata.js +138 -0
- package/dist/src/core/types/increment-metadata.js.map +1 -0
- package/dist/src/core/types/plugin.d.ts +283 -0
- package/dist/src/core/types/plugin.d.ts.map +1 -0
- package/dist/src/core/types/plugin.js +49 -0
- package/dist/src/core/types/plugin.js.map +1 -0
- package/dist/src/core/types/sync-profile.d.ts +403 -0
- package/dist/src/core/types/sync-profile.d.ts.map +1 -0
- package/dist/src/core/types/sync-profile.js +55 -0
- package/dist/src/core/types/sync-profile.js.map +1 -0
- package/dist/src/hooks/lib/types/reflection-types.d.ts +125 -0
- package/dist/src/hooks/lib/types/reflection-types.d.ts.map +1 -0
- package/dist/src/hooks/lib/types/reflection-types.js +54 -0
- package/dist/src/hooks/lib/types/reflection-types.js.map +1 -0
- package/dist/src/integrations/ado/ado-client.d.ts +127 -0
- package/dist/src/integrations/ado/ado-client.d.ts.map +1 -0
- package/dist/src/integrations/ado/ado-client.js +416 -0
- package/dist/src/integrations/ado/ado-client.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +139 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -0
- package/dist/src/integrations/jira/jira-client.js +386 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts +75 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.js +474 -0
- package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -0
- package/dist/src/integrations/jira/jira-mapper.d.ts +105 -0
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -0
- package/dist/src/integrations/jira/jira-mapper.js +494 -0
- package/dist/src/integrations/jira/jira-mapper.js.map +1 -0
- package/dist/src/metrics/calculators/change-failure-rate.d.ts +22 -0
- package/dist/src/metrics/calculators/change-failure-rate.d.ts.map +1 -0
- package/dist/src/metrics/calculators/change-failure-rate.js +70 -0
- package/dist/src/metrics/calculators/change-failure-rate.js.map +1 -0
- package/dist/src/metrics/calculators/deployment-frequency.d.ts +20 -0
- package/dist/src/metrics/calculators/deployment-frequency.d.ts.map +1 -0
- package/dist/src/metrics/calculators/deployment-frequency.js +61 -0
- package/dist/src/metrics/calculators/deployment-frequency.js.map +1 -0
- package/dist/src/metrics/calculators/lead-time.d.ts +22 -0
- package/dist/src/metrics/calculators/lead-time.d.ts.map +1 -0
- package/dist/src/metrics/calculators/lead-time.js +82 -0
- package/dist/src/metrics/calculators/lead-time.js.map +1 -0
- package/dist/src/metrics/calculators/mttr.d.ts +21 -0
- package/dist/src/metrics/calculators/mttr.d.ts.map +1 -0
- package/dist/src/metrics/calculators/mttr.js +60 -0
- package/dist/src/metrics/calculators/mttr.js.map +1 -0
- package/dist/src/metrics/dora-calculator.d.ts +28 -0
- package/dist/src/metrics/dora-calculator.d.ts.map +1 -0
- package/dist/src/metrics/dora-calculator.js +117 -0
- package/dist/src/metrics/dora-calculator.js.map +1 -0
- package/dist/src/metrics/github-client.d.ts +51 -0
- package/dist/src/metrics/github-client.d.ts.map +1 -0
- package/dist/src/metrics/github-client.js +133 -0
- package/dist/src/metrics/github-client.js.map +1 -0
- package/dist/src/metrics/report-generator.d.ts +17 -0
- package/dist/src/metrics/report-generator.d.ts.map +1 -0
- package/dist/src/metrics/report-generator.js +403 -0
- package/dist/src/metrics/report-generator.js.map +1 -0
- package/dist/src/metrics/types.d.ts +112 -0
- package/dist/src/metrics/types.d.ts.map +1 -0
- package/dist/src/metrics/types.js +10 -0
- package/dist/src/metrics/types.js.map +1 -0
- package/dist/src/metrics/utils/percentile.d.ts +25 -0
- package/dist/src/metrics/utils/percentile.d.ts.map +1 -0
- package/dist/src/metrics/utils/percentile.js +46 -0
- package/dist/src/metrics/utils/percentile.js.map +1 -0
- package/dist/src/metrics/utils/tier-classifier.d.ts +61 -0
- package/dist/src/metrics/utils/tier-classifier.d.ts.map +1 -0
- package/dist/src/metrics/utils/tier-classifier.js +100 -0
- package/dist/src/metrics/utils/tier-classifier.js.map +1 -0
- package/dist/src/testing/test-generator.d.ts +117 -0
- package/dist/src/testing/test-generator.d.ts.map +1 -0
- package/dist/src/testing/test-generator.js +370 -0
- package/dist/src/testing/test-generator.js.map +1 -0
- package/dist/src/types/cost-tracking.d.ts +43 -0
- package/dist/src/types/cost-tracking.d.ts.map +1 -0
- package/dist/src/types/cost-tracking.js +8 -0
- package/dist/src/types/cost-tracking.js.map +1 -0
- package/dist/src/types/model-selection.d.ts +53 -0
- package/dist/src/types/model-selection.d.ts.map +1 -0
- package/dist/src/types/model-selection.js +12 -0
- package/dist/src/types/model-selection.js.map +1 -0
- package/dist/src/utils/agents-md-compiler.d.ts +68 -0
- package/dist/src/utils/agents-md-compiler.d.ts.map +1 -0
- package/dist/src/utils/agents-md-compiler.js +420 -0
- package/dist/src/utils/agents-md-compiler.js.map +1 -0
- package/dist/src/utils/auth-helpers.d.ts +58 -0
- package/dist/src/utils/auth-helpers.d.ts.map +1 -0
- package/dist/src/utils/auth-helpers.js +108 -0
- package/dist/src/utils/auth-helpers.js.map +1 -0
- package/dist/src/utils/auto-install.d.ts +47 -0
- package/dist/src/utils/auto-install.d.ts.map +1 -0
- package/dist/src/utils/auto-install.js +211 -0
- package/dist/src/utils/auto-install.js.map +1 -0
- package/dist/src/utils/claude-cli-detector.d.ts +75 -0
- package/dist/src/utils/claude-cli-detector.d.ts.map +1 -0
- package/dist/src/utils/claude-cli-detector.js +285 -0
- package/dist/src/utils/claude-cli-detector.js.map +1 -0
- package/dist/src/utils/cost-reporter.d.ts +58 -0
- package/dist/src/utils/cost-reporter.d.ts.map +1 -0
- package/dist/src/utils/cost-reporter.js +224 -0
- package/dist/src/utils/cost-reporter.js.map +1 -0
- package/dist/src/utils/docs-preview/config-generator.d.ts +46 -0
- package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/config-generator.js +377 -0
- package/dist/src/utils/docs-preview/config-generator.js.map +1 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +38 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.js +177 -0
- package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -0
- package/dist/src/utils/docs-preview/index.d.ts +7 -0
- package/dist/src/utils/docs-preview/index.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/index.js +7 -0
- package/dist/src/utils/docs-preview/index.js.map +1 -0
- package/dist/src/utils/docs-preview/package-installer.d.ts +42 -0
- package/dist/src/utils/docs-preview/package-installer.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/package-installer.js +182 -0
- package/dist/src/utils/docs-preview/package-installer.js.map +1 -0
- package/dist/src/utils/docs-preview/server-manager.d.ts +30 -0
- package/dist/src/utils/docs-preview/server-manager.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/server-manager.js +212 -0
- package/dist/src/utils/docs-preview/server-manager.js.map +1 -0
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts +32 -0
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/sidebar-builder.js +202 -0
- package/dist/src/utils/docs-preview/sidebar-builder.js.map +1 -0
- package/dist/src/utils/docs-preview/types.d.ts +57 -0
- package/dist/src/utils/docs-preview/types.d.ts.map +1 -0
- package/dist/src/utils/docs-preview/types.js +2 -0
- package/dist/src/utils/docs-preview/types.js.map +1 -0
- package/dist/src/utils/env-file.d.ts +88 -0
- package/dist/src/utils/env-file.d.ts.map +1 -0
- package/dist/src/utils/env-file.js +180 -0
- package/dist/src/utils/env-file.js.map +1 -0
- package/dist/src/utils/env-multi-project-parser.d.ts +220 -0
- package/dist/src/utils/env-multi-project-parser.d.ts.map +1 -0
- package/dist/src/utils/env-multi-project-parser.js +403 -0
- package/dist/src/utils/env-multi-project-parser.js.map +1 -0
- package/dist/src/utils/esm-helpers.d.ts +50 -0
- package/dist/src/utils/esm-helpers.d.ts.map +1 -0
- package/dist/src/utils/esm-helpers.js +57 -0
- package/dist/src/utils/esm-helpers.js.map +1 -0
- package/dist/src/utils/execFileNoThrow.d.ts +99 -0
- package/dist/src/utils/execFileNoThrow.d.ts.map +1 -0
- package/dist/src/utils/execFileNoThrow.js +137 -0
- package/dist/src/utils/execFileNoThrow.js.map +1 -0
- package/dist/src/utils/external-resource-validator.d.ts +102 -0
- package/dist/src/utils/external-resource-validator.d.ts.map +1 -0
- package/dist/src/utils/external-resource-validator.js +400 -0
- package/dist/src/utils/external-resource-validator.js.map +1 -0
- package/dist/src/utils/generate-skills-index.d.ts +24 -0
- package/dist/src/utils/generate-skills-index.d.ts.map +1 -0
- package/dist/src/utils/generate-skills-index.js +410 -0
- package/dist/src/utils/generate-skills-index.js.map +1 -0
- package/dist/src/utils/model-selection.d.ts +75 -0
- package/dist/src/utils/model-selection.d.ts.map +1 -0
- package/dist/src/utils/model-selection.js +204 -0
- package/dist/src/utils/model-selection.js.map +1 -0
- package/dist/src/utils/plugin-validator.d.ts +161 -0
- package/dist/src/utils/plugin-validator.d.ts.map +1 -0
- package/dist/src/utils/plugin-validator.js +558 -0
- package/dist/src/utils/plugin-validator.js.map +1 -0
- package/dist/src/utils/pricing-constants.d.ts +70 -0
- package/dist/src/utils/pricing-constants.d.ts.map +1 -0
- package/dist/src/utils/pricing-constants.js +71 -0
- package/dist/src/utils/pricing-constants.js.map +1 -0
- package/dist/src/utils/project-detection.d.ts +141 -0
- package/dist/src/utils/project-detection.d.ts.map +1 -0
- package/dist/src/utils/project-detection.js +321 -0
- package/dist/src/utils/project-detection.js.map +1 -0
- package/dist/src/utils/string-utils.d.ts +40 -0
- package/dist/src/utils/string-utils.d.ts.map +1 -0
- package/dist/src/utils/string-utils.js +58 -0
- package/dist/src/utils/string-utils.js.map +1 -0
- package/dist/src/utils/translation.d.ts +187 -0
- package/dist/src/utils/translation.d.ts.map +1 -0
- package/dist/src/utils/translation.js +414 -0
- package/dist/src/utils/translation.js.map +1 -0
- package/dist/utils/plugin-validator.d.ts.map +1 -1
- package/dist/utils/plugin-validator.js +0 -7
- package/dist/utils/plugin-validator.js.map +1 -1
- package/package.json +3 -2
- package/plugins/specweave/agents/reflective-reviewer/AGENT.md +535 -0
- package/plugins/specweave/hooks/post-first-increment.sh +10 -28
- package/plugins/specweave/hooks/post-increment-planning.sh +261 -1
- package/plugins/specweave/hooks/post-task-completion.sh +26 -0
- package/plugins/specweave/lib/hooks/git-diff-analyzer.ts +269 -0
- package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +264 -0
- package/plugins/specweave/lib/hooks/prepare-reflection-context.ts +178 -0
- package/plugins/specweave/lib/hooks/reflection-config-loader.ts +156 -0
- package/plugins/specweave/lib/hooks/reflection-parser.ts +484 -0
- package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts +306 -0
- package/plugins/specweave/lib/hooks/reflection-storage.ts +369 -0
- package/plugins/specweave/lib/hooks/run-self-reflection.ts +258 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +147 -0
- package/plugins/specweave/lib/hooks/translate-file.ts +428 -0
- package/plugins/specweave/lib/hooks/translate-living-docs.ts +224 -0
- package/plugins/specweave/lib/hooks/types/reflection-types.ts +193 -0
- package/plugins/specweave/lib/hooks/update-tasks-md.ts +256 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +2 -2
- package/plugins/specweave/skills/increment-planner/SKILL.md +8 -0
- package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -4
- package/plugins/specweave/skills/plugin-installer/SKILL.md +19 -21
- package/plugins/specweave/skills/plugin-validator/SKILL.md +0 -1
- package/plugins/specweave/skills/project-kickstarter/SKILL.md +3 -3
- package/plugins/specweave/skills/spec-generator/SKILL.md +3 -3
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-docs-preview/commands/build.md +489 -0
- package/plugins/specweave-docs-preview/commands/preview.md +330 -0
- package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +386 -0
- package/plugins/specweave/skills/translator/SKILL.md.bak +0 -172
|
@@ -0,0 +1,258 @@
|
|
|
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
|
+
|
|
15
|
+
import { loadAndValidateReflectionConfig } from './reflection-config-loader';
|
|
16
|
+
import { getModifiedFiles, getModifiedFilesSummary } from './git-diff-analyzer';
|
|
17
|
+
import { buildReflectionPrompt, estimatePromptTokens } from './reflection-prompt-builder';
|
|
18
|
+
import { parseReflectionMarkdown, validateReflectionResult } from './reflection-parser';
|
|
19
|
+
import { saveReflection } from './reflection-storage';
|
|
20
|
+
import {
|
|
21
|
+
ReflectionContext,
|
|
22
|
+
ReflectionExecutionResult,
|
|
23
|
+
ReflectionMode,
|
|
24
|
+
ReflectionModel
|
|
25
|
+
} from './types/reflection-types';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Check if reflection should run for the current context
|
|
29
|
+
*
|
|
30
|
+
* @param context Reflection context with config and modified files
|
|
31
|
+
* @returns True if reflection should run
|
|
32
|
+
*/
|
|
33
|
+
function shouldRunReflection(context: ReflectionContext): boolean {
|
|
34
|
+
const { config, modifiedFiles } = context;
|
|
35
|
+
|
|
36
|
+
// Check if reflection is enabled
|
|
37
|
+
if (!config.enabled) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Check mode
|
|
42
|
+
if (config.mode === ReflectionMode.DISABLED) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (config.mode === ReflectionMode.MANUAL) {
|
|
47
|
+
// Manual mode requires explicit invocation
|
|
48
|
+
// This function is only called in auto mode, so skip
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Check if there are modified files to analyze
|
|
53
|
+
if (modifiedFiles.length === 0) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Estimate reflection cost based on model and prompt size
|
|
62
|
+
*
|
|
63
|
+
* @param model Reflection model (haiku, sonnet, opus)
|
|
64
|
+
* @param promptTokens Estimated prompt token count
|
|
65
|
+
* @param responseTokens Estimated response token count (default: 2000)
|
|
66
|
+
* @returns Estimated cost in USD
|
|
67
|
+
*/
|
|
68
|
+
function estimateReflectionCost(
|
|
69
|
+
model: ReflectionModel,
|
|
70
|
+
promptTokens: number,
|
|
71
|
+
responseTokens: number = 2000
|
|
72
|
+
): number {
|
|
73
|
+
// Pricing per 1M tokens (as of Nov 2025)
|
|
74
|
+
const pricing = {
|
|
75
|
+
[ReflectionModel.HAIKU]: { input: 0.80, output: 4.00 },
|
|
76
|
+
[ReflectionModel.SONNET]: { input: 3.00, output: 15.00 },
|
|
77
|
+
[ReflectionModel.OPUS]: { input: 15.00, output: 75.00 }
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const modelPricing = pricing[model];
|
|
81
|
+
const inputCost = (promptTokens / 1_000_000) * modelPricing.input;
|
|
82
|
+
const outputCost = (responseTokens / 1_000_000) * modelPricing.output;
|
|
83
|
+
|
|
84
|
+
return inputCost + outputCost;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Invoke reflective-reviewer agent to analyze code
|
|
89
|
+
*
|
|
90
|
+
* @param prompt Reflection prompt
|
|
91
|
+
* @param model Model to use (haiku, sonnet, opus)
|
|
92
|
+
* @returns Agent response (markdown reflection)
|
|
93
|
+
*/
|
|
94
|
+
async function invokeReflectiveReviewerAgent(
|
|
95
|
+
prompt: string,
|
|
96
|
+
model: ReflectionModel
|
|
97
|
+
): Promise<string> {
|
|
98
|
+
// NOTE: This is a placeholder for agent invocation
|
|
99
|
+
// In the real implementation, this would use Claude Code's Task tool
|
|
100
|
+
// to invoke the specweave:reflective-reviewer:reflective-reviewer agent
|
|
101
|
+
//
|
|
102
|
+
// For now, we'll return a mock response to enable testing
|
|
103
|
+
// The actual implementation will be in the hook integration (T-008)
|
|
104
|
+
|
|
105
|
+
throw new Error(
|
|
106
|
+
'Agent invocation not implemented yet. ' +
|
|
107
|
+
'This function will be implemented in hook integration (T-008). ' +
|
|
108
|
+
'Call this from the post-task-completion hook using the Task tool.'
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Run self-reflection analysis
|
|
114
|
+
* Main entry point for the reflection system
|
|
115
|
+
*
|
|
116
|
+
* @param context Reflection context with increment, task, and files
|
|
117
|
+
* @returns Reflection execution result (success or error)
|
|
118
|
+
*/
|
|
119
|
+
export async function runSelfReflection(
|
|
120
|
+
context: ReflectionContext
|
|
121
|
+
): Promise<ReflectionExecutionResult> {
|
|
122
|
+
const { incrementId, taskId, modifiedFiles, config } = context;
|
|
123
|
+
const startTime = Date.now();
|
|
124
|
+
|
|
125
|
+
try {
|
|
126
|
+
// Step 1: Check if reflection should run
|
|
127
|
+
if (!shouldRunReflection(context)) {
|
|
128
|
+
return {
|
|
129
|
+
success: true,
|
|
130
|
+
result: undefined,
|
|
131
|
+
error: undefined
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Step 2: Build reflection prompt
|
|
136
|
+
const prompt = buildReflectionPrompt({
|
|
137
|
+
taskId,
|
|
138
|
+
taskName: `Task ${taskId}`, // Will be enhanced with actual task name in hook
|
|
139
|
+
modifiedFiles,
|
|
140
|
+
config,
|
|
141
|
+
incrementId,
|
|
142
|
+
includeFullDiff: false // Use simplified prompt for token efficiency
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// Step 3: Estimate cost
|
|
146
|
+
const promptTokens = estimatePromptTokens(prompt);
|
|
147
|
+
const estimatedCost = estimateReflectionCost(config.model, promptTokens);
|
|
148
|
+
|
|
149
|
+
// Step 4: Invoke reflective-reviewer agent
|
|
150
|
+
const agentResponse = await invokeReflectiveReviewerAgent(prompt, config.model);
|
|
151
|
+
|
|
152
|
+
// Step 5: Parse response
|
|
153
|
+
const endTime = Date.now();
|
|
154
|
+
const reflectionTime = Math.round((endTime - startTime) / 1000); // seconds
|
|
155
|
+
|
|
156
|
+
const reflectionResult = parseReflectionMarkdown(
|
|
157
|
+
agentResponse,
|
|
158
|
+
`Task ${taskId}`,
|
|
159
|
+
config.model,
|
|
160
|
+
reflectionTime,
|
|
161
|
+
estimatedCost
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
// Step 6: Add file modification stats
|
|
165
|
+
const fileStats = getModifiedFilesSummary(modifiedFiles);
|
|
166
|
+
reflectionResult.filesModified = {
|
|
167
|
+
count: fileStats.count,
|
|
168
|
+
linesAdded: fileStats.linesAdded,
|
|
169
|
+
linesRemoved: fileStats.linesRemoved
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Step 7: Validate reflection result
|
|
173
|
+
const validation = validateReflectionResult(reflectionResult);
|
|
174
|
+
if (!validation.valid) {
|
|
175
|
+
return {
|
|
176
|
+
success: false,
|
|
177
|
+
error: {
|
|
178
|
+
message: 'Reflection validation failed',
|
|
179
|
+
code: 'VALIDATION_ERROR',
|
|
180
|
+
details: validation.errors
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Step 8: Store reflection (if enabled)
|
|
186
|
+
if (config.storeReflections) {
|
|
187
|
+
try {
|
|
188
|
+
saveReflection(reflectionResult, incrementId, taskId);
|
|
189
|
+
} catch (storageError: any) {
|
|
190
|
+
// Storage failure shouldn't fail the entire reflection
|
|
191
|
+
console.warn(`Failed to store reflection: ${storageError.message}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Step 9: Return success
|
|
196
|
+
return {
|
|
197
|
+
success: true,
|
|
198
|
+
result: reflectionResult
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
} catch (error: any) {
|
|
202
|
+
// Graceful degradation: Return error but don't throw
|
|
203
|
+
return {
|
|
204
|
+
success: false,
|
|
205
|
+
error: {
|
|
206
|
+
message: error.message || 'Unknown error during reflection',
|
|
207
|
+
code: 'REFLECTION_ERROR',
|
|
208
|
+
details: error.stack
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Create reflection context from hook environment
|
|
216
|
+
* Helper function for hook integration
|
|
217
|
+
*
|
|
218
|
+
* @param incrementId Increment identifier
|
|
219
|
+
* @param taskId Task identifier
|
|
220
|
+
* @param projectRoot Project root directory (optional, auto-detected)
|
|
221
|
+
* @returns Reflection context ready for runSelfReflection
|
|
222
|
+
*/
|
|
223
|
+
export function createReflectionContext(
|
|
224
|
+
incrementId: string,
|
|
225
|
+
taskId: string,
|
|
226
|
+
projectRoot?: string
|
|
227
|
+
): ReflectionContext {
|
|
228
|
+
// Load and validate configuration
|
|
229
|
+
const config = loadAndValidateReflectionConfig(projectRoot);
|
|
230
|
+
|
|
231
|
+
// Get modified files from git
|
|
232
|
+
const modifiedFiles = getModifiedFiles(projectRoot);
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
incrementId,
|
|
236
|
+
taskId,
|
|
237
|
+
modifiedFiles,
|
|
238
|
+
config
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Run reflection with automatic context creation
|
|
244
|
+
* Convenience function for hook integration
|
|
245
|
+
*
|
|
246
|
+
* @param incrementId Increment identifier
|
|
247
|
+
* @param taskId Task identifier
|
|
248
|
+
* @param projectRoot Project root directory (optional)
|
|
249
|
+
* @returns Reflection execution result
|
|
250
|
+
*/
|
|
251
|
+
export async function runReflectionAuto(
|
|
252
|
+
incrementId: string,
|
|
253
|
+
taskId: string,
|
|
254
|
+
projectRoot?: string
|
|
255
|
+
): Promise<ReflectionExecutionResult> {
|
|
256
|
+
const context = createReflectionContext(incrementId, taskId, projectRoot);
|
|
257
|
+
return runSelfReflection(context);
|
|
258
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SpecWeave Living Docs Auto-Sync
|
|
5
|
+
*
|
|
6
|
+
* Automatically syncs living documentation after task completion.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* node dist/hooks/lib/sync-living-docs.js <incrementId>
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* node dist/hooks/lib/sync-living-docs.js 0006-llm-native-i18n
|
|
13
|
+
*
|
|
14
|
+
* What it does:
|
|
15
|
+
* 1. Checks if sync_living_docs enabled in config
|
|
16
|
+
* 2. Detects changed docs via git diff
|
|
17
|
+
* 3. Invokes /sync-docs update command (future implementation)
|
|
18
|
+
* 4. Logs sync actions
|
|
19
|
+
*
|
|
20
|
+
* @author SpecWeave Team
|
|
21
|
+
* @version 1.0.0
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import fs from 'fs-extra';
|
|
25
|
+
import path from 'path';
|
|
26
|
+
import { execSync } from 'child_process';
|
|
27
|
+
|
|
28
|
+
interface Config {
|
|
29
|
+
hooks?: {
|
|
30
|
+
post_task_completion?: {
|
|
31
|
+
sync_living_docs?: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Main function - sync living docs for given increment
|
|
38
|
+
*/
|
|
39
|
+
async function syncLivingDocs(incrementId: string): Promise<void> {
|
|
40
|
+
try {
|
|
41
|
+
console.log(`\nš Checking living docs sync for increment: ${incrementId}`);
|
|
42
|
+
|
|
43
|
+
// 1. Load config
|
|
44
|
+
const configPath = path.join(process.cwd(), '.specweave', 'config.json');
|
|
45
|
+
let config: Config = {};
|
|
46
|
+
|
|
47
|
+
if (fs.existsSync(configPath)) {
|
|
48
|
+
config = JSON.parse(await fs.readFile(configPath, 'utf-8'));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 2. Check if sync enabled
|
|
52
|
+
const syncEnabled = config.hooks?.post_task_completion?.sync_living_docs ?? false;
|
|
53
|
+
|
|
54
|
+
if (!syncEnabled) {
|
|
55
|
+
console.log('ā¹ļø Living docs sync disabled in config');
|
|
56
|
+
console.log(' To enable: Set hooks.post_task_completion.sync_living_docs = true');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.log('ā
Living docs sync enabled');
|
|
61
|
+
|
|
62
|
+
// 3. Detect changed docs via git diff
|
|
63
|
+
const changedDocs = detectChangedDocs();
|
|
64
|
+
|
|
65
|
+
if (changedDocs.length === 0) {
|
|
66
|
+
console.log('ā¹ļø No living docs changed (no git diff in .specweave/docs/)');
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
console.log(`š Detected ${changedDocs.length} changed doc(s):`);
|
|
71
|
+
changedDocs.forEach((doc) => console.log(` - ${doc}`));
|
|
72
|
+
|
|
73
|
+
// 4. Invoke /sync-docs update command
|
|
74
|
+
// TODO: Implement actual sync command invocation
|
|
75
|
+
// For now, just log what would happen
|
|
76
|
+
|
|
77
|
+
console.log('\nš Syncing living docs...');
|
|
78
|
+
console.log(' (Actual sync command invocation to be implemented in future version)');
|
|
79
|
+
console.log(' Would invoke: /sync-docs update');
|
|
80
|
+
|
|
81
|
+
// Future implementation:
|
|
82
|
+
// await invokeSyncDocsCommand(incrementId);
|
|
83
|
+
|
|
84
|
+
console.log('ā
Living docs sync check complete\n');
|
|
85
|
+
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error('ā Error syncing living docs:', error);
|
|
88
|
+
// Don't exit with error - this is best-effort
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Detect changed documentation files via git diff
|
|
94
|
+
*/
|
|
95
|
+
function detectChangedDocs(): string[] {
|
|
96
|
+
try {
|
|
97
|
+
// Get changed files in .specweave/docs/
|
|
98
|
+
const output = execSync('git diff --name-only .specweave/docs/ 2>/dev/null || true', {
|
|
99
|
+
encoding: 'utf-8',
|
|
100
|
+
cwd: process.cwd(),
|
|
101
|
+
}).trim();
|
|
102
|
+
|
|
103
|
+
if (!output) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Filter to only .md files
|
|
108
|
+
const files = output
|
|
109
|
+
.split('\n')
|
|
110
|
+
.filter((f) => f.endsWith('.md'))
|
|
111
|
+
.filter((f) => f.length > 0);
|
|
112
|
+
|
|
113
|
+
return files;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.warn('ā ļø Could not detect git changes:', error);
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Invoke /sync-docs update command
|
|
122
|
+
* TODO: Implement actual command invocation
|
|
123
|
+
*/
|
|
124
|
+
async function invokeSyncDocsCommand(incrementId: string): Promise<void> {
|
|
125
|
+
// This will be implemented in future version when /sync-docs command is ready
|
|
126
|
+
console.log(` Invoking /sync-docs update for ${incrementId}`);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// CLI entry point
|
|
130
|
+
const isMainModule = import.meta.url === `file://${process.argv[1]}`;
|
|
131
|
+
|
|
132
|
+
if (isMainModule) {
|
|
133
|
+
const incrementId = process.argv[2];
|
|
134
|
+
|
|
135
|
+
if (!incrementId) {
|
|
136
|
+
console.error('ā Usage: sync-living-docs <incrementId>');
|
|
137
|
+
console.error(' Example: sync-living-docs 0006-llm-native-i18n');
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
syncLivingDocs(incrementId).catch((error) => {
|
|
142
|
+
console.error('ā Fatal error:', error);
|
|
143
|
+
// Don't exit with error code - best-effort sync
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { syncLivingDocs };
|