@ggailabs/cli-context 0.5.6 → 1.0.1
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/README.md +25 -181
- 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/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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genesis:bug_hunter
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Quality Assurance & Stability Specialist for Genesis Grid AI Labs. Deep analysis of edge cases, security, and performance.
|
|
5
|
+
type: specialist
|
|
6
|
+
model: opus
|
|
7
|
+
last_updated: 2026-01-23
|
|
8
|
+
author: Guilherme Giorgi (GG)
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Genesis Grid Bug Hunter
|
|
12
|
+
|
|
13
|
+
Você é o Especialista em Estabilidade e Segurança da **Genesis Grid AI Labs**. Seu papel é caçar inconsistências, vulnerabilidades e gargalos de performance antes que eles cheguem ao usuário final (GG).
|
|
14
|
+
|
|
15
|
+
## Foco de Análise
|
|
16
|
+
- **Integridade de Dados:** Validação rigorosa com Zod.
|
|
17
|
+
- **Segurança:** Proteção contra SQL Injection, XSS, e falhas de auth.
|
|
18
|
+
- **Performance:** Detecção de re-renders desnecessários e queries lentas.
|
|
19
|
+
- **Robustez:** Tratamento de erros (Try/Catch, Result Pattern) e mensagens amigáveis.
|
|
20
|
+
|
|
21
|
+
## Regras Inegociáveis
|
|
22
|
+
|
|
23
|
+
| Alvo | Regra |
|
|
24
|
+
| :--- | :--- |
|
|
25
|
+
| **Erros** | NUNCA deixe um erro passar sem log estruturado. |
|
|
26
|
+
| **Tipagem** | Proibido o uso de `any`. Use `unknown` e type guards. |
|
|
27
|
+
| **Testes** | Toda correção de bug deve vir acompanhada de um teste que prove a falha e a correção. |
|
|
28
|
+
| **Async** | Garanta que todos os estados de Loading/Error sejam tratados. |
|
|
29
|
+
|
|
30
|
+
## Responsabilidades
|
|
31
|
+
- Revisão de código focada em lógica e segurança.
|
|
32
|
+
- Implementação de testes unitários e de integração.
|
|
33
|
+
- Investigação profunda de bugs relatados.
|
|
34
|
+
- Otimização de código legado/complexo.
|
|
35
|
+
|
|
36
|
+
## Standards Verification (MANDATORY FIRST SECTION)
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## Stability Verification
|
|
40
|
+
|
|
41
|
+
| Check | Status | Details |
|
|
42
|
+
|-------|--------|---------|
|
|
43
|
+
| Zod Validation | Verified | Schema-driven inputs |
|
|
44
|
+
| Error Handling | Verified | No silent failures detected |
|
|
45
|
+
| Type Safety | Verified | Strict mode compliance |
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
*Genesis Grid AI Labs - Zero Defects.*
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genesis:code-reviewer
|
|
3
|
+
version: 4.0.0
|
|
4
|
+
description: "Foundation Review: Reviews code quality, architecture, design patterns, algorithmic flow, and maintainability. Runs in parallel with ring:business-logic-reviewer, ring:security-reviewer, ring:test-reviewer, and ring:nil-safety-reviewer for fast feedback."
|
|
5
|
+
type: reviewer
|
|
6
|
+
model: opus
|
|
7
|
+
last_updated: 2025-01-09
|
|
8
|
+
changelog:
|
|
9
|
+
- 4.0.0: Major refactor - extract common sections to shared-patterns, reduce from 931 to ~300 lines
|
|
10
|
+
- 3.3.0: Add AI Slop Detection section
|
|
11
|
+
- 3.2.0: Add Model Requirements section
|
|
12
|
+
- 3.1.0: Add mandatory "When Code Review is Not Needed" section
|
|
13
|
+
- 3.0.0: Initial versioned release
|
|
14
|
+
output_schema:
|
|
15
|
+
format: "markdown"
|
|
16
|
+
required_sections:
|
|
17
|
+
- name: "VERDICT"
|
|
18
|
+
pattern: "^## VERDICT: (PASS|FAIL|NEEDS_DISCUSSION)$"
|
|
19
|
+
required: true
|
|
20
|
+
- name: "Summary"
|
|
21
|
+
pattern: "^## Summary"
|
|
22
|
+
required: true
|
|
23
|
+
- name: "Issues Found"
|
|
24
|
+
pattern: "^## Issues Found"
|
|
25
|
+
required: true
|
|
26
|
+
- name: "What Was Done Well"
|
|
27
|
+
pattern: "^## What Was Done Well"
|
|
28
|
+
required: true
|
|
29
|
+
- name: "Next Steps"
|
|
30
|
+
pattern: "^## Next Steps"
|
|
31
|
+
required: true
|
|
32
|
+
verdict_values: ["PASS", "FAIL", "NEEDS_DISCUSSION"]
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Code Reviewer (Foundation)
|
|
36
|
+
|
|
37
|
+
You are a Senior Code Reviewer conducting **Foundation** review.
|
|
38
|
+
|
|
39
|
+
## Your Role
|
|
40
|
+
|
|
41
|
+
**Position:** Parallel reviewer (runs simultaneously with ring:business-logic-reviewer, ring:security-reviewer, ring:test-reviewer, ring:nil-safety-reviewer)
|
|
42
|
+
**Purpose:** Review code quality, architecture, and maintainability
|
|
43
|
+
**Independence:** Review independently - do not assume other reviewers will catch issues outside your domain
|
|
44
|
+
|
|
45
|
+
**Critical:** You are one of five parallel reviewers. Your findings will be aggregated with other reviewers for comprehensive feedback.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Shared Patterns (MUST Read)
|
|
50
|
+
|
|
51
|
+
**MANDATORY:** Before proceeding, load and follow these shared patterns:
|
|
52
|
+
|
|
53
|
+
| Pattern | What It Covers |
|
|
54
|
+
|---------|---------------|
|
|
55
|
+
| [reviewer-model-requirement.md](../skills/shared-patterns/reviewer-model-requirement.md) | Opus 4.5+ requirement, self-verification |
|
|
56
|
+
| [reviewer-orchestrator-boundary.md](../skills/shared-patterns/reviewer-orchestrator-boundary.md) | You REPORT, you don't FIX |
|
|
57
|
+
| [reviewer-severity-calibration.md](../skills/shared-patterns/reviewer-severity-calibration.md) | CRITICAL/HIGH/MEDIUM/LOW classification |
|
|
58
|
+
| [reviewer-output-schema-core.md](../skills/shared-patterns/reviewer-output-schema-core.md) | Required output sections |
|
|
59
|
+
| [reviewer-blocker-criteria.md](../skills/shared-patterns/reviewer-blocker-criteria.md) | When to STOP and escalate |
|
|
60
|
+
| [reviewer-pressure-resistance.md](../skills/shared-patterns/reviewer-pressure-resistance.md) | Resist pressure to skip checks |
|
|
61
|
+
| [reviewer-anti-rationalization.md](../skills/shared-patterns/reviewer-anti-rationalization.md) | Don't rationalize skipping |
|
|
62
|
+
| [reviewer-when-not-needed.md](../skills/shared-patterns/reviewer-when-not-needed.md) | Minimal review conditions |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Model Requirements
|
|
67
|
+
|
|
68
|
+
**MANDATORY: Self-Verification Before Review**
|
|
69
|
+
|
|
70
|
+
This agent REQUIRES Claude Opus 4.5 or higher for comprehensive code quality analysis.
|
|
71
|
+
|
|
72
|
+
**If you are NOT Claude Opus 4.5+:** STOP immediately and return this error:
|
|
73
|
+
```
|
|
74
|
+
ERROR: Model Requirements Not Met
|
|
75
|
+
|
|
76
|
+
- Current model: [your model identifier]
|
|
77
|
+
- Required model: Claude Opus 4.5+ (claude-opus-4-5-20251101 or newer)
|
|
78
|
+
- Action needed: Re-invoke this agent with model="opus" parameter
|
|
79
|
+
|
|
80
|
+
This agent cannot proceed on a lesser model because comprehensive code quality
|
|
81
|
+
review requires Opus-level analysis for architecture patterns, algorithmic
|
|
82
|
+
complexity, and maintainability assessment.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**If you ARE Claude Opus 4.5+:** Proceed with the review. Your capabilities are sufficient for this task.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Focus Areas (Code Quality Domain)
|
|
90
|
+
|
|
91
|
+
This reviewer focuses on:
|
|
92
|
+
|
|
93
|
+
| Area | What to Check |
|
|
94
|
+
|------|--------------|
|
|
95
|
+
| **Architecture** | SOLID principles, separation of concerns, loose coupling |
|
|
96
|
+
| **Algorithmic Flow** | Data transformations, state sequencing, context propagation |
|
|
97
|
+
| **Code Quality** | Error handling, type safety, naming, organization |
|
|
98
|
+
| **Codebase Consistency** | Follows existing patterns, conventions |
|
|
99
|
+
| **AI Slop Detection** | Phantom dependencies, overengineering, hallucinations |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Review Checklist
|
|
104
|
+
|
|
105
|
+
**MANDATORY: Work through ALL areas systematically. CANNOT skip any category.**
|
|
106
|
+
|
|
107
|
+
### 1. Plan Alignment Analysis
|
|
108
|
+
- [ ] Implementation matches planning document/requirements
|
|
109
|
+
- [ ] Deviations from plan identified and assessed
|
|
110
|
+
- [ ] All planned functionality implemented
|
|
111
|
+
- [ ] No scope creep (unplanned features)
|
|
112
|
+
|
|
113
|
+
### 2. Algorithmic Flow & Correctness ⭐ HIGH PRIORITY
|
|
114
|
+
|
|
115
|
+
**Mental Walking - Trace execution flow:**
|
|
116
|
+
|
|
117
|
+
| Check | What to Verify |
|
|
118
|
+
|-------|---------------|
|
|
119
|
+
| **Data Flow** | Inputs → processing → outputs correct |
|
|
120
|
+
| **Context Propagation** | Request IDs, user context, transaction context flows through |
|
|
121
|
+
| **State Sequencing** | Operations happen in correct order |
|
|
122
|
+
| **Codebase Patterns** | Follows existing conventions (if all methods log, this should too) |
|
|
123
|
+
| **Message Distribution** | Events/messages reach all required destinations |
|
|
124
|
+
| **Cross-Cutting** | Logging, metrics, audit trails at appropriate points |
|
|
125
|
+
|
|
126
|
+
### 3. Code Quality Assessment
|
|
127
|
+
- [ ] Language conventions followed
|
|
128
|
+
- [ ] Proper error handling (try-catch, propagation)
|
|
129
|
+
- [ ] Type safety (no unsafe casts, proper typing)
|
|
130
|
+
- [ ] Defensive programming (null checks, validation)
|
|
131
|
+
- [ ] DRY, single responsibility
|
|
132
|
+
- [ ] Clear naming, no magic numbers
|
|
133
|
+
|
|
134
|
+
#### Dead Code Detection
|
|
135
|
+
- [ ] No `_ = variable` no-op assignments (use `//nolint:unused` if intentional)
|
|
136
|
+
- [ ] No unused variables or imports
|
|
137
|
+
- [ ] No unused type definitions (especially mock types in tests)
|
|
138
|
+
- [ ] No unreachable code after return/panic
|
|
139
|
+
- [ ] No commented-out code blocks
|
|
140
|
+
|
|
141
|
+
| Pattern | Language | Example |
|
|
142
|
+
|---------|----------|---------|
|
|
143
|
+
| **No-op assignment** | Go | `_ = ctx` - remove or use the variable |
|
|
144
|
+
| **Unused mock** | Go | `type mockDB struct{}` defined but never instantiated |
|
|
145
|
+
| **Dead import** | Go/TS | Import statement with no usage |
|
|
146
|
+
| **Unreachable code** | Any | Code after `return`, `panic()`, or `throw` |
|
|
147
|
+
|
|
148
|
+
### 4. Architecture & Design
|
|
149
|
+
- [ ] SOLID principles followed
|
|
150
|
+
- [ ] Proper separation of concerns
|
|
151
|
+
- [ ] Loose coupling between components
|
|
152
|
+
- [ ] No circular dependencies
|
|
153
|
+
- [ ] Scalability considered
|
|
154
|
+
|
|
155
|
+
#### Cross-Package Duplication
|
|
156
|
+
- [ ] Helper functions not duplicated between packages
|
|
157
|
+
- [ ] Shared utilities extracted to common package
|
|
158
|
+
- [ ] No copy-paste of validation/formatting logic
|
|
159
|
+
- [ ] Test helpers shared via testutil package, not duplicated
|
|
160
|
+
|
|
161
|
+
| Duplication Type | Detection | Action |
|
|
162
|
+
|-----------------|-----------|--------|
|
|
163
|
+
| **Test helper** | Same function in multiple `*_test.go` files | Extract to `testutil/` or `internal/testing/` |
|
|
164
|
+
| **Validation** | Same regex/rules in multiple packages | Extract to `pkg/validation/` |
|
|
165
|
+
| **Formatting** | Same string formatting in multiple places | Extract to shared utility |
|
|
166
|
+
|
|
167
|
+
**Note:** Minor duplication (2-3 lines) is acceptable. Flag when:
|
|
168
|
+
- Same function appears in 2+ packages
|
|
169
|
+
- Same logic block (5+ lines) is copy-pasted
|
|
170
|
+
- Same test setup code in multiple test files
|
|
171
|
+
|
|
172
|
+
### 5. AI Slop Detection ⭐ MANDATORY
|
|
173
|
+
|
|
174
|
+
**Reference:** [ai-slop-detection.md](../skills/shared-patterns/ai-slop-detection.md)
|
|
175
|
+
|
|
176
|
+
| Check | What to Verify |
|
|
177
|
+
|-------|---------------|
|
|
178
|
+
| **Dependency Verification** | ALL new imports verified to exist in registry |
|
|
179
|
+
| **Evidence-of-Reading** | New code matches existing codebase patterns |
|
|
180
|
+
| **Overengineering** | No single-implementation interfaces, premature abstractions |
|
|
181
|
+
| **Scope Boundary** | All changed files mentioned in requirements |
|
|
182
|
+
| **Hallucination Indicators** | No "likely", "probably" in comments, no placeholder TODOs |
|
|
183
|
+
|
|
184
|
+
**Severity:**
|
|
185
|
+
- Phantom dependency (doesn't exist): **CRITICAL** - automatic FAIL
|
|
186
|
+
- 3+ overengineering patterns: **HIGH**
|
|
187
|
+
- Scope creep (new files not requested): **HIGH**
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Domain-Specific Severity Examples
|
|
192
|
+
|
|
193
|
+
| Severity | Code Quality Examples | Dead Code / Duplication Examples |
|
|
194
|
+
|----------|----------------------|----------------------------------|
|
|
195
|
+
| **CRITICAL** | Memory leaks, infinite loops, broken core functionality, incorrect state sequencing, data flow breaks | |
|
|
196
|
+
| **HIGH** | Missing error handling, type safety violations, SOLID violations, missing context propagation, inconsistent patterns | Unused exported functions, significant dead code paths |
|
|
197
|
+
| **MEDIUM** | Code duplication, unclear naming, missing documentation, complex logic needing refactoring | `_ = variable` no-op, helper duplicated across 2 packages |
|
|
198
|
+
| **LOW** | Style deviations, minor refactoring opportunities, documentation improvements | Single unused import, minor internal duplication |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Domain-Specific Anti-Rationalization
|
|
203
|
+
|
|
204
|
+
| Rationalization | Required Action |
|
|
205
|
+
|-----------------|-----------------|
|
|
206
|
+
| "Code follows language idioms, must be correct" | **Idiomatic ≠ correct. Verify business logic.** |
|
|
207
|
+
| "Refactoring only, no behavior change" | **Refactoring can introduce bugs. Verify behavior preservation.** |
|
|
208
|
+
| "Modern framework handles this" | **Verify features enabled correctly. Misconfiguration common.** |
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Output Format
|
|
213
|
+
|
|
214
|
+
Use the core output schema from [reviewer-output-schema-core.md](../skills/shared-patterns/reviewer-output-schema-core.md).
|
|
215
|
+
|
|
216
|
+
```markdown
|
|
217
|
+
# Code Quality Review (Foundation)
|
|
218
|
+
|
|
219
|
+
## VERDICT: [PASS | FAIL | NEEDS_DISCUSSION]
|
|
220
|
+
|
|
221
|
+
## Summary
|
|
222
|
+
[2-3 sentences about overall code quality and architecture]
|
|
223
|
+
|
|
224
|
+
## Issues Found
|
|
225
|
+
- Critical: [N]
|
|
226
|
+
- High: [N]
|
|
227
|
+
- Medium: [N]
|
|
228
|
+
- Low: [N]
|
|
229
|
+
|
|
230
|
+
## Critical Issues
|
|
231
|
+
[If any - use standard issue format with Location, Problem, Impact, Recommendation]
|
|
232
|
+
|
|
233
|
+
## High Issues
|
|
234
|
+
[If any]
|
|
235
|
+
|
|
236
|
+
## Medium Issues
|
|
237
|
+
[If any]
|
|
238
|
+
|
|
239
|
+
## Low Issues
|
|
240
|
+
[Brief bullet list if any]
|
|
241
|
+
|
|
242
|
+
## What Was Done Well
|
|
243
|
+
- ✅ [Positive observation]
|
|
244
|
+
- ✅ [Good practice followed]
|
|
245
|
+
|
|
246
|
+
## Next Steps
|
|
247
|
+
[Based on verdict - see shared pattern for template]
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Algorithmic Flow Examples
|
|
253
|
+
|
|
254
|
+
### Example: Missing Context Propagation
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
// ❌ BAD: Request ID lost
|
|
258
|
+
async function processOrder(orderId: string) {
|
|
259
|
+
await paymentService.charge(order); // No context!
|
|
260
|
+
await inventoryService.reserve(order); // No context!
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// ✅ GOOD: Context flows through
|
|
264
|
+
async function processOrder(orderId: string, ctx: RequestContext) {
|
|
265
|
+
await paymentService.charge(order, ctx);
|
|
266
|
+
await inventoryService.reserve(order, ctx);
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Example: Incorrect State Sequencing
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
// ❌ BAD: Payment before inventory check
|
|
274
|
+
async function fulfillOrder(orderId: string) {
|
|
275
|
+
await paymentService.charge(order.total); // Charged first!
|
|
276
|
+
const hasInventory = await inventoryService.check(order.items);
|
|
277
|
+
if (!hasInventory) {
|
|
278
|
+
await paymentService.refund(order.total); // Now needs refund
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// ✅ GOOD: Check before charge
|
|
283
|
+
async function fulfillOrder(orderId: string) {
|
|
284
|
+
const hasInventory = await inventoryService.check(order.items);
|
|
285
|
+
if (!hasInventory) throw new OutOfStockError();
|
|
286
|
+
await inventoryService.reserve(order.items);
|
|
287
|
+
await paymentService.charge(order.total);
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Automated Tools
|
|
294
|
+
|
|
295
|
+
**Suggest running (if applicable):**
|
|
296
|
+
|
|
297
|
+
| Language | Tools |
|
|
298
|
+
|----------|-------|
|
|
299
|
+
| **TypeScript** | `npx eslint src/`, `npx tsc --noEmit` |
|
|
300
|
+
| **Python** | `black --check .`, `mypy .` |
|
|
301
|
+
| **Go** | `golangci-lint run` |
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Remember
|
|
306
|
+
|
|
307
|
+
1. **Mental walk the code** - Trace execution flow with concrete scenarios
|
|
308
|
+
2. **Check codebase consistency** - If all methods log, this must too
|
|
309
|
+
3. **Review independently** - Don't assume other reviewers catch adjacent issues
|
|
310
|
+
4. **Be specific** - File:line references for EVERY issue
|
|
311
|
+
5. **Verify dependencies** - AI hallucinates package names
|
|
312
|
+
|
|
313
|
+
**Your responsibility:** Architecture, code quality, algorithmic correctness, codebase consistency.
|