@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
|
@@ -1,147 +1,92 @@
|
|
|
1
|
-
import{appendFileSync as
|
|
2
|
-
|
|
3
|
-
This project uses **@vpxa/kb** as an MCP knowledge base server.
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
| \`
|
|
41
|
-
| \`
|
|
42
|
-
| \`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
| \`kb_parse_output\` | Parse build tool output (tsc, vitest, biome, git) into structured JSON. |
|
|
91
|
-
|
|
92
|
-
### FORGE & Context Compression
|
|
93
|
-
| Tool | Purpose |
|
|
94
|
-
|------|---------|
|
|
95
|
-
| \`kb_forge_ground\` | Full FORGE Ground phase (classify + scope + constraints + evidence). |
|
|
96
|
-
| \`kb_forge_classify\` | Quick FORGE tier classification (Floor/Standard/Critical). |
|
|
97
|
-
| \`kb_evidence_map\` | Track critical-path claims as Verified/Assumed/Unknown with receipts. |
|
|
98
|
-
| \`kb_digest\` | Compress multiple text blocks into token-budgeted digest. |
|
|
99
|
-
| \`kb_stratum_card\` | Generate T1/T2 context cards (10-100x token reduction). |
|
|
100
|
-
|
|
101
|
-
### Web & Network
|
|
102
|
-
| Tool | Purpose |
|
|
103
|
-
|------|---------|
|
|
104
|
-
| \`kb_web_fetch\` | Fetch web page \u2192 LLM-optimized markdown. CSS selectors, 4 modes, smart truncation. |
|
|
105
|
-
| \`kb_web_search\` | Search the web via DuckDuckGo (no API key needed). |
|
|
106
|
-
| \`kb_http\` | HTTP requests (GET/POST/PUT/PATCH/DELETE) for API testing with timing. |
|
|
107
|
-
|
|
108
|
-
### Verified Lanes
|
|
109
|
-
| Tool | Purpose |
|
|
110
|
-
|------|---------|
|
|
111
|
-
| \`kb_lane\` | Manage isolated file copies for parallel exploration. Actions: \`create\`, \`list\`, \`status\`, \`diff\`, \`merge\`, \`discard\`. |
|
|
112
|
-
|
|
113
|
-
### Git & Environment
|
|
114
|
-
| Tool | Purpose |
|
|
115
|
-
|------|---------|
|
|
116
|
-
| \`kb_git_context\` | Branch, status, recent commits, optional diff stats. |
|
|
117
|
-
| \`kb_process\` | Process supervisor (start/stop/logs). |
|
|
118
|
-
| \`kb_watch\` | Filesystem watcher for auto-triggered workflows. |
|
|
119
|
-
| \`kb_delegate\` | Delegate subtask to a local Ollama model. |
|
|
120
|
-
|
|
121
|
-
### Developer Utilities
|
|
122
|
-
| Tool | Purpose |
|
|
123
|
-
|------|---------|
|
|
124
|
-
| \`kb_regex_test\` | Test regex patterns with match/replace/split modes. |
|
|
125
|
-
| \`kb_encode\` | Base64, URL, SHA-256, MD5, hex encode/decode, JWT decode. |
|
|
126
|
-
| \`kb_measure\` | Code complexity metrics (cyclomatic complexity, line counts). |
|
|
127
|
-
| \`kb_changelog\` | Generate changelog from git history (conventional commits). |
|
|
128
|
-
| \`kb_schema_validate\` | Validate JSON data against JSON Schema. |
|
|
129
|
-
| \`kb_snippet\` | Save/get/search/delete persistent code snippets. |
|
|
130
|
-
| \`kb_env\` | System and runtime environment info (sensitive values redacted). |
|
|
131
|
-
| \`kb_time\` | Date parsing, timezone conversion, duration math. |
|
|
132
|
-
|
|
133
|
-
### System
|
|
134
|
-
| Tool | Purpose |
|
|
135
|
-
|------|---------|
|
|
136
|
-
| \`kb_status\` | Index statistics (record count, file count, content types). |
|
|
137
|
-
| \`kb_reindex\` | Rebuild the vector index from configured sources. |
|
|
138
|
-
| \`kb_health\` | Project health checks (package.json, tsconfig, lockfile, etc.). |
|
|
139
|
-
| \`kb_onboard\` | First-time codebase onboarding \u2014 runs all analyses, auto-persists results. |
|
|
140
|
-
| \`kb_graph\` | Knowledge graph queries (find_nodes, find_edges, neighbors, traverse, stats). |
|
|
141
|
-
| \`kb_queue\` | Task queue for sequential agent operations. |
|
|
142
|
-
| \`kb_replay_list\` | View audit trail of tool invocations. |
|
|
143
|
-
| \`kb_replay_clear\` | Clear the replay audit trail. |
|
|
144
|
-
`}function w(e){return`# ${e} \u2014 Agent Instructions
|
|
1
|
+
import{appendFileSync as e,copyFileSync as t,existsSync as n,mkdirSync as r,readFileSync as i,readdirSync as a,statSync as o,writeFileSync as s}from"node:fs";import{basename as c,dirname as l,resolve as u}from"node:path";import{fileURLToPath as d}from"node:url";const f={serverName:`knowledge-base`,sources:[{path:`.`,excludePatterns:[`**/node_modules/**`,`**/dist/**`,`**/build/**`,`**/.git/**`,`**/.kb-data/**`,`**/coverage/**`,`**/*.min.js`,`**/package-lock.json`,`**/pnpm-lock.yaml`]}],indexing:{chunkSize:1500,chunkOverlap:200,minChunkSize:100},embedding:{model:`mixedbread-ai/mxbai-embed-large-v1`,dimensions:1024},store:{backend:`lancedb`,path:`.kb-data/lance`},curated:{path:`curated`}};function p(e){return{servers:{[e]:{type:`stdio`,command:`npx`,args:[`@vpxa/kb`,`serve`]}}}}function m(e,t){let n=e=>e;return`# ${e} — Copilot Instructions
|
|
2
|
+
|
|
3
|
+
This project uses **@vpxa/kb** as an MCP knowledge base server. The KB provides search, context compression, persistent memory, and validation tools that **MUST** be used to maintain quality and performance.
|
|
4
|
+
|
|
5
|
+
## Mandatory Rules
|
|
6
|
+
|
|
7
|
+
### 1. ALWAYS search before acting
|
|
8
|
+
Before writing or modifying code, you MUST recall prior decisions and understand the affected area:
|
|
9
|
+
\`\`\`
|
|
10
|
+
${n(`search`)}({ query: "<task keywords>" })
|
|
11
|
+
${n(`scope_map`)}({ task: "<what you are doing>" })
|
|
12
|
+
\`\`\`
|
|
13
|
+
|
|
14
|
+
### 2. ALWAYS compress context before reading large files
|
|
15
|
+
Do NOT read entire files into context. Use these tools to reduce tokens and focus on what matters:
|
|
16
|
+
|
|
17
|
+
| Situation | Tool | Why |
|
|
18
|
+
|-----------|------|-----|
|
|
19
|
+
| Need relevant sections of a large file | \`${n(`compact`)}\` | Extracts only semantically relevant chunks — 5-20x reduction |
|
|
20
|
+
| Need to summarize multiple sources | \`${n(`digest`)}\` | Compresses multiple text blocks into a token-budgeted summary |
|
|
21
|
+
| Need a quick structural overview of a file | \`${n(`file_summary`)}\` | Returns exports, imports, functions without reading the full file |
|
|
22
|
+
| Need a reusable context card | \`${n(`stratum_card`)}\` | Generates T1/T2 cards — 10-100x token reduction |
|
|
23
|
+
|
|
24
|
+
**Example — reading a 400-line file:**
|
|
25
|
+
\`\`\`
|
|
26
|
+
# BAD: read_file entire file (wastes ~3000 tokens)
|
|
27
|
+
# GOOD: get structure first, then compact only what you need
|
|
28
|
+
${n(`file_summary`)}({ path: "src/http-client.ts" })
|
|
29
|
+
${n(`compact`)}({ path: "src/http-client.ts", query: "retry logic" })
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
### 3. ALWAYS use persistent memory
|
|
33
|
+
- **Start of session**: Read prior knowledge with \`${n(`list`)}()\` and \`${n(`search`)}({ query: "SESSION CHECKPOINT", origin: "curated" })\`
|
|
34
|
+
- **During session**: Use \`${n(`stash`)}\` for temporary working data, \`${n(`checkpoint`)}\` to save progress
|
|
35
|
+
- **End of session**: MUST call \`${n(`remember`)}\` to persist decisions, patterns, and lessons learned
|
|
36
|
+
- **Before proposing a new approach**: MUST \`${n(`search`)}\` to check if a decision already exists
|
|
37
|
+
|
|
38
|
+
| Tool | When | Persistence |
|
|
39
|
+
|------|------|-------------|
|
|
40
|
+
| \`${n(`stash`)}\` | Temporary data within a session (intermediate results, scratch notes) | Session only |
|
|
41
|
+
| \`${n(`checkpoint`)}\` | Save/restore session progress (resumable work) | Session only |
|
|
42
|
+
| \`${n(`remember`)}\` | Architecture decisions, conventions, patterns, troubleshooting | Permanent (survives reindex) |
|
|
43
|
+
|
|
44
|
+
### 4. ALWAYS validate before committing
|
|
45
|
+
\`\`\`
|
|
46
|
+
${n(`check`)}({}) # Typecheck + lint (returns summary by default)
|
|
47
|
+
${n(`test_run`)}({}) # Run tests
|
|
48
|
+
${n(`blast_radius`)}({ changed_files: ["..."] }) # Impact analysis
|
|
49
|
+
${n(`audit`)}({}) # Unified project audit with score and recommendations
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
### 5. Use FORGE for complex tasks
|
|
53
|
+
For tasks involving multiple files or architectural decisions:
|
|
54
|
+
\`\`\`
|
|
55
|
+
${n(`forge_classify`)}({ task: "<description>" }) # Classify complexity tier
|
|
56
|
+
${n(`forge_ground`)}({ task: "<description>" }) # Full analysis: scope + constraints + evidence
|
|
57
|
+
${n(`evidence_map`)}({ claims: [...] }) # Track verified vs assumed claims
|
|
58
|
+
\`\`\`
|
|
59
|
+
|
|
60
|
+
## Quick Workflow
|
|
61
|
+
|
|
62
|
+
\`\`\`
|
|
63
|
+
# 1. Orient
|
|
64
|
+
${n(`search`)}({ query: "task keywords" })
|
|
65
|
+
${n(`scope_map`)}({ task: "what you are doing" })
|
|
66
|
+
|
|
67
|
+
# 2. Read efficiently (NEVER raw-read large files)
|
|
68
|
+
${n(`file_summary`)}({ path: "relevant-file.ts" })
|
|
69
|
+
${n(`compact`)}({ path: "relevant-file.ts", query: "specific concern" })
|
|
70
|
+
|
|
71
|
+
# 3. Do the work
|
|
72
|
+
|
|
73
|
+
# 4. Validate
|
|
74
|
+
${n(`check`)}({})
|
|
75
|
+
${n(`test_run`)}({})
|
|
76
|
+
|
|
77
|
+
# 5. Persist
|
|
78
|
+
${n(`remember`)}({ title: "What I learned", content: "...", category: "decisions" })
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
## Context Budget Rules
|
|
82
|
+
|
|
83
|
+
- **Prefer \`${n(`file_summary`)}\` over \`read_file\`** for understanding file structure
|
|
84
|
+
- **Prefer \`${n(`compact`)}\` over full file reads** when you need specific sections (use \`path\` param to avoid read_file round-trip)
|
|
85
|
+
- **Prefer \`${n(`search`)}\` over \`grep_search\`** for semantic/conceptual queries
|
|
86
|
+
- **Prefer \`${n(`symbol`)}\` over manual grep** for finding definitions and references
|
|
87
|
+
- **Use \`${n(`digest`)}\`** when combining information from 3+ sources
|
|
88
|
+
- **Use \`${n(`stratum_card`)}\`** to create reusable compressed context for repeated reference
|
|
89
|
+
`}function h(e,t){let n=e=>e;return`# ${e} — Agent Instructions
|
|
145
90
|
|
|
146
91
|
## KB Knowledge Base
|
|
147
92
|
|
|
@@ -150,100 +95,211 @@ This project has a **@vpxa/kb** MCP server providing search, analysis, memory, a
|
|
|
150
95
|
### Skills Reference
|
|
151
96
|
|
|
152
97
|
| Context | Skill | Details |
|
|
153
|
-
|
|
154
|
-
| KB search, analysis, memory | \`kb\` | See [skills/knowledge-base/SKILL.md](skills/knowledge-base/SKILL.md) or run
|
|
98
|
+
|---------|-------|--------|
|
|
99
|
+
| KB search, analysis, memory | \`kb\` | See [.github/skills/knowledge-base/SKILL.md](.github/skills/knowledge-base/SKILL.md) or run \`${n(`status`)}({})\` |
|
|
100
|
+
| Brainstorming & design | \`brainstorming\` | See [.github/skills/brainstorming/SKILL.md](.github/skills/brainstorming/SKILL.md) |
|
|
155
101
|
|
|
156
102
|
### Available Tool Categories
|
|
157
103
|
|
|
158
104
|
| Category | Tools | Purpose |
|
|
159
105
|
|----------|-------|---------|
|
|
160
|
-
| Search & Discovery |
|
|
161
|
-
| Code Analysis |
|
|
162
|
-
| Knowledge |
|
|
163
|
-
| Execution |
|
|
164
|
-
| Code Manipulation |
|
|
165
|
-
| Context |
|
|
166
|
-
| FORGE |
|
|
167
|
-
| Web & API |
|
|
168
|
-
| Lanes | \`
|
|
169
|
-
| Git & Environment |
|
|
170
|
-
| Utilities |
|
|
171
|
-
| System |
|
|
106
|
+
| Search & Discovery | \`${n(`search`)}\`, \`${n(`find`)}\`, \`${n(`symbol`)}\`, \`${n(`trace`)}\`, \`${n(`scope_map`)}\`, \`${n(`lookup`)}\`, \`${n(`dead_symbols`)}\`, \`${n(`file_summary`)}\` | Find code, symbols, data flow, reading plans |
|
|
107
|
+
| Code Analysis | \`${n(`analyze_structure`)}\`, \`${n(`analyze_dependencies`)}\`, \`${n(`analyze_symbols`)}\`, \`${n(`analyze_patterns`)}\`, \`${n(`analyze_entry_points`)}\`, \`${n(`analyze_diagram`)}\`, \`${n(`blast_radius`)}\` | Structure, deps, patterns, impact, diagrams |
|
|
108
|
+
| Knowledge | \`${n(`remember`)}\`, \`${n(`read`)}\`, \`${n(`update`)}\`, \`${n(`forget`)}\`, \`${n(`list`)}\`, \`${n(`produce_knowledge`)}\` | Persistent cross-session memory |
|
|
109
|
+
| Execution | \`${n(`check`)}\`, \`${n(`test_run`)}\`, \`${n(`eval`)}\`, \`${n(`batch`)}\`, \`${n(`audit`)}\` | Typecheck, lint, test, run code, unified audit. \`check\` defaults to summary output (~300 tokens) |
|
|
110
|
+
| Code Manipulation | \`${n(`rename`)}\`, \`${n(`codemod`)}\`, \`${n(`diff_parse`)}\`, \`${n(`data_transform`)}\` | Safe renames, transforms, diff parsing |
|
|
111
|
+
| Context | \`${n(`compact`)}\`, \`${n(`workset`)}\`, \`${n(`stash`)}\`, \`${n(`checkpoint`)}\`, \`${n(`parse_output`)}\` | Manage working sets, save progress. \`compact\` accepts \`path\` for server-side file read |
|
|
112
|
+
| FORGE | \`${n(`forge_ground`)}\`, \`${n(`forge_classify`)}\`, \`${n(`evidence_map`)}\`, \`${n(`digest`)}\`, \`${n(`stratum_card`)}\` | Quality gates, context compression |
|
|
113
|
+
| Web & API | \`${n(`web_fetch`)}\`, \`${n(`web_search`)}\`, \`${n(`http`)}\` | Fetch pages, search web, test APIs |
|
|
114
|
+
| Lanes | \`${n(`lane`)}\` | Isolated file copies for parallel exploration (create/list/status/diff/merge/discard) |
|
|
115
|
+
| Git & Environment | \`${n(`git_context`)}\`, \`${n(`process`)}\`, \`${n(`watch`)}\`, \`${n(`delegate`)}\` | Git info, process management |
|
|
116
|
+
| Utilities | \`${n(`regex_test`)}\`, \`${n(`encode`)}\`, \`${n(`measure`)}\`, \`${n(`changelog`)}\`, \`${n(`schema_validate`)}\`, \`${n(`snippet`)}\`, \`${n(`env`)}\`, \`${n(`time`)}\` | Regex, encoding, metrics, validation |
|
|
117
|
+
| System | \`${n(`status`)}\`, \`${n(`reindex`)}\`, \`${n(`health`)}\`, \`${n(`guide`)}\`, \`${n(`onboard`)}\`, \`${n(`graph`)}\`, \`${n(`queue`)}\`, \`${n(`replay`)}\` | Index management, health checks, tool discovery, knowledge graph |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## MANDATORY: Context Reduction Protocol
|
|
172
122
|
|
|
173
|
-
|
|
123
|
+
**Every agent interaction MUST minimize context window usage.** Raw file reads waste tokens and degrade LLM output quality. Use these tools instead:
|
|
174
124
|
|
|
175
|
-
|
|
125
|
+
### Decision Tree — How to Read Code
|
|
176
126
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
127
|
+
\`\`\`
|
|
128
|
+
Need to understand a file?
|
|
129
|
+
├─ Just structure? → ${n(`file_summary`)} (exports, imports, functions — ~50 tokens)
|
|
130
|
+
├─ Specific section? → ${n(`compact`)}({ path: "file.ts", query: "topic" }) — 5-20x reduction
|
|
131
|
+
├─ Multiple files? → ${n(`digest`)} (multi-source compression — token-budgeted)
|
|
132
|
+
├─ Repeated reference? → ${n(`stratum_card`)} (T1/T2 card — 10-100x reduction)
|
|
133
|
+
└─ Full file needed? → ONLY as last resort, and compact it after reading
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
### Rules
|
|
137
|
+
1. **NEVER read a file >100 lines without compressing it first**
|
|
138
|
+
2. **ALWAYS use \`${n(`file_summary`)}\` before \`read_file\`** — often the summary is sufficient
|
|
139
|
+
3. **ALWAYS use \`${n(`compact`)}\` when you only need specific sections** of a file (use \`path\` param to read server-side)
|
|
140
|
+
4. **Use \`${n(`digest`)}\` when synthesizing from 3+ sources** — don't accumulate raw text
|
|
141
|
+
5. **Use \`${n(`stratum_card`)}\` for files you'll reference repeatedly** in a session
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## MANDATORY: Memory Protocol
|
|
146
|
+
|
|
147
|
+
**Every session MUST read and write persistent memory.** Without this, every conversation starts from zero.
|
|
148
|
+
|
|
149
|
+
### Session Start (MUST do ALL of these)
|
|
150
|
+
\`\`\`
|
|
151
|
+
${n(`status`)}({}) # Verify KB is ready
|
|
152
|
+
${n(`list`)}() # See what knowledge exists
|
|
153
|
+
${n(`search`)}({ query: "SESSION CHECKPOINT", origin: "curated" }) # Resume prior work
|
|
154
|
+
\`\`\`
|
|
155
|
+
|
|
156
|
+
### During Session
|
|
157
|
+
| Situation | Action |
|
|
158
|
+
|-----------|--------|
|
|
159
|
+
| Found a useful intermediate result | \`${n(`stash`)}({ key: "name", value: "data" })\` |
|
|
160
|
+
| Completed a milestone | \`${n(`checkpoint`)}({ action: "save", name: "milestone" })\` |
|
|
161
|
+
| Made an architecture decision | \`${n(`remember`)}({ title: "...", category: "decisions" })\` |
|
|
162
|
+
| Discovered a pattern or convention | \`${n(`remember`)}({ title: "...", category: "patterns" })\` |
|
|
163
|
+
| Found a non-obvious solution | \`${n(`remember`)}({ title: "...", category: "troubleshooting" })\` |
|
|
164
|
+
| About to propose a new approach | \`${n(`search`)}({ query: "..." })\` — check if decided before |
|
|
165
|
+
|
|
166
|
+
### Session End (MUST do this)
|
|
167
|
+
\`\`\`
|
|
168
|
+
${n(`remember`)}({
|
|
169
|
+
title: "Session checkpoint: <topic>",
|
|
170
|
+
content: "<what was done, decisions made, blockers, next steps>",
|
|
171
|
+
category: "conventions"
|
|
172
|
+
})
|
|
173
|
+
\`\`\`
|
|
174
|
+
|
|
175
|
+
### Memory Decision Tree
|
|
176
|
+
\`\`\`
|
|
177
|
+
Is this data temporary (scratch, intermediate)?
|
|
178
|
+
├─ Yes → ${n(`stash`)} (session-scoped key-value)
|
|
179
|
+
└─ No → Is it resumable progress?
|
|
180
|
+
├─ Yes → ${n(`checkpoint`)} (session-scoped snapshot)
|
|
181
|
+
└─ No → ${n(`remember`)} (permanent, survives reindex)
|
|
182
|
+
Categories: decisions | patterns | conventions | troubleshooting
|
|
183
|
+
\`\`\`
|
|
180
184
|
|
|
181
|
-
|
|
185
|
+
---
|
|
182
186
|
|
|
183
|
-
|
|
187
|
+
## MANDATORY: Search-Before-Act Protocol
|
|
188
|
+
|
|
189
|
+
**NEVER write or modify code without first searching for context.**
|
|
184
190
|
|
|
185
|
-
**Start of session:**
|
|
186
191
|
\`\`\`
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
# Before ANY code change:
|
|
193
|
+
${n(`search`)}({ query: "<what you're about to change>" }) # Prior decisions?
|
|
194
|
+
${n(`scope_map`)}({ task: "<description>" }) # What files to read?
|
|
195
|
+
${n(`symbol`)}({ name: "<key symbol>" }) # Where is it defined/used?
|
|
189
196
|
\`\`\`
|
|
190
197
|
|
|
191
|
-
|
|
198
|
+
If \`${n(`search`)}\` returns a prior decision about the topic, you MUST follow it or explicitly explain why you're deviating.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## MANDATORY: Validation Protocol
|
|
203
|
+
|
|
204
|
+
**NEVER commit or present code without validation.**
|
|
205
|
+
|
|
192
206
|
\`\`\`
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
207
|
+
${n(`check`)}({}) # Typecheck + lint (tsc + biome)
|
|
208
|
+
${n(`test_run`)}({}) # Run tests
|
|
209
|
+
${n(`blast_radius`)}({ changed_files: ["..."] }) # Impact analysis
|
|
210
|
+
${n(`audit`)}({}) # Unified project audit (structure, deps, patterns, health, dead symbols, entry points)
|
|
196
211
|
\`\`\`
|
|
197
212
|
|
|
198
|
-
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## FORGE Protocol (for complex tasks)
|
|
216
|
+
|
|
217
|
+
For tasks touching 3+ files or involving architectural decisions:
|
|
218
|
+
|
|
199
219
|
\`\`\`
|
|
200
|
-
|
|
220
|
+
${n(`forge_classify`)}({ task: "<description>" }) # Quick: Floor/Standard/Critical tier
|
|
221
|
+
${n(`forge_ground`)}({ task: "<description>" }) # Full: scope + constraints + evidence
|
|
222
|
+
${n(`evidence_map`)}({ claims: ["claim1", "claim2"] }) # Track verified vs assumed
|
|
201
223
|
\`\`\`
|
|
202
224
|
|
|
203
|
-
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Search Modes
|
|
228
|
+
|
|
229
|
+
| Mode | When | Example |
|
|
230
|
+
|------|------|---------|
|
|
231
|
+
| \`hybrid\` (default) | General queries | \`${n(`search`)}({ query: "error handling" })\` |
|
|
232
|
+
| \`semantic\` | Conceptual/meaning-based | \`${n(`search`)}({ query: "retry with backoff", search_mode: "semantic" })\` |
|
|
233
|
+
| \`keyword\` | Exact identifiers | \`${n(`search`)}({ query: "CircuitBreaker", search_mode: "keyword" })\` |
|
|
234
|
+
|
|
235
|
+
Filters: \`origin\` (\`indexed\`/\`curated\`/\`produced\`), \`category\`, \`content_type\`, \`tags\`, \`min_score\`.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Workflow Chains
|
|
204
240
|
|
|
205
241
|
**Codebase onboarding:**
|
|
206
242
|
\`\`\`
|
|
207
|
-
|
|
243
|
+
${n(`onboard`)}({ path: "." }) → ${n(`produce_knowledge`)}({ path: "src/" }) → ${n(`remember`)}(...)
|
|
208
244
|
\`\`\`
|
|
209
245
|
|
|
210
246
|
**Planning a task:**
|
|
211
247
|
\`\`\`
|
|
212
|
-
|
|
248
|
+
${n(`search`)}({ query: "task keywords" })
|
|
249
|
+
→ ${n(`scope_map`)}({ task: "description" })
|
|
250
|
+
→ ${n(`file_summary`)} for each file in scope
|
|
251
|
+
→ ${n(`compact`)}({ path: "relevant-file.ts", query: "detail needed" }) for files needing detail
|
|
252
|
+
→ ${n(`workset`)}({ action: "save", name: "task", files: [...] })
|
|
213
253
|
\`\`\`
|
|
214
254
|
|
|
215
255
|
**Bug investigation:**
|
|
216
256
|
\`\`\`
|
|
217
|
-
|
|
257
|
+
${n(`parse_output`)}({ output: "<error>" })
|
|
258
|
+
→ ${n(`symbol`)}({ name: "failingFn" })
|
|
259
|
+
→ ${n(`trace`)}({ symbol: "failingFn", direction: "backward" })
|
|
260
|
+
→ ${n(`blast_radius`)}({ changed_files: ["suspect.ts"] })
|
|
218
261
|
\`\`\`
|
|
219
262
|
|
|
220
263
|
**Safe refactor with lanes:**
|
|
221
264
|
\`\`\`
|
|
222
|
-
|
|
265
|
+
${n(`lane`)}({ action: "create", name: "refactor", files: [...] })
|
|
266
|
+
→ [make changes]
|
|
267
|
+
→ ${n(`lane`)}({ action: "diff", name: "refactor" })
|
|
268
|
+
→ ${n(`check`)}({}) → ${n(`test_run`)}({})
|
|
269
|
+
→ ${n(`lane`)}({ action: "merge", name: "refactor" })
|
|
223
270
|
\`\`\`
|
|
224
271
|
|
|
225
272
|
**After making changes:**
|
|
226
273
|
\`\`\`
|
|
227
|
-
|
|
274
|
+
${n(`blast_radius`)}({ changed_files: ["src/file.ts"] })
|
|
275
|
+
→ ${n(`check`)}({}) → ${n(`test_run`)}({})
|
|
276
|
+
→ ${n(`reindex`)}({})
|
|
277
|
+
→ ${n(`remember`)}(...)
|
|
228
278
|
\`\`\`
|
|
229
279
|
|
|
230
|
-
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Knowledge Categories
|
|
283
|
+
|
|
284
|
+
| Category | What to store |
|
|
285
|
+
|----------|---------------|
|
|
286
|
+
| \`decisions\` | Architecture choices, trade-offs, rejected alternatives |
|
|
287
|
+
| \`patterns\` | Code patterns, naming conventions, structural patterns |
|
|
288
|
+
| \`conventions\` | Session checkpoints, workflow conventions, team agreements |
|
|
289
|
+
| \`troubleshooting\` | Non-obvious fixes, debugging strategies, workarounds |
|
|
231
290
|
|
|
232
|
-
|
|
291
|
+
---
|
|
233
292
|
|
|
234
|
-
|
|
293
|
+
## Core Rules Summary
|
|
235
294
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
`,
|
|
243
|
-
|
|
244
|
-
.
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
`,"utf-8"),console.log(" Created .gitignore with .kb-data/"));const n=g(s),l=t(s,".vscode"),d=t(l,"mcp.json");o(l)&&!o(d)&&(a(d,`${JSON.stringify(f(n),null,2)}
|
|
248
|
-
`,"utf-8"),console.log(" Created .vscode/mcp.json"));const b=t(s,".github"),k=t(b,"copilot-instructions.md");o(k)||(u(b,{recursive:!0}),a(k,y(n),"utf-8"),console.log(" Created .github/copilot-instructions.md"));const _=t(s,"AGENTS.md");o(_)||(a(_,w(n),"utf-8"),console.log(" Created AGENTS.md")),console.log(`
|
|
249
|
-
Knowledge base initialized! Next steps:`),console.log(" kb reindex Index your codebase"),console.log(" kb search Search indexed content"),console.log(" kb serve Start MCP server for IDE integration")}export{P as initProject};
|
|
295
|
+
1. **Search KB before proposing anything new** — prior decisions exist
|
|
296
|
+
2. **Compress context aggressively** — \`file_summary\` → \`compact\` → \`digest\`
|
|
297
|
+
3. **Use persistent memory** — \`remember\` decisions, \`stash\` temporary data
|
|
298
|
+
4. **Validate before committing** — \`check\` + \`test_run\` + \`blast_radius\`
|
|
299
|
+
5. **Follow \`_Next:\` hints** in tool responses for guided workflow
|
|
300
|
+
6. **Use FORGE for complex tasks** — \`forge_classify\` → \`forge_ground\` → \`evidence_map\`
|
|
301
|
+
`}function g(e,i,s=``,c=!1){r(i,{recursive:!0});for(let r of a(e)){let a=u(e,r),l=u(i,r),d=s?`${s}/${r}`:r;if(o(a).isDirectory())g(a,l,d,c);else if(c||!n(l)){let e=n(l)?`Updated`:`Created`;t(a,l),console.log(` ${e} .github/${d}`)}}}function _(e,t,r,s){if(n(e))for(let c of a(e)){let a=u(e,c),l=r?`${r}/${c}`:c;if(o(a).isDirectory())_(a,u(t,c),l,s);else{let e=u(t,c),r=i(a,`utf-8`);n(e)?r===i(e,`utf-8`)?s.push({status:`current`,relativePath:l,sourcePath:a}):s.push({status:`outdated`,relativePath:l,sourcePath:a,content:r}):s.push({status:`new`,relativePath:l,sourcePath:a,content:r})}}}async function v(t){let a=process.cwd(),o=u(a,`kb.config.json`);if(n(o)&&!t.force){console.log(`kb.config.json already exists. Use --force to overwrite.`);return}s(o,`${JSON.stringify(f,null,2)}\n`,`utf-8`),console.log(` Created kb.config.json`);let _=u(a,`curated`);n(_)||(r(_,{recursive:!0}),console.log(` Created curated/`));let v=u(a,`.gitignore`),y=[{dir:`.kb-data/`,label:`Knowledge base vector store`},{dir:`.brainstorm/`,label:`Brainstorming sessions`},{dir:`curated/`,label:`Curated knowledge entries`}];if(n(v)){let t=i(v,`utf-8`),n=y.filter(e=>!t.includes(e.dir));n.length>0&&(e(v,`\n${n.map(e=>`# ${e.label}\n${e.dir}`).join(`
|
|
302
|
+
`)}\n`,`utf-8`),console.log(` Added ${n.map(e=>e.dir).join(`, `)} to .gitignore`))}else s(v,`${y.map(e=>`# ${e.label}\n${e.dir}`).join(`
|
|
303
|
+
`)}\n`,`utf-8`),console.log(` Created .gitignore with KB entries`);let b=c(a),x=f.serverName,S=u(a,`.vscode`),C=u(S,`mcp.json`);n(S)&&!n(C)&&(s(C,`${JSON.stringify(p(x),null,2)}\n`,`utf-8`),console.log(` Created .vscode/mcp.json`));let w=u(a,`.github`),T=u(w,`copilot-instructions.md`);n(T)||(r(w,{recursive:!0}),s(T,m(b,x),`utf-8`),console.log(` Created .github/copilot-instructions.md`));let E=u(a,`AGENTS.md`);n(E)||(s(E,h(b,x),`utf-8`),console.log(` Created AGENTS.md`));let D=u(l(d(import.meta.url)),`..`,`..`,`..`,`..`);for(let e of[`knowledge-base`,`brainstorming`]){let r=u(D,`skills`,e);n(r)&&g(r,u(a,`.github`,`skills`,e),`skills/${e}`,t.force)}let O=u(D,`scaffold`,`copilot`);for(let e of[`agents`,`prompts`]){let r=u(O,e),i=u(a,`.github`,e);n(r)&&g(r,i,``,t.force)}for(let e of[`decisions`,`patterns`,`conventions`,`troubleshooting`]){let t=u(_,e);n(t)||r(t,{recursive:!0})}console.log(` Created curated/{decisions,patterns,conventions,troubleshooting}/`),console.log(`
|
|
304
|
+
Knowledge base initialized! Next steps:`),console.log(` kb reindex Index your codebase`),console.log(` kb search Search indexed content`),console.log(` kb serve Start MCP server for IDE integration`)}async function y(){let e=process.cwd(),t=u(l(d(import.meta.url)),`..`,`..`,`..`,`..`),r=[];for(let i of[`knowledge-base`,`brainstorming`]){let a=u(t,`skills`,i);n(a)&&_(a,u(e,`.github`,`skills`,i),`skills/${i}`,r)}let i=u(t,`scaffold`,`copilot`);for(let t of[`agents`,`prompts`])_(u(i,t),u(e,`.github`,t),t,r);let a={summary:{total:r.length,new:r.filter(e=>e.status===`new`).length,outdated:r.filter(e=>e.status===`outdated`).length,current:r.filter(e=>e.status===`current`).length},files:r};console.log(JSON.stringify(a,null,2))}export{y as guideProject,v as initProject};
|
|
305
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Command } from "../types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/cli/src/commands/knowledge.d.ts
|
|
4
|
+
declare const knowledgeCommands: Command[];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { knowledgeCommands };
|
|
3
7
|
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ctx as e}from"../context.js";import{extractNumFlag as t,extractStrFlag as n,readStdin as r,splitCsv as i}from"../helpers.js";import{compact as a}from"../../../tools/dist/index.js";const o=[{name:`remember`,description:`Store curated knowledge`,usage:`kb remember <title> --category <cat> [--tags tag1,tag2]`,run:async t=>{let a=n(t,`--category`,``).trim(),o=i(n(t,`--tags`,``)),s=t.shift()?.trim()??``,c=await r(),l=c.trim().length>0?c:t.join(` `).trim();(!s||!a||!l.trim())&&(console.error(`Usage: kb remember <title> --category <cat> [--tags tag1,tag2]`),process.exit(1));let{curated:u}=await e(),d=await u.remember(s,l,a,o);console.log(`Stored curated entry`),console.log(` Path: ${d.path}`),console.log(` Category: ${a}`),o.length>0&&console.log(` Tags: ${o.join(`, `)}`)}},{name:`forget`,description:`Remove a curated entry`,usage:`kb forget <path> --reason <reason>`,run:async t=>{let r=n(t,`--reason`,``).trim(),i=t.shift()?.trim()??``;(!i||!r)&&(console.error(`Usage: kb forget <path> --reason <reason>`),process.exit(1));let{curated:a}=await e(),o=await a.forget(i,r);console.log(`Removed curated entry: ${o.path}`)}},{name:`read`,description:`Read a curated entry`,usage:`kb read <path>`,run:async t=>{let n=t.shift()?.trim()??``;n||(console.error(`Usage: kb read <path>`),process.exit(1));let{curated:r}=await e(),i=await r.read(n);console.log(i.title),console.log(`─`.repeat(60)),console.log(`Path: ${i.path}`),console.log(`Category: ${i.category}`),console.log(`Version: ${i.version}`),console.log(`Tags: ${i.tags.length>0?i.tags.join(`, `):`None`}`),console.log(``),console.log(i.content)}},{name:`list`,description:`List curated entries`,usage:`kb list [--category <cat>] [--tag <tag>]`,run:async t=>{let r=n(t,`--category`,``).trim()||void 0,i=n(t,`--tag`,``).trim()||void 0,{curated:a}=await e(),o=await a.list({category:r,tag:i});if(o.length===0){console.log(`No curated entries found.`);return}console.log(`Curated entries (${o.length})`),console.log(`─`.repeat(60));for(let e of o){console.log(e.path),console.log(` ${e.title}`),console.log(` Category: ${e.category} | Version: ${e.version}`),console.log(` Tags: ${e.tags.length>0?e.tags.join(`, `):`None`}`);let t=e.contentPreview.replace(/\s+/g,` `).trim();t&&console.log(` Preview: ${t}`),console.log(``)}}},{name:`update`,description:`Update a curated entry`,usage:`kb update <path> --reason <reason>`,run:async t=>{let i=n(t,`--reason`,``).trim(),a=t.shift()?.trim()??``,o=await r();(!a||!i||!o.trim())&&(console.error(`Usage: kb update <path> --reason <reason>`),process.exit(1));let{curated:s}=await e(),c=await s.update(a,o,i);console.log(`Updated curated entry`),console.log(` Path: ${c.path}`),console.log(` Version: ${c.version}`)}},{name:`compact`,description:`Compress text for context`,usage:`kb compact <query> [--path <file>] [--max-chars N] [--segmentation paragraph|sentence|line]`,run:async i=>{let o=t(i,`--max-chars`,3e3),s=n(i,`--path`,``).trim()||void 0,c=n(i,`--segmentation`,`paragraph`),l=i.join(` `).trim(),u=s?void 0:await r();(!l||!s&&!u?.trim())&&(console.error(`Usage: kb compact <query> --path <file> OR cat file | kb compact <query>`),process.exit(1));let{embedder:d}=await e(),f=await a(d,{text:u,path:s,query:l,maxChars:o,segmentation:c});console.log(`Compressed ${f.originalChars} chars to ${f.compressedChars} chars`),console.log(`Ratio: ${(f.ratio*100).toFixed(1)}% | Segments: ${f.segmentsKept}/${f.segmentsTotal}`),console.log(``),console.log(f.text)}}];export{o as knowledgeCommands};
|
|
2
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Command } from "../types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/cli/src/commands/search.d.ts
|
|
4
|
+
declare const searchCommands: Command[];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { searchCommands };
|
|
3
7
|
//# sourceMappingURL=search.d.ts.map
|