Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 100 additions & 8 deletions .claude/commands/own/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,20 @@ Check `.claude/ownyourcode-manifest.json` for profile settings:

## The SDD Philosophy

> "Spec first, code second. But YOU write the code."

Unlike other SDD tools where AI writes code, OwnYourCode uses SDD for PLANNING only.
The implementation phase is where the junior learns by doing.
> "Spec first, code second. But YOU own the judgment behind every line."

OwnYourCode uses SDD for planning, then builds with ownership — not by handing the
junior a finished feature to read. **How "build" works depends on profile:**
- **Junior profile** → Phase 6 runs the Implementation Loop: the junior predicts the
judgment for each task *before* the AI reveals the code, then gets graded on the
prediction. They own the code by being able to evaluate it, not by transcribing it.
- **Other profiles (v1)** → the loop is **not yet wired** for them; SDD stops at the spec
and implementation happens however that developer ships.
> **Deliberate v1 scoping, not a permanent exclusion.** The loop is built for the Junior
> profile first. **Interview Prep** is the strongest candidate to get it next — defending
> judgment in a live review is exactly what predict-before-reveal trains — with **Career
> Switcher** (rebuilding fundamentals) close behind. A future PR can extend Phase 6 to
> those profiles without contradicting this copy.

---

Expand Down Expand Up @@ -294,8 +304,9 @@ Please review. You should:
3. Tell me anything that doesn't match your vision (I'll change it)

When ready:
- Run /own:advise to prepare for implementation
- Then /own:guide to start the first task
- **Junior profile:** we go straight into building — Phase 6 runs the Implementation
Loop here, task by task. (No need to run /own:guide; the gym is built in.)
- **Other profiles:** run /own:advise to prepare, then implement your way.
```

---
Expand All @@ -322,12 +333,92 @@ Options:
```

Based on response:
- **Looks good:** Finalize and move to implementation
- **Looks good:** Finalize, then proceed to Phase 6 (Junior) or end (other profiles)
- **Add/Modify:** Make changes, regenerate summary
- **Read first:** End command, let them review

---

### Phase 6: The Implementation Loop (JUNIOR PROFILE ONLY)

**⚠️ Profile Check:** Read `.claude/ownyourcode-manifest.json`.
- If `profile.type = "junior"` → run this phase. The command builds the feature
task-by-task through Predict → Reveal → Judge.
- All other profiles → **skip Phase 6 (v1).** End the command after Phase 5 with the
usual "now implement" handoff. The loop is wired for Junior first by deliberate v1
scoping — **Interview Prep** and **Career Switcher** are the intended next profiles,
not permanent exclusions (see "The SDD Philosophy" above).

> **Authority:** the full loop mechanics, prediction prompt, rubric, grounding
> guard, and anti-sycophancy rule live in `profiles/junior.md` → "The Implementation
> Loop". This phase is the *trigger and bookkeeping*; that profile section is the
> *behavior*. If they disagree, the profile wins.

**Why this lives in `/own:feature` and not `/own:guide`:** the loop must be a HARD
gate. `/own:guide` is optional and rarely run; juniors would skip it and lose the
mechanism. Because `/own:feature` runs Phase 6 inline, the gate can't be bypassed.
Comment thread
DanielPodolsky marked this conversation as resolved.

**The loop:**

1. **Read the tasks** just written to the phase's `tasks[]`. Identify the
`Implementation`-group tasks (these gate) vs. `Setup` / `Verification` (these flow).

1b. **Read the Prediction Scorecard** in `~/ownyourcode/learning/LEARNING_REGISTRY.md`
and compute each dimension's **fade state** (see `junior.md` → "Adaptive Fading"):
count consecutive trailing `MATCH`es per dimension (approach / data structure /
control flow / edge cases). A dimension with **≥4 consecutive MATCHes is Faded**;
otherwise it is **Gated**. If the file/section is missing, treat all dimensions as
Gated (default). This decides which dimensions each task will actually ask for.
Also compute **staleness** per Faded dimension: how many logged tasks since it was
last graded. A Faded dimension that is **≥5 tasks stale** is re-asked once this phase
(the deterministic staleness nudge) — a `MISS` snaps it back to Gated, a `MATCH`
resets its staleness.

2. **For each task, in order:**
- **Setup / Verification task** → implement it directly, no prediction gate.
(Scaffolding and test-running carry no design judgment.)
- **Implementation task** → run the gate **on the still-Gated dimensions only**:
1. **PREDICT** — present the prediction prompt for **only the Gated dimensions**
(free-text, N/A-with-reason allowed). Faded dimensions are NOT asked. Do not
proceed until the Gated ones are answered with specifics; bounce vague answers.
(If ALL four are Faded, treat the task like Setup: build + spot-check, no gate.)
2. **GATE** — no committed prediction → no code. Don't cave to "just show me."
3. **REVEAL** — write the actual production code for that task.
4. **JUDGE** — grade the **predicted (Gated)** dimensions on the rubric
(MATCH/PARTIAL/MISS), name the specific gap, ground it (Context7 for authority,
Octocode for prevalence — cite *why*, not just *that it's common*). For **Faded**
dimensions, do a lightweight **spot-check**: state what you did and flag if they'd
likely have missed it. Snap-back to Gated happens on a `MISS` when a faded
dimension was re-asked — either by the **deterministic staleness nudge** (step 1b)
or because this was a notably complex/high-stakes task.
5. **OWN** — have them **explain *why* the actual approach is better and *where their
prediction's logic broke***, not just acknowledge the gap (the self-explanation
step — see `junior.md` → OWN). Push past a vague "yeah I missed that" to the causal
*why*; that reconstruction is the ownership evidence `/own:done` Gate 1 consumes.

3. **Record** each Implementation task's verdicts to the **Prediction Scorecard** in
`~/ownyourcode/learning/LEARNING_REGISTRY.md`, and add every `MISS` to that file's
**Failures (Anti-Patterns)** table. (See that file for the row formats.)

4. **Mark tasks `done`** as they're completed (flip `done: true` in `dashboard-data.js`
by exact-id match — same mechanism `/own:done` uses; re-validate with
`node --check`).

5. **Close out:**
```
✅ Phase [n] built — [x] Implementation tasks, [y] predictions logged.

Your judgment scorecard this phase:
• Approach: [M/P/MISS tally]
• Data structure: [M/P/MISS tally]
• Control flow: [M/P/MISS tally]
• Edge cases: [M/P/MISS tally]

When you're ready to verify ownership and ship, run /own:done.
```

---

## Generated Output (write into the phase object)

You do NOT create `spec.md` / `design.md` / `tasks.md` files. You **mutate the
Expand Down Expand Up @@ -422,7 +513,8 @@ detected phase object** inside `ownyourcode/dashboard/dashboard-data.js`:

## Important Notes

1. **AI generates, junior reviews** — This is the SDD model
1. **AI generates the spec, junior reviews** — the SDD planning model. (Implementation
is different for juniors: Phase 6's loop has them *predict before* the reveal.)
2. **Keep specs lean** — Verbose specs amplify confusion, not clarity
3. **Phases are mandatory** — Don't skip to Phase 3 before Phase 1 is done
4. **Edge cases are pre-populated** — Junior adds any we missed
Expand Down
8 changes: 4 additions & 4 deletions .claude/commands/own/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ Update `.claude/ownyourcode-manifest.json` with profile settings:

```json
{
"version": "2.6.0",
"version": "2.7.0",
"installed_at": "...",
"profile": {
"type": "junior",
Expand All @@ -639,7 +639,7 @@ Update `.claude/ownyourcode-manifest.json` with profile settings:

```json
{
"version": "2.6.0",
"version": "2.7.0",
"installed_at": "...",
"profile": {
"type": "custom",
Expand Down Expand Up @@ -1221,7 +1221,7 @@ window.PROJECT = {
audience: "[enum: myself | employers | clients | real-users]",
mission: "[the PROBLEM statement, in the user's words]",
generated:"[today YYYY-MM-DD]",
version: "2.6.0",
version: "2.7.0",
},
dod: [
{ text: "[one concrete, measurable done-criterion]", done: false },
Expand Down Expand Up @@ -1254,7 +1254,7 @@ window.PROJECT = {
| `meta.audience` | Phase 3 selection → enum: "Yourself"→`myself`, "Employers"→`employers`, "A client"→`clients`, "Real users"→`real-users` |
| `meta.mission` | Phase 2 problem statement (the *why*, in their words) |
| `meta.generated` | Today, `YYYY-MM-DD` |
| `meta.version` | Literal `2.6.0` |
| `meta.version` | Literal `2.7.0` |
| `dod[]` | Phase 4 Definition-of-Done items, each `done:false` |
| `stack[]` | Phase 5 stack + Phase 5.1 MCP-verified versions, as 5-tuples |
| `phases[]` | Phase 5.5 collaborative roadmap — each `status:"roadmap-only"` with `items:[…]`, NO `spec`/`design`/`tasks` (those come from `/own:feature`) |
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 2.7.0

- Reworked the Junior profile from "hand-type every line" to **predict-before-reveal**: on each implementation task the junior commits a prediction (approach, data structure, control flow, edge cases) *before* the AI writes the code, then the AI grades the prediction against a rubric and names the specific gap — ownership shifts from typing the code to being able to evaluate it
- The predict-before-reveal loop runs inline as a new `/own:feature` **Phase 6** (Junior profile only) so the gate can't be skipped; only judgment-carrying Implementation tasks gate, while Setup and Verification tasks flow
- Added a per-dimension **Prediction Scorecard** to the global learning registry that logs MATCH/PARTIAL/MISS over time, turning "is the junior's judgment improving?" into a measurable curve
- Added **adaptive fading**: the prediction gate relaxes per-dimension as the junior proves the skill (4 consecutive matches retires a dimension to a spot-check), with a deterministic staleness re-check so a faded-but-rusty dimension re-engages on its own — the gym never decays into a rubber-stamp tax
- The Junior `OWN` step now requires a self-explanation (why the actual approach is better and where the prediction broke), feeding `/own:done` Gate 1 with real ownership evidence
- Added `docs/research/junior-profile-predict-before-reveal-validation.md` — the redesign validated against learning-science literature and real-world industry practice, with prioritized refinements
- `/own:guide` is no longer the primary implementation path for juniors; it remains available for ad-hoc help (README and command docs updated to match)

## 2.6.0

- Added a boot sequence — a terminal window types your live project status (phases, task counts) on load; any key skips it, `prefers-reduced-motion` bypasses it, `#noboot` disables it
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</p>

<p align="center">
<sub>v2.6.0 · MIT License</sub>
<sub>v2.7.0 · MIT License</sub>
</p>

---
Expand Down Expand Up @@ -102,13 +102,15 @@ Learnings compound across projects. Patterns that worked. Mistakes you won't rep
| Command | Purpose |
| -------------- | ---------------------------------- |
| `/own:init` | Set your profile, stack, and goals |
| `/own:feature` | Plan with spec-driven development |
| `/own:feature` | Plan with spec-driven development — and, for the Junior profile, build it via the predict-before-reveal loop (Phase 6) |
| `/own:advise` | Query past learnings before starting |
| `/own:guide` | Get implementation guidance |
| `/own:guide` | Optional implementation help (for the Junior profile the gym now runs inline in `/own:feature` Phase 6) |
| `/own:stuck` | Debug systematically |
| `/own:done` | Complete with gates + code review |
| `/own:retro` | Capture learnings |

> **Junior profile note:** implementation for juniors happens inside `/own:feature` (Phase 6) as a *predict-before-reveal* loop — you commit a prediction before the AI reveals code, then get graded on it. `/own:guide` remains available for ad-hoc help but is no longer the primary path to writing code.

### Utilities

| Command | Purpose |
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dashboard-data.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ window.PROJECT = {
audience: "myself",
mission: "This dashboard is empty. Run /own:init in Claude Code to define your project's mission, stack, and roadmap — then /own:feature to spec your first phase.",
generated: "—",
version: "2.6.0",
version: "2.7.0",
},
dod: [], // Definition-of-Done items: { text, done }
stack: [], // 5-tuple rows: [layer, tech, version, source, purpose]
Expand Down
Loading