| name | tdk-epic-prd |
| description | EPIC-ONLY product alignment and slice-map step after tdk-discovery; writes tracker-neutral epic PRD artifacts without minting requirements |
| argument-hint | <epic-id> [--force] [--interview] |
| metadata | {"version":"1.0.0"} |
tdk-epic-prd
Create bounded epic PRD context after /tdk-discovery and before child
/tdk-specify commands.
Triggers:
/tdk-epic-prd <epic-id> [--force] [--interview]
Boundary Declaration
This command is EPIC-ONLY and tracker-neutral. It is product alignment for a
broad epic; it is not requirement authority.
This command produces:
- Epic dashboard at
{FEATURE_DIR}/index.md
- Epic PRD stage manifest at
{FEATURE_DIR}/epic-prd.md
epic-prd/prd.md
epic-prd/slice-map.md
epic-prd/open-questions.md
This command does not create spec.md, plans, HLD artifacts, task breakdown
artifacts, code, tracker issues, product-memory updates, or requirement IDs.
Only child spec.md artifacts mint UR-*, FR-*, and SC-*. Epic PRD slice
keys are slugs and must not mint FS-*.
Feature-sized work skips epic PRD and starts at /tdk-specify.
Skill References
Load before writing any epic PRD file:
references/epic-prd-output-contract.md
references/epic-prd-quality-guidelines.md
.specify/_shared/skills/interview-alignment-protocol.md when --interview is set
Error Recovery
| Situation | Action |
|---|
| Any required discovery artifact is missing | STOP before writing. Tell the user to run /tdk-discovery <epic-id> <brief|file> first. |
epic-prd/index.md exists and epic-prd.md is missing | STOP with legacy layout detected; tell the user to rerun with --force or recreate the test epic. do not auto-migrate. |
epic-prd.md exists and --force is not set | STOP unless --interview is replaying existing PRD artifacts. |
--force is set | Regenerate exactly the four epic PRD files in the new layout. Do not archive or migrate prior files. |
--interview is set and all four PRD files exist | Set PRD_REPLAY_INTERVIEW=true and run interview replay against the current artifacts. |
--interview is set and PRD files do not exist | Generate draft PRD artifacts, then interview them before validation. |
Recovery stays inside the same four epic PRD files. No interview.md, tracker
record, requirement ID, spec, plan, HLD, or task file may be created.
Execution Steps
Step 0 - Validate Epic ID
Invoke tdk-validate-task-id with $ARGUMENTS and host skill name
/tdk-epic-prd. If STOP -> halt execution.
Store: TASK_ID, TASK_ID_SOURCE.
Step 1 - Load Project Context
Invoke tdk-load-project-context with validated TASK_ID and:
require_feature_dir:false
require_prefix_validation:false
Store: PROJECT_CONTEXT.
Step 1.5 - Resolve Feature Directory
Determine paths from PROJECT_CONTEXT and validated TASK_ID:
SPECS_ROOT = project's .specify root
FOLDER = parsed from TASK_ID prefix folder or PROJECT_CONTEXT.featureEnv.defaultFolder fallback feature
TICKET_ID = parsed ticket identifier, e.g. tdk-001
FEATURE_DIR = $SPECS_ROOT/$FOLDER/$TICKET_ID
Do not create FEATURE_DIR yet. Epic PRD requires existing discovery artifacts.
Store: SPECS_ROOT, FOLDER, TICKET_ID, FEATURE_DIR.
Step 2 - Parse Flags
Supported flags:
Unknown flags STOP before any file is read or written. Report:
Unknown flag: <flag>. Usage: /tdk-epic-prd <epic-id> [--force] [--interview]
If a positional argument other than the epic ID remains after flag parsing, STOP
and show the same usage. This command reads discovery artifacts; it does not
accept a separate brief.
If --force is present, set FORCE_PRD=true.
If --interview is present, set INTERVIEW_PRD=true.
Step 3 - Require Discovery Artifacts
Before writing epic PRD artifacts, require:
discovery.md
discovery/problem.md
discovery/personas.md
discovery/mvp-scope.md
If any file is missing, STOP before writing with:
Epic PRD requires existing discovery artifacts. Run /tdk-discovery <epic-id> <brief|file> first.
Read the four discovery files as context. Discovery remains context; it is not
requirement authority.
Step 4 - Prepare Epic PRD Directory
Set:
PRD_DIR="$FEATURE_DIR/epic-prd"
If epic-prd/index.md exists and epic-prd.md is missing, STOP with:
legacy layout detected: epic-prd/index.md is from the old nested-manifest layout. Re-run with --force to regenerate epic PRD in the new layout, or recreate the test epic. TDK does not auto-migrate old epic-prd/index.md content.
If all four epic PRD files exist and INTERVIEW_PRD=true and FORCE_PRD is not
true, set PRD_REPLAY_INTERVIEW=true.
If epic-prd.md exists and neither FORCE_PRD nor
PRD_REPLAY_INTERVIEW is true, STOP with:
Epic PRD already exists. Re-run with --force only when you intend to replace epic PRD artifacts, or use --interview to replay alignment against the existing PRD.
If PRD_REPLAY_INTERVIEW=true, verify epic-prd/ contains exactly:
epic-prd/prd.md
epic-prd/slice-map.md
epic-prd/open-questions.md
Also require sibling epic-prd.md. If any file is missing or any extra file
exists in epic-prd/, STOP before interviewing.
Otherwise create the directory:
mkdir -p "$FEATURE_DIR/epic-prd"
Step 5 - Write Epic PRD Artifacts
If PRD_REPLAY_INTERVIEW=true, skip generation and read the existing four files.
Load references/epic-prd-output-contract.md and
references/epic-prd-quality-guidelines.md, then write exactly:
epic-prd.md
epic-prd/prd.md
epic-prd/slice-map.md
epic-prd/open-questions.md
Use templates from .specify/templates/epic-prd/. Derive content only from
discovery artifacts, project context, memory/constitution context when already
available, and explicit user input from the optional interview.
Do not create spec.md, requirement IDs, task files, HLD files, implementation
plans, source code, tracker records, product-memory updates, or any other PRD
file. Keep slice-map.md entries as slug slice keys and child spec seeds.
Step 5.5 - Optional Interview Alignment Gate
If INTERVIEW_PRD=true, run the interview after draft PRD artifacts exist for
creation, or after the current artifacts are loaded for
PRD_REPLAY_INTERVIEW=true, and before validation:
- Load
.specify/_shared/skills/interview-alignment-protocol.md.
- Read
epic-prd.md, epic-prd/prd.md, epic-prd/slice-map.md, and epic-prd/open-questions.md.
- Build an internal claim map from product objective, MVP appetite, no-gos,
slice boundaries, build order, and blocking questions.
- Ask 3-6 artifact-grounded questions, one at a time.
- Classify each answer as
aligned, mismatch, or unclear.
Integration rules:
aligned: leave artifacts unchanged unless a concise wording correction helps.
mismatch: update only the relevant section in the four epic PRD files.
unclear: add a recommended item under ## Blocking Questions or
## Non-Blocking Questions.
Critical mismatch must be integrated or accepted as an open question before
completion. Persist durable decisions only. No interview.md; update only the four epic PRD files.
Step 6 - Validate Output
Before completion, verify:
epic-prd.md exists as the stage manifest.
{FEATURE_DIR}/index.md exists as the epic dashboard.
- Only the three allowed detail files exist under
epic-prd/.
- No
interview.md or other extra epic PRD file exists.
epic-prd.md links all three detail artifacts.
{FEATURE_DIR}/index.md links epic-prd.md, states current stage, readiness, and next command.
slice-map.md has at least one independently specifiable slice.
- No slice key is a catch-all such as "all features" or "entire MVP".
open-questions.md separates Blocking Questions from Non-Blocking Questions.
- Blocking questions make the readiness gate not ready.
- No
UR-*, FR-*, SC-*, FS-*, tracker command, spec.md, HLD, task,
plan, code, or product-memory update was created.
Step 7 - Report Completion
Report:
- Epic PRD directory path
- Epic dashboard path:
index.md
- Files written or updated
- Interview alignment:
creation, existing artifact, or disabled
- Blocking question count
- Readiness for
/tdk-epic-hld <epic-id> when blocking questions are empty, and for child /tdk-specify <child-id> "<slice seed>" only after downstream breakdown creates seeds
Step 8 - Recommend Next Step
Use AskUserQuestion with header "Next Step" after reporting completion:
| Option | Action |
|---|
/tdk-epic-hld {TASK_ID} (Recommended when blocking question count is 0) | Invoke /tdk-epic-hld {TASK_ID} |
/tdk-epic-prd {TASK_ID} --interview | Invoke /tdk-epic-prd {TASK_ID} --interview to resolve or confirm PRD alignment before HLD |
| End session | Stop |
If blocking question count is greater than 0, mark /tdk-epic-prd {TASK_ID} --interview as the recommended option and do not invoke HLD unless the user explicitly selects it after acknowledging the readiness gate.