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
|
@@ -268,6 +268,224 @@ translate_living_docs_specs() {
|
|
|
268
268
|
return 0
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
# ============================================================================
|
|
272
|
+
# GITHUB ISSUE CREATION
|
|
273
|
+
# ============================================================================
|
|
274
|
+
|
|
275
|
+
create_github_issue() {
|
|
276
|
+
local increment_id="$1"
|
|
277
|
+
local increment_dir="$2"
|
|
278
|
+
|
|
279
|
+
local spec_file="$increment_dir/spec.md"
|
|
280
|
+
local tasks_file="$increment_dir/tasks.md"
|
|
281
|
+
local metadata_file="$increment_dir/metadata.json"
|
|
282
|
+
|
|
283
|
+
# Validate files exist
|
|
284
|
+
if [ ! -f "$spec_file" ]; then
|
|
285
|
+
log_error "spec.md not found in $increment_dir"
|
|
286
|
+
return 1
|
|
287
|
+
fi
|
|
288
|
+
|
|
289
|
+
if [ ! -f "$tasks_file" ]; then
|
|
290
|
+
log_error "tasks.md not found in $increment_dir"
|
|
291
|
+
return 1
|
|
292
|
+
fi
|
|
293
|
+
|
|
294
|
+
# Extract title from spec.md frontmatter
|
|
295
|
+
local title=$(awk '/^---$/,/^---$/ {if (/^title:/) {sub(/^title:[[:space:]]*"?/, ""); sub(/"?[[:space:]]*$/, ""); print; exit}}' "$spec_file")
|
|
296
|
+
|
|
297
|
+
if [ -z "$title" ]; then
|
|
298
|
+
# Fallback: extract from first heading
|
|
299
|
+
title=$(grep -m 1 '^# ' "$spec_file" | sed 's/^# //' | sed 's/Increment [0-9]*: //')
|
|
300
|
+
fi
|
|
301
|
+
|
|
302
|
+
if [ -z "$title" ]; then
|
|
303
|
+
title="$increment_id"
|
|
304
|
+
fi
|
|
305
|
+
|
|
306
|
+
# Extract quick overview from spec.md (try multiple sections)
|
|
307
|
+
local overview=$(awk '/## Quick Overview/,/^---$|^##/ {if (/## Quick Overview/) next; if (/^---$/ || /^##/) exit; print}' "$spec_file" | grep -v '^$' | head -5)
|
|
308
|
+
|
|
309
|
+
# Fallback: try Summary section
|
|
310
|
+
if [ -z "$overview" ]; then
|
|
311
|
+
overview=$(awk '/## Summary/,/^---$|^##/ {if (/## Summary/) next; if (/^---$/ || /^##/) exit; print}' "$spec_file" | grep -v '^$' | head -5)
|
|
312
|
+
fi
|
|
313
|
+
|
|
314
|
+
# Fallback: extract first paragraph after frontmatter
|
|
315
|
+
if [ -z "$overview" ]; then
|
|
316
|
+
overview=$(awk '/^---$/{count++; if(count==2){flag=1; next}} flag && /^[^#]/ && NF>0 {print; count2++; if(count2>=5) exit}' "$spec_file")
|
|
317
|
+
fi
|
|
318
|
+
|
|
319
|
+
# Final fallback: use a default message
|
|
320
|
+
if [ -z "$overview" ]; then
|
|
321
|
+
overview="See spec.md for details."
|
|
322
|
+
fi
|
|
323
|
+
|
|
324
|
+
# Extract total tasks count
|
|
325
|
+
local total_tasks=$(awk '/^total_tasks:/ {print $2; exit}' "$tasks_file")
|
|
326
|
+
|
|
327
|
+
# Fallback: count tasks if total_tasks not in frontmatter
|
|
328
|
+
if [ -z "$total_tasks" ] || [ "$total_tasks" = "0" ]; then
|
|
329
|
+
total_tasks=$(grep -c '^### T-[0-9]*:' "$tasks_file" 2>/dev/null || echo "0")
|
|
330
|
+
fi
|
|
331
|
+
|
|
332
|
+
# Generate task checklist from tasks.md
|
|
333
|
+
local task_list=$(awk '
|
|
334
|
+
/^### T-[0-9]+:/ {
|
|
335
|
+
task_id = $2
|
|
336
|
+
task_title = substr($0, index($0, $3))
|
|
337
|
+
in_task = 1
|
|
338
|
+
next
|
|
339
|
+
}
|
|
340
|
+
in_task && /^\*\*Status\*\*:/ {
|
|
341
|
+
if (/\[x\]/) {
|
|
342
|
+
print "- [x] " task_id " " task_title
|
|
343
|
+
} else {
|
|
344
|
+
print "- [ ] " task_id " " task_title
|
|
345
|
+
}
|
|
346
|
+
in_task = 0
|
|
347
|
+
}
|
|
348
|
+
' "$tasks_file")
|
|
349
|
+
|
|
350
|
+
# Detect repository from git remote
|
|
351
|
+
local repo=$(git remote get-url origin 2>/dev/null | sed 's/.*github\.com[:/]\(.*\)\.git/\1/' | sed 's/.*github\.com[:/]\(.*\)/\1/')
|
|
352
|
+
|
|
353
|
+
if [ -z "$repo" ]; then
|
|
354
|
+
# Fallback to config
|
|
355
|
+
repo=$(cat "$CONFIG_FILE" 2>/dev/null | grep -A 5 '"sync"' | grep -o '"repo"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"\([^"]*\)".*/\1/')
|
|
356
|
+
fi
|
|
357
|
+
|
|
358
|
+
if [ -z "$repo" ]; then
|
|
359
|
+
log_error "Could not detect GitHub repository"
|
|
360
|
+
return 1
|
|
361
|
+
fi
|
|
362
|
+
|
|
363
|
+
# Extract increment number from ID (e.g., "0016-self-reflection-system" -> "0016")
|
|
364
|
+
local inc_number=$(echo "$increment_id" | grep -o '^[0-9]*')
|
|
365
|
+
|
|
366
|
+
log_debug "Creating issue for repo: $repo"
|
|
367
|
+
log_debug "Title: [INC-$inc_number] $title"
|
|
368
|
+
|
|
369
|
+
# Generate issue body
|
|
370
|
+
local issue_body=$(cat <<EOF
|
|
371
|
+
# [INC-$inc_number] $title
|
|
372
|
+
|
|
373
|
+
**Status**: Planning → Implementation
|
|
374
|
+
**Priority**: P1
|
|
375
|
+
**Increment**: $increment_id
|
|
376
|
+
|
|
377
|
+
## Summary
|
|
378
|
+
|
|
379
|
+
$overview
|
|
380
|
+
|
|
381
|
+
## Tasks
|
|
382
|
+
|
|
383
|
+
Progress: 0/$total_tasks tasks (0%)
|
|
384
|
+
|
|
385
|
+
$task_list
|
|
386
|
+
|
|
387
|
+
## Links
|
|
388
|
+
|
|
389
|
+
- **Spec**: [\`spec.md\`](../../tree/develop/.specweave/increments/$increment_id/spec.md)
|
|
390
|
+
- **Plan**: [\`plan.md\`](../../tree/develop/.specweave/increments/$increment_id/plan.md)
|
|
391
|
+
- **Tasks**: [\`tasks.md\`](../../tree/develop/.specweave/increments/$increment_id/tasks.md)
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
🤖 Auto-created by SpecWeave | Updates automatically on task completion
|
|
396
|
+
EOF
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
# Create temporary file for issue body
|
|
400
|
+
local temp_body=$(mktemp)
|
|
401
|
+
echo "$issue_body" > "$temp_body"
|
|
402
|
+
|
|
403
|
+
# Create GitHub issue
|
|
404
|
+
log_debug "Calling gh issue create..."
|
|
405
|
+
|
|
406
|
+
local gh_output=$(gh issue create \
|
|
407
|
+
--repo "$repo" \
|
|
408
|
+
--title "[INC-$inc_number] $title" \
|
|
409
|
+
--body-file "$temp_body" \
|
|
410
|
+
--label "specweave,increment" \
|
|
411
|
+
2>&1)
|
|
412
|
+
|
|
413
|
+
local gh_status=$?
|
|
414
|
+
|
|
415
|
+
# Clean up temp file
|
|
416
|
+
rm -f "$temp_body"
|
|
417
|
+
|
|
418
|
+
if [ $gh_status -ne 0 ]; then
|
|
419
|
+
log_error "gh issue create failed: $gh_output"
|
|
420
|
+
return 1
|
|
421
|
+
fi
|
|
422
|
+
|
|
423
|
+
# Extract issue number from output (format: "https://github.com/owner/repo/issues/123")
|
|
424
|
+
local issue_number=$(echo "$gh_output" | grep -o '/issues/[0-9]*' | grep -o '[0-9]*')
|
|
425
|
+
local issue_url=$(echo "$gh_output" | grep 'https://github.com')
|
|
426
|
+
|
|
427
|
+
if [ -z "$issue_number" ]; then
|
|
428
|
+
log_error "Could not extract issue number from gh output: $gh_output"
|
|
429
|
+
return 1
|
|
430
|
+
fi
|
|
431
|
+
|
|
432
|
+
if [ -z "$issue_url" ]; then
|
|
433
|
+
# Construct URL manually if extraction failed
|
|
434
|
+
issue_url="https://github.com/$repo/issues/$issue_number"
|
|
435
|
+
fi
|
|
436
|
+
|
|
437
|
+
log_info " 📝 Issue #$issue_number created"
|
|
438
|
+
log_info " 🔗 $issue_url"
|
|
439
|
+
|
|
440
|
+
# Create or update metadata.json
|
|
441
|
+
local current_timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
442
|
+
|
|
443
|
+
if [ -f "$metadata_file" ]; then
|
|
444
|
+
# Update existing metadata.json with github section
|
|
445
|
+
if command -v jq >/dev/null 2>&1; then
|
|
446
|
+
local temp_metadata=$(mktemp)
|
|
447
|
+
jq ". + {\"github\": {\"issue\": $issue_number, \"url\": \"$issue_url\", \"synced\": \"$current_timestamp\"}}" "$metadata_file" > "$temp_metadata"
|
|
448
|
+
mv "$temp_metadata" "$metadata_file"
|
|
449
|
+
else
|
|
450
|
+
# Fallback: manual JSON construction (less reliable)
|
|
451
|
+
log_debug "jq not found, using manual metadata update"
|
|
452
|
+
cat >> "$metadata_file" <<EOF_META
|
|
453
|
+
{
|
|
454
|
+
"id": "$increment_id",
|
|
455
|
+
"status": "active",
|
|
456
|
+
"type": "feature",
|
|
457
|
+
"created": "$current_timestamp",
|
|
458
|
+
"github": {
|
|
459
|
+
"issue": $issue_number,
|
|
460
|
+
"url": "$issue_url",
|
|
461
|
+
"synced": "$current_timestamp"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
EOF_META
|
|
465
|
+
fi
|
|
466
|
+
else
|
|
467
|
+
# Create new metadata.json
|
|
468
|
+
cat > "$metadata_file" <<EOF_META
|
|
469
|
+
{
|
|
470
|
+
"id": "$increment_id",
|
|
471
|
+
"status": "active",
|
|
472
|
+
"type": "feature",
|
|
473
|
+
"created": "$current_timestamp",
|
|
474
|
+
"github": {
|
|
475
|
+
"issue": $issue_number,
|
|
476
|
+
"url": "$issue_url",
|
|
477
|
+
"synced": "$current_timestamp"
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
EOF_META
|
|
481
|
+
fi
|
|
482
|
+
|
|
483
|
+
log_info " ✅ metadata.json updated"
|
|
484
|
+
log_debug "Metadata saved to $metadata_file"
|
|
485
|
+
|
|
486
|
+
return 0
|
|
487
|
+
}
|
|
488
|
+
|
|
271
489
|
# ============================================================================
|
|
272
490
|
# MAIN LOGIC
|
|
273
491
|
# ============================================================================
|
|
@@ -383,7 +601,49 @@ EOF
|
|
|
383
601
|
|
|
384
602
|
translate_living_docs_specs "$increment_id"
|
|
385
603
|
|
|
386
|
-
# 7.
|
|
604
|
+
# 7. Auto-create GitHub issue (if configured)
|
|
605
|
+
log_info ""
|
|
606
|
+
log_info "🔗 Checking GitHub issue auto-creation..."
|
|
607
|
+
|
|
608
|
+
# Check if auto-create is enabled in config
|
|
609
|
+
local auto_create=$(cat "$CONFIG_FILE" 2>/dev/null | grep -A 5 '"sync"' | grep -A 2 '"settings"' | grep -o '"autoCreateIssue"[[:space:]]*:[[:space:]]*\(true\|false\)' | grep -o '\(true\|false\)' || echo "false")
|
|
610
|
+
|
|
611
|
+
if [ "$auto_create" = "true" ]; then
|
|
612
|
+
log_info " 📦 Auto-create enabled, checking for GitHub CLI..."
|
|
613
|
+
|
|
614
|
+
# Check if gh CLI is available
|
|
615
|
+
if command -v gh &> /dev/null; then
|
|
616
|
+
log_info " ✓ GitHub CLI found"
|
|
617
|
+
|
|
618
|
+
# Check if metadata.json already has GitHub issue
|
|
619
|
+
local metadata_file="$increment_dir/metadata.json"
|
|
620
|
+
local existing_issue=""
|
|
621
|
+
|
|
622
|
+
if [ -f "$metadata_file" ]; then
|
|
623
|
+
existing_issue=$(cat "$metadata_file" 2>/dev/null | grep -o '"issue"[[:space:]]*:[[:space:]]*[0-9]*' | grep -o '[0-9]*' || echo "")
|
|
624
|
+
fi
|
|
625
|
+
|
|
626
|
+
if [ -n "$existing_issue" ]; then
|
|
627
|
+
log_info " ℹ️ GitHub issue already exists: #$existing_issue"
|
|
628
|
+
else
|
|
629
|
+
log_info " 🚀 Creating GitHub issue for $increment_id..."
|
|
630
|
+
|
|
631
|
+
# Call the create_github_issue function (defined below)
|
|
632
|
+
if create_github_issue "$increment_id" "$increment_dir"; then
|
|
633
|
+
log_info " ✅ GitHub issue created successfully!"
|
|
634
|
+
else
|
|
635
|
+
log_info " ⚠️ Failed to create GitHub issue (non-blocking)"
|
|
636
|
+
log_debug "Issue creation failed, continuing..."
|
|
637
|
+
fi
|
|
638
|
+
fi
|
|
639
|
+
else
|
|
640
|
+
log_debug "GitHub CLI not found, skipping issue creation"
|
|
641
|
+
fi
|
|
642
|
+
else
|
|
643
|
+
log_debug "GitHub issue auto-create disabled in config"
|
|
644
|
+
fi
|
|
645
|
+
|
|
646
|
+
# 8. Final summary
|
|
387
647
|
log_info ""
|
|
388
648
|
local total_translated=$((increment_success_count))
|
|
389
649
|
|
|
@@ -365,6 +365,32 @@ if [ -n "$CURRENT_INCREMENT" ]; then
|
|
|
365
365
|
fi
|
|
366
366
|
fi
|
|
367
367
|
|
|
368
|
+
# ============================================================================
|
|
369
|
+
# SELF-REFLECTION (NEW in v0.12.0-beta - AI Self-Reflection System)
|
|
370
|
+
# ============================================================================
|
|
371
|
+
|
|
372
|
+
if command -v node &> /dev/null; then
|
|
373
|
+
if [ -n "$CURRENT_INCREMENT" ] && [ "$ALL_COMPLETED" = "true" ]; then
|
|
374
|
+
echo "[$(date)] 🤔 Preparing self-reflection context for $CURRENT_INCREMENT" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
375
|
+
|
|
376
|
+
# Detect latest completed task
|
|
377
|
+
LATEST_TASK=$(grep "^## T-[0-9]" ".specweave/increments/$CURRENT_INCREMENT/tasks.md" 2>/dev/null | tail -1 | awk '{print $2}' | sed 's/://')
|
|
378
|
+
|
|
379
|
+
if [ -n "$LATEST_TASK" ]; then
|
|
380
|
+
# Prepare reflection context (non-blocking, best-effort)
|
|
381
|
+
node dist/hooks/lib/prepare-reflection-context.js "$CURRENT_INCREMENT" "$LATEST_TASK" 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
|
|
382
|
+
echo "[$(date)] ⚠️ Failed to prepare reflection context (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
383
|
+
}
|
|
384
|
+
else
|
|
385
|
+
echo "[$(date)] ℹ️ No tasks found in tasks.md, skipping reflection" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
386
|
+
fi
|
|
387
|
+
else
|
|
388
|
+
echo "[$(date)] ℹ️ Skipping reflection (tasks still pending or no increment)" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
389
|
+
fi
|
|
390
|
+
else
|
|
391
|
+
echo "[$(date)] ⚠️ Node.js not found, skipping reflection" >> "$DEBUG_LOG" 2>/dev/null || true
|
|
392
|
+
fi
|
|
393
|
+
|
|
368
394
|
# ============================================================================
|
|
369
395
|
# PLAY SOUND (only if session is truly ending)
|
|
370
396
|
# ============================================================================
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Diff Analyzer
|
|
3
|
+
*
|
|
4
|
+
* Extracts modified files from git diff for reflection analysis
|
|
5
|
+
* Parses git diff output to get file changes, line counts, and content
|
|
6
|
+
*
|
|
7
|
+
* @module git-diff-analyzer
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { execSync } from 'child_process';
|
|
11
|
+
import fs from 'fs-extra';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import { GitDiffInfo } from './types/reflection-types';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Execute git command safely
|
|
17
|
+
* @param command Git command to execute
|
|
18
|
+
* @param cwd Working directory (optional)
|
|
19
|
+
* @returns Command output as string
|
|
20
|
+
* @throws Error if command fails
|
|
21
|
+
*/
|
|
22
|
+
function executeGitCommand(command: string, cwd?: string): string {
|
|
23
|
+
try {
|
|
24
|
+
return execSync(command, {
|
|
25
|
+
cwd: cwd || process.cwd(),
|
|
26
|
+
encoding: 'utf-8',
|
|
27
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
28
|
+
});
|
|
29
|
+
} catch (error: any) {
|
|
30
|
+
throw new Error(`Git command failed: ${command}. ${error.message}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Check if directory is a git repository
|
|
36
|
+
* @param dir Directory to check (defaults to cwd)
|
|
37
|
+
* @returns True if directory is in a git repository
|
|
38
|
+
*/
|
|
39
|
+
export function isGitRepository(dir: string = process.cwd()): boolean {
|
|
40
|
+
try {
|
|
41
|
+
executeGitCommand('git rev-parse --git-dir', dir);
|
|
42
|
+
return true;
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get list of modified files in the working directory
|
|
50
|
+
* Includes both staged and unstaged changes
|
|
51
|
+
*
|
|
52
|
+
* @param cwd Working directory (optional, defaults to process.cwd())
|
|
53
|
+
* @returns Array of file paths relative to git root
|
|
54
|
+
*/
|
|
55
|
+
export function getModifiedFilesList(cwd?: string): string[] {
|
|
56
|
+
if (!isGitRepository(cwd)) {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
// Get both staged and unstaged changes
|
|
62
|
+
const output = executeGitCommand('git diff --name-only HEAD', cwd);
|
|
63
|
+
|
|
64
|
+
if (!output.trim()) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return output
|
|
69
|
+
.trim()
|
|
70
|
+
.split('\n')
|
|
71
|
+
.filter(file => file.length > 0)
|
|
72
|
+
.filter(file => !file.startsWith('.git/')); // Exclude .git directory
|
|
73
|
+
} catch {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Parse git diff numstat output to get line counts
|
|
80
|
+
* Format: <added>\t<removed>\t<filename>
|
|
81
|
+
*
|
|
82
|
+
* @param numstatOutput Output from git diff --numstat
|
|
83
|
+
* @returns Map of filename to {added, removed} counts
|
|
84
|
+
*/
|
|
85
|
+
export function parseNumstat(numstatOutput: string): Map<string, { added: number; removed: number }> {
|
|
86
|
+
const stats = new Map<string, { added: number; removed: number }>();
|
|
87
|
+
|
|
88
|
+
if (!numstatOutput.trim()) {
|
|
89
|
+
return stats;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const lines = numstatOutput.trim().split('\n');
|
|
93
|
+
|
|
94
|
+
for (const line of lines) {
|
|
95
|
+
const parts = line.split('\t');
|
|
96
|
+
if (parts.length < 3) continue;
|
|
97
|
+
|
|
98
|
+
const added = parts[0] === '-' ? 0 : parseInt(parts[0], 10);
|
|
99
|
+
const removed = parts[1] === '-' ? 0 : parseInt(parts[1], 10);
|
|
100
|
+
const filename = parts[2];
|
|
101
|
+
|
|
102
|
+
stats.set(filename, { added, removed });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return stats;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Get diff content for a specific file
|
|
110
|
+
* @param file File path relative to git root
|
|
111
|
+
* @param cwd Working directory (optional)
|
|
112
|
+
* @returns Diff content as string
|
|
113
|
+
*/
|
|
114
|
+
export function getFileDiff(file: string, cwd?: string): string {
|
|
115
|
+
if (!isGitRepository(cwd)) {
|
|
116
|
+
return '';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
// Get unified diff for the file
|
|
121
|
+
const output = executeGitCommand(`git diff HEAD -- "${file}"`, cwd);
|
|
122
|
+
return output;
|
|
123
|
+
} catch {
|
|
124
|
+
return '';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get current file content
|
|
130
|
+
* @param file File path (can be absolute or relative to cwd)
|
|
131
|
+
* @param cwd Working directory (optional)
|
|
132
|
+
* @returns File content as string, or empty string if file doesn't exist
|
|
133
|
+
*/
|
|
134
|
+
export function getFileContent(file: string, cwd?: string): string {
|
|
135
|
+
try {
|
|
136
|
+
const workingDir = cwd || process.cwd();
|
|
137
|
+
const absolutePath = path.isAbsolute(file) ? file : path.join(workingDir, file);
|
|
138
|
+
|
|
139
|
+
if (!fs.existsSync(absolutePath)) {
|
|
140
|
+
return '';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return fs.readFileSync(absolutePath, 'utf-8');
|
|
144
|
+
} catch {
|
|
145
|
+
return '';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get modified files with diff information
|
|
151
|
+
* Main function for reflection analysis
|
|
152
|
+
*
|
|
153
|
+
* @param cwd Working directory (optional, defaults to process.cwd())
|
|
154
|
+
* @param maxFiles Maximum number of files to return (optional, defaults to 100)
|
|
155
|
+
* @returns Array of GitDiffInfo objects with file changes
|
|
156
|
+
*/
|
|
157
|
+
export function getModifiedFiles(
|
|
158
|
+
cwd?: string,
|
|
159
|
+
maxFiles: number = 100
|
|
160
|
+
): GitDiffInfo[] {
|
|
161
|
+
if (!isGitRepository(cwd)) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const workingDir = cwd || process.cwd();
|
|
166
|
+
|
|
167
|
+
// Get list of modified files
|
|
168
|
+
const modifiedFiles = getModifiedFilesList(workingDir);
|
|
169
|
+
|
|
170
|
+
if (modifiedFiles.length === 0) {
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Limit number of files to prevent overwhelming the analysis
|
|
175
|
+
const filesToAnalyze = modifiedFiles.slice(0, maxFiles);
|
|
176
|
+
|
|
177
|
+
// Get line count statistics
|
|
178
|
+
let numstatOutput = '';
|
|
179
|
+
try {
|
|
180
|
+
numstatOutput = executeGitCommand('git diff --numstat HEAD', workingDir);
|
|
181
|
+
} catch {
|
|
182
|
+
// If numstat fails, continue with empty stats
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const stats = parseNumstat(numstatOutput);
|
|
186
|
+
|
|
187
|
+
// Build GitDiffInfo array
|
|
188
|
+
const result: GitDiffInfo[] = [];
|
|
189
|
+
|
|
190
|
+
for (const file of filesToAnalyze) {
|
|
191
|
+
const fileStat = stats.get(file) || { added: 0, removed: 0 };
|
|
192
|
+
const diffContent = getFileDiff(file, workingDir);
|
|
193
|
+
|
|
194
|
+
// Only include files with actual changes
|
|
195
|
+
if (fileStat.added > 0 || fileStat.removed > 0 || diffContent.length > 0) {
|
|
196
|
+
result.push({
|
|
197
|
+
file,
|
|
198
|
+
linesAdded: fileStat.added,
|
|
199
|
+
linesRemoved: fileStat.removed,
|
|
200
|
+
content: diffContent
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get summary statistics for modified files
|
|
210
|
+
* Useful for reflection metadata
|
|
211
|
+
*
|
|
212
|
+
* @param modifiedFiles Array of GitDiffInfo objects
|
|
213
|
+
* @returns Summary with file count, total lines added/removed
|
|
214
|
+
*/
|
|
215
|
+
export function getModifiedFilesSummary(modifiedFiles: GitDiffInfo[]): {
|
|
216
|
+
count: number;
|
|
217
|
+
linesAdded: number;
|
|
218
|
+
linesRemoved: number;
|
|
219
|
+
totalChanges: number;
|
|
220
|
+
} {
|
|
221
|
+
return {
|
|
222
|
+
count: modifiedFiles.length,
|
|
223
|
+
linesAdded: modifiedFiles.reduce((sum, file) => sum + file.linesAdded, 0),
|
|
224
|
+
linesRemoved: modifiedFiles.reduce((sum, file) => sum + file.linesRemoved, 0),
|
|
225
|
+
totalChanges: modifiedFiles.reduce(
|
|
226
|
+
(sum, file) => sum + file.linesAdded + file.linesRemoved,
|
|
227
|
+
0
|
|
228
|
+
)
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Filter files by extension
|
|
234
|
+
* Useful for focusing reflection on specific file types
|
|
235
|
+
*
|
|
236
|
+
* @param modifiedFiles Array of GitDiffInfo objects
|
|
237
|
+
* @param extensions Array of file extensions (e.g., ['.ts', '.js'])
|
|
238
|
+
* @returns Filtered array of GitDiffInfo objects
|
|
239
|
+
*/
|
|
240
|
+
export function filterFilesByExtension(
|
|
241
|
+
modifiedFiles: GitDiffInfo[],
|
|
242
|
+
extensions: string[]
|
|
243
|
+
): GitDiffInfo[] {
|
|
244
|
+
return modifiedFiles.filter(file => {
|
|
245
|
+
const ext = path.extname(file.file).toLowerCase();
|
|
246
|
+
return extensions.some(allowedExt => ext === allowedExt.toLowerCase());
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Exclude files matching patterns
|
|
252
|
+
* Useful for excluding generated files, test files, etc.
|
|
253
|
+
*
|
|
254
|
+
* @param modifiedFiles Array of GitDiffInfo objects
|
|
255
|
+
* @param patterns Array of glob patterns to exclude
|
|
256
|
+
* @returns Filtered array of GitDiffInfo objects
|
|
257
|
+
*/
|
|
258
|
+
export function excludeFilesByPattern(
|
|
259
|
+
modifiedFiles: GitDiffInfo[],
|
|
260
|
+
patterns: string[]
|
|
261
|
+
): GitDiffInfo[] {
|
|
262
|
+
return modifiedFiles.filter(file => {
|
|
263
|
+
return !patterns.some(pattern => {
|
|
264
|
+
// Simple pattern matching (supports * wildcard)
|
|
265
|
+
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
|
|
266
|
+
return regex.test(file.file);
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|