Custom agent imported from B0yZ4kr14/OrthoPlus-Enterprise (
.github/agents/speckit.sf.stories.agent.md). Copyright stays with the author.
Generate Developer Story Files
User Input
$ARGUMENTS
Supplemental Skill Discovery (Optional)
Before executing, you may check for any installed agent skills related to:
- Metadata/Story Analysis (
sf-metadata,sf-data) - Developer Workload Estimation (if specialized skills exist)
[!NOTE] These skills are Optional Accelerators. If found, use them to assist in decomposing features and identifying implementation layers. However, the standards in
docs/scoring.mdare the primary source of truth.
Prerequisites
- Plan exists:
.specify/specs/NNN-feature-name/plan.md - Data model exists:
.specify/specs/NNN-feature-name/data-model.md - Spec exists:
.specify/specs/NNN-feature-name/spec.md - Architect Sign-Off is completed in plan.md (check the sign-off section)
- If sign-off is incomplete, WARN the user and ask if they want to proceed anyway
Instructions
Step 1: Read All Context
- Read the plan from
.specify/specs/NNN-feature-name/plan.md - Read the data model from
.specify/specs/NNN-feature-name/data-model.md - Read the spec from
.specify/specs/NNN-feature-name/spec.md - Read the constitution from
.specify/memory/constitution.md
Step 2: Validate Architect Sign-Off
Check plan.md for the Architect Sign-Off section:
- If "Overall Sign-Off: [x] APPROVED" → proceed
- If not approved → warn: "⚠️ Architect has not signed off on this plan. Story generation may need revision after sign-off."
- Ask user whether to proceed or wait
Step 3: Generate Story-000 (Foundation Story)
ALWAYS generate this story first. It contains shared infrastructure that blocks all other stories.
Create .specify/specs/NNN-feature-name/task_story_00.md containing:
- Type: FULL
- What it covers:
- All Custom Objects and Custom Fields referenced by ANY user story
- Permission Sets with FLS for all new fields
- Trigger files (one per object, with TAF MetadataTriggerHandler dispatch)
- Test Data Factory class(es)
- Custom Metadata for Trigger Action configuration
- Base utility/selector classes shared across stories
- Dependencies: NONE (this is the root)
- Blocks: ALL other stories (task_story_01..NN)
Step 4: Decompose User Stories into Developer Stories
For each user story in the spec (US-1, US-2, US-3...):
- Jira-Ready Description: Format as "As a [Persona], I want to [Action] so that [Business Benefit]".
- Determine story type:
FULL(has Apex/Flow/LWC) orDECLARATIVE(metadata-only) - Security & Access Matrix: Which Permission Sets/Profiles require access to which objects/fields.
- Map to SF implementation layers: Apex classes, Flows, LWC components, test classes with exact file paths.
- Detailed Acceptance Criteria: At least 3-5 Given/When/Then scenarios from the spec.
- Generate test cases: Positive, Negative, and Bulk (251+ records).
- Determine dependencies: Every story REQUIRES task_story_00.md.
- Estimate effort: Hours for Human Developer Effort per layer.
Step 5: Create Story Files
For each story (01, 02, 03, ...):
Create .specify/specs/NNN-feature-name/task_story_NN.md:
- Set Status to DRAFT
- Set Story Type to FULL or DECLARATIVE
- Populate SF Implementation Layers table with exact file paths
- Populate Security & Access Matrix with detailed profile/permset configs
- Populate Dependencies based on Step 4 analysis
- Populate Scoring Gates with thresholds from the plan (mapped to the rubric in
docs/scoring.md) - Populate Estimation table (Human Effort in hours)
- Add TPO/Architect guidance in Developer Notes
Step 6: Build Dependency Graph
Create a summary showing the story dependency structure:
task_story_00.md (Foundation) ⛔ BLOCKS ALL
├── task_story_01.md (US-1: ...) [P]
├── task_story_02.md (US-2: ...) [P]
│ └── task_story_04.md (US-4: ...) — depends on 02
└── task_story_03.md (US-3: ...) [P]
[P] = Can work in parallel after Story-000 completes
Step 7: Present to User
Show the user:
- Number of stories generated (including Story-000)
- Dependency graph
- Which stories can be worked in parallel
- Total estimated effort (Human Hours)
- Recommendation for sprint planning
Next Step
Run /speckit.sf.review to have the Architect validate the story decomposition before creating Jira tickets.
Output
- Files created:
task_story_00.mdthroughtask_story_NN.md - Location:
.specify/specs/NNN-feature-name/ - Status: All stories in DRAFT state
Notes
- Story-000 is ALWAYS generated and ALWAYS blocks other stories
- DECLARATIVE stories skip Apex/LWC layers and only include metadata scoring
- Mark parallel stories with
[P]in the dependency graph - Estimations represent Human Developer Effort in hours.