AGENT SKILL

write-prd

Use to turn a raw feature idea into a reviewed PRD.md — a lightweight Socratic interview front (capture the idea, deep-dive the problem) merged with a full product spec (context, goals, user stories, acceptance criteria, NFRs, KPIs). Triggers on "/sdlc:write-prd {slug}", "write PRD for {slug}", "draft PRD for {slug}", "PRD для {slug}", "write spec for {slug}", "product requirements for {slug}", "напиши PRD {slug}", "опиши вимоги", "зафіксуй ідею". Opens by setting the interview-depth dial (easy/medium/hard), drafts from templates/PRD-template.md, validates each acceptance criterion Socratically, runs a clean-context critic (sdlc:critic), then writes docs/features/{slug}/PRD.md. Hard refuse if idea-brief.md or CONTEXT.md missing.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 15
Forks
13

01 前言 Front Matter

name
write-prd
model
opus
stage
03
agents
[ "critic" ]
effort
high
triggers
[ "/sdlc:write-prd", "write PRD for", "draft PRD for", "PRD для", "write spec for", "product requirements for" ]
description
Use to turn a raw feature idea into a reviewed PRD.md — a lightweight Socratic interview front (capture the idea, deep-dive the problem) merged with a full product spec (context, goals, user stories, acceptance criteria, NFRs, KPIs). Triggers on "/sdlc:write-prd {slug}", "write PRD for {slug}", "draft PRD for {slug}", "PRD для {slug}", "write spec for {slug}", "product requirements for {slug}", "напиши PRD {slug}", "опиши вимоги", "зафіксуй ідею". Opens by setting the interview-depth dial (easy/medium/hard), drafts from templates/PRD-template.md, validates each acceptance criterion Socratically, runs a clean-context critic (sdlc:critic), then writes docs/features/{slug}/PRD.md. Hard refuse if idea-brief.md or CONTEXT.md missing.

02 资源文件 8

03 SKILL.md 正文

Skill: write-prd (SDLC stage 03 — PRD drafter)

Turns a one-line idea into a reviewed PRD.md: a lightweight interview captures and stress-tests the idea, then the skill drafts a product spec (context → goals → user stories → acceptance criteria → NFRs → KPIs), validates it Socratically, and runs a clean-context critic before writing. Less typing, more reviewing. This file is the spine; detail lives in references/.

The Socratic machine, the critic, and the ask-style are shared — this skill keeps only its deltas: → ../_shared/socratic-loop.md · ../_shared/critic.md · ../_shared/ask-style.md

Depth governs question volume + autonomy → ../_shared/interview-depth.md.

Owner

PM + Tech Lead (co-authors). PM drives goals / non-goals / KPIs; Tech Lead drives context patterns and the acceptance-criteria coverage.

Inputs

Hard required (skill stops without them):

  • <slug> — kebab-case feature slug.
  • docs/features/<slug>/idea-brief.md — problem, RICE, Recommendation (§13), Out of scope (§6). Missing → «run /sdlc:interview <slug> first».
  • docs/features/<slug>/CONTEXT.md — canonical glossary (role names, domain terms). Missing → «run /sdlc:fix-term <slug> first». No silent fallback.

Optional:

  • docs/features/<slug>/.size — depth hint (MVP vs Full per the size matrix). Read if present; established here if absent (step 1 classifies + writes it), so downstream stages never silently default to M.
  • --reference <path-to-module> — passed at invocation; pre-selects the «Reference module code» channel in step 3.

Protocol

  1. Prereq check + read context + set interview depth. test -f both required inputs and stop with the appropriate error if either is missing. Then: if CONTEXT.md exists, load its ## Glossary as session state (canonical roles + terms). If .size exists, read it to size the PRD's depth; if absent, establish it now — classify the feature via the 4 signals in ../_shared/size-matrix.md (PR count / time-to-merge / new module·API·migration / breaking changes), confirm in one bundled AskUserQuestion (at easy depth, take the matrix default and record it in the assumptions ledger), and write docs/features/<slug>/.size — so every later stage reads a real size instead of silently defaulting to M. classify-size stays the utility to re-classify when scope changes. If docs/architecture-map.md exists (from map-architecture), read it so the PRD is architecture-aware — it informs §1 Context, §2 Constraints, and §3 Non-goals (what the existing system already does / can't do). Absent → suggest running /sdlc:map-architecture first, but proceed (the PRD is product-level and can be captured without it). Do not leak the map's tech into §5 AC — AC stay business-observable; the map shapes constraints, not acceptance criteria. Then set the interview depth (the opening question): if .claude/sdlc.local.md is absent, auto-create it with the documented default frontmatter (every key + its allowed values explained inline) and patch .gitignore; then read interview_depth from it (else default medium), and — unless a --depth=easy|medium|hard arg was passed (which skips the question) — ask ONE depth-selection AskUserQuestion phrased per ../_shared/ask-style.md, with the saved/medium value as the «(Recommended)» first option, overridable per run. The chosen level governs the step-2 deep-dive volume and the step-7 Socratic volume → ../_shared/interview-depth.md. (Completeness — §5's 5-type AC floor and §4→§5 use-case floor — is unaffected by depth.)

  2. Capture the idea (interview front). One AskUserQuestion for the raw idea in 1–3 sentences (persist verbatim as the baseline). Then a Socratic deep-dive across problem clarity / success criteria / constraints / strategic fit, delivered in batches of 2–3 — its volume scales with the depth dial (easy: only the few un-inferable ones, then a stated-assumptions ledger; medium: 3–5; hard: walk every angle, foreground each trade-off). Phrase every question per ../_shared/ask-style.md.

  3. Reconcile the glossary in-flow (a hard rule, at every depth). On every new or unknown domain term that surfaces in the interview or the draft, invoke /sdlc:fix-term <slug> for it immediately — compare it against CONTEXT.md and add/update the definition before continuing. By the time the PRD is written, every §4 role and §5 domain term is already glossary-canonical; the glossary is never a deferred batch.

  4. Ask which extra channels to read (multi-select AskUserQuestion): reference module code / project docs / MCP-Atlassian (Confluence) / MCP-Atlassian (Jira) / knowledge-base / none. For each picked channel ask the specific path/query — no silent broad scans. If --reference was passed, pre-select Reference module code.

  5. Read selected channels. Reference module → extract entity types, error sentinels, status constants, authz checks. MCP-Atlassian → mcp__atlassian__search for specified pages/tickets. Docs / RAG → only the paths/topics the user named.

  6. Read the template + draft §1–§8. Read ./templates/PRD-template.md (its <!-- Skill instruction: ... --> comments are the per-section contract). Draft per ./references/draft-generation.md: per-section sources, the 5 AC coverage types (happy / error / authorization / domain invariant / cross-context), and the stack-agnostic forbidden-token rule for acceptance criteria. Ensure every §4 user story has ≥1 AC in §5 at draft time (the use-case floor applies before the Socratic walk begins).

  7. Socratic validation. Walk §4 US → §5 AC → §6 NFR → §7 KPI with the shared 4-state machine (per-decision question volume scales with the depth dial — at easy, the un-asked decisions land in the assumptions ledger for a batch veto). write-prd delta → ./references/socratic-loop.md: AC has a 5th option «Add another AC»; the §5 coverage gate enforces two floors after drops/OQ-migrations — (a) ≥1 AC of each of the 5 coverage types, and (b) ≥1 AC per retained §4 user story (regenerate/add a replacement if a type or a user story is left empty). Both are floors, not dials — enforced at every depth; only the question volume scales. The (b) floor closes the §4→§5 link so the downstream complete-sequence-diagrams use-case coverage + review-feature trace can't be undermined by a user story that lost its only AC. Maintain the edits-log.

  8. Critic + write + commit. Dispatch the critic agent — subagent_type: "sdlc:critic" (carries model: opus + effort: high, clean-isolated context per ../_shared/agent-roster.md) — with the write-prd delta in ./references/critic.md (over ../_shared/critic.md) — inline the draft + edits-log, it Reads CONTEXT.md + idea-brief.md. Resolve findings via AskUserQuestion (Accept revert / Accept amendment / Override-with-rationale → §1 ¶4 bullet). Run the forbidden-token regex scan as the F6 backstop. On pass, write docs/features/<slug>/PRD.md (glossary already reconciled in-flow per step 3) and propose commit 03: PRD for <slug>. Register on the roadmap: add/promote this feature to Now in docs/roadmap.md (via /sdlc:roadmap) — an outcome one-liner + a link to this feature folder + status; if it existed as a Next candidate, move it up. (If there's no roadmap yet, skip — it's optional.) Then emit the stage-handoff block per ../_shared/handoff.md — What I did + Review (PRD.md, .size) + Run next (/clear, then /sdlc:clarify-prd <slug>). (If sdlc:critic is unavailable, fall back to a general-purpose Agent with the same delta.)

Definition of Done

  • docs/features/<slug>/PRD.md written; all sections filled (or <!-- N/A: reason -->).
  • docs/features/<slug>/.size exists after this stage (read if it was present, else classified + written here).
  • §5 holds ≥1 AC of each of the 5 coverage types after drops/OQ-migrations, every §4 user story has ≥1 AC (the use-case floor — no retained US left with zero ACs), and 0 forbidden tokens (HTTP verbs / URL paths / status-code numerics / module.error_name strings / JSON fragments / SQL constructs).
  • §4 roles match the CONTEXT.md glossary exactly (no invented user/admin).
  • §8 Open Questions each carry owner + due (no lone «TBD»).
  • Edits-log maintained; critic (sdlc:critic) ran on the post-Socratic draft; every finding resolved or overridden.

Anti-patterns

  • Skipping the interview front and reconstructing the idea from the model's guess. Capture + deep-dive must actually fire AskUserQuestion.
  • Naming concrete technologies in §1–§3 (a specific datastore, broker, framework, or library). The PRD is WHAT + WHY; technology choices belong to architecture-design.
  • Implementation leak in AC — HTTP/status/error-code/SQL detail. That mapping lives in api-forge and decide-adr.
  • Dispatching general-purpose instead of sdlc:critic without first checking availability. The namespaced critic carries the correct model/effort and clean context; fall back only on confirmed unavailability.
  • Treating brainstorm or initiatives artifacts as PRD inputs. PRD draws only from CONTEXT + idea-brief (required) plus user-selected additional channels.
  • Inventing role names or domain terms not in CONTEXT glossary. The glossary is canonical; the PRD never introduces new role names.

References & template

04 同仓库更多 Skills

genkovich
genkovich/agentic-engineering-course-public

release

Run the whole local release pipeline in order, stopping at each human gate. Triggers on "run the release", "prepare a release", "/release", "зроби реліз", "підготуй реліз". Drives the four stages back to back — bump-version → curate-changelog → release-notes → check-docs-drift — pausing after each so the human reviews the diff before the next stage. Prepares everything in the working tree; never tags, commits, or pushes. The tag push (which fires CI) stays the human's action.

★ 15
genkovich
genkovich/agentic-engineering-course-public

release-notes

Draft partner-facing release notes from the same commits as the changelog. Triggers on "draft release notes", "release notes for the next version", "/release-notes", "нотатки релізу", "release notes партнеру". Same input as curate-changelog, different audience and tone: a short, benefit-first narrative for a user or partner — "what's new for you" — not a categorized engineer's list. Keeps only changes a user actually notices; drops internal refactors and tooling. Prints the notes to the chat to seed a GitHub Release description or a partner announcement. Writes no file.

★ 15
genkovich
genkovich/agentic-engineering-course-public

curate-changelog

Curate the [Unreleased] section of docs/CHANGELOG.md from git history. Triggers on "curate the changelog", "update the changelog", "/curate-changelog", "онови changelog", "курування журналу". Reads git log since the last tag, FILTERS out what a reader never feels (test/ci/chore/merge), GROUPS commits about one feature into one bullet, and REWRITES technical subjects into plain language under the six Keep a Changelog categories (Added/Changed/Deprecated/ Removed/Fixed/Security). The result must have FEWER lines than the raw log — that is the proof of curation, not a dump. Leaves the edit in the working tree; never commits or pushes.

★ 15
genkovich
genkovich/agentic-engineering-course-public

codify-rule

Turn a repeated mistake into a durable, path-scoped rule in .claude/rules/. Triggers on "codify this rule", "make a rule so this doesn't happen again", "/codify-rule", "закодифікуй правило", "петля помилка-правило". Use only when the same mistake showed up TWICE (twice = a pattern, once = noise). Names the wrong shape and the right shape with one short example of each, scopes the rule to the paths that matter, and leaves the edit in the working tree so the next agent on this repo inherits the fix. Edits only .claude/rules/; never commits or pushes.

★ 15
genkovich
genkovich/agentic-engineering-course-public

check-docs-drift

Find and fix where docs/api.md fell behind the code. Triggers on "check for doc drift", "is the API doc up to date", "/check-docs-drift", "перевір дрейф документації", "docs drift". Runs the deterministic scripts/check-docs-drift.py (parses the public NoteBook methods with ast, compares to what docs/api.md documents — NO LLM finds the gap), reports the drift, and PROPOSES the doc edit that closes it. The gap is found by parsing; the agent writes the missing documentation in the doc's existing style. Edits only docs/; never commits or pushes.

★ 15
genkovich
genkovich/agentic-engineering-course-public

bump-version

Decide and apply the next semver for a release. Triggers on "bump the version", "what version is next", "/bump-version", "простав версію", "яка наступна версія". Reads the next number from the deterministic scripts/next-version.sh (NEVER guesses it), explains in plain language WHICH part moved and why (e.g. "MINOR, because a feat landed: filter notes by tag"), edits the version line in pyproject.toml, and proposes the matching `git tag vX.Y.Z`. The number is decided by a rule; the agent explains and applies — the human confirms the tag. Never pushes a tag itself.

★ 15