Skip to content
Back to skills

Draft Story Markdown

ASecurity

Generate a draft story markdown by analyzing a story tracker or feature description, Figma designs, and the codebase.

  • 16 stars
  • 0 votes
  • 0 copies
  • 16 views
  • Added February 7, 2026
ai-agentsgoreactvueangularnodeazureapidatabasefrontendbackend

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add Intai/story-flow --skill draft-story-markdown --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Draft Story Markdown?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Draft Story Markdown
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/intai-draft-story-markdown/badge)](https://www.skillsdirectory.com/skills/intai-draft-story-markdown)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Draft a story markdown from a story tracker or feature description
description: Generate a draft story markdown by analyzing a story tracker or feature description, Figma designs, and the codebase.
user-invocable: false
---

# Draft a story markdown from a story tracker or feature description

## Overview

This skill helps developers create technical story markdown by:
1. Gathering requirements from a story tracker or a provided feature description
2. Fetching Figma designs linked in the story (when applicable)
3. Exploring the codebase to discover relevant files and patterns
4. Generating a draft `story.md` for the developer to review and refine

## Instructions

### Phase 1: Gather Requirements

#### Option A: Ticket ID provided

When the input is a ticket ID (matching a pattern like `PROJ-123`, `86d2uf1mh`, `4821`, `AB#4821`). A bare integer is always a ticket ID, never a feature description:

- Use the project's story tracker MCP tools (Jira, ClickUp, Azure DevOps) to fetch the story by its ticket ID and download its attachments. If no story tracker MCP tool is available, tell the developer the project has no story tracker MCP server configured (`/mcp` to check status) and ask them to paste the story details or provide a feature description instead — never guess at the story content.
- Extract:
  - Type (Story, Task, Bug/Defect, etc.)
  - Summary (user story statement)
  - Description (context and background)
  - Acceptance criteria (requirements)
  - Subtasks (if any)
  - Figma links (any `figma.com` URL, keeping its `node-id`), searching the ticket's comments, custom fields and attachments as well as its description
  - Steps to reproduce, actual and expected behaviour (bug tickets)
- Fetch each Figma link with `mcp__plugin_story-flow_figma__get_design_context` and `mcp__plugin_story-flow_figma__get_screenshot`, and note its frame and component names for Phase 4. If the fetch fails, keep the link for the tasks anyway and tell the developer to check the Figma MCP login (`/mcp`).
- Treat the ticket as a bug when its type is `Bug`, `Defect`, `Incident` or equivalent, or when it carries steps to reproduce with actual and expected behaviour.
- If the ticket is a bug, reproduce it before drafting. Follow its steps to reproduce by driving the app with `mcp__plugin_story-flow_playwright__*` tools, or `mcp__plugin_story-flow_appium__*` for a mobile app. Navigate relative to the base URL from `BASE_URL`, falling back to `use.baseURL` in the project's @playwright.config.js. Note the failing step, the actual behaviour and any console or network errors, and use them to inform the exploration keywords in Phase 2 and the tasks in Phase 4.
- If the bug does not reproduce, carry on drafting and highlight it as an assumption in Phase 5 for the developer to confirm the environment, version, account or seed data.
- If the fetch fails, inform the developer and ask them to verify:
  - The ticket ID is correct
  - The project's `.mcp.json` defines a story tracker MCP server, and they are logged into it (`/mcp` to check status)

#### Option B: Feature description provided

When the input is a feature description (not a ticket ID):

- Use the provided description as the basis for the story.
- Ask the developer clarifying questions if the description is too vague to derive requirements from, such as:
  - What is the expected user flow?
  - Are there specific acceptance criteria?
- Ask the developer for Figma links when the feature changes UI and the description has none, then fetch them as in Option A.
- Derive a user story summary, context, and initial requirements from the description and any clarifications.

### Phase 2: Explore Codebase

Use a **single comprehensive Explore agent** (Task tool with `subagent_type: Explore`) to discover:

1. **Project structure and conventions**
   - Directory organization (e.g., `src/`, `components/`, `api/`, `schemas/`)
   - File naming conventions (kebab-case, camelCase, PascalCase)
   - Common patterns (how similar features are structured)

2. **Files related to the feature area**
   - Search using keywords extracted from the story summary and description
   - Look for existing files in the same domain/module
   - Identify files that will likely need modification

3. **Similar existing implementations**
   - Find reference patterns for the type of work (API endpoints, components, schemas)
   - Note how tests are organized for similar features

4. **Technical conventions**
   - Schema definitions and validation patterns
   - API route patterns and middleware usage
   - Component structure and state management approach

5. **Existing utility/helper patterns**
   - Locate utility or helper directories (e.g., `src/utils/`, `src/helpers/`, `lib/`)
   - Note naming conventions for shared modules
   - Identify reusable functions that already exist (validation, formatting, transformations)
   - Look for patterns where multiple modules import from the same shared location

**Exploration prompt template:**
```
Explore the codebase to help draft a story for: [SUMMARY FROM STORY TRACKER OR FEATURE DESCRIPTION]

Find:
1. Project structure - how are features organized?
2. Files related to: [KEYWORDS FROM REQUIREMENTS]
3. Similar implementations to use as reference patterns
4. Naming conventions for schemas, components, APIs, and tests
5. Where new files should be created based on existing patterns
6. Utility/helper directories and existing shared functions (validation, formatting, etc.)

Provide specific file paths and patterns discovered.
```

### Phase 3: Size the Story

- Estimate the draft from the requirements and the exploration. Offer a split when it would have more than 8 tasks, or when its requirements contain two or more observable behaviours that can each ship alone.
- Split vertically. Each slice delivers one behaviour its consumer can observe through the system's outer interface (a UI flow, an API endpoint, a CLI command, a published event, a job's output), end to end through every layer it needs. A slice qualifies when its own BDD scenarios pass with only the earlier slices merged, and merging it leaves nothing half-wired. Never split by layer (e.g. a backend story and a frontend story) or by task type.
- Cut along workflow steps, business rule variations, data or interface variations, or the happy path before its edge cases and errors.
- Order the slices so the first builds the shared foundation (route, schema, API client, shared utility) and later slices build on it.
- Each requirement belongs to exactly one slice. Each Figma link appears on at least one slice.
- Use AskUserQuestion to propose the slices, giving each a one-line outcome and its requirements, with "Keep as one story" as an option. Draft one story unless the developer accepts the split.

### Phase 4: Generate Draft

**Important:** Do not include unit test requirements or tasks in the story. Unit tests are automatically created during implementation with 100% coverage for every source file. Only include QA tasks for BDD scenario planning and for verifying the implementation against the acceptance criteria.

Create a story markdown with the following structure:

```markdown
[User story summary from the story tracker or feature description]

## Requirements

- [Requirement 1 from acceptance criteria or feature description]
- [Requirement 2 from acceptance criteria or feature description]
- [Additional requirements derived from Figma design]

## Tasks

- Use qa-tester subagent to plan BDD scenarios @path/to/feature.feature. Scenario ideas:
  - Real data. Assert behaviour that holds for any data:
    - [Behaviour that holds for any data]
  - Stubbed [request], for behaviour that needs specific data and for visual regression scenarios:
    - [Behaviour that needs specific data]
- Use backend-developer subagent to [task description] @path/to/file.js. [Requirement, contract or decision the implementer can't derive].
  - [Risk: reason]
- Use frontend-developer subagent to [task description] @path/to/component.jsx.
  - [Requirement, contract or decision the implementer can't derive].
  - [Requirement, contract or decision the implementer can't derive].
  - [Requirement, contract or decision the implementer can't derive].
- Use qa-tester subagent to verify the implementation meets the acceptance criteria by executing all BDD scenarios @path/to/feature.feature via the /execute-scenario command. If any scenario fails, fix the implementation with the appropriate developer subagent and re-run until every scenario passes.
```

**Task guidelines:**
- Each task should have:
  - Agent assignment (`Use backend-developer subagent to`, `Use frontend-developer subagent to`, `Use mobile-developer subagent to`, `Use qa-tester subagent to`)
  - Clear action description
  - Specific file path(s) using `@path/to/file` format
  - Only the technical details the implementer can't derive from the Figma design or the codebase, each stated as an instruction:
    - The requirements this task enforces, even though they repeat the Requirements section
    - Contracts other tasks or the BDD scenarios depend on: function names and signatures, file paths, API request and response fields, schema fields, test ids
    - Decisions: the chosen approach, a resolved Discuss or Risk marker, a deviation from the existing pattern or from the Figma design
    - Pitfalls the codebase would lead the implementer into, such as an existing component that looks reusable but isn't, a field that looks like the right signal but isn't, or a test fixture whose defaults don't fit
    - Existing modules to reuse or follow
    - Give the reason or evidence behind an instruction only when the instruction would otherwise look like a mistake, and then in one short clause
    - Leave out code style (e.g. pure function, no side effects), general conventions (naming, folder structure, component library), styling and layout as shown in Figma, unit test cases, line numbers, references to other tickets or stories, comment and doc-comment wording, and work the task doesn't do unless it guards against a pitfall
  - The Figma link of each frame a frontend-developer or mobile-developer task builds or changes, matched by `node-id`. Every Figma link from Phase 1 appears on at least one task
- Group related work into single tasks when appropriate
- Keep each task to a single line stating one action; a line running past a couple of sentences is carrying detail to cut. Only when it carries three or more separate technical details, move them into nested bullets under the task line for readability, keeping the agent assignment on the line itself. Risk and Discuss markers are always nested bullets and do not count toward the three, and neither do scenario ideas
- Add a nested [Risk: reason] bullet under a task when a mistake in it would break behaviour beyond this story, such as changing a schema, data migration or public API contract, or authentication, authorisation or payments. Add a nested [Discuss: question] bullet when the task has a decision the story doesn't settle, such as exploration finding two or more viable approaches or no existing pattern to follow, the task requesting data for more items than it displays, or the requirement it serves having more than one reading. Write anything the draft can't confirm as a Discuss marker, never as a hedge in the task such as "confirm which…" or "may need to…". Leave every other task unmarked. The developer resolves each marker before implementing the story, replacing it with the chosen approach as a technical detail on the task, with no alternatives or reasoning
- Always include a QA task to **plan** BDD scenarios, with scenario ideas as nested bullets grouped as in the template. Each idea is a behaviour worth checking: a user journey, a business behaviour, or an edge case such as a limit, tie, empty state or filtered-out item. Between them, the ideas cover every requirement. A requirement can need several ideas, and it needs none when an existing scenario already covers it. For a bug ticket, one idea is the reproduced failure
- Always include a final QA task to **verify** the implementation by executing the BDD scenarios (via `/execute-scenario`) and fixing any failure until all scenarios pass
- Use existing file paths discovered during exploration
- For new files, follow the naming conventions discovered
- **Shared utility tasks:** When exploration reveals that two or more tasks will need the same logic (validation, formatting, data transformation), add a separate task to create the shared utility function before the tasks that use it. This avoids duplicating logic across tasks and keeps each task focused on a single responsibility.
  - Only create utility tasks when the shared pattern is genuinely identical across consumers — do not pre-emptively abstract similar-looking code that may diverge.
  - Place utility files in the project's existing utility directory (discovered during exploration, e.g., `src/utils/`, `src/helpers/`).
  - Name utility files by category (e.g., `validation.js`, `formatting.js`, `transforms.js`), not one function per file.
- **IMPORTANT: Do NOT add task dependency or ordering annotations** (e.g. "Parallel tasks 1-3:", "Sequential task N after task M completes:"). List tasks as unordered bullet points in any logical order. Task dependencies and parallel execution grouping are handled separately using the `analyze-task-dependencies` skill after the story is drafted. Note: existing story files in the codebase may already have dependency groupings added by that skill — do NOT copy that format when drafting.

**Using Figma design to inform content:**

When the story has Figma links:

1. **Derive requirements from design:**
   - Identify UI elements that imply requirements (e.g., an input field implies data storage)
   - Note validation needs from input types (email, phone, required fields)
   - Understand user flow from layout and component arrangement

2. **Inform task descriptions:**
   - Use component names from Figma (e.g., "ProfileCard", "EditNameModal")
   - Reference specific UI elements when describing frontend tasks
   - Identify new components that need to be created vs. existing ones to modify

**Agent assignment guide:**
- `Use backend-developer subagent to`: APIs, schemas, database models, server-side logic, backend services
- `Use frontend-developer subagent to`: React/Vue/Angular components, state management, UI logic, styling
- `Use mobile-developer subagent to`: React Native, iOS, Android native code, mobile-specific features
- `Use qa-tester subagent to`: BDD scenarios, test planning, feature files, executing/verifying scenarios against acceptance criteria and coordinating fixes on failure

**Split stories:**
- Draft each slice as its own story markdown with the structure above. Each slice has its own plan and verify QA tasks, against its own `.feature` file or extending an earlier slice's `.feature` file when it reaches the same state.
- A later slice opens, under its summary, with one line naming what an earlier slice already builds, so its tasks don't rebuild it.
- Do not add ordering annotations between stories.

### Phase 4b: Handle Unknown Files

If a requirement cannot be mapped to specific files:

1. **Ask the developer** using the AskUserQuestion tool:
   ```
   I couldn't identify where [requirement description] should be implemented.

   Based on my exploration, possible locations might be:
   - [Option A]: [path/to/possible/location]
   - [Option B]: [another/possible/location]

   Which file or module should handle this? Or should I create a new file?
   ```

2. Use the developer's guidance to complete the task description.

3. Document assumptions made for the developer to review.

### Phase 5: Present to Developer

1. **Show the complete draft markdown** in a code block, one per slice when split.

2. **Highlight areas needing review:**
   - Tasks where file paths were uncertain (marked with assumptions)
   - Requirements that may need clarification
   - Any gaps between the story acceptance criteria and generated tasks
   - Any Figma link from Phase 1 that no task references
   - Tasks marked [Risk: …] or [Discuss: …], to resolve and delete before implementing

3. **Suggest output path:**
   - If an output path was provided, use it
   - Otherwise, suggest based on codebase structure (e.g., `src/[module]/docs/[feature]-story.md`)
   - When split, suggest one path per slice side by side, `src/[module]/docs/[feature]-[index]-[slice]-story.md`, numbered from 1 in slice order, with `[slice]` naming its behaviour (e.g., `invoices-2-export-csv-story.md`)

4. **Ask for confirmation** before writing the file:
   ```
   Would you like me to save this draft to [suggested/path/story.md]?

   Please review the draft and let me know if you'd like any changes before I save it.
   ```

5. **Write the file** only after the developer confirms, asking once for all slices when split, then point them to `/story-flow:review-story` for each file, starting with the first slice, as the next step, followed by `/story-flow:analyze-tasks` once the review is done.

## Example Output

```markdown
As a user, I want to update my profile name so that my account details are accurate.

## Requirements

- Allow the user to edit their display name.
- The display name is optional and has a maximum length of 100 characters.
- Display validation error if name exceeds 100 characters.
- Show character count below the input field (derived from Figma design).

## Tasks

- Use qa-tester subagent to plan BDD scenarios @src/account/docs/update-profile-name.feature.
- Use backend-developer subagent to create `validateDisplayName(name)`, returning an error message or null for a name over 100 characters, in @src/account/utils/validation.js.
- Use backend-developer subagent to add `displayName: String` field to user schema @src/account/schemas/user-schema.js. Use `validateDisplayName` from @src/account/utils/validation.js.
  - [Risk: changes the user schema shared by every account API; check existing records without displayName still load]
- Use backend-developer subagent to update user update API to handle displayName @src/account/api/user-api.js.
- Use frontend-developer subagent to create EditNameModal component @src/account/components/edit-name-modal.jsx, validating with `validateDisplayName` from @src/account/utils/validation.js. Match the modal design from Figma https://figma.com/design/abc123/ProfileEdit?node-id=1-234.
- Use frontend-developer subagent to update profile state management @src/account/redux/profile-slice.js.
  - [Discuss: update the slice optimistically or after the API responds?]
- Use qa-tester subagent to verify the implementation meets the acceptance criteria by executing all BDD scenarios @src/account/docs/update-profile-name.feature via the /execute-scenario command. If any scenario fails, fix the implementation with the appropriate developer subagent and re-run until every scenario passes.
```

## Example Inputs

- Draft story for PROJ-123
- Create story markdown from PROJ-456
- Generate technical story for PROJ-789 @src/feature/docs/story.md
- Draft PROJ-100 to @path/to/output.md
- Draft story for PROJ-123 and split it if it's too big
- Draft story for "Add dark mode support to the settings page"
- Draft story for "Implement user profile image upload"

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.