Best for
- Create a lean story specification optimized for both human review (clear intent) and AI alignment (accurate code generation).
humansys/raise/packages/raise-cli/src/raise_cli/skills_base/rai-story-design/SKILL.md
Create lean story spec for human review and AI alignment. Use before story plan.
Decision brief
Create lean story spec for human review and AI alignment. Use before story plan.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/humansys/raise --skill "packages/raise-cli/src/raise_cli/skills_base/rai-story-design"Inspect the Agent Skill "rai-story-design" from https://github.com/humansys/raise/blob/88a77d6e4065e3c8bdbae9be4aff5b84e6a7a5eb/packages/raise-cli/src/raise_cli/skills_base/rai-story-design/SKILL.md at commit 88a77d6e4065e3c8bdbae9be4aff5b84e6a7a5eb. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
JIT: Before assessing complexity, query graph for patterns from similar stories → aspects/introspection.md § JIT Protocol
Go to the actual code. Design without reading the code is guessing.
Load story.md (from /rai-story-start) if it exists — use its User Story as starting frame.
JIT: Before describing approach, query graph for implementation patterns in affected modules → aspects/introspection.md § JIT Protocol
This section drives AI code generation accuracy more than any other.
Permission review
The documentation asks the agent to run terminal commands or scripts.
git show "origin/${DEV_BRANCH}:packages/raise-cli/src/raise_cli/storage/schema.py" | grep "^SCHEMA_VERSION"Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 95/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 71 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Create a lean story specification optimized for both human review (clear intent) and AI alignment (accurate code generation).
See raise.mastery in frontmatter.
When to use: Before planning ANY story. Design is never optional — it is the gemba walk that prevents duplicate components, wasted effort, and wrong approaches.
Inputs: Story from backlog, User Story artifact (story.md from /rai-story-start), epic scope/design documents.
Before starting Step 1, you MUST execute the PRIME protocol:
raise_graph_query MCP tool with cwd="{project_or_worktree_path}". If MCP tools are not available, fall back to:
rai graph query
If graph is unavailable, note and continue.raise_session_context MCP tool with sections="code_context", cwd="{project_or_worktree_path}".
If MCP tools are not available, fall back to:
rai session context -s code_context -p .
Returns ~20 symbols ranked by structural proximity to active work modules. Empty result is valid — branch name may not match any module. Use these symbols as starting points for code exploration, not as exhaustive scope.apply_phase_transition.
No skill-initiated transition call required or allowed.| Criterion | Simple | Moderate | Complex |
|---|---|---|---|
| Components | 1-2 | 3-4 | 5+ |
| Story points | <5 | 5-8 | >8 |
| External integrations | 0-1 | 2-3 | 4+ |
| Algorithm complexity | Trivial | Custom logic | Novel |
| Result | Action |
|---|---|
| Simple | Lean design — core sections, quick gemba walk |
| Moderate | Core sections + examples |
| Complex | Full spec with all sections |
JIT: Before assessing complexity, query graph for patterns from similar stories →
aspects/introspection.md § JIT Protocol
Risk gate: If story is marked HIGH RISK in epic scope, discuss risks before designing — name concerns, failure modes, and scope boundaries.
UX gate: If story touches human interaction (workflows, prompts, DX), recommend /rai-research first (~10 min).
Integration gate: If story name includes "dogfood", "E2E", or "integration", OR if epic has separate client/server stories developed with mocks — AC MUST include at least one scenario that runs with real infrastructure (docker compose, actual DB, real HTTP calls). Unit tests with mocks cannot catch cross-component contract mismatches (auth headers, payload validation, parameter limits).
Frontend DoR gate (is_frontend=true only — skip for backend-only stories): Every screen referenced by this story (screen_refs) must be present in the prototype / living-design-system (prototype_screens). Formally: screen_refs ⊆ prototype_screens. If any referenced screen is absent, the story is NOT ready — extend the prototype first (add the missing screen faithful to existing tokens/components), then return to design. This is a lightweight DoR in Mike Cohn's sense ("sufficiently far along, not done") — not a pixel-final stage-gate and not BDUF. Skill-prose only; no new CLI verbs per ADR-125 / RAISE-10923.
Example (E11478): S5 (analytics dashboard) references the
dashboardscreen — that screen exists in the prototype → ready, proceed. S4 (subscription apply flow) references theapplyscreen — that screen is not yet in the prototype → NOT ready; extend the prototype with the apply screen first, then re-evaluate S4.
Go to the actual code. Design without reading the code is guessing.
file:line — deletion plan is X" (commit-level plan included); (c) "V1 coexists because Y" (explain why keeping V1 is correct). No implicit answers. This exists because RCA s2092.1 showed refactors cierran declarados done sin barrer V1 (R1/R3/R5 · pattern refactor-declared-done-without-sweep).# Example gemba commands
grep -r "similar_function" packages/ # Does this already exist?
grep -r "class SimilarModel" packages/ # Duplicate models?
JIT: For deeper code exploration beyond the orientation map, use the
raise_graph_queryMCP tool withcwd="{project_or_worktree_path}"or fall back to CLI:rai graph query "symbol_name" --types symbol --limit 10 rai graph query "module_name" --module mod-raise-cli--session rai graph query "callers of function_name" --types symbolUse
--file path/to/file.pyto scope results to a specific file.
Portfolio context — fail-open:
rai portfolio suggest "$JIRA_KEY" 2>/dev/null || true
If the command produces output, add a ## Portfolio Context section to the design doc with the raw output — include components_touched and change_mode to cross-check the gemba walk findings. If the story has no portfolio profile (empty output), retry with the parent epic key:
rai portfolio suggest "$EPIC_KEY" 2>/dev/null || true
If neither call produces output, continue without portfolio context — do not block.
| Finding | Action |
|---|---|
| Similar component exists | Reuse or extend it — do NOT create a duplicate |
| No established pattern | Document the new pattern as a design decision |
| Multiple approaches found | List them in Step 4 with trade-offs |
Drift Risk Check — for each module this story will touch:
governance/drift-hotspots.json exists: check if the module appears in the top-10 ranked modules — note rank and signal count.governance/drift-catalog.md §1 (AG1–AG6): does the story scope risk any of these?
Graceful degradation: if governance/drift-hotspots.json is absent, skip step 1 silently and proceed to step 2.
Load story.md (from /rai-story-start) if it exists — use its User Story as starting frame.
JIT: Before framing problem and value, query graph for prior designs with similar scope →
aspects/introspection.md § JIT Protocol
JIT: Before describing approach, query graph for implementation patterns in affected modules →
aspects/introspection.md § JIT Protocol
Document WHAT you're building and WHY this approach (not detailed HOW):
Lean design gates — challenge every component before committing:
For refactoring: grep all call sites of the target. A half-migration is worse than none.
For data mutations: What happens when inputs reference missing entities? Declare the strategy explicitly: reject with error, skip + report count, partial success with warnings. Silent drops are semantic bugs.
Storage migration gate: If this story replaces a storage mechanism (file → SQLite, JSON → DB, YAML → table), answer for every public function of the replaced module: "What did callers get on (a) missing data and (b) corrupt data before? What will they get after?" Common silent contract breaks:
FileNotFoundError → empty result (callers catching the exception silently get nothing)ValueError/JSONDecodeError → ValidationError (callers expecting None on corrupt data now get an exception)Declare the contract explicitly in the Approach section and add an AC for each broken contract you identify. Skip this gate if the story does not replace a storage mechanism.
Also run — advisory ⚠ if stale or missing:
rai schema sum check
If stale, update:
rai schema sum update
Schema version coordination check: If this story adds a _V{N}_DDL migration, verify that the next version number is not already taken by the dev branch:
# Current branch version
grep "^SCHEMA_VERSION" packages/raise-cli/src/raise_cli/storage/schema.py
# Dev branch version (read from manifest)
DEV_BRANCH=$(python3 -c "import yaml; print(yaml.safe_load(open('.raise/manifest.yaml'))['branches']['development'])" 2>/dev/null || echo "release/3.1.0")
git show "origin/${DEV_BRANCH}:packages/raise-cli/src/raise_cli/storage/schema.py" | grep "^SCHEMA_VERSION"
If the two versions diverge (feature branch has V18, dev branch already at V19), assign migrations starting from max(both) + 1. Document the chosen version in the design. Skipping this check when branches diverge causes migration number collisions at merge time — a ~30 min fix that cannot be automated away.
Value preservation gate: Before finalizing components, ask: "What domain knowledge does this layer provide that a generic pass-through wouldn't?" If the answer is "none", the design may be over-abstracted. If the answer involves config/resolution/mapping that an existing pattern handles differently, check where that responsibility lives in the proven pattern.
Supply Chain Gate — For each NEW external dependency introduced by this story, evaluate supply chain health before committing:
Document findings in the design doc's Approach section. This is a guide, not a hard block — an informed risk decision is valid.
Skip rule: Well-known, widely-adopted packages (pydantic, fastapi, pytest, requests, httpx, typer, rich, click, and similar) are N/A — their supply chain health is already established. Use human judgment for the boundary.
See pattern BASE-056: Consumer reputation ≠ package stability — verify supply chain independently (will be registered in RAISE-586).
For complex stories, add: scenarios (Gherkin), algorithm pseudocode, constraints, testing strategy.
This section drives AI code generation accuracy more than any other.
Provide concrete, runnable examples:
Use concrete values (not placeholders), correct syntax (not pseudocode), consistent with codebase style.
JIT: Before defining acceptance criteria, query graph for testing patterns and quality standards →
aspects/introspection.md § JIT Protocol
If story.md has Gherkin AC, reference them here — refine, don't duplicate. If no story.md, define from scratch:
All criteria must be observable outcomes traceable to value from Step 2.
After completing all steps, persist the design to the artifact store and render a Markdown view:
Call raise_artifact_emit with the design content as structured JSON. The artifact store is the source of truth.
raise_artifact_emit(
artifact_type="design",
story_id="{story_id}",
content=<JSON string with fields: problem, value, approach, components, decisions,
acceptance_criteria, examples, complexity, dependencies, legacy_sweep,
drift_risks, testing_strategy, open_questions>
cwd="{project_or_worktree_path}"
)
Field reference for the content JSON:
| Field | Type | Required | Description |
|---|---|---|---|
problem | string | yes | What gap does this fill |
value | string | yes | Why it matters (measurable) |
approach | string | yes | Solution approach |
components | list of {name, change, purpose} | yes | Files affected (change: create/modify/delete) |
decisions | list of {id, title, rationale, body?} | yes | Design decisions (body for extended rationale) |
acceptance_criteria | list of {id, description, severity?, verifiable?, test_link?} | yes | severity: must (default), should, must_not |
examples | list of {title, language?, code, explanation?} | no | Concrete runnable examples |
complexity | "simple" / "moderate" / "complex" | no | From Step 1 assessment |
dependencies | list of {description, blocks?} | no | What this story depends on |
legacy_sweep | string | no | What V1 becomes orphaned (mandatory answer from Step 2) |
drift_risks | list of {id, description, mitigation?} | no | From drift risk check in Step 2 |
testing_strategy | list of {layer, name, purpose} | no | Key test scenarios |
open_questions | list of strings | no | Questions deferred to plan phase |
Note: The CLI fallback for artifact emission was removed in v3.0.0. MCP tool mcp__rai-workspace__raise_artifact_emit is required (primary path above). If MCP is unavailable, skip structured artifact emission.
Publish rendered Markdown via CLI for human readability, git diff, and Confluence:
Use raise_docs_write MCP tool with doc_type="story-design", title="S{N}.{M}: {story-name} design", content="[rendered Markdown from artifact store content]", output_path="work/epics/e{N}-{name}/stories/s{N}.{M}-design.md", cwd="{project_or_worktree_path}".
Verify result: If result.status != "ok", stop immediately with error:
Story design write failed: {result.error}. Cannot continue without docs sync in connected mode.
If MCP tools are not available, fall back to:
rai docs write story-design \
--title "S{N}.{M}: {story-name} design" \
--stdin \
--output-path work/epics/e{N}-{name}/stories/s{N}.{M}-design.md << 'EOF'
[rendered Markdown from artifact store content]
EOF
If exit code != 0, stop immediately — do not proceed.
The Markdown file is a rendered view, not the source of truth. It is generated from the artifact content. If the artifact store and the file ever diverge, the artifact store wins.
| Item | Destination |
|---|---|
| Design artifact | SQLite artifact store (primary) |
| Design Markdown | work/epics/e{N}-{name}/stories/s{N}.{M}-design.md (rendered view) |
| Signal | WorkLifecycle event emitted (start on entry, complete here) |
STOP HERE. Return your summary to the orchestrator. Do NOT invoke any further skill.
/rai-story-plan/rai-research before UX storiesFrequently asked questions
Create lean story spec for human review and AI alignment. Use before story plan.
The source record exposes this install command: npx skills add https://github.com/humansys/raise --skill "packages/raise-cli/src/raise_cli/skills_base/rai-story-design". Inspect the command and pinned source before running it.
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
coreyhaines31/marketingskills
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' 'involuntary churn,' 'people keep canceling,' 'churn rate is too high,' 'how do I keep users,' or 'customers are leaving.' Use this whenever someone is losing subscribers o
prowler-cloud/prowler
PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing index usage statistics, reindexing, dropping indexes, or working with partitioned table indexes. Also trigger when discussing index strategies, partial indexes, or index maintenance
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre