liteagents 2.4.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/CHANGELOG.md +441 -0
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/cli.js +230 -0
- package/docs/.gitkeep +1 -0
- package/docs/CONTRIBUTING.md +739 -0
- package/docs/DUAL_PUBLISH_SUMMARY.md +177 -0
- package/docs/ERROR_HANDLING_IMPLEMENTATION.md +327 -0
- package/docs/GITHUB_PACKAGES.md +181 -0
- package/docs/GITHUB_SETUP.md +158 -0
- package/docs/INSTALLATION_DEMO.md +691 -0
- package/docs/INSTALLATION_LOCATIONS.md +299 -0
- package/docs/INSTALLER_GUIDE.md +1586 -0
- package/docs/INTEGRATION_ISSUES_9.1.md +341 -0
- package/docs/KNOWLEDGE_BASE.md +727 -0
- package/docs/MIGRATION.md +384 -0
- package/docs/PACKAGE_BASELINE.md +557 -0
- package/docs/PACKAGE_VALIDATION_REPORT.md +427 -0
- package/docs/PASS_INTEGRATION.md +307 -0
- package/docs/PASS_QUICK_START.md +150 -0
- package/docs/PRIVACY.md +203 -0
- package/docs/PUBLISHING.md +494 -0
- package/docs/QUICK-START.md +318 -0
- package/docs/RELEASE_NOTES_1.2.0.md +323 -0
- package/docs/SECURITY.md +317 -0
- package/docs/SILENT_MODE_GUIDE.md +526 -0
- package/docs/SKILLS_CONVERSION.md +154 -0
- package/docs/TESTING.md +582 -0
- package/docs/TEST_COVERAGE.md +347 -0
- package/docs/TROUBLESHOOTING.md +788 -0
- package/docs/UPDATED_VARIANT_CONFIGURATION.md +274 -0
- package/docs/VARIANT_CONFIGURATION.md +440 -0
- package/installer/cli.js +761 -0
- package/installer/installation-engine.js +1536 -0
- package/installer/package-manager.js +640 -0
- package/installer/path-manager.js +427 -0
- package/installer/report-template.js +298 -0
- package/installer/verification-system.js +274 -0
- package/package.json +83 -0
- package/packages/ampcode/AGENT.md +58 -0
- package/packages/ampcode/README.md +17 -0
- package/packages/ampcode/agents/1-create-prd.md +175 -0
- package/packages/ampcode/agents/2-generate-tasks.md +190 -0
- package/packages/ampcode/agents/3-process-task-list.md +225 -0
- package/packages/ampcode/agents/code-developer.md +198 -0
- package/packages/ampcode/agents/context-builder.md +142 -0
- package/packages/ampcode/agents/feature-planner.md +199 -0
- package/packages/ampcode/agents/market-researcher.md +89 -0
- package/packages/ampcode/agents/orchestrator.md +116 -0
- package/packages/ampcode/agents/quality-assurance.md +115 -0
- package/packages/ampcode/agents/system-architect.md +135 -0
- package/packages/ampcode/agents/ui-designer.md +184 -0
- package/packages/ampcode/commands/brainstorming.md +56 -0
- package/packages/ampcode/commands/code-review.md +107 -0
- package/packages/ampcode/commands/condition-based-waiting/example.ts +158 -0
- package/packages/ampcode/commands/condition-based-waiting.md +122 -0
- package/packages/ampcode/commands/debug.md +20 -0
- package/packages/ampcode/commands/docs-builder/templates.md +572 -0
- package/packages/ampcode/commands/docs-builder.md +106 -0
- package/packages/ampcode/commands/explain.md +18 -0
- package/packages/ampcode/commands/git-commit.md +14 -0
- package/packages/ampcode/commands/optimize.md +20 -0
- package/packages/ampcode/commands/refactor.md +21 -0
- package/packages/ampcode/commands/review.md +18 -0
- package/packages/ampcode/commands/root-cause-tracing/find-polluter.sh +63 -0
- package/packages/ampcode/commands/root-cause-tracing.md +176 -0
- package/packages/ampcode/commands/security.md +21 -0
- package/packages/ampcode/commands/ship.md +18 -0
- package/packages/ampcode/commands/skill-creator/scripts/init_skill.py +303 -0
- package/packages/ampcode/commands/skill-creator/scripts/package_skill.py +110 -0
- package/packages/ampcode/commands/skill-creator/scripts/quick_validate.py +65 -0
- package/packages/ampcode/commands/skill-creator.md +211 -0
- package/packages/ampcode/commands/stash.md +45 -0
- package/packages/ampcode/commands/systematic-debugging.md +297 -0
- package/packages/ampcode/commands/test-driven-development.md +390 -0
- package/packages/ampcode/commands/test-generate.md +18 -0
- package/packages/ampcode/commands/testing-anti-patterns.md +304 -0
- package/packages/ampcode/commands/verification-before-completion.md +152 -0
- package/packages/ampcode/settings.json +13 -0
- package/packages/ampcode/variants.json +8 -0
- package/packages/claude/CLAUDE.md +58 -0
- package/packages/claude/README.md +23 -0
- package/packages/claude/agents/1-create-prd.md +175 -0
- package/packages/claude/agents/2-generate-tasks.md +190 -0
- package/packages/claude/agents/3-process-task-list.md +225 -0
- package/packages/claude/agents/code-developer.md +198 -0
- package/packages/claude/agents/context-builder.md +142 -0
- package/packages/claude/agents/feature-planner.md +199 -0
- package/packages/claude/agents/market-researcher.md +89 -0
- package/packages/claude/agents/orchestrator.md +117 -0
- package/packages/claude/agents/quality-assurance.md +115 -0
- package/packages/claude/agents/system-architect.md +135 -0
- package/packages/claude/agents/ui-designer.md +184 -0
- package/packages/claude/commands/debug.md +20 -0
- package/packages/claude/commands/explain.md +18 -0
- package/packages/claude/commands/git-commit.md +14 -0
- package/packages/claude/commands/optimize.md +20 -0
- package/packages/claude/commands/refactor.md +21 -0
- package/packages/claude/commands/review.md +18 -0
- package/packages/claude/commands/security.md +21 -0
- package/packages/claude/commands/ship.md +18 -0
- package/packages/claude/commands/stash.md +45 -0
- package/packages/claude/commands/test-generate.md +18 -0
- package/packages/claude/skills/brainstorming/SKILL.md +56 -0
- package/packages/claude/skills/code-review/SKILL.md +107 -0
- package/packages/claude/skills/code-review/code-reviewer.md +146 -0
- package/packages/claude/skills/condition-based-waiting/SKILL.md +122 -0
- package/packages/claude/skills/condition-based-waiting/example.ts +158 -0
- package/packages/claude/skills/docs-builder/SKILL.md +106 -0
- package/packages/claude/skills/docs-builder/references/templates.md +572 -0
- package/packages/claude/skills/root-cause-tracing/SKILL.md +176 -0
- package/packages/claude/skills/root-cause-tracing/find-polluter.sh +63 -0
- package/packages/claude/skills/skill-creator/LICENSE.txt +202 -0
- package/packages/claude/skills/skill-creator/SKILL.md +211 -0
- package/packages/claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/packages/claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/packages/claude/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/packages/claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/packages/claude/skills/systematic-debugging/SKILL.md +296 -0
- package/packages/claude/skills/systematic-debugging/test-academic.md +14 -0
- package/packages/claude/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/packages/claude/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/packages/claude/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/packages/claude/skills/test-driven-development/SKILL.md +392 -0
- package/packages/claude/skills/testing-anti-patterns/SKILL.md +304 -0
- package/packages/claude/skills/verification-before-completion/SKILL.md +152 -0
- package/packages/claude/variants.json +9 -0
- package/packages/droid/AGENTS.md +52 -0
- package/packages/droid/README.md +17 -0
- package/packages/droid/change_settings.json +61 -0
- package/packages/droid/commands/brainstorming.md +56 -0
- package/packages/droid/commands/code-review.md +107 -0
- package/packages/droid/commands/condition-based-waiting/example.ts +158 -0
- package/packages/droid/commands/condition-based-waiting.md +122 -0
- package/packages/droid/commands/debug.md +20 -0
- package/packages/droid/commands/docs-builder/templates.md +572 -0
- package/packages/droid/commands/docs-builder.md +106 -0
- package/packages/droid/commands/explain.md +18 -0
- package/packages/droid/commands/git-commit.md +14 -0
- package/packages/droid/commands/optimize.md +20 -0
- package/packages/droid/commands/refactor.md +21 -0
- package/packages/droid/commands/review.md +18 -0
- package/packages/droid/commands/root-cause-tracing/find-polluter.sh +63 -0
- package/packages/droid/commands/root-cause-tracing.md +176 -0
- package/packages/droid/commands/security.md +21 -0
- package/packages/droid/commands/ship.md +18 -0
- package/packages/droid/commands/skill-creator/scripts/init_skill.py +303 -0
- package/packages/droid/commands/skill-creator/scripts/package_skill.py +110 -0
- package/packages/droid/commands/skill-creator/scripts/quick_validate.py +65 -0
- package/packages/droid/commands/skill-creator.md +211 -0
- package/packages/droid/commands/stash.md +45 -0
- package/packages/droid/commands/systematic-debugging.md +297 -0
- package/packages/droid/commands/test-driven-development.md +390 -0
- package/packages/droid/commands/test-generate.md +18 -0
- package/packages/droid/commands/testing-anti-patterns.md +304 -0
- package/packages/droid/commands/verification-before-completion.md +152 -0
- package/packages/droid/droids/1-create-prd.md +170 -0
- package/packages/droid/droids/2-generate-tasks.md +190 -0
- package/packages/droid/droids/3-process-task-list.md +225 -0
- package/packages/droid/droids/code-developer.md +198 -0
- package/packages/droid/droids/context-builder.md +142 -0
- package/packages/droid/droids/feature-planner.md +199 -0
- package/packages/droid/droids/market-researcher.md +89 -0
- package/packages/droid/droids/orchestrator.md +116 -0
- package/packages/droid/droids/quality-assurance.md +115 -0
- package/packages/droid/droids/system-architect.md +135 -0
- package/packages/droid/droids/ui-designer.md +184 -0
- package/packages/droid/variants.json +8 -0
- package/packages/opencode/AGENTS.md +52 -0
- package/packages/opencode/README.md +17 -0
- package/packages/opencode/agent/1-create-prd.md +179 -0
- package/packages/opencode/agent/2-generate-tasks.md +194 -0
- package/packages/opencode/agent/3-process-task-list.md +229 -0
- package/packages/opencode/agent/code-developer.md +202 -0
- package/packages/opencode/agent/context-builder.md +146 -0
- package/packages/opencode/agent/feature-planner.md +203 -0
- package/packages/opencode/agent/market-researcher.md +93 -0
- package/packages/opencode/agent/orchestrator.md +120 -0
- package/packages/opencode/agent/quality-assurance.md +119 -0
- package/packages/opencode/agent/system-architect.md +139 -0
- package/packages/opencode/agent/ui-designer.md +188 -0
- package/packages/opencode/command/brainstorming.md +56 -0
- package/packages/opencode/command/code-review.md +107 -0
- package/packages/opencode/command/condition-based-waiting/example.ts +158 -0
- package/packages/opencode/command/condition-based-waiting.md +122 -0
- package/packages/opencode/command/debug.md +20 -0
- package/packages/opencode/command/docs-builder/templates.md +572 -0
- package/packages/opencode/command/docs-builder.md +106 -0
- package/packages/opencode/command/explain.md +18 -0
- package/packages/opencode/command/git-commit.md +14 -0
- package/packages/opencode/command/optimize.md +20 -0
- package/packages/opencode/command/refactor.md +21 -0
- package/packages/opencode/command/review.md +18 -0
- package/packages/opencode/command/root-cause-tracing/find-polluter.sh +63 -0
- package/packages/opencode/command/root-cause-tracing.md +176 -0
- package/packages/opencode/command/security.md +21 -0
- package/packages/opencode/command/ship.md +18 -0
- package/packages/opencode/command/skill-creator/scripts/init_skill.py +303 -0
- package/packages/opencode/command/skill-creator/scripts/package_skill.py +110 -0
- package/packages/opencode/command/skill-creator/scripts/quick_validate.py +65 -0
- package/packages/opencode/command/skill-creator.md +211 -0
- package/packages/opencode/command/stash.md +45 -0
- package/packages/opencode/command/systematic-debugging.md +297 -0
- package/packages/opencode/command/test-driven-development.md +390 -0
- package/packages/opencode/command/test-generate.md +18 -0
- package/packages/opencode/command/testing-anti-patterns.md +304 -0
- package/packages/opencode/command/verification-before-completion.md +152 -0
- package/packages/opencode/opencode.jsonc +201 -0
- package/packages/opencode/variants.json +8 -0
- package/packages/subagentic-manual.md +349 -0
- package/postinstall.js +21 -0
- package/tools/ampcode/manifest-template.json +14 -0
- package/tools/claude/manifest-template.json +14 -0
- package/tools/droid/manifest-template.json +14 -0
- package/tools/opencode/manifest-template.json +14 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: testing-anti-patterns
|
|
3
|
+
description: Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies
|
|
4
|
+
usage: /testing-anti-patterns <testing-scenario>
|
|
5
|
+
auto_trigger: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Testing Anti-Patterns
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Tests must verify real behavior, not mock behavior. Mocks are a means to isolate, not the thing being tested.
|
|
13
|
+
|
|
14
|
+
**Core principle:** Test what the code does, not what the mocks do.
|
|
15
|
+
|
|
16
|
+
**Following strict TDD prevents these anti-patterns.**
|
|
17
|
+
|
|
18
|
+
## The Iron Laws
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
1. NEVER test mock behavior
|
|
22
|
+
2. NEVER add test-only methods to production classes
|
|
23
|
+
3. NEVER mock without understanding dependencies
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Anti-Pattern 1: Testing Mock Behavior
|
|
27
|
+
|
|
28
|
+
**The violation:**
|
|
29
|
+
```typescript
|
|
30
|
+
// ❌ BAD: Testing that the mock exists
|
|
31
|
+
test('renders sidebar', () => {
|
|
32
|
+
render(<Page />);
|
|
33
|
+
expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Why this is wrong:**
|
|
38
|
+
- You're verifying the mock works, not that the component works
|
|
39
|
+
- Test passes when mock is present, fails when it's not
|
|
40
|
+
- Tells you nothing about real behavior
|
|
41
|
+
|
|
42
|
+
**your human partner's correction:** "Are we testing the behavior of a mock?"
|
|
43
|
+
|
|
44
|
+
**The fix:**
|
|
45
|
+
```typescript
|
|
46
|
+
// ✅ GOOD: Test real component or don't mock it
|
|
47
|
+
test('renders sidebar', () => {
|
|
48
|
+
render(<Page />); // Don't mock sidebar
|
|
49
|
+
expect(screen.getByRole('navigation')).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// OR if sidebar must be mocked for isolation:
|
|
53
|
+
// Don't assert on the mock - test Page's behavior with sidebar present
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Gate Function
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
BEFORE asserting on any mock element:
|
|
60
|
+
Ask: "Am I testing real component behavior or just mock existence?"
|
|
61
|
+
|
|
62
|
+
IF testing mock existence:
|
|
63
|
+
STOP - Delete the assertion or unmock the component
|
|
64
|
+
|
|
65
|
+
Test real behavior instead
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Anti-Pattern 2: Test-Only Methods in Production
|
|
69
|
+
|
|
70
|
+
**The violation:**
|
|
71
|
+
```typescript
|
|
72
|
+
// ❌ BAD: destroy() only used in tests
|
|
73
|
+
class Session {
|
|
74
|
+
async destroy() { // Looks like production API!
|
|
75
|
+
await this._workspaceManager?.destroyWorkspace(this.id);
|
|
76
|
+
// ... cleanup
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// In tests
|
|
81
|
+
afterEach(() => session.destroy());
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Why this is wrong:**
|
|
85
|
+
- Production class polluted with test-only code
|
|
86
|
+
- Dangerous if accidentally called in production
|
|
87
|
+
- Violates YAGNI and separation of concerns
|
|
88
|
+
- Confuses object lifecycle with entity lifecycle
|
|
89
|
+
|
|
90
|
+
**The fix:**
|
|
91
|
+
```typescript
|
|
92
|
+
// ✅ GOOD: Test utilities handle test cleanup
|
|
93
|
+
// Session has no destroy() - it's stateless in production
|
|
94
|
+
|
|
95
|
+
// In test-utils/
|
|
96
|
+
export async function cleanupSession(session: Session) {
|
|
97
|
+
const workspace = session.getWorkspaceInfo();
|
|
98
|
+
if (workspace) {
|
|
99
|
+
await workspaceManager.destroyWorkspace(workspace.id);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// In tests
|
|
104
|
+
afterEach(() => cleanupSession(session));
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Gate Function
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
BEFORE adding any method to production class:
|
|
111
|
+
Ask: "Is this only used by tests?"
|
|
112
|
+
|
|
113
|
+
IF yes:
|
|
114
|
+
STOP - Don't add it
|
|
115
|
+
Put it in test utilities instead
|
|
116
|
+
|
|
117
|
+
Ask: "Does this class own this resource's lifecycle?"
|
|
118
|
+
|
|
119
|
+
IF no:
|
|
120
|
+
STOP - Wrong class for this method
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Anti-Pattern 3: Mocking Without Understanding
|
|
124
|
+
|
|
125
|
+
**The violation:**
|
|
126
|
+
```typescript
|
|
127
|
+
// ❌ BAD: Mock breaks test logic
|
|
128
|
+
test('detects duplicate server', () => {
|
|
129
|
+
// Mock prevents config write that test depends on!
|
|
130
|
+
vi.mock('ToolCatalog', () => ({
|
|
131
|
+
discoverAndCacheTools: vi.fn().mockResolvedValue(undefined)
|
|
132
|
+
}));
|
|
133
|
+
|
|
134
|
+
await addServer(config);
|
|
135
|
+
await addServer(config); // Should throw - but won't!
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Why this is wrong:**
|
|
140
|
+
- Mocked method had side effect test depended on (writing config)
|
|
141
|
+
- Over-mocking to "be safe" breaks actual behavior
|
|
142
|
+
- Test passes for wrong reason or fails mysteriously
|
|
143
|
+
|
|
144
|
+
**The fix:**
|
|
145
|
+
```typescript
|
|
146
|
+
// ✅ GOOD: Mock at correct level
|
|
147
|
+
test('detects duplicate server', () => {
|
|
148
|
+
// Mock the slow part, preserve behavior test needs
|
|
149
|
+
vi.mock('MCPServerManager'); // Just mock slow server startup
|
|
150
|
+
|
|
151
|
+
await addServer(config); // Config written
|
|
152
|
+
await addServer(config); // Duplicate detected ✓
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Gate Function
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
BEFORE mocking any method:
|
|
160
|
+
STOP - Don't mock yet
|
|
161
|
+
|
|
162
|
+
1. Ask: "What side effects does the real method have?"
|
|
163
|
+
2. Ask: "Does this test depend on any of those side effects?"
|
|
164
|
+
3. Ask: "Do I fully understand what this test needs?"
|
|
165
|
+
|
|
166
|
+
IF depends on side effects:
|
|
167
|
+
Mock at lower level (the actual slow/external operation)
|
|
168
|
+
OR use test doubles that preserve necessary behavior
|
|
169
|
+
NOT the high-level method the test depends on
|
|
170
|
+
|
|
171
|
+
IF unsure what test depends on:
|
|
172
|
+
Run test with real implementation FIRST
|
|
173
|
+
Observe what actually needs to happen
|
|
174
|
+
THEN add minimal mocking at the right level
|
|
175
|
+
|
|
176
|
+
Red flags:
|
|
177
|
+
- "I'll mock this to be safe"
|
|
178
|
+
- "This might be slow, better mock it"
|
|
179
|
+
- Mocking without understanding the dependency chain
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Anti-Pattern 4: Incomplete Mocks
|
|
183
|
+
|
|
184
|
+
**The violation:**
|
|
185
|
+
```typescript
|
|
186
|
+
// ❌ BAD: Partial mock - only fields you think you need
|
|
187
|
+
const mockResponse = {
|
|
188
|
+
status: 'success',
|
|
189
|
+
data: { userId: '123', name: 'Alice' }
|
|
190
|
+
// Missing: metadata that downstream code uses
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// Later: breaks when code accesses response.metadata.requestId
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Why this is wrong:**
|
|
197
|
+
- **Partial mocks hide structural assumptions** - You only mocked fields you know about
|
|
198
|
+
- **Downstream code may depend on fields you didn't include** - Silent failures
|
|
199
|
+
- **Tests pass but integration fails** - Mock incomplete, real API complete
|
|
200
|
+
- **False confidence** - Test proves nothing about real behavior
|
|
201
|
+
|
|
202
|
+
**The Iron Rule:** Mock the COMPLETE data structure as it exists in reality, not just fields your immediate test uses.
|
|
203
|
+
|
|
204
|
+
**The fix:**
|
|
205
|
+
```typescript
|
|
206
|
+
// ✅ GOOD: Mirror real API completeness
|
|
207
|
+
const mockResponse = {
|
|
208
|
+
status: 'success',
|
|
209
|
+
data: { userId: '123', name: 'Alice' },
|
|
210
|
+
metadata: { requestId: 'req-789', timestamp: 1234567890 }
|
|
211
|
+
// All fields real API returns
|
|
212
|
+
};
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Gate Function
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
BEFORE creating mock responses:
|
|
219
|
+
Check: "What fields does the real API response contain?"
|
|
220
|
+
|
|
221
|
+
Actions:
|
|
222
|
+
1. Examine actual API response from docs/examples
|
|
223
|
+
2. Include ALL fields system might consume downstream
|
|
224
|
+
3. Verify mock matches real response schema completely
|
|
225
|
+
|
|
226
|
+
Critical:
|
|
227
|
+
If you're creating a mock, you must understand the ENTIRE structure
|
|
228
|
+
Partial mocks fail silently when code depends on omitted fields
|
|
229
|
+
|
|
230
|
+
If uncertain: Include all documented fields
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Anti-Pattern 5: Integration Tests as Afterthought
|
|
234
|
+
|
|
235
|
+
**The violation:**
|
|
236
|
+
```
|
|
237
|
+
✅ Implementation complete
|
|
238
|
+
❌ No tests written
|
|
239
|
+
"Ready for testing"
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Why this is wrong:**
|
|
243
|
+
- Testing is part of implementation, not optional follow-up
|
|
244
|
+
- TDD would have caught this
|
|
245
|
+
- Can't claim complete without tests
|
|
246
|
+
|
|
247
|
+
**The fix:**
|
|
248
|
+
```
|
|
249
|
+
TDD cycle:
|
|
250
|
+
1. Write failing test
|
|
251
|
+
2. Implement to pass
|
|
252
|
+
3. Refactor
|
|
253
|
+
4. THEN claim complete
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## When Mocks Become Too Complex
|
|
257
|
+
|
|
258
|
+
**Warning signs:**
|
|
259
|
+
- Mock setup longer than test logic
|
|
260
|
+
- Mocking everything to make test pass
|
|
261
|
+
- Mocks missing methods real components have
|
|
262
|
+
- Test breaks when mock changes
|
|
263
|
+
|
|
264
|
+
**your human partner's question:** "Do we need to be using a mock here?"
|
|
265
|
+
|
|
266
|
+
**Consider:** Integration tests with real components often simpler than complex mocks
|
|
267
|
+
|
|
268
|
+
## TDD Prevents These Anti-Patterns
|
|
269
|
+
|
|
270
|
+
**Why TDD helps:**
|
|
271
|
+
1. **Write test first** → Forces you to think about what you're actually testing
|
|
272
|
+
2. **Watch it fail** → Confirms test tests real behavior, not mocks
|
|
273
|
+
3. **Minimal implementation** → No test-only methods creep in
|
|
274
|
+
4. **Real dependencies** → You see what the test actually needs before mocking
|
|
275
|
+
|
|
276
|
+
**If you're testing mock behavior, you violated TDD** - you added mocks without watching test fail against real code first.
|
|
277
|
+
|
|
278
|
+
## Quick Reference
|
|
279
|
+
|
|
280
|
+
| Anti-Pattern | Fix |
|
|
281
|
+
|--------------|-----|
|
|
282
|
+
| Assert on mock elements | Test real component or unmock it |
|
|
283
|
+
| Test-only methods in production | Move to test utilities |
|
|
284
|
+
| Mock without understanding | Understand dependencies first, mock minimally |
|
|
285
|
+
| Incomplete mocks | Mirror real API completely |
|
|
286
|
+
| Tests as afterthought | TDD - tests first |
|
|
287
|
+
| Over-complex mocks | Consider integration tests |
|
|
288
|
+
|
|
289
|
+
## Red Flags
|
|
290
|
+
|
|
291
|
+
- Assertion checks for `*-mock` test IDs
|
|
292
|
+
- Methods only called in test files
|
|
293
|
+
- Mock setup is >50% of test
|
|
294
|
+
- Test fails when you remove mock
|
|
295
|
+
- Can't explain why mock is needed
|
|
296
|
+
- Mocking "just to be safe"
|
|
297
|
+
|
|
298
|
+
## The Bottom Line
|
|
299
|
+
|
|
300
|
+
**Mocks are tools to isolate, not things to test.**
|
|
301
|
+
|
|
302
|
+
If TDD reveals you're testing mock behavior, you've gone wrong.
|
|
303
|
+
|
|
304
|
+
Fix: Test real behavior or question why you're mocking at all.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-before-completion
|
|
3
|
+
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
|
|
4
|
+
usage: /verification-before-completion <work-to-verify>
|
|
5
|
+
auto_trigger: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Verification Before Completion
|
|
9
|
+
|
|
10
|
+
## Auto-Trigger
|
|
11
|
+
|
|
12
|
+
**APPLIES WHEN:**
|
|
13
|
+
- About to say: done, fixed, complete, passing, success
|
|
14
|
+
- About to commit, push, create PR
|
|
15
|
+
- About to mark task [x]
|
|
16
|
+
|
|
17
|
+
**APPLIES TO:** All agents, all invocation paths
|
|
18
|
+
|
|
19
|
+
**NEVER SKIP:** Even for "obvious" tasks
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
24
|
+
|
|
25
|
+
**Core principle:** Evidence before claims, always.
|
|
26
|
+
|
|
27
|
+
**Violating the letter of this rule is violating the spirit of this rule.**
|
|
28
|
+
|
|
29
|
+
## The Iron Law
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you haven't run the verification command in this message, you cannot claim it passes.
|
|
36
|
+
|
|
37
|
+
## The Gate Function
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
BEFORE claiming any status or expressing satisfaction:
|
|
41
|
+
|
|
42
|
+
1. IDENTIFY: What command proves this claim?
|
|
43
|
+
2. RUN: Execute the FULL command (fresh, complete)
|
|
44
|
+
3. READ: Full output, check exit code, count failures
|
|
45
|
+
4. VERIFY: Does output confirm the claim?
|
|
46
|
+
- If NO: State actual status with evidence
|
|
47
|
+
- If YES: State claim WITH evidence
|
|
48
|
+
5. ONLY THEN: Make the claim
|
|
49
|
+
|
|
50
|
+
Skip any step = lying, not verifying
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Common Failures
|
|
54
|
+
|
|
55
|
+
| Claim | Requires | Not Sufficient |
|
|
56
|
+
|-------|----------|----------------|
|
|
57
|
+
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
58
|
+
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
59
|
+
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
|
|
60
|
+
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
61
|
+
| Regression test works | Red-green cycle verified | Test passes once |
|
|
62
|
+
| Agent completed | VCS diff shows changes | Agent reports "success" |
|
|
63
|
+
| Requirements met | Line-by-line checklist | Tests passing |
|
|
64
|
+
|
|
65
|
+
## Red Flags - STOP
|
|
66
|
+
|
|
67
|
+
- Using "should", "probably", "seems to"
|
|
68
|
+
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
|
|
69
|
+
- About to commit/push/PR without verification
|
|
70
|
+
- Trusting agent success reports
|
|
71
|
+
- Relying on partial verification
|
|
72
|
+
- Thinking "just this once"
|
|
73
|
+
- Tired and wanting work over
|
|
74
|
+
- **ANY wording implying success without having run verification**
|
|
75
|
+
|
|
76
|
+
## Rationalization Prevention
|
|
77
|
+
|
|
78
|
+
| Excuse | Reality |
|
|
79
|
+
|--------|---------|
|
|
80
|
+
| "Should work now" | RUN the verification |
|
|
81
|
+
| "I'm confident" | Confidence ≠ evidence |
|
|
82
|
+
| "Just this once" | No exceptions |
|
|
83
|
+
| "Linter passed" | Linter ≠ compiler |
|
|
84
|
+
| "Agent said success" | Verify independently |
|
|
85
|
+
| "I'm tired" | Exhaustion ≠ excuse |
|
|
86
|
+
| "Partial check is enough" | Partial proves nothing |
|
|
87
|
+
| "Different words so rule doesn't apply" | Spirit over letter |
|
|
88
|
+
|
|
89
|
+
## Key Patterns
|
|
90
|
+
|
|
91
|
+
**Tests:**
|
|
92
|
+
```
|
|
93
|
+
✅ [Run test command] [See: 34/34 pass] "All tests pass"
|
|
94
|
+
❌ "Should pass now" / "Looks correct"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Regression tests (TDD Red-Green):**
|
|
98
|
+
```
|
|
99
|
+
✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
|
|
100
|
+
❌ "I've written a regression test" (without red-green verification)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Build:**
|
|
104
|
+
```
|
|
105
|
+
✅ [Run build] [See: exit 0] "Build passes"
|
|
106
|
+
❌ "Linter passed" (linter doesn't check compilation)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Requirements:**
|
|
110
|
+
```
|
|
111
|
+
✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
|
|
112
|
+
❌ "Tests pass, phase complete"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Agent delegation:**
|
|
116
|
+
```
|
|
117
|
+
✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
|
|
118
|
+
❌ Trust agent report
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Why This Matters
|
|
122
|
+
|
|
123
|
+
From 24 failure memories:
|
|
124
|
+
- your human partner said "I don't believe you" - trust broken
|
|
125
|
+
- Undefined functions shipped - would crash
|
|
126
|
+
- Missing requirements shipped - incomplete features
|
|
127
|
+
- Time wasted on false completion → redirect → rework
|
|
128
|
+
- Violates: "Honesty is a core value. If you lie, you'll be replaced."
|
|
129
|
+
|
|
130
|
+
## When To Apply
|
|
131
|
+
|
|
132
|
+
**ALWAYS before:**
|
|
133
|
+
- ANY variation of success/completion claims
|
|
134
|
+
- ANY expression of satisfaction
|
|
135
|
+
- ANY positive statement about work state
|
|
136
|
+
- Committing, PR creation, task completion
|
|
137
|
+
- Moving to next task
|
|
138
|
+
- Delegating to agents
|
|
139
|
+
|
|
140
|
+
**Rule applies to:**
|
|
141
|
+
- Exact phrases
|
|
142
|
+
- Paraphrases and synonyms
|
|
143
|
+
- Implications of success
|
|
144
|
+
- ANY communication suggesting completion/correctness
|
|
145
|
+
|
|
146
|
+
## The Bottom Line
|
|
147
|
+
|
|
148
|
+
**No shortcuts for verification.**
|
|
149
|
+
|
|
150
|
+
Run the command. Read the output. THEN claim the result.
|
|
151
|
+
|
|
152
|
+
This is non-negotiable.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"amp.anthropic.thinking.enabled": true,
|
|
3
|
+
"amp.git.commit.ampThread.enabled": true,
|
|
4
|
+
"amp.git.commit.coauthor.enabled": true,
|
|
5
|
+
"amp.todos.enabled": true,
|
|
6
|
+
"amp.terminal.commands.nodeSpawn.loadProfile": "always",
|
|
7
|
+
"amp.tools.stopTimeout": 300,
|
|
8
|
+
"amp.updates.mode": "auto",
|
|
9
|
+
"amp.permissions": [],
|
|
10
|
+
"amp.tools.disable": [],
|
|
11
|
+
"amp.mcpServers": {},
|
|
12
|
+
"amp.mcpPermissions": []
|
|
13
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Global Claude Code CLI
|
|
2
|
+
|
|
3
|
+
Claude Code is a lightweight CLI tool that provides workflow automation commands.
|
|
4
|
+
|
|
5
|
+
## Claude Code Subagents (Reference)
|
|
6
|
+
|
|
7
|
+
These subagents are available when using Claude Code CLI. Droid can reference them but doesn't implement them directly.
|
|
8
|
+
|
|
9
|
+
### Subagents (11 total)
|
|
10
|
+
|
|
11
|
+
| ID | Title | When To Use |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| 1-create-prd | 1-Create PRD | Define Scope - use to clearly outline what needs to be built with a Product Requirement Document (PRD) |
|
|
14
|
+
| 2-generate-tasks | 2-Generate Tasks | Detailed Planning - use to break down the PRD into a granular, actionable task list |
|
|
15
|
+
| 3-process-task-list | 3-Process Task List | Iterative Implementation - use to guide the AI to tackle one task at a time, allowing you to review and approve each change |
|
|
16
|
+
| code-developer | Full Stack Developer | Use for code implementation, debugging, refactoring, and development best practices |
|
|
17
|
+
| context-builder | Context Initializer | Use to initialize project context for new/existing projects, discover and organize documentation, create CLAUDE.md and KNOWLEDGE_BASE.md for optimal token-efficient memory |
|
|
18
|
+
| feature-planner | Product Manager | Use for creating epics and user stories, prioritization, backlog navigation, story refinement, and retrospectives |
|
|
19
|
+
| market-researcher | Business Analyst | Use for market research, brainstorming, competitive analysis, project briefs, and initial project discovery |
|
|
20
|
+
| orchestrator | Master Orchestrator | Use for workflow coordination, multi-agent tasks, role switching guidance, and when unsure which specialist to consult |
|
|
21
|
+
| quality-assurance | Test Architect & Quality Advisor | Use for comprehensive test architecture review, quality gate decisions, and code improvement. Provides thorough analysis including requirements traceability, risk assessment, and test strategy. Advisory only - teams choose their quality bar |
|
|
22
|
+
| system-architect | Architect | Use for system design, architecture documents, technology selection, API design, and infrastructure planning |
|
|
23
|
+
| ui-designer | UX Expert | Use for UI/UX design, wireframes, prototypes, front-end specifications, and user experience optimization |
|
|
24
|
+
|
|
25
|
+
### Skills (10 total)
|
|
26
|
+
|
|
27
|
+
| ID | Description | Usage | Auto |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| brainstorming | Refines rough ideas into fully-formed designs through collaborative questioning | /brainstorming <session-type> <topic> | false |
|
|
30
|
+
| code-review | Reviews implementation against plan or requirements before proceeding | /code-review <review-scope> <focus-areas> | false |
|
|
31
|
+
| condition-based-waiting | Replaces arbitrary timeouts with condition polling to wait for actual state changes | /condition-based-waiting <condition-type> <timeout-specs> | false |
|
|
32
|
+
| docs-builder | Create comprehensive project documentation with structured /docs hierarchy | /docs-builder | false |
|
|
33
|
+
| root-cause-tracing | Systematically traces bugs backward through call stack to identify source | /root-cause-tracing <issue-description> | false |
|
|
34
|
+
| skill-creator | Guide for creating effective skills and extending Claude capabilities | /skill-creator <skill-type> <skill-description> | false |
|
|
35
|
+
| systematic-debugging | Four-phase debugging framework - investigate root cause before any fixes | /systematic-debugging <bug-or-error-description> | false |
|
|
36
|
+
| test-driven-development | Write test first, watch it fail, write minimal code to pass | /test-driven-development <feature-or-behavior-to-test> | true |
|
|
37
|
+
| testing-anti-patterns | Prevents testing mock behavior and production pollution with test-only methods | /testing-anti-patterns <testing-scenario> | true |
|
|
38
|
+
| verification-before-completion | Requires running verification commands before making any success claims | /verification-before-completion <work-to-verify> | true |
|
|
39
|
+
|
|
40
|
+
### Commands (10 total)
|
|
41
|
+
|
|
42
|
+
| ID | Description | Usage |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| debug | Debug an issue systematically using structured investigation techniques | /debug <issue-description> |
|
|
45
|
+
| explain | Explain code for someone new to the codebase | /explain <code-section> |
|
|
46
|
+
| git-commit | Analyze changes and create intelligent git commits | /git-commit |
|
|
47
|
+
| optimize | Analyze and optimize performance issues | /optimize <target-area> |
|
|
48
|
+
| refactor | Refactor code while maintaining behavior and tests | /refactor <code-section> |
|
|
49
|
+
| review | Comprehensive code review including quality, tests, and architecture | /review |
|
|
50
|
+
| security | Security vulnerability scan and analysis | /security |
|
|
51
|
+
| ship | Pre-deployment verification checklist | /ship |
|
|
52
|
+
| stash | Save session context for compaction recovery or handoffs | /stash ["optional-name"] |
|
|
53
|
+
| test-generate | Generate comprehensive test suites for existing code | /test-generate <code-section> |
|
|
54
|
+
|
|
55
|
+
All resources are auto-discovered from frontmatter in their respective directories:
|
|
56
|
+
- **Agents**: `./agents/*.md`
|
|
57
|
+
- **Skills**: `./skills/*/SKILL.md`
|
|
58
|
+
- **Commands**: `./commands/*.md`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Claude Code Packages
|
|
2
|
+
|
|
3
|
+
Claude Code AI development assistant packages optimized for conversational AI interactions.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
- `lite/` - Minimal setup with 3 core agents
|
|
7
|
+
- `standard/` - Full agent set with 8 core skills
|
|
8
|
+
- `pro/` - Complete toolkit with 14 advanced skills
|
|
9
|
+
|
|
10
|
+
## Content Source
|
|
11
|
+
Existing content available in `../claude_temp_backup/` ready to be organized into variants.
|
|
12
|
+
|
|
13
|
+
## Optimization Focus
|
|
14
|
+
- Conversational AI patterns
|
|
15
|
+
- Markdown formatting
|
|
16
|
+
- Claude-specific response handling
|
|
17
|
+
- Plugin integration
|
|
18
|
+
|
|
19
|
+
## Next Steps
|
|
20
|
+
1. Copy 3 core agents to `lite/`
|
|
21
|
+
2. Copy all agents + 8 skills to `standard/`
|
|
22
|
+
3. Copy all agents + 14 skills to `pro/`
|
|
23
|
+
4. Customize for Claude-specific optimizations
|