npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin epieczko-bettyThis skill uses the workspace's default tool permissions.
**Version:** 0.1.0
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Version: 0.1.0 Status: Active Tags: agents, execution, claude-api, orchestration, layer2
The agent.run skill executes registered Betty agents by orchestrating the complete agent lifecycle: loading manifests, generating Claude-friendly prompts, invoking the Claude API (or simulating), executing planned skills, and logging all results.
This skill is the primary execution engine for Betty agents, enabling them to operate in both iterative and oneshot reasoning modes. It handles the translation between agent manifests and Claude API calls, manages skill invocation, and provides comprehensive logging for auditability.
agent_logs/<agent>_<timestamp>.json# Execute agent by name
python skills/agent.run/agent_run.py api.designer
# Execute with task context
python skills/agent.run/agent_run.py api.designer "Design a REST API for user management"
# Execute from manifest path
python skills/agent.run/agent_run.py agents/api.designer/agent.yaml "Create authentication API"
# Execute without saving logs
python skills/agent.run/agent_run.py api.designer "Design API" --no-save-log
import sys
import os
sys.path.insert(0, os.path.abspath("./"))
from skills.agent.run.agent_run import run_agent
# Execute agent
result = run_agent(
agent_path="api.designer",
task_context="Design a REST API for user management with authentication",
save_log=True
)
if result["ok"]:
print(f"Agent executed successfully!")
print(f"Skills invoked: {result['details']['summary']['skills_executed']}")
print(f"Log saved to: {result['details']['log_path']}")
else:
print(f"Execution failed: {result['errors']}")
# Using the Betty plugin command
/agent/run api.designer "Design authentication API"
# With full path
/agent/run agents/api.designer/agent.yaml "Create user management endpoints"
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
agent_path | string | Yes | - | Path to agent.yaml or agent name (e.g., api.designer) |
task_context | string | No | None | Task or query to provide to the agent |
save_log | boolean | No | true | Whether to save execution log to disk |
{
"ok": true,
"status": "success",
"timestamp": "2025-10-23T14:30:00Z",
"errors": [],
"details": {
"timestamp": "2025-10-23T14:30:00Z",
"agent": {
"name": "api.designer",
"version": "0.1.0",
"description": "Design RESTful APIs...",
"reasoning_mode": "iterative",
"status": "active"
},
"task_context": "Design a REST API for user management",
"prompt": "You are api.designer, a specialized Betty Framework agent...",
"skills_available": [
{
"name": "api.define",
"description": "Create OpenAPI specifications",
"status": "active"
}
],
"missing_skills": [],
"claude_response": {
"analysis": "I will design a comprehensive user management API...",
"skills_to_invoke": [
{
"skill": "api.define",
"purpose": "Create initial OpenAPI spec",
"inputs": {"guidelines": "zalando"},
"order": 1
}
],
"reasoning": "Following API design workflow pattern"
},
"execution_results": [
{
"skill": "api.define",
"purpose": "Create initial OpenAPI spec",
"status": "simulated",
"timestamp": "2025-10-23T14:30:05Z",
"output": {
"success": true,
"note": "Simulated execution of api.define"
}
}
],
"summary": {
"skills_planned": 3,
"skills_executed": 3,
"success": true
},
"log_path": "/home/user/betty/agent_logs/api.designer_20251023_143000.json"
}
}
In oneshot mode, the agent analyzes the complete task and plans all skill invocations upfront in a single pass. The execution follows the predetermined plan without dynamic adjustment.
Best for:
Example Agent:
name: api.generator
reasoning_mode: oneshot
workflow_pattern: |
1. Define API structure
2. Validate specification
3. Generate models
In iterative mode, the agent analyzes results after each skill invocation and dynamically determines the next steps. It can retry failed operations, adjust its approach based on feedback, or invoke additional skills as needed.
Best for:
Example Agent:
name: api.designer
reasoning_mode: iterative
workflow_pattern: |
1. Analyze requirements
2. Draft OpenAPI spec
3. Validate (if fails, refine and retry)
4. Generate models
python skills/agent.run/agent_run.py api.designer \
"Create a REST API for managing blog posts with CRUD operations"
Output:
================================================================================
AGENT EXECUTION: api.designer
================================================================================
Agent: api.designer v0.1.0
Mode: iterative
Status: active
Task: Create a REST API for managing blog posts with CRUD operations
--------------------------------------------------------------------------------
CLAUDE RESPONSE:
--------------------------------------------------------------------------------
{
"analysis": "I will design a RESTful API following best practices...",
"skills_to_invoke": [
{
"skill": "api.define",
"purpose": "Create initial OpenAPI specification",
"inputs": {"guidelines": "zalando", "format": "openapi-3.1"},
"order": 1
},
{
"skill": "api.validate",
"purpose": "Validate the specification for compliance",
"inputs": {"strict_mode": true},
"order": 2
}
]
}
--------------------------------------------------------------------------------
EXECUTION RESULTS:
--------------------------------------------------------------------------------
✓ api.define
Purpose: Create initial OpenAPI specification
Status: simulated
✓ api.validate
Purpose: Validate the specification for compliance
Status: simulated
📝 Log saved to: /home/user/betty/agent_logs/api.designer_20251023_143000.json
================================================================================
EXECUTION COMPLETE
================================================================================
python skills/agent.run/agent_run.py \
agents/api.analyzer/agent.yaml \
"Analyze this OpenAPI spec for compatibility issues"
python skills/agent.run/agent_run.py api.designer \
"Design authentication API" \
--no-save-log
from skills.agent.run.agent_run import run_agent, load_agent_manifest
# Load and inspect agent before running
manifest = load_agent_manifest("api.designer")
print(f"Agent capabilities: {manifest['capabilities']}")
# Execute with custom context
result = run_agent(
agent_path="api.designer",
task_context="Design GraphQL API for e-commerce",
save_log=True
)
if result["ok"]:
# Access execution details
claude_response = result["details"]["claude_response"]
execution_results = result["details"]["execution_results"]
print(f"Claude planned {len(claude_response['skills_to_invoke'])} skills")
print(f"Executed {len(execution_results)} skills")
# Check individual skill results
for exec_result in execution_results:
print(f" - {exec_result['skill']}: {exec_result['status']}")
For agent.run to successfully execute an agent, the agent manifest must include:
name: agent.name # Must match pattern ^[a-z][a-z0-9._-]*$
version: 0.1.0 # Semantic version
description: "..." # Clear description
capabilities: # List of capabilities
- "Capability 1"
- "Capability 2"
skills_available: # List of Betty skills
- skill.name.1
- skill.name.2
reasoning_mode: iterative # 'iterative' or 'oneshot'
workflow_pattern: | # Recommended workflow steps
1. Step 1
2. Step 2
3. Step 3
context_requirements: # Optional context hints
guidelines: string
domain: string
error_handling: # Error handling config
max_retries: 3
timeout_seconds: 300
status: active # Agent status (draft/active/deprecated)
tags: # Categorization tags
- tag1
- tag2
The skill supports both real Claude API calls and mock simulation:
Set the ANTHROPIC_API_KEY environment variable:
export ANTHROPIC_API_KEY="sk-ant-..."
python skills/agent.run/agent_run.py api.designer "Design API"
The skill will:
Without an API key, the skill generates intelligent mock responses:
python skills/agent.run/agent_run.py api.designer "Design API"
The skill will:
All agent executions are logged to agent_logs/<agent>_<timestamp>.json with:
{
"timestamp": "2025-10-23T14:30:00Z",
"agent": { /* agent metadata */ },
"task_context": "Design API for...",
"prompt": "You are api.designer...",
"skills_available": [ /* skill info */ ],
"missing_skills": [],
"claude_response": { /* Claude's plan */ },
"execution_results": [ /* skill outputs */ ],
"summary": {
"skills_planned": 3,
"skills_executed": 3,
"success": true
}
}
# View latest log for an agent
cat agent_logs/api.designer_latest.json | jq '.'
# View specific execution
cat agent_logs/api.designer_20251023_143000.json | jq '.summary'
# List all logs for an agent
ls -lt agent_logs/api.designer_*.json
Agent Not Found
{
"ok": false,
"status": "failed",
"errors": ["Agent not found: my.agent"],
"details": {
"error": {
"type": "BettyError",
"message": "Agent not found: my.agent",
"details": {
"agent_path": "my.agent",
"expected_path": "/home/user/betty/agents/my.agent/agent.yaml",
"suggestion": "Use 'betty agent list' to see available agents"
}
}
}
}
Invalid Agent Manifest
{
"ok": false,
"errors": ["Agent manifest missing required fields: reasoning_mode, capabilities"],
"details": {
"error": {
"type": "BettyError",
"details": {
"missing_fields": ["reasoning_mode", "capabilities"]
}
}
}
}
Skill Not Found
missing_skills arraybetty agent validate <agent_path>skills_available are registeredagent_logs/<agent>_latest.json for detailsBETTY_LOG_LEVEL=DEBUGsave_log=true)agent.run depends on:
The skill is registered in plugin.yaml as:
- name: agent/run
description: Execute a registered Betty agent
handler:
runtime: python
script: skills/agent.run/agent_run.py
parameters:
- name: agent_path
type: string
required: true
This enables Claude Code to invoke agents directly:
User: "Run the API designer agent to create a user management API"
Claude: [Invokes /agent/run api.designer "create user management API"]
Planned features for future versions:
v0.2.0:
v0.3.0:
v0.4.0:
Part of the Betty Framework. See project LICENSE for details.
For issues, questions, or contributions:
/docs/skills/agent.run.md/examples/agents/