@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,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-handoff
|
|
3
|
+
description: "Creates comprehensive handoff documents for seamless AI agent session transfers. Triggered when: (1) user requests handoff/memory/context save, (2) context window approaches capacity, (3) major task milestone completed, (4) work session ending, (5) user says 'save state', 'create handoff', 'I need to pause', 'context is getting full', (6) resuming work with 'load handoff', 'resume from', 'continue where we left off'. Proactively suggests handoffs after substantial work (multiple file edits, complex debugging, architecture decisions). Solves long-running agent context exhaustion by enabling fresh agents to continue with zero ambiguity."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Handoff
|
|
7
|
+
|
|
8
|
+
Creates comprehensive handoff documents that enable fresh AI agents to seamlessly continue work with zero ambiguity. Solves the long-running agent context exhaustion problem.
|
|
9
|
+
|
|
10
|
+
## Mode Selection
|
|
11
|
+
|
|
12
|
+
Determine which mode applies:
|
|
13
|
+
|
|
14
|
+
**Creating a handoff?** User wants to save current state, pause work, or context is getting full.
|
|
15
|
+
- Follow: CREATE Workflow below
|
|
16
|
+
|
|
17
|
+
**Resuming from a handoff?** User wants to continue previous work, load context, or mentions an existing handoff.
|
|
18
|
+
- Follow: RESUME Workflow below
|
|
19
|
+
|
|
20
|
+
**Proactive suggestion?** After substantial work (5+ file edits, complex debugging, major decisions), suggest:
|
|
21
|
+
> "We've made significant progress. Consider creating a handoff document to preserve this context for future sessions. Say 'create handoff' when ready."
|
|
22
|
+
|
|
23
|
+
## CREATE Workflow
|
|
24
|
+
|
|
25
|
+
### Step 1: Generate Scaffold
|
|
26
|
+
|
|
27
|
+
Run the smart scaffold script to create a pre-filled handoff document:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node scripts/create_handoff.js [task-slug]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Example: `node scripts/create_handoff.js implementing-user-auth`
|
|
34
|
+
|
|
35
|
+
**For continuation handoffs** (linking to previous work):
|
|
36
|
+
```bash
|
|
37
|
+
node scripts/create_handoff.js "auth-part-2" --continues-from 2024-01-15-auth.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The script will:
|
|
41
|
+
- Create `.handoffs/` directory if needed
|
|
42
|
+
- Generate timestamped filename
|
|
43
|
+
- Pre-fill: timestamp, project path, git branch, recent commits, modified files
|
|
44
|
+
- Add handoff chain links if continuing from previous
|
|
45
|
+
- Output file path for editing
|
|
46
|
+
|
|
47
|
+
### Step 2: Complete the Handoff Document
|
|
48
|
+
|
|
49
|
+
Open the generated file and fill in all `[TODO: ...]` sections. Prioritize these sections:
|
|
50
|
+
|
|
51
|
+
1. **Current State Summary** - What's happening right now
|
|
52
|
+
2. **Important Context** - Critical info the next agent MUST know
|
|
53
|
+
3. **Immediate Next Steps** - Clear, actionable first steps
|
|
54
|
+
4. **Decisions Made** - Choices with rationale (not just outcomes)
|
|
55
|
+
|
|
56
|
+
Use the template structure in [references/handoff-template.md](references/handoff-template.md) for guidance.
|
|
57
|
+
|
|
58
|
+
### Step 3: Validate the Handoff
|
|
59
|
+
|
|
60
|
+
Run the validation script to check completeness and security:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
node scripts/validate_handoff.js <handoff-file>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The validator checks:
|
|
67
|
+
- [ ] No `[TODO: ...]` placeholders remaining
|
|
68
|
+
- [ ] Required sections present and populated
|
|
69
|
+
- [ ] No potential secrets detected (API keys, passwords, tokens)
|
|
70
|
+
- [ ] Referenced files exist
|
|
71
|
+
- [ ] Quality score (0-100)
|
|
72
|
+
|
|
73
|
+
**Do not finalize a handoff with secrets detected or score below 70.**
|
|
74
|
+
|
|
75
|
+
### Step 4: Confirm Handoff
|
|
76
|
+
|
|
77
|
+
Report to user:
|
|
78
|
+
- Handoff file location
|
|
79
|
+
- Validation score and any warnings
|
|
80
|
+
- Summary of captured context
|
|
81
|
+
- First action item for next session
|
|
82
|
+
|
|
83
|
+
## RESUME Workflow
|
|
84
|
+
|
|
85
|
+
### Step 1: Find Available Handoffs
|
|
86
|
+
|
|
87
|
+
List handoffs in the current project:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
node scripts/list_handoffs.js
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This shows all handoffs with dates, titles, and completion status.
|
|
94
|
+
|
|
95
|
+
### Step 2: Check Staleness
|
|
96
|
+
|
|
97
|
+
Before loading, check how current the handoff is:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
node scripts/check_staleness.js <handoff-file>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Staleness levels:
|
|
104
|
+
- **FRESH**: Safe to resume - minimal changes since handoff
|
|
105
|
+
- **SLIGHTLY_STALE**: Review changes, then resume
|
|
106
|
+
- **STALE**: Verify context carefully before resuming
|
|
107
|
+
- **VERY_STALE**: Consider creating a fresh handoff
|
|
108
|
+
|
|
109
|
+
The script checks:
|
|
110
|
+
- Time since handoff was created
|
|
111
|
+
- Git commits since handoff
|
|
112
|
+
- Files changed since handoff
|
|
113
|
+
- Branch divergence
|
|
114
|
+
- Missing referenced files
|
|
115
|
+
|
|
116
|
+
### Step 3: Load the Handoff
|
|
117
|
+
|
|
118
|
+
Read the relevant handoff document completely before taking any action.
|
|
119
|
+
|
|
120
|
+
If handoff is part of a chain (has "Continues from" link), also read the linked previous handoff for full context.
|
|
121
|
+
|
|
122
|
+
### Step 4: Verify Context
|
|
123
|
+
|
|
124
|
+
Follow the checklist in [references/resume-checklist.md](references/resume-checklist.md):
|
|
125
|
+
|
|
126
|
+
1. Verify project directory and git branch match
|
|
127
|
+
2. Check if blockers have been resolved
|
|
128
|
+
3. Validate assumptions still hold
|
|
129
|
+
4. Review modified files for conflicts
|
|
130
|
+
5. Check environment state
|
|
131
|
+
|
|
132
|
+
### Step 5: Begin Work
|
|
133
|
+
|
|
134
|
+
Start with "Immediate Next Steps" item #1 from the handoff document.
|
|
135
|
+
|
|
136
|
+
Reference these sections as you work:
|
|
137
|
+
- "Critical Files" for important locations
|
|
138
|
+
- "Key Patterns Discovered" for conventions to follow
|
|
139
|
+
- "Potential Gotchas" to avoid known issues
|
|
140
|
+
|
|
141
|
+
### Step 6: Update or Chain Handoffs
|
|
142
|
+
|
|
143
|
+
As you work:
|
|
144
|
+
- Mark completed items in "Pending Work"
|
|
145
|
+
- Add new discoveries to relevant sections
|
|
146
|
+
- For long sessions: create a new handoff with `--continues-from` to chain them
|
|
147
|
+
|
|
148
|
+
## Handoff Chaining
|
|
149
|
+
|
|
150
|
+
For long-running projects, chain handoffs together to maintain context lineage:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
handoff-1.md (initial work)
|
|
154
|
+
↓
|
|
155
|
+
handoff-2.md --continues-from handoff-1.md
|
|
156
|
+
↓
|
|
157
|
+
handoff-3.md --continues-from handoff-2.md
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Each handoff in the chain:
|
|
161
|
+
- Links to its predecessor
|
|
162
|
+
- Can mark older handoffs as superseded
|
|
163
|
+
- Provides context breadcrumbs for new agents
|
|
164
|
+
|
|
165
|
+
When resuming from a chain, read the most recent handoff first, then reference predecessors as needed.
|
|
166
|
+
|
|
167
|
+
## Storage Location
|
|
168
|
+
|
|
169
|
+
Handoffs are stored in: `.handoffs/`
|
|
170
|
+
|
|
171
|
+
Naming convention: `YYYY-MM-DD-HHMMSS-[slug].md`
|
|
172
|
+
|
|
173
|
+
Example: `2024-01-15-143022-implementing-auth.md`
|
|
174
|
+
|
|
175
|
+
## Resources
|
|
176
|
+
|
|
177
|
+
### scripts/
|
|
178
|
+
|
|
179
|
+
| Script | Purpose |
|
|
180
|
+
|--------|---------|
|
|
181
|
+
| `create_handoff.js [slug] [--continues-from <file>]` | Generate new handoff with smart scaffolding |
|
|
182
|
+
| `list_handoffs.js [path]` | List available handoffs in a project |
|
|
183
|
+
| `validate_handoff.js <file>` | Check completeness, quality, and security |
|
|
184
|
+
| `check_staleness.js <file>` | Assess if handoff context is still current |
|
|
185
|
+
|
|
186
|
+
### references/
|
|
187
|
+
|
|
188
|
+
- [handoff-template.md](references/handoff-template.md) - Complete template structure with guidance
|
|
189
|
+
- [resume-checklist.md](references/resume-checklist.md) - Verification checklist for resuming agents
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Handoff Template
|
|
2
|
+
|
|
3
|
+
Use this template structure when creating handoff documents. The smart scaffold script will pre-fill metadata sections; complete the remaining sections based on session context.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Session Metadata](#session-metadata)
|
|
8
|
+
- [Current State Summary](#current-state-summary)
|
|
9
|
+
- [Codebase Understanding](#codebase-understanding)
|
|
10
|
+
- [Architecture Overview](#architecture-overview)
|
|
11
|
+
- [Critical Files](#critical-files)
|
|
12
|
+
- [Key Patterns Discovered](#key-patterns-discovered)
|
|
13
|
+
- [Work Completed](#work-completed)
|
|
14
|
+
- [Tasks Finished](#tasks-finished)
|
|
15
|
+
- [Files Modified](#files-modified)
|
|
16
|
+
- [Decisions Made](#decisions-made)
|
|
17
|
+
- [Pending Work](#pending-work)
|
|
18
|
+
- [Immediate Next Steps](#immediate-next-steps)
|
|
19
|
+
- [Blockers/Open Questions](#blockersopen-questions)
|
|
20
|
+
- [Deferred Items](#deferred-items)
|
|
21
|
+
- [Context for Resuming Agent](#context-for-resuming-agent)
|
|
22
|
+
- [Important Context](#important-context)
|
|
23
|
+
- [Assumptions Made](#assumptions-made)
|
|
24
|
+
- [Potential Gotchas](#potential-gotchas)
|
|
25
|
+
- [Environment State](#environment-state)
|
|
26
|
+
- [Related Resources](#related-resources)
|
|
27
|
+
- [Template Usage Notes](#template-usage-notes)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Handoff: [TASK_TITLE]
|
|
32
|
+
|
|
33
|
+
## Session Metadata
|
|
34
|
+
- Created: [TIMESTAMP]
|
|
35
|
+
- Project: [PROJECT_PATH]
|
|
36
|
+
- Branch: [GIT_BRANCH]
|
|
37
|
+
- Session duration: [APPROX_DURATION]
|
|
38
|
+
|
|
39
|
+
## Current State Summary
|
|
40
|
+
|
|
41
|
+
[One paragraph: What was being worked on, current status, and where things left off]
|
|
42
|
+
|
|
43
|
+
## Codebase Understanding
|
|
44
|
+
|
|
45
|
+
### Architecture Overview
|
|
46
|
+
|
|
47
|
+
[Key architectural insights discovered during this session - how the system is structured, main components, data flow]
|
|
48
|
+
|
|
49
|
+
### Critical Files
|
|
50
|
+
|
|
51
|
+
| File | Purpose | Relevance |
|
|
52
|
+
|------|---------|-----------|
|
|
53
|
+
| path/to/file | What this file does | Why it matters for this task |
|
|
54
|
+
|
|
55
|
+
### Key Patterns Discovered
|
|
56
|
+
|
|
57
|
+
[Important patterns, conventions, or idioms found in this codebase that the next agent should follow]
|
|
58
|
+
|
|
59
|
+
## Work Completed
|
|
60
|
+
|
|
61
|
+
### Tasks Finished
|
|
62
|
+
|
|
63
|
+
- [x] Task 1 - brief description of what was done
|
|
64
|
+
- [x] Task 2 - brief description
|
|
65
|
+
|
|
66
|
+
### Files Modified
|
|
67
|
+
|
|
68
|
+
| File | Changes | Rationale |
|
|
69
|
+
|------|---------|-----------|
|
|
70
|
+
| path/to/file | Description of changes | Why this change was made |
|
|
71
|
+
|
|
72
|
+
### Decisions Made
|
|
73
|
+
|
|
74
|
+
| Decision | Options Considered | Rationale |
|
|
75
|
+
|----------|-------------------|-----------|
|
|
76
|
+
| Chose X over Y | X, Y, Z | Why X was chosen |
|
|
77
|
+
|
|
78
|
+
## Pending Work
|
|
79
|
+
|
|
80
|
+
### Immediate Next Steps
|
|
81
|
+
|
|
82
|
+
1. [Most critical next action - what to do first]
|
|
83
|
+
2. [Second priority]
|
|
84
|
+
3. [Third priority]
|
|
85
|
+
|
|
86
|
+
### Blockers/Open Questions
|
|
87
|
+
|
|
88
|
+
- [ ] Blocker: [description] - Needs: [what's required to unblock]
|
|
89
|
+
- [ ] Question: [unclear aspect] - Suggested: [potential resolution]
|
|
90
|
+
|
|
91
|
+
### Deferred Items
|
|
92
|
+
|
|
93
|
+
- Item 1 (deferred because: [reason, e.g., out of scope, needs user input])
|
|
94
|
+
|
|
95
|
+
## Context for Resuming Agent
|
|
96
|
+
|
|
97
|
+
### Important Context
|
|
98
|
+
|
|
99
|
+
[Critical information the next agent MUST know to continue effectively - this is the most important section for handoff]
|
|
100
|
+
|
|
101
|
+
### Assumptions Made
|
|
102
|
+
|
|
103
|
+
- Assumption 1: [what was assumed to be true]
|
|
104
|
+
- Assumption 2: [another assumption]
|
|
105
|
+
|
|
106
|
+
### Potential Gotchas
|
|
107
|
+
|
|
108
|
+
- [Things that might trip up a new agent - edge cases, quirks, non-obvious behavior]
|
|
109
|
+
|
|
110
|
+
## Environment State
|
|
111
|
+
|
|
112
|
+
### Tools/Services Used
|
|
113
|
+
|
|
114
|
+
- [Tool/Service]: [relevant configuration or state]
|
|
115
|
+
|
|
116
|
+
### Active Processes
|
|
117
|
+
|
|
118
|
+
- [Any background processes, dev servers, watchers that may be running]
|
|
119
|
+
|
|
120
|
+
### Environment Variables
|
|
121
|
+
|
|
122
|
+
- [Key env vars that matter for this work - DO NOT include secrets/values, just names]
|
|
123
|
+
|
|
124
|
+
## Related Resources
|
|
125
|
+
|
|
126
|
+
- [Link to relevant documentation]
|
|
127
|
+
- [Related file paths]
|
|
128
|
+
- [External resources consulted]
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Template Usage Notes
|
|
133
|
+
|
|
134
|
+
When filling this template:
|
|
135
|
+
1. Be specific and concrete - vague descriptions don't help the next agent
|
|
136
|
+
2. Include file paths with line numbers where relevant (e.g., `src/auth.ts:142`)
|
|
137
|
+
3. Prioritize the "Important Context" and "Immediate Next Steps" sections
|
|
138
|
+
4. Don't include sensitive data (API keys, passwords, tokens)
|
|
139
|
+
5. Focus on WHAT and WHY, not just WHAT - rationale is crucial for handoffs
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Resume Checklist
|
|
2
|
+
|
|
3
|
+
Follow this checklist when resuming work from a handoff document to ensure zero-ambiguity continuation.
|
|
4
|
+
|
|
5
|
+
## Pre-Resume Verification
|
|
6
|
+
|
|
7
|
+
- [ ] Read the entire handoff document before taking any action
|
|
8
|
+
- [ ] Verify you are in the correct project directory
|
|
9
|
+
- [ ] Confirm the git branch matches (or understand why it might differ)
|
|
10
|
+
- [ ] Check the handoff timestamp - how stale is this context?
|
|
11
|
+
|
|
12
|
+
## Context Validation
|
|
13
|
+
|
|
14
|
+
- [ ] Review "Important Context" section thoroughly
|
|
15
|
+
- [ ] Understand all assumptions listed - are they still valid?
|
|
16
|
+
- [ ] Check if any blockers have been resolved since handoff
|
|
17
|
+
- [ ] Review "Potential Gotchas" to avoid known pitfalls
|
|
18
|
+
|
|
19
|
+
## State Verification
|
|
20
|
+
|
|
21
|
+
- [ ] Run `git status` to see current file state
|
|
22
|
+
- [ ] Compare modified files list in handoff vs current state
|
|
23
|
+
- [ ] Check if any environment variables need to be set
|
|
24
|
+
- [ ] Verify any required services/processes are running
|
|
25
|
+
|
|
26
|
+
## Resume Execution
|
|
27
|
+
|
|
28
|
+
- [ ] Start with "Immediate Next Steps" item #1
|
|
29
|
+
- [ ] Reference "Files Modified" table for context on recent changes
|
|
30
|
+
- [ ] Apply patterns documented in "Key Patterns Discovered"
|
|
31
|
+
- [ ] Follow architectural insights from "Architecture Overview"
|
|
32
|
+
|
|
33
|
+
## During Work
|
|
34
|
+
|
|
35
|
+
- [ ] Update handoff document if major new context is discovered
|
|
36
|
+
- [ ] Mark completed items in "Pending Work" as you finish them
|
|
37
|
+
- [ ] Add new blockers/questions as they arise
|
|
38
|
+
- [ ] Consider creating a new handoff if session becomes long
|
|
39
|
+
|
|
40
|
+
## Red Flags - Stop and Verify
|
|
41
|
+
|
|
42
|
+
If you encounter any of these, pause and verify context before proceeding:
|
|
43
|
+
|
|
44
|
+
1. **Files mentioned in handoff don't exist** - codebase may have changed significantly
|
|
45
|
+
2. **Branch has diverged substantially** - check git log for recent commits
|
|
46
|
+
3. **Assumptions are clearly invalid** - reassess the approach
|
|
47
|
+
4. **Blockers marked as unresolved are now blocking you** - escalate to user
|
|
48
|
+
5. **Architecture has changed** - re-explore before continuing
|
|
49
|
+
|
|
50
|
+
## Quick Start Commands
|
|
51
|
+
|
|
52
|
+
After reading the handoff, these commands help verify state:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Check current branch and status
|
|
56
|
+
git branch --show-current
|
|
57
|
+
git status
|
|
58
|
+
|
|
59
|
+
# See recent commits (compare with handoff)
|
|
60
|
+
git log --oneline -10
|
|
61
|
+
|
|
62
|
+
# Check for any running processes mentioned
|
|
63
|
+
ps aux | grep [process-name]
|
|
64
|
+
|
|
65
|
+
# Verify environment
|
|
66
|
+
env | grep [relevant-var]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Handoff Quality Assessment
|
|
70
|
+
|
|
71
|
+
Rate the handoff quality to identify if more exploration is needed:
|
|
72
|
+
|
|
73
|
+
| Aspect | Good | Needs Exploration |
|
|
74
|
+
|--------|------|-------------------|
|
|
75
|
+
| Next steps | Clear, actionable | Vague or missing |
|
|
76
|
+
| File references | Specific paths/lines | General descriptions |
|
|
77
|
+
| Decisions | Rationale included | Just outcomes |
|
|
78
|
+
| Context | Complete picture | Gaps or assumptions |
|
|
79
|
+
|
|
80
|
+
If multiple aspects "Need Exploration", spend time re-exploring the codebase before continuing implementation.
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Check staleness of a handoff document compared to current project state.
|
|
4
|
+
*
|
|
5
|
+
* Analyzes:
|
|
6
|
+
* - Time since handoff was created
|
|
7
|
+
* - Git commits since handoff
|
|
8
|
+
* - Files that changed since handoff
|
|
9
|
+
* - Branch divergence
|
|
10
|
+
* - Modified files status
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* node check_staleness.js <handoff-file>
|
|
14
|
+
* node check_staleness.js .handoffs/2024-01-15-143022-auth.md
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const fs = require('node:fs');
|
|
18
|
+
const path = require('node:path');
|
|
19
|
+
const { execSync } = require('node:child_process');
|
|
20
|
+
|
|
21
|
+
function _die(msg) {
|
|
22
|
+
process.stderr.write(`${msg}\n`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function runCmd(cmd, cwd) {
|
|
27
|
+
try {
|
|
28
|
+
return { ok: true, out: execSync(cmd, { cwd, timeout: 10_000, encoding: 'utf-8' }).trim() };
|
|
29
|
+
} catch {
|
|
30
|
+
return { ok: false, out: '' };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function parseHandoffMetadata(filepath) {
|
|
35
|
+
const content = fs.readFileSync(filepath, 'utf-8');
|
|
36
|
+
const meta = { created: null, branch: null, projectPath: null, modifiedFiles: [] };
|
|
37
|
+
|
|
38
|
+
const createdMatch = content.match(/Created:\s*(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})/);
|
|
39
|
+
if (createdMatch) meta.created = new Date(createdMatch[1].replace(' ', 'T'));
|
|
40
|
+
|
|
41
|
+
const branchMatch = content.match(/Branch:\s*(\S+)/);
|
|
42
|
+
if (branchMatch && !branchMatch[1].startsWith('[')) meta.branch = branchMatch[1];
|
|
43
|
+
|
|
44
|
+
const projMatch = content.match(/Project:\s*(.+?)(?:\n|$)/);
|
|
45
|
+
if (projMatch) meta.projectPath = projMatch[1].trim();
|
|
46
|
+
|
|
47
|
+
const fileMatches = content.matchAll(/\|\s*([a-zA-Z0-9_\-./]+\.[a-zA-Z]+)\s*\|/g);
|
|
48
|
+
for (const m of fileMatches) {
|
|
49
|
+
if (m[1].includes('/') && !m[1].startsWith('[')) meta.modifiedFiles.push(m[1]);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return meta;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getCommitsSince(timestamp, cwd) {
|
|
56
|
+
if (!timestamp) return [];
|
|
57
|
+
const iso = timestamp.toISOString();
|
|
58
|
+
const { ok, out } = runCmd(`git log --since="${iso}" --oneline --no-decorate`, cwd);
|
|
59
|
+
return ok && out ? out.split('\n') : [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getChangedFilesSince(timestamp, cwd) {
|
|
63
|
+
if (!timestamp) return [];
|
|
64
|
+
const iso = timestamp.toISOString();
|
|
65
|
+
const { ok, out } = runCmd(`git log --since="${iso}" --name-only --pretty=format:`, cwd);
|
|
66
|
+
if (ok && out) {
|
|
67
|
+
return [
|
|
68
|
+
...new Set(
|
|
69
|
+
out
|
|
70
|
+
.split('\n')
|
|
71
|
+
.map((f) => f.trim())
|
|
72
|
+
.filter(Boolean),
|
|
73
|
+
),
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function checkFilesExist(files, cwd) {
|
|
80
|
+
const existing = [];
|
|
81
|
+
const missing = [];
|
|
82
|
+
for (const f of files) {
|
|
83
|
+
if (fs.existsSync(path.join(cwd, f))) existing.push(f);
|
|
84
|
+
else missing.push(f);
|
|
85
|
+
}
|
|
86
|
+
return { existing, missing };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function calculateStaleness(daysOld, commitsSince, filesChanged, branchMatches, filesMissing) {
|
|
90
|
+
const issues = [];
|
|
91
|
+
let score = 0;
|
|
92
|
+
|
|
93
|
+
if (daysOld > 30) {
|
|
94
|
+
score += 3;
|
|
95
|
+
issues.push(`Handoff is ${Math.floor(daysOld)} days old`);
|
|
96
|
+
} else if (daysOld > 7) {
|
|
97
|
+
score += 2;
|
|
98
|
+
issues.push(`Handoff is ${Math.floor(daysOld)} days old`);
|
|
99
|
+
} else if (daysOld > 1) {
|
|
100
|
+
score += 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (commitsSince > 50) {
|
|
104
|
+
score += 3;
|
|
105
|
+
issues.push(`${commitsSince} commits since handoff - significant changes`);
|
|
106
|
+
} else if (commitsSince > 20) {
|
|
107
|
+
score += 2;
|
|
108
|
+
issues.push(`${commitsSince} commits since handoff`);
|
|
109
|
+
} else if (commitsSince > 5) {
|
|
110
|
+
score += 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!branchMatches) {
|
|
114
|
+
score += 2;
|
|
115
|
+
issues.push('Current branch differs from handoff branch');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (filesMissing > 5) {
|
|
119
|
+
score += 2;
|
|
120
|
+
issues.push(`${filesMissing} referenced files no longer exist`);
|
|
121
|
+
} else if (filesMissing > 0) {
|
|
122
|
+
score += 1;
|
|
123
|
+
issues.push(`${filesMissing} referenced file(s) missing`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (filesChanged > 20) {
|
|
127
|
+
score += 2;
|
|
128
|
+
issues.push(`${filesChanged} files changed since handoff`);
|
|
129
|
+
} else if (filesChanged > 5) {
|
|
130
|
+
score += 1;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let level, recommendation;
|
|
134
|
+
if (score === 0) {
|
|
135
|
+
level = 'FRESH';
|
|
136
|
+
recommendation = 'Safe to resume - minimal changes since handoff';
|
|
137
|
+
} else if (score <= 2) {
|
|
138
|
+
level = 'SLIGHTLY_STALE';
|
|
139
|
+
recommendation = 'Generally safe to resume - review changes before continuing';
|
|
140
|
+
} else if (score <= 4) {
|
|
141
|
+
level = 'STALE';
|
|
142
|
+
recommendation = 'Proceed with caution - significant changes may affect context';
|
|
143
|
+
} else {
|
|
144
|
+
level = 'VERY_STALE';
|
|
145
|
+
recommendation = 'Consider creating new handoff - too many changes since original';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return { level, recommendation, issues };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function checkStaleness(handoffPath) {
|
|
152
|
+
if (!fs.existsSync(handoffPath)) return { error: `Handoff file not found: ${handoffPath}` };
|
|
153
|
+
|
|
154
|
+
const meta = parseHandoffMetadata(handoffPath);
|
|
155
|
+
const projectPath =
|
|
156
|
+
meta.projectPath && fs.existsSync(meta.projectPath)
|
|
157
|
+
? meta.projectPath
|
|
158
|
+
: path.resolve(path.dirname(handoffPath), '..'); // Up from .handoffs/
|
|
159
|
+
|
|
160
|
+
const isGitRepo = runCmd('git rev-parse --git-dir', projectPath).ok;
|
|
161
|
+
|
|
162
|
+
const result = {
|
|
163
|
+
handoffFile: handoffPath,
|
|
164
|
+
projectPath,
|
|
165
|
+
isGitRepo,
|
|
166
|
+
created: meta.created,
|
|
167
|
+
handoffBranch: meta.branch,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
if (meta.created) {
|
|
171
|
+
const age = Date.now() - meta.created.getTime();
|
|
172
|
+
result.daysOld = age / 86_400_000;
|
|
173
|
+
result.hoursOld = age / 3_600_000;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (isGitRepo) {
|
|
177
|
+
const { out: currentBranch } = runCmd('git branch --show-current', projectPath);
|
|
178
|
+
result.currentBranch = currentBranch;
|
|
179
|
+
result.branchMatches = meta.branch ? currentBranch === meta.branch : true;
|
|
180
|
+
|
|
181
|
+
const commits = getCommitsSince(meta.created, projectPath);
|
|
182
|
+
result.commitsSince = commits.length;
|
|
183
|
+
result.recentCommits = commits.slice(0, 5);
|
|
184
|
+
|
|
185
|
+
const changedFiles = getChangedFilesSince(meta.created, projectPath);
|
|
186
|
+
result.filesChangedCount = changedFiles.length;
|
|
187
|
+
result.filesChanged = changedFiles.slice(0, 10);
|
|
188
|
+
|
|
189
|
+
const { existing, missing } = checkFilesExist(meta.modifiedFiles, projectPath);
|
|
190
|
+
result.referencedFilesExist = existing.length;
|
|
191
|
+
result.referencedFilesMissing = missing;
|
|
192
|
+
|
|
193
|
+
const { level, recommendation, issues } = calculateStaleness(
|
|
194
|
+
result.daysOld || 0,
|
|
195
|
+
result.commitsSince,
|
|
196
|
+
result.filesChangedCount,
|
|
197
|
+
result.branchMatches,
|
|
198
|
+
missing.length,
|
|
199
|
+
);
|
|
200
|
+
result.stalenessLevel = level;
|
|
201
|
+
result.recommendation = recommendation;
|
|
202
|
+
result.issues = issues;
|
|
203
|
+
} else {
|
|
204
|
+
result.stalenessLevel = 'UNKNOWN';
|
|
205
|
+
result.recommendation = 'Not a git repo - unable to detect changes';
|
|
206
|
+
result.issues = ['Project is not a git repository'];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function printReport(result) {
|
|
213
|
+
if (result.error) {
|
|
214
|
+
console.log(`Error: ${result.error}`);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
219
|
+
console.log('Handoff Staleness Report');
|
|
220
|
+
console.log('='.repeat(60));
|
|
221
|
+
console.log(`File: ${result.handoffFile}`);
|
|
222
|
+
console.log(`Project: ${result.projectPath}`);
|
|
223
|
+
|
|
224
|
+
if (result.created) {
|
|
225
|
+
console.log(`Created: ${result.created.toISOString().replace('T', ' ').slice(0, 19)}`);
|
|
226
|
+
if (result.daysOld != null) {
|
|
227
|
+
console.log(
|
|
228
|
+
result.daysOld < 1
|
|
229
|
+
? `Age: ${result.hoursOld.toFixed(1)} hours`
|
|
230
|
+
: `Age: ${result.daysOld.toFixed(1)} days`,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
console.log(`\nStaleness: ${result.stalenessLevel}`);
|
|
236
|
+
console.log(`Recommendation: ${result.recommendation}`);
|
|
237
|
+
|
|
238
|
+
if (result.issues && result.issues.length > 0) {
|
|
239
|
+
console.log('\nIssues:');
|
|
240
|
+
for (const issue of result.issues) console.log(` - ${issue}`);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (result.isGitRepo) {
|
|
244
|
+
console.log(
|
|
245
|
+
`\nBranch: ${result.currentBranch || 'detached'}${result.branchMatches ? ' (matches handoff)' : ` (handoff: ${result.handoffBranch})`}`,
|
|
246
|
+
);
|
|
247
|
+
console.log(`Commits since handoff: ${result.commitsSince}`);
|
|
248
|
+
console.log(`Files changed since handoff: ${result.filesChangedCount}`);
|
|
249
|
+
if (result.referencedFilesMissing.length > 0) {
|
|
250
|
+
console.log(`Missing referenced files: ${result.referencedFilesMissing.join(', ')}`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// --- Main ---
|
|
256
|
+
const args = process.argv.slice(2);
|
|
257
|
+
if (args.includes('--help') || args.includes('-h') || args.length === 0) {
|
|
258
|
+
console.log('Usage: node check_staleness.js <handoff-file>');
|
|
259
|
+
console.log(' node check_staleness.js .handoffs/2024-01-15-143022-auth.md');
|
|
260
|
+
process.exit(args.length === 0 ? 1 : 0);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (args.includes('--json')) {
|
|
264
|
+
const result = checkStaleness(args.find((a) => !a.startsWith('-')));
|
|
265
|
+
console.log(JSON.stringify(result, null, 2));
|
|
266
|
+
} else {
|
|
267
|
+
const result = checkStaleness(args[0]);
|
|
268
|
+
printReport(result);
|
|
269
|
+
}
|