@itz4blitz/agentful 0.4.0 → 1.0.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 (93) hide show
  1. package/README.md +131 -16
  2. package/bin/cli.js +1031 -47
  3. package/bin/hooks/README.md +338 -82
  4. package/bin/hooks/analyze-trigger.js +69 -0
  5. package/bin/hooks/block-random-docs.js +77 -0
  6. package/bin/hooks/health-check.js +153 -0
  7. package/bin/hooks/post-agent.js +101 -0
  8. package/bin/hooks/post-feature.js +227 -0
  9. package/bin/hooks/pre-agent.js +118 -0
  10. package/bin/hooks/pre-feature.js +138 -0
  11. package/lib/VALIDATION_README.md +455 -0
  12. package/lib/atomic.js +350 -0
  13. package/lib/ci/claude-action-integration.js +641 -0
  14. package/lib/ci/index.js +10 -0
  15. package/lib/core/CLAUDE_EXECUTOR.md +371 -0
  16. package/lib/core/README.md +321 -0
  17. package/lib/core/analyzer.js +497 -0
  18. package/lib/core/claude-executor.example.js +210 -0
  19. package/lib/core/claude-executor.js +1046 -0
  20. package/lib/core/cli.js +141 -0
  21. package/lib/core/detectors/conventions.js +342 -0
  22. package/lib/core/detectors/framework.js +276 -0
  23. package/lib/core/detectors/index.js +15 -0
  24. package/lib/core/detectors/language.js +199 -0
  25. package/lib/core/detectors/patterns.js +356 -0
  26. package/lib/core/generator.js +626 -0
  27. package/lib/core/index.js +9 -0
  28. package/lib/core/output-parser.example.js +250 -0
  29. package/lib/core/output-parser.js +458 -0
  30. package/lib/core/storage.js +515 -0
  31. package/lib/core/templates.js +556 -0
  32. package/lib/index.js +32 -0
  33. package/lib/init.js +252 -21
  34. package/lib/pipeline/cli.js +423 -0
  35. package/lib/pipeline/engine.js +928 -0
  36. package/lib/pipeline/executor.js +440 -0
  37. package/lib/pipeline/index.js +33 -0
  38. package/lib/pipeline/integrations.js +559 -0
  39. package/lib/pipeline/schemas.js +288 -0
  40. package/lib/presets.js +207 -0
  41. package/lib/remote/client.js +361 -0
  42. package/lib/server/auth.js +286 -0
  43. package/lib/server/client-example.js +190 -0
  44. package/lib/server/executor.js +426 -0
  45. package/lib/server/index.js +469 -0
  46. package/lib/update-helpers.js +505 -0
  47. package/lib/validation.js +460 -0
  48. package/package.json +19 -2
  49. package/template/.claude/agents/architect.md +260 -0
  50. package/template/.claude/agents/backend.md +203 -0
  51. package/template/.claude/agents/fixer.md +244 -0
  52. package/template/.claude/agents/frontend.md +232 -0
  53. package/template/.claude/agents/orchestrator.md +528 -0
  54. package/template/.claude/agents/product-analyzer.md +1130 -0
  55. package/template/.claude/agents/reviewer.md +229 -0
  56. package/template/.claude/agents/tester.md +242 -0
  57. package/{.claude → template/.claude}/commands/agentful-analyze.md +151 -43
  58. package/template/.claude/commands/agentful-decide.md +470 -0
  59. package/{.claude → template/.claude}/commands/agentful-product.md +89 -5
  60. package/template/.claude/commands/agentful-start.md +432 -0
  61. package/{.claude → template/.claude}/commands/agentful-status.md +88 -3
  62. package/template/.claude/commands/agentful-update.md +402 -0
  63. package/template/.claude/commands/agentful-validate.md +369 -0
  64. package/{.claude → template/.claude}/commands/agentful.md +110 -183
  65. package/template/.claude/product/EXAMPLES.md +167 -0
  66. package/{.claude → template/.claude}/settings.json +9 -13
  67. package/{.claude → template/.claude}/skills/conversation/SKILL.md +13 -7
  68. package/template/.claude/skills/deployment/SKILL.md +116 -0
  69. package/template/.claude/skills/product-planning/SKILL.md +463 -0
  70. package/template/.claude/skills/testing/SKILL.md +228 -0
  71. package/template/.claude/skills/validation/SKILL.md +650 -0
  72. package/template/CLAUDE.md +73 -5
  73. package/template/bin/hooks/block-random-docs.js +121 -0
  74. package/version.json +1 -1
  75. package/.claude/agents/architect.md +0 -524
  76. package/.claude/agents/backend.md +0 -315
  77. package/.claude/agents/fixer.md +0 -263
  78. package/.claude/agents/frontend.md +0 -274
  79. package/.claude/agents/orchestrator.md +0 -283
  80. package/.claude/agents/product-analyzer.md +0 -792
  81. package/.claude/agents/reviewer.md +0 -332
  82. package/.claude/agents/tester.md +0 -410
  83. package/.claude/commands/agentful-decide.md +0 -214
  84. package/.claude/commands/agentful-start.md +0 -182
  85. package/.claude/commands/agentful-validate.md +0 -127
  86. package/.claude/product/EXAMPLES.md +0 -610
  87. package/.claude/product/README.md +0 -326
  88. package/.claude/skills/validation/SKILL.md +0 -271
  89. package/bin/hooks/analyze-trigger.sh +0 -57
  90. package/bin/hooks/health-check.sh +0 -36
  91. /package/{.claude → template/.claude}/commands/agentful-generate.md +0 -0
  92. /package/{.claude → template/.claude}/product/index.md +0 -0
  93. /package/{.claude → template/.claude}/skills/product-tracking/SKILL.md +0 -0
@@ -0,0 +1,167 @@
1
+ # Product Structure Examples
2
+
3
+ agentful supports two product specification formats.
4
+
5
+ ## Flat Structure (Simple Projects)
6
+
7
+ **Best for**: Small projects with < 20 features
8
+
9
+ **Structure**:
10
+ ```
11
+ .claude/product/
12
+ └── index.md # All features in one file
13
+ ```
14
+
15
+ **Example** (.claude/product/index.md):
16
+ ```markdown
17
+ # TaskFlow - Task Management App
18
+
19
+ ## Tech Stack
20
+
21
+ - **Frontend**: Next.js 14, TypeScript, Tailwind
22
+ - **Backend**: Node.js, Prisma, PostgreSQL
23
+ - **Testing**: Vitest, Playwright
24
+
25
+ ## Features
26
+
27
+ ### 1. User Authentication - CRITICAL
28
+ **Description**: User registration, login, JWT tokens
29
+
30
+ **Acceptance Criteria**:
31
+ - [ ] User can register with email/password
32
+ - [ ] User can login and receive JWT token
33
+ - [ ] Protected routes require valid token
34
+
35
+ ---
36
+
37
+ ### 2. Task Management - CRITICAL
38
+ **Description**: Create, read, update, delete tasks
39
+
40
+ **Acceptance Criteria**:
41
+ - [ ] User can create task with title, description, due date
42
+ - [ ] User can edit and delete tasks
43
+ - [ ] Tasks paginated (20 per page)
44
+
45
+ ---
46
+
47
+ ### 3. Project Organization - HIGH
48
+ **Description**: Group tasks into projects
49
+
50
+ **Acceptance Criteria**:
51
+ - [ ] User can create projects
52
+ - [ ] User can assign tasks to projects
53
+ ```
54
+
55
+ **Tracking** (.agentful/completion.json):
56
+ ```json
57
+ {
58
+ "features": {
59
+ "user-authentication": { "status": "complete", "score": 100 },
60
+ "task-management": { "status": "in_progress", "score": 60 },
61
+ "project-organization": { "status": "pending", "score": 0 }
62
+ },
63
+ "overall": 53
64
+ }
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Hierarchical Structure (Complex Projects)
70
+
71
+ **Best for**: Large projects with 20+ features, team collaboration
72
+
73
+ **Structure**:
74
+ ```
75
+ .claude/product/
76
+ ├── index.md # Product overview
77
+ └── domains/
78
+ ├── authentication/
79
+ │ ├── index.md # Domain overview
80
+ │ └── features/
81
+ │ ├── registration.md
82
+ │ ├── login.md
83
+ │ └── password-reset.md
84
+ ├── task-management/
85
+ │ ├── index.md
86
+ │ └── features/
87
+ │ ├── task-crud.md
88
+ │ └── task-search.md
89
+ └── dashboard/
90
+ ├── index.md
91
+ └── features/
92
+ └── analytics.md
93
+ ```
94
+
95
+ **Example** (.claude/product/index.md):
96
+ ```markdown
97
+ # TaskFlow - Task Management App
98
+
99
+ ## Tech Stack
100
+
101
+ - **Frontend**: Next.js 14, TypeScript, Tailwind
102
+ - **Backend**: Node.js, Prisma, PostgreSQL
103
+
104
+ ## Domains
105
+
106
+ | Domain | Priority | Description |
107
+ |--------|----------|-------------|
108
+ | Authentication | CRITICAL | User identity and access |
109
+ | Task Management | CRITICAL | Core task CRUD |
110
+ | Dashboard | MEDIUM | Analytics and insights |
111
+ ```
112
+
113
+ **Example** (.claude/product/domains/authentication/features/login.md):
114
+ ```markdown
115
+ # Feature: User Login
116
+
117
+ ## Priority
118
+ CRITICAL
119
+
120
+ ## Description
121
+ Authenticate users with email/password and issue JWT tokens.
122
+
123
+ ## Acceptance Criteria
124
+ - [ ] POST /api/auth/login endpoint
125
+ - [ ] Returns JWT on success
126
+ - [ ] Rate limit: 5 attempts per 15min
127
+ - [ ] HTTP-only refresh token cookie
128
+
129
+ ## User Stories
130
+ - As a user, I want to login so that I can access my account
131
+ ```
132
+
133
+ **Tracking** (.agentful/completion.json):
134
+ ```json
135
+ {
136
+ "domains": {
137
+ "authentication": {
138
+ "status": "in_progress",
139
+ "score": 50,
140
+ "features": {
141
+ "registration": { "status": "complete", "score": 100 },
142
+ "login": { "status": "in_progress", "score": 50 },
143
+ "password-reset": { "status": "pending", "score": 0 }
144
+ }
145
+ },
146
+ "task-management": {
147
+ "status": "pending",
148
+ "score": 0
149
+ }
150
+ },
151
+ "overall": 25
152
+ }
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Comparison
158
+
159
+ | Aspect | Flat | Hierarchical |
160
+ |--------|------|--------------|
161
+ | **Files** | 1 file | 10+ files |
162
+ | **Organization** | Feature list | Domains → Features |
163
+ | **Best for** | < 20 features | 20+ features |
164
+ | **Team collab** | Harder (merge conflicts) | Easier (separate files) |
165
+ | **Visibility** | Feature-level | Subtask-level |
166
+
167
+ Choose based on your project size and team needs!
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "includeCoAuthoredBy": false,
3
+ "env": {
4
+ "ENABLE_TOOL_SEARCH": "true"
5
+ },
3
6
  "hooks": {
4
7
  "SessionStart": [
5
8
  {
6
9
  "hooks": [
7
10
  {
8
11
  "type": "command",
9
- "command": "bash bin/hooks/health-check.sh",
12
+ "command": "node bin/hooks/health-check.js",
10
13
  "timeout": 5,
11
14
  "description": "Quick agentful health check"
12
15
  }
@@ -15,11 +18,13 @@
15
18
  ],
16
19
  "PreToolUse": [
17
20
  {
18
- "matcher": "Write|Edit",
21
+ "tools": ["Write", "Edit"],
19
22
  "hooks": [
20
23
  {
21
24
  "type": "command",
22
- "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"
25
+ "command": "node bin/hooks/block-random-docs.js",
26
+ "timeout": 3,
27
+ "description": "Block random markdown file creation (disable with AGENTFUL_ALLOW_RANDOM_DOCS=true)"
23
28
  }
24
29
  ]
25
30
  }
@@ -30,7 +35,7 @@
30
35
  "hooks": [
31
36
  {
32
37
  "type": "command",
33
- "command": "bash bin/hooks/analyze-trigger.sh",
38
+ "command": "node bin/hooks/analyze-trigger.js",
34
39
  "timeout": 3,
35
40
  "description": "Check if file changes warrant analysis"
36
41
  }
@@ -68,15 +73,6 @@
68
73
  ]
69
74
  },
70
75
  "permissions": {
71
- "allow": [
72
- "Bash(npm:*)",
73
- "Bash(npx:*)",
74
- "Bash(node:*)",
75
- "Bash(git:*)",
76
- "Bash(cat:*)",
77
- "Bash(echo:*)",
78
- "Bash(jq:*)"
79
- ],
80
76
  "deny": [
81
77
  "Bash(rm -rf /)",
82
78
  "Bash(rm -rf ~/.*)",
@@ -338,12 +338,18 @@ function route_to_handler(
338
338
  };
339
339
  }
340
340
 
341
- // Product planning → product-planning skill
341
+ // Product planning → reference product-planning skill guidance (inline)
342
+ // Note: product-planning is a skill, not a separate agent
343
+ // When user asks planning/requirements questions, use product-planning skill's guidance
342
344
  if (/plan|requirements|spec|analyze/i.test(intentName)) {
343
345
  return {
344
- handler: 'product-planning',
346
+ handler: 'inline',
345
347
  skill: 'product-planning',
346
- context: { intent: intentName }
348
+ context: {
349
+ intent: intentName,
350
+ use_skill_guidance: 'product-planning',
351
+ action: 'answer_with_planning_guidance'
352
+ }
347
353
  };
348
354
  }
349
355
 
@@ -548,16 +554,16 @@ ${routing.context.domain_filter ? `Filter: domain ${routing.context.domain_filte
548
554
  Task('validation', `Run quality gates. Scope: ${routing.context.scope || 'all'}`);
549
555
  break;
550
556
 
551
- case 'product-planning':
552
- Task('product-planning', userMessage);
553
- break;
554
-
555
557
  case 'inline':
556
558
  if (routing.context.needs_clarification) {
557
559
  return 'Could you please provide more details about what you\'d like me to do?';
558
560
  } else if (routing.context.action === 'pause_work') {
559
561
  pause_current_work();
560
562
  return 'Work paused. Run `/agentful` when ready to continue.';
563
+ } else if (routing.context.action === 'answer_with_planning_guidance') {
564
+ // Use product-planning skill guidance to answer planning/requirements questions
565
+ // The skill provides structured approach to product planning, requirements analysis
566
+ return answer_planning_question(userMessage, routing.context);
561
567
  } else if (routing.context.intent === 'question') {
562
568
  return answer_question(userMessage, routing.context);
563
569
  }
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: deployment
3
+ description: Guides deployment preparation and production readiness validation
4
+ model: sonnet
5
+ tools: Read, Write, Edit, Glob, Grep, Bash
6
+ ---
7
+
8
+ # Deployment Skill
9
+
10
+ ## Pre-Deployment Checklist
11
+
12
+ Before deploying to production:
13
+
14
+ ### Code Quality
15
+ - [ ] All tests passing (unit, integration, e2e)
16
+ - [ ] Code coverage ≥80%
17
+ - [ ] No type errors
18
+ - [ ] No linter errors or warnings
19
+ - [ ] No formatting issues
20
+ - [ ] Security vulnerabilities checked
21
+
22
+ ### Build & Configuration
23
+ - [ ] Production build succeeds locally
24
+ - [ ] Environment variables documented in `.env.example`
25
+ - [ ] All required secrets configured
26
+ - [ ] Database migrations ready and tested
27
+ - [ ] Migration rollback scripts prepared
28
+
29
+ ### Deployment Plan
30
+ - [ ] Rollback procedure documented
31
+ - [ ] Stakeholders notified
32
+ - [ ] Monitoring and health checks configured
33
+ - [ ] Post-deployment verification steps defined
34
+
35
+ ## Environment Variables
36
+
37
+ **Create `.env.example`:**
38
+ ```bash
39
+ # Document all required variables
40
+ DATABASE_URL=
41
+ API_KEY=
42
+ JWT_SECRET=
43
+ NODE_ENV=production
44
+ ```
45
+
46
+ **Runtime Validation:**
47
+ Validate environment variables at application startup to catch configuration errors early.
48
+
49
+ ## Database Migrations
50
+
51
+ **Safe Migration Strategy:**
52
+ 1. Test migrations in staging environment
53
+ 2. Backup production database before migration
54
+ 3. Write rollback scripts for all migrations
55
+ 4. Apply migrations before or after code deployment (depending on breaking changes)
56
+ 5. Monitor application after migration
57
+
58
+ ## Health Checks
59
+
60
+ Implement health check endpoints:
61
+ - `/health` - Overall system health (database, cache, external services)
62
+ - `/ready` - Readiness to serve traffic
63
+ - `/alive` - Process liveness
64
+
65
+ ## Rollback Procedures
66
+
67
+ **Always have a rollback plan:**
68
+ 1. Know how to revert code deployment on your platform
69
+ 2. Know how to rollback database migrations
70
+ 3. Test rollback procedure in staging
71
+ 4. Document rollback commands
72
+
73
+ ## Post-Deployment Verification
74
+
75
+ After deployment:
76
+ 1. Verify health checks return 200 OK
77
+ 2. Test critical user workflows
78
+ 3. Monitor error rates and logs for 15+ minutes
79
+ 4. Verify database migrations applied correctly
80
+
81
+ ## Common Deployment Platforms
82
+
83
+ Choose platform based on your stack and requirements:
84
+ - **Static sites**: Netlify, Vercel, CloudFlare Pages, GitHub Pages
85
+ - **Serverless**: AWS Lambda, Vercel Functions, Netlify Functions, CloudFlare Workers
86
+ - **Containers**: AWS ECS, Google Cloud Run, Azure Container Apps, Railway, Render
87
+ - **Virtual Machines**: AWS EC2, DigitalOcean, Linode, Hetzner
88
+ - **Kubernetes**: AWS EKS, Google GKE, Azure AKS, DigitalOcean Kubernetes
89
+
90
+ Consult your platform's documentation for specific deployment commands and configuration.
91
+
92
+ ## Rules
93
+
94
+ ### DO
95
+ - Run full test suite before deploying
96
+ - Validate environment configuration
97
+ - Test production build locally
98
+ - Document rollback procedure
99
+ - Monitor after deployment
100
+ - Tag releases in version control
101
+
102
+ ### DON'T
103
+ - Deploy with failing tests
104
+ - Commit secrets to version control
105
+ - Deploy without rollback plan
106
+ - Skip environment validation
107
+ - Deploy breaking changes without coordination
108
+ - Deploy on Friday afternoon without monitoring capacity
109
+
110
+ ## Integration
111
+
112
+ The orchestrator uses this skill when:
113
+ - User requests deployment
114
+ - Feature is complete and ready to ship
115
+ - Rollback is needed
116
+ - Environment setup required