@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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Universal Failure Recovery Pattern
|
|
2
|
+
|
|
3
|
+
Add this section to any skill with potential failure points:
|
|
4
|
+
|
|
5
|
+
## When You Violate This Skill
|
|
6
|
+
|
|
7
|
+
**Skills can be violated by skipping steps or doing things out of order.**
|
|
8
|
+
|
|
9
|
+
Add skill-specific violation recovery procedures:
|
|
10
|
+
|
|
11
|
+
### Violation Template
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
### Violation: [Common violation name]
|
|
15
|
+
|
|
16
|
+
**How to detect:**
|
|
17
|
+
[What indicates this violation occurred]
|
|
18
|
+
|
|
19
|
+
**Recovery procedure:**
|
|
20
|
+
1. [Step 1 to recover]
|
|
21
|
+
2. [Step 2 to recover]
|
|
22
|
+
3. [Step 3 to recover]
|
|
23
|
+
|
|
24
|
+
**Why recovery matters:**
|
|
25
|
+
[Explanation of why you can't just continue]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Example:**
|
|
29
|
+
|
|
30
|
+
Violation: Wrote implementation before test (in TDD)
|
|
31
|
+
|
|
32
|
+
**How to detect:**
|
|
33
|
+
- Implementation file exists but no test file
|
|
34
|
+
- Git history shows implementation committed before test
|
|
35
|
+
|
|
36
|
+
**Recovery procedure:**
|
|
37
|
+
1. Stash or delete the implementation code
|
|
38
|
+
2. Write the failing test first
|
|
39
|
+
3. Run test to verify it fails
|
|
40
|
+
4. Rewrite the implementation to make test pass
|
|
41
|
+
|
|
42
|
+
**Why recovery matters:**
|
|
43
|
+
The test must fail first to prove it actually tests something. If implementation exists first, you can't verify the test works - it might be passing for the wrong reason or not testing anything at all.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## When Things Go Wrong
|
|
48
|
+
|
|
49
|
+
**If you get stuck:**
|
|
50
|
+
|
|
51
|
+
1. **Attempt failed?**
|
|
52
|
+
- Document exactly what happened
|
|
53
|
+
- Include error messages verbatim
|
|
54
|
+
- Note what you tried
|
|
55
|
+
|
|
56
|
+
2. **Can't proceed?**
|
|
57
|
+
- State blocker explicitly: "Blocked by: [specific issue]"
|
|
58
|
+
- Don't guess or work around
|
|
59
|
+
- Ask for help
|
|
60
|
+
|
|
61
|
+
3. **Confused?**
|
|
62
|
+
- Say "I don't understand [specific thing]"
|
|
63
|
+
- Don't pretend to understand
|
|
64
|
+
- Research or ask for clarification
|
|
65
|
+
|
|
66
|
+
4. **Multiple failures?**
|
|
67
|
+
- After 3 attempts: STOP
|
|
68
|
+
- Document all attempts
|
|
69
|
+
- Reassess approach with human partner
|
|
70
|
+
|
|
71
|
+
**Never:** Pretend to succeed when stuck
|
|
72
|
+
**Never:** Continue after 3 failures
|
|
73
|
+
**Never:** Hide confusion or errors
|
|
74
|
+
**Always:** Be explicit about blockage
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# AI Slop Detection Patterns
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Last Updated:** 2025-12-28
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
This document provides centralized detection patterns for AI-generated low-quality code ("AI slop"). All code review agents MUST reference these patterns during review.
|
|
9
|
+
|
|
10
|
+
## What is AI Slop?
|
|
11
|
+
|
|
12
|
+
AI slop refers to code generated by AI assistants that:
|
|
13
|
+
- Looks syntactically correct and well-formatted
|
|
14
|
+
- Uses common patterns that "pass the eye test"
|
|
15
|
+
- Contains real problems: hallucinated dependencies, overengineering, scope creep, or semantic incorrectness
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## AI Generation Smell Detection
|
|
20
|
+
|
|
21
|
+
### Code Smells Unique to AI Generation
|
|
22
|
+
|
|
23
|
+
| Smell | Detection Pattern | Severity | Why AI Does This |
|
|
24
|
+
|-------|-------------------|----------|------------------|
|
|
25
|
+
| **Phantom Dependencies** | Package names that don't exist on npm/PyPI/Go modules | CRITICAL | AI hallucinates plausible names from training data |
|
|
26
|
+
| **Morpheme-Spliced Names** | Plausible but non-existent: `graphit-orm`, `wave-socket` | CRITICAL | AI combines familiar morphemes without registry verification |
|
|
27
|
+
| **Cross-Ecosystem Borrowing** | `serverless-python-requirements` (npm name in Python) | HIGH | AI confuses packages across registries |
|
|
28
|
+
| **Confident Hallucination** | Code references APIs/methods that don't exist in the library version | HIGH | AI generates from statistical patterns, not docs |
|
|
29
|
+
| **Over-Abstraction** | Unnecessary interfaces, factories, or adapters for one-time operations | HIGH | AI pattern-matches "best practices" without context |
|
|
30
|
+
| **Premature Generalization** | Config options, feature flags, or extensibility for unrequested features | HIGH | AI adds "future-proofing" that wasn't requested |
|
|
31
|
+
| **Context-Gap Filling** | Generic implementations that "fill in" unspecified requirements | MEDIUM | AI guesses when requirements are incomplete |
|
|
32
|
+
| **Surface-Form Mimicry** | Code follows naming conventions but logic is semantically wrong | HIGH | AI matches form without understanding function |
|
|
33
|
+
| **Scope Creep** | Changes to files/functions not mentioned in requirements | HIGH | AI tries to be "helpful" beyond the request |
|
|
34
|
+
| **Cargo-Cult Patterns** | Design patterns applied without understanding (Observer for 1 subscriber) | MEDIUM | AI applies patterns based on keywords, not need |
|
|
35
|
+
| **Verbose Boilerplate** | Excessive error handling for impossible scenarios | LOW | AI over-generalizes defensive patterns |
|
|
36
|
+
| **Typo-Adjacent Names** | Package names one character off from real packages | CRITICAL | AI approximates from training data |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Slopsquatting Detection (Security)
|
|
41
|
+
|
|
42
|
+
### What is Slopsquatting?
|
|
43
|
+
|
|
44
|
+
Slopsquatting is a supply-chain attack where:
|
|
45
|
+
1. AI hallucates a plausible but non-existent package name
|
|
46
|
+
2. Attacker pre-registers that name on public registries
|
|
47
|
+
3. Developer runs AI-generated install command
|
|
48
|
+
4. Malicious code is downloaded and executed
|
|
49
|
+
|
|
50
|
+
### Mandatory Checks for Every New Dependency
|
|
51
|
+
|
|
52
|
+
**Registry Verification Commands:**
|
|
53
|
+
```bash
|
|
54
|
+
# npm (JavaScript/TypeScript)
|
|
55
|
+
npm view <package-name> version
|
|
56
|
+
|
|
57
|
+
# PyPI (Python)
|
|
58
|
+
pip index versions <package-name>
|
|
59
|
+
|
|
60
|
+
# Go modules
|
|
61
|
+
go list -m <module-path>@latest
|
|
62
|
+
|
|
63
|
+
# Cargo (Rust)
|
|
64
|
+
cargo search <crate-name>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Suspicious Naming Patterns
|
|
68
|
+
|
|
69
|
+
| Pattern | Example | Risk Level | Detection Method |
|
|
70
|
+
|---------|---------|------------|------------------|
|
|
71
|
+
| **Morpheme-spliced** | `graphit-orm`, `wave-socket`, `fast-json-parser` | HIGH | Verify each package exists in registry |
|
|
72
|
+
| **Cross-ecosystem** | npm name used in Python project | HIGH | Check correct registry for language |
|
|
73
|
+
| **Typo-adjacent** | `lodahs`, `requets`, `expresss` | CRITICAL | Compare against known popular packages |
|
|
74
|
+
| **Plausible prefix** | `opentelemetry-instrumentation-fake` | HIGH | Verify official package namespaces |
|
|
75
|
+
| **Brand new package** | Package < 30 days old | HIGH | Check package creation date |
|
|
76
|
+
| **Low downloads** | < 100 weekly downloads for common functionality | MEDIUM | Verify popularity matches claimed utility |
|
|
77
|
+
| **Author mismatch** | Popular name, unknown author | HIGH | Compare against official maintainers |
|
|
78
|
+
|
|
79
|
+
### Verification Output Format
|
|
80
|
+
|
|
81
|
+
For EVERY new dependency, document:
|
|
82
|
+
```markdown
|
|
83
|
+
### Dependency Verification
|
|
84
|
+
| Package | Registry | Exists | Author | Age | Downloads/Week | Risk |
|
|
85
|
+
|---------|----------|--------|--------|-----|----------------|------|
|
|
86
|
+
| lodash | npm | ✅ | lodash | 12y | 50M | LOW |
|
|
87
|
+
| graphit-orm | npm | ❌ NOT FOUND | - | - | - | CRITICAL |
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Evidence-of-Reading Verification
|
|
93
|
+
|
|
94
|
+
### Problem
|
|
95
|
+
|
|
96
|
+
AI agents often claim to have read files but operate on cached/assumed content, producing code that doesn't match existing patterns.
|
|
97
|
+
|
|
98
|
+
### Verification Checklist
|
|
99
|
+
|
|
100
|
+
| Check | How to Verify | Red Flag |
|
|
101
|
+
|-------|---------------|----------|
|
|
102
|
+
| **Existing Pattern Awareness** | Does new code match existing patterns in the codebase? | New code uses different conventions than surrounding code |
|
|
103
|
+
| **Import Consistency** | Are imports from same locations as similar files? | Imports from different paths than established patterns |
|
|
104
|
+
| **Error Handling Style** | Does error handling match project conventions? | Generic try/catch when project uses Result types |
|
|
105
|
+
| **Naming Convention Match** | Do new names match existing naming patterns? | camelCase in a snake_case codebase |
|
|
106
|
+
| **Type Consistency** | Are types used consistently with existing code? | `any` or `interface{}` when project uses strict typing |
|
|
107
|
+
| **Test Pattern Match** | Do tests follow project's testing patterns? | Jest syntax in a Vitest project |
|
|
108
|
+
| **Logging Pattern Match** | Does logging match surrounding code? | No logging when all adjacent functions log |
|
|
109
|
+
| **Comment Style** | Do comments match project documentation style? | Different comment format than rest of codebase |
|
|
110
|
+
|
|
111
|
+
### Evidence Requirements
|
|
112
|
+
|
|
113
|
+
Before approving code, verify implementation shows evidence of reading:
|
|
114
|
+
- [ ] Related existing files (imports match, patterns match)
|
|
115
|
+
- [ ] Type definitions (types used correctly)
|
|
116
|
+
- [ ] Test patterns (test style matches)
|
|
117
|
+
- [ ] Configuration (respects project config)
|
|
118
|
+
- [ ] Documentation (follows documented conventions)
|
|
119
|
+
|
|
120
|
+
**If evidence is missing → Flag as potential AI slop**
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Overengineering Detection
|
|
125
|
+
|
|
126
|
+
### Red Flags
|
|
127
|
+
|
|
128
|
+
| Pattern | Why It's Suspicious | Question to Ask |
|
|
129
|
+
|---------|--------------------|--------------------|
|
|
130
|
+
| **Interface with 1 implementation** | AI creates interfaces "for flexibility" | Will there ever be a 2nd implementation? |
|
|
131
|
+
| **Factory for single type** | AI pattern-matches factory pattern | Is the creation logic actually complex? |
|
|
132
|
+
| **Strategy pattern for 1 strategy** | AI sees conditional and adds pattern | Are more strategies planned? |
|
|
133
|
+
| **Wrapper adding no value** | AI creates layers for "separation" | What does this wrapper actually do? |
|
|
134
|
+
| **Configuration for hardcoded values** | AI externalizes everything | Will this value ever change? |
|
|
135
|
+
| **Generic<T> for single type** | AI adds generics "for reusability" | Will T ever be anything else? |
|
|
136
|
+
| **Event system for 1 subscriber** | AI sees "decoupling" opportunity | Are more subscribers expected? |
|
|
137
|
+
| **Middleware for single operation** | AI adds middleware "for extensibility" | What other operations would use this? |
|
|
138
|
+
| **Abstract base class with 1 child** | AI adds abstraction "for structure" | Will there be sibling classes? |
|
|
139
|
+
| **Builder pattern for simple object** | AI adds fluent API "for clarity" | Does object have optional fields? |
|
|
140
|
+
| **Stateless struct when functions would suffice** | AI creates struct with no fields (Go-specific) | Does the struct hold any state? |
|
|
141
|
+
|
|
142
|
+
### Severity Assessment
|
|
143
|
+
|
|
144
|
+
- **3+ of these patterns in one PR** → HIGH (likely AI slop)
|
|
145
|
+
- **1-2 patterns with no justification** → MEDIUM
|
|
146
|
+
- **Patterns with documented future use** → LOW (acceptable)
|
|
147
|
+
|
|
148
|
+
### Stateless Struct Pattern (Go)
|
|
149
|
+
|
|
150
|
+
```go
|
|
151
|
+
// ❌ OVER-ENGINEERED: Struct with no fields
|
|
152
|
+
type ScopeMatcher struct{}
|
|
153
|
+
|
|
154
|
+
func (s *ScopeMatcher) Match(scope string, pattern string) bool {
|
|
155
|
+
return strings.HasPrefix(scope, pattern)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Usage requires unnecessary instantiation:
|
|
159
|
+
matcher := &ScopeMatcher{}
|
|
160
|
+
result := matcher.Match(scope, pattern)
|
|
161
|
+
|
|
162
|
+
// ✅ SIMPLE: Plain function
|
|
163
|
+
func MatchScope(scope string, pattern string) bool {
|
|
164
|
+
return strings.HasPrefix(scope, pattern)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Usage is direct:
|
|
168
|
+
result := MatchScope(scope, pattern)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**When stateless structs ARE justified:**
|
|
172
|
+
- Implementing an interface (e.g., `http.Handler`)
|
|
173
|
+
- Grouping related methods for discoverability
|
|
174
|
+
- Future state is planned (documented)
|
|
175
|
+
|
|
176
|
+
**When to flag:**
|
|
177
|
+
- Single method on struct with no fields
|
|
178
|
+
- No interface requirement
|
|
179
|
+
- No documented reason for struct wrapper
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Scope Boundary Enforcement
|
|
184
|
+
|
|
185
|
+
### Problem
|
|
186
|
+
|
|
187
|
+
AI agents make "helpful" changes outside requested scope, creating untested code paths.
|
|
188
|
+
|
|
189
|
+
### Verification Process
|
|
190
|
+
|
|
191
|
+
1. **Extract Scope from Requirements**
|
|
192
|
+
- List all files mentioned in task/requirements
|
|
193
|
+
- List all functions mentioned
|
|
194
|
+
- List all behaviors specified
|
|
195
|
+
|
|
196
|
+
2. **Compare to Actual Changes**
|
|
197
|
+
```
|
|
198
|
+
REQUESTED SCOPE:
|
|
199
|
+
- [ ] File: src/auth/login.ts (modify)
|
|
200
|
+
- [ ] Function: validateCredentials (add retry logic)
|
|
201
|
+
|
|
202
|
+
ACTUAL CHANGES:
|
|
203
|
+
- [✅] File: src/auth/login.ts
|
|
204
|
+
- [⚠️] File: src/auth/logout.ts (NOT IN SCOPE)
|
|
205
|
+
- [⚠️] File: src/utils/retry.ts (NEW - NOT REQUESTED)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
3. **Flag Out-of-Scope Changes**
|
|
209
|
+
|
|
210
|
+
| Change Type | Severity | Required Action |
|
|
211
|
+
|-------------|----------|-----------------|
|
|
212
|
+
| New file not requested | HIGH | Require justification or remove |
|
|
213
|
+
| Modified file not in scope | HIGH | Require justification or revert |
|
|
214
|
+
| Deleted code not requested | CRITICAL | Block until justified |
|
|
215
|
+
| Refactored "while I was here" | MEDIUM | Flag for review, suggest separate PR |
|
|
216
|
+
| Added "helpful" utilities | MEDIUM | Question necessity |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Hallucination Indicator Detection
|
|
221
|
+
|
|
222
|
+
### Language Patterns That Indicate Guessing
|
|
223
|
+
|
|
224
|
+
Flag code comments or PR descriptions containing:
|
|
225
|
+
|
|
226
|
+
| Pattern | Example | Meaning |
|
|
227
|
+
|---------|---------|---------|
|
|
228
|
+
| "likely", "probably" | "This file likely handles..." | **Agent didn't read file** |
|
|
229
|
+
| "should work" | "This should work with..." | **Agent didn't test** |
|
|
230
|
+
| "based on common patterns" | "Based on common patterns, I added..." | **Agent guessed** |
|
|
231
|
+
| "assuming" | "Assuming the API returns..." | **Agent didn't verify** |
|
|
232
|
+
| "typical", "usually" | "This typically requires..." | **Agent used training data, not codebase** |
|
|
233
|
+
| "I believe" | "I believe this function..." | **Agent is uncertain** |
|
|
234
|
+
| "standard approach" | "Using the standard approach..." | **May not match this codebase** |
|
|
235
|
+
|
|
236
|
+
### Code Indicators
|
|
237
|
+
|
|
238
|
+
| Indicator | Detection | Severity |
|
|
239
|
+
|-----------|-----------|----------|
|
|
240
|
+
| **TODO with vague content** | `// TODO: implement properly` | HIGH - incomplete |
|
|
241
|
+
| **Placeholder returns** | `return null; // placeholder` | CRITICAL - not implemented |
|
|
242
|
+
| **Generic error messages** | `throw new Error('Something went wrong')` | MEDIUM - lazy |
|
|
243
|
+
| **Commented-out code** | `// const oldWay = ...` | LOW - cleanup needed |
|
|
244
|
+
| **Magic strings/numbers** | Unexplained literals | MEDIUM - needs constants |
|
|
245
|
+
| **Empty catch blocks** | `catch (e) {}` | HIGH - swallowed errors |
|
|
246
|
+
| **Console.log debugging** | `console.log('here')` | LOW - cleanup needed |
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Anti-Rationalization for AI Slop
|
|
251
|
+
|
|
252
|
+
| AI Rationalization | Why It's WRONG | Required Action |
|
|
253
|
+
|--------------------|----------------|-----------------|
|
|
254
|
+
| "For future extensibility" | YAGNI - don't build for hypotheticals | **Remove unless in requirements** |
|
|
255
|
+
| "Industry best practice" | Best practice ≠ every practice everywhere | **Verify it applies to THIS codebase** |
|
|
256
|
+
| "For testability" | Dependency injection doesn't require interfaces | **Question if abstraction is needed** |
|
|
257
|
+
| "Separation of concerns" | One class can have multiple methods | **Verify separation is warranted** |
|
|
258
|
+
| "Needed for the implementation" | Then it should be in requirements | **Add to requirements first** |
|
|
259
|
+
| "Improved while I was there" | Out of scope = untested = risky | **Separate PR required** |
|
|
260
|
+
| "DRY principle" | DRY doesn't justify scope creep | **Keep scope, refactor later** |
|
|
261
|
+
| "Future-proofing" | YAGNI applies | **Remove unless requested** |
|
|
262
|
+
| "Standard library for this" | May be hallucinated | **Verify package exists** |
|
|
263
|
+
| "Common pattern in codebase" | May not have read codebase | **Show evidence of pattern** |
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Quick Reference: Severity Summary
|
|
268
|
+
|
|
269
|
+
| Issue Type | Severity | Blocks PR? |
|
|
270
|
+
|------------|----------|------------|
|
|
271
|
+
| Phantom/hallucinated dependency | CRITICAL | YES |
|
|
272
|
+
| Typosquatting-adjacent package name | CRITICAL | YES |
|
|
273
|
+
| API/method that doesn't exist | HIGH | YES |
|
|
274
|
+
| Scope creep (new files not requested) | HIGH | YES (without justification) |
|
|
275
|
+
| 3+ overengineering patterns | HIGH | YES |
|
|
276
|
+
| Missing evidence of reading existing code | MEDIUM | No, but flag |
|
|
277
|
+
| 1-2 overengineering patterns | MEDIUM | No, but flag |
|
|
278
|
+
| Hallucination language indicators | MEDIUM | No, but investigate |
|
|
279
|
+
| Verbose/unnecessary boilerplate | LOW | No |
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Usage
|
|
284
|
+
|
|
285
|
+
All code review agents MUST:
|
|
286
|
+
|
|
287
|
+
1. **Reference this document** in their review checklist
|
|
288
|
+
2. **Check for AI slop patterns** before issuing PASS verdict
|
|
289
|
+
3. **Document findings** using the formats provided
|
|
290
|
+
4. **Escalate CRITICAL issues** as automatic FAIL
|
|
291
|
+
|
|
292
|
+
**Integration:**
|
|
293
|
+
```markdown
|
|
294
|
+
See [shared-patterns/ai-slop-detection.md](../skills/shared-patterns/ai-slop-detection.md) for AI slop detection checklist.
|
|
295
|
+
```
|