agent-design
Skill35 starsChanged 53 days agoApache-2.0View on GitHub
Design AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- mariomile/builder-ostheir own version, first seen Nov 1, 2026
- xiaolai/cc-suitetheir own version, first seen Oct 19, 2026
- bingyue/fde-skillstheir own version, first seen Oct 13, 2026
- The-Utopia-Studio/skillstheir own version, first seen Oct 13, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- wibus-wee/cradle-app★ 75same name
- nahid-sparktales/agent-dispatcher★ 59same name
- xiaolai/cc-suite★ 56same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- The-Utopia-Studio/skills★ 6same name
- bingyue/fde-skills★ 5same name
- Minions-Land/Soup_Drinking★ 4same name
- tienenwu/fables★ 4same name
- freezingfunky/ashwin-skills★ 2same name
- gmanch94/claude-code-aidlc-template★ 2same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
The file
Files
/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.
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."""
passPerception 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.
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."""
passPlanning 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.
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 resultsExecution Checklist
- Tool executed correctly
- Output validated
- Errors handled gracefully
- Progress tracked
- Reflection after each step
Phase 4: REFLECT
Learn from execution and adjust.
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?"""
passTool Design Pattern
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:
passAgent Design Template
# 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:
- [Step 1]
- [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
- Define agent purpose and scope
- Design perception layer
- Create planning strategy
- Implement tool interfaces
- Add reflection loop
- Define safety constraints
- Test with edge cases
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

