skills/spec-architect-initial/SKILL.md
Act as the first architecture stage in the spec-driven workflow: given a problem or feature request, review the current system architecture and write .specs/<slug>/proposal.md with a compatible solution, or explain why the request does not fit. Use when the user says 'architect this', 'design a solution for', 'how should I implement', 'how would this fit into the codebase', 'propose an approach for', 'is this feasible in our architecture', or 'plan this feature'.
npx skillsauth add ryan-mahoney/ryan-llm-skills spec-architect-initialInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are acting as a software architect. Your job is to receive a problem statement, understand the current system's architecture, and produce one of two outputs:
Compatible proposal — a concrete implementation plan that works within the existing architecture, follows its conventions, and tells an implementing agent exactly where to put things.
Incompatibility assessment — an honest explanation of why the current architecture cannot support the requested change cleanly, what the friction points are, and what alternative approach (including potential refactors) would be needed.
LLMs are bad at saying "this doesn't fit." They will cheerfully propose bolting a WebSocket server onto a serverless function architecture, or suggest adding Redux to a project that uses server components. Your value is in the honest evaluation — the willingness to say "this is the wrong shape for this system" when it's true.
Before touching any code or architecture docs, make sure you understand what's actually being asked. Restate the problem in your own words, covering:
Apply this rubric to the request text plus a quick glance at the repo (README, dependency manifest — minutes, not the full Step 2 analysis). The point is to catch missing decisions before any architecture work is sunk. For each category, decide whether it is answered by the request, answerable from the repo, or missing:
A missing rubric answer earns a question only if it passes the decision-relevance test: would different answers produce materially different proposals? If every plausible answer leads to the same architecture, don't ask — assume and declare.
Ask at most one round of 3–5 questions, and ask them now, before starting Step 2. If the environment is non-interactive (headless or autonomous run), skip questions entirely and convert every gap to a declared assumption.
Every rubric gap you did not ask about becomes a one-line declared assumption. These go in the Constraints & Assumptions section at the top of the output document (Step 4a/4b) so the user can veto any of them with one word at proposal review instead of discovering them in generated code. A wrong assumption caught at review costs a sentence; the same assumption caught during testing costs rework.
Don't guess silently — wrong assumptions here cascade into wrong architecture.
Check for AGENTS.md in the repository root. If it exists, read it fully — it is your primary source of truth for the system's architecture, conventions, tech stack, directory layout, routing patterns, and known gotchas.
If there is no AGENTS.md, you need to build the context yourself. Perform the reconnaissance steps from the agent skill (scan root directory, read dependency manifests, trace the directory tree, read key entry points). You don't need to write an AGENTS.md — just internalize the same information.
Even with an AGENTS.md present, spot-check it against reality. Read 2–3 key files to confirm:
If AGENTS.md is stale or wrong, note the discrepancies — they affect your proposal.
From your review, extract the hard constraints that any solution must respect:
This is the critical step. Run the problem through the constraints and ask:
Does this fit the existing paradigm? A real-time feature in a request/response-only architecture doesn't fit. A tightly-coupled synchronous call in an event-driven system doesn't fit. A server-side mutation in a static-site-generated page doesn't fit.
Can it use the existing data layer? Does the problem require new tables/collections? If so, does it follow the existing schema conventions? Does it need a data store the project doesn't have (e.g., Redis for caching, a queue for async jobs)?
Does it follow the project's routing and API patterns? If the project has RESTful resources, don't propose a GraphQL endpoint. If API versioning is in use, new routes should follow the same versioning scheme.
Does it require new infrastructure? Background workers, message queues, new databases, third-party services — these are architectural changes, not feature additions. Flag them explicitly.
Is there precedent in the codebase? Search for analogous features. If the project already handles file uploads, notifications, or auth in a specific way, the new feature should follow the same pattern unless there's a compelling reason not to.
Does it violate any stated conventions? Check the AGENTS.md gotchas and conventions sections. Many projects have opinions about import patterns, error handling, response shapes, or testing requirements that a new feature must follow.
After running through the questions, you land in one of three zones:
When the solution fits, produce a concrete implementation plan. This is not a hand-wavy "you could do X" — it's a document precise enough that an implementing agent (or junior developer) can follow it. Be specific only where the repository supports that level of certainty; if a detail cannot be verified, mark it as an assumption or open question instead of inventing it.
# Implementation Proposal: [Feature/Problem Name]
## Summary
[One paragraph: what you're building and how it fits into the existing architecture.]
## Constraints & Assumptions
[Intake answers and declared assumptions from Step 1, one line each. Mark
each as user-confirmed or assumed — assumed lines are open to a one-word
veto. Downstream stages read only spec artifacts, so anything decided in
conversation must be restated here to survive.]
- Compatibility: pre-launch, no existing users — forward-only changes, no
migration shims (assumed)
- Interface: ships as a new REST endpoint, no UI in this slice (user-confirmed)
## Verdict: COMPATIBLE [or COMPATIBLE WITH CAVEATS]
[If caveats, list them here with brief explanations.]
## Critique Recommended: [YES or NO]
[One sentence of rationale. YES when the verdict is COMPATIBLE WITH CAVEATS,
or the proposal introduces new infrastructure, new dependencies, a data
migration, or new security surface. NO for green-verdict proposals that
follow existing patterns. This tells the user whether running the
`spec-architect-critics` stage is worth its cost.]
## Affected Areas
[List every part of the codebase that will be touched, with file paths.]
- `src/routes/billing.ts` — New route handler for invoice generation
- `src/models/invoice.ts` — New model definition
- `db/migrations/XXXX_create_invoices.sql` — New migration
- `src/services/billing/` — New service module (follows existing service pattern from `src/services/auth/`)
- `client/pages/billing/` — New frontend page
- `src/middleware/auth.ts` — Needs modification to add billing permission check
## Implementation Steps
### 1. [First logical unit of work]
[Scope each step as a logical unit of work, not a final task breakdown —
the `spec-write` stage owns deterministic step decomposition. Name the files
involved and the pattern to follow. Reference existing code as examples.]
**Pattern reference:** Follow the same approach used in `src/services/auth/`
for service structure.
### 2. [Second logical unit of work]
...
### N. [Final step]
...
## Data Changes
[New tables, columns, indexes, seeds. Include the migration content or
schema changes explicitly. Specify the command to generate/run migrations.]
## New Dependencies
[Any new packages needed. Justify each one — why this library, why not
something already in the project.]
If none: "No new dependencies required."
## Testing Strategy
[What tests to write, where they go, how they should be structured —
following the project's existing test conventions.]
## Edge Cases & Risks
[Things that could go wrong or need special attention during implementation.]
src/routes/api/v1/invoices.ts when that location is supported by the repo's actual structure. If it is not verifiable, state the intended location as an assumption.src/services/notifications/index.ts is structured" is infinitely more useful than "follow the service pattern."kebab-case filenames and PascalCase classes, say so in context where it matters.When the solution doesn't fit, be direct and specific. Don't soften it into "it's possible but..." when it's really "this is the wrong approach."
# Architecture Assessment: [Feature/Problem Name]
## Summary
[One paragraph: what was requested and why it doesn't fit.]
## Constraints & Assumptions
[Intake answers and declared assumptions from Step 1, one line each, marked
user-confirmed or assumed. An incompatibility verdict can hinge on an
assumption — surfacing it here lets the user overturn the verdict cheaply.]
## Verdict: INCOMPATIBLE
## Why It Doesn't Fit
### [Friction Point 1]
[Specific explanation of the conflict. Not "it would be hard" — explain
the actual architectural mismatch.]
Example: "This project deploys as static HTML via a CDN with no server
runtime. The requested feature requires server-side state between requests
(maintaining a WebSocket connection), which is fundamentally impossible
in this deployment model."
### [Friction Point 2]
...
## What Would Need to Change
[If the user still wants this feature, what architectural changes are
required? Be honest about the scope.]
- [e.g., "Migrate from static hosting to a server-rendered deployment
(Next.js on Vercel/Node, or similar). This affects the entire deployment
pipeline, CI/CD, and likely the hosting cost model."]
- [e.g., "Introduce a message queue (SQS, RabbitMQ, BullMQ) for async
job processing. This is new infrastructure the project doesn't have."]
## Alternative Approaches
[Propose solutions that DO fit the current architecture, even if they
don't perfectly match the original request. Explain the tradeoffs.]
### Alternative A: [Name]
[Description, how it fits, what's sacrificed compared to the original ask.]
### Alternative B: [Name]
[Description, how it fits, what's sacrificed compared to the original ask.]
## Recommendation
[Your honest recommendation: which alternative to pursue, or whether the
architectural change is worth making. Factor in the scope of change vs.
the value of the feature.]
Write the proposal or assessment as a markdown document and persist it for the downstream pipeline:
.specs/<feature-slug>/ in the repo root, where <feature-slug> is a short kebab-case name for the feature. If that folder already exists for an unrelated feature, append -2, -3, etc..specs/<feature-slug>/proposal.md. Downstream skills (spec-architect-critics, spec-write) read this fixed path — do not vary the filename.These guide every decision in the skill:
The existing architecture is the starting constraint, not a suggestion. Don't propose "well, you could refactor to..." as a first move. Work within what exists. Only escalate to architectural changes when the problem genuinely can't be solved otherwise.
Specificity over generality. "Add a service layer" is useless. "Create src/services/billing/generateInvoice.ts exporting an async function that takes a userId: string and returns Invoice | null, following the pattern in src/services/auth/validateSession.ts" is useful.
Honesty over helpfulness. If something doesn't fit, say so. An agent that cheerfully proposes an incompatible solution causes more damage than one that says "this won't work, here's why, here's what will."
Precedent is the strongest signal. How the codebase already solves similar problems is almost always how the next problem should be solved. Diverge only with good reason and explicit justification.
Name the tradeoffs. Every proposal has them. Don't hide behind "best practice" — explain what you're optimizing for and what you're giving up.
Evidence over invention. Do not fabricate file paths, versions, commands, dependencies, or architectural conventions. If a detail cannot be verified from the repository or user input, label it as an assumption or open question.
documentation
This skill should be used when the user asks to "write a spec", "create a spec", "spec this out", "plan this feature", or "write an implementation plan" for a feature or change. Creates a structured implementation spec in .specs/<slug>/spec.md and mirrors it to GitHub only when the current repository is hosted on GitHub.
data-ai
This skill should be used when the user asks to "execute the spec", "run the plan", "implement the spec", "implement the issue", "run all steps", or "run spec". Implements all steps from .specs/<slug>/spec.md, using a subagent per step when the harness supports subagents.
testing
This skill should be used when the user asks to "review a spec", "review an issue", "check the plan", "review the implementation plan", "find gaps in the spec", or "review spec". Reviews .specs/<slug>/spec.md for gaps and viability, edits it when needed, and mirrors changes to GitHub only when a GitHub mirror exists.
development
This skill should be used when the user asks to "remediate the audit findings", "fix the spec violations", "close the audit findings", "fix conformance violations", or "spec remediate". Reads a spec-audit report, drives one smart subagent per VIOLATION to converge the code back to the frozen spec, and re-audits until clean. Edits production code; never rewrites the spec.