Context and specs
How Context creator decides readiness via a 3-part Go gate, ingests existing GitHub repositories, multi-issue tickets, and image attachments, enforces 25 lint rules, and exports OpenSpec files plus SRS, Plain, and UAT views.
turbo-12f anchors every specification to words the requester wrote so downstream agents cannot invent unasked scope. internal/roles/context runs a toolless conversation until three deterministic Go checks pass, then exports OpenSpec files plus three audience views.
Verbatim quotes
All six must-haves must be populated and matched to exact human quotes.
Zero open points
Every behavioral edge case (open_point) must be answered or accepted.
25 lint rules
Drafts must pass OpenSpec structural lint and plain-language word caps.
How Context knows context is enough to start
The Context creator LLM never decides when a project is ready (context-creator-v2.md). Instead, gateOf in state.go enforces three ordered checks on *st.Draft:
- Six must-haves backed by verbatim quotes:
st.MustHaves.Missing()must be empty, andsaid(words, given.Quote)(answer.go) verifies every quote appears in human messages (case- and whitespace-normalized). - Zero open points remaining: Behavioral gaps (
open_point) keep the plan unconfirmed (still open with the person: ...) and block confirmation. - Zero structural contract violations:
spec.Lint(lint.go) checks 25 OpenSpec rules on*st.Draft;spec.LintPlainchecks turn replies andplain.md.
spec.MustHaveKeys uses underscores in Go (core_journey, out_of_scope), while catalogue/*.json uses hyphens (core-journey, out-of-scope).
| Key | Purpose | Hand-back allowed |
|---|---|---|
goal | Core outcome the project exists to deliver | Refused (refusalRe check) |
users | Target audience and operator roles | Refused |
pages | Every page or screen, content, and actions | Allowed (catalogue/<type>.json default) |
core_journey | Main step-by-step user flow in requester's words | Refused |
look | Style, hex colors, typography, size, contrast, layout | Allowed (catalogue/<type>.json default) |
out_of_scope | Explicit non-goals excluded from this change | Refused |
open_point | Remaining behavioral detail (limits, errors, rollovers) | Allowed: accepts recommended for remaining points |
When refusalRe matches "you decide" or "skip it", Context fills defaults for pages, look, and open open_points. conversationActions exposes CanDecide and HasSuggestions so the UI swaps Decide for me for Accept suggestions when only non-delegable suggestions remain.
Image attachments, GitHub issues, and existing repositories
Context creator validates multimodal, multi-issue, and repository inputs on t12 ask and t12 ui before mutating state:
- Limits (
internal/imginput): Up to5PNG, JPEG, WebP, or GIF files (MaxPerTurn = 5,MaxBytes = 5 MiBeach), validated against magic bytes and image headers. - Storage & lifecycle: Saved via
Home.Evidence, recorded asrecord.RefonEvInputandcontext/state.json, reloaded on--resume, and written toattachments.json(spec.Change.Attachments) ont12 confirm.
How a conversation becomes a confirmed spec
Context turn replies run exact-quote, open-point, and OpenSpec lint checks in Go before unlocking t12 confirm.
Click any node or press PlayStandards the Context creator follows
Across context-creator-v2.md and lint.go, Context enforces five standards:
- ISO/IEC/IEEE 29148:2018 traits: Every requirement must be
necessary,appropriate,singular,unambiguous,complete,feasible,verifiable,correct, andconforming. - Normative
SHALL& MoSCoW: Requires uppercaseSHALL(RuleShall) andmust/should/could(RulePriority), while banning vague terms (RuleVague),TBD(RuleTBD), and prose filler (RuleFiller). - User stories & BDD Gherkin: Capabilities open with
"As a <user>, I want <goal>, so that <reason>"(RuleStory),mustitems carryGIVEN/WHEN/THEN, andfeature/changecapabilities include anerror: truepath. - Three-round elicitation: Caps at
8questions per round (1:goal/users/pages;2: copy, WCAG4.5:1, fonts,core_journey;3:out_of_scopeandopen_points) and at most12requirements per change. - Plain-language accessibility (
spec.LintPlain): Caps turn replies andplain.mdsentences at25words (PlainSentenceWords), banning factory terms (lane,branch,commit,CI,token,hash, role names) and filler.
| Group | Rules | What Go enforces |
|---|---|---|
| Change and DAG | change, capability, story, task | Lower-case dashed IDs, title/why, user story, TaskTypes, bug-only Severities, depends_on, dag.Order |
| Identifiers & wording | id, duplicate-id, title, shall, priority, vague, tbd, prose-filler | Unique <PREFIX>-REQ-NNN / <PREFIX>-SC-NNN, unique titles, SHALL, priority, zero banned terms |
| Provenance | source, source-turn, decision, keeps | source in said/accepted/decided for you; positive turn; decision ID; keeps requires BuildsOn, ExistingProject, or Repository |
| Scenarios | scenario, gwt, readonly, error-scenario | Scenarios on must; Given/When/Then; no mutating verbs in read-only; error scenario on feature/change |
| Quality & glossary | quality, quality-number, glossary, glossary-used, screen | quality on first change with digits; non-empty glossary with every term and screen ID used in scenarios |
Export standards (openspec/changes/<id>/ and generated views)
Context writes canonical OpenSpec source files plus three read-only views (spec.IsView in files.go and views.go), committed to staging on t12 confirm:
| File | Kind | Purpose |
|---|---|---|
proposal.md | Canonical | Change ID, Project, Builds on, # Request quotes, Why, What Changes, Capabilities, "Your words" |
specs/<capability>/spec.md | Canonical | Delta markdown (## ADDED Requirements), user story, metadata, and Gherkin scenarios |
glossary.md | Canonical | Domain terms and UI screen IDs (home, post-page) used by e2e/t12/capture.ts and ui-check |
decisions.md | Canonical | Decision log (Question, Source, Options, Choice, Reason, Changeable) |
design.md | Canonical | Optional visual spec (hex palette, contrast, fonts, px size, rounding, per-screen layout) |
attachments.json | Canonical | Image attachment metadata when intake included images |
srs.md | Read-only view | Tailored 9-section ISO/IEC/IEEE 29148:2018 SRS (1. Purpose–9. Deliverables) |
plain.md | Read-only view | Requester-readable summary checked by spec.LintPlain ([change this] markers on defaults) |
uat.md | Read-only view | Manual bug-bash checklist (Start, Do, Expect, [ ] pass / fail, grouped error cases) |
What the Context creator leaves behind
t12 ask and confirm separate the project repository spec change on staging from the immutable request log in the state home.
Click any node or press PlayThree readiness gates
- Spec gate (state.go): Runs three deterministic Go checks on every draft turn: verbatim human quotes on all six must-haves, zero remaining
open_pointquestions, andspec.Lintplusspec.LintPlain. - Project gate (gate.go): Triggered by
t12 confirmto verify.t12/configs, skill hashes, branches, dependencies, and base checks onstaging. See DevOps internals. - Task gate:
Design target vs. current code
design.md specifies a standalone pre-lane Task Gate to drop duplicate or already-passing scenarios. Today strategist enforces dag.Order and 1:1 partitions while Orchestrator enforces depsDone and pausedDeps (see Strategist internals and Orchestrator execution).
How the Context creator checks readiness
The person talks only to an agent; scripts enforce the six must-haves, zero open points, and OpenSpec lint before confirm.
Click any node or press PlayKey takeaway
Context creator isolates requirement capture from implementation: three deterministic Go checks prove the spec is grounded and contract-valid before any repository file is touched.
Next steps
Agent roles
How the thirteen role packages under internal/roles and the internal/observer loop combine deterministic scripts with bounded LLM sessions.
Planning and build roles
Deep dive into Strategist DAG lane planning and routing, Analyzer repro creation and split plans, and Engineer caged edits, turn limits, and verify gates.