diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 0000000..8b1d492
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,121 @@
+# Agent Kit — LLM Context
+
+This repository **is** the Agent Kit framework. It is not a project built with the framework — it is the framework itself.
+
+## What this repository contains
+
+Agent Kit is a process framework for LLM-assisted software development. It provides a structured process (lenses, gates, artifacts) and a learning mechanism (domain profiles) that accumulates knowledge across projects.
+
+When someone copies `framework/` into their own repository and points `AGENTS.md` at `BUILDER.md`, any LLM can follow the process to build software with verification and domain-specific knowledge.
+
+## Repository structure
+
+```
+.
+├── AGENTS.md # Example entry point (5 lines, points to BUILDER.md)
+├── README.md # Explanation: what the framework is and why it exists
+├── GUIDE.md # Tutorial: step-by-step first project walkthrough
+├── LICENSE # MIT
+│
+├── framework/ # THE FRAMEWORK (this is what gets copied to target repos)
+│ ├── BUILDER.md # Process contract — the LLM reads and follows this
+│ ├── GATEKEEPER.md # Verification agent — executes commands, enforces gates
+│ ├── README.md # Technical reference — gates, artifacts, contracts
+│ ├── VERSION # Framework version for tracking updates
+│ ├── domains/
+│ │ ├── _template.md # Template for creating profile links that extend catalog profiles
+│ │ └── README.md # How domain profiles work
+│ └── templates/
+│ ├── INTENT.md # Template: what and why
+│ ├── DESIGN.md # Template: how (architecture, decisions, risks)
+│ ├── VERIFICATION_LOG-template.md # Template: proof (gate output, progress)
+│ └── DOMAIN_PROFILE-template.md # Template: standalone full domain profile
+│
+├── catalog/ # Community-contributed base profiles
+│ ├── README.md # How to use and contribute profiles
+│ ├── apps-sdk-mcp-lit-vite.md # Real profile (11 pitfalls, 7 adversary Qs)
+│ └── web-kinu-preact-vite.md # Real profile (4 pitfalls, 4 adversary Qs)
+│
+├── examples/ # Real project artifacts showing the framework in action
+│ ├── mcp-task-widget/ # Complete example with intent, design, verification
+│ ├── logistics-control-tower/ # Full-sized project prompt
+│ └── test-habit-tracker/ # Spanish-language prompt example
+│
+└── docs/ # Would hold generated artifacts in a real project
+```
+
+## Framework concepts
+
+- **Domain profiles** accumulate stack knowledge (pitfalls, adversary questions, checks, decisions) across projects
+- **Gates** (0-4) are verification checkpoints with real command output — "assumed to pass" is never valid
+- **Four lenses**: User, Architecture, Adversary, Domain — thinking modes, not sequential phases
+- **Anti-Loop Rule**: produce the Intent document before continuing to investigate
+- **Pre-Implementation Checkpoint**: 4 questions before writing any code
+- **Resume**: verification log Progress section enables continuing interrupted work
+
+### The process (BUILDER.md)
+
+The LLM determines project size (Quick / Standard / Full), then follows a structured process:
+
+1. **Intent** — Capture what and why before doing anything (`docs/[project]-intent.md`)
+2. **Domain profile** — Load accumulated stack knowledge, read every pitfall and adversary question
+3. **Skills** — Load relevant skills from `.github/skills/` and `.agents/skills/` as design guidance
+4. **Design** — Architecture, decisions, risks, pitfalls applied, adversary questions answered (`docs/[project]-design.md`)
+5. **Pre-Implementation Checkpoint** — 4 mental questions before writing code
+6. **Gated build** — Gates 0-4 with real command output recorded
+7. **Self-review** — Adversary lens + domain checklist
+8. **Domain learning** — Update the profile with new discoveries
+
+### Domain profiles (the differentiator)
+
+Domain profiles use an **inheritance model**. Base profiles in `catalog/` contain stack-wide knowledge (pitfalls, adversary questions, automated checks, decision history). Profile links in `framework/domains/` extend a base profile with project-specific additions. Every gate failure becomes a new pitfall. Every project makes the next one better.
+
+Community-contributed base profiles live in `catalog/`. Create a profile link in `framework/domains/` that extends the relevant catalog profile — see `framework/domains/_template.md` for the format.
+
+A base profile contains: Selection Metadata, Terminology Mapping, Verification Commands, Common Pitfalls, Adversary Questions, Integration Rules, Automated Checks, Decision History, Review Checklist. A profile link contains: `extends` reference, Local Pitfalls, Local Overrides, Local Decision History.
+
+### Verification gates
+
+Gates are mandatory checkpoints with real command output. "Assumed to pass" is never valid. Gates 0 (deps) → 1 (scaffold) → 2 (features) → 3 (tests) → 4 (clean build).
+
+### Artifacts
+
+- **Intent** — Scope anchor. Given/when/then behaviors, MUST/MUST NOT constraints, IN/OUT scope.
+- **Design** — Single document replacing PRD + tech spec + implementation plan. Includes Adversary Questions Applied and Domain Pitfalls Applied as separate mandatory sections.
+- **Verification Log** — Gate evidence + Progress section for resuming interrupted work.
+
+### Anti-Loop Rule
+
+The LLM produces the Intent before continuing to investigate. Unclear decisions become open questions asked to the human — not reasons to keep researching.
+
+### Resume mechanism
+
+Each verification log has a Progress table at the top. When a session is interrupted, the next session reads Progress and continues from the last completed step.
+
+## Documentation follows Diátaxis
+
+| Document | Type | Serves |
+|----------|------|--------|
+| `README.md` | Explanation | Understanding — what and why |
+| `GUIDE.md` | Tutorial | Learning — step-by-step first project |
+| `framework/README.md` | Reference | Information — specs, contracts, definitions |
+| `BUILDER.md` | Reference | Information — the process contract (for LLMs) |
+| `GATEKEEPER.md` | Reference | Information — the verification contract (for LLMs) |
+
+## When modifying the framework
+
+- `BUILDER.md` is the source of truth for the process. Changes here affect how every LLM behaves.
+- Profile link template (`framework/domains/_template.md`) defines what new profile links look like. Full profile template (`framework/templates/DOMAIN_PROFILE-template.md`) defines standalone profiles and catalog contributions. Changes propagate to all future profiles.
+- Template changes (`templates/*.md`) affect artifact structure for all future projects.
+- `README.md`, `GUIDE.md`, and `framework/README.md` must stay aligned with `BUILDER.md`. If the process changes, the docs must reflect it.
+- Examples in `examples/` are historical artifacts — do not modify them to match framework changes.
+- Catalog profiles in `catalog/` are contributed by the community — review for quality but preserve the contributor's learnings.
+
+## Conventions
+
+- All framework documentation is in English.
+- Standalone/base profiles use the structure in `framework/templates/DOMAIN_PROFILE-template.md`. Profile links use `framework/domains/_template.md`. Do not deviate.
+- Verification logs are per-project: `docs/[project]-verification.md`, not a shared file.
+- Project code goes in its own directory, never at the repo root.
+- The AGENTS.md entry point is intentionally minimal (5 lines). Process logic lives in BUILDER.md.
+- Skills are guidance, not process. They live in `.github/skills/` (repo-level) or `.agents/skills/` (agent-level/external). Skills cannot override gates, skip artifacts, or replace domain profile correctness. Technical learnings go in domain profiles; process learnings go in skills; project-specific learnings go in `docs/`.
diff --git a/AGENTS.md b/AGENTS.md
index cd10175..e52b89d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Agent Instructions
-Read and follow `agent-kit/BUILDER.md` for all tasks.
+The framework operates on a strict **Adversarial Verification Loop**:
+- For design, planning, and code implementation tasks: Read and follow `framework/BUILDER.md`.
+- For execution, testing, and mechanical verification tasks: Read and follow `framework/GATEKEEPER.md`.
Project artifacts (intent, design, verification) go in `docs/`.
diff --git a/GUIDE.md b/GUIDE.md
index c7add1a..f90728b 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -10,12 +10,16 @@ In this tutorial, we will set up Agent Kit in a new repository and use it to bui
## Step 1: Copy the framework into your repo
-Copy three things into your repository's root:
+Copy the framework into your repository's root:
```bash
-cp -R agent-kit/ your-repo/agent-kit/
+cp -R framework/ your-repo/framework/
cp AGENTS.md your-repo/
mkdir -p your-repo/docs
+
+# Optional: if a catalog profile exists for your stack, copy it too
+mkdir -p your-repo/catalog
+cp catalog/[your-profile].md your-repo/catalog/
```
Your repo should now look like this:
@@ -23,14 +27,20 @@ Your repo should now look like this:
```
your-repo/
├── AGENTS.md
-├── agent-kit/
+├── framework/
│ ├── BUILDER.md
+│ ├── GATEKEEPER.md
+│ ├── README.md
+│ ├── VERSION
│ ├── domains/
│ │ └── _template.md
│ └── templates/
│ ├── INTENT.md
│ ├── DESIGN.md
-│ └── VERIFICATION_LOG-template.md
+│ ├── VERIFICATION_LOG-template.md
+│ └── DOMAIN_PROFILE-template.md
+├── catalog/ ← only if you copied a profile
+│ └── [your-profile].md
└── docs/
```
@@ -39,12 +49,14 @@ Open `AGENTS.md` and verify it contains:
```markdown
# Agent Instructions
-Read and follow `agent-kit/BUILDER.md` for all tasks.
+The framework operates on a strict Adversarial Verification Loop:
+- For design, planning, and code implementation tasks: Read and follow `framework/BUILDER.md`.
+- For execution, testing, and mechanical verification tasks: Read and follow `framework/GATEKEEPER.md`.
Project artifacts (intent, design, verification) go in `docs/`.
```
-That's all `AGENTS.md` needs. The process logic lives in `BUILDER.md`.
+That's all `AGENTS.md` needs. The Builder handles design and implementation; the GateKeeper handles verification. The process logic lives in their respective files.
## Step 2: Write your prompt
@@ -96,15 +108,24 @@ This is your chance to course-correct. If a decision is wrong, say so now. If a
## Step 5: Watch the domain profile load (or get created)
-If a domain profile exists for your stack in `agent-kit/domains/`, the LLM loads it and reads every pitfall and adversary question before continuing.
+If a matching base profile exists in `catalog/`, the LLM creates a **profile link** in `framework/domains/` with `extends: [profile-id]` and reads every pitfall and adversary question from the base before continuing. The link template is `framework/domains/_template.md`.
+
+If no base profile exists, the LLM creates a **standalone full profile** directly in `framework/domains/` using `framework/templates/DOMAIN_PROFILE-template.md`. The first version will be minimal — terminology mapping, verification commands, a couple of pitfalls. It will grow as the project discovers new pitfalls. When you want to reuse it across projects, move it to `catalog/` and replace it with a link.
+
+## Step 6: Skills get loaded (if they exist)
-If no profile exists, the LLM creates one from `agent-kit/domains/_template.md`. The first version will be minimal — terminology mapping, verification commands, a couple of pitfalls. That's fine. It will grow.
+If your repo has skills installed in `.github/skills/` or `.agents/skills/`, the LLM scans their descriptions and loads any that match the task. For example, a `frontend-design` skill would be loaded for a UI task but ignored for a backend API.
-## Step 6: Review the Design
+Skills provide design guidance — aesthetic direction, API conventions, documentation style — but they don't replace the domain profile or the verification gates. You might not have any skills yet, and that's fine. The framework works without them.
+
+> **Tip:** You can install community skills from [skills.sh](https://skills.sh) (`npx skills add owner/skill-name`) or create your own in `.github/skills/your-skill/SKILL.md`.
+
+## Step 7: Review the Design
The LLM creates `docs/[project]-design.md`. This is one document that replaces a separate PRD, tech spec, and implementation plan. You will see:
- **Domain Profile Selection** — which profile was chosen and why (with scores)
+- **Skills Loaded** — which skills were loaded (or "none")
- **Stack** — technologies with verified versions
- **Architecture** — structure, data flow, initialization chain
- **Decisions** — every architectural choice with rationale
@@ -114,7 +135,7 @@ The LLM creates `docs/[project]-design.md`. This is one document that replaces a
The Adversary Questions and Domain Pitfalls sections are where the domain profile earns its value. They force the LLM to confront known failure modes *before* writing a single line of code.
-## Step 7: Watch the gated build
+## Step 8: Watch the gated build
Now the LLM starts building. It proceeds through gates:
@@ -135,7 +156,7 @@ If a gate fails, the LLM:
This last step is the learning cycle in action. A failure today becomes a prevention for tomorrow.
-## Step 8: Check the verification log
+## Step 9: Check the verification log
When the build is complete, open `docs/[project]-verification.md`. At the top you will see the Progress table:
@@ -143,6 +164,7 @@ When the build is complete, open `docs/[project]-verification.md`. At the top yo
| Step | Status |
|------|--------|
| Intent | PASS |
+| Skills loaded | PASS |
| Design | PASS |
| Gate 0: Dependencies | PASS |
| Gate 1: Scaffold | PASS |
@@ -157,18 +179,23 @@ Below that: real output for every gate, a failure history (if anything failed al
If Gate 4 passed, the project builds and tests from a clean state. That's the proof.
-## Step 9: Check the domain profile
+## Step 10: Check what the LLM learned
+
+After the project, check two places:
-Open `agent-kit/domains/[your-profile].md`. Compare it to how it looked before the project. You may see:
+**Your profile link** (`framework/domains/[your-profile].md`) — project-specific discoveries:
+- New **Local Pitfalls** — things unique to this project's context
+- New **Local Decision History** — constraints specific to this project
-- New entries in **Common Pitfalls** — things the LLM discovered during implementation
+**The base profile** (`catalog/[profile-id].md`) — stack-wide discoveries:
+- New entries in **Common Pitfalls** — things any project on this stack should know
- New **Adversary Questions** — traps specific to this stack
- New **Decision History** entries — constraints learned the hard way
- Updated **Automated Checks** — new detection patterns
-This is the flywheel. The next project on this stack will load this profile and avoid the problems this project discovered.
+This is the flywheel. The next project on this stack inherits the updated base profile automatically through `extends`. Local pitfalls that prove useful across projects should be contributed back to the catalog profile.
-## Step 10: Resume interrupted work (when it happens)
+## Step 11: Resume interrupted work (when it happens)
Sessions get interrupted — context limits, network issues, or just closing the chat. When you come back, start a new session and prompt:
@@ -184,8 +211,8 @@ The LLM reads the verification log's Progress section, finds the last completed
**Add constraints as you discover preferences.** Every time you say "always do X" or "never do Y", the framework captures it — in the Intent for this project, in the domain profile for all future projects on this stack.
-**Bring profiles to new repos.** When you start a new repository with the same stack, copy the domain profile along with `agent-kit/`. All accumulated knowledge travels with it.
+**Bring profiles to new repos.** When you start a new repository with the same stack, copy `framework/` and include the relevant base profiles from `catalog/`. Create a new profile link in `framework/domains/` that extends the base. All accumulated stack knowledge travels with it; project-specific knowledge stays behind.
-For the full technical reference — file descriptions, gate definitions, domain profile contract, and artifact specs — see [`agent-kit/README.md`](agent-kit/README.md).
+For the full technical reference — file descriptions, gate definitions, domain profile contract, and artifact specs — see [`framework/README.md`](framework/README.md).
For the concepts behind the framework — why it works, how the learning cycle operates, what makes domain profiles different — see the [project README](README.md).
diff --git a/README.md b/README.md
index 98e5815..55ad3f9 100644
--- a/README.md
+++ b/README.md
@@ -6,9 +6,9 @@ A process framework for LLM-assisted software development. Works with any LLM an
LLMs make the same mistakes across projects. They skip verification, forget past lessons, lose context between sessions, and build confidently on wrong assumptions. Each new conversation starts from zero — even when the same stack was used yesterday.
-Agent Kit solves this with two mechanisms:
+Agent Kit solves this with an **Adversarial Verification Loop**:
-1. **A structured process** that forces the LLM to pause, verify, and prove its work before moving forward.
+1. **Dual-Agent Architecture**: A strictly separated `Builder` (writes code) and `GateKeeper` (executes tests). The LLM is forced to prove its work mechanically against an automated opponent, preventing self-approval hallucinations.
2. **Domain profiles** — living documents that accumulate stack-specific knowledge across projects. Every bug fix, every gate failure, every discovery enriches the profile. The next project on the same stack starts knowing what the last one learned.
## How the process works
@@ -30,20 +30,28 @@ graph TB
subgraph STANDARD ["Standard / Full Process"]
direction TB
INTENT["1 Capture Intent
docs/[project]-intent.md"]
- LOAD_PROFILE["2 Load domain profile
Read every pitfall &
adversary question"]
- DESIGN["3 Design — all lenses
docs/[project]-design.md"]
- CHECKPOINT["Pre-Implementation
Checkpoint
4 questions before coding"]
- GATES["4 Gated build
Gate 0 → 1 → 2"]
- TESTS["5 Tests + verification
Gate 3 → Gate 4"]
- REVIEW["6 Self-review
Adversary Lens +
domain checklist"]
-
+ LOAD_PROFILE["2 Load domain profile"]
+ LOAD_SKILLS["3 Load relevant skills
.github/skills/ · .agents/skills/"]
+ DESIGN["4 Design — all lenses
docs/[project]-design.md"]
+ WRITE_CODE["5 Implement code
Builder strictly writes"]
+ HANDOFF["6 Handoff to GateKeeper"]
+
INTENT --> LOAD_PROFILE
- LOAD_PROFILE --> DESIGN
- DESIGN --> CHECKPOINT
- CHECKPOINT --> GATES
+ LOAD_PROFILE --> LOAD_SKILLS
+ LOAD_SKILLS --> DESIGN
+ DESIGN --> WRITE_CODE
+ WRITE_CODE --> HANDOFF
+ end
+
+ %% ── Verification Loop (GateKeeper) ──
+ subgraph VERIFICATION ["GateKeeper Authority"]
+ direction TB
+ GATES["7 Gated build
Gate 0 → 1 → 2"]
+ TESTS["8 Tests + verification
Gate 3 → Gate 4"]
GATES --> TESTS
- TESTS --> REVIEW
end
+
+ HANDOFF --> VERIFICATION
%% ── Domain profile (central) ──
DP[("Domain Profile
pitfalls · adversary questions
integration rules · checks
decision history")]
@@ -54,14 +62,15 @@ graph TB
%% ── Gate failure loop ──
GATES --> FAIL{"Gate
fails?"}
- FAIL -->|"Yes"| FIX["Root cause → Fix
→ Re-run gate"]
- FIX --> UPDATE_PROFILE["Update domain profile
new pitfall / rule / check"]
+ FAIL -->|"Yes"| FIX["Raw log to Builder
→ Fix → Re-run"]
+ FIX --> UPDATE_PROFILE["GateKeeper Updates Profile
new pitfall / rule"]
UPDATE_PROFILE --> DP
FIX --> GATES
FAIL -->|"No"| TESTS
%% ── Learning cycle ──
- REVIEW --> LEARNING["7 Domain learning
verify profile was updated"]
+ TESTS --> REVIEW["9 Self-review
Adversary Lens + domain checklist"]
+ REVIEW --> LEARNING["10 Domain learning
verify profile was updated"]
LEARNING --> DP
%% ── Verification log ──
@@ -88,10 +97,11 @@ graph TB
%% ── Styles ──
style DP fill:#4CAF50,color:#fff,stroke:#2E7D32,stroke-width:2px
style VLOG fill:#2196F3,color:#fff,stroke:#1565C0,stroke-width:2px
- style CHECKPOINT fill:#FF9800,color:#fff,stroke:#E65100,stroke-width:2px
+ style REVIEW fill:#FF9800,color:#fff,stroke:#E65100,stroke-width:2px
style FAIL fill:#f44336,color:#fff,stroke:#c62828
style FIX fill:#f44336,color:#fff,stroke:#c62828
style UPDATE_PROFILE fill:#4CAF50,color:#fff,stroke:#2E7D32
+ style LOAD_SKILLS fill:#CE93D8,color:#000,stroke:#8E24AA,stroke-width:1px
style RESUME fill:#9C27B0,color:#fff,stroke:#6A1B9A
style QUICK fill:#78909C,color:#fff,stroke:#37474F
style QUICK_DONE fill:#78909C,color:#fff,stroke:#37474F
@@ -103,6 +113,7 @@ graph TB
- **Blue** = Verification Log — the proof mechanism. Real command output, not assumptions.
- **Orange** = Checkpoints — points where the LLM must pause and think before acting.
- **Red** = Failure path — failures are captured, root-caused, and fed back into the profile.
+- **Light purple** = Skills — optional guidance loaded before design (aesthetic, conventions, workflow).
- **Purple** = Resume — interrupted sessions recover from the verification log's Progress section.
- The dashed line from Domain Profile back to "Load domain profile" is the **learning cycle**: every project starts with the accumulated knowledge of all previous projects on that stack.
@@ -116,7 +127,7 @@ The LLM doesn't follow a linear sequence. It applies four thinking modes wheneve
**Adversary Lens** — What could go wrong? Applied *during* design, not only after. "What input breaks this?", "What happens when X is unavailable?", "What would a careless developer get wrong?" If the domain profile has adversary questions, they must be answered against the specific design before any code is written.
-**Domain Lens** — What does the domain profile say? Checks every pitfall, follows integration rules, runs automated checks. The accumulated knowledge of previous projects on this stack.
+**Domain Lens** — What does the domain profile say? Incorporates integration rules and semantic terminology. The accumulated knowledge of previous projects on this stack.
## Domain profiles: the learning mechanism
@@ -136,11 +147,11 @@ From real usage: a domain profile started with 3 pitfalls. After two projects, i
Documentation describes how things work. Domain profiles describe how things *fail* — and what to do about it. They are written by the LLM during implementation, not by a human before it. They grow from experience, not from planning.
-They also travel. Copy a profile to a new repository and every project in that repo inherits the knowledge. Different LLMs can use the same profile. The learning persists regardless of which model or session created it.
+They also travel. Copy `framework/` along with the relevant base profiles from `catalog/` to a new repository and every project in that repo inherits the knowledge. Different LLMs can use the same profile. The learning persists regardless of which model or session created it.
## Verification: proof over claims
-LLMs are confident. They will tell you "everything works" when it doesn't. The framework addresses this with gates — mandatory checkpoints where the LLM runs a real command, pastes the real output, and records it in the verification log.
+LLMs are confident. They will tell you "everything works" when it doesn't. The framework addresses this with an adversarial loop — mandatory checkpoints where the GateKeeper runs a real command against the Builder's code, pastes the real output, and records it in the verification log.
"Assumed to pass" is never valid evidence. If the output isn't in the log, it didn't happen.
@@ -164,11 +175,22 @@ The framework is LLM-agnostic. Any model that can read markdown and follow instr
See [**GUIDE.md**](GUIDE.md) for a step-by-step tutorial on setting up and using Agent Kit.
-See [**agent-kit/README.md**](agent-kit/README.md) for the technical reference — file descriptions, gate definitions, artifact specs, and the domain profile contract.
+See [**framework/README.md**](framework/README.md) for the technical reference — file descriptions, gate definitions, artifact specs, and the domain profile contract.
## Included examples
-**Domain profile:** [`agent-kit/domains/apps-sdk-mcp-lit-vite.md`](agent-kit/domains/apps-sdk-mcp-lit-vite.md) — A real domain profile built across multiple projects with [Apps SDK](https://developers.openai.com/apps-sdk/quickstart) + Lit + Vite. 11 pitfalls, 7 adversary questions, automated checks, and decision history — all learned from real bugs. Shows what a mature profile looks like after the flywheel has turned a few times.
+**Domain profiles:** The [`catalog/`](catalog/) directory contains community-contributed domain profiles built from real projects:
+
+- [`apps-sdk-mcp-lit-vite.md`](catalog/apps-sdk-mcp-lit-vite.md) — MCP Apps + Lit + Vite. 11 pitfalls, 7 adversary questions. Shows what a mature profile looks like after the flywheel has turned.
+- [`web-kinu-preact-vite.md`](catalog/web-kinu-preact-vite.md) — Kinu + Preact + Vite. 4 pitfalls, 4 adversary questions.
+
+If a relevant catalog profile exists for your stack, create a profile link in `framework/domains/` that extends it (see `framework/domains/_template.md`). If not, the Builder will create a standalone profile during the first project using `framework/templates/DOMAIN_PROFILE-template.md`.
+
+**Project artifacts:** The [`examples/`](examples/) directory contains real project artifacts showing the framework in action:
+
+- [`mcp-task-widget/`](examples/mcp-task-widget/) — Complete example with intent, design, and verification artifacts.
+- [`logistics-control-tower/`](examples/logistics-control-tower/) — Full-sized project prompt.
+- [`test-habit-tracker/`](examples/test-habit-tracker/) — Spanish-language prompt example.
## License
diff --git a/agent-kit/domains/README.md b/agent-kit/domains/README.md
deleted file mode 100644
index a57ad1d..0000000
--- a/agent-kit/domains/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# Domain Profiles
-
-Domain profiles provide stack-specific knowledge that the Builder loads based on the project's technology stack. They are the framework's learning mechanism — each project can enrich them with new pitfalls, decisions, and automated checks.
-
-## How Profiles Are Used
-
-1. The Builder reads the user's prompt and identifies the technology stack
-2. The Builder applies the operational matching contract in this directory
-3. If found, the profile overrides generic assumptions:
- - **Verification commands** replace generic "run build" instructions
- - **Common pitfalls** are checked against the design before coding
- - **Adversary questions** must be answered against the specific design (documented in the Design doc)
- - **Automated checks** are executed mechanically during self-review
- - **Decision history** applies permanent constraints from past projects
- - **Integration rules** define data flow between technologies
-
-## Operational Matching Contract
-
-Selection must be deterministic and auditable:
-
-1. Candidate set: all `.md` files in this directory except `_template.md` and `README.md`
-2. Metadata required per profile:
- - `Profile ID`
- - `Match Keywords`
- - `Use When`
- - `Do Not Use When`
-3. Remove any profile whose `Do Not Use When` matches explicit user constraints
-4. Score remaining profiles by keyword overlap with prompt/stack (`+1` per keyword hit)
-5. Select only if highest score is unique and `>= 2`
-6. If tied or below threshold: ask the human to choose; if no clarification is available, create a new profile from `_template.md` instead of forcing a weak match
-7. Record the selected profile and reason in the project design doc
-
-## Naming Convention
-
-`[domain]-[stack].md`
-
-The filenames below are naming examples, not bundled profiles in this starter pack.
-
-Examples:
-- `web-angular-lit.md`
-- `web-react-nextjs.md`
-- `plc-siemens-scl.md`
-- `embedded-stm32-freertos.md`
-- `backend-python-fastapi.md`
-
-## Who Creates Profiles
-
-1. **The human (proactively)** — Create profiles for stacks you use frequently. Use `_template.md`.
-2. **The Builder (during a project)** — When no profile exists for the stack, the Builder creates one during the Design phase. Pitfalls discovered during implementation enrich it.
-
-## Profile Sections
-
-| Section | Purpose |
-|---------|---------|
-| Selection Metadata | Deterministic profile routing (`Profile ID`, keywords, use/do-not-use rules) |
-| Terminology Mapping | Translates generic "build/test/deploy" to stack language |
-| Verification Commands | Exact commands for each gate (0-4) |
-| Common Pitfalls | Frequent errors with detection patterns |
-| Adversary Questions | Domain-specific questions to answer BEFORE coding — born from real bugs. Must be answered in the Design doc's "Adversary Questions Applied" section |
-| Integration Rules | Data flow between technologies, build scoping, init order |
-| Automated Checks | Executable commands for mechanical verification |
-| Decision History | Permanent constraints from real project experience |
-| Review Checklist | Items to verify during self-review |
-
-## When No Profile Exists
-
-The Builder creates one using `_template.md` during the Design phase. Minimum viable profile: Terminology Mapping + Verification Commands + 2 Common Pitfalls.
diff --git a/catalog/README.md b/catalog/README.md
new file mode 100644
index 0000000..66e887f
--- /dev/null
+++ b/catalog/README.md
@@ -0,0 +1,62 @@
+# Domain Profile Catalog
+
+Community-contributed domain profiles for Agent Kit. Each profile captures stack-specific knowledge — pitfalls, adversary questions, verification commands, and decision history — learned from real projects.
+
+## Available Profiles
+
+| Profile | Stack | Pitfalls | Adversary Qs |
+|---------|-------|----------|--------------|
+| [apps-sdk-mcp-lit-vite](apps-sdk-mcp-lit-vite.md) | MCP Apps + Lit + Vite + TypeScript | 11 | 7 |
+| [web-kinu-preact-vite](web-kinu-preact-vite.md) | Kinu + Preact + Vite + TypeScript | 4 | 4 |
+
+## Using a profile
+
+Create a profile link in your project's `framework/domains/` directory that extends the catalog profile:
+
+```markdown
+
+
+## Profile Link
+
+extends: web-kinu-preact-vite
+catalog_version: 1.0.0
+
+## Local Pitfalls
+
+
+## Local Overrides
+
+```
+
+The Builder loads the base from `catalog/` and merges your local additions on top. See `framework/domains/_template.md` for the full template and `framework/domains/README.md` for merge rules.
+
+## Contributing a profile
+
+Domain profiles grow from real project experience. If you've built projects with a stack that isn't represented here, consider contributing your profile.
+
+### Requirements
+
+1. Use the template at `framework/templates/DOMAIN_PROFILE-template.md`
+2. Follow the naming convention: `[domain]-[stack].md` (e.g., `web-react-nextjs.md`, `backend-python-fastapi.md`)
+3. Include at minimum:
+ - **Selection Metadata** — Profile ID, Match Keywords, Use When, Do Not Use When
+ - **Terminology Mapping** — Stack-specific command translations
+ - **Verification Commands** — Exact commands for Gates 0-4
+ - **2+ Common Pitfalls** — With What/Correct/Detection pattern
+4. Every pitfall and adversary question should come from a real bug or failure — not hypotheticals
+
+### What makes a good profile
+
+- **Specific:** "Vite uses `--k-` CSS variable prefix, not `--p-`" beats "check your CSS variables"
+- **Actionable:** Each pitfall has a Detection command that can be run mechanically
+- **Honest:** If a pitfall was discovered by making the mistake, say so
+- **Growing:** A profile with 3 real pitfalls is more valuable than one with 10 speculative ones
+
+### Submitting
+
+1. Fork the repository
+2. Add your profile to `catalog/`
+3. Open a pull request with:
+ - The stack and domain your profile covers
+ - How many projects informed the profile
+ - At least one example of a pitfall that prevented a real bug
diff --git a/agent-kit/domains/apps-sdk-mcp-lit-vite.md b/catalog/apps-sdk-mcp-lit-vite.md
similarity index 100%
rename from agent-kit/domains/apps-sdk-mcp-lit-vite.md
rename to catalog/apps-sdk-mcp-lit-vite.md
diff --git a/examples/PASO-A-PASO.md b/examples/PASO-A-PASO.md
new file mode 100644
index 0000000..e2ddfa5
--- /dev/null
+++ b/examples/PASO-A-PASO.md
@@ -0,0 +1,412 @@
+# Paso a paso: qué ocurre cuando pegas un prompt
+
+Este documento describe la secuencia completa desde que escribes un prompt hasta que el proyecto está terminado y verificado. Cubre el flujo **Standard/Full** (el más completo). El flujo Quick es una versión reducida que salta directamente a código + Gate 2.
+
+---
+
+## Diagrama general
+
+```mermaid
+graph TB
+ %% ── Arranque ──
+ PROMPT["👤 Usuario pega el prompt
'Read AGENTS.md. Build...'"]
+ READ_AGENTS["🤖 Lee AGENTS.md"]
+ READ_BUILDER["🤖 Lee BUILDER.md + GATEKEEPER.md"]
+ PROMPT --> READ_AGENTS --> READ_BUILDER
+
+ %% ── Clasificación ──
+ READ_BUILDER --> SIZE{"¿Qué tamaño
tiene la tarea?"}
+ SIZE -->|"< 3 archivos,
alcance claro"| QUICK["⚡ Quick
Código → Gate 2 → Fin"]
+ SIZE -->|"feature"| STD["📋 Standard"]
+ SIZE -->|"proyecto nuevo /
refactor mayor"| FULL["📋 Full
(Standard + ADRs +
Devil's Advocate)"]
+
+ %% ── Escalado Quick ──
+ QUICK --> Q_ESC{"¿Tocó > 3 archivos
o bugs nuevos?"}
+ Q_ESC -->|"Sí"| STD
+ Q_ESC -->|"No"| DONE["✅ Hecho"]
+
+ %% ── Flujo Standard/Full ──
+ subgraph PROCESS ["Proceso Standard / Full"]
+ direction TB
+
+ subgraph PHASE_1 ["FASE 1 · Entender + Preparar"]
+ direction TB
+ INTENT["1️⃣ Capturar Intent
docs/[proyecto]-intent.md
Qué · Por qué · Comportamientos
Decisiones · Restricciones"]
+ LOAD["2️⃣ Cargar Domain Profile
Resolver extends → catalog/
Merge: base + local"]
+ SKILLS["3️⃣ Cargar Skills relevantes
.github/skills/ · .agents/skills/"]
+ READ_PROFILE["4️⃣ Leer CADA pitfall
y adversary question
del perfil mergeado"]
+ INTENT --> LOAD --> SKILLS --> READ_PROFILE
+ end
+
+ subgraph PHASE_2 ["FASE 2 · Diseñar"]
+ direction TB
+ DESIGN["5️⃣ Design — 4 lentes
docs/[proyecto]-design.md"]
+ LENSES["User · Architecture
Adversary · Domain"]
+ AQ["6️⃣ Adversary Questions Applied
Responder cada pregunta
del perfil contra ESTE diseño"]
+ DP["7️⃣ Domain Pitfalls Applied
Cómo se aborda cada
pitfall conocido"]
+ CHECKPOINT["8️⃣ Pre-Implementation Checkpoint
4 preguntas antes de codificar"]
+ DESIGN --- LENSES
+ DESIGN --> AQ --> DP --> CHECKPOINT
+ end
+
+ subgraph PHASE_3 ["FASE 3 · Construir + Verificar"]
+ direction TB
+ CODE["9️⃣ Builder implementa código"]
+ HANDOFF["🔟 Handoff al GateKeeper
'Gate X listo para verificar'"]
+ CODE --> HANDOFF
+
+ subgraph GATES ["GateKeeper ejecuta gates"]
+ direction TB
+ G0["Gate 0 · Dependencias
npm install → exit 0"]
+ G1["Gate 1 · Scaffold
build → artefactos existen"]
+ G2["Gate 2 · Feature
build + tests → sin regresiones"]
+ G3["Gate 3 · Tests
suite completa → todo pasa"]
+ G4["Gate 4 · Clean Build
desde cero → todo pasa"]
+ G0 --> G1 --> G2 --> G3 --> G4
+ end
+
+ HANDOFF --> GATES
+ end
+
+ subgraph PHASE_4 ["FASE 4 · Cerrar"]
+ direction TB
+ REVIEW["1️⃣1️⃣ Self-Review
Adversary Lens sobre
el código terminado"]
+ LEARNING["1️⃣2️⃣ Domain Learning
Actualizar perfil con
descubrimientos"]
+ REVIEW --> LEARNING
+ end
+
+ PHASE_1 --> PHASE_2 --> PHASE_3 --> PHASE_4
+ end
+
+ STD --> PROCESS
+ FULL --> PROCESS
+
+ %% ── Bucle de fallo ──
+ FAIL{"❌ Gate falla"}
+ G0 --> FAIL
+ G1 --> FAIL
+ G2 --> FAIL
+ G3 --> FAIL
+ FAIL -->|"Log al Builder"| FIX["Root cause → Fix"]
+ FIX -->|"Reenvía al
GateKeeper"| GATES
+ FIX -->|"Nuevo pitfall"| UPDATE_DP["Actualizar
Domain Profile"]
+
+ %% ── Artefactos ──
+ VLOG["📄 Verification Log
docs/[proyecto]-verification.md
Progreso · Output real · Fallos"]
+ GATES -. "output real" .-> VLOG
+ FAIL -. "historial de fallos" .-> VLOG
+
+ %% ── Flywheel ──
+ DP_NODE[("🧠 Domain Profile
catalog/ (base)
domains/ (local)")]
+ LEARNING --> DP_NODE
+ UPDATE_DP --> DP_NODE
+ DP_NODE -. "próximo proyecto
arranca sabiendo
todo esto" .-> LOAD
+
+ %% ── Estilos ──
+ style DP_NODE fill:#4CAF50,color:#fff,stroke:#2E7D32,stroke-width:2px
+ style VLOG fill:#2196F3,color:#fff,stroke:#1565C0,stroke-width:2px
+ style FAIL fill:#f44336,color:#fff,stroke:#c62828
+ style FIX fill:#f44336,color:#fff,stroke:#c62828
+ style UPDATE_DP fill:#4CAF50,color:#fff,stroke:#2E7D32
+ style SKILLS fill:#CE93D8,color:#000,stroke:#8E24AA,stroke-width:1px
+ style DONE fill:#4CAF50,color:#fff,stroke:#2E7D32
+ style CHECKPOINT fill:#FF9800,color:#fff,stroke:#E65100
+```
+
+---
+
+## Paso a paso detallado
+
+### ARRANQUE — El prompt activa la cadena
+
+**Paso 0: El usuario pega el prompt**
+
+```
+Read AGENTS.md. Build a task management widget.
+Stack: Lit 3, Vite, TypeScript, MCP SDK.
+```
+
+La línea `Read AGENTS.md` es el disparador. Sin ella, el LLM no sabe que existe el framework.
+
+**Paso 0.1: El LLM lee AGENTS.md**
+
+AGENTS.md contiene solo 5 líneas. Le dice al LLM:
+- Para diseñar e implementar → lee `framework/BUILDER.md`
+- Para verificar → lee `framework/GATEKEEPER.md`
+- Los artefactos van en `docs/`
+
+**Paso 0.2: El LLM lee BUILDER.md**
+
+BUILDER.md es el contrato de proceso completo. El LLM absorbe:
+- Las 4 lentes (User, Architecture, Adversary, Domain)
+- Las 3 escalas (Quick, Standard, Full)
+- El protocolo de gates
+- Las reglas de domain profiles (modelo de herencia)
+- La Anti-Loop Rule
+
+**Paso 0.3: Clasificación por tamaño**
+
+El LLM evalúa el prompt:
+
+| Tamaño | Criterio | Qué produce |
+|--------|----------|-------------|
+| **Quick** | < 3 archivos, alcance obvio | Código + Gate 2 |
+| **Standard** | Feature. Hay decisiones de diseño | Intent + Design + Código + Verification Log |
+| **Full** | Proyecto nuevo o refactor mayor | Todo de Standard + ADRs + Devil's Advocate |
+
+> Regla: en caso de duda, sube un nivel. Es más barato documentar de más que descubrir tarde que faltaba una decisión.
+
+---
+
+### FASE 1 — Entender
+
+**Paso 1: Capturar el Intent**
+
+El LLM crea `docs/[proyecto]-intent.md` ANTES de investigar más (Anti-Loop Rule). Extrae del prompt:
+
+- **Goal** — Qué y por qué (1-2 frases)
+- **Behavior** — Comportamientos observables en formato given/when/then
+- **Decisions** — Decisiones tomadas con alternativas rechazadas
+- **Constraints** — MUST / MUST NOT / SHOULD
+- **Scope** — Qué entra (IN) y qué queda fuera (OUT)
+- **Acceptance** — Condiciones verificables de "terminado"
+
+Si algo no está claro, lo escribe como pregunta abierta y **pregunta al humano**. No asume.
+
+> Este es tu momento de corregir rumbo. Si una decisión es incorrecta, dilo ahora.
+
+**Paso 2: Cargar el Domain Profile (modelo de herencia)**
+
+El LLM busca en `framework/domains/`:
+
+1. Encuentra un archivo (ej. `mi-proyecto.md`) con un campo `extends: apps-sdk-mcp-lit-vite`
+2. Carga el perfil base desde `catalog/apps-sdk-mcp-lit-vite.md`
+3. Aplica las reglas de merge:
+ - **Local Pitfalls** y **Local Adversary Questions** → se **añaden** a las del base
+ - **Local Overrides** → **reemplazan** la sección correspondiente del base
+ - **Local Decision History** → se mantiene separado
+ - Todo lo demás → se hereda del base sin cambios
+
+Si no existe ningún perfil → el LLM crea uno nuevo completo en `catalog/` y luego un link en `domains/`.
+
+**Paso 3: Cargar Skills relevantes**
+
+El LLM busca en `.github/skills/` y `.agents/skills/` archivos `SKILL.md`. Lee la `description` de cada uno y carga los que encajan con la tarea. Por ejemplo, una skill `frontend-design` se carga para tareas de UI pero se ignora para una API backend.
+
+Las skills son guidance de diseño y calidad — no reemplazan el proceso del framework ni los domain profiles. Si no hay skills instaladas, se salta este paso.
+
+> En proyectos **Full**, este paso es obligatorio. Si no hay skills, se documenta "ninguna encontrada".
+
+**Paso 4: Leer cada pitfall y adversary question**
+
+No basta con "cargar" el perfil. El LLM lee activamente cada pitfall y cada adversary question del perfil mergeado. Estos informan el diseño — cargar sin leer es inútil.
+
+---
+
+### FASE 2 — Diseñar
+
+**Paso 5: Design Document — las 4 lentes en un solo pase**
+
+El LLM crea `docs/[proyecto]-design.md` aplicando las 4 lentes simultáneamente:
+
+| Lente | Pregunta central | Qué produce |
+|-------|-----------------|-------------|
+| **User** | ¿Qué debe hacer el software? | Goals, behaviors, needs implícitas |
+| **Architecture** | ¿Cómo se construye? | Stack, estructura, data flow, init chain, dependencias |
+| **Adversary** | ¿Qué puede salir mal? | Risks, edge cases, assumptions cuestionables |
+| **Domain** | ¿Qué dice el perfil? | Pitfalls aplicados, integration rules, terminología |
+
+El Design incluye:
+- **Domain Profile Selection Rationale** — Por qué se eligió este perfil (con scores)
+- **Skills Loaded** — Qué skills se cargaron (o "ninguna")
+- **Stack** — Tecnologías con versiones verificadas (`npm view`)
+- **Architecture** — Estructura, data flow, init chain
+- **Decisions** — Cada decisión arquitectónica con alternativas rechazadas
+- **Risks** — Identificados ANTES de implementar
+
+**Paso 6: Adversary Questions Applied** (sección obligatoria)
+
+Cada adversary question del perfil se responde contra ESTE diseño específico:
+
+| Pregunta del perfil | Respuesta para este diseño |
+|---------------------|---------------------------|
+| "¿Qué pasa si `document.referrer` está vacío?" | "No aplica — usamos SDK `App` class que usa `postMessage`" |
+
+> Checking pitfalls ≠ answering adversary questions. Son secciones separadas con propósitos distintos.
+
+**Paso 7: Domain Pitfalls Applied** (sección obligatoria)
+
+Para cada pitfall del perfil: ¿aplica? ¿cómo se aborda?
+
+| Pitfall | ¿Aplica? | Cómo se aborda |
+|---------|----------|----------------|
+| Attribute binding for non-strings | Sí | Property binding en todos los casos |
+| CORS en widget assets | Sí | CSP configurado en `_meta.ui` |
+
+**Paso 8: Pre-Implementation Checkpoint**
+
+4 preguntas antes de escribir una sola línea de código:
+
+1. **¿Mis dependencias ya resuelven esto?** — Lee la API pública. Si la librería lo ofrece, úsala.
+2. **¿Qué assumption del entorno podría estar mal?** — Identifica al menos una.
+3. **¿He revisado los pitfalls del perfil?** — Cada pitfall y adversary question contra el plan.
+4. **¿Sigue siendo el tamaño correcto?** — Re-evalúa Quick vs Standard vs Full.
+
+> No es un documento. Es una pausa mental — existe porque los LLMs bajo presión se la saltan.
+
+---
+
+### FASE 3 — Construir y verificar
+
+**Paso 9: El Builder implementa código**
+
+El Builder escribe código siguiendo el Design. El código va en su propio directorio (ej. `mcp-task-widget/`), nunca en la raíz del repo.
+
+**Paso 10: Handoff adversarial al GateKeeper**
+
+El Builder **nunca verifica su propio trabajo**. Cuando una fase está lista:
+
+1. Declara: *"Gate X listo para verificar"*
+2. **Para.** No ejecuta comandos de verificación.
+3. El GateKeeper toma el control.
+
+> Esta separación elimina las auto-aprobaciones alucinadas.
+
+**Paso 10.1: El GateKeeper ejecuta los gates**
+
+El GateKeeper es un agente estrictamente mecánico:
+
+| Gate | Qué verifica | Criterio de paso |
+|------|-------------|-----------------|
+| **0** | Dependencias | `npm install` → exit 0, sin warnings de dependencias |
+| **1** | Scaffold | Build → exit 0, artefactos existen en disco |
+| **2** | Feature | Build + tests → exit 0, sin regresiones |
+| **3** | Tests | Suite completa → todo pasa, coverage cumple target |
+| **4** | Clean Build | Desde cero (borrar todo → install → build → test) → todo pasa |
+
+Para cada gate, el GateKeeper:
+1. Lee los comandos del Domain Profile
+2. Los ejecuta en terminal
+3. Captura STDOUT/STDERR + exit code
+4. Pega el output real en `docs/[proyecto]-verification.md`
+
+> "Assumed to pass" nunca es evidencia válida. Output real o no ocurrió.
+
+**Paso 10.2: Qué pasa cuando un gate falla**
+
+```
+[GATE REJECTED]
+Gate: 2
+Exit Code: 1
+Raw Output:
+