@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,305 @@
|
|
|
1
|
+
# Day 3: Workflow Mastery
|
|
2
|
+
|
|
3
|
+
**Duration**: 2-3 hours
|
|
4
|
+
**Covers**: Standard Lesson 4 (Workflow Patterns) + Hands-on Practice
|
|
5
|
+
**Assessment**: Checkpoint 1 after this day
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Part 1: Workflow Patterns by Task Type
|
|
10
|
+
|
|
11
|
+
Different tasks require different workflows. Master these patterns:
|
|
12
|
+
|
|
13
|
+
### New Feature Workflow
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/plan "feature description"
|
|
17
|
+
↓
|
|
18
|
+
/tdd "component/function"
|
|
19
|
+
↓
|
|
20
|
+
/code-review
|
|
21
|
+
↓
|
|
22
|
+
/verify
|
|
23
|
+
↓
|
|
24
|
+
git commit
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**When**: Adding new functionality
|
|
28
|
+
**Key point**: Always plan first to prevent scope creep
|
|
29
|
+
|
|
30
|
+
### Bug Fix Workflow
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
/tdd "reproduce bug" # Write failing test
|
|
34
|
+
↓
|
|
35
|
+
Fix the bug # Make test pass
|
|
36
|
+
↓
|
|
37
|
+
/verify # Ensure no regression
|
|
38
|
+
↓
|
|
39
|
+
git commit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**When**: Fixing reported issues
|
|
43
|
+
**Key point**: Reproduce with test BEFORE fixing
|
|
44
|
+
|
|
45
|
+
### Refactoring Workflow
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
/checkpoint "before-refactor"
|
|
49
|
+
↓
|
|
50
|
+
/verify # Baseline passing
|
|
51
|
+
↓
|
|
52
|
+
Refactor incrementally
|
|
53
|
+
↓
|
|
54
|
+
/verify # Still passing
|
|
55
|
+
↓
|
|
56
|
+
/code-review
|
|
57
|
+
↓
|
|
58
|
+
git commit
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**When**: Improving code structure
|
|
62
|
+
**Key point**: Checkpoint first, verify often
|
|
63
|
+
|
|
64
|
+
### Security-Sensitive Workflow
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
/plan "security feature"
|
|
68
|
+
↓
|
|
69
|
+
/tdd "security component"
|
|
70
|
+
↓
|
|
71
|
+
/code-review --security
|
|
72
|
+
↓
|
|
73
|
+
/verify
|
|
74
|
+
↓
|
|
75
|
+
Manual security review
|
|
76
|
+
↓
|
|
77
|
+
git commit
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**When**: Auth, payments, data encryption
|
|
81
|
+
**Key point**: Always use `--security` flag
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Part 2: The Complete Development Cycle
|
|
86
|
+
|
|
87
|
+
For substantial features, use the full orchestration:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
/orchestrate "implement user dashboard"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This chains agents in optimal order:
|
|
94
|
+
1. **Planner** → Designs architecture
|
|
95
|
+
2. **Architect** → Validates patterns
|
|
96
|
+
3. **TDD Guide** → Enforces test-first
|
|
97
|
+
4. **Code Reviewer** → Catches issues
|
|
98
|
+
|
|
99
|
+
### When to Use /orchestrate vs Manual
|
|
100
|
+
|
|
101
|
+
| Use /orchestrate | Use Manual Commands |
|
|
102
|
+
|------------------|---------------------|
|
|
103
|
+
| Multi-file features | Single file changes |
|
|
104
|
+
| New subsystems | Bug fixes |
|
|
105
|
+
| Complex refactors | Quick enhancements |
|
|
106
|
+
| Architectural changes | Routine updates |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Part 3: Verification Patterns
|
|
111
|
+
|
|
112
|
+
### Pre-Commit Verification
|
|
113
|
+
|
|
114
|
+
Always run before committing:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
/verify
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
If issues found, fix and re-verify until clean.
|
|
121
|
+
|
|
122
|
+
### Build-Fix Loop
|
|
123
|
+
|
|
124
|
+
When builds fail:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
/build-fix
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This:
|
|
131
|
+
1. Parses build errors
|
|
132
|
+
2. Fixes incrementally
|
|
133
|
+
3. Re-runs build
|
|
134
|
+
4. Repeats until clean
|
|
135
|
+
|
|
136
|
+
### Continuous Verification
|
|
137
|
+
|
|
138
|
+
During long sessions:
|
|
139
|
+
```
|
|
140
|
+
/verify # After each logical chunk
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Don't wait until the end - catch issues early.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Part 4: Hands-On Practice
|
|
148
|
+
|
|
149
|
+
### Exercise 3.1: Complete Feature Workflow
|
|
150
|
+
|
|
151
|
+
Implement a simple feature from scratch:
|
|
152
|
+
|
|
153
|
+
**Task**: Add a utility function with tests
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
/checkpoint "exercise-start"
|
|
157
|
+
|
|
158
|
+
/plan "add string utility: capitalize first letter of each word"
|
|
159
|
+
|
|
160
|
+
/tdd "capitalizeWords function"
|
|
161
|
+
|
|
162
|
+
/code-review
|
|
163
|
+
|
|
164
|
+
/verify
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Observe:
|
|
168
|
+
- How plan informs implementation
|
|
169
|
+
- TDD creates tests first
|
|
170
|
+
- Code review catches issues
|
|
171
|
+
- Verify ensures everything passes
|
|
172
|
+
|
|
173
|
+
### Exercise 3.2: Bug Fix Workflow
|
|
174
|
+
|
|
175
|
+
Simulate fixing a bug:
|
|
176
|
+
|
|
177
|
+
**Setup**: Create a buggy function
|
|
178
|
+
```javascript
|
|
179
|
+
// buggy.js
|
|
180
|
+
function divide(a, b) {
|
|
181
|
+
return a / b; // Bug: doesn't handle division by zero
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Fix using TDD**:
|
|
186
|
+
```
|
|
187
|
+
/tdd "reproduce division by zero bug"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
1. Write test that exposes the bug
|
|
191
|
+
2. Fix the function
|
|
192
|
+
3. Verify test passes
|
|
193
|
+
|
|
194
|
+
### Exercise 3.3: Refactoring Workflow
|
|
195
|
+
|
|
196
|
+
Practice safe refactoring:
|
|
197
|
+
|
|
198
|
+
**Setup**: Create code that works but is messy
|
|
199
|
+
```javascript
|
|
200
|
+
function processData(d) {
|
|
201
|
+
if (d && d.items && d.items.length > 0) {
|
|
202
|
+
return d.items.map(i => i.value * 2);
|
|
203
|
+
}
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Refactor safely**:
|
|
209
|
+
```
|
|
210
|
+
/checkpoint "before-refactor"
|
|
211
|
+
/verify # Baseline
|
|
212
|
+
|
|
213
|
+
# Refactor the function for clarity
|
|
214
|
+
# ...
|
|
215
|
+
|
|
216
|
+
/verify # Confirm still passing
|
|
217
|
+
/code-review
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Exercise 3.4: Security-Sensitive Workflow
|
|
221
|
+
|
|
222
|
+
Practice security-focused development:
|
|
223
|
+
|
|
224
|
+
**Task**: Add password validation
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
/plan "add password strength validation"
|
|
228
|
+
|
|
229
|
+
/tdd "password validator"
|
|
230
|
+
|
|
231
|
+
/code-review --security
|
|
232
|
+
|
|
233
|
+
/verify
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Note the additional security checks in the review.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Verification Checklist
|
|
241
|
+
|
|
242
|
+
Before taking Checkpoint 1, confirm:
|
|
243
|
+
|
|
244
|
+
- [ ] Can execute New Feature workflow
|
|
245
|
+
- [ ] Can execute Bug Fix workflow
|
|
246
|
+
- [ ] Can execute Refactoring workflow
|
|
247
|
+
- [ ] Understand when to use `/orchestrate`
|
|
248
|
+
- [ ] Practiced verification patterns
|
|
249
|
+
- [ ] Completed all 4 exercises
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Checkpoint 1 Assessment
|
|
254
|
+
|
|
255
|
+
After completing Day 3, you must pass Checkpoint 1 before proceeding.
|
|
256
|
+
|
|
257
|
+
Run:
|
|
258
|
+
```
|
|
259
|
+
/tutorial checkpoint-1
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Topics covered:
|
|
263
|
+
- Core concepts and philosophy
|
|
264
|
+
- Essential commands
|
|
265
|
+
- Workflow patterns
|
|
266
|
+
|
|
267
|
+
Passing score: 80%
|
|
268
|
+
Max retakes: 2
|
|
269
|
+
|
|
270
|
+
See: [Checkpoint 1 Assessment](assessment/checkpoint-1.md)
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Key Takeaways
|
|
275
|
+
|
|
276
|
+
1. **Different tasks need different workflows** - don't use one pattern for everything
|
|
277
|
+
2. **Bug fixes start with a failing test** - prove the bug exists before fixing
|
|
278
|
+
3. **Refactors need checkpoints** - always have a rollback option
|
|
279
|
+
4. **Security code gets extra scrutiny** - use `--security` flag
|
|
280
|
+
5. **Verify often, not just at the end** - catch issues early
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Quick Reference
|
|
285
|
+
|
|
286
|
+
### Workflow Summary
|
|
287
|
+
|
|
288
|
+
| Task | Workflow |
|
|
289
|
+
|------|----------|
|
|
290
|
+
| New Feature | plan → tdd → code-review → verify |
|
|
291
|
+
| Bug Fix | tdd (reproduce) → fix → verify |
|
|
292
|
+
| Refactor | checkpoint → verify → refactor → verify → code-review |
|
|
293
|
+
| Security | plan → tdd → code-review --security → verify |
|
|
294
|
+
|
|
295
|
+
### Key Commands
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
/orchestrate "task" - Full agent chain
|
|
299
|
+
/build-fix - Iterative build repair
|
|
300
|
+
/verify - Complete validation
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
**Day 3 Complete** | **CHECKPOINT 1 REQUIRED** | Next: [Day 4 - Compliance & Zoho](day-4-compliance-zoho.md)
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# Day 4: Compliance & Zoho Development
|
|
2
|
+
|
|
3
|
+
**Duration**: 3-4 hours
|
|
4
|
+
**Covers**: Standard Lessons 5-6 (Compliance Modes, Zoho Platform)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Part 1: Compliance Modes
|
|
9
|
+
|
|
10
|
+
CloudStream serves regulated industries. Compliance modes ensure code meets legal requirements.
|
|
11
|
+
|
|
12
|
+
### The Three Frameworks
|
|
13
|
+
|
|
14
|
+
| Mode | Industry | Key Requirements |
|
|
15
|
+
|------|----------|------------------|
|
|
16
|
+
| HIPAA | Healthcare | PHI protection, encryption, audit logs |
|
|
17
|
+
| SOC2 | SaaS/Cloud | Data security, availability, processing integrity |
|
|
18
|
+
| PCI-DSS | Payments | Cardholder data protection, access control |
|
|
19
|
+
|
|
20
|
+
### Violation Consequences
|
|
21
|
+
|
|
22
|
+
| Framework | Penalty |
|
|
23
|
+
|-----------|---------|
|
|
24
|
+
| HIPAA | Up to $1.5M per incident |
|
|
25
|
+
| SOC2 | Failed audits, lost enterprise customers |
|
|
26
|
+
| PCI-DSS | Inability to process payments |
|
|
27
|
+
|
|
28
|
+
The system catches violations during development, not after deployment.
|
|
29
|
+
|
|
30
|
+
### Enabling Compliance Mode
|
|
31
|
+
|
|
32
|
+
Add to your project's CLAUDE.md:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
## Compliance Mode: hipaa
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or multiple modes:
|
|
39
|
+
```markdown
|
|
40
|
+
## Compliance Mode: hipaa, soc2
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### What Changes with Compliance Mode
|
|
44
|
+
|
|
45
|
+
When compliance mode is active:
|
|
46
|
+
|
|
47
|
+
1. **`/code-review`** checks for compliance violations
|
|
48
|
+
2. **`/compliance-check`** runs a full audit
|
|
49
|
+
3. **Agents** add compliance-specific validations
|
|
50
|
+
4. **Generated code** includes required safeguards
|
|
51
|
+
|
|
52
|
+
### Compliance Check Details
|
|
53
|
+
|
|
54
|
+
#### HIPAA Mode
|
|
55
|
+
```markdown
|
|
56
|
+
## Compliance Mode: hipaa
|
|
57
|
+
```
|
|
58
|
+
Checks for:
|
|
59
|
+
- PHI in logs/errors
|
|
60
|
+
- Encryption at rest/transit
|
|
61
|
+
- Audit trail for data access
|
|
62
|
+
- Minimum necessary access
|
|
63
|
+
|
|
64
|
+
#### SOC2 Mode
|
|
65
|
+
```markdown
|
|
66
|
+
## Compliance Mode: soc2
|
|
67
|
+
```
|
|
68
|
+
Checks for:
|
|
69
|
+
- Data retention policies
|
|
70
|
+
- Change management logging
|
|
71
|
+
- Incident response procedures
|
|
72
|
+
- Vendor management
|
|
73
|
+
|
|
74
|
+
#### PCI-DSS Mode
|
|
75
|
+
```markdown
|
|
76
|
+
## Compliance Mode: pci-dss
|
|
77
|
+
```
|
|
78
|
+
Checks for:
|
|
79
|
+
- Card data exposure
|
|
80
|
+
- Encryption standards
|
|
81
|
+
- Access logging
|
|
82
|
+
- Network segmentation
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Part 2: Zoho Development
|
|
87
|
+
|
|
88
|
+
Zoho is CloudStream's primary platform. Understanding its constraints is essential.
|
|
89
|
+
|
|
90
|
+
### Platform Constraints
|
|
91
|
+
|
|
92
|
+
| Platform | Constraint | Limit |
|
|
93
|
+
|----------|------------|-------|
|
|
94
|
+
| Deluge | Statements per function | 5,000 |
|
|
95
|
+
| Catalyst | Function timeout | 40 seconds |
|
|
96
|
+
| Catalyst | I/O timeout | 30 seconds |
|
|
97
|
+
| Catalyst | Memory per function | 512 MB |
|
|
98
|
+
| Creator | Subforms per form | 10 |
|
|
99
|
+
| Deluge | API calls per day | 25,000 |
|
|
100
|
+
| OAuth | Token expiry | 1 hour |
|
|
101
|
+
| Creator | Audit retention | 1 year |
|
|
102
|
+
|
|
103
|
+
### Specialized Agents
|
|
104
|
+
|
|
105
|
+
| Agent | Purpose |
|
|
106
|
+
|-------|---------|
|
|
107
|
+
| `creator-architect` | Creator app design and form hierarchy |
|
|
108
|
+
| `catalyst-deployer` | Catalyst function deployment |
|
|
109
|
+
| `deluge-reviewer` | Deluge script validation |
|
|
110
|
+
|
|
111
|
+
### Key Commands
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
/zoho-scaffold creator-app "app-name" - Scaffold Creator app
|
|
115
|
+
/zoho-scaffold catalyst-function "func" - Scaffold Catalyst function
|
|
116
|
+
/deluge "task description" - Generate Deluge code
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Part 3: Zoho Development Patterns
|
|
122
|
+
|
|
123
|
+
### Creator App Scaffolding
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
/zoho-scaffold creator-app "inventory-tracker"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Generates:
|
|
130
|
+
- Form hierarchy design
|
|
131
|
+
- Workflow templates
|
|
132
|
+
- Widget placeholders
|
|
133
|
+
- Connection setup
|
|
134
|
+
- Compliance fields (if mode active)
|
|
135
|
+
|
|
136
|
+
### Catalyst Function Scaffolding
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
/zoho-scaffold catalyst-function "webhook-processor"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Generates:
|
|
143
|
+
- Function entry point with proper signature
|
|
144
|
+
- Error handling with try-catch
|
|
145
|
+
- Timeout management (context.close())
|
|
146
|
+
- Environment configuration
|
|
147
|
+
- Logging setup
|
|
148
|
+
|
|
149
|
+
### Deluge Code Generation
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
/deluge "fetch contacts from CRM and update Creator form"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Generates code with:
|
|
156
|
+
- Null checks on every variable
|
|
157
|
+
- Try-catch error handling
|
|
158
|
+
- Statement count awareness
|
|
159
|
+
- API call batching
|
|
160
|
+
- Proper indentation and comments
|
|
161
|
+
|
|
162
|
+
### Critical Patterns
|
|
163
|
+
|
|
164
|
+
#### context.close() Requirement
|
|
165
|
+
```javascript
|
|
166
|
+
// Catalyst functions MUST call context.close()
|
|
167
|
+
try {
|
|
168
|
+
// ... function logic
|
|
169
|
+
context.close();
|
|
170
|
+
} catch (err) {
|
|
171
|
+
context.close(); // Even on error!
|
|
172
|
+
throw err;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### Null-Safe Deluge
|
|
177
|
+
```deluge
|
|
178
|
+
// NEVER: record.get("field") -- will crash if null
|
|
179
|
+
// ALWAYS: ifnull(record.get("field"), "")
|
|
180
|
+
value = ifnull(record.get("field"), "default");
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Exercises
|
|
186
|
+
|
|
187
|
+
### Exercise 4.1: Enable Compliance Mode
|
|
188
|
+
|
|
189
|
+
1. Create or edit a project's CLAUDE.md
|
|
190
|
+
2. Add HIPAA compliance mode:
|
|
191
|
+
```markdown
|
|
192
|
+
## Compliance Mode: hipaa
|
|
193
|
+
```
|
|
194
|
+
3. Run a compliance check:
|
|
195
|
+
```
|
|
196
|
+
/compliance-check
|
|
197
|
+
```
|
|
198
|
+
4. Observe the audit output
|
|
199
|
+
|
|
200
|
+
### Exercise 4.2: Review with Compliance
|
|
201
|
+
|
|
202
|
+
1. Create a simple file:
|
|
203
|
+
```javascript
|
|
204
|
+
function logUserData(user) {
|
|
205
|
+
console.log(user.email, user.ssn); // BAD: logs PHI
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
2. Run code review:
|
|
209
|
+
```
|
|
210
|
+
/code-review
|
|
211
|
+
```
|
|
212
|
+
3. Note the compliance violations flagged
|
|
213
|
+
|
|
214
|
+
### Exercise 4.3: Scaffold Catalyst Function
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
/zoho-scaffold catalyst-function "data-sync"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Observe:
|
|
221
|
+
- Generated file structure
|
|
222
|
+
- Error handling patterns
|
|
223
|
+
- context.close() placement
|
|
224
|
+
- Timeout management
|
|
225
|
+
|
|
226
|
+
### Exercise 4.4: Generate Deluge Code
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
/deluge "calculate invoice totals with tax for a list of orders"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Observe:
|
|
233
|
+
- Null safety patterns
|
|
234
|
+
- Statement count comments
|
|
235
|
+
- Error handling
|
|
236
|
+
- API batching (if applicable)
|
|
237
|
+
|
|
238
|
+
### Exercise 4.5: Full Zoho Workflow
|
|
239
|
+
|
|
240
|
+
Combine compliance and Zoho development:
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
# Set compliance mode in CLAUDE.md
|
|
244
|
+
## Compliance Mode: hipaa
|
|
245
|
+
|
|
246
|
+
# Scaffold with compliance
|
|
247
|
+
/zoho-scaffold creator-app "patient-portal"
|
|
248
|
+
|
|
249
|
+
# Review compliance integration
|
|
250
|
+
/code-review
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Verification Checklist
|
|
256
|
+
|
|
257
|
+
Before proceeding to Day 5, confirm:
|
|
258
|
+
|
|
259
|
+
- [ ] Can set compliance mode in CLAUDE.md
|
|
260
|
+
- [ ] Ran `/compliance-check` and understood output
|
|
261
|
+
- [ ] Understand HIPAA/SOC2/PCI-DSS basics
|
|
262
|
+
- [ ] Scaffolded a Catalyst function
|
|
263
|
+
- [ ] Generated Deluge code with `/deluge`
|
|
264
|
+
- [ ] Understand platform constraints (5000 statements, 40s timeout)
|
|
265
|
+
- [ ] Know critical patterns (context.close, null safety)
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Key Takeaways
|
|
270
|
+
|
|
271
|
+
1. **Set compliance mode once** - the system handles the rest
|
|
272
|
+
2. **Zoho has hard limits** - 5000 statements, 40 second timeout
|
|
273
|
+
3. **Always use scaffolding** - it includes required patterns
|
|
274
|
+
4. **Deluge needs null safety** - every variable access
|
|
275
|
+
5. **Catalyst needs context.close()** - every function, even on error
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Quick Reference
|
|
280
|
+
|
|
281
|
+
### Compliance Commands
|
|
282
|
+
```
|
|
283
|
+
/compliance-check - Run full audit
|
|
284
|
+
/code-review - Includes compliance checks when mode is set
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Zoho Commands
|
|
288
|
+
```
|
|
289
|
+
/zoho-scaffold creator-app "name" - Creator app
|
|
290
|
+
/zoho-scaffold catalyst-function "name" - Catalyst function
|
|
291
|
+
/deluge "description" - Generate Deluge code
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Constraint Limits
|
|
295
|
+
```
|
|
296
|
+
Deluge: 5,000 statements / function
|
|
297
|
+
Catalyst: 40 second timeout
|
|
298
|
+
Creator: 10 subforms / form
|
|
299
|
+
OAuth: 1 hour token expiry
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
**Day 4 Complete** | Next: [Day 5 - Hooks & Skills](day-5-hooks-skills.md)
|