@itz4blitz/agentful 1.8.0 → 1.8.2
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.
- package/README.md +0 -3
- package/bin/cli.js +165 -109
- package/bin/hooks/architect-drift-detector.js +3 -1
- package/bin/hooks/block-random-docs.js +0 -2
- package/bin/hooks/ensure-worktree.js +234 -0
- package/bin/hooks/mcp-health-check.js +56 -0
- package/bin/hooks/package-metadata-guard.js +118 -0
- package/bin/hooks/session-start.js +32 -5
- package/bin/hooks/worktree-service.js +514 -0
- package/lib/presets.js +22 -1
- package/package.json +7 -8
- package/template/.claude/agents/backend.md +19 -0
- package/template/.claude/agents/frontend.md +19 -0
- package/template/.claude/agents/orchestrator.md +182 -0
- package/template/.claude/agents/reviewer.md +18 -0
- package/template/.claude/commands/agentful-worktree.md +106 -0
- package/template/.claude/settings.json +32 -9
- package/template/CLAUDE.md +37 -2
- package/template/bin/hooks/block-random-docs.js +0 -1
- package/version.json +1 -1
package/lib/presets.js
CHANGED
|
@@ -19,7 +19,7 @@ export const presets = {
|
|
|
19
19
|
description: 'Complete agentful installation (recommended)',
|
|
20
20
|
agents: ['orchestrator', 'architect', 'backend', 'frontend', 'tester', 'reviewer', 'fixer', 'product-analyzer'],
|
|
21
21
|
skills: ['product-tracking', 'validation', 'testing', 'conversation', 'product-planning', 'deployment', 'research'],
|
|
22
|
-
hooks: ['session-start', 'health-check', 'block-random-docs', 'block-file-creation', 'product-spec-watcher', 'architect-drift-detector', 'analyze-trigger'],
|
|
22
|
+
hooks: ['session-start', 'health-check', 'mcp-health-check', 'block-random-docs', 'block-file-creation', 'product-spec-watcher', 'architect-drift-detector', 'analyze-trigger', 'package-metadata-guard'],
|
|
23
23
|
gates: ['types', 'tests', 'coverage', 'lint', 'security', 'dead-code']
|
|
24
24
|
},
|
|
25
25
|
|
|
@@ -47,6 +47,16 @@ export const hookConfigurations = {
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
|
|
50
|
+
'mcp-health-check': {
|
|
51
|
+
event: 'SessionStart',
|
|
52
|
+
config: {
|
|
53
|
+
type: 'command',
|
|
54
|
+
command: 'node bin/hooks/mcp-health-check.js',
|
|
55
|
+
timeout: 3,
|
|
56
|
+
description: 'Verify agentful MCP server is configured'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
50
60
|
'block-random-docs': {
|
|
51
61
|
event: 'PreToolUse',
|
|
52
62
|
matcher: 'Write',
|
|
@@ -151,6 +161,17 @@ export const hookConfigurations = {
|
|
|
151
161
|
timeout: 3,
|
|
152
162
|
description: 'Watch for product spec changes and auto-trigger generation'
|
|
153
163
|
}
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
'package-metadata-guard': {
|
|
167
|
+
event: 'PostToolUse',
|
|
168
|
+
matcher: 'Write|Edit',
|
|
169
|
+
config: {
|
|
170
|
+
type: 'command',
|
|
171
|
+
command: 'node bin/hooks/package-metadata-guard.js',
|
|
172
|
+
timeout: 3,
|
|
173
|
+
description: 'Protect package.json ownership metadata from accidental corruption'
|
|
174
|
+
}
|
|
154
175
|
}
|
|
155
176
|
};
|
|
156
177
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itz4blitz/agentful",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Pre-configured AI toolkit with self-hosted execution - works with any LLM, any tech stack, any platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,16 +16,14 @@
|
|
|
16
16
|
"lint": "eslint .",
|
|
17
17
|
"release": "semantic-release",
|
|
18
18
|
"release:dry-run": "semantic-release --dry-run",
|
|
19
|
-
"docs:dev": "vocs dev",
|
|
19
|
+
"docs:dev": "vocs dev --host 127.0.0.1 --port 8080",
|
|
20
20
|
"docs:build": "vocs build",
|
|
21
21
|
"docs:preview": "vocs preview",
|
|
22
|
-
"build:all": "npm run build:
|
|
23
|
-
"build:cli": "cd packages/cli && npm run build",
|
|
24
|
-
"build:studio": "cd packages/studio && npm run build",
|
|
22
|
+
"build:all": "npm run build:mcp",
|
|
25
23
|
"build:mcp": "cd packages/mcp-server && npm run build",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"install:all": "npm install && cd packages/
|
|
24
|
+
"test:mcp": "cd packages/mcp-server && npm run test",
|
|
25
|
+
"dev:mcp": "cd packages/mcp-server && npm run dev",
|
|
26
|
+
"install:all": "npm install && cd packages/mcp-server && npm install"
|
|
29
27
|
},
|
|
30
28
|
"exports": {
|
|
31
29
|
".": {
|
|
@@ -79,6 +77,7 @@
|
|
|
79
77
|
"@vitest/coverage-v8": "^1.2.0",
|
|
80
78
|
"eslint": "^9.39.2",
|
|
81
79
|
"semantic-release": "^25.0.2",
|
|
80
|
+
"vite-plugin-pagefind": "^1.0.7",
|
|
82
81
|
"vitest": "^1.2.0",
|
|
83
82
|
"vocs": "^1.4.1"
|
|
84
83
|
},
|
|
@@ -48,6 +48,25 @@ You are the **Backend Agent**. You implement server-side code using clean archit
|
|
|
48
48
|
|
|
49
49
|
**Reference skills for tech-specific guidance:**
|
|
50
50
|
- Look in `.claude/skills/` for framework-specific patterns
|
|
51
|
+
|
|
52
|
+
## Step 1.5: Worktree Check
|
|
53
|
+
|
|
54
|
+
Before implementing, verify your working environment:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Check if AGENTFUL_WORKTREE_DIR is set
|
|
58
|
+
if exists("$AGENTFUL_WORKTREE_DIR"):
|
|
59
|
+
worktree_path = "$AGENTFUL_WORKTREE_DIR"
|
|
60
|
+
echo "✅ Implementing backend in worktree: $worktree_path"
|
|
61
|
+
else:
|
|
62
|
+
echo "📍 Implementing backend in root repository"
|
|
63
|
+
echo "⚠️ Changes will affect main branch directly"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Report worktree status**: In your final report, always include:
|
|
67
|
+
- Worktree path (if applicable)
|
|
68
|
+
- Branch being worked on
|
|
69
|
+
- Any commits created
|
|
51
70
|
- Skills contain project-specific conventions, not generic framework docs
|
|
52
71
|
|
|
53
72
|
**Sample existing code to understand conventions:**
|
|
@@ -53,6 +53,25 @@ You are the **Frontend Agent**. You implement user interfaces and client-side co
|
|
|
53
53
|
|
|
54
54
|
**Reference skills for tech-specific guidance:**
|
|
55
55
|
- Look in `.claude/skills/` for framework-specific patterns
|
|
56
|
+
|
|
57
|
+
## Step 1.5: Worktree Check
|
|
58
|
+
|
|
59
|
+
Before implementing, verify your working environment:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Check if AGENTFUL_WORKTREE_DIR is set
|
|
63
|
+
if exists("$AGENTFUL_WORKTREE_DIR"):
|
|
64
|
+
worktree_path = "$AGENTFUL_WORKTREE_DIR"
|
|
65
|
+
echo "✅ Implementing frontend in worktree: $worktree_path"
|
|
66
|
+
else:
|
|
67
|
+
echo "📍 Implementing frontend in root repository"
|
|
68
|
+
echo "⚠️ Changes will affect main branch directly"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Report worktree status**: In your final report, always include:
|
|
72
|
+
- Worktree path (if applicable)
|
|
73
|
+
- Branch being worked on
|
|
74
|
+
- Any commits created
|
|
56
75
|
- Skills contain project-specific conventions (styling, state management, forms)
|
|
57
76
|
|
|
58
77
|
**Sample existing code to understand conventions:**
|
|
@@ -456,6 +456,188 @@ else:
|
|
|
456
456
|
}
|
|
457
457
|
```
|
|
458
458
|
|
|
459
|
+
## Worktree Management
|
|
460
|
+
|
|
461
|
+
Git worktrees provide isolated environments for parallel agent development. Each task can work in its own worktree without polluting the main repository.
|
|
462
|
+
|
|
463
|
+
### Why Worktrees?
|
|
464
|
+
|
|
465
|
+
- **Isolation**: Changes are isolated until merged
|
|
466
|
+
- **Parallel Development**: Multiple agents can work simultaneously
|
|
467
|
+
- **Safety**: Experimental changes don't affect main branch
|
|
468
|
+
- **Clean History**: Each worktree has its own git history
|
|
469
|
+
|
|
470
|
+
### Worktree Modes
|
|
471
|
+
|
|
472
|
+
Controlled via `AGENTFUL_WORKTREE_MODE` environment variable:
|
|
473
|
+
|
|
474
|
+
| Mode | Behavior | When to Use |
|
|
475
|
+
|-------|-----------|--------------|
|
|
476
|
+
| `auto` | Create worktrees automatically | Default, recommended |
|
|
477
|
+
| `block` | Require existing worktree | Strict environments |
|
|
478
|
+
| `off` | Allow direct edits | Legacy, manual control |
|
|
479
|
+
|
|
480
|
+
### Before Delegation: Worktree Setup
|
|
481
|
+
|
|
482
|
+
Before delegating to any specialist agent:
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
# Check worktree mode
|
|
486
|
+
if AGENTFUL_WORKTREE_MODE != "off":
|
|
487
|
+
# Check if we need a worktree
|
|
488
|
+
current_worktree = get_current_worktree()
|
|
489
|
+
|
|
490
|
+
if not current_worktree:
|
|
491
|
+
# Determine purpose from task type
|
|
492
|
+
purpose = determine_worktree_purpose(task_type)
|
|
493
|
+
|
|
494
|
+
# Create worktree via worktree-service
|
|
495
|
+
worktree = execute("node bin/hooks/worktree-service.js create " + purpose)
|
|
496
|
+
|
|
497
|
+
# Set environment for delegated agents
|
|
498
|
+
# They inherit AGENTFUL_WORKTREE_DIR
|
|
499
|
+
current_worktree = worktree
|
|
500
|
+
|
|
501
|
+
# Track in state.json
|
|
502
|
+
state.current_worktree = {
|
|
503
|
+
name: worktree.name,
|
|
504
|
+
path: worktree.path,
|
|
505
|
+
branch: worktree.branch,
|
|
506
|
+
purpose: worktree.purpose,
|
|
507
|
+
created_at: worktree.created_at
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Worktree Naming Convention
|
|
512
|
+
|
|
513
|
+
Worktrees are automatically named:
|
|
514
|
+
|
|
515
|
+
```
|
|
516
|
+
agentful-<purpose>-<branch-slug>-<timestamp>
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Examples:
|
|
520
|
+
- `agentful-feature-auth-1739297120` - Feature development
|
|
521
|
+
- `agentful-fix-coverage-1739297150` - Fixer adding coverage
|
|
522
|
+
- `agentful-review-1739297180` - Reviewer validating
|
|
523
|
+
- `agentful-hotfix-login-bug-1739297210` - Hotfix work
|
|
524
|
+
|
|
525
|
+
### State Schema Extension
|
|
526
|
+
|
|
527
|
+
Track worktrees in `.agentful/state.json`:
|
|
528
|
+
|
|
529
|
+
```json
|
|
530
|
+
{
|
|
531
|
+
"current_task": "feature/auth",
|
|
532
|
+
"current_phase": "implementation",
|
|
533
|
+
"current_worktree": {
|
|
534
|
+
"name": "agentful-feature-auth-1739297120",
|
|
535
|
+
"path": "/Users/dev/project/.git/worktrees/agentful-feature-auth-1739297120",
|
|
536
|
+
"branch": "feature/auth",
|
|
537
|
+
"purpose": "feature",
|
|
538
|
+
"created_at": "2025-02-11T15:30:00Z"
|
|
539
|
+
},
|
|
540
|
+
"worktrees": {
|
|
541
|
+
"active": [
|
|
542
|
+
{
|
|
543
|
+
"name": "agentful-feature-auth-1739297120",
|
|
544
|
+
"branch": "feature/auth",
|
|
545
|
+
"purpose": "feature",
|
|
546
|
+
"agent": "orchestrator",
|
|
547
|
+
"created_at": "2025-02-11T15:30:00Z",
|
|
548
|
+
"last_activity": "2025-02-11T16:45:00Z"
|
|
549
|
+
}
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### After Task Completion: Worktree Cleanup
|
|
556
|
+
|
|
557
|
+
When a feature passes all quality gates:
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
if task_completed and AGENTFUL_WORKTREE_AUTO_CLEANUP != "false":
|
|
561
|
+
# Commit changes in worktree
|
|
562
|
+
git -C $WORKTREE_PATH add .
|
|
563
|
+
git -C $WORKTREE_PATH commit -m "feat: complete ${feature_name}"
|
|
564
|
+
|
|
565
|
+
# Ask user what to do next
|
|
566
|
+
response = AskUserQuestion(
|
|
567
|
+
"Feature complete! What would you like to do?",
|
|
568
|
+
options: [
|
|
569
|
+
"Create PR",
|
|
570
|
+
"Merge to main",
|
|
571
|
+
"Keep worktree for review",
|
|
572
|
+
"Clean up worktree"
|
|
573
|
+
]
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
if response == "Create PR" or response == "Merge to main":
|
|
577
|
+
# Push and create PR/merge
|
|
578
|
+
git -C $WORKTREE_PATH push
|
|
579
|
+
# ... PR creation logic ...
|
|
580
|
+
|
|
581
|
+
# Remove worktree
|
|
582
|
+
execute("node bin/hooks/worktree-service.js remove " + worktree.name)
|
|
583
|
+
|
|
584
|
+
# Update state.json
|
|
585
|
+
state.current_worktree = null
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
### Handling Interruptions
|
|
589
|
+
|
|
590
|
+
If user interrupts during worktree operation:
|
|
591
|
+
|
|
592
|
+
```bash
|
|
593
|
+
on SIGINT:
|
|
594
|
+
if active_worktree:
|
|
595
|
+
# Mark for review instead of deleting
|
|
596
|
+
state.interrupted_worktree = {
|
|
597
|
+
name: active_worktree.name,
|
|
598
|
+
path: active_worktree.path,
|
|
599
|
+
interrupted_at: new Date().toISOString()
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
console.log("Worktree preserved: " + active_worktree.name)
|
|
603
|
+
console.log("Run /agentful-worktree --resume to continue")
|
|
604
|
+
console.log("Run /agentful-worktree --cleanup to remove")
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
### Worktree Service API
|
|
608
|
+
|
|
609
|
+
The `worktree-service.js` provides these operations:
|
|
610
|
+
|
|
611
|
+
```bash
|
|
612
|
+
node bin/hooks/worktree-service.js create <purpose> [branch] # Create worktree
|
|
613
|
+
node bin/hooks/worktree-service.js list # List all worktrees
|
|
614
|
+
node bin/hooks/worktree-service.js status # Show current status
|
|
615
|
+
node bin/hooks/worktree-service.js cleanup # Remove stale worktrees
|
|
616
|
+
node bin/hooks/worktree-service.js prune # Run git prune
|
|
617
|
+
node bin/hooks/worktree-service.js remove <name> # Remove specific worktree
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
### Environment Variables
|
|
621
|
+
|
|
622
|
+
| Variable | Default | Description |
|
|
623
|
+
|-----------|----------|-------------|
|
|
624
|
+
| `AGENTFUL_WORKTREE_MODE` | `auto` | Worktree enforcement mode |
|
|
625
|
+
| `AGENTFUL_WORKTREE_DIR` | (auto-set) | Current worktree path |
|
|
626
|
+
| `AGENTFUL_WORKTREE_LOCATION` | `../` | Where to create worktrees |
|
|
627
|
+
| `AGENTFUL_WORKTREE_AUTO_CLEANUP` | `true` | Auto-remove after completion |
|
|
628
|
+
| `AGENTFUL_WORKTREE_RETENTION_DAYS` | `7` | Days before stale cleanup |
|
|
629
|
+
| `AGENTFUL_WORKTREE_MAX_ACTIVE` | `5` | Maximum active worktrees |
|
|
630
|
+
|
|
631
|
+
### CI/CD Detection
|
|
632
|
+
|
|
633
|
+
Worktree mode auto-disables in CI environments:
|
|
634
|
+
|
|
635
|
+
```bash
|
|
636
|
+
if process.env.CI == "true" or process.env.GITHUB_ACTIONS == "true":
|
|
637
|
+
# Skip worktree creation
|
|
638
|
+
# CI already provides isolated environments
|
|
639
|
+
```
|
|
640
|
+
|
|
459
641
|
## Delegation Pattern
|
|
460
642
|
|
|
461
643
|
**NEVER implement yourself.** Always use Task tool.
|
|
@@ -38,6 +38,24 @@ Fall back to manual Grep if none available
|
|
|
38
38
|
|
|
39
39
|
**Reference the validation skill** (`.claude/skills/validation/SKILL.md`) for comprehensive validation strategies.
|
|
40
40
|
|
|
41
|
+
## Step 1.5: Worktree Check
|
|
42
|
+
|
|
43
|
+
Before running checks, verify your working environment:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Check if AGENTFUL_WORKTREE_DIR is set
|
|
47
|
+
if exists("$AGENTFUL_WORKTREE_DIR"):
|
|
48
|
+
worktree_path = "$AGENTFUL_WORKTREE_DIR"
|
|
49
|
+
echo "✅ Reviewing in worktree: $worktree_path"
|
|
50
|
+
else:
|
|
51
|
+
echo "📍 Reviewing in root repository"
|
|
52
|
+
echo "⚠️ Validation reports will be saved to main .agentful/"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Report worktree status**: In your validation report, always include:
|
|
56
|
+
- Worktree path (if applicable)
|
|
57
|
+
- Branch being validated
|
|
58
|
+
|
|
41
59
|
## Your Scope
|
|
42
60
|
|
|
43
61
|
- **Type Checking** - Run type checker (tsc, mypy, etc.)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentful-worktree
|
|
3
|
+
description: Manage git worktrees for parallel agent development. List, create, and cleanup worktrees.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /agentful-worktree
|
|
7
|
+
|
|
8
|
+
Manage git worktrees for parallel agentful development.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/agentful-worktree # List all active worktrees
|
|
14
|
+
/agentful-worktree --status # Show current session worktree
|
|
15
|
+
/agentful-worktree --create feature/x # Create new worktree for branch
|
|
16
|
+
/agentful-worktree --cleanup # Remove stale worktrees
|
|
17
|
+
/agentful-worktree --prune # Run git worktree prune
|
|
18
|
+
/agentful-worktree --remove <name> # Remove specific worktree
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Environment Variables
|
|
22
|
+
|
|
23
|
+
| Variable | Default | Description |
|
|
24
|
+
|-----------|----------|-------------|
|
|
25
|
+
| `AGENTFUL_WORKTREE_MODE` | `auto` | `auto` (create), `block` (require), `off` (disabled) |
|
|
26
|
+
| `AGENTFUL_WORKTREE_LOCATION` | `../` | Where to create worktrees (relative to repo) |
|
|
27
|
+
| `AGENTFUL_WORKTREE_AUTO_CLEANUP` | `true` | Auto-remove worktrees after task completion |
|
|
28
|
+
| `AGENTFUL_WORKTREE_RETENTION_DAYS` | `7` | Days before worktrees are marked stale |
|
|
29
|
+
| `AGENTFUL_WORKTREE_MAX_ACTIVE` | `5` | Maximum active worktrees before cleanup forced |
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
### List Worktrees
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
/agentful-worktree
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Output:
|
|
40
|
+
```
|
|
41
|
+
📋 Active Worktrees:
|
|
42
|
+
|
|
43
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
44
|
+
│ agentful-feature-auth-1739297120 │
|
|
45
|
+
│ ├─ Branch: feature/auth │
|
|
46
|
+
│ ├─ Purpose: feature │
|
|
47
|
+
│ ├─ Path: ../agentful-feature-auth-1739297120 │
|
|
48
|
+
│ ├─ Status: 🟢 Active (15 min ago) │
|
|
49
|
+
│ └─ Created: 2025-02-11T15:30:00.000Z │
|
|
50
|
+
└─────────────────────────────────────────────────────────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Show Current Status
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/agentful-worktree --status
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Create Worktree
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
/agentful-worktree --create feature/dashboard
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Creates a worktree named `agentful-feature-dashboard-<timestamp>` on the `feature/dashboard` branch.
|
|
66
|
+
|
|
67
|
+
### Cleanup Stale Worktrees
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
/agentful-worktree --cleanup
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Removes worktrees older than `AGENTFUL_WORKTREE_RETENTION_DAYS` (default: 7 days).
|
|
74
|
+
|
|
75
|
+
## Worktree Naming Convention
|
|
76
|
+
|
|
77
|
+
Worktrees are automatically named using this pattern:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
agentful-<purpose>-<branch-slug>-<timestamp>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Examples:
|
|
84
|
+
- `agentful-feature-auth-1739297120` - Feature development
|
|
85
|
+
- `agentful-fix-coverage-1739297150` - Fixer adding coverage
|
|
86
|
+
- `agentful-review-1739297180` - Reviewer validating
|
|
87
|
+
- `agentful-hotfix-login-bug-1739297210` - Hotfix work
|
|
88
|
+
|
|
89
|
+
## When to Use Worktrees
|
|
90
|
+
|
|
91
|
+
**Use worktrees when**:
|
|
92
|
+
- Working on multiple features simultaneously
|
|
93
|
+
- Running quality gates while developing other features
|
|
94
|
+
- Reviewing PRs without interrupting active work
|
|
95
|
+
- Testing experimental approaches safely
|
|
96
|
+
|
|
97
|
+
**Don't need worktrees when**:
|
|
98
|
+
- Quick fixes in a single feature branch
|
|
99
|
+
- Documentation-only changes
|
|
100
|
+
- Set `AGENTFUL_WORKTREE_MODE=off` to disable
|
|
101
|
+
|
|
102
|
+
## See Also
|
|
103
|
+
|
|
104
|
+
- [Git Worktrees Concept](/concepts/git-worktrees) - Deep dive on worktree usage
|
|
105
|
+
- [/agentful-start](/commands/agentful-start) - Main development loop
|
|
106
|
+
- [/agentful-status](/commands/agentful-status) - Check completion progress
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"includeCoAuthoredBy": false,
|
|
3
3
|
"env": {
|
|
4
|
-
"ENABLE_TOOL_SEARCH": "true"
|
|
4
|
+
"ENABLE_TOOL_SEARCH": "true",
|
|
5
|
+
"AGENTFUL_WORKTREE_MODE": "auto"
|
|
5
6
|
},
|
|
6
7
|
"hooks": {
|
|
7
8
|
"SessionStart": [
|
|
@@ -24,7 +25,18 @@
|
|
|
24
25
|
],
|
|
25
26
|
"PreToolUse": [
|
|
26
27
|
{
|
|
27
|
-
"
|
|
28
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
29
|
+
"hooks": [
|
|
30
|
+
{
|
|
31
|
+
"type": "command",
|
|
32
|
+
"command": "node bin/hooks/ensure-worktree.js",
|
|
33
|
+
"timeout": 10,
|
|
34
|
+
"description": "Ensure agents work in git worktrees (disable with AGENTFUL_WORKTREE_MODE=off)"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
28
40
|
"hooks": [
|
|
29
41
|
{
|
|
30
42
|
"type": "command",
|
|
@@ -35,7 +47,7 @@
|
|
|
35
47
|
]
|
|
36
48
|
},
|
|
37
49
|
{
|
|
38
|
-
"
|
|
50
|
+
"matcher": "Write",
|
|
39
51
|
"hooks": [
|
|
40
52
|
{
|
|
41
53
|
"type": "command",
|
|
@@ -48,7 +60,7 @@
|
|
|
48
60
|
],
|
|
49
61
|
"PostToolUse": [
|
|
50
62
|
{
|
|
51
|
-
"matcher": "Write|Edit",
|
|
63
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
52
64
|
"hooks": [
|
|
53
65
|
{
|
|
54
66
|
"type": "command",
|
|
@@ -59,7 +71,7 @@
|
|
|
59
71
|
]
|
|
60
72
|
},
|
|
61
73
|
{
|
|
62
|
-
"matcher": "Write|Edit",
|
|
74
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
63
75
|
"hooks": [
|
|
64
76
|
{
|
|
65
77
|
"type": "command",
|
|
@@ -70,7 +82,7 @@
|
|
|
70
82
|
]
|
|
71
83
|
},
|
|
72
84
|
{
|
|
73
|
-
"matcher": "Write|Edit",
|
|
85
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
74
86
|
"hooks": [
|
|
75
87
|
{
|
|
76
88
|
"type": "command",
|
|
@@ -81,7 +93,18 @@
|
|
|
81
93
|
]
|
|
82
94
|
},
|
|
83
95
|
{
|
|
84
|
-
"matcher": "Write|Edit",
|
|
96
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
97
|
+
"hooks": [
|
|
98
|
+
{
|
|
99
|
+
"type": "command",
|
|
100
|
+
"command": "node bin/hooks/package-metadata-guard.js",
|
|
101
|
+
"timeout": 3,
|
|
102
|
+
"description": "Protect package.json ownership metadata from accidental corruption"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
85
108
|
"hooks": [
|
|
86
109
|
{
|
|
87
110
|
"type": "command",
|
|
@@ -90,7 +113,7 @@
|
|
|
90
113
|
]
|
|
91
114
|
},
|
|
92
115
|
{
|
|
93
|
-
"matcher": "Write|Edit",
|
|
116
|
+
"matcher": "Write|Edit|NotebookEdit",
|
|
94
117
|
"hooks": [
|
|
95
118
|
{
|
|
96
119
|
"type": "command",
|
|
@@ -120,4 +143,4 @@
|
|
|
120
143
|
"Bash(mkfs:*)"
|
|
121
144
|
]
|
|
122
145
|
}
|
|
123
|
-
}
|
|
146
|
+
}
|
package/template/CLAUDE.md
CHANGED
|
@@ -20,7 +20,7 @@ npx @itz4blitz/agentful init --agents=orchestrator,backend --skills=validation
|
|
|
20
20
|
npx @itz4blitz/agentful presets
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Use `npx @itz4blitz/agentful presets` to see local installation options.
|
|
24
24
|
|
|
25
25
|
## Quick Start
|
|
26
26
|
|
|
@@ -78,6 +78,15 @@ Without MCP: agents start from scratch every session. With MCP: agents compound
|
|
|
78
78
|
|
|
79
79
|
See [Hooks System](#hooks-system) below for manual setup or other editors.
|
|
80
80
|
|
|
81
|
+
## Metadata Safety (Critical)
|
|
82
|
+
|
|
83
|
+
When editing `package.json` (or other repo metadata files), preserve project ownership:
|
|
84
|
+
|
|
85
|
+
- Never change `repository.url`, `homepage`, `bugs.url`, `name` scope, or `author` to agentful maintainer values unless the project explicitly asks.
|
|
86
|
+
- Keep `repository.type` as `"git"` when a `repository` object exists.
|
|
87
|
+
- Do not infer repo owner from agentful package names/docs (`@itz4blitz/agentful`); derive owner from the current repository remote instead.
|
|
88
|
+
- Prefer structured JSON edits (JSON path / `jq` / `npm pkg`) instead of broad text replace on `"type"` or `"url"`.
|
|
89
|
+
|
|
81
90
|
## Commands
|
|
82
91
|
|
|
83
92
|
| Command | Description | When to Use |
|
|
@@ -199,6 +208,33 @@ The `reviewer` agent runs these checks automatically. The `fixer` agent resolves
|
|
|
199
208
|
- Estimated remaining work
|
|
200
209
|
→ If no progress for 2+ minutes, the task may be stuck. Check `.agentful/state.json` for circuit breaker status.
|
|
201
210
|
|
|
211
|
+
### Git Worktree Mode
|
|
212
|
+
|
|
213
|
+
agentful supports automatic git worktree management for safer parallel development.
|
|
214
|
+
|
|
215
|
+
**Modes**:
|
|
216
|
+
| Mode | Behavior |
|
|
217
|
+
|-------|-----------|
|
|
218
|
+
| `auto` | Create worktrees automatically when agents make changes (recommended) |
|
|
219
|
+
| `block` | Require agents to work in existing worktrees |
|
|
220
|
+
| `off` | Allow direct edits to root repository (legacy) |
|
|
221
|
+
|
|
222
|
+
**Enable via environment**:
|
|
223
|
+
```bash
|
|
224
|
+
export AGENTFUL_WORKTREE_MODE=auto
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Or in `.claude/settings.json`**:
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"env": {
|
|
231
|
+
"AGENTFUL_WORKTREE_MODE": "auto"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**More configuration**: See [/agentful-worktree](/commands/agentful-worktree) command and [Git Worktrees concept](/concepts/git-worktrees) for full details.
|
|
237
|
+
|
|
202
238
|
## Getting Help
|
|
203
239
|
|
|
204
240
|
**Documentation**: See `.claude/commands/` for detailed command documentation
|
|
@@ -259,7 +295,6 @@ Agentful uses Claude Code hooks for automation, protection, and intelligent cont
|
|
|
259
295
|
- ✅ `.claude/skills/*/SKILL.md` - Skill documentation
|
|
260
296
|
- ✅ `.claude/product/**/*.md` - Product specifications
|
|
261
297
|
- ✅ `template/**/*.md` - Template files
|
|
262
|
-
- ✅ `examples/**/*.md` - Example documentation
|
|
263
298
|
- **Allowed if parent directory exists**:
|
|
264
299
|
- 📁 `docs/*.md`, `docs/pages/*.mdx` - Requires `docs/` directory
|
|
265
300
|
- 📁 `documentation/*.md` - Requires `documentation/` directory
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* - .claude/skills/*\/SKILL.md (skill documentation)
|
|
17
17
|
* - .claude/product/**\/*.md (product specifications)
|
|
18
18
|
* - template/**\/*.md (template files)
|
|
19
|
-
* - examples/**\/*.md (example documentation)
|
|
20
19
|
*
|
|
21
20
|
* Blocked:
|
|
22
21
|
* - Random *.md files in project root
|
package/version.json
CHANGED