Skip to content

Six-tab editor

For the five atom kinds that carry Layer 2 (feature, ui_view, rule, criterion, fixture), the cloud editor splits into six tabs:

[1.Fields] [2.Intent] [3.Relations] [4.Behavior] [5.Provenance] [6.Preview]

The other 21 kinds use a simpler 3-tab editor (Fields / Intent / Relations).

The kind-specific form. For criterion you fill EARS pattern + actor + system_response. For task you fill title + complexity + depends_on. Etc.

This is where the kind-specific top-level fields of the atom get edited. Validation runs on Save against the Zod schema for the kind.

Three free-form fields, all optional:

  • userStory — prose. Vietnamese / English / whatever.
  • relatedAtoms — list of atom IDs you mention in the user story.
  • notes — internal commentary.

Fill this before you fill Layer 2. The LLM Pattern D suggester reads it as part of every prompt.

Wire edges between this atom and others. The cloud picker has 3 dropdowns:

  • Relation type — one of 20 (verifies, parent_of, uses_rule, …).
  • Atom kind filter — narrow the target picker.
  • Target atom — pick from current project.

The atom’s outgoing edges show above the picker. Incoming edges are read-only here (edit them on the source atom).

Structured executable detail. Two ways to populate:

For feature: a structured Step list editor with 7 step kinds (validate, call, dispatch, setState, navigate, log, if). Click ⇧⇩ to reorder, × to delete. Each step has form fields per kind.

Plus a raw JSON textarea fallback for any field.

  • 🟡 Re-infer (Pattern C) — deterministic synthesis from linked criterion + fixture atoms (or in reverse: criterion from feature steps). Free, no LLM call.
  • Suggest with AI (Pattern D) — calls OpenRouter / Anthropic with a kind-specific prompt + your Layer 1 prose. ~$0.001-0.01/call.

Either path opens a Diff modal before applying — review current vs suggested side-by-side, then Apply or Cancel.

If behavior is empty, the panel shows a Pattern B preview describing what the codegen-senlang bridge will fall back to (e.g. events[<slug>] = [{ $do: log, level: warn, msg: "TODO ..." }] for an unfilled feature).

Per-field audit table. Each row:

  • Field path (e.g. behavior.steps.0).
  • Pattern badge (🟢 A / 🔵 B / 🟡 C / ⚪ D).
  • Source (e.g. cri_xxx + fix_yyy for C, llm:claude-sonnet-4.6 for D).
  • Confidence (% — only for C / D).
  • 🔒 Lock toggle (click to flip).
  • Timestamp.

Lock fields you don’t want overwritten when you re-run Pattern C / D. The merge logic respects locks. See Concepts → Four patterns → The lock flag.

Visualisation of what the codegen bridge will emit:

  • feature → numbered Action chain cards.
  • ui_view → screen tree with section types.
  • rule → enforced_at site cards.
  • criterion → before/after state diff table + api calls list.
  • fixture → API call traces with method badge + response preview.

For full live render, the homepage hosts /demos/from-atomprd.

The Save button in the modal footer commits all 6 tabs at once. There is no per-tab save. Unsaved drafts are lost on browser refresh — save often.