@itz4blitz/agentful 0.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.
@@ -0,0 +1,312 @@
1
+ # Product Structure Guide
2
+
3
+ Agentful supports **both** flat and hierarchical product structures with automatic detection. This guide explains how to use each format.
4
+
5
+ ## Quick Start
6
+
7
+ ### Simple Projects (Flat Structure)
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`:
19
+
20
+ ```bash
21
+ your-project/
22
+ ├── .claude/
23
+ │ └── product/
24
+ │ └── index.md # All features in one file
25
+ ├── src/
26
+ └── package.json
27
+ ```
28
+
29
+ ### Organized Projects (Hierarchical Structure)
30
+
31
+ Create a hierarchical structure under `.claude/product/domains/`:
32
+
33
+ ```bash
34
+ your-project/
35
+ ├── .claude/
36
+ │ └── product/
37
+ │ ├── index.md # Product overview
38
+ │ └── domains/
39
+ │ ├── authentication/
40
+ │ │ ├── index.md # Domain overview
41
+ │ │ └── features/
42
+ │ │ ├── login.md
43
+ │ │ └── register.md
44
+ │ └── user-management/
45
+ │ ├── index.md
46
+ │ └── features/
47
+ │ └── profile.md
48
+ ├── src/
49
+ └── package.json
50
+ ```
51
+
52
+ ## Auto-Detection
53
+
54
+ The system automatically detects which format you're using:
55
+
56
+ 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)
59
+
60
+ ### Detection Algorithm
61
+
62
+ ```bash
63
+ if exists(".claude/product/domains/*/index.md"):
64
+ → Use hierarchical structure
65
+ → Track at subtask → feature → domain levels
66
+ else if exists("PRODUCT.md"):
67
+ → Use flat structure (legacy)
68
+ → Track at feature level
69
+ else if exists(".claude/product/index.md"):
70
+ → Use flat structure (new)
71
+ → Track at feature level
72
+ else:
73
+ → Error: No product specification found
74
+ ```
75
+
76
+ ## When to Use Each Format
77
+
78
+ ### Flat Structure
79
+
80
+ **Use when:**
81
+ - Quick prototype or MVP
82
+ - Small project with 5-10 features
83
+ - Single developer or small team
84
+ - Simple feature list without dependencies
85
+
86
+ **Example `PRODUCT.md`:**
87
+
88
+ ```markdown
89
+ # My App
90
+
91
+ ## Features
92
+
93
+ ### 1. User Authentication - CRITICAL
94
+ - Login with email/password
95
+ - JWT token handling
96
+ - Password reset
97
+
98
+ ### 2. User Profile - HIGH
99
+ - Edit profile information
100
+ - Upload avatar
101
+
102
+ ### 3. Dashboard - MEDIUM
103
+ - Display user stats
104
+ - Recent activity
105
+ ```
106
+
107
+ ### Hierarchical Structure
108
+
109
+ **Use when:**
110
+ - Large project with 20+ features
111
+ - Multiple team members working in parallel
112
+ - Complex feature dependencies
113
+ - Need domain-driven organization
114
+
115
+ **Example structure:**
116
+
117
+ ```markdown
118
+ <!-- .claude/product/index.md -->
119
+ # My App
120
+
121
+ ## Domains
122
+ - Authentication (CRITICAL)
123
+ - User Management (HIGH)
124
+ - Dashboard (MEDIUM)
125
+
126
+ <!-- .claude/product/domains/authentication/index.md -->
127
+ # Authentication Domain
128
+
129
+ Handles user identity and access control.
130
+
131
+ ## Features
132
+ - Login
133
+ - Register
134
+ - Password Reset
135
+
136
+ <!-- .claude/product/domains/authentication/features/login.md -->
137
+ # Feature: Login
138
+
139
+ Priority: CRITICAL
140
+
141
+ ## Subtasks
142
+ 1. Create login UI
143
+ 2. Implement login API
144
+ 3. Add JWT handling
145
+ 4. Write tests
146
+ ```
147
+
148
+ ## Completion Tracking
149
+
150
+ ### Flat Structure Tracking
151
+
152
+ ```json
153
+ {
154
+ "features": {
155
+ "authentication": {
156
+ "status": "complete",
157
+ "score": 100
158
+ },
159
+ "user-profile": {
160
+ "status": "in_progress",
161
+ "score": 60
162
+ }
163
+ },
164
+ "gates": {
165
+ "tests_passing": true,
166
+ "no_type_errors": true
167
+ },
168
+ "overall": 72
169
+ }
170
+ ```
171
+
172
+ ### Hierarchical Structure Tracking
173
+
174
+ ```json
175
+ {
176
+ "domains": {
177
+ "authentication": {
178
+ "status": "complete",
179
+ "score": 100,
180
+ "features": {
181
+ "login": {
182
+ "status": "complete",
183
+ "score": 100,
184
+ "subtasks": {
185
+ "login-ui": { "status": "complete" },
186
+ "login-api": { "status": "complete" }
187
+ }
188
+ }
189
+ }
190
+ },
191
+ "user-management": {
192
+ "status": "in_progress",
193
+ "score": 60,
194
+ "features": {
195
+ "profile": {
196
+ "status": "in_progress",
197
+ "score": 60
198
+ }
199
+ }
200
+ }
201
+ },
202
+ "gates": {
203
+ "tests_passing": true,
204
+ "no_type_errors": true
205
+ },
206
+ "overall": 72
207
+ }
208
+ ```
209
+
210
+ ## Migration Path
211
+
212
+ You can start flat and migrate to hierarchical as your project grows:
213
+
214
+ ```
215
+ 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)
220
+
221
+ Phase 3: Scale Up (when needed)
222
+ └── .claude/product/domains/ (split by domain)
223
+ ├── authentication/
224
+ ├── user-management/
225
+ └── dashboard/
226
+ ```
227
+
228
+ ### How to Migrate
229
+
230
+ 1. **Create domain directories:**
231
+ ```bash
232
+ mkdir -p .claude/product/domains/authentication/features
233
+ mkdir -p .claude/product/domains/user-management/features
234
+ ```
235
+
236
+ 2. **Split features into domain files:**
237
+ ```bash
238
+ # Move authentication features
239
+ # .claude/product/domains/authentication/features/login.md
240
+ # .claude/product/domains/authentication/features/register.md
241
+ ```
242
+
243
+ 3. **Create domain index files:**
244
+ ```bash
245
+ # .claude/product/domains/authentication/index.md
246
+ # List overview, goals, and feature summaries
247
+ ```
248
+
249
+ 4. **Update .claude/product/index.md:**
250
+ ```bash
251
+ # Keep only product overview and domain list
252
+ # Remove detailed feature specs (now in domain files)
253
+ ```
254
+
255
+ 5. **System auto-detects the change:**
256
+ - Next agent run will detect hierarchical structure
257
+ - No configuration changes needed
258
+
259
+ ## Best Practices
260
+
261
+ ### Flat Structure
262
+
263
+ 1. **Keep features focused**: Each feature should be independently testable
264
+ 2. **Use priorities**: CRITICAL, HIGH, MEDIUM, LOW
265
+ 3. **Clear acceptance criteria**: Specific requirements for each feature
266
+ 4. **Track progress**: Update completion.json after validated work
267
+
268
+ ### Hierarchical Structure
269
+
270
+ 1. **Domain boundaries**: Group related features (e.g., authentication, billing)
271
+ 2. **Feature independence**: Each feature should be completable independently
272
+ 3. **Subtask granularity**: Break features into small, testable subtasks
273
+ 4. **Cross-domain dependencies**: Document in feature files, minimize where possible
274
+
275
+ ## Examples
276
+
277
+ See `.claude/product/index.md` template for a complete flat structure example.
278
+
279
+ For hierarchical structure examples, check:
280
+ - `.claude/agents/orchestrator.md` - Product structure reading algorithm
281
+ - `.claude/skills/product-tracking/SKILL.md` - Progress tracking for both formats
282
+
283
+ ## Troubleshooting
284
+
285
+ ### "No product specification found"
286
+
287
+ **Solution**: Create one of:
288
+ - `PRODUCT.md` at root
289
+ - `.claude/product/index.md`
290
+ - `.claude/product/domains/*/index.md`
291
+
292
+ ### "Format mismatch" error
293
+
294
+ **Cause**: completion.json structure doesn't match product files
295
+
296
+ **Solution**: Don't mix formats. Choose one:
297
+ - All flat: `PRODUCT.md` + `completion.json` with `features` object
298
+ - All hierarchical: `.claude/product/domains/` + `completion.json` with `domains` object
299
+
300
+ ### Can I use both formats?
301
+
302
+ **No**: The system auto-detects ONE format. Choose the format that best fits your project size and complexity.
303
+
304
+ ## Summary
305
+
306
+ | Format | Best For | Tracking | File Structure |
307
+ |--------|----------|----------|----------------|
308
+ | Flat (PRODUCT.md) | Small projects, MVPs | Feature level | Single file |
309
+ | Flat (.claude/product/index.md) | Small projects, organized | Feature level | Single file in .claude |
310
+ | Hierarchical | Large projects, teams | Subtask/feature/domain level | Multiple files, domain folders |
311
+
312
+ Choose the format that matches your project needs. The system will auto-detect and adapt!
@@ -0,0 +1,152 @@
1
+ # Product Specification
2
+
3
+ > **Note**: This template supports **both** flat and hierarchical product structures. The system will auto-detect which format you're using:
4
+ > - **Flat (this file)**: Add all features here for simple projects
5
+ > - **Hierarchical**: Create `.claude/product/domains/*/` directories for organized projects
6
+ >
7
+ > See `.claude/agents/orchestrator.md` for details on product structure detection.
8
+
9
+ ## Overview
10
+
11
+ [Describe what you're building in 2-3 sentences]
12
+
13
+ Example:
14
+ > A task management application that helps teams collaborate on projects. Users can create projects, add tasks with deadlines, assign team members, and track progress with real-time updates.
15
+
16
+ ## Goals
17
+
18
+ - [ ] [Primary goal 1]
19
+ - [ ] [Primary goal 2]
20
+ - [ ] [Primary goal 3]
21
+
22
+ ## Tech Stack
23
+
24
+ ### Frontend
25
+ - **Framework**: [Next.js 14 / React + Vite / Vue + Nuxt / SvelteKit]
26
+ - **Language**: [TypeScript / JavaScript]
27
+ - **Styling**: [Tailwind CSS / CSS Modules / styled-components / shadcn/ui]
28
+ - **State Management**: [Zustand / Context API / Redux / Jotai]
29
+
30
+ ### Backend
31
+ - **Runtime**: [Node.js / Bun / Deno]
32
+ - **Framework**: [Next.js API Routes / Express / Fastify / NestJS / Hono]
33
+ - **Language**: [TypeScript / JavaScript]
34
+
35
+ ### Database
36
+ - **Database**: [PostgreSQL / MySQL / SQLite / MongoDB / PlanetScale]
37
+ - **ORM**: [Prisma / Drizzle / TypeORM / Mongoose]
38
+
39
+ ### Authentication
40
+ - **Method**: [JWT / NextAuth / Clerk / Auth0 / Lucia]
41
+
42
+ ### Testing
43
+ - **Unit**: [Vitest / Jest]
44
+ - **E2E**: [Playwright / Cypress]
45
+
46
+ ### Deployment
47
+ - **Hosting**: [Vercel / Netlify / Railway / Fly.io]
48
+
49
+ ## Features (Priority Order)
50
+
51
+ ### 1. [Feature Name] - CRITICAL
52
+ **Description**: [What this feature does]
53
+
54
+ **Acceptance Criteria**:
55
+ - [ ] [Specific requirement 1]
56
+ - [ ] [Specific requirement 2]
57
+ - [ ] [Specific requirement 3]
58
+
59
+ **User Stories**:
60
+ - As a [user type], I want [feature] so that [benefit]
61
+
62
+ **Technical Notes**:
63
+ - [Any technical details or constraints]
64
+
65
+ ---
66
+
67
+ ### 2. [Feature Name] - HIGH
68
+ **Description**: [What this feature does]
69
+
70
+ **Acceptance Criteria**:
71
+ - [ ] [Specific requirement 1]
72
+ - [ ] [Specific requirement 2]
73
+
74
+ ---
75
+
76
+ ### 3. [Feature Name] - MEDIUM
77
+ **Description**: [What this feature does]
78
+
79
+ **Acceptance Criteria**:
80
+ - [ ] [Specific requirement 1]
81
+ - [ ] [Specific requirement 2]
82
+
83
+ ---
84
+
85
+ ### 4. [Feature Name] - LOW
86
+ **Description**: [What this feature does]
87
+
88
+ **Acceptance Criteria**:
89
+ - [ ] [Specific requirement 1]
90
+
91
+ ---
92
+
93
+ ## Architecture Notes
94
+
95
+ ### Folder Structure (Optional)
96
+
97
+ If you have a preferred structure:
98
+
99
+ ```
100
+ src/
101
+ ├── app/ # Next.js app router
102
+ ├── components/ # React components
103
+ ├── lib/ # Utilities
104
+ ├── hooks/ # Custom hooks
105
+ └── styles/ # Global styles
106
+ ```
107
+
108
+ ### Design Patterns
109
+
110
+ - [Any specific patterns to use]
111
+ - [Any patterns to avoid]
112
+
113
+ ### Constraints
114
+
115
+ - [Performance requirements]
116
+ - [Accessibility requirements]
117
+ - [Browser support requirements]
118
+
119
+ ## Third-Party Integrations (Optional)
120
+
121
+ - [API 1]: [Purpose]
122
+ - [API 2]: [Purpose]
123
+
124
+ ## Out of Scope (for MVP)
125
+
126
+ List what you're explicitly NOT building:
127
+
128
+ - [Feature X] - Will add in v2
129
+ - [Feature Y] - Out of scope
130
+ - [Feature Z] - Not needed
131
+
132
+ ## Success Criteria
133
+
134
+ The product is complete when:
135
+
136
+ 1. [All critical features implemented and tested]
137
+ 2. [All tests passing with 80%+ coverage]
138
+ 3. [No TypeScript errors]
139
+ 4. [No security vulnerabilities]
140
+ 5. [Deployed to production]
141
+
142
+ ## Notes
143
+
144
+ [Any additional context, links, or documentation]
145
+
146
+ ---
147
+
148
+ **Tip**: The more detailed your product specification, the better Agentful can understand what to build. Include:
149
+ - Clear acceptance criteria
150
+ - User stories for context
151
+ - Technical constraints
152
+ - Examples when helpful
@@ -0,0 +1,63 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Write|Edit",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "if [ \"$FILE\"\" = \"*.md\" ] && grep -q 'Deployment Guide\\|Publishing Guide\\|Setup Guide' \"$FILE\" 2>/dev/null; then echo \"WARNING: Similar documentation may exist. Check for: docs/pages/deployment.mdx, PUBLISHING.md\"; fi"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PostToolUse": [
15
+ {
16
+ "matcher": "Write|Edit",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "npx tsc --noEmit 2>&1 | head -5 || true"
21
+ }
22
+ ]
23
+ },
24
+ {
25
+ "matcher": "Write|Edit",
26
+ "hooks": [
27
+ {
28
+ "type": "command",
29
+ "command": "if [ \"$FILE\"\" = \"*.md\" ]; then existing=$(find . -name '*.md' -not -path './node_modules/*' -not -path './.git/*' | xargs grep -l \"$(basename '$FILE' | sed 's/_/ /g' | sed 's/.md$//' | head -c 30)\" 2>/dev/null | grep -v \"$FILE\" | head -1); if [ -n \"$existing\"\" ]; then echo \"⚠️ Similar doc exists: $existing - consider updating instead\"; fi; fi || true"
30
+ }
31
+ ]
32
+ }
33
+ ],
34
+ "UserPromptSubmit": [
35
+ {
36
+ "hooks": [
37
+ {
38
+ "type": "command",
39
+ "command": "if [ -f .agentful/state.json ]; then jq -r '.current_phase // \"idle\"' .agentful/state.json 2>/dev/null || echo 'idle'; else echo 'idle'; fi"
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ },
45
+ "permissions": {
46
+ "allow": [
47
+ "Bash(npm:*)",
48
+ "Bash(npx:*)",
49
+ "Bash(node:*)",
50
+ "Bash(git:*)",
51
+ "Bash(cat:*)",
52
+ "Bash(echo:*)",
53
+ "Bash(jq:*)"
54
+ ],
55
+ "deny": [
56
+ "Bash(rm -rf /)",
57
+ "Bash(rm -rf ~/.*)",
58
+ "Bash(rm -rf /.*)",
59
+ "Bash(dd:*)",
60
+ "Bash(mkfs:*)"
61
+ ]
62
+ }
63
+ }