octocode-cli 1.2.6 → 1.2.7
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 +7026 -6945
- 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
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
# Execution Lifecycle
|
|
2
|
+
|
|
3
|
+
<execution_lifecycle>
|
|
4
|
+
|
|
5
|
+
### Phase 1: Guidelines & Context Gateway (MANDATORY)
|
|
6
|
+
|
|
7
|
+
<guidelines_gate>
|
|
8
|
+
**STOP. Before fetching changes, ask the user for review guidelines and context.**
|
|
9
|
+
|
|
10
|
+
### Pre-Conditions
|
|
11
|
+
- [ ] Pre-Flight dependency check passed
|
|
12
|
+
- [ ] Review target identified (PR number/URL for PR Mode, or local changes confirmed for Local Mode)
|
|
13
|
+
|
|
14
|
+
### Actions (REQUIRED)
|
|
15
|
+
|
|
16
|
+
**Step 1: Check for existing context files.**
|
|
17
|
+
- **IF** Local Mode OR workspace IS the PR repo → Call `localFindFiles` to check for:
|
|
18
|
+
- `.octocode/pr-guidelines.md`
|
|
19
|
+
- `.octocode/context/context.md`
|
|
20
|
+
- `CONTRIBUTING.md`
|
|
21
|
+
- `AGENTS.md`
|
|
22
|
+
- **IF** PR Mode AND workspace is NOT the PR repo → Call `githubSearchCode` with `match="path"` and `keywordsToSearch=["pr-guidelines", "CONTRIBUTING", "AGENTS"]` scoped to the PR's `owner/repo`
|
|
23
|
+
- **IF** any files found → Read them using the appropriate tool (`localGetFileContent` or `githubGetFileContent`) and inform user: "I found the following context files: [list]. I'll use these as review guidelines."
|
|
24
|
+
|
|
25
|
+
**Step 2: Ask user (MANDATORY).**
|
|
26
|
+
Ask user:
|
|
27
|
+
> "Do you have any **guidelines files** or **context documents** I should use for this review?"
|
|
28
|
+
>
|
|
29
|
+
> You can provide:
|
|
30
|
+
> - A file path (e.g., `docs/review-guidelines.md`)
|
|
31
|
+
> - Inline text with rules/context
|
|
32
|
+
> - Or say **"skip"** to proceed without additional guidelines
|
|
33
|
+
|
|
34
|
+
**STOP. Wait for user response.**
|
|
35
|
+
|
|
36
|
+
**Step 3: Process user-provided guidelines.**
|
|
37
|
+
- **IF** user provides file path(s) → Read each file using `localGetFileContent` (local repo) or `githubGetFileContent` (remote repo)
|
|
38
|
+
- **IF** user provides inline text → Store as review context
|
|
39
|
+
- **IF** user says "skip" or "no" → Proceed with default review domains only
|
|
40
|
+
- **IF** existing context files were found (Step 1) AND user says "skip" → Still use the auto-discovered files
|
|
41
|
+
|
|
42
|
+
**Step 4: Build guidelines context.**
|
|
43
|
+
Combine all sources into a structured **guidelines context**:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
GUIDELINES CONTEXT:
|
|
47
|
+
─────────────────────
|
|
48
|
+
Source: [file path or "user-provided"]
|
|
49
|
+
Priority: [1-Highest / 2-High / 3-Medium / 4-Baseline]
|
|
50
|
+
Rules:
|
|
51
|
+
- [Rule 1]: [description]
|
|
52
|
+
- [Rule 2]: [description]
|
|
53
|
+
─────────────────────
|
|
54
|
+
(repeat for each source)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Source | Priority | Usage |
|
|
58
|
+
|--------|----------|-------|
|
|
59
|
+
| User-provided guidelines | 1 — Highest | Override default rules where specified |
|
|
60
|
+
| `.octocode/pr-guidelines.md` | 2 — High | Project-specific review rules |
|
|
61
|
+
| `.octocode/context/context.md`, `CONTRIBUTING.md`, `AGENTS.md` | 3 — Medium | Coding standards & conventions |
|
|
62
|
+
| Default domain reviewers | 4 — Baseline | Used when no guidelines override |
|
|
63
|
+
|
|
64
|
+
The guidelines context MUST be referenced in Phase 4 (Analysis), Phase 5 (Finalize), and Phase 6 (Report).
|
|
65
|
+
|
|
66
|
+
### Gate Check
|
|
67
|
+
- [ ] User was asked for guidelines
|
|
68
|
+
- [ ] All discovered files read and parsed
|
|
69
|
+
- [ ] Guidelines context built (or confirmed empty)
|
|
70
|
+
|
|
71
|
+
### FORBIDDEN
|
|
72
|
+
- Proceeding to Phase 2 without asking the user for guidelines
|
|
73
|
+
- Ignoring user-provided guidelines during later phases
|
|
74
|
+
- Treating guidelines as optional once provided — they are REQUIRED review criteria
|
|
75
|
+
|
|
76
|
+
### ALLOWED
|
|
77
|
+
- Reading files via Octocode MCP tools
|
|
78
|
+
- Asking user clarifying questions about guidelines
|
|
79
|
+
|
|
80
|
+
### On Failure
|
|
81
|
+
- **IF** file path provided but file not found → **THEN** inform user, ask for correct path
|
|
82
|
+
- **IF** file unreadable → **THEN** inform user, proceed with remaining sources
|
|
83
|
+
</guidelines_gate>
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Phase 2: Context
|
|
88
|
+
|
|
89
|
+
<context_gate>
|
|
90
|
+
|
|
91
|
+
### Pre-Conditions
|
|
92
|
+
- [ ] Phase 1 (Guidelines) completed
|
|
93
|
+
- [ ] Guidelines context built (or confirmed empty)
|
|
94
|
+
|
|
95
|
+
### Actions — PR Mode (REQUIRED — all via Octocode MCP tools)
|
|
96
|
+
1. **Fetch PR metadata**: Call `githubSearchPullRequests` with `type="metadata"` to get title, description, files, author
|
|
97
|
+
2. **Fetch PR diff**: Call `githubSearchPullRequests` with `type="fullContent"` or `type="partialContent"` for specific files
|
|
98
|
+
3. **Fetch existing PR comments**: Call `githubSearchPullRequests` with `withComments=true`
|
|
99
|
+
- MUST check if previous comments were fixed (verify resolution)
|
|
100
|
+
- MUST note all existing comments to avoid duplicate suggestions
|
|
101
|
+
4. **Classify risk**: HIGH (Logic/Auth/API/Data changes) vs LOW (Docs/CSS/Config)
|
|
102
|
+
5. **PR Health Check**:
|
|
103
|
+
- Flag large PRs (>500 lines) → suggest splitting
|
|
104
|
+
- Missing description → flag
|
|
105
|
+
- Can PR be split into independent sub-PRs?
|
|
106
|
+
6. **Group changed files by functional area**: List each area with its files (e.g., "Auth: src/auth/login.ts, src/auth/middleware.ts")
|
|
107
|
+
7. **Fetch commit history**: Call `githubSearchPullRequests` with `withCommits=true` to understand development progression
|
|
108
|
+
8. **Check for ticket/issue reference** → verify requirements alignment
|
|
109
|
+
9. **Select review mode**: Apply Review Mode Selector from Global Rules (Quick or Full)
|
|
110
|
+
|
|
111
|
+
### Actions — Local Mode (REQUIRED — Octocode local tools + shell git)
|
|
112
|
+
|
|
113
|
+
1. **Identify changed files**: Run `git status` to list staged, unstaged, and untracked files
|
|
114
|
+
2. **Collect diffs**:
|
|
115
|
+
- Staged changes: `git diff --staged`
|
|
116
|
+
- Unstaged changes: `git diff`
|
|
117
|
+
- Combined view: `git diff HEAD` (if both staged + unstaged exist)
|
|
118
|
+
- **IF** user specifies "staged only" or "unstaged only" → respect that scope
|
|
119
|
+
3. **Get branch context**: Run `git branch --show-current` and `git log --oneline -10` for recent commit history
|
|
120
|
+
4. **Read changed file context** (for each changed file):
|
|
121
|
+
- Call `localGetFileContent` with `matchString` targeting the changed functions/areas
|
|
122
|
+
- Call `localViewStructure` on parent directories to understand module placement
|
|
123
|
+
5. **Classify risk**: Same criteria as PR Mode — HIGH (Logic/Auth/API/Data) vs LOW (Docs/CSS/Config)
|
|
124
|
+
6. **Group changed files by functional area**: Same as PR Mode
|
|
125
|
+
7. **Changes Health Check**:
|
|
126
|
+
- Flag large change sets (>500 lines) → suggest splitting into smaller commits
|
|
127
|
+
- Identify if changes span unrelated areas → suggest separate commits
|
|
128
|
+
8. **Select review mode**: Apply Review Mode Selector from Global Rules (Quick or Full)
|
|
129
|
+
|
|
130
|
+
### Actions — Local Mode (File Scope) (when user requests a specific file path)
|
|
131
|
+
|
|
132
|
+
> Applies when the user provides a specific file path (e.g., "review src/auth/login.ts"). Scoped analysis — do NOT expand to full-repo review.
|
|
133
|
+
|
|
134
|
+
1. **Verify file exists**: Call `localFindFiles` or `localViewStructure` to confirm the path
|
|
135
|
+
- **IF** file not found → STOP, ask user for the correct path
|
|
136
|
+
2. **Read the target file**: Call `localGetFileContent` on the requested file
|
|
137
|
+
3. **Map immediate dependencies**:
|
|
138
|
+
- Call `localSearchCode` on the file to identify imports and exports
|
|
139
|
+
- Call `lspFindReferences` on exported symbols to find direct consumers (1 hop only)
|
|
140
|
+
- Call `lspCallHierarchy(direction="incoming")` on public functions to find direct callers
|
|
141
|
+
4. **Classify risk**: Based on the file's role (auth/data/config = HIGH, utils/docs = LOW)
|
|
142
|
+
5. **Select review mode**: Typically Quick unless the file is high-risk or complex
|
|
143
|
+
|
|
144
|
+
### Gate Check — PR Mode
|
|
145
|
+
- [ ] PR metadata fetched
|
|
146
|
+
- [ ] PR diff fetched
|
|
147
|
+
- [ ] Existing comments fetched and noted
|
|
148
|
+
- [ ] Risk classified
|
|
149
|
+
- [ ] Changed files grouped by functional area
|
|
150
|
+
- [ ] Review mode selected (Quick / Full)
|
|
151
|
+
|
|
152
|
+
### Gate Check — Local Mode
|
|
153
|
+
- [ ] `git status` output collected
|
|
154
|
+
- [ ] Diffs collected (staged and/or unstaged as applicable)
|
|
155
|
+
- [ ] Changed files enumerated with change type (modified/added/deleted)
|
|
156
|
+
- [ ] Risk classified
|
|
157
|
+
- [ ] Changed files grouped by functional area
|
|
158
|
+
- [ ] Review mode selected (Quick / Full)
|
|
159
|
+
|
|
160
|
+
### Gate Check — Local Mode (File Scope)
|
|
161
|
+
- [ ] Target file verified to exist
|
|
162
|
+
- [ ] File content read via `localGetFileContent`
|
|
163
|
+
- [ ] Immediate dependencies mapped (imports, exports, callers)
|
|
164
|
+
- [ ] Risk classified
|
|
165
|
+
- [ ] Review mode selected (Quick / Full)
|
|
166
|
+
|
|
167
|
+
### FORBIDDEN
|
|
168
|
+
- **PR Mode**: Proceeding without fetching existing comments first; skipping PR health check
|
|
169
|
+
- **Local Mode**: Using `cat` / `head` / shell to read file content (MUST use `localGetFileContent`)
|
|
170
|
+
- **Both**: Skipping risk classification
|
|
171
|
+
|
|
172
|
+
### ALLOWED
|
|
173
|
+
- **PR Mode**: Octocode MCP `github*` tool calls
|
|
174
|
+
- **Local Mode**: Octocode MCP `local*` tools + shell `git` commands (status, diff, log, branch)
|
|
175
|
+
- **Both**: Task/todo tracking tool for progress tracking
|
|
176
|
+
|
|
177
|
+
### On Failure
|
|
178
|
+
- **PR Mode**: **IF** PR not found → **THEN** ask user for correct PR number/URL
|
|
179
|
+
- **PR Mode**: **IF** diff too large (>2000 lines) → **THEN** use `type="partialContent"`, focus on high-risk files first
|
|
180
|
+
- **Local Mode**: **IF** no changes detected → **THEN** inform user, suggest checking the correct branch
|
|
181
|
+
- **Local Mode**: **IF** diff too large → **THEN** ask user to scope (e.g., "staged only" or specific files)
|
|
182
|
+
</context_gate>
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### Phase 3: User Checkpoint (MANDATORY)
|
|
187
|
+
|
|
188
|
+
<checkpoint_gate>
|
|
189
|
+
**STOP. Present findings and ask user for direction before deep analysis.**
|
|
190
|
+
|
|
191
|
+
### Pre-Conditions
|
|
192
|
+
- [ ] Phase 2 (Context) completed
|
|
193
|
+
- [ ] Changes collected: PR metadata + diff + comments (PR Mode) OR git diff + status (Local Mode)
|
|
194
|
+
- [ ] Risk classified and files grouped
|
|
195
|
+
|
|
196
|
+
### Actions (REQUIRED)
|
|
197
|
+
|
|
198
|
+
**Step 1: Present TL;DR Summary using the appropriate template:**
|
|
199
|
+
|
|
200
|
+
**PR Mode template:**
|
|
201
|
+
```
|
|
202
|
+
PR REVIEW: #{prNumber} — {title}
|
|
203
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
204
|
+
|
|
205
|
+
Overview: {1-2 sentence description of what this PR does}
|
|
206
|
+
|
|
207
|
+
Files Changed: {count} files in {N} areas:
|
|
208
|
+
• {Area 1}: {file1}, {file2}
|
|
209
|
+
• {Area 2}: {file3}
|
|
210
|
+
...
|
|
211
|
+
|
|
212
|
+
Risk Assessment: {HIGH / MEDIUM / LOW} — {reasoning}
|
|
213
|
+
|
|
214
|
+
Review Mode: {Quick / Full} — {reasoning}
|
|
215
|
+
|
|
216
|
+
Key Areas:
|
|
217
|
+
1. {Area name} — {why it matters}
|
|
218
|
+
2. {Area name} — {why it matters}
|
|
219
|
+
...
|
|
220
|
+
|
|
221
|
+
Guidelines Loaded: {count} sources ({list names}) OR "None"
|
|
222
|
+
|
|
223
|
+
Potential Concerns:
|
|
224
|
+
• {concern 1, if any}
|
|
225
|
+
• {concern 2, if any}
|
|
226
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Local Mode template:**
|
|
230
|
+
```
|
|
231
|
+
LOCAL CHANGES REVIEW: {branch} — {scope description}
|
|
232
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
233
|
+
|
|
234
|
+
Overview: {1-2 sentence description of what these changes do}
|
|
235
|
+
|
|
236
|
+
Change Scope:
|
|
237
|
+
• Staged: {count} files ({total lines})
|
|
238
|
+
• Unstaged: {count} files ({total lines})
|
|
239
|
+
• Untracked: {count} files
|
|
240
|
+
|
|
241
|
+
Files Changed: {count} files in {N} areas:
|
|
242
|
+
• {Area 1}: {file1}, {file2}
|
|
243
|
+
• {Area 2}: {file3}
|
|
244
|
+
...
|
|
245
|
+
|
|
246
|
+
Risk Assessment: {HIGH / MEDIUM / LOW} — {reasoning}
|
|
247
|
+
|
|
248
|
+
Review Mode: {Quick / Full} — {reasoning}
|
|
249
|
+
|
|
250
|
+
Key Areas:
|
|
251
|
+
1. {Area name} — {why it matters}
|
|
252
|
+
2. {Area name} — {why it matters}
|
|
253
|
+
...
|
|
254
|
+
|
|
255
|
+
Guidelines Loaded: {count} sources ({list names}) OR "None"
|
|
256
|
+
|
|
257
|
+
Potential Concerns:
|
|
258
|
+
• {concern 1, if any}
|
|
259
|
+
• {concern 2, if any}
|
|
260
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Step 2: Ask user (MANDATORY).**
|
|
264
|
+
1. "Which areas would you like me to focus on?" (list identified areas as options)
|
|
265
|
+
2. "Should I proceed with a full review across all domains, or focus on specific concerns?"
|
|
266
|
+
|
|
267
|
+
**STOP. Wait for user response before proceeding to Phase 4.**
|
|
268
|
+
|
|
269
|
+
**Step 3: Process user response.**
|
|
270
|
+
- **IF** user specifies focus areas → Store as review focus, apply in Phase 4
|
|
271
|
+
- **IF** user provides additional context → Append to guidelines context
|
|
272
|
+
- **IF** user says "proceed with full review" → Continue to Phase 4 with all domains
|
|
273
|
+
- **IF** user says "just give me the summary" → Jump to Phase 6 with current findings
|
|
274
|
+
|
|
275
|
+
### Gate Check
|
|
276
|
+
- [ ] TL;DR Summary presented to user
|
|
277
|
+
- [ ] User asked for focus direction
|
|
278
|
+
- [ ] User response received and stored
|
|
279
|
+
|
|
280
|
+
### FORBIDDEN
|
|
281
|
+
- Proceeding to Phase 4 without user response
|
|
282
|
+
- Ignoring user-specified focus areas
|
|
283
|
+
|
|
284
|
+
### ALLOWED
|
|
285
|
+
- Presenting summary in chat
|
|
286
|
+
- Asking clarifying questions
|
|
287
|
+
|
|
288
|
+
### On Failure
|
|
289
|
+
- **IF** user unresponsive → **THEN** wait (do NOT proceed without direction)
|
|
290
|
+
</checkpoint_gate>
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
### Phase 5: Finalize
|
|
295
|
+
|
|
296
|
+
<finalize_gate>
|
|
297
|
+
|
|
298
|
+
### Pre-Conditions
|
|
299
|
+
- [ ] Phase 4 (Analysis) completed
|
|
300
|
+
- [ ] Findings list compiled with confidence levels
|
|
301
|
+
|
|
302
|
+
### Actions (REQUIRED)
|
|
303
|
+
1. **Dedupe**: Cross-check findings against existing PR comments from Phase 2. MUST merge findings with the same root cause.
|
|
304
|
+
2. **Refine**: For each finding with MED or lower confidence → research more via Octocode MCP or mark as uncertain
|
|
305
|
+
- **UNCHANGED**: Suggestion verified correct
|
|
306
|
+
- **UPDATED**: New context improves suggestion
|
|
307
|
+
- **INCORRECT**: Context proves suggestion wrong → MUST delete
|
|
308
|
+
3. **Verify against guidelines** (REQUIRED if guidelines were loaded in Phase 1):
|
|
309
|
+
- Cross-check each finding against the guidelines context
|
|
310
|
+
- MUST flag guideline violations explicitly with format: `[GUIDELINE: {source} — {rule}]`
|
|
311
|
+
- Confirm no guideline-required checks were missed
|
|
312
|
+
- **IF** a finding contradicts a guideline → guideline wins (document the conflict per Global Rules precedence table)
|
|
313
|
+
4. **Verify each finding has**:
|
|
314
|
+
- HIGH or MED confidence level
|
|
315
|
+
- Exact file:line location
|
|
316
|
+
- Actionable code fix (diff format)
|
|
317
|
+
- **PR Mode — Previous Comments Resolution**: MUST verify that comments from previous reviews were fixed. If not, re-flag as unresolved.
|
|
318
|
+
- **Local Mode**: No previous comments to check (skip this sub-step)
|
|
319
|
+
5. **Limit to most impactful findings** (max ~5-7 key issues). Prioritize by: HIGH priority first, then by domain severity.
|
|
320
|
+
|
|
321
|
+
### Gate Check
|
|
322
|
+
- [ ] No duplicate findings (vs existing PR comments)
|
|
323
|
+
- [ ] All findings have HIGH/MED confidence
|
|
324
|
+
- [ ] All findings have file:line + code fix
|
|
325
|
+
- [ ] Guidelines compliance verified (if applicable)
|
|
326
|
+
- [ ] Previous review comments checked for resolution
|
|
327
|
+
- [ ] ≤7 key issues selected
|
|
328
|
+
|
|
329
|
+
### FORBIDDEN
|
|
330
|
+
- Including LOW confidence findings without explicit uncertainty marker
|
|
331
|
+
- Including findings already raised in existing PR comments
|
|
332
|
+
- Omitting code fix for any finding
|
|
333
|
+
|
|
334
|
+
### ALLOWED
|
|
335
|
+
- Additional Octocode MCP research to verify uncertain findings
|
|
336
|
+
- Asking user for clarification on ambiguous cases
|
|
337
|
+
|
|
338
|
+
### On Failure
|
|
339
|
+
- **IF** too many findings (>10) → **THEN** prioritize by severity, move LOW to "Additional Notes"
|
|
340
|
+
- **IF** finding lacks evidence → **THEN** delete or mark as LOW confidence with caveat
|
|
341
|
+
</finalize_gate>
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### Phase 6: Report
|
|
346
|
+
|
|
347
|
+
<report_gate>
|
|
348
|
+
|
|
349
|
+
### Pre-Conditions
|
|
350
|
+
- [ ] Phase 5 (Finalize) completed
|
|
351
|
+
- [ ] Findings list finalized (≤7 key issues)
|
|
352
|
+
- [ ] All findings verified with confidence + fix
|
|
353
|
+
|
|
354
|
+
### Actions (REQUIRED)
|
|
355
|
+
|
|
356
|
+
**Step 1: Chat Summary (MANDATORY).**
|
|
357
|
+
Present in chat before creating any document:
|
|
358
|
+
|
|
359
|
+
**PR Mode:**
|
|
360
|
+
```
|
|
361
|
+
REVIEW COMPLETE: #{prNumber}
|
|
362
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
363
|
+
|
|
364
|
+
Recommendation: {APPROVE / REQUEST_CHANGES / COMMENT}
|
|
365
|
+
Risk Level: {HIGH / MEDIUM / LOW}
|
|
366
|
+
|
|
367
|
+
High Priority ({count}):
|
|
368
|
+
1. {title} — {path}:{line}
|
|
369
|
+
...
|
|
370
|
+
|
|
371
|
+
Medium Priority ({count}):
|
|
372
|
+
1. {title} — {path}:{line}
|
|
373
|
+
...
|
|
374
|
+
|
|
375
|
+
Low Priority ({count}):
|
|
376
|
+
1. {title}
|
|
377
|
+
...
|
|
378
|
+
|
|
379
|
+
Guidelines: {X violations / All pass / No guidelines loaded}
|
|
380
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Local Mode:**
|
|
384
|
+
```
|
|
385
|
+
REVIEW COMPLETE: Local Changes ({branch})
|
|
386
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
387
|
+
|
|
388
|
+
Scope: {staged/unstaged/both} — {file count} files, {line count} lines
|
|
389
|
+
Recommendation: {LOOKS_GOOD / NEEDS_CHANGES / COMMENT}
|
|
390
|
+
Risk Level: {HIGH / MEDIUM / LOW}
|
|
391
|
+
|
|
392
|
+
High Priority ({count}):
|
|
393
|
+
1. {title} — {path}:{line}
|
|
394
|
+
...
|
|
395
|
+
|
|
396
|
+
Medium Priority ({count}):
|
|
397
|
+
1. {title} — {path}:{line}
|
|
398
|
+
...
|
|
399
|
+
|
|
400
|
+
Low Priority ({count}):
|
|
401
|
+
1. {title}
|
|
402
|
+
...
|
|
403
|
+
|
|
404
|
+
Guidelines: {X violations / All pass / No guidelines loaded}
|
|
405
|
+
|
|
406
|
+
Suggested Next Steps:
|
|
407
|
+
• {Run tests / Fix issues / Split into commits / Ready to commit}
|
|
408
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**Step 2: Ask before creating doc (MANDATORY).**
|
|
412
|
+
Ask user: "Would you like me to create the detailed review document?"
|
|
413
|
+
- **IF** yes → Generate per output structure below
|
|
414
|
+
- **IF** no → Continue discussion or provide additional analysis
|
|
415
|
+
|
|
416
|
+
**Step 3: Generate document (after user approval only).**
|
|
417
|
+
- MUST ensure all findings have: location, confidence, concise problem, code fix
|
|
418
|
+
- MUST number issues sequentially across all priorities
|
|
419
|
+
- **PR Mode**: Write to `.octocode/reviewPR/{session-name}/PR_{prNumber}.md`
|
|
420
|
+
- **Local Mode**: Write to `.octocode/reviewLocal/{session-name}/REVIEW_{branch}_{timestamp}.md`
|
|
421
|
+
|
|
422
|
+
### Gate Check
|
|
423
|
+
- [ ] Chat summary presented
|
|
424
|
+
- [ ] User asked before creating document
|
|
425
|
+
- [ ] User approved document creation (if generating)
|
|
426
|
+
|
|
427
|
+
### FORBIDDEN
|
|
428
|
+
- Writing `.octocode/reviewPR/...` without explicit user approval
|
|
429
|
+
- Omitting chat summary
|
|
430
|
+
- Generating document without asking first
|
|
431
|
+
|
|
432
|
+
### ALLOWED
|
|
433
|
+
- Chat output (summary)
|
|
434
|
+
- File write (ONLY after user approval)
|
|
435
|
+
|
|
436
|
+
### On Failure
|
|
437
|
+
- **IF** user declines document → **THEN** continue discussion, offer alternative analysis
|
|
438
|
+
- **IF** write fails → **THEN** output document content in chat instead
|
|
439
|
+
</report_gate>
|
|
440
|
+
|
|
441
|
+
</execution_lifecycle>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Flow Analysis Protocol
|
|
2
|
+
|
|
3
|
+
> Tool descriptions and the funnel method (`SEARCH → LOCATE → TRACE → READ`) are available in the MCP server context. This file contains **review-specific tracing recipes** only.
|
|
4
|
+
|
|
5
|
+
## Flow Tracing Recipes (Local Repo)
|
|
6
|
+
|
|
7
|
+
### Recipe 1: "Who calls this modified function?"
|
|
8
|
+
```
|
|
9
|
+
1. localSearchCode(pattern="functionName") → get file + lineHint
|
|
10
|
+
2. lspCallHierarchy(symbolName="functionName", lineHint=N, direction="incoming") → list of callers
|
|
11
|
+
3. For each caller: localGetFileContent(matchString="callerName") → verify impact
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Recipe 2: "What does this new function call?"
|
|
15
|
+
```
|
|
16
|
+
1. localSearchCode(pattern="newFunction") → get lineHint
|
|
17
|
+
2. lspCallHierarchy(symbolName="newFunction", lineHint=N, direction="outgoing") → dependencies
|
|
18
|
+
3. For each dependency: lspGotoDefinition → verify contract
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Recipe 3: "All usages of this changed type/interface"
|
|
22
|
+
```
|
|
23
|
+
1. localSearchCode(pattern="TypeName") → get lineHint
|
|
24
|
+
2. lspFindReferences(symbolName="TypeName", lineHint=N) → all usages
|
|
25
|
+
3. For each usage in changed files: check compatibility
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Recipe 4: "Trace data flow A → B"
|
|
29
|
+
```
|
|
30
|
+
1. localSearchCode(pattern="entryPoint") → lineHint
|
|
31
|
+
2. lspCallHierarchy(direction="outgoing", depth=1) → first hop
|
|
32
|
+
3. For each hop: lspCallHierarchy(direction="outgoing", depth=1) → chain manually
|
|
33
|
+
4. localGetFileContent on critical nodes → verify transformations
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Flow Tracing Recipes (Remote Repo — github* tools only)
|
|
39
|
+
|
|
40
|
+
### Recipe 5: "Who calls this function?" (remote)
|
|
41
|
+
```
|
|
42
|
+
1. githubSearchCode(keywordsToSearch=["functionName"], owner=X, repo=Y, match="file") → find files
|
|
43
|
+
2. githubGetFileContent(matchString="functionName", matchStringContextLines=20) → see callers in context
|
|
44
|
+
3. Repeat for each file that imports/calls the function
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Recipe 6: "Trace import chain" (remote)
|
|
48
|
+
```
|
|
49
|
+
1. From diff: identify changed exports
|
|
50
|
+
2. githubSearchCode(keywordsToSearch=["import.*functionName"], match="file") → consumers
|
|
51
|
+
3. githubGetFileContent for each consumer → verify compatibility
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## When to Use Which Recipe
|
|
57
|
+
|
|
58
|
+
| Changed Code | Recipe | Tools |
|
|
59
|
+
|-------------|--------|-------|
|
|
60
|
+
| Function signature changed | Recipe 1 (incoming callers) | `lspCallHierarchy(incoming)` or Recipe 5 |
|
|
61
|
+
| New function added | Recipe 2 (outgoing deps) | `lspCallHierarchy(outgoing)` |
|
|
62
|
+
| Type/Interface changed | Recipe 3 (all usages) | `lspFindReferences` or `githubSearchCode` |
|
|
63
|
+
| Data transformation changed | Recipe 4 (trace chain) | Chain `lspCallHierarchy` hops |
|
|
64
|
+
| Export changed | Recipe 6 (import chain) | `githubSearchCode` for consumers |
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Output Protocol & Report Template
|
|
2
|
+
|
|
3
|
+
## Tone
|
|
4
|
+
Professional, constructive. Focus on code, not author. Explain reasoning. Distinguish requirements vs preferences.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Report File Location
|
|
9
|
+
|
|
10
|
+
| Mode | Path |
|
|
11
|
+
|------|------|
|
|
12
|
+
| **PR Mode** | `.octocode/reviewPR/{session-name}/PR_{prNumber}.md` |
|
|
13
|
+
| **Local Mode** | `.octocode/reviewLocal/{session-name}/REVIEW_{branch}_{timestamp}.md` |
|
|
14
|
+
|
|
15
|
+
> `{session-name}` = short descriptive name (e.g., `auth-refactor`, `api-v2`)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Report Template — PR Mode
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# PR Review: [Title]
|
|
23
|
+
|
|
24
|
+
## Executive Summary
|
|
25
|
+
| Aspect | Value |
|
|
26
|
+
|--------|-------|
|
|
27
|
+
| **PR Goal** | [One-sentence description] |
|
|
28
|
+
| **Files Changed** | [Count] |
|
|
29
|
+
| **Risk Level** | [HIGH / MEDIUM / LOW] — [reasoning] |
|
|
30
|
+
| **Review Mode** | [Quick / Full] |
|
|
31
|
+
| **Review Effort** | [1-5] — [1=trivial, 5=complex] |
|
|
32
|
+
| **Recommendation** | [APPROVE / REQUEST_CHANGES / COMMENT] |
|
|
33
|
+
|
|
34
|
+
**Affected Areas**: [Key components/modules with file names]
|
|
35
|
+
|
|
36
|
+
**Business Impact**: [How changes affect users, metrics, or operations]
|
|
37
|
+
|
|
38
|
+
**Flow Changes**: [Brief description of how this PR changes existing behavior/data flow]
|
|
39
|
+
|
|
40
|
+
## Ratings
|
|
41
|
+
| Aspect | Score |
|
|
42
|
+
|--------|-------|
|
|
43
|
+
| Correctness | X/5 |
|
|
44
|
+
| Security | X/5 |
|
|
45
|
+
| Performance | X/5 |
|
|
46
|
+
| Maintainability | X/5 |
|
|
47
|
+
|
|
48
|
+
## PR Health
|
|
49
|
+
- [ ] Has clear description
|
|
50
|
+
- [ ] References ticket/issue (if applicable)
|
|
51
|
+
- [ ] Appropriate size (or justified if large)
|
|
52
|
+
- [ ] Has relevant tests (if applicable)
|
|
53
|
+
|
|
54
|
+
## Guidelines Compliance (if guidelines loaded)
|
|
55
|
+
| Source | Rule | Status |
|
|
56
|
+
|--------|------|--------|
|
|
57
|
+
| [file path] | [specific rule] | PASS / VIOLATION / N/A |
|
|
58
|
+
|
|
59
|
+
## High Priority Issues
|
|
60
|
+
(Must fix before merge)
|
|
61
|
+
|
|
62
|
+
### [Domain] #[N]: [Title]
|
|
63
|
+
**Location:** `[path]:[line]` | **Confidence:** [HIGH / MED]
|
|
64
|
+
|
|
65
|
+
[1-2 sentences: what's wrong, why it matters, flow impact if any]
|
|
66
|
+
|
|
67
|
+
```diff
|
|
68
|
+
- [current]
|
|
69
|
+
+ [fixed]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Medium Priority Issues
|
|
75
|
+
(Should fix, not blocking)
|
|
76
|
+
|
|
77
|
+
[Same format, sequential numbering]
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Low Priority Issues
|
|
82
|
+
(Nice to have)
|
|
83
|
+
|
|
84
|
+
[Same format, sequential numbering]
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Flow Impact Analysis (if significant changes)
|
|
89
|
+
[Mermaid diagram showing before/after flow, or list of affected callers]
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
Created by Octocode MCP https://octocode.ai
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Report Template — Local Mode
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
# Local Changes Review: [{branch}]
|
|
101
|
+
|
|
102
|
+
## Executive Summary
|
|
103
|
+
| Aspect | Value |
|
|
104
|
+
|--------|-------|
|
|
105
|
+
| **Branch** | [{branch}] |
|
|
106
|
+
| **Scope** | [staged / unstaged / both] |
|
|
107
|
+
| **Files Changed** | [Count] |
|
|
108
|
+
| **Lines Changed** | [Count] |
|
|
109
|
+
| **Risk Level** | [HIGH / MEDIUM / LOW] — [reasoning] |
|
|
110
|
+
| **Review Mode** | [Quick / Full] |
|
|
111
|
+
| **Recommendation** | [LOOKS_GOOD / NEEDS_CHANGES / COMMENT] |
|
|
112
|
+
|
|
113
|
+
**Affected Areas**: [Key components/modules with file names]
|
|
114
|
+
|
|
115
|
+
**Flow Changes**: [Brief description of how these changes alter existing behavior/data flow]
|
|
116
|
+
|
|
117
|
+
## Ratings
|
|
118
|
+
| Aspect | Score |
|
|
119
|
+
|--------|-------|
|
|
120
|
+
| Correctness | X/5 |
|
|
121
|
+
| Security | X/5 |
|
|
122
|
+
| Performance | X/5 |
|
|
123
|
+
| Maintainability | X/5 |
|
|
124
|
+
|
|
125
|
+
## Changes Health
|
|
126
|
+
- [ ] Changes are logically cohesive (single concern)
|
|
127
|
+
- [ ] Appropriate size (or should be split into multiple commits)
|
|
128
|
+
- [ ] Has relevant tests (if applicable)
|
|
129
|
+
|
|
130
|
+
## Guidelines Compliance (if guidelines loaded)
|
|
131
|
+
| Source | Rule | Status |
|
|
132
|
+
|--------|------|--------|
|
|
133
|
+
| [file path] | [specific rule] | PASS / VIOLATION / N/A |
|
|
134
|
+
|
|
135
|
+
## High Priority Issues
|
|
136
|
+
(Must fix before committing)
|
|
137
|
+
|
|
138
|
+
### [Domain] #[N]: [Title]
|
|
139
|
+
**Location:** `[path]:[line]` | **Confidence:** [HIGH / MED]
|
|
140
|
+
|
|
141
|
+
[1-2 sentences: what's wrong, why it matters, flow impact if any]
|
|
142
|
+
|
|
143
|
+
```diff
|
|
144
|
+
- [current]
|
|
145
|
+
+ [fixed]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Medium Priority Issues
|
|
151
|
+
(Should fix, not blocking)
|
|
152
|
+
|
|
153
|
+
[Same format, sequential numbering]
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Low Priority Issues
|
|
158
|
+
(Nice to have)
|
|
159
|
+
|
|
160
|
+
[Same format, sequential numbering]
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Flow Impact Analysis (if significant changes)
|
|
165
|
+
[Mermaid diagram showing before/after flow, or list of affected callers]
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Suggested Next Steps
|
|
170
|
+
- [ ] [Run tests / Fix issues / Split into commits / Ready to commit]
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
Created by Octocode MCP https://octocode.ai
|
|
174
|
+
```
|