@reddb-io/red-skills-dev 2.75.2

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 (135) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +30 -0
  3. package/package.json +32 -0
  4. package/skills/engineering/README.md +36 -0
  5. package/skills/engineering/_report-runtime/WRAPPER.md +47 -0
  6. package/skills/engineering/afk/AGENT-PROMPT.md +295 -0
  7. package/skills/engineering/afk/SAFETY.md +103 -0
  8. package/skills/engineering/afk/SKILL.md +160 -0
  9. package/skills/engineering/afk/TROUBLESHOOTING.md +260 -0
  10. package/skills/engineering/afk/actions-lane.md +213 -0
  11. package/skills/engineering/afk/bin/README.md +29 -0
  12. package/skills/engineering/afk/bin/afk.mjs +51 -0
  13. package/skills/engineering/afk/defaults/cargo-pre-worktree.sh +37 -0
  14. package/skills/engineering/afk/defaults/envelope-post-attempt.sh +47 -0
  15. package/skills/engineering/afk/defaults/gradle-pre-worktree.sh +42 -0
  16. package/skills/engineering/afk/defaults/heartbeat-post-attempt.sh +43 -0
  17. package/skills/engineering/afk/defaults/validation-post-merge.sh +77 -0
  18. package/skills/engineering/afk/detectors/README.md +72 -0
  19. package/skills/engineering/afk/detectors/cargo.sh +27 -0
  20. package/skills/engineering/afk/detectors/gradle.sh +35 -0
  21. package/skills/engineering/afk/docs/BOOT-SWEEPS.md +81 -0
  22. package/skills/engineering/afk/docs/CONFIG.md +238 -0
  23. package/skills/engineering/afk/docs/ENVELOPE.md +177 -0
  24. package/skills/engineering/afk/docs/HANDOFF.md +70 -0
  25. package/skills/engineering/afk/docs/LIVENESS.md +56 -0
  26. package/skills/engineering/afk/docs/OPERATIONS.md +409 -0
  27. package/skills/engineering/afk/examples/only-mine.sh +32 -0
  28. package/skills/engineering/afk/examples/red-afk-attempt-action.yml +53 -0
  29. package/skills/engineering/afk/examples/rs-afk-attempt.yml +76 -0
  30. package/skills/engineering/afk/fleet.md +127 -0
  31. package/skills/engineering/afk/hooks/red-cargo +44 -0
  32. package/skills/engineering/afk/hooks/red-envelope +50 -0
  33. package/skills/engineering/afk/hooks/red-gradle +50 -0
  34. package/skills/engineering/afk/hooks/red-heartbeat +46 -0
  35. package/skills/engineering/afk/hooks/red-validation +79 -0
  36. package/skills/engineering/afk/monitor.md +170 -0
  37. package/skills/engineering/afk/runner-claude-minimax.md +71 -0
  38. package/skills/engineering/afk/runner-claude.md +67 -0
  39. package/skills/engineering/afk/runner-codex.md +138 -0
  40. package/skills/engineering/afk/runner-hermes.md +40 -0
  41. package/skills/engineering/afk/runner-opencode.md +142 -0
  42. package/skills/engineering/ask-red/SKILL.md +137 -0
  43. package/skills/engineering/audit-skills/SKILL.md +46 -0
  44. package/skills/engineering/code-review/SKILL.md +106 -0
  45. package/skills/engineering/context/SKILL.md +142 -0
  46. package/skills/engineering/curate/SKILL.md +133 -0
  47. package/skills/engineering/daily-review/SKILL.md +68 -0
  48. package/skills/engineering/dashboard/SKILL.md +44 -0
  49. package/skills/engineering/diagnose/SKILL.md +155 -0
  50. package/skills/engineering/diagnose/scripts/hitl-loop.template.sh +41 -0
  51. package/skills/engineering/go/SKILL.md +144 -0
  52. package/skills/engineering/go/TROUBLESHOOTING.md +81 -0
  53. package/skills/engineering/ground-truth/SKILL.md +84 -0
  54. package/skills/engineering/hitl/SKILL.md +171 -0
  55. package/skills/engineering/hitl/TROUBLESHOOTING.md +76 -0
  56. package/skills/engineering/implement/SKILL.md +69 -0
  57. package/skills/engineering/improve-codebase-architecture/DEEPENING.md +37 -0
  58. package/skills/engineering/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
  59. package/skills/engineering/improve-codebase-architecture/LANGUAGE.md +53 -0
  60. package/skills/engineering/improve-codebase-architecture/SKILL.md +81 -0
  61. package/skills/engineering/model-tier-policy/SKILL.md +83 -0
  62. package/skills/engineering/prototype/LOGIC.md +79 -0
  63. package/skills/engineering/prototype/SKILL.md +30 -0
  64. package/skills/engineering/prototype/UI.md +112 -0
  65. package/skills/engineering/red-doctor/APPLY.md +35 -0
  66. package/skills/engineering/red-doctor/SKILL.md +172 -0
  67. package/skills/engineering/red-gains/SKILL.md +49 -0
  68. package/skills/engineering/red-setup/INTERVIEW.md +266 -0
  69. package/skills/engineering/red-setup/ISSUE-SWEEP.md +18 -0
  70. package/skills/engineering/red-setup/REFERENCE.md +35 -0
  71. package/skills/engineering/red-setup/SKILL.md +58 -0
  72. package/skills/engineering/red-setup/WORKFLOWS.md +74 -0
  73. package/skills/engineering/red-setup/WRITE-CONTRACT.md +151 -0
  74. package/skills/engineering/red-setup/config-template.yaml +174 -0
  75. package/skills/engineering/red-setup/domain.md +52 -0
  76. package/skills/engineering/red-setup/issue-tracker-github.md +88 -0
  77. package/skills/engineering/red-setup/rsp-retirement-runbook.md +35 -0
  78. package/skills/engineering/red-setup/scripts/install-runtime-shim.sh +189 -0
  79. package/skills/engineering/red-setup/triage-labels.md +176 -0
  80. package/skills/engineering/red-setup/workflows/red-issues-needs-triage.yml +36 -0
  81. package/skills/engineering/red-statusline/HOST-NOTES.md +180 -0
  82. package/skills/engineering/red-statusline/SKILL.md +58 -0
  83. package/skills/engineering/report-bug/SKILL.md +155 -0
  84. package/skills/engineering/resolving-merge-conflicts/SKILL.md +143 -0
  85. package/skills/engineering/retake/SKILL.md +184 -0
  86. package/skills/engineering/review-adrs/SKILL.md +125 -0
  87. package/skills/engineering/start/ADR-FORMAT.md +47 -0
  88. package/skills/engineering/start/CONTEXT-FORMAT.md +77 -0
  89. package/skills/engineering/start/DOC-LANDING-FINALIZER.md +9 -0
  90. package/skills/engineering/start/SKILL.md +179 -0
  91. package/skills/engineering/tdd/SKILL.md +96 -0
  92. package/skills/engineering/tdd/deep-modules.md +33 -0
  93. package/skills/engineering/tdd/interface-design.md +31 -0
  94. package/skills/engineering/tdd/mocking.md +59 -0
  95. package/skills/engineering/tdd/tests.md +85 -0
  96. package/skills/engineering/to-spec/SKILL.md +104 -0
  97. package/skills/engineering/to-tickets/SKILL.md +158 -0
  98. package/skills/engineering/triage/AGENT-BRIEF.md +207 -0
  99. package/skills/engineering/triage/OUT-OF-SCOPE.md +101 -0
  100. package/skills/engineering/triage/SKILL.md +176 -0
  101. package/skills/engineering/verify/SKILL.md +136 -0
  102. package/skills/engineering/wayfinder/SKILL.md +128 -0
  103. package/skills/engineering/zoom-out/SKILL.md +51 -0
  104. package/skills/engineering/zoom-out/scripts/graph-mode-plumbing.sh +36 -0
  105. package/skills/engineering/zoom-out/scripts/tests/contract.test.sh +168 -0
  106. package/skills/knowledge/README.md +5 -0
  107. package/skills/knowledge/research/SKILL.md +76 -0
  108. package/skills/misc/README.md +8 -0
  109. package/skills/misc/branch-lock/SKILL.md +187 -0
  110. package/skills/misc/branch-lock/scripts/branch-lock-hook.sh +113 -0
  111. package/skills/misc/branch-lock/scripts/branch-lock-session-start.sh +81 -0
  112. package/skills/misc/branch-lock/scripts/branch-lock.sh +68 -0
  113. package/skills/misc/branch-lock/scripts/lib/dev-config.sh +126 -0
  114. package/skills/misc/branch-lock/scripts/lib/git-command-classifier.sh +198 -0
  115. package/skills/misc/branch-lock/scripts/lib/lock-store.sh +67 -0
  116. package/skills/misc/branch-lock/scripts/lib/scope-resolver.sh +43 -0
  117. package/skills/misc/branch-lock/scripts/tests/branch-lock-cli.test.sh +114 -0
  118. package/skills/misc/branch-lock/scripts/tests/claude-plugin-hook.test.sh +117 -0
  119. package/skills/misc/branch-lock/scripts/tests/codex-hook.test.sh +229 -0
  120. package/skills/misc/branch-lock/scripts/tests/dev-config.test.sh +99 -0
  121. package/skills/misc/branch-lock/scripts/tests/git-command-classifier.test.sh +187 -0
  122. package/skills/misc/branch-lock/scripts/tests/lock-store.test.sh +90 -0
  123. package/skills/misc/branch-lock/scripts/tests/scope-resolver.test.sh +63 -0
  124. package/skills/misc/branch-lock/scripts/tests/session-start.test.sh +123 -0
  125. package/skills/misc/git-guardrails-claude-code/SKILL.md +105 -0
  126. package/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh +231 -0
  127. package/skills/misc/git-guardrails-claude-code/scripts/tests/block-dangerous-git.test.sh +143 -0
  128. package/skills/misc/migrate-to-shoehorn/SKILL.md +96 -0
  129. package/skills/misc/setup-pre-commit/SKILL.md +94 -0
  130. package/skills/productivity/README.md +8 -0
  131. package/skills/productivity/ff/SKILL.md +116 -0
  132. package/skills/productivity/handoff/SKILL.md +37 -0
  133. package/skills/productivity/reflect/SKILL.md +18 -0
  134. package/skills/productivity/write-a-skill/SKILL.md +190 -0
  135. package/skills/productivity/write-a-skill/WRITING-STYLE.md +62 -0
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: retake
3
+ description: Pick one issue back up — reconstruct where it stands (linked PRs, branches, worktrees, uncommitted or unpushed work, HITL state, active blocker), report that state, then execute the one right action — a plain requeue into `ready-for-agent`, an `--adopt-branch` landing through the no-agent gate, or a handoff to `/hitl`. Use when the user invokes `/retake #123`, asks to resume or recover an issue, wants to requeue a parked issue, or has hand-done work on a branch that needs to land.
4
+ argument-hint: "#ISSUE [--apply] [--json] [--repo OWNER/REPO] [--pr-limit N]"
5
+ ---
6
+
7
+ # /retake
8
+
9
+ **Diagnose before you act — a requeue fired at an issue whose work already sits finished in a dirty worktree just spawns a second agent to redo it.**
10
+
11
+ `/retake` is one skill with two halves. The **diagnosis** half reconstructs the
12
+ issue's real state from GitHub and the local filesystem. The **action** half
13
+ executes exactly one transition out of that state. Never skip the first half:
14
+ the label claims `ready-for-human`, but the truth is in the worktree.
15
+
16
+ <what-to-do>
17
+
18
+ ## 1. Diagnose — Reconstruct The State
19
+
20
+ Resolve the `red-skills-dev` runtime through the shared contract in
21
+ [`../_report-runtime/WRAPPER.md`](../_report-runtime/WRAPPER.md): use an
22
+ installed shim on `PATH` first, otherwise use the ADR 0091 npm direct-run form
23
+ `npx -y -p @reddb-io/red-skills@<version> red-skills-dev retake ...`. If the
24
+ shim is missing, name that fallback instead of surfacing a bare
25
+ command-not-found.
26
+
27
+ ```bash
28
+ red-skills-dev retake 123
29
+ ```
30
+
31
+ The runtime accepts `123` and `#123`; quote `'#123'` when a shell would read it
32
+ as a comment. Add `--json` when another tool or agent consumes the state.
33
+
34
+ The report answers six questions, in this order:
35
+
36
+ 1. **What does the tracker say?** Issue state, labels, the active
37
+ `## Current blocker` in the body, and whether those two agree. A `blocked:*`
38
+ label without a matching blocker section is a **label/body mismatch** — that
39
+ issue belongs to `/hitl`, not to you.
40
+ 2. **Is there a PR?** Linked PRs from recent PRs plus `#ISSUE` search hits, with
41
+ their check and review state.
42
+ 3. **Is there a branch?** Local and remote branches carrying the issue number.
43
+ 4. **Is there a worktree?** Matching local worktrees, each marked `clean` or
44
+ `dirty`.
45
+ 5. **Is the work already done locally?** A dirty worktree holds uncommitted
46
+ work; a branch ahead of its remote holds unpushed commits. Either one means
47
+ **the code exists and nobody knows** — say so loudly.
48
+ 6. **What is the blocker really?** `blocked:validation` and `blocked:spec` are
49
+ retryable. `blocked:sensitive-path` is a landing gate, not a retry gate.
50
+ Anything else is a pending human decision.
51
+
52
+ ## 2. Report — Say Where The Issue Stands
53
+
54
+ Present the reconstruction before proposing anything. Use this form:
55
+
56
+ ```text
57
+ Issue #123 — <title> [<labels>]
58
+ Tracker: <state>, blocker: <kind or none>, label/body: agree | mismatch
59
+ PR: #456 <checks> <reviews> (or: none)
60
+ Branch: <name> (<n> ahead / <n> behind origin) (or: none)
61
+ Worktree: <path> — clean | dirty (<n> uncommitted files) (or: none)
62
+ Verdict: <one sentence: is the work done, partial, or unstarted?>
63
+ Action: <the single next command>
64
+ ```
65
+
66
+ **The verdict is the point.** "Work is committed on `afk/123-foo`, pushed, PR
67
+ #456 green" and "work is unstarted, only a label is parked" demand opposite
68
+ actions from an identical set of labels.
69
+
70
+ ## 3. Act — Execute Exactly One Transition
71
+
72
+ Pick by verdict, never by label alone:
73
+
74
+ | Verdict | Action |
75
+ | --- | --- |
76
+ | Pending human decision, mixed `blocked:*` labels, or label/body mismatch | `/hitl #ISSUE` — stop here, do not requeue |
77
+ | Parked `blocked:validation` / `blocked:spec`, work unstarted, guidance in hand | plain requeue (below) |
78
+ | Work done on a branch — committed and pushed | adopt-branch landing (below) |
79
+ | `blocked:sensitive-path`, and you have **reviewed** the protected diff | adopt-branch landing (a bare requeue refuses) |
80
+ | Open PR with failing checks or changes requested | fix the PR branch first; neither command lands a red PR |
81
+ | Dirty worktree | commit and push inside that worktree, then re-run `/retake` |
82
+
83
+ ### Plain requeue — put a parked issue back in the queue
84
+
85
+ ```bash
86
+ red-skills-dev requeue 123 --guidance "Retry with the documented guidance; the gate flake is fixed."
87
+ ```
88
+
89
+ One atomic transition: archive the active `## Current blocker` into
90
+ `## Resolved blockers`, post the guidance as an auditable `directive` comment,
91
+ drop `ready-for-human` and every `blocked:*` label, add `ready-for-agent`.
92
+
93
+ ### Adopt-branch landing — validate and land hand-done work
94
+
95
+ ```bash
96
+ red-skills-dev requeue 123 --adopt-branch my-feature-branch --guidance "Manual implementation complete; run gate."
97
+ ```
98
+
99
+ After the requeue transition, the branch routes through the **no-agent landing
100
+ lane** (ADR 0055). The shared feedback gate validates it with no agent re-run;
101
+ green lands it through `doLanding` and closes the issue; red parks it back to
102
+ `ready-for-human` with `blocked:validation` plus the real failing checks; a
103
+ branch with no commits versus base exits 0 with a note. An adopted branch and an
104
+ AFK branch pass the same gate authority.
105
+
106
+ `--guidance` is required in both modes — it records the human decision. Use
107
+ `--dry-run` to print the planned transition without mutating, and `--json` for
108
+ structured output.
109
+
110
+ ### `--apply` — safe local setup only
111
+
112
+ `red-skills-dev retake 123 --apply` runs only the safe local `git` operations
113
+ the diagnosis selected: create a missing manual worktree under
114
+ `.red/tmp/worktrees/manual/<slug>`, recreate it from a matching branch, or fetch
115
+ a PR head branch into a fresh worktree. It then prints the next `cd`, `requeue`,
116
+ or `/go` command.
117
+
118
+ - ✅ `--apply` is non-destructive by construction — local `git` setup, nothing else.
119
+ - ❌ Do **not** expect `--apply` to merge, close issues, edit labels, run the requeue transition, or move the primary checkout's branch. It does none of them.
120
+ - ❌ Do **not** flip labels by hand instead of running requeue. AFK preflight re-reads the active blocker and re-parks the issue, so a hand-flipped label is a silent no-op retry loop (#850).
121
+
122
+ </what-to-do>
123
+
124
+ <supporting-info>
125
+
126
+ ## Why a label flip alone fails
127
+
128
+ A validation or spec failure parks an issue with three things at once:
129
+ `ready-for-human`, a `blocked:*` label, and an active `## Current blocker` in
130
+ the body. AFK preflight reads that blocker **before any work starts**, so an
131
+ issue whose labels say `ready-for-agent` while its body still carries a blocker
132
+ is re-parked immediately. The blocker must clear in the same transition that
133
+ flips the labels. Producing that single transition is what the `requeue` command
134
+ exists for.
135
+
136
+ ## Clearing a `blocked:sensitive-path` park (#1171)
137
+
138
+ A sensitive-path park means the diff touches a protected path — a CI workflow, a
139
+ lifecycle script, a git hook, `.red/` config. It gates **landing**, so it
140
+ re-fires on every fresh attempt: bare requeue → `/hitl` → a new attempt
141
+ reproduces the same protected diff → re-parks. An infinite loop.
142
+
143
+ `--adopt-branch` breaks it. On a `blocked:sensitive-path` issue, requeue clears
144
+ the blocker, drops `ready-for-human` and `blocked:sensitive-path`, and adopts the
145
+ reviewed branch **with the sensitive-path landing guard bypassed for that land
146
+ only**. An audit comment records who approved the diff and when — the bypass is
147
+ never silent. The guard is never weakened for the autonomous path: every normal
148
+ AFK or `/go` attempt still parks. The bypass is reachable only from this
149
+ explicit human command, and a bare requeue of a sensitive-path park still
150
+ refuses.
151
+
152
+ ## `/retake` vs `/hitl` — the decision boundary
153
+
154
+ **Stay in `/retake`** when the decision is already made: the issue is
155
+ `blocked:validation` or `blocked:spec` with no other `blocked:*` label, the label
156
+ kind and the active blocker kind agree, and you hold the retry guidance. Or when
157
+ you have a hand-done branch to adopt. Or when you have reviewed a protected diff
158
+ and want to land it.
159
+
160
+ **Hand to `/hitl`** when the pending human decision still has to be *extracted* —
161
+ it interviews the maintainer, decides delegability, then clears the blocker and
162
+ requeues. Hand over any issue carrying mixed `blocked:*` labels, a label/body
163
+ mismatch, or a blocked kind outside `validation` / `spec` / `sensitive-path`
164
+ (`blocked:decision`, `blocked:stalled`). Both paths end in the same safe state;
165
+ `/retake` is the informed shortcut, `/hitl` is the interview.
166
+
167
+ ## Where the work lives
168
+
169
+ Hand-done work belongs in the manual-worktree lane
170
+ `.red/tmp/worktrees/manual/<slug>`, never on the primary checkout's branch. Use a
171
+ lowercase kebab-case slug, usually the issue number plus a short task name. When
172
+ the diagnosis finds no local state at all, the next action is a fresh worktree
173
+ from `origin/main` — or, for a brand-new one-off demand that never was an issue,
174
+ `/go "<demand>"` instead of this skill. After an adopted branch lands through the
175
+ no-agent landing lane, its worktree is pruned automatically.
176
+
177
+ ## See also
178
+
179
+ - `/hitl` — interactive decision extraction before requeueing
180
+ - `/go` — dispatch an untracked one-off demand end-to-end
181
+ - ADR 0055 — the no-agent landing lane (reconcile / doLanding)
182
+ - ADR 0081 — command topology; retake is the manual adoption path
183
+
184
+ </supporting-info>
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: review-adrs
3
+ description: Review the `.red/adr/` set for consistency issues, reconcile each finding with the maintainer through a one-question-at-a-time interview — reaching agreement before any write — then consolidate every agreement into a single actionable Spec on the issue tracker via `/to-spec`. Use when asked to "review the ADRs", after adding or reversing an ADR, or to turn ADR decision debt into scheduled work.
4
+ ---
5
+
6
+ # Review ADRs (decision-record interview → actionable Spec)
7
+
8
+ **Lint the decision record read-only, reconcile each finding through a one-question-at-a-time interview, and package every agreement into one Spec — never edit an ADR, the wiki, or the graph directly.**
9
+
10
+ ADRs accumulate (30–40+ per repo) and **derive**: one reverses another, a path it
11
+ cites moves, a decision was taken controversially and never reconciled, the wiki and
12
+ Memory graph hold claims sourced from a decision that later changed. This is the
13
+ "doctor of decisions" — sibling to `/red-doctor` (adoption) and `memory:doctor` (graph).
14
+ Detection is read-only; **every resolution is reached through an interview** — one
15
+ question per turn, `/start`-style — and the agreement is captured, not applied. The
16
+ skill never edits an ADR, the wiki, or the graph: it consolidates every agreed fix
17
+ into **one Spec** on the tracker, which `/to-tickets` + `/afk` execute afterwards.
18
+
19
+ <what-to-do>
20
+
21
+ **First detect read-only (Pass 1). Then run the Reconcile interview (Pass 2): walk the findings as a decision tree, ask ONE question per turn with a recommended resolution, wait for the reply, and record the agreed action. Grouping (Pass 3) and propagation (Pass 4) are further branches of that same interview. Then emit ONE Spec via `/to-spec` (Pass 5) holding every agreed action. The only artefact this skill writes is the Spec.**
22
+
23
+ ### Hard rules
24
+
25
+ - ❌ Do **not** edit ADR bodies, renumber files, write the INDEX, supersede a Memory node, or re-ingest a wiki page directly. This skill ends in a **Spec on the tracker**, not in applied edits. Every agreed fix becomes a Spec work item, executed later by `/to-tickets` + `/afk` or a human.
26
+ - ❌ Do **not** auto-resolve a finding or controversial decision. Surface it in the interview; the maintainer's answer is what gets recorded as the agreed action.
27
+ - ❌ Do **not** stack questions. **One `Q##` per turn.** Wait for the reply, re-evaluate the tree, then ask the next. Do not preempt the next question, and do not summarise the user's answers back at them.
28
+ - ✅ Before Pass 1, run `git fetch origin`, resolve `origin/HEAD` to the remote default branch, and lint from that Git ref (`origin/<default-branch>`). Read ADR/context files with Git plumbing such as `git ls-tree` / `git show`; do **not** inspect `.red/adr/` from the working tree. Use local `HEAD` only when no `origin` remote/ref exists, and state that fallback in the report.
29
+ - ✅ Compose existing surfaces to detect: `/wiki lint` for wiki claims, Memory supersession/contradiction reads for graph claims. Do not reimplement them.
30
+ - ✅ Compose `/to-spec` to publish — do not hand-roll the Spec format. Every interview agreement is a **Human Decision** in that Spec (load-bearing judgement the agent could not infer).
31
+ - ✅ Honour ADR conventions in `start/ADR-FORMAT.md` (Status frontmatter, "superseded by ADR-NNNN", Related links).
32
+
33
+ ### Pass 1 — Lint (detect, read-only)
34
+
35
+ Fetch first: `git fetch origin`. Resolve `origin/HEAD` to the remote default branch, set the lint ref to `origin/<default-branch>`, and read every `.red/adr/*.md` (and `.red/CONTEXT-MAP.md` / contexts if present) from that ref. Use `git ls-tree -r --name-only "$lint_ref" -- .red/adr .red/CONTEXT-MAP.md .red/contexts` to discover files and `git show "$lint_ref:$path"` to read them; path-existence checks for stale references must also query the same ref. Lint **against the fetched committed tree**, not a dirty or stale local working copy, so a lagging checkout is never mistaken for a real finding. If there is no `origin` remote/ref, fall back to local `HEAD` and say so before reporting findings. Report:
36
+
37
+ - **Contradictions** — two ADRs whose decisions oppose on the same topic (e.g. "memory lives in `src/apps`" vs "memory moves to `red-memory`"). Flag pairs that should cross-reference but don't.
38
+ - **Missing supersession** — a later ADR reverses/supersedes an earlier one, but the earlier still reads `Status: accepted` with no "superseded by ADR-NNNN" / Related note.
39
+ - **Stale references** — an ADR cites a path / file / command that no longer exists (grep the body for paths, check existence; e.g. an ADR naming `src/domains/` or `src/apps/` after the tree became `apps/`). Flag the prose, not the decision.
40
+ - **Numbering** — duplicate or gap-colliding ADR numbers (two files claiming the same NNNN, e.g. when parallel branches both grab the next number).
41
+ - **Structural / controversial decisions** — a decision that is internally incoherent, was taken under unresolved disagreement, or was never actually implemented. These are the ones that **don't** get fixed by editing markdown — they need real work, and they are the spine of the Spec.
42
+
43
+ This finding list **is the decision tree** the interview walks. Present it once, briefly, ordered by impact — then enter Pass 2.
44
+
45
+ ### Pass 2 — Reconcile (the interview — `/start`-style, the core of this skill)
46
+
47
+ Walk the Pass-1 findings as a decision tree. **The loop:**
48
+
49
+ 1. **Pick the next unresolved finding**, highest-impact first: numbering collisions (they break references) → contradictions → missing supersession → stale references → structural/controversial decisions.
50
+ 2. **Ask ONE question** in the format below — branches for the finite resolution space, plus a recommended branch with a one-sentence reason.
51
+ 3. **Wait** for the reply. Do not stack, do not preempt.
52
+ 4. **Re-evaluate** when the answer cascades (e.g. renumbering an ADR also changes the INDEX entry and every cross-ref to it) — fold the cascade into the tree before the next question.
53
+ 5. **Record the agreed action** in the ledger (the agreement *is* the spec for a Spec item — do not apply it), then continue.
54
+ 6. **Stop** when the user says stop, or when every finding is resolved.
55
+
56
+ **Question format template (identical discipline to `/start`):**
57
+
58
+ > **Q##:** [the decision to reconcile]
59
+ > **Branches:**
60
+ > (a) [resolution A — e.g. "renumber the locally-authored ADR to the next free number, fix its inbound refs"]
61
+ > (b) [resolution B — e.g. "renumber the other one"]
62
+ > (c) [defer — leave the finding open, no Spec item]
63
+ > **Recommend:** (a), because [one-sentence reason].
64
+ > *(answer, redirect, or push back — I'll wait)*
65
+
66
+ Number questions `Q01`, `Q02`, … zero-padded to 2 digits, session-scoped (reset each invocation, never on a redirect). Prefer enumerated branches whenever the resolution space is finite; `(c) defer` is almost always a legitimate branch — a finding the maintainer wants to think about is simply left out of the Spec.
67
+
68
+ ### Pass 3 — Group → INDEX (one agreement within the interview)
69
+
70
+ When the lint findings are reconciled (or the user wants the map first, to reason about them), raise a question on whether to (re)generate **`.red/adr/INDEX.md`** — the decision map (the ADR analogue of `CONTEXT-MAP.md`): ADRs clustered by theme (AFK lifecycle · memory architecture · bundle/fetch/version · branch-lock · MCP/transport · licensing · repo structure · …), each entry showing theme, status, and supersession edges, reflecting the numbering/supersession just agreed. May reuse Memory graph-community clustering when graph mode is available. The agreed clustering becomes a **Spec item** ("create/refresh `.red/adr/INDEX.md` as …"), not an inline write.
71
+
72
+ ### Pass 4 — Propagate to Wiki + Memory (further interview branches)
73
+
74
+ A changed/superseded ADR leaves derived claims dangling. For each ADR touched in Pass 2/3, raise it as its own question:
75
+
76
+ - **Wiki** — `/wiki lint` (contradictions / orphans / stale claims); find pages whose `REFERENCES` point at the changed ADR. Ask whether to re-ingest that ADR — if yes, it becomes a Spec item.
77
+ - **Memory** — ADRs are first-class graph nodes (engineering semantic graph). Find nodes whose provenance cites the changed ADR. Ask whether to `memory_supersede` the obsolete claims (reversible hide-not-delete) — if yes, it becomes a Spec item.
78
+
79
+ One question per target, one agreed action per item. Never silently propagate.
80
+
81
+ ### Pass 5 — Emit the Spec
82
+
83
+ Hand the accumulated agreed actions to `/to-spec`:
84
+
85
+ - **Problem Statement / Solution** — the decision debt found and the reconciliation plan.
86
+ - **User Stories** — one per agreed action, phrased as the concrete edit/work: "rewrite ADR-0034 Status to `superseded by 0041` and add the Related link", "renumber the locally-authored ADR and fix its inbound refs", "create `.red/adr/INDEX.md` clustering the set", "re-ingest ADR-0041 into the wiki", "implement the reconciliation of the controversial X decision".
87
+ - **Human Decisions** — every interview answer (`Q##` → agreed branch), in `/to-spec`'s Decision/Why/Alternatives shape. These are load-bearing: once `/to-tickets` slices the Spec they must not be mistaken for agent inference.
88
+
89
+ Publish with `type:spec` + `needs-slicing` (never `ready-for-agent` — `/to-spec` handles the labels). Then in chat: a short receipt of each `Q##` and the action it produced, the link to the published Spec, what was **deferred** (left out), and the single highest-impact finding to reconcile first.
90
+
91
+ ### End-of-session doc-landing finalizer
92
+
93
+ When the ADR review session ends, run the shared end-of-session doc-landing finalizer in [`/start`'s DOC-LANDING-FINALIZER.md](../start/DOC-LANDING-FINALIZER.md) before exiting.
94
+
95
+ </what-to-do>
96
+
97
+ <supporting-info>
98
+
99
+ ### Why this is an interview, not a flat list
100
+
101
+ ADR reconciliation decisions are exactly the kind `/start` exists for: hard to reverse (renumbering breaks inbound refs; supersession hides graph claims), surprising without context, and the product of a real trade-off (which of two colliding ADRs renumbers? does the older one get a "partially superseded" note or a full one?). A flat approval list forces all of these at once and invites a rubber-stamp. Walking them one at a time — recommend, wait, re-evaluate — is how shared agreement is actually reached, and it lets one answer reshape the rest of the tree before the next question is asked. The agreements then become a coherent Spec instead of a scattered set of edits.
102
+
103
+ ### Why each finding kind exists (worked examples)
104
+
105
+ - **Contradiction / missing supersession:** ADR 0034 placed memory under `src/apps`; ADR 0041 moves it out to the `red-memory` repo — 0034 should carry a "partially superseded by 0041" note. The interview asks: full or partial supersession, and worded how? → Spec item to rewrite 0034's Status + Related.
106
+ - **Stale reference:** an ADR whose body says `src/domains/{dev,memory}` after the tree became `src/apps/` is out of date even though the *decision* still stands — the interview asks whether to fix the prose (yes) without touching the decision → Spec item.
107
+ - **Numbering collision:** two PRs each grabbed "next = 0039" (one merged as `plugin-entrypoints-share-one-source`; a second authored locally had to renumber to 0041). The interview asks which file renumbers and confirms the inbound-ref fixups → Spec item.
108
+ - **Structural / controversial:** a decision recorded under unresolved disagreement, or one whose implementation never landed — the interview confirms whether it's still the intent; if it needs real engineering to reconcile, it becomes the load-bearing slice of the Spec.
109
+
110
+ ### Composition map
111
+
112
+ | Pass | Reuses |
113
+ |---|---|
114
+ | 1 Lint | filesystem reads against `origin/HEAD` + `start/ADR-FORMAT.md` conventions; Memory contradiction reads when graph mode is on |
115
+ | 2 Reconcile | `/start` interview discipline (one `Q##` per turn, branches + recommend) |
116
+ | 3 Group | Memory graph communities (optional) for clustering |
117
+ | 4 Propagate | `/wiki lint` + `/wiki ingest`; `memory_supersede` / Memory provenance reads |
118
+ | 5 Emit Spec | `/to-spec` (format, labels, Human Decisions capture) → later `/to-tickets` + `/afk` |
119
+
120
+ ### Boundaries
121
+
122
+ - The skill **reaches agreement, then packages** — it never silently rewrites a decision, the wiki, or the graph, and never applies an ADR edit directly. Execution is a separate, scheduled step driven by the Spec.
123
+ - Pairs with `/red-doctor` (adoption/process) and `memory:doctor` (graph health) — three doctors over different axes; this one owns **the decision record**, resolves through dialogue, and turns its debt into work.
124
+
125
+ </supporting-info>
@@ -0,0 +1,47 @@
1
+ # ADR Format
2
+
3
+ ADRs live in `.red/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
4
+
5
+ Create the `.red/adr/` directory lazily — only when the first ADR is needed.
6
+
7
+ ## Template
8
+
9
+ ```md
10
+ # {Short title of the decision}
11
+
12
+ {1-3 sentences: what's the context, what did we decide, and why.}
13
+ ```
14
+
15
+ That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
16
+
17
+ ## Optional sections
18
+
19
+ Only include these when they add genuine value. Most ADRs won't need them.
20
+
21
+ - **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
22
+ - **Considered Options** — only when the rejected alternatives are worth remembering
23
+ - **Consequences** — only when non-obvious downstream effects need to be called out
24
+
25
+ ## Numbering
26
+
27
+ Scan `.red/adr/` for the highest existing number and increment by one.
28
+
29
+ ## When to offer an ADR
30
+
31
+ All three of these must be true:
32
+
33
+ 1. **Hard to reverse** — the cost of changing your mind later is meaningful
34
+ 2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
35
+ 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
36
+
37
+ If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
38
+
39
+ ### What qualifies
40
+
41
+ - **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
42
+ - **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
43
+ - **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
44
+ - **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
45
+ - **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
46
+ - **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
47
+ - **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
@@ -0,0 +1,77 @@
1
+ # .red/CONTEXT.md Format
2
+
3
+ ## Structure
4
+
5
+ ```md
6
+ # {Context Name}
7
+
8
+ {One or two sentence description of what this context is and why it exists.}
9
+
10
+ ## Language
11
+
12
+ **Order**:
13
+ {A concise description of the term}
14
+ _Avoid_: Purchase, transaction
15
+
16
+ **Invoice**:
17
+ A request for payment sent to a customer after delivery.
18
+ _Avoid_: Bill, payment request
19
+
20
+ **Customer**:
21
+ A person or organization that places orders.
22
+ _Avoid_: Client, buyer, account
23
+
24
+ ## Relationships
25
+
26
+ - An **Order** produces one or more **Invoices**
27
+ - An **Invoice** belongs to exactly one **Customer**
28
+
29
+ ## Example dialogue
30
+
31
+ > **Dev:** "When a **Customer** places an **Order**, do we create the **Invoice** immediately?"
32
+ > **Domain expert:** "No — an **Invoice** is only generated once a **Fulfillment** is confirmed."
33
+
34
+ ## Flagged ambiguities
35
+
36
+ - "account" was used to mean both **Customer** and **User** — resolved: these are distinct concepts.
37
+ ```
38
+
39
+ ## Rules
40
+
41
+ - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others as aliases to avoid.
42
+ - **Flag conflicts explicitly.** If a term is used ambiguously, call it out in "Flagged ambiguities" with a clear resolution.
43
+ - **Keep definitions tight.** One sentence max. Define what it IS, not what it does.
44
+ - **Show relationships.** Use bold term names and express cardinality where obvious.
45
+ - **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
46
+ - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
47
+ - **Write an example dialogue.** A conversation between a dev and a domain expert that demonstrates how the terms interact naturally and clarifies boundaries between related concepts.
48
+
49
+ ## Single vs multi-context repos
50
+
51
+ **Single context (most repos):** One `.red/CONTEXT.md` at the repo root.
52
+
53
+ **Multiple contexts:** A `.red/CONTEXT-MAP.md` at the repo root lists the contexts and how they relate. Each context's glossary lives under `.red/contexts/<name>/CONTEXT.md` — all still inside the single root `.red/`, never a nested `.red/` inside a source subtree:
54
+
55
+ ```md
56
+ # Context Map
57
+
58
+ ## Contexts
59
+
60
+ - [Ordering](./contexts/ordering/CONTEXT.md) — receives and tracks customer orders
61
+ - [Billing](./contexts/billing/CONTEXT.md) — generates invoices and processes payments
62
+ - [Fulfillment](./contexts/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
63
+
64
+ ## Relationships
65
+
66
+ - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
67
+ - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
68
+ - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
69
+ ```
70
+
71
+ The skill infers which structure applies:
72
+
73
+ - If `.red/CONTEXT-MAP.md` exists, read it to find contexts
74
+ - If only a root `.red/CONTEXT.md` exists, single context
75
+ - If neither exists, create a root `.red/CONTEXT.md` lazily when the first term is resolved
76
+
77
+ When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
@@ -0,0 +1,9 @@
1
+ # End-of-session doc-landing finalizer
2
+
3
+ When a doc-writing session ends (the user stops or every reachable branch is resolved), run one end-of-session doc-landing finalizer before exiting:
4
+
5
+ 1. Detect modified or untracked docs in the primary checkout across the domain glossary (`.red/CONTEXT.md`, `.red/CONTEXT-MAP.md`, `.red/contexts/**`) and ADRs (`.red/adr/**`). A session with no doc changes skips the finalizer silently.
6
+ 2. If docs changed, do this first: Announce the file list and ADR numbers to the user, and accept a decline. A decline leaves the docs unlanded; the cascade gate remains the enforcement point.
7
+ 3. If accepted, land the docs through the standard docs-worktree lane: create one worktree under `.red/tmp/worktrees/docs/<slug>` from a freshly fetched `origin/{base}` (base resolved lock > pin > main), using the name pattern `docs-<YYYYMMDD>-<slug>` for the worktree slug, copy only the dirty doc files into that worktree, commit them as a `docs:`-typed change, push the branch, open a PR, merge it, and rely on the existing post-landing fast-forward to bring the local base up.
8
+ 4. Restate these safety prohibitions before landing: never commit in the primary checkout, never switch its branch, never stash, never reset.
9
+ 5. Land at most one batch PR per session.
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: start
3
+ description: Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (.red/CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
4
+ argument-hint: "[plan to grill: prose, URL, path, or empty]"
5
+ ---
6
+
7
+ <what-to-do>
8
+
9
+ **Run a relentless one-Q-at-a-time grilling session until every branch of the decision tree is resolved — shared understanding is the only exit condition.** Ask one question, include a recommendation with one-sentence reasoning, wait for the reply, re-evaluate, then move to the next branch.
10
+
11
+ Walk down each branch of the design tree, resolving dependencies between decisions one at a time.
12
+
13
+ **The loop:**
14
+
15
+ 1. Pick the next unresolved branch of the decision tree.
16
+ 2. Ask **one** question. Include your recommended answer with one-sentence reasoning.
17
+ 3. Wait for the user's reply. Do not stack questions, do not preempt the next one.
18
+ 4. When their answer changes the tree, re-evaluate before asking the next question.
19
+ 5. Stop when the user says stop, or when every reachable branch is resolved.
20
+
21
+ ## End-of-session doc-landing finalizer
22
+
23
+ When the grilling session ends (the user stops or every reachable branch is resolved), run the shared end-of-session doc-landing finalizer in [DOC-LANDING-FINALIZER.md](./DOC-LANDING-FINALIZER.md) before exiting.
24
+
25
+ ## Boot behavior (turn 1 — first invocation only)
26
+
27
+ The argument is optional. Treat it as the plan or context to grill.
28
+
29
+ - **External reference** (URL or file path) → eager ingest via `/wiki ingest <ref>`. If `.red/wiki/` is not initialised, ask **once**: `Initialise /wiki to cache fetches across sessions? (y/N)`. On `y`, run `/wiki-init` then proceed. On `n`, fall back to plain `WebFetch`/`Read` into context and note in the receipt that the material is **not cached**.
30
+ - **Inline document** (text pasted in the argument) → already in context, no fetch.
31
+ - **Prose** (short description) → no fetch, the prose is the plan.
32
+ - **Empty argument** → open with the literal Q01:
33
+
34
+ > **Q01:** What plan are we grilling?
35
+ > **Branches:** (a) paste it inline (b) share a URL or file path (c) describe it in a sentence
36
+ > **Recommend:** (a), because inline context lets us start grilling immediately.
37
+ > *(answer, redirect, or push back — I'll wait)*
38
+
39
+ After successful ingestion, emit a **single-line receipt** then proceed to `Q01`:
40
+
41
+ | Source | Receipt |
42
+ |---|---|
43
+ | URL | `Fetched <url> → wiki/raw/<slug>.md (<N> words).` |
44
+ | File (md/txt) | `Read <path> → wiki/raw/<slug>.md.` |
45
+ | File (PDF) | `Read <path> → wiki/raw/<slug>.txt (<N> pages).` |
46
+ | Inline doc | `Got <N> words inline.` |
47
+ | Prose | _(no receipt — proceed to Q01 immediately)_ |
48
+
49
+ When wiki is **not cached** (user declined `/wiki-init`), append ` (not cached)` to the receipt.
50
+
51
+ On ingestion **failure**, do not start `Q01`. Ask for an alternative:
52
+
53
+ ```
54
+ Couldn't read <ref>: <reason>.
55
+ Paste the content, point to another path, or say "skip" and we'll grill on what you describe.
56
+ ```
57
+
58
+ **Hard rules — do not break these:**
59
+
60
+ - ❌ Do **not** implement, write code, or run commands beyond read-only codebase exploration, except for the end-of-session doc-landing finalizer.
61
+ - ❌ Do **not** summarise the user's answers back at them. They know what they said.
62
+ - ❌ Do **not** propose a final plan, design doc, or Spec. This skill ends in shared understanding, not artefacts.
63
+ - ❌ Do **not** ask more than one question per turn.
64
+ - ❌ Do **not** fetch URLs the user only **mentions** in passing. A ref becomes a fetch only when the user explicitly asks ("look at this", "ingest X") or the next question requires its content.
65
+ - ❌ Do **not** answer a decision yourself — an agent that answers its own questions has broken the interview.
66
+ - ✅ **Do** look up facts in the codebase (what the code does, what names exist, how something is wired) instead of asking the human for information that is already readable in the code.
67
+ - ✅ **Do** put every decision to the human and wait for the answer. Facts can be looked up; decisions belong to the human.
68
+ - ✅ **Do** challenge contradictions immediately — between user statements, between user and code, between user and `.red/CONTEXT.md`.
69
+ - ✅ **Do** update `.red/CONTEXT.md` inline the moment a term is resolved (one term → one edit → next question). This is a side effect of the interview, not a separate phase.
70
+ - ✅ **Do** offer an ADR only when the three-condition test in `<supporting-info>` passes.
71
+ - ✅ **Do** treat mid-grilling refs symmetrically to boot refs: when the user introduces a URL or file path at any turn, ingest via `/wiki ingest`, emit the same receipt line, then continue with the next question.
72
+
73
+ **Question format template:**
74
+
75
+ > **Q##:** [the question]
76
+ > **Branches:** _(omit only when the question is genuinely open-ended)_
77
+ > (a) [answer option A]
78
+ > (b) [answer option B]
79
+ > [if more options, add more branches]
80
+ > **Recommend:** (a), because [one-sentence reason].
81
+ > *(answer, redirect, or push back — I'll wait)*
82
+
83
+ Prefer enumerated branches whenever the decision space is finite — they give the user a stable handle ("ok (b) but with X tweak") and force the skill to make the choice space explicit instead of hand-waving. `Recommend:` references a branch letter when branches are listed, prose otherwise.
84
+
85
+ Number every question `Q01`, `Q02`, … `Q10`, … zero-padded to 2 digits. Counter is **session-scoped** — reset on each `/start` invocation, never on user redirects.
86
+
87
+ </what-to-do>
88
+
89
+ <supporting-info>
90
+
91
+ ## Wiki integration
92
+
93
+ External references (URL, PDF, md/txt) flow through the `/wiki` skill so every fetched source is cached at `.red/wiki/raw/<slug>.md` and reusable across sessions and other skills (`/diagnose`, `/afk`, `/tdd`).
94
+
95
+ Behaviour summary (full contract in [`/wiki`](../../../../memory/skills/core/wiki/SKILL.md)):
96
+
97
+ - URL → `WebFetch` → `.red/wiki/raw/<slug>.md` with YAML header (`url`, `fetched`, `title`).
98
+ - Local PDF → `pdftotext` → `.red/wiki/raw/<slug>.txt`, original kept alongside.
99
+ - Local md/txt → copied to `.red/wiki/raw/<slug>.md` if not already there.
100
+ - Every ingest is logged at `.red/wiki/log.md`.
101
+
102
+ When `.red/wiki/` is missing, `/start` prompts once to run `/wiki-init`. Decline path: plain `WebFetch`/`Read` into context, no caching, receipt marked `(not cached)`.
103
+
104
+ ## Domain awareness
105
+
106
+ During codebase exploration, also look for existing documentation:
107
+
108
+ ### File structure
109
+
110
+ Most repos have a single context:
111
+
112
+ ```
113
+ /
114
+ ├── .red/
115
+ │ ├── CONTEXT.md
116
+ │ └── adr/
117
+ │ ├── 0001-event-sourced-orders.md
118
+ │ └── 0002-postgres-for-write-model.md
119
+ └── src/
120
+ ```
121
+
122
+ If a `.red/CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. Everything still lives under the single root `.red/` — the map lists the contexts and each one's glossary lives under `.red/contexts/<name>/`:
123
+
124
+ ```
125
+ /
126
+ ├── .red/
127
+ │ ├── CONTEXT-MAP.md ← lists the contexts and how they relate
128
+ │ ├── contexts/
129
+ │ │ ├── ordering/CONTEXT.md
130
+ │ │ └── billing/CONTEXT.md
131
+ │ └── adr/ ← single root ADR sequence (all contexts)
132
+ └── src/
133
+ ├── ordering/
134
+ └── billing/
135
+ ```
136
+
137
+ Create files lazily — only when you have something to write. If no `.red/CONTEXT.md` exists, create one when the first term is resolved. If no `.red/adr/` exists, create it when the first ADR is needed.
138
+
139
+ ## Side-effect triggers during the interview
140
+
141
+ These fire **as a consequence of grilling**. They never replace the interview loop — finish writing, then ask the next question.
142
+
143
+ ### Trigger: user introduces an external reference
144
+
145
+ URL or file path appears in the user's message **with intent to ingest** ("look at this", "olha esse", "ingest …", or the next question clearly needs it). Hand off to `/wiki ingest <ref>`, emit the standard receipt line as a brief acknowledgement, then proceed to the next `Q##:`. Mid-grilling refs follow the same rules as boot refs — no extra opt-in once `/wiki` is initialised.
146
+
147
+ ### Trigger: term conflicts with the glossary
148
+
149
+ When the user uses a term that conflicts with the existing language in `.red/CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
150
+
151
+ ### Trigger: fuzzy or overloaded language
152
+
153
+ When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
154
+
155
+ ### Trigger: domain relationship being asserted
156
+
157
+ Stress-test with a specific scenario. Invent edge cases that force the user to be precise about the boundaries between concepts.
158
+
159
+ ### Trigger: user statement contradicts the code
160
+
161
+ When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
162
+
163
+ ### Trigger: a term is resolved
164
+
165
+ Update `.red/CONTEXT.md` right there. Don't batch. Use the format in [CONTEXT-FORMAT.md](./CONTEXT-FORMAT.md).
166
+
167
+ `.red/CONTEXT.md` is a **glossary**. It is totally devoid of implementation details. Do not treat it as a spec, a scratch pad, or a repository for implementation decisions.
168
+
169
+ ### Trigger: a decision passes the ADR test
170
+
171
+ Only offer to create an ADR when all three are true:
172
+
173
+ 1. **Hard to reverse** — the cost of changing your mind later is meaningful
174
+ 2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
175
+ 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
176
+
177
+ If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
178
+
179
+ </supporting-info>