hive
npx skills add https://github.com/adenhq/hive --skill hive
Agent 安装分布
Skill 文档
Agent Development Workflow
THIS IS AN EXECUTABLE WORKFLOW. DO NOT explore the codebase or read source files. ROUTE to the correct skill IMMEDIATELY.
When this skill is loaded, ALWAYS use the AskUserQuestion tool to present options:
Use AskUserQuestion with these options:
- "Build a new agent" â Then invoke /hive-create
- "Test an existing agent" â Then invoke /hive-test
- "Learn agent concepts" â Then invoke /hive-concepts
- "Optimize agent design" â Then invoke /hive-patterns
- "Set up credentials" â Then invoke /hive-credentials
- "Debug a failing agent" â Then invoke /hive-debugger
- "Other" (please describe what you want to achieve)
DO NOT: Read source files, explore the codebase, search for code, or do any investigation before routing. The sub-skills handle all of that.
Complete Standard Operating Procedure (SOP) for building production-ready goal-driven agents.
Overview
This workflow orchestrates specialized skills to take you from initial concept to production-ready agent:
- Understand Concepts â
/hive-concepts(optional) - Build Structure â
/hive-create - Optimize Design â
/hive-patterns(optional) - Setup Credentials â
/hive-credentials(if agent uses tools requiring API keys) - Test & Validate â
/hive-test - Debug Issues â
/hive-debugger(if agent fails at runtime)
When to Use This Workflow
Use this meta-skill when:
- Starting a new agent from scratch
- Unclear which skill to use first
- Need end-to-end guidance for agent development
- Want consistent, repeatable agent builds
Skip this workflow if:
- You only need to test an existing agent â use
/hive-testdirectly - You know exactly which phase you’re in â use specific skill directly
Quick Decision Tree
"Need to understand agent concepts" â hive-concepts
"Build a new agent" â hive-create
"Optimize my agent design" â hive-patterns
"Need client-facing nodes or feedback loops" â hive-patterns
"Set up API keys for my agent" â hive-credentials
"Test my agent" â hive-test
"My agent is failing/stuck/has errors" â hive-debugger
"Not sure what I need" â Read phases below, then decide
"Agent has structure but needs implementation" â See agent directory STATUS.md
Phase 0: Understand Concepts (Optional)
Skill: /hive-concepts
Input: Questions about agent architecture
When to Use
- First time building an agent
- Need to understand node types, edges, goals
- Want to validate tool availability
- Learning about event loop architecture and client-facing nodes
What This Phase Provides
- Architecture overview (Python packages, not JSON)
- Core concepts (Goal, Node, Edge, Event Loop, Judges)
- Tool discovery and validation procedures
- Workflow overview
Skip this phase if you already understand agent fundamentals.
Phase 1: Build Agent Structure
Skill: /hive-create
Input: User requirements (“Build an agent that…”) or a template to start from
What This Phase Does
Creates the complete agent architecture:
- Package structure (
exports/agent_name/) - Goal with success criteria and constraints
- Workflow graph (nodes and edges)
- Node specifications
- CLI interface
- Documentation
Process
- Create package – Directory structure with skeleton files
- Define goal – Success criteria and constraints written to agent.py
- Design nodes – Each node approved and written incrementally
- Connect edges – Workflow graph with conditional routing
- Finalize – Agent class, exports, and documentation
Outputs
- â
exports/agent_name/package created - â Goal defined in agent.py
- â 3-5 success criteria defined
- â 1-5 constraints defined
- â 5-10 nodes specified in nodes/init.py
- â 8-15 edges connecting workflow
- â
Validated structure (passes
uv run python -m agent_name validate) - â README.md with usage instructions
- â CLI commands (info, validate, run, shell)
Success Criteria
You’re ready for Phase 2 when:
- Agent structure validates without errors
- All nodes and edges are defined
- CLI commands work (info, validate)
- You see: “Agent complete: exports/agent_name/”
Common Outputs
The hive-create skill produces:
exports/agent_name/
âââ __init__.py (package exports)
âââ __main__.py (CLI interface)
âââ agent.py (goal, graph, agent class)
âââ nodes/__init__.py (node specifications)
âââ config.py (configuration)
âââ implementations.py (may be created for Python functions)
âââ README.md (documentation)
Next Steps
If structure complete and validated:
â Check exports/agent_name/STATUS.md or IMPLEMENTATION_GUIDE.md
â These files explain implementation options
â You may need to add Python functions or MCP tools (not covered by current skills)
If want to optimize design: â Proceed to Phase 1.5 (hive-patterns)
If ready to test: â Proceed to Phase 2
Phase 1.5: Optimize Design (Optional)
Skill: /hive-patterns
Input: Completed agent structure
When to Use
- Want to add client-facing blocking or feedback edges
- Need judge patterns for output validation
- Want fan-out/fan-in (parallel execution)
- Need error handling patterns
- Want best practices guidance
What This Phase Provides
- Client-facing interaction patterns
- Feedback edge routing with nullable output keys
- Judge patterns (implicit, SchemaJudge)
- Fan-out/fan-in parallel execution
- Context management and spillover patterns
- Anti-patterns to avoid
Skip this phase if your agent design is straightforward.
Phase 2: Test & Validate
Skill: /hive-test
Input: Working agent from Phase 1
What This Phase Does
Guides the creation and execution of a comprehensive test suite:
- Constraint tests
- Success criteria tests
- Edge case tests
- Integration tests
Process
- Analyze agent – Read goal, constraints, success criteria
- Generate tests – The calling agent writes pytest files in
exports/agent_name/tests/using hive-test guidelines and templates - User approval – Review and approve each test
- Run evaluation – Execute tests and collect results
- Debug failures – Identify and fix issues
- Iterate – Repeat until all tests pass
Outputs
- â
Test files in
exports/agent_name/tests/ - â Test report with pass/fail metrics
- â Coverage of all success criteria
- â Coverage of all constraints
- â Edge case handling verified
Success Criteria
You’re done when:
- All tests pass
- All success criteria validated
- All constraints verified
- Agent handles edge cases
- Test coverage is comprehensive
Next Steps
Agent ready for:
- Production deployment
- Integration into larger systems
- Documentation and handoff
- Continuous monitoring
Phase Transitions
From Phase 1 to Phase 2
Trigger signals:
- “Agent complete: exports/…”
- Structure validation passes
- README indicates implementation complete
Before proceeding:
- Verify agent can be imported:
from exports.agent_name import default_agent - Check if implementation is needed (see STATUS.md or IMPLEMENTATION_GUIDE.md)
- Confirm agent executes without import errors
Skipping Phases
When to skip Phase 1:
- Agent structure already exists
- Only need to add tests
- Modifying existing agent
When to skip Phase 2:
- Prototyping or exploring
- Agent not production-bound
- Manual testing sufficient
Common Patterns
Pattern 1: Complete New Build (Simple)
User: "Build an agent that monitors files"
â Use /hive-create
â Agent structure created
â Use /hive-test
â Tests created and passing
â Done: Production-ready agent
Pattern 1b: Complete New Build (With Learning)
User: "Build an agent (first time)"
â Use /hive-concepts (understand concepts)
â Use /hive-create (build structure)
â Use /hive-patterns (optimize design)
â Use /hive-test (validate)
â Done: Production-ready agent
Pattern 1c: Build from Template
User: "Build an agent based on the deep research template"
â Use /hive-create
â Select "From a template" path
â Pick template, name new agent
â Review/modify goal, nodes, graph
â Agent exported with customizations
â Use /hive-test
â Done: Customized agent
Pattern 2: Test Existing Agent
User: "Test my agent at exports/my_agent"
â Skip Phase 1
â Use /hive-test directly
â Tests created
â Done: Validated agent
Pattern 3: Iterative Development
User: "Build an agent"
â Use /hive-create (Phase 1)
â Implementation needed (see STATUS.md)
â [User implements functions]
â Use /hive-test (Phase 2)
â Tests reveal bugs
â [Fix bugs manually]
â Re-run tests
â Done: Working agent
Pattern 4: Agent with Review Loops and HITL Checkpoints
User: "Build an agent with human review and feedback loops"
â Use /hive-concepts (learn event loop, client-facing nodes)
â Use /hive-create (build structure with feedback edges)
â Use /hive-patterns (implement client-facing + feedback patterns)
â Use /hive-test (validate review flows and edge routing)
â Done: Agent with HITL checkpoints and review loops
Skill Dependencies
hive (meta-skill)
â
âââ hive-concepts (foundational)
â âââ Architecture concepts (event loop, judges)
â âââ Node types (event_loop, function)
â âââ Edge routing and priority
â âââ Tool discovery procedures
â âââ Workflow overview
â
âââ hive-create (procedural)
â âââ Creates package structure
â âââ Defines goal
â âââ Adds nodes (event_loop, function)
â âââ Connects edges with priority routing
â âââ Finalizes agent class
â âââ Requires: hive-concepts
â
âââ hive-patterns (reference)
â âââ Client-facing interaction patterns
â âââ Feedback edges and review loops
â âââ Judge patterns (implicit, SchemaJudge)
â âââ Fan-out/fan-in parallel execution
â âââ Context management and anti-patterns
â
âââ hive-credentials (utility)
â âââ Detects missing credentials
â âââ Offers auth method choices (Aden OAuth, direct API key)
â âââ Stores securely in ~/.hive/credentials
â âââ Validates with health checks
â
âââ hive-test (validation)
â âââ Reads agent goal
â âââ Generates tests
â âââ Runs evaluation
â âââ Reports results
â
âââ hive-debugger (troubleshooting)
âââ Monitors runtime logs (L1/L2/L3)
âââ Identifies retry loops, tool failures
âââ Categorizes issues (10 categories)
âââ Provides fix recommendations
Troubleshooting
“Agent structure won’t validate”
- Check node IDs match between nodes/init.py and agent.py
- Verify all edges reference valid node IDs
- Ensure entry_node exists in nodes list
- Run:
PYTHONPATH=exports uv run python -m agent_name validate
“Agent has structure but won’t run”
- Check for STATUS.md or IMPLEMENTATION_GUIDE.md in agent directory
- Implementation may be needed (Python functions or MCP tools)
- This is expected – hive-create creates structure, not implementation
- See implementation guide for completion options
“Tests are failing”
- Review test output for specific failures
- Check agent goal and success criteria
- Verify constraints are met
- Use
/hive-testto debug and iterate - Fix agent code and re-run tests
“Agent is failing at runtime”
- Use
/hive-debuggerto analyze runtime logs - The debugger identifies retry loops, tool failures, and stalled execution
- Get actionable fix recommendations with code changes
- Monitor the agent in real-time during TUI sessions
“Not sure which phase I’m in”
Run these checks:
# Check if agent structure exists
ls exports/my_agent/agent.py
# Check if it validates
PYTHONPATH=exports uv run python -m my_agent validate
# Check if tests exist
ls exports/my_agent/tests/
# If structure exists and validates â Phase 2 (testing)
# If structure doesn't exist â Phase 1 (building)
# If tests exist but failing â Debug phase
Best Practices
For Phase 1 (Building)
- Start with clear requirements – Know what the agent should do
- Define success criteria early – Measurable goals drive design
- Keep nodes focused – One responsibility per node
- Use descriptive names – Node IDs should explain purpose
- Validate incrementally – Check structure after each major addition
For Phase 2 (Testing)
- Test constraints first – Hard requirements must pass
- Mock external dependencies – Use mock mode for LLMs/APIs
- Cover edge cases – Test failures, not just success paths
- Iterate quickly – Fix one test at a time
- Document test patterns – Future tests follow same structure
General Workflow
- Use version control – Git commit after each phase
- Document decisions – Update README with changes
- Keep iterations small – Build â Test â Fix â Repeat
- Preserve working states – Tag successful iterations
- Learn from failures – Failed tests reveal design issues
Exit Criteria
You’re done with the workflow when:
â Agent structure validates â All tests pass â Success criteria met â Constraints verified â Documentation complete â Agent ready for deployment
Additional Resources
- hive-concepts: See
.claude/skills/hive-concepts/SKILL.md - hive-create: See
.claude/skills/hive-create/SKILL.md - hive-patterns: See
.claude/skills/hive-patterns/SKILL.md - hive-test: See
.claude/skills/hive-test/SKILL.md - Agent framework docs: See
core/README.md - Example agents: See
exports/directory
Summary
This workflow provides a proven path from concept to production-ready agent:
- Learn with
/hive-conceptsâ Understand fundamentals (optional) - Build with
/hive-createâ Get validated structure - Optimize with
/hive-patternsâ Apply best practices (optional) - Configure with
/hive-credentialsâ Set up API keys (if needed) - Test with
/hive-testâ Get verified functionality - Debug with
/hive-debuggerâ Fix runtime issues (if needed)
The workflow is flexible – skip phases as needed, iterate freely, and adapt to your specific requirements. The goal is production-ready agents built with consistent, repeatable processes.
Skill Selection Guide
Choose hive-concepts when:
- First time building agents
- Need to understand event loop architecture
- Validating tool availability
- Learning about node types, edges, and judges
Choose hive-create when:
- Actually building an agent
- Have clear requirements
- Ready to write code
- Want step-by-step guidance
- Want to start from an existing template and customize it
Choose hive-patterns when:
- Agent structure complete
- Need client-facing nodes or feedback edges
- Implementing review loops or fan-out/fan-in
- Want judge patterns or context management
- Want best practices
Choose hive-test when:
- Agent structure complete
- Ready to validate functionality
- Need comprehensive test coverage
- Testing feedback loops, output keys, or fan-out
Choose hive-debugger when:
- Agent is failing or stuck at runtime
- Seeing retry loops or escalations
- Tool calls are failing
- Need to understand why a node isn’t completing
- Want real-time monitoring of agent execution