@jualopezmo/codeforge 0.4.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 (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +368 -0
  3. package/VERSION +1 -0
  4. package/bin/codeforge.mjs +64 -0
  5. package/install.ps1 +317 -0
  6. package/install.sh +326 -0
  7. package/package.json +39 -0
  8. package/src/CLAUDE.md +88 -0
  9. package/src/CONTINUITY.template.md +16 -0
  10. package/src/PROJECT.template.md +27 -0
  11. package/src/configs/claude/settings.json +6 -0
  12. package/src/configs/codex/config.toml +17 -0
  13. package/src/configs/opencode.json +14 -0
  14. package/src/docs/CHANGELOG.md +9 -0
  15. package/src/docs/adr/.gitkeep +0 -0
  16. package/src/docs/e2e/reports/.gitkeep +0 -0
  17. package/src/docs/e2e/use-cases/.gitkeep +0 -0
  18. package/src/docs/extending.md +134 -0
  19. package/src/docs/plans/.gitkeep +0 -0
  20. package/src/docs/prds/.gitkeep +0 -0
  21. package/src/docs/research/.gitkeep +0 -0
  22. package/src/docs/solutions/.gitkeep +0 -0
  23. package/src/shared/rules/approach-comparison.md +29 -0
  24. package/src/shared/rules/continuity.md +32 -0
  25. package/src/shared/rules/docs-layout.md +23 -0
  26. package/src/shared/rules/memory.md +34 -0
  27. package/src/shared/rules/models.md +59 -0
  28. package/src/shared/rules/project-rules.md +31 -0
  29. package/src/shared/rules/research.md +30 -0
  30. package/src/shared/rules/severity.md +17 -0
  31. package/src/shared/rules/ship-gates.md +164 -0
  32. package/src/shared/rules/tdd.md +20 -0
  33. package/src/shared/rules/workflow.md +38 -0
  34. package/src/shared/scripts/check-gates.ps1 +197 -0
  35. package/src/shared/scripts/check-gates.sh +201 -0
  36. package/src/shared/scripts/claude-gate-hook.ps1 +35 -0
  37. package/src/shared/scripts/claude-gate-hook.sh +43 -0
  38. package/src/shared/state.template.md +33 -0
  39. package/src/skills/adr/SKILL.md +63 -0
  40. package/src/skills/checkpoint/SKILL.md +50 -0
  41. package/src/skills/council/SKILL.md +87 -0
  42. package/src/skills/finish-branch/SKILL.md +85 -0
  43. package/src/skills/fix-bug/SKILL.md +84 -0
  44. package/src/skills/index/SKILL.md +52 -0
  45. package/src/skills/new-feature/SKILL.md +84 -0
  46. package/src/skills/plan/SKILL.md +63 -0
  47. package/src/skills/prd/SKILL.md +62 -0
  48. package/src/skills/quick-fix/SKILL.md +60 -0
  49. package/src/skills/research/SKILL.md +61 -0
  50. package/src/skills/review/SKILL.md +66 -0
  51. package/src/skills/simplify/SKILL.md +59 -0
  52. package/src/skills/verify-e2e/SKILL.md +102 -0
  53. package/src/sync.ps1 +69 -0
  54. package/src/sync.sh +69 -0
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@jualopezmo/codeforge",
3
+ "version": "0.4.0",
4
+ "description": "Install one cross-engine AI-coding workflow discipline (research → plan → TDD → cross-engine review → verify → ship) into a project — runs identically on Claude Code, Codex, and OpenCode. Also hosts the framework's own dev tooling (skill linter, routing evals).",
5
+ "bin": {
6
+ "codeforge": "bin/codeforge.mjs"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "src/",
11
+ "install.sh",
12
+ "install.ps1",
13
+ "VERSION",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "lint:skills": "node tools/lint-skills.mjs",
19
+ "eval:routing": "node tools/run-evals.mjs",
20
+ "test:tools": "node --test",
21
+ "check": "npm run lint:skills && npm run eval:routing && npm run test:tools"
22
+ },
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/Juan-Motta/codeforge.git"
30
+ },
31
+ "keywords": [
32
+ "claude-code",
33
+ "codex",
34
+ "opencode",
35
+ "ai-agents",
36
+ "agent-skills",
37
+ "workflow"
38
+ ]
39
+ }
package/src/CLAUDE.md ADDED
@@ -0,0 +1,88 @@
1
+ # Workflow discipline for Claude Code, Codex + OpenCode
2
+
3
+ > This file is the always-on instruction set. `AGENTS.md` is a generated copy of it, so
4
+ > **Claude Code** (reads `CLAUDE.md`), **Codex** (reads `AGENTS.md`), and **OpenCode**
5
+ > (reads `AGENTS.md`, falls back to `CLAUDE.md`) all load the exact same discipline — no
6
+ > symlinks, no drift. Both are generated from the codeforge source; to change the discipline,
7
+ > edit the source there and re-run the codeforge installer against this project (don't
8
+ > hand-edit `CLAUDE.md`/`AGENTS.md` here — a re-install overwrites them).
9
+
10
+ ## What this is
11
+
12
+ A lightweight, **skills-and-config-only** workflow system. It's **discipline, not a hard
13
+ gate**: you follow the instructions (advisory), plus each engine shows a **best-effort
14
+ native prompt** on outward actions (push / PR) that the human confirms — it reads no gate
15
+ state and is bypassable. It runs identically under Claude Code, Codex, and OpenCode.
16
+
17
+ ## Golden rules (always apply)
18
+
19
+ - **Resume from continuity.** At the start of each session, read `CONTINUITY.md` first and
20
+ continue from its **Next step** before anything else; if it names an active workflow,
21
+ open that `.workflow/state.md` too. See `shared/rules/continuity.md`.
22
+ - **Load project rules.** Also read `PROJECT.md` — this project's persona, info,
23
+ variables, and special rules. It **adds** to these global rules and **should not**
24
+ override the safety/ship-gate baseline (advisory — nothing enforces this). See
25
+ `shared/rules/project-rules.md`.
26
+ - **Never work on `main`.** Create a branch before changing code.
27
+ - **Pick the right workflow skill** for the task (see index below) and follow it.
28
+ - **`.workflow/state.md` is the source of truth** for the active workflow: its checklist
29
+ gates shipping. Keep it updated as you progress. If it doesn't exist for the current
30
+ task, start from `shared/state.template.md`.
31
+ - **Do not ship until the gates pass.** Before `git commit` / `git push` /
32
+ `gh pr create`, every required box in `.workflow/state.md` must be checked. See
33
+ `shared/rules/ship-gates.md`.
34
+ - **Challenge, don't flatter.** Push back on weak ideas; verify claims against the code.
35
+ - **Ground your claims.** State what you verified vs. inferred; cite `file:line`.
36
+ - **Capture learnings.** Save reusable solutions/decisions to the repo `docs/` (portable
37
+ memory) — see `shared/rules/memory.md` and `shared/rules/docs-layout.md`.
38
+
39
+ ## Workflow skills (canonical in `skills/`, discovered by all three harnesses)
40
+
41
+ - `prd` — write a product requirements doc (problem/users/goals) before designing
42
+ - `research` — pre-design research: check current docs + prior art, write a sourced brief
43
+ - `plan` — design step: clarify intent, compare approaches, write a reviewed plan
44
+ - `new-feature` — full feature workflow (brainstorm → plan → cross-review → TDD → review → verify → ship)
45
+ - `fix-bug` — bug fix with systematic debugging (reproduce → root cause → failing test → fix → review → verify → ship)
46
+ - `quick-fix` — trivial changes (<3 files, no behavior risk); escalate if scope grows
47
+ - `review` — cross-engine second opinion on a plan or diff (P0–P3 findings)
48
+ - `simplify` — post-green, behavior-preserving cleanup pass (reduce complexity, tests stay green)
49
+ - `verify-e2e` — execute API/CLI user-journey use cases, write an evidence report, and bind the E2E ship-gate box to it
50
+ - `council` — multi-perspective decision analysis: several engines as advisors → synthesized verdict + minority report (for hard, expensive forks)
51
+ - `adr` — record an architecture decision (context, alternatives, consequences) → `docs/adr/`
52
+ - `finish-branch` — close out a branch: confirm gates → final verify → commit → push → PR
53
+ - `checkpoint` — write a clean session handoff to `CONTINUITY.md` before closing / context reset
54
+ - `index` — generate/refresh `docs/index.md`, a high-level project map for fast orientation
55
+
56
+ ## Discipline reference (`shared/rules/`)
57
+
58
+ - `workflow.md` — when to use which skill; the phases
59
+ - `severity.md` — P0–P3 rubric for review findings
60
+ - `ship-gates.md` — what must be true before commit/push/PR, and how each harness gates it
61
+ - `tdd.md` — red-green-refactor discipline
62
+ - `research.md` — when to research and what a good brief contains
63
+ - `approach-comparison.md` — fixed-axes table for choosing an approach
64
+ - `memory.md` — what to save and where (repo-first, portable across engines)
65
+ - `docs-layout.md` — where each artifact lives (`docs/prds|plans|research|solutions|adr`, `CHANGELOG.md`)
66
+ - `continuity.md` — session handoff via `CONTINUITY.md`; how to resume on a new session
67
+ - `models.md` — default model per role (research/review/council); reviewer ≠ driver
68
+ - `project-rules.md` — how per-project `PROJECT.md` layers on the global baseline (precedence)
69
+
70
+ ## Enforcement model (read this — it's a deliberate trade)
71
+
72
+ By default there is **no hard conditional block**. The skills instruct you to run the gates
73
+ before shipping (advisory), and `finish-branch` runs `shared/scripts/check-gates.sh` — a
74
+ deterministic check of `.workflow/state.md` that fails loudly on an unchecked box (still only
75
+ when invoked). On top of that, each harness applies a **coarse native approval** on outward
76
+ actions:
77
+
78
+ - **Claude Code:** `git push` / `gh pr create` are `ask`-tier in `.claude/settings.json`
79
+ (human approves).
80
+ - **Codex:** `approval_policy` in `.codex/config.toml` requires approval before running
81
+ non-trivial shell commands.
82
+ - **OpenCode:** `permission.bash` in `opencode.json` sets `git push*` / `gh pr create*`
83
+ to `ask` (and force-push to `deny`).
84
+
85
+ None of them read `.workflow/state.md` to decide — they always ask; you approve, after
86
+ checking the gates (or running `check-gates.sh`). For real blocking on Claude Code,
87
+ `install.sh --with-hooks` adds an opt-in `PreToolUse` hook that exits 2 on incomplete gates.
88
+ A checked box is *attested*, not *verified* — see `shared/rules/ship-gates.md`.
@@ -0,0 +1,16 @@
1
+ # Continuity — session handoff
2
+
3
+ > The first thing to read on a new session (auto-loaded via `CLAUDE.md` / `AGENTS.md`).
4
+ > Keep it current; refresh it with the `checkpoint` skill before closing a session.
5
+ > Roles: this file = cross-session "where am I / what's next"; `.workflow/state.md` = the
6
+ > active workflow's checklist. Non-overlapping — this points to state.md, doesn't copy it.
7
+
8
+ - **Focus:** <what you're working on, one line>
9
+ - **Next step:** <the single next action to take on resume — an action, not "continue">
10
+ - **Blockers:** <what's stuck, or "none">
11
+ - **Active workflow:** <path to `.workflow/state.md` if one is running, else "none">
12
+ - **Updated:** <YYYY-MM-DD>
13
+
14
+ ## Handoff notes
15
+
16
+ <2–4 lines: where we are, why, and the key decisions/context the next session needs>
@@ -0,0 +1,27 @@
1
+ # Project rules
2
+
3
+ > Project-specific rules for THIS project. Always loaded alongside the global baseline
4
+ > (`CLAUDE.md` golden rules + `shared/rules/*`). These **add and refine** — they
5
+ > **should not** override the global safety rules (branch safety, ship-gate) — advisory;
6
+ > nothing enforces it. See `shared/rules/project-rules.md`.
7
+ > Copy this file to `PROJECT.md` and fill it in.
8
+
9
+ ## Persona
10
+
11
+ <How the agent should behave here: tone, stance, what to optimize for. One short paragraph.>
12
+
13
+ ## Project info
14
+
15
+ <What this project is, its stack, layout, and anything an agent needs to orient. A few lines.>
16
+
17
+ ## Variables
18
+
19
+ <Stable facts the agent should reuse: repo URL, service URLs/ports, key names, entry points.>
20
+
21
+ - `<KEY>`: `<value>`
22
+
23
+ ## Special rules
24
+
25
+ <Project-specific dos/don'ts that go beyond the global baseline. Bullet list.>
26
+
27
+ - <rule>
@@ -0,0 +1,6 @@
1
+ {
2
+ "permissions": {
3
+ "ask": ["Bash(git push:*)", "Bash(gh pr create:*)", "Bash(gh pr merge:*)"],
4
+ "deny": ["Bash(git push --force:*)", "Bash(git push -f:*)"]
5
+ }
6
+ }
@@ -0,0 +1,17 @@
1
+ # Codex-native options for codeforge (no scripts/hooks).
2
+ # Best-effort ship prompt (NOT a hard gate): on-request asks when a command crosses the
3
+ # sandbox boundary — it does NOT fire before every command, does NOT read
4
+ # .workflow/state.md, and is bypassable. See shared/rules/ship-gates.md. Check the gate
5
+ # checklist yourself before approving a push/PR.
6
+
7
+ approval_policy = "on-request"
8
+ sandbox_mode = "workspace-write"
9
+
10
+ # This file is the CANONICAL source for Codex config; ./sync.sh copies it to .codex/config.toml.
11
+ # Repo skills are generated under <repo>/.agents/skills (Codex discovers project skills there —
12
+ # NOT under .codex/skills). Sync also writes <repo>/.claude/skills (Claude Code + OpenCode).
13
+ # Discipline is loaded from AGENTS.md (a generated copy of CLAUDE.md) at the repo root.
14
+
15
+ # To harden the ship-gate into an actual command block (still no bash script), add a
16
+ # Codex execpolicy `.rules` file that requires approval specifically for
17
+ # `git push` / `gh pr create`. Left out of this first cut to keep it minimal.
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "instructions": ["PROJECT.md"],
4
+ "permission": {
5
+ "bash": {
6
+ "*": "allow",
7
+ "git push*": "ask",
8
+ "gh pr create*": "ask",
9
+ "gh pr merge*": "ask",
10
+ "git push --force*": "deny",
11
+ "git push -f*": "deny"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ Notable changes to this project, newest first — one short entry (or small block) per
4
+ shipped change. Written at ship time (the `finish-branch` skill records an entry before the
5
+ ship commit). See `shared/rules/docs-layout.md`.
6
+
7
+ ## Unreleased
8
+
9
+ - _Nothing shipped yet — the first change goes here._
File without changes
File without changes
File without changes
@@ -0,0 +1,134 @@
1
+ # Extending codeforge
2
+
3
+ How to add capability while keeping the project simple and interoperable across
4
+ **Claude Code, Codex, and OpenCode**.
5
+
6
+ ## The rule of thumb
7
+
8
+ > A **skill** can express anything the agent *should do* (an instruction). A
9
+ > **script/hook** is needed only when something must *happen regardless* — block an
10
+ > action, run outside the agent's turn, or compute deterministically without relying on
11
+ > the model to comply.
12
+
13
+ Prefer the lowest tier that does the job. Higher tiers add power but cost simplicity and
14
+ portability.
15
+
16
+ ---
17
+
18
+ ## Tier A — Skills only (advisory, fully portable)
19
+
20
+ Anything that is a *procedure or criterion*. Add these freely — no config changes; after a
21
+ `./sync.sh` all three engines pick them up automatically.
22
+
23
+ Examples:
24
+
25
+ - New workflow skills (any command/flow).
26
+ - A research step before designing ("investigate and write the brief").
27
+ - Cross-engine review ("have the other engine review this plan/diff").
28
+ - Severity rubric, TDD sequence, approach comparison, PR-description format.
29
+ - "Verify by exercising it."
30
+ - A lightweight multi-engine council (a skill that orchestrates calling several engines
31
+ and synthesizing).
32
+ - Checklists and keeping `.workflow/state.md` updated.
33
+
34
+ **Cost:** the agent does it *because instructed*. Nothing prevents non-compliance.
35
+
36
+ ### How to add a skill
37
+
38
+ 1. `mkdir skills/<name>` — the directory name must be lowercase, hyphen-separated.
39
+ 2. Create `skills/<name>/SKILL.md` (uppercase filename) with frontmatter:
40
+ ```
41
+ ---
42
+ name: <name> # must equal the directory name
43
+ description: <1–1024 chars; when to use it>
44
+ ---
45
+ ```
46
+ then the steps, referencing `shared/rules/*` and `.workflow/state.md`.
47
+ 3. Run `./sync.sh` (or `sync.ps1` on Windows). It regenerates `.claude/skills` (Claude Code +
48
+ OpenCode) and `.agents/skills` (Codex + OpenCode) from `skills/` — a full mirror (deletions
49
+ propagate), so every engine discovers the skill. No further config.
50
+
51
+ **Framework vs project-own skills:** `skills/` holds both. The installer's `--upgrade`
52
+ refreshes only the **framework's own** skills (by name) and never deletes the rest — so a
53
+ skill you add here survives upgrades. (Same for `shared/rules/`.) Give your own skills
54
+ names distinct from the framework's, or an upgrade will overwrite the collision.
55
+
56
+ ---
57
+
58
+ ## Tier B — Skills + agent-invoked scripts (deterministic, still advisory)
59
+
60
+ No hooks. A skill tells the agent to run a helper script (e.g. `scripts/check-gates.sh`).
61
+ You gain determinism and reuse; a single POSIX script serves all three engines. But it
62
+ runs **only when the agent chooses to call it**.
63
+
64
+ Good fits:
65
+
66
+ - A `.workflow/state.md` validator (are the required boxes checked?).
67
+ - A reproducible git/drift check.
68
+ - An artifact checker that *reports* (not blocks) whether a brief/evidence file exists.
69
+
70
+ **Cost:** deterministic, but still skippable — the agent may not invoke it.
71
+
72
+ Convention: keep such scripts in `scripts/`, POSIX `sh`, no engine-specific assumptions,
73
+ and have the relevant skill name the exact command to run.
74
+
75
+ ---
76
+
77
+ ## Tier C — Hooks (automatic, blocking, or out-of-turn) — NOT portable
78
+
79
+ Needed only when something must be *guaranteed* — it cannot be expressed as an
80
+ instruction. This is where interoperability breaks: each engine has a different mechanism,
81
+ so it means maintaining up to three implementations.
82
+
83
+ Capabilities that require this tier:
84
+
85
+ - **Conditional blocking** of commit/push/PR based on `.workflow/state.md` (the native
86
+ `permission` gates only do "always ask", not "block *if* gates are unmet").
87
+ - **Unbypassable evidence gate** / per-iteration clean evidence / a convergence breaker.
88
+ - **A mandatory research gate** (cannot start design until the brief exists).
89
+ - **Out-of-turn events:** per-turn phase reminder, dynamic session-start injection,
90
+ pre-compaction save, post-edit auto-format, auto-approve of local writes.
91
+
92
+ Per-engine mechanism (all can block):
93
+
94
+ | Engine | Mechanism | Block signal |
95
+ | --- | --- | --- |
96
+ | Claude Code | hooks in `.claude/settings.json` | `PreToolUse` exit code 2 |
97
+ | Codex | `hooks.json` (`$CODEX_HOME` or `<repo>/.codex/hooks.json`) | `PreToolUse` exit code 2 |
98
+ | OpenCode | plugin with `tool.execute.before` | throw to abort |
99
+
100
+ **Trade:** three separate implementations to keep in sync, plus per-engine trust/merge
101
+ concerns. Reach for it only when a real guarantee is worth that cost — and start with a single
102
+ engine. **A reference adapter ships opt-in:** `install.sh --with-hooks` (Claude Code only)
103
+ installs a `PreToolUse` hook (`shared/scripts/claude-gate-hook.sh`) that runs the same
104
+ `check-gates.sh` and exits 2 to block a ship on incomplete gates. It stays off the default
105
+ install (per-developer, gitignored `.claude/settings.local.json`) so the portable core is
106
+ unchanged; Codex/OpenCode adapters are not built yet.
107
+
108
+ ---
109
+
110
+ ## verify-e2e roadmap (v2)
111
+
112
+ Planned extensions to the `verify-e2e` skill — each is a skill/config change, no hooks
113
+ needed:
114
+
115
+ - **Playwright `.spec.ts` regression bridge:** graduate passing use cases into
116
+ deterministic, replayable spec files for CI, alongside the markdown use cases.
117
+ - **UI interface adapter:** drive browser-based use cases (today's skill covers API/CLI).
118
+ - **Automatic multi-surface coverage audit:** flag when a feature exposes UI/API/CLI
119
+ surfaces but use cases only cover a subset.
120
+
121
+ ---
122
+
123
+ ## Decision checklist
124
+
125
+ Before adding something, ask in order:
126
+
127
+ 1. Is it a procedure the agent should follow? → **Tier A** (a skill).
128
+ 2. Does it need deterministic, repeatable computation, but only when asked? → **Tier B**
129
+ (a skill that invokes a `scripts/` helper).
130
+ 3. Must it be enforced/automatic even if the agent doesn't cooperate, or run outside a
131
+ turn? → **Tier C** (hooks, per engine) — accept the portability cost, or scope to one
132
+ engine.
133
+
134
+ Default to the lowest tier that works. Most new functionality is Tier A.
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,29 @@
1
+ # Approach Comparison
2
+
3
+ Before committing to a design, compare 2–3 real alternatives on fixed axes. This forces
4
+ the tradeoffs into the open instead of defaulting to the first idea.
5
+
6
+ ## Fixed axes
7
+
8
+ Score each candidate approach (Low / Med / High, with a one-line why):
9
+
10
+ | Axis | Question |
11
+ | --- | --- |
12
+ | **Complexity** | How many moving parts / how much new code? |
13
+ | **Blast radius** | What breaks if it's wrong? How much does it touch? |
14
+ | **Reversibility** | How hard is it to undo or change later? |
15
+ | **Time to validate** | How fast can you prove it works (or fails)? |
16
+ | **Correctness/User risk** | Likelihood of a wrong result or bad UX? |
17
+
18
+ ## How to use it
19
+
20
+ 1. List 2–3 genuinely different approaches (not variations of one).
21
+ 2. Fill the table; add a one-line rationale per cell.
22
+ 3. Name the **default winner** and why. Prefer the simplest option that meets the bar
23
+ (low complexity + low blast radius + high reversibility).
24
+ 4. **Validate the default with a second opinion** (the `review` or `council` skill) before
25
+ locking it in — do not self-certify the choice.
26
+ 5. If the cheapest falsifying test is quick (say, under ~30 min), **spike it first** and
27
+ let evidence decide.
28
+
29
+ Record the table and the chosen approach in the plan / `.workflow/state.md`.
@@ -0,0 +1,32 @@
1
+ # Continuity
2
+
3
+ `CONTINUITY.md` (repo root) is the **session handoff anchor** — always present, so it's
4
+ the reliable "read this first" on any new session or after a context reset.
5
+
6
+ ## Roles (non-overlapping — no drift)
7
+
8
+ - **`CONTINUITY.md`** — cross-session state: current focus, the single Next step,
9
+ blockers, and a pointer to the active workflow. Small (a handful of lines).
10
+ - **`.workflow/state.md`** — the active workflow's checklist/gates. Only exists while a
11
+ workflow runs.
12
+
13
+ `CONTINUITY.md` **points to** `state.md`; it never duplicates it.
14
+
15
+ ## On session start
16
+
17
+ Read `CONTINUITY.md` first and resume from **Next step** before doing anything else. If it
18
+ names an active workflow, open that `.workflow/state.md` too and continue there.
19
+
20
+ ## Keeping it current
21
+
22
+ - Update it as the situation changes — especially the Next step.
23
+ - Before closing a session, or when context is getting tight, run the `checkpoint` skill to
24
+ write a clean handoff.
25
+ - Keep it tiny: focus, next step, blockers, pointer, date + a few handoff lines. Details
26
+ live in the workflow/docs, not here.
27
+
28
+ ## Caveat
29
+
30
+ Saving the handoff **automatically** right before an unexpected context compaction needs a
31
+ hook (Tier C) and is not covered here. Keep `CONTINUITY.md` current manually so any reset
32
+ point already reflects reality.
@@ -0,0 +1,23 @@
1
+ # Docs Layout
2
+
3
+ Where each artifact lives. The workflow skills write to these paths so knowledge is
4
+ findable and portable across all three engines.
5
+
6
+ | Path | Holds | Written by |
7
+ | --- | --- | --- |
8
+ | `docs/prds/<feature>.md` | Product requirements (problem, users, goals, criteria) | `prd` |
9
+ | `docs/plans/<feature>.md` | Design plan (approach, files, tests, acceptance) | `plan`, `new-feature` |
10
+ | `docs/research/<YYYY-MM-DD>-<topic>.md` | Sourced research brief | `research` |
11
+ | `docs/solutions/<slug>.md` | Solved-bug knowledge base (symptom→cause→fix) | `fix-bug` |
12
+ | `docs/adr/<NNN>-<slug>.md` | Architecture decision records | `adr` (from `plan` / `council`) |
13
+ | `docs/e2e/reports/` | verify-e2e evidence reports (committed; the ship-gate binds to these) | `verify-e2e` |
14
+ | `docs/e2e/use-cases/` | Graduated user-journey use cases (committed regression suite) | `verify-e2e` / `new-feature` / `fix-bug` |
15
+ | `docs/CHANGELOG.md` | Human-readable history of notable changes | `finish-branch` / ship |
16
+ | `docs/index.md` | High-level project map (structure, entry points, conventions) | `index` |
17
+
18
+ ## Rules
19
+
20
+ - Create the file under the right folder; the folder already exists (`.gitkeep`).
21
+ - One artifact per file; name it after the feature/topic so it's greppable.
22
+ - These are the **portable memory** of the project — see `shared/rules/memory.md`.
23
+ - Keep `docs/CHANGELOG.md` newest-first, one line or short block per shipped change.
@@ -0,0 +1,34 @@
1
+ # Memory & Learning
2
+
3
+ Capture what's worth reusing so the next session (or the next engine) doesn't relearn it.
4
+
5
+ ## What to save
6
+
7
+ When you solve a tricky bug, discover a project pattern/convention, or learn a durable
8
+ preference or constraint — write it down. Ask yourself before finishing a task:
9
+ **"Did I learn anything worth remembering?"** If yes, save it.
10
+
11
+ ## Where to save it (portable-first)
12
+
13
+ Memory has two homes; the **repo** is the portable one that all three engines share:
14
+
15
+ 1. **Durable project knowledge → the repo** (source of truth, works everywhere):
16
+ - Solved bugs → `docs/solutions/<slug>.md` (symptom, root cause, fix, how verified).
17
+ - Architecture decisions → `docs/adr/<NNN>-<slug>.md`.
18
+ - Notable changes → `docs/CHANGELOG.md`.
19
+ 2. **Personal / cross-session recall → the engine's own memory, where it has one**
20
+ (Claude Code has a persistent memory; other engines vary — do NOT assume it exists).
21
+ Use it for preferences and session continuity, but never as the *only* copy of
22
+ something the team needs.
23
+
24
+ **Save solutions twice:** a reusable fix goes to `docs/solutions/` (portable) AND the
25
+ engine's personal memory if available.
26
+
27
+ ## Rules
28
+
29
+ - Prefer the repo for anything another person or engine would need — it's the one place
30
+ all three read.
31
+ - Keep entries concise and findable (clear title, one problem each).
32
+ - Don't duplicate what the code or git history already records; save the non-obvious
33
+ *why*.
34
+ - Never store secrets in memory or docs.
@@ -0,0 +1,59 @@
1
+ # Models
2
+
3
+ Default model + effort per engine for the cross-engine roles (research, review, council).
4
+ Maintained by hand — edit this table to change defaults; the skills read from here so
5
+ model IDs live in one place, not scattered across skills.
6
+
7
+ **Principle:** the reviewer/advisor must run on a **different engine than the driver**
8
+ (model diversity is the point). The driver's own model is whatever you opened the CLI
9
+ with — not pinned by this project.
10
+
11
+ ## Per-engine defaults
12
+
13
+ | Engine | Model | Effort | Invocation |
14
+ | --- | --- | --- | --- |
15
+ | **Codex** | `gpt-5.6-sol` | `xhigh` | `codex exec -m gpt-5.6-sol -c model_reasoning_effort="xhigh" --sandbox read-only "<prompt>" < /dev/null` |
16
+ | **Claude** | `opus` | `high` | `claude -p --model opus --effort high "<prompt>"` |
17
+ | **OpenCode** | `opencode-go/glm-5.2` | default | `opencode run -m opencode-go/glm-5.2 "<prompt>"` |
18
+
19
+ Same model/effort per engine regardless of role — the role only decides **which
20
+ engine(s)** to use:
21
+
22
+ | Role | Engine(s) |
23
+ | --- | --- |
24
+ | **Driver** (implementation / TDD) | the CLI you open (not pinned) |
25
+ | **Reviewer** (design + code review) | the non-driver engine |
26
+ | **Research** (when delegated) | a non-driver, web/synthesis-capable engine |
27
+ | **Council advisors** | all three (max diversity) |
28
+
29
+ ## Running these from an agent (non-interactive)
30
+
31
+ When an **agent** (not a human at a terminal) runs these invocations through a shell tool,
32
+ stdio is not attached to a TTY. Two consequences, both fixed with flags — no wrapper or shim
33
+ needed (this stays skills + config):
34
+
35
+ - **`codex exec` blocks on stdin.** Even with the prompt passed as an argument, it prints
36
+ `Reading additional input from stdin...` and waits forever. Always redirect **`< /dev/null`**
37
+ (shown in the table) so it reads no input and proceeds.
38
+ - **A detached `codex exec` can drop its streamed stdout** ([openai/codex#19945](https://github.com/openai/codex/issues/19945)),
39
+ so the agent sees an empty result even though the run succeeded. Capture the final message to
40
+ a file with **`--output-last-message <file>`** and read that file instead of relying on
41
+ stdout. Give each parallel advisor its **own** file (e.g. `/tmp/council-<advisor>.txt`) so
42
+ concurrent `council` runs don't clobber each other.
43
+
44
+ Claude (`claude -p`) and OpenCode (`opencode run`) return their output normally in
45
+ non-interactive mode and need neither workaround.
46
+
47
+ ## Read-only for reviewers / advisors
48
+
49
+ A reviewer (`review`) or council advisor must not modify the working tree it's judging.
50
+ Invoke it read-only: Codex `--sandbox read-only`; for Claude/OpenCode restrict to
51
+ read-only (no write/edit tools). Hand it the diff/plan as text and confirm the
52
+ working-tree diff is unchanged afterward.
53
+
54
+ ## Cost note
55
+
56
+ These are quality-first defaults (top models, high effort) because review/council
57
+ decisions are where being wrong is expensive. If cost matters, downgrade here — e.g.
58
+ Codex `gpt-5.4-mini`, OpenCode `opencode-go/deepseek-v4-flash`, or a lower `--effort` /
59
+ `model_reasoning_effort` — and the skills follow automatically.
@@ -0,0 +1,31 @@
1
+ # Project Rules (layering)
2
+
3
+ Two layers of rules apply to every session, both always-on:
4
+
5
+ 1. **Global baseline** — `CLAUDE.md` golden rules + `shared/rules/*`. The framework's
6
+ discipline. Applies **always, without exception**.
7
+ 2. **Project rules** — `PROJECT.md` at the repo root (from `PROJECT.template.md`):
8
+ **Persona · Project info · Variables · Special rules**. Project-specific and editable.
9
+
10
+ ## Load order
11
+
12
+ Read `PROJECT.md` alongside the global rules at session start (golden rule). All three
13
+ engines auto-load `CLAUDE.md`/`AGENTS.md`, which points here; OpenCode also force-loads
14
+ `PROJECT.md` via `opencode.json` `instructions`.
15
+
16
+ ## Precedence (important)
17
+
18
+ - The **global safety baseline** — branch safety, the ship-gate, and anything that
19
+ prevents data loss or an unreviewed ship — **should not** be overridden by `PROJECT.md`.
20
+ Note: this is **advisory** — nothing physically enforces it, so review your own
21
+ `PROJECT.md` against `ship-gates.md` and don't write project rules that weaken safety.
22
+ - `PROJECT.md` **adds and refines**: persona/tone, project context, variables, and
23
+ special behavior.
24
+ - On a genuine conflict, treat the global safety baseline as winning; surface the conflict
25
+ rather than silently following the weaker rule.
26
+
27
+ ## Adding project rules
28
+
29
+ Copy `PROJECT.template.md` → `PROJECT.md`, fill the four sections, commit it. That's the
30
+ whole mechanism — no per-engine config needed (the golden rule + `instructions` handle
31
+ loading).
@@ -0,0 +1,30 @@
1
+ # Research
2
+
3
+ Model knowledge has a cutoff. Before designing anything that touches an external library,
4
+ API, protocol, or a problem others have already solved, **check current sources first** —
5
+ don't build on stale assumptions.
6
+
7
+ ## When research is needed
8
+
9
+ - A new or unfamiliar library / framework / API / CLI is involved.
10
+ - The behavior depends on a spec, protocol, or third-party service.
11
+ - The problem is a well-trodden one worth learning from prior art before reinventing it.
12
+
13
+ Skip it only for changes fully contained in code you already understand.
14
+
15
+ ## What a good brief contains
16
+
17
+ Write the brief to `docs/research/<YYYY-MM-DD>-<topic>.md`:
18
+
19
+ 1. **Question(s)** — what you needed to find out.
20
+ 2. **Findings** — current, sourced facts (cite the doc/URL and the date checked).
21
+ Separate verified facts from inference.
22
+ 3. **Prior art** — how established tools/products solved this, and what to borrow or avoid.
23
+ 4. **Implications for the design** — what the findings change about the approach.
24
+ 5. **Open questions** — what remains unverified and how to close it.
25
+
26
+ ## Rules
27
+
28
+ - Cite sources; never present recalled-from-memory API details as current fact.
29
+ - Prefer official docs over blog posts; note the version/date.
30
+ - The brief feeds the plan — the design must be consistent with it.
@@ -0,0 +1,17 @@
1
+ # Severity Rubric
2
+
3
+ Tag every review finding with a severity. P0/P1/P2 must be fixed before shipping; P3 is
4
+ optional.
5
+
6
+ | Level | Meaning | Action |
7
+ | --- | --- | --- |
8
+ | **P0** | Broken — will crash, lose data, or create a security hole | Fix before proceeding |
9
+ | **P1** | Wrong — incorrect behavior, logic error, missing required case | Fix before proceeding |
10
+ | **P2** | Poor — code smell, maintainability, unclear intent, missing test | Fix before proceeding |
11
+ | **P3** | Nit — style, naming, minor suggestion | May fix; does not block |
12
+
13
+ **Plan-stage note:** at the plan stage, an omission that would cause the *wrong thing to
14
+ be built* (missing required behavior or acceptance criterion) is a **P1**, not a P2.
15
+
16
+ **Review loop:** run reviewers, collect findings, fix P0/P1/P2, repeat. Exit only when a
17
+ single pass yields no P0/P1/P2 from all reviewers.