The Foundation step, once per product: frame its purpose, scope, MVP, roadmap and stack, for review. Use when the user says "start the project", "write the Foundation", "do discovery", "market research / feasibility / roadmap", or "what should we build first".
3 stars
0 votes
0 copies
1 view
Added November 14, 2026
developmentgoshellgitdatabase
Works with
cli
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Yad Discovery?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/abdelrahmannasr-yad-discovery)
---
name: yad-discovery
description: 'The Foundation step, once per product: frame its purpose, scope, MVP, roadmap and stack, for review. Use when the user says "start the project", "write the Foundation", "do discovery", "market research / feasibility / roadmap", or "what should we build first".'
---
# SDLC — Foundation (the Product level)
<!-- generated: yad-cli — from cli/skill-yad-cli.mjs by scripts/skill-yad-cli.mjs; do not edit by hand -->
**This skill needs the `yad` command.** Before its first `yad …` command, run `command -v yad` (in PowerShell, `(Get-Command yad -ErrorAction SilentlyContinue).Source`). When it prints nothing, the yadflow CLI is not installed on this machine: stop there, and tell the person:
- Install it with `npm install -g yadflow@latest`, or run each command as `npx -y yadflow@4 …` in place of `yad …`.
- It is needed because the CLI is what enforces the approvals. Without it, a step could only ask you to wait; it could not check that a person approved.
Go on only when that check prints a path, or when the person chooses `npx -y yadflow@4`. A command this skill already writes as `npx -y yadflow@4 …` runs without the install.
<!-- end: yad-cli -->
**Goal:** Produce a human-authored, AI-assisted **Foundation** for the whole product under
`{project-root}/foundation/`, then hand off to `yad-review-gate`. The Foundation says why the product
exists, what it is and is not, the smallest thing worth shipping, and the rough order after that. Its
`roadmap.md` is the menu of features; each feature is later taken into the normal `yad-epic` flow,
which reads it for project context.
**What the Foundation is.** The roadmap (`docs/design-rules.md`, Part 1) has two levels. The
**Product** level runs once per product and holds the Foundation. The **Feature** level runs once per
epic and walks the six phases. The Foundation has its own gate: one approval before feature work
begins. That approval is **reported, not enforced** in this release — `yad next` says when feature
epics are going ahead of an unapproved Foundation, and nothing is blocked.
This is a **Shape step**: human-authored with AI assist and **never auto-advances**. It is
**optional** — a team that already knows what to build can start at `yad-epic`. It supports **both
greenfield and brownfield**.
The skill keeps its old name, `yad-discovery`. Before E75 it wrote a different set of files under the
reserved `EP-discovery` epic; that older spelling is still read (see Step 1).
## Conventions
- `{project-root}` resolves from the project working directory.
- The Foundation lives in `{project-root}/foundation/`: its sections directly inside it, its ledger in
`foundation/.sdlc/`, and its review summaries in `foundation/reviews/`. Its fixed id is
`EP-foundation` — every `yad` command takes that id.
- Speak in the `communication_language` set in `{project-root}/.sdlc/config.yaml`; write documents in `document_output_language`.
## On Activation
### Step 1 — Entry guard (one Foundation per product)
- If `{project-root}/foundation/.sdlc/state.json` already exists, **STOP** and point the user at
`yad next EP-foundation`. The Foundation is already seeded; edit its sections in place.
- If `{project-root}/epics/EP-discovery/.sdlc/state.json` exists, this product already has its Product
level **in the old spelling**. A product has ONE Foundation, so do not seed a second. **STOP** and tell
the user:
- on a **local** ledger, `yad migrate` (preview) then `yad migrate --apply` converts it into
`foundation/`, keeping its files and approvals;
- on a **verified** ledger CI owns that ledger and it cannot be moved by hand — keep working in
`epics/EP-discovery/`, and review it with `yad gate open EP-discovery discovery/`.
Detect the project mode from `{project-root}/.sdlc/product.json` (`.sdlc/hub.json` on an older Product that has only that name) `profile.codebase`
(`greenfield` | `brownfield`, set by `yad setup`). If absent, ask the user; default `greenfield`.
### Step 2 — Shape with the field-expert lenses (assist: analyst + pm)
Adopt the **analyst** lens and the **pm** lens to frame the product as a domain expert would. Research:
- **Market** — market size, segments, demand, trends, positioning.
- **Domain** — the problem domain, regulations, and constraints of the field.
- **Product brief** — the users it serves, the value proposition, success metrics.
Pressure-test: who is this for and why does it exist, what does success look like, who else does this
and why us, **what it is and explicitly what it is not**, what the smallest valuable slice is, what
sequences after it, what it is built with, and what could kill it.
### Step 2a — Greenfield: write the Foundation with the user, one section at a time
On a **greenfield** product nothing is built yet, so every section comes from the user's answers. For
each section, `references/foundation-schema.md` gives the template, the questions to **Ask**, what **a
good answer** holds, what **the reviewer checks**, and a short example.
Work in this order, because each section is the input to the next:
1. `purpose.md` — why it exists, who for, how success is measured.
2. `scope.md` — what it is, and at least three things it is **not**.
3. `mvp.md` — the smallest set of capabilities that reaches the first success signal.
4. `roadmap.md` — Phase 1 is exactly the MVP, one row per feature; later phases in a stated order.
5. `stack.md` — for each choice: the decision, the alternatives rejected, and why.
6. `repos.md` — the layout and one row per intended repo; they need not exist yet.
7. `market.md` and `risks.md` — only if the user wants them. Both are optional.
For each section:
- Ask the questions **one at a time**. Write down the user's answer, not your own guess. When an answer is
vague ("everyone", "fast", "not bloated"), ask again for something concrete.
- Draft the section's text, show it to the user, and change it until they agree. Then move to the next
one. The agreed text is written into `foundation/` in Step 5, once the authoring branch (Step 3) and the
ledger (Step 4) exist — never onto whatever branch happens to be checked out.
- Check it against the sections before it: the MVP must not contradict a non-goal in `scope.md`, and
Phase 1 of the roadmap must match `mvp.md`.
Keep examples inside `<!-- comments -->`. A section holding only its headings, comments and an empty table
is **not written**, and the gate warns about it (Step 5) — but a filled example row counts as content.
### Step 2b — Brownfield: read what already exists
Read the registry `{project-root}/.sdlc/repos.json` (`config.yaml` `code_context`). For **every
connected repo**, load the lightweight code-map `{project-root}/.sdlc/code-context/<repo>/code-map.md`
and base `stack.md` and `repos.md` on **what already exists** — languages, frameworks, modules,
endpoints, data — so the Foundation describes the real system rather than re-proposing it.
- **Greenfield-safe:** if `repos.json` is absent or empty, there is nothing to read — write every
section with the user as in Step 2a, where `stack.md` and `repos.md` record the intended choices, the
alternatives rejected, and why.
- **Staleness:** if a repo's current HEAD (`git -C <path> rev-parse HEAD`) ≠ its registry `syncedHead`,
warn and suggest `yad repo refresh <repo>` (a human decision — flag, never auto-refresh).
- **Backfill pointer:** for an existing codebase, point the user at `yad-backfill` to capture specs for
already-built features; the Foundation frames the *product*, backfill captures the *features*.
### Step 3 — Open the authoring branch
Open the Foundation authoring branch `foundation/EP-foundation` per the shared procedure
(`../yad-epic/references/state-schema.md` → "Authoring branches"): git-safe (skip with a note if
`{project-root}` is not a git work tree), check out the branch if it exists, else create it from the
Product's default branch. Author the Foundation on it, and end the step with `yad fold EP-foundation foundation` — the one commit the
step keeps (E44). Distinct from the verified ledger's
`review/EP-foundation/foundation` branch.
### Step 4 — Seed the ledger with the engine
Run:
```
yad foundation new
```
That writes `foundation/.sdlc/state.json` with the Foundation's two-step chain (`foundation` →
`foundation-review`), an empty `approvals.json` and `comments.json`, and the `foundation/reviews/`
folder. The engine owns that file: do not write or edit it by hand. The command refuses a second
Foundation and a product still on the old spelling (Step 1 already stopped for both).
### Step 5 — Write the Foundation sections
Write these files directly in `{project-root}/foundation/`, one per section, using the templates in
`references/foundation-schema.md` for their headings. The bodies are the text already agreed with the
user — on greenfield, the sections drafted in Step 2a; on brownfield, what Step 2b read from the
code-maps. Do not start a section over from its blank template. The gate binds to the **whole set**: editing any section revokes
approvals. (The frontmatter `status:` line does not count — the gate rewrites it after the review.)
| File | Section | Required? |
|---|---|---|
| `purpose.md` | Why this exists, who it is for, what success looks like | required |
| `market.md` | Who else does this, and why us | optional |
| `scope.md` | What it is — **and explicitly what it is not** | required |
| `mvp.md` | The smallest thing worth shipping | required |
| `roadmap.md` | The rough order after the MVP — the menu of feature epics | required |
| `stack.md` | Languages, frameworks, hosting, databases | required |
| `repos.md` | How many repos, what each does, monorepo or separate | required |
| `risks.md` | What could kill this | optional |
**All six required sections must exist to review.** Until they do, the Foundation has no fingerprint to
bind an approval to, and `yad gate open` warns. An optional section counts once it exists — adding or
removing one after an approval revokes it, like any other edit.
**Every section that exists must also be written.** A section that still holds only its template — the
frontmatter, `#` and `##` headings, comments, `---` dividers and an empty table — makes `yad gate open` and `yad gate sync` warn
`Foundation not written yet`, and once the review has opened or passed `yad doctor` reports it as
`foundation:unwritten`. These are warnings, not refusals: finish the section before asking for review.
Leave `owner` for the user to set in each frontmatter. Fill the bodies with the user.
### Step 6 — Stop at the gate (do NOT advance)
Report the path to the Foundation, and that the next action is **review** via `yad-review-gate`:
```
yad gate open EP-foundation foundation/
```
**Never mark `foundation-review` approved here** — only real reviewers do that through the gate. When
the gate passes, the ledger moves to the `foundation-done` sentinel (not `ready-for-build` — the
Foundation has no Build). From then on `foundation/roadmap.md` and `foundation/scope.md` are the inputs
each `yad-epic` reads (its "Step 2c"). When the Product has a platform, the gate opens a review PR on the
Product (via `yad-product-bridge`) and `yad-review-gate action: sync` pulls platform approvals and comments
into the ledger; otherwise the review is recorded locally.
**Once the review has passed and the Product has a platform, offer to publish the roadmap** (E174). Ask the
person, then run `yad foundation publish --dry-run` to show what it would create, then `yad foundation publish`.
It opens one issue or work item per roadmap feature in the Product repo: type feature, a priority by phase
(the first phase, the MVP, is P1; the next P2; later ones P3), the label `epic: EP-x`, and the phase as its
milestone. The `Later / parked` phase is left out. If the Foundation changed after its review, the command refuses:
the changed roadmap needs a new review first. Report the links, and remind the person to commit
`foundation/.sdlc/roadmap-items.json` on a branch of its own, not a `review/…` one, and open a pull request
(`chore: record tracker links`). A review branch would advance a step. On a verified Product, the Product
checks let a pull request of that file, the epics' `.sdlc/issue-links.json` files and step owner files alone
through from any branch (#512), once a `yad update` carrying that rule has merged on the default branch.
## Reference
- Foundation section templates: `references/foundation-schema.md`.
- The older spelling of the Product level (`EP-discovery`, its six files, and how it converts):
`references/discovery-schema.md`.
- State schema, chain shapes, and the authoring-branch procedure:
`../yad-epic/references/state-schema.md`.
- The epic step that consumes `roadmap.md`: `../yad-epic/SKILL.md` (Step 2c).
- Capturing already-built features in a brownfield codebase: `../yad-backfill/SKILL.md`.
- Connecting code repos + the code-context the brain reads: `../yad-connect-repos/SKILL.md`.