feature-driven-flow
Coordinate a structured 7-phase feature delivery workflow in Codex for non-trivial work. Use when a task needs scoped intent, repository behavior tracing, ambiguity resolution, design choices, control
SKILL.mdskills/feature-driven-flow/SKILL.md
GitHubFeature-Driven-Flow Conductor
Execute feature delivery in seven phases with explicit checkpoints.
Workflow Contract
- Run Phase 1 Scope.
- Run Phase 2 Explore.
- Run Phase 3 Clarify.
- Run Phase 4 Architect.
- Run Phase 5 Implement.
- Run Phase 6 Verify.
- Run Phase 7 Summarize.
Read references/phase-contracts.md before running phases.
Read references/phases.md for phase intent and non-negotiable behaviors.
Read references/checklists.md before finalizing.
Read references/extension-system.md, references/rule-model.md, references/profile-model.md, references/context-model.md, references/settings.md, references/packs.md, references/effective-matrix-reuse.md, references/effective-instructions-reuse.md, and references/specialist-skills.md before applying rules.
Core Skeleton Invariants
- Do not change phase order.
- Do not begin Implement without explicit user approval.
- Do not leave Clarify while decision-critical ambiguity remains unresolved.
- Do not close workflow before Verify disposition and final Summarize output.
Interactive Decision UX
- When a user decision is needed, provide 2-4 numbered options.
- Mark one option as recommended and include a one-line rationale/tradeoff.
- Ask the user to reply with the option number or a custom answer.
- Do not move forward until the decision is explicitly captured.
Rule System
- Use one extension dimension: rules. Profiles are an optional selection mechanism that compiles down to a concrete phase-by-phase rule matrix. The user-facing label for this artifact is "Effective Rule Matrix".
- Infer execution context from request text, repository signals, and
AGENTS.md. If available via enabled packs, useprofile-recommendations.mdas a deterministic mapping from inferred context to recommended profile selection. - In Scope, if the user asks to load/import/use/read/reuse matrix (file path or inline block), treat it as Effective Rule Matrix candidate input, then parse and validate it using
references/effective-matrix-reuse.md. If valid, use it as the candidate matrix; if invalid or missing, continue with profile-driven compilation. - In Scope, if the user asks to load/import compiled/effective instructions (directory bundle or compact file; reference or portable), validate artifact format/content mode using
references/effective-instructions-reuse.md, then ask user to accept, refresh, or discard it. If imported artifact includescustom_instructions, also ask whether to accept as-is, edit/rephrase, or discard custom instructions. - In Scope, propose profile selection (base + optional overlays) and show the Effective Rule Matrix (compiled phase-by-phase active rules) with a recommended baseline set or validated imported candidate. In markdown files, render it as a native markdown table with one row per phase; in the rules cell, use backticked rule ids separated by commas. In terminal/chat output, do not render a table; render only a plain-text phase list.
- Ask user to accept or adjust the proposed profiles and/or Effective Rule Matrix before Explore.
- Apply rules in this order:
- core shared rules in
extensions/rules/*.md - enabled pack rules from manifests under
skills/feature-driven-flow/packs/*/manifest.jsonand optionally.codex/feature-driven-flow/packs/*/manifest.json - repository-local rules in
.codex/feature-driven-flow/rules/*.md(whenlocal_rules.enabled=true)
- core shared rules in
- Matrix export behavior:
- If
matrix_export.auto_generate_on_scope_confirmed=true, auto-save confirmed Effective Rule Matrix after Scope confirmation. - If user asks to save/export current|active|chosen|choice|effective|compiled matrix, interpret it as export of the currently confirmed Effective Rule Matrix.
- If user asks only for
stateorcompiled state, ask a short clarification between Effective Rule Matrix export, Effective Instructions export, andstate.jsonexport. - Path resolution: explicit user path (when allowed) then
matrix_export.default_file. - Relative paths are repo-root relative; absolute paths allowed only when
matrix_export.allow_absolute_path=true. - Respect
matrix_export.overwrite_existing; if overwrite is disallowed, ask user for alternative.
- If
- Effective Instructions export/convert behavior:
- If
effective_instructions.export.auto_generate_on_scope_confirmed=true, auto-save compiled instructions after Scope confirmation. - Support export as directory bundle (canonical) and compact file.
- Support content mode
reference|portable|hybridfromeffective_instructions.export.content_mode. - For
portableandhybrid, embed content for cross-environment portability and warn about size/sensitive data tradeoffs. - If
effective_instructions.export.allow_custom_instructions=true, ask user whether to include custom instructions before export. - If custom instructions are included and
effective_instructions.export.require_custom_instructions_approval=true, require explicit user approval before writing export files. - If
effective_instructions.export.require_all_custom_instruction_items_approved=true, export only approved items; never include draft/rejected items. - If draft/rejected items exist, notify user and ask whether to improve/rephrase and approve, skip unapproved items, or cancel export.
- Present numbered options: add new custom instruction(s), modify/rephrase current candidate(s), or skip custom instructions.
- If
effective_instructions.export.allow_custom_instruction_rephrase=true, you may suggest rephrased versions but user approval remains mandatory. - Persist approved custom instructions in artifact field
custom_instructions. - If user asks to convert directory bundle <-> compact, use
tools/convert-effective-instructions.ps1. - Path resolution and overwrite policy follow
effective_instructions.export.*.
- If
- If rules disagree, ask user which direction to follow.
AGENTS.mdpolicy constraints remain mandatory.
Phase Skeleton
Phase 1 Scope
- Open a phase tracker for all seven phases.
- Execute active Scope-phase rules.
- Capture matrix candidate source (
file|inline|none) and instructions candidate source (bundle|compact|none), validation results, and user-confirmed Effective Rule Matrix before Phase 2. Capture custom-instructions decision and approval state when instructions import/export is used.
Phase 2 Explore
- Execute active Explore-phase rules.
Phase 3 Clarify
- Execute active Clarify-phase rules.
Phase 4 Architect
- Execute active Architect-phase rules.
Phase 5 Implement
- Confirm explicit approval.
- Execute active Implement-phase rules.
Phase 6 Verify
- Execute active Verify-phase rules.
Phase 7 Summarize
- Execute active Summarize-phase rules.
- Close phase tracker.
Output Templates
Use templates in:
templates/clarifying-questions.mdtemplates/architecture-options.mdtemplates/review-report.mdtemplates/structured-phase-output.mdtemplates/execution-metrics.mdtemplates/rule-matrix-diff.md(when rule matrix changes after Scope)templates/effective-instructions-bundle.manifest.json(when exporting directory bundle)templates/effective-instructions-compact.json(when exporting compact format)- Pack templates/references resolved from enabled pack manifests (for example quality/hardening/async-collab assets)
extensions/rules/*.md.codex/feature-driven-flow/rules/*.md(when present)
Tooling Expectations
- Prefer fast file search and targeted reads.
- Keep outputs concise but complete.
- Enforce phase checkpoints through explicit outputs and decisions.
Specialist Skills (Optional)
fdf-code-explorer, fdf-implementation-planner, and fdf-change-auditor are optional accelerators.
- Prefer following active rules/templates directly.
- Invoke specialist skills only when they materially reduce risk/ambiguity, or when explicitly requested by the user.