Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

12.9 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- FILL: source path and `git hash-object <source>` — the staleness check reads these two -->
<meta name="explain-source" content=".ai/specs/YYYY-MM-DD-slug.md" />
<meta name="explain-source-hash" content="0000000000000000000000000000000000000000" />
<!-- FILL: the feature name, 2–5 words -->
<title>Feature name</title>
<style>
  :root {
    --bg: #fbfbf9; --panel: #ffffff; --ink: #262323; --faint: #6b6764;
    --hairline: #e3e2de; --accent: #1e84b0; --accent-soft: #dff5ff;
    --warn: #a3520f; --warn-soft: #fff1e0; --ok: #2c7a14; --ok-soft: #e4f8da;
    --code-bg: #efefeb;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #141416; --panel: #1c1c1f; --ink: #ececea; --faint: #a3a19c;
      --hairline: #2e2e33; --accent: #5cc2ee; --accent-soft: #10303f;
      --warn: #f0a35e; --warn-soft: #3a2614; --ok: #8fd672; --ok-soft: #1b3112;
      --code-bg: #26262a;
    }
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--ink);
         font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
  main { max-width: 880px; margin: 0 auto; padding: 48px 16px 96px; }
  h1 { font-size: 30px; line-height: 1.2; margin: 8px 0 12px; }
  h2 { font-size: 20px; margin: 56px 0 12px; padding-top: 24px; border-top: 1px solid var(--hairline); }
  h3 { font-size: 16px; margin: 24px 0 8px; }
  p, li { max-width: 72ch; }
  a { color: var(--accent); }
  code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
         background: var(--code-bg); border-radius: 4px; padding: 1px 5px; }
  .kicker { color: var(--faint); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
  .tldr { font-size: 18px; border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 0; }
  .callout { border-radius: 10px; padding: 12px 16px; margin: 16px 0; border: 1px solid var(--hairline); }
  .callout.example { background: var(--accent-soft); }
  .callout.warn { background: var(--warn-soft); }
  .callout .label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
                    text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
  ol.steps { padding-left: 0; list-style: none; counter-reset: s; }
  ol.steps li { counter-increment: s; position: relative; padding: 8px 0 8px 44px; }
  ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 28px; height: 28px;
                        border-radius: 50%; background: var(--accent-soft); color: var(--accent);
                        font-weight: 700; font-size: 14px; display: grid; place-items: center; }
  figure { margin: 20px 0; background: var(--panel); border: 1px solid var(--hairline);
           border-radius: 12px; padding: 16px; overflow-x: auto; }
  figcaption { color: var(--faint); font-size: 14px; margin-top: 8px; }
  /* SVG diagram primitives — use these classes, never inline colors */
  svg.diagram { display: block; width: 100%; height: auto; min-width: 560px; }
  svg .box { fill: var(--panel); stroke: var(--hairline); stroke-width: 1.5; }
  svg .box.hot { stroke: var(--accent); stroke-width: 2.5; fill: var(--accent-soft); }
  svg .box.new { stroke: var(--ok); stroke-width: 2; fill: var(--ok-soft); }
  svg .box.risk { stroke: var(--warn); stroke-width: 2; fill: var(--warn-soft); }
  svg .lane { fill: none; stroke: var(--hairline); stroke-dasharray: 4 4; }
  svg .edge { fill: none; stroke: var(--faint); stroke-width: 1.5; }
  svg .edge.hot { stroke: var(--accent); stroke-width: 2.5; }
  svg text { fill: var(--ink); font: 14px ui-sans-serif, system-ui, sans-serif; }
  svg text.small { fill: var(--faint); font-size: 12px; }
  svg text.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
  svg marker path { fill: var(--faint); }
  svg marker.hot path { fill: var(--accent); }
  /* Tabs (before / after) */
  .tabs { border: 1px solid var(--hairline); border-radius: 12px; background: var(--panel); margin: 16px 0; }
  .tabs [role=tablist] { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--hairline); }
  .tabs button { font: inherit; font-size: 14px; border: 0; background: none; color: var(--faint);
                 padding: 6px 12px; border-radius: 8px; cursor: pointer; }
  .tabs button[aria-selected=true] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .tabs [role=tabpanel] { padding: 12px 16px; }
  .tabs [role=tabpanel][hidden] { display: none; }
  /* Decisions */
  details { border: 1px solid var(--hairline); border-radius: 10px; background: var(--panel); margin: 8px 0; }
  details > summary { cursor: pointer; padding: 10px 14px; list-style: none; }
  details > summary::-webkit-details-marker { display: none; }
  details > summary::before { content: "▸"; color: var(--faint); margin-right: 8px; display: inline-block; transition: transform .15s; }
  details[open] > summary::before { transform: rotate(90deg); }
  details > div { padding: 0 14px 12px 34px; }
  .choice { font-weight: 600; }
  .rejected { color: var(--faint); }
  .tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
         border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
  .tag.human { background: var(--ok-soft); color: var(--ok); }
  .tag.assumed { background: var(--warn-soft); color: var(--warn); }
  table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
  th, td { text-align: left; border-bottom: 1px solid var(--hairline); padding: 8px 10px; vertical-align: top; }
  th { color: var(--faint); font-weight: 600; }
  .table-wrap { overflow-x: auto; }
  ul.checks { list-style: none; padding-left: 0; }
  ul.checks li { padding: 6px 0 6px 28px; position: relative; }
  ul.checks li::before { content: "☐"; position: absolute; left: 0; color: var(--accent); }
  dl.terms dt { font-weight: 600; margin-top: 12px; }
  dl.terms dd { margin: 2px 0 0 0; color: var(--faint); max-width: 72ch; }
  footer { margin-top: 64px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--hairline); padding-top: 16px; }
</style>
</head>
<body>
<main>

  <header>
    <!-- FILL: artifact kind · the source's own Status value, verbatim · date · source path -->
    <p class="kicker">Spec · draft · 2026-01-01 · <code>.ai/specs/YYYY-MM-DD-slug.md</code></p>
    <!-- FILL: the feature name -->
    <h1>Feature name</h1>
    <!-- FILL: TL;DR — exactly 3 STE-80 sentences: the problem, the change, the result for the user -->
    <p class="tldr">Sentence one. Sentence two. Sentence three.</p>
  </header>

  <section>
    <h2>The picture</h2>
    <!-- FILL: the ONE diagram that explains the whole change (see SKILL.md Step 3 for which kind).
         Copy the primitives below; move/duplicate them; delete what you don't use.
         Coordinates: viewBox is 800 wide; boxes are 160×56; columns at x = 40, 240, 440, 640 (4 per row, 40px gaps).
         Mark the changed parts with class "hot" (changed), "new" (added) or "risk". -->
    <figure>
      <svg class="diagram" viewBox="0 0 800 220" role="img" aria-label="FILL: one-sentence description of the diagram">
        <defs>
          <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" /></marker>
          <marker id="arrow-hot" class="hot" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" /></marker>
        </defs>
        <!-- lane (optional: one per actor/module) -->
        <rect class="lane" x="10" y="10" width="780" height="200" rx="10" />
        <text class="small" x="24" y="32">Lane / actor name</text>
        <!-- box -->
        <rect class="box" x="40" y="80" width="160" height="56" rx="8" />
        <text x="120" y="113" text-anchor="middle">Step A</text>
        <!-- edge -->
        <path class="edge" d="M200,108 L238,108" marker-end="url(#arrow)" />
        <!-- changed box + hot edge -->
        <rect class="box hot" x="240" y="80" width="160" height="56" rx="8" />
        <text x="320" y="105" text-anchor="middle">Step B</text>
        <text class="small" x="320" y="124" text-anchor="middle">what changed</text>
        <path class="edge hot" d="M400,108 L438,108" marker-end="url(#arrow-hot)" />
        <!-- new box -->
        <rect class="box new" x="440" y="80" width="160" height="56" rx="8" />
        <text class="mono" x="520" y="113" text-anchor="middle">newThing</text>
      </svg>
      <!-- FILL: one STE-80 sentence that tells the reader where to look first. Write your own;
           the sample caption below is a placeholder; replace it. -->
      <figcaption>Read left to right. The blue box is the part that changes.</figcaption>
    </figure>
  </section>

  <section>
    <h2>Scope</h2>
    <!-- FILL: from the source's Goals / Non-goals (or In scope / Out of scope). Delete this
         section if the source has neither. -->
    <div class="table-wrap">
      <table>
        <tr><th>In scope</th><th>Out of scope</th></tr>
        <tr><td></td><td></td></tr>
      </table>
    </div>
  </section>

  <section>
    <h2>The problem</h2>
    <!-- FILL: 2–4 STE-80 sentences: what happens today and why it is wrong -->
    <p></p>
    <div class="callout example">
      <span class="label">Example</span>
      <!-- FILL: one concrete case with real-looking (synthetic) numbers and names -->
      <p></p>
    </div>
  </section>

  <section>
    <h2>How it works</h2>
    <!-- FILL: the new behavior as a numbered sequence, one action per item, ≤20 words each -->
    <ol class="steps">
      <li></li>
    </ol>
  </section>

  <section>
    <h2>Before and after</h2>
    <!-- FILL: the same scenario before and after. Delete this section if the spec adds
         something new and nothing existed before. -->
    <div class="tabs" data-tabs>
      <div role="tablist">
        <button role="tab" aria-selected="true">Before</button>
        <button role="tab" aria-selected="false">After</button>
      </div>
      <div role="tabpanel"><p></p></div>
      <div role="tabpanel" hidden><p></p></div>
    </div>
  </section>

  <section>
    <h2>Decisions</h2>
    <!-- FILL: one <details> per row of the spec's Design Decisions table, most important first.
         summary = the question, then the choice. Body = why (≤30 words) + rejected options.
         Tag: "human" if an Open Question with **Answer:** settled it, "assumed" if **Autonomous:**
         settled it, NO tag if no question traces to it. Delete the "Rejected:" line when the
         source names no rejected option. -->
    <details>
      <summary>Question? <span class="choice">Choice.</span><span class="tag human">human</span></summary>
      <div>
        <p>Why: </p>
        <p class="rejected">Rejected: option — reason.</p>
      </div>
    </details>
  </section>

  <section>
    <h2>Data model</h2>
    <!-- FILL: one box per table (header = table name, then key columns), edges = foreign keys.
         Reuse the SVG primitives above. Delete this section if the spec changes no schema. -->
    <figure>
      <svg class="diagram" viewBox="0 0 800 160" role="img" aria-label="FILL: tables and their relations">
        <rect class="box new" x="40" y="20" width="220" height="120" rx="8" />
        <text class="mono" x="56" y="46">newTable</text>
        <text class="small mono" x="56" y="72">id, companyId (PK)</text>
        <text class="small mono" x="56" y="94">parentId → parent</text>
      </svg>
    </figure>
  </section>

  <section>
    <h2>Done when</h2>
    <!-- FILL: the spec's acceptance criteria, one per line, each testable -->
    <ul class="checks">
      <li></li>
    </ul>
  </section>

  <section>
    <h2>Terms</h2>
    <!-- FILL: every domain term or identifier a newcomer would not know. When the term is in
         docs/content/src/glossary/terms.ts, shorten its definition to one STE-80 sentence.
         Otherwise define it only with words the source itself uses. -->
    <dl class="terms">
      <dt>Term</dt><dd>Definition in one STE-80 sentence.</dd>
    </dl>
  </section>

  <footer>
    <!-- FILL: source path -->
    Generated by <code>/explain</code> from <code>.ai/specs/YYYY-MM-DD-slug.md</code>.
    If this page and the source disagree, the source is correct.
  </footer>

</main>
<script>
  // Tabs: no dependencies. Works for every [data-tabs] block on the page.
  document.querySelectorAll("[data-tabs]").forEach(function (root) {
    var tabs = root.querySelectorAll("[role=tab]");
    var panels = root.querySelectorAll("[role=tabpanel]");
    tabs.forEach(function (tab, i) {
      tab.addEventListener("click", function () {
        tabs.forEach(function (t, j) { t.setAttribute("aria-selected", String(i === j)); });
        panels.forEach(function (p, j) { p.hidden = i !== j; });
      });
    });
  });
</script>
</body>
</html>