# Story Quality Check

## Context

App: {{APP_NAME}}
Actor docs: {{ACTOR_DOCS}}
Business flow docs: {{BUSINESS_FLOW_DOCS}}
Story docs: {{STORY_DOCS}}

## Instructions

1. Read ALL actor docs at the paths above
2. Read ALL business flow docs at the paths above
3. Read ALL story docs at the paths above
4. Validate story quality against the checks below
5. Return results per the report format at the bottom

## Checks

### Story-to-Flow Parity

For each business flow:
- Every flow must have at least one story
- Every story must map to exactly one flow (via its directory location)
- The `## Stories` section in each flow README must link to all stories in its `story/` directory
- No broken links in `## Stories` sections

### Naming Conventions

- Story filename must follow `<actor>--<story-name>.md` pattern (double-dash separator)
- Actor slug in filename must match an existing actor doc
- Story name portion must be kebab-case

### Content Completeness

For each story:
- Must have scenario patterns (non-empty)
- Must have preconditions and postconditions
- Must have screen references (can be TBD at this stage)
- Must have resolver classification (TBD for mutations, None for read-only)

### Actor Consistency

- Actor referenced in story filename must exist in `docs/actors/`
- Actor referenced in story content must match the filename actor

## Output Format

Return findings as structured markdown:

### Issues

For each issue found:

- **Check:** which check failed
- **Scope:** which file/story/flow is affected
- **Severity:** critical / high / medium / low
- **Detail:** what's wrong and how to fix it

### Summary

| Check | Passed | Failed | Total |
| ----- | ------ | ------ | ----- |
| Story-to-Flow Parity | | | |
| Naming Conventions | | | |
| Content Completeness | | | |
| Actor Consistency | | | |
