clarity-flow
Skill0 starsChanged 3 months agoMITView on GitHub
The ClarityKit design flow — activate ONLY when the user explicitly asks for it (mentions clarity-flow / the ClarityKit design flow, in any language; a governing host workflow calling for ClarityKit counts as the ask). Runs standalone or as a clarification sub-flow inside a host workflow's thinking stage (e.g. superpowers brainstorming, planning before an implementation plan). Walks direction → requirements → behavior/architecture (chosen order) → data → ui → commission, judging each step's necessity before entering it, keeping docs/clarity/flow.yaml as the resume point, closing with a signed delegation ledger. Every other ClarityKit skill is invoked the same way — the user names it, or this flow enters its step; none self-activates.
In this repository8 other files it gives its agents.
- clarify-acceptanceSkill
- clarify-architectureSkill
- clarify-behaviorSkill
- clarify-dataSkill
- clarify-directionSkill
- clarify-requirementsSkill
- clarify-uiSkill
- clarity-previewSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
NOT activation — answer in plain conversation.
- Distinctive: line 40
If the user did not state a preference, proceed with the default and attach one line: "behavior-first chosen by default — say the word if …
- Very specific: line 42
Scaffold: Run clarity init, then write docs/clarity/flow.yaml (schema below), announce the flow in two lines (steps + order + where you're …
- Distinctive: line 66
Exit hands upward: When commission is signed, hand the delegation ledger and risk list to the host so its plan absorbs them.
- Distinctive: line 96
Necessary → invoke the skill directly: No permission round-trip. The skill's own batched interview already contains the one interaction …
- Very specific: line 110
When a step's skill reports user approval: set its status done, list its artifacts (relative to the staging dir), and add a one-line note …
- Distinctive: line 117
When a later step invalidates an earlier conclusion (a scenario no component can own.
- Very specific: line 135
Never skipped, never delegated.
- Very specific: line 196
Every diagram is verified + published with clarity publish (check-then-build).
- Very specific: line 197
Never start the preview server yourself — that is the user-invoked clarity-preview skill.
- Very specific: line 199
All tools run through the clarity CLI — never relative tool paths.
- Very specific: line 201
STOP and tell the user to finish the ClarityKit install.
≈ “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
clarity-flow — the explicit ClarityKit design flow
An optional, explicitly-activated flow that composes the ClarityKit toolbox into a progressive path: from a rough direction to an implementation-ready design. This skill owns process (ordering, necessity judgment, resume state, the closing ledger); the clarify-* skills own content. It never self-activates and never hijacks a plain design conversation.
Activation — the only way in
Activate when — and only when — the user explicitly asks for the ClarityKit flow (any language, any name for it: "use clarity-flow", "walk the ClarityKit stages"). A governing host workflow whose own instructions call for ClarityKit counts as the explicit ask. Discussing requirements or architecture without that explicit ask is NOT activation — answer in plain conversation; no skill runs and no skip ceremony applies.
On activation, decide three things. These three decisions together cost at most one confirmation round (the defaults usually need none — later steps have their own, separate interaction points):
- Entry mode.
- greenfield (default): a new product/project. Start at
direction. - re-entry: a new feature inside an existing, already-designed system (user says
so, or the staging dir holds prior approved artifacts). Do NOT redo direction or
requirements — mark them
givenin flow.yaml, consult existing artifacts read-only as constraints, and enter atbehavior(ordatawhen the feature is data-shaped). Changes to existing artifacts are additive deltas; mutating existing behavior is a back-jump, not an edit.
- greenfield (default): a new product/project. Start at
- Middle order. The two legal orders through the middle are:
- behavior-first (DEFAULT): scenarios pin what the system must do before technology shapes it. Use unless the user says otherwise.
- arch-first: the user states it, or hard technology constraints dominate (mandated platform, integration that forces the stack). If the user did not state a preference, proceed with the default and attach one line: "behavior-first chosen by default — say the word if you want architecture first."
- Scaffold. Run
clarity init, then writedocs/clarity/flow.yaml(schema below), announce the flow in two lines (steps + order + where you're entering), and enter the first step immediately. No opening ceremony beyond that. In re-entry mode, put the 5-line feature brief (what job, for whom, one non-goal) into thedirectionstep'snoteso it survives across sessions. (Laterclarity init <name>calls for behavior modules: names are lowercase, digits, hyphens.)
Inside a host workflow — sub-flow mode
ClarityKit's natural habitat is the thinking stage before implementation: requirements discussion, design brainstorming, or the moment before an implementation plan is written — frequently inside a host workflow (e.g. superpowers brainstorming, a spec-driven process, a planning phase). When activated there, this flow runs as a SUB-FLOW of the host's thinking stage:
- The host owns the session — when we enter, when we leave, what happens before and after. Never restructure, extend, or shortcut the host's own stages.
- clarity-flow owns the clarification inside — steps, artifacts, flow.yaml, the closing ledger.
- Two output layers. ClarityKit artifacts (diagrams, models, contracts, ADR,
commission.md) stay in
docs/clarity/as the design record; the HOST's deliverables (its spec, plan, or ticket documents) receive the conclusions. Write the host's format as the primary output — never force the host to adopt ClarityKit files. - Exit hands upward. When commission is signed, hand the delegation ledger and risk list to the host so its plan absorbs them; announce the SUB-FLOW complete, never the host workflow itself.
The flow
direction → requirements → { behavior ⇄ architecture } → data → ui → commission| Step | Skill | Core question | Skip condition (record it — never silent) |
| direction | clarify-direction | who is this for, what job, what non-goals | user's opening message already pins user, job, ≥3 non-goals, and observable success |
| requirements | clarify-requirements | what does it do, in what priority order | brief already decidable for the next step |
| behavior | clarify-behavior | what happens, end to end, including failure | no user-visible behavior worth reviewing (a pure internal transform). Linear/simple behavior is NOT a skip — run it in light tier (one flowchart + criteria) |
| architecture | clarify-architecture | what are the parts, what stack | stack already fixed / only one viable option. Single-process tools collapse to an ownership note — record the step done with the note as its artifact, NOT skipped |
| data | clarify-data | what is remembered, what crosses boundaries | stateless AND interface-free |
| ui | clarify-ui | does the UX feel right before we build it | no interactive UI to judge (pure backend, CLI, library, batch job); the prototype skill itself decides depth |
| commission | (this skill — no separate skill) | what did we NOT decide, who decides it | NEVER skippable |
The middle pair (behavior, architecture) runs in the chosen order; data follows both,
then ui, then commission. In re-entry mode, architecture usually records skipped
with note "stack fixed by the existing system" — or runs as a delta when the feature
adds a component.
The step-entry loop (the heart of this skill)
For the next pending step, BEFORE invoking its skill:
- Judge necessity against the skip condition above + the skill's entry criteria.
- Necessary → invoke the skill directly. No permission round-trip. The skill's own batched interview already contains the one interaction point where the user weighs in — including which optional diagrams to draw (each with your recommendation and reason; default at most 2 optional diagrams per module, more only if the user asks).
- Want to skip → one batched question, nothing else in it:
I propose skipping behavior for this module — it's a one-shot transform with no state. OK to skip? (If we run it, I'd also draw the failure-path view because ___.) The user's single reply decides. On confirmation: record
skipped+ one-line reason in flow.yaml, move on, never re-litigate. - Per-module granularity (behavior only).
behavioris evaluated and entered per module — one module may need the YAML tier while another needs a one-diagram light tier; different modules may choose different optional diagrams.dataanduirun ONCE each, project-level, after the middle pair.
When a step's skill reports user approval: set its status done, list its artifacts
(relative to the staging dir), and add a one-line note of what was decided. Then repeat
the loop. flow.yaml is updated immediately at every status change — it is the resume
point for any future session.
Back-jumps — reopen decisions, not stages
When a later step invalidates an earlier conclusion (a scenario no component can own; a contract that doesn't fit its boundary; an error with no recovery scenario):
- Name the specific decision that flipped, never "redo the stage".
- Estimate the blast radius ("this invalidates field X and state Y — small touch").
- Set the CURRENT step back to
pending(ordoneif its other decisions survive), then set the owning step's status toactivewith a note — never leave two stepsactive(the validator rejects that). Redo only the invalidated decisions and their artifacts; when the redo is approved, re-enter the step you left. - Downgrade valve: the user may refuse the jump and accept the flaw — then it goes on the commission risk list as accepted, and the flow moves on.
- Thrash rule: any decision that flips twice is being made at the wrong layer or with missing information — either commission a probe against it or escalate one level up (a twice-flipped structure decision is usually a disguised behavior decision). This rule is mandatory; it is the anti-loop governor.
Commission — the terminal step (this skill performs it)
Never skipped, never delegated. Cheap, because it mostly assembles what the flow already
surfaced. Write docs/clarity/commission.md:
- Delegation ledger — two lists:
- the implementing agent may decide autonomously (library choices within constraints, internal naming, error message wording, standard UI states, anything inside a stated constraint);
- forces a return to the user (anything touching a contract, a persistent field, an unrecoverable transition, a new dependency, a non-goal boundary).
- Risk list — top 3–5 risks as "if we're wrong about X, we redo Y", each with an explicit accept or probe decision. A probe is a targeted spike (one risky algorithm, one hostile-input test), never a whole-product prototype.
- Consistency sweep — scenarios ↔ behavior models ↔ contracts ↔ diagrams agree;
clarity checkgreen; every open question is either closed or on the ledger.
Present both lists in the conversation. The user signs off line by line — that signature
is the terminal act. Then: mark commission done in flow.yaml and run
clarity publish once so the site's progress chips show the finished flow
(commission itself produces no diagrams — this closing publish is the only one it
needs), and announce the flow complete. Until the signature lands,
"implementation-ready" is an assertion, not a fact.
flow.yaml — schema (you maintain it; the CLI validates it)
# TEMPLATE — pick ONE value from each a|b|c union; see examples/flow.yaml for a
# filled-in one. The validator errors on the literal union strings.
flow:
id: <kebab-case> # project or module scope
order: behavior-first | arch-first
steps:
direction: { status: pending|active|done|skipped|given, artifacts: [...], note: <one line> }
requirements: { ... }
behavior: { ... }
architecture: { ... }
data: { ... }
ui: { ... }
commission: { status: ..., artifacts: [commission.md] }artifactspaths are relative to the staging dir.givenmeans settled elsewhere (re-entry): consulted read-only, not performed.- Edit the file directly with your file-editing tool. Every
claritycommand validates it and prints problems asflow.yaml:lines — repair them promptly (they are usually a stale artifact path or a missing note). - On any session where the flow was previously activated: run
clarity statusfirst — one call printing flow progress, the active step with its note, the artifact inventory, preview state, and site freshness. Resume from there; do not re-derive state by listing directories or reading files one by one.
Shared conventions (all ClarityKit capabilities)
- Invocation is explicit everywhere. Each capability runs only when the user names it or a governing flow walks into its step — never self-activated from topic overlap. In plain design conversation, answer plainly.
- Paths are derived, never chosen. Artifacts live in the staging dir
<projectRoot>/docs/clarity/(runclarity root). The ADR is the one handoff artifact (clarity adr→docs/adr/, automatic numbering). - Presentation contract. Decision-grade content lives in the conversation; files
are archives for future agents. Published diagrams carry
%% title:(plus%% caption:/%% group:when useful); refer to diagrams by exact browser title. - Every diagram is verified + published with
clarity publish(check-then-build). Never start the preview server yourself — that is the user-invokedclarity-previewskill. - All tools run through the
clarityCLI — never relative tool paths. Ifclarityis not found:export PATH="$HOME/.local/bin:$PATH"and retry ONCE; still missing → STOP and tell the user to finish the ClarityKit install. Never improvise alternatives (nohup, setsid, hand-rolled servers).
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.

