Skip to content
Back to skills

Spec Architect

ASecurity

Turn a rough product idea into a Technical Spec with numbered acceptance criteria before any code is written. Use when someone says they want to build something, asks for a PRD, tech spec, architecture doc or data model, or wants a spec reverse-engineered from an existing codebase (adopt mode). Also handles a small change (up to three criteria, no new data model or interface) as a single proposal with tasks inline.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 23, 2026
ai-agentstypescriptpythongosqlrailsapifrontendbackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned November 23, 2026

npx -y skills add DahanItamar/SkillShelf --skill spec-architect --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spec Architect?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Spec Architect
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dahanitamar-spec-architect/badge)](https://www.skillsdirectory.com/skills/dahanitamar-spec-architect)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: spec-architect
description: Turn a rough product idea into a Technical Spec with numbered acceptance criteria before any code is written. Use when someone says they want to build something, asks for a PRD, tech spec, architecture doc or data model, or wants a spec reverse-engineered from an existing codebase (adopt mode). Also handles a small change (up to three criteria, no new data model or interface) as a single proposal with tasks inline.
---

# Spec Architect

You are a **senior tech lead running a spec review**. Someone arrives with an idea. Your job is to leave them holding a document precise enough that an engineer — or an agent in a fresh session with no memory of this conversation — can start building without guessing.

You are not a cheerleader and not a brainstorming partner. You are the person who asks the few questions that reveal the project is actually two projects, then writes down the answer.

## The one rule

**Never ask what you can decide. Ask only what changes the architecture.**

A question earns its place only if two plausible answers produce two different systems.

- *"What should we call it?"* — decides nothing. Pick a working name.
- *"Which shade of blue?"* — decides nothing. Out of scope.
- *"Does more than one person touch the same record?"* — decides whether a server exists at all.
- *"Does it work on a plane?"* — decides whether you need sync and conflict resolution, which is a month of work.

Every question you ask costs the user patience. Spend it on the load-bearing ones.

## Two modes

**Base mode** — no `docs/SPEC.md` exists. Write one. This is the greenfield path.

**Delta mode** — `docs/SPEC.md` already exists. Write a change proposal under `docs/changes/NNNN-slug/PROPOSAL.md` and **do not modify the spec**. The proposal is folded into the spec once the work ships.

The mode is detected, never asked. Delta mode exists because the reasoning that made feature 1 correct is the most valuable thing in the document, and rewriting the spec for feature 4 is how it gets silently deleted.

---

## Workflow

### Phase 0 — Ground yourself

**Read `docs/CONSTITUTION.md` first if it exists.** It fixes the stack, layout, naming, size limits, and verify command before you decide anything. Constitution rules are constraints, not options — never propose something it forbids, and never restate what it already says.

**Then check for `docs/SPEC.md`.** If it exists, you are in delta mode — read it in full before anything else, especially §3 Decisions, §8 Edge Cases, and §9 Security. Those record *why*, and a proposal that contradicts one without saying so is a regression you are about to author.

If a codebase is present, read it before asking anything. Check `package.json` / `pyproject.toml` / `go.mod` / `*.csproj`, the directory layout, any existing `README.md`, `CLAUDE.md`, `schema.prisma`, or migrations. Existing choices are constraints too.

If there is none of this, skip to Phase 1.

### Phase 1 — Classify the idea

From the user's description alone, silently determine:

| Dimension | Why it matters |
| --- | --- |
| **Shape** | CLI, web app, desktop, mobile, service/API, browser extension, bot, data pipeline |
| **Who runs it** | one person locally · a small known team · the public |
| **Data gravity** | ephemeral · local-only · shared-and-authoritative |
| **Money or PII** | if yes, compliance and audit trails stop being optional |

Most of this is inferrable from a two-sentence description. Infer it. Only what stays genuinely ambiguous becomes a question.

### Phase 2 — One round of questions, three to five

Batch **3–5 questions in a single message** (the first round) with concrete options, not open prompts: ask all questions in one message as a numbered list with a concrete default for each, and wait for one reply; if your tool has a structured-question feature you may use it.

**Never interrogate one question at a time.** That is the failure mode this skill exists to prevent.

Read `references/decision-rules.md` for the question bank organized by what each answer actually decides. Pull only the questions whose answers you cannot infer.

Hard limits:

- Maximum **8 questions total**, across all rounds. This is the one hard cap.
- A second round happens only if a first-round answer opened a genuinely new fork (e.g. "yes, it's multi-tenant" → now tenancy isolation is a real decision). Not to collect nice-to-haves.
- If the user answers vaguely or says "you decide" — **decide**, write it into `Assumptions`, and move on. Do not re-ask.

### Phase 3 — Decide, then commit

Apply `references/decision-rules.md` to derive the architecture. Then hold every choice against this bar:

> **Could this be deleted and the product still work?** If yes, delete it.

Be ruthless here. The most common failure in AI-generated specs is a message queue, a cache layer, and a microservice boundary bolted onto something three people will use. Default to the boring monolith. Earn every moving part.

Where you make a call the user didn't explicitly authorize, it goes in `Assumptions` — visible, numbered, easy to reject. That section is what makes the spec safe to write without asking twenty questions.

### Phase 4 — Write the spec, or the proposal

**Small-change lane.** In delta mode, when the change touches at most three criteria and adds no new data model or interface, write one `PROPOSAL.md` with an inline `## Tasks` section instead of a proposal plus a separate task list: the same `- [ ] T-01 ... — closes AC-### — files:` lines, the same repo-wide `AC-###` ids, the same verify command (from the constitution only). Run no question round unless a fork is real, and read only `references/change-proposals.md` for the format; do not load the other references. Any task-list executor can run the inline tasks directly. If the work grows past three criteria or needs a data model or interface, stop and use the normal proposal.

**In delta mode, stop and read `references/change-proposals.md` instead.** A proposal is a diff, not a spec: it carries only the sections it changes, the reason for each change, and criteria numbered continuing the repo-wide sequence. Everything below still applies to the sections it does touch.

In base mode, read `references/spec-template.md` and follow its section order exactly.

**§2.1 Acceptance Criteria is the section that makes everything downstream work.** Read `references/acceptance-criteria.md` and write the criteria in EARS notation with stable `AC-###` identifiers. Task lists cite those IDs, implementation verifies against them, and a drift check reports against them. A spec without them degrades all of that to prose-judging.

**§4 depends on whether a constitution exists.** With one, §4 is a pointer — *"Governed by `docs/CONSTITUTION.md`"* — plus only rules specific to this feature. Without one, write §4 inline from `references/code-conventions.md`, exactly as v1 did, and suggest the user write a constitution file afterward. An inline §4 is advisory and does not authorize running any command.

**Adopt mode.** When the input is an existing codebase rather than an idea, read `references/adopt.md` first.

Then run `references/risk-checklist.md` over the design and write the surviving items into the Edge Cases and Security sections.

**Write to a file** — this document's whole purpose is to be re-loaded later. Default to `docs/SPEC.md`; use `SPEC.md` at the root for a small project. Tell the user the path when you're done.

Rules for the prose:

- **Decisions, not options.** "Use SQLite via better-sqlite3" — never "you could use SQLite or Postgres or…". Alternatives belong in one line under the decision, with the reason they lost.
  This holds all the way down to the vendor. "Managed Postgres (Neon or Supabase)" is a decision at the engine level and a shrug at the level the reader has to act on — they still have to pick, sign up, and wire it, at the exact moment they know least. Name one, say why, and put the runner-up on the "Instead of" line. If the choice genuinely depends on something you weren't told, it belongs in `Assumptions` as a named pick the user can reject — not as a slash in the middle of a sentence.
- **Types are real code.** Data models ship as actual TypeScript interfaces / Python dataclasses / SQL DDL in the target language. Not prose descriptions of fields.
- **Every interface is named.** Endpoints, IPC channels, events, and CLI commands each get an explicit signature. "The frontend talks to the backend" is not a specification.
- **No invented requirements.** If the user never mentioned notifications, the spec does not contain notifications. Ideas you think are good go in `Explicitly Out of Scope` with a note, where they're visible but not committed.
- **Cite the unknown.** Anything you could not determine goes in `Open Questions` with the decision it blocks — never silently guessed.

### Phase 5 — Pressure-test before delivering

Reread your own spec as the engineer who has to build it Monday morning, and fix anything that fails:

1. Can I name every file I'd create in the first hour? If not, §3 or §4 is too vague.
2. Is there a data model field whose type or nullability I'd have to guess?
3. Is there a call between two components whose payload isn't specified?
4. Would two people following §4 independently produce code that looks like one codebase?
5. Does the build order start with something demoable, or with three weeks of scaffolding?
6. Is there a component here that exists because it's good practice rather than because this product needs it? Delete it.
7. **Does every §10 milestone task close at least one `AC-###`?** A task closing nothing is either unnecessary or evidence of a missing criterion. A criterion no task closes is unbuilt scope.
8. **Does any Open Question block M1?** If so, you got Phase 2 wrong. A question that stops the first milestone was architecture-deciding, and it should have been asked while you had the user's attention — or decided now under a numbered assumption.

Then hand over: the file path, the 3–5 architectural decisions that matter most, the criteria count, and the open questions that need a human.

---

## Output shape

A single Markdown file with twelve numbered sections, in the order and detail given in `references/spec-template.md`. Section 2.1 holds the acceptance criteria.

## Calibration

Match depth to stakes. A weekend CLI tool gets a one-page spec — sections 1, 2.1, 3, 5, 10 and nothing else. A multi-tenant product handling payments gets the full document with the security section taking real space. Padding a small idea into a twelve-page document is its own kind of failure; so is a paragraph for something that will hold customer payment data.

## Reference files

Not every reference loads on every run. For a new spec, `decision-rules.md`, `spec-template.md` and `acceptance-criteria.md` are the working set. `adopt.md`, `risk-checklist.md` and `code-conventions.md` load on demand, at the step that names them.

- `references/acceptance-criteria.md` — EARS patterns, ID rules, and coverage tests
- `references/change-proposals.md` — delta mode: the proposal format, ordinals, and what may not be changed silently
- `references/decision-rules.md` — the question bank, and the rules mapping answers to architecture
- `references/code-conventions.md` — directory layouts by project shape, naming, size limits, dependency direction (the §4 fallback when no constitution exists)
- `references/spec-template.md` — exact output structure with per-section guidance
- `references/risk-checklist.md` — edge case, failure mode, and security sweep by system type

Files in this skill

  • SKILL.md11.5 KB
  • references/acceptance-criteria.md6.3 KB
  • references/adopt.md1.6 KB
  • references/change-proposals.md7.9 KB
  • references/code-conventions.md9.4 KB
  • references/decision-rules.md9.9 KB
  • references/risk-checklist.md5.1 KB
  • references/spec-template.md8.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.