@itz4blitz/agentful 0.2.0 → 0.3.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.
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: agentful-generate
3
+ description: Analyze codebase and generate domain agents + tech skills based on your stack
4
+ ---
5
+
6
+ # /agentful-generate
7
+
8
+ Analyze codebase, detect tech stack, discover business domains, generate domain agents and tech skills.
9
+
10
+ ## Key Concepts
11
+
12
+ **Agents** = Actors that DO work. They have tools, write code, make decisions.
13
+ - Core agents: backend, frontend, tester, reviewer, fixer (already included)
14
+ - Domain agents: books, auth, billing, orders (generated based on your code)
15
+
16
+ **Skills** = Knowledge that agents REFERENCE. Documentation and patterns.
17
+ - Tech skills: react, express, prisma, nextjs (generated based on your stack)
18
+
19
+ ## Workflow
20
+
21
+ ### Step 1: Detect Tech Stack
22
+
23
+ **Read**: package.json, requirements.txt, pyproject.toml, go.mod, Cargo.toml, prisma/schema.prisma
24
+
25
+ **Detect**:
26
+ - Language: TypeScript, JavaScript, Python, Go, Rust
27
+ - Framework: Next.js, React, Vue, Express, NestJS, Django, Flask, FastAPI
28
+ - ORM: Prisma, Drizzle, TypeORM, Mongoose, SQLAlchemy
29
+ - Database: PostgreSQL, MySQL, MongoDB, SQLite
30
+ - Testing: Vitest, Jest, Playwright, pytest
31
+
32
+ ### Step 2: Discover Business Domains
33
+
34
+ **Scan**: src/**/*, API routes, services, models, components
35
+
36
+ **Evidence scoring**:
37
+ - Directory named after domain: +10 (src/auth/, src/billing/)
38
+ - API routes for domain: +15 (api/auth/*, routes/books.ts)
39
+ - Service/controller files: +8 (authService.ts, bookController.ts)
40
+ - Database models: +5 (User, Book, Order)
41
+ - Frontend pages/components: +5 (Books.tsx, AuthorCard.tsx)
42
+
43
+ **Confidence** = score / 50 * 100 (max 100%)
44
+
45
+ **Threshold**: Only generate domain agent if confidence >= 75%
46
+
47
+ ### Step 3: Plan Generation
48
+
49
+ **Show plan to user**:
50
+
51
+ ```
52
+ Tech Stack Detected:
53
+ - TypeScript
54
+ - React 18 + Vite
55
+ - Express 4
56
+ - Prisma + SQLite
57
+
58
+ Domains Discovered:
59
+ - books (95% confidence) ✓ Will generate agent
60
+ - authors (95% confidence) ✓ Will generate agent
61
+ - stats (85% confidence) ✓ Will generate agent
62
+ - payments (40% confidence) ✗ Below threshold
63
+
64
+ Will Generate:
65
+
66
+ Domain Agents (3):
67
+ .claude/agents/books.md
68
+ .claude/agents/authors.md
69
+ .claude/agents/stats.md
70
+
71
+ Tech Skills (4):
72
+ .claude/skills/react/SKILL.md
73
+ .claude/skills/express/SKILL.md
74
+ .claude/skills/prisma/SKILL.md
75
+ .claude/skills/typescript/SKILL.md
76
+
77
+ Proceed? (y/n)
78
+ ```
79
+
80
+ **Wait for confirmation before generating.**
81
+
82
+ ### Step 4: Generate Domain Agents
83
+
84
+ Create `.claude/agents/<domain>.md` for each domain with confidence >= 75%:
85
+
86
+ ```markdown
87
+ ---
88
+ name: <domain>
89
+ description: <Domain> domain - <brief description based on evidence>
90
+ model: sonnet
91
+ tools: Read, Write, Edit, Glob, Grep, Bash
92
+ ---
93
+
94
+ # <Domain> Agent
95
+
96
+ ## Your Scope
97
+ [List responsibilities based on discovered files]
98
+
99
+ ## Domain Structure
100
+ [List actual files discovered - services, controllers, routes, components]
101
+
102
+ ## Implementation Guidelines
103
+ [Patterns specific to this domain, derived from existing code]
104
+
105
+ ## Boundaries
106
+ - Handles: [what this agent owns]
107
+ - Delegates to @backend: [general backend patterns]
108
+ - Delegates to @frontend: [general frontend patterns]
109
+ - Delegates to @tester: [testing]
110
+
111
+ ## Rules
112
+ 1. Stay within domain boundaries
113
+ 2. Follow existing patterns in this domain
114
+ 3. Coordinate with related domains via clear interfaces
115
+ ```
116
+
117
+ ### Step 5: Generate Tech Skills
118
+
119
+ Create `.claude/skills/<tech>/SKILL.md` for each detected technology:
120
+
121
+ ```markdown
122
+ ---
123
+ name: <tech>
124
+ description: <Tech> patterns and best practices for this project
125
+ ---
126
+
127
+ # <Tech> Skill
128
+
129
+ ## Overview
130
+ [Brief intro - what this tech does in this project]
131
+
132
+ ## Project Configuration
133
+ [Detected version, settings from package.json/config files]
134
+
135
+ ## Common Patterns
136
+ [3-5 patterns with code examples from THIS project's style]
137
+
138
+ ## Best Practices
139
+ [Numbered list specific to this project's usage]
140
+
141
+ ## Common Pitfalls
142
+ [What to avoid]
143
+
144
+ ## References
145
+ [Official docs links]
146
+ ```
147
+
148
+ ### Step 6: Create architecture.json
149
+
150
+ Write to `.agentful/architecture.json`:
151
+
152
+ ```json
153
+ {
154
+ "techStack": {
155
+ "languages": ["TypeScript"],
156
+ "frontend": { "framework": "React", "version": "18.x" },
157
+ "backend": { "framework": "Express", "version": "4.x" },
158
+ "database": { "type": "SQLite", "orm": "Prisma" },
159
+ "testing": ["Vitest", "Jest"]
160
+ },
161
+ "domains": [
162
+ { "name": "books", "confidence": 95 },
163
+ { "name": "authors", "confidence": 95 }
164
+ ],
165
+ "generatedAgents": ["books", "authors"],
166
+ "generatedSkills": ["react", "express", "prisma", "typescript"],
167
+ "analyzedAt": "2026-01-20T00:00:00Z"
168
+ }
169
+ ```
170
+
171
+ ### Step 7: Report Results
172
+
173
+ ```
174
+ ✅ Generation Complete
175
+
176
+ Domain Agents (2):
177
+ ✓ .claude/agents/books.md (95%)
178
+ ✓ .claude/agents/authors.md (95%)
179
+
180
+ Tech Skills (4):
181
+ ✓ .claude/skills/react/SKILL.md
182
+ ✓ .claude/skills/express/SKILL.md
183
+ ✓ .claude/skills/prisma/SKILL.md
184
+ ✓ .claude/skills/typescript/SKILL.md
185
+
186
+ Architecture saved to .agentful/architecture.json
187
+
188
+ Usage:
189
+ @books add new field to book model
190
+ @authors implement author search
191
+ @backend (uses express, prisma skills automatically)
192
+ @frontend (uses react skill automatically)
193
+
194
+ Rerun /agentful-generate when codebase structure changes.
195
+ ```
196
+
197
+ ## Rules
198
+
199
+ 1. **Agents are ACTORS** - Only create agents for business domains (books, auth, billing)
200
+ 2. **Skills are KNOWLEDGE** - Create skills for technologies (react, express, prisma)
201
+ 3. **Never create tech agents** - No react.md agent, no express.md agent
202
+ 4. **Domain threshold is 75%** - Don't create agents for low-confidence domains
203
+ 5. **Always show plan first** - Wait for user confirmation before generating
204
+ 6. **Use real code examples** - Sample actual project files for patterns
205
+ 7. **Don't duplicate core agents** - backend, frontend, tester already exist
206
+ 8. **Create architecture.json** - Track what was generated for health checks
@@ -301,6 +301,38 @@ For hierarchical structure examples, check:
301
301
 
302
302
  **No**: The system auto-detects ONE format. Choose the format that best fits your project size and complexity.
303
303
 
304
+ ## Product Analysis File
305
+
306
+ After running `/agentful-product`, a `product-analysis.json` file is generated:
307
+
308
+ ```bash
309
+ .claude/product/
310
+ ├── index.md # Your product spec (template)
311
+ └── product-analysis.json # Generated analysis (created by /agentful-product)
312
+ ```
313
+
314
+ **Key points:**
315
+ - **Not in templates**: This file doesn't exist in the agentful package itself
316
+ - **Generated on demand**: Created when you run `/agentful-product` in your project
317
+ - **Purpose**: Analyzes your product spec for completeness, clarity, feasibility, testability, and consistency
318
+ - **Scores readiness**: 0-100% score with blocking issues and recommendations
319
+ - **Version controlled**: Commit to git to track spec quality improvements over time
320
+
321
+ **Example content:**
322
+ ```json
323
+ {
324
+ "version": "1.0",
325
+ "timestamp": "2026-01-20T00:00:00Z",
326
+ "readiness_score": 75,
327
+ "dimensions": {
328
+ "completeness": { "score": 85 },
329
+ "clarity": { "score": 90 }
330
+ },
331
+ "blocking_issues": [],
332
+ "can_start_development": true
333
+ }
334
+ ```
335
+
304
336
  ## Summary
305
337
 
306
338
  | Format | Best For | Tracking | File Structure |