agentleFS
bybren-llcbybren-llc/safe-agentic-workflow/.cursor/rules/14-spec-creation.mdc

safe-agentic-workflow / rules

Cursor rule419 starsChanged 4 months agoMITView on GitHub

Spec-driven development: spec templates, acceptance criteria, definition of done, pattern references, and demo scripts.

The file

We split this 14-spec-creation.mdc into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every spec MUST include:

    line 13
  2. Distinctive:

    If any of these are missing, the spec is not ready for implementation.

    line 20
  3. Distinctive:

    Use this structure for all implementation specs:

    line 24
  4. Distinctive:

    Before submitting a spec:

    line 95

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
14-spec-creation.mdc
---
description: "Spec-driven development: spec templates, acceptance criteria, definition of done, pattern references, and demo scripts."
globs: "specs/**/*.md,specs_templates/**/*.md"
alwaysApply: false
---

# Spec Creation Rules

These rules apply when creating or editing implementation specs. Every spec drives implementation -- incomplete specs block all downstream work.

## Stop-the-Line: Spec Quality Gate

Every spec MUST include:

1. **Acceptance Criteria** -- Testable pass/fail conditions
2. **Pattern References** -- Pointers to `patterns_library/` for execution agents
3. **Success Validation Command** -- A runnable command to verify the feature works
4. **Demo Script** -- Step-by-step reproduction for QAS

If any of these are missing, the spec is not ready for implementation.

## Spec Template

Use this structure for all implementation specs:

```markdown
# SPEC-{{TICKET_PREFIX}}-{number}: {Feature Name}

## Summary
{One paragraph describing the feature}

## User Story
As a [user type], I want [goal] so that [benefit].

## Acceptance Criteria
- [ ] {Testable criterion 1}
- [ ] {Testable criterion 2}
- [ ] {Testable criterion 3}

## Pattern References
- **API**: `patterns_library/api/{pattern}.md`
- **Database**: `patterns_library/database/{pattern}.md`
- **Security**: `docs/database/RLS_IMPLEMENTATION_GUIDE.md`

## Success Validation Command
{runnable command to verify the feature}

## Demo Script
1. Navigate to {page}
2. Perform {action}
3. Observe {expected behavior}
4. Verify {success indicator}

## Logical Commits
1. `feat(scope): implement data model [{{TICKET_PREFIX}}-{number}]`
2. `feat(scope): add API endpoint [{{TICKET_PREFIX}}-{number}]`
3. `test(scope): add tests [{{TICKET_PREFIX}}-{number}]`
```

## Acceptance Criteria Patterns

### User Action Criteria

```markdown
- [ ] User can {action} -> {result}
- [ ] When user {triggers}, system {responds}
- [ ] User receives {feedback} after {action}
```

### Data Criteria

```markdown
- [ ] Data persists after {action}
- [ ] User can only see their own {data type}
- [ ] {field} validates {constraint}
```

### Error Criteria

```markdown
- [ ] Invalid input shows {error message}
- [ ] Network failure shows retry option
- [ ] Unauthorized access returns 401
```

## FORBIDDEN Patterns

- Specs without testable acceptance criteria
- Specs without pattern references (execution agents need pointers)
- Specs with "looks good to reviewer" as done criteria (not testable)
- Specs that skip the success validation command

## Quality Checklist

Before submitting a spec:

- [ ] All acceptance criteria are testable (verifiable pass/fail)
- [ ] Pattern references point to existing patterns in `patterns_library/`
- [ ] Success validation command is runnable
- [ ] Demo script is step-by-step reproducible
- [ ] Logical commits follow SAFe format
- [ ] Linear ticket referenced

## Key References

- **Spec templates**: `specs_templates/`
- **Pattern library**: `patterns_library/README.md`
- **SAFe workflow**: `CONTRIBUTING.md`
- **Full skill docs**: `.claude/skills/spec-creation/SKILL.md`

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.