@itz4blitz/agentful 0.2.1 → 0.4.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.
@@ -36,7 +36,6 @@ First, detect which product structure format is being used:
36
36
  domains_found = Glob(".claude/product/domains/*/index.md")
37
37
 
38
38
  # Step 2: Check for flat structure
39
- product_md_exists = exists("PRODUCT.md")
40
39
  product_index_exists = exists(".claude/product/index.md")
41
40
 
42
41
  if domains_found:
@@ -50,11 +49,6 @@ if domains_found:
50
49
  for feature_file in Glob(".claude/product/domains/{domain}/features/*.md"):
51
50
  Read(feature_file)
52
51
 
53
- elif product_md_exists:
54
- format = "flat"
55
- product_root = "."
56
- Read("PRODUCT.md")
57
-
58
52
  elif product_index_exists:
59
53
  format = "flat"
60
54
  product_root = ".claude/product"
@@ -325,7 +319,7 @@ if structure == "hierarchical":
325
319
  domain.features.append(feature)
326
320
  domains.append(domain)
327
321
  else:
328
- product_spec = Read("PRODUCT.md" OR ".claude/product/index.md")
322
+ product_spec = Read(".claude/product/index.md")
329
323
  ```
330
324
 
331
325
  ### Step 2: Analyze Each Dimension
@@ -735,9 +729,8 @@ Analysis saved to: .claude/product/product-analysis.json
735
729
  "recommendation": {
736
730
  "action": "Create product specification",
737
731
  "options": [
738
- "Use PRODUCT.md for simple projects",
739
- "Use .claude/product/index.md for organized flat structure",
740
- "Use .claude/product/domains/* for complex projects"
732
+ "Use .claude/product/index.md for simple flat structure",
733
+ "Use .claude/product/domains/* for complex projects with hierarchical organization"
741
734
  ]
742
735
  }
743
736
  }
@@ -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
@@ -28,7 +28,7 @@ if user_text:
28
28
  goto DISCUSSION_MODE
29
29
 
30
30
  # Step 2: Check if product spec exists
31
- product_spec_exists = exists(".claude/product/index.md") OR exists("PRODUCT.md")
31
+ product_spec_exists = exists(".claude/product/index.md")
32
32
 
33
33
  if !product_spec_exists:
34
34
  has_substantial_codebase = check_codebase_exists()
@@ -169,7 +169,7 @@ Task("product-analyzer", "Analyze .claude/product/index.md and generate product-
169
169
 
170
170
  The product analyzer should:
171
171
 
172
- 1. **Read product specification**: `.claude/product/index.md` or `PRODUCT.md`
172
+ 1. **Read product specification**: `.claude/product/index.md`
173
173
 
174
174
  2. **Analyze for completeness and clarity**:
175
175
  - Tech stack: All stack choices specified (not placeholders)
@@ -425,7 +425,7 @@ Task("product-analyzer", "Analyze .claude/product/index.md and generate product-
425
425
 
426
426
  ## File Locations
427
427
 
428
- - **Product spec**: `.claude/product/index.md` (or `PRODUCT.md` for legacy)
428
+ - **Product spec**: `.claude/product/index.md`
429
429
  - **Analysis results**: `.claude/product/product-analysis.json`
430
430
  - **Domain structure**: `.claude/product/domains/*/index.md` (optional hierarchical)
431
431
 
@@ -268,18 +268,7 @@ This is optional but recommended for complex projects. Run `/agentful-product` t
268
268
 
269
269
  Create a product specification (choose one):
270
270
 
271
- **Flat structure** (simple projects):
272
- ```markdown
273
- # PRODUCT.md
274
-
275
- ## Features
276
-
277
- - [CRITICAL] User authentication (login, register, password reset)
278
- - [HIGH] User profiles (edit, avatar, preferences)
279
- - [MEDIUM] Dashboard (analytics, activity feed)
280
- ```
281
-
282
- **Hierarchical structure** (complex projects):
271
+ **Hierarchical structure** (recommended):
283
272
  ```
284
273
  .claude/product/
285
274
  ├── index.md # Product overview
@@ -4,7 +4,7 @@ This file shows concrete examples of both flat and hierarchical product structur
4
4
 
5
5
  ## Example 1: Flat Structure (Simple Project)
6
6
 
7
- ### File: PRODUCT.md
7
+ ### File: .claude/product/index.md
8
8
 
9
9
  ```markdown
10
10
  # TaskFlow - Task Management App
@@ -600,7 +600,7 @@ POST /api/auth/login
600
600
 
601
601
  | Aspect | Flat Structure | Hierarchical Structure |
602
602
  |--------|---------------|----------------------|
603
- | **Files** | 1 file (PRODUCT.md) | 10+ files (domains/features) |
603
+ | **Files** | 1 file (.claude/product/index.md) | 10+ files (domains/features) |
604
604
  | **Organization** | Feature list | Domains → Features → Subtasks |
605
605
  | **Tracking** | Feature-level (6 items) | Subtask-level (20+ items) |
606
606
  | **Scalability** | Good for < 20 features | Good for 20+ features |
@@ -6,16 +6,7 @@ agentful supports **both** flat and hierarchical product structures with automat
6
6
 
7
7
  ### Simple Projects (Flat Structure)
8
8
 
9
- Just create a single `PRODUCT.md` file at your project root:
10
-
11
- ```bash
12
- your-project/
13
- ├── PRODUCT.md # All features in one file
14
- ├── src/
15
- └── package.json
16
- ```
17
-
18
- Or use `.claude/product/index.md`:
9
+ Create `.claude/product/index.md` with all your features:
19
10
 
20
11
  ```bash
21
12
  your-project/
@@ -54,8 +45,7 @@ your-project/
54
45
  The system automatically detects which format you're using:
55
46
 
56
47
  1. **Hierarchical**: If `.claude/product/domains/*/index.md` exists
57
- 2. **Flat (legacy)**: If `PRODUCT.md` exists at root
58
- 3. **Flat (new)**: If `.claude/product/index.md` exists (without domains)
48
+ 2. **Flat**: If `.claude/product/index.md` exists (without domains)
59
49
 
60
50
  ### Detection Algorithm
61
51
 
@@ -63,11 +53,8 @@ The system automatically detects which format you're using:
63
53
  if exists(".claude/product/domains/*/index.md"):
64
54
  → Use hierarchical structure
65
55
  → Track at subtask → feature → domain levels
66
- else if exists("PRODUCT.md"):
67
- → Use flat structure (legacy)
68
- → Track at feature level
69
56
  else if exists(".claude/product/index.md"):
70
- → Use flat structure (new)
57
+ → Use flat structure
71
58
  → Track at feature level
72
59
  else:
73
60
  → Error: No product specification found
@@ -83,7 +70,7 @@ else:
83
70
  - Single developer or small team
84
71
  - Simple feature list without dependencies
85
72
 
86
- **Example `PRODUCT.md`:**
73
+ **Example `.claude/product/index.md`:**
87
74
 
88
75
  ```markdown
89
76
  # My App
@@ -209,16 +196,13 @@ Priority: CRITICAL
209
196
 
210
197
  ## Migration Path
211
198
 
212
- You can start flat and migrate to hierarchical as your project grows:
199
+ You can start flat and expand to hierarchical as your project grows:
213
200
 
214
201
  ```
215
202
  Phase 1: Quick Start
216
- └── PRODUCT.md (all features in one file)
217
-
218
- Phase 2: Organize (optional)
219
- └── .claude/product/index.md (move to .claude directory)
203
+ └── .claude/product/index.md (all features in one file)
220
204
 
221
- Phase 3: Scale Up (when needed)
205
+ Phase 2: Scale Up (when needed)
222
206
  └── .claude/product/domains/ (split by domain)
223
207
  ├── authentication/
224
208
  ├── user-management/
@@ -285,7 +269,6 @@ For hierarchical structure examples, check:
285
269
  ### "No product specification found"
286
270
 
287
271
  **Solution**: Create one of:
288
- - `PRODUCT.md` at root
289
272
  - `.claude/product/index.md`
290
273
  - `.claude/product/domains/*/index.md`
291
274
 
@@ -294,7 +277,7 @@ For hierarchical structure examples, check:
294
277
  **Cause**: completion.json structure doesn't match product files
295
278
 
296
279
  **Solution**: Don't mix formats. Choose one:
297
- - All flat: `PRODUCT.md` + `completion.json` with `features` object
280
+ - All flat: `.claude/product/index.md` + `completion.json` with `features` object
298
281
  - All hierarchical: `.claude/product/domains/` + `completion.json` with `domains` object
299
282
 
300
283
  ### Can I use both formats?
@@ -337,8 +320,7 @@ After running `/agentful-product`, a `product-analysis.json` file is generated:
337
320
 
338
321
  | Format | Best For | Tracking | File Structure |
339
322
  |--------|----------|----------|----------------|
340
- | Flat (PRODUCT.md) | Small projects, MVPs | Feature level | Single file |
341
- | Flat (.claude/product/index.md) | Small projects, organized | Feature level | Single file in .claude |
323
+ | Flat (.claude/product/index.md) | Small projects, MVPs | Feature level | Single file |
342
324
  | Hierarchical | Large projects, teams | Subtask/feature/domain level | Multiple files, domain folders |
343
325
 
344
326
  Choose the format that matches your project needs. The system will auto-detect and adapt!