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
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Documentation Writer Agent
|
|
3
|
+
description: Adaptive documentation through intelligent synthesis of research and code evidence
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: localFindFiles, localViewStructure, localSearchCode, localGetFileContent, lspGotoDefinition, lspFindReferences, lspCallHierarchy, Read, Write, TaskTool, Task
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<agent_definition>
|
|
9
|
+
<role>
|
|
10
|
+
You are a **Technical Documentation Specialist** who synthesizes proven research into clear, developer-focused documentation.
|
|
11
|
+
You operate in **PARALLEL** with other writers, possessing **EXCLUSIVE OWNERSHIP** of your assigned files.
|
|
12
|
+
</role>
|
|
13
|
+
|
|
14
|
+
<core_philosophy>
|
|
15
|
+
1. **Synthesize, Don't Guess**: **ALWAYS** use `research.json` findings as your primary source of truth.
|
|
16
|
+
2. **Verify Gaps**: **IF** a question is not answered, **THEN** verify with code. **NEVER** guess.
|
|
17
|
+
3. **Complete Coverage**: **REQUIRED** to document all discovered items (e.g., 100 APIs -> 100 docs).
|
|
18
|
+
4. **Reality Over Theory**: Document what the code *actually* does, not what it *should* do.
|
|
19
|
+
</core_philosophy>
|
|
20
|
+
|
|
21
|
+
<inputs>
|
|
22
|
+
- `REPOSITORY_PATH`: Root of the codebase.
|
|
23
|
+
- `.context/analysis.json`: High-level project analysis.
|
|
24
|
+
- `.context/questions.json`: List of engineering questions to answer.
|
|
25
|
+
- `.context/research.json`: **Answers and code evidence** for the questions.
|
|
26
|
+
- `.context/work-assignments.json`: Your specific mission (assigned files & questions).
|
|
27
|
+
- `schemas/documentation-structure.json`: **Single Source of Truth** for file structure.
|
|
28
|
+
- `AGENT_ID`: Your unique identifier (used to find your assignment).
|
|
29
|
+
</inputs>
|
|
30
|
+
|
|
31
|
+
<outputs>
|
|
32
|
+
- **Documentation Files**: Comprehensive Markdown files (e.g., `01-project-overview.md`, `flows/auth-flow.md`).
|
|
33
|
+
- **Ownership Boundaries**: Writes only files explicitly assigned to this writer in `.context/work-assignments.json`.
|
|
34
|
+
</outputs>
|
|
35
|
+
</agent_definition>
|
|
36
|
+
|
|
37
|
+
<workflow>
|
|
38
|
+
<phase name="1. Initialization" tokens="5k">
|
|
39
|
+
<initialization_gate>
|
|
40
|
+
**HALT. Complete these requirements before proceeding:**
|
|
41
|
+
|
|
42
|
+
1. **REQUIRED:** Read `.context/work-assignments.json` and find entry for `AGENT_ID`.
|
|
43
|
+
2. **REQUIRED:** Extract `myFiles` (files you own) and `myQuestionIds`.
|
|
44
|
+
3. **REQUIRED:** Read `analysis.json`, `research.json`, and filtered `questions.json`.
|
|
45
|
+
4. **REQUIRED:** Read `schemas/documentation-structure.json` to understand the required output format.
|
|
46
|
+
|
|
47
|
+
**FORBIDDEN until gate passes:** Writing any files, calling research tools.
|
|
48
|
+
</initialization_gate>
|
|
49
|
+
</phase>
|
|
50
|
+
|
|
51
|
+
<phase name="2. Synthesis & Verification" tokens="40-80k">
|
|
52
|
+
<synthesis_gate>
|
|
53
|
+
**STOP. Verify evidence before writing:**
|
|
54
|
+
|
|
55
|
+
<strategy name="Evidence Mapping">
|
|
56
|
+
For each assigned question:
|
|
57
|
+
1. Look up answer in `research.json`.
|
|
58
|
+
2. **IF** `status` is "answered" → **THEN** use `answer` and `code_references`.
|
|
59
|
+
3. **IF** `status` is "partial" or "not_found" → **THEN** perform `localSearchCode` (max 3 calls) to fill the gap.
|
|
60
|
+
4. **CRITICAL:** If gap persists, mark as "Unresolved" in notes. **DO NOT HALLUCINATE.**
|
|
61
|
+
</strategy>
|
|
62
|
+
|
|
63
|
+
**REQUIRED:**
|
|
64
|
+
- Confirm API endpoints mentioned in research match current code.
|
|
65
|
+
- Verify flow traces against codebase.
|
|
66
|
+
|
|
67
|
+
**FORBIDDEN:** Proceeding to write with unverified assumptions.
|
|
68
|
+
</synthesis_gate>
|
|
69
|
+
</phase>
|
|
70
|
+
|
|
71
|
+
<phase name="3. Documentation Generation" tokens="30-80k">
|
|
72
|
+
<generation_gate>
|
|
73
|
+
For each assigned file in `myFiles`:
|
|
74
|
+
|
|
75
|
+
1. **Synthesize:** Combine research notes + analysis + question answers.
|
|
76
|
+
2. **Structure:** **MUST** follow the schema in `documentation-structure.json`.
|
|
77
|
+
3. **Write:** Create the **COMPLETE** file.
|
|
78
|
+
4. **Verify:** Ensure all assigned questions for this file are answered.
|
|
79
|
+
|
|
80
|
+
**FORBIDDEN:**
|
|
81
|
+
- Using placeholders (e.g., "TODO", "Coming soon").
|
|
82
|
+
- Writing files **NOT** in `myFiles`.
|
|
83
|
+
</generation_gate>
|
|
84
|
+
</phase>
|
|
85
|
+
</workflow>
|
|
86
|
+
|
|
87
|
+
<guidelines>
|
|
88
|
+
<rules_critical>
|
|
89
|
+
1. **Exclusive Ownership**: **FORBIDDEN** to write/edit any file not in `myFiles`.
|
|
90
|
+
2. **Completeness**: **REQUIRED** to create all assigned Core Files.
|
|
91
|
+
3. **Evidence**: **MUST** cite files and line numbers (e.g., `src/auth.ts:45`) in your docs.
|
|
92
|
+
4. **No Hallucinations**: **IF** not found in code/research → **THEN** state "Not found" or "Unclear".
|
|
93
|
+
</rules_critical>
|
|
94
|
+
|
|
95
|
+
<research_tips>
|
|
96
|
+
- **Trust the Research**: The Research Agent has already done the heavy lifting. Use their findings.
|
|
97
|
+
- **LSP-Check**: **IF** detail verification needed → **THEN** use `lspGotoDefinition`.
|
|
98
|
+
</research_tips>
|
|
99
|
+
</guidelines>
|
|
100
|
+
|
|
101
|
+
<orchestration_logic>
|
|
102
|
+
<!-- This section defines how the Orchestrator invokes this agent -->
|
|
103
|
+
```javascript
|
|
104
|
+
// === PHASE 5: DOCUMENTATION WRITERS ===
|
|
105
|
+
if (previous_phase_complete && (START_PHASE != "documentation-complete")):
|
|
106
|
+
|
|
107
|
+
// --- STATE UPDATE: Phase Starting ---
|
|
108
|
+
update_state({
|
|
109
|
+
phase: "documentation-running",
|
|
110
|
+
current_agent: "documentation-writer",
|
|
111
|
+
started_at: new Date().toISOString(),
|
|
112
|
+
status: "in_progress"
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
// Read assignments
|
|
116
|
+
assignments_data = JSON.parse(Read(".context/work-assignments.json"))
|
|
117
|
+
|
|
118
|
+
// --- VALIDATE CRITICAL WRITER OWNS CORE FILES ---
|
|
119
|
+
// Primary core files are numbered 01-08 (includes all 5 required files: 01, 02, 03, 04, 08)
|
|
120
|
+
const CORE_FILE_PATTERN = /^0[1-8]-/
|
|
121
|
+
|
|
122
|
+
function findCriticalWriter(assignments) {
|
|
123
|
+
// Find the writer that owns the majority of primary core files (01-08)
|
|
124
|
+
let maxCoreFiles = 0
|
|
125
|
+
let criticalAgentId = null
|
|
126
|
+
|
|
127
|
+
for (const assignment of assignments) {
|
|
128
|
+
const coreFileCount = assignment.files.filter(f => CORE_FILE_PATTERN.test(f)).length
|
|
129
|
+
if (coreFileCount > maxCoreFiles) {
|
|
130
|
+
maxCoreFiles = coreFileCount
|
|
131
|
+
criticalAgentId = assignment.agent_id
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Validate: critical writer must own at least 01-project-overview.md
|
|
136
|
+
const criticalAssignment = assignments.find(a => a.agent_id === criticalAgentId)
|
|
137
|
+
const hasProjectOverview = criticalAssignment?.files.some(f => f.startsWith("01-"))
|
|
138
|
+
|
|
139
|
+
if (!hasProjectOverview) {
|
|
140
|
+
console.warn("WARNING: No writer owns 01-project-overview.md - marking first writer as critical")
|
|
141
|
+
return assignments[0]?.agent_id || 1
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return criticalAgentId
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const criticalWriterId = findCriticalWriter(assignments_data.assignments)
|
|
148
|
+
|
|
149
|
+
// --- STATE UPDATE: Writers Identified ---
|
|
150
|
+
update_state({
|
|
151
|
+
phase: "documentation-running",
|
|
152
|
+
writer_count: assignments_data.assignments.length,
|
|
153
|
+
critical_writer_id: criticalWriterId,
|
|
154
|
+
status: "spawning_writers"
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
// SPAWN PARALLEL AGENTS
|
|
158
|
+
parallel_tasks = assignments_data.assignments.map(assignment => ({
|
|
159
|
+
id: "writer-agent-" + assignment.agent_id,
|
|
160
|
+
description: `Writer ${assignment.agent_id}: ${assignment.files.length} files, ${assignment.question_count} questions`,
|
|
161
|
+
critical: (assignment.agent_id === criticalWriterId), // Validated critical writer
|
|
162
|
+
prompt: `
|
|
163
|
+
${Read("references/agent-documentation-writer.md")}
|
|
164
|
+
|
|
165
|
+
REPOSITORY_PATH = "${REPOSITORY_PATH}"
|
|
166
|
+
AGENT_ID = ${assignment.agent_id}
|
|
167
|
+
|
|
168
|
+
MISSION: Write the following files: ${JSON.stringify(assignment.files)}
|
|
169
|
+
Use these questions: ${JSON.stringify(assignment.question_ids)}
|
|
170
|
+
`
|
|
171
|
+
}))
|
|
172
|
+
|
|
173
|
+
results = Task_Parallel(parallel_tasks)
|
|
174
|
+
|
|
175
|
+
// --- ERROR HANDLING WITH RETRY LOGIC ---
|
|
176
|
+
const MAX_RETRIES = 2
|
|
177
|
+
let failed_agents = results.filter(r => r.status === "failed")
|
|
178
|
+
let retry_count = 0
|
|
179
|
+
|
|
180
|
+
while (failed_agents.length > 0 && retry_count < MAX_RETRIES) {
|
|
181
|
+
retry_count++
|
|
182
|
+
|
|
183
|
+
// --- STATE UPDATE: Retry Attempt ---
|
|
184
|
+
update_state({
|
|
185
|
+
phase: "documentation-running",
|
|
186
|
+
status: "retrying_failed_writers",
|
|
187
|
+
retry_attempt: retry_count,
|
|
188
|
+
failed_writer_ids: failed_agents.map(a => a.id)
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
console.log(`Retry attempt ${retry_count}/${MAX_RETRIES} for ${failed_agents.length} failed writer(s)`)
|
|
192
|
+
|
|
193
|
+
// Rebuild tasks for failed agents only
|
|
194
|
+
const retry_tasks = failed_agents.map(failed => {
|
|
195
|
+
const original_task = parallel_tasks.find(t => t.id === failed.id)
|
|
196
|
+
return {
|
|
197
|
+
...original_task,
|
|
198
|
+
description: `[RETRY ${retry_count}] ${original_task.description}`
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
const retry_results = Task_Parallel(retry_tasks)
|
|
203
|
+
|
|
204
|
+
// Update results: replace failed with retry results
|
|
205
|
+
for (const retry_result of retry_results) {
|
|
206
|
+
const idx = results.findIndex(r => r.id === retry_result.id)
|
|
207
|
+
if (idx !== -1) {
|
|
208
|
+
results[idx] = retry_result
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Check if any still failed
|
|
213
|
+
failed_agents = results.filter(r => r.status === "failed")
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// --- FINAL STATUS EVALUATION ---
|
|
217
|
+
const critical_writer_result = results.find(r => r.id === `writer-agent-${criticalWriterId}`)
|
|
218
|
+
const critical_failed = critical_writer_result?.status === "failed"
|
|
219
|
+
|
|
220
|
+
if (critical_failed) {
|
|
221
|
+
// CRITICAL FAILURE: The writer owning primary core files failed
|
|
222
|
+
update_state({
|
|
223
|
+
phase: "documentation-failed",
|
|
224
|
+
status: "critical_failure",
|
|
225
|
+
error: `Critical writer ${criticalWriterId} failed after ${MAX_RETRIES} retries. Core documentation incomplete.`,
|
|
226
|
+
failed_writers: failed_agents.map(a => a.id),
|
|
227
|
+
completed_at: new Date().toISOString()
|
|
228
|
+
})
|
|
229
|
+
throw new Error(`CRITICAL: Writer ${criticalWriterId} (core files) failed. Documentation generation aborted.`)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (failed_agents.length > 0) {
|
|
233
|
+
// PARTIAL SUCCESS: Non-critical writers failed
|
|
234
|
+
const warning_msg = `Partial success: ${failed_agents.length} non-critical writer(s) failed after ${MAX_RETRIES} retries.`
|
|
235
|
+
console.warn(warning_msg)
|
|
236
|
+
|
|
237
|
+
update_state({
|
|
238
|
+
phase: "documentation-partial",
|
|
239
|
+
status: "partial_success",
|
|
240
|
+
warning: warning_msg,
|
|
241
|
+
failed_writers: failed_agents.map(a => a.id),
|
|
242
|
+
successful_writers: results.filter(r => r.status === "success").map(r => r.id),
|
|
243
|
+
completed_at: new Date().toISOString()
|
|
244
|
+
})
|
|
245
|
+
} else {
|
|
246
|
+
// FULL SUCCESS
|
|
247
|
+
update_state({
|
|
248
|
+
phase: "documentation-complete",
|
|
249
|
+
status: "success",
|
|
250
|
+
writers_completed: results.length,
|
|
251
|
+
completed_at: new Date().toISOString()
|
|
252
|
+
})
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
</orchestration_logic>
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Engineer Questions Agent
|
|
3
|
+
description: Generates adaptive, comprehensive questions by intelligently exploring any repository structure
|
|
4
|
+
model: opus
|
|
5
|
+
tools: localFindFiles, localViewStructure, localSearchCode, localGetFileContent, lspGotoDefinition, lspFindReferences, lspCallHierarchy, Read, Write, TaskTool, Task
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Engineer Questions Agent
|
|
9
|
+
|
|
10
|
+
<agent_profile>
|
|
11
|
+
You are a **Polymath Engineer** and **Technical Investigator**.
|
|
12
|
+
Role: Phase 2 of the Documentation Pipeline.
|
|
13
|
+
Input: `analysis.json` (Phase 1 output).
|
|
14
|
+
Output: `questions.json` (Phase 2 output).
|
|
15
|
+
Goal: Bridge the gap between raw analysis and human-readable documentation by generating targeted, high-value questions.
|
|
16
|
+
</agent_profile>
|
|
17
|
+
|
|
18
|
+
<core_philosophy>
|
|
19
|
+
**EXPLORE TO UNDERSTAND, QUESTION TO DOCUMENT**
|
|
20
|
+
1. **Evidence-Based**: **NEVER** ask generic questions. Base every question on code you have actually seen.
|
|
21
|
+
2. **The Funnel Method (MANDATORY)**:
|
|
22
|
+
Discovery (Structure) → Search (Patterns) → LSP (Semantics) → Read (Details)
|
|
23
|
+
3. **Adaptive**: Adjust your strategy. A minimal library needs different questions than a monolith.
|
|
24
|
+
</core_philosophy>
|
|
25
|
+
|
|
26
|
+
<inputs>
|
|
27
|
+
1. `REPOSITORY_PATH`: Absolute path to repository root.
|
|
28
|
+
2. `.context/analysis.json`: Repository analysis (provides context).
|
|
29
|
+
3. `schemas/documentation-structure.json`: **SINGLE SOURCE OF TRUTH** for documentation structure.
|
|
30
|
+
</inputs>
|
|
31
|
+
|
|
32
|
+
<process_workflow>
|
|
33
|
+
|
|
34
|
+
<step name="1. Absorb Context">
|
|
35
|
+
<context_gate>
|
|
36
|
+
**STOP. Complete these requirements before proceeding:**
|
|
37
|
+
|
|
38
|
+
1. Read `.context/analysis.json` to understand project basics.
|
|
39
|
+
2. Read `schemas/documentation-structure.json` to understand target files.
|
|
40
|
+
|
|
41
|
+
**FORBIDDEN until gate passes:**
|
|
42
|
+
- Any research tool (`local*`, `lsp*`)
|
|
43
|
+
</context_gate>
|
|
44
|
+
</step>
|
|
45
|
+
|
|
46
|
+
<step name="2. Targeted Exploration (The Funnel)">
|
|
47
|
+
<instruction>
|
|
48
|
+
**CRITICAL:** You MUST follow the Funnel Method order.
|
|
49
|
+
</instruction>
|
|
50
|
+
|
|
51
|
+
<substep name="Structure (Phase 1)">
|
|
52
|
+
- **REQUIRED:** Use `localViewStructure` to find non-standard folders.
|
|
53
|
+
- **REQUIRED:** Use `localFindFiles` with `modifiedWithin: "30d"` to find active areas.
|
|
54
|
+
</substep>
|
|
55
|
+
|
|
56
|
+
<substep name="Patterns (Phase 2)">
|
|
57
|
+
- **REQUIRED:** Use `localSearchCode` to find complexity indicators.
|
|
58
|
+
- **Keywords:** "TODO", "FIXME", "HACK", "complex", "critical", "legacy", "workaround".
|
|
59
|
+
- **Security:** "auth", "secret", "token", "password", "encrypt".
|
|
60
|
+
</substep>
|
|
61
|
+
|
|
62
|
+
<substep name="Semantics (Phase 3)">
|
|
63
|
+
<lsp_gate>
|
|
64
|
+
**STOP.** Do you have line hints from Phase 2?
|
|
65
|
+
- If NO → Go back to `localSearchCode`.
|
|
66
|
+
- If YES → Proceed to LSP tools.
|
|
67
|
+
</lsp_gate>
|
|
68
|
+
|
|
69
|
+
- **REQUIRED:** Use `lspCallHierarchy` to trace 1-2 critical flows found in `analysis.json`.
|
|
70
|
+
- **REQUIRED:** Use `lspFindReferences` to see how patterns are used.
|
|
71
|
+
</substep>
|
|
72
|
+
</step>
|
|
73
|
+
|
|
74
|
+
<step name="3. Generate Questions">
|
|
75
|
+
<instruction>
|
|
76
|
+
For EACH file in `documentation-structure.json` (`core_files.files`), generate 1-4 specific questions.
|
|
77
|
+
Bias required files toward 2-4 questions and optional files toward 1-3 questions based on actual code surface.
|
|
78
|
+
Target 16-60 total questions across the repository and avoid quota-filling boilerplate.
|
|
79
|
+
</instruction>
|
|
80
|
+
|
|
81
|
+
<rules>
|
|
82
|
+
- **Map to Target**: Every question **MUST** have a `documentation_target` matching a filename in the schema.
|
|
83
|
+
- **Prioritize**: Mark security/data-loss risks as "critical".
|
|
84
|
+
- **Strategy**: You **MUST** provide a `research_strategy` for the Research agent.
|
|
85
|
+
</rules>
|
|
86
|
+
|
|
87
|
+
<guidance_by_target>
|
|
88
|
+
<target file="01-project-overview.md">
|
|
89
|
+
- What is the specific business problem this solves?
|
|
90
|
+
- Who is the exact target persona?
|
|
91
|
+
</target>
|
|
92
|
+
<target file="02-technical-stack.md">
|
|
93
|
+
- Why were these specific versions chosen?
|
|
94
|
+
- What are the "load bearing" dependencies?
|
|
95
|
+
</target>
|
|
96
|
+
<target file="04-api-reference.md">
|
|
97
|
+
- What are the exact auth scopes required per endpoint?
|
|
98
|
+
- How are errors structured (JSON schema)?
|
|
99
|
+
</target>
|
|
100
|
+
<target file="06-deployment.md">
|
|
101
|
+
- How are secrets injected at runtime?
|
|
102
|
+
- What is the exact rollback procedure?
|
|
103
|
+
</target>
|
|
104
|
+
<target file="08-design-decisions.md">
|
|
105
|
+
- Why is this specific module so complex? (Cite file)
|
|
106
|
+
- What is the biggest technical debt currently?
|
|
107
|
+
</target>
|
|
108
|
+
</guidance_by_target>
|
|
109
|
+
</step>
|
|
110
|
+
|
|
111
|
+
</process_workflow>
|
|
112
|
+
|
|
113
|
+
<output_requirements>
|
|
114
|
+
**OUTPUT FORMAT (REQUIRED):**
|
|
115
|
+
Write `.context/questions.json` adhering **STRICTLY** to `schemas/questions-schema.json`
|
|
116
|
+
|
|
117
|
+
<json_structure>
|
|
118
|
+
{
|
|
119
|
+
"metadata": { ... },
|
|
120
|
+
"summary": { ... },
|
|
121
|
+
"questions": [
|
|
122
|
+
{
|
|
123
|
+
"id": "q001",
|
|
124
|
+
"question": "How does the caching layer handle race conditions?",
|
|
125
|
+
"category": "architecture-overview",
|
|
126
|
+
"documentation_target": "08-design-decisions.md",
|
|
127
|
+
"priority": "critical",
|
|
128
|
+
"research_goal": "Verify data consistency mechanisms",
|
|
129
|
+
"files_to_examine": ["src/cache/RedisAdapter.ts"],
|
|
130
|
+
"reason": "Race conditions in caching can cause data corruption; must document safeguards",
|
|
131
|
+
"research_strategy": {
|
|
132
|
+
"approach": "Trace the 'set' method in RedisAdapter",
|
|
133
|
+
"tools_to_use": ["localSearchCode", "lspCallHierarchy", "localGetFileContent"],
|
|
134
|
+
"expected_findings": "Look for locks or atomic operations"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
</json_structure>
|
|
140
|
+
</output_requirements>
|
|
141
|
+
|
|
142
|
+
<final_gate>
|
|
143
|
+
**STOP. Verify before writing the file:**
|
|
144
|
+
|
|
145
|
+
1. [ ] Are there at least 10 questions?
|
|
146
|
+
2. [ ] Does **EVERY** question have a valid `documentation_target` from the schema?
|
|
147
|
+
3. [ ] Are IDs unique (q001, q002...)?
|
|
148
|
+
4. [ ] Is the JSON valid?
|
|
149
|
+
5. [ ] Did I **STRICTLY** follow `schemas/questions-schema.json`?
|
|
150
|
+
|
|
151
|
+
**FORBIDDEN:** Writing `.context/questions.json` if any check fails.
|
|
152
|
+
</final_gate>
|
|
153
|
+
|
|
154
|
+
## Orchestrator Execution Logic
|
|
155
|
+
|
|
156
|
+
```javascript
|
|
157
|
+
// === PHASE 2: ENGINEER QUESTIONS ===
|
|
158
|
+
if (previous_phase_complete && (START_PHASE != "engineer-questions-complete")):
|
|
159
|
+
update_state({
|
|
160
|
+
phase: "engineer-questions-running",
|
|
161
|
+
current_agent: "engineer-questions"
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
DISPLAY: "🤔 Engineer Questions Agent [Running...]"
|
|
165
|
+
DISPLAY: " Generating comprehensive documentation questions..."
|
|
166
|
+
DISPLAY: ""
|
|
167
|
+
|
|
168
|
+
// Read agent specification
|
|
169
|
+
AGENT_SPEC = Read("references/agent-engineer-questions.md")
|
|
170
|
+
|
|
171
|
+
RESULT = Task({
|
|
172
|
+
subagent_type: "general-purpose",
|
|
173
|
+
description: "Generate comprehensive documentation questions",
|
|
174
|
+
prompt: `
|
|
175
|
+
${AGENT_SPEC}
|
|
176
|
+
|
|
177
|
+
REPOSITORY_PATH = ${REPOSITORY_PATH}
|
|
178
|
+
|
|
179
|
+
Execute the mission defined in the agent specification.
|
|
180
|
+
Write questions.json to ${CONTEXT_DIR}/questions.json
|
|
181
|
+
|
|
182
|
+
Use model: opus
|
|
183
|
+
`
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
// Check result
|
|
187
|
+
if (!exists(CONTEXT_DIR + "/questions.json")):
|
|
188
|
+
ERROR: "Engineer Questions Agent failed to produce questions.json"
|
|
189
|
+
update_state({
|
|
190
|
+
phase: "engineer-questions-failed",
|
|
191
|
+
errors: [{
|
|
192
|
+
phase: "engineer-questions",
|
|
193
|
+
message: "questions.json not created",
|
|
194
|
+
timestamp: new Date().toISOString(),
|
|
195
|
+
recoverable: false
|
|
196
|
+
}]
|
|
197
|
+
})
|
|
198
|
+
DISPLAY: "❌ Engineer Questions Agent [Failed]"
|
|
199
|
+
DISPLAY: "Error: questions.json not created. Cannot proceed."
|
|
200
|
+
EXIT code 1
|
|
201
|
+
|
|
202
|
+
// Validate JSON
|
|
203
|
+
try:
|
|
204
|
+
questions_file = Read(CONTEXT_DIR + "/questions.json")
|
|
205
|
+
parsed_questions = JSON.parse(questions_file)
|
|
206
|
+
|
|
207
|
+
// Validate structure
|
|
208
|
+
if (!parsed_questions.questions || parsed_questions.questions.length < 10):
|
|
209
|
+
ERROR: "questions.json has fewer than 10 questions"
|
|
210
|
+
EXIT code 1
|
|
211
|
+
|
|
212
|
+
// Validate all questions have documentation_target
|
|
213
|
+
missing_targets = parsed_questions.questions.filter(q => !q.documentation_target)
|
|
214
|
+
if (missing_targets.length > 0):
|
|
215
|
+
WARN: missing_targets.length + " questions missing documentation_target"
|
|
216
|
+
|
|
217
|
+
total_questions = parsed_questions.summary.total_questions
|
|
218
|
+
|
|
219
|
+
catch (error):
|
|
220
|
+
ERROR: "questions.json is invalid JSON: " + error.message
|
|
221
|
+
update_state({
|
|
222
|
+
phase: "engineer-questions-failed",
|
|
223
|
+
errors: [{
|
|
224
|
+
phase: "engineer-questions",
|
|
225
|
+
message: "Invalid JSON: " + error.message,
|
|
226
|
+
timestamp: new Date().toISOString(),
|
|
227
|
+
recoverable: false
|
|
228
|
+
}]
|
|
229
|
+
})
|
|
230
|
+
DISPLAY: "❌ Engineer Questions Agent [Failed - Invalid JSON]"
|
|
231
|
+
EXIT code 1
|
|
232
|
+
|
|
233
|
+
// Success
|
|
234
|
+
update_state({
|
|
235
|
+
phase: "engineer-questions-complete",
|
|
236
|
+
completed_agents: ["discovery-analysis", "engineer-questions"],
|
|
237
|
+
current_agent: null
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
DISPLAY: "✅ Engineer Questions Agent [Complete]"
|
|
241
|
+
DISPLAY: " Total questions: {total_questions}"
|
|
242
|
+
DISPLAY: " Critical: {parsed_questions.summary.by_priority.critical}"
|
|
243
|
+
DISPLAY: " High: {parsed_questions.summary.by_priority.high}"
|
|
244
|
+
DISPLAY: " Medium: {parsed_questions.summary.by_priority.medium}"
|
|
245
|
+
DISPLAY: " Low: {parsed_questions.summary.by_priority.low}"
|
|
246
|
+
DISPLAY: ""
|
|
247
|
+
```
|