Plan architecture

From ils15/pantheon-legacy · View interactive version

Plan architecture is an AI agent skill from the GitHub repository ils15/pantheon-legacy. Plan feature architecture with component breakdown, data flow, and dependency mapping. Use before implementation to define contracts between layers.

How to use this skill

Skill file

Plan Architecture Skill

When to Use

Use this skill when:

Architecture Planning Workflow

1. Understand the Requirement

Before drawing boxes:

2. Component Breakdown

Break the feature into layers:

Request → Route/Handler → Service → Repository → Database
                       ↓
                   External APIs

For each component define:

3. Data Flow Diagram

Map the happy path first, then edge cases:

Client
  │ POST /feature
  ▼
Handler (validates input, calls service)
  │
  ▼
Service (business logic, orchestrates)
  │         │
  ▼         ▼
Repo     External API
  │
  ▼
Database

4. Dependency Map

| Component | Depends On | Depended By |

|-----------|-----------|-------------|

| Handler | Service | Client |

| Service | Repo, External API | Handler |

| Repo | Database | Service |

5. API Contracts

Define contracts before implementation:

# Input schema
class CreateFeatureRequest(BaseModel):
    name: str
    config: dict[str, Any]

# Output schema
class FeatureResponse(BaseModel):
    id: UUID
    name: str
    created_at: datetime

# Error cases
# 400 — validation error
# 404 — dependency not found
# 409 — conflict (already exists)
# 500 — upstream failure

6. Implementation Phases

Split into parallel-safe phases for TDD execution:

Phase 1 — Data layer (Demeter)
  - Migration: create table
  - Model: ORM class
  - Repository: CRUD methods + tests

Phase 2 — Service layer (Hermes) [depends on Phase 1]
  - Service class: business logic + tests
  - External API client + mock tests

Phase 3 — API layer (Hermes) [depends on Phase 2]
  - Route handler + tests
  - Request/response schemas

Phase 4 — Frontend (Aphrodite) [can parallel Phase 2+3]
  - Component tree
  - API integration
  - Tests

Architectural Trade-offs Checklist

Before finalizing the plan, evaluate:

Output Format

The plan output should be a PLAN-<feature>.md artifact:

# PLAN-<feature>
**Date:** YYYY-MM-DD  **Status:** Awaiting Approval

## Goal
[One sentence]

## Component Breakdown
[Table: Component | Responsibility | Inputs | Outputs]

## Data Flow
[ASCII diagram]

## API Contracts
[Key schemas and error codes]

## Phases
1. Phase 1 — @demeter — [scope]
2. Phase 2 — @hermes — [scope]
3. Phase 3 — @aphrodite — [scope] (parallel with Phase 2)

## Risks
- [Risk and mitigation]

## Open Questions
- [ ] [Decision needed from human]
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.