create-pmos 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/bin/create-pmos.js +103 -0
  4. package/package.json +26 -0
  5. package/payload/AGENTS.md +83 -0
  6. package/payload/KIT-VERSION +3 -0
  7. package/payload/README.md +56 -0
  8. package/payload/okf/core/concepts/agent-harness.md +83 -0
  9. package/payload/okf/core/concepts/control-plane.md +61 -0
  10. package/payload/okf/core/concepts/design-loop.md +117 -0
  11. package/payload/okf/core/concepts/eval-driven-pm.md +71 -0
  12. package/payload/okf/core/concepts/index.md +17 -0
  13. package/payload/okf/core/concepts/log.md +6 -0
  14. package/payload/okf/core/concepts/okf-governance.md +159 -0
  15. package/payload/okf/core/concepts/okr-anti-optimism.md +54 -0
  16. package/payload/okf/core/concepts/okr-tree.md +67 -0
  17. package/payload/okf/core/concepts/output-eval.md +81 -0
  18. package/payload/okf/core/concepts/pm-identity.md +68 -0
  19. package/payload/okf/core/concepts/product-slug-convention.md +64 -0
  20. package/payload/okf/core/concepts/sdlc-loop.md +69 -0
  21. package/payload/okf/core/concepts/self-refining-harness.md +77 -0
  22. package/payload/okf/core/concepts/watermelon-flag.md +66 -0
  23. package/payload/okf/core/templates/design-brief-template.md +84 -0
  24. package/payload/okf/core/templates/eval-rubric-template.md +95 -0
  25. package/payload/okf/core/templates/index.md +8 -0
  26. package/payload/okf/core/templates/log.md +9 -0
  27. package/payload/okf/core/templates/prd-template.md +75 -0
  28. package/payload/okf/product/.gitkeep +0 -0
  29. package/payload/planning/evals/agent-run-eval-rubric.md +46 -0
  30. package/payload/planning/evals/check_rubrics.py +108 -0
  31. package/payload/planning/evals/eval-calibration.md +4 -0
  32. package/payload/planning/okrs/.gitkeep +0 -0
  33. package/payload/planning/prd/.gitkeep +0 -0
  34. package/payload/scripts/gate-initiative.sh +56 -0
  35. package/payload/scripts/kit-update.sh +16 -0
  36. package/payload/scripts/metrics.py +99 -0
  37. package/payload/skills/SKILL-FORMAT.md +89 -0
  38. package/payload/skills/eval-rubric.skill +122 -0
  39. package/payload/skills/evaluator.skill +82 -0
  40. package/payload/skills/ingest-repo.skill +117 -0
  41. package/payload/skills/okr.skill +68 -0
  42. package/payload/skills/prd.skill +80 -0
  43. package/payload/state/acceptances.jsonl +0 -0
  44. package/payload/state/discoveries.md +2 -0
  45. package/payload/state/evals.jsonl +0 -0
  46. package/payload/state/initiatives/.gitkeep +0 -0
  47. package/payload/state/runs.jsonl +0 -0
  48. package/payload/templates/agent-run-eval-rubric.md +46 -0
  49. package/payload/templates/pmos-gate.yml +29 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wawan (PMOS)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # create-pmos
2
+
3
+ Scaffold the **PMOS portable kit**: run a disciplined, eval-driven product-management workflow —
4
+ initiative → PRD → eval rubric → pre-run contract → build → Quality/Review/Acceptance gates —
5
+ **entirely inside your own repo**. All state is git-versioned files. No database, no account,
6
+ no network calls, no telemetry.
7
+
8
+ ```bash
9
+ npx create-pmos@latest # vendor a pmos/ kit into the current directory
10
+ npx create-pmos@latest my-product # ...or into my-product/
11
+ npx create-pmos@latest --update # refresh the kit kernel (never touches your state)
12
+ ```
13
+
14
+ Then open the folder with your coding agent (e.g. Claude Code) and start at `pmos/AGENTS.md` —
15
+ it is the whole protocol. `pmos/README.md` is the operator guide; `pmos/scripts/metrics.py`
16
+ prints your north-star metrics from the recorded state.
17
+
18
+ ## What's inside
19
+
20
+ - `pmos/AGENTS.md` — the run protocol + the state adapter (every workflow action is a file convention)
21
+ - `pmos/skills/` — the working skills (PRD, eval rubric, OKR, adversarial evaluator, repo ingest)
22
+ - `pmos/okf/core/` — the concept kernel (the SDLC loop, three-tier gates, watermelon flags, …)
23
+ - `pmos/scripts/` — a fail-closed CI gate for unanchored PRs, metrics, kernel updater
24
+ - `pmos/state/` — your append-only operational record (initiatives, runs, evals, acceptances)
25
+
26
+ ## Scope & support
27
+
28
+ This package contains only the PMOS workflow **kernel** — it holds no reference to, and never
29
+ contacts, any PMOS backend. Provided **as-is** (MIT); it is a snapshot published from a private
30
+ upstream, updated when the maintainer publishes. Issues/PRs are not currently monitored.
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * create-pmos — scaffold the PMOS portable kit into a repo (D54/D55).
4
+ *
5
+ * npx create-pmos@latest [target-dir] vendor a fresh pmos/ kit (default target: cwd)
6
+ * npx create-pmos@latest --update [dir] refresh ONLY the kernel of an existing kit
7
+ * npx create-pmos@latest --version print package version + bundled kernel provenance
8
+ *
9
+ * Dependency-free by design. Makes NO network calls, sends NO telemetry — the payload is
10
+ * bundled in this package (assembled by the canonical kit/build-kit.sh at publish time).
11
+ * --update never touches state/, planning/ (except check_rubrics.py), or okf/product/.
12
+ */
13
+ 'use strict';
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+
17
+ const PAYLOAD = path.join(__dirname, '..', 'payload'); // the assembled pmos/ kit
18
+ const PKG = require(path.join(__dirname, '..', 'package.json'));
19
+
20
+ // Kernel paths (relative to the kit root) that --update may rewrite. Everything else is state.
21
+ const KERNEL = [
22
+ 'AGENTS.md',
23
+ 'README.md',
24
+ 'KIT-VERSION',
25
+ 'skills',
26
+ 'okf/core',
27
+ 'scripts',
28
+ 'templates',
29
+ 'planning/evals/check_rubrics.py',
30
+ ];
31
+
32
+ function die(msg) { console.error(`create-pmos: ERROR — ${msg}`); process.exit(1); }
33
+
34
+ function payloadOrDie() {
35
+ if (!fs.existsSync(path.join(PAYLOAD, 'AGENTS.md'))) {
36
+ die('bundled payload missing — this package was not assembled by kit/build-kit.sh; refusing.');
37
+ }
38
+ }
39
+
40
+ function kitVersion() {
41
+ try { return fs.readFileSync(path.join(PAYLOAD, 'KIT-VERSION'), 'utf8').trim(); }
42
+ catch { return '(no KIT-VERSION in payload)'; }
43
+ }
44
+
45
+ function stampInstall(kitDir, mode) {
46
+ const stamp = `installed-via: create-pmos@${PKG.version}\ninstall-mode: ${mode}\ninstalled: ${new Date().toISOString().slice(0, 10)}\n`;
47
+ fs.appendFileSync(path.join(kitDir, 'KIT-VERSION'), stamp);
48
+ }
49
+
50
+ function vendor(targetRoot) {
51
+ payloadOrDie();
52
+ const kit = path.join(targetRoot, 'pmos');
53
+ if (fs.existsSync(kit)) die(`${kit} already exists — use --update to refresh its kernel.`);
54
+ fs.mkdirSync(targetRoot, { recursive: true });
55
+ fs.cpSync(PAYLOAD, kit, { recursive: true });
56
+ stampInstall(kit, 'vendor');
57
+ console.log(`✅ PMOS kit vendored at ${kit} (${kitVersion().split('\n')[0]})`);
58
+ console.log(`
59
+ Next steps in ${targetRoot}:
60
+ 1. If the repo is not git yet: git init
61
+ 2. If it lives on GitHub: cp pmos/templates/pmos-gate.yml .github/workflows/pmos-gate.yml
62
+ 3. Add to the repo's CLAUDE.md: "This product is PMOS-managed (file mode) — read pmos/AGENTS.md before any work."
63
+ 4. Commit the pmos/ folder. Then follow pmos/AGENTS.md for every run.`);
64
+ }
65
+
66
+ function update(dirArg) {
67
+ payloadOrDie();
68
+ // Accept either the kit dir itself or its parent repo root.
69
+ let kit = path.resolve(dirArg || '.');
70
+ if (path.basename(kit) !== 'pmos' && fs.existsSync(path.join(kit, 'pmos', 'state'))) {
71
+ kit = path.join(kit, 'pmos');
72
+ }
73
+ if (!fs.existsSync(path.join(kit, 'state'))) {
74
+ die(`${kit} does not look like a vendored kit (no state/) — refusing to update.`);
75
+ }
76
+ for (const rel of KERNEL) {
77
+ const src = path.join(PAYLOAD, rel);
78
+ if (!fs.existsSync(src)) continue;
79
+ const dst = path.join(kit, rel);
80
+ if (fs.statSync(src).isDirectory()) {
81
+ fs.rmSync(dst, { recursive: true, force: true });
82
+ fs.cpSync(src, dst, { recursive: true });
83
+ } else {
84
+ fs.mkdirSync(path.dirname(dst), { recursive: true });
85
+ fs.copyFileSync(src, dst);
86
+ }
87
+ }
88
+ stampInstall(kit, 'update');
89
+ console.log(`✅ kit kernel updated at ${kit} (${kitVersion().split('\n')[0]})`);
90
+ console.log('state/, planning/ (beyond check_rubrics.py), and okf/product/ were not touched. Review the diff as a normal PR.');
91
+ }
92
+
93
+ const args = process.argv.slice(2);
94
+ if (args.includes('--help') || args.includes('-h')) {
95
+ console.log('usage: create-pmos [target-dir] | create-pmos --update [kit-or-repo-dir] | create-pmos --version');
96
+ } else if (args.includes('--version') || args.includes('-v')) {
97
+ console.log(`create-pmos ${PKG.version}`);
98
+ console.log(kitVersion());
99
+ } else if (args.includes('--update')) {
100
+ update(args.filter((a) => !a.startsWith('-'))[0]);
101
+ } else {
102
+ vendor(path.resolve(args.filter((a) => !a.startsWith('-'))[0] || '.'));
103
+ }
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "create-pmos",
3
+ "version": "0.1.0",
4
+ "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → PRD → eval rubric → contract → build → three gates) entirely inside your own repo, with all state as git-versioned files. No database, no network, no telemetry.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "create-pmos": "bin/create-pmos.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "payload/",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "keywords": [
19
+ "pmos",
20
+ "product-management",
21
+ "agent-harness",
22
+ "eval-driven",
23
+ "scaffold",
24
+ "create"
25
+ ]
26
+ }
@@ -0,0 +1,83 @@
1
+ # AGENTS.md — PMOS Portable Kit (file mode)
2
+
3
+ > This file must be read at optimal altitude — concrete heuristics that guide behavior, not brittle
4
+ > if-else rules engines, and not vague mandates that assume shared context.
5
+
6
+ You are working in a product repo that vendors the **PMOS portable kit** (D54). PMOS here is a
7
+ **control plane** for how work is specced, evaluated, and accepted — it generates no application
8
+ code by itself; you build the product, PMOS disciplines the loop.
9
+
10
+ ## The containment rule (non-negotiable)
11
+
12
+ **This deployment is file-mode. Make NO network call to any PMOS backend — no MCP connection, no
13
+ `get_skill`, no telemetry, nothing.** Every piece of PMOS state lives in this repo, under `pmos/`.
14
+ This boundary exists because this product's data must not leave its own remote. If you find
15
+ yourself wanting an MCP tool, use the state adapter below instead.
16
+
17
+ ## The state adapter — every PMOS tool is a file convention
18
+
19
+ | Hosted tool (as skills name them) | File-mode equivalent |
20
+ |---|---|
21
+ | `create_initiative` | write `pmos/state/initiatives/<id>.md` (frontmatter: id, title, parent_kr, stage, status, prd_path, rubric_path, created) |
22
+ | `save_spec` | the PRD file itself at `pmos/planning/prd/<id>-prd.md` (set `prd_path` on the initiative file) |
23
+ | `get_spec` / `get_planning_artifact` | read `pmos/planning/…` |
24
+ | `get_skill` | read `pmos/skills/<name>.skill` |
25
+ | `get_okf_concepts` | read `pmos/okf/…` (index-first, then the concept body — progressive disclosure) |
26
+ | `get_eval_rubric` | read `pmos/planning/evals/<id>-eval-rubric.md` |
27
+ | `log_agent_run` | append one JSON line to `pmos/state/runs.jsonl` (`{run_id, initiative_id, pre_run_contract, self_eval, human_corrections, date}`) |
28
+ | `save_eval` | append one JSON line to `pmos/state/evals.jsonl` (`{run_id, initiative_id, rubric_path, score, verdict, dimensions, date}`) |
29
+ | `record_acceptance` | append one JSON line to `pmos/state/acceptances.jsonl` (`{run_id, initiative_id, accepted, pm_label, note, date}`) — **written only on the PM's explicit word** |
30
+ | `save_okf_doc` | write the doc under `pmos/okf/product/…` marked as a DRAFT; the PM approves it via PR review (the file-mode form of draft→approved) |
31
+ | `register_product_repo` | not applicable — this repo IS the product; skip the step |
32
+ | `log_friction` / `log_discovery` | append to `pmos/state/discoveries.md` (ISO date, `#friction` tag where applicable) |
33
+ | `get_agent_runs` / `get_friction` | read those same files (your episodic memory — consult before contracting) |
34
+
35
+ State files are **append-only**: never rewrite or delete an existing line or initiative record;
36
+ correct by appending. When a vendored skill names a hosted tool, apply this table — the skill
37
+ bodies are single-sourced from the PMOS kernel and are not forked for file mode.
38
+
39
+ ## Agent run protocol (every run, in order)
40
+
41
+ 1. Read this file.
42
+ 2. Read the relevant `pmos/skills/*.skill` for the task type (L1 index first; body when relevant).
43
+ No skill fits → escalate to the PM; do not improvise a procedure.
44
+ 3. Retrieve context: `pmos/okf/` for concepts, `pmos/okf/product/` for this product's knowledge,
45
+ `pmos/state/runs.jsonl` + `discoveries.md` for what prior runs tried (episodic memory).
46
+ 4. Anchor: the initiative file must exist at stage `intake`/`spec` with a PRD and rubric authored
47
+ **before** build (eval-first, D13). Write the **pre-run contract** into the rubric's sprint
48
+ contract section and get the PM's explicit approval (`PM_approved: true`) before any work.
49
+ 5. Branch `initiative/<id>`; execute at control altitude; one commit per artifact.
50
+ 6. Self-evaluate against the contract — self-eval is unreliable; it is an input to the gates, never
51
+ a verdict.
52
+ 7. Close the gates: **Quality** = this repo's CI plus the kit gate (`pmos/scripts/gate-initiative.sh`
53
+ + `pmos/planning/evals/check_rubrics.py`); **Review** = score against the rubric with the evaluator
54
+ skill (adversarial, outcome-only, default-to-refute) and append to `evals.jsonl`; **Acceptance**
55
+ = the human PM merges and disposes — final and non-delegable. Never merge your own PR.
56
+ 8. Log the run (`runs.jsonl`) and any friction (`discoveries.md`, `#friction`).
57
+
58
+ ## Escalation (stop and ask the PM)
59
+
60
+ An architectural choice with no recorded decision; a wrong or unsatisfiable contract; scope growth;
61
+ any destructive/irreversible action; anything that would send product data outside this repo's
62
+ remote. Confirm-first regardless of framing.
63
+
64
+ ## Evaluator leniency warning
65
+
66
+ The evaluator defaults to generous scoring. Treat the Review Gate as **uncalibrated** in this
67
+ deployment until this repo has accumulated its own PM-vs-evaluator record (append overrides to
68
+ `pmos/planning/evals/eval-calibration.md`; the D40 classifier method applies locally).
69
+ `pmos/scripts/metrics.py` computes the north star (human corrections per accepted run), pass rates,
70
+ and the Goodhart tripwire from `pmos/state/`.
71
+
72
+ ## PM protocol (weekly)
73
+
74
+ Scan `discoveries.md`; a friction theme seen twice with no resolving decision must be promoted to a
75
+ decision. Read run records since last review; log overrides to `eval-calibration.md`. Run
76
+ `pmos/scripts/metrics.py` and read the red first.
77
+
78
+ ## Kit maintenance
79
+
80
+ `pmos/KIT-VERSION` records the kernel source. Update the kernel with
81
+ `pmos/scripts/kit-update.sh <path-to-pmos-checkout>` — it re-vendors ONLY `skills/`, `okf/core/`,
82
+ `scripts/`, `AGENTS.md`, `README.md` and never touches `state/`, `planning/`, or `okf/product/`.
83
+ Review the update as a normal PR.
@@ -0,0 +1,3 @@
1
+ kernel-source: pmos@1740a5e
2
+ assembled: 2026-07-17
3
+ mode: vendor
@@ -0,0 +1,56 @@
1
+ # PMOS Portable Kit (file mode)
2
+
3
+ Run the PMOS workflow — initiative → PRD → eval rubric → pre-run contract → build →
4
+ Quality/Review/Acceptance gates — **entirely inside this repo**, with every piece of state as
5
+ git-versioned files. No database, no MCP connection, no network calls to any PMOS backend (D54).
6
+ Built for products whose data must not leave their own remote (e.g. company-owned products vs a
7
+ personally-owned PMOS backend).
8
+
9
+ ## What's in the folder
10
+
11
+ - `AGENTS.md` — the run protocol. **Start here; every agent session reads it first.** Contains the
12
+ state adapter: the table mapping each hosted PMOS tool to a file convention.
13
+ - `skills/` — the PMOS skill kernel (prd, eval-rubric, okr, evaluator, …). Single-sourced from the
14
+ PMOS repo; where a skill names a hosted tool, apply the AGENTS.md state adapter.
15
+ - `okf/core/` — kernel concepts (the sdlc loop, the three-tier gate, watermelon flags, …).
16
+ `okf/product/` — YOUR product's knowledge; drafted by ingest, approved via PR review.
17
+ - `planning/` — okrs, PRDs, rubrics (`agent-run-eval-rubric.md` is the per-initiative template),
18
+ `eval-calibration.md` (append every PM override of an evaluator verdict).
19
+ - `state/` — the operational record, **append-only**: `initiatives/<id>.md`, `runs.jsonl`,
20
+ `evals.jsonl`, `acceptances.jsonl`, `discoveries.md`.
21
+ - `scripts/` — `gate-initiative.sh` (the fail-closed CI gate), `metrics.py` (north star +
22
+ calibration + Goodhart tripwire), `kit-update.sh` (kernel refresh).
23
+ - `templates/pmos-gate.yml` — CI drop-in; copy to `.github/workflows/`.
24
+ - `KIT-VERSION` — which PMOS kernel this was assembled from.
25
+
26
+ ## Install (once)
27
+
28
+ No PMOS repo access needed (D55): **`npx create-pmos@latest [target-dir]`** — then follow its
29
+ printed next steps (wire the CI workflow, point CLAUDE.md at `pmos/AGENTS.md`, commit).
30
+ From a PMOS checkout the equivalent is `kit/build-kit.sh <this-repo-root>`; the npm package's
31
+ payload is assembled by that same script at publish time, so the two never drift.
32
+
33
+ ## Operate (every piece of work)
34
+
35
+ 1. Create `pmos/state/initiatives/<id>.md` (stage `intake`, anchored to a KR in `planning/okrs/`).
36
+ 2. Author the PRD and the rubric **before building** (copy the rubric template); agree the sprint
37
+ contract; the PM flips `PM_approved: true`.
38
+ 3. Branch `initiative/<id>`, build, open a PR — the `pmos-gate` CI check fails any PR that isn't
39
+ anchored (branch or `Initiative: <id>` in the PR body; `no-initiative` label for genuine chores).
40
+ 4. Review Gate: run the evaluator skill against the rubric; append the verdict to
41
+ `state/evals.jsonl`. The verdict is advisory until locally calibrated.
42
+ 5. Acceptance Gate: the **human PM** merges and disposes; append to `state/acceptances.jsonl`
43
+ (`accepted`, `pm_label`, corrections). Weekly: run `scripts/metrics.py`, read the red first.
44
+
45
+ ## Update the kernel (occasionally)
46
+
47
+ `npx create-pmos@latest --update` (or `pmos/scripts/kit-update.sh <path-to-pmos-checkout>` from a
48
+ PMOS checkout) — refreshes ONLY the kernel (skills/okf-core/scripts/AGENTS.md/README/templates),
49
+ stamps `KIT-VERSION`, never touches `state/`, `planning/`, or `okf/product/`. Updates flow
50
+ one-way, PMOS → kit; review the diff as a normal PR.
51
+
52
+ ## The containment guarantee
53
+
54
+ The assembly script greps its own output and fails on any reference to the hosted PMOS backend.
55
+ Nothing in this folder phones home; the AGENTS.md protocol forbids connecting sessions from this
56
+ repo to any personal PMOS MCP. Isolation is the point.
@@ -0,0 +1,83 @@
1
+ ---
2
+ type: Concept
3
+ title: The Agent Harness
4
+ description: Everything wrapping the model that lets it finish work — and the Summary Gate, the input gate that compresses prior-session context into essential state.
5
+ tags: [harness, agent, context, summary-gate, architecture]
6
+ timestamp: 2026-06-28
7
+ ---
8
+
9
+ # The Agent Harness
10
+
11
+ **Situating context:** PMOS's deliverables are not application code — they are harness. This concept
12
+ names what a harness is and introduces the **Summary Gate**, the pattern that explains why PMOS's
13
+ structured artifacts beat raw context compaction. It informs AGENTS.md, the OKF bundle's role, and
14
+ the [control plane](/okf/core/concepts/control-plane.md) identity.
15
+
16
+ ## Agent = Model + Harness
17
+
18
+ A model on its own predicts tokens. An **agent** finishes work. The difference is the **harness**:
19
+ everything wrapping the model that lets a run complete.
20
+
21
+ The harness includes:
22
+
23
+ - **Instructions / rule files** — CLAUDE.md, AGENTS.md, DECISIONS.md, PRINCIPLES.md.
24
+ - **Knowledge** — the [OKF bundle](/okf/core/concepts/okf-governance.md): concepts, templates,
25
+ playbooks.
26
+ - **Skills** — procedural competence loaded on demand
27
+ ([SKILL-FORMAT](/skills/core/SKILL-FORMAT.md)).
28
+ - **Tools / MCP** — the [ACI surface](/build-skills/MCP-SPEC.md) the agent acts through.
29
+ - **Sandboxes** — where work runs safely.
30
+ - **Orchestration** — sequencing, concurrency, routing.
31
+ - **Guardrails** — the [three-tier eval gate](/okf/core/concepts/output-eval.md), kill conditions.
32
+ - **Observability** — `agent_runs`, [discoveries.md](/discoveries.md), transcript review.
33
+
34
+ **PMOS builds the harness, not the app.** Improving any harness element improves every future run —
35
+ that is the leverage the [control plane](/okf/core/concepts/control-plane.md) exists to capture.
36
+
37
+ ## The Summary Gate
38
+
39
+ > **Summary Gate:** PMOS's OKF bundle + SKILL.md + AGENTS.md constitute a *Summary Gate* — an input
40
+ > gate that compresses prior-session context into essential state before a new agent session begins.
41
+
42
+ A model's context window is finite and a project's history is not. Something has to decide what
43
+ crosses from "everything that happened" into "what the next session actually needs." That decider is
44
+ the Summary Gate.
45
+
46
+ ### What it does
47
+
48
+ - **Compresses** prior-session context into essential state: the decisions, the knowledge, the
49
+ contracts — not the transcript.
50
+ - **Extracts key decisions and discards intermediate reasoning.** The *conclusion* ("we decided X
51
+ because Y") crosses the gate; the deliberation that produced it does not.
52
+ - **Prevents context pollution** — stops the next session from inheriting stale, contradictory, or
53
+ irrelevant intermediate state that would degrade its judgment.
54
+
55
+ ### Why structured handoff beats raw compaction
56
+
57
+ Raw context compaction (summarizing a transcript) preserves *narrative* — it keeps a lossy trace of
58
+ what was said. A Summary Gate preserves *state* — it keeps the durable decisions and knowledge in
59
+ purpose-built artifacts (OKF concepts, skills, AGENTS.md) that are authored to be read fresh.
60
+
61
+ A new session reading a hand-authored decision record starts from clean, intentional state. A new
62
+ session reading a compacted transcript starts from a blurry recollection of a conversation. **This
63
+ is why PMOS invests in structured handoff artifacts instead of relying on context compaction** — the
64
+ artifacts *are* the gate, and they are designed to survive the session boundary intact.
65
+
66
+ ## Optimal altitude
67
+
68
+ Harness instructions must be written at **optimal altitude**: concrete heuristics that guide
69
+ behavior, not a brittle if-else rules engine, and not a vague mandate that assumes shared context.
70
+ Too low and the harness is rigid and breaks on the first unforeseen case; too high and it gives no
71
+ real guidance. AGENTS.md and every skill body are held to this standard.
72
+
73
+ ## Relationship to autonomy and drift
74
+
75
+ The harness is what makes higher [autonomy](/okf/core/concepts/output-eval.md) safe: the better the
76
+ guardrails, observability, and Summary Gate, the longer an agent can run unattended without producing
77
+ [silent drift](/okf/core/concepts/watermelon-flag.md). Harness quality and safe autonomy rise
78
+ together — which is why the quarterly harness assumption review exists.
79
+
80
+ The harness also **improves from its own runs**: evals, friction, and calibration data are evidence for
81
+ the next harness edit. See [self-refining-harness](/okf/core/concepts/self-refining-harness.md) — the
82
+ detect → draft → PM-gate loop that turns run evidence into harness edits, bounded at L3 so it never
83
+ becomes L4 self-mutation.
@@ -0,0 +1,61 @@
1
+ ---
2
+ type: Concept
3
+ title: The Control Plane
4
+ description: What it means for PMOS to be a control plane — it orchestrates, specs, evaluates, and routes agent work rather than generating production code itself.
5
+ tags: [control-plane, architecture, orchestration, identity]
6
+ timestamp: 2026-06-28
7
+ ---
8
+
9
+ # The Control Plane
10
+
11
+ **Situating context:** "PMOS is a control plane, not a code generator" is the load-bearing identity
12
+ claim of the whole product, and it is easy to forget mid-build. This concept fixes what that claim
13
+ means so design decisions stay on the right side of the line. It informs every artifact: if a thing
14
+ generates production app code, it is not PMOS's job.
15
+
16
+ ## Control plane vs. data plane
17
+
18
+ The term is borrowed deliberately. In systems architecture:
19
+
20
+ - The **data plane** does the work — moves the packets, serves the requests, *generates the code*.
21
+ - The **control plane** decides what the data plane should do — configures, schedules, routes,
22
+ observes, governs.
23
+
24
+ **PMOS is the control plane. The coding agents are the data plane.** PMOS orchestrates, specs,
25
+ evaluates, and routes agent work; it does **not** itself generate production application code. The
26
+ thing PMOS controls is the [agent harness](/okf/core/concepts/agent-harness.md), not the end app.
27
+
28
+ ## What the control plane actually does
29
+
30
+ PMOS's four control-plane functions map onto the [SDLC loop](/okf/core/concepts/sdlc-loop.md):
31
+
32
+ 1. **Spec** — turn intent into a contract: PRDs, pre-run contracts, done-criteria. The control plane
33
+ says *what* should be built and *why*.
34
+ 2. **Evaluate** — judge what came back through the
35
+ [three-tier gate](/okf/core/concepts/output-eval.md). The control plane decides whether output is
36
+ acceptable.
37
+ 3. **Route** — direct work to the right agent, skill, and OKF context; escalate to the human when
38
+ needed. The control plane decides *who/what* does the work.
39
+ 4. **Orchestrate** — sequence runs, manage concurrency, close the loop by writing knowledge back.
40
+ The control plane decides *when* and *in what order*.
41
+
42
+ Notice what is absent: *writing the application*. That is the data plane's job.
43
+
44
+ ## Why the distinction is load-bearing
45
+
46
+ If PMOS starts generating production code, it stops being a control plane and becomes just another
47
+ code generator — and it loses the leverage that makes it valuable. The control plane's power is that
48
+ it improves the **harness** (instructions, skills, gates, OKF knowledge), and a better harness
49
+ improves *every* agent run, not one feature. Conflating the planes collapses that leverage:
50
+
51
+ - Keep PMOS's outputs at the control altitude — specs, rubrics, routing decisions, knowledge.
52
+ - Push code generation down to agents operating inside the harness PMOS defines.
53
+ - When a proposed PMOS feature would emit production app code, that is the signal it belongs in the
54
+ data plane, not here.
55
+
56
+ ## Relationship to the harness
57
+
58
+ The control plane *controls* the harness; the harness *wraps* the model so a run can finish. PMOS's
59
+ deliverables — OKF bundle, skills, AGENTS.md, eval gates — **are** the harness configuration. See
60
+ [agent-harness](/okf/core/concepts/agent-harness.md) for what the harness contains and the
61
+ **Summary Gate** that compresses context into it between sessions.
@@ -0,0 +1,117 @@
1
+ ---
2
+ type: Concept
3
+ title: The Design Loop
4
+ description: How a PM runs UI/UX design as a first-class, repeatable, product-scoped sub-flow of the Build stage — brief → design → reconcile → build → design-sync — gated by the Review Gate, presentation-only, never a data decision. PMOS's own app is one instance.
5
+ tags: [design, ui, workflow, build, reconciliation, watermelon]
6
+ timestamp: 2026-07-01
7
+ ---
8
+
9
+ # The Design Loop
10
+
11
+ **Situating context:** Any product a PM runs through PMOS may have a user-facing surface that needs UI/UX
12
+ design. That design was an out-of-band activity — a brief handed to claude.ai/design, an ad-hoc
13
+ reconciliation, a build, a sync back — never named as a loop, never made a skill, never gated. This concept
14
+ names that loop **product-agnostically** (PMOS's own `web/` control-plane app is one instance — see
15
+ [Per-product instances](#per-product-instances-pmos-and-tenants) below), so the
16
+ [intake checklist](/planning/prd/initiative-intake-checklist.md), the skills, and [AGENTS.md](/AGENTS.md) all
17
+ refer to one thing. **The load-bearing claim: design is a sub-flow of the
18
+ [Build stage](/okf/core/concepts/sdlc-loop.md) (stage 3), not a new lifecycle stage.** It informs any
19
+ initiative that adds or changes a user-facing surface.
20
+
21
+ ## The loop
22
+
23
+ An initiative with a user-facing surface runs four legs *inside* Build:
24
+
25
+ ```
26
+ 1. BRIEF ──────► 2. DESIGN ────────► 3. RECONCILE + BUILD ──────► 4. DESIGN-SYNC
27
+ (design-brief (claude.ai/design, (design-reconcile gate, (/design-sync skill:
28
+ skill) external) then the design-system export the real web/
29
+ build, web-ci) library back)
30
+ ```
31
+
32
+ 1. **Brief** — the [design-brief skill](/skills/core/design-brief.skill) writes the context handoff: what
33
+ to design and the hard, presentation-only constraints, each surface tied to a real data source. It is to
34
+ design what the [PRD](/skills/core/prd.skill) is to build.
35
+ 2. **Design** — the design is made in claude.ai/design (external to this repo).
36
+ 3. **Reconcile + build** — the [design-reconcile skill](/skills/core/design-reconcile.skill) classifies
37
+ every surface against **the product's capability ledger** and the PM signs off before any code; then the
38
+ design is built into the product's app on its design system, verified by the product's CI. (For PMOS's own
39
+ app the ledger is [web-capability-ledger.md](/planning/web-capability-ledger.md), the system is D38, and
40
+ CI is `web-ci`.)
41
+ 4. **Design-sync** — the external `/design-sync` Claude Code skill exports the now-real component library back
42
+ to claude.ai/design (for PMOS, see [.design-sync/conventions.md](/.design-sync/conventions.md)), so the
43
+ next design starts from the product's actual parts.
44
+
45
+ Legs 2 and 4 are external tools PMOS *references*; legs 1 and 3 are the PMOS skills that make the loop
46
+ repeatable.
47
+
48
+ ## Presentation-only is the load-bearing constraint
49
+
50
+ Design is **behavior-preserving**: no new views, no new data, no changed flows — presentation only. If a
51
+ design implies a data or feature change, it is **flagged back as a separate decision**, never smuggled into
52
+ the build. This is what keeps design at [control altitude](/okf/core/concepts/control-plane.md) and stops it
53
+ from becoming a backdoor for architecture the PM never decided.
54
+
55
+ ## Reconciliation is the watermelon defense for UI
56
+
57
+ Leg 3's classification — **Supported** (maps to a real read/write) / **Cosmetic** (pure presentation, free)
58
+ / **Available-unsurfaced** (data exists, opt-in) / **Unsupported** (no backend) — is the
59
+ [watermelon-flag](/okf/core/concepts/watermelon-flag.md) concept applied to a design. A control that *looks*
60
+ functional with no backend behind it is **watermelon-UI**: green on the surface, hollow underneath. The
61
+ canonical instance is a Routing screen offering provider connections and API-key fields when PMOS has no
62
+ connections table and must never hold API keys client-side. Reconciliation catches these before any code;
63
+ the PM signs off the Unsupported dispositions as an [Acceptance-Gate](/okf/core/concepts/output-eval.md) call.
64
+
65
+ ## Where design meets the three-tier gate
66
+
67
+ Design is judged by the standard [three-tier gate](/okf/core/concepts/output-eval.md), not a bespoke one:
68
+
69
+ - **Quality Gate** — the product's CI (build/lint; `web-ci` for PMOS's own app) and token-hygiene checks (no raw hex where a semantic token exists).
70
+ - **Review Gate** — the reusable [design-fidelity rubric](/planning/evals/design-fidelity-eval-rubric.md):
71
+ weighted dimensions led by *capability-honesty / no-watermelon-UI*, then token-adherence, accessibility
72
+ (not color alone), information density, interaction clarity, behavior-preservation. The rubric *is* the
73
+ design spec ([eval-driven PM](/okf/core/concepts/eval-driven-pm.md)).
74
+ - **Acceptance Gate** — the PM confirms visual parity and honors the reconciliation dispositions. Non-delegable.
75
+
76
+ ## Why a sub-flow of Build, not a new stage
77
+
78
+ Design changes no world-state of an initiative independent of building — by its own presentation-only charter
79
+ it is *how a surface being built looks*. Giving it a board column would imply a parallel lifecycle, force a
80
+ data-model change to the stage machinery, and contradict the charter. PMOS makes a capability first-class by
81
+ making it **retrievable, repeatable, and gated** (this concept + the two skills + the rubric), not by adding a
82
+ swimlane — the same move that self-hosted the eval layer. (If design-approval and build-start ever decouple in
83
+ time such that the board hides real "designed-but-not-built" state, the lighter first step is a `specs` row of
84
+ `kind:'design'` in the board drawer — still no new stage. Recorded as the revisit trigger in D48.)
85
+
86
+ ## Per-product instances (PMOS and tenants)
87
+
88
+ The loop is a **method**; PMOS's own app is just its first instance. What is **shared** vs **per-product** (D50):
89
+
90
+ - **Shared, authored once, read by every PM** — this concept, the [design-brief](/skills/core/design-brief.skill)
91
+ and [design-reconcile](/skills/core/design-reconcile.skill) skills, the
92
+ [design-brief template](/okf/core/templates/design-brief-template.md), and the **generic dimensions** of the
93
+ [design-fidelity rubric](/planning/evals/design-fidelity-eval-rubric.md). These live in PMOS-self's knowledge
94
+ and are already reachable by tenants (repo-managed OKF rows are shared-read, D37; the `skills` table is
95
+ select-all).
96
+ - **Per-product, authored by each tenant** — its **capability ledger** (reconciliation checks a design against
97
+ *that* product's real reads/writes), its **design system** (chosen at the product's IRS gate, D46 — not
98
+ PMOS's D38), and its **brief + fidelity-rubric instance** (the generic dimensions plus the product's own
99
+ tokens/surfaces).
100
+ - **Where the build runs** — **leg-3 build executes in the product's own repo** (D46): PMOS creates the shell
101
+ and holds the spec (brief), the reconcile gate, and the rubric; it does not build the tenant's app
102
+ ([control plane](/okf/core/concepts/control-plane.md), D01).
103
+
104
+ PMOS's own instance: the `web/` app, the [D38](/okf/products/pmos/adr/d38-design-system.md) design system, and
105
+ [web-capability-ledger.md](/planning/web-capability-ledger.md).
106
+
107
+ ## Relationship to other concepts
108
+
109
+ - Design is a sub-flow of the [SDLC loop](/okf/core/concepts/sdlc-loop.md)'s Build stage.
110
+ - It is gated by the [three-tier gate](/okf/core/concepts/output-eval.md) and run in an
111
+ [eval-driven](/okf/core/concepts/eval-driven-pm.md) style (the fidelity rubric before the build).
112
+ - Reconciliation is [watermelon-flag](/okf/core/concepts/watermelon-flag.md) applied to UI.
113
+ - PMOS stays a [control plane](/okf/core/concepts/control-plane.md): it specs and evaluates design; the design
114
+ itself is made in claude.ai/design and built by a build agent.
115
+ - Formalized by [D48](/okf/products/pmos/adr/d48-design-loop.md); made product-scoped by
116
+ [D50](/okf/products/pmos/adr/d50-design-loop-product-scoped.md); composes with the design *system* (D38,
117
+ PMOS's own instance).