Configuration
Customize agentful to match your workflow.
Overview
You can modify:
- Agents - Add, remove, or specialize agents
- Commands - Create custom slash commands
- Skills - Add domain-specific capabilities
- Settings - Configure hooks and permissions
- Product Structure - Choose flat or hierarchical
Configuration files:
.claude/
├── product/
│ ├── index.md # Product spec (hierarchical)
│ └── domains/ # Domain-specific specs
├── agents/ # Agent definitions
├── commands/ # Slash commands
├── skills/ # Domain skills
└── settings.json # Hooks and permissionsWhile you can manually edit any files in .claude/, use /agentful-update when updating agentful to newer versions. This command safely updates your configuration files while preserving your customizations.
Product Structure
agentful uses a hierarchical structure for organizing product specifications.
Hierarchical Structure
Best for large projects, team collaboration.
.claude/product/
├── index.md # Product overview
└── domains/
├── authentication/
│ ├── index.md # Domain overview
│ └── features/
│ ├── login.md
│ └── register.md
└── user-management/
└── index.md.claude/product/index.md:
# My App
## Domains
- Authentication (CRITICAL)
- User Management (HIGH).claude/product/domains/authentication/index.md:
# Authentication Domain
## Features
### 1. Login - CRITICAL
**Description**: User login
**Acceptance Criteria**:
- [ ] Email/password input
- [ ] JWT generationWhen to Use Domains
For complex projects with multiple business domains, organize into domain subdirectories.
For simpler projects, keep all features in index.md.
Settings Configuration
Location: .claude/settings.json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "npx tsc --noEmit 2>&1 | head -5 || true"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "if [ -f .agentful/state.json ]; then jq -r '.current_phase // \"idle\"' .agentful/state.json 2>/dev/null || echo 'idle'; else echo 'idle'; fi"
}
]
}
]
},
"permissions": {
"allow": [
"Bash(npm:*)",
"Bash(npx:*)",
"Bash(node:*)",
"Bash(git:*)",
"Bash(jq:*)"
],
"deny": [
"Bash(rm -rf /)",
"Bash(dd:*)",
"Bash(mkfs:*)"
]
}
}Hooks
agentful uses Claude Code hooks for automation, protection, and intelligent context awareness. Hooks run at specific lifecycle events to enhance the development experience.
agentful provides 11 built-in hooks organized into 4 categories: Context Awareness, File Protection, Monitoring & Detection, and Advanced hooks.
Hook Event Types
- SessionStart - Runs once when Claude Code session starts
- PreToolUse - Runs before a tool executes (can block execution)
- PostToolUse - Runs after a tool executes (informational only)
- UserPromptSubmit - Runs when user submits a prompt
Context Awareness Hooks
session-start (SessionStart event)
Provides intelligent session startup with project status and smart suggestions.
{
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node bin/hooks/session-start.js",
"timeout": 3,
"description": "Intelligent context awareness"
}
]
}
]
}Features:
- Shows project completion percentage and feature progress
- Detects parallel execution capability
- Highlights blocking issues (pending decisions, invalid architecture)
- Suggests numbered next steps based on current project state
Example output:
✅ Agentful ready (parallel execution: ON)
📊 Project Status: 47% complete (6/13 features)
⚠️ Architecture needs attention
⚠️ 2 pending decision(s)
💡 Suggested next steps:
1. ⚠️ Fix architecture → /agentful-generate
Architecture older than package.json - may need regeneration
2. ⚠️ Answer pending decisions → /agentful-decide
2 decision(s) blocking progressTo disable: Remove from SessionStart hooks in .claude/settings.json
post-action-suggestions (PostToolUse event - currently inactive)
Suggests smart follow-up actions after completing slash commands.
Status: Module exists but not currently enabled (future enhancement)
Features: Context-aware suggestions based on what you just did
File Protection Hooks
block-random-docs (PreToolUse event on Write/Edit)
Prevents creation of random markdown files outside approved locations.
{
"PreToolUse": [
{
"tools": ["Write", "Edit"],
"hooks": [
{
"type": "command",
"command": "node bin/hooks/block-random-docs.js",
"timeout": 3,
"description": "Block random markdown file creation"
}
]
}
]
}Always allowed:
- ✅
README.md,CONTRIBUTING.md,CHANGELOG.md,LICENSE.md - ✅
.claude/agents/*.md- Agent definitions - ✅
.claude/skills/*/SKILL.md- Skill documentation - ✅
.claude/product/**/*.md- Product specifications
Allowed if parent directory exists:
- 📁
docs/*.md,docs/pages/*.mdx- Requiresdocs/directory - 📁
documentation/*.md- Requiresdocumentation/directory - 📁
wiki/*.md- Requireswiki/directory - 📁
guides/*.md- Requiresguides/directory
To disable:
# Temporary
export AGENTFUL_ALLOW_RANDOM_DOCS=true
# Permanent
# Remove from .claude/settings.json PreToolUse hooksTo customize: Edit bin/hooks/block-random-docs.js and modify ALLOWED_PATTERNS
block-file-creation (PreToolUse event on Write)
Prevents creation of arbitrary data files outside approved directories.
{
"PreToolUse": [
{
"tools": ["Write"],
"hooks": [
{
"type": "command",
"command": "node bin/hooks/block-file-creation.js",
"timeout": 3,
"description": "Block arbitrary file creation"
}
]
}
]
}Always allowed:
- ✅ Source code files (
.js,.ts,.py,.go,.rs, etc.) - ✅ Root config files (
package.json,tsconfig.json, etc.) - ✅ Test files in test directories
Allowed in specific directories:
- 📁
.agentful/- Runtime state (validated files only) - 📁
fixtures/,test/fixtures/- Test fixtures - 📁
mocks/,__mocks__/- Test mocks - 📁
public/assets/- Static assets - 📁
config/,.config/- Configuration files
Blocked everywhere else:
- ❌ Random
.jsonfiles (e.g.,random-state.json,debug-output.json) - ❌ Random
.txtfiles (e.g.,notes.txt,todo.txt) - ❌ Random
.logfiles (e.g.,debug.log,output.log) - ❌ Temporary files (
.tmp,.temp,.bak,.old)
To disable: Remove from .claude/settings.json PreToolUse hooks
To customize: Edit bin/hooks/block-file-creation.js to modify allowed directories/extensions
Monitoring & Detection Hooks
health-check (SessionStart event)
Runs comprehensive startup health check for agentful.
{
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node bin/hooks/health-check.js",
"timeout": 5,
"description": "Quick agentful health check"
}
]
}
]
}Checks:
- ✅
.agentful/directory exists - ✅ Core state files present (
state.json,completion.json,decisions.json) - ✅
.claude/directory structure complete - ✅ Core agents exist (orchestrator, backend, frontend, tester, reviewer, fixer, architect, product-analyzer)
- ✅ Product specification exists (flat or hierarchical)
- ✅ Settings file valid JSON
- ⚠️ Architecture analysis exists and is valid
- ⚠️ Node.js version >= 22.0.0
Output: Shows errors (critical) and warnings (nice-to-have)
To disable: Remove from SessionStart hooks
architect-drift-detector (PostToolUse event on Write/Edit)
Detects when project changes require architecture re-analysis.
{
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "node bin/hooks/architect-drift-detector.js",
"timeout": 3,
"description": "Detect when architect needs to re-analyze"
}
]
}
]
}Triggers re-analysis when:
- 📦 Dependencies changed (
package.json,requirements.txt,go.mod, etc.) - ⚙️ Tech stack config modified (
tsconfig.json,next.config.js, etc.) - 📈 Significant code growth (20%+ new files)
- ⏰ Analysis is stale (>7 days old)
Action: Updates .agentful/architecture.json with needs_reanalysis: true and drift reasons
Output: ⚠️ Architect drift detected: dependencies_changed, tech_stack_modified
To disable: Remove from PostToolUse hooks
product-spec-watcher (PostToolUse event on Write/Edit)
Watches for product specification changes and suggests agent regeneration.
{
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "node bin/hooks/product-spec-watcher.js",
"timeout": 3,
"description": "Watch for product spec changes"
}
]
}
]
}Behavior:
- After
/agentful-initflow: Auto-suggests agent generation - Manual edit (no agents): Suggests running
/agentful-generate - Agents already exist: Suggests regenerating agents or continuing
Use case: Ensures agents stay aligned with product requirements
To disable: Remove from PostToolUse hooks
analyze-trigger (PostToolUse event on Write/Edit)
Suggests /agentful-analyze when critical config files change.
{
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "node bin/hooks/analyze-trigger.js",
"timeout": 3,
"description": "Check if file changes warrant analysis"
}
]
}
]
}Triggers suggestions for:
package.json- Dependencies changedtsconfig.json,jsconfig.json- TypeScript/JavaScript config changedvite.config.*,webpack.config.*,next.config.*- Build config changeddocker-compose.yml,Dockerfile- Docker config changed.env.example- Environment template changed
Output: "Dependencies changed in package.json. Consider running /agentful-analyze to update architecture understanding."
To disable: Remove from PostToolUse hooks
Advanced Hooks
TypeScript type checking (PostToolUse event on Write/Edit)
Runs tsc --noEmit after file changes to detect type errors.
{
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "npx tsc --noEmit 2>&1 | head -5 || true"
}
]
}
]
}Output: First 5 lines of TypeScript errors (if any)
Customize for your language:
// Python
{"command": "python -m mypy . 2>&1 | head -5 || true"}
// Go
{"command": "go build ./... 2>&1 | head -5 || true"}
// Disable
{"command": "echo 'Type checking disabled'"}To disable: Remove from PostToolUse hooks
Similar documentation detector (PostToolUse event on Write/Edit)
Warns if similar documentation already exists.
{
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"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"
}
]
}
]
}Output: ⚠️ Similar doc exists: docs/guide.md - consider updating instead
To disable: Remove from PostToolUse hooks
Phase tracker (UserPromptSubmit event)
Tracks current agentful phase from .agentful/state.json.
{
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "if [ -f .agentful/state.json ]; then jq -r '.current_phase // \"idle\"' .agentful/state.json 2>/dev/null || echo 'idle'; else echo 'idle'; fi",
"description": "Track current agentful phase"
}
]
}
]
}Output: Silent (logs phase for internal use)
To disable: Remove from UserPromptSubmit hooks
Hook Configuration Syntax
Hooks are configured in .claude/settings.json:
{
"hooks": {
"EventType": [
{
"tools": ["Write", "Edit"], // Optional: filter by tools
"matcher": "Write|Edit", // Optional: regex matcher
"hooks": [
{
"type": "command",
"command": "node bin/hooks/my-hook.js",
"timeout": 3,
"description": "What this hook does"
}
]
}
]
}
}Event types:
SessionStart- When Claude Code startsPreToolUse- Before tool execution (can block)PostToolUse- After tool execution (informational)UserPromptSubmit- When user submits prompt
Hook properties:
type- Always"command"for shell commandscommand- The command to executetimeout- Maximum execution time in seconds (optional)description- Human-readable description (optional)
Disabling Hooks
Option 1: Temporary disable (environment variable)# Disable random docs hook
export AGENTFUL_ALLOW_RANDOM_DOCS=true
claudeEdit .claude/settings.json and remove specific hook:
{
"hooks": {
"SessionStart": [
{
"hooks": [
// Keep session-start, remove health-check
{
"type": "command",
"command": "node bin/hooks/session-start.js",
"timeout": 3
}
]
}
],
"PreToolUse": [
{
"tools": ["Write", "Edit"],
"hooks": [
// Remove block-random-docs to allow any markdown file
]
}
]
}
}Edit the hook file directly in bin/hooks/:
bin/hooks/block-random-docs.js- ModifyALLOWED_PATTERNSbin/hooks/block-file-creation.js- ModifySOURCE_CODE_EXTENSIONSorALLOWED_DIRECTORY_PATTERNSbin/hooks/architect-drift-detector.js- ChangeSTALE_THRESHOLD_DAYS
When editing hook files, make sure to preserve the exit code behavior:
process.exit(0)- Success (proceed)process.exit(1)- Failure (block)
PreToolUse hooks can block execution by exiting with code 1.
Permissions
Allow List:
"allow": [
"Bash(npm:*)",
"Bash(pnpm:*)", // Add pnpm
"Bash(yarn:*)", // Add yarn
"Bash(python:*)", // Add Python
"Bash(docker:*)" // Add Docker
]Deny List:
"deny": [
"Bash(rm -rf /)", // Prevent root deletion
"Bash(dd:*)", // Prevent disk ops
"Bash(mkfs:*)" // Prevent formatting
]Agent Configuration
Customize Existing Agents
Location: .claude/agents/
Agents available:
orchestrator.md- Main coordinatorarchitect.md- Tech stack analyzerbackend.md- Backend specialistfrontend.md- Frontend specialisttester.md- Test writerreviewer.md- Quality validatorfixer.md- Issue fixer
Example: Customize Frontend Agent
File: .claude/agents/frontend.md
Add to scope:
## Your Scope
- **UI Components** - Reusable components
- **Pages** - Route pages
- **Animation** - Framer Motion, GSAP ← NEWRemove from scope:
## NOT Your Scope
- State Management → @state-manager ← DELEGATEExample: Customize Quality Gates
File: .claude/agents/reviewer.md
Add custom gate:
## Quality Gates
- All tests passing
- No type errors
- Test coverage ≥ 80%
- Bundle size < 200KB (gzip) ← NEW
- Lighthouse score ≥ 90 ← NEWCreate New Agents
File: .claude/agents/database.md
---
name: database
version: 1.0.0
---
# Database Agent
You are the **Database Agent**. You handle database operations.
## Your Scope
- Schema Design - Models and relationships
- Migrations - Database migrations
- Queries - Complex queries
- Seeding - Test data
## NOT Your Scope
- API routes → @backend
- Tests → @tester
## Rules
1. ALWAYS use TypeScript
2. ALWAYS create migrations for schema changes
3. ALWAYS use transactions for multi-step operations
4. NEVER expose raw queries to API
## After Implementation
Report:
- Schemas created/modified
- Migrations run
- What needs testingUse with:
@database, please create the User modelCommand Configuration
Location: .claude/commands/
Commands:
agentful-generate.md- Generate specialized agentsagentful-status.md- Check progressagentful-decide.md- Answer decisionsagentful-validate.md- Run quality checks
Create Custom Command
File: .claude/commands/agentful-deploy.md
---
name: agentful-deploy
description: Deploy project to production
---
# Deploy Command
Deploys after validation.
## Usage/agentful-deploy
## What It Does
1. Runs validation (`/agentful-validate`)
2. Checks quality gates
3. Runs build
4. Deploys to platform
5. Runs smoke tests
## Requirements
- All quality gates pass
- Build succeeds
- No uncommitted changes
## Platforms
- Vercel: `vercel deploy --prod`
- Netlify: `netlify deploy --prod`
- Railway: `railway up`
- Custom: `npm run deploy`
## Configuration
Add to .claude/product/index.md:
```markdown
## Deployment
- Platform: Vercel
- Build Command: npm run build
- Output Directory: .next
Use with:/agentful-deploy
## Skills Configuration
**Location**: `.claude/skills/`
### Create Testing Skill
**File**: `.claude/skills/testing/SKILL.md`
```markdown
---
name: testing
version: 1.0.0
---
# Testing Skill
Provides testing capabilities.
## What This Skill Does
- Writes unit tests
- Writes integration tests
- Writes E2E tests
- Measures coverage
## Usage@tester use testing skill to write tests for UserService
## Test Templates
### Unit Test (Vitest)
```typescript
import { describe, it, expect } from 'vitest';
import { UserService } from '../UserService';
describe('UserService', () => {
it('should create a user', async () => {
const user = await UserService.create({
email: 'test@example.com',
name: 'Test User'
});
expect(user).toHaveProperty('id');
expect(user.email).toBe('test@example.com');
});
});Coverage Targets
- Unit tests: 90%+ coverage
- Integration tests: Critical paths
- E2E tests: User journeys
Best Practices
- Test behavior, not implementation
- Use descriptive names
- Follow AAA pattern (Arrange, Act, Assert)
- Mock external dependencies
- Keep tests fast
## Platform-Specific Configuration
### Next.js
**next.config.js**:
```javascript
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
domains: ['example.com'],
},
experimental: {
serverActions: true,
},
}
module.exports = nextConfigTypeScript
tsconfig.json:
{
"compilerOptions": {
"target": "ES2020",
"lib": ["dom", "dom.iterable", "esnext"],
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"jsx": "preserve",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}Quality Gate Configuration
Coverage Thresholds
Update: .claude/agents/reviewer.md
## Coverage Thresholds
- Overall: ≥ 80%
- Critical paths: ≥ 90%
- UI components: ≥ 70%
- Utilities: ≥ 95%Vitest config:
// vitest.config.ts
export default defineConfig({
test: {
coverage: {
provider: 'v8',
thresholds: {
lines: 80,
functions: 80,
branches: 80,
statements: 80,
},
},
},
})Troubleshooting
Configuration Not Loading
- Restart Claude Code:
exit
claude- Check file format:
- Valid Markdown (.md)
- Valid frontmatter
- No JSON syntax errors
- Verify paths:
ls -la .claude/agents/
ls -la .claude/commands/
ls -la .claude/settings.jsonAgent Not Responding
- Check file exists in
.claude/agents/ - Verify agent name:
ls .claude/agents/
# Reference: @database (not @database.md)Best Practices
Version Control
Commit .claude/ to git:
git add .claude/
git commit -m "Configure agentful"Ignore .agentful/ (runtime state):
# Already in .gitignore
.agentful/Document Changes
Create CONFIG.md:
# agentful Configuration
## Custom Agents
- @database - Database operations
- @analytics - Analytics tracking
## Custom Commands
- /agentful-deploy - Deployment workflow
## Modified Agents
- @frontend - Added animation support
- @reviewer - Added bundle size checksTest Gradually
- Use defaults first
- Make small changes
- Test after each change
- Document what works
Next Steps
Agent Reference
Learn about each agent Agents Guide
Command Reference
Learn about all commands Commands Guide