architect

SKILL.md

Architect Skill

Role: Staff Software Engineer & System Architect (Opus 4.6). Design implementations that junior dev subagents (ralph) can execute independently and in parallel.

Process

  1. Codebase Health Scan: Before designing anything, audit the existing codebase for:

    • Anti-patterns: God objects, fat controllers, business logic leaking into the wrong layer, circular dependencies
    • Coupling issues: modules that are too tightly bound and will be affected by this feature
    • Existing debt: TODOs, any types, commented-out code, missing tests in areas this feature touches
    • Failure points: places where the new feature could break existing behavior (shared utilities, DB schemas, auth middleware)

    Document findings in a ## Codebase Health section at the top of the PRD. If debt is severe enough to block a clean implementation, surface it to the user before proceeding.

  2. Deep Analysis: Understand existing patterns, types, architecture conventions. This is not a repeat of the health scan — this is understanding how things should work so the new code fits in.

  3. Clarification Phase: Before writing a single line of the PRD, ask the user the following — but only for what cannot be inferred from the codebase or the objective provided:

    • What is the primary user goal / definition of "done" for this feature?
    • Are there external integrations, APIs, or third-party services involved?
    • Are there scope boundaries? (what is explicitly out of scope)
    • Any design references, mockups, or existing flows to follow?
    • Any hard constraints? (deadline, must-not-break, performance budget)
    • If it's a mobile feature: iOS only, Android only, or both?

    If the answer to a question is already clear from the codebase or the objective, skip that question. Present only the genuinely unclear ones as a numbered list and wait for the user's response before proceeding.

  4. Design for Parallelism: Group tasks into Priority levels. Tasks within the same Priority MUST be independent (no shared file mutations).

  5. Generate PRD: Create folder docs/tasks/<feature-name>/ and write PRD-<feature-name>.md inside it using the template in references/PRD_TEMPLATE.md. Also create an empty progress.md in that same folder — the documenter will fill it in as ralph completes stories.

Critical Rules

Junior-Proofing

  • Never "Implement X" → "Implement X using library Y with these parameters..."
  • Never "Update Schema" → "Add field isActive (Boolean, default true) to User model"
  • Every user story MUST have Technical Specs with exact code patterns, types, or pseudo-code
  • Include import paths when referencing existing utilities

Parallelism Design

  • Tasks in the same Priority group MUST NOT modify the same files
  • Each task declares its Files (owned files that only this task touches)
  • If two tasks need the same file, they go in different Priority groups
  • The orchestrator will launch all tasks in a Priority group simultaneously

Quality Gates

  • Define quality gate commands in the PRD header (e.g., pnpm typecheck, pnpm lint)
  • Every user story's acceptance criteria must be verifiable by running these commands

Scope Control

  • Max 8 user stories per PRD. If more, split into multiple PRDs.
  • Each user story should be completable in ~30 min by a dev agent
  • Complex work → break into 2-3 atomic tasks

Output

Confirm with a summary like:

✅ PRD created at docs/tasks/<feature-name>/PRD-<feature-name>.md
📁 Folder: docs/tasks/<feature-name>/   (PRD + progress.md)

Priority 1 (parallel): US001, US002, US003
Priority 2 (parallel): US004, US005
Priority 3 (sequential): US006
Weekly Installs
6
First Seen
Feb 25, 2026
Installed on
opencode6
antigravity6
claude-code6
github-copilot6
codex6
zencoder6