JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q43325F
  • License MIT

Comprehensive toolkit for validating and managing Claude Flow agent systems

Package Exports

  • @aigentics/agent-toolkit
  • @aigentics/agent-toolkit/src/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@aigentics/agent-toolkit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🤖 Claude Flow Agent Toolkit

npm version License: MIT GitHub Release NPX Ready

🚀 Enterprise-grade toolkit for validating, fixing, and managing Claude Flow AI agent systems with comprehensive hook management and NPX support

🎯 What This Toolkit Does

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)

🚀 Key Features

🔧 Hook Management System (NEW!)

  • 🔍 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

🎯 Agent Management

  • 🔍 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

📦 Installation & Usage

# 🔧 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-agent

Global Installation

npm install -g @aigentics/agent-toolkit

# Then use directly:
claude-flow-hooks validate
agent-toolkit validate

🔧 Quick Start - Hook Management

🎯 Most Common Use Case: Fix Agent Hooks

# 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

🔍 Hook Commands Reference

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

🤖 Full Agent Management

Agent Configuration Commands

# 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

🔧 Agent Commands Reference

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

📊 Performance & Metrics

🏆 Hook System Transformation Results

  • ✅ Before: 6 agents with valid hooks (9%)
  • ✅ After: 63+ agents with valid hooks (94%)
  • 📊 Improvement: 950% increase in hook reliability

⚡ Tool Performance

  • 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

🛡️ Reliability Features

  • 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

Programmatic API

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']
});

Configuration Schema

Required Fields

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 code
  • description - Agent description
  • version - Semantic version (e.g., 1.0.0)
  • priority - Priority level (high, medium, low)
  • capabilities - Array of capabilities
  • triggers - Activation triggers
  • tools - Tool access configuration
  • constraints - Execution constraints
  • communication - Inter-agent communication
  • dependencies - Agent dependencies
  • resources - Resource limits
  • execution - Execution settings
  • security - Security configuration
  • monitoring - Monitoring settings
  • hooks - Pre/post execution hooks

Valid Agent Types

  • core - Core functionality agents
  • swarm - Swarm coordination agents
  • consensus - Consensus protocol agents
  • github - GitHub integration agents
  • testing - Testing and validation agents
  • architecture - System architecture agents
  • documentation - Documentation agents
  • analysis - Code analysis agents
  • specialized - Domain-specific agents
  • devops - DevOps and CI/CD agents
  • optimization - Performance optimization agents
  • templates - Template and boilerplate agents
  • data - Data processing agents
  • hive-mind - Collective intelligence agents
  • sparc - SPARC methodology agents

Directory Organization

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 protocols
  • github/ can contain architecture agents, swarm agents, or any type related to GitHub operations
  • core/ can contain planning agents, research agents, or any type providing core functionality

Common directories:

  • core/ - Core functionality agents
  • swarm/ - Swarm coordination and multi-agent systems
  • consensus/ - Consensus protocols and distributed systems
  • github/ - GitHub integration and repository management
  • testing/ - Testing and validation
  • architecture/ - System design and architecture
  • documentation/ - Documentation generation
  • analysis/ - Code analysis and review
  • specialized/ - Domain-specific agents
  • templates/ - Template and boilerplate generators
  • sparc/ - SPARC methodology agents
  • hive-mind/ - Collective intelligence
  • development/ - Development workflow
  • devops/ - DevOps and CI/CD
  • optimization/ - Performance optimization
  • data/ - Data processing

Common Issues and Fixes

Tools Format

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: []

Type Mismatches

The toolkit can fix type mismatches using intelligent mapping:

  • developercore
  • coordinatorswarm
  • analystanalysis
  • etc.

Missing Fields

The toolkit automatically adds missing required fields with sensible defaults based on agent type.

👥 For Different User Types

👨‍💻 For Developers (Most Common)

# 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

👷 For DevOps/CI Integration

# In CI/CD pipelines
npx @aigentics/agent-toolkit agent-toolkit validate -f json
npx @aigentics/agent-toolkit claude-flow-hooks validate

🔬 For Advanced Users

# 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

🎯 For New Projects

# Create new agents
npx @aigentics/agent-toolkit agent-toolkit create my-agent -i
npx @aigentics/agent-toolkit agent-toolkit list-templates

📚 Documentation

🏆 Best Practices

🔧 Hook Management

  1. Regular validation - claude-flow-hooks status weekly
  2. Safe fixing - Always creates .backup files automatically
  3. Context awareness - Use smart-fix for complex scenarios
  4. Error handling - All agents should have on_error hooks

🤖 Agent Development

  1. Always validate before deployment
  2. Use consistent naming (kebab-case)
  3. Define clear capabilities for each agent
  4. Set appropriate security constraints
  5. Enable monitoring for production agents
  6. Document agent purpose and usage
  7. Test agents in isolation first

🎆 Success Stories

📊 Transformation Results

📊 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

⚡ Performance Improvements

  • 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

🚀 Real-World Usage

# 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

🤝 Contributing

Contributions welcome! Ensure all agents pass validation:

npx @aigentics/agent-toolkit agent-toolkit validate
npx @aigentics/agent-toolkit claude-flow-hooks validate

📝 License

MIT © 2025 Aigentics / Teemu Linna


Transform your Claude Flow agent system into enterprise-grade coordination with just one NPX command! 🎆