Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rdr Close?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hellblazer-rdr-close)
---
name: rdr-close
description: Use when an RDR is done — close it with optional post-mortem, bead status gate, and T3 archival
effort: medium
---
# RDR Close Skill
Gates on open bead status before closing. Archives post-mortem directly via `mcp__plugin_conexus_nexus__store_put`. See [${CLAUDE_PLUGIN_ROOT}/registry.yaml](../../registry.yaml).
## When This Skill Activates
- User says "close this RDR", "RDR done", "finish RDR"
- User invokes `/conexus:rdr-close`
- Implementation is complete and the RDR should be finalized
## Inputs
- **RDR ID** (required) — e.g., `003`
- **Reason** (required): Implemented | Reverted | Abandoned | Superseded
## Path Detection
Resolve RDR directory from `.nexus.yml` `indexing.rdr_paths[0]`; default `docs/rdr`. Use the Step 0 snippet from the rdr-create skill, stored as `RDR_DIR`. All file paths below use `$RDR_DIR` in place of `docs/rdr`.
## Pre-Check
1. Read T2 record: mcp__plugin_conexus_nexus__memory_get(project="{repo}_rdr", title="NNN"
2. If status is not "accepted" (or "final") and reason is "Implemented":
- Warn: "RDR NNN status is '{current_status}' — expected 'accepted'. Close anyway?"
- Require explicit user confirmation to proceed
3. If T2 record not found, check filesystem for the markdown file
## Flow: Implemented
### Step 1: Divergence Notes
Ask: "Did implementation diverge from the plan? If so, describe the divergences."
If diverged, carry the notes into the post-mortem (Step 2).
### Step 1.75: Automatic Critique
Dispatch `/conexus:substantive-critique <rdr-id>` via the Agent tool and parse the `## Verdict` block from the response. This is the authoritative gate signal (CA-1 verified n=4 for outcome-category determinism; finding-level variance is expected).
**Verdict extraction** — try in order, take the first hit:
1. **Canonical path** (preferred): find the literal line `- **outcome**:` (bullet-dash, bold "outcome", colon, space, value). The value is one of `justified`, `partial`, `not-justified`.
2. **Code-block path**: if the agent emitted the Verdict block inside a code fence, look for a line matching `outcome:\s*(\S+)` within a `## Verdict` section. Normalize the captured value case-insensitively: `FAILED`/`FAIL`/`BLOCKED`/`NOT-JUSTIFIED` → `not-justified`; `PARTIAL`/`PARTIALLY` → `partial`; `PASS`/`PASSED`/`APPROVED`/`JUSTIFIED` → `justified`.
3. **Fallback path**: if neither canonical nor code-block form is present, count `### Issue:` headers under `## Critical Issues` and `## Significant Issues`. Derive outcome mechanically: Critical > 0 → `not-justified`; Critical == 0 AND Significant > 0 → `partial`; all clear → `justified`. Surface the fallback path to the user explicitly: "The critic did not emit a canonical Verdict block. Falling back to section counting: <counts>."
All three paths give the same enum (`justified` / `partial` / `not-justified`), branched on below.
**Relay framing** (load-bearing, do not vary): the dispatch relay MUST be fixed-shape and minimal. Pass only `{rdr_id}` and the standard input artifacts (T2 RDR record, catalog entry, RDR markdown file). NEVER pass session-generated summaries of what was built, what diverged, or what the user intends. Rationalization bias is the exact failure mode this isolation prevents.
```markdown
## Relay: substantive-critic
**Task**: Critique RDR {rdr_id} against its Problem Statement for silent scope reduction, retcon, or unjustified-implemented closure.
**Bead**: none
### Input Artifacts
- nx memory: {repo}_rdr/{rdr_id} (status, research records, planning chain)
- Files: docs/rdr/rdr-{rdr_id}-*.md
- Catalog: mcp__plugin_conexus_nexus-catalog__search query "RDR-{rdr_id}"
### Deliverable
Critique report with canonical `## Verdict` block (outcome, confidence, critical_count, significant_count, summary).
### Quality Criteria
- [ ] Verdict block uses 5-field canonical format
- [ ] Findings grounded in RDR text (file:line references)
- [ ] No session context consumed beyond the listed input artifacts
```
Branch on `Verdict.outcome`:
**A. `justified`** → surface the one-line summary to the user and continue to Step 2. No constraint on `close_reason`.
**B. `partial`** → surface all Critical and Significant findings to the user verbatim. Block closing as Implemented unless the user states an explicit override reason. If there is none, prompt the user: "The critic found significant issues. Address them and re-run, or give an override reason to close anyway with an audit trail." Do not proceed until the user either resolves findings (recursive loop) or gives the override.
**C. `not-justified`** → surface ALL Critical findings verbatim. Block closing as Implemented unless the user states an explicit override reason. `close_reason: reverted` and `close_reason: partial` are legitimate non-override paths on `not-justified` — a user who genuinely wants to acknowledge failure with `reverted` should be able to do so without an override. User's options: (1) address findings and re-run with reason Implemented (recursive refinement loop), (2) re-run with reason Reverted or Partial (honest failure-acknowledgment, no override needed), or (3) give a substantive override reason to close as Implemented despite the Critical findings. A one-word reason (e.g., "wontfix") is insufficient — prompt the user to expand it before accepting. Only `close_reason: implemented` requires the override.
**D. Verdict extraction failure** → reached only when all three extraction paths fail (e.g. the critic response is empty or wholly unparseable). Surface explicitly to the user: "Critic response could not be parsed at all. Proceed without critique? (y/N)". Do not silently block; do not silently proceed.
**E. Override audit entry** (runs whenever the user overrides the critic to close as Implemented):
```
mcp__plugin_conexus_nexus__memory_put(
project="{repo}_rdr",
title="{rdr_id}-close-override-{YYYY-MM-DD}",
content="critic_verdict: {outcome}\nuser_reason: {override_reason}\nfinal_close_reason: {close_reason}\ntimestamp: {ISO8601}\nrdr_id: {rdr_id}",
tags="rdr,close-override,rdr-{rdr_id}"
# omit ttl (memory_put's ttl is int|None; permanent by omission, not the string "permanent")
)
```
If `{repo}_rdr/*-close-override-*` exceeds 20% of closes in any 30-day window, dispatch degrades to advisory mode.
**Scenario 4 — timeout or transport failure**: if the Agent tool dispatch fails, times out (>5 minutes without response), or returns an unparseable response (not just a missing Verdict block, but genuinely malformed output), ask: "Critic dispatch failed. Proceed without critique? (y/N)". Never block or proceed silently; the user chooses.
### Step 2: Create Post-Mortem
Prose register: the post-mortem's reader is the next person about to make the same mistake (see `$RDR_DIR/REGISTER.md`, falling back to `${CLAUDE_PLUGIN_ROOT}/resources/rdr/REGISTER.md`). Before finishing it, apply the register's closing check: list undefined terms and define or cut them. Clear, simple, concise.
Create `$RDR_DIR/post-mortem/NNN-kebab-title.md` from the post-mortem template. Populate:
- **RDR Summary**: Extract from the RDR's Problem Statement (or Problem) section
- **Implementation Status**: "Implemented"
- **What Diverged**: User's divergence notes
- **Drift Classification**: Prompt user to classify each divergence into categories:
- Unvalidated assumption
- Framework API detail
- Missing failure mode
- Missing Day 2 operation
- Deferred critical constraint
- Over-specified code
- Under-specified architecture
- Scope underestimation
- Internal contradiction
- Missing cross-cutting concern
### Step 3: Bead Status Gate
If T2 record has an `epic_bead` field (set during accept-time planning):
1. Read epic bead ID from T2: mcp__plugin_conexus_nexus__memory_get(project="{repo}_rdr", title="NNN"
2. Run `bd show <epic-id>` to get child bead statuses
3. Display bead status table to user:
- Bead ID, title, status (open/in_progress/closed)
- Highlight any unclosed beads
4. Do NOT automatically mark beads complete — the human decides which beads to close.
If T2 record has no `epic_bead` field (user skipped planning at accept time):
- Run `bd list --status=open` and `bd list --status=in_progress` and check the output for beads that name this RDR.
**HARD GATE — if ANY open or in-progress beads exist:**
- Display the open beads to the user
- Ask explicitly: "These beads are still open. Close this RDR anyway?"
- **Do NOT proceed until the user confirms.** This is not advisory — it is a gate.
- If the user says no, stop and let them resolve the beads first.
### Step 4: Update State
1. Update T2 record: mcp__plugin_conexus_nexus__memory_put(content="... (same fields, status: closed, closed: YYYY-MM-DD, close_reason: Implemented, archived: true)", project="{repo}_rdr", title="NNN", tags="rdr,{type},closed" # omit ttl (memory_put's ttl is int|None; permanent by omission)
If T3 archive fails, set `archived: false` — retryable by re-running `/conexus:rdr-close`
2. **Flip the file frontmatter + README via the CLI (do NOT hand-edit):**
```bash
nx rdr set-status NNN closed
```
Code-enforced flip: rewrites the RDR file `status -> closed`, adds `closed_date`, and updates the README index-row status cell in one tested action. A record still `draft` (work shipped without the accept gate) closes only with `--reason "<why it shipped without acceptance>"`, the table's guarded `close-unaccepted` edge; without it the command refuses `reason-not-stated`. Hand-edited frontmatter caused ledger drift. (`--date YYYY-MM-DD` overrides the default of today.)
3. (The README index row is updated by the command in step 2 — no separate regen step.)
3a. Run `nx memory gate-rollup --rdr NNN --all` with `--dry-run` first and tell the user its count; the real run (`--counted N`) gives the records a 30-day TTL and waits for their word. Nothing blocks the close without it.
3b. **Tick or annotate every remaining `- [ ]` checkbox in the RDR body** — check it off if done, or replace with `- [deferred: <bead-id>]` / `- [waived: <reason>]`. A closed RDR with unchecked boxes reads as hidden scope loss to every future audit.
4. **Scoped conditional reindex** — if the RDR body changed during close (e.g. divergence notes added, post-mortem link inserted, or any text outside the frontmatter block modified), run `nx index rdr` **scoped to the single RDR file**, NOT the whole corpus:
```bash
nx index rdr docs/rdr/rdr-NNN-<slug>.md
```
A frontmatter-only edit (status/closed_date/close_reason) needs no reindex: the chunk text is unchanged. Check with:
```bash
# If the diff is wholly inside the frontmatter block, skip the reindex.
git diff HEAD -- docs/rdr/rdr-NNN-*.md | grep -v '^[+-]---' | grep -v '^[+-][a-z_]*: ' | grep -E '^[+-]' | head -1
# Prints nothing → frontmatter-only → skip.
# Prints lines → body changed → run the single-file `nx index rdr <path>`.
```
**Do NOT run the directory form `nx index rdr` (no argument)** at close time: it walks the whole corpus. The file form takes only the target RDR.
### Step 5: Catalog Links (if catalog initialized)
The RDR already has a catalog entry from the original accept-time indexing. Create links to capture implementation provenance (if catalog is initialized):
1. **Code→RDR links**: Nothing generates `implements-heuristic` links any more (the pass was turned off at engine v0.1.57); an older RDR may still carry some. Review them with `nx catalog links <rdr-tumbler> --type implements-heuristic` and promote high-confidence ones to `implements` via `mcp__plugin_conexus_nexus-catalog__link` for link-boost scoring benefit (heuristic links have zero search boost weight). For a new RDR, link the implementing files with `implements` directly.
2. **RDR→prior-RDR links**: If the RDR's T2 record has a `supersedes` field, create the catalog link:
```
mcp__plugin_conexus_nexus-catalog__link(from_tumbler="<this-rdr-title>", to_tumbler="<superseded-rdr-title>", link_type="supersedes", created_by="rdr-close")
```
3. **RDR→research links**: If research findings reference indexed papers, create `cites` links:
- Read T2 research findings for this RDR
- For each finding with a URL or paper title as source, search catalog: `mcp__plugin_conexus_nexus-catalog__search(query="<source>")`
- If found, resolve the RDR tumbler (`mcp__plugin_conexus_nexus-catalog__search(query="RDR-NNN")`), then: `mcp__plugin_conexus_nexus-catalog__link(from_tumbler="<rdr-tumbler>", to_tumbler="<paper-tumbler>", link_type="cites", created_by="rdr-close")`
Skip all catalog steps silently if catalog is not initialized. The T2 record and markdown are the authorities — catalog links are supplementary graph enrichment.
### Step 6: T3 Archive (post-mortem only)
The main RDR is already in its `rdr__` collection from `nx index repo`, drafts included (and refreshed in Step 4 only if the body changed during close). Do **not** duplicate it with store_put tool — that would create non-CCE blob entries in the same collection, degrading search quality.
Per the collection rules (https://github.com/Hellblazer/nexus/blob/main/docs/collections.md), Rule 1, a knowledge collection is a subject area, never an owner id. The post-mortem's target is the bare subject `{repo}-rdr-research` (per Rule 3, never the four-segment form — `store_put` finds the collection by its attributes and, on first write, mints it), with `category="rdr_postmortem"` stamped on the chunk metadata so it is queryable as a distinct slice without needing its own collection.
Check for an existing subject before writing (Rule 2, reuse before create). A new subject's collection is labelled `c<id>` by the engine, so it is found by its CONTENT_TYPE and OWNER columns (OWNER is the subject), not by its name; a live collection named `knowledge__<subject>__...` counts too, and a retired one does not:
```bash
SUBJECT="$(printf '%s' "{repo}" | tr _ -)-rdr-research" # the engine turns _ into - in a subject
subject_collections() { nx collection list | awk -v s="$SUBJECT" '$1=="NAME"{for(i=1;i<=NF;i++){if($i=="CONTENT_TYPE")t=i;if($i=="OWNER")o=i};next} /superseded->/{next} {split($1,p,"__")} (t&&o&&$t=="knowledge"&&$o==s)||(p[1]=="knowledge"&&p[2]==s){print $1}'; }
subject_collections
```
It prints the collection's name, or nothing when the subject has none. If it prints one, reuse it — pass its bare subject name to `store_put` below regardless; the catalog resolves the rest. If it prints nothing and the legacy `knowledge__rdr_postmortem__<repo>` collection exists, run the one-time migration below BEFORE the first `store_put`.
Seed link-context so the post-mortem auto-links to the RDR:
```
mcp__plugin_conexus_nexus__scratch(action="put", content='{"targets": [{"tumbler": "<rdr-tumbler>", "link_type": "relates"}], "source_agent": "rdr-close"}', tags="link-context")
```
Archive the post-mortem directly:
```
mcp__plugin_conexus_nexus__store_put(
content=(contents of $RDR_DIR/post-mortem/NNN-kebab-title.md),
collection="{repo}-rdr-research",
title="PREFIX-NNN Title (post-mortem)",
tags="rdr,post-mortem,{drift-categories}",
category="rdr_postmortem"
)
```
Post-mortems are then queryable as a slice of the knowledge collection:
```
mcp__plugin_conexus_nexus__search(query="...", corpus="knowledge__{repo}-rdr-research", where='category=rdr_postmortem')
```
#### One-time migration (the legacy `knowledge__rdr_postmortem__<repo>` collection)
Rename that collection onto the subject BEFORE the first `store_put` to `{repo}-rdr-research`: `nx catalog rename-collection` refuses a target that exists, and a first `store_put` on a new subject mints a `c<id>` label, leaving no conformant name to rename onto. The target is the subject's four-segment name with the legacy collection's own model (a rename never re-embeds):
```bash
CUR="${CUR:?set CUR to the model this install writes knowledge in (read it as described below)}"
[ -n "${SUBJECT:-}" ] && type subject_collections >/dev/null 2>&1 || { echo "run the reuse check above first" >&2; exit 1; }
OLD="knowledge__rdr_postmortem__<repo>"
# the subject must have no live collection yet, whatever its label: `subject_collections` from the reuse check above
[ -z "$(subject_collections)" ] \
|| { echo "$SUBJECT already has a collection: skip" >&2; exit 1; }
# the legacy collection's model, by the MODEL header; a retired (superseded) row is not the collection
MODEL=$(nx collection list | awk -v o="$OLD" '$1=="NAME"{for(i=1;i<=NF;i++) if($i=="MODEL") c=i; next} /superseded->/{next} $1==o && c {print $c; exit}')
[ -n "$MODEL" ] || { echo "$OLD is not listed: nothing to migrate" >&2; exit 1; }
[ "$MODEL" != "-" ] || { echo "no registered model for $OLD: skip" >&2; exit 1; }
[ "$MODEL" = "$CUR" ] || { echo "MODEL is $MODEL, this install writes $CUR: skip" >&2; exit 1; }
nx catalog rename-collection "$OLD" "knowledge__${SUBJECT}__${MODEL}__v1" --yes
```
`nx collection list` has no `--json` form, so the filters read NAME (first word) and the CONTENT_TYPE, OWNER and MODEL headers, never a column position or a name split; the legacy name keeps `<repo>` as written. Afterwards the bare subject resolves to this collection for `store_put` and `search(corpus="knowledge__{repo}-rdr-research")`, but only when `MODEL` is the model this install writes knowledge in today, so the block stops unless `MODEL` equals `CUR`; otherwise a later `store_put` mints a second collection.
Set `CUR` to what this install writes knowledge in today:
- cloud mode: `voyage-context-3`;
- local mode: read `nx config get local.embed_model`. A value starting `voyage` means `voyage-context-3`; any other value means `bge-base-en-v15-768`. When it is unset, a Voyage key saved in `config.yml` (shown by `nx config list`) means `voyage-context-3`, and no saved key means `bge-base-en-v15-768`. A key that is only in the environment does not choose the model.
**Skip** (legacy post-mortems stay findable by their old collection and tags: `search(corpus="knowledge__rdr_postmortem__<repo>")`) when the subject already has a collection, when `MODEL` is not your current knowledge model, or when the post-mortems sit in an owner-id-shaped `knowledge__<owner-id>__...` collection that holds other knowledge too. Not `nx catalog migrate-fallback`: it re-points documents onto owner-id-shaped targets and does not move chunks.
Renamed chunks lack `category="rdr_postmortem"`; they stay findable by their `tags="rdr,post-mortem,..."`. To add the category, re-run `store_put` with it against the subject, overwriting by title.
## Flow: Reverted or Abandoned
1. Prompt for reason (free text) — e.g. "reverted" (implementation started, then rolled back) or "never going to happen". This reason is recorded in T2 and the post-mortem only; it is NOT a file status. The lifecycle table's status domain is `{draft, accepted, deferred, closed, superseded, abandoned}` — `reverted` was explicitly retired, so both reasons above close the file to the SAME status, `abandoned`.
2. Offer post-mortem (useful for capturing what was learned, even from abandoned work)
3. Update T2 record with close reason — record the reason text (e.g. "reverted") even though the file status written in step 4 is always `abandoned`.
4. **Flip the file frontmatter + README via the CLI (do NOT hand-edit):** run `nx rdr set-status NNN abandoned`. Code-enforced — same ledger-drift fix as the Implemented flow. (`reverted` is not a valid `set-status` target — the CLI exits 2 on it; the T2 reason from step 3 is where "reverted" is recorded.)
5. **Scoped conditional reindex** — if the RDR body changed, run `nx index rdr docs/rdr/rdr-NNN-<slug>.md` (single-file form). A frontmatter-only `status: abandoned` flip does not warrant a reindex. Apply the same diff check from Step 4 of the Implemented flow.
6. Archive post-mortem (if created) to the conformant knowledge collection via Step 6 of the Implemented flow: same `{repo}-rdr-research` subject, same `category="rdr_postmortem"` stamp.
7. (README index row is updated by `set-status` in step 4 — no separate regen.)
## Flow: Superseded
1. Prompt for superseding RDR ID
2. **Write `superseded_by` into the OLD RDR's YAML frontmatter FIRST.** `nx rdr set-status ... superseded`'s `successor` guard reads this key from the file AT CALL TIME and refuses `successor-not-named` if it is absent — the frontmatter edit must happen BEFORE the CLI call in step 3, never after. Edit the old RDR's frontmatter block to add (or set) the key:
```
superseded_by: "RDR-NNN"
```
(NNN = the superseding RDR's numeric ID.)
3. **Flip the old RDR's file status + README via the CLI:** run `nx rdr set-status MMM superseded` (code-enforced; do NOT hand-edit the `status:` line itself — the frontmatter edit in step 2 is the only direct edit, and it comes first). The README index cell is written as "Superseded by RDR-NNN" automatically, reading the `superseded_by` key from step 2. Then cross-link both RDRs (bidirectional):
- **Old RDR**: In T2, set `superseded_by: "RDR-NNN"` (the T2 record; separate from the frontmatter key already written in step 2). In markdown BODY (below the frontmatter fence), add a "Superseded by RDR-NNN" note.
- **New RDR**: In T2, set `supersedes: "MMM"`. In markdown, add "Supersedes RDR-MMM" note
4. **Scoped reindex** — this flow typically DOES warrant a reindex because the markdown notes added in step 3 live in the RDR body. Run the single-file form: `nx index rdr docs/rdr/rdr-NNN-<slug>.md` on the OLD RDR, and separately on the NEW RDR. Two files → two single-file invocations. Do NOT run the whole-corpus form.
5. **Catalog link** (if catalog initialized): Create `supersedes` link in the catalog so the graph reflects the relationship:
```
# Find both RDRs by title in catalog
mcp__plugin_conexus_nexus-catalog__link(from_tumbler="<new-rdr-title>", to_tumbler="<old-rdr-title>", link_type="supersedes", created_by="rdr-close")
```
If catalog is not initialized or either RDR is not found, skip silently — the T2 record is the authority.
6. Regenerate index
## Failure Handling
The close operation performs multiple state mutations. If any step fails:
- Each step emits clear status (e.g., "T2 updated ✓", "Bead gate ✓", "T3 archive ✗ FAILED")
- T2 `archived` flag tracks whether T3 archival succeeded
- Re-running `/conexus:rdr-close` is idempotent: checks T2 state and skips completed steps
## Agent Invocation
**Only one agent is dispatched by this skill:** `substantive-critic` (Step 1.75, implemented close only). All other operations use MCP tools directly.
Post-mortem archival calls `mcp__plugin_conexus_nexus__store_put` directly (no agent spawn), as Step 6 shows: the bare subject `{repo}-rdr-research` (never the owner-id-shaped `nx catalog collection-name --content-type knowledge` resolution), `category="rdr_postmortem"`, with link-context seeded first.
## Success Criteria
- [ ] RDR directory resolved from `.nexus.yml` `indexing.rdr_paths[0]` (default `docs/rdr`)
- [ ] Pre-check completed (status verified, warnings issued for non-Final RDRs)
- [ ] Divergence notes captured from user (if implementation diverged)
- [ ] Post-mortem created with drift classification (if diverged or reverted/abandoned)
- [ ] Open beads displayed and user asked for explicit confirmation before proceeding
- [ ] Beads NOT auto-closed — human decides
- [ ] T2 record updated with close reason, date, epic bead ID, and archived flag
- [ ] T3 semantic index refreshed via `nx index rdr` **only if the RDR body changed during close** (divergence notes added, cross-link notes inserted, etc.) — skipped for frontmatter-only closes
- [ ] Post-mortem archived to the conformant knowledge collection (the `{repo}-rdr-research` subject) with `category="rdr_postmortem"` (if exists)
- [ ] README index regenerated
- [ ] Idempotent: re-running skips completed steps
## Agent-Specific PRODUCE
Outputs produced by this skill directly:
- **Console output**: Bead status gate table (if epic_bead in T2)
- **T2 memory**: Close metadata via memory_put tool: project="{repo}_rdr", title="NNN", tags="rdr,{type},closed" (omit `ttl`; permanent by omission)
- **T3 semantic index**: Conditionally refreshed via `nx index rdr` (CCE embeddings, section-level chunks) — only when the RDR body changed during close; frontmatter-only edits are skipped
- **Filesystem**: Post-mortem at `$RDR_DIR/post-mortem/NNN-kebab-title.md`, updated README
- **T3 knowledge**: Post-mortem archive via `mcp__plugin_conexus_nexus__store_put`: content=(post-mortem contents), collection="{repo}-rdr-research" (the subject collection, never the owner-id-shaped `nx catalog collection-name --content-type knowledge` resolution), title="RDR-NNN: {title} (post-mortem)", category="rdr_postmortem" (called directly, no agent spawn)
## Does NOT
- Force close if gate hasn't passed (warns, allows override)
- Delete the markdown file (it stays in the repo permanently)
- Auto-commit (user decides when to commit)