Context and specs
How Context creator decides readiness via a 3-part Go gate, ingests existing GitHub repositories, multi-issue tickets, and image attachments, draws the mock UI, 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. Context creator is the Product Owner of the default team flow: it talks with the person and writes the spec, and owns no lane step. Both flows start from the same spec.
Verbatim quotes
All six must-haves (goal, users, pages, core journey, look, what is out) 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). Who accepts follows from the person's access to the request (see Autonomy and people), so there is no acceptor must-have. 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). The six aregoal,users,pages,core_journey,look, andout_of_scope. - 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. Before a turn is accepted,spec.LintPlainalso checks the turn reply and the plain view, and refuses words the person did not use themselves.
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 (the type's recommended page set) |
core_journey | Main step-by-step user flow in requester's words | Refused |
look | Style, hex colors, typography, size, contrast, layout | Allowed (the type's recommended look) |
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 takes its last recommendation for pages and look and accepts its recommended answer for open open_points. For goal, users, core_journey, and out_of_scope it keeps asking. conversationActions sets CanDecide when an open question is an open_point or a must-have with a recommendation, and HasSuggestions when any open question carries one; the UI shows Decide for me and Accept suggestions from these two flags.
Recommended answers per catalogue
The recommendation comes from the project type's catalogue (web-blog version 3, web-app version 2, desktop version 2). pages and look carry a recommended answer in all three. See Catalogues.
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.RefonEvInputand in the request'scontext-statedatabase document, 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 PlayThe mock UI
Context sends a mock_ui with its turns once pages and look are known: the picture the person approves before anything is built. It picks one template that fits the request, gives it a palette and the words each screen shows, and the UI renders it as a sandboxed page with no network access. The rules mirror design/mock-templates.md.
| Part | What the code enforces |
|---|---|
| Template | One of countdown, landing, mobile-app, game, portfolio, blog, ecommerce, dashboard (MockTemplates) |
| Screens | At most 6 screens (maxMockScreens) and 8 items each; each screen id names a glossary screen. App templates may name a layout: list, form, detail, calendar, board, settings, or chart |
| Palette | Seven #RRGGBB colours. Text needs 4.5:1 contrast on background and on surface, muted text 3:1 on background, or checkMockUI refuses the call |
| Style | A mood (eight values), a font (sans, serif, mono, rounded, display), and a brand name clipped to 40 characters |
| Pinned comments | The person pins change requests on the mock (up to 60, 1000 characters each, on desktop, tablet, or mobile). Context must answer every pending pin with a new mock_ui |
| Viewer designs | Dark, Light, and Project colours (the palette Context drew). With no choice, dashboard and mobile-app draw Dark and the other templates draw Project colours |
The person's approval is a mock-ui-approved event written by the acceptor (the opener, or a team owner or member). It records the choice but is not one of the three readiness gates. The mock itself lives in the context-state document, not in <home>.
Standards 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. - Batched elicitation: Asks up to
8questions per batch (maxQuestions). The first batch normally carries the missing must-haves (up to six), later batches onlyopen_points, and the person answers them one at a time. A change holds at most12requirements. - 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. A confirmation stands only while its spec is on the project's staging branch: one made into a repository that was lost (a cloud runner's scratch disk) is committed again into the new repository instead of being reported as done.
| 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 record kept in Postgres.
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.Linton the draft. - Project gate (gate.go): Triggered by
t12 confirm. DevOps first bootstraps an empty project repository, then verifies.t12/configs, skill hashes, branches, dependencies, and base checks onstaging. See DevOps internals. - Task gate: Not a separate step today.
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 team flow's five members map onto the thirteen role packages under internal/roles and the internal/observer loop, each combining 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.