Turn a feature idea into a structured specification with testable rules before any code is written.
/cdebug), refactoring (use /crefactor), or changes that already have an approved spec/cspec is the first skill you run after /csetup. It produces the spec document that drives everything downstream. After the spec is approved, you run /creview to challenge it with fresh eyes. The full pipeline is: /cspec → /creview → /ctdd → /cverify → /cdocs → merge.
User: /cspec — add rate limiting to the login endpoint
Agent: Before writing the spec, let me understand the problem.
What's driving this? Brute force attacks, or general API abuse?
User: Brute force. We've had credential stuffing attempts.
Agent: What's the simplest version that would be useful? Per-IP limiting,
per-account limiting, or both?
User: Per-account first. IP limiting can come later.
Agent: Based on our discussion, here's what I understand: rate limiting on
the login endpoint to prevent credential stuffing, scoped to
per-account lockout. IP-based limiting is out of scope for now.
[reads ARCHITECTURE.md, antipatterns, recent git log]
# Spec: Login Rate Limiting
## Rules
- **R-001** [unit]: After 5 failed login attempts for the same email
within 15 minutes, subsequent attempts return 429 with a
Retry-After header
- **R-002** [integration]: The lockout counter resets after a
successful login
- **R-003** [unit]: The lockout duration is configurable via
environment variable (default: 15 minutes)
- **R-004** [integration]: Rate limit state persists across server
restarts (stored in Redis/database, not in-memory)
- **R-005** [unit]: The 429 response does not reveal whether the
email exists in the system
Does this look right? Anything to add or change?
| Reads | Writes |
|---|---|
AGENT_CONTEXT.md |
.correctless/specs/{task-slug}.md |
ARCHITECTURE.md |
.correctless/artifacts/research/{slug}-research.md (if research triggered) |
.correctless/antipatterns.md |
.correctless/artifacts/token-log-{slug}.json |
.correctless/meta/drift-debt.json (high+ intensity) |
Workflow state (advances to review phase) |
.correctless/artifacts/qa-findings-*.json |
|
| Git log (recent 20 commits) |
For [integration] rules, /cspec defines Entry/Through/Exit contract constraints derived from .correctless/ARCHITECTURE.md entrypoints (ABS-023). The contract format (ABS-024) tells the TDD agent exactly what the integration test must exercise:
test_via field)If no entrypoints are defined in ARCHITECTURE.md, the skill prompts you to run /carchitect first or skip contracts for this spec. Rules tagged [unit] are not affected — contracts apply only to [integration] rules.
Standard intensity produces 5 sections: What, Rules (R-xxx with test levels), Won’t Do, Risks, Open Questions. Simple and fast.
High/critical intensity scales artifact weight by intensity level. High adds Boundary Conditions and Complexity Budget. Critical adds STRIDE analysis, Environment Assumptions, and Design Decisions. At high/critical intensity, the skill also checks drift debt and recommends an intensity level based on trust boundaries touched.
/creview. The review skill exists specifically to catch what you missed.