@cloudstreamsoftware/claude-tools 1.0.0 → 1.2.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 +152 -37
- package/agents/INDEX.md +183 -0
- package/agents/architect.md +247 -0
- package/agents/build-error-resolver.md +555 -0
- package/agents/catalyst-deployer.md +132 -0
- package/agents/code-reviewer.md +121 -0
- package/agents/compliance-auditor.md +148 -0
- package/agents/creator-architect.md +395 -0
- package/agents/deluge-reviewer.md +98 -0
- package/agents/doc-updater.md +471 -0
- package/agents/e2e-runner.md +711 -0
- package/agents/planner.md +122 -0
- package/agents/refactor-cleaner.md +309 -0
- package/agents/security-reviewer.md +582 -0
- package/agents/tdd-guide.md +302 -0
- package/bin/cloudstream-setup.js +16 -6
- package/config/versions.json +63 -0
- package/dist/hooks/hooks.json +209 -0
- package/dist/index.js +47 -0
- package/dist/lib/asset-value.js +609 -0
- package/dist/lib/client-manager.js +300 -0
- package/dist/lib/command-matcher.js +242 -0
- package/dist/lib/cross-session-patterns.js +754 -0
- package/dist/lib/intent-classifier.js +1075 -0
- package/dist/lib/package-manager.js +374 -0
- package/dist/lib/recommendation-engine.js +597 -0
- package/dist/lib/session-memory.js +489 -0
- package/dist/lib/skill-effectiveness.js +486 -0
- package/dist/lib/skill-matcher.js +595 -0
- package/dist/lib/tutorial-metrics.js +242 -0
- package/dist/lib/tutorial-progress.js +209 -0
- package/dist/lib/tutorial-renderer.js +431 -0
- package/dist/lib/utils.js +380 -0
- package/dist/lib/verify-formatter.js +143 -0
- package/dist/lib/workflow-state.js +249 -0
- package/hooks/hooks.json +209 -0
- package/package.json +5 -1
- package/scripts/aggregate-sessions.js +290 -0
- package/scripts/branch-name-validator.js +291 -0
- package/scripts/build.js +101 -0
- package/scripts/commands/client-switch.js +231 -0
- package/scripts/deprecate-skill.js +610 -0
- package/scripts/diagnose.js +324 -0
- package/scripts/doc-freshness.js +168 -0
- package/scripts/generate-weekly-digest.js +393 -0
- package/scripts/health-check.js +270 -0
- package/scripts/hooks/credential-check.js +101 -0
- package/scripts/hooks/evaluate-session.js +81 -0
- package/scripts/hooks/pre-compact.js +66 -0
- package/scripts/hooks/prompt-analyzer.js +276 -0
- package/scripts/hooks/prompt-router.js +422 -0
- package/scripts/hooks/quality-gate-enforcer.js +371 -0
- package/scripts/hooks/session-end.js +156 -0
- package/scripts/hooks/session-start.js +195 -0
- package/scripts/hooks/skill-injector.js +333 -0
- package/scripts/hooks/suggest-compact.js +58 -0
- package/scripts/lib/asset-value.js +609 -0
- package/scripts/lib/client-manager.js +300 -0
- package/scripts/lib/command-matcher.js +242 -0
- package/scripts/lib/cross-session-patterns.js +754 -0
- package/scripts/lib/intent-classifier.js +1075 -0
- package/scripts/lib/package-manager.js +374 -0
- package/scripts/lib/recommendation-engine.js +597 -0
- package/scripts/lib/session-memory.js +489 -0
- package/scripts/lib/skill-effectiveness.js +486 -0
- package/scripts/lib/skill-matcher.js +595 -0
- package/scripts/lib/tutorial-metrics.js +242 -0
- package/scripts/lib/tutorial-progress.js +209 -0
- package/scripts/lib/tutorial-renderer.js +431 -0
- package/scripts/lib/utils.js +380 -0
- package/scripts/lib/verify-formatter.js +143 -0
- package/scripts/lib/workflow-state.js +249 -0
- package/scripts/onboard.js +363 -0
- package/scripts/quarterly-report.js +692 -0
- package/scripts/setup-package-manager.js +204 -0
- package/scripts/sync-upstream.js +391 -0
- package/scripts/test.js +108 -0
- package/scripts/tutorial-runner.js +351 -0
- package/scripts/validate-all.js +201 -0
- package/scripts/verifiers/agents.js +245 -0
- package/scripts/verifiers/config.js +186 -0
- package/scripts/verifiers/environment.js +123 -0
- package/scripts/verifiers/hooks.js +188 -0
- package/scripts/verifiers/index.js +38 -0
- package/scripts/verifiers/persistence.js +140 -0
- package/scripts/verifiers/plugin.js +215 -0
- package/scripts/verifiers/skills.js +209 -0
- package/scripts/verify-setup.js +164 -0
- package/skills/INDEX.md +157 -0
- package/skills/backend-patterns/SKILL.md +586 -0
- package/skills/backend-patterns/catalyst-patterns.md +128 -0
- package/skills/bigquery-patterns/SKILL.md +27 -0
- package/skills/bigquery-patterns/performance-optimization.md +518 -0
- package/skills/bigquery-patterns/query-patterns.md +372 -0
- package/skills/bigquery-patterns/schema-design.md +78 -0
- package/skills/cloudstream-project-template/SKILL.md +20 -0
- package/skills/cloudstream-project-template/structure.md +65 -0
- package/skills/coding-standards/SKILL.md +524 -0
- package/skills/coding-standards/deluge-standards.md +83 -0
- package/skills/compliance-patterns/SKILL.md +28 -0
- package/skills/compliance-patterns/hipaa/audit-requirements.md +251 -0
- package/skills/compliance-patterns/hipaa/baa-process.md +298 -0
- package/skills/compliance-patterns/hipaa/data-archival-strategy.md +387 -0
- package/skills/compliance-patterns/hipaa/phi-handling.md +52 -0
- package/skills/compliance-patterns/pci-dss/saq-a-requirements.md +307 -0
- package/skills/compliance-patterns/pci-dss/tokenization-patterns.md +382 -0
- package/skills/compliance-patterns/pci-dss/zoho-checkout-patterns.md +56 -0
- package/skills/compliance-patterns/soc2/access-controls.md +344 -0
- package/skills/compliance-patterns/soc2/audit-logging.md +458 -0
- package/skills/compliance-patterns/soc2/change-management.md +403 -0
- package/skills/compliance-patterns/soc2/deluge-execution-logging.md +407 -0
- package/skills/consultancy-workflows/SKILL.md +19 -0
- package/skills/consultancy-workflows/client-isolation.md +21 -0
- package/skills/consultancy-workflows/documentation-automation.md +454 -0
- package/skills/consultancy-workflows/handoff-procedures.md +257 -0
- package/skills/consultancy-workflows/knowledge-capture.md +513 -0
- package/skills/consultancy-workflows/time-tracking.md +26 -0
- package/skills/continuous-learning/SKILL.md +84 -0
- package/skills/continuous-learning/config.json +18 -0
- package/skills/continuous-learning/evaluate-session.sh +60 -0
- package/skills/continuous-learning-v2/SKILL.md +126 -0
- package/skills/continuous-learning-v2/config.json +61 -0
- package/skills/frontend-patterns/SKILL.md +635 -0
- package/skills/frontend-patterns/zoho-widget-patterns.md +103 -0
- package/skills/gcp-data-engineering/SKILL.md +36 -0
- package/skills/gcp-data-engineering/bigquery/performance-optimization.md +337 -0
- package/skills/gcp-data-engineering/dataflow/error-handling.md +496 -0
- package/skills/gcp-data-engineering/dataflow/pipeline-patterns.md +444 -0
- package/skills/gcp-data-engineering/dbt/model-organization.md +63 -0
- package/skills/gcp-data-engineering/dbt/testing-patterns.md +503 -0
- package/skills/gcp-data-engineering/medallion-architecture/bronze-layer.md +60 -0
- package/skills/gcp-data-engineering/medallion-architecture/gold-layer.md +311 -0
- package/skills/gcp-data-engineering/medallion-architecture/layer-transitions.md +517 -0
- package/skills/gcp-data-engineering/medallion-architecture/silver-layer.md +305 -0
- package/skills/gcp-data-engineering/zoho-to-gcp/data-extraction.md +543 -0
- package/skills/gcp-data-engineering/zoho-to-gcp/real-time-vs-batch.md +337 -0
- package/skills/security-review/SKILL.md +498 -0
- package/skills/security-review/compliance-checklist.md +53 -0
- package/skills/strategic-compact/SKILL.md +67 -0
- package/skills/tdd-workflow/SKILL.md +413 -0
- package/skills/tdd-workflow/zoho-testing.md +124 -0
- package/skills/tutorial/SKILL.md +249 -0
- package/skills/tutorial/docs/ACCESSIBILITY.md +169 -0
- package/skills/tutorial/lessons/00-philosophy-and-workflow.md +198 -0
- package/skills/tutorial/lessons/01-basics.md +81 -0
- package/skills/tutorial/lessons/02-training.md +86 -0
- package/skills/tutorial/lessons/03-commands.md +109 -0
- package/skills/tutorial/lessons/04-workflows.md +115 -0
- package/skills/tutorial/lessons/05-compliance.md +116 -0
- package/skills/tutorial/lessons/06-zoho.md +121 -0
- package/skills/tutorial/lessons/07-hooks-system.md +277 -0
- package/skills/tutorial/lessons/08-mcp-servers.md +316 -0
- package/skills/tutorial/lessons/09-client-management.md +215 -0
- package/skills/tutorial/lessons/10-testing-e2e.md +260 -0
- package/skills/tutorial/lessons/11-skills-deep-dive.md +272 -0
- package/skills/tutorial/lessons/12-rules-system.md +326 -0
- package/skills/tutorial/lessons/13-golden-standard-graduation.md +213 -0
- package/skills/tutorial/lessons/14-fork-setup-and-sync.md +312 -0
- package/skills/tutorial/lessons/15-living-examples-system.md +221 -0
- package/skills/tutorial/tracks/accelerated/README.md +134 -0
- package/skills/tutorial/tracks/accelerated/assessment/checkpoint-1.md +161 -0
- package/skills/tutorial/tracks/accelerated/assessment/checkpoint-2.md +175 -0
- package/skills/tutorial/tracks/accelerated/day-1-core-concepts.md +234 -0
- package/skills/tutorial/tracks/accelerated/day-2-essential-commands.md +270 -0
- package/skills/tutorial/tracks/accelerated/day-3-workflow-mastery.md +305 -0
- package/skills/tutorial/tracks/accelerated/day-4-compliance-zoho.md +304 -0
- package/skills/tutorial/tracks/accelerated/day-5-hooks-skills.md +344 -0
- package/skills/tutorial/tracks/accelerated/day-6-client-testing.md +386 -0
- package/skills/tutorial/tracks/accelerated/day-7-graduation.md +369 -0
- package/skills/zoho-patterns/CHANGELOG.md +108 -0
- package/skills/zoho-patterns/SKILL.md +446 -0
- package/skills/zoho-patterns/analytics/dashboard-patterns.md +352 -0
- package/skills/zoho-patterns/analytics/zoho-to-bigquery-pipeline.md +427 -0
- package/skills/zoho-patterns/catalyst/appsail-deployment.md +349 -0
- package/skills/zoho-patterns/catalyst/context-close-patterns.md +354 -0
- package/skills/zoho-patterns/catalyst/cron-batch-processing.md +374 -0
- package/skills/zoho-patterns/catalyst/function-patterns.md +439 -0
- package/skills/zoho-patterns/creator/form-design.md +304 -0
- package/skills/zoho-patterns/creator/publish-api-patterns.md +313 -0
- package/skills/zoho-patterns/creator/widget-integration.md +306 -0
- package/skills/zoho-patterns/creator/workflow-automation.md +253 -0
- package/skills/zoho-patterns/deluge/api-patterns.md +468 -0
- package/skills/zoho-patterns/deluge/batch-processing.md +403 -0
- package/skills/zoho-patterns/deluge/cross-app-integration.md +356 -0
- package/skills/zoho-patterns/deluge/error-handling.md +423 -0
- package/skills/zoho-patterns/deluge/syntax-reference.md +65 -0
- package/skills/zoho-patterns/integration/cors-proxy-architecture.md +426 -0
- package/skills/zoho-patterns/integration/crm-books-native-sync.md +277 -0
- package/skills/zoho-patterns/integration/oauth-token-management.md +461 -0
- package/skills/zoho-patterns/integration/zoho-flow-patterns.md +334 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Lesson 9: Client Management
|
|
2
|
+
|
|
3
|
+
CloudStream is a consultancy. Managing multiple clients requires isolation, context switching, and handoff documentation.
|
|
4
|
+
|
|
5
|
+
## Concept
|
|
6
|
+
|
|
7
|
+
Client management commands ensure you never mix contexts:
|
|
8
|
+
|
|
9
|
+
| Command | Purpose | What It Does |
|
|
10
|
+
|---------|---------|--------------|
|
|
11
|
+
| `/client-switch` | Switch client context | Loads client CLAUDE.md, sets compliance mode, shows recent activity |
|
|
12
|
+
| `/handoff` | Generate handoff docs | Creates comprehensive project documentation for transitions |
|
|
13
|
+
|
|
14
|
+
## Why This Matters
|
|
15
|
+
|
|
16
|
+
Without client isolation:
|
|
17
|
+
- Credentials get mixed up
|
|
18
|
+
- Wrong compliance mode applied
|
|
19
|
+
- Context leaks between projects
|
|
20
|
+
- Handoffs are incomplete
|
|
21
|
+
|
|
22
|
+
With proper management:
|
|
23
|
+
- Clean context boundaries
|
|
24
|
+
- Compliance automatically set
|
|
25
|
+
- Seamless project transitions
|
|
26
|
+
- Professional handoff documentation
|
|
27
|
+
|
|
28
|
+
## Client Context Structure
|
|
29
|
+
|
|
30
|
+
Each client should have:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
clients/
|
|
34
|
+
acme-corp/
|
|
35
|
+
CLAUDE.md # Client-specific config
|
|
36
|
+
.env.local # Client credentials
|
|
37
|
+
activity-log.md # Recent work (auto-generated)
|
|
38
|
+
beta-inc/
|
|
39
|
+
CLAUDE.md
|
|
40
|
+
.env.local
|
|
41
|
+
activity-log.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Client CLAUDE.md Example
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
# ACME Corp Project
|
|
48
|
+
|
|
49
|
+
## Company Context
|
|
50
|
+
Enterprise SaaS company, 500 employees
|
|
51
|
+
Primary contact: jane@acme.com
|
|
52
|
+
|
|
53
|
+
## Technology Stack
|
|
54
|
+
- Zoho Creator (CRM customizations)
|
|
55
|
+
- Zoho Catalyst (serverless functions)
|
|
56
|
+
- GCP BigQuery (analytics)
|
|
57
|
+
|
|
58
|
+
## Compliance Mode: soc2
|
|
59
|
+
SOC2 audit scheduled for Q2
|
|
60
|
+
|
|
61
|
+
## Billing
|
|
62
|
+
Rate: $150/hr
|
|
63
|
+
Time tracking: Required
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Exercise
|
|
67
|
+
|
|
68
|
+
### Exercise 9.1: Client Switching
|
|
69
|
+
|
|
70
|
+
**Step 1**: List available clients:
|
|
71
|
+
```
|
|
72
|
+
/client-switch
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**What happens:**
|
|
76
|
+
- Scans `clients/` directory
|
|
77
|
+
- Shows available client contexts
|
|
78
|
+
- Displays current client (if set)
|
|
79
|
+
|
|
80
|
+
**Step 2**: Switch to a client:
|
|
81
|
+
```
|
|
82
|
+
/client-switch acme-corp
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**What happens:**
|
|
86
|
+
1. Loads `clients/acme-corp/CLAUDE.md`
|
|
87
|
+
2. Sets compliance mode from config
|
|
88
|
+
3. Loads environment variables from `.env.local`
|
|
89
|
+
4. Displays recent activity summary
|
|
90
|
+
5. Updates session context
|
|
91
|
+
|
|
92
|
+
### Exercise 9.2: Handoff Documentation
|
|
93
|
+
|
|
94
|
+
Generate comprehensive handoff documentation:
|
|
95
|
+
```
|
|
96
|
+
/handoff
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**What the `doc-updater` agent generates:**
|
|
100
|
+
|
|
101
|
+
1. **Project Summary**
|
|
102
|
+
- Current state
|
|
103
|
+
- Key stakeholders
|
|
104
|
+
- Project timeline
|
|
105
|
+
|
|
106
|
+
2. **Architecture Overview**
|
|
107
|
+
- System components
|
|
108
|
+
- Integration points
|
|
109
|
+
- Data flows
|
|
110
|
+
|
|
111
|
+
3. **Setup Instructions**
|
|
112
|
+
- Environment requirements
|
|
113
|
+
- Installation steps
|
|
114
|
+
- Configuration needed
|
|
115
|
+
|
|
116
|
+
4. **Outstanding Tasks**
|
|
117
|
+
- In-progress work
|
|
118
|
+
- Known issues
|
|
119
|
+
- Backlog items
|
|
120
|
+
|
|
121
|
+
5. **Runbook**
|
|
122
|
+
- Common operations
|
|
123
|
+
- Troubleshooting guides
|
|
124
|
+
- Contact information
|
|
125
|
+
|
|
126
|
+
### Exercise 9.3: Creating a New Client
|
|
127
|
+
|
|
128
|
+
**Step 1**: Create client directory:
|
|
129
|
+
```bash
|
|
130
|
+
mkdir -p clients/new-client
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Step 2**: Create client CLAUDE.md:
|
|
134
|
+
```bash
|
|
135
|
+
cat > clients/new-client/CLAUDE.md << 'EOF'
|
|
136
|
+
# New Client Project
|
|
137
|
+
|
|
138
|
+
## Company Context
|
|
139
|
+
[Description]
|
|
140
|
+
|
|
141
|
+
## Technology Stack
|
|
142
|
+
[Stack details]
|
|
143
|
+
|
|
144
|
+
## Compliance Mode: hipaa
|
|
145
|
+
[If applicable]
|
|
146
|
+
|
|
147
|
+
## Billing
|
|
148
|
+
Rate: $XXX/hr
|
|
149
|
+
EOF
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Step 3**: Switch to the new client:
|
|
153
|
+
```
|
|
154
|
+
/client-switch new-client
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Verification
|
|
158
|
+
|
|
159
|
+
You've completed this exercise successfully if:
|
|
160
|
+
- [ ] `/client-switch` showed available clients or prompted to create
|
|
161
|
+
- [ ] You understand client directory structure
|
|
162
|
+
- [ ] `/handoff` generated documentation (or you understand the sections)
|
|
163
|
+
- [ ] You can create a new client context
|
|
164
|
+
|
|
165
|
+
## Multi-Client Workflow
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
MORNING: Check which client you're working on
|
|
169
|
+
/client-switch # Show current context
|
|
170
|
+
|
|
171
|
+
STARTING WORK ON CLIENT:
|
|
172
|
+
/client-switch acme-corp # Switch context
|
|
173
|
+
# Compliance mode auto-set
|
|
174
|
+
# Credentials loaded
|
|
175
|
+
# Recent activity shown
|
|
176
|
+
|
|
177
|
+
DURING WORK:
|
|
178
|
+
/plan <feature> # Plan with client context
|
|
179
|
+
/tdd <component> # Tests include compliance
|
|
180
|
+
/code-review # Review against client standards
|
|
181
|
+
|
|
182
|
+
END OF ENGAGEMENT:
|
|
183
|
+
/handoff # Generate transition docs
|
|
184
|
+
# Everything documented
|
|
185
|
+
# Clean handoff ready
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Agent Reference
|
|
189
|
+
|
|
190
|
+
| Agent | Command | What It Does |
|
|
191
|
+
|-------|---------|--------------|
|
|
192
|
+
| **doc-updater** | `/handoff` | Generates comprehensive project documentation |
|
|
193
|
+
|
|
194
|
+
## Security Best Practices
|
|
195
|
+
|
|
196
|
+
1. **Never commit `.env.local`** - Client credentials stay local
|
|
197
|
+
2. **Separate credentials per client** - No shared tokens
|
|
198
|
+
3. **Review before switching** - Ensure previous work is committed
|
|
199
|
+
4. **Verify compliance mode** - Check it matches client requirements
|
|
200
|
+
5. **Clean handoffs** - Document everything before transition
|
|
201
|
+
|
|
202
|
+
## Key Takeaway
|
|
203
|
+
|
|
204
|
+
Client management is about **isolation and professionalism**. Use `/client-switch` to set context, `/handoff` to document transitions. Never mix client contexts.
|
|
205
|
+
|
|
206
|
+
## Next Steps
|
|
207
|
+
|
|
208
|
+
In Lesson 10, you'll learn about testing and quality commands - E2E testing, build error resolution, and coverage analysis.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
**Commands learned**: `/client-switch`, `/handoff`
|
|
213
|
+
**Agent introduced**: doc-updater
|
|
214
|
+
**Key concept**: Client isolation and professional handoffs
|
|
215
|
+
**Progress**: 10 of 15 lessons complete
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# Lesson 10: Testing & E2E
|
|
2
|
+
|
|
3
|
+
Beyond unit tests, you need end-to-end testing, build error resolution, and coverage analysis to ensure quality.
|
|
4
|
+
|
|
5
|
+
## Concept
|
|
6
|
+
|
|
7
|
+
Quality assurance requires multiple layers:
|
|
8
|
+
|
|
9
|
+
| Command | Purpose | Agent |
|
|
10
|
+
|---------|---------|-------|
|
|
11
|
+
| `/e2e` | End-to-end tests | e2e-runner |
|
|
12
|
+
| `/build-fix` | Fix build errors | build-error-resolver |
|
|
13
|
+
| `/test-coverage` | Analyze coverage | tdd-guide |
|
|
14
|
+
| `/eval` | Track quality metrics | (self-contained) |
|
|
15
|
+
|
|
16
|
+
## Why This Matters
|
|
17
|
+
|
|
18
|
+
**Unit tests** verify individual functions. **E2E tests** verify user journeys.
|
|
19
|
+
|
|
20
|
+
Without E2E:
|
|
21
|
+
- Integration bugs slip through
|
|
22
|
+
- User flows break silently
|
|
23
|
+
- Regressions go unnoticed
|
|
24
|
+
|
|
25
|
+
Without build error resolution:
|
|
26
|
+
- TypeScript errors pile up
|
|
27
|
+
- Broken builds block deployments
|
|
28
|
+
- Manual fixes are inconsistent
|
|
29
|
+
|
|
30
|
+
## Exercise
|
|
31
|
+
|
|
32
|
+
### Exercise 10.1: End-to-End Testing
|
|
33
|
+
|
|
34
|
+
Generate and run E2E tests for a user journey:
|
|
35
|
+
```
|
|
36
|
+
/e2e "user login flow"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**What the `e2e-runner` agent does:**
|
|
40
|
+
|
|
41
|
+
1. **Creates Playwright test file**
|
|
42
|
+
```typescript
|
|
43
|
+
// tests/e2e/login.spec.ts
|
|
44
|
+
import { test, expect } from '@playwright/test';
|
|
45
|
+
|
|
46
|
+
test('user can log in successfully', async ({ page }) => {
|
|
47
|
+
await page.goto('/login');
|
|
48
|
+
await page.fill('[name="email"]', 'test@example.com');
|
|
49
|
+
await page.fill('[name="password"]', 'password123');
|
|
50
|
+
await page.click('button[type="submit"]');
|
|
51
|
+
await expect(page).toHaveURL('/dashboard');
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. **Defines user journey steps**
|
|
56
|
+
- Navigate to page
|
|
57
|
+
- Fill form fields
|
|
58
|
+
- Submit action
|
|
59
|
+
- Verify result
|
|
60
|
+
|
|
61
|
+
3. **Runs the tests**
|
|
62
|
+
```bash
|
|
63
|
+
npx playwright test tests/e2e/login.spec.ts
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
4. **Captures artifacts on failure**
|
|
67
|
+
- Screenshots
|
|
68
|
+
- Videos
|
|
69
|
+
- Trace files
|
|
70
|
+
|
|
71
|
+
5. **Reports results**
|
|
72
|
+
```
|
|
73
|
+
E2E Test Results:
|
|
74
|
+
✓ user can log in successfully (2.3s)
|
|
75
|
+
✓ user sees error on invalid credentials (1.8s)
|
|
76
|
+
✓ user can reset password (3.1s)
|
|
77
|
+
|
|
78
|
+
3 passed (7.2s)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Exercise 10.2: Build Error Resolution
|
|
82
|
+
|
|
83
|
+
When your build fails, fix errors systematically:
|
|
84
|
+
```
|
|
85
|
+
/build-fix
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**What the `build-error-resolver` agent does:**
|
|
89
|
+
|
|
90
|
+
1. **Runs build command**
|
|
91
|
+
```bash
|
|
92
|
+
npm run build
|
|
93
|
+
# or
|
|
94
|
+
npx tsc --noEmit
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
2. **Parses error output**
|
|
98
|
+
```
|
|
99
|
+
src/api/auth.ts:45:3 - error TS2322: Type 'string' is not assignable to type 'number'.
|
|
100
|
+
src/utils/format.ts:12:5 - error TS2345: Argument of type 'undefined' is not assignable...
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Fixes each error with minimal changes**
|
|
104
|
+
- One error at a time
|
|
105
|
+
- Smallest possible diff
|
|
106
|
+
- No unrelated refactoring
|
|
107
|
+
|
|
108
|
+
4. **Re-runs build to verify**
|
|
109
|
+
- Confirms fix worked
|
|
110
|
+
- Checks for new errors
|
|
111
|
+
|
|
112
|
+
5. **Repeats until build passes**
|
|
113
|
+
```
|
|
114
|
+
Build Error Resolution:
|
|
115
|
+
✓ Fixed: src/api/auth.ts:45 - type mismatch
|
|
116
|
+
✓ Fixed: src/utils/format.ts:12 - undefined argument
|
|
117
|
+
✓ Build passes
|
|
118
|
+
|
|
119
|
+
2 errors fixed in 3 iterations
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Exercise 10.3: Test Coverage Analysis
|
|
123
|
+
|
|
124
|
+
Analyze test coverage for the project:
|
|
125
|
+
```
|
|
126
|
+
/test-coverage
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**What the `tdd-guide` agent does:**
|
|
130
|
+
|
|
131
|
+
1. **Runs coverage command**
|
|
132
|
+
```bash
|
|
133
|
+
npm test -- --coverage
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
2. **Parses coverage report**
|
|
137
|
+
```
|
|
138
|
+
Coverage Summary:
|
|
139
|
+
Statements: 78.5%
|
|
140
|
+
Branches: 65.2%
|
|
141
|
+
Functions: 82.1%
|
|
142
|
+
Lines: 79.3%
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
3. **Identifies files below 80% threshold**
|
|
146
|
+
```
|
|
147
|
+
Critical Gaps (below 80%):
|
|
148
|
+
1. src/api/auth.ts - 45% (needs: login, logout, refresh tests)
|
|
149
|
+
2. src/utils/validate.ts - 62% (needs: edge case tests)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
4. **Suggests tests for uncovered paths**
|
|
153
|
+
- Prioritizes by risk (critical paths first)
|
|
154
|
+
- Provides specific test suggestions
|
|
155
|
+
- Estimates effort to reach 80%
|
|
156
|
+
|
|
157
|
+
### Exercise 10.4: Evaluation System
|
|
158
|
+
|
|
159
|
+
Create and run evaluations to track quality over time:
|
|
160
|
+
```
|
|
161
|
+
/eval
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Creating an eval case:**
|
|
165
|
+
```
|
|
166
|
+
/eval create "API response times"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Running evals:**
|
|
170
|
+
```
|
|
171
|
+
/eval run
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**What the eval system tracks:**
|
|
175
|
+
- Test pass rate
|
|
176
|
+
- Coverage percentage
|
|
177
|
+
- Lint error count
|
|
178
|
+
- Build time
|
|
179
|
+
- Bundle size
|
|
180
|
+
|
|
181
|
+
**Expected output:**
|
|
182
|
+
```
|
|
183
|
+
Evaluation Results:
|
|
184
|
+
Test Pass Rate: 98.5% (↑ 0.5%)
|
|
185
|
+
Coverage: 82.3% (↑ 2.1%)
|
|
186
|
+
Lint Errors: 0 (same)
|
|
187
|
+
Build Time: 12.3s (↓ 0.8s)
|
|
188
|
+
|
|
189
|
+
Trend: IMPROVING
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Verification
|
|
193
|
+
|
|
194
|
+
You've completed this exercise successfully if:
|
|
195
|
+
- [ ] `/e2e` created a Playwright test (or you understand the pattern)
|
|
196
|
+
- [ ] `/build-fix` demonstrated error resolution workflow
|
|
197
|
+
- [ ] `/test-coverage` showed coverage percentages
|
|
198
|
+
- [ ] You understand the 80% coverage target
|
|
199
|
+
- [ ] `/eval` concepts make sense (tracking metrics over time)
|
|
200
|
+
|
|
201
|
+
## The Quality Workflow
|
|
202
|
+
|
|
203
|
+
Integrate all quality commands:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
DEVELOPMENT:
|
|
207
|
+
/tdd <component> # Tests first (target 80%+)
|
|
208
|
+
|
|
209
|
+
BEFORE COMMIT:
|
|
210
|
+
/test-coverage # Verify coverage achieved
|
|
211
|
+
/build-fix # Fix any build errors
|
|
212
|
+
/code-review # Quality review
|
|
213
|
+
|
|
214
|
+
BEFORE DEPLOY:
|
|
215
|
+
/e2e "critical flows" # Verify user journeys
|
|
216
|
+
/eval run # Check quality metrics
|
|
217
|
+
/verify # Final validation
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Agent Reference
|
|
221
|
+
|
|
222
|
+
| Agent | Command | Specialty |
|
|
223
|
+
|-------|---------|-----------|
|
|
224
|
+
| **e2e-runner** | `/e2e` | Playwright tests, user journeys, artifact capture |
|
|
225
|
+
| **build-error-resolver** | `/build-fix` | TypeScript/build error fixing with minimal diffs |
|
|
226
|
+
| **tdd-guide** | `/test-coverage`, `/tdd` | Coverage analysis, test-driven development |
|
|
227
|
+
| **code-reviewer** | `/code-review` | Quality review, code standards |
|
|
228
|
+
| **security-reviewer** | (proactive) | Security-specific quality checks |
|
|
229
|
+
|
|
230
|
+
## E2E Best Practices
|
|
231
|
+
|
|
232
|
+
1. **Test critical paths first** - Login, checkout, core features
|
|
233
|
+
2. **Use stable selectors** - `data-testid` over CSS classes
|
|
234
|
+
3. **Handle async** - Wait for elements, not arbitrary timeouts
|
|
235
|
+
4. **Isolate tests** - Each test should run independently
|
|
236
|
+
5. **Capture artifacts** - Screenshots/videos for debugging
|
|
237
|
+
|
|
238
|
+
## Coverage Guidelines
|
|
239
|
+
|
|
240
|
+
| Coverage Level | Quality |
|
|
241
|
+
|----------------|---------|
|
|
242
|
+
| < 60% | Critical gap - immediate action needed |
|
|
243
|
+
| 60-79% | Below target - prioritize coverage work |
|
|
244
|
+
| 80-89% | Target achieved - maintain coverage |
|
|
245
|
+
| 90%+ | Excellent - don't sacrifice quality for numbers |
|
|
246
|
+
|
|
247
|
+
## Key Takeaway
|
|
248
|
+
|
|
249
|
+
Quality is multi-layered: unit tests, E2E tests, coverage, and metrics. Use `/e2e` for user journeys, `/build-fix` for errors, `/test-coverage` for gaps, and `/eval` for trends.
|
|
250
|
+
|
|
251
|
+
## Next Steps
|
|
252
|
+
|
|
253
|
+
In Lesson 11, you'll dive deep into the Skills system - all 16 skills and their relationships to agents.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
**Commands learned**: `/e2e`, `/build-fix`, `/test-coverage`, `/eval`
|
|
258
|
+
**Agents introduced**: e2e-runner, build-error-resolver, tdd-guide (coverage role)
|
|
259
|
+
**Key concept**: Multi-layer quality assurance
|
|
260
|
+
**Progress**: 11 of 15 lessons complete
|