octocode-cli 1.2.7 → 1.2.9
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 +42 -35
- package/out/octocode-cli.js +36 -11719
- package/package.json +36 -36
- package/skills/README.md +42 -114
- package/skills/{octocode-code-engineer → octocode-engineer}/.claude/settings.local.json +2 -1
- package/skills/octocode-engineer/README.md +99 -0
- package/skills/octocode-engineer/SKILL.md +499 -0
- package/skills/octocode-engineer/build.mjs +29 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/eslint.config.mjs +3 -13
- package/skills/{octocode-code-engineer → octocode-engineer}/package.json +28 -27
- package/skills/octocode-engineer/references/ast-reference.md +166 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/references/cli-reference.md +80 -6
- package/skills/octocode-engineer/references/externals.md +86 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/references/output-files.md +46 -6
- package/skills/octocode-engineer/references/quality-indicators.md +202 -0
- package/skills/octocode-engineer/references/tool-workflows.md +298 -0
- package/skills/octocode-engineer/references/validation-playbooks.md +99 -0
- package/skills/octocode-engineer/scripts/ast/search.js +45 -0
- package/skills/octocode-engineer/scripts/ast/tree-search.js +27 -0
- package/skills/octocode-engineer/scripts/index.js +173 -0
- package/skills/octocode-engineer/scripts/run.js +179 -0
- package/skills/octocode-engineer/src/analysis/dependencies.ts +378 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/discovery.test.ts +57 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/discovery.ts +43 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/search.test.ts +113 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/search.ts +64 -1
- package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-sitter.test.ts +118 -2
- package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-sitter.ts +65 -3
- package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/ts-analyzer.test.ts +281 -1
- package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/ts-analyzer.ts +173 -3
- package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/security.test.ts +73 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/security.ts +62 -4
- package/skills/octocode-engineer/src/detector-gating.test.ts +59 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/code-quality.ts +342 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/index.ts +8 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/index.test.ts +565 -11
- package/skills/octocode-engineer/src/index.ts +468 -0
- package/skills/octocode-engineer/src/pipeline/affected.test.ts +147 -0
- package/skills/octocode-engineer/src/pipeline/affected.ts +68 -0
- package/skills/octocode-engineer/src/pipeline/baseline.test.ts +276 -0
- package/skills/octocode-engineer/src/pipeline/baseline.ts +76 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cli.test.ts +300 -53
- package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cli.ts +180 -36
- package/skills/octocode-engineer/src/pipeline/config-loader.test.ts +264 -0
- package/skills/octocode-engineer/src/pipeline/config-loader.ts +109 -0
- package/skills/octocode-engineer/src/pipeline/create-options.ts +55 -0
- package/skills/octocode-engineer/src/pipeline/health-score.test.ts +65 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/main.ts +130 -17
- package/skills/octocode-engineer/src/pipeline/progress.ts +51 -0
- package/skills/octocode-engineer/src/pipeline/reporters.test.ts +155 -0
- package/skills/octocode-engineer/src/pipeline/reporters.ts +64 -0
- package/skills/octocode-engineer/src/reporting/graph-features.test.ts +279 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/output-contract.test.ts +6 -0
- package/skills/octocode-engineer/src/reporting/summary-md.test.ts +1066 -0
- package/skills/octocode-engineer/src/reporting/summary-md.ts +1604 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/writer.ts +136 -13
- package/skills/octocode-engineer/src/run.ts +78 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/sanity.test.ts +1 -1
- package/skills/octocode-engineer/src/types/analysis.ts +25 -0
- package/skills/octocode-engineer/src/types/collectors.ts +134 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/types/constants.ts +75 -41
- package/skills/octocode-engineer/src/types/core.ts +203 -0
- package/skills/octocode-engineer/src/types/dependency.ts +215 -0
- package/skills/octocode-engineer/src/types/file-entry.ts +108 -0
- package/skills/octocode-engineer/src/types/findings.ts +105 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/src/types/index.ts +60 -30
- package/skills/octocode-engineer/src/types/tree-sitter.ts +38 -0
- package/skills/{octocode-code-engineer → octocode-engineer}/tsconfig.json +1 -0
- package/skills/octocode-research/.octocode/scan/.cache/analysis-cache.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/architecture.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/ast-trees.txt +5566 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/code-quality.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/dead-code.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/file-inventory.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/findings.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/graph.md +189 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/security.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/summary.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/summary.md +265 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/architecture.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/ast-trees.txt +5555 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/code-quality.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/dead-code.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/file-inventory.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/findings.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/graph.md +190 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/security.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/summary.json +1 -0
- package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/summary.md +265 -0
- package/skills/octocode-research/CHANGELOG.md +60 -0
- package/skills/octocode-research/README.md +102 -388
- package/skills/octocode-research/SKILL.md +169 -498
- package/skills/octocode-research/package.json +19 -31
- package/skills/octocode-research/references/PARALLEL_AGENT_PROTOCOL.md +19 -0
- package/skills/octocode-research/references/SESSION_MANAGEMENT.md +38 -0
- package/skills/octocode-research/scripts/server-init.js +1 -1
- package/skills/octocode-research/scripts/server.d.ts +2 -1
- package/skills/octocode-research/scripts/server.js +329 -233
- package/skills/octocode-research/src/__tests__/integration/promptsRoutes.test.ts +180 -0
- package/skills/octocode-research/src/__tests__/integration/serverHttp.test.ts +221 -0
- package/skills/octocode-research/src/__tests__/integration/serverLifecycle.test.ts +194 -0
- package/skills/octocode-research/src/__tests__/integration/toolsRoutes.test.ts +501 -0
- package/skills/octocode-research/src/__tests__/unit/readiness.test.ts +61 -0
- package/skills/octocode-research/src/__tests__/unit/resilience.test.ts +192 -0
- package/skills/octocode-research/src/__tests__/unit/responseFactory.test.ts +172 -0
- package/skills/octocode-research/src/__tests__/unit/responseParser.test.ts +288 -0
- package/skills/octocode-research/src/__tests__/unit/schemas.test.ts +509 -0
- package/skills/octocode-research/src/index.ts +4 -124
- package/skills/octocode-research/src/middleware/queryParser.ts +0 -26
- package/skills/octocode-research/src/routes/lsp.ts +58 -59
- package/skills/octocode-research/src/routes/package.ts +35 -65
- package/skills/octocode-research/src/routes/prompts.ts +3 -3
- package/skills/octocode-research/src/routes/tools.ts +8 -20
- package/skills/octocode-research/src/server-init.ts +30 -237
- package/skills/octocode-research/src/server.ts +50 -23
- package/skills/octocode-research/src/types/errorGuards.ts +9 -80
- package/skills/octocode-research/src/types/guards.ts +0 -28
- package/skills/octocode-research/src/types/mcp.ts +11 -66
- package/skills/octocode-research/src/types/responses.ts +11 -129
- package/skills/octocode-research/src/utils/circuitBreaker.ts +0 -21
- package/skills/octocode-research/src/utils/logger.ts +1 -97
- package/skills/octocode-research/src/utils/resilience.ts +2 -12
- package/skills/octocode-research/src/utils/responseFactory.ts +0 -42
- package/skills/octocode-research/src/utils/responseParser.ts +3 -25
- package/skills/octocode-research/src/utils/retry.ts +0 -63
- package/skills/octocode-research/src/utils/routeFactory.ts +1 -1
- package/skills/octocode-research/src/validation/httpPreprocess.ts +0 -3
- package/skills/octocode-research/src/validation/index.ts +0 -1
- package/skills/octocode-research/src/validation/schemas.ts +0 -63
- package/skills/octocode-research/src/validation/toolCallSchema.ts +3 -3
- package/skills/octocode-research/tsdown.config.ts +4 -0
- package/skills/octocode-research/vitest.config.ts +3 -0
- package/skills/octocode-code-engineer/.plan/VALIDATED_PLAN.md +0 -223
- package/skills/octocode-code-engineer/README.md +0 -178
- package/skills/octocode-code-engineer/SKILL.md +0 -418
- package/skills/octocode-code-engineer/minify-scripts.mjs +0 -32
- package/skills/octocode-code-engineer/references/agent-ast-reading-rfc.md +0 -95
- package/skills/octocode-code-engineer/references/architecture-techniques.md +0 -121
- package/skills/octocode-code-engineer/references/ast-search.md +0 -210
- package/skills/octocode-code-engineer/references/ast-tree-search.md +0 -151
- package/skills/octocode-code-engineer/references/concepts.md +0 -107
- package/skills/octocode-code-engineer/references/finding-categories.md +0 -128
- package/skills/octocode-code-engineer/references/improvement-roadmap.md +0 -304
- package/skills/octocode-code-engineer/references/playbooks.md +0 -204
- package/skills/octocode-code-engineer/references/present-results.md +0 -136
- package/skills/octocode-code-engineer/references/tool-workflows.md +0 -566
- package/skills/octocode-code-engineer/references/validate-investigate.md +0 -225
- package/skills/octocode-code-engineer/scripts/analysis/dependencies.js +0 -1
- package/skills/octocode-code-engineer/scripts/analysis/dependency-summary.js +0 -1
- package/skills/octocode-code-engineer/scripts/analysis/discovery.js +0 -1
- package/skills/octocode-code-engineer/scripts/analysis/graph-analytics.js +0 -1
- package/skills/octocode-code-engineer/scripts/analysis/semantic.js +0 -1
- package/skills/octocode-code-engineer/scripts/ast/helpers.js +0 -1
- package/skills/octocode-code-engineer/scripts/ast/metrics.js +0 -1
- package/skills/octocode-code-engineer/scripts/ast/search.js +0 -2
- package/skills/octocode-code-engineer/scripts/ast/tree-search.js +0 -2
- package/skills/octocode-code-engineer/scripts/ast/tree-sitter.js +0 -1
- package/skills/octocode-code-engineer/scripts/ast/ts-analyzer.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/chains.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/effects.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/input-sources.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/performance.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/prototype-pollution.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/security.js +0 -1
- package/skills/octocode-code-engineer/scripts/collectors/test-profile.js +0 -1
- package/skills/octocode-code-engineer/scripts/common/is-direct-run.js +0 -1
- package/skills/octocode-code-engineer/scripts/common/utils.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/code-quality.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/cohesion.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/coupling.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/cycle.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/dead-code.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/import-style.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/index.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/security.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/semantic.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/shared.js +0 -1
- package/skills/octocode-code-engineer/scripts/detectors/test-quality.js +0 -1
- package/skills/octocode-code-engineer/scripts/index.js +0 -1
- package/skills/octocode-code-engineer/scripts/pipeline/cache.js +0 -1
- package/skills/octocode-code-engineer/scripts/pipeline/cli.js +0 -1
- package/skills/octocode-code-engineer/scripts/pipeline/main.js +0 -2
- package/skills/octocode-code-engineer/scripts/reporting/analysis.js +0 -1
- package/skills/octocode-code-engineer/scripts/reporting/summary-md.js +0 -1
- package/skills/octocode-code-engineer/scripts/reporting/writer.js +0 -1
- package/skills/octocode-code-engineer/scripts/types/constants.js +0 -1
- package/skills/octocode-code-engineer/scripts/types/index.js +0 -1
- package/skills/octocode-code-engineer/scripts/types/interfaces.js +0 -1
- package/skills/octocode-code-engineer/src/analysis/dependencies.ts +0 -406
- package/skills/octocode-code-engineer/src/index.ts +0 -403
- package/skills/octocode-code-engineer/src/reporting/summary-md.test.ts +0 -421
- package/skills/octocode-code-engineer/src/reporting/summary-md.ts +0 -714
- package/skills/octocode-code-engineer/src/types/interfaces.ts +0 -682
- package/skills/octocode-research/src/types/toolTypes.ts +0 -33
- package/skills/octocode-research/src/utils/logEmoji.ts +0 -103
- /package/skills/{octocode-code-engineer → octocode-engineer}/.octocode/rfc/RFC-code-engineer-weakness-fixes.md +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/architecture.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/ast-helpers.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/ast-search.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/base.css +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/block-navigation.js +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/cache.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/cli.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/clover.xml +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-effects.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-input-sources.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-performance.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-prototype-pollution.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-security.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-test-profile.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/coverage-final.json +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/dependencies.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/dependency-summary.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/discovery.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/favicon.png +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/graph-analytics.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/index.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/index.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/metrics.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/pipeline.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/prettify.css +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/prettify.js +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/report-analysis.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/report-writer.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/security-detectors.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/semantic-detectors.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/semantic.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/sort-arrow-sprite.png +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/sorter.js +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/summary-md.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/test-quality-detectors.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/tree-sitter-analyzer.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/ts-analyzer.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/types.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/utils.ts.html +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/dependencies.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/dependency-summary.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/dependency-summary.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/graph-analytics.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/graph-analytics.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/semantic.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/semantic.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/helpers.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/helpers.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/metrics.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/metrics.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-search.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-search.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/chains.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/effects.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/effects.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/input-sources.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/input-sources.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/performance.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/performance.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/prototype-pollution.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/prototype-pollution.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/test-profile.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/test-profile.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/is-direct-run.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/is-direct-run.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/utils.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/utils.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/cohesion.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/coupling.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/cycle.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/dead-code.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/import-style.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/index.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/security.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/security.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/semantic.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/shared.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/test-quality.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/test-quality.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cache.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cache.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/main.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/analysis.test.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/analysis.ts +0 -0
- /package/skills/{octocode-code-engineer → octocode-engineer}/vitest.config.ts +0 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: octocode-engineer
|
|
3
|
+
description: "Codebase-aware engineering: analysis, planning, implementation. For code understanding, bug fixes, refactors, audits, architecture/security/test-quality reviews. AST/graph/LSP scanning + AI validation. Use when checking code or architecture, understanding before/after any code change, validating bugs and flows, reviewing docs/plans/RFCs against code, or doing smart implementation with blast-radius awareness."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Octocode Code Engineer
|
|
7
|
+
|
|
8
|
+
Detectors produce hypotheses. AI validates, reasons, and prioritizes. Never present raw findings as facts. Always tell user what you found with evidence, ask before acting on M/L changes.
|
|
9
|
+
|
|
10
|
+
`<SKILL_DIR>` = directory containing this SKILL.md.
|
|
11
|
+
|
|
12
|
+
## Core Principle: Multi-Angle Investigation
|
|
13
|
+
|
|
14
|
+
Every question about code MUST be investigated from multiple angles. No single tool gives a complete answer. Cross-validate using **at least 2 tool families** before presenting findings.
|
|
15
|
+
|
|
16
|
+
```mermaid
|
|
17
|
+
flowchart TD
|
|
18
|
+
Q([User Question]) --> D[Discovery Layer]
|
|
19
|
+
|
|
20
|
+
D -->|"layout, files, search"| Local["Local Tools\n(search, structure, files)"]
|
|
21
|
+
D -->|"lineHint"| LSP["LSP\n(definition, refs, calls)"]
|
|
22
|
+
D -->|"presets, patterns"| AST["AST Scripts\n(structural proof)"]
|
|
23
|
+
D -->|"full scan"| Scanner["Scanner\n(94 detectors, 5 pillars)"]
|
|
24
|
+
|
|
25
|
+
Local -->|text patterns\nfile locations| V{AI Validation}
|
|
26
|
+
LSP -->|blast radius\ncall chains| V
|
|
27
|
+
AST -->|structural facts\npattern matches| V
|
|
28
|
+
Scanner -->|hypotheses\n94 categories| V
|
|
29
|
+
|
|
30
|
+
V -->|"2+ layers agree"| C([Confirmed Finding])
|
|
31
|
+
V -->|"1 layer only"| U([Uncertain — needs more evidence])
|
|
32
|
+
V -->|"code contradicts"| X([Dismissed])
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Tool Family | What it proves | Unique strength |
|
|
36
|
+
|-------------|---------------|-----------------|
|
|
37
|
+
| **Local tools** (search, structure, files, content) | Where things are, what the code says | Scope, layout, text patterns, `lineHint` for LSP |
|
|
38
|
+
| **LSP** (definition, references, call hierarchy) | Semantic relationships between symbols | Blast radius, call chains, dead code proof |
|
|
39
|
+
| **AST** (search.js, tree-search.js) | Structural code patterns | Empty catches, `any` types, nested ternaries — things regex can't prove |
|
|
40
|
+
| **Scanner** (run.js) | Cross-cutting analysis across 5 pillars | 94 finding categories, dependency graph, per-function metrics |
|
|
41
|
+
|
|
42
|
+
**Confidence levels:**
|
|
43
|
+
- `confirmed` — 2+ tool families agree
|
|
44
|
+
- `uncertain` — partial evidence from 1 family
|
|
45
|
+
- `dismissed` — code contradicts the finding
|
|
46
|
+
|
|
47
|
+
### Why Cross-Validated Investigation Matters
|
|
48
|
+
|
|
49
|
+
Most regressions come from hidden context: complex control flow, high fan-in, dependency cycles, duplicated logic, and weak test coverage. Multi-angle checks prevent local optimizations from causing system-level failures.
|
|
50
|
+
|
|
51
|
+
Use one source for each claim type: Local tools for scope/text evidence, LSP for semantic blast radius, AST for structural proof, and scanner findings for codebase-wide prioritization.
|
|
52
|
+
|
|
53
|
+
## Tools
|
|
54
|
+
|
|
55
|
+
### Local Tools (Octocode MCP)
|
|
56
|
+
|
|
57
|
+
MCP check: run `localSearchCode`. If unavailable → CLI-only mode (AST scripts only), reduce confidence on semantic claims.
|
|
58
|
+
|
|
59
|
+
**`localViewStructure`** — Maps codebase shape: directories, file counts, extensions, nesting. Tells you *where to look* — large folders, test gaps, naming patterns. Use `directoriesOnly=true` for layout, `filesOnly=true` + `extension` for source spread.
|
|
60
|
+
|
|
61
|
+
**`localFindFiles`** — Finds files by size, modification time, name pattern. Surfaces god files (`sortBy=size`), recent churn (`modifiedWithin=7d`), naming anomalies. Feeds candidate lists to every other tool.
|
|
62
|
+
|
|
63
|
+
**`localSearchCode`** — Text search across the codebase. Critical output: `lineHint` — the exact line number that **every LSP tool requires**. Without this, LSP tools cannot be called. Also reveals how symbols spread across files. Use `filesOnly=true` for fast file-level discovery first.
|
|
64
|
+
|
|
65
|
+
**`localGetFileContent`** — Reads actual source code. The final verification step: after other tools identify *where* and *what*, this lets AI *read and reason about* the real code. Use `matchString` to jump to the right section in large files.
|
|
66
|
+
|
|
67
|
+
### LSP Tools (Semantic Analysis)
|
|
68
|
+
|
|
69
|
+
All LSP tools REQUIRE `lineHint` from `localSearchCode`. Never guess it.
|
|
70
|
+
|
|
71
|
+
**`lspGotoDefinition(lineHint=N)`** — Jumps from usage to definition. Answers "what is this symbol actually?" Resolves ambiguity when search returns multiple candidates.
|
|
72
|
+
|
|
73
|
+
**`lspFindReferences(lineHint=N)`** — Counts all consumers of a symbol (types, vars, exports, functions). This is **blast radius** — the most important metric for risk. 0 refs = dead code. 50 refs = plan carefully. Use `includeDeclaration=false` for clean consumer counts.
|
|
74
|
+
|
|
75
|
+
**`lspCallHierarchy(lineHint=N, direction)`** — Traces function call chains. `incoming` = who calls this? `outgoing` = what does it call? **Functions only** — do NOT use on types/vars/constants.
|
|
76
|
+
|
|
77
|
+
| Symbol type | Use this | NOT this |
|
|
78
|
+
|-------------|----------|----------|
|
|
79
|
+
| Function/method | `lspCallHierarchy` | — |
|
|
80
|
+
| Type/interface/class | `lspFindReferences` | `lspCallHierarchy` (will fail) |
|
|
81
|
+
| Variable/constant/export | `lspFindReferences` | `lspCallHierarchy` (will fail) |
|
|
82
|
+
|
|
83
|
+
### AST Scripts (Structural Proof)
|
|
84
|
+
|
|
85
|
+
Text search finds strings. AST search proves **structure**. AST matches are facts.
|
|
86
|
+
|
|
87
|
+
**`ast/search.js`** — Parses live source files. Matches structural patterns that regex cannot reliably detect.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
node <SKILL_DIR>/scripts/ast/search.js --preset empty-catch --root <target> --json
|
|
91
|
+
node <SKILL_DIR>/scripts/ast/search.js -p 'console.$METHOD($$$ARGS)' --root <target> --json
|
|
92
|
+
node <SKILL_DIR>/scripts/ast/search.js --kind function_declaration --root <target> --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
22 presets: `empty-catch`, `console-log`, `console-any`, `debugger`, `todo-fixme`, `any-type`, `type-assertion`, `non-null-assertion`, `fat-arrow-body`, `nested-ternary`, `throw-string`, `switch-no-default`, `class-declaration`, `async-function`, `export-default`, `import-star`, `catch-rethrow` (catch blocks containing a throw — simplification candidates), `promise-all`, `boolean-param` (boolean type annotations in function signatures), `magic-number`, `deep-callback`, `unused-var`.
|
|
96
|
+
|
|
97
|
+
**TypeScript pattern best practices** — patterns must match the full AST structure including type annotations:
|
|
98
|
+
|
|
99
|
+
| Goal | Wrong (misses TS types) | Right |
|
|
100
|
+
|------|------------------------|-------|
|
|
101
|
+
| Find all functions | `-p 'function $NAME($$$P)'` | `-k function_declaration` or `--preset async-function` |
|
|
102
|
+
| Find specific calls | (works fine) | `-p 'JSON.parse($X)'` or `-p 'console.$M($$$A)'` |
|
|
103
|
+
| Match typed params | `-p 'function $N($P)'` | `-p 'function $N($P: string): string { $$$B }'` |
|
|
104
|
+
| Structural smells | (use presets) | `--preset empty-catch`, `--preset any-type`, etc. |
|
|
105
|
+
|
|
106
|
+
**Rule of thumb:** Use `--kind` or `--preset` for declarations (functions, classes, exports). Use `-p` pattern for call expressions and specific code shapes where types aren't involved.
|
|
107
|
+
|
|
108
|
+
See [AST reference](./references/ast-reference.md) for pattern wildcards (`$X`, `$$$X`), kind matching, and rule mode.
|
|
109
|
+
|
|
110
|
+
**`ast/tree-search.js`** — Queries cached `ast-trees.txt` from a prior scan. Fast triage to narrow targets before deeper investigation.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
node <SKILL_DIR>/scripts/ast/tree-search.js -i .octocode/scan -k function_declaration --limit 25
|
|
114
|
+
node <SKILL_DIR>/scripts/ast/tree-search.js -i .octocode/scan -p 'async' --json
|
|
115
|
+
node <SKILL_DIR>/scripts/ast/tree-search.js -i .octocode/scan -k arrow_function --file src/utils.ts --section functions
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Additional options: `-p <pattern>` (text pattern), `--json` (JSON output), `--file <path>` (filter by file), `--section <name>` (filter by tree section), `-C N` (context lines), `--ignore-case`.
|
|
119
|
+
|
|
120
|
+
**Triage** with `tree-search.js` (fast, cached). **Prove** with `search.js` (live source, authoritative).
|
|
121
|
+
|
|
122
|
+
### Scanner (`run.js`) — Full Deterministic Analysis
|
|
123
|
+
|
|
124
|
+
Heaviest tool. Runs TypeScript Compiler + tree-sitter across the codebase. Produces hypotheses across 5 analysis pillars with 94 finding categories.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
node <SKILL_DIR>/scripts/run.js [flags]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**5 pillars:**
|
|
131
|
+
- **Architecture** (28 categories): dependency cycles, coupling, god modules, SDP violations, chokepoints, critical paths, layer violations, barrel explosions
|
|
132
|
+
- **Code quality** (34 categories): complexity, duplicates, halstead effort, maintainability, unsafe `any`, empty catch, promise misuse, memory leaks, god functions, deep nesting, multiple returns, catch-rethrow, magic strings, boolean param clusters, unhandled promise combinators, export surface density, change risk
|
|
133
|
+
- **Dead code** (12 categories): dead exports/files, unused deps, barrel explosions, orphan implementations
|
|
134
|
+
- **Security** (12 categories): secrets, eval, injection, XSS, prototype pollution, path traversal, command injection
|
|
135
|
+
- **Test quality** (8 categories): assertion density, excessive mocking, cleanup, focused tests
|
|
136
|
+
|
|
137
|
+
**Additional capabilities:**
|
|
138
|
+
- `--semantic`: 12 of the 94 finding categories require this flag — TypeChecker-powered analysis (over-abstraction, shotgun surgery, unused params, circular types, and more)
|
|
139
|
+
- `--graph` / `--graph-advanced`: dependency graph with Mermaid, chokepoints, SCC clusters
|
|
140
|
+
- `--flow`: flow enrichment for richer evidence metadata
|
|
141
|
+
- `--scope=path` or `--scope=file:functionName`: focus on specific areas
|
|
142
|
+
- `--parser auto|typescript|tree-sitter`: engine selection (`auto` = TypeScript primary + tree-sitter for node-count metadata; `tree-sitter` = tree-sitter primary + TypeScript for dependencies)
|
|
143
|
+
- `--layer-order ui,service,repository`: automatic layer violation detection
|
|
144
|
+
- `--similarity-threshold 0.8`: near-clone / duplicate function detection
|
|
145
|
+
- `--features` / `--exclude`: select or skip pillars and individual categories (mutually exclusive)
|
|
146
|
+
- `--findings-limit N`: cap total findings; `--no-diversify` for pure severity ordering (default interleaves categories)
|
|
147
|
+
- `--all`: enable everything (`--include-tests --semantic`)
|
|
148
|
+
- Incremental caching (use `--no-cache` to force full re-scan, `--clear-cache` to wipe)
|
|
149
|
+
- `--affected [revision]`: scope to git-changed files + their transitive dependents (default: HEAD)
|
|
150
|
+
- `--save-baseline` / `--ignore-known [file]`: progressive adoption — save current findings, suppress known ones
|
|
151
|
+
- `--reporter default|compact|github-actions`: CI-friendly output (one-line or `::warning`/`::error` annotations)
|
|
152
|
+
- `--focus <module>` + `--focus-depth N`: graph neighborhood exploration (show module + N hops)
|
|
153
|
+
- `--collapse N`: fold graph nodes to folder depth for high-level architecture view
|
|
154
|
+
- `--at-least N`: fail if gate score below threshold (CI quality gate; uses count-based `100/(1+(findings/files)/10)`, distinct from severity-weighted feature scores in `summary.md`)
|
|
155
|
+
- `--config <file>`: explicit config; auto-discovers `.octocode-scan.json`, `.octocode-scan.jsonc`, or `package.json#octocode`
|
|
156
|
+
- Additional flags (`--root`, `--out`, `--json`, `--emit-tree`/`--no-tree`, `--deep-link-topn`, `--tree-depth`): see `node <SKILL_DIR>/scripts/run.js --help`
|
|
157
|
+
|
|
158
|
+
**Key thresholds** (tune for stricter or looser analysis):
|
|
159
|
+
|
|
160
|
+
| Area | Flag | Default | What it controls |
|
|
161
|
+
|------|------|---------|-----------------|
|
|
162
|
+
| Complexity | `--critical-complexity-threshold` | 30 | Cyclomatic complexity for HIGH findings |
|
|
163
|
+
| Complexity | `--cognitive-complexity-threshold` | 15 | Cognitive complexity threshold |
|
|
164
|
+
| Coupling | `--coupling-threshold` | 15 | Ca+Ce for high-coupling |
|
|
165
|
+
| Coupling | `--fan-in-threshold` / `--fan-out-threshold` | 20/15 | God-module coupling |
|
|
166
|
+
| Type safety | `--any-threshold` | 5 | Max `any` usages per file |
|
|
167
|
+
| Maintainability | `--maintainability-index-threshold` | 20 | MI below this = high-risk |
|
|
168
|
+
| God module | `--god-module-statements` / `--god-module-exports` | 500/20 | Size thresholds |
|
|
169
|
+
| God function | `--god-function-statements` | 100 | Statement count threshold |
|
|
170
|
+
| God function | `--god-function-mi-threshold` | 10 | MI threshold (fires when MI < N and LOC > 30) |
|
|
171
|
+
| Parameters | `--parameter-threshold` | 5 | Max function parameters before flagging |
|
|
172
|
+
| Halstead | `--halstead-effort-threshold` | 500000 | Halstead effort threshold |
|
|
173
|
+
| Duplicates | `--similarity-threshold` | 0.85 | Jaccard similarity for near-clones |
|
|
174
|
+
| Duplicates | `--min-function-statements` | 6 | Min function body statements for duplicate matching |
|
|
175
|
+
| Duplicates | `--min-flow-statements` | 6 | Min control-flow statements for duplicate matching |
|
|
176
|
+
| Duplicates | `--flow-dup-threshold` | 3 | Min occurrences for a repeated flow to become a finding |
|
|
177
|
+
| Nesting | `--deep-nesting-threshold` | 5 | Max branch/loop nesting depth |
|
|
178
|
+
| Returns | `--multiple-return-threshold` | 6 | Max return/throw paths per function |
|
|
179
|
+
| Magic strings | `--magic-string-min-occurrences` | 3 | Min repetitions to flag a string literal |
|
|
180
|
+
| Boolean params | `--boolean-param-threshold` | 3 | Min boolean params to flag a function |
|
|
181
|
+
| Architecture | `--barrel-symbol-threshold` | 30 | Re-export count for barrel-explosion |
|
|
182
|
+
| Architecture | `--sdp-min-delta` | 0.15 | Min instability delta for SDP violations |
|
|
183
|
+
| Architecture | `--sdp-max-source-instability` | 0.6 | Max source instability to report SDP |
|
|
184
|
+
| Semantic | `--override-chain-threshold` | 3 | Max method override depth (requires `--semantic`) |
|
|
185
|
+
| Semantic | `--shotgun-threshold` | 8 | Unique-file threshold for shotgun-surgery (requires `--semantic`) |
|
|
186
|
+
| Security | `--secret-entropy-threshold` | 4.5 | Shannon entropy for secret detection |
|
|
187
|
+
| Security | `--secret-min-length` | 20 | Min string length for entropy-based secret detection |
|
|
188
|
+
| Tests | `--mock-threshold` | 10 | Max mock/spy calls per test file |
|
|
189
|
+
|
|
190
|
+
**Common profiles:**
|
|
191
|
+
|
|
192
|
+
| Goal | Flags |
|
|
193
|
+
|------|-------|
|
|
194
|
+
| General audit | `--graph --flow` |
|
|
195
|
+
| Architecture deep-dive | `--features=architecture --graph --graph-advanced` |
|
|
196
|
+
| Code quality | `--features=code-quality --flow` |
|
|
197
|
+
| Dead code cleanup | `--features=dead-code` |
|
|
198
|
+
| Security audit | `--features=security --flow` |
|
|
199
|
+
| Test quality | `--features=test-quality --include-tests` |
|
|
200
|
+
| Focused deep-dive | `--scope=<path> --graph --flow --semantic` |
|
|
201
|
+
| Full everything | `--all --graph --graph-advanced --flow` |
|
|
202
|
+
| Post-change verify | `--scope=<changed-paths> --no-cache` |
|
|
203
|
+
| Strict type safety | `--any-threshold 0` |
|
|
204
|
+
| Layer enforcement | `--layer-order ui,service,repository --features=architecture` |
|
|
205
|
+
| Detect near-clones | `--similarity-threshold 0.8 --features=code-quality` |
|
|
206
|
+
| CI gate | `--reporter github-actions --at-least 60` |
|
|
207
|
+
| PR diff check | `--affected HEAD~1 --reporter compact` |
|
|
208
|
+
| Progressive adoption | `--save-baseline` then `--ignore-known --at-least 60` |
|
|
209
|
+
| Module zoom | `--graph --focus=src/session.ts --focus-depth 2` |
|
|
210
|
+
| High-level arch | `--graph --collapse 2` |
|
|
211
|
+
|
|
212
|
+
**Drill-down workflow** — progressive narrowing from broad to surgical:
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
1. Full scan → identify hotspots from summary.md
|
|
216
|
+
2. --scope=critical/area → deep-dive into the worst package/directory
|
|
217
|
+
3. --scope=file.ts → investigate a single file's findings
|
|
218
|
+
4. --scope=file.ts:functionName → drill into a specific function
|
|
219
|
+
5. Fix → re-scan with scope → verify finding count drops
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Scope sanity checks** — low/zero findings may mean clean code OR a bad scope:
|
|
223
|
+
- Confirm the scope has `.ts`/`.js` files — `--scope=docs/` yields 0 findings
|
|
224
|
+
- `--features=test-quality` without `--include-tests` yields 0 findings — test files are excluded by default
|
|
225
|
+
- Scoped scans affect `ast-trees.txt` — `tree-search.js` picks the latest scan, which may be the narrow one. Point to a full-scan timestamp explicitly if needed.
|
|
226
|
+
- When in doubt, compare against a broad baseline: `run.js --graph --flow` with no scope
|
|
227
|
+
|
|
228
|
+
Output: `.octocode/scan/<timestamp>/` — `summary.json`, `summary.md`, `findings.json`, `architecture.json`, `code-quality.json`, `dead-code.json`, `file-inventory.json`. Conditional: `security.json` and `test-quality.json` (only when findings exist), `ast-trees.txt` (unless `--no-tree`), `graph.md` (requires `--graph`).
|
|
229
|
+
|
|
230
|
+
See [CLI reference](./references/cli-reference.md) for all flags and thresholds. See [output files](./references/output-files.md) for JSON schemas and read order.
|
|
231
|
+
|
|
232
|
+
## How to Investigate
|
|
233
|
+
|
|
234
|
+
For any user request, reason beyond the literal question and check adjacent risk areas.
|
|
235
|
+
|
|
236
|
+
### 21 Investigation Workflows
|
|
237
|
+
|
|
238
|
+
The skill includes ready-made workflows for every common scenario. Pick the right one based on the task:
|
|
239
|
+
|
|
240
|
+
| # | Workflow | When to use |
|
|
241
|
+
|---|---------|-------------|
|
|
242
|
+
| 1 | **Full Scan → Triage → Validate** | New codebase or broad audit |
|
|
243
|
+
| 2 | **Symbol Deep Dive** | Trace a function: definition → callers → callees |
|
|
244
|
+
| 3 | **Impact Analysis (Pre-Refactor)** | Assess blast radius before changing a symbol |
|
|
245
|
+
| 4 | **Dead Export Validation** | Confirm/dismiss dead code findings |
|
|
246
|
+
| 5 | **Code Smell Sweep** | Batch AST preset checks for structural smells |
|
|
247
|
+
| 6 | **Dependency Cycle Tracing** | Validate and trace cycles from architecture.json |
|
|
248
|
+
| 7 | **Security Sink Validation** | Taint-trace data flow from source to sink |
|
|
249
|
+
| 8 | **Scoped Deep-Dive** | Drill into a specific flagged file or function |
|
|
250
|
+
| 9 | **Coupling Hotspot Analysis** | Quantify coupling for architecture findings |
|
|
251
|
+
| 10 | **Fix Verification Loop** | Confirm fixes reduced finding count after every batch |
|
|
252
|
+
| 11 | **Pre-Implementation Check** | Where should new code live? Avoid hotspots |
|
|
253
|
+
| 12 | **Refactoring Plan** | Multi-file refactor with full blast radius awareness |
|
|
254
|
+
| 13 | **Codebase Exploration** | New repo orientation — layout, scale, conventions |
|
|
255
|
+
| 14 | **Test Strategy Analysis** | Map test coverage gaps and test quality issues |
|
|
256
|
+
| 15 | **Code Review Support** | Assess architectural impact of changed files |
|
|
257
|
+
| 16 | **Code Quality Review** | Focused quality review of a module or file |
|
|
258
|
+
| 17 | **Full Architecture Analysis** | Complete architecture health assessment |
|
|
259
|
+
| 18 | **Smart Coding** | Impact-aware before/during/after code changes |
|
|
260
|
+
| 19 | **CLI Change Safety** | Safe changes to commands, flags, output, exit behavior |
|
|
261
|
+
| 20 | **API Contract Safety** | Safe changes to endpoints, schemas, DTOs, responses |
|
|
262
|
+
| 21 | **Docs & Rollout Sync** | Post-change docs, migration notes, rollback plan |
|
|
263
|
+
|
|
264
|
+
Full step-by-step details: [tool workflows](./references/tool-workflows.md).
|
|
265
|
+
|
|
266
|
+
### Smart Coding Workflow (Before / During / After)
|
|
267
|
+
|
|
268
|
+
The most important workflow for any code change. Ensures blast-radius awareness and post-change verification.
|
|
269
|
+
|
|
270
|
+
**BEFORE coding:**
|
|
271
|
+
1. Define behavior contract — current behavior, desired behavior, invariants, non-goals
|
|
272
|
+
2. Understand the target area — explore module layout, read current code, jump to definitions
|
|
273
|
+
3. Check blast radius — `localSearchCode` → `lspFindReferences` (total, production-only, test-only) → `lspCallHierarchy(incoming)`
|
|
274
|
+
4. Check architecture safety — scoped scan with architecture + graph → check if change creates new cycles
|
|
275
|
+
5. Follow existing patterns — AST search for similar patterns nearby, text search for analogous implementations
|
|
276
|
+
|
|
277
|
+
**MAKE the change:**
|
|
278
|
+
6. Implement edits
|
|
279
|
+
|
|
280
|
+
**AFTER coding:**
|
|
281
|
+
7. Run project tests
|
|
282
|
+
8. Verify no new issues — scoped scan of changed files + AST preset sweep (`any-type`, `empty-catch`)
|
|
283
|
+
9. Verify references intact — `lspFindReferences` for moved/renamed symbols, `lspCallHierarchy(incoming)` for callers
|
|
284
|
+
10. Run project toolchain — lint (with auto-fix), build
|
|
285
|
+
|
|
286
|
+
**Decision gates:**
|
|
287
|
+
- Step 3: >20 production consumers = high-risk → consider feature flag or incremental migration
|
|
288
|
+
- Step 4: change touches cycle member or hotfile = extra caution → re-scan after
|
|
289
|
+
- Step 8: new findings = fix before committing
|
|
290
|
+
- Step 10: any failure = investigate before proceeding
|
|
291
|
+
|
|
292
|
+
### Decision: What tool(s) to reach for?
|
|
293
|
+
|
|
294
|
+
| I need to know... | Use these (parallel when possible) |
|
|
295
|
+
|-------------------|------------------------------------|
|
|
296
|
+
| Codebase layout / where to look | `localViewStructure` + `localFindFiles` |
|
|
297
|
+
| Where a symbol lives | `localSearchCode` → `lspGotoDefinition(lineHint)` |
|
|
298
|
+
| Who uses a symbol | `localSearchCode` → `lspFindReferences(lineHint)` |
|
|
299
|
+
| Who calls a function | `localSearchCode` → `lspCallHierarchy(incoming, lineHint)` |
|
|
300
|
+
| What a function calls | `localSearchCode` → `lspCallHierarchy(outgoing, lineHint)` |
|
|
301
|
+
| If a structural pattern exists | `ast/search.js --preset` or `-p` pattern |
|
|
302
|
+
| If an export is dead | `lspFindReferences` (0 refs?) + `ast/search.js` (import check) + `localSearchCode` (dynamic refs?) |
|
|
303
|
+
| Module/file health | `run.js --scope=<path>` + `ast/search.js` presets + `lspFindReferences` per export |
|
|
304
|
+
| Full codebase health | `run.js --graph --flow` → validate top findings with LSP + AST |
|
|
305
|
+
| If a fix worked | `run.js --scope=<changed> --no-cache` + `ast/search.js` on changed dirs + lint/test/build |
|
|
306
|
+
|
|
307
|
+
### Think broader than the question
|
|
308
|
+
|
|
309
|
+
| User asks about... | Also investigate... |
|
|
310
|
+
|--------------------|---------------------|
|
|
311
|
+
| A function | Callers, tests, sibling functions, error handling |
|
|
312
|
+
| A module | Dependency cycles, consumers, barrel re-exports, test coverage |
|
|
313
|
+
| Security | Input sources, data flows, output sinks, guard functions |
|
|
314
|
+
| Tests | Untested production code, mock quality, assertion density |
|
|
315
|
+
| A bug fix | Blast radius, related callers, regression risk |
|
|
316
|
+
| A refactor | Fan-in, cycles, test coverage of affected symbols |
|
|
317
|
+
| Architecture | Hotspots, coupling, critical paths, layer violations |
|
|
318
|
+
|
|
319
|
+
### Cross-validate findings
|
|
320
|
+
|
|
321
|
+
Every finding should be checked from multiple angles:
|
|
322
|
+
|
|
323
|
+
**"Is this catch block a problem?"**
|
|
324
|
+
1. `ast/search.js --preset empty-catch` → proves the catch IS empty (structural fact)
|
|
325
|
+
2. `localSearchCode` for the function → get `lineHint`
|
|
326
|
+
3. `lspFindReferences(lineHint)` → 15 callers (high blast radius)
|
|
327
|
+
4. `localGetFileContent` → read the actual code, understand context
|
|
328
|
+
5. AI: "confirmed — silent error swallowing in high-traffic function"
|
|
329
|
+
|
|
330
|
+
**"Is this export dead?"**
|
|
331
|
+
1. `localSearchCode` for the export → get `lineHint` + see file spread
|
|
332
|
+
2. `lspFindReferences(lineHint, includeDeclaration=false)` → 0 refs
|
|
333
|
+
3. `ast/search.js -p 'import { exportName }'` → 0 structural imports
|
|
334
|
+
4. AI: "confirmed dead — zero consumers across semantic + structural checks"
|
|
335
|
+
|
|
336
|
+
**"Is this function too complex?"**
|
|
337
|
+
1. `run.js --scope=file:functionName` → complexity metrics
|
|
338
|
+
2. `ast/tree-search.js` → function span and nesting depth
|
|
339
|
+
3. `lspCallHierarchy(outgoing)` → how many things it orchestrates
|
|
340
|
+
4. `lspCallHierarchy(incoming)` → how many callers depend on it
|
|
341
|
+
5. `localGetFileContent` → read the body, count concerns
|
|
342
|
+
6. AI: "uncertain — high complexity but may be intentional orchestration. Flag for review."
|
|
343
|
+
|
|
344
|
+
**Per-category validation quick-reference:**
|
|
345
|
+
|
|
346
|
+
| Category | How to validate | Typical fix |
|
|
347
|
+
|----------|----------------|-------------|
|
|
348
|
+
| Dead export | `lspFindReferences(includeDeclaration=false)` → 0 refs = dead | Remove export or wire real usage |
|
|
349
|
+
| Coupling hotspot | Fan-in (`lspFindReferences`) + fan-out (`lspCallHierarchy(outgoing)`) | Split module by responsibility/consumer group |
|
|
350
|
+
| Dependency cycle | Trace imports through cycle path from `architecture.json` | Break edge via shared contract/inversion |
|
|
351
|
+
| Security sink | Trace data sources via `lspCallHierarchy(incoming)` → check for guards | Add/centralize validation before sink |
|
|
352
|
+
| God function | Read body + map outgoing calls → count concerns and side effects | Extract focused helpers, keep orchestration thin |
|
|
353
|
+
| Performance (await-in-loop) | Check if iterations are independent (no data dependency between N and N-1) | Collect with `Promise.all()`; keep sequential only when dependent |
|
|
354
|
+
| Test gap | `lspFindReferences` filtered to test dirs → 0 test refs = gap | Add tests around public contract and edge paths |
|
|
355
|
+
|
|
356
|
+
Use TDD for behavioral fixes when practical: failing test → fix → pass → full suite.
|
|
357
|
+
|
|
358
|
+
More cross-validation patterns: [validation playbooks](./references/validation-playbooks.md).
|
|
359
|
+
|
|
360
|
+
### External tools — ask user before running
|
|
361
|
+
|
|
362
|
+
`npx` only. Scanner already covers duplicates, unused deps, dead exports — no external tool needed for those.
|
|
363
|
+
|
|
364
|
+
| Tool | When | Command |
|
|
365
|
+
|------|------|---------|
|
|
366
|
+
| eslint | Lint & auto-fix | `npx eslint --fix <path>` |
|
|
367
|
+
| tsc | Type check | `npx tsc --noEmit` |
|
|
368
|
+
| stylelint | CSS/SCSS | `npx stylelint "**/*.css"` |
|
|
369
|
+
| knip | Framework-aware dead code | `npx knip --exports` |
|
|
370
|
+
| type-coverage | Type safety % | `npx type-coverage --strict --detail` |
|
|
371
|
+
| dep-cruiser | Custom arch rules | `npx depcruise --no-config -T err <path>` |
|
|
372
|
+
|
|
373
|
+
Details: [external tools](./references/externals.md).
|
|
374
|
+
|
|
375
|
+
### Architecture interpretation signals
|
|
376
|
+
|
|
377
|
+
When raw architecture findings are noisy, use these structural signals to prioritize:
|
|
378
|
+
|
|
379
|
+
| Signal | What it means | Action |
|
|
380
|
+
|--------|--------------|--------|
|
|
381
|
+
| **SCC cluster** | Overlapping dependency cycles forming a strongly connected component | Treat entire cluster as one refactor unit — breaking one edge may not help |
|
|
382
|
+
| **Broker/chokepoint** | High fan-in + high fan-out — dependency pressure node | Decompose by splitting read vs write consumers, or extract interface |
|
|
383
|
+
| **Bridge module** | Articulation-style file connecting two subsystems | Fragile — breaking it disconnects the graph. Stabilize or duplicate at boundary |
|
|
384
|
+
| **Package chatter** | Excessive cross-package imports | Boundary erosion — consolidate shared types or redraw package lines |
|
|
385
|
+
|
|
386
|
+
Prioritize fixes where **hotspots and critical paths overlap** — those are the highest-leverage changes.
|
|
387
|
+
|
|
388
|
+
### Metrics reference
|
|
389
|
+
|
|
390
|
+
| Metric | Formula / Scale | What it means | Threshold signal |
|
|
391
|
+
|--------|----------------|---------------|------------------|
|
|
392
|
+
| Instability | `I = Ce / (Ca + Ce)` | How change-prone vs depended-on (0 = stable, 1 = unstable) | Stable module depending on unstable one = SDP violation |
|
|
393
|
+
| Cognitive complexity | Incremental per branch/nesting | Mental load to understand a function | >15 = decomposition candidate |
|
|
394
|
+
| Maintainability index | 0-100 composite (volume, complexity, LOC) | Overall maintainability score | <20 = high-risk |
|
|
395
|
+
| Halstead effort | Operators × operands formula | Estimated comprehension effort | Very high = split or refactor |
|
|
396
|
+
| Fan-in | Count of incoming dependencies | How many modules depend on this | >20 = god module risk |
|
|
397
|
+
| Fan-out | Count of outgoing dependencies | How many modules this depends on | >15 = coupling risk |
|
|
398
|
+
|
|
399
|
+
Use thresholds as heuristics, not absolute truth. Context matters — a config module with fan-in=45 may be fine if it's read-only.
|
|
400
|
+
|
|
401
|
+
### Working with scanner output
|
|
402
|
+
|
|
403
|
+
Read scan results in this order:
|
|
404
|
+
1. `summary.md` → health scores, severity breakdown, top recommendations
|
|
405
|
+
2. `summary.json` → `featureScores[]`, `investigationPrompts[]`, `recommendedValidation`
|
|
406
|
+
3. `findings.json` → per-finding detail with `evidence.location`, `correlatedSignals[]`, `lspHints[]`
|
|
407
|
+
4. Pillar files as needed
|
|
408
|
+
|
|
409
|
+
Per finding, use:
|
|
410
|
+
- `recommendedValidation.tools[]` → which tools to run for confirmation
|
|
411
|
+
- `evidence.location` → exact `file:line` to inspect
|
|
412
|
+
- `correlatedSignals[]` → related findings to check together
|
|
413
|
+
- `suggestedFix.strategy` + `suggestedFix.steps` → actionable fix path
|
|
414
|
+
|
|
415
|
+
Follow `investigationPrompts[]` from `summary.json` — ready-made next steps.
|
|
416
|
+
|
|
417
|
+
**Scoring model** — the scanner produces two complementary scores:
|
|
418
|
+
|
|
419
|
+
*Feature scores* (`featureScores[]`): per-category scores using severity weights (`critical=25, high=10, medium=3, low=1`). Formula: `100 / (1 + (weightedFindingsPerFile / 10))`. Guardrails: critical findings cap at 95, high at 98. Hotspot overlap applies context penalties.
|
|
420
|
+
|
|
421
|
+
*Quality rating* (`qualityRating`): hybrid AI + structural rating across 6 weighted aspects:
|
|
422
|
+
- Architecture & Structure (30%) — dependency health, modularity, coupling
|
|
423
|
+
- Folder Topology (15%) — directory depth, naming coherence, layout clarity
|
|
424
|
+
- Naming Quality (15%) — consistent conventions, descriptive identifiers
|
|
425
|
+
- Common/Shared Layer Health (15%) — utility modules, shared abstractions
|
|
426
|
+
- Maintainability & Evolvability (15%) — change readiness, encapsulation
|
|
427
|
+
- Codebase Consistency (10%) — uniform patterns across modules
|
|
428
|
+
|
|
429
|
+
Use `featureScores[]` to rank worst categories. Use `qualityRating.aspects[]` for soft-signal scoring.
|
|
430
|
+
|
|
431
|
+
**Finding correlation patterns** — findings that appear together often signal deeper issues:
|
|
432
|
+
|
|
433
|
+
| Combination | Likely root cause |
|
|
434
|
+
|-------------|-------------------|
|
|
435
|
+
| `feature-envy` + `low-cohesion` | Boundary error — logic in the wrong module |
|
|
436
|
+
| `layer-violation` + `feature-envy` | Dependency leak across architecture layers |
|
|
437
|
+
| `import-side-effect-risk` + hotspot tags | Startup risk — initialization on import |
|
|
438
|
+
| `dependency-critical-path` + complexity tags | Change chokepoint — high-risk modification path |
|
|
439
|
+
|
|
440
|
+
**File inventory deep fields** (`file-inventory.json`) — per-file AST lens for targeted investigation:
|
|
441
|
+
- `functions[]` — shape, complexity, span per function
|
|
442
|
+
- `flows[]` — repeated control-flow structures
|
|
443
|
+
- `dependencyProfile` — exports, imports, re-exports, internal/external deps
|
|
444
|
+
- `topLevelEffects[]` — hidden initialization / import-time side effects
|
|
445
|
+
- `effectProfile` — summarized import-time risk
|
|
446
|
+
- `symbolUsageSummary` — compact import/export shape for boundary follow-up
|
|
447
|
+
- `boundaryRoleHints[]` — lightweight role inference (entrypoint, utility, config, etc.)
|
|
448
|
+
- `cfgFlags` — flow clues for validation, cleanup, exit behavior, async boundaries (with `--flow`)
|
|
449
|
+
|
|
450
|
+
If `architecture.json` names a hotspot, use `file-inventory.json` to explain *why* it's structurally hard to change.
|
|
451
|
+
|
|
452
|
+
## Task Sizing & Planning
|
|
453
|
+
|
|
454
|
+
| Size | Scope | Approach |
|
|
455
|
+
|------|-------|----------|
|
|
456
|
+
| S | Single-file, low-risk | Investigate → implement → verify (lint + tests) |
|
|
457
|
+
| M | Multi-file with consumers | Multi-angle investigation → present plan → implement → verify (lint + tests + build) |
|
|
458
|
+
| L | Cross-cutting / architectural | Full investigation → present improvement plan → implement → verify (lint + tests + build + re-scan) |
|
|
459
|
+
|
|
460
|
+
Upgrade to L if: fan-in >20, cycle/hotspot involvement, or unclear contract risk.
|
|
461
|
+
|
|
462
|
+
**M/L improvement plan** — per item:
|
|
463
|
+
- **Target**: file:symbol
|
|
464
|
+
- **Issue**: what's wrong + evidence (tool + file:line)
|
|
465
|
+
- **Impact**: consumer count, severity
|
|
466
|
+
- **Fix**: strategy + steps
|
|
467
|
+
- **Test**: what to add/update
|
|
468
|
+
- **Risk**: low/medium/high + mitigation
|
|
469
|
+
- **Order**: dependency-aware (foundations first)
|
|
470
|
+
|
|
471
|
+
Present plan to user. Ask before proceeding.
|
|
472
|
+
|
|
473
|
+
## Hard Rules
|
|
474
|
+
|
|
475
|
+
- Never present unvalidated findings as facts
|
|
476
|
+
- Never guess `lineHint` — always get it from `localSearchCode`
|
|
477
|
+
- Never use `lspCallHierarchy` on non-function symbols
|
|
478
|
+
- Never skip blast-radius checks on shared symbols (M/L)
|
|
479
|
+
- Never implement M/L changes without presenting plan to user first
|
|
480
|
+
- Always cross-validate with 2+ tool families before confirming a finding
|
|
481
|
+
|
|
482
|
+
## Error Recovery
|
|
483
|
+
|
|
484
|
+
| Problem | Recovery |
|
|
485
|
+
|---------|----------|
|
|
486
|
+
| 0 findings from scan | Relax scope/features; check `parseErrors` in `summary.json`; verify scope has `.ts`/`.js` files |
|
|
487
|
+
| LSP unavailable | CLI-only mode (AST scripts); reduce confidence claims |
|
|
488
|
+
| AST no matches | Widen `--root`/pattern or switch kind/preset |
|
|
489
|
+
| Scan vs LSP mismatch | Report both; treat as uncertain |
|
|
490
|
+
| Huge findings count | Triage via `featureScores[]` grades first, filter by severity |
|
|
491
|
+
|
|
492
|
+
## References
|
|
493
|
+
- [Tool workflows](./references/tool-workflows.md) — 21 scenario-specific workflows
|
|
494
|
+
- [CLI reference](./references/cli-reference.md) — all flags, thresholds, scope details
|
|
495
|
+
- [Output files](./references/output-files.md) — JSON schemas, read order, key reference
|
|
496
|
+
- [AST reference](./references/ast-reference.md) — presets, patterns, tree-search
|
|
497
|
+
- [Validation playbooks](./references/validation-playbooks.md) — per-category validation with worked examples
|
|
498
|
+
- [External Tools](./references/externals.md) — `npx` cross-validation: eslint, tsc, stylelint, knip, type-coverage, dep-cruiser
|
|
499
|
+
- [Quality Indicators](./references/quality-indicators.md) — complete catalog of 34 code quality detectors, 22 AST presets, metrics, algorithms, thresholds
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
import { rm } from 'fs/promises';
|
|
3
|
+
|
|
4
|
+
await rm('scripts', { recursive: true, force: true });
|
|
5
|
+
|
|
6
|
+
const sharedOptions = {
|
|
7
|
+
bundle: true,
|
|
8
|
+
splitting: false,
|
|
9
|
+
platform: 'node',
|
|
10
|
+
target: 'node18',
|
|
11
|
+
format: 'esm',
|
|
12
|
+
outdir: 'scripts',
|
|
13
|
+
minify: true,
|
|
14
|
+
treeShaking: true,
|
|
15
|
+
packages: 'external',
|
|
16
|
+
logLevel: 'info',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
await esbuild.build({
|
|
20
|
+
...sharedOptions,
|
|
21
|
+
entryPoints: {
|
|
22
|
+
run: 'src/run.ts',
|
|
23
|
+
index: 'src/index.ts',
|
|
24
|
+
'ast/search': 'src/ast/search.ts',
|
|
25
|
+
'ast/tree-search': 'src/ast/tree-search.ts',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log('✓ esbuild complete');
|
|
@@ -25,18 +25,8 @@ export default tseslint.config(
|
|
|
25
25
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
26
26
|
'import/first': 'error',
|
|
27
27
|
'import/newline-after-import': 'error',
|
|
28
|
-
'import/order':
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'type'],
|
|
32
|
-
'newlines-between': 'always',
|
|
33
|
-
alphabetize: {
|
|
34
|
-
order: 'asc',
|
|
35
|
-
caseInsensitive: true,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
|
28
|
+
'import/order': 'off',
|
|
29
|
+
'sort-imports': 'off',
|
|
40
30
|
'@typescript-eslint/no-use-before-define': [
|
|
41
31
|
'error',
|
|
42
32
|
{
|
|
@@ -49,6 +39,6 @@ export default tseslint.config(
|
|
|
49
39
|
},
|
|
50
40
|
},
|
|
51
41
|
{
|
|
52
|
-
ignores: ['dist/**', 'node_modules/**', 'scripts/**'],
|
|
42
|
+
ignores: ['dist/**', 'node_modules/**', 'scripts/**', '*.mjs'],
|
|
53
43
|
}
|
|
54
44
|
);
|
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "octocode-
|
|
2
|
+
"name": "@octocode/engineer-skill",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "AST-based code quality analysis with duplicate detection, complexity metrics, and dependency graph intelligence",
|
|
7
|
-
"author": "Guy Bary <bgauryy@octocodeai.com>",
|
|
8
|
-
"homepage": "https://octocode.ai",
|
|
9
|
-
"repository": "bgauryy/octocode-mcp.git",
|
|
10
|
-
"license": "MIT",
|
|
4
|
+
"description": "AST-based code quality analysis with duplicate detection, complexity metrics, and dependency graph intelligence. TypeScript in src/ compiles to scripts/ (yarn build or npm run build).",
|
|
11
5
|
"keywords": [
|
|
12
6
|
"agent-skill",
|
|
13
7
|
"ast-analysis",
|
|
14
8
|
"code-quality",
|
|
15
|
-
"tree-sitter",
|
|
16
9
|
"dependency-graph",
|
|
17
|
-
"octocode"
|
|
10
|
+
"octocode",
|
|
11
|
+
"tree-sitter"
|
|
18
12
|
],
|
|
13
|
+
"author": "Guy Bary <bgauryy@octocodeai.com>",
|
|
14
|
+
"homepage": "https://octocode.ai",
|
|
15
|
+
"repository": "bgauryy/octocode-mcp.git",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"type": "module",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
19
21
|
"scripts": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"analyze": "node scripts/run.js",
|
|
23
|
+
"analyze:full": "node scripts/run.js --include-tests --findings-limit 500 --deep-link-topn 30 --out .octocode/scan/scan.json",
|
|
24
|
+
"analyze:graph": "node scripts/run.js --graph --out .octocode/scan/scan.json",
|
|
25
|
+
"analyze:json": "node scripts/run.js --json --out .octocode/scan/scan.json",
|
|
26
|
+
"build": "node build.mjs",
|
|
27
|
+
"build:watch": "tsc -p tsconfig.json --watch",
|
|
24
28
|
"lint": "eslint src",
|
|
25
29
|
"lint:fix": "eslint src --fix",
|
|
26
|
-
"
|
|
27
|
-
"analyze:json": "node scripts/index.js --json --out .octocode/scan/scan.json",
|
|
28
|
-
"analyze:full": "node scripts/index.js --include-tests --findings-limit 500 --deep-link-topn 30 --out .octocode/scan/scan.json",
|
|
29
|
-
"analyze:graph": "node scripts/index.js --graph --out .octocode/scan/scan.json",
|
|
30
|
+
"prepare": "npm run build",
|
|
30
31
|
"search": "node scripts/ast/search.js",
|
|
31
32
|
"search:json": "node scripts/ast/search.js --json",
|
|
32
33
|
"search:presets": "node scripts/ast/search.js --list-presets",
|
|
33
34
|
"search:trees": "node scripts/ast/tree-search.js",
|
|
34
|
-
"search:trees:json": "node scripts/ast/tree-search.js --json"
|
|
35
|
+
"search:trees:json": "node scripts/ast/tree-search.js --json",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest"
|
|
35
38
|
},
|
|
36
39
|
"dependencies": {
|
|
37
40
|
"@ast-grep/napi": "^0.42.0",
|
|
38
41
|
"tree-sitter": "^0.25.0",
|
|
39
|
-
"tree-sitter-typescript": "^0.23.2"
|
|
40
|
-
"typescript": "^5.9.3"
|
|
42
|
+
"tree-sitter-typescript": "^0.23.2"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
45
|
"@eslint/js": "^9.27.0",
|
|
44
|
-
"@types/node": "^
|
|
46
|
+
"@types/node": "^22.15.29",
|
|
47
|
+
"esbuild": "^0.27.2",
|
|
45
48
|
"eslint": "^9.27.0",
|
|
46
49
|
"eslint-plugin-import": "^2.32.0",
|
|
47
|
-
"
|
|
48
|
-
"typescript-eslint": "^8.
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"typescript-eslint": "^8.52.0",
|
|
49
52
|
"vitest": "^4.1.0"
|
|
50
53
|
},
|
|
51
|
-
"
|
|
52
|
-
"node": ">=18.0.0"
|
|
53
|
-
}
|
|
54
|
+
"private": true
|
|
54
55
|
}
|