@ggailabs/cli-context 0.5.5 → 1.0.0
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.
Potentially problematic release.
This version of @ggailabs/cli-context might be problematic. Click here for more details.
- package/dist/.context/docs/GENESIS_SYSTEM_PROMPT.md +62 -0
- package/dist/.context/eng/agents/architect.md +15 -0
- package/dist/.context/eng/agents/backend_typescript.md +1000 -0
- package/dist/.context/eng/agents/bug_hunter.md +49 -0
- package/dist/.context/eng/agents/code_reviewer.md +313 -0
- package/dist/.context/eng/agents/devops_specialist.md +718 -0
- package/dist/.context/eng/agents/frontend_specialist.md +1027 -0
- package/dist/.context/eng/agents/qa_specialist.md +1234 -0
- package/dist/.context/eng/agents/security_reviewer.md +382 -0
- package/dist/.context/eng/agents/ui_specialist.md +16 -0
- package/dist/.context/eng/docs/AGENT_HANDOFF_PROMPT.md +44 -0
- package/dist/.context/eng/docs/GENESIS_DESIGN_SYSTEM.md +15 -0
- package/dist/.context/eng/docs/GG_METHODOLOGY.md +48 -0
- package/dist/.context/eng/docs/OPERATIONS_LOG.md +30 -0
- package/dist/.context/eng/docs/PROJECT_MAP.md +35 -0
- package/dist/.context/eng/docs/standards/devops.md +0 -0
- package/dist/.context/eng/docs/standards/frontend.md +0 -0
- package/dist/.context/eng/docs/standards/typescript.md +12 -0
- package/dist/.context/eng/skills/agent_logging.md +18 -0
- package/dist/.context/eng/skills/brainstorming.md +227 -0
- package/dist/.context/eng/skills/exploring_codebase.md +1217 -0
- package/dist/.context/eng/skills/patterns/compliance_check.md +246 -0
- package/dist/.context/eng/skills/patterns/coverage_table.md +401 -0
- package/dist/.context/eng/skills/patterns/exit_criteria.md +31 -0
- package/dist/.context/eng/skills/patterns/failure_recovery.md +74 -0
- package/dist/.context/eng/skills/patterns/quality_gate.md +295 -0
- package/dist/.context/eng/skills/patterns/standards_workflow.md +391 -0
- package/dist/.context/eng/skills/patterns/state_tracking.md +30 -0
- package/dist/.context/eng/skills/patterns/task_tracking.md +38 -0
- package/dist/.context/eng/skills/previce.md +45 -0
- package/dist/.context/eng/skills/tdd.md +421 -0
- package/dist/.context/eng/skills/writing_plans.md +105 -0
- package/dist/.context/plans/.gitkeep +0 -0
- package/dist/.context/pt-br/agents/architect.md +69 -0
- package/dist/.context/pt-br/agents/backend_typescript.md +1000 -0
- package/dist/.context/pt-br/agents/bug_hunter.md +49 -0
- package/dist/.context/pt-br/agents/code_reviewer.md +313 -0
- package/dist/.context/pt-br/agents/devops_specialist.md +718 -0
- package/dist/.context/pt-br/agents/frontend_specialist.md +1027 -0
- package/dist/.context/pt-br/agents/qa_specialist.md +1234 -0
- package/dist/.context/pt-br/agents/security_reviewer.md +382 -0
- package/dist/.context/pt-br/agents/ui_specialist.md +55 -0
- package/dist/.context/pt-br/docs/AGENT_HANDOFF_PROMPT.md +44 -0
- package/dist/.context/pt-br/docs/GENESIS_DESIGN_SYSTEM.md +88 -0
- package/dist/.context/pt-br/docs/GG_METHODOLOGY.md +48 -0
- package/dist/.context/pt-br/docs/OPERATIONS_LOG.md +30 -0
- package/dist/.context/pt-br/docs/PROJECT_MAP.md +37 -0
- package/dist/.context/pt-br/docs/standards/devops.md +707 -0
- package/dist/.context/pt-br/docs/standards/frontend.md +748 -0
- package/dist/.context/pt-br/docs/standards/typescript.md +1150 -0
- package/dist/.context/pt-br/skills/agent_logging.md +36 -0
- package/dist/.context/pt-br/skills/brainstorming.md +227 -0
- package/dist/.context/pt-br/skills/exploring_codebase.md +1217 -0
- package/dist/.context/pt-br/skills/patterns/compliance_check.md +246 -0
- package/dist/.context/pt-br/skills/patterns/coverage_table.md +401 -0
- package/dist/.context/pt-br/skills/patterns/exit_criteria.md +31 -0
- package/dist/.context/pt-br/skills/patterns/failure_recovery.md +74 -0
- package/dist/.context/pt-br/skills/patterns/quality_gate.md +295 -0
- package/dist/.context/pt-br/skills/patterns/standards_workflow.md +391 -0
- package/dist/.context/pt-br/skills/patterns/state_tracking.md +30 -0
- package/dist/.context/pt-br/skills/patterns/task_tracking.md +38 -0
- package/dist/.context/pt-br/skills/previce.md +45 -0
- package/dist/.context/pt-br/skills/tdd.md +421 -0
- package/dist/.context/pt-br/skills/writing_plans.md +105 -0
- package/dist/.context/workflow/.gitkeep +0 -0
- package/dist/commands/init.js +140 -0
- package/dist/commands/monitor.js +34 -0
- package/dist/index.js +20 -568
- package/dist/services/monitor-service.js +340 -0
- package/dist/services/scaffolder.js +164 -0
- package/package.json +16 -58
- package/LICENSE +0 -21
- package/README.md +0 -197
- package/dist/generators/agents/agentConfig.d.ts +0 -4
- package/dist/generators/agents/agentConfig.d.ts.map +0 -1
- package/dist/generators/agents/agentConfig.js +0 -180
- package/dist/generators/agents/agentConfig.js.map +0 -1
- package/dist/generators/agents/agentGenerator.d.ts +0 -9
- package/dist/generators/agents/agentGenerator.d.ts.map +0 -1
- package/dist/generators/agents/agentGenerator.js +0 -97
- package/dist/generators/agents/agentGenerator.js.map +0 -1
- package/dist/generators/agents/agentTypes.d.ts +0 -4
- package/dist/generators/agents/agentTypes.d.ts.map +0 -1
- package/dist/generators/agents/agentTypes.js +0 -25
- package/dist/generators/agents/agentTypes.js.map +0 -1
- package/dist/generators/agents/index.d.ts +0 -4
- package/dist/generators/agents/index.d.ts.map +0 -1
- package/dist/generators/agents/index.js +0 -12
- package/dist/generators/agents/index.js.map +0 -1
- package/dist/generators/agents/templates/index.d.ts +0 -4
- package/dist/generators/agents/templates/index.d.ts.map +0 -1
- package/dist/generators/agents/templates/index.js +0 -8
- package/dist/generators/agents/templates/index.js.map +0 -1
- package/dist/generators/agents/templates/indexTemplate.d.ts +0 -3
- package/dist/generators/agents/templates/indexTemplate.d.ts.map +0 -1
- package/dist/generators/agents/templates/indexTemplate.js +0 -36
- package/dist/generators/agents/templates/indexTemplate.js.map +0 -1
- package/dist/generators/agents/templates/playbookTemplate.d.ts +0 -4
- package/dist/generators/agents/templates/playbookTemplate.d.ts.map +0 -1
- package/dist/generators/agents/templates/playbookTemplate.js +0 -99
- package/dist/generators/agents/templates/playbookTemplate.js.map +0 -1
- package/dist/generators/agents/templates/types.d.ts +0 -14
- package/dist/generators/agents/templates/types.d.ts.map +0 -1
- package/dist/generators/agents/templates/types.js +0 -3
- package/dist/generators/agents/templates/types.js.map +0 -1
- package/dist/generators/documentation/documentationGenerator.d.ts +0 -15
- package/dist/generators/documentation/documentationGenerator.d.ts.map +0 -1
- package/dist/generators/documentation/documentationGenerator.js +0 -188
- package/dist/generators/documentation/documentationGenerator.js.map +0 -1
- package/dist/generators/documentation/guideRegistry.d.ts +0 -6
- package/dist/generators/documentation/guideRegistry.d.ts.map +0 -1
- package/dist/generators/documentation/guideRegistry.js +0 -82
- package/dist/generators/documentation/guideRegistry.js.map +0 -1
- package/dist/generators/documentation/index.d.ts +0 -2
- package/dist/generators/documentation/index.d.ts.map +0 -1
- package/dist/generators/documentation/index.js +0 -6
- package/dist/generators/documentation/index.js.map +0 -1
- package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/apiReferenceTemplate.js +0 -490
- package/dist/generators/documentation/templates/apiReferenceTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/architectureTemplate.d.ts +0 -3
- package/dist/generators/documentation/templates/architectureTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/architectureTemplate.js +0 -66
- package/dist/generators/documentation/templates/architectureTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/common.d.ts +0 -7
- package/dist/generators/documentation/templates/common.d.ts.map +0 -1
- package/dist/generators/documentation/templates/common.js +0 -58
- package/dist/generators/documentation/templates/common.js.map +0 -1
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts +0 -3
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/dataFlowTemplate.js +0 -40
- package/dist/generators/documentation/templates/dataFlowTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js +0 -44
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts +0 -3
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/glossaryTemplate.js +0 -41
- package/dist/generators/documentation/templates/glossaryTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/index.d.ts +0 -15
- package/dist/generators/documentation/templates/index.d.ts.map +0 -1
- package/dist/generators/documentation/templates/index.js +0 -30
- package/dist/generators/documentation/templates/index.js.map +0 -1
- package/dist/generators/documentation/templates/indexTemplate.d.ts +0 -3
- package/dist/generators/documentation/templates/indexTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/indexTemplate.js +0 -42
- package/dist/generators/documentation/templates/indexTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/migrationTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/migrationTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/migrationTemplate.js +0 -422
- package/dist/generators/documentation/templates/migrationTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/onboardingTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/onboardingTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/onboardingTemplate.js +0 -431
- package/dist/generators/documentation/templates/onboardingTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts +0 -3
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/projectOverviewTemplate.js +0 -65
- package/dist/generators/documentation/templates/projectOverviewTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/securityTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/securityTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/securityTemplate.js +0 -39
- package/dist/generators/documentation/templates/securityTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/testingTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/testingTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/testingTemplate.js +0 -45
- package/dist/generators/documentation/templates/testingTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/toolingTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/toolingTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/toolingTemplate.js +0 -42
- package/dist/generators/documentation/templates/toolingTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts +0 -2
- package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts.map +0 -1
- package/dist/generators/documentation/templates/troubleshootingTemplate.js +0 -292
- package/dist/generators/documentation/templates/troubleshootingTemplate.js.map +0 -1
- package/dist/generators/documentation/templates/types.d.ts +0 -23
- package/dist/generators/documentation/templates/types.d.ts.map +0 -1
- package/dist/generators/documentation/templates/types.js +0 -3
- package/dist/generators/documentation/templates/types.js.map +0 -1
- package/dist/generators/plans/index.d.ts +0 -2
- package/dist/generators/plans/index.d.ts.map +0 -1
- package/dist/generators/plans/index.js +0 -6
- package/dist/generators/plans/index.js.map +0 -1
- package/dist/generators/plans/planGenerator.d.ts +0 -22
- package/dist/generators/plans/planGenerator.d.ts.map +0 -1
- package/dist/generators/plans/planGenerator.js +0 -109
- package/dist/generators/plans/planGenerator.js.map +0 -1
- package/dist/generators/plans/templates/indexTemplate.d.ts +0 -3
- package/dist/generators/plans/templates/indexTemplate.d.ts.map +0 -1
- package/dist/generators/plans/templates/indexTemplate.js +0 -37
- package/dist/generators/plans/templates/indexTemplate.js.map +0 -1
- package/dist/generators/plans/templates/planTemplate.d.ts +0 -3
- package/dist/generators/plans/templates/planTemplate.d.ts.map +0 -1
- package/dist/generators/plans/templates/planTemplate.js +0 -166
- package/dist/generators/plans/templates/planTemplate.js.map +0 -1
- package/dist/generators/plans/templates/types.d.ts +0 -19
- package/dist/generators/plans/templates/types.d.ts.map +0 -1
- package/dist/generators/plans/templates/types.js +0 -3
- package/dist/generators/plans/templates/types.js.map +0 -1
- package/dist/generators/shared/contextGenerator.d.ts +0 -7
- package/dist/generators/shared/contextGenerator.d.ts.map +0 -1
- package/dist/generators/shared/contextGenerator.js +0 -13
- package/dist/generators/shared/contextGenerator.js.map +0 -1
- package/dist/generators/shared/directoryTemplateHelpers.d.ts +0 -2
- package/dist/generators/shared/directoryTemplateHelpers.d.ts.map +0 -1
- package/dist/generators/shared/directoryTemplateHelpers.js +0 -12
- package/dist/generators/shared/directoryTemplateHelpers.js.map +0 -1
- package/dist/generators/shared/generatorUtils.d.ts +0 -16
- package/dist/generators/shared/generatorUtils.d.ts.map +0 -1
- package/dist/generators/shared/generatorUtils.js +0 -119
- package/dist/generators/shared/generatorUtils.js.map +0 -1
- package/dist/generators/shared/index.d.ts +0 -4
- package/dist/generators/shared/index.d.ts.map +0 -1
- package/dist/generators/shared/index.js +0 -10
- package/dist/generators/shared/index.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/prompts/defaults.d.ts +0 -3
- package/dist/prompts/defaults.d.ts.map +0 -1
- package/dist/prompts/defaults.js +0 -95
- package/dist/prompts/defaults.js.map +0 -1
- package/dist/services/baseLLMClient.d.ts +0 -12
- package/dist/services/baseLLMClient.d.ts.map +0 -1
- package/dist/services/baseLLMClient.js +0 -80
- package/dist/services/baseLLMClient.js.map +0 -1
- package/dist/services/fill/fillService.d.ts +0 -46
- package/dist/services/fill/fillService.d.ts.map +0 -1
- package/dist/services/fill/fillService.js +0 -254
- package/dist/services/fill/fillService.js.map +0 -1
- package/dist/services/init/initService.d.ts +0 -37
- package/dist/services/init/initService.d.ts.map +0 -1
- package/dist/services/init/initService.js +0 -167
- package/dist/services/init/initService.js.map +0 -1
- package/dist/services/llmClientFactory.d.ts +0 -8
- package/dist/services/llmClientFactory.d.ts.map +0 -1
- package/dist/services/llmClientFactory.js +0 -23
- package/dist/services/llmClientFactory.js.map +0 -1
- package/dist/services/openRouterClient.d.ts +0 -9
- package/dist/services/openRouterClient.d.ts.map +0 -1
- package/dist/services/openRouterClient.js +0 -49
- package/dist/services/openRouterClient.js.map +0 -1
- package/dist/services/plan/planService.d.ts +0 -57
- package/dist/services/plan/planService.d.ts.map +0 -1
- package/dist/services/plan/planService.js +0 -334
- package/dist/services/plan/planService.js.map +0 -1
- package/dist/services/shared/llmConfig.d.ts +0 -22
- package/dist/services/shared/llmConfig.d.ts.map +0 -1
- package/dist/services/shared/llmConfig.js +0 -38
- package/dist/services/shared/llmConfig.js.map +0 -1
- package/dist/types.d.ts +0 -65
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/utils/cliUI.d.ts +0 -27
- package/dist/utils/cliUI.d.ts.map +0 -1
- package/dist/utils/cliUI.js +0 -252
- package/dist/utils/cliUI.js.map +0 -1
- package/dist/utils/fileMapper.d.ts +0 -11
- package/dist/utils/fileMapper.d.ts.map +0 -1
- package/dist/utils/fileMapper.js +0 -146
- package/dist/utils/fileMapper.js.map +0 -1
- package/dist/utils/gitService.d.ts +0 -50
- package/dist/utils/gitService.d.ts.map +0 -1
- package/dist/utils/gitService.js +0 -470
- package/dist/utils/gitService.js.map +0 -1
- package/dist/utils/i18n.d.ts +0 -171
- package/dist/utils/i18n.d.ts.map +0 -1
- package/dist/utils/i18n.js +0 -381
- package/dist/utils/i18n.js.map +0 -1
- package/dist/utils/promptLoader.d.ts +0 -12
- package/dist/utils/promptLoader.d.ts.map +0 -1
- package/dist/utils/promptLoader.js +0 -81
- package/dist/utils/promptLoader.js.map +0 -1
- package/dist/utils/versionChecker.d.ts +0 -15
- package/dist/utils/versionChecker.d.ts.map +0 -1
- package/dist/utils/versionChecker.js +0 -49
- package/dist/utils/versionChecker.js.map +0 -1
- package/prompts/update_plan_prompt.md +0 -41
- package/prompts/update_scaffold_prompt.md +0 -47
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderTroubleshooting = renderTroubleshooting;
|
|
4
|
-
function renderTroubleshooting() {
|
|
5
|
-
return `
|
|
6
|
-
<!-- agent-update:start:troubleshooting-guide -->
|
|
7
|
-
# Troubleshooting Guide
|
|
8
|
-
|
|
9
|
-
**Purpose:** Enable AI agents to diagnose and resolve issues using automated diagnostics and decision trees.
|
|
10
|
-
|
|
11
|
-
**Agent Protocol:**
|
|
12
|
-
1. Run diagnostic script to gather facts
|
|
13
|
-
2. Match symptoms to known patterns
|
|
14
|
-
3. Execute resolution if confidence high (>80%)
|
|
15
|
-
4. Escalate to human if uncertain or high-risk
|
|
16
|
-
5. Log all diagnostic steps and resolution attempts
|
|
17
|
-
|
|
18
|
-
## Agent Diagnostic Script
|
|
19
|
-
|
|
20
|
-
**Agent First Action:** Always run this diagnostic script to gather system state.
|
|
21
|
-
|
|
22
|
-
\`\`\`bash
|
|
23
|
-
#!/bin/bash
|
|
24
|
-
# Save as: scripts/diagnose.sh
|
|
25
|
-
# Agent runs this for ANY issue before attempting fixes
|
|
26
|
-
|
|
27
|
-
echo "=== System Diagnostics $(date) ==="
|
|
28
|
-
|
|
29
|
-
# 1. Application Status
|
|
30
|
-
echo -e "\\n[Application Status]"
|
|
31
|
-
curl -sf http://localhost:3000/health && echo "✓ App responding" || echo "✗ App not responding"
|
|
32
|
-
|
|
33
|
-
# 2. Recent Errors
|
|
34
|
-
echo -e "\\n[Recent Errors - Last 50 lines]"
|
|
35
|
-
tail -50 logs/error.log 2>/dev/null || echo "No error log found"
|
|
36
|
-
|
|
37
|
-
# 3. System Resources
|
|
38
|
-
echo -e "\\n[System Resources]"
|
|
39
|
-
echo "CPU: $(top -bn1 | grep "Cpu(s)" | awk '{print $2}')%"
|
|
40
|
-
echo "Memory: $(free -h | awk '/^Mem:/ {print $3 "/" $2}')"
|
|
41
|
-
echo "Disk: $(df -h / | awk 'NR==2 {print $5 " used"}')"
|
|
42
|
-
|
|
43
|
-
# 4. Critical Services
|
|
44
|
-
echo -e "\\n[Critical Services]"
|
|
45
|
-
nc -z localhost 5432 && echo "✓ Database reachable" || echo "✗ Database unreachable"
|
|
46
|
-
nc -z localhost 6379 && echo "✓ Redis reachable" || echo "✗ Redis unreachable"
|
|
47
|
-
|
|
48
|
-
# 5. Recent Git Changes
|
|
49
|
-
echo -e "\\n[Recent Changes]"
|
|
50
|
-
git log --oneline -5
|
|
51
|
-
|
|
52
|
-
# 6. Running Processes
|
|
53
|
-
echo -e "\\n[Node Processes]"
|
|
54
|
-
ps aux | grep -i node | grep -v grep
|
|
55
|
-
|
|
56
|
-
echo -e "\\n=== Diagnostics Complete ==="
|
|
57
|
-
\`\`\`
|
|
58
|
-
|
|
59
|
-
**Agent Usage:**
|
|
60
|
-
\`\`\`bash
|
|
61
|
-
chmod +x scripts/diagnose.sh
|
|
62
|
-
./scripts/diagnose.sh > diagnostics-$(date +%Y%m%d-%H%M%S).txt
|
|
63
|
-
# Agent parses output to determine issue category
|
|
64
|
-
\`\`\`
|
|
65
|
-
|
|
66
|
-
## Agent Decision Tree
|
|
67
|
-
|
|
68
|
-
**Agent follows this tree based on diagnostic output:**
|
|
69
|
-
|
|
70
|
-
\`\`\`
|
|
71
|
-
App not responding?
|
|
72
|
-
├─ YES → Check "Application Won't Start" section
|
|
73
|
-
└─ NO → Continue
|
|
74
|
-
|
|
75
|
-
Database unreachable?
|
|
76
|
-
├─ YES → Check "Database Issues" section
|
|
77
|
-
└─ NO → Continue
|
|
78
|
-
|
|
79
|
-
Error log has entries?
|
|
80
|
-
├─ YES → Parse errors, match to "Common Issues" patterns
|
|
81
|
-
└─ NO → Check "Performance Issues" section
|
|
82
|
-
|
|
83
|
-
CPU > 80% OR Memory > 90%?
|
|
84
|
-
├─ YES → Check "Performance/Memory Issues" section
|
|
85
|
-
└─ NO → Escalate (unusual state, no clear pattern)
|
|
86
|
-
\`\`\`
|
|
87
|
-
|
|
88
|
-
**Agent Pattern Matching:**
|
|
89
|
-
\`\`\`bash
|
|
90
|
-
# Agent extracts last error from log
|
|
91
|
-
LAST_ERROR=$(tail -1 logs/error.log)
|
|
92
|
-
|
|
93
|
-
# Agent matches against known patterns
|
|
94
|
-
if echo "$LAST_ERROR" | grep -q "ECONNREFUSED"; then
|
|
95
|
-
# Database connection issue
|
|
96
|
-
ISSUE_TYPE="database_connection"
|
|
97
|
-
CONFIDENCE="high"
|
|
98
|
-
elif echo "$LAST_ERROR" | grep -q "EADDRINUSE"; then
|
|
99
|
-
# Port conflict
|
|
100
|
-
ISSUE_TYPE="port_in_use"
|
|
101
|
-
CONFIDENCE="high"
|
|
102
|
-
elif echo "$LAST_ERROR" | grep -q "Cannot find module"; then
|
|
103
|
-
# Missing dependency
|
|
104
|
-
ISSUE_TYPE="missing_dependency"
|
|
105
|
-
CONFIDENCE="high"
|
|
106
|
-
else
|
|
107
|
-
# Unknown pattern
|
|
108
|
-
ISSUE_TYPE="unknown"
|
|
109
|
-
CONFIDENCE="low"
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
# Agent decides action based on confidence
|
|
113
|
-
if [ "$CONFIDENCE" == "high" ]; then
|
|
114
|
-
echo "Agent attempting auto-resolution for $ISSUE_TYPE"
|
|
115
|
-
# Execute fix from "Common Issues" section
|
|
116
|
-
else
|
|
117
|
-
echo "Agent escalating: unknown error pattern"
|
|
118
|
-
# Create issue with diagnostic output
|
|
119
|
-
fi
|
|
120
|
-
\`\`\`
|
|
121
|
-
|
|
122
|
-
## Common Issues & Solutions
|
|
123
|
-
|
|
124
|
-
### Application Won't Start
|
|
125
|
-
|
|
126
|
-
**Agent Auto-Resolution: YES (safe to attempt)**
|
|
127
|
-
|
|
128
|
-
#### Error Pattern: "EADDRINUSE"
|
|
129
|
-
**Agent Detection:** Log contains "EADDRINUSE" or "port already in use"
|
|
130
|
-
|
|
131
|
-
**Agent Resolution:**
|
|
132
|
-
\`\`\`bash
|
|
133
|
-
# Agent automatically kills process and restarts
|
|
134
|
-
PORT=\${PORT:-3000}
|
|
135
|
-
PID=$(lsof -ti:\$PORT)
|
|
136
|
-
if [ -n "\$PID" ]; then
|
|
137
|
-
echo "Killing process \$PID on port \$PORT"
|
|
138
|
-
kill -9 \$PID
|
|
139
|
-
sleep 2
|
|
140
|
-
fi
|
|
141
|
-
npm start
|
|
142
|
-
# Agent verifies: curl -f http://localhost:\$PORT/health
|
|
143
|
-
\`\`\`
|
|
144
|
-
|
|
145
|
-
#### Error Pattern: "Cannot find module"
|
|
146
|
-
**Agent Detection:** Log contains "Cannot find module" or "MODULE_NOT_FOUND"
|
|
147
|
-
|
|
148
|
-
**Agent Resolution:**
|
|
149
|
-
\`\`\`bash
|
|
150
|
-
# Agent reinstalls dependencies
|
|
151
|
-
rm -rf node_modules package-lock.json
|
|
152
|
-
npm install
|
|
153
|
-
npm start
|
|
154
|
-
# Agent logs: "Resolved missing module issue by reinstalling dependencies"
|
|
155
|
-
\`\`\`
|
|
156
|
-
|
|
157
|
-
#### Error Pattern: "Missing environment variable"
|
|
158
|
-
**Agent Detection:** Log contains "undefined" for env var or "Missing required environment variable"
|
|
159
|
-
|
|
160
|
-
**Agent Resolution:**
|
|
161
|
-
\`\`\`bash
|
|
162
|
-
# Agent checks .env.example for required vars
|
|
163
|
-
REQUIRED_VARS=$(grep -v "^#" .env.example | cut -d= -f1)
|
|
164
|
-
for VAR in \$REQUIRED_VARS; do
|
|
165
|
-
if [ -z "\${!VAR}" ]; then
|
|
166
|
-
echo "ERROR: Missing required environment variable: \$VAR"
|
|
167
|
-
echo "Agent cannot auto-resolve. Escalating to human."
|
|
168
|
-
exit 1
|
|
169
|
-
fi
|
|
170
|
-
done
|
|
171
|
-
\`\`\`
|
|
172
|
-
**Agent Action:** ESCALATE (requires human to set values)
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
### Performance Issues
|
|
177
|
-
|
|
178
|
-
**Agent Auto-Resolution: CONDITIONAL (depends on cause)**
|
|
179
|
-
|
|
180
|
-
#### Error Pattern: High CPU Usage
|
|
181
|
-
**Agent Detection:** CPU >80% sustained for >5 minutes
|
|
182
|
-
|
|
183
|
-
**Agent Diagnostic:**
|
|
184
|
-
\`\`\`bash
|
|
185
|
-
# Agent identifies high CPU process
|
|
186
|
-
top -bn1 | head -20
|
|
187
|
-
ps aux --sort=-%cpu | head -10
|
|
188
|
-
|
|
189
|
-
# Agent checks if it's the application
|
|
190
|
-
APP_PID=$(ps aux | grep "node.*index.js" | grep -v grep | awk '{print \$2}')
|
|
191
|
-
APP_CPU=$(ps aux | grep \$APP_PID | awk '{print \$3}')
|
|
192
|
-
|
|
193
|
-
if (( \$(echo "\$APP_CPU > 80" | bc -l) )); then
|
|
194
|
-
echo "Application consuming high CPU: \${APP_CPU}%"
|
|
195
|
-
echo "Agent Action: Restart application"
|
|
196
|
-
pm2 restart app || npm run restart
|
|
197
|
-
else
|
|
198
|
-
echo "External process consuming CPU - Agent escalating to human"
|
|
199
|
-
fi
|
|
200
|
-
\`\`\`
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
### Database Issues
|
|
205
|
-
|
|
206
|
-
**Agent Auto-Resolution: CONDITIONAL**
|
|
207
|
-
|
|
208
|
-
#### Error Pattern: "ECONNREFUSED" (Database)
|
|
209
|
-
**Agent Detection:** Log contains "ECONNREFUSED" with database port (5432, 3306, 27017)
|
|
210
|
-
|
|
211
|
-
**Agent Diagnostic:**
|
|
212
|
-
\`\`\`bash
|
|
213
|
-
# Check if database is running
|
|
214
|
-
nc -z localhost 5432 && echo "DB reachable" || echo "DB not reachable"
|
|
215
|
-
|
|
216
|
-
# If not reachable, attempt to start
|
|
217
|
-
if ! nc -z localhost 5432; then
|
|
218
|
-
echo "Agent attempting to start database..."
|
|
219
|
-
docker-compose up -d db || sudo systemctl start postgresql
|
|
220
|
-
sleep 5
|
|
221
|
-
nc -z localhost 5432 && echo "✓ Database started" || echo "✗ Failed to start - escalating"
|
|
222
|
-
fi
|
|
223
|
-
\`\`\`
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## Escalation Criteria
|
|
228
|
-
|
|
229
|
-
**Agent must escalate immediately when:**
|
|
230
|
-
- Unknown error pattern (confidence <50%)
|
|
231
|
-
- Data corruption risk (database migration failures, validation errors)
|
|
232
|
-
- Security issue detected (exposed credentials, unauthorized access)
|
|
233
|
-
- Multiple resolution attempts failed (tried 2+ fixes, issue persists)
|
|
234
|
-
- Human approval required (destructive operations, production changes)
|
|
235
|
-
|
|
236
|
-
**Escalation format:**
|
|
237
|
-
\`\`\`bash
|
|
238
|
-
# Agent creates structured escalation
|
|
239
|
-
cat > escalation-\$(date +%Y%m%d-%H%M%S).txt <<EOF
|
|
240
|
-
ESCALATION REQUIRED
|
|
241
|
-
|
|
242
|
-
Issue: [Brief description]
|
|
243
|
-
Confidence: [low/medium]
|
|
244
|
-
Risk Level: [low/medium/high]
|
|
245
|
-
|
|
246
|
-
Symptoms:
|
|
247
|
-
- [List observed symptoms]
|
|
248
|
-
|
|
249
|
-
Diagnostics Run:
|
|
250
|
-
- [Commands executed]
|
|
251
|
-
- [Output summary]
|
|
252
|
-
|
|
253
|
-
Resolution Attempts:
|
|
254
|
-
- [What agent tried]
|
|
255
|
-
- [Results]
|
|
256
|
-
|
|
257
|
-
Recommendation:
|
|
258
|
-
- [Suggested next steps for human]
|
|
259
|
-
|
|
260
|
-
Diagnostic Files:
|
|
261
|
-
- diagnostics-*.txt
|
|
262
|
-
- logs/error.log (last 100 lines attached below)
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
\$(tail -100 logs/error.log)
|
|
266
|
-
EOF
|
|
267
|
-
|
|
268
|
-
echo "Escalation created. Agent awaiting human intervention."
|
|
269
|
-
\`\`\`
|
|
270
|
-
|
|
271
|
-
<!-- agent-readonly:guidance -->
|
|
272
|
-
## AI Update Checklist
|
|
273
|
-
1. Review recent incident reports and add new common issues
|
|
274
|
-
2. Update diagnostic commands to match current tooling
|
|
275
|
-
3. Verify contact information and escalation paths are current
|
|
276
|
-
4. Add workarounds for newly discovered issues
|
|
277
|
-
5. Update log locations and monitoring tool links
|
|
278
|
-
6. Validate that debugging workflows match current setup
|
|
279
|
-
7. Add new error patterns from support tickets
|
|
280
|
-
|
|
281
|
-
<!-- agent-readonly:sources -->
|
|
282
|
-
## Acceptable Sources
|
|
283
|
-
- Post-mortem and incident reports
|
|
284
|
-
- Support ticket patterns and resolutions
|
|
285
|
-
- Production logs and error tracking systems
|
|
286
|
-
- Team knowledge base and runbooks
|
|
287
|
-
- Infrastructure and monitoring configurations
|
|
288
|
-
|
|
289
|
-
<!-- agent-update:end -->
|
|
290
|
-
`;
|
|
291
|
-
}
|
|
292
|
-
//# sourceMappingURL=troubleshootingTemplate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"troubleshootingTemplate.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/troubleshootingTemplate.ts"],"names":[],"mappings":";;AACA,sDAgSC;AAhSD,SAAgB,qBAAqB;IAEnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6RR,CAAC;AACF,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { RepoStructure } from '../../../types';
|
|
2
|
-
export interface GuideMeta {
|
|
3
|
-
key: string;
|
|
4
|
-
title: string;
|
|
5
|
-
file: string;
|
|
6
|
-
marker: string;
|
|
7
|
-
primaryInputs: string;
|
|
8
|
-
}
|
|
9
|
-
export interface DirectoryStat {
|
|
10
|
-
name: string;
|
|
11
|
-
fileCount: number;
|
|
12
|
-
}
|
|
13
|
-
export interface DocumentationTemplateContext {
|
|
14
|
-
repoStructure: RepoStructure;
|
|
15
|
-
topLevelDirectories: string[];
|
|
16
|
-
primaryLanguages: Array<{
|
|
17
|
-
extension: string;
|
|
18
|
-
count: number;
|
|
19
|
-
}>;
|
|
20
|
-
directoryStats: DirectoryStat[];
|
|
21
|
-
guides: GuideMeta[];
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,aAAa,CAAC;IAC7B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,gBAAgB,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/plans/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlanGenerator = void 0;
|
|
4
|
-
var planGenerator_1 = require("./planGenerator");
|
|
5
|
-
Object.defineProperty(exports, "PlanGenerator", { enumerable: true, get: function () { return planGenerator_1.PlanGenerator; } });
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/plans/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface PlanGeneratorOptions {
|
|
2
|
-
planName: string;
|
|
3
|
-
outputDir: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
summary?: string;
|
|
6
|
-
selectedAgentTypes?: string[] | null;
|
|
7
|
-
selectedDocKeys?: string[] | null;
|
|
8
|
-
force?: boolean;
|
|
9
|
-
verbose?: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface PlanGenerationResult {
|
|
12
|
-
planPath: string;
|
|
13
|
-
relativePath: string;
|
|
14
|
-
slug: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class PlanGenerator {
|
|
17
|
-
generatePlan(options: PlanGeneratorOptions): Promise<PlanGenerationResult>;
|
|
18
|
-
private resolveAgents;
|
|
19
|
-
private updatePlanIndex;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=planGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"planGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/plans/planGenerator.ts"],"names":[],"mappings":"AAWA,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,aAAa;IAClB,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA4DhF,OAAO,CAAC,aAAa;YAmBP,eAAe;CAkB9B"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PlanGenerator = void 0;
|
|
37
|
-
const path = __importStar(require("path"));
|
|
38
|
-
const fs = __importStar(require("fs-extra"));
|
|
39
|
-
const shared_1 = require("../shared");
|
|
40
|
-
const agentTypes_1 = require("../agents/agentTypes");
|
|
41
|
-
const agentConfig_1 = require("../agents/agentConfig");
|
|
42
|
-
const guideRegistry_1 = require("../documentation/guideRegistry");
|
|
43
|
-
const planTemplate_1 = require("./templates/planTemplate");
|
|
44
|
-
const indexTemplate_1 = require("./templates/indexTemplate");
|
|
45
|
-
class PlanGenerator {
|
|
46
|
-
async generatePlan(options) {
|
|
47
|
-
const { planName, outputDir, title, summary, selectedAgentTypes, selectedDocKeys, force = false, verbose = false } = options;
|
|
48
|
-
const slug = shared_1.GeneratorUtils.slugify(planName);
|
|
49
|
-
if (!slug) {
|
|
50
|
-
throw new Error('Plan name must contain at least one alphanumeric character.');
|
|
51
|
-
}
|
|
52
|
-
const planTitle = title?.trim() || shared_1.GeneratorUtils.formatTitle(slug);
|
|
53
|
-
const resolvedOutput = path.resolve(outputDir);
|
|
54
|
-
const plansDir = path.join(resolvedOutput, 'plans');
|
|
55
|
-
await fs.ensureDir(resolvedOutput);
|
|
56
|
-
await shared_1.GeneratorUtils.ensureDirectoryAndLog(plansDir, verbose, 'Ensuring plans directory');
|
|
57
|
-
const planFileName = `${slug}.md`;
|
|
58
|
-
const planPath = path.join(plansDir, planFileName);
|
|
59
|
-
if (!force && await fs.pathExists(planPath)) {
|
|
60
|
-
throw new Error(`Plan already exists at ${planPath}. Use --force to overwrite.`);
|
|
61
|
-
}
|
|
62
|
-
const agentSummaries = this.resolveAgents(selectedAgentTypes);
|
|
63
|
-
const docGuides = selectedDocKeys === null
|
|
64
|
-
? []
|
|
65
|
-
: (0, guideRegistry_1.getGuidesByKeys)(selectedDocKeys || undefined);
|
|
66
|
-
const content = (0, planTemplate_1.renderPlanTemplate)({
|
|
67
|
-
title: planTitle,
|
|
68
|
-
slug,
|
|
69
|
-
summary,
|
|
70
|
-
agents: agentSummaries,
|
|
71
|
-
docs: docGuides
|
|
72
|
-
});
|
|
73
|
-
await shared_1.GeneratorUtils.writeFileWithLogging(planPath, content, verbose, `Created ${planFileName}`);
|
|
74
|
-
await this.updatePlanIndex(plansDir, verbose);
|
|
75
|
-
return {
|
|
76
|
-
planPath,
|
|
77
|
-
relativePath: path.relative(resolvedOutput, planPath),
|
|
78
|
-
slug
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
resolveAgents(selected) {
|
|
82
|
-
const allowed = new Set(Array.from(agentTypes_1.AGENT_TYPES));
|
|
83
|
-
if (selected === null) {
|
|
84
|
-
return [];
|
|
85
|
-
}
|
|
86
|
-
const chosen = selected && selected.length > 0
|
|
87
|
-
? Array.from(new Set(selected.map(value => value.toLowerCase().trim())))
|
|
88
|
-
.filter(value => allowed.has(value))
|
|
89
|
-
: Array.from(allowed);
|
|
90
|
-
return chosen.map(type => ({
|
|
91
|
-
type,
|
|
92
|
-
title: shared_1.GeneratorUtils.formatTitle(type),
|
|
93
|
-
responsibility: agentConfig_1.AGENT_RESPONSIBILITIES[type]?.[0] || 'Document this agent\'s primary responsibility.'
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
async updatePlanIndex(plansDir, verbose) {
|
|
97
|
-
const files = await fs.readdir(plansDir);
|
|
98
|
-
const entries = files
|
|
99
|
-
.filter(file => file.toLowerCase().endsWith('.md') && file.toLowerCase() !== 'readme.md')
|
|
100
|
-
.map(file => file.replace(/\.md$/i, ''))
|
|
101
|
-
.map(slug => ({ slug, title: shared_1.GeneratorUtils.formatTitle(slug) }))
|
|
102
|
-
.sort((a, b) => a.title.localeCompare(b.title));
|
|
103
|
-
const indexContent = (0, indexTemplate_1.renderPlanIndex)(entries);
|
|
104
|
-
const indexPath = path.join(plansDir, 'README.md');
|
|
105
|
-
await shared_1.GeneratorUtils.writeFileWithLogging(indexPath, indexContent, verbose, 'Updated plans index');
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.PlanGenerator = PlanGenerator;
|
|
109
|
-
//# sourceMappingURL=planGenerator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"planGenerator.js","sourceRoot":"","sources":["../../../src/generators/plans/planGenerator.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/plans/templates/indexTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,CAiCjE"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderPlanIndex = renderPlanIndex;
|
|
4
|
-
function renderPlanIndex(entries) {
|
|
5
|
-
const planList = entries.length
|
|
6
|
-
? entries
|
|
7
|
-
.map((entry, index) => `${index + 1}. [${entry.title}](./${entry.slug}.md)`)
|
|
8
|
-
.join('\n')
|
|
9
|
-
: '_No plans created yet. Use "ai-context plan <name>" to create the first one._';
|
|
10
|
-
return `# Collaboration Plans
|
|
11
|
-
|
|
12
|
-
This directory is the run queue for AI agents and maintainers coordinating work across documentation and playbooks. Treat the list below as an ordered backlog: finish the first plan before moving on to the next unless a human directs otherwise.
|
|
13
|
-
|
|
14
|
-
## Agent Execution Protocol
|
|
15
|
-
1. **Read the queue** from top to bottom. The numbering reflects execution priority.
|
|
16
|
-
2. **Open the plan file** (e.g., './plans/<slug>.md') and review the YAML front matter and the '<!-- agent-update:start:plan-... -->' wrapper so you understand the goal, required inputs, and success criteria.
|
|
17
|
-
3. **Gather context** by visiting the linked documentation and agent playbooks referenced in the "Agent Lineup" and "Documentation Touchpoints" tables.
|
|
18
|
-
4. **Execute the stages** exactly as written, capturing evidence and updating linked docs as instructed. If a stage cannot be completed, record the reason inside the plan before pausing.
|
|
19
|
-
5. **Close out the plan** by updating any TODOs, recording outcomes in the "Evidence & Follow-up" section, and notifying maintainers if human review is required.
|
|
20
|
-
6. **Return here** and pick the next plan in the queue. Always leave the README and plan files consistent with the work performed.
|
|
21
|
-
|
|
22
|
-
## Plan Queue (process in order)
|
|
23
|
-
${planList}
|
|
24
|
-
|
|
25
|
-
## How To Create Or Update Plans
|
|
26
|
-
- Run "ai-context plan <name>" to scaffold a new plan template.
|
|
27
|
-
- Run "ai-context plan <name> --fill" (optionally with "--dry-run") to have an LLM refresh the plan using the latest repository context.
|
|
28
|
-
- Cross-link any new documentation or agent resources you introduce so future runs stay discoverable.
|
|
29
|
-
|
|
30
|
-
## Related Resources
|
|
31
|
-
- [Agent Handbook](../agents/README.md)
|
|
32
|
-
- [Documentation Index](../docs/README.md)
|
|
33
|
-
- [Agent Knowledge Base](../../AGENTS.md)
|
|
34
|
-
- [Contributor Guidelines](../../CONTRIBUTING.md)
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=indexTemplate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexTemplate.js","sourceRoot":"","sources":["../../../../src/generators/plans/templates/indexTemplate.ts"],"names":[],"mappings":";;AAEA,0CAiCC;AAjCD,SAAgB,eAAe,CAAC,OAAyB;IACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM;QAC7B,CAAC,CAAC,OAAO;aACJ,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,IAAI,MAAM,CAAC;aAC3E,IAAI,CAAC,IAAI,CAAC;QACf,CAAC,CAAC,+EAA+E,CAAC;IAEpF,OAAO;;;;;;;;;;;;;EAaP,QAAQ;;;;;;;;;;;;CAYT,CAAC;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"planTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/plans/templates/planTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAqKvE"}
|