|
| 1 | +--- |
| 2 | +command: end-session |
| 3 | +description: Wrap up the work session — log decisions to DECISIONS.md, bugs to BUGS.md, findings + a dated narrative to ROADMAP.md (in the sibling rn-dev-agent-workspace), then run a git/changeset hygiene check. Appends only; never deletes or rewrites existing entries; never commits. |
| 4 | +argument-hint: [optional focus or extra notes to weave in] |
| 5 | +allowed-tools: Bash, Read, Edit, Grep, Glob |
| 6 | +--- |
| 7 | + |
| 8 | +# /end-session — session wrap-up |
| 9 | + |
| 10 | +A maintainer ritual for **this repo** (`claude-react-native-dev-plugin`). It distills |
| 11 | +what happened this session into the project's living docs, then flags anything left |
| 12 | +undone. The docs live in the **sibling workspace repo**, per the project `CLAUDE.md`: |
| 13 | + |
| 14 | +| Doc | Path | What goes here | |
| 15 | +|---|---|---| |
| 16 | +| Roadmap | `../rn-dev-agent-workspace/docs/ROADMAP.md` | A dated narrative: what shipped, what's in flight, what's next, key findings | |
| 17 | +| Decisions | `../rn-dev-agent-workspace/docs/DECISIONS.md` | Architectural decisions as `Dxxxx` ADRs | |
| 18 | +| Bugs | `../rn-dev-agent-workspace/docs/BUGS.md` | Defects discovered/fixed as `Bxxxx` entries | |
| 19 | + |
| 20 | +`$ARGUMENTS` (if present) is an explicit focus or note from the maintainer — weave it in; |
| 21 | +it does not replace your own reconstruction of the session. |
| 22 | + |
| 23 | +## Iron rules |
| 24 | + |
| 25 | +1. **Append only.** Never delete, reorder, or rewrite existing entries (this honors the |
| 26 | + standing "never delete md files" instruction). You add new entries and, for a bug that |
| 27 | + got fixed this session, append its `Fix` block / move it to the Fixed section — you do |
| 28 | + not edit history. |
| 29 | +2. **Never fabricate.** If the session produced no new decisions, write nothing to |
| 30 | + DECISIONS.md. Same for bugs. An empty doc update is the correct output when nothing |
| 31 | + qualifies — say so in the summary. Only ROADMAP always gets an entry (the session |
| 32 | + itself is the news). |
| 33 | +3. **Never commit.** You write the files and report. The maintainer reviews and commits. |
| 34 | + (The workspace is a separate git repo; its commits are theirs to make.) |
| 35 | +4. **Continue the sequence.** IDs are monotonic. Read the current max `Dxxxx` / `Bxxxx` |
| 36 | + before writing and increment from there — do not reuse or guess. |
| 37 | +5. **Match the house format** of each doc exactly (see the templates below). Use today's |
| 38 | + date from `date +%F`, never a guessed date. |
| 39 | + |
| 40 | +## Procedure |
| 41 | + |
| 42 | +### Step 0 — Preconditions |
| 43 | +- `WS=../rn-dev-agent-workspace/docs`. Confirm `$WS/ROADMAP.md`, `$WS/DECISIONS.md`, |
| 44 | + `$WS/BUGS.md` all exist. If the workspace is missing, **stop** and tell the maintainer |
| 45 | + — do **not** create these files inside the plugin repo (that's the "two test-apps" |
| 46 | + class of mistake the project `CLAUDE.md` warns about). |
| 47 | + |
| 48 | +### Step 1 — Gather evidence (don't rely on memory alone) |
| 49 | +Run these and read the output before writing anything: |
| 50 | +- `date +%F` → today's date for the entries. |
| 51 | +- This repo: `git -C . log --oneline -25` and `git -C . status --short` and |
| 52 | + `git -C . branch --show-current`. |
| 53 | +- Workspace: `git -C ../rn-dev-agent-workspace log --oneline -15` and |
| 54 | + `git -C ../rn-dev-agent-workspace status --short`. |
| 55 | +- Current max IDs: |
| 56 | + - `grep -oE '### D[0-9]+' "$WS/DECISIONS.md" | grep -oE '[0-9]+' | sort -n | tail -1` |
| 57 | + - `grep -oE '### B[0-9]+' "$WS/BUGS.md" | grep -oE '[0-9]+' | sort -n | tail -1` |
| 58 | +- Then reconstruct from THIS conversation: what was built/changed, which choices were |
| 59 | + architectural (→ ADR), which were defects (→ bug), which were noteworthy observations |
| 60 | + (→ findings in the roadmap entry). |
| 61 | + |
| 62 | +### Step 2 — DECISIONS.md (only if there were architectural decisions) |
| 63 | +For each new decision, append a block at the end, continuing the `Dxxxx` sequence: |
| 64 | + |
| 65 | +```markdown |
| 66 | +### D<next>: <imperative one-line title> |
| 67 | + |
| 68 | +**Context.** <what forced the decision; the constraint or surprise> |
| 69 | + |
| 70 | +**Decision.** <what was chosen; alternatives considered and why rejected> |
| 71 | + |
| 72 | +**Lesson.** <the durable, transferable takeaway — optional but valued in this repo> |
| 73 | + |
| 74 | +**Refs.** <GH #, PR #, commit SHAs, files touched, related Dxxxx/Bxxxx> |
| 75 | +``` |
| 76 | + |
| 77 | +### Step 3 — BUGS.md (only if defects were found or fixed) |
| 78 | +New defect → append under the relevant section continuing the `Bxxxx` sequence: |
| 79 | + |
| 80 | +```markdown |
| 81 | +### B<next>: <one-line symptom> (<Open | Fixed — YYYY-MM-DD>) |
| 82 | + |
| 83 | +**Observed.** <how it showed up; repro if known> |
| 84 | + |
| 85 | +**Fix.** <what resolved it, or "Proposed fix." if still open> |
| 86 | + |
| 87 | +**Refs.** <GH #, PR #, commit SHAs, files, related Dxxxx/Bxxxx> |
| 88 | +``` |
| 89 | +If a previously-Open bug was fixed this session, append a `Fix.` block to it (don't rewrite |
| 90 | +the original Observed text). |
| 91 | + |
| 92 | +### Step 4 — ROADMAP.md (always) |
| 93 | +Append a dated section at the end: |
| 94 | + |
| 95 | +```markdown |
| 96 | +## <YYYY-MM-DD> — <session title> |
| 97 | + |
| 98 | +<1–3 sentence framing: what the session was about and why it mattered.> |
| 99 | + |
| 100 | +**Shipped.** <bullet or prose list of what landed — commits, files, behavior changes.> |
| 101 | + |
| 102 | +**Findings.** <noteworthy observations that aren't ADRs or bugs — perf numbers, |
| 103 | +gotchas, things to watch. Omit the heading if there were none.> |
| 104 | + |
| 105 | +**Process.** <how the work was done if notable — TDD, multi-agent review, brainstorm.> |
| 106 | + |
| 107 | +**Forward.** <what's still open / next — carry forward unfinished items from the prior |
| 108 | +entry's Forward block that are still open.> |
| 109 | + |
| 110 | +**Refs.** <Dxxxx/Bxxxx created this session, GH #, PR #.> |
| 111 | +``` |
| 112 | + |
| 113 | +### Step 5 — Hygiene check (report, don't fix) |
| 114 | +- Uncommitted work: surface `git status --short` for **both** repos (the plugin repo and |
| 115 | + the workspace, including the docs you just wrote). |
| 116 | +- Changeset gate: if `scripts/cdp-bridge/src/` changed this session (`git diff --name-only` |
| 117 | + against the branch base), confirm a `.changeset/*.md` exists. If shippable src changed |
| 118 | + with no changeset, **flag it** — the `require-changeset` CI job will fail the PR. |
| 119 | +- Branch: note the current branch and whether it's ahead of `main` / has an open PR. |
| 120 | + |
| 121 | +### Step 6 — Summarize |
| 122 | +Print a compact report: |
| 123 | +- Which docs were updated and the new IDs assigned (e.g. "DECISIONS +D1229, D1230; BUGS |
| 124 | + +B162; ROADMAP +2026-05-31 entry"). |
| 125 | +- The hygiene flags (uncommitted files, missing changeset, branch state). |
| 126 | +- An explicit reminder that **nothing was committed** — list the exact files the |
| 127 | + maintainer should review and commit, in both repos. |
| 128 | + |
| 129 | +Keep the final report short; the value is in the doc updates, not the recap. |
0 commit comments