rail-spec
Skill5 starsChanged 4 months agoMITView on GitHub
Synthesize a durable align.md (and current conversation) into docs/monorail/<feature>/spec.md, then stop and ask before continuing to rail-slice. Refuse empty context — do not invent a thin spec.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- rail-alignSkill
- rail-buildSkill
- rail-debugSkill
- rail-grillSkill
- rail-passSkill
- rail-reviewSkill
- rail-setupSkill
- railSkill
- rail-sliceSkill
- rail-tddSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 3 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Before reading or writing work files:
- Distinctive: line 19
If the user named one, use it
- Very specific: line 21
If docs/monorail/<slug>/align.md already exists for this effort, do not invent a different slug for the spec
- Very specific: line 37
If no adequate source: stop.
- Very specific: line 41
If align.md exists, read it fully — fold Intent / Decisions settled / Out of scope into the spec.
- Distinctive: line 42
Use conversation only to enrich, never as the sole source after a fresh session
- Very specific: line 46
Before writing, run a read-only grounding pass so the spec's seams are anchored in the actual code — this is not optional: the spec's ## …
- Very specific: line 50
Write the validated outcome into ## Testing Decisions: external behaviour, then seams — prefer existing seams, highest seam, few seams — …
- Very specific: line 55
If durable sources exist but a few gaps block a coherent spec, ask only those questions — one at a time.
- Very specific: line 59
Write docs/monorail/<feature-slug>/spec.md using the template below.
- Very specific: line 67
Do not substitute foreign-pack skills — e.g.
- Very specific: line 73
Use these exact headings in spec.md:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.
Files
Rail Spec
Turn durable alignment into a spec. Prefer synthesis over interview — but never invent a spec from thin air.
Confirm with the shell before concluding it is missing (ls docs/monorail/work-tracker.md, or read the path directly) — search tools skip gitignored paths, so an empty Glob/Grep result is not evidence of absence. If it is missing on disk, tell the user to run /rail-setup and stop.
Process
1. Confirm the feature slug
Before reading or writing work files:
- If the user named one, use it
- Else list them with the shell (
ls docs/monorail/, then each effort directory foralign.md/spec.md) — search tools skip gitignored paths, so never build this list from Glob/Grep results (skip reserved names:adr,work-tracker.md,domain.md,CONTEXT.md,CONTEXT-MAP.md); match by content name (strip theYYYY-MM-DD-NN-prefix from agent-invented slugs); if several match, use the latest (date + sequence sorts chronologically) - If
docs/monorail/<slug>/align.mdalready exists for this effort, do not invent a different slug for the spec
2. Adequacy gate (fail closed)
Collect sources for this <slug>:
/rail-spec refuses to write spec.md without an align.md:
| Source | Counts as adequate? |
docs/monorail/<slug>/align.md | Yes |
Substantial align discussion in this same session that has not yet been written to align.md | Yes — but write align.md first (same template as /rail-align), then continue |
docs/monorail/<slug>/pass-*.md or a pass path the user passed | Enrichment only — not sufficient alone |
docs/monorail/CONTEXT.md / ADRs alone | No |
| Empty / unrelated conversation | No |
If no adequate source: stop. Tell the user to run /rail-align for this slug (or keep grilling in this session, then persist align.md). Do not write spec.md.
3. Fold durable sources
- If
align.mdexists, read it fully — fold Intent / Decisions settled / Out of scope into the spec; do not leave consensus only inalign.md - Use conversation only to enrich, never as the sole source after a fresh session
4. Code-ground the seams (mandatory)
Before writing, run a read-only grounding pass so the spec's seams are anchored in the actual code — this is not optional: the spec's ## Testing Decisions is the single seam decision for the effort, and /rail-build verifies it rather than re-confirming.
- Explore the codebase. Use
docs/monorail/CONTEXT.mdvocabulary; respect ADRs underdocs/monorail/adr/. - Run a read-only grounding sweep inline in the main session by default — usually a few reads (
grep+read): code map (paths/types/call chains named or implied), test / seam precedents (existing tests and public boundaries near those paths), domain docs (CONTEXT, ADRs, coding standards). Offload to read-only sub-agents — up to three in parallel, or sequentially — only when the territory is genuinely unfamiliar or wide enough to justify the spawn; skip a scope whose inputs clearly do not exist. Always run code map + test precedents when any code exists. - Write the validated outcome into
## Testing Decisions: external behaviour, then seams — prefer existing seams, highest seam, few seams — each with a pointer to the file/test that anchors it. Do not leave seams as a sketch. - Confirm seams with the user once, here — before writing
spec.md. Present the grounded seam proposal using the/rail-grillQuestion format (**问题:**/**推荐:A**/- **A.**), recommend the highest existing seam, and wait for the answer. Do not writespec.mduntil the user confirms. If they reject the proposal, revise it and ask again. This is the single seam decision; downstream build only re-raises a seam on a real contradiction.
5. Gap-closing only (not a full grill)
If durable sources exist but a few gaps block a coherent spec, ask only those questions — one at a time. If gaps are large or re-open the decision tree, stop and suggest /rail-align instead of pushing a hollow spec.
6. Write, then stop for the slice go/no-go
Write docs/monorail/<feature-slug>/spec.md using the template below.
Stop and ask once before slicing. After writing, present a short digest of the spec (Problem / Solution / Stories overview, the single seam decision from ## Testing Decisions, Out of scope, and the spec.md path), then ask whether to continue into /rail-slice in this same session. Wait for the answer. This go/no-go only restates the seam already confirmed in §4 — do not ask the seam question again.
- Continue → read and follow
/rail-slicefor this same<slug>in this same session (writesdocs/monorail/<slug>/tasks/NN-*.md) - Revise the spec → stay on the spec; iterate
spec.mdin place from the feedback (if a change contradicts a settledalign.mddecision, update that durable source too), then return to this go/no-go - Pause → stop here.
spec.mdis durable; a later/rail-slice(or the next session) resumes from it
Do not substitute foreign-pack skills — e.g. /to-tickets, /to-issues, /to-prd, /to-spec — even if those are installed. Do not open GitHub/GitLab Issues for rail work. Do not auto-continue into /rail-build.
Stop instead when: context is near limits → /rail-pass (do not write a degraded spec, and do not continue to slice).
Spec template
Use these exact headings in spec.md:
## Problem Statement## Solution## User Stories(numbered: As a <actor>, I want <feature>, so that <benefit>)## Implementation Decisions(modules/interfaces/architecture/schema/API — no fragile file paths unless quoting a prototype snippet that encodes a decision)## Testing Decisions(external behaviour; seams; prior art)## Out of Scope## Further Notes
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
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.

