oneie 3.3.6 → 3.4.1

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.
@@ -0,0 +1,606 @@
1
+ # Agent Skills Implementation Plan
2
+
3
+ **Version:** 1.0.0
4
+ **Date:** 2025-10-18
5
+ **Status:** Planning
6
+ **Reference:** https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview
7
+
8
+ ## Overview
9
+
10
+ Implement Claude Code agent skills for all ONE Platform agents in `.claude/agents/*` to enable:
11
+ - Reusable, composable skill modules
12
+ - Skill invocation from within agents
13
+ - Skill-to-skill communication
14
+ - Better separation of concerns
15
+ - Easier testing and maintenance
16
+
17
+ ## Current State
18
+
19
+ ### Existing Agents (17 total)
20
+
21
+ **Coding Specialists (7):**
22
+ - `agent-backend.md` - Convex backend (schema, mutations, queries, services)
23
+ - `agent-frontend.md` - Astro 5 + React 19 UI components
24
+ - `agent-builder.md` - Full-stack engineering
25
+ - `agent-integrator.md` - Protocol integrations (A2A, ACP, AP2, X402, AG-UI)
26
+ - `agent-designer.md` - Wireframes, components, design tokens
27
+ - `agent-clean.md` - Code quality, refactoring, technical debt
28
+ - `agent-quality.md` - Testing, validation, ontology alignment
29
+
30
+ **Business Specialists (10):**
31
+ - `agent-ops.md` - DevOps, releases, deployments, CI/CD
32
+ - `agent-director.md` - Idea validation, planning, specialist orchestration
33
+ - `agent-sales.md` - Lead qualification, demos, KYC, trials
34
+ - `agent-documenter.md` - Documentation, knowledge capture
35
+ - `agent-clone.md` - Data migration, AI clones from content
36
+ - `agent-problem-solver.md` - Root cause analysis, solution proposals
37
+ - Plus general-purpose agents
38
+
39
+ ### Current Pain Points
40
+
41
+ 1. **Code Duplication:** Common tasks (read schema, validate ontology, check build) repeated across agents
42
+ 2. **No Reusability:** Each agent re-implements similar functionality
43
+ 3. **Hard to Test:** Logic embedded in agent prompts, not isolated skills
44
+ 4. **Inconsistent Patterns:** Different agents use different approaches for same tasks
45
+ 5. **No Composition:** Can't combine skills or build on existing capabilities
46
+
47
+ ## Target State: Skill-Based Architecture
48
+
49
+ ### Skill Categories
50
+
51
+ #### 1. **Ontology Skills** (`skills/ontology/`)
52
+
53
+ **`validate-schema.md`** - Validate against 6-dimension ontology
54
+ - Input: Schema definition or code file
55
+ - Output: Validation report with errors/warnings
56
+ - Used by: agent-backend, agent-quality, agent-director
57
+
58
+ **`check-dimension.md`** - Check if feature maps to dimensions
59
+ - Input: Feature description
60
+ - Output: Dimension mapping (groups, people, things, connections, events, knowledge)
61
+ - Used by: agent-director, agent-quality
62
+
63
+ **`generate-entity-type.md`** - Generate new entity type from description
64
+ - Input: Plain English entity description
65
+ - Output: TypeScript type definition + schema
66
+ - Used by: agent-backend, agent-builder
67
+
68
+ **`verify-relationships.md`** - Verify connection types are valid
69
+ - Input: Connection definition
70
+ - Output: Valid/invalid with reasoning
71
+ - Used by: agent-backend, agent-quality
72
+
73
+ #### 2. **Convex Skills** (`skills/convex/`)
74
+
75
+ **`read-schema.md`** - Read and parse Convex schema
76
+ - Input: Schema file path
77
+ - Output: Parsed schema with tables, indexes, types
78
+ - Used by: All backend-related agents
79
+
80
+ **`create-mutation.md`** - Generate Convex mutation
81
+ - Input: Operation description
82
+ - Output: Typed mutation code with validation
83
+ - Used by: agent-backend, agent-builder
84
+
85
+ **`create-query.md`** - Generate Convex query
86
+ - Input: Query description
87
+ - Output: Typed query code with indexes
88
+ - Used by: agent-backend, agent-builder
89
+
90
+ **`test-function.md`** - Test Convex function
91
+ - Input: Function name, test cases
92
+ - Output: Test results
93
+ - Used by: agent-quality, agent-backend
94
+
95
+ **`check-deployment.md`** - Verify Convex deployment status
96
+ - Input: Deployment name
97
+ - Output: Status, functions, schema version
98
+ - Used by: agent-ops, agent-quality
99
+
100
+ #### 3. **Astro Skills** (`skills/astro/`)
101
+
102
+ **`create-page.md`** - Generate Astro page
103
+ - Input: Route, layout, components
104
+ - Output: Astro page file with SSR
105
+ - Used by: agent-frontend, agent-builder
106
+
107
+ **`create-component.md`** - Generate React component
108
+ - Input: Component spec
109
+ - Output: React component with types
110
+ - Used by: agent-frontend, agent-designer
111
+
112
+ **`add-content-collection.md`** - Add content collection
113
+ - Input: Collection name, schema
114
+ - Output: Collection config + type definitions
115
+ - Used by: agent-frontend, agent-builder
116
+
117
+ **`check-build.md`** - Run Astro build check
118
+ - Input: None
119
+ - Output: Build status, errors, warnings
120
+ - Used by: agent-quality, agent-ops
121
+
122
+ **`optimize-performance.md`** - Optimize Astro performance
123
+ - Input: Page or component path
124
+ - Output: Optimization recommendations + changes
125
+ - Used by: agent-clean, agent-quality
126
+
127
+ #### 4. **Design Skills** (`skills/design/`)
128
+
129
+ **`generate-wireframe.md`** - Create wireframe from spec
130
+ - Input: Feature spec, test requirements
131
+ - Output: Wireframe document
132
+ - Used by: agent-designer
133
+
134
+ **`create-component-spec.md`** - Define component specifications
135
+ - Input: Component description
136
+ - Output: Component spec with props, states, events
137
+ - Used by: agent-designer, agent-frontend
138
+
139
+ **`generate-design-tokens.md`** - Create design tokens
140
+ - Input: Brand guidelines
141
+ - Output: Design token definitions (colors, spacing, typography)
142
+ - Used by: agent-designer
143
+
144
+ **`check-accessibility.md`** - Verify WCAG compliance
145
+ - Input: Component or page
146
+ - Output: Accessibility report with fixes
147
+ - Used by: agent-quality, agent-designer
148
+
149
+ #### 5. **Testing Skills** (`skills/testing/`)
150
+
151
+ **`generate-tests.md`** - Generate test suite
152
+ - Input: Feature description, code file
153
+ - Output: Complete test suite (unit + integration)
154
+ - Used by: agent-quality
155
+
156
+ **`run-tests.md`** - Execute test suite
157
+ - Input: Test file path or pattern
158
+ - Output: Test results with coverage
159
+ - Used by: agent-quality, agent-ops
160
+
161
+ **`analyze-coverage.md`** - Check test coverage
162
+ - Input: None (uses project coverage data)
163
+ - Output: Coverage report with gaps
164
+ - Used by: agent-quality
165
+
166
+ **`validate-e2e.md`** - Run end-to-end tests
167
+ - Input: User flow description
168
+ - Output: E2E test results
169
+ - Used by: agent-quality
170
+
171
+ #### 6. **Deployment Skills** (`skills/deployment/`)
172
+
173
+ **`deploy-cloudflare.md`** - Deploy to Cloudflare Pages
174
+ - Input: Build directory
175
+ - Output: Deployment URL, status
176
+ - Used by: agent-ops
177
+
178
+ **`deploy-convex.md`** - Deploy Convex backend
179
+ - Input: Deployment name
180
+ - Output: Deployment status, function list
181
+ - Used by: agent-ops
182
+
183
+ **`create-release.md`** - Create GitHub release
184
+ - Input: Version, changelog
185
+ - Output: Release URL
186
+ - Used by: agent-ops
187
+
188
+ **`sync-repositories.md`** - Sync files to multiple repos
189
+ - Input: File patterns, target repos
190
+ - Output: Sync status for each repo
191
+ - Used by: agent-ops
192
+
193
+ **`check-deployment-health.md`** - Verify deployment is healthy
194
+ - Input: Deployment URL
195
+ - Output: Health check results
196
+ - Used by: agent-ops, agent-quality
197
+
198
+ #### 7. **Documentation Skills** (`skills/documentation/`)
199
+
200
+ **`generate-readme.md`** - Create README from code
201
+ - Input: Project directory
202
+ - Output: Comprehensive README.md
203
+ - Used by: agent-documenter
204
+
205
+ **`update-knowledge.md`** - Update knowledge dimension
206
+ - Input: Feature description, lessons learned
207
+ - Output: Updated knowledge docs
208
+ - Used by: agent-documenter
209
+
210
+ **`generate-api-docs.md`** - Generate API documentation
211
+ - Input: Function/schema definitions
212
+ - Output: API reference docs
213
+ - Used by: agent-documenter
214
+
215
+ **`create-migration-guide.md`** - Create migration documentation
216
+ - Input: Old version, new version, changes
217
+ - Output: Migration guide
218
+ - Used by: agent-documenter
219
+
220
+ #### 8. **Integration Skills** (`skills/integration/`)
221
+
222
+ **`implement-a2a.md`** - Implement Agent-to-Agent protocol
223
+ - Input: Agent definitions, protocol spec
224
+ - Output: A2A implementation
225
+ - Used by: agent-integrator
226
+
227
+ **`implement-acp.md`** - Implement Agent Communication Protocol
228
+ - Input: Communication flow
229
+ - Output: ACP implementation
230
+ - Used by: agent-integrator
231
+
232
+ **`connect-external-system.md`** - Connect external API/service
233
+ - Input: API spec, credentials
234
+ - Output: Integration code
235
+ - Used by: agent-integrator
236
+
237
+ **`verify-integration.md`** - Test integration
238
+ - Input: Integration name
239
+ - Output: Integration test results
240
+ - Used by: agent-quality, agent-integrator
241
+
242
+ #### 9. **Problem Solving Skills** (`skills/problem-solving/`)
243
+
244
+ **`analyze-test-failure.md`** - Deep analysis of failed tests
245
+ - Input: Test failure output
246
+ - Output: Root cause analysis with solutions
247
+ - Used by: agent-problem-solver
248
+
249
+ **`identify-root-cause.md`** - Find root cause of issues
250
+ - Input: Error logs, symptoms
251
+ - Output: Root cause with evidence
252
+ - Used by: agent-problem-solver
253
+
254
+ **`propose-solution.md`** - Generate solution proposals
255
+ - Input: Problem description, constraints
256
+ - Output: Ranked solution options
257
+ - Used by: agent-problem-solver, agent-director
258
+
259
+ **`verify-fix.md`** - Verify problem is resolved
260
+ - Input: Original problem, applied fix
261
+ - Output: Verification results
262
+ - Used by: agent-problem-solver, agent-quality
263
+
264
+ #### 10. **Sales & Business Skills** (`skills/sales/`)
265
+
266
+ **`qualify-lead.md`** - Lead qualification
267
+ - Input: Lead information
268
+ - Output: Qualification score, next steps
269
+ - Used by: agent-sales
270
+
271
+ **`generate-demo-script.md`** - Create demo script
272
+ - Input: Lead profile, use case
273
+ - Output: Customized demo script
274
+ - Used by: agent-sales
275
+
276
+ **`verify-kyc.md`** - KYC verification
277
+ - Input: Organization details
278
+ - Output: KYC status, flags
279
+ - Used by: agent-sales
280
+
281
+ **`track-trial.md`** - Trial management
282
+ - Input: Trial status, usage metrics
283
+ - Output: Trial health report
284
+ - Used by: agent-sales
285
+
286
+ ## Implementation Phases
287
+
288
+ ### Phase 1: Core Skills (Infer 1-20)
289
+
290
+ **Goal:** Implement foundational skills used by all agents
291
+
292
+ **Infer 1-5: Ontology Skills**
293
+ - Create `skills/ontology/` directory structure
294
+ - Implement `validate-schema.md`
295
+ - Implement `check-dimension.md`
296
+ - Test with agent-director and agent-quality
297
+ - Document skill usage patterns
298
+
299
+ **Infer 6-10: Convex Skills**
300
+ - Create `skills/convex/` directory
301
+ - Implement `read-schema.md`
302
+ - Implement `create-mutation.md`
303
+ - Implement `create-query.md`
304
+ - Test with agent-backend
305
+
306
+ **Infer 11-15: Astro Skills**
307
+ - Create `skills/astro/` directory
308
+ - Implement `create-page.md`
309
+ - Implement `create-component.md`
310
+ - Implement `check-build.md`
311
+ - Test with agent-frontend
312
+
313
+ **Infer 16-20: Testing Skills**
314
+ - Create `skills/testing/` directory
315
+ - Implement `generate-tests.md`
316
+ - Implement `run-tests.md`
317
+ - Test with agent-quality
318
+
319
+ ### Phase 2: Specialist Skills (Infer 21-40)
320
+
321
+ **Infer 21-25: Design Skills**
322
+ - Implement all design skills
323
+ - Update agent-designer to use skills
324
+ - Test component generation workflow
325
+
326
+ **Infer 26-30: Deployment Skills**
327
+ - Implement all deployment skills
328
+ - Update agent-ops to use skills
329
+ - Test complete release workflow
330
+
331
+ **Infer 31-35: Documentation Skills**
332
+ - Implement all documentation skills
333
+ - Update agent-documenter to use skills
334
+ - Test knowledge capture workflow
335
+
336
+ **Infer 36-40: Integration Skills**
337
+ - Implement all integration skills
338
+ - Update agent-integrator to use skills
339
+ - Test A2A protocol implementation
340
+
341
+ ### Phase 3: Advanced Skills (Infer 41-60)
342
+
343
+ **Infer 41-45: Problem Solving Skills**
344
+ - Implement all problem-solving skills
345
+ - Update agent-problem-solver to use skills
346
+ - Test root cause analysis workflow
347
+
348
+ **Infer 46-50: Sales & Business Skills**
349
+ - Implement all sales skills
350
+ - Update agent-sales to use skills
351
+ - Test lead qualification workflow
352
+
353
+ **Infer 51-55: Performance Optimization**
354
+ - Create `optimize-performance.md` skill
355
+ - Create `analyze-bundle.md` skill
356
+ - Create `improve-lighthouse.md` skill
357
+
358
+ **Infer 56-60: Security & Compliance**
359
+ - Create `check-security.md` skill
360
+ - Create `verify-auth.md` skill
361
+ - Create `audit-permissions.md` skill
362
+
363
+ ### Phase 4: Agent Migration (Infer 61-80)
364
+
365
+ **Goal:** Update all agents to use skills instead of embedded logic
366
+
367
+ **Infer 61-65: Backend Agents**
368
+ - Migrate agent-backend to use skills
369
+ - Migrate agent-builder (backend parts)
370
+ - Test with real schema changes
371
+
372
+ **Infer 66-70: Frontend Agents**
373
+ - Migrate agent-frontend to use skills
374
+ - Migrate agent-designer to use skills
375
+ - Test with page generation
376
+
377
+ **Infer 71-75: Operations Agents**
378
+ - Migrate agent-ops to use skills
379
+ - Migrate agent-quality to use skills
380
+ - Test with full release cycle
381
+
382
+ **Infer 76-80: Business Agents**
383
+ - Migrate agent-sales to use skills
384
+ - Migrate agent-documenter to use skills
385
+ - Migrate agent-clone to use skills
386
+
387
+ ### Phase 5: Testing & Documentation (Infer 81-95)
388
+
389
+ **Infer 81-85: Skill Testing**
390
+ - Create test suite for each skill
391
+ - Test skill-to-skill invocation
392
+ - Test error handling and edge cases
393
+
394
+ **Infer 86-90: Integration Testing**
395
+ - Test complete agent workflows with skills
396
+ - Test parallel skill execution
397
+ - Test skill caching and performance
398
+
399
+ **Infer 91-95: Documentation**
400
+ - Document all skills with examples
401
+ - Create skill usage guide for agents
402
+ - Create troubleshooting guide
403
+
404
+ ### Phase 6: Deployment & Monitoring (Infer 96-100)
405
+
406
+ **Infer 96-98: Deploy Skills**
407
+ - Deploy all skills to `.claude/skills/`
408
+ - Update all agent files
409
+ - Test in production
410
+
411
+ **Infer 99: Monitor & Optimize**
412
+ - Monitor skill usage patterns
413
+ - Optimize frequently-used skills
414
+ - Collect performance metrics
415
+
416
+ **Infer 100: Mark Complete & Document Lessons**
417
+ - Mark feature complete
418
+ - Document lessons learned in `one/knowledge/`
419
+ - Notify stakeholders
420
+
421
+ ## Skill File Structure
422
+
423
+ Each skill follows this template:
424
+
425
+ ```markdown
426
+ # Skill Name
427
+
428
+ **Category:** [ontology|convex|astro|design|testing|deployment|documentation|integration|problem-solving|sales]
429
+ **Version:** 1.0.0
430
+ **Used By:** [agent-backend, agent-quality, ...]
431
+
432
+ ## Purpose
433
+
434
+ [One sentence: What does this skill do?]
435
+
436
+ ## Inputs
437
+
438
+ - **param1** (type): Description
439
+ - **param2** (type): Description
440
+
441
+ ## Outputs
442
+
443
+ - **result** (type): Description
444
+
445
+ ## Prerequisites
446
+
447
+ - Condition 1
448
+ - Condition 2
449
+
450
+ ## Steps
451
+
452
+ 1. Step 1
453
+ 2. Step 2
454
+ 3. Step 3
455
+
456
+ ## Examples
457
+
458
+ ### Example 1: [Use Case]
459
+
460
+ **Input:**
461
+ ```
462
+ [input data]
463
+ ```
464
+
465
+ **Output:**
466
+ ```
467
+ [output data]
468
+ ```
469
+
470
+ ## Error Handling
471
+
472
+ - **Error 1:** How to handle
473
+ - **Error 2:** How to handle
474
+
475
+ ## Dependencies
476
+
477
+ - Skill: `other-skill.md`
478
+ - Tool: Read, Write, Edit, Bash
479
+
480
+ ## Tests
481
+
482
+ - Test case 1
483
+ - Test case 2
484
+
485
+ ## Lessons Learned
486
+
487
+ - Lesson 1
488
+ - Lesson 2
489
+ ```
490
+
491
+ ## Agent Update Pattern
492
+
493
+ ### Before (Embedded Logic)
494
+
495
+ ```markdown
496
+ ## Steps
497
+
498
+ 1. Read the schema file from backend/convex/schema.ts
499
+ 2. Parse the schema to identify tables
500
+ 3. Validate against 6-dimension ontology
501
+ 4. Generate mutation code
502
+ 5. Write tests
503
+ ```
504
+
505
+ ### After (Skill-Based)
506
+
507
+ ```markdown
508
+ ## Steps
509
+
510
+ 1. USE SKILL: `skills/convex/read-schema.md`
511
+ - Input: schema file path
512
+ - Save result as SCHEMA
513
+
514
+ 2. USE SKILL: `skills/ontology/validate-schema.md`
515
+ - Input: SCHEMA
516
+ - Ensure valid
517
+
518
+ 3. USE SKILL: `skills/convex/create-mutation.md`
519
+ - Input: operation description, SCHEMA
520
+ - Save result as MUTATION_CODE
521
+
522
+ 4. USE SKILL: `skills/testing/generate-tests.md`
523
+ - Input: MUTATION_CODE
524
+ - Save result as TESTS
525
+
526
+ 5. Run tests to verify
527
+ ```
528
+
529
+ ## Benefits
530
+
531
+ ### 1. **Reusability**
532
+ - Write once, use everywhere
533
+ - 40+ skills replacing 1000+ lines of duplicated logic
534
+
535
+ ### 2. **Composability**
536
+ - Skills can invoke other skills
537
+ - Build complex workflows from simple building blocks
538
+
539
+ ### 3. **Testability**
540
+ - Each skill has isolated tests
541
+ - Easy to verify correctness
542
+
543
+ ### 4. **Maintainability**
544
+ - Fix bugs in one place
545
+ - Update skills without touching agents
546
+
547
+ ### 5. **Consistency**
548
+ - All agents use same patterns
549
+ - Guaranteed ontology compliance
550
+
551
+ ### 6. **Performance**
552
+ - Skills can be cached
553
+ - Parallel execution when possible
554
+
555
+ ### 7. **Documentation**
556
+ - Skills are self-documenting
557
+ - Clear inputs/outputs/examples
558
+
559
+ ## Success Metrics
560
+
561
+ ### Quantitative
562
+ - **Code Reduction:** 60% reduction in agent file size
563
+ - **Reuse Rate:** Each skill used by 3+ agents on average
564
+ - **Test Coverage:** 90%+ coverage for all skills
565
+ - **Performance:** 30% faster agent execution (via caching)
566
+
567
+ ### Qualitative
568
+ - Agents easier to understand
569
+ - Faster agent development
570
+ - Fewer bugs in agents
571
+ - Better separation of concerns
572
+
573
+ ## Risks & Mitigations
574
+
575
+ ### Risk 1: Skill Overhead
576
+ **Mitigation:** Cache skill results, measure performance
577
+
578
+ ### Risk 2: Breaking Changes
579
+ **Mitigation:** Version skills, maintain backwards compatibility
580
+
581
+ ### Risk 3: Skill Dependencies
582
+ **Mitigation:** Keep skills independent, use composition
583
+
584
+ ### Risk 4: Learning Curve
585
+ **Mitigation:** Document thoroughly, provide examples
586
+
587
+ ## Next Steps
588
+
589
+ 1. Review this plan with team
590
+ 2. Get approval to proceed
591
+ 3. Start Phase 1 (Infer 1-20)
592
+ 4. Create first 5 ontology skills
593
+ 5. Test with agent-director
594
+
595
+ ## References
596
+
597
+ - [Claude Code Agent Skills Overview](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
598
+ - [ONE Ontology Specification](../knowledge/ontology.md)
599
+ - [Development Workflow](../../one/connections/workflow.md)
600
+ - [Agent Coordination Rules](../../AGENTS.md)
601
+
602
+ ---
603
+
604
+ **Status:** Ready for Implementation
605
+ **Next Inference:** Infer 1 - Create ontology skills directory structure
606
+ **Owner:** agent-director (orchestration) → agent-builder (implementation)