@vpxa/kb 0.1.13 → 0.1.16
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 +65 -12
- package/package.json +14 -7
- package/packages/analyzers/dist/blast-radius-analyzer.d.ts +17 -21
- package/packages/analyzers/dist/blast-radius-analyzer.js +5 -12
- package/packages/analyzers/dist/dependency-analyzer.d.ts +31 -28
- package/packages/analyzers/dist/dependency-analyzer.js +6 -9
- package/packages/analyzers/dist/diagram-generator.d.ts +12 -9
- package/packages/analyzers/dist/diagram-generator.js +2 -4
- package/packages/analyzers/dist/entry-point-analyzer.d.ts +39 -36
- package/packages/analyzers/dist/entry-point-analyzer.js +4 -6
- 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 +34 -26
- package/packages/analyzers/dist/knowledge-producer.js +17 -15
- package/packages/analyzers/dist/pattern-analyzer.d.ts +14 -11
- package/packages/analyzers/dist/pattern-analyzer.js +2 -5
- package/packages/analyzers/dist/regex-call-graph.d.ts +6 -13
- package/packages/analyzers/dist/regex-call-graph.js +1 -1
- package/packages/analyzers/dist/structure-analyzer.d.ts +13 -10
- package/packages/analyzers/dist/structure-analyzer.js +2 -4
- package/packages/analyzers/dist/symbol-analyzer.d.ts +13 -9
- package/packages/analyzers/dist/symbol-analyzer.js +9 -13
- package/packages/analyzers/dist/ts-call-graph.d.ts +16 -14
- package/packages/analyzers/dist/ts-call-graph.js +1 -1
- package/packages/analyzers/dist/types.d.ts +82 -80
- package/packages/analyzers/dist/types.js +1 -0
- package/packages/chunker/dist/call-graph-extractor.d.ts +15 -12
- package/packages/chunker/dist/call-graph-extractor.js +1 -1
- package/packages/chunker/dist/chunker-factory.d.ts +16 -4
- package/packages/chunker/dist/chunker-factory.js +1 -1
- package/packages/chunker/dist/chunker.interface.d.ts +8 -5
- package/packages/chunker/dist/chunker.interface.js +1 -0
- package/packages/chunker/dist/code-chunker.d.ts +16 -13
- package/packages/chunker/dist/code-chunker.js +11 -14
- package/packages/chunker/dist/extractors/call-extractor.d.ts +24 -0
- package/packages/chunker/dist/extractors/call-extractor.js +1 -0
- package/packages/chunker/dist/extractors/entry-point-detector.d.ts +14 -0
- package/packages/chunker/dist/extractors/entry-point-detector.js +1 -0
- package/packages/chunker/dist/extractors/import-extractor.d.ts +14 -0
- package/packages/chunker/dist/extractors/import-extractor.js +1 -0
- package/packages/chunker/dist/extractors/pattern-detector.d.ts +14 -0
- package/packages/chunker/dist/extractors/pattern-detector.js +1 -0
- package/packages/chunker/dist/extractors/scope-resolver.d.ts +26 -0
- package/packages/chunker/dist/extractors/scope-resolver.js +1 -0
- package/packages/chunker/dist/extractors/symbol-extractor.d.ts +14 -0
- package/packages/chunker/dist/extractors/symbol-extractor.js +1 -0
- package/packages/chunker/dist/extractors/types.d.ts +36 -0
- package/packages/chunker/dist/extractors/types.js +1 -0
- package/packages/chunker/dist/generic-chunker.d.ts +14 -11
- package/packages/chunker/dist/generic-chunker.js +5 -5
- package/packages/chunker/dist/index.d.ts +19 -8
- package/packages/chunker/dist/index.js +1 -1
- package/packages/chunker/dist/markdown-chunker.d.ts +16 -13
- package/packages/chunker/dist/markdown-chunker.js +3 -10
- package/packages/chunker/dist/wasm/languages.d.ts +18 -0
- package/packages/chunker/dist/wasm/languages.js +1 -0
- package/packages/chunker/dist/wasm/query-executor.d.ts +70 -0
- package/packages/chunker/dist/wasm/query-executor.js +1 -0
- package/packages/chunker/dist/wasm/runtime.d.ts +44 -0
- package/packages/chunker/dist/wasm/runtime.js +1 -0
- package/packages/chunker/dist/wasm/types.d.ts +84 -0
- package/packages/chunker/dist/wasm/types.js +1 -0
- package/packages/chunker/dist/wasm-chunker.d.ts +23 -0
- package/packages/chunker/dist/wasm-chunker.js +6 -0
- package/packages/chunker/src/queries/go/calls.scm +11 -0
- package/packages/chunker/src/queries/go/entry-points.scm +20 -0
- package/packages/chunker/src/queries/go/imports.scm +6 -0
- package/packages/chunker/src/queries/go/patterns.scm +25 -0
- package/packages/chunker/src/queries/go/symbols.scm +26 -0
- package/packages/chunker/src/queries/java/calls.scm +10 -0
- package/packages/chunker/src/queries/java/entry-points.scm +27 -0
- package/packages/chunker/src/queries/java/imports.scm +11 -0
- package/packages/chunker/src/queries/java/patterns.scm +27 -0
- package/packages/chunker/src/queries/java/symbols.scm +28 -0
- package/packages/chunker/src/queries/javascript/calls.scm +21 -0
- package/packages/chunker/src/queries/javascript/entry-points.scm +31 -0
- package/packages/chunker/src/queries/javascript/imports.scm +32 -0
- package/packages/chunker/src/queries/javascript/patterns.scm +28 -0
- package/packages/chunker/src/queries/javascript/symbols.scm +52 -0
- package/packages/chunker/src/queries/python/calls.scm +11 -0
- package/packages/chunker/src/queries/python/entry-points.scm +21 -0
- package/packages/chunker/src/queries/python/imports.scm +14 -0
- package/packages/chunker/src/queries/python/patterns.scm +25 -0
- package/packages/chunker/src/queries/python/symbols.scm +17 -0
- package/packages/chunker/src/queries/rust/calls.scm +20 -0
- package/packages/chunker/src/queries/rust/entry-points.scm +7 -0
- package/packages/chunker/src/queries/rust/imports.scm +26 -0
- package/packages/chunker/src/queries/rust/patterns.scm +18 -0
- package/packages/chunker/src/queries/rust/symbols.scm +73 -0
- package/packages/chunker/src/queries/typescript/calls.scm +21 -0
- package/packages/chunker/src/queries/typescript/entry-points.scm +48 -0
- package/packages/chunker/src/queries/typescript/imports.scm +35 -0
- package/packages/chunker/src/queries/typescript/patterns.scm +47 -0
- package/packages/chunker/src/queries/typescript/symbols.scm +79 -0
- package/packages/chunker/wasm/tree-sitter-go.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-java.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-javascript.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-python.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-rust.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter-typescript.wasm +0 -0
- package/packages/chunker/wasm/tree-sitter.wasm +0 -0
- package/packages/cli/dist/commands/analyze.d.ts +6 -3
- package/packages/cli/dist/commands/analyze.js +2 -3
- package/packages/cli/dist/commands/context-cmds.d.ts +6 -3
- package/packages/cli/dist/commands/context-cmds.js +1 -1
- package/packages/cli/dist/commands/environment.d.ts +6 -3
- package/packages/cli/dist/commands/environment.js +1 -2
- package/packages/cli/dist/commands/execution.d.ts +6 -3
- package/packages/cli/dist/commands/execution.js +1 -1
- package/packages/cli/dist/commands/graph.d.ts +6 -3
- package/packages/cli/dist/commands/graph.js +5 -6
- package/packages/cli/dist/commands/init/adapters.d.ts +28 -0
- package/packages/cli/dist/commands/init/adapters.js +1 -0
- package/packages/cli/dist/commands/init/config.d.ts +10 -0
- package/packages/cli/dist/commands/init/config.js +3 -0
- package/packages/cli/dist/commands/init/constants.d.ts +18 -0
- package/packages/cli/dist/commands/init/constants.js +1 -0
- package/packages/cli/dist/commands/init/curated.d.ts +7 -0
- package/packages/cli/dist/commands/init/curated.js +1 -0
- package/packages/cli/dist/commands/init/global.d.ts +34 -0
- package/packages/cli/dist/commands/init/global.js +5 -0
- package/packages/cli/dist/commands/init/index.d.ts +28 -0
- package/packages/cli/dist/commands/init/index.js +5 -0
- package/packages/cli/dist/commands/init/scaffold.d.ts +23 -0
- package/packages/cli/dist/commands/init/scaffold.js +1 -0
- package/packages/cli/dist/commands/init/templates.d.ts +9 -0
- package/packages/cli/dist/commands/init/templates.js +165 -0
- package/packages/cli/dist/commands/knowledge.d.ts +6 -3
- package/packages/cli/dist/commands/knowledge.js +1 -1
- package/packages/cli/dist/commands/search.d.ts +6 -3
- package/packages/cli/dist/commands/search.js +1 -8
- package/packages/cli/dist/commands/system.d.ts +6 -3
- package/packages/cli/dist/commands/system.js +4 -7
- package/packages/cli/dist/commands/workspace.d.ts +6 -3
- package/packages/cli/dist/commands/workspace.js +1 -2
- package/packages/cli/dist/context.d.ts +7 -5
- package/packages/cli/dist/context.js +1 -1
- package/packages/cli/dist/helpers.d.ts +51 -48
- package/packages/cli/dist/helpers.js +5 -5
- package/packages/cli/dist/index.d.ts +4 -2
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/dist/kb-init.d.ts +48 -51
- package/packages/cli/dist/kb-init.js +1 -1
- package/packages/cli/dist/types.d.ts +8 -6
- package/packages/cli/dist/types.js +1 -0
- package/packages/core/dist/constants.d.ts +58 -34
- package/packages/core/dist/constants.js +1 -1
- package/packages/core/dist/content-detector.d.ts +8 -8
- package/packages/core/dist/content-detector.js +1 -1
- package/packages/core/dist/errors.d.ts +15 -13
- package/packages/core/dist/errors.js +1 -1
- package/packages/core/dist/global-registry.d.ts +62 -0
- package/packages/core/dist/global-registry.js +1 -0
- package/packages/core/dist/index.d.ts +7 -6
- package/packages/core/dist/index.js +1 -1
- package/packages/core/dist/logger.d.ts +19 -8
- package/packages/core/dist/logger.js +1 -1
- package/packages/core/dist/types.d.ts +107 -92
- package/packages/core/dist/types.js +1 -0
- package/packages/embeddings/dist/embedder.interface.d.ts +22 -20
- 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 -23
- package/packages/embeddings/dist/onnx-embedder.js +1 -1
- package/packages/enterprise-bridge/dist/cache.d.ts +28 -0
- package/packages/enterprise-bridge/dist/cache.js +1 -0
- package/packages/enterprise-bridge/dist/er-client.d.ts +37 -0
- package/packages/enterprise-bridge/dist/er-client.js +1 -0
- package/packages/enterprise-bridge/dist/evolution-collector.d.ts +62 -0
- package/packages/enterprise-bridge/dist/evolution-collector.js +1 -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 +45 -0
- package/packages/enterprise-bridge/dist/policy-store.js +1 -0
- package/packages/enterprise-bridge/dist/push-adapter.d.ts +23 -0
- package/packages/enterprise-bridge/dist/push-adapter.js +1 -0
- package/packages/enterprise-bridge/dist/result-merger.d.ts +14 -0
- package/packages/enterprise-bridge/dist/result-merger.js +1 -0
- package/packages/enterprise-bridge/dist/types.d.ts +81 -0
- package/packages/enterprise-bridge/dist/types.js +1 -0
- package/packages/indexer/dist/file-hasher.d.ts +5 -3
- package/packages/indexer/dist/file-hasher.js +1 -1
- package/packages/indexer/dist/filesystem-crawler.d.ts +23 -21
- package/packages/indexer/dist/filesystem-crawler.js +1 -1
- package/packages/indexer/dist/graph-extractor.d.ts +9 -13
- package/packages/indexer/dist/graph-extractor.js +1 -1
- package/packages/indexer/dist/incremental-indexer.d.ts +49 -44
- package/packages/indexer/dist/incremental-indexer.js +1 -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 -3
- package/packages/server/dist/config.js +1 -1
- package/packages/server/dist/cross-workspace.d.ts +43 -0
- package/packages/server/dist/cross-workspace.js +1 -0
- package/packages/server/dist/curated-manager.d.ts +80 -78
- package/packages/server/dist/curated-manager.js +5 -10
- package/packages/server/dist/index.d.ts +1 -2
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/replay-interceptor.d.ts +6 -7
- package/packages/server/dist/replay-interceptor.js +1 -1
- package/packages/server/dist/resources/resources.d.ts +7 -4
- package/packages/server/dist/resources/resources.js +2 -2
- package/packages/server/dist/server.d.ts +37 -25
- package/packages/server/dist/server.js +1 -1
- package/packages/server/dist/tools/analyze.tools.d.ts +14 -11
- package/packages/server/dist/tools/analyze.tools.js +1 -3
- package/packages/server/dist/tools/audit.tool.d.ts +8 -5
- package/packages/server/dist/tools/audit.tool.js +1 -4
- package/packages/server/dist/tools/bridge.tools.d.ts +34 -0
- package/packages/server/dist/tools/bridge.tools.js +15 -0
- package/packages/server/dist/tools/evolution.tools.d.ts +7 -0
- package/packages/server/dist/tools/evolution.tools.js +5 -0
- package/packages/server/dist/tools/forge.tools.d.ts +13 -12
- package/packages/server/dist/tools/forge.tools.js +10 -13
- package/packages/server/dist/tools/forget.tool.d.ts +7 -4
- package/packages/server/dist/tools/forget.tool.js +1 -7
- package/packages/server/dist/tools/graph.tool.d.ts +7 -4
- package/packages/server/dist/tools/graph.tool.js +4 -5
- package/packages/server/dist/tools/list.tool.d.ts +7 -4
- package/packages/server/dist/tools/list.tool.js +2 -8
- package/packages/server/dist/tools/lookup.tool.d.ts +7 -4
- package/packages/server/dist/tools/lookup.tool.js +2 -9
- package/packages/server/dist/tools/onboard.tool.d.ts +8 -5
- package/packages/server/dist/tools/onboard.tool.js +2 -2
- package/packages/server/dist/tools/policy.tools.d.ts +7 -0
- package/packages/server/dist/tools/policy.tools.js +2 -0
- package/packages/server/dist/tools/produce.tool.d.ts +6 -3
- package/packages/server/dist/tools/produce.tool.js +2 -2
- package/packages/server/dist/tools/read.tool.d.ts +7 -4
- package/packages/server/dist/tools/read.tool.js +2 -6
- package/packages/server/dist/tools/reindex.tool.d.ts +10 -7
- package/packages/server/dist/tools/reindex.tool.js +3 -2
- package/packages/server/dist/tools/remember.tool.d.ts +8 -4
- package/packages/server/dist/tools/remember.tool.js +3 -5
- package/packages/server/dist/tools/replay.tool.d.ts +6 -3
- package/packages/server/dist/tools/replay.tool.js +2 -6
- package/packages/server/dist/tools/search.tool.d.ts +10 -5
- package/packages/server/dist/tools/search.tool.js +6 -22
- package/packages/server/dist/tools/status.tool.d.ts +12 -4
- package/packages/server/dist/tools/status.tool.js +2 -3
- package/packages/server/dist/tools/toolkit.tools.d.ts +36 -35
- package/packages/server/dist/tools/toolkit.tools.js +20 -24
- package/packages/server/dist/tools/update.tool.d.ts +7 -4
- package/packages/server/dist/tools/update.tool.js +1 -6
- package/packages/server/dist/tools/utility.tools.d.ts +15 -15
- package/packages/server/dist/tools/utility.tools.js +10 -23
- package/packages/server/dist/version-check.d.ts +5 -2
- package/packages/server/dist/version-check.js +1 -1
- package/packages/store/dist/graph-store.interface.d.ts +89 -87
- 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 -31
- package/packages/store/dist/lance-store.js +1 -1
- package/packages/store/dist/sqlite-graph-store.d.ts +43 -47
- package/packages/store/dist/sqlite-graph-store.js +13 -13
- package/packages/store/dist/store-factory.d.ts +11 -8
- package/packages/store/dist/store-factory.js +1 -1
- package/packages/store/dist/store.interface.d.ts +47 -47
- package/packages/store/dist/store.interface.js +1 -0
- package/packages/tools/dist/audit.d.ts +61 -62
- package/packages/tools/dist/audit.js +4 -5
- package/packages/tools/dist/batch.d.ts +20 -18
- package/packages/tools/dist/batch.js +1 -1
- package/packages/tools/dist/changelog.d.ts +29 -27
- package/packages/tools/dist/changelog.js +2 -2
- package/packages/tools/dist/check.d.ts +42 -39
- package/packages/tools/dist/check.js +2 -2
- package/packages/tools/dist/checkpoint.d.ts +17 -15
- package/packages/tools/dist/checkpoint.js +1 -2
- package/packages/tools/dist/codemod.d.ts +35 -33
- package/packages/tools/dist/codemod.js +2 -2
- package/packages/tools/dist/compact.d.ts +34 -38
- package/packages/tools/dist/compact.js +2 -2
- package/packages/tools/dist/data-transform.d.ts +10 -8
- package/packages/tools/dist/data-transform.js +1 -1
- package/packages/tools/dist/dead-symbols.d.ts +29 -26
- package/packages/tools/dist/dead-symbols.js +2 -2
- package/packages/tools/dist/delegate.d.ts +26 -24
- package/packages/tools/dist/delegate.js +1 -5
- package/packages/tools/dist/diff-parse.d.ts +24 -22
- package/packages/tools/dist/diff-parse.js +3 -3
- package/packages/tools/dist/digest.d.ts +43 -46
- package/packages/tools/dist/digest.js +4 -5
- package/packages/tools/dist/dogfood-log.d.ts +49 -0
- package/packages/tools/dist/dogfood-log.js +2 -0
- package/packages/tools/dist/encode.d.ts +11 -9
- package/packages/tools/dist/encode.js +1 -1
- package/packages/tools/dist/env-info.d.ts +25 -23
- package/packages/tools/dist/env-info.js +1 -1
- package/packages/tools/dist/eval.d.ts +13 -11
- package/packages/tools/dist/eval.js +2 -3
- package/packages/tools/dist/evidence-map.d.ts +64 -62
- package/packages/tools/dist/evidence-map.js +2 -3
- package/packages/tools/dist/file-cache.d.ts +41 -0
- package/packages/tools/dist/file-cache.js +3 -0
- package/packages/tools/dist/file-summary.d.ts +50 -30
- package/packages/tools/dist/file-summary.js +2 -2
- package/packages/tools/dist/file-walk.d.ts +6 -4
- package/packages/tools/dist/file-walk.js +1 -1
- package/packages/tools/dist/find-examples.d.ts +26 -22
- package/packages/tools/dist/find-examples.js +3 -3
- package/packages/tools/dist/find.d.ts +39 -41
- package/packages/tools/dist/find.js +1 -1
- package/packages/tools/dist/forge-classify.d.ts +35 -39
- package/packages/tools/dist/forge-classify.js +2 -2
- package/packages/tools/dist/forge-ground.d.ts +58 -61
- package/packages/tools/dist/forge-ground.js +1 -1
- package/packages/tools/dist/git-context.d.ts +22 -20
- package/packages/tools/dist/git-context.js +3 -3
- package/packages/tools/dist/graph-query.d.ts +75 -79
- package/packages/tools/dist/graph-query.js +1 -1
- package/packages/tools/dist/guide.d.ts +14 -12
- package/packages/tools/dist/guide.js +1 -1
- package/packages/tools/dist/health.d.ts +13 -11
- package/packages/tools/dist/health.js +2 -2
- package/packages/tools/dist/http-request.d.ts +20 -18
- package/packages/tools/dist/http-request.js +1 -1
- package/packages/tools/dist/index.d.ts +55 -53
- package/packages/tools/dist/index.js +1 -1
- package/packages/tools/dist/lane.d.ts +28 -26
- package/packages/tools/dist/lane.js +6 -7
- package/packages/tools/dist/measure.d.ts +34 -30
- package/packages/tools/dist/measure.js +2 -2
- package/packages/tools/dist/onboard.d.ts +29 -27
- package/packages/tools/dist/onboard.js +17 -41
- package/packages/tools/dist/parse-output.d.ts +48 -46
- package/packages/tools/dist/parse-output.js +2 -2
- package/packages/tools/dist/path-resolver.d.ts +4 -2
- package/packages/tools/dist/path-resolver.js +1 -1
- package/packages/tools/dist/process-manager.d.ts +18 -16
- package/packages/tools/dist/process-manager.js +1 -1
- package/packages/tools/dist/queue.d.ts +28 -26
- package/packages/tools/dist/queue.js +1 -2
- package/packages/tools/dist/regex-test.d.ts +26 -24
- package/packages/tools/dist/regex-test.js +1 -1
- package/packages/tools/dist/rename.d.ts +28 -26
- package/packages/tools/dist/rename.js +2 -2
- package/packages/tools/dist/replay.d.ts +33 -31
- package/packages/tools/dist/replay.js +4 -6
- package/packages/tools/dist/response-envelope.d.ts +32 -30
- package/packages/tools/dist/response-envelope.js +1 -1
- package/packages/tools/dist/schema-validate.d.ts +15 -13
- package/packages/tools/dist/schema-validate.js +1 -1
- package/packages/tools/dist/scope-map.d.ts +45 -48
- package/packages/tools/dist/scope-map.js +1 -1
- package/packages/tools/dist/snippet.d.ts +26 -25
- package/packages/tools/dist/snippet.js +1 -1
- package/packages/tools/dist/stash.d.ts +13 -11
- package/packages/tools/dist/stash.js +1 -2
- package/packages/tools/dist/stratum-card.d.ts +27 -28
- package/packages/tools/dist/stratum-card.js +3 -5
- package/packages/tools/dist/symbol.d.ts +31 -26
- package/packages/tools/dist/symbol.js +3 -3
- package/packages/tools/dist/test-run.d.ts +19 -16
- package/packages/tools/dist/test-run.js +2 -2
- package/packages/tools/dist/text-utils.d.ts +6 -4
- package/packages/tools/dist/text-utils.js +2 -2
- package/packages/tools/dist/time-utils.d.ts +15 -13
- package/packages/tools/dist/time-utils.js +1 -1
- package/packages/tools/dist/trace.d.ts +26 -21
- package/packages/tools/dist/trace.js +2 -2
- package/packages/tools/dist/truncation.d.ts +6 -4
- package/packages/tools/dist/truncation.js +6 -13
- package/packages/tools/dist/watch.d.ts +28 -26
- package/packages/tools/dist/watch.js +1 -1
- package/packages/tools/dist/web-fetch.d.ts +35 -33
- package/packages/tools/dist/web-fetch.js +6 -12
- package/packages/tools/dist/web-search.d.ts +16 -14
- package/packages/tools/dist/web-search.js +1 -1
- package/packages/tools/dist/workset.d.ts +19 -17
- package/packages/tools/dist/workset.js +1 -2
- package/packages/tui/dist/App-CYLNJLr6.js +2 -0
- package/packages/tui/dist/App.d.ts +11 -6
- package/packages/tui/dist/App.js +1 -450
- package/packages/tui/dist/CuratedPanel-sYdZAICX.js +2 -0
- package/packages/tui/dist/LogPanel-DtMnoyXT.js +3 -0
- package/packages/tui/dist/SearchPanel-DREo6zgt.js +2 -0
- package/packages/tui/dist/StatusPanel-2ex8fLOO.js +2 -0
- package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
- package/packages/tui/dist/devtools-DUyj952l.js +7 -0
- package/packages/tui/dist/embedder.interface-D4ew0HPW.d.ts +28 -0
- package/packages/tui/dist/index-B9VpfVPP.d.ts +13 -0
- package/packages/tui/dist/index.d.ts +3 -19
- package/packages/tui/dist/index.js +1 -476
- package/packages/tui/dist/jsx-runtime-Cof-kwFn.js +316 -0
- package/packages/tui/dist/panels/CuratedPanel.d.ts +11 -6
- package/packages/tui/dist/panels/CuratedPanel.js +1 -371
- package/packages/tui/dist/panels/LogPanel.d.ts +7 -3
- package/packages/tui/dist/panels/LogPanel.js +1 -449
- package/packages/tui/dist/panels/SearchPanel.d.ts +14 -8
- package/packages/tui/dist/panels/SearchPanel.js +1 -372
- package/packages/tui/dist/panels/StatusPanel.d.ts +11 -6
- package/packages/tui/dist/panels/StatusPanel.js +1 -371
- package/packages/tui/dist/store.interface-CnY6SPOH.d.ts +150 -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 +21 -0
- package/scaffold/copilot/agents/Architect-Reviewer-Beta.agent.md +21 -0
- package/scaffold/copilot/agents/Documenter.agent.md +42 -0
- package/scaffold/copilot/agents/Orchestrator.agent.md +104 -0
- package/scaffold/copilot/agents/Planner.agent.md +54 -0
- package/scaffold/copilot/agents/Refactor.agent.md +36 -0
- package/scaffold/copilot/agents/Researcher-Alpha.agent.md +20 -0
- package/scaffold/copilot/agents/Researcher-Beta.agent.md +20 -0
- package/scaffold/copilot/agents/Researcher-Delta.agent.md +20 -0
- package/scaffold/copilot/agents/Researcher-Gamma.agent.md +20 -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/general/agents/Architect-Reviewer-Alpha.agent.md +21 -0
- package/scaffold/general/agents/Architect-Reviewer-Beta.agent.md +21 -0
- package/scaffold/general/agents/Code-Reviewer-Alpha.agent.md +12 -0
- package/scaffold/general/agents/Code-Reviewer-Beta.agent.md +12 -0
- package/scaffold/general/agents/Debugger.agent.md +31 -0
- package/scaffold/general/agents/Documenter.agent.md +42 -0
- package/scaffold/general/agents/Explorer.agent.md +50 -0
- package/scaffold/general/agents/Frontend.agent.md +29 -0
- package/scaffold/general/agents/Implementer.agent.md +31 -0
- package/scaffold/general/agents/Orchestrator.agent.md +104 -0
- package/scaffold/general/agents/Planner.agent.md +55 -0
- package/scaffold/general/agents/README.md +57 -0
- package/scaffold/general/agents/Refactor.agent.md +36 -0
- package/scaffold/general/agents/Researcher-Alpha.agent.md +20 -0
- package/scaffold/general/agents/Researcher-Beta.agent.md +20 -0
- package/scaffold/general/agents/Researcher-Delta.agent.md +20 -0
- package/scaffold/general/agents/Researcher-Gamma.agent.md +20 -0
- package/scaffold/general/agents/Security.agent.md +42 -0
- package/scaffold/general/agents/_shared/adr-protocol.md +91 -0
- package/scaffold/general/agents/_shared/architect-reviewer-base.md +50 -0
- package/scaffold/general/agents/_shared/code-agent-base.md +88 -0
- package/scaffold/general/agents/_shared/code-reviewer-base.md +54 -0
- package/scaffold/general/agents/_shared/decision-protocol.md +27 -0
- package/scaffold/general/agents/_shared/forge-protocol.md +46 -0
- package/scaffold/general/agents/_shared/researcher-base.md +61 -0
- package/scaffold/general/agents/templates/adr-template.md +27 -0
- package/scaffold/general/agents/templates/execution-state.md +25 -0
- package/scaffold/general/prompts/ask.prompt.md +20 -0
- package/scaffold/general/prompts/debug.prompt.md +25 -0
- package/scaffold/general/prompts/design.prompt.md +22 -0
- package/scaffold/general/prompts/implement.prompt.md +26 -0
- package/scaffold/general/prompts/plan.prompt.md +24 -0
- package/scaffold/general/prompts/review.prompt.md +31 -0
- package/scaffold/generate.mjs +74 -0
- package/skills/adr-skill/SKILL.md +329 -0
- package/skills/adr-skill/assets/templates/adr-madr.md +89 -0
- package/skills/adr-skill/assets/templates/adr-readme.md +20 -0
- package/skills/adr-skill/assets/templates/adr-simple.md +46 -0
- package/skills/adr-skill/references/adr-conventions.md +95 -0
- package/skills/adr-skill/references/examples.md +193 -0
- package/skills/adr-skill/references/review-checklist.md +77 -0
- package/skills/adr-skill/references/template-variants.md +52 -0
- package/skills/adr-skill/scripts/bootstrap_adr.js +259 -0
- package/skills/adr-skill/scripts/new_adr.js +391 -0
- package/skills/adr-skill/scripts/set_adr_status.js +169 -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/c4-architecture/SKILL.md +295 -0
- package/skills/c4-architecture/references/advanced-patterns.md +552 -0
- package/skills/c4-architecture/references/c4-syntax.md +492 -0
- package/skills/c4-architecture/references/common-mistakes.md +437 -0
- package/skills/knowledge-base/SKILL.md +100 -10
- package/skills/lesson-learned/SKILL.md +105 -0
- package/skills/lesson-learned/references/anti-patterns.md +55 -0
- package/skills/lesson-learned/references/se-principles.md +109 -0
- package/skills/requirements-clarity/SKILL.md +324 -0
- package/skills/session-handoff/SKILL.md +189 -0
- package/skills/session-handoff/references/handoff-template.md +139 -0
- package/skills/session-handoff/references/resume-checklist.md +80 -0
- package/skills/session-handoff/scripts/check_staleness.js +269 -0
- package/skills/session-handoff/scripts/create_handoff.js +299 -0
- package/skills/session-handoff/scripts/list_handoffs.js +113 -0
- package/skills/session-handoff/scripts/validate_handoff.js +241 -0
- package/packages/chunker/dist/treesitter-chunker.d.ts +0 -47
- package/packages/chunker/dist/treesitter-chunker.js +0 -8
- package/packages/cli/dist/commands/init.d.ts +0 -10
- package/packages/cli/dist/commands/init.js +0 -308
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
# Common C4 Model Mistakes to Avoid
|
|
2
|
+
|
|
3
|
+
This guide documents frequent anti-patterns and errors when creating C4 architecture diagrams, with examples of what to do instead.
|
|
4
|
+
|
|
5
|
+
## Abstraction Level Mistakes
|
|
6
|
+
|
|
7
|
+
### 1. Confusing Containers and Components
|
|
8
|
+
|
|
9
|
+
**The Problem:**
|
|
10
|
+
Containers are **deployable units** (applications, services, databases). Components are **non-deployable elements inside a container** (modules, classes, packages).
|
|
11
|
+
|
|
12
|
+
**Wrong - Java class shown as container:**
|
|
13
|
+
```mermaid
|
|
14
|
+
C4Container
|
|
15
|
+
title WRONG: Class as Container
|
|
16
|
+
|
|
17
|
+
Container(userController, "UserController", "Java Class", "Handles user requests")
|
|
18
|
+
Container(userService, "UserService", "Java Class", "Business logic")
|
|
19
|
+
ContainerDb(db, "Database", "PostgreSQL", "User data")
|
|
20
|
+
|
|
21
|
+
Rel(userController, userService, "Calls")
|
|
22
|
+
Rel(userService, db, "Queries")
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Correct - Classes as components inside a container:**
|
|
26
|
+
```mermaid
|
|
27
|
+
C4Component
|
|
28
|
+
title CORRECT: Classes as Components
|
|
29
|
+
|
|
30
|
+
ContainerDb(db, "Database", "PostgreSQL", "User data")
|
|
31
|
+
|
|
32
|
+
Container_Boundary(api, "User API Service") {
|
|
33
|
+
Component(userController, "UserController", "Spring MVC", "REST endpoints")
|
|
34
|
+
Component(userService, "UserService", "Spring Bean", "Business logic")
|
|
35
|
+
Component(userRepo, "UserRepository", "JPA", "Data access")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
Rel(userController, userService, "Calls")
|
|
39
|
+
Rel(userService, userRepo, "Uses")
|
|
40
|
+
Rel(userRepo, db, "Queries", "JDBC")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Adding Undefined Abstraction Levels
|
|
44
|
+
|
|
45
|
+
**The Problem:**
|
|
46
|
+
C4 defines exactly four levels. Don't invent "subcomponents", "modules", or other arbitrary levels.
|
|
47
|
+
|
|
48
|
+
**Wrong:**
|
|
49
|
+
- Level 3.5: "Subcomponents"
|
|
50
|
+
- Level 2.5: "Microservice groups"
|
|
51
|
+
- Custom levels like "packages" or "modules"
|
|
52
|
+
|
|
53
|
+
**Correct:**
|
|
54
|
+
Stick to Person, Software System, Container, Component. If you need more detail, you're at Level 4 (Code) which should use UML class diagrams.
|
|
55
|
+
|
|
56
|
+
### 3. Vague Subsystems
|
|
57
|
+
|
|
58
|
+
**The Problem:**
|
|
59
|
+
"Subsystem" is ambiguous. Is it a system, container, or component?
|
|
60
|
+
|
|
61
|
+
**Wrong:**
|
|
62
|
+
```
|
|
63
|
+
Subsystem(orders, "Order Subsystem", "Handles orders")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Correct - Be specific:**
|
|
67
|
+
```
|
|
68
|
+
System(orderSystem, "Order System", "Handles order lifecycle")
|
|
69
|
+
# OR
|
|
70
|
+
Container(orderService, "Order Service", "Java", "Order processing API")
|
|
71
|
+
# OR
|
|
72
|
+
Component(orderProcessor, "Order Processor", "Spring Bean", "Order business logic")
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Shared Libraries Mistake
|
|
76
|
+
|
|
77
|
+
**The Problem:**
|
|
78
|
+
Modeling a shared library as a container implies it's an independently running service. Libraries are copied into applications, not deployed separately.
|
|
79
|
+
|
|
80
|
+
**Wrong - Library as separate container:**
|
|
81
|
+
```mermaid
|
|
82
|
+
C4Container
|
|
83
|
+
title WRONG: Library as Container
|
|
84
|
+
|
|
85
|
+
Container(serviceA, "Service A", "Java")
|
|
86
|
+
Container(serviceB, "Service B", "Java")
|
|
87
|
+
Container(sharedLib, "Shared Utils Library", "Java", "Common utilities")
|
|
88
|
+
|
|
89
|
+
Rel(serviceA, sharedLib, "Uses")
|
|
90
|
+
Rel(serviceB, sharedLib, "Uses")
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Correct - Show library within each service:**
|
|
94
|
+
```mermaid
|
|
95
|
+
C4Component
|
|
96
|
+
title CORRECT: Library in Each Service
|
|
97
|
+
|
|
98
|
+
Container_Boundary(serviceA, "Service A") {
|
|
99
|
+
Component(controllerA, "Controller", "Spring MVC")
|
|
100
|
+
Component(utilsA, "Shared Utils", "Java Library", "Bundled copy")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
Container_Boundary(serviceB, "Service B") {
|
|
104
|
+
Component(controllerB, "Controller", "Spring MVC")
|
|
105
|
+
Component(utilsB, "Shared Utils", "Java Library", "Bundled copy")
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or simply omit the library from architecture diagrams since it's an implementation detail.
|
|
110
|
+
|
|
111
|
+
## Message Broker Mistakes
|
|
112
|
+
|
|
113
|
+
### Single Message Bus Anti-Pattern
|
|
114
|
+
|
|
115
|
+
**The Problem:**
|
|
116
|
+
Showing Kafka/RabbitMQ as a single container creates a misleading "hub and spoke" diagram that hides actual data flows.
|
|
117
|
+
|
|
118
|
+
**Wrong - Central message bus:**
|
|
119
|
+
```mermaid
|
|
120
|
+
C4Container
|
|
121
|
+
title WRONG: Central Message Bus
|
|
122
|
+
|
|
123
|
+
Container(orderSvc, "Order Service", "Java")
|
|
124
|
+
Container(inventorySvc, "Inventory Service", "Java")
|
|
125
|
+
Container(paymentSvc, "Payment Service", "Java")
|
|
126
|
+
ContainerQueue(kafka, "Kafka", "Event Streaming", "Message bus")
|
|
127
|
+
|
|
128
|
+
Rel(orderSvc, kafka, "Publishes/Subscribes")
|
|
129
|
+
Rel(inventorySvc, kafka, "Publishes/Subscribes")
|
|
130
|
+
Rel(paymentSvc, kafka, "Publishes/Subscribes")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Correct - Individual topics:**
|
|
134
|
+
```mermaid
|
|
135
|
+
C4Container
|
|
136
|
+
title CORRECT: Individual Topics
|
|
137
|
+
|
|
138
|
+
Container(orderSvc, "Order Service", "Java", "Creates orders")
|
|
139
|
+
Container(inventorySvc, "Inventory Service", "Java", "Manages stock")
|
|
140
|
+
Container(paymentSvc, "Payment Service", "Java", "Processes payments")
|
|
141
|
+
|
|
142
|
+
ContainerQueue(orderCreated, "order.created", "Kafka", "New orders")
|
|
143
|
+
ContainerQueue(stockReserved, "stock.reserved", "Kafka", "Stock events")
|
|
144
|
+
ContainerQueue(paymentComplete, "payment.complete", "Kafka", "Payment events")
|
|
145
|
+
|
|
146
|
+
Rel(orderSvc, orderCreated, "Publishes")
|
|
147
|
+
Rel(inventorySvc, orderCreated, "Consumes")
|
|
148
|
+
Rel(inventorySvc, stockReserved, "Publishes")
|
|
149
|
+
Rel(paymentSvc, stockReserved, "Consumes")
|
|
150
|
+
Rel(paymentSvc, paymentComplete, "Publishes")
|
|
151
|
+
Rel(orderSvc, paymentComplete, "Consumes")
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Alternative - Topics on relationship labels:**
|
|
155
|
+
```mermaid
|
|
156
|
+
C4Container
|
|
157
|
+
title ALTERNATIVE: Topics as Labels
|
|
158
|
+
|
|
159
|
+
Container(orderSvc, "Order Service", "Java")
|
|
160
|
+
Container(inventorySvc, "Inventory Service", "Java")
|
|
161
|
+
Container(paymentSvc, "Payment Service", "Java")
|
|
162
|
+
|
|
163
|
+
Rel(orderSvc, inventorySvc, "order.created", "Kafka")
|
|
164
|
+
Rel(inventorySvc, paymentSvc, "stock.reserved", "Kafka")
|
|
165
|
+
Rel(paymentSvc, orderSvc, "payment.complete", "Kafka")
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## External Systems Mistakes
|
|
169
|
+
|
|
170
|
+
### Showing Internal Details of External Systems
|
|
171
|
+
|
|
172
|
+
**The Problem:**
|
|
173
|
+
You don't control external systems. Showing their internals creates coupling and becomes stale quickly.
|
|
174
|
+
|
|
175
|
+
**Wrong - External system internals:**
|
|
176
|
+
```mermaid
|
|
177
|
+
C4Container
|
|
178
|
+
title WRONG: External System Internals
|
|
179
|
+
|
|
180
|
+
Container(myApp, "My App", "Node.js")
|
|
181
|
+
|
|
182
|
+
System_Boundary(stripe, "Stripe") {
|
|
183
|
+
Container(stripeApi, "Stripe API", "Ruby")
|
|
184
|
+
Container(stripeWorker, "Payment Worker", "Java")
|
|
185
|
+
ContainerDb(stripeDb, "Payment DB", "MySQL")
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
Rel(myApp, stripeApi, "Charges cards")
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Correct - External system as black box:**
|
|
192
|
+
```mermaid
|
|
193
|
+
C4Context
|
|
194
|
+
title CORRECT: External System Black Box
|
|
195
|
+
|
|
196
|
+
Container(myApp, "My App", "Node.js", "E-commerce backend")
|
|
197
|
+
System_Ext(stripe, "Stripe", "Payment processing platform")
|
|
198
|
+
|
|
199
|
+
Rel(myApp, stripe, "Processes payments", "REST API")
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Metadata and Documentation Mistakes
|
|
203
|
+
|
|
204
|
+
### 1. Removing Type Labels
|
|
205
|
+
|
|
206
|
+
**The Problem:**
|
|
207
|
+
Removing element type labels (Container, Component, System) to "simplify" diagrams creates ambiguity.
|
|
208
|
+
|
|
209
|
+
**Wrong:**
|
|
210
|
+
```
|
|
211
|
+
Box(api, "API") # What is this? System? Container? Component?
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Correct:**
|
|
215
|
+
```
|
|
216
|
+
Container(api, "API Application", "Spring Boot", "REST API backend")
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 2. Missing Descriptions
|
|
220
|
+
|
|
221
|
+
**The Problem:**
|
|
222
|
+
Elements without descriptions force viewers to guess their purpose.
|
|
223
|
+
|
|
224
|
+
**Wrong:**
|
|
225
|
+
```
|
|
226
|
+
Container(svc, "Service", "Java")
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Correct:**
|
|
230
|
+
```
|
|
231
|
+
Container(orderSvc, "Order Service", "Spring Boot", "Manages order lifecycle and fulfillment")
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 3. Generic Relationship Labels
|
|
235
|
+
|
|
236
|
+
**The Problem:**
|
|
237
|
+
Labels like "uses" or "communicates with" don't explain what data flows or why.
|
|
238
|
+
|
|
239
|
+
**Wrong:**
|
|
240
|
+
```
|
|
241
|
+
Rel(frontend, api, "Uses")
|
|
242
|
+
Rel(api, db, "Accesses")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Correct:**
|
|
246
|
+
```
|
|
247
|
+
Rel(frontend, api, "Fetches products, submits orders", "JSON/HTTPS")
|
|
248
|
+
Rel(api, db, "Reads/writes order data", "JDBC")
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Diagram Scope Mistakes
|
|
252
|
+
|
|
253
|
+
### 1. Not Tailoring to Audience
|
|
254
|
+
|
|
255
|
+
**The Problem:**
|
|
256
|
+
Showing Level 4 code diagrams to executives, or only Level 1 to developers who need implementation details.
|
|
257
|
+
|
|
258
|
+
| Audience | Appropriate Levels |
|
|
259
|
+
|----------|-------------------|
|
|
260
|
+
| Executives | Level 1 (Context) only |
|
|
261
|
+
| Product Managers | Levels 1-2 |
|
|
262
|
+
| Architects | Levels 1-3 |
|
|
263
|
+
| Developers | All levels as needed |
|
|
264
|
+
| DevOps | Levels 2 + Deployment |
|
|
265
|
+
|
|
266
|
+
### 2. Creating All Four Levels by Default
|
|
267
|
+
|
|
268
|
+
**The Problem:**
|
|
269
|
+
Not every system needs all four levels. Level 3 (Component) and Level 4 (Code) often add no value.
|
|
270
|
+
|
|
271
|
+
**Guidance:**
|
|
272
|
+
- **Always create:** Context (L1) and Container (L2)
|
|
273
|
+
- **Create if valuable:** Component (L3) for complex containers
|
|
274
|
+
- **Rarely create:** Code (L4) - let IDEs generate these
|
|
275
|
+
|
|
276
|
+
### 3. Too Many Elements Per Diagram
|
|
277
|
+
|
|
278
|
+
**The Problem:**
|
|
279
|
+
Diagrams with 20+ elements become unreadable.
|
|
280
|
+
|
|
281
|
+
**Simon Brown's advice:** "If a diagram with a dozen boxes is hard to understand, don't draw a diagram with a dozen boxes!"
|
|
282
|
+
|
|
283
|
+
**Solutions:**
|
|
284
|
+
- Split by bounded context or domain
|
|
285
|
+
- Create separate diagrams per service
|
|
286
|
+
- Show one service + its direct dependencies
|
|
287
|
+
- Use multiple focused diagrams instead of one comprehensive diagram
|
|
288
|
+
|
|
289
|
+
## Arrow Mistakes
|
|
290
|
+
|
|
291
|
+
### 1. Bidirectional Arrows
|
|
292
|
+
|
|
293
|
+
**The Problem:**
|
|
294
|
+
Bidirectional arrows are ambiguous. Who initiates the call? What flows each direction?
|
|
295
|
+
|
|
296
|
+
**Wrong:**
|
|
297
|
+
```
|
|
298
|
+
BiRel(frontend, api, "Data") # Ambiguous direction
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Correct:**
|
|
302
|
+
```
|
|
303
|
+
Rel(frontend, api, "Requests products", "JSON/HTTPS")
|
|
304
|
+
Rel(api, frontend, "Returns product data", "JSON/HTTPS")
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Or show the initiator's perspective:
|
|
308
|
+
```
|
|
309
|
+
Rel(frontend, api, "Fetches products", "JSON/HTTPS")
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### 2. Unlabeled Arrows
|
|
313
|
+
|
|
314
|
+
**The Problem:**
|
|
315
|
+
Arrows without labels force readers to guess what flows between elements.
|
|
316
|
+
|
|
317
|
+
**Wrong:**
|
|
318
|
+
```
|
|
319
|
+
Rel(orderSvc, paymentSvc)
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Correct:**
|
|
323
|
+
```
|
|
324
|
+
Rel(orderSvc, paymentSvc, "Requests payment authorization", "gRPC")
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Deployment Diagram Mistakes
|
|
328
|
+
|
|
329
|
+
### 1. Deployment Details in Container Diagrams
|
|
330
|
+
|
|
331
|
+
**The Problem:**
|
|
332
|
+
Container diagrams should show logical architecture, not infrastructure details.
|
|
333
|
+
|
|
334
|
+
**Wrong - Infrastructure in container diagram:**
|
|
335
|
+
```mermaid
|
|
336
|
+
C4Container
|
|
337
|
+
title WRONG: Infrastructure in Container Diagram
|
|
338
|
+
|
|
339
|
+
Container(api1, "API (Instance 1)", "Java", "Primary")
|
|
340
|
+
Container(api2, "API (Instance 2)", "Java", "Replica")
|
|
341
|
+
Container(api3, "API (Instance 3)", "Java", "Replica")
|
|
342
|
+
Container(lb, "Load Balancer", "HAProxy", "Distributes traffic")
|
|
343
|
+
ContainerDb(primary, "Primary DB", "PostgreSQL", "Write")
|
|
344
|
+
ContainerDb(replica, "Read Replica", "PostgreSQL", "Read")
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**Correct - Use Deployment diagram for infrastructure:**
|
|
348
|
+
```mermaid
|
|
349
|
+
C4Deployment
|
|
350
|
+
title CORRECT: Deployment Diagram for Infrastructure
|
|
351
|
+
|
|
352
|
+
Deployment_Node(lb, "Load Balancer", "AWS ALB") {
|
|
353
|
+
Container(alb, "ALB", "AWS", "Traffic distribution")
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
Deployment_Node(ecs, "ECS Cluster", "Fargate") {
|
|
357
|
+
Container(api1, "API Instance 1", "Spring Boot")
|
|
358
|
+
Container(api2, "API Instance 2", "Spring Boot")
|
|
359
|
+
Container(api3, "API Instance 3", "Spring Boot")
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
Deployment_Node(rds, "RDS", "Multi-AZ") {
|
|
363
|
+
ContainerDb(primary, "Primary", "PostgreSQL")
|
|
364
|
+
ContainerDb(replica, "Replica", "PostgreSQL")
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### 2. Missing Environment Context
|
|
369
|
+
|
|
370
|
+
**The Problem:**
|
|
371
|
+
Deployment diagrams should specify which environment (production, staging, dev).
|
|
372
|
+
|
|
373
|
+
**Wrong:**
|
|
374
|
+
```
|
|
375
|
+
C4Deployment
|
|
376
|
+
title Deployment Diagram # Which environment?
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
**Correct:**
|
|
380
|
+
```
|
|
381
|
+
C4Deployment
|
|
382
|
+
title Deployment Diagram - Production (AWS us-east-1)
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Consistency Mistakes
|
|
386
|
+
|
|
387
|
+
### 1. Inconsistent Notation Across Diagrams
|
|
388
|
+
|
|
389
|
+
**The Problem:**
|
|
390
|
+
Using different colors, shapes, or terminology for the same elements across diagrams.
|
|
391
|
+
|
|
392
|
+
**Wrong:**
|
|
393
|
+
- Context diagram: "Payment System" (blue)
|
|
394
|
+
- Container diagram: "Payment Service" (green)
|
|
395
|
+
- Component diagram: "Payment Module" (red)
|
|
396
|
+
|
|
397
|
+
**Correct:**
|
|
398
|
+
Use consistent naming, colors, and styling. Create a style guide for your team.
|
|
399
|
+
|
|
400
|
+
### 2. No Legend/Key
|
|
401
|
+
|
|
402
|
+
**The Problem:**
|
|
403
|
+
Assuming viewers understand your notation without explanation.
|
|
404
|
+
|
|
405
|
+
**Solution:**
|
|
406
|
+
Always include a legend explaining colors, shapes, and line styles. Even for "obvious" elements.
|
|
407
|
+
|
|
408
|
+
## Decision Documentation Mistakes
|
|
409
|
+
|
|
410
|
+
### Showing Decision Process in Diagrams
|
|
411
|
+
|
|
412
|
+
**The Problem:**
|
|
413
|
+
Architecture diagrams show **outcomes** of decisions, not the decision-making process.
|
|
414
|
+
|
|
415
|
+
**Wrong approach:**
|
|
416
|
+
Including "Option A vs Option B" annotations in diagrams.
|
|
417
|
+
|
|
418
|
+
**Correct approach:**
|
|
419
|
+
- Document decisions separately in Architecture Decision Records (ADRs)
|
|
420
|
+
- Link ADRs to relevant diagrams
|
|
421
|
+
- Diagrams show the chosen architecture, ADRs explain why
|
|
422
|
+
|
|
423
|
+
## Quick Reference: Checklist
|
|
424
|
+
|
|
425
|
+
Before finalizing any C4 diagram, verify:
|
|
426
|
+
|
|
427
|
+
- [ ] Every element has: name, type, technology (if applicable), description
|
|
428
|
+
- [ ] All arrows are unidirectional with action verb labels
|
|
429
|
+
- [ ] Technology/protocol included on relationships
|
|
430
|
+
- [ ] Diagram has a clear, specific title
|
|
431
|
+
- [ ] Under 20 elements (ideally under 15)
|
|
432
|
+
- [ ] Appropriate level for the target audience
|
|
433
|
+
- [ ] Containers are deployable, components are not
|
|
434
|
+
- [ ] External systems shown as black boxes
|
|
435
|
+
- [ ] Message topics shown individually (not as single broker)
|
|
436
|
+
- [ ] No infrastructure details in container diagrams
|
|
437
|
+
- [ ] Consistent with other diagrams in the set
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knowledge-base
|
|
3
|
+
description: "Use the @anvpx/kb Knowledge Base MCP server for codebase search, analysis, and persistent memory. Load this skill when using kb_search, kb_remember, kb_analyze_*, or any kb_* tool. Covers all 64 MCP tools: search (hybrid/semantic/keyword), code analysis (structure, dependencies, symbols, patterns, entry points, diagrams, blast radius), knowledge graph (auto-populated module/symbol/import graph with traversal), context management (worksets, stash, checkpoints, lanes), code manipulation (rename, codemod, eval), knowledge management (remember/read/update/forget), web access (fetch, search, http), FORGE protocol (ground, classify, evidence map, stratum cards, digest), onboarding (full codebase analysis in one call), and developer utilities (regex, encode, measure, changelog, schema-validate, snippet, env, time)."
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @vpxa/kb — Knowledge Base Toolkit
|
|
2
7
|
|
|
3
|
-
Local-first AI developer toolkit — 64 MCP tools for
|
|
8
|
+
Local-first AI developer toolkit — 64 MCP tools for search, analysis, context compression, FORGE quality gates, knowledge management, code manipulation, execution, web access, and developer utilities.
|
|
4
9
|
|
|
5
10
|
## When to Use
|
|
6
11
|
|
|
@@ -25,7 +30,7 @@ Local-first AI developer toolkit — 64 MCP tools for knowledge management, code
|
|
|
25
30
|
core → store → embeddings → chunker → indexer → analyzers → tools → server → cli → tui
|
|
26
31
|
```
|
|
27
32
|
|
|
28
|
-
- **MCP server**:
|
|
33
|
+
- **MCP server**: 64 tools + 2 resources (via `@modelcontextprotocol/sdk`)
|
|
29
34
|
- **CLI**: 45 commands (thin dispatcher + 10 command groups)
|
|
30
35
|
- **Search**: Hybrid vector + keyword + RRF fusion
|
|
31
36
|
- **Embeddings**: ONNX local (mxbai-embed-large-v1, 1024 dimensions)
|
|
@@ -54,9 +59,9 @@ remember (capture insights)
|
|
|
54
59
|
remember({ title: "Session checkpoint: <topic>", content: "<what was done, decisions made, next steps>", category: "conventions" })
|
|
55
60
|
```
|
|
56
61
|
|
|
57
|
-
## Tool Catalog (
|
|
62
|
+
## Tool Catalog (64 tools)
|
|
58
63
|
|
|
59
|
-
### Search & Discovery (
|
|
64
|
+
### Search & Discovery (8)
|
|
60
65
|
| Tool | CLI | Purpose |
|
|
61
66
|
|------|-----|---------|
|
|
62
67
|
| `search` | `kb search` | Hybrid/semantic/keyword search with `search_mode` param |
|
|
@@ -98,7 +103,7 @@ remember({ title: "Session checkpoint: <topic>", content: "<what was done, decis
|
|
|
98
103
|
|
|
99
104
|
### Execution & Validation (5)
|
|
100
105
|
| Tool | CLI | Purpose |
|
|
101
|
-
|
|
106
|
+
|------|-----|---------|
|
|
102
107
|
| `eval` | `kb eval` | Sandboxed JavaScript/TypeScript execution |
|
|
103
108
|
| `check` | `kb check` | Incremental typecheck + lint. `detail` param: summary (default, ~300 tokens), errors, full |
|
|
104
109
|
| `test_run` | `kb test` | Run tests with structured pass/fail results |
|
|
@@ -142,25 +147,108 @@ Lane actions: `create` (copy files to lane), `list`, `status` (modified/added/de
|
|
|
142
147
|
|------|-----|---------|
|
|
143
148
|
| `regex_test` | — | Test regex patterns with match/replace/split modes |
|
|
144
149
|
| `encode` | — | Base64, URL, SHA-256, MD5, hex encode/decode, JWT decode |
|
|
145
|
-
| `measure` | — | Code complexity metrics (cyclomatic, lines, functions) |
|
|
150
|
+
| `measure` | — | Code complexity metrics (cyclomatic, cognitive complexity, lines, functions) |
|
|
146
151
|
| `changelog` | — | Generate changelog from git history (conventional commits) |
|
|
147
152
|
| `schema_validate` | — | Validate JSON data against JSON Schema |
|
|
148
153
|
| `snippet` | — | Save/get/search/delete persistent code snippets |
|
|
149
154
|
| `env` | — | System and runtime environment info (sensitive values redacted) |
|
|
150
155
|
| `time` | — | Date parsing, timezone conversion, duration math |
|
|
151
156
|
|
|
152
|
-
###
|
|
157
|
+
### FORGE Quality Gates (5)
|
|
158
|
+
| Tool | CLI | Purpose |
|
|
159
|
+
|------|-----|---------|
|
|
160
|
+
| `forge_ground` | — | Full Ground phase: classify tier, scope map, unknowns, constraints |
|
|
161
|
+
| `forge_classify` | — | Quick tier classification (Floor/Standard/Critical) |
|
|
162
|
+
| `evidence_map` | — | CRUD + Gate evaluation for verified/assumed/unknown claims |
|
|
163
|
+
| `stratum_card` | — | Generate T1/T2 compressed context cards from files (10-100x token reduction) |
|
|
164
|
+
| `digest` | — | Compress N text sources into token-budgeted summary |
|
|
165
|
+
|
|
166
|
+
### System (8)
|
|
153
167
|
| Tool | CLI | Purpose |
|
|
154
|
-
|
|
168
|
+
|------|-----|---------|
|
|
155
169
|
| `status` | `kb status` | Index statistics |
|
|
156
170
|
| `reindex` | `kb reindex` | Rebuild index |
|
|
157
171
|
| `health` | `kb health` | Project health checks (package.json, tsconfig, lockfile, circular deps) |
|
|
158
172
|
| `guide` | `kb guide` | Tool discovery — given a goal, recommends tools and workflow order |
|
|
173
|
+
| `onboard` | `kb onboard` | Full codebase onboarding in one call (structure + deps + patterns + knowledge) |
|
|
174
|
+
| `graph` | `kb graph` | Query the auto-populated knowledge graph (modules, symbols, imports) |
|
|
159
175
|
| `queue` | `kb queue` | Task queue for sequential agent operations (create/push/next/done/fail) |
|
|
160
176
|
| `replay` | `kb replay` | View or clear the audit trail of tool invocations (action: list/clear) |
|
|
161
177
|
|
|
162
178
|
## Search Strategy
|
|
163
179
|
|
|
180
|
+
## CRITICAL: Use KB Tools Instead of Native IDE Tools
|
|
181
|
+
|
|
182
|
+
KB tools provide **10x richer output** than native IDE tools — with AST-analyzed call graphs, scope context, import classification, and cognitive complexity. **Always prefer KB tools.**
|
|
183
|
+
|
|
184
|
+
### Tool Replacement Table
|
|
185
|
+
|
|
186
|
+
| Instead of... | Use KB Tool | Why |
|
|
187
|
+
|---------------|-------------|-----|
|
|
188
|
+
| `read_file` (full file) | `file_summary` | Exports, imports, call edges — **10x fewer tokens** |
|
|
189
|
+
| `read_file` (specific section) | `compact({ path, query })` | Server-side read + extract — **5-20x reduction** |
|
|
190
|
+
| `grep_search` / `textSearch` | `search` | Semantic + keyword hybrid across all indexed content |
|
|
191
|
+
| `grep_search` for a symbol | `symbol` | Definition + references **with scope context** |
|
|
192
|
+
| Multiple `read_file` calls | `digest` | Compresses multiple sources into token-budgeted summary |
|
|
193
|
+
| `listDirectory` + `read_file` | `scope_map` | Identifies relevant files for a task automatically |
|
|
194
|
+
| Manual code tracing | `trace` | AST call-graph traversal with scope context |
|
|
195
|
+
| Line counting / `wc` | `measure` | Lines, complexity, **cognitive complexity**, functions |
|
|
196
|
+
| Grep for unused exports | `dead_symbols` | AST-powered export detection with regex fallback |
|
|
197
|
+
| Repeated file reads | `stratum_card` | Reusable compressed context — **10-100x reduction** |
|
|
198
|
+
|
|
199
|
+
### Decision Tree — How to Read Code
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
Need to understand a file?
|
|
203
|
+
├─ Just structure? → file_summary (exports, imports, call edges — ~50 tokens)
|
|
204
|
+
├─ Specific section? → compact({ path: "file.ts", query: "topic" }) — 5-20x reduction
|
|
205
|
+
├─ Multiple files? → digest (multi-source compression — token-budgeted)
|
|
206
|
+
├─ Repeated reference? → stratum_card (T1/T2 card — 10-100x reduction)
|
|
207
|
+
└─ Full file needed? → ONLY as last resort, and compact it after reading
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### What KB Tools Return (AST-Enhanced)
|
|
211
|
+
|
|
212
|
+
These tools use Tree-sitter WASM to analyze source code at the AST level, providing structured data that raw file reads cannot:
|
|
213
|
+
|
|
214
|
+
| Tool | Rich Output |
|
|
215
|
+
|------|-------------|
|
|
216
|
+
| `file_summary` | Imports classified as **external vs internal** (`isExternal` flag). **Call edges** between functions (e.g., `handleRequest() → validateInput() @ line 42`). `exported` flag on interfaces and types. Import count breakdown. |
|
|
217
|
+
| `symbol` | References include **scope** — which function/class/method contains each usage (e.g., `referenced in processOrder() at auth-service.ts:55`). |
|
|
218
|
+
| `trace` | **Call-graph edges** discovered via AST syntax tree, not text matching. Supports forward (who does X call?) and backward (who calls X?) tracing. Scope context on each node. |
|
|
219
|
+
| `measure` | **Cognitive complexity** — weights nesting depth (nested `if` inside `for` inside `try` scores higher). More useful than cyclomatic complexity for understanding code difficulty. |
|
|
220
|
+
| `dead_symbols` | **AST export enumeration** — catches `export default`, barrel re-exports (`export { x } from`), `export =`, and `export type`. Regex fallback for non-AST-supported languages. |
|
|
221
|
+
|
|
222
|
+
### Example: `file_summary` Output
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
src/auth-service.ts
|
|
226
|
+
Language: typescript | Lines: 180 | Estimated tokens: ~1400
|
|
227
|
+
|
|
228
|
+
Imports (6): 3 external, 3 internal
|
|
229
|
+
- import { hash } from 'bcrypt' [external]
|
|
230
|
+
- import { UserRepo } from './user-repo' [internal]
|
|
231
|
+
|
|
232
|
+
Functions (4):
|
|
233
|
+
- authenticate @ line 22 [exported]
|
|
234
|
+
- validateToken @ line 55 [exported]
|
|
235
|
+
- hashPassword @ line 90
|
|
236
|
+
- generateJwt @ line 110
|
|
237
|
+
|
|
238
|
+
Call edges (12 intra-file):
|
|
239
|
+
- authenticate() → hashPassword() @ line 35
|
|
240
|
+
- authenticate() → generateJwt() @ line 42
|
|
241
|
+
- validateToken() → UserRepo.findById() @ line 68
|
|
242
|
+
|
|
243
|
+
Interfaces (2):
|
|
244
|
+
- AuthResult @ line 8 [exported]
|
|
245
|
+
- TokenPayload @ line 14
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Compare: `read_file` would cost ~1400 tokens for raw text. `file_summary` gives structured data in ~120 tokens — **12x reduction** with richer information.
|
|
249
|
+
|
|
250
|
+
## Search Strategy
|
|
251
|
+
|
|
164
252
|
1. **Start broad**: `search({ query: "topic", search_mode: "hybrid" })`
|
|
165
253
|
2. **Narrow**: Add `content_type`, `origin`, or `category` filters
|
|
166
254
|
3. **Exact match**: Use `search_mode: "keyword"` for identifiers
|
|
@@ -221,8 +309,10 @@ git_context({ diff: true })
|
|
|
221
309
|
## CLI Quick Reference
|
|
222
310
|
|
|
223
311
|
```bash
|
|
224
|
-
kb init
|
|
225
|
-
kb
|
|
312
|
+
kb init # Scaffold KB in current directory
|
|
313
|
+
kb init --force # Overwrite all scaffold/skill files
|
|
314
|
+
kb init --guide # JSON report of stale files for LLM-driven updates
|
|
315
|
+
kb serve # Start MCP server (stdio or HTTP)
|
|
226
316
|
kb search <q> # Hybrid search
|
|
227
317
|
kb find <q> # Federated search
|
|
228
318
|
kb symbol <name> # Resolve symbol
|