@vpxa/kb 0.1.12 → 0.1.15
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/README.md +56 -39
- package/package.json +10 -7
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -20
- package/packages/analyzers/dist/blast-radius-analyzer.js +6 -12
- package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -27
- package/packages/analyzers/dist/dependency-analyzer.js +7 -9
- package/packages/analyzers/dist/diagram-generator.d.ts +12 -8
- package/packages/analyzers/dist/diagram-generator.js +3 -4
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -17
- package/packages/analyzers/dist/entry-point-analyzer.js +5 -5
- package/packages/analyzers/dist/index.d.ts +12 -14
- package/packages/analyzers/dist/index.js +1 -1
- package/packages/analyzers/dist/knowledge-producer.d.ts +29 -25
- package/packages/analyzers/dist/knowledge-producer.js +16 -15
- package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -10
- package/packages/analyzers/dist/pattern-analyzer.js +3 -5
- package/packages/analyzers/dist/regex-call-graph.d.ts +6 -12
- package/packages/analyzers/dist/regex-call-graph.js +2 -1
- package/packages/analyzers/dist/structure-analyzer.d.ts +13 -9
- package/packages/analyzers/dist/structure-analyzer.js +3 -4
- package/packages/analyzers/dist/symbol-analyzer.d.ts +12 -8
- package/packages/analyzers/dist/symbol-analyzer.js +8 -13
- package/packages/analyzers/dist/ts-call-graph.d.ts +16 -13
- package/packages/analyzers/dist/ts-call-graph.js +2 -1
- package/packages/analyzers/dist/types.d.ts +82 -79
- package/packages/analyzers/dist/types.js +1 -0
- package/packages/chunker/dist/call-graph-extractor.d.ts +13 -10
- package/packages/chunker/dist/call-graph-extractor.js +2 -1
- package/packages/chunker/dist/chunker-factory.d.ts +6 -2
- package/packages/chunker/dist/chunker-factory.js +2 -1
- package/packages/chunker/dist/chunker.interface.d.ts +8 -4
- package/packages/chunker/dist/chunker.interface.js +1 -0
- package/packages/chunker/dist/code-chunker.d.ts +16 -12
- package/packages/chunker/dist/code-chunker.js +12 -14
- package/packages/chunker/dist/generic-chunker.d.ts +14 -10
- package/packages/chunker/dist/generic-chunker.js +6 -5
- package/packages/chunker/dist/index.d.ts +8 -8
- package/packages/chunker/dist/index.js +1 -1
- package/packages/chunker/dist/markdown-chunker.d.ts +16 -12
- package/packages/chunker/dist/markdown-chunker.js +4 -10
- package/packages/chunker/dist/treesitter-chunker.d.ts +28 -31
- package/packages/chunker/dist/treesitter-chunker.js +7 -8
- package/packages/cli/dist/commands/analyze.d.ts +6 -2
- package/packages/cli/dist/commands/analyze.js +3 -3
- package/packages/cli/dist/commands/context-cmds.d.ts +6 -2
- package/packages/cli/dist/commands/context-cmds.js +2 -1
- package/packages/cli/dist/commands/environment.d.ts +6 -2
- package/packages/cli/dist/commands/environment.js +2 -2
- package/packages/cli/dist/commands/execution.d.ts +6 -2
- package/packages/cli/dist/commands/execution.js +2 -1
- package/packages/cli/dist/commands/graph.d.ts +6 -2
- package/packages/cli/dist/commands/graph.js +6 -6
- package/packages/cli/dist/commands/init/adapters.d.ts +27 -0
- package/packages/cli/dist/commands/init/adapters.js +2 -0
- package/packages/cli/dist/commands/init/config.d.ts +11 -0
- package/packages/cli/dist/commands/init/config.js +4 -0
- package/packages/cli/dist/commands/init/curated.d.ts +8 -0
- package/packages/cli/dist/commands/init/curated.js +2 -0
- package/packages/cli/dist/commands/init/index.d.ts +23 -0
- package/packages/cli/dist/commands/init/index.js +3 -0
- package/packages/cli/dist/commands/init/scaffold.d.ts +24 -0
- package/packages/cli/dist/commands/init/scaffold.js +2 -0
- package/packages/cli/dist/commands/init/templates.d.ts +10 -0
- package/packages/cli/dist/commands/init/templates.js +302 -0
- package/packages/cli/dist/commands/init.d.ts +9 -3
- package/packages/cli/dist/commands/init.js +253 -197
- package/packages/cli/dist/commands/knowledge.d.ts +6 -2
- package/packages/cli/dist/commands/knowledge.js +2 -1
- package/packages/cli/dist/commands/search.d.ts +6 -2
- package/packages/cli/dist/commands/search.js +2 -8
- package/packages/cli/dist/commands/system.d.ts +6 -2
- package/packages/cli/dist/commands/system.js +5 -4
- package/packages/cli/dist/commands/workspace.d.ts +6 -2
- package/packages/cli/dist/commands/workspace.js +2 -2
- package/packages/cli/dist/context.d.ts +7 -4
- package/packages/cli/dist/context.js +2 -1
- package/packages/cli/dist/helpers.d.ts +51 -47
- package/packages/cli/dist/helpers.js +6 -3
- package/packages/cli/dist/index.d.ts +4 -1
- package/packages/cli/dist/index.js +3 -2
- package/packages/cli/dist/kb-init.d.ts +48 -50
- package/packages/cli/dist/kb-init.js +2 -1
- package/packages/cli/dist/types.d.ts +8 -5
- package/packages/cli/dist/types.js +1 -0
- package/packages/core/dist/constants.d.ts +36 -33
- package/packages/core/dist/constants.js +2 -1
- package/packages/core/dist/content-detector.d.ts +10 -5
- package/packages/core/dist/content-detector.js +2 -1
- package/packages/core/dist/errors.d.ts +15 -12
- package/packages/core/dist/errors.js +2 -1
- package/packages/core/dist/index.d.ts +6 -6
- package/packages/core/dist/index.js +1 -1
- package/packages/core/dist/logger.d.ts +16 -7
- package/packages/core/dist/logger.js +2 -1
- package/packages/core/dist/types.d.ts +108 -90
- package/packages/core/dist/types.js +2 -0
- package/packages/embeddings/dist/embedder.interface.d.ts +22 -19
- package/packages/embeddings/dist/embedder.interface.js +1 -0
- package/packages/embeddings/dist/index.d.ts +3 -3
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/embeddings/dist/onnx-embedder.d.ts +21 -22
- package/packages/embeddings/dist/onnx-embedder.js +2 -1
- package/packages/enterprise-bridge/dist/cache.d.ts +29 -0
- package/packages/enterprise-bridge/dist/cache.js +2 -0
- package/packages/enterprise-bridge/dist/er-client.d.ts +38 -0
- package/packages/enterprise-bridge/dist/er-client.js +2 -0
- package/packages/enterprise-bridge/dist/evolution-collector.d.ts +63 -0
- package/packages/enterprise-bridge/dist/evolution-collector.js +2 -0
- package/packages/enterprise-bridge/dist/index.d.ts +8 -0
- package/packages/enterprise-bridge/dist/index.js +1 -0
- package/packages/enterprise-bridge/dist/policy-store.d.ts +46 -0
- package/packages/enterprise-bridge/dist/policy-store.js +2 -0
- package/packages/enterprise-bridge/dist/push-adapter.d.ts +24 -0
- package/packages/enterprise-bridge/dist/push-adapter.js +2 -0
- package/packages/enterprise-bridge/dist/result-merger.d.ts +15 -0
- package/packages/enterprise-bridge/dist/result-merger.js +2 -0
- package/packages/enterprise-bridge/dist/types.d.ts +82 -0
- package/packages/enterprise-bridge/dist/types.js +2 -0
- package/packages/indexer/dist/file-hasher.d.ts +5 -2
- package/packages/indexer/dist/file-hasher.js +2 -1
- package/packages/indexer/dist/filesystem-crawler.d.ts +23 -20
- package/packages/indexer/dist/filesystem-crawler.js +2 -1
- package/packages/indexer/dist/graph-extractor.d.ts +9 -12
- package/packages/indexer/dist/graph-extractor.js +2 -1
- package/packages/indexer/dist/incremental-indexer.d.ts +49 -43
- package/packages/indexer/dist/incremental-indexer.js +2 -1
- package/packages/indexer/dist/index.d.ts +5 -5
- package/packages/indexer/dist/index.js +1 -1
- package/packages/server/dist/api.d.ts +3 -8
- package/packages/server/dist/api.js +1 -1
- package/packages/server/dist/config.d.ts +6 -2
- package/packages/server/dist/config.js +2 -1
- package/packages/server/dist/curated-manager.d.ts +79 -76
- package/packages/server/dist/curated-manager.js +6 -10
- package/packages/server/dist/index.d.ts +1 -2
- package/packages/server/dist/index.js +2 -1
- package/packages/server/dist/replay-interceptor.d.ts +6 -6
- package/packages/server/dist/replay-interceptor.js +2 -1
- package/packages/server/dist/resources/resources.d.ts +7 -3
- package/packages/server/dist/resources/resources.js +3 -2
- package/packages/server/dist/server.d.ts +34 -24
- package/packages/server/dist/server.js +2 -1
- package/packages/server/dist/tools/analyze.tools.d.ts +14 -10
- package/packages/server/dist/tools/analyze.tools.js +2 -1
- package/packages/server/dist/tools/audit.tool.d.ts +9 -0
- package/packages/server/dist/tools/audit.tool.js +2 -0
- package/packages/server/dist/tools/bridge.tools.d.ts +35 -0
- package/packages/server/dist/tools/bridge.tools.js +16 -0
- package/packages/server/dist/tools/evolution.tools.d.ts +8 -0
- package/packages/server/dist/tools/evolution.tools.js +6 -0
- package/packages/server/dist/tools/forge.tools.d.ts +13 -11
- package/packages/server/dist/tools/forge.tools.js +11 -13
- package/packages/server/dist/tools/forget.tool.d.ts +7 -3
- package/packages/server/dist/tools/forget.tool.js +2 -7
- package/packages/server/dist/tools/graph.tool.d.ts +7 -3
- package/packages/server/dist/tools/graph.tool.js +5 -5
- package/packages/server/dist/tools/list.tool.d.ts +7 -3
- package/packages/server/dist/tools/list.tool.js +3 -8
- package/packages/server/dist/tools/lookup.tool.d.ts +7 -3
- package/packages/server/dist/tools/lookup.tool.js +3 -9
- package/packages/server/dist/tools/onboard.tool.d.ts +8 -4
- package/packages/server/dist/tools/onboard.tool.js +3 -2
- package/packages/server/dist/tools/policy.tools.d.ts +8 -0
- package/packages/server/dist/tools/policy.tools.js +3 -0
- package/packages/server/dist/tools/produce.tool.d.ts +6 -2
- package/packages/server/dist/tools/produce.tool.js +3 -2
- package/packages/server/dist/tools/read.tool.d.ts +7 -3
- package/packages/server/dist/tools/read.tool.js +3 -6
- package/packages/server/dist/tools/reindex.tool.d.ts +10 -6
- package/packages/server/dist/tools/reindex.tool.js +3 -2
- package/packages/server/dist/tools/remember.tool.d.ts +8 -3
- package/packages/server/dist/tools/remember.tool.js +4 -5
- package/packages/server/dist/tools/replay.tool.d.ts +6 -2
- package/packages/server/dist/tools/replay.tool.js +3 -6
- package/packages/server/dist/tools/search.tool.d.ts +10 -4
- package/packages/server/dist/tools/search.tool.js +7 -18
- package/packages/server/dist/tools/status.tool.d.ts +7 -3
- package/packages/server/dist/tools/status.tool.js +3 -3
- package/packages/server/dist/tools/toolkit.tools.d.ts +36 -34
- package/packages/server/dist/tools/toolkit.tools.js +20 -21
- package/packages/server/dist/tools/update.tool.d.ts +7 -3
- package/packages/server/dist/tools/update.tool.js +2 -6
- package/packages/server/dist/tools/utility.tools.d.ts +15 -14
- package/packages/server/dist/tools/utility.tools.js +11 -23
- package/packages/server/dist/version-check.d.ts +5 -1
- package/packages/server/dist/version-check.js +2 -1
- package/packages/store/dist/graph-store.interface.d.ts +89 -86
- package/packages/store/dist/graph-store.interface.js +1 -0
- package/packages/store/dist/index.d.ts +6 -6
- package/packages/store/dist/index.js +1 -1
- package/packages/store/dist/lance-store.d.ts +37 -30
- package/packages/store/dist/lance-store.js +2 -1
- package/packages/store/dist/sqlite-graph-store.d.ts +43 -46
- package/packages/store/dist/sqlite-graph-store.js +14 -13
- package/packages/store/dist/store-factory.d.ts +11 -7
- package/packages/store/dist/store-factory.js +2 -1
- package/packages/store/dist/store.interface.d.ts +47 -44
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +66 -0
- package/packages/tools/dist/audit.js +7 -0
- package/packages/tools/dist/batch.d.ts +20 -17
- package/packages/tools/dist/batch.js +2 -1
- package/packages/tools/dist/changelog.d.ts +29 -26
- package/packages/tools/dist/changelog.js +3 -2
- package/packages/tools/dist/check.d.ts +45 -22
- package/packages/tools/dist/check.js +3 -2
- package/packages/tools/dist/checkpoint.d.ts +17 -14
- package/packages/tools/dist/checkpoint.js +2 -2
- package/packages/tools/dist/codemod.d.ts +35 -32
- package/packages/tools/dist/codemod.js +3 -2
- package/packages/tools/dist/compact.d.ts +34 -35
- package/packages/tools/dist/compact.js +3 -2
- package/packages/tools/dist/data-transform.d.ts +10 -7
- package/packages/tools/dist/data-transform.js +2 -1
- package/packages/tools/dist/dead-symbols.d.ts +29 -17
- package/packages/tools/dist/dead-symbols.js +3 -2
- package/packages/tools/dist/delegate.d.ts +26 -23
- package/packages/tools/dist/delegate.js +2 -5
- package/packages/tools/dist/diff-parse.d.ts +24 -21
- package/packages/tools/dist/diff-parse.js +4 -3
- package/packages/tools/dist/digest.d.ts +43 -45
- package/packages/tools/dist/digest.js +5 -5
- package/packages/tools/dist/encode.d.ts +11 -8
- package/packages/tools/dist/encode.js +2 -1
- package/packages/tools/dist/env-info.d.ts +25 -22
- package/packages/tools/dist/env-info.js +2 -1
- package/packages/tools/dist/eval.d.ts +13 -10
- package/packages/tools/dist/eval.js +3 -3
- package/packages/tools/dist/evidence-map.d.ts +64 -61
- package/packages/tools/dist/evidence-map.js +3 -3
- package/packages/tools/dist/file-cache.d.ts +42 -0
- package/packages/tools/dist/file-cache.js +4 -0
- package/packages/tools/dist/file-summary.d.ts +34 -29
- package/packages/tools/dist/file-summary.js +3 -2
- package/packages/tools/dist/file-walk.d.ts +6 -3
- package/packages/tools/dist/file-walk.js +2 -1
- package/packages/tools/dist/find-examples.d.ts +26 -21
- package/packages/tools/dist/find-examples.js +4 -3
- package/packages/tools/dist/find.d.ts +39 -40
- package/packages/tools/dist/find.js +2 -1
- package/packages/tools/dist/forge-classify.d.ts +35 -38
- package/packages/tools/dist/forge-classify.js +3 -2
- package/packages/tools/dist/forge-ground.d.ts +58 -60
- package/packages/tools/dist/forge-ground.js +2 -1
- package/packages/tools/dist/git-context.d.ts +22 -19
- package/packages/tools/dist/git-context.js +4 -3
- package/packages/tools/dist/graph-query.d.ts +75 -78
- package/packages/tools/dist/graph-query.js +2 -1
- package/packages/tools/dist/guide.d.ts +26 -0
- package/packages/tools/dist/guide.js +2 -0
- package/packages/tools/dist/health.d.ts +13 -10
- package/packages/tools/dist/health.js +3 -1
- package/packages/tools/dist/http-request.d.ts +20 -17
- package/packages/tools/dist/http-request.js +2 -1
- package/packages/tools/dist/index.d.ts +54 -49
- package/packages/tools/dist/index.js +1 -1
- package/packages/tools/dist/lane.d.ts +28 -25
- package/packages/tools/dist/lane.js +7 -7
- package/packages/tools/dist/measure.d.ts +32 -29
- package/packages/tools/dist/measure.js +3 -2
- package/packages/tools/dist/onboard.d.ts +29 -26
- package/packages/tools/dist/onboard.js +18 -41
- package/packages/tools/dist/parse-output.d.ts +48 -45
- package/packages/tools/dist/parse-output.js +3 -2
- package/packages/tools/dist/path-resolver.d.ts +15 -0
- package/packages/tools/dist/path-resolver.js +2 -0
- package/packages/tools/dist/process-manager.d.ts +18 -15
- package/packages/tools/dist/process-manager.js +2 -1
- package/packages/tools/dist/queue.d.ts +28 -25
- package/packages/tools/dist/queue.js +2 -2
- package/packages/tools/dist/regex-test.d.ts +26 -23
- package/packages/tools/dist/regex-test.js +2 -1
- package/packages/tools/dist/rename.d.ts +28 -25
- package/packages/tools/dist/rename.js +3 -2
- package/packages/tools/dist/replay.d.ts +33 -30
- package/packages/tools/dist/replay.js +5 -6
- package/packages/tools/dist/response-envelope.d.ts +44 -0
- package/packages/tools/dist/response-envelope.js +2 -0
- package/packages/tools/dist/schema-validate.d.ts +15 -12
- package/packages/tools/dist/schema-validate.js +2 -1
- package/packages/tools/dist/scope-map.d.ts +45 -45
- package/packages/tools/dist/scope-map.js +2 -1
- package/packages/tools/dist/snippet.d.ts +26 -24
- package/packages/tools/dist/snippet.js +2 -1
- package/packages/tools/dist/stash.d.ts +13 -10
- package/packages/tools/dist/stash.js +2 -2
- package/packages/tools/dist/stratum-card.d.ts +27 -27
- package/packages/tools/dist/stratum-card.js +4 -5
- package/packages/tools/dist/symbol.d.ts +29 -25
- package/packages/tools/dist/symbol.js +4 -3
- package/packages/tools/dist/test-run.d.ts +19 -15
- package/packages/tools/dist/test-run.js +3 -2
- package/packages/tools/dist/text-utils.d.ts +6 -3
- package/packages/tools/dist/text-utils.js +3 -2
- package/packages/tools/dist/time-utils.d.ts +15 -12
- package/packages/tools/dist/time-utils.js +2 -1
- package/packages/tools/dist/trace.d.ts +24 -20
- package/packages/tools/dist/trace.js +3 -2
- package/packages/tools/dist/truncation.d.ts +14 -2
- package/packages/tools/dist/truncation.js +8 -14
- package/packages/tools/dist/watch.d.ts +28 -25
- package/packages/tools/dist/watch.js +2 -1
- package/packages/tools/dist/web-fetch.d.ts +35 -32
- package/packages/tools/dist/web-fetch.js +7 -12
- package/packages/tools/dist/web-search.d.ts +16 -13
- package/packages/tools/dist/web-search.js +2 -1
- package/packages/tools/dist/workset.d.ts +19 -16
- package/packages/tools/dist/workset.js +2 -2
- package/packages/tui/dist/App-BAlmxCCw.js +3 -0
- package/packages/tui/dist/App.d.ts +11 -5
- package/packages/tui/dist/App.js +1 -450
- package/packages/tui/dist/CuratedPanel-sYdZAICX.js +3 -0
- package/packages/tui/dist/LogPanel-DVB8Sv46.js +4 -0
- package/packages/tui/dist/SearchPanel-DREo6zgt.js +3 -0
- package/packages/tui/dist/StatusPanel-2ex8fLOO.js +3 -0
- package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
- package/packages/tui/dist/devtools-DUyj952l.js +8 -0
- package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +29 -0
- package/packages/tui/dist/index-B9VpfVPP.d.ts +14 -0
- package/packages/tui/dist/index.d.ts +3 -19
- package/packages/tui/dist/index.js +2 -476
- package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +317 -0
- package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -5
- package/packages/tui/dist/panels/CuratedPanel.js +1 -371
- package/packages/tui/dist/panels/LogPanel.d.ts +7 -2
- package/packages/tui/dist/panels/LogPanel.js +1 -449
- package/packages/tui/dist/panels/SearchPanel.d.ts +14 -7
- package/packages/tui/dist/panels/SearchPanel.js +1 -372
- package/packages/tui/dist/panels/StatusPanel.d.ts +11 -5
- package/packages/tui/dist/panels/StatusPanel.js +1 -371
- package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +151 -0
- package/scaffold/adapters/claude-code.mjs +20 -0
- package/scaffold/adapters/copilot.mjs +320 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Alpha.agent.md +14 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +14 -0
- package/scaffold/copilot/agents/Code-Reviewer-Alpha.agent.md +12 -0
- package/scaffold/copilot/agents/Code-Reviewer-Beta.agent.md +12 -0
- package/scaffold/copilot/agents/Debugger.agent.md +31 -0
- package/scaffold/copilot/agents/Documenter.agent.md +35 -0
- package/scaffold/copilot/agents/Explorer.agent.md +50 -0
- package/scaffold/copilot/agents/Frontend.agent.md +29 -0
- package/scaffold/copilot/agents/Implementer.agent.md +31 -0
- package/scaffold/copilot/agents/Orchestrator.agent.md +96 -0
- package/scaffold/copilot/agents/Planner.agent.md +45 -0
- package/scaffold/copilot/agents/README.md +57 -0
- package/scaffold/copilot/agents/Refactor.agent.md +30 -0
- package/scaffold/copilot/agents/Researcher-Alpha.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Beta.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Delta.agent.md +12 -0
- package/scaffold/copilot/agents/Researcher-Gamma.agent.md +12 -0
- package/scaffold/copilot/agents/Security.agent.md +42 -0
- package/scaffold/copilot/agents/_shared/adr-protocol.md +91 -0
- package/scaffold/copilot/agents/_shared/architect-reviewer-base.md +50 -0
- package/scaffold/copilot/agents/_shared/code-agent-base.md +70 -0
- package/scaffold/copilot/agents/_shared/code-reviewer-base.md +54 -0
- package/scaffold/copilot/agents/_shared/decision-protocol.md +27 -0
- package/scaffold/copilot/agents/_shared/forge-protocol.md +46 -0
- package/scaffold/copilot/agents/_shared/researcher-base.md +61 -0
- package/scaffold/copilot/agents/templates/adr-template.md +27 -0
- package/scaffold/copilot/agents/templates/execution-state.md +25 -0
- package/scaffold/copilot/prompts/ask.prompt.md +20 -0
- package/scaffold/copilot/prompts/debug.prompt.md +25 -0
- package/scaffold/copilot/prompts/design.prompt.md +22 -0
- package/scaffold/copilot/prompts/implement.prompt.md +26 -0
- package/scaffold/copilot/prompts/plan.prompt.md +24 -0
- package/scaffold/copilot/prompts/review.prompt.md +31 -0
- package/scaffold/definitions/agents.mjs +165 -0
- package/scaffold/definitions/bodies.mjs +292 -0
- package/scaffold/definitions/hooks.mjs +43 -0
- package/scaffold/definitions/models.mjs +56 -0
- package/scaffold/definitions/plugins.mjs +24 -0
- package/scaffold/definitions/prompts.mjs +145 -0
- package/scaffold/definitions/protocols.mjs +322 -0
- package/scaffold/definitions/tools.mjs +176 -0
- package/scaffold/generate.mjs +74 -0
- package/skills/brainstorming/SKILL.md +259 -0
- package/skills/brainstorming/scripts/frame-template.html +365 -0
- package/skills/brainstorming/scripts/helper.js +216 -0
- package/skills/brainstorming/scripts/server.cjs +9 -0
- package/skills/brainstorming/scripts/server.src.cjs +249 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +430 -0
- package/skills/knowledge-base/SKILL.md +34 -21
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared protocol content — base instructions referenced by multiple agents.
|
|
3
|
+
*
|
|
4
|
+
* Keys map to filenames: 'code-agent-base' → '_shared/code-agent-base.md'
|
|
5
|
+
* Content is IDE-agnostic markdown, but adapters may wrap it differently.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const PROTOCOLS = {
|
|
9
|
+
'code-agent-base': `# Code Agent — Shared Base Instructions
|
|
10
|
+
|
|
11
|
+
> This file contains shared protocols for all code-modifying agents (Implementer, Frontend, Refactor, Debugger). Each agent's definition file contains only its unique identity, constraints, and workflow. **Do not duplicate this content in agent files.**
|
|
12
|
+
|
|
13
|
+
## Invocation Mode Detection
|
|
14
|
+
|
|
15
|
+
You may be invoked in two modes:
|
|
16
|
+
1. **Direct** — you have full KB tool access. Execute KB Recall normally.
|
|
17
|
+
2. **Sub-agent** (via Orchestrator) — you may have limited MCP tool access.
|
|
18
|
+
The Orchestrator provides context under "## Prior KB Context" in your prompt.
|
|
19
|
+
If present, skip KB Recall and use the provided context instead.
|
|
20
|
+
|
|
21
|
+
**Detection:** If your prompt contains "## Prior KB Context", you are in sub-agent mode.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## FORGE Protocol (Quality Gate)
|
|
26
|
+
|
|
27
|
+
**Quick reference:**
|
|
28
|
+
1. If the Orchestrator provided FORGE tier in your prompt, use it. Otherwise, run \`forge_classify\` to determine tier.
|
|
29
|
+
2. **Floor tier** → implement directly, no evidence map needed.
|
|
30
|
+
3. **Standard/Critical tier** → Use \`evidence_map\` to track each critical-path claim as V/A/U during your work.
|
|
31
|
+
4. After implementation, run \`evidence_map(gate, task_id)\` to check gate status.
|
|
32
|
+
5. Use \`stratum_card\` for quick file context instead of reading full files. Use \`digest\` to compress accumulated context.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## KB Recall (BLOCKING — Before ANY Code Change)
|
|
37
|
+
|
|
38
|
+
1. **Search for relevant context:**
|
|
39
|
+
\`\`\`
|
|
40
|
+
search("feature/area keywords")
|
|
41
|
+
scope_map("what you are doing")
|
|
42
|
+
\`\`\`
|
|
43
|
+
2. **Check for existing patterns** — reuse established conventions
|
|
44
|
+
3. **Read design decisions** that constrain your implementation
|
|
45
|
+
4. **If KB has no hits**, proceed but **remember your findings at the end**
|
|
46
|
+
|
|
47
|
+
**Proceed only after KB search is complete.**
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## KB Learn (After Completing Work)
|
|
52
|
+
|
|
53
|
+
Before returning your handoff, persist discoveries to KB:
|
|
54
|
+
- Architecture insights → \`remember({ title, content, category: "patterns" })\`
|
|
55
|
+
- Non-obvious solutions → \`remember({ title, content, category: "troubleshooting" })\`
|
|
56
|
+
- Key decisions made → \`remember({ title, content, category: "decisions" })\`
|
|
57
|
+
- Outdated KB entries → \`update(path, content, reason)\`
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Handoff Format
|
|
62
|
+
|
|
63
|
+
Always return this structure when invoked as a sub-agent:
|
|
64
|
+
|
|
65
|
+
\`\`\`markdown
|
|
66
|
+
<handoff>
|
|
67
|
+
<status>SUCCESS | PARTIAL | FAILED | ESCALATE</status>
|
|
68
|
+
<summary>{1 sentence summary}</summary>
|
|
69
|
+
<artifacts>
|
|
70
|
+
- Created: {files}
|
|
71
|
+
- Modified: {files}
|
|
72
|
+
- Deleted: {files}
|
|
73
|
+
</artifacts>
|
|
74
|
+
<context>{what the next agent needs to know}</context>
|
|
75
|
+
<blockers>{any blocking issues}</blockers>
|
|
76
|
+
</handoff>
|
|
77
|
+
\`\`\`
|
|
78
|
+
`,
|
|
79
|
+
|
|
80
|
+
'researcher-base': `# Researcher — Shared Base Instructions
|
|
81
|
+
|
|
82
|
+
> Shared methodology for all Researcher variants. Each variant's definition contains only its unique identity and model assignment. **Do not duplicate.**
|
|
83
|
+
|
|
84
|
+
## Research Methodology
|
|
85
|
+
|
|
86
|
+
### Phase 1: KB Recall (BLOCKING)
|
|
87
|
+
\`\`\`
|
|
88
|
+
search("task keywords")
|
|
89
|
+
scope_map("what you need to investigate")
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
### Phase 2: Exploration
|
|
93
|
+
- Use \`find\`, \`symbol\`, \`trace\` for code exploration
|
|
94
|
+
- Use \`file_summary\`, \`compact\` for efficient file reading
|
|
95
|
+
- Use \`analyze_structure\`, \`analyze_dependencies\` for package-level understanding
|
|
96
|
+
- Use \`web_search\`, \`web_fetch\` for external documentation
|
|
97
|
+
|
|
98
|
+
### Phase 3: Synthesis
|
|
99
|
+
- Combine findings from multiple sources using \`digest\`
|
|
100
|
+
- Create \`stratum_card\` for key files that will be referenced later
|
|
101
|
+
- Build a coherent picture of the subsystem
|
|
102
|
+
|
|
103
|
+
### Phase 4: Report
|
|
104
|
+
Return structured findings. Always include:
|
|
105
|
+
1. **Summary** — 1-3 sentence overview
|
|
106
|
+
2. **Key Findings** — Bullet list of important discoveries
|
|
107
|
+
3. **Files Examined** — Paths with brief purpose notes
|
|
108
|
+
4. **Recommendation** — Your suggested approach with reasoning
|
|
109
|
+
5. **Trade-offs** — Pros and cons of alternatives
|
|
110
|
+
6. **Risks** — What could go wrong
|
|
111
|
+
|
|
112
|
+
### Phase 5: Persist
|
|
113
|
+
\`remember\` key findings for future recall.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Multi-Model Decision Context
|
|
118
|
+
|
|
119
|
+
When invoked for a decision analysis, you receive a specific question. You MUST:
|
|
120
|
+
1. **Commit to a recommendation** — do not hedge with "it depends"
|
|
121
|
+
2. **Provide concrete reasoning** — cite specific files, patterns, or constraints
|
|
122
|
+
3. **Acknowledge trade-offs** — show you considered alternatives
|
|
123
|
+
4. **State your confidence level** — high/medium/low with reasoning
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Invocation Mode Detection
|
|
128
|
+
|
|
129
|
+
- **Direct** (has KB tools) → Execute KB Recall normally
|
|
130
|
+
- **Sub-agent** (prompt has "## Prior KB Context") → Skip KB Recall, use provided context
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Context Efficiency
|
|
135
|
+
|
|
136
|
+
- **Prefer \`file_summary\` over \`read_file\`** for understanding structure
|
|
137
|
+
- **Prefer \`compact\` over full reads** when you need specific sections
|
|
138
|
+
- **Use \`digest\`** when synthesizing from 3+ sources
|
|
139
|
+
- **Use \`stratum_card\`** for files you'll reference repeatedly
|
|
140
|
+
`,
|
|
141
|
+
|
|
142
|
+
'code-reviewer-base': `# Code-Reviewer — Shared Base Instructions
|
|
143
|
+
|
|
144
|
+
> Shared methodology for all Code-Reviewer variants. Each variant's definition contains only identity and model. **Do not duplicate.**
|
|
145
|
+
|
|
146
|
+
## Review Workflow
|
|
147
|
+
|
|
148
|
+
1. **KB Recall** — Search for relevant conventions, past review findings
|
|
149
|
+
2. **Blast Radius** — \`blast_radius\` on changed files to understand impact
|
|
150
|
+
3. **FORGE Classify** — \`forge_classify\` to determine review depth
|
|
151
|
+
4. **Review** — Evaluate against all dimensions below
|
|
152
|
+
5. **Validate** — Run \`check\` (typecheck + lint) and \`test_run\`
|
|
153
|
+
6. **Report** — Structured findings with verdict
|
|
154
|
+
7. **Persist** — \`remember\` any new patterns or issues
|
|
155
|
+
|
|
156
|
+
## Review Dimensions
|
|
157
|
+
|
|
158
|
+
| Dimension | What to Check |
|
|
159
|
+
|-----------|---------------|
|
|
160
|
+
| **Correctness** | Logic errors, off-by-one, null handling, async/await |
|
|
161
|
+
| **Security** | OWASP Top 10, input validation, secrets exposure |
|
|
162
|
+
| **Performance** | N+1 queries, unnecessary allocations, missing caching |
|
|
163
|
+
| **Maintainability** | Naming, complexity, DRY, single responsibility |
|
|
164
|
+
| **Testing** | Coverage for new/changed logic, edge cases |
|
|
165
|
+
| **Patterns** | Consistency with existing codebase conventions |
|
|
166
|
+
| **Types** | Proper typing, no \`any\`, generics where useful |
|
|
167
|
+
|
|
168
|
+
## Output Format
|
|
169
|
+
|
|
170
|
+
\`\`\`markdown
|
|
171
|
+
## Code Review: {scope}
|
|
172
|
+
**Verdict: APPROVED | NEEDS_REVISION | FAILED**
|
|
173
|
+
**Severity: {count by level}**
|
|
174
|
+
|
|
175
|
+
### Findings
|
|
176
|
+
1. **[SEVERITY]** {file}:{line} — Description and fix
|
|
177
|
+
|
|
178
|
+
### Summary
|
|
179
|
+
{Overall assessment, key concerns}
|
|
180
|
+
\`\`\`
|
|
181
|
+
|
|
182
|
+
## Severity Levels
|
|
183
|
+
|
|
184
|
+
- **CRITICAL** — Correctness bug that will cause runtime failure
|
|
185
|
+
- **HIGH** — Security issue or major design flaw
|
|
186
|
+
- **MEDIUM** — Code quality concern that should be fixed
|
|
187
|
+
- **LOW** — Style/naming suggestion
|
|
188
|
+
|
|
189
|
+
## Rules
|
|
190
|
+
|
|
191
|
+
- **APPROVED** requires zero CRITICAL/HIGH findings
|
|
192
|
+
- **NEEDS_REVISION** for any HIGH finding
|
|
193
|
+
- **FAILED** for any CRITICAL finding
|
|
194
|
+
- Always check for **test coverage** on new/changed code
|
|
195
|
+
`,
|
|
196
|
+
|
|
197
|
+
'architect-reviewer-base': `# Architect-Reviewer — Shared Base Instructions
|
|
198
|
+
|
|
199
|
+
> Shared methodology for all Architect-Reviewer variants. Each variant's definition contains only identity and model. **Do not duplicate.**
|
|
200
|
+
|
|
201
|
+
## Review Workflow
|
|
202
|
+
|
|
203
|
+
1. **KB Recall** — Search for architecture decisions, boundary conventions
|
|
204
|
+
2. **Analyze** — \`analyze_structure\`, \`analyze_dependencies\`, \`blast_radius\`
|
|
205
|
+
3. **Evaluate** — Check all dimensions below
|
|
206
|
+
4. **Report** — Structured findings with verdict
|
|
207
|
+
5. **Persist** — \`remember\` findings
|
|
208
|
+
|
|
209
|
+
## Review Dimensions
|
|
210
|
+
|
|
211
|
+
| Dimension | What to Check |
|
|
212
|
+
|-----------|---------------|
|
|
213
|
+
| **Dependency Direction** | Dependencies flow inward (domain ← services ← infra) |
|
|
214
|
+
| **Boundary Respect** | No cross-cutting between unrelated packages |
|
|
215
|
+
| **SOLID Compliance** | Single responsibility, dependency inversion |
|
|
216
|
+
| **Pattern Adherence** | Consistent with established patterns in codebase |
|
|
217
|
+
| **Interface Stability** | Public APIs don't break existing consumers |
|
|
218
|
+
| **Scalability** | Design handles growth (more data, more users, more features) |
|
|
219
|
+
| **Testability** | Dependencies injectable, side effects isolated |
|
|
220
|
+
|
|
221
|
+
## Output Format
|
|
222
|
+
|
|
223
|
+
\`\`\`markdown
|
|
224
|
+
## Architecture Review: {scope}
|
|
225
|
+
**Verdict: APPROVED | NEEDS_CHANGES | BLOCKED**
|
|
226
|
+
|
|
227
|
+
### Boundary Analysis
|
|
228
|
+
{dependency direction, package boundaries}
|
|
229
|
+
|
|
230
|
+
### Pattern Compliance
|
|
231
|
+
{consistency with existing patterns}
|
|
232
|
+
|
|
233
|
+
### Findings
|
|
234
|
+
1. **[SEVERITY]** {description} — Impact and recommendation
|
|
235
|
+
|
|
236
|
+
### Summary
|
|
237
|
+
{Overall structural assessment}
|
|
238
|
+
\`\`\`
|
|
239
|
+
|
|
240
|
+
## Rules
|
|
241
|
+
|
|
242
|
+
- **APPROVED** — No structural issues
|
|
243
|
+
- **NEEDS_CHANGES** — Fixable structural issues
|
|
244
|
+
- **BLOCKED** — Fundamental design flaw requiring rethink
|
|
245
|
+
- Always validate **dependency direction** — inner layers must not depend on outer
|
|
246
|
+
`,
|
|
247
|
+
|
|
248
|
+
'decision-protocol': `# Multi-Model Decision Protocol
|
|
249
|
+
|
|
250
|
+
The Orchestrator uses **multi-model decision analysis** to resolve non-trivial technical choices. This is the autonomous decision-making process — distinct from the interactive brainstorming skill.
|
|
251
|
+
|
|
252
|
+
## How It Works
|
|
253
|
+
|
|
254
|
+
The Orchestrator launches ALL available Researcher variants **in parallel** with the same question. Each returns an independent recommendation. The Orchestrator synthesizes results and presents the agreement/disagreement breakdown to the user.
|
|
255
|
+
|
|
256
|
+
## When to Use (Auto-Trigger Rules)
|
|
257
|
+
|
|
258
|
+
Trigger the decision protocol when there is an **unresolved non-trivial technical decision** after requirements are understood:
|
|
259
|
+
- Architecture or infrastructure decisions with multiple viable approaches
|
|
260
|
+
- Data model, schema, or storage strategy choices
|
|
261
|
+
- Technology or library selection
|
|
262
|
+
- Trade-offs where the "right" answer isn't obvious
|
|
263
|
+
- When a sub-agent returns a recommendation that has alternatives
|
|
264
|
+
|
|
265
|
+
**Do NOT use for:** Requirements discovery, user intent clarification, or feature scoping — those belong to the brainstorming skill.
|
|
266
|
+
|
|
267
|
+
## Key Rules
|
|
268
|
+
|
|
269
|
+
- Always launch in **parallel**, minimum 4 variants
|
|
270
|
+
- Use exact case-sensitive agent names — never rename or alias
|
|
271
|
+
- Never make a non-trivial technical decision without multi-model analysis
|
|
272
|
+
- **Produce an ADR** after every decision resolution
|
|
273
|
+
- \`remember\` the decision for future recall
|
|
274
|
+
`,
|
|
275
|
+
|
|
276
|
+
'forge-protocol': `# FORGE Protocol — Quality Overlay
|
|
277
|
+
|
|
278
|
+
> Follow the FORGE (Fact-Oriented Reasoning with Graduated Evidence) protocol for all code generation and modification tasks.
|
|
279
|
+
|
|
280
|
+
## KB Tools for FORGE
|
|
281
|
+
|
|
282
|
+
| Tool | Purpose | When |
|
|
283
|
+
|------|---------|------|
|
|
284
|
+
| \`forge_ground\` | Execute entire Ground phase — classify tier, scope map, unknowns, constraints | Start of every Standard/Critical task |
|
|
285
|
+
| \`forge_classify\` | Classify tier only (Floor/Standard/Critical) | Quick classification |
|
|
286
|
+
| \`evidence_map\` | CRUD + Gate evaluation for Evidence Map | Track claims during Build |
|
|
287
|
+
| \`stratum_card\` | Generate T1/T2 context cards from files | Replace full file reads |
|
|
288
|
+
| \`digest\` | Compress N text sources into budget | Compress accumulated context |
|
|
289
|
+
|
|
290
|
+
## Tier Classification
|
|
291
|
+
|
|
292
|
+
- **Floor**: Single file, no unknowns, no schema change, blast_radius ≤ 2. → Skip Phase 3.
|
|
293
|
+
- **Standard**: Default for multi-file or non-trivial tasks.
|
|
294
|
+
- **Critical**: blast_radius > 5, cross-service boundary, schema change, or security code.
|
|
295
|
+
|
|
296
|
+
When uncertain, round up.
|
|
297
|
+
|
|
298
|
+
## 4-Phase Flow
|
|
299
|
+
|
|
300
|
+
### Phase 1 — Ground
|
|
301
|
+
Read files, blast radius, classify tier, build Typed Unknown Queue, load constraints.
|
|
302
|
+
|
|
303
|
+
### Phase 2 — Build
|
|
304
|
+
Generate with evidence anchoring. Route typed unknowns mid-generation.
|
|
305
|
+
|
|
306
|
+
### Phase 3 — Break (Standard+ only, skip for Floor)
|
|
307
|
+
One adversarial round. Check error paths, edge cases, blast radius, convention violations.
|
|
308
|
+
|
|
309
|
+
### Phase 4 — Gate
|
|
310
|
+
Binary YIELD/HOLD. Contract-type unknowns → **HARD BLOCK**. Non-contract → 1 retry, then FORCED DELIVERY with annotation.
|
|
311
|
+
|
|
312
|
+
## Evidence Map
|
|
313
|
+
|
|
314
|
+
\`\`\`
|
|
315
|
+
evidence_map({ action: "create", task_id: "my-task", tier: "standard" })
|
|
316
|
+
evidence_map({ action: "add", task_id: "my-task", claim: "API contract unchanged", status: "V", receipt: "search → types.ts#L42" })
|
|
317
|
+
evidence_map({ action: "gate", task_id: "my-task" }) → YIELD / HOLD / HARD_BLOCK
|
|
318
|
+
\`\`\`
|
|
319
|
+
|
|
320
|
+
Status values: **V** (Verified + receipt), **A** (Assumed + reasoning), **U** (Unresolved).
|
|
321
|
+
`,
|
|
322
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool lists by agent role category.
|
|
3
|
+
*
|
|
4
|
+
* `kb` — Knowledge-base MCP tools (IDE-agnostic, same across all adapters).
|
|
5
|
+
* `ide` — IDE-native tool permissions, keyed by role. Each IDE adapter
|
|
6
|
+
* maps these to its own format (e.g., Copilot tool identifiers).
|
|
7
|
+
*
|
|
8
|
+
* When KB adds/removes a tool, update `kb` here — all agents pick it up.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const KB_TOOLS = [
|
|
12
|
+
'analyze_dependencies',
|
|
13
|
+
'analyze_diagram',
|
|
14
|
+
'analyze_entry_points',
|
|
15
|
+
'analyze_patterns',
|
|
16
|
+
'analyze_structure',
|
|
17
|
+
'analyze_symbols',
|
|
18
|
+
'audit',
|
|
19
|
+
'batch',
|
|
20
|
+
'blast_radius',
|
|
21
|
+
'changelog',
|
|
22
|
+
'check',
|
|
23
|
+
'checkpoint',
|
|
24
|
+
'codemod',
|
|
25
|
+
'compact',
|
|
26
|
+
'data_transform',
|
|
27
|
+
'dead_symbols',
|
|
28
|
+
'delegate',
|
|
29
|
+
'diff_parse',
|
|
30
|
+
'digest',
|
|
31
|
+
'encode',
|
|
32
|
+
'env',
|
|
33
|
+
'eval',
|
|
34
|
+
'evidence_map',
|
|
35
|
+
'file_summary',
|
|
36
|
+
'find',
|
|
37
|
+
'forge_classify',
|
|
38
|
+
'forge_ground',
|
|
39
|
+
'forget',
|
|
40
|
+
'git_context',
|
|
41
|
+
'graph',
|
|
42
|
+
'guide',
|
|
43
|
+
'health',
|
|
44
|
+
'http',
|
|
45
|
+
'lane',
|
|
46
|
+
'list',
|
|
47
|
+
'lookup',
|
|
48
|
+
'measure',
|
|
49
|
+
'onboard',
|
|
50
|
+
'parse_output',
|
|
51
|
+
'process',
|
|
52
|
+
'produce_knowledge',
|
|
53
|
+
'queue',
|
|
54
|
+
'read',
|
|
55
|
+
'regex_test',
|
|
56
|
+
'reindex',
|
|
57
|
+
'remember',
|
|
58
|
+
'rename',
|
|
59
|
+
'replay',
|
|
60
|
+
'schema_validate',
|
|
61
|
+
'scope_map',
|
|
62
|
+
'search',
|
|
63
|
+
'snippet',
|
|
64
|
+
'stash',
|
|
65
|
+
'status',
|
|
66
|
+
'stratum_card',
|
|
67
|
+
'symbol',
|
|
68
|
+
'test_run',
|
|
69
|
+
'time',
|
|
70
|
+
'trace',
|
|
71
|
+
'update',
|
|
72
|
+
'watch',
|
|
73
|
+
'web_fetch',
|
|
74
|
+
'web_search',
|
|
75
|
+
'workset',
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* IDE-native tool categories by role.
|
|
80
|
+
* These are abstract capability names — each IDE adapter maps them to concrete tool IDs.
|
|
81
|
+
*
|
|
82
|
+
* Categories:
|
|
83
|
+
* terminal — run commands
|
|
84
|
+
* problems — read diagnostics
|
|
85
|
+
* readFile — read file contents
|
|
86
|
+
* lastCommand — read terminal output
|
|
87
|
+
* subagent — invoke other agents
|
|
88
|
+
* createFile — create new files
|
|
89
|
+
* editFiles — edit existing files
|
|
90
|
+
* search — search codebase (code, text, usages, changes)
|
|
91
|
+
* web — web fetch, web search, GitHub
|
|
92
|
+
* todo — manage task lists
|
|
93
|
+
* memory — persistent memory (VS Code)
|
|
94
|
+
* runCommand — run VS Code commands
|
|
95
|
+
* switchAgent — switch to another agent
|
|
96
|
+
* killTerminal — kill a terminal
|
|
97
|
+
* createTask — create and run tasks
|
|
98
|
+
* terminalSel — read terminal selection
|
|
99
|
+
* fileSearch — search by filename
|
|
100
|
+
* listDir — list directory
|
|
101
|
+
* textSearch — text search
|
|
102
|
+
* searchResults — get search results
|
|
103
|
+
*/
|
|
104
|
+
export const IDE_CAPABILITIES = {
|
|
105
|
+
orchestrator: [
|
|
106
|
+
'memory',
|
|
107
|
+
'runCommand',
|
|
108
|
+
'switchAgent',
|
|
109
|
+
'killTerminal',
|
|
110
|
+
'createTask',
|
|
111
|
+
'terminal',
|
|
112
|
+
'terminalSel',
|
|
113
|
+
'lastCommand',
|
|
114
|
+
'problems',
|
|
115
|
+
'readFile',
|
|
116
|
+
'subagent',
|
|
117
|
+
'createFile',
|
|
118
|
+
'editFiles',
|
|
119
|
+
'search',
|
|
120
|
+
'web',
|
|
121
|
+
'todo',
|
|
122
|
+
'searchResults',
|
|
123
|
+
'textSearch',
|
|
124
|
+
],
|
|
125
|
+
researcher: ['terminal', 'problems', 'readFile', 'lastCommand', 'subagent', 'search', 'web'],
|
|
126
|
+
reviewer: ['terminal', 'problems', 'readFile', 'lastCommand', 'subagent', 'search', 'web'],
|
|
127
|
+
codeAgent: [
|
|
128
|
+
'createTask',
|
|
129
|
+
'terminal',
|
|
130
|
+
'problems',
|
|
131
|
+
'readFile',
|
|
132
|
+
'lastCommand',
|
|
133
|
+
'subagent',
|
|
134
|
+
'createFile',
|
|
135
|
+
'editFiles',
|
|
136
|
+
'search',
|
|
137
|
+
'todo',
|
|
138
|
+
],
|
|
139
|
+
debugger: [
|
|
140
|
+
'terminal',
|
|
141
|
+
'problems',
|
|
142
|
+
'readFile',
|
|
143
|
+
'terminalSel',
|
|
144
|
+
'lastCommand',
|
|
145
|
+
'subagent',
|
|
146
|
+
'createFile',
|
|
147
|
+
'editFiles',
|
|
148
|
+
'search',
|
|
149
|
+
],
|
|
150
|
+
refactor: ['terminal', 'problems', 'readFile', 'lastCommand', 'subagent', 'editFiles', 'search'],
|
|
151
|
+
explorer: ['problems', 'readFile', 'search', 'fileSearch', 'listDir', 'textSearch'],
|
|
152
|
+
planner: [
|
|
153
|
+
'terminal',
|
|
154
|
+
'problems',
|
|
155
|
+
'readFile',
|
|
156
|
+
'lastCommand',
|
|
157
|
+
'subagent',
|
|
158
|
+
'createFile',
|
|
159
|
+
'editFiles',
|
|
160
|
+
'search',
|
|
161
|
+
'web',
|
|
162
|
+
'todo',
|
|
163
|
+
],
|
|
164
|
+
security: ['terminal', 'problems', 'readFile', 'subagent', 'search', 'web'],
|
|
165
|
+
documenter: [
|
|
166
|
+
'terminal',
|
|
167
|
+
'problems',
|
|
168
|
+
'readFile',
|
|
169
|
+
'lastCommand',
|
|
170
|
+
'subagent',
|
|
171
|
+
'createFile',
|
|
172
|
+
'editFiles',
|
|
173
|
+
'search',
|
|
174
|
+
'web',
|
|
175
|
+
],
|
|
176
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Scaffold generator — reads definitions, picks adapter, writes files.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node scaffold/generate.mjs # Default: all adapters
|
|
7
|
+
* node scaffold/generate.mjs --ide copilot # Copilot only
|
|
8
|
+
* node scaffold/generate.mjs --ide claude-code # Claude Code only [stub]
|
|
9
|
+
*
|
|
10
|
+
* Architecture:
|
|
11
|
+
* definitions/ — IDE-agnostic data (agents, models, tools, prompts, hooks, plugins)
|
|
12
|
+
* adapters/ — IDE-specific generators (copilot, claude-code)
|
|
13
|
+
* {ide}/ — Generated output (what `kb init` copies into workspaces)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
17
|
+
import { dirname, resolve } from 'node:path';
|
|
18
|
+
import { fileURLToPath } from 'node:url';
|
|
19
|
+
import { generateClaudeCode } from './adapters/claude-code.mjs';
|
|
20
|
+
import { generateCopilot } from './adapters/copilot.mjs';
|
|
21
|
+
|
|
22
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
|
|
24
|
+
const ADAPTERS = {
|
|
25
|
+
copilot: { generate: generateCopilot, outDir: 'copilot' },
|
|
26
|
+
'claude-code': { generate: generateClaudeCode, outDir: 'claude-code' },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// ─── Parse args ───────────────────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
const args = process.argv.slice(2);
|
|
32
|
+
const ideIdx = args.indexOf('--ide');
|
|
33
|
+
const targetIde = ideIdx >= 0 ? args[ideIdx + 1] : null;
|
|
34
|
+
|
|
35
|
+
const idesToRun = targetIde ? [targetIde] : Object.keys(ADAPTERS);
|
|
36
|
+
|
|
37
|
+
// ─── Generate ─────────────────────────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
for (const ide of idesToRun) {
|
|
40
|
+
const adapter = ADAPTERS[ide];
|
|
41
|
+
if (!adapter) {
|
|
42
|
+
console.error(`Unknown IDE: ${ide}. Available: ${Object.keys(ADAPTERS).join(', ')}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const outDir = resolve(__dirname, adapter.outDir);
|
|
47
|
+
|
|
48
|
+
// Clean output directory for a fresh generation
|
|
49
|
+
if (existsSync(outDir)) {
|
|
50
|
+
rmSync(outDir, { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
console.log(`\n─── Generating ${ide} scaffold ───`);
|
|
54
|
+
|
|
55
|
+
const files = adapter.generate();
|
|
56
|
+
|
|
57
|
+
if (files.length === 0) {
|
|
58
|
+
console.log(` (stub — no files generated)`);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
let count = 0;
|
|
63
|
+
for (const { path, content } of files) {
|
|
64
|
+
const fullPath = resolve(outDir, path);
|
|
65
|
+
mkdirSync(dirname(fullPath), { recursive: true });
|
|
66
|
+
writeFileSync(fullPath, content, 'utf-8');
|
|
67
|
+
console.log(` ${path}`);
|
|
68
|
+
count++;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
console.log(` → ${count} files written to scaffold/${adapter.outDir}/`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log('\nDone!');
|