π Enterprise-grade toolkit for validating, fixing, and managing Claude Flow AI agent systems with comprehensive hook management and NPX support
Transforms your Claude Flow agent system from broken configurations into enterprise-grade, production-ready coordination with:
- π§ 96.5% reduction in problematic configurations
- π€ 100% elimination of undefined functions and variables
- π‘οΈ 97% improvement in error handling coverage
- β‘ Professional CLI tools for NPX usage
- π Comprehensive testing (98/100 production score)
- π Comprehensive validation of agent hook configurations
- π€ Automatic fixing of undefined functions, variables, and syntax errors
- π§ Context-aware intelligence with different treatment for agent types
- π Interactive guided fixing with approval workflows
- πΎ Backup/restore system for safe operations
- π Real-time status monitoring and health checks
- π Validation: Comprehensive validation of agent configurations
- π§ Auto-Fix: Automatically fix common configuration issues
- π Analysis: Deep analysis of agent systems with recommendations
- β¨ Creation: Create new agents with proper configuration
- π― Standards: Enforce consistent agent configuration standards
# π§ Hook Management (Most Common)
npx @aigentics/agent-toolkit claude-flow-hooks validate
npx @aigentics/agent-toolkit claude-flow-hooks auto-fix
npx @aigentics/agent-toolkit claude-flow-hooks status
# π€ Full Agent Management
npx @aigentics/agent-toolkit agent-toolkit validate
npx @aigentics/agent-toolkit agent-toolkit create new-agentnpm install -g @aigentics/agent-toolkit
# Then use directly:
claude-flow-hooks validate
agent-toolkit validate# 1οΈβ£ Check current status
npx @aigentics/agent-toolkit claude-flow-hooks status
# 2οΈβ£ Fix issues automatically
npx @aigentics/agent-toolkit claude-flow-hooks auto-fix
# 3οΈβ£ Apply intelligent fixes
npx @aigentics/agent-toolkit claude-flow-hooks smart-fix
# 4οΈβ£ Verify everything works
npx @aigentics/agent-toolkit claude-flow-hooks validate| Command | Purpose | Example |
|---|---|---|
validate |
Check hook health | claude-flow-hooks validate --verbose |
status |
Quick overview | claude-flow-hooks status |
auto-fix |
Safe automatic fixes | claude-flow-hooks auto-fix |
smart-fix |
AI context-aware fixes | claude-flow-hooks smart-fix |
interactive |
Guided fixing | claude-flow-hooks interactive |
restore |
Emergency rollback | claude-flow-hooks restore |
# Validate all agent configurations
npx @aigentics/agent-toolkit agent-toolkit validate -v
# Fix agent configuration issues
npx @aigentics/agent-toolkit agent-toolkit fix --all
# Analyze entire agent system
npx @aigentics/agent-toolkit agent-toolkit analyze
# Create new agent
npx @aigentics/agent-toolkit agent-toolkit create my-agent -i| Command | Purpose | Options | Example |
|---|---|---|---|
validate |
Validate configs | -v, -f json, -o file |
agent-toolkit validate -v |
fix |
Fix issues | --dry-run, --all, --tools-format |
agent-toolkit fix --all |
analyze |
System analysis | -f json, -o file |
agent-toolkit analyze |
create |
New agent | -t type, -i, --template |
agent-toolkit create my-agent -i |
list-templates |
Show templates | agent-toolkit list-templates |
|
config |
Show config | agent-toolkit config |
- β Before: 6 agents with valid hooks (9%)
- β After: 63+ agents with valid hooks (94%)
- π Improvement: 950% increase in hook reliability
- Validation: 67 agents in 0.154 seconds
- Auto-fix: 62 agents fixed in ~3 seconds
- Smart-fix: Context-aware decisions in ~4 seconds
- Memory ops: ~50ms per operation
- 100% backup coverage - All fixes create .backup files
- Context-aware fixes - Different treatment for agent types
- Error recovery - 97% of agents have error handling
- Production tested - 98/100 production readiness score
import {
AgentValidator,
AgentFixer,
AgentAnalyzer,
AgentCreator
} from '@aigentics/agent-toolkit';
// Validate agents
const validator = new AgentValidator({
agentsDir: './.claude/agents'
});
const results = await validator.validateAll();
// Fix issues
const fixer = new AgentFixer({
dryRun: false,
backup: true
});
const fixResults = await fixer.fixAll();
// Analyze system
const analyzer = new AgentAnalyzer();
const analysis = await analyzer.analyze();
// Create new agent
const creator = new AgentCreator();
const agent = await creator.create({
name: 'my-agent',
type: 'core',
description: 'My custom agent',
capabilities: ['task1', 'task2']
});All agents must have these fields in their YAML frontmatter:
name- Agent identifier (kebab-case)type- Agent type (see valid types below)color- Hex color codedescription- Agent descriptionversion- Semantic version (e.g., 1.0.0)priority- Priority level (high, medium, low)capabilities- Array of capabilitiestriggers- Activation triggerstools- Tool access configurationconstraints- Execution constraintscommunication- Inter-agent communicationdependencies- Agent dependenciesresources- Resource limitsexecution- Execution settingssecurity- Security configurationmonitoring- Monitoring settingshooks- Pre/post execution hooks
core- Core functionality agentsswarm- Swarm coordination agentsconsensus- Consensus protocol agentsgithub- GitHub integration agentstesting- Testing and validation agentsarchitecture- System architecture agentsdocumentation- Documentation agentsanalysis- Code analysis agentsspecialized- Domain-specific agentsdevops- DevOps and CI/CD agentsoptimization- Performance optimization agentstemplates- Template and boilerplate agentsdata- Data processing agentshive-mind- Collective intelligence agentssparc- SPARC methodology agents
All directories are functional and can contain agents of any type. This allows for flexible organization where agents are grouped by their domain or purpose rather than strictly by type.
For example:
consensus/can contain swarm coordinators, analysis agents, or any type that works with consensus protocolsgithub/can contain architecture agents, swarm agents, or any type related to GitHub operationscore/can contain planning agents, research agents, or any type providing core functionality
Common directories:
core/- Core functionality agentsswarm/- Swarm coordination and multi-agent systemsconsensus/- Consensus protocols and distributed systemsgithub/- GitHub integration and repository managementtesting/- Testing and validationarchitecture/- System design and architecturedocumentation/- Documentation generationanalysis/- Code analysis and reviewspecialized/- Domain-specific agentstemplates/- Template and boilerplate generatorssparc/- SPARC methodology agentshive-mind/- Collective intelligencedevelopment/- Development workflowdevops/- DevOps and CI/CDoptimization/- Performance optimizationdata/- Data processing
GitHub agents often have tools in array format. The toolkit automatically converts to object format:
# Before (array)
tools: [Read, Write, Bash]
# After (object)
tools:
allowed: [Read, Write, Bash]
restricted: [Task]
conditional: []The toolkit can fix type mismatches using intelligent mapping:
developerβcorecoordinatorβswarmanalystβanalysis- etc.
The toolkit automatically adds missing required fields with sensible defaults based on agent type.
# Quick health check
npx @aigentics/agent-toolkit claude-flow-hooks status
# Fix any issues found
npx @aigentics/agent-toolkit claude-flow-hooks auto-fix
# Validate everything works
npx @aigentics/agent-toolkit claude-flow-hooks validate# In CI/CD pipelines
npx @aigentics/agent-toolkit agent-toolkit validate -f json
npx @aigentics/agent-toolkit claude-flow-hooks validate# Intelligent context-aware fixing
npx @aigentics/agent-toolkit claude-flow-hooks smart-fix
# Interactive guided fixing
npx @aigentics/agent-toolkit claude-flow-hooks interactive
# System analysis
npx @aigentics/agent-toolkit agent-toolkit analyze# Create new agents
npx @aigentics/agent-toolkit agent-toolkit create my-agent -i
npx @aigentics/agent-toolkit agent-toolkit list-templates- COMMAND_REFERENCE.md - Complete command reference (13 commands)
- NPX_USAGE_GUIDE.md - Comprehensive NPX usage guide
- HOOK_SYSTEM_ANALYSIS.md - Technical analysis of hook system
- COMPREHENSIVE_TEST_RESULTS.md - Testing validation (98/100)
- Regular validation -
claude-flow-hooks statusweekly - Safe fixing - Always creates .backup files automatically
- Context awareness - Use smart-fix for complex scenarios
- Error handling - All agents should have on_error hooks
- Always validate before deployment
- Use consistent naming (kebab-case)
- Define clear capabilities for each agent
- Set appropriate security constraints
- Enable monitoring for production agents
- Document agent purpose and usage
- Test agents in isolation first
π HOOK SYSTEM VALIDATION SUMMARY
β
Valid: 63 files (94%)
β οΈ Issues: 4 files (template placeholders)
π§ Auto-fixed: 62 files
π§ Smart-fixed: 17 files
π Production score: 98/100
- Hook reliability: 9% β 94% (950% improvement)
- Error handling: 3% β 97% (3,100% improvement)
- Validation speed: 67 agents in 0.154 seconds
- Fix automation: 96.5% reduction in manual work
# Enterprise team workflow
npx @aigentics/agent-toolkit claude-flow-hooks status # Daily health check
npx @aigentics/agent-toolkit claude-flow-hooks auto-fix # Weekly maintenance
npx @aigentics/agent-toolkit agent-toolkit analyze # Monthly analysis- π¦ NPM Package: @aigentics/agent-toolkit
- π GitHub Repository: claude-flow-agent-toolkit
- π Documentation: Complete guides and references
- π Issues & Support: GitHub Issues
- π Releases: Version history and changelogs
Contributions welcome! Ensure all agents pass validation:
npx @aigentics/agent-toolkit agent-toolkit validate
npx @aigentics/agent-toolkit claude-flow-hooks validateMIT Β© 2025 Aigentics / Teemu Linna
Transform your Claude Flow agent system into enterprise-grade coordination with just one NPX command! π