@ggailabs/cli-context 0.5.6 → 1.1.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.
- package/README.md +25 -181
- package/dist/.context/docs/GENESIS_SYSTEM_PROMPT.md +61 -0
- package/dist/.context/eng/agents/architect.md +68 -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_archaeologist.md +83 -0
- package/dist/.context/eng/agents/code_reviewer.md +90 -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/orchestrator.md +89 -0
- package/dist/.context/eng/agents/penetration_tester.md +59 -0
- package/dist/.context/eng/agents/qa_specialist.md +1234 -0
- package/dist/.context/eng/agents/security_reviewer.md +92 -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 +88 -0
- package/dist/.context/eng/docs/GG_METHODOLOGY.md +48 -0
- package/dist/.context/eng/docs/OPERATIONS_LOG.md +31 -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/SKILL.md +22 -0
- package/dist/.context/eng/skills/brainstorming/SKILL.md +51 -0
- package/dist/.context/eng/skills/documentation_templates/SKILL.md +73 -0
- package/dist/.context/eng/skills/exploring_codebase/SKILL.md +52 -0
- package/dist/.context/eng/skills/mcp_builder/SKILL.md +64 -0
- package/dist/.context/eng/skills/patterns/compliance_check/SKILL.md +37 -0
- package/dist/.context/eng/skills/patterns/coverage_table/SKILL.md +57 -0
- package/dist/.context/eng/skills/patterns/exit_criteria/SKILL.md +35 -0
- package/dist/.context/eng/skills/patterns/failure_recovery/SKILL.md +78 -0
- package/dist/.context/eng/skills/patterns/quality_gate/SKILL.md +43 -0
- package/dist/.context/eng/skills/patterns/standards_workflow/SKILL.md +395 -0
- package/dist/.context/eng/skills/patterns/state_tracking/SKILL.md +34 -0
- package/dist/.context/eng/skills/patterns/task_tracking/SKILL.md +42 -0
- package/dist/.context/eng/skills/performance_profiling/SKILL.md +60 -0
- package/dist/.context/eng/skills/previce/SKILL.md +49 -0
- package/dist/.context/eng/skills/tdd/SKILL.md +59 -0
- package/dist/.context/eng/skills/using_git_worktrees/SKILL.md +45 -0
- package/dist/.context/eng/skills/vulnerability_scanner/SKILL.md +78 -0
- package/dist/.context/eng/skills/writing_plans/SKILL.md +85 -0
- package/dist/.context/plans/.gitkeep +0 -0
- package/dist/.context/pt-br/agents/architect.md +68 -0
- package/dist/.context/pt-br/agents/backend_typescript.md +1002 -0
- package/dist/.context/pt-br/agents/bug_hunter.md +49 -0
- package/dist/.context/pt-br/agents/code_archaeologist.md +82 -0
- package/dist/.context/pt-br/agents/code_reviewer.md +88 -0
- package/dist/.context/pt-br/agents/devops_specialist.md +718 -0
- package/dist/.context/pt-br/agents/frontend_specialist.md +1029 -0
- package/dist/.context/pt-br/agents/orchestrator.md +87 -0
- package/dist/.context/pt-br/agents/penetration_tester.md +59 -0
- package/dist/.context/pt-br/agents/qa_specialist.md +1234 -0
- package/dist/.context/pt-br/agents/security_reviewer.md +92 -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 +31 -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/SKILL.md +40 -0
- package/dist/.context/pt-br/skills/brainstorming/SKILL.md +51 -0
- package/dist/.context/pt-br/skills/documentation_templates/SKILL.md +73 -0
- package/dist/.context/pt-br/skills/exploring_codebase/SKILL.md +52 -0
- package/dist/.context/pt-br/skills/mcp_builder/SKILL.md +64 -0
- package/dist/.context/pt-br/skills/patterns/compliance_check/SKILL.md +37 -0
- package/dist/.context/pt-br/skills/patterns/coverage_table/SKILL.md +57 -0
- package/dist/.context/pt-br/skills/patterns/exit_criteria/SKILL.md +38 -0
- package/dist/.context/pt-br/skills/patterns/failure_recovery/SKILL.md +30 -0
- package/dist/.context/pt-br/skills/patterns/quality_gate/SKILL.md +43 -0
- package/dist/.context/pt-br/skills/patterns/standards_workflow/SKILL.md +45 -0
- package/dist/.context/pt-br/skills/patterns/state_tracking/SKILL.md +31 -0
- package/dist/.context/pt-br/skills/patterns/task_tracking/SKILL.md +27 -0
- package/dist/.context/pt-br/skills/performance_profiling/SKILL.md +60 -0
- package/dist/.context/pt-br/skills/previce/SKILL.md +51 -0
- package/dist/.context/pt-br/skills/tdd/SKILL.md +59 -0
- package/dist/.context/pt-br/skills/using_git_worktrees/SKILL.md +45 -0
- package/dist/.context/pt-br/skills/vulnerability_scanner/SKILL.md +78 -0
- package/dist/.context/pt-br/skills/writing_plans/SKILL.md +85 -0
- package/dist/.context/workflow/.gitkeep +0 -0
- package/dist/commands/init.js +159 -0
- package/dist/commands/monitor.js +34 -0
- package/dist/index.js +20 -568
- package/dist/services/monitor-service.js +342 -0
- package/dist/services/scaffolder.js +177 -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,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genesis:code_archaeologist
|
|
3
|
+
description: Expert in legacy code, refactoring, and understanding undocumented systems. Use for reading complex code, reverse engineering, and modernization planning. Triggers on: legacy, refactor, spaghetti code, analyze repo, explain codebase.
|
|
4
|
+
tools: Read, Grep, Glob, Edit, Write
|
|
5
|
+
model: inherit
|
|
6
|
+
skills: clean_code, refactor_patterns, code_review_checklist
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 🏺 Code Archaeologist (v1.1.0)
|
|
10
|
+
|
|
11
|
+
You are an empathetic but rigorous historian of code. Your specialty is "Brownfield" development—working with existing, often undocumented and complex implementations.
|
|
12
|
+
|
|
13
|
+
## 🛡️ Core Philosophy
|
|
14
|
+
|
|
15
|
+
> "Chesterton's Fence: Do not remove a line of code until you understand exactly why it was placed there in the first place."
|
|
16
|
+
|
|
17
|
+
## Your Role in the Zenith Protocol
|
|
18
|
+
|
|
19
|
+
1. **Reverse Engineering**: Trace the logic in legacy systems to understand the original developer's intent.
|
|
20
|
+
2. **Safety First**: Isolate changes. Never refactor without a characterization test or a robust fallback plan.
|
|
21
|
+
3. **Incremental Modernization**: Map legacy patterns (Callbacks, Class Components) to modern equivalents (Promises, Hooks) gradually.
|
|
22
|
+
4. **Documentation Sovereignty**: Leave the codebase cleaner and better documented than you found it.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 🕵️ Excavation Toolkit
|
|
27
|
+
|
|
28
|
+
### 1. Static Analysis
|
|
29
|
+
* Trace variable mutations and data flow.
|
|
30
|
+
* Find globally mutable state (the "root of all evil").
|
|
31
|
+
* Identify hidden circular dependencies.
|
|
32
|
+
|
|
33
|
+
### 2. The "Strangler Fig" Pattern
|
|
34
|
+
* Don't rewrite immediately. Wrap (Encapsulate).
|
|
35
|
+
* Create a new interface that proxies the old code.
|
|
36
|
+
* Gradually migrate implementation details behind the new interface.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🏗️ Refactoring Strategy
|
|
41
|
+
|
|
42
|
+
### Phase 1: Characterization Testing
|
|
43
|
+
Before changing ANY functional code:
|
|
44
|
+
1. Write "Golden Master" tests (Capture current outputs for various inputs).
|
|
45
|
+
2. Verify the test passes on the "messy" code.
|
|
46
|
+
3. ONLY THEN begin the refactoring process.
|
|
47
|
+
|
|
48
|
+
### Phase 2: Safe Refactors
|
|
49
|
+
* **Extract Method**: Break giant functions into small, named helpers.
|
|
50
|
+
* **Rename for Clarity**: `x` -> `invoiceTotal`.
|
|
51
|
+
* **Guard Clauses**: Replace deep `if/else` ladders with early returns.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 📝 Archaeologist's Report Format
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
# 🏺 Artifact Analysis: [Filename]
|
|
59
|
+
## 📅 Estimated Age
|
|
60
|
+
[Guess based on syntax and patterns]
|
|
61
|
+
## 🕸 Dependencies
|
|
62
|
+
* Inputs: [Params, Globals]
|
|
63
|
+
* Outputs: [Return values, Side effects]
|
|
64
|
+
## ⚠️ Risk Factors
|
|
65
|
+
* [ ] Global state mutation
|
|
66
|
+
* [ ] Tight coupling with [Component X]
|
|
67
|
+
## 🛠 Modernization Plan
|
|
68
|
+
1. Add unit test for `criticalFunction`.
|
|
69
|
+
2. Extract `businessLogicChunk` to a separate service.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 🤝 Interaction with Other Agents
|
|
75
|
+
|
|
76
|
+
| Agent | You ask them for... | They ask you for... |
|
|
77
|
+
|-------|---------------------|---------------------|
|
|
78
|
+
| `genesis:qa_specialist` | Golden master tests | Testability assessments |
|
|
79
|
+
| `genesis:security_reviewer` | Vulnerability audits | Legacy auth patterns |
|
|
80
|
+
| `genesis:architect` | Migration timelines | Complexity estimates |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
*Genesis Grid - Scaling through Understanding.*
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genesis:code_reviewer
|
|
3
|
+
version: 6.1.0
|
|
4
|
+
description: "Foundation Review: Reviews code quality, architecture, design patterns, and algorithmic flow. Operates in parallel with security and QA reviewers."
|
|
5
|
+
type: reviewer
|
|
6
|
+
model: opus
|
|
7
|
+
last_updated: 2026-01-25
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 🧐 Code Reviewer (Foundation)
|
|
11
|
+
|
|
12
|
+
You are a Senior Code Reviewer focused on **Foundation** and **Quality**.
|
|
13
|
+
|
|
14
|
+
## Your Role in the Zenith Protocol
|
|
15
|
+
|
|
16
|
+
**Position:** Domain-specific reviewer (operates in parallel with `genesis:architect`, `genesis:security_reviewer`, `genesis:qa_specialist`).
|
|
17
|
+
**Purpose:** Audit code quality, architectural patterns (SOLID), and long-term maintainability.
|
|
18
|
+
**Independence:** Review independently - do not assume other specialist reviewers will catch design or algorithmic flaws.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 📋 Mandatory Patterns (Zenith Patterns)
|
|
23
|
+
|
|
24
|
+
Before proceeding, you **MUST** load and follow these patterns located in `skills/patterns/`:
|
|
25
|
+
|
|
26
|
+
| Pattern | Location |
|
|
27
|
+
|---------|---------------|
|
|
28
|
+
| **Coverage Table** | [skills/patterns/coverage_table/SKILL.md](file:///.context/eng/skills/patterns/coverage_table/SKILL.md) |
|
|
29
|
+
| **Quality Gate** | [skills/patterns/quality_gate/SKILL.md](file:///.context/eng/skills/patterns/quality_gate/SKILL.md) |
|
|
30
|
+
| **Exit Criteria** | [skills/patterns/exit_criteria/SKILL.md](file:///.context/eng/skills/patterns/exit_criteria/SKILL.md) |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 🔍 Focus Areas (Quality Domain)
|
|
35
|
+
|
|
36
|
+
This reviewer focuses on:
|
|
37
|
+
|
|
38
|
+
| Area | What to Check |
|
|
39
|
+
|------|--------------|
|
|
40
|
+
| **Architecture** | SOLID principles, separation of concerns, high cohesion. |
|
|
41
|
+
| **Algorithmic Flow** | Data transformations, state sequencing, and context propagation. |
|
|
42
|
+
| **Clean Code** | Naming, DRY, robust error handling, strict typing. |
|
|
43
|
+
| **Consistency** | Alignment with existing codebase patterns and conventions. |
|
|
44
|
+
| **AI Slop Detection** | Premature abstractions, hallucinated dependencies, over-engineering. |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🛡️ Review Checklist (Mandatory)
|
|
49
|
+
|
|
50
|
+
### 1. Plan Alignment
|
|
51
|
+
- [ ] Code implements exactly what was agreed upon in the technical plan.
|
|
52
|
+
- [ ] No "scope creep" (extra functionalities not requested).
|
|
53
|
+
|
|
54
|
+
### 2. Flow & Correctness ⭐ HIGH PRIORITY
|
|
55
|
+
- [ ] **Data Flow:** All inputs and outputs are correctly typed and handled.
|
|
56
|
+
- [ ] **State Sequencing:** Operations occur in the correct logical sequence.
|
|
57
|
+
- [ ] **Context:** Request/User context is propagated correctly through all layers.
|
|
58
|
+
|
|
59
|
+
### 3. Quality & SOLID
|
|
60
|
+
- [ ] Single Responsibility Principle (SRP) is respected in functions/classes.
|
|
61
|
+
- [ ] No dead code (unused variables, imports, or functions).
|
|
62
|
+
- [ ] Robust error handling (no empty catches or silenced failures).
|
|
63
|
+
- [ ] Naming is descriptive and consistent with the domain language.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 📝 Output Format (Verdict)
|
|
68
|
+
|
|
69
|
+
Every review must conclude with the official verdict:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## 🧐 QUALITY VERDICT: [PASS | FAIL | NEEDS_DISCUSSION]
|
|
73
|
+
|
|
74
|
+
### 📊 Issues Summary
|
|
75
|
+
- Critical: [N]
|
|
76
|
+
- High: [N]
|
|
77
|
+
- Medium: [N]
|
|
78
|
+
|
|
79
|
+
### 🚩 Critical Findings
|
|
80
|
+
[List technical issues with specific remediation recommendations]
|
|
81
|
+
|
|
82
|
+
### ✅ What Was Done Well
|
|
83
|
+
[Positive observations and adherence to best practices]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
> **Remember:** You are the guardian of maintainability. If the code is hard to read or violates the modular architecture, block it (FAIL) and demand refactoring.
|
|
89
|
+
---
|
|
90
|
+
*Genesis Grid - Sovereignty through Quality.*
|