@cloudstreamsoftware/claude-tools 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/README.md +152 -37
  2. package/agents/INDEX.md +183 -0
  3. package/agents/architect.md +247 -0
  4. package/agents/build-error-resolver.md +555 -0
  5. package/agents/catalyst-deployer.md +132 -0
  6. package/agents/code-reviewer.md +121 -0
  7. package/agents/compliance-auditor.md +148 -0
  8. package/agents/creator-architect.md +395 -0
  9. package/agents/deluge-reviewer.md +98 -0
  10. package/agents/doc-updater.md +471 -0
  11. package/agents/e2e-runner.md +711 -0
  12. package/agents/planner.md +122 -0
  13. package/agents/refactor-cleaner.md +309 -0
  14. package/agents/security-reviewer.md +582 -0
  15. package/agents/tdd-guide.md +302 -0
  16. package/config/versions.json +63 -0
  17. package/dist/hooks/hooks.json +209 -0
  18. package/dist/index.js +47 -0
  19. package/dist/lib/asset-value.js +609 -0
  20. package/dist/lib/client-manager.js +300 -0
  21. package/dist/lib/command-matcher.js +242 -0
  22. package/dist/lib/cross-session-patterns.js +754 -0
  23. package/dist/lib/intent-classifier.js +1075 -0
  24. package/dist/lib/package-manager.js +374 -0
  25. package/dist/lib/recommendation-engine.js +597 -0
  26. package/dist/lib/session-memory.js +489 -0
  27. package/dist/lib/skill-effectiveness.js +486 -0
  28. package/dist/lib/skill-matcher.js +595 -0
  29. package/dist/lib/tutorial-metrics.js +242 -0
  30. package/dist/lib/tutorial-progress.js +209 -0
  31. package/dist/lib/tutorial-renderer.js +431 -0
  32. package/dist/lib/utils.js +380 -0
  33. package/dist/lib/verify-formatter.js +143 -0
  34. package/dist/lib/workflow-state.js +249 -0
  35. package/hooks/hooks.json +209 -0
  36. package/package.json +5 -1
  37. package/scripts/aggregate-sessions.js +290 -0
  38. package/scripts/branch-name-validator.js +291 -0
  39. package/scripts/build.js +101 -0
  40. package/scripts/commands/client-switch.js +231 -0
  41. package/scripts/deprecate-skill.js +610 -0
  42. package/scripts/diagnose.js +324 -0
  43. package/scripts/doc-freshness.js +168 -0
  44. package/scripts/generate-weekly-digest.js +393 -0
  45. package/scripts/health-check.js +270 -0
  46. package/scripts/hooks/credential-check.js +101 -0
  47. package/scripts/hooks/evaluate-session.js +81 -0
  48. package/scripts/hooks/pre-compact.js +66 -0
  49. package/scripts/hooks/prompt-analyzer.js +276 -0
  50. package/scripts/hooks/prompt-router.js +422 -0
  51. package/scripts/hooks/quality-gate-enforcer.js +371 -0
  52. package/scripts/hooks/session-end.js +156 -0
  53. package/scripts/hooks/session-start.js +195 -0
  54. package/scripts/hooks/skill-injector.js +333 -0
  55. package/scripts/hooks/suggest-compact.js +58 -0
  56. package/scripts/lib/asset-value.js +609 -0
  57. package/scripts/lib/client-manager.js +300 -0
  58. package/scripts/lib/command-matcher.js +242 -0
  59. package/scripts/lib/cross-session-patterns.js +754 -0
  60. package/scripts/lib/intent-classifier.js +1075 -0
  61. package/scripts/lib/package-manager.js +374 -0
  62. package/scripts/lib/recommendation-engine.js +597 -0
  63. package/scripts/lib/session-memory.js +489 -0
  64. package/scripts/lib/skill-effectiveness.js +486 -0
  65. package/scripts/lib/skill-matcher.js +595 -0
  66. package/scripts/lib/tutorial-metrics.js +242 -0
  67. package/scripts/lib/tutorial-progress.js +209 -0
  68. package/scripts/lib/tutorial-renderer.js +431 -0
  69. package/scripts/lib/utils.js +380 -0
  70. package/scripts/lib/verify-formatter.js +143 -0
  71. package/scripts/lib/workflow-state.js +249 -0
  72. package/scripts/onboard.js +363 -0
  73. package/scripts/quarterly-report.js +692 -0
  74. package/scripts/setup-package-manager.js +204 -0
  75. package/scripts/sync-upstream.js +391 -0
  76. package/scripts/test.js +108 -0
  77. package/scripts/tutorial-runner.js +351 -0
  78. package/scripts/validate-all.js +201 -0
  79. package/scripts/verifiers/agents.js +245 -0
  80. package/scripts/verifiers/config.js +186 -0
  81. package/scripts/verifiers/environment.js +123 -0
  82. package/scripts/verifiers/hooks.js +188 -0
  83. package/scripts/verifiers/index.js +38 -0
  84. package/scripts/verifiers/persistence.js +140 -0
  85. package/scripts/verifiers/plugin.js +215 -0
  86. package/scripts/verifiers/skills.js +209 -0
  87. package/scripts/verify-setup.js +164 -0
  88. package/skills/INDEX.md +157 -0
  89. package/skills/backend-patterns/SKILL.md +586 -0
  90. package/skills/backend-patterns/catalyst-patterns.md +128 -0
  91. package/skills/bigquery-patterns/SKILL.md +27 -0
  92. package/skills/bigquery-patterns/performance-optimization.md +518 -0
  93. package/skills/bigquery-patterns/query-patterns.md +372 -0
  94. package/skills/bigquery-patterns/schema-design.md +78 -0
  95. package/skills/cloudstream-project-template/SKILL.md +20 -0
  96. package/skills/cloudstream-project-template/structure.md +65 -0
  97. package/skills/coding-standards/SKILL.md +524 -0
  98. package/skills/coding-standards/deluge-standards.md +83 -0
  99. package/skills/compliance-patterns/SKILL.md +28 -0
  100. package/skills/compliance-patterns/hipaa/audit-requirements.md +251 -0
  101. package/skills/compliance-patterns/hipaa/baa-process.md +298 -0
  102. package/skills/compliance-patterns/hipaa/data-archival-strategy.md +387 -0
  103. package/skills/compliance-patterns/hipaa/phi-handling.md +52 -0
  104. package/skills/compliance-patterns/pci-dss/saq-a-requirements.md +307 -0
  105. package/skills/compliance-patterns/pci-dss/tokenization-patterns.md +382 -0
  106. package/skills/compliance-patterns/pci-dss/zoho-checkout-patterns.md +56 -0
  107. package/skills/compliance-patterns/soc2/access-controls.md +344 -0
  108. package/skills/compliance-patterns/soc2/audit-logging.md +458 -0
  109. package/skills/compliance-patterns/soc2/change-management.md +403 -0
  110. package/skills/compliance-patterns/soc2/deluge-execution-logging.md +407 -0
  111. package/skills/consultancy-workflows/SKILL.md +19 -0
  112. package/skills/consultancy-workflows/client-isolation.md +21 -0
  113. package/skills/consultancy-workflows/documentation-automation.md +454 -0
  114. package/skills/consultancy-workflows/handoff-procedures.md +257 -0
  115. package/skills/consultancy-workflows/knowledge-capture.md +513 -0
  116. package/skills/consultancy-workflows/time-tracking.md +26 -0
  117. package/skills/continuous-learning/SKILL.md +84 -0
  118. package/skills/continuous-learning/config.json +18 -0
  119. package/skills/continuous-learning/evaluate-session.sh +60 -0
  120. package/skills/continuous-learning-v2/SKILL.md +126 -0
  121. package/skills/continuous-learning-v2/config.json +61 -0
  122. package/skills/frontend-patterns/SKILL.md +635 -0
  123. package/skills/frontend-patterns/zoho-widget-patterns.md +103 -0
  124. package/skills/gcp-data-engineering/SKILL.md +36 -0
  125. package/skills/gcp-data-engineering/bigquery/performance-optimization.md +337 -0
  126. package/skills/gcp-data-engineering/dataflow/error-handling.md +496 -0
  127. package/skills/gcp-data-engineering/dataflow/pipeline-patterns.md +444 -0
  128. package/skills/gcp-data-engineering/dbt/model-organization.md +63 -0
  129. package/skills/gcp-data-engineering/dbt/testing-patterns.md +503 -0
  130. package/skills/gcp-data-engineering/medallion-architecture/bronze-layer.md +60 -0
  131. package/skills/gcp-data-engineering/medallion-architecture/gold-layer.md +311 -0
  132. package/skills/gcp-data-engineering/medallion-architecture/layer-transitions.md +517 -0
  133. package/skills/gcp-data-engineering/medallion-architecture/silver-layer.md +305 -0
  134. package/skills/gcp-data-engineering/zoho-to-gcp/data-extraction.md +543 -0
  135. package/skills/gcp-data-engineering/zoho-to-gcp/real-time-vs-batch.md +337 -0
  136. package/skills/security-review/SKILL.md +498 -0
  137. package/skills/security-review/compliance-checklist.md +53 -0
  138. package/skills/strategic-compact/SKILL.md +67 -0
  139. package/skills/tdd-workflow/SKILL.md +413 -0
  140. package/skills/tdd-workflow/zoho-testing.md +124 -0
  141. package/skills/tutorial/SKILL.md +249 -0
  142. package/skills/tutorial/docs/ACCESSIBILITY.md +169 -0
  143. package/skills/tutorial/lessons/00-philosophy-and-workflow.md +198 -0
  144. package/skills/tutorial/lessons/01-basics.md +81 -0
  145. package/skills/tutorial/lessons/02-training.md +86 -0
  146. package/skills/tutorial/lessons/03-commands.md +109 -0
  147. package/skills/tutorial/lessons/04-workflows.md +115 -0
  148. package/skills/tutorial/lessons/05-compliance.md +116 -0
  149. package/skills/tutorial/lessons/06-zoho.md +121 -0
  150. package/skills/tutorial/lessons/07-hooks-system.md +277 -0
  151. package/skills/tutorial/lessons/08-mcp-servers.md +316 -0
  152. package/skills/tutorial/lessons/09-client-management.md +215 -0
  153. package/skills/tutorial/lessons/10-testing-e2e.md +260 -0
  154. package/skills/tutorial/lessons/11-skills-deep-dive.md +272 -0
  155. package/skills/tutorial/lessons/12-rules-system.md +326 -0
  156. package/skills/tutorial/lessons/13-golden-standard-graduation.md +213 -0
  157. package/skills/tutorial/lessons/14-fork-setup-and-sync.md +312 -0
  158. package/skills/tutorial/lessons/15-living-examples-system.md +221 -0
  159. package/skills/tutorial/tracks/accelerated/README.md +134 -0
  160. package/skills/tutorial/tracks/accelerated/assessment/checkpoint-1.md +161 -0
  161. package/skills/tutorial/tracks/accelerated/assessment/checkpoint-2.md +175 -0
  162. package/skills/tutorial/tracks/accelerated/day-1-core-concepts.md +234 -0
  163. package/skills/tutorial/tracks/accelerated/day-2-essential-commands.md +270 -0
  164. package/skills/tutorial/tracks/accelerated/day-3-workflow-mastery.md +305 -0
  165. package/skills/tutorial/tracks/accelerated/day-4-compliance-zoho.md +304 -0
  166. package/skills/tutorial/tracks/accelerated/day-5-hooks-skills.md +344 -0
  167. package/skills/tutorial/tracks/accelerated/day-6-client-testing.md +386 -0
  168. package/skills/tutorial/tracks/accelerated/day-7-graduation.md +369 -0
  169. package/skills/zoho-patterns/CHANGELOG.md +108 -0
  170. package/skills/zoho-patterns/SKILL.md +446 -0
  171. package/skills/zoho-patterns/analytics/dashboard-patterns.md +352 -0
  172. package/skills/zoho-patterns/analytics/zoho-to-bigquery-pipeline.md +427 -0
  173. package/skills/zoho-patterns/catalyst/appsail-deployment.md +349 -0
  174. package/skills/zoho-patterns/catalyst/context-close-patterns.md +354 -0
  175. package/skills/zoho-patterns/catalyst/cron-batch-processing.md +374 -0
  176. package/skills/zoho-patterns/catalyst/function-patterns.md +439 -0
  177. package/skills/zoho-patterns/creator/form-design.md +304 -0
  178. package/skills/zoho-patterns/creator/publish-api-patterns.md +313 -0
  179. package/skills/zoho-patterns/creator/widget-integration.md +306 -0
  180. package/skills/zoho-patterns/creator/workflow-automation.md +253 -0
  181. package/skills/zoho-patterns/deluge/api-patterns.md +468 -0
  182. package/skills/zoho-patterns/deluge/batch-processing.md +403 -0
  183. package/skills/zoho-patterns/deluge/cross-app-integration.md +356 -0
  184. package/skills/zoho-patterns/deluge/error-handling.md +423 -0
  185. package/skills/zoho-patterns/deluge/syntax-reference.md +65 -0
  186. package/skills/zoho-patterns/integration/cors-proxy-architecture.md +426 -0
  187. package/skills/zoho-patterns/integration/crm-books-native-sync.md +277 -0
  188. package/skills/zoho-patterns/integration/oauth-token-management.md +461 -0
  189. package/skills/zoho-patterns/integration/zoho-flow-patterns.md +334 -0
@@ -0,0 +1,454 @@
1
+ # Documentation Automation
2
+
3
+ ## Overview
4
+
5
+ CloudStream delivers billable client work that must be auditable, defensible, and handoff-ready. Manual documentation is time-consuming, error-prone, and frequently falls behind code changes. This guide defines how to auto-generate client documentation from code, commits, and project structure -- ensuring documentation stays in sync with reality.
6
+
7
+ > **WARNING**: Client documentation is a deliverable. Undocumented work cannot be handed off, cannot be maintained by other team members, and cannot be defended in disputes. Automate documentation generation as part of every project.
8
+
9
+ ---
10
+
11
+ ## Auto-Generating Client Documentation from Code and Commits
12
+
13
+ ### Documentation Sources
14
+
15
+ | Source | What It Produces | Automation Method |
16
+ |---|---|---|
17
+ | Git commit history | Change logs, release notes | Commit message parsing |
18
+ | Code comments/JSDoc | API reference docs | Comment extraction |
19
+ | Deluge function headers | Function catalog | Header parsing |
20
+ | Creator form structure | Data dictionary | API export + formatting |
21
+ | Catalyst function configs | Deployment runbook | Config file parsing |
22
+ | Workflow definitions | Process documentation | Workflow export |
23
+ | File/folder structure | Architecture overview | Directory tree analysis |
24
+
25
+ ### Commit-Driven Documentation Pipeline
26
+
27
+ ```
28
+ Developer commits code
29
+ |
30
+ | (Conventional Commits format)
31
+ v
32
+ Pre-commit hook validates format
33
+ |
34
+ v
35
+ Post-push hook triggers doc generation
36
+ |
37
+ v
38
+ Claude Code parses commit history
39
+ |
40
+ v
41
+ Documentation artifacts updated:
42
+ - CHANGELOG.md (per project)
43
+ - API reference (if endpoints changed)
44
+ - Architecture docs (if structure changed)
45
+ - Runbook (if deployment config changed)
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Extracting Architecture Diagrams from Code Structure
51
+
52
+ ### Directory-to-Architecture Mapping
53
+
54
+ ```
55
+ project-root/
56
+ ├── forms/ → Data Layer documentation
57
+ │ ├── Patient_Records/ → Entity: Patient Records
58
+ │ ├── Appointments/ → Entity: Appointments
59
+ │ └── Audit_Logs/ → Entity: Audit Trail
60
+ ├── workflows/ → Business Logic documentation
61
+ │ ├── approval/ → Approval Process flows
62
+ │ ├── notifications/ → Notification system
63
+ │ └── scheduled/ → Scheduled job documentation
64
+ ├── functions/ → API/Integration documentation
65
+ │ ├── catalyst/ → Serverless functions
66
+ │ ├── webhooks/ → Webhook handlers
67
+ │ └── integrations/ → Third-party integrations
68
+ ├── reports/ → Reporting documentation
69
+ └── portals/ → User-facing documentation
70
+ ```
71
+
72
+ ### Architecture Document Auto-Generation Prompt
73
+
74
+ When using Claude Code to generate architecture docs from a project:
75
+
76
+ ```
77
+ Analyze the project structure at [path] and generate:
78
+ 1. A component diagram showing major subsystems
79
+ 2. A data flow diagram showing how data moves between forms
80
+ 3. An integration diagram showing external connections
81
+ 4. A deployment diagram showing environments and their relationships
82
+
83
+ Format as markdown with Mermaid diagram syntax.
84
+ Include all Creator forms, Catalyst functions, and external integrations.
85
+ ```
86
+
87
+ ### Sample Generated Architecture Section
88
+
89
+ ```markdown
90
+ ## System Architecture
91
+
92
+ ### Component Overview
93
+
94
+ ```mermaid
95
+ graph TD
96
+ Portal[Customer Portal] --> Creator[Zoho Creator]
97
+ Creator --> Forms[Form Layer]
98
+ Creator --> Workflows[Workflow Engine]
99
+ Forms --> AuditLog[Audit Logging]
100
+ Workflows --> Catalyst[Catalyst Functions]
101
+ Catalyst --> BigQuery[GCP BigQuery]
102
+ Catalyst --> Payments[Zoho Payments]
103
+ Workflows --> Email[Zoho Mail]
104
+ ```
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Generating API Documentation from Deluge/Catalyst Functions
110
+
111
+ ### Deluge Function Header Standard
112
+
113
+ Every Deluge function MUST include a documentation header:
114
+
115
+ ```deluge
116
+ // ============================================================
117
+ // FUNCTION: functionName
118
+ // PURPOSE: Brief description of what this function does
119
+ // TRIGGER: How this function is invoked (button/workflow/schedule/API)
120
+ // INPUTS:
121
+ // - paramName (Type): Description
122
+ // - paramName2 (Type): Description
123
+ // OUTPUTS:
124
+ // - Return value description
125
+ // SIDE EFFECTS:
126
+ // - Records created/modified
127
+ // - Emails sent
128
+ // - External API calls made
129
+ // COMPLIANCE: HIPAA|SOC2|PCI (which frameworks apply)
130
+ // AUTHOR: developer@cloudstreamsoftware.com
131
+ // CREATED: 2025-01-15
132
+ // MODIFIED: 2025-02-20 - Added error handling
133
+ // ============================================================
134
+ ```
135
+
136
+ ### Auto-Extraction Script
137
+
138
+ ```javascript
139
+ // Extract documentation headers from Deluge files
140
+ // Run as part of CI/CD or pre-handoff process
141
+
142
+ const fs = require('fs');
143
+ const path = require('path');
144
+
145
+ function extractDelugeDoc(filePath) {
146
+ const content = fs.readFileSync(filePath, 'utf8');
147
+ const headerRegex = /\/\/ ={50,}\n([\s\S]*?)\/\/ ={50,}/g;
148
+ const headers = [];
149
+ let match;
150
+
151
+ while ((match = headerRegex.exec(content)) !== null) {
152
+ const header = parseHeader(match[1]);
153
+ headers.push(header);
154
+ }
155
+
156
+ return headers;
157
+ }
158
+
159
+ function parseHeader(headerText) {
160
+ const lines = headerText.split('\n').map(l => l.replace(/^\/\/\s*/, '').trim());
161
+ const doc = {};
162
+
163
+ lines.forEach(line => {
164
+ if (line.startsWith('FUNCTION:')) doc.name = line.replace('FUNCTION:', '').trim();
165
+ if (line.startsWith('PURPOSE:')) doc.purpose = line.replace('PURPOSE:', '').trim();
166
+ if (line.startsWith('TRIGGER:')) doc.trigger = line.replace('TRIGGER:', '').trim();
167
+ if (line.startsWith('COMPLIANCE:')) doc.compliance = line.replace('COMPLIANCE:', '').trim();
168
+ // ... parse other fields
169
+ });
170
+
171
+ return doc;
172
+ }
173
+
174
+ function generateApiReference(headers) {
175
+ let markdown = '# API Reference\n\n';
176
+ markdown += '| Function | Purpose | Trigger | Compliance |\n';
177
+ markdown += '|---|---|---|---|\n';
178
+
179
+ headers.forEach(h => {
180
+ markdown += `| ${h.name} | ${h.purpose} | ${h.trigger} | ${h.compliance} |\n`;
181
+ });
182
+
183
+ return markdown;
184
+ }
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Commit Message Analysis for Change Logs
190
+
191
+ ### Conventional Commits Format (Required)
192
+
193
+ ```
194
+ <type>(<scope>): <description>
195
+
196
+ [optional body]
197
+
198
+ [optional footer]
199
+ ```
200
+
201
+ ### Types and Their Documentation Impact
202
+
203
+ | Type | Changelog Section | Example |
204
+ |---|---|---|
205
+ | `feat` | New Features | `feat(appointments): add recurring appointment support` |
206
+ | `fix` | Bug Fixes | `fix(billing): correct tax calculation for multi-state` |
207
+ | `docs` | Documentation | `docs(api): update webhook endpoint reference` |
208
+ | `refactor` | Technical Changes | `refactor(audit): optimize BigQuery batch insert` |
209
+ | `perf` | Performance | `perf(search): add index to Patient_Records lookup` |
210
+ | `security` | Security Updates | `security(auth): enforce MFA for admin roles` |
211
+ | `compliance` | Compliance Changes | `compliance(hipaa): add field-level encryption for SSN` |
212
+
213
+ ### Changelog Generation Script
214
+
215
+ ```javascript
216
+ // Generate CHANGELOG.md from git log
217
+ // Run: node generate-changelog.js [since-tag]
218
+
219
+ const { execSync } = require('child_process');
220
+
221
+ function generateChangelog(sinceTag) {
222
+ const log = execSync(
223
+ `git log ${sinceTag}..HEAD --pretty=format:"%H|%s|%an|%ad" --date=short`
224
+ ).toString();
225
+
226
+ const entries = log.split('\n').filter(Boolean).map(line => {
227
+ const [hash, message, author, date] = line.split('|');
228
+ const match = message.match(/^(\w+)(?:\(([^)]+)\))?: (.+)$/);
229
+ return match ? { hash, type: match[1], scope: match[2], desc: match[3], author, date } : null;
230
+ }).filter(Boolean);
231
+
232
+ const sections = {
233
+ feat: '### New Features',
234
+ fix: '### Bug Fixes',
235
+ security: '### Security Updates',
236
+ compliance: '### Compliance Changes',
237
+ perf: '### Performance Improvements',
238
+ refactor: '### Technical Changes'
239
+ };
240
+
241
+ let changelog = `## [${getNextVersion()}] - ${new Date().toISOString().split('T')[0]}\n\n`;
242
+
243
+ Object.entries(sections).forEach(([type, header]) => {
244
+ const items = entries.filter(e => e.type === type);
245
+ if (items.length) {
246
+ changelog += `${header}\n`;
247
+ items.forEach(item => {
248
+ changelog += `- ${item.scope ? `**${item.scope}**: ` : ''}${item.desc} (${item.hash.substring(0,7)})\n`;
249
+ });
250
+ changelog += '\n';
251
+ }
252
+ });
253
+
254
+ return changelog;
255
+ }
256
+ ```
257
+
258
+ ---
259
+
260
+ ## Automated Handoff Document Generation
261
+
262
+ ### Handoff Document Structure
263
+
264
+ When the `/handoff` command is invoked, generate the following document automatically:
265
+
266
+ ```markdown
267
+ # Project Handoff Document
268
+ ## [Client Name] - [Project Name]
269
+ ## Generated: [Date]
270
+
271
+ ### 1. Project Overview
272
+ - Client: [from project config]
273
+ - Engagement type: [from project config]
274
+ - Primary contacts: [from project config]
275
+ - Environments: [from deployment config]
276
+
277
+ ### 2. Architecture Summary
278
+ [Auto-generated from code structure analysis]
279
+
280
+ ### 3. Access & Credentials
281
+ - Zoho Org: [org details - NOT credentials]
282
+ - GCP Project: [project ID]
283
+ - Repository: [repo URL]
284
+ - Key contacts for access: [list]
285
+
286
+ ### 4. Active Workflows
287
+ [Auto-extracted from workflow definitions]
288
+
289
+ ### 5. Scheduled Jobs
290
+ [Auto-extracted from Catalyst cron configs]
291
+
292
+ ### 6. Integration Points
293
+ [Auto-extracted from API connection configs]
294
+
295
+ ### 7. Compliance Requirements
296
+ [Auto-extracted from compliance markers in code]
297
+
298
+ ### 8. Known Issues / Technical Debt
299
+ [Auto-extracted from TODO comments and issue tracker]
300
+
301
+ ### 9. Recent Changes
302
+ [Auto-generated from last 30 days of commits]
303
+
304
+ ### 10. Runbook
305
+ [Auto-generated from deployment configs and operational docs]
306
+ ```
307
+
308
+ ### Integration with /handoff Command
309
+
310
+ ```javascript
311
+ // In the handoff skill implementation
312
+ // Auto-collect documentation sources and generate
313
+
314
+ async function generateHandoffDoc(clientId, projectPath) {
315
+ const doc = {};
316
+
317
+ // 1. Project config
318
+ doc.overview = await readProjectConfig(projectPath);
319
+
320
+ // 2. Architecture
321
+ doc.architecture = await analyzeProjectStructure(projectPath);
322
+
323
+ // 3. Access (never include actual credentials)
324
+ doc.access = await extractAccessInfo(projectPath);
325
+
326
+ // 4. Workflows
327
+ doc.workflows = await extractWorkflowDefinitions(projectPath);
328
+
329
+ // 5. Scheduled jobs
330
+ doc.scheduledJobs = await extractCronConfigs(projectPath);
331
+
332
+ // 6. Integrations
333
+ doc.integrations = await extractApiConnections(projectPath);
334
+
335
+ // 7. Compliance
336
+ doc.compliance = await extractComplianceMarkers(projectPath);
337
+
338
+ // 8. Known issues
339
+ doc.issues = await extractTodosAndIssues(projectPath);
340
+
341
+ // 9. Recent changes
342
+ doc.recentChanges = await generateChangelog('30-days-ago');
343
+
344
+ // 10. Runbook
345
+ doc.runbook = await generateRunbook(projectPath);
346
+
347
+ return formatAsMarkdown(doc);
348
+ }
349
+ ```
350
+
351
+ ---
352
+
353
+ ## Documentation Templates
354
+
355
+ ### Architecture Document Template
356
+
357
+ | Section | Content | Auto-Generated? |
358
+ |---|---|---|
359
+ | Executive Summary | High-level overview | Partially (needs human review) |
360
+ | System Context | External dependencies | Yes (from integrations) |
361
+ | Component Diagram | Internal architecture | Yes (from structure) |
362
+ | Data Model | Forms and relationships | Yes (from Creator API) |
363
+ | Integration Map | External connections | Yes (from configs) |
364
+ | Security Model | Auth, encryption, access | Partially |
365
+ | Deployment Model | Environments, promotion | Yes (from configs) |
366
+ | Operational Model | Monitoring, alerting | Partially |
367
+
368
+ ### Runbook Template
369
+
370
+ | Section | Content | Auto-Generated? |
371
+ |---|---|---|
372
+ | Service Overview | What the system does | Yes (from README/config) |
373
+ | Health Checks | How to verify system health | Yes (from monitoring config) |
374
+ | Common Issues | Known problems and solutions | No (from knowledge base) |
375
+ | Restart Procedures | How to restart components | Partially |
376
+ | Escalation Path | Who to contact | No (from project config) |
377
+ | Deployment Steps | How to deploy changes | Yes (from CI/CD config) |
378
+
379
+ ### API Reference Template
380
+
381
+ | Section | Content | Auto-Generated? |
382
+ |---|---|---|
383
+ | Endpoint List | All API endpoints | Yes (from function headers) |
384
+ | Authentication | How to authenticate | Partially |
385
+ | Request/Response | Formats and examples | Yes (from code analysis) |
386
+ | Error Codes | Error responses | Yes (from error handling code) |
387
+ | Rate Limits | Throttling rules | No (from platform docs) |
388
+
389
+ ---
390
+
391
+ ## Keeping Docs in Sync with Code Changes
392
+
393
+ ### Automated Sync Triggers
394
+
395
+ | Trigger | Action | Tool |
396
+ |---|---|---|
397
+ | New commit pushed | Update changelog | Git hook + script |
398
+ | New form created | Update data dictionary | Creator webhook |
399
+ | New function deployed | Update API reference | Deployment hook |
400
+ | Quarterly review | Full doc regeneration | Scheduled task |
401
+ | Pre-handoff | Complete doc package | /handoff command |
402
+
403
+ ### Staleness Detection
404
+
405
+ ```javascript
406
+ // Check if documentation is stale relative to code changes
407
+ function checkDocStaleness(projectPath) {
408
+ const lastDocUpdate = getLastModified(`${projectPath}/docs/`);
409
+ const lastCodeChange = getLastCommitDate(projectPath);
410
+
411
+ const daysSinceDocUpdate = daysBetween(lastDocUpdate, new Date());
412
+ const daysSinceCodeChange = daysBetween(lastCodeChange, new Date());
413
+
414
+ if (daysSinceCodeChange < daysSinceDocUpdate && daysSinceDocUpdate > 14) {
415
+ return {
416
+ stale: true,
417
+ message: `Documentation last updated ${daysSinceDocUpdate} days ago, but code changed ${daysSinceCodeChange} days ago.`,
418
+ recommendation: 'Run documentation regeneration.'
419
+ };
420
+ }
421
+
422
+ return { stale: false };
423
+ }
424
+ ```
425
+
426
+ ---
427
+
428
+ ## Client-Facing vs. Internal Documentation Standards
429
+
430
+ ### Client-Facing Documentation
431
+
432
+ | Characteristic | Standard |
433
+ |---|---|
434
+ | Language | Professional, non-technical where possible |
435
+ | Detail level | Enough for client's IT team to understand |
436
+ | Credentials | NEVER included -- reference "contact CloudStream" |
437
+ | Architecture | High-level diagrams, not implementation details |
438
+ | Code snippets | Only when explaining customization options |
439
+ | Branding | Client logo/branding, CloudStream attribution |
440
+ | Format | PDF deliverable + shared folder access |
441
+
442
+ ### Internal Documentation
443
+
444
+ | Characteristic | Standard |
445
+ |---|---|
446
+ | Language | Technical, developer-focused |
447
+ | Detail level | Complete implementation details |
448
+ | Credentials | Reference to credential store (never plaintext) |
449
+ | Architecture | Detailed component diagrams with data flows |
450
+ | Code snippets | Comprehensive with context |
451
+ | Branding | CloudStream internal |
452
+ | Format | Markdown in project repository |
453
+
454
+ > **WARNING**: Never accidentally deliver internal documentation to clients. Internal docs may reference other clients, pricing strategies, or technical shortcuts that are inappropriate for external consumption. Always generate client-facing docs separately.
@@ -0,0 +1,257 @@
1
+ # Client Handoff Procedures
2
+
3
+ ## When Handoffs Occur
4
+
5
+ | Scenario | Trigger | Recipient |
6
+ |----------|---------|-----------|
7
+ | Project completion | All deliverables accepted | Client internal team |
8
+ | Team member change | Employee departure/transition | New CloudStream developer |
9
+ | Support transition | Active dev → maintenance mode | Support team |
10
+ | Emergency coverage | Illness, PTO, unavailability | Backup developer |
11
+
12
+ ---
13
+
14
+ ## Architecture Handoff Checklist
15
+
16
+ ### System Documentation
17
+
18
+ - [ ] Architecture diagram (draw.io or Lucidchart, exported as PNG + editable source)
19
+ - [ ] All Zoho apps listed with links:
20
+ - Creator apps (form links, widget links)
21
+ - CRM modules and custom fields
22
+ - Catalyst projects (console links)
23
+ - Analytics workspaces and dashboards
24
+ - Books organization and chart of accounts
25
+ - [ ] All integrations documented:
26
+ - OAuth connections (name, scope, expiry schedule)
27
+ - Webhooks (source, destination, payload format)
28
+ - Scheduled jobs (frequency, purpose, error handling)
29
+ - API endpoints (Catalyst functions, AppSail routes)
30
+ - [ ] Data flow diagram showing:
31
+ - Where data enters the system
32
+ - How it moves between Zoho apps
33
+ - External systems connected
34
+ - GCP pipeline stages (if applicable)
35
+
36
+ ### Code Documentation
37
+
38
+ - [ ] Repository structure explained
39
+ - [ ] Key Deluge scripts documented (purpose, trigger, dependencies)
40
+ - [ ] Catalyst function index (name, type, trigger, timeout)
41
+ - [ ] Widget source code location and build instructions
42
+ - [ ] Environment variables documented (what each one controls)
43
+ - [ ] Test procedures documented (how to validate changes)
44
+
45
+ ### Compliance Documentation (if applicable)
46
+
47
+ - [ ] Compliance mode documented (HIPAA/SOC2/PCI-DSS/standard)
48
+ - [ ] ePHI field inventory (HIPAA clients)
49
+ - [ ] Access control matrix current and signed
50
+ - [ ] Audit log archival status confirmed (no gaps)
51
+ - [ ] BAA/DPA agreements referenced (not included - legal holds)
52
+ - [ ] Last compliance review date and findings
53
+
54
+ ---
55
+
56
+ ## Credential Rotation During Handoff
57
+
58
+ ### NEVER Transfer Credentials Via
59
+
60
+ - Email (unencrypted, logged, forwarded)
61
+ - Chat/messaging (Slack, Teams - retained in logs)
62
+ - Shared documents (Google Docs, OneDrive)
63
+ - Git repositories (even private ones)
64
+ - Screenshots (may be backed up to cloud)
65
+
66
+ ### Approved Credential Transfer Methods
67
+
68
+ | Method | Use When | Steps |
69
+ |--------|----------|-------|
70
+ | Password manager (1Password/LastPass) | Ongoing team access | Create shared vault, add credentials, invite recipient |
71
+ | Zoho Vault | Client uses Zoho One | Create shared secret, set access duration |
72
+ | In-person + secure wipe | Highest security | Show on screen, recipient types, verify, clear clipboard |
73
+ | Secure video call | Remote handoff | Screen share credential, recipient confirms, revoke screen share |
74
+
75
+ ### Credential Rotation Procedure
76
+
77
+ 1. Generate NEW credentials (don't transfer existing)
78
+ 2. Update the application to use new credentials
79
+ 3. Verify application works with new credentials
80
+ 4. Revoke OLD credentials
81
+ 5. Document new credential locations in password manager
82
+ 6. Update `.env.client` template if format changed
83
+
84
+ ### Credentials to Rotate at Handoff
85
+
86
+ | Credential | Rotation Steps |
87
+ |-----------|----------------|
88
+ | Zoho OAuth Refresh Token | Revoke old in API Console, generate new with same scopes |
89
+ | GCP Service Account Key | Create new key, deploy, delete old key |
90
+ | GitHub Personal Access Token | Generate new under recipient's account |
91
+ | dbt Cloud Token | Create new service token, revoke old |
92
+ | Webhook secrets | Generate new secret, update both endpoints |
93
+ | Catalyst environment variables | Update in Catalyst Console |
94
+
95
+ ---
96
+
97
+ ## Documentation Package Contents
98
+
99
+ The handoff package is a folder (physical or shared drive) containing:
100
+
101
+ ```
102
+ handoff-package/
103
+ ├── 01-architecture-overview.md # System design document
104
+ ├── 02-component-inventory.md # All apps, forms, functions listed
105
+ ├── 03-integration-map.md # Data flows and connections
106
+ ├── 04-api-reference.md # Custom endpoints documentation
107
+ ├── 05-operational-runbook.md # Day-to-day operations guide
108
+ ├── 06-known-issues.md # Technical debt and workarounds
109
+ ├── 07-future-recommendations.md # Suggested improvements
110
+ ├── 08-compliance-status.md # Current compliance state
111
+ ├── 09-credential-inventory.md # WHERE credentials are stored (not the credentials)
112
+ ├── 10-contact-directory.md # Key contacts and escalation paths
113
+ ├── diagrams/
114
+ │ ├── architecture.png
115
+ │ ├── architecture.drawio # Editable source
116
+ │ ├── data-flow.png
117
+ │ └── data-flow.drawio
118
+ └── appendix/
119
+ ├── sample-api-responses.json
120
+ ├── form-screenshots/ # Current form layouts
121
+ └── dashboard-screenshots/ # Current report/dashboard state
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Operational Runbook Template
127
+
128
+ ### Section 1: Daily Operations
129
+
130
+ ```markdown
131
+ ## Daily Checks
132
+ 1. Verify scheduled jobs ran successfully
133
+ - Check: Catalyst Console → Functions → Execution Logs
134
+ - Expected: All cron functions show "SUCCESS" status
135
+ - If failed: Check error logs, re-run manually if safe
136
+
137
+ 2. Monitor API credit usage
138
+ - Check: Zoho API Console → Usage
139
+ - Threshold: Alert if >70% of daily limit consumed
140
+ - Action: Identify high-usage script, optimize or schedule off-peak
141
+
142
+ 3. Check BigQuery pipeline (if applicable)
143
+ - Check: GCP Console → BigQuery → Jobs
144
+ - Verify: Bronze ingestion completed, silver refresh succeeded
145
+ - If failed: Check source availability, re-trigger pipeline
146
+ ```
147
+
148
+ ### Section 2: Weekly Operations
149
+
150
+ ```markdown
151
+ ## Weekly Tasks
152
+ 1. Review audit logs for anomalies
153
+ 2. Check Zoho subscription usage (storage, API credits)
154
+ 3. Verify backup/archival jobs completed
155
+ 4. Update project status in internal tracking
156
+ ```
157
+
158
+ ### Section 3: Monthly Operations
159
+
160
+ ```markdown
161
+ ## Monthly Tasks
162
+ 1. Export audit logs to BigQuery (compliance clients)
163
+ 2. Review and rotate any expiring credentials
164
+ 3. Generate monthly usage report for client
165
+ 4. Review error logs for recurring issues
166
+ ```
167
+
168
+ ### Section 4: Troubleshooting
169
+
170
+ ```markdown
171
+ ## Common Issues
172
+
173
+ ### "Token Expired" in Deluge Scripts
174
+ - Cause: OAuth connection needs reauthorization
175
+ - Fix: Setup → Developer → Connections → Re-authorize
176
+ - Prevention: Monitor token expiry dates
177
+
178
+ ### Catalyst Function Timeout
179
+ - Cause: Processing exceeds 30s (I/O) or 15min (Cron)
180
+ - Fix: Optimize query, add pagination, or split into smaller batches
181
+ - Prevention: Add timeout monitoring, break large jobs into chunks
182
+
183
+ ### "Maximum records limit reached" in Creator
184
+ - Cause: Form approaching 500K record limit
185
+ - Fix: Archive old records to BigQuery, delete from Creator
186
+ - Prevention: Schedule monthly archival
187
+
188
+ ### Webhook Not Firing
189
+ - Cause: Workflow disabled, URL changed, or target unreachable
190
+ - Fix: Verify workflow is active, check target URL, test manually
191
+ - Prevention: Monitor webhook delivery status
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Knowledge Transfer Session Structure
197
+
198
+ ### Session 1: Architecture Overview (60 minutes)
199
+
200
+ 1. Walk through architecture diagram (15 min)
201
+ 2. Demo key user workflows in the live system (20 min)
202
+ 3. Show data flow: source → Zoho → GCP → reports (15 min)
203
+ 4. Q&A and gap identification (10 min)
204
+
205
+ ### Session 2: Technical Deep-Dive (90 minutes)
206
+
207
+ 1. Repository structure and code organization (15 min)
208
+ 2. Key Deluge scripts walkthrough (30 min)
209
+ 3. Catalyst functions and deployment process (20 min)
210
+ 4. Widget development and testing (15 min)
211
+ 5. Q&A (10 min)
212
+
213
+ ### Session 3: Operations and Support (60 minutes)
214
+
215
+ 1. Walk through operational runbook live (20 min)
216
+ 2. Simulate common troubleshooting scenarios (20 min)
217
+ 3. Review credential locations and rotation process (10 min)
218
+ 4. Define support escalation path (10 min)
219
+
220
+ ### Session 4: Compliance (30 minutes, if applicable)
221
+
222
+ 1. Review compliance mode and requirements (10 min)
223
+ 2. Walk through audit log configuration (10 min)
224
+ 3. Demonstrate audit response procedure (10 min)
225
+
226
+ ---
227
+
228
+ ## Post-Handoff Support Window
229
+
230
+ | Period | Support Level | Response Time | Scope |
231
+ |--------|--------------|---------------|-------|
232
+ | Days 1-7 | Full availability | Same day | All questions |
233
+ | Days 8-14 | Available on request | 24 hours | Technical issues |
234
+ | Days 15-30 | Email only | 48 hours | Critical issues only |
235
+ | Day 31+ | New engagement | Per contract | Requires SOW |
236
+
237
+ ### Support Window Expectations
238
+
239
+ - Recipient should attempt self-resolution using documentation first
240
+ - Questions should be batched where possible (not 20 individual messages)
241
+ - Critical issues (production down, data loss risk) bypass normal channels
242
+ - All support interactions are logged for knowledge base improvement
243
+
244
+ ---
245
+
246
+ ## Handoff Completion Criteria
247
+
248
+ The handoff is considered complete when:
249
+
250
+ - [ ] All documentation delivered and acknowledged
251
+ - [ ] Credentials rotated and verified working
252
+ - [ ] Knowledge transfer sessions completed (recorded if possible)
253
+ - [ ] Recipient can independently deploy a code change
254
+ - [ ] Recipient can independently troubleshoot a common issue
255
+ - [ ] Recipient can independently respond to an audit request (compliance clients)
256
+ - [ ] Support window start date agreed upon
257
+ - [ ] Final sign-off from client/recipient