Quality - the architecture, the code and the test coverage, judged
Three deliberate captures share this skill. Each part is a reference the run reads and follows; the first word picks
one part, and the typed command with no topic word runs all three behind one ask.
| Part |
Topic words |
Writes |
Seats |
| architecture-quality |
architecture-quality, architecture |
<docs-path>/quality/ARCHITECTURE-ASSESSMENT.md |
architecture-analyzer |
| code-quality |
code-quality, code |
<docs-path>/quality/CODE-ASSESSMENT.md |
code-quality-analyzer |
| test-coverage-quality |
test-coverage-quality, test-coverage, coverage |
<docs-path>/quality/COVERAGE-QUALITY.md, <docs-path>/quality/coverage-raw/ |
test-coverage-analyzer |
When to use
- A topic word picks one part:
/capture-quality coverage src/api, /capture-quality code,
/capture-quality architecture.
- The chain of all three runs only on the typed
/capture-quality with no topic word, or a request that asks in words
for all the quality captures. A description match runs the one part the request names.
- The chain asks first - one call, one question per part plus the mode - and no part asks its run gate again.
- Not for fixing the findings or raising coverage (the quality loops:
/loop-architecture-quality,
/loop-code-quality, /loop-test-coverage-quality), building the architecture map (the awareness capture's architecture part), recording
the code style, a security audit (the security-auditor seat) or one diff (task-verify-code, review-code). Each part's
own ## When to use names the rest of its boundary.
- A part's run gate is there because a conversational question - 'what are the risks here?', 'what is our
coverage?' - can match this skill: no seats, instrumented suite or doc rewrite start on a description match without
its answer. A bare 'is this code any good?' measured no load (0 of 10), so the code part runs from its topic word or
a request that names the code assessment.
Modes. Mode flags right after the command - --mode-auto-run-on, --mode-auto-run-off, --mode-output-scorer-on, --mode-output-scorer-off - are switches, not the request: strip them; with only flags typed, run as with no arguments. Under the hook's auto-run contract, follow it. With no hook line (hooks off, Cursor), -on holds for this run only: each stop takes its (Recommended) option, listed in the close, an unmarked one waits, nothing goes outward, no fresh-session hand-off, and the close says auto-run ended; --mode-output-scorer-on grades this run's output like a typed stack.
1. The topic word
Read the arguments in this order.
Strip the mode flags (--mode-auto-run-on, --mode-auto-run-off, --mode-output-scorer-on,
--mode-output-scorer-off).
Take the first remaining word, compared whole and case-insensitively against the table's topic words. A word
holding /, \ or . never matches, because it is a path.
A match picks that part. A mode word next (section 4) marks a calling flow; every word after it is the part's own
arguments - the scope or target the part reads.
No match: who started the load decides.
- The user's message is the typed
/capture-quality command, or asks in words for all the quality captures: the
chain runs (section 3), and every remaining word is the target handed to each part it runs.
- Otherwise the model loaded the skill on a request (a description match). The part is the one the request names,
matched against the table's Writes and topic words ('what is our coverage?' names the coverage part). When it
names none, or more than one, ONE single-select question picks the part, the part closest to the request's words
first and Recommended. The chain never runs on a description match, because three full runs are never what one
question asked for.
- On a description match the remaining words are a target only when they name a path that exists. Otherwise there is
no target, so 'test coverage' never becomes a scope.
The part's own run gate still applies on a description match, because no calling flow started it (section 4).
| Arguments |
Result |
coverage |
the coverage part, no target |
Coverage src/api |
the coverage part, target src/api |
coverage/ |
the chain, target coverage/ |
coverages |
the chain, target coverages |
--mode-auto-run-on code |
the code part, with auto-run on |
| empty, or flags only, the user's message the typed command |
the chain, no target |
| empty, a description match on 'what is our test coverage?' |
the coverage part, no target, its run gate asked |
test coverage, a description match on 'how is our test coverage?' |
the coverage part, no target (no path named test) |
| empty, a description match on 'assess the quality of this service' |
ONE question: code-quality (Recommended), architecture-quality, test-coverage-quality |
The part pick, when a description match names none of the parts or more than one - the other two in table order:
Which quality capture should run? The request names none of the three parts, or more than one.
- '<the part closest to the request's words> (Recommended)' - its Writes or topic words come nearest the request
- '<the next part in table order>' - writes <its doc>
- '<the last part in table order>' - writes <its doc>
2. One part
The part runs alone, with its target, by its own reference - its run gate, mode ask, steps and REPORT as written there:
- architecture-quality: read
references/architecture-quality.md and follow it. Alone, it runs section 3 step 1's
state block first: its INLINE verify-and-rewrite path keys on the architecture-quality: line that block prints.
references/architecture-quality-doc-shape.md - the findings gate, the buckets and the doc's shape, read before JUDGE.
- code-quality: read
references/code-quality.md and follow it.
references/code-quality-doc-shape.md - the rule sources, the findings gate and the doc's shape, read before JUDGE.
- test-coverage-quality: read
references/test-coverage-quality.md and follow it.
references/test-coverage-quality-weak-points.md - the exclusions, the findings gate and the buckets, read at ANALYZE.
Each part's contract file is read in full at its step, never from the part's mention alone.
3. The chain
With no topic word on the typed command, ask once, then run the chosen parts in table order.
The state script. It has TWO homes - this skill's copy under .claude/skills/, or the stack's plugin cache, where
the newest version is taken - so resolve and run it in one block from the project root:
QS=.claude/skills/capture-quality/scripts/quality-state.js
[ -f "$QS" ] || QS=$(for d in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}"/plugins/cache/*/*/*; do # one glob: zsh aborts the loop when any named glob matches nothing
PN=${d%/*}; PN=${PN##*/}; [ "$PN" = alfred-code ] || continue
f="$d/stack/skills/capture-quality/scripts/quality-state.js"
[ -f "$f" ] && [ ! -e "$d/.orphaned_at" ] && printf '%s\t%s\n' "$(basename "$d")" "$f"
done 2>/dev/null | sort -V | tail -1 | cut -f2)
if [ -n "$QS" ]; then node "$QS"; else echo "quality-state: absent"; fi
It prints one line per part - absent, unstamped, current <branch>@<sha> or stale <branch>@<sha> (<why>).
quality-state: absent means neither home has it: say so, and read each part as absent where its doc is missing
and stale (state unknown) where it exists - never compare stamps to git by hand.
Put ONE AskUserQuestion call:
- one question per part, single-select, filled from the template below that matches its state line;
- a fourth question, the mode template, only when dispatch is available. With no dispatch every part runs INLINE
and the question is not asked.
The answer is each part's run gate and mode answer: no part asks either again.
Run each part whose answer is not 'Skip it' by reading its reference and following it, in table order, with the
chain's target and mode.
Close with one line per part (section 5).
No part recommends a skip. The two assessments keep no zero-drift shortcut, because a changed rule, an accepted
decision or a shipped fix changes the answer even when the code did not; the coverage part's own update gate
recommends the re-measure and keeps its report-only answer.
For absent, any part:
Run the <part> capture? <DOC> does not exist yet.
- 'Run it (Recommended)' - the part's first run; it writes <DOC>
- 'Skip it' - nothing runs for <part>
For unstamped, any part:
<DOC> has no stamp, so its state is unknown. Refresh it?
- 'Refresh it (Recommended)' - the part runs again and stamps <DOC>
- 'Skip it' - <DOC> stays as it is
For stale, the two assessments:
<DOC> is stale (<why>). Refresh it?
- 'Refresh it (Recommended)' - the part's full run; <DOC> is replaced
- 'Skip it' - <DOC> stays as it is
For current, the code-quality part:
CODE-ASSESSMENT.md is current at this HEAD. Run it again?
- 'Run it again (Recommended)' - a changed rule, decision or shipped fix still changes the answer when the code did not
- 'Skip it' - CODE-ASSESSMENT.md stays as it is
For stale or current, the coverage part - its own update gate, with its report-only answer kept:
COVERAGE-QUALITY.md is <stale (<why>)|current at this HEAD>. Re-measure every surface and reconcile it?
- 'Re-measure and reconcile (Recommended)' - each surface's suite runs once, its raw files are replaced
- 'Report from the existing COVERAGE-QUALITY.md only' - nothing runs, nothing is written; the close reports from the doc
- 'Skip it' - nothing runs for test-coverage-quality
For current, the architecture part:
ARCHITECTURE-ASSESSMENT.md is current at this HEAD. Verify and rewrite it, run it in full, or skip it?
- 'Verify and rewrite at this HEAD (Recommended)' - every recorded entry re-measured, the accepted decisions folded in, one whole-file Write
- 'Run it in full' - a fresh judgment, seats as picked in the mode question
- 'Skip it' - ARCHITECTURE-ASSESSMENT.md stays as it is
The mode question:
Run the chosen parts through their analyzer seats or in this session?
- 'Through the seats (Recommended)' - the cheap seats absorb the reads; the judgment and the writes stay here
- 'In this session' - navigation-tools-first and bounded, no dispatch
- The architecture part's verify-and-rewrite path dispatches nothing, so it runs in this session whatever the mode
answer.
- 'Refresh it' and 'Run it again' are each part's full run - for the coverage part, its UPDATE path.
- A chain that picks the coverage part with no coverage doc asks that part's first-capture questions (the % bar, the
exclusions) in ONE more AskUserQuestion call, right after the chain ask and before any part runs - never deferred to
the middle of the run.
- The mode answer reaches the coverage part only on a first capture: its update analysis is INLINE by its own rule.
- Under auto-run (the hook's contract, or
--mode-auto-run-on with no hook line), each question takes its Recommended
option.
- The chain is one skill load. The parts are read, not re-invoked: no fresh-session gate fires between parts.
4. Callers
- A calling flow hands
<topic> <DELEGATED|INLINE> <target>. A mode word right after the topic marks a run a flow
started: it skips the part's run gate and mode ask, and inherits the mode.
- A person may type the same form, and has then chosen.
5. The close
One part: its REPORT, as its reference writes it. The chain: one line per part in table order, then each part's REPORT
below it.
architecture-quality: ran - <its REPORT block's first line> | skipped | stopped - <why>
code-quality: ran - <...> | skipped | stopped - <why>
test-coverage-quality: ran - <...> | skipped | stopped - <why>
1---2name: capture-quality3description: "Use when asked about test coverage, or to assess how good the code or architecture is - deliberate only. Not for fixes or writing tests (the quality loops)."4metadata:5 source: https://skillmd.com/skills/envoydev/capture-quality6---78# Quality - the architecture, the code and the test coverage, judged910Three deliberate captures share this skill. Each part is a reference the run reads and follows; the first word picks11one part, and the typed command with no topic word runs all three behind one ask.1213| Part | Topic words | Writes | Seats |14|---|---|---|---|15| architecture-quality | `architecture-quality`, `architecture` | `<docs-path>/quality/ARCHITECTURE-ASSESSMENT.md` | architecture-analyzer |16| code-quality | `code-quality`, `code` | `<docs-path>/quality/CODE-ASSESSMENT.md` | code-quality-analyzer |17| test-coverage-quality | `test-coverage-quality`, `test-coverage`, `coverage` | `<docs-path>/quality/COVERAGE-QUALITY.md`, `<docs-path>/quality/coverage-raw/` | test-coverage-analyzer |1819## When to use2021- A topic word picks one part: `/capture-quality coverage src/api`, `/capture-quality code`,22 `/capture-quality architecture`.23- The chain of all three runs only on the typed `/capture-quality` with no topic word, or a request that asks in words24 for all the quality captures. A description match runs the one part the request names.25- The chain asks first - one call, one question per part plus the mode - and no part asks its run gate again.26- Not for fixing the findings or raising coverage (the quality loops: `/loop-architecture-quality`,27 `/loop-code-quality`, `/loop-test-coverage-quality`), building the architecture map (the awareness capture's architecture part), recording28 the code style, a security audit (the security-auditor seat) or one diff (task-verify-code, review-code). Each part's29 own `## When to use` names the rest of its boundary.30- A part's run gate is there because a conversational question - 'what are the risks here?', 'what is our31 coverage?' - can match this skill: no seats, instrumented suite or doc rewrite start on a description match without32 its answer. A bare 'is this code any good?' measured no load (0 of 10), so the code part runs from its topic word or33 a request that names the code assessment.3435**Modes.** Mode flags right after the command - `--mode-auto-run-on`, `--mode-auto-run-off`, `--mode-output-scorer-on`, `--mode-output-scorer-off` - are switches, not the request: strip them; with only flags typed, run as with no arguments. Under the hook's auto-run contract, follow it. With no hook line (hooks off, Cursor), `-on` holds for this run only: each stop takes its `(Recommended)` option, listed in the close, an unmarked one waits, nothing goes outward, no fresh-session hand-off, and the close says auto-run ended; `--mode-output-scorer-on` grades this run's output like a typed stack.3637## 1. The topic word3839Read the arguments in this order.40411. Strip the mode flags (`--mode-auto-run-on`, `--mode-auto-run-off`, `--mode-output-scorer-on`,42 `--mode-output-scorer-off`).432. Take the first remaining word, compared whole and case-insensitively against the table's topic words. A word44 holding `/`, `\` or `.` never matches, because it is a path.453. A match picks that part. A mode word next (section 4) marks a calling flow; every word after it is the part's own46 arguments - the scope or target the part reads.474. No match: who started the load decides.48 - The user's message is the typed `/capture-quality` command, or asks in words for all the quality captures: the49 chain runs (section 3), and every remaining word is the target handed to each part it runs.50 - Otherwise the model loaded the skill on a request (a description match). The part is the one the request names,51 matched against the table's Writes and topic words ('what is our coverage?' names the coverage part). When it52 names none, or more than one, ONE single-select question picks the part, the part closest to the request's words53 first and Recommended. The chain never runs on a description match, because three full runs are never what one54 question asked for.55 - On a description match the remaining words are a target only when they name a path that exists. Otherwise there is56 no target, so 'test coverage' never becomes a scope.5758 The part's own run gate still applies on a description match, because no calling flow started it (section 4).5960| Arguments | Result |61|---|---|62| `coverage` | the coverage part, no target |63| `Coverage src/api` | the coverage part, target `src/api` |64| `coverage/` | the chain, target `coverage/` |65| `coverages` | the chain, target `coverages` |66| `--mode-auto-run-on code` | the code part, with auto-run on |67| empty, or flags only, the user's message the typed command | the chain, no target |68| empty, a description match on 'what is our test coverage?' | the coverage part, no target, its run gate asked |69| `test coverage`, a description match on 'how is our test coverage?' | the coverage part, no target (no path named `test`) |70| empty, a description match on 'assess the quality of this service' | ONE question: code-quality (Recommended), architecture-quality, test-coverage-quality |7172The part pick, when a description match names none of the parts or more than one - the other two in table order:7374```ask75Which quality capture should run? The request names none of the three parts, or more than one.76- '<the part closest to the request's words> (Recommended)' - its Writes or topic words come nearest the request77- '<the next part in table order>' - writes <its doc>78- '<the last part in table order>' - writes <its doc>79```8081## 2. One part8283The part runs alone, with its target, by its own reference - its run gate, mode ask, steps and REPORT as written there:8485- architecture-quality: read `references/architecture-quality.md` and follow it. Alone, it runs section 3 step 1's86 state block first: its INLINE verify-and-rewrite path keys on the `architecture-quality:` line that block prints.87 - `references/architecture-quality-doc-shape.md` - the findings gate, the buckets and the doc's shape, read before JUDGE.88- code-quality: read `references/code-quality.md` and follow it.89 - `references/code-quality-doc-shape.md` - the rule sources, the findings gate and the doc's shape, read before JUDGE.90- test-coverage-quality: read `references/test-coverage-quality.md` and follow it.91 - `references/test-coverage-quality-weak-points.md` - the exclusions, the findings gate and the buckets, read at ANALYZE.9293Each part's contract file is read in full at its step, never from the part's mention alone.9495## 3. The chain9697With no topic word on the typed command, ask once, then run the chosen parts in table order.98991. The state script. It has TWO homes - this skill's copy under `.claude/skills/`, or the stack's plugin cache, where100 the newest version is taken - so resolve and run it in one block from the project root:101102 ```bash103 QS=.claude/skills/capture-quality/scripts/quality-state.js104 [ -f "$QS" ] || QS=$(for d in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}"/plugins/cache/*/*/*; do # one glob: zsh aborts the loop when any named glob matches nothing105 PN=${d%/*}; PN=${PN##*/}; [ "$PN" = alfred-code ] || continue106 f="$d/stack/skills/capture-quality/scripts/quality-state.js"107 [ -f "$f" ] && [ ! -e "$d/.orphaned_at" ] && printf '%s\t%s\n' "$(basename "$d")" "$f"108 done 2>/dev/null | sort -V | tail -1 | cut -f2)109 if [ -n "$QS" ]; then node "$QS"; else echo "quality-state: absent"; fi110 ```111112 It prints one line per part - `absent`, `unstamped`, `current <branch>@<sha>` or `stale <branch>@<sha> (<why>)`.113 `quality-state: absent` means neither home has it: say so, and read each part as `absent` where its doc is missing114 and `stale (state unknown)` where it exists - never compare stamps to git by hand.1152. Put ONE AskUserQuestion call:116 - one question per part, single-select, filled from the template below that matches its state line;117 - a fourth question, the mode template, only when dispatch is available. With no dispatch every part runs INLINE118 and the question is not asked.119120 The answer is each part's run gate and mode answer: no part asks either again.1213. Run each part whose answer is not 'Skip it' by reading its reference and following it, in table order, with the122 chain's target and mode.1234. Close with one line per part (section 5).124125No part recommends a skip. The two assessments keep no zero-drift shortcut, because a changed rule, an accepted126decision or a shipped fix changes the answer even when the code did not; the coverage part's own update gate127recommends the re-measure and keeps its report-only answer.128129For `absent`, any part:130131```ask132Run the <part> capture? <DOC> does not exist yet.133- 'Run it (Recommended)' - the part's first run; it writes <DOC>134- 'Skip it' - nothing runs for <part>135```136137For `unstamped`, any part:138139```ask140<DOC> has no stamp, so its state is unknown. Refresh it?141- 'Refresh it (Recommended)' - the part runs again and stamps <DOC>142- 'Skip it' - <DOC> stays as it is143```144145For `stale`, the two assessments:146147```ask148<DOC> is stale (<why>). Refresh it?149- 'Refresh it (Recommended)' - the part's full run; <DOC> is replaced150- 'Skip it' - <DOC> stays as it is151```152153For `current`, the code-quality part:154155```ask156CODE-ASSESSMENT.md is current at this HEAD. Run it again?157- 'Run it again (Recommended)' - a changed rule, decision or shipped fix still changes the answer when the code did not158- 'Skip it' - CODE-ASSESSMENT.md stays as it is159```160161For `stale` or `current`, the coverage part - its own update gate, with its report-only answer kept:162163```ask164COVERAGE-QUALITY.md is <stale (<why>)|current at this HEAD>. Re-measure every surface and reconcile it?165- 'Re-measure and reconcile (Recommended)' - each surface's suite runs once, its raw files are replaced166- 'Report from the existing COVERAGE-QUALITY.md only' - nothing runs, nothing is written; the close reports from the doc167- 'Skip it' - nothing runs for test-coverage-quality168```169170For `current`, the architecture part:171172```ask173ARCHITECTURE-ASSESSMENT.md is current at this HEAD. Verify and rewrite it, run it in full, or skip it?174- 'Verify and rewrite at this HEAD (Recommended)' - every recorded entry re-measured, the accepted decisions folded in, one whole-file Write175- 'Run it in full' - a fresh judgment, seats as picked in the mode question176- 'Skip it' - ARCHITECTURE-ASSESSMENT.md stays as it is177```178179The mode question:180181```ask182Run the chosen parts through their analyzer seats or in this session?183- 'Through the seats (Recommended)' - the cheap seats absorb the reads; the judgment and the writes stay here184- 'In this session' - navigation-tools-first and bounded, no dispatch185```186187- The architecture part's verify-and-rewrite path dispatches nothing, so it runs in this session whatever the mode188 answer.189- 'Refresh it' and 'Run it again' are each part's full run - for the coverage part, its UPDATE path.190- A chain that picks the coverage part with no coverage doc asks that part's first-capture questions (the % bar, the191 exclusions) in ONE more AskUserQuestion call, right after the chain ask and before any part runs - never deferred to192 the middle of the run.193- The mode answer reaches the coverage part only on a first capture: its update analysis is INLINE by its own rule.194- Under auto-run (the hook's contract, or `--mode-auto-run-on` with no hook line), each question takes its Recommended195 option.196- The chain is one skill load. The parts are read, not re-invoked: no fresh-session gate fires between parts.197198## 4. Callers199200- A calling flow hands `<topic> <DELEGATED|INLINE> <target>`. A mode word right after the topic marks a run a flow201 started: it skips the part's run gate and mode ask, and inherits the mode.202- A person may type the same form, and has then chosen.203204## 5. The close205206One part: its REPORT, as its reference writes it. The chain: one line per part in table order, then each part's REPORT207below it.208209```text210architecture-quality: ran - <its REPORT block's first line> | skipped | stopped - <why>211code-quality: ran - <...> | skipped | stopped - <why>212test-coverage-quality: ran - <...> | skipped | stopped - <why>213```