octocode-cli 1.2.6 → 1.2.8
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/LICENSE +21 -63
- package/README.md +85 -142
- package/out/octocode-cli.js +7063 -6934
- package/package.json +8 -6
- package/skills/README.md +97 -120
- package/skills/octocode-code-engineer/.claude/settings.local.json +18 -0
- package/skills/octocode-code-engineer/.octocode/rfc/RFC-code-engineer-weakness-fixes.md +255 -0
- package/skills/octocode-code-engineer/.plan/VALIDATED_PLAN.md +223 -0
- package/skills/octocode-code-engineer/README.md +178 -0
- package/skills/octocode-code-engineer/SKILL.md +418 -0
- package/skills/octocode-code-engineer/coverage/architecture.ts.html +7828 -0
- package/skills/octocode-code-engineer/coverage/ast-helpers.ts.html +211 -0
- package/skills/octocode-code-engineer/coverage/ast-search.ts.html +1795 -0
- package/skills/octocode-code-engineer/coverage/base.css +224 -0
- package/skills/octocode-code-engineer/coverage/block-navigation.js +87 -0
- package/skills/octocode-code-engineer/coverage/cache.ts.html +376 -0
- package/skills/octocode-code-engineer/coverage/cli.ts.html +982 -0
- package/skills/octocode-code-engineer/coverage/clover.xml +3217 -0
- package/skills/octocode-code-engineer/coverage/collect-effects.ts.html +664 -0
- package/skills/octocode-code-engineer/coverage/collect-input-sources.ts.html +577 -0
- package/skills/octocode-code-engineer/coverage/collect-performance.ts.html +331 -0
- package/skills/octocode-code-engineer/coverage/collect-prototype-pollution.ts.html +421 -0
- package/skills/octocode-code-engineer/coverage/collect-security.ts.html +604 -0
- package/skills/octocode-code-engineer/coverage/collect-test-profile.ts.html +589 -0
- package/skills/octocode-code-engineer/coverage/coverage-final.json +30 -0
- package/skills/octocode-code-engineer/coverage/dependencies.ts.html +997 -0
- package/skills/octocode-code-engineer/coverage/dependency-summary.ts.html +688 -0
- package/skills/octocode-code-engineer/coverage/discovery.ts.html +322 -0
- package/skills/octocode-code-engineer/coverage/favicon.png +0 -0
- package/skills/octocode-code-engineer/coverage/graph-analytics.ts.html +1510 -0
- package/skills/octocode-code-engineer/coverage/index.html +536 -0
- package/skills/octocode-code-engineer/coverage/index.ts.html +826 -0
- package/skills/octocode-code-engineer/coverage/metrics.ts.html +553 -0
- package/skills/octocode-code-engineer/coverage/pipeline.ts.html +2044 -0
- package/skills/octocode-code-engineer/coverage/prettify.css +1 -0
- package/skills/octocode-code-engineer/coverage/prettify.js +2 -0
- package/skills/octocode-code-engineer/coverage/report-analysis.ts.html +1570 -0
- package/skills/octocode-code-engineer/coverage/report-writer.ts.html +1102 -0
- package/skills/octocode-code-engineer/coverage/security-detectors.ts.html +1747 -0
- package/skills/octocode-code-engineer/coverage/semantic-detectors.ts.html +2152 -0
- package/skills/octocode-code-engineer/coverage/semantic.ts.html +1897 -0
- package/skills/octocode-code-engineer/coverage/sort-arrow-sprite.png +0 -0
- package/skills/octocode-code-engineer/coverage/sorter.js +210 -0
- package/skills/octocode-code-engineer/coverage/summary-md.ts.html +1222 -0
- package/skills/octocode-code-engineer/coverage/test-quality-detectors.ts.html +1039 -0
- package/skills/octocode-code-engineer/coverage/tree-sitter-analyzer.ts.html +955 -0
- package/skills/octocode-code-engineer/coverage/ts-analyzer.ts.html +1213 -0
- package/skills/octocode-code-engineer/coverage/types.ts.html +2473 -0
- package/skills/octocode-code-engineer/coverage/utils.ts.html +820 -0
- package/skills/octocode-code-engineer/eslint.config.mjs +54 -0
- package/skills/octocode-code-engineer/minify-scripts.mjs +32 -0
- package/skills/octocode-code-engineer/package.json +54 -0
- package/skills/octocode-code-engineer/references/agent-ast-reading-rfc.md +95 -0
- package/skills/octocode-code-engineer/references/architecture-techniques.md +121 -0
- package/skills/octocode-code-engineer/references/ast-search.md +210 -0
- package/skills/octocode-code-engineer/references/ast-tree-search.md +151 -0
- package/skills/octocode-code-engineer/references/cli-reference.md +167 -0
- package/skills/octocode-code-engineer/references/concepts.md +107 -0
- package/skills/octocode-code-engineer/references/finding-categories.md +128 -0
- package/skills/octocode-code-engineer/references/improvement-roadmap.md +304 -0
- package/skills/octocode-code-engineer/references/output-files.md +144 -0
- package/skills/octocode-code-engineer/references/playbooks.md +204 -0
- package/skills/octocode-code-engineer/references/present-results.md +136 -0
- package/skills/octocode-code-engineer/references/tool-workflows.md +566 -0
- package/skills/octocode-code-engineer/references/validate-investigate.md +225 -0
- package/skills/octocode-code-engineer/scripts/analysis/dependencies.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/dependency-summary.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/discovery.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/graph-analytics.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/semantic.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/helpers.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/metrics.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/search.js +2 -0
- package/skills/octocode-code-engineer/scripts/ast/tree-search.js +2 -0
- package/skills/octocode-code-engineer/scripts/ast/tree-sitter.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/ts-analyzer.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/chains.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/effects.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/input-sources.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/performance.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/prototype-pollution.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/security.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/test-profile.js +1 -0
- package/skills/octocode-code-engineer/scripts/common/is-direct-run.js +1 -0
- package/skills/octocode-code-engineer/scripts/common/utils.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/code-quality.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/cohesion.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/coupling.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/cycle.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/dead-code.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/import-style.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/index.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/security.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/semantic.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/shared.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/test-quality.js +1 -0
- package/skills/octocode-code-engineer/scripts/index.js +1 -0
- package/skills/octocode-code-engineer/scripts/pipeline/cache.js +1 -0
- package/skills/octocode-code-engineer/scripts/pipeline/cli.js +1 -0
- package/skills/octocode-code-engineer/scripts/pipeline/main.js +2 -0
- package/skills/octocode-code-engineer/scripts/reporting/analysis.js +1 -0
- package/skills/octocode-code-engineer/scripts/reporting/summary-md.js +1 -0
- package/skills/octocode-code-engineer/scripts/reporting/writer.js +1 -0
- package/skills/octocode-code-engineer/scripts/types/constants.js +1 -0
- package/skills/octocode-code-engineer/scripts/types/index.js +1 -0
- package/skills/octocode-code-engineer/scripts/types/interfaces.js +1 -0
- package/skills/octocode-code-engineer/src/analysis/dependencies.test.ts +545 -0
- package/skills/octocode-code-engineer/src/analysis/dependencies.ts +406 -0
- package/skills/octocode-code-engineer/src/analysis/dependency-summary.test.ts +566 -0
- package/skills/octocode-code-engineer/src/analysis/dependency-summary.ts +257 -0
- package/skills/octocode-code-engineer/src/analysis/discovery.test.ts +420 -0
- package/skills/octocode-code-engineer/src/analysis/discovery.ts +87 -0
- package/skills/octocode-code-engineer/src/analysis/graph-analytics.test.ts +449 -0
- package/skills/octocode-code-engineer/src/analysis/graph-analytics.ts +534 -0
- package/skills/octocode-code-engineer/src/analysis/semantic.test.ts +1533 -0
- package/skills/octocode-code-engineer/src/analysis/semantic.ts +830 -0
- package/skills/octocode-code-engineer/src/ast/helpers.test.ts +185 -0
- package/skills/octocode-code-engineer/src/ast/helpers.ts +62 -0
- package/skills/octocode-code-engineer/src/ast/metrics.test.ts +304 -0
- package/skills/octocode-code-engineer/src/ast/metrics.ts +204 -0
- package/skills/octocode-code-engineer/src/ast/search.test.ts +647 -0
- package/skills/octocode-code-engineer/src/ast/search.ts +648 -0
- package/skills/octocode-code-engineer/src/ast/tree-search.test.ts +199 -0
- package/skills/octocode-code-engineer/src/ast/tree-search.ts +392 -0
- package/skills/octocode-code-engineer/src/ast/tree-sitter.test.ts +407 -0
- package/skills/octocode-code-engineer/src/ast/tree-sitter.ts +402 -0
- package/skills/octocode-code-engineer/src/ast/ts-analyzer.test.ts +1864 -0
- package/skills/octocode-code-engineer/src/ast/ts-analyzer.ts +509 -0
- package/skills/octocode-code-engineer/src/collectors/chains.ts +74 -0
- package/skills/octocode-code-engineer/src/collectors/effects.test.ts +490 -0
- package/skills/octocode-code-engineer/src/collectors/effects.ts +332 -0
- package/skills/octocode-code-engineer/src/collectors/input-sources.test.ts +144 -0
- package/skills/octocode-code-engineer/src/collectors/input-sources.ts +196 -0
- package/skills/octocode-code-engineer/src/collectors/performance.test.ts +82 -0
- package/skills/octocode-code-engineer/src/collectors/performance.ts +141 -0
- package/skills/octocode-code-engineer/src/collectors/prototype-pollution.test.ts +55 -0
- package/skills/octocode-code-engineer/src/collectors/prototype-pollution.ts +162 -0
- package/skills/octocode-code-engineer/src/collectors/security.test.ts +124 -0
- package/skills/octocode-code-engineer/src/collectors/security.ts +309 -0
- package/skills/octocode-code-engineer/src/collectors/test-profile.test.ts +97 -0
- package/skills/octocode-code-engineer/src/collectors/test-profile.ts +269 -0
- package/skills/octocode-code-engineer/src/common/is-direct-run.test.ts +32 -0
- package/skills/octocode-code-engineer/src/common/is-direct-run.ts +13 -0
- package/skills/octocode-code-engineer/src/common/utils.test.ts +463 -0
- package/skills/octocode-code-engineer/src/common/utils.ts +304 -0
- package/skills/octocode-code-engineer/src/detectors/code-quality.ts +966 -0
- package/skills/octocode-code-engineer/src/detectors/cohesion.ts +539 -0
- package/skills/octocode-code-engineer/src/detectors/coupling.ts +323 -0
- package/skills/octocode-code-engineer/src/detectors/cycle.ts +349 -0
- package/skills/octocode-code-engineer/src/detectors/dead-code.ts +320 -0
- package/skills/octocode-code-engineer/src/detectors/import-style.ts +376 -0
- package/skills/octocode-code-engineer/src/detectors/index.test.ts +3061 -0
- package/skills/octocode-code-engineer/src/detectors/index.ts +88 -0
- package/skills/octocode-code-engineer/src/detectors/security.test.ts +882 -0
- package/skills/octocode-code-engineer/src/detectors/security.ts +821 -0
- package/skills/octocode-code-engineer/src/detectors/semantic.ts +758 -0
- package/skills/octocode-code-engineer/src/detectors/shared.ts +49 -0
- package/skills/octocode-code-engineer/src/detectors/test-quality.test.ts +388 -0
- package/skills/octocode-code-engineer/src/detectors/test-quality.ts +367 -0
- package/skills/octocode-code-engineer/src/index.test.ts +4425 -0
- package/skills/octocode-code-engineer/src/index.ts +403 -0
- package/skills/octocode-code-engineer/src/pipeline/cache.test.ts +199 -0
- package/skills/octocode-code-engineer/src/pipeline/cache.ts +130 -0
- package/skills/octocode-code-engineer/src/pipeline/cli.test.ts +493 -0
- package/skills/octocode-code-engineer/src/pipeline/cli.ts +344 -0
- package/skills/octocode-code-engineer/src/pipeline/main.test.ts +174 -0
- package/skills/octocode-code-engineer/src/pipeline/main.ts +1074 -0
- package/skills/octocode-code-engineer/src/pipeline.test.ts +84 -0
- package/skills/octocode-code-engineer/src/reporting/analysis.test.ts +782 -0
- package/skills/octocode-code-engineer/src/reporting/analysis.ts +688 -0
- package/skills/octocode-code-engineer/src/reporting/output-contract.test.ts +463 -0
- package/skills/octocode-code-engineer/src/reporting/summary-md.test.ts +421 -0
- package/skills/octocode-code-engineer/src/reporting/summary-md.ts +714 -0
- package/skills/octocode-code-engineer/src/reporting/writer.ts +430 -0
- package/skills/octocode-code-engineer/src/sanity.test.ts +47 -0
- package/skills/octocode-code-engineer/src/types/constants.ts +248 -0
- package/skills/octocode-code-engineer/src/types/index.ts +80 -0
- package/skills/octocode-code-engineer/src/types/interfaces.ts +682 -0
- package/skills/octocode-code-engineer/tsconfig.json +17 -0
- package/skills/octocode-code-engineer/vitest.config.ts +8 -0
- package/skills/octocode-documentation-writer/README.md +113 -0
- package/skills/octocode-documentation-writer/SKILL.md +886 -0
- package/skills/octocode-documentation-writer/references/agent-discovery-analysis.md +453 -0
- package/skills/octocode-documentation-writer/references/agent-documentation-writer.md +255 -0
- package/skills/octocode-documentation-writer/references/agent-engineer-questions.md +247 -0
- package/skills/octocode-documentation-writer/references/agent-orchestrator.md +370 -0
- package/skills/octocode-documentation-writer/references/agent-qa-validator.md +227 -0
- package/skills/octocode-documentation-writer/references/agent-researcher.md +250 -0
- package/skills/octocode-documentation-writer/schemas/analysis-schema.json +886 -0
- package/skills/octocode-documentation-writer/schemas/discovery-tasks.json +96 -0
- package/skills/octocode-documentation-writer/schemas/documentation-structure.json +373 -0
- package/skills/octocode-documentation-writer/schemas/partial-discovery-schema.json +102 -0
- package/skills/octocode-documentation-writer/schemas/partial-research-schema.json +98 -0
- package/skills/octocode-documentation-writer/schemas/qa-results-schema.json +113 -0
- package/skills/octocode-documentation-writer/schemas/questions-schema.json +228 -0
- package/skills/octocode-documentation-writer/schemas/research-schema.json +104 -0
- package/skills/octocode-documentation-writer/schemas/state-schema.json +222 -0
- package/skills/octocode-documentation-writer/schemas/work-assignments-schema.json +74 -0
- package/skills/octocode-plan/SKILL.md +122 -116
- package/skills/octocode-prompt-optimizer/SKILL.md +617 -0
- package/skills/octocode-pull-request-reviewer/README.md +249 -0
- package/skills/octocode-pull-request-reviewer/SKILL.md +479 -0
- package/skills/octocode-pull-request-reviewer/references/dependency-check.md +74 -0
- package/skills/octocode-pull-request-reviewer/references/domain-reviewers.md +24 -0
- package/skills/octocode-pull-request-reviewer/references/execution-lifecycle.md +441 -0
- package/skills/octocode-pull-request-reviewer/references/flow-analysis-protocol.md +64 -0
- package/skills/octocode-pull-request-reviewer/references/output-template.md +174 -0
- package/skills/octocode-pull-request-reviewer/references/parallel-agent-protocol.md +182 -0
- package/skills/octocode-pull-request-reviewer/references/review-guidelines.md +26 -0
- package/skills/octocode-pull-request-reviewer/references/verification-checklist.md +40 -0
- package/skills/octocode-research/.claude/settings.local.json +46 -0
- package/skills/octocode-research/.octocode/plan/code-review-fixes/plan.md +312 -0
- package/skills/octocode-research/.octocode/plan/code-review-fixes/research.md +212 -0
- package/skills/octocode-research/.octocode/plans/NODE_SERVER_START_PLAN.md +755 -0
- package/skills/octocode-research/.octocode/research/code-review/research.md +371 -0
- package/skills/octocode-research/.octocode/review/IMPROVEMENTS.md +391 -0
- package/skills/octocode-research/.octocode/review/REVIEW_PLAN.md +289 -0
- package/skills/octocode-research/.octocode/review/REVIEW_REPORT.md +356 -0
- package/skills/octocode-research/AGENTS.md +349 -0
- package/skills/octocode-research/README.md +494 -0
- package/skills/octocode-research/SKILL.md +652 -274
- package/skills/octocode-research/docs/API_REFERENCE.md +562 -0
- package/skills/octocode-research/docs/ARCHITECTURE.md +554 -0
- package/skills/octocode-research/docs/FLOWS.md +577 -0
- package/skills/octocode-research/docs/OVERVIEW.md +564 -0
- package/skills/octocode-research/docs/SERVER_FLOWS.md +631 -0
- package/skills/octocode-research/ecosystem.config.cjs +88 -0
- package/skills/octocode-research/eslint.config.mjs +27 -0
- package/skills/octocode-research/package.json +84 -0
- package/skills/octocode-research/references/GUARDRAILS.md +40 -0
- package/skills/octocode-research/references/PARALLEL_AGENT_PROTOCOL.md +178 -0
- package/skills/octocode-research/references/roast-prompt.md +149 -0
- package/skills/octocode-research/scripts/server-init.d.ts +2 -0
- package/skills/octocode-research/scripts/server-init.js +2 -0
- package/skills/octocode-research/scripts/server.d.ts +8 -0
- package/skills/octocode-research/scripts/server.js +445 -0
- package/skills/octocode-research/src/__tests__/integration/circuitBreaker.test.ts +205 -0
- package/skills/octocode-research/src/__tests__/integration/routes.test.ts +374 -0
- package/skills/octocode-research/src/__tests__/unit/circuitBreaker.test.ts +245 -0
- package/skills/octocode-research/src/__tests__/unit/errorHandler.test.ts +183 -0
- package/skills/octocode-research/src/__tests__/unit/httpPreprocess.test.ts +157 -0
- package/skills/octocode-research/src/__tests__/unit/logger.test.ts +143 -0
- package/skills/octocode-research/src/__tests__/unit/queryParser.test.ts +130 -0
- package/skills/octocode-research/src/__tests__/unit/responseBuilder.test.ts +469 -0
- package/skills/octocode-research/src/__tests__/unit/retry.test.ts +205 -0
- package/skills/octocode-research/src/index.ts +186 -0
- package/skills/octocode-research/src/mcpCache.ts +49 -0
- package/skills/octocode-research/src/middleware/errorHandler.ts +65 -0
- package/skills/octocode-research/src/middleware/logger.ts +61 -0
- package/skills/octocode-research/src/middleware/queryParser.ts +115 -0
- package/skills/octocode-research/src/middleware/readiness.ts +17 -0
- package/skills/octocode-research/src/routes/github.ts +197 -0
- package/skills/octocode-research/src/routes/local.ts +175 -0
- package/skills/octocode-research/src/routes/lsp.ts +177 -0
- package/skills/octocode-research/src/routes/package.ts +127 -0
- package/skills/octocode-research/src/routes/prompts.ts +138 -0
- package/skills/octocode-research/src/routes/tools.ts +677 -0
- package/skills/octocode-research/src/server-init.ts +363 -0
- package/skills/octocode-research/src/server.ts +285 -0
- package/skills/octocode-research/src/types/errorGuards.ts +151 -0
- package/skills/octocode-research/src/types/express.d.ts +76 -0
- package/skills/octocode-research/src/types/guards.ts +98 -0
- package/skills/octocode-research/src/types/mcp.ts +119 -0
- package/skills/octocode-research/src/types/responses.ts +199 -0
- package/skills/octocode-research/src/types/toolTypes.ts +33 -0
- package/skills/octocode-research/src/utils/asyncTimeout.ts +116 -0
- package/skills/octocode-research/src/utils/circuitBreaker.ts +492 -0
- package/skills/octocode-research/src/utils/colors.ts +53 -0
- package/skills/octocode-research/src/utils/errorQueue.ts +71 -0
- package/skills/octocode-research/src/utils/logEmoji.ts +103 -0
- package/skills/octocode-research/src/utils/logger.ts +413 -0
- package/skills/octocode-research/src/utils/resilience.ts +169 -0
- package/skills/octocode-research/src/utils/responseBuilder.ts +495 -0
- package/skills/octocode-research/src/utils/responseFactory.ts +100 -0
- package/skills/octocode-research/src/utils/responseParser.ts +272 -0
- package/skills/octocode-research/src/utils/retry.ts +280 -0
- package/skills/octocode-research/src/utils/routeFactory.ts +117 -0
- package/skills/octocode-research/src/utils/url.ts +20 -0
- package/skills/octocode-research/src/validation/httpPreprocess.ts +155 -0
- package/skills/octocode-research/src/validation/index.ts +2 -0
- package/skills/octocode-research/src/validation/schemas.ts +578 -0
- package/skills/octocode-research/src/validation/toolCallSchema.ts +132 -0
- package/skills/octocode-research/tsconfig.json +21 -0
- package/skills/octocode-research/tsdown.config.ts +42 -0
- package/skills/octocode-research/vitest.config.ts +20 -0
- package/skills/octocode-researcher/SKILL.md +461 -0
- package/skills/octocode-researcher/references/fallbacks.md +120 -0
- package/skills/{octocode-local-search → octocode-researcher}/references/tool-reference.md +132 -49
- package/skills/{octocode-local-search → octocode-researcher}/references/workflow-patterns.md +204 -4
- package/skills/octocode-rfc-generator/SKILL.md +223 -0
- package/skills/octocode-rfc-generator/references/rfc-template.md +193 -0
- package/skills/octocode-roast/SKILL.md +63 -21
- package/skills/octocode-implement/SKILL.md +0 -293
- package/skills/octocode-implement/references/execution-phases.md +0 -317
- package/skills/octocode-implement/references/tool-reference.md +0 -403
- package/skills/octocode-implement/references/workflow-patterns.md +0 -385
- package/skills/octocode-local-search/SKILL.md +0 -449
- package/skills/octocode-pr-review/SKILL.md +0 -391
- package/skills/octocode-pr-review/references/domain-reviewers.md +0 -105
- package/skills/octocode-pr-review/references/execution-lifecycle.md +0 -116
- package/skills/octocode-pr-review/references/research-flows.md +0 -75
- package/skills/octocode-research/references/tool-reference.md +0 -304
- package/skills/octocode-research/references/workflow-patterns.md +0 -325
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "octocode-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Interactive CLI installer for octocode-mcp - Configure MCP servers for Cursor, Claude Desktop, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"octocode",
|
|
@@ -25,15 +25,14 @@
|
|
|
25
25
|
"directory": "packages/octocode-cli"
|
|
26
26
|
},
|
|
27
27
|
"bugs": "https://github.com/bgauryy/octocode-mcp/issues",
|
|
28
|
-
"license": "
|
|
28
|
+
"license": "MIT",
|
|
29
29
|
"bin": "./out/octocode-cli.js",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@inquirer/prompts": "^8.1.0",
|
|
32
|
-
"@napi-rs/keyring": "^1.2.0",
|
|
33
32
|
"@octokit/auth-oauth-device": "^8.0.3",
|
|
34
33
|
"@octokit/oauth-methods": "^6.0.2",
|
|
35
34
|
"@octokit/request": "^10.0.7",
|
|
36
|
-
"octocode-shared": "
|
|
35
|
+
"octocode-shared": "workspace:^",
|
|
37
36
|
"open": "^11.0.0"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
@@ -49,7 +48,7 @@
|
|
|
49
48
|
"node": ">=20.12.0"
|
|
50
49
|
},
|
|
51
50
|
"files": [
|
|
52
|
-
"out
|
|
51
|
+
"out",
|
|
53
52
|
"skills",
|
|
54
53
|
"assets/example.png",
|
|
55
54
|
"README.md",
|
|
@@ -60,6 +59,8 @@
|
|
|
60
59
|
"build": "yarn lint && vite build",
|
|
61
60
|
"build:dev": "vite build",
|
|
62
61
|
"clean": "rm -rf out/",
|
|
62
|
+
"prepack": "cp -r ../../skills ./skills",
|
|
63
|
+
"postpack": "rm -rf ./skills",
|
|
63
64
|
"lint": "eslint src tests",
|
|
64
65
|
"lint:fix": "eslint src tests --fix",
|
|
65
66
|
"start": "node ./out/octocode-cli.js",
|
|
@@ -70,7 +71,8 @@
|
|
|
70
71
|
"validate:mcp": "npx tsx scripts/validate-mcp-registry.ts",
|
|
71
72
|
"validate:mcp:json": "npx tsx scripts/validate-mcp-registry.ts --json",
|
|
72
73
|
"validate:skills": "npx tsx scripts/validate-skills-marketplace.ts",
|
|
73
|
-
"validate:skills:json": "npx tsx scripts/validate-skills-marketplace.ts --json"
|
|
74
|
+
"validate:skills:json": "npx tsx scripts/validate-skills-marketplace.ts --json",
|
|
75
|
+
"verify": "yarn lint && yarn typecheck && yarn test && yarn validate:mcp && yarn validate:skills"
|
|
74
76
|
},
|
|
75
77
|
"type": "module"
|
|
76
78
|
}
|
package/skills/README.md
CHANGED
|
@@ -1,165 +1,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OctoCode Skills
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Specialized AI agent skills that extend OctoCode's capabilities.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|-------|-------------|------|
|
|
9
|
-
| `octocode-research` | Evidence-first code forensics (local & GitHub) | PREPARE → DISCOVER → ANALYZE → OUTPUT |
|
|
10
|
-
| `octocode-local-search` | Local-first code exploration and discovery | DISCOVER → PLAN → EXECUTE → VERIFY → OUTPUT |
|
|
11
|
-
| `octocode-implement` | Research-driven feature implementation from specs | SPEC → CONTEXT → PLAN → RESEARCH → IMPLEMENT → VALIDATE |
|
|
12
|
-
| `octocode-plan` | Adaptive research & implementation planning | UNDERSTAND → RESEARCH → PLAN → IMPLEMENT → VERIFY |
|
|
13
|
-
| `octocode-pr-review` | Defects-first PR review across 6+ domains | CONTEXT → CHECKPOINT → ANALYSIS → FINALIZE → REPORT |
|
|
14
|
-
| `octocode-roast` | Brutally honest code review with comedic flair | SCOPE → ROAST → INVENTORY → SPOTLIGHT → REDEMPTION |
|
|
7
|
+
## When to Use What
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
| Your Need | Skill | Example Trigger |
|
|
10
|
+
|-----------|-------|-----------------|
|
|
11
|
+
| Code search, exploration, research (local + external) | **Researcher** | "Find X in codebase", "Where is Y?", "Who calls Z?", "Trace this flow", "How does library X work?" |
|
|
12
|
+
| Complex multi-phase research with sessions & checkpoints | **Research** | "Deep-dive into auth end-to-end", "Compare React vs Vue state", "Research and review PR changes" |
|
|
13
|
+
| Plan implementation steps before coding | **Plan** | "Plan this refactor", "Research & plan this feature" |
|
|
14
|
+
| Technical decisions requiring formal RFC with alternatives | **RFC** | "Create RFC for caching", "Design doc for API v2", "How should we build X?" |
|
|
15
|
+
| Review a pull request or local changes | **PR Reviewer** | "Review PR #123", "Review my changes", "Is this PR safe to merge?" |
|
|
16
|
+
| Repo-wide code quality scan (duplicates, complexity, cycles) | **Local Code Scan** | "Analyze code quality", "Find duplicates", "Find dependency cycles", "Scan for tech debt" |
|
|
17
|
+
| Brutal code criticism with fixes | **Roast** | "Roast my code", "Find code sins", "What's wrong with this?" |
|
|
18
|
+
| Strengthen prompts / agent instructions | **Prompt Optimizer** | "Optimize this SKILL.md", "Agent skips steps" |
|
|
19
|
+
| Generate repo documentation | **Documentation Writer** | "Document this project", "Create developer docs" |
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
---
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
octocode skills install
|
|
22
|
-
```
|
|
23
|
+
## Skills Overview
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
### 1. OctoCode Researcher
|
|
26
|
+
**Location:** `octocode-researcher/`
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
**The default research skill.** Direct code exploration via Octocode MCP tools — local codebase (LSP semantic navigation, search, structure) and external (GitHub, npm/PyPI, PRs). Lightweight, no server needed. Use for most research tasks.
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
| When | Example |
|
|
31
|
+
|------|---------|
|
|
32
|
+
| Local search + LSP | "Find auth logic", "Where is X defined?", "Who calls Y?" |
|
|
33
|
+
| External research | "How does library X work?", "Find a caching package" |
|
|
34
|
+
| Cross-boundary | "How does our code use dependency Z?" |
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
# Global (all projects)
|
|
32
|
-
cp -r skills/octocode-* ~/.claude/skills/
|
|
36
|
+
---
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
38
|
+
### 2. OctoCode Research (HTTP Server)
|
|
39
|
+
**Location:** `octocode-research/`
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
HTTP server mode for complex, multi-phase research. Adds session management, checkpoints, and persistent context on top of Octocode MCP tools. Phases: Init → Context → Fast-path → Plan → Research → Output. Use when research spans multiple domains and benefits from state persistence.
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
| When | Example |
|
|
44
|
+
|------|---------|
|
|
45
|
+
| Multi-domain deep dive | "Research how auth works end-to-end" |
|
|
46
|
+
| Comparative analysis | "Compare React vs Vue state management" |
|
|
47
|
+
| Persistent sessions | "Continue researching from last checkpoint" |
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
---
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- GitHub code forensics across repositories
|
|
47
|
-
- Cross-domain transitions (Local ↔ GitHub)
|
|
48
|
-
- node_modules inspection with `noIgnore=true`
|
|
49
|
-
- Multi-agent parallelization for independent hypotheses
|
|
50
|
-
- Validation pattern: Discover → Verify → Cross-check → Confirm
|
|
51
|
+
### 3. OctoCode Plan
|
|
52
|
+
**Location:** `octocode-plan/`
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
Evidence-based implementation planning. Understand → Research (delegates to Researcher/Research) → Plan → Implement. Use when you know the general approach and need actionable steps.
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
| When | Example |
|
|
57
|
+
|------|---------|
|
|
58
|
+
| Multi-step work | "Plan auth refactor", "Plan API v2" |
|
|
59
|
+
| Non-trivial tasks | "Research & plan this feature" |
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
- Local-only focus (no GitHub tools)
|
|
58
|
-
- Structured discovery with `localViewStructure`, `localSearchCode`, `localFindFiles`, `localGetFileContent`
|
|
59
|
-
- Interactive planning with user checkpoints
|
|
60
|
-
- node_modules inspection with `noIgnore=true`
|
|
61
|
-
- Token-efficient workflows with discovery mode
|
|
62
|
-
- Multi-agent parallelization for independent research domains
|
|
61
|
+
---
|
|
63
62
|
|
|
64
|
-
###
|
|
63
|
+
### 4. OctoCode RFC Generator
|
|
64
|
+
**Location:** `octocode-rfc-generator/`
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
For technical decisions that need formal evaluation. Understand → Research → Draft RFC with alternatives → Validate → Implementation plan. Use when multiple approaches are viable and you need to reason through trade-offs before committing.
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- Impact analysis before modifying code
|
|
74
|
-
- Test-driven implementation with validation gates
|
|
75
|
-
- User checkpoints at key decision points
|
|
76
|
-
- Multi-agent parallelization for independent tasks
|
|
68
|
+
| When | Example |
|
|
69
|
+
|------|---------|
|
|
70
|
+
| Technical decisions | "Create RFC for caching layer", "How should we build X?" |
|
|
71
|
+
| Migrations / refactors | "RFC for auth migration", "Design doc for API v2" |
|
|
72
|
+
| Architecture choices | "Should we use Redis or Memcached?", "Propose new pattern" |
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
---
|
|
79
75
|
|
|
80
|
-
###
|
|
76
|
+
### 5. OctoCode Prompt Optimizer
|
|
77
|
+
**Location:** `octocode-prompt-optimizer/`
|
|
81
78
|
|
|
82
|
-
|
|
79
|
+
Turns weak prompts into enforceable protocols. Gates, FORBIDDEN lists, failure analysis. Preserves intent, adds reliability.
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- Goal classification (RESEARCH_ONLY, ANALYSIS, CREATION, FEATURE, BUG, REFACTOR)
|
|
89
|
-
- Research synthesis with confidence levels
|
|
90
|
-
- Plan approval gates before implementation
|
|
91
|
-
- Multi-agent parallelization for independent research domains
|
|
92
|
-
- Structured output to `.octocode/plan/{session-name}/`
|
|
81
|
+
| When | Example |
|
|
82
|
+
|------|---------|
|
|
83
|
+
| Prompts ignored | "Agent keeps skipping steps" |
|
|
84
|
+
| New/weak instructions | "Optimize this SKILL.md", "Make prompt reliable" |
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
*Not for:* Short prompts (<50 lines), already-optimized docs.
|
|
95
87
|
|
|
96
|
-
|
|
88
|
+
---
|
|
97
89
|
|
|
98
|
-
|
|
90
|
+
### 6. OctoCode Documentation Writer
|
|
91
|
+
**Location:** `octocode-documentation-writer/`
|
|
99
92
|
|
|
100
|
-
|
|
101
|
-
- 🐛 Bug (runtime errors, logic flaws, resource leaks)
|
|
102
|
-
- 🏗️ Architecture (pattern violations, circular dependencies)
|
|
103
|
-
- ⚡ Performance (O(n²), memory leaks, blocking ops)
|
|
104
|
-
- 🎨 Code Quality (naming, conventions, DRY violations)
|
|
105
|
-
- 🔗 Duplicate Code (missed reuse opportunities)
|
|
106
|
-
- 🚨 Error Handling (swallowed exceptions, poor diagnostics)
|
|
107
|
-
- 🔄 Flow Impact (breaking changes, altered data paths)
|
|
93
|
+
6-phase pipeline: Discovery → Questions → Research → Orchestration → Writing → QA. Produces 16+ docs with validation.
|
|
108
94
|
|
|
109
|
-
|
|
95
|
+
| When | Example |
|
|
96
|
+
|------|---------|
|
|
97
|
+
| New/outdated docs | "Generate documentation", "Update docs" |
|
|
98
|
+
| Onboarding | "Create docs for new devs" |
|
|
110
99
|
|
|
111
|
-
|
|
100
|
+
---
|
|
112
101
|
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
- Personalized zingers based on actual patterns found
|
|
116
|
-
- Multiple roast personas (Gordon Ramsay, Disappointed Dad, Tech Bro, Israeli Sabra, etc.)
|
|
117
|
-
- User checkpoint before fixes (Redemption Arc)
|
|
118
|
-
- Actionable fixes with before/after
|
|
102
|
+
### 7. OctoCode Roast
|
|
103
|
+
**Location:** `octocode-roast/`
|
|
119
104
|
|
|
120
|
-
|
|
105
|
+
Brutal code critique with file:line citations. Severity: gentle → nuclear. Sin registry, user picks fixes. Cites or dies.
|
|
121
106
|
|
|
122
|
-
|
|
107
|
+
| When | Example |
|
|
108
|
+
|------|---------|
|
|
109
|
+
| Code critique | "Roast my code", "Find antipatterns" |
|
|
110
|
+
| Honest feedback | "What's wrong with my code?" |
|
|
123
111
|
|
|
124
|
-
|
|
125
|
-
{skill-name}/
|
|
126
|
-
├── SKILL.md # Main reference (<500 lines)
|
|
127
|
-
└── references/ # Supporting documentation (optional)
|
|
128
|
-
├── tool-reference.md
|
|
129
|
-
└── workflow-patterns.md
|
|
130
|
-
```
|
|
112
|
+
---
|
|
131
113
|
|
|
132
|
-
|
|
114
|
+
### 8. OctoCode Local Code Scan
|
|
115
|
+
**Location:** `octocode-local-code-scan/`
|
|
133
116
|
|
|
134
|
-
|
|
117
|
+
AST-based repo-wide code quality scanner. Detects duplicate function bodies, repeated control-flow patterns, high-complexity functions, dependency cycles, critical dependency chains, and dead modules. Produces a prioritized JSON report with file:line references and suggested fixes. Optionally uses tree-sitter for richer metadata. Pairs with Octocode MCP local + LSP tools for investigation.
|
|
135
118
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
7. **Evidence Citing**: Include file paths and code references
|
|
119
|
+
| When | Example |
|
|
120
|
+
|------|---------|
|
|
121
|
+
| Code quality audit | "Analyze code quality", "Scan for tech debt" |
|
|
122
|
+
| Duplicate detection | "Find duplicate code", "Find repeated patterns" |
|
|
123
|
+
| Dependency analysis | "Find dependency cycles", "Show critical paths" |
|
|
124
|
+
| Complexity check | "Check complexity", "Find oversized functions" |
|
|
143
125
|
|
|
144
|
-
|
|
126
|
+
---
|
|
145
127
|
|
|
146
|
-
|
|
128
|
+
### 9. OctoCode Pull Request & Code Reviewer
|
|
129
|
+
**Location:** `octocode-pull-request-reviewer/`
|
|
147
130
|
|
|
148
|
-
|
|
149
|
-
```yaml
|
|
150
|
-
---
|
|
151
|
-
name: skill-name
|
|
152
|
-
description: Use when [specific triggers]...
|
|
153
|
-
---
|
|
154
|
-
```
|
|
131
|
+
Holistic code review via Octocode MCP: bugs, security, architecture, flow impact. Supports both **remote PRs** and **local changes** (staged/unstaged). 7 domains, LSP-powered flow tracing, evidence-backed, user checkpoint before deep dive.
|
|
155
132
|
|
|
156
|
-
|
|
133
|
+
> **Local Mode** requires `ENABLE_LOCAL=true` — see [README](https://github.com/bgauryy/octocode-mcp/blob/main/skills/octocode-pull-request-reviewer/README.md)
|
|
157
134
|
|
|
158
|
-
|
|
135
|
+
| When | Example |
|
|
136
|
+
|------|---------|
|
|
137
|
+
| PR review | "Review PR #456", "Check this PR" |
|
|
138
|
+
| Local changes | "Review my changes", "Review staged changes" |
|
|
139
|
+
| Security/impact | "Is this safe to merge?" |
|
|
159
140
|
|
|
160
|
-
|
|
141
|
+
---
|
|
161
142
|
|
|
162
|
-
## More Info
|
|
163
|
-
|
|
164
|
-
- [Claude Skills Documentation](https://support.anthropic.com/en/articles/10176498-how-to-use-custom-instructions-for-your-projects)
|
|
165
|
-
- [Octocode MCP](https://octocode.ai)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"WebFetch(domain:docs.anthropic.com)",
|
|
5
|
+
"WebSearch",
|
|
6
|
+
"Bash(wc:*)",
|
|
7
|
+
"Bash(node:*)",
|
|
8
|
+
"Skill(octocode-local-code-quality)",
|
|
9
|
+
"Bash(tail:*)",
|
|
10
|
+
"Bash(npm install:*)",
|
|
11
|
+
"Bash(npx tsc:*)",
|
|
12
|
+
"Bash(npx vitest:*)",
|
|
13
|
+
"Bash(cp:*)",
|
|
14
|
+
"Bash(npx tsc 2>&1 && cp -R /Users/guybary/Documents/octocode-mcp/skills/octocode-local-code-quality/ /Users/guybary/.claude/skills/octocode-local-code-quality/ 2>&1)",
|
|
15
|
+
"Bash(cat:*)"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# RFC: Code Engineer Skill — Weakness Fixes
|
|
2
|
+
|
|
3
|
+
**Generated**: 2026-03-21
|
|
4
|
+
**Scope**: `skills/octocode-code-engineer` — detectors, pipeline, documentation, CLI
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Summary
|
|
9
|
+
|
|
10
|
+
Fix all 14 weaknesses identified by running the code-engineer skill against itself. The changes span four areas: **detector accuracy** (thresholds, missing wiring, noise reduction), **pipeline behavior** (scope clarity, semantic confidence, cache), **documentation** (stale roadmap, thin concepts, missing fallbacks, category drift), and **test quality cross-referencing**. No architectural rewrites — surgical fixes anchored to exact file:line evidence.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Motivation
|
|
15
|
+
|
|
16
|
+
The code-engineer skill self-scan revealed legitimate gaps that affect real users:
|
|
17
|
+
|
|
18
|
+
- **False negatives**: `god-function` uses statement count only (threshold 100), so orchestration functions with MI=1.4 pass. `detectSemanticDeadExports` is **implemented but never wired** into `runSemanticDetectors`. `detectDeadFiles` exists in `cycle.ts:202-234` but is **never called** from `index.ts`.
|
|
19
|
+
- **False positives / noise**: `unbounded-collection` fires on any function with 2+ loops and 5+ calls — no collection mutation check. `shotgun-surgery` has no allowlist for intentionally-shared utilities. Dead re-export count (94) inflated by `src/`↔`scripts/` duality.
|
|
20
|
+
- **Missing config surface**: `shotgunThreshold` planned but not in `AnalysisOptions`/CLI. SDP `minDelta` hardcoded. `unbounded-collection` has no threshold config.
|
|
21
|
+
- **Semantic underperformance**: 6 of 12 semantic detectors produce 0 findings due to strict prerequisites. Confidence is always "low" because `inferAnalysisLens` doesn't recognize semantic categories.
|
|
22
|
+
- **Documentation drift**: `finding-categories.md` missing `mega-folder`, documents `redundant-re-export`/`redundant-comment` without implementations. `PILLAR_CATEGORIES` missing `message-chain`, `debug-log-leakage`, `sensitive-data-logging`. `concepts.md` missing abstractness, distance D, LCOM, hot-file scoring. Code Mode has no LSP fallback.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 3. Detailed Fixes
|
|
27
|
+
|
|
28
|
+
### Fix 1: God-function detector — add MI as secondary trigger
|
|
29
|
+
|
|
30
|
+
**File**: `src/detectors/cohesion.ts:170-214`
|
|
31
|
+
**Problem**: Only triggers on `statementCount > 100`. A function with 20 top-level statements but MI=1.4 escapes detection.
|
|
32
|
+
**Fix**: Add secondary condition: fire if `fn.maintainabilityIndex !== undefined && fn.maintainabilityIndex < options.godFunctionMiThreshold` (default 10). This catches orchestration-heavy functions with collapsed MI.
|
|
33
|
+
|
|
34
|
+
**Files to change**:
|
|
35
|
+
- `src/types/constants.ts` — add `godFunctionMiThreshold: 10` to `DEFAULT_OPTS`
|
|
36
|
+
- `src/types/interfaces.ts` — add `godFunctionMiThreshold` to `AnalysisOptions`
|
|
37
|
+
- `src/pipeline/cli.ts` — add `--god-function-mi-threshold` flag
|
|
38
|
+
- `src/detectors/cohesion.ts` — add MI check in `detectGodFunctions`
|
|
39
|
+
- `src/index.ts` — pass `options.godFunctionMiThreshold` to detector
|
|
40
|
+
- `scripts/` — rebuild after TS changes
|
|
41
|
+
|
|
42
|
+
### Fix 2: Unbounded-collection — require collection mutation evidence
|
|
43
|
+
|
|
44
|
+
**File**: `src/detectors/code-quality.ts:794-826`
|
|
45
|
+
**Problem**: Fires on any function with `loops >= 2 && calls >= 5 && maxLoopDepth >= 2` — purely structural, no collection evidence.
|
|
46
|
+
**Fix**:
|
|
47
|
+
1. Add heuristic: function must also contain `.push(`, `.set(`, `.add(`, or array/map literal + loop pattern.
|
|
48
|
+
2. Add configurable thresholds to `AnalysisOptions` and CLI.
|
|
49
|
+
3. The collector already has `fn.effects` — check for collection-mutation effects.
|
|
50
|
+
|
|
51
|
+
**Files to change**:
|
|
52
|
+
- `src/detectors/code-quality.ts` — refine detection logic to check `fn.effects` or AST patterns
|
|
53
|
+
- `src/types/constants.ts` — add `unboundedCollectionMinLoops: 2` etc. to `DEFAULT_OPTS`
|
|
54
|
+
- `src/types/interfaces.ts` — add threshold to `AnalysisOptions`
|
|
55
|
+
- `src/pipeline/cli.ts` — add CLI flag
|
|
56
|
+
|
|
57
|
+
### Fix 3: Shotgun-surgery — add config surface + shared-utility allowlist
|
|
58
|
+
|
|
59
|
+
**File**: `src/detectors/semantic.ts:597-642`
|
|
60
|
+
**Problem**: Threshold 8 is hardcoded, not in CLI. Flags intentionally-shared utilities like `isTestFile`.
|
|
61
|
+
**Fix**:
|
|
62
|
+
1. Wire `shotgunThreshold` through `AnalysisOptions` → CLI (`--shotgun-threshold`).
|
|
63
|
+
2. Add `excludePattern` option to skip paths matching `**/common/**`, `**/utils/**`, `**/shared/**` (configurable).
|
|
64
|
+
3. Alternatively: raise default to 12 (current "high" boundary) to reduce noise on moderate sharing.
|
|
65
|
+
|
|
66
|
+
**Files to change**:
|
|
67
|
+
- `src/types/interfaces.ts` — add `shotgunThreshold` to `AnalysisOptions`
|
|
68
|
+
- `src/types/constants.ts` — add default
|
|
69
|
+
- `src/pipeline/cli.ts` — add `--shotgun-threshold`
|
|
70
|
+
- `src/pipeline/main.ts:213-215` — pass `options.shotgunThreshold` to `runSemanticDetectors`
|
|
71
|
+
- `src/detectors/semantic.ts` — accept utility-path exclusion
|
|
72
|
+
|
|
73
|
+
### Fix 4: SDP violation — expose `minDelta` + lower source-instability gate
|
|
74
|
+
|
|
75
|
+
**File**: `src/detectors/coupling.ts:17-71`
|
|
76
|
+
**Problem**: `minDelta=0.15` and `iSrc < 0.5` gate are hardcoded. Only 1 finding means most edges fail the source-stability check.
|
|
77
|
+
**Fix**: Add `sdpMinDelta` and `sdpMaxSourceInstability` to `AnalysisOptions`/CLI. Default `sdpMaxSourceInstability` to 0.6 (from 0.5) to widen the detection window slightly.
|
|
78
|
+
|
|
79
|
+
**Files to change**:
|
|
80
|
+
- `src/types/interfaces.ts` — add SDP options
|
|
81
|
+
- `src/types/constants.ts` — add defaults
|
|
82
|
+
- `src/pipeline/cli.ts` — add flags
|
|
83
|
+
- `src/detectors/coupling.ts` — parameterize
|
|
84
|
+
- `src/index.ts` — pass options
|
|
85
|
+
|
|
86
|
+
### Fix 5: Wire `detectSemanticDeadExports` into pipeline
|
|
87
|
+
|
|
88
|
+
**File**: `src/detectors/semantic.ts:735-756` (`runSemanticDetectors`)
|
|
89
|
+
**Problem**: `detectSemanticDeadExports` is defined (line 10-50) but **never called** from `runSemanticDetectors`.
|
|
90
|
+
**Fix**: Add `all.push(...detectSemanticDeadExports(profiles));` to `runSemanticDetectors`.
|
|
91
|
+
|
|
92
|
+
**Files to change**:
|
|
93
|
+
- `src/detectors/semantic.ts` — add call in `runSemanticDetectors`
|
|
94
|
+
|
|
95
|
+
### Fix 6: Wire `detectDeadFiles` into main scan
|
|
96
|
+
|
|
97
|
+
**File**: `src/detectors/cycle.ts:202-234`, `src/index.ts`
|
|
98
|
+
**Problem**: `detectDeadFiles` is implemented and tested but never called from the main scan.
|
|
99
|
+
**Fix**: Add call in `src/index.ts` alongside other dead-code detectors.
|
|
100
|
+
|
|
101
|
+
**Files to change**:
|
|
102
|
+
- `src/index.ts` — add `detectDeadFiles` call
|
|
103
|
+
- `src/types/constants.ts` — ensure `dead-file` is in `PILLAR_CATEGORIES['dead-code']`
|
|
104
|
+
|
|
105
|
+
### Fix 7: Semantic confidence — recognize semantic analysis lens
|
|
106
|
+
|
|
107
|
+
**File**: `src/reporting/analysis.ts:175-236`
|
|
108
|
+
**Problem**: `inferAnalysisLens` falls through to `'ast'` for all semantic categories. `defaultConfidence` then assigns `'low'` since `ast` + non-critical = low.
|
|
109
|
+
**Fix**:
|
|
110
|
+
1. Add semantic categories to `inferAnalysisLens` → return `'hybrid'` or new `'semantic'` lens.
|
|
111
|
+
2. In `defaultConfidence`, treat `'semantic'` lens as `'medium'` confidence.
|
|
112
|
+
|
|
113
|
+
**Files to change**:
|
|
114
|
+
- `src/reporting/analysis.ts` — add semantic category recognition in `inferAnalysisLens`, update `defaultConfidence`
|
|
115
|
+
- `src/types/interfaces.ts` — if adding `'semantic'` as a new `AnalysisLens` value
|
|
116
|
+
|
|
117
|
+
### Fix 8: PILLAR_CATEGORIES drift — add missing categories
|
|
118
|
+
|
|
119
|
+
**File**: `src/types/constants.ts:64-157`
|
|
120
|
+
**Problem**: `message-chain`, `debug-log-leakage`, `sensitive-data-logging` are emitted by detectors but missing from `PILLAR_CATEGORIES`, so they don't appear in pillar-specific JSON files.
|
|
121
|
+
**Fix**: Add missing categories to appropriate pillars.
|
|
122
|
+
|
|
123
|
+
**Files to change**:
|
|
124
|
+
- `src/types/constants.ts` — add `message-chain` to `code-quality`, add `debug-log-leakage` and `sensitive-data-logging` to `security`
|
|
125
|
+
|
|
126
|
+
### Fix 9: `finding-categories.md` — sync with actual detectors
|
|
127
|
+
|
|
128
|
+
**File**: `references/finding-categories.md`
|
|
129
|
+
**Problem**: Missing `mega-folder`. Documents `redundant-re-export` and `redundant-comment` which have no detector implementation.
|
|
130
|
+
**Fix**: Add `mega-folder`. Mark `redundant-re-export` and `redundant-comment` as "planned" or remove.
|
|
131
|
+
|
|
132
|
+
### Fix 10: `concepts.md` — add missing metrics
|
|
133
|
+
|
|
134
|
+
**File**: `references/concepts.md`
|
|
135
|
+
**Problem**: Missing abstractness (A), distance from main sequence (D), LCOM/low-cohesion, hot-file/risk scoring, cyclomatic density mismatch.
|
|
136
|
+
**Fix**: Add sections for each missing metric with formula and threshold. Fix cyclomatic density to reflect actual implementation (used inside MI and `function-optimization`, not as standalone category).
|
|
137
|
+
|
|
138
|
+
### Fix 11: SKILL.md Code Mode — add LSP fallback
|
|
139
|
+
|
|
140
|
+
**File**: `SKILL.md:240-278`
|
|
141
|
+
**Problem**: Code Mode Steps 1-2 and 5 reference LSP tools with no fallback.
|
|
142
|
+
**Fix**: Add "If LSP unavailable" bullet after Step 2 and Step 5, mirroring Audit Step 4 fallback (use `ast/search.js`, `localSearchCode`, scan JSON for dependency data, lower confidence).
|
|
143
|
+
|
|
144
|
+
### Fix 12: Test-quality / untested-critical cross-reference
|
|
145
|
+
|
|
146
|
+
**Problem**: `untested-critical-code` (graph-based, 25 findings) and `test-quality` (requires `testProfile` on test files) are orthogonal. Users see 25 untested modules but 100/100 test quality — confusing.
|
|
147
|
+
**Fix**:
|
|
148
|
+
1. In `summary.md` generation, add a note when `untested-critical-code > 0` but `test-quality` score is 100: "Test Quality reflects analyzed test files; see untested-critical-code for coverage gaps."
|
|
149
|
+
2. In SKILL.md Test Strategy mode, document that `--include-tests` is needed for test-quality findings.
|
|
150
|
+
|
|
151
|
+
**Files to change**:
|
|
152
|
+
- `src/reporting/summary-md.ts` — add conditional note in test-quality section
|
|
153
|
+
- `SKILL.md` — document `--include-tests` requirement in Test Strategy
|
|
154
|
+
|
|
155
|
+
### Fix 13: Dead re-export src/scripts inflation
|
|
156
|
+
|
|
157
|
+
**Problem**: 94 dead re-exports partly because `scripts/` JS mirror of `src/` TS inflates the count — both are scanned as separate module graphs.
|
|
158
|
+
**Fix**: Add `--exclude` flag to CLI (or respect `.octocoderc` ignorePatterns) so users can exclude `scripts/` from scans. This is already partially supported through `options.scope` but not as an exclusion pattern.
|
|
159
|
+
|
|
160
|
+
**Files to change**:
|
|
161
|
+
- `src/pipeline/cli.ts` — add `--exclude <pattern>` flag
|
|
162
|
+
- `src/types/interfaces.ts` — add `exclude` to `AnalysisOptions`
|
|
163
|
+
- `src/analysis/discovery.ts` — filter excluded paths in `collectFiles`
|
|
164
|
+
- `src/pipeline/main.ts` — apply exclude to dependency file collection
|
|
165
|
+
|
|
166
|
+
### Fix 14: improvement-roadmap.md — mark implemented items
|
|
167
|
+
|
|
168
|
+
**File**: `references/improvement-roadmap.md`
|
|
169
|
+
**Problem**: 302 lines with no status markers. Items like file cache, test-quality detectors, graph analytics, output versioning are done but not marked.
|
|
170
|
+
**Fix**: Add status column/badges: Done, In Progress, Planned. Remove or mark as aspirational items with no near-term plan (SARIF, mutation testing, persistent TS project service).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 4. Drawbacks
|
|
175
|
+
|
|
176
|
+
- **Fix 1 (MI threshold)**: MI can be unreliable for very small functions. The secondary trigger needs a minimum LOC guard (e.g. only fire MI check if `fn.lineCount > 30`).
|
|
177
|
+
- **Fix 2 (collection mutation)**: AST heuristic for `.push`/`.set` may miss wrapper patterns. False negatives are acceptable since the current 110-finding noise is worse.
|
|
178
|
+
- **Fix 7 (semantic lens)**: Adding `'semantic'` as a new lens value requires all consumers to handle it — check `graph.md` rendering, `summary-md.ts`, any external tooling.
|
|
179
|
+
- **Fix 13 (--exclude)**: Another CLI flag adds complexity. Could instead auto-detect `scripts/` as build output (check for matching filenames in `src/`).
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 5. Alternatives Considered
|
|
184
|
+
|
|
185
|
+
| Approach | Pros | Cons |
|
|
186
|
+
|----------|------|------|
|
|
187
|
+
| **A: Surgical fixes (this RFC)** | Targeted, low risk, each fix is independently testable | Doesn't address deeper architecture (e.g. detector plugin system) |
|
|
188
|
+
| **B: Detector plugin system** | Extensible, clean separation | Major refactor, delays all fixes, overkill for current need |
|
|
189
|
+
| **C: Config file (.octocoderc)** | Single place for all thresholds | Adds config-file discovery, parsing, validation complexity |
|
|
190
|
+
|
|
191
|
+
**Recommendation**: Option A. Each fix is 1-3 files, independently testable. Option C can be a follow-up RFC for threshold management.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 6. Implementation Plan
|
|
196
|
+
|
|
197
|
+
### Phase 1: Critical wiring fixes (no threshold changes)
|
|
198
|
+
|
|
199
|
+
| # | Fix | Files | Risk |
|
|
200
|
+
|---|-----|-------|------|
|
|
201
|
+
| 5 | Wire `detectSemanticDeadExports` | `semantic.ts` | Low |
|
|
202
|
+
| 6 | Wire `detectDeadFiles` | `index.ts`, `constants.ts` | Low |
|
|
203
|
+
| 8 | Fix `PILLAR_CATEGORIES` drift | `constants.ts` | Low |
|
|
204
|
+
| 7 | Semantic confidence/lens fix | `analysis.ts`, possibly `interfaces.ts` | Low |
|
|
205
|
+
|
|
206
|
+
### Phase 2: Threshold + config surface
|
|
207
|
+
|
|
208
|
+
| # | Fix | Files | Risk |
|
|
209
|
+
|---|-----|-------|------|
|
|
210
|
+
| 1 | God-function MI threshold | `cohesion.ts`, `constants.ts`, `interfaces.ts`, `cli.ts`, `index.ts` | Medium |
|
|
211
|
+
| 3 | Shotgun-surgery config | `semantic.ts`, `interfaces.ts`, `constants.ts`, `cli.ts`, `main.ts` | Medium |
|
|
212
|
+
| 4 | SDP config exposure | `coupling.ts`, `interfaces.ts`, `constants.ts`, `cli.ts`, `index.ts` | Low |
|
|
213
|
+
| 2 | Unbounded-collection refinement | `code-quality.ts`, `constants.ts`, `interfaces.ts`, `cli.ts` | Medium |
|
|
214
|
+
| 13 | `--exclude` flag | `cli.ts`, `interfaces.ts`, `discovery.ts`, `main.ts` | Medium |
|
|
215
|
+
|
|
216
|
+
### Phase 3: Documentation
|
|
217
|
+
|
|
218
|
+
| # | Fix | Files | Risk |
|
|
219
|
+
|---|-----|-------|------|
|
|
220
|
+
| 9 | `finding-categories.md` sync | `references/finding-categories.md` | None |
|
|
221
|
+
| 10 | `concepts.md` expansion | `references/concepts.md` | None |
|
|
222
|
+
| 11 | Code Mode LSP fallback | `SKILL.md` | None |
|
|
223
|
+
| 12 | Test-quality cross-reference | `summary-md.ts`, `SKILL.md` | Low |
|
|
224
|
+
| 14 | Roadmap status update | `references/improvement-roadmap.md` | None |
|
|
225
|
+
|
|
226
|
+
### Verification
|
|
227
|
+
|
|
228
|
+
After each phase:
|
|
229
|
+
1. `yarn build` — compile succeeds
|
|
230
|
+
2. `yarn test` — all tests pass
|
|
231
|
+
3. `node scripts/index.js --graph --flow --semantic` — re-scan self, verify:
|
|
232
|
+
- Phase 1: `semantic-dead-export` > 0, `dead-file` appears, semantic confidence upgrades
|
|
233
|
+
- Phase 2: `unbounded-collection` count drops, `god-function` detects MI-collapsed functions
|
|
234
|
+
- Phase 3: docs pass manual review
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 7. References
|
|
239
|
+
|
|
240
|
+
### Local code evidence
|
|
241
|
+
- `src/detectors/cohesion.ts:170-214` — god-function detector
|
|
242
|
+
- `src/detectors/code-quality.ts:794-826` — unbounded-collection detector
|
|
243
|
+
- `src/detectors/semantic.ts:597-642` — shotgun-surgery detector
|
|
244
|
+
- `src/detectors/semantic.ts:10-50` — semantic-dead-export (unwired)
|
|
245
|
+
- `src/detectors/semantic.ts:735-756` — `runSemanticDetectors` (missing calls)
|
|
246
|
+
- `src/detectors/cycle.ts:202-234` — `detectDeadFiles` (unwired)
|
|
247
|
+
- `src/detectors/coupling.ts:17-71` — SDP violation detector
|
|
248
|
+
- `src/reporting/analysis.ts:175-236` — `inferAnalysisLens` + `defaultConfidence`
|
|
249
|
+
- `src/types/constants.ts:64-157` — `PILLAR_CATEGORIES`
|
|
250
|
+
- `src/pipeline/cache.ts:23-42` — cache load/invalidation
|
|
251
|
+
- `src/pipeline/main.ts:505-522` — scope + features interaction
|
|
252
|
+
- `references/finding-categories.md` — category documentation
|
|
253
|
+
- `references/concepts.md` — metric definitions
|
|
254
|
+
- `references/improvement-roadmap.md` — planned features
|
|
255
|
+
- `SKILL.md:240-278` — Code Mode (no LSP fallback)
|