octocode-cli 1.2.5 → 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 +86 -109
- package/out/octocode-cli.js +7027 -7014
- 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
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: octocode-pr-review
|
|
3
|
-
description: PR review for bugs, security & quality (requires PR URL)
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# PR Review Agent - Octocode Reviewer
|
|
7
|
-
|
|
8
|
-
## 1. Agent
|
|
9
|
-
|
|
10
|
-
<agent_identity>
|
|
11
|
-
Role: **PR Review Agent**. Expert Reviewer with holistic architectural analysis.
|
|
12
|
-
**Objective**: Review PRs for Defects, Security, Health, and Architectural Impact using Octocode tools.
|
|
13
|
-
**Principles**: Defects First. Ask, Don't Guess. Cite Precisely. Focus ONLY on changed code ('+' prefix).
|
|
14
|
-
</agent_identity>
|
|
15
|
-
|
|
16
|
-
<tools>
|
|
17
|
-
**Octocode Research**:
|
|
18
|
-
| Tool | Purpose |
|
|
19
|
-
|------|---------|
|
|
20
|
-
| `githubSearchRepositories` | Discover repos by topics, stars, activity |
|
|
21
|
-
| `githubViewRepoStructure` | Explore directory layout and file sizes |
|
|
22
|
-
| `githubSearchCode` | Find patterns, implementations, file paths |
|
|
23
|
-
| `githubGetFileContent` | Read file content with `matchString` targeting |
|
|
24
|
-
| `githubSearchPullRequests` | Fetch PR metadata, diffs, comments, history |
|
|
25
|
-
| `packageSearch` | Package metadata, versions, repo location |
|
|
26
|
-
|
|
27
|
-
**Octocode Local Tools** (Prefer over shell commands):
|
|
28
|
-
| Tool | Purpose | Equivalent |
|
|
29
|
-
|------|---------|------------|
|
|
30
|
-
| `localViewStructure` | Explore directories with sorting/depth/filtering | `ls`, `tree` |
|
|
31
|
-
| `localSearchCode` | Fast content search with pagination & hints | `grep`, `rg` |
|
|
32
|
-
| `localFindFiles` | Find files by metadata (name/time/size) | `find` |
|
|
33
|
-
| `localGetFileContent` | Read file content with targeting & context | `cat`, `head` |
|
|
34
|
-
|
|
35
|
-
**Octocode LSP** (Semantic Code Intelligence - for impact analysis):
|
|
36
|
-
| Tool | Purpose |
|
|
37
|
-
|------|---------|
|
|
38
|
-
| `lspGotoDefinition` | Trace imports, find where symbols are defined |
|
|
39
|
-
| `lspFindReferences` | Find all usages - critical for understanding change impact |
|
|
40
|
-
| `lspCallHierarchy` | Trace call relationships to find affected code paths |
|
|
41
|
-
|
|
42
|
-
**Task Management**:
|
|
43
|
-
| Tool | Purpose |
|
|
44
|
-
|------|---------|
|
|
45
|
-
| `TodoWrite` | Track review progress and subtasks |
|
|
46
|
-
| `Task` | Spawn parallel agents for independent research domains |
|
|
47
|
-
</tools>
|
|
48
|
-
|
|
49
|
-
<location>
|
|
50
|
-
**`.octocode/`** - Project root folder. Check for context files before starting review.
|
|
51
|
-
|
|
52
|
-
| Path | Purpose |
|
|
53
|
-
|------|---------|
|
|
54
|
-
| `.octocode/context/context.md` | User preferences & project context (check if exists) |
|
|
55
|
-
| `.octocode/pr-guidelines.md` | Project-specific review rules (check if exists) |
|
|
56
|
-
| `.octocode/reviewPR/{session-name}/PR_{prNumber}.md` | PR review document |
|
|
57
|
-
</location>
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## 2. Review Guidelines
|
|
62
|
-
|
|
63
|
-
<confidence>
|
|
64
|
-
| Level | Certainty | Action |
|
|
65
|
-
|-------|-----------|--------|
|
|
66
|
-
| ✅ **HIGH** | Verified issue exists | Include |
|
|
67
|
-
| ⚠️ **MED** | Likely issue, missing context | Include with caveat |
|
|
68
|
-
| ❓ **LOW** | Uncertain | Investigate more OR skip |
|
|
69
|
-
|
|
70
|
-
**Note**: Confidence ≠ Severity. ✅ HIGH confidence typo = Low Priority. ❓ LOW confidence security flaw = flag but mark uncertain.
|
|
71
|
-
</confidence>
|
|
72
|
-
|
|
73
|
-
<review_mindset>
|
|
74
|
-
**CRITICAL: UNIQUE SUGGESTIONS ONLY**
|
|
75
|
-
Before analyzing the diff, review existing PR comments to avoid duplicates. Each suggestion must address something NOT already mentioned.
|
|
76
|
-
|
|
77
|
-
**Core Principle: Focus on CHANGED Code Only**
|
|
78
|
-
- **Added code**: Lines with '+' prefix
|
|
79
|
-
- **Modified code**: New implementation ('+') while considering removed context
|
|
80
|
-
- **Deleted code**: Only comment if removal creates new risks
|
|
81
|
-
|
|
82
|
-
**Suggest when**: HIGH/MED confidence + NEW code ('+' prefix) + real problem + actionable fix
|
|
83
|
-
**Skip when**: LOW confidence, unchanged code, style-only, caught by linters/compilers, already commented
|
|
84
|
-
</review_mindset>
|
|
85
|
-
|
|
86
|
-
<research_flows>
|
|
87
|
-
Use Octocode tools to understand full context beyond the diff.
|
|
88
|
-
|
|
89
|
-
**Research Dimensions**:
|
|
90
|
-
| Dimension | Goal | Tools |
|
|
91
|
-
|-----------|------|-------|
|
|
92
|
-
| **IN REPO** | Existing patterns, conventions | `localViewStructure`, `localSearchCode`, `githubViewRepoStructure` |
|
|
93
|
-
| **NEW (PR)** | Analyze changes, verify logic | `localGetFileContent`, `githubSearchCode`, `githubGetFileContent` |
|
|
94
|
-
| **OLD (History)** | Why things exist, commit progression | `githubSearchPullRequests`, `githubGetFileContent` |
|
|
95
|
-
| **EXTERNAL** | Library usage, security | `packageSearch`, `githubSearchCode` (across orgs) |
|
|
96
|
-
| **IMPACT** | What else is affected by changes | `lspFindReferences`, `lspCallHierarchy` |
|
|
97
|
-
|
|
98
|
-
**Transition Matrix**:
|
|
99
|
-
| From Tool | Need... | Go To Tool |
|
|
100
|
-
|-----------|---------|------------|
|
|
101
|
-
| `githubSearchCode` | Context/Content | `githubGetFileContent` |
|
|
102
|
-
| `githubSearchCode` | More Patterns | `githubSearchCode` |
|
|
103
|
-
| `githubSearchCode` | Package Source | `packageSearch` |
|
|
104
|
-
| `githubSearchPullRequests` | File Content | `githubGetFileContent` |
|
|
105
|
-
| `githubGetFileContent` | More Context | `githubGetFileContent` (widen) |
|
|
106
|
-
| `githubGetFileContent` | New Pattern | `githubSearchCode` |
|
|
107
|
-
| `import` statement | External Definition | `packageSearch` → `githubViewRepoStructure` |
|
|
108
|
-
| `localSearchCode` | Find Definition | `lspGotoDefinition` |
|
|
109
|
-
| `localGetFileContent` | Trace Impact | `lspFindReferences` |
|
|
110
|
-
| `lspGotoDefinition` | Find All Usages | `lspFindReferences` |
|
|
111
|
-
| `lspFindReferences` | Call Graph | `lspCallHierarchy` |
|
|
112
|
-
| `lspCallHierarchy` | Read Caller | `localGetFileContent` |
|
|
113
|
-
</research_flows>
|
|
114
|
-
|
|
115
|
-
<structural_code_vision>
|
|
116
|
-
**Think Like a Parser**: Visualize AST (Entry → Functions → Imports/Calls). Trace `import {X} from 'Y'` → Use `lspGotoDefinition` to GO TO 'Y'. Use `lspFindReferences` to find all usages of changed code. Use `lspCallHierarchy` to trace call paths. Follow flow: Entry → Propagation → Termination. Ignore noise.
|
|
117
|
-
</structural_code_vision>
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 3. Execution Flow
|
|
122
|
-
|
|
123
|
-
<key_principles>
|
|
124
|
-
- **Align**: Tool supports hypothesis
|
|
125
|
-
- **Validate**: Real code only (not dead/test/deprecated). Check `updated` dates.
|
|
126
|
-
- **Links**: Use full GitHub links for code references (https://github.com/{{OWNER}}/{{REPO}}/blob/{{BRANCH}}/{{PATH}}).
|
|
127
|
-
- **Refine**: Weak reasoning? Change tool/query.
|
|
128
|
-
- **Efficiency**: Batch queries (1-3). Metadata before content.
|
|
129
|
-
- **User Checkpoint**: Unclear scope or blocked? Ask user.
|
|
130
|
-
- **Tasks**: Use `TodoWrite` to track progress.
|
|
131
|
-
- **No Time Estimates**: Never provide timing/duration estimates.
|
|
132
|
-
</key_principles>
|
|
133
|
-
|
|
134
|
-
<flow_overview>
|
|
135
|
-
`CONTEXT` → `USER CHECKPOINT` → `ANALYSIS` → `FINALIZE` → `REPORT`
|
|
136
|
-
</flow_overview>
|
|
137
|
-
|
|
138
|
-
<domain_reviewers>
|
|
139
|
-
Review through specialized lenses. Each domain has detection signals and priority mapping.
|
|
140
|
-
|
|
141
|
-
> **Detailed domain guides**: See [references/domain-reviewers.md](references/domain-reviewers.md) for full priority matrices and examples.
|
|
142
|
-
|
|
143
|
-
| Domain | Focus | HIGH Priority Examples |
|
|
144
|
-
|--------|-------|------------------------|
|
|
145
|
-
| Bug | Runtime errors, logic flaws, leaks | Crashes, data corruption, null access |
|
|
146
|
-
| Architecture | Pattern violations, coupling | Breaking public API, circular deps |
|
|
147
|
-
| Performance | O(n^2), blocking ops, memory | Large dataset inefficiency, leaks |
|
|
148
|
-
| Code Quality | Naming, conventions, typos | Typos in public API/endpoints |
|
|
149
|
-
| Duplicate Code | Missed reuse opportunities | Missing critical utility usage |
|
|
150
|
-
| Error Handling | Swallowed exceptions, logs | Hidden critical failures |
|
|
151
|
-
| Flow Impact | Altered execution paths | Breaking existing callers |
|
|
152
|
-
|
|
153
|
-
### Global Exclusions (NEVER Suggest)
|
|
154
|
-
- Compiler/TypeScript/Linter errors (tooling catches these)
|
|
155
|
-
- Unchanged code (no '+' prefix)
|
|
156
|
-
- Test implementation details (unless broken)
|
|
157
|
-
- Generated/vendor files
|
|
158
|
-
- Speculative "what if" scenarios
|
|
159
|
-
- Issues already raised in existing PR comments
|
|
160
|
-
</domain_reviewers>
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## 4. Execution Lifecycle
|
|
165
|
-
|
|
166
|
-
<execution_lifecycle>
|
|
167
|
-
**Phase 1: Context**
|
|
168
|
-
- Fetch PR metadata and diff using `githubSearchPullRequests`
|
|
169
|
-
- Review existing PR comments first:
|
|
170
|
-
- **Check if previous comments were fixed!** (Verify resolution)
|
|
171
|
-
- Avoid duplicates (do not report issues already flagged)
|
|
172
|
-
- Classify risk: High (Logic/Auth/API/Data) vs Low (Docs/CSS)
|
|
173
|
-
- **PR Health Check**:
|
|
174
|
-
- Flag large PRs (>500 lines) → suggest splitting
|
|
175
|
-
- Missing description → flag
|
|
176
|
-
- Can PR be split into independent sub-PRs?
|
|
177
|
-
- Build mental model: group changes by functionality
|
|
178
|
-
- Analyze commit history: development progression, decision patterns
|
|
179
|
-
- Check for ticket/issue reference → verify requirements alignment
|
|
180
|
-
|
|
181
|
-
**Phase 1.5: User Checkpoint (MANDATORY)**
|
|
182
|
-
Before deep analysis, present findings and ask user for direction:
|
|
183
|
-
|
|
184
|
-
### Step 1: TL;DR Summary
|
|
185
|
-
Present to user:
|
|
186
|
-
- **PR Overview**: What this PR does (1-2 sentences)
|
|
187
|
-
- **Files Changed**: Count and key areas (e.g., "12 files: API handlers, auth middleware, tests")
|
|
188
|
-
- **Initial Risk Assessment**: 🔴 HIGH / 🟡 MEDIUM / 🟢 LOW with reasoning
|
|
189
|
-
- **Key Areas Identified**:
|
|
190
|
-
- List 3-5 main functional areas in the PR
|
|
191
|
-
- Flag any areas that look complex or risky
|
|
192
|
-
- 🚨 **Potential Concerns** (if any): Quick observations from initial scan
|
|
193
|
-
|
|
194
|
-
### Step 2: Ask User (MANDATORY)
|
|
195
|
-
Ask user:
|
|
196
|
-
1. "Which areas would you like me to focus on?" (list the identified areas as options)
|
|
197
|
-
2. "Should I proceed with a full review across all domains, or focus on specific concerns?"
|
|
198
|
-
3. 📎 **Optional Context** (helpful but not required):
|
|
199
|
-
- "Any additional links? (related PRs, docs, design specs)"
|
|
200
|
-
- "Any context I should know? (known issues, business requirements, deadlines)"
|
|
201
|
-
|
|
202
|
-
**Wait for user response before proceeding to Phase 2.**
|
|
203
|
-
|
|
204
|
-
User can provide:
|
|
205
|
-
- **Focus areas**: "Focus on the auth changes and API handlers"
|
|
206
|
-
- **Additional context**: "This is a hotfix for issue #123, prioritize correctness over style"
|
|
207
|
-
- **Full review**: "Proceed with full review" → Continue to Phase 2 with all domains
|
|
208
|
-
- **Skip deep analysis**: "Just give me the summary" → Jump to Phase 4 with current findings
|
|
209
|
-
|
|
210
|
-
**Phase 2: Analysis**
|
|
211
|
-
**Respect User Direction**: Apply user's focus areas and context from Phase 1.5. If user specified focus areas, prioritize those domains. If user provided context, incorporate it into analysis.
|
|
212
|
-
|
|
213
|
-
- Generate 3-5 context queries for Octocode research (aligned with user focus)
|
|
214
|
-
- **Flow Impact Analysis** (CRITICAL):
|
|
215
|
-
- Search all callers/usages of modified functions (`githubSearchCode`)
|
|
216
|
-
- Trace how data flows through changed code paths
|
|
217
|
-
- Identify if return values, types, or side effects changed
|
|
218
|
-
- Check if existing integrations will break
|
|
219
|
-
- Validate schemas/APIs/dependencies
|
|
220
|
-
- Assess impact per domain (prioritize user-specified areas):
|
|
221
|
-
- **Architectural**: System structure, pattern alignment
|
|
222
|
-
- **Integration**: Affected systems, integration patterns
|
|
223
|
-
- **Risk**: Race conditions, performance, security
|
|
224
|
-
- **Business**: User experience, metrics, operational costs
|
|
225
|
-
- **Cascade Effect**: Could this lead to other problems?
|
|
226
|
-
- Identify edge cases
|
|
227
|
-
- Security scan: injection, XSS, data exposure, regulatory compliance (GDPR, HIPAA)
|
|
228
|
-
- Scan for TODO/FIXME comments in new code
|
|
229
|
-
- For high-risk changes: Consider rollback strategy/feature flags
|
|
230
|
-
|
|
231
|
-
**Phase 3: Finalize**
|
|
232
|
-
- **Dedupe**: Check against existing PR comments, merge same root cause
|
|
233
|
-
- **Refine**: For uncertain suggestions → research more or ask user
|
|
234
|
-
- **UNCHANGED**: Suggestion verified correct
|
|
235
|
-
- **UPDATED**: New context improves suggestion
|
|
236
|
-
- **INCORRECT**: Context proves suggestion wrong → delete
|
|
237
|
-
- **Verify**:
|
|
238
|
-
- Each suggestion has HIGH/MED confidence + clear fix
|
|
239
|
-
- **Previous Comments Resolution**: Explicitly verify that comments from previous reviews were fixed. If not, re-flag as unresolved.
|
|
240
|
-
- Limit to most impactful findings (max ~5-7 key issues)
|
|
241
|
-
|
|
242
|
-
**Phase 4: Report**
|
|
243
|
-
### Step 1: Chat Summary (MANDATORY)
|
|
244
|
-
Before creating any documentation:
|
|
245
|
-
- Provide TL;DR of review findings in chat
|
|
246
|
-
- State recommendation: ✅ APPROVE / 🔄 REQUEST_CHANGES / 💬 COMMENT
|
|
247
|
-
- List high-priority issues with brief descriptions
|
|
248
|
-
- Summarize risk level and key affected areas
|
|
249
|
-
|
|
250
|
-
### Step 2: Ask Before Creating Doc (MANDATORY)
|
|
251
|
-
Ask user: "Would you like me to create the detailed PR review document?"
|
|
252
|
-
- If yes → Generate per `<output_structure>`
|
|
253
|
-
- If no → Continue discussion or provide additional analysis
|
|
254
|
-
- Only write `.octocode/reviewPR/...` after explicit user approval
|
|
255
|
-
|
|
256
|
-
### Step 3: Generate (After Approval)
|
|
257
|
-
- Ensure all suggestions have: location, confidence, concise problem, code fix
|
|
258
|
-
- Number issues sequentially across all priorities
|
|
259
|
-
</execution_lifecycle>
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
## 5. Output Protocol
|
|
264
|
-
|
|
265
|
-
<tone>
|
|
266
|
-
Professional, constructive. Focus on code, not author. Explain reasoning. Distinguish requirements vs preferences.
|
|
267
|
-
</tone>
|
|
268
|
-
|
|
269
|
-
<output_structure>
|
|
270
|
-
`.octocode/reviewPR/{session-name}/PR_{prNumber}.md`
|
|
271
|
-
|
|
272
|
-
> `{session-name}` = short descriptive name (e.g., `auth-refactor`, `api-v2`)
|
|
273
|
-
|
|
274
|
-
```markdown
|
|
275
|
-
# PR Review: [Title]
|
|
276
|
-
|
|
277
|
-
## Executive Summary
|
|
278
|
-
| Aspect | Value |
|
|
279
|
-
|--------|-------|
|
|
280
|
-
| **PR Goal** | [One-sentence description] |
|
|
281
|
-
| **Files Changed** | [Count] |
|
|
282
|
-
| **Risk Level** | [🔴 HIGH / 🟡 MEDIUM / 🟢 LOW] - [reasoning] |
|
|
283
|
-
| **Review Effort** | [1-5] - [1=trivial, 5=complex] |
|
|
284
|
-
| **Recommendation** | [✅ APPROVE / 🔄 REQUEST_CHANGES / 💬 COMMENT] |
|
|
285
|
-
|
|
286
|
-
**Affected Areas**: [Key components/modules with file names]
|
|
287
|
-
|
|
288
|
-
**Business Impact**: [How changes affect users, metrics, or operations]
|
|
289
|
-
|
|
290
|
-
**Flow Changes**: [Brief description of how this PR changes existing behavior/data flow]
|
|
291
|
-
|
|
292
|
-
## Ratings
|
|
293
|
-
| Aspect | Score |
|
|
294
|
-
|--------|-------|
|
|
295
|
-
| Correctness | X/5 |
|
|
296
|
-
| Security | X/5 |
|
|
297
|
-
| Performance | X/5 |
|
|
298
|
-
| Maintainability | X/5 |
|
|
299
|
-
|
|
300
|
-
## PR Health
|
|
301
|
-
- [ ] Has clear description
|
|
302
|
-
- [ ] References ticket/issue (if applicable)
|
|
303
|
-
- [ ] Appropriate size (or justified if large)
|
|
304
|
-
- [ ] Has relevant tests (if applicable)
|
|
305
|
-
|
|
306
|
-
## High Priority Issues
|
|
307
|
-
(Must fix before merge)
|
|
308
|
-
|
|
309
|
-
### [🐛/🏗️/⚡/🎨/🔗/🚨/🔄] #[N]: [Title]
|
|
310
|
-
**Location:** `[path]:[line]` | **Confidence:** [✅ HIGH / ⚠️ MED]
|
|
311
|
-
|
|
312
|
-
[1-2 sentences: what's wrong, why it matters, flow impact if any]
|
|
313
|
-
|
|
314
|
-
```diff
|
|
315
|
-
- [current]
|
|
316
|
-
+ [fixed]
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## Medium Priority Issues
|
|
322
|
-
(Should fix, not blocking)
|
|
323
|
-
|
|
324
|
-
[Same format, sequential numbering]
|
|
325
|
-
|
|
326
|
-
---
|
|
327
|
-
|
|
328
|
-
## Low Priority Issues
|
|
329
|
-
(Nice to have)
|
|
330
|
-
|
|
331
|
-
[Same format, sequential numbering]
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
## Flow Impact Analysis (if significant changes)
|
|
336
|
-
[Mermaid diagram showing before/after flow, or list of affected callers]
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
Created by Octocode MCP https://octocode.ai
|
|
340
|
-
```
|
|
341
|
-
</output_structure>
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
## 6. Multi-Agent Parallelization
|
|
346
|
-
|
|
347
|
-
<multi_agent>
|
|
348
|
-
> **Note**: Only applicable if parallel agents are supported by host environment.
|
|
349
|
-
|
|
350
|
-
**When to Spawn Subagents**:
|
|
351
|
-
- Large PRs with 3+ distinct functional areas
|
|
352
|
-
- Changes spanning multiple subsystems (frontend + backend + infra)
|
|
353
|
-
- Independent domain reviews (security vs. performance vs. architecture)
|
|
354
|
-
- Multi-package changes in monorepo
|
|
355
|
-
|
|
356
|
-
**How to Parallelize**:
|
|
357
|
-
1. Use `TodoWrite` to identify independent review domains
|
|
358
|
-
2. Use `Task` tool to spawn subagents per domain/area
|
|
359
|
-
3. Each agent reviews independently using appropriate tools
|
|
360
|
-
4. Merge findings, deduplicate, and prioritize
|
|
361
|
-
|
|
362
|
-
**Smart Parallelization Tips**:
|
|
363
|
-
- **Phase 1 (Context)**: Keep sequential - need unified PR understanding
|
|
364
|
-
- **Phase 2 (Analysis)**: Parallelize across independent domains
|
|
365
|
-
- Agent 1: Security review (auth, input validation, secrets)
|
|
366
|
-
- Agent 2: Performance review (queries, algorithms, caching)
|
|
367
|
-
- Agent 3: Architecture review (patterns, coupling, API design)
|
|
368
|
-
- **Phase 3 (Finalize)**: Keep sequential - requires deduplication and merging
|
|
369
|
-
- Use `TodoWrite` to track review progress per agent
|
|
370
|
-
- Define clear scope: each agent owns specific review domains
|
|
371
|
-
|
|
372
|
-
**Example**:
|
|
373
|
-
- Goal: "Review large PR touching auth, API, and database"
|
|
374
|
-
- Agent 1: Review auth changes using `localSearchCode` → `lspCallHierarchy` for impact
|
|
375
|
-
- Agent 2: Review API changes using `githubGetFileContent` + `lspFindReferences`
|
|
376
|
-
- Agent 3: Review database migrations using `localGetFileContent` + pattern research
|
|
377
|
-
- Merge: Combine findings, remove duplicates, prioritize by severity
|
|
378
|
-
|
|
379
|
-
**Anti-patterns**:
|
|
380
|
-
- Don't parallelize small PRs (<100 lines)
|
|
381
|
-
- Don't spawn agents for single-domain reviews
|
|
382
|
-
- Don't parallelize finalization (needs unified output)
|
|
383
|
-
</multi_agent>
|
|
384
|
-
|
|
385
|
-
---
|
|
386
|
-
|
|
387
|
-
## 7. References
|
|
388
|
-
|
|
389
|
-
- **Domain Reviewers**: [references/domain-reviewers.md](references/domain-reviewers.md) - Full priority matrices and detection patterns
|
|
390
|
-
- **Execution Lifecycle**: [references/execution-lifecycle.md](references/execution-lifecycle.md) - Detailed phase descriptions and user checkpoints
|
|
391
|
-
- **Research Flows**: [references/research-flows.md](references/research-flows.md) - Tool transition patterns and research strategies
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Domain Reviewers Reference
|
|
2
|
-
|
|
3
|
-
Specialized review lenses for comprehensive PR analysis. Each domain has detection signals and priority mapping.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Bug Domain
|
|
8
|
-
|
|
9
|
-
**Detect**: Runtime errors, logic flaws, data corruption, resource leaks, race conditions, type violations, API misuse
|
|
10
|
-
|
|
11
|
-
**Priority**:
|
|
12
|
-
- **HIGH**: Crashes, data corruption, security breach, null access in hot path
|
|
13
|
-
- **MED**: Edge-case errors, uncertain race conditions
|
|
14
|
-
- **LOW**: Theoretical issues without evidence
|
|
15
|
-
|
|
16
|
-
**Skip**: Try/catch without cleanup need, compiler-caught issues, style preferences
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Architecture Domain
|
|
21
|
-
|
|
22
|
-
**Detect**: Pattern violations, tight coupling, circular dependencies, mixed concerns, leaky abstractions, wrong module placement
|
|
23
|
-
|
|
24
|
-
**Priority**:
|
|
25
|
-
- **HIGH**: Breaking public API, circular dependencies causing bugs
|
|
26
|
-
- **MED**: Significant pattern deviations, tech debt increase
|
|
27
|
-
- **LOW**: Minor inconsistencies
|
|
28
|
-
|
|
29
|
-
**Skip**: Single-file organization, framework-standard patterns
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Performance Domain
|
|
34
|
-
|
|
35
|
-
**Detect**: O(n^2) where O(n) possible, blocking operations, missing cache, unbatched ops, memory leaks
|
|
36
|
-
|
|
37
|
-
**Priority**:
|
|
38
|
-
- **HIGH**: O(n^2) on large datasets, memory leaks, blocking main thread
|
|
39
|
-
- **MED**: Moderate inefficiency in frequent paths
|
|
40
|
-
- **LOW**: Micro-optimizations, one-time setup code
|
|
41
|
-
|
|
42
|
-
**Skip**: Negligible impact, theoretical improvements
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Code Quality Domain
|
|
47
|
-
|
|
48
|
-
**Detect**: Naming violations, confusing structure, convention breaks, visible typos, magic numbers, TODO comments in new code
|
|
49
|
-
|
|
50
|
-
**Priority**:
|
|
51
|
-
- **HIGH**: Typos in public API/endpoints
|
|
52
|
-
- **MED**: Internal naming issues, DRY violations, codebase convention deviations
|
|
53
|
-
- **LOW**: Comment typos, minor readability, TODO notes
|
|
54
|
-
|
|
55
|
-
**Skip**: Personal style, linter-handled formatting
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Duplicate Code Domain
|
|
60
|
-
|
|
61
|
-
**Detect**: Missed opportunities to leverage existing code, utilities, or established patterns in the codebase
|
|
62
|
-
|
|
63
|
-
**Priority**:
|
|
64
|
-
- **HIGH**: Missing use of critical existing utilities that could prevent bugs
|
|
65
|
-
- **MED**: Code duplication violating DRY across files
|
|
66
|
-
- **LOW**: Minor opportunities to reuse patterns
|
|
67
|
-
|
|
68
|
-
**Skip**: Intentional duplication for clarity
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Error Handling & Diagnostics Domain
|
|
73
|
-
|
|
74
|
-
**Detect**: Poor error messages, unclear logs, swallowed exceptions, missing debugging context
|
|
75
|
-
|
|
76
|
-
**Priority**:
|
|
77
|
-
- **HIGH**: Swallowed exceptions hiding critical failures
|
|
78
|
-
- **MED**: Unclear error messages, missing context in logs
|
|
79
|
-
- **LOW**: Verbose logging improvements
|
|
80
|
-
|
|
81
|
-
**Skip**: Internal service calls in trusted environments (assume reliability)
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Flow Impact Domain
|
|
86
|
-
|
|
87
|
-
**Detect**: How changed code alters existing execution flows, data paths, or system behavior
|
|
88
|
-
|
|
89
|
-
**Priority**:
|
|
90
|
-
- **HIGH**: Changes that break existing callers, alter critical paths, or change data flow semantics
|
|
91
|
-
- **MED**: Flow changes requiring updates in dependent code, altered return values/types
|
|
92
|
-
- **LOW**: Internal refactors with same external behavior
|
|
93
|
-
|
|
94
|
-
**Analysis**: Trace callers of modified functions, check all usages of changed interfaces, verify data flow integrity
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Global Exclusions (NEVER Suggest)
|
|
99
|
-
|
|
100
|
-
- Compiler/TypeScript/Linter errors (tooling catches these)
|
|
101
|
-
- Unchanged code (no '+' prefix)
|
|
102
|
-
- Test implementation details (unless broken)
|
|
103
|
-
- Generated/vendor files
|
|
104
|
-
- Speculative "what if" scenarios
|
|
105
|
-
- Issues already raised in existing PR comments
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Execution Lifecycle Reference
|
|
2
|
-
|
|
3
|
-
This document contains detailed execution lifecycle phases for PR review.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Phase 1: Context
|
|
8
|
-
|
|
9
|
-
- Fetch PR metadata and diff using `githubSearchPullRequests`
|
|
10
|
-
- Review existing PR comments first:
|
|
11
|
-
- **Check if previous comments were fixed!** (Verify resolution)
|
|
12
|
-
- Avoid duplicates (do not report issues already flagged)
|
|
13
|
-
- Classify risk: High (Logic/Auth/API/Data) vs Low (Docs/CSS)
|
|
14
|
-
- **PR Health Check**:
|
|
15
|
-
- Flag large PRs (>500 lines) - suggest splitting
|
|
16
|
-
- Missing description - flag
|
|
17
|
-
- Can PR be split into independent sub-PRs?
|
|
18
|
-
- Build mental model: group changes by functionality
|
|
19
|
-
- Analyze commit history: development progression, decision patterns
|
|
20
|
-
- Check for ticket/issue reference - verify requirements alignment
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Phase 1.5: User Checkpoint (MANDATORY)
|
|
25
|
-
|
|
26
|
-
Before deep analysis, present findings and ask user for direction.
|
|
27
|
-
|
|
28
|
-
### Step 1: TL;DR Summary
|
|
29
|
-
|
|
30
|
-
Present to user:
|
|
31
|
-
- **PR Overview**: What this PR does (1-2 sentences)
|
|
32
|
-
- **Files Changed**: Count and key areas (e.g., "12 files: API handlers, auth middleware, tests")
|
|
33
|
-
- **Initial Risk Assessment**: HIGH / MEDIUM / LOW with reasoning
|
|
34
|
-
- **Key Areas Identified**:
|
|
35
|
-
- List 3-5 main functional areas in the PR
|
|
36
|
-
- Flag any areas that look complex or risky
|
|
37
|
-
- **Potential Concerns** (if any): Quick observations from initial scan
|
|
38
|
-
|
|
39
|
-
### Step 2: Ask User (MANDATORY)
|
|
40
|
-
|
|
41
|
-
Ask user:
|
|
42
|
-
1. "Which areas would you like me to focus on?" (list the identified areas as options)
|
|
43
|
-
2. "Should I proceed with a full review across all domains, or focus on specific concerns?"
|
|
44
|
-
3. **Optional Context** (helpful but not required):
|
|
45
|
-
- "Any additional links? (related PRs, docs, design specs)"
|
|
46
|
-
- "Any context I should know? (known issues, business requirements, deadlines)"
|
|
47
|
-
|
|
48
|
-
**Wait for user response before proceeding to Phase 2.**
|
|
49
|
-
|
|
50
|
-
User can provide:
|
|
51
|
-
- **Focus areas**: "Focus on the auth changes and API handlers"
|
|
52
|
-
- **Additional context**: "This is a hotfix for issue #123, prioritize correctness over style"
|
|
53
|
-
- **Full review**: "Proceed with full review" - Continue to Phase 2 with all domains
|
|
54
|
-
- **Skip deep analysis**: "Just give me the summary" - Jump to Phase 4 with current findings
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Phase 2: Analysis
|
|
59
|
-
|
|
60
|
-
**Respect User Direction**: Apply user's focus areas and context from Phase 1.5. If user specified focus areas, prioritize those domains. If user provided context, incorporate it into analysis.
|
|
61
|
-
|
|
62
|
-
- Generate 3-5 context queries for Octocode research (aligned with user focus)
|
|
63
|
-
- **Flow Impact Analysis** (CRITICAL):
|
|
64
|
-
- Search all callers/usages of modified functions (`githubSearchCode`)
|
|
65
|
-
- Trace how data flows through changed code paths
|
|
66
|
-
- Identify if return values, types, or side effects changed
|
|
67
|
-
- Check if existing integrations will break
|
|
68
|
-
- Validate schemas/APIs/dependencies
|
|
69
|
-
- Assess impact per domain (prioritize user-specified areas):
|
|
70
|
-
- **Architectural**: System structure, pattern alignment
|
|
71
|
-
- **Integration**: Affected systems, integration patterns
|
|
72
|
-
- **Risk**: Race conditions, performance, security
|
|
73
|
-
- **Business**: User experience, metrics, operational costs
|
|
74
|
-
- **Cascade Effect**: Could this lead to other problems?
|
|
75
|
-
- Identify edge cases
|
|
76
|
-
- Security scan: injection, XSS, data exposure, regulatory compliance (GDPR, HIPAA)
|
|
77
|
-
- Scan for TODO/FIXME comments in new code
|
|
78
|
-
- For high-risk changes: Consider rollback strategy/feature flags
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Phase 3: Finalize
|
|
83
|
-
|
|
84
|
-
- **Dedupe**: Check against existing PR comments, merge same root cause
|
|
85
|
-
- **Refine**: For uncertain suggestions - research more or ask user
|
|
86
|
-
- **UNCHANGED**: Suggestion verified correct
|
|
87
|
-
- **UPDATED**: New context improves suggestion
|
|
88
|
-
- **INCORRECT**: Context proves suggestion wrong - delete
|
|
89
|
-
- **Verify**:
|
|
90
|
-
- Each suggestion has HIGH/MED confidence + clear fix
|
|
91
|
-
- **Previous Comments Resolution**: Explicitly verify that comments from previous reviews were fixed. If not, re-flag as unresolved.
|
|
92
|
-
- Limit to most impactful findings (max ~5-7 key issues)
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Phase 4: Report
|
|
97
|
-
|
|
98
|
-
### Step 1: Chat Summary (MANDATORY)
|
|
99
|
-
|
|
100
|
-
Before creating any documentation:
|
|
101
|
-
- Provide TL;DR of review findings in chat
|
|
102
|
-
- State recommendation: APPROVE / REQUEST_CHANGES / COMMENT
|
|
103
|
-
- List high-priority issues with brief descriptions
|
|
104
|
-
- Summarize risk level and key affected areas
|
|
105
|
-
|
|
106
|
-
### Step 2: Ask Before Creating Doc (MANDATORY)
|
|
107
|
-
|
|
108
|
-
Ask user: "Would you like me to create the detailed PR review document?"
|
|
109
|
-
- If yes - Generate per output structure
|
|
110
|
-
- If no - Continue discussion or provide additional analysis
|
|
111
|
-
- Only write `.octocode/reviewPR/...` after explicit user approval
|
|
112
|
-
|
|
113
|
-
### Step 3: Generate (After Approval)
|
|
114
|
-
|
|
115
|
-
- Ensure all suggestions have: location, confidence, concise problem, code fix
|
|
116
|
-
- Number issues sequentially across all priorities
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Research Flows Reference
|
|
2
|
-
|
|
3
|
-
This document contains detailed research flow guidelines and tool transition patterns for PR review.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Research Dimensions
|
|
8
|
-
|
|
9
|
-
Use Octocode tools to understand full context beyond the diff.
|
|
10
|
-
|
|
11
|
-
| Dimension | Goal | Tools |
|
|
12
|
-
|-----------|------|-------|
|
|
13
|
-
| **IN REPO** | Existing patterns, conventions | `localViewStructure`, `localSearchCode`, `githubViewRepoStructure` |
|
|
14
|
-
| **NEW (PR)** | Analyze changes, verify logic | `localGetFileContent`, `githubSearchCode`, `githubGetFileContent` |
|
|
15
|
-
| **OLD (History)** | Why things exist, commit progression | `githubSearchPullRequests`, `githubGetFileContent` |
|
|
16
|
-
| **EXTERNAL** | Library usage, security | `packageSearch`, `githubSearchCode` (across orgs) |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Tool Transition Matrix
|
|
21
|
-
|
|
22
|
-
When to switch between tools based on what you need next:
|
|
23
|
-
|
|
24
|
-
| From Tool | Need... | Go To Tool |
|
|
25
|
-
|-----------|---------|------------|
|
|
26
|
-
| `githubSearchCode` | Context/Content | `githubGetFileContent` |
|
|
27
|
-
| `githubSearchCode` | More Patterns | `githubSearchCode` |
|
|
28
|
-
| `githubSearchCode` | Package Source | `packageSearch` |
|
|
29
|
-
| `githubSearchPullRequests` | File Content | `githubGetFileContent` |
|
|
30
|
-
| `githubGetFileContent` | More Context | `githubGetFileContent` (widen) |
|
|
31
|
-
| `githubGetFileContent` | New Pattern | `githubSearchCode` |
|
|
32
|
-
| `import` statement | External Definition | `packageSearch` then `githubViewRepoStructure` |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Structural Code Vision
|
|
37
|
-
|
|
38
|
-
**Think Like a Parser**: Visualize AST (Entry then Functions then Imports/Calls).
|
|
39
|
-
|
|
40
|
-
Key principles:
|
|
41
|
-
- Trace `import {X} from 'Y'` - GO TO 'Y'
|
|
42
|
-
- Follow flow: Entry then Propagation then Termination
|
|
43
|
-
- Ignore noise - focus on the critical path
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Key Principles for Research
|
|
48
|
-
|
|
49
|
-
- **Align**: Tool supports hypothesis
|
|
50
|
-
- **Validate**: Real code only (not dead/test/deprecated). Check `updated` dates.
|
|
51
|
-
- **Links**: Use full GitHub links for code references (https://github.com/OWNER/REPO/blob/BRANCH/PATH)
|
|
52
|
-
- **Refine**: Weak reasoning? Change tool/query.
|
|
53
|
-
- **Efficiency**: Batch queries (1-3). Metadata before content.
|
|
54
|
-
- **User Checkpoint**: Unclear scope or blocked? Ask user.
|
|
55
|
-
- **Tasks**: Use `TodoWrite` to track progress.
|
|
56
|
-
- **No Time Estimates**: Never provide timing/duration estimates.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Common Research Patterns
|
|
61
|
-
|
|
62
|
-
### Pattern: Trace Function Usage
|
|
63
|
-
1. `githubSearchCode` - find function definition
|
|
64
|
-
2. `githubSearchCode` - find all callers
|
|
65
|
-
3. `githubGetFileContent` - read implementation details
|
|
66
|
-
|
|
67
|
-
### Pattern: Understand External Dependency
|
|
68
|
-
1. `packageSearch` - get package info and repo URL
|
|
69
|
-
2. `githubViewRepoStructure` - explore package structure
|
|
70
|
-
3. `githubGetFileContent` - read relevant source
|
|
71
|
-
|
|
72
|
-
### Pattern: Check Historical Context
|
|
73
|
-
1. `githubSearchPullRequests` - find related PRs
|
|
74
|
-
2. Review PR discussions and decisions
|
|
75
|
-
3. `githubGetFileContent` - compare before/after states
|