Skip to content
Skills Library
AI & agents · Building & coding

agent-design

/agent-design

Design AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows.

Licence
Apache-2.0
Last repository change
24.10.2026

Assessment and security

84/ 100Class: good
Format9 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

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

  1. Outcome Contract
  2. 3P Pattern Overview
  3. Phase 1: PERCEIVE
  4. Phase 2: PLAN
  5. Phase 3: PERFORM
  6. Phase 4: REFLECT
  7. Tool Design Pattern
  8. Agent Design Template
  9. Anti-Patterns
  10. Process
Original SKILL.md headings · 293 lines, 888 words
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

RepositoryScoreLicence
This page · buldee/ai-craftsman-superpowers84Apache-2.0
sarthakrastogi/agent-engineer100MIT
The-Utopia-Studio/skills100Apache-2.0
nimadorostkar/Claude-Skills-collection100MIT
xiaolai/cc-suite100ISC
fusengine/agents100MIT
nahid-sparktales/agent-dispatcher90MIT

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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.