agent-design
/agent-design
Design AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows.
- Author
- buldee ↗
- Repository
- ai-craftsman-superpowers ↗
- Licence
- Apache-2.0
- Last repository change
- 24.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Design AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows.
Original author description
Design AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows.
How it works
- Outcome Contract
- 3P Pattern Overview
- Phase 1: PERCEIVE
- Phase 2: PLAN
- Phase 3: PERFORM
- Phase 4: REFLECT
- Tool Design Pattern
- Agent Design Template
- Anti-Patterns
- Process
SKILL.md preview
---
model: opus
description: Design AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows.
effort: xhigh
---
# /craftsman:agent-design - 3P Pattern Architecture
## Outcome Contract
- **Outcome**: an agent design following the 3P pattern with explicit tool boundaries and failure handling.
- **Done when**: Perceive, Plan, and Perform are each specified, tool access is scoped and justified, and failure modes have defined recovery paths.
- **Evidence**: the 3P breakdown, the tool list with rationale, and the failure scenarios covered.
Design AI agents using the Perceive-Plan-Perform (3P) cognitive architecture.
## 3P Pattern Overview
```
┌─────────────────────────────────────────────────────────────────┐
│ AGENT COGNITIVE LOOP │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ PERCEIVE │─────▶│ PLAN │─────▶│ PERFORM │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │ │ │
│ │ ┌──────────┐ │ │
│ └────────────│ REFLECT │◀───────────┘ │
│ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
```
## Phase 1: PERCEIVE
Gather and interpret information from the environment.
```python
class Perceiver:
"""Gathers context and interprets the environment."""
def perceive(self, input: str, context: Context) -> Perception:
return Perception(
user_intent=self.extract_intent(input),
entities=self.extract_entities(input),
context_summary=self.summarize_context(context),
constraints=self.identify_constraints(input),
ambiguities=self.detect_ambiguities(input),
)
def extract_intent(self, input: str) -> Intent:
"""Classify user intent: question, command, clarification, etc."""
pass
def detect_ambiguities(self, input: str) -> list[Ambiguity]:
"""Identify unclear aspects requiring clarification."""
pass
```
### Perception Checklist
- [ ] User intent identified
- [ ] Key entities extracted
- [ ] Context summarized
- [ ] Constraints recognized
- [ ] Ambiguities flagged (ask before assuming)
## Phase 2: PLAN
Devise a strategy to achieve the goal.
```python
class Planner:
"""Creates action plans based on perception."""
def plan(self, perception: Perception, tools: list[Tool]) -> Plan:
# 1. Break down into subtasks
subtasks = self.decompose(perception.user_intent)
# 2. Select tools for each subtask
tool_assignments = self.assign_tools(subtasks, tools)
# 3. Order by dependencies
ordered_tasks = self.topological_sort(tool_assignments)
# 4. Identify risks
risks = self.assess_risks(ordered_tasks)
return Plan(
tasks=ordered_tasks,
risks=risks,
estimated_steps=len(ordered_tasks),
)
def decompose(self, intent: Intent) -> list[Subtask]:
"""Break complex goals into atomic subtasks."""
pass
```
### Planning Checklist
- [ ] Goal decomposed into subtasks
- [ ] Tools selected for each subtask
- [ ] Dependencies identified
- [ ] Risks assessed
- [ ] Fallback strategies defined
## Phase 3: PERFORM
Execute the plan using available tools.
```python
class Performer:
"""Executes plan steps using tools."""
def perform(self, plan: Plan, tools: ToolRegistry) -> list[Result]:
results = []
for task in plan.tasks:
# Select tool
tool = tools.get(task.tool_name)
# Execute with error handling
try:
result = tool.execute(task.parameters)
results.append(Result(task=task, output=result, status="success"))
except ToolError as e:
# Attempt recovery
recovery = self.recover(task, e, tools)
results.append(recovery)
# Reflect after each step
self.reflect(task, results[-1])
return results
```
### Execution Checklist
- [ ] Tool executed correctly
- [ ] Output validated
- [ ] Errors handled gracefully
- [ ] Progress tracked
- [ ] Reflection after each step
## Phase 4: REFLECT
Learn from execution and adjust.
```python
class Reflector:
"""Reflects on execution and adjusts strategy."""
def reflect(self, task: Task, result: Result) -> Reflection:
return Reflection(
success=result.status == "success",
lessons_learned=self.extract_lessons(result),
plan_adjustments=self.suggest_adjustments(result),
should_continue=self.evaluate_progress(result),
)
def extract_lessons(self, result: Result) -> list[str]:
"""What worked? What didn't?"""
pass
```
## Tool Design Pattern
```python
from abc import ABC, abstractmethod
from pydantic import BaseModel
class ToolInput(BaseModel):
"""Base class for tool inputs with validation."""
pass
class ToolOutput(BaseModel):
"""Base class for tool outputs."""
success: bool
data: Any
error: str | None = None
class Tool(ABC):
"""Base tool interface."""
@property
@abstractmethod
def name(self) -> str:
pass
@property
@abstractmethod
def description(self) -> str:
"""Used by LLM to decide when to use this tool."""
pass
@property
@abstractmethod
def parameters_schema(self) -> dict:
"""JSON schema for parameters."""
pass
@abstractmethod
def execute(self, params: ToolInput) -> ToolOutput:
pass
```
## Agent Design Template
```markdown
# Agent Design: [Agent Name]
## Purpose
[What problem does this agent solve?]
## Capabilities
- [ ] Capability 1
- [ ] Capability 2
## Tools Available
| Tool | Purpose | Risk Level |
|------|---------|------------|
| read_file | Read file contents | Low |
| write_file | Write file contents | Medium |
| execute_code | Run code | High |
## Workflow
### Perceive
- Inputs: [What the agent receives]
- Extraction: [What it identifies]
### Plan
- Decomposition strategy: [How it breaks down tasks]
- Tool selection criteria: [How it chooses tools]
### Perform
- Execution strategy: [Sequential, Parallel]
- Error handling: [Recovery strategies]
### Reflect
- Success criteria: [How it knows it succeeded]
- Learning: [What it remembers]
## Safety Constraints
- [ ] Confirmation required for: [destructive actions]
- [ ] Rate limits: [X calls per minute]
- [ ] Sandboxing: [isolated execution]
- [ ] Audit logging: [all actions logged]
## Example Interaction
```
User: [Example input]
PERCEIVE:
- Intent: [identified intent]
- Entities: [extracted entities]
PLAN:
1. [Step 1]
2. [Step 2]
PERFORM:
- Tool: [tool used]
- Result: [output]
REFLECT:
- Success: [yes/no]
- Adjustment: [if needed]
Response: [Final output to user]
```
```
## Anti-Patterns
| Anti-Pattern | Problem | Solution |
|--------------|---------|----------|
| No planning | Random tool calls | Always plan first |
| No reflection | Repeats mistakes | Reflect after each step |
| Overconfidence | Assumes success | Verify outputs |
| No error handling | Crashes on failure | Graceful recovery |
| No constraints | Dangerous actions | Safety boundaries |
## Process
1. **Define agent purpose and scope**
2. **Design perception layer**
3. **Create planning strategy**
4. **Implement tool interfaces**
5. **Add reflection loop**
6. **Define safety constraints**
7. **Test with edge cases**
Files in this package (2)
- .craftsman-pack-source 1 KB
- SKILL.md 8 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · buldee/ai-craftsman-superpowers | 84 | Apache-2.0 |
| sarthakrastogi/agent-engineer | 100 | MIT |
| The-Utopia-Studio/skills | 100 | Apache-2.0 |
| nimadorostkar/Claude-Skills-collection | 100 | MIT |
| xiaolai/cc-suite | 100 | ISC |
| fusengine/agents | 100 | MIT |
| nahid-sparktales/agent-dispatcher | 90 | MIT |
Database snapshot: 13.11.2026 · package version 7b6f0c626a53 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100ai-agents-architect
Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration. Use when: build agent, AI agent, autonomous agent, tool use, function calling. - 100agent-native-architecture
This skill should be used when designing agent-native applications where agents are first-class citizens: architecting autonomous agents, creating MCP tools, building apps where features are agent-driven outcomes. - 95autogpt-agents
Autonomous AI agent platform for building and deploying continuous agents. Use when creating visual workflow agents, deploying persistent autonomous agents, or building complex multi-step AI automation systems. - 93ai-agent-core-loop
Use this skill when the user says 'agent loop', 'perceive think act', 'ReAct vs plan-and-solve', 'agent keeps looping', 'agent self-reflection', 'Reflexion', 'agent termination condition'. Explains and implements the mechanics of a single agent's control loop: observation… - 100lwy-project-agent-writer
Use this skill when the user wants to create, update, or design a project-level agent (.agents/agents/*.md). Analyze the user's question and project context to design a work plan. Triggers: 'create agent', 'build an agent', 'add agent', 'design agent', 'update agent', 'project… - 100agent-builder
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI system" (2) want to understand agent architecture, agentic patterns, or autonomous AI (3) need help with capabilities, subagents, planning, or skill…