Skip to content
Development
Command

/story-from-planning

This file is read by `/craft:story-new` when the user picks "From planning" at the mode question. It owns the entire planning-to-story transformation: extract decisions from the planning corpus, write a thorough story file with all required sections plus `## Reference

From plugin
craft
4260 skills27 agents60 commands7 hooks
+1
Install
$ npx -y skills add drobins25/craft --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/story-from-planning

Context preview

What this command does when you run it.

This file is read by `/craft:story-new` when the user picks "From planning" at the mode question. It owns the entire planning-to-story transformation: extract decisions from the planning corpus, write a thorough story file with all required sections plus `## Reference

Command definition

story-from-planning.md

Story From Planning (Inline Reference)

This file is read by `/craft:story-new` when the user picks "From planning" at the mode question. It owns the entire planning-to-story transformation: extract decisions from the planning corpus, write a thorough story file with all required sections plus `## Reference Materials`, and forward-link planning docs so the bidirectional traceability is real.

**DO NOT invoke this as a skill via the Skill tool.** The parent command (`/craft:story-new`) Reads this file and executes the phases inline. Same pattern as `content-spark-inline.md` and `creative-spark-inline.md`. Skill-tool nesting causes the chain break documented in the chain-break-fix-discovery memo.

When This Runs

This protocol is invoked from two parent flows:

**A. `/craft:story-new` Step 2.5** has: 1. Detected `.craft/planning/` contains at least one file with `concept:` or `initiative:` frontmatter 2. Asked the user "From planning, or freeform?" 3. The user picked "From planning"

The parent command jumps here instead of continuing to Step 3 (Choose Your Path).

**B. `/craft:cycle-design`** invokes this protocol when: 1. The active or planning cycle's `cycle.yaml` has `source_concept` populated (one or more planning doc paths) 2. The orchestrator is in the **planning-extraction moment** during default-mode, roadmap-mode, or detailing-mode story creation (see `commands/references/cycle-design/default-mode.md` action-moment framing for the distinction)

In this case, **Phase 1's concept-picker auto-resolves** to the cycle's `source_concept` value(s) - the user already confirmed the planning source at cycle creation, so re-asking is redundant. See Phase 1 below for the auto-resolve behavior.

Phase 1: Confirm Concept Source

**Invocation marker check (required for auto-resolve):**

The auto-resolve branch below fires ONLY when the calling context explicitly includes the marker phrase:

> `INVOCATION: cycle-design - planning source already confirmed in cycle.yaml`

Cycle-design mode files (default-mode.md, roadmap-mode.md, detailing-mode.md) set this marker before Reading this protocol. The marker is a deterministic structural signal - if it's not present in the calling context (e.g., the user ran `/craft:story-new` directly while `ACTIVE_CYCLE` happens to point at a planning-sourced cycle), the auto-resolve does NOT fire. Fall through to the corpus-scan path below.

**Cycle-design invocation - auto-resolve from cycle.yaml (marker present):**

If the marker is present in your invocation context:

1. Read `${CRAFT_PROJECT_ROOT}/.craft/cycles/${ACTIVE_CYCLE}/cycle.yaml` to get the `source_concept` value (list of planning doc paths). 2. **If cycle.yaml has exactly one source_concept path:** auto-resolve. Skip the picker. Set that path as the selected concept. Proceed directly to Phase 2. 3. **If cycle.yaml has multiple source_concept paths:** ask the user which specific concept THIS story is from, using the cycle's `source_concept` list as the option set (not the full planning corpus). Skip directly to Phase 3a after answer.

**Story-new invocation - corpus scan (no marker, or marker absent):**

Glob the planning corpus:

$PROJECT/.craft/planning/*.md
$PROJECT/.craft/planning/**/*.md

Filter to files with `concept:` or `initiative:` as a YAML key in frontmatter. Group by folder - an initiative folder (e.g., `01-customer-profile-tab/`) is one logical group; standalone concept files are each their own group.

**If exactly one concept exists:** skip the selection question, proceed to Phase 2.

**If multiple concepts exist:** use **AskUserQuestion** to confirm which one this story is from:

question: "Which concept is this story from?"
header: "Concept"
options:
  - label: "[Concept title]"
    description: "[status] - [last_updated] - [N open questions]"
  - label: "[Concept title]"
    description: "[status] - [last_updated] - [N open questions]"

If the user provides custom text identifying a different file, use that path.

**Concept readiness check:** Read the selected concept file. If it has `- [ ]` open questions in its `## Open questions` section, warn the user but proceed:

> "Concept has [N] unresolved open questions. The story can still be written - any unresolved questions will be captured in the story's `## Notes` section for you to address before plan-chunks runs."

Phase 2: Capture Story Title

One concept can spawn multiple stories. Ask the user what this specific story is:

Use **AskUserQuestion**:

question: "What's the title for this story? (Plain English - the slug is derived automatically.)"
header: "Title"
options:
  - label: "[Inferred title from conversation, if any]"
    description: "Use this title"
  - label: "Different title"
    description: "I'll provide a different one"

If the user picks "Different title" or supplies custom text, use their exact wording. Derive the slug as `kebab-case` of the title. Story name (frontmatter `name` field) is the slug.

Phase 3a: Supersession-First Scan

**Before any extraction begins**, the Explore agent scans the primary concept AND sibling concepts in the same initiative folder for supersession markers. This is the FIRST action - never extract decisions from a potentially-superseded concept.

Spawn an **Explore** agent with this prompt:

Scan the following planning files for supersession markers ONLY. Do not extract decisions yet.

- Primary concept: [absolute path to selected concept file]
- Sibling concepts: [absolute paths to other concept files in the same initiative folder, if applicable]

Look for prose like:
- "superseded by concept X"
- "superseded YYYY-MM-DD"
- "deprecated"
- "replaced by"
- "see [concept] instead"

For each marker found, return:
- Source file path
- Source location (which section, which line range or surrounding text)
- The exact marker text quoted
- The superseding concept (path or name) parsed from the marker text

If no supersession markers found, return: "NO
Read more
Ships withcraft

Stop Vibing. Start Crafting. Claude Code plugin: guided + controlled development orchestration harness with built-in workflow + state management, for designing + building durable, production-ready software through the entire product lifecycle - new projects

Get the whole plugin, auto-invoked
Stats
42
Stars
1
Views
5
Forks
Active
Maintenance
Shell
Language
MIT
License
21h ago
Last commit
3mo ago
Created

Repo: drobins25/craft