mandrel 2.7.0 → 2.8.0
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.
- package/.agents/README.md +104 -330
- package/.agents/agents/auditor.md +135 -0
- package/.agents/agents/plan-critic.md +80 -0
- package/.agents/audit-checklists/dependencies.md +7 -0
- package/.agents/audit-checklists/documentation.md +1 -0
- package/.agents/docs/SDLC.md +69 -162
- package/.agents/docs/configuration.md +133 -499
- package/.agents/docs/quality-gates.md +59 -180
- package/.agents/instructions.md +170 -295
- package/.agents/rules/changelog-style.md +8 -66
- package/.agents/rules/ci-remediation.md +65 -124
- package/.agents/rules/gherkin-standards.md +10 -31
- package/.agents/rules/git-conventions-reference.md +28 -61
- package/.agents/rules/git-conventions.md +1 -1
- package/.agents/rules/orchestration-error-handling.md +5 -15
- package/.agents/rules/security-baseline.md +7 -13
- package/.agents/rules/shell-conventions.md +4 -13
- package/.agents/rules/test-seams.md +2 -2
- package/.agents/rules/testing-standards.md +7 -17
- package/.agents/skills/core/api-and-interface-design/SKILL.md +23 -297
- package/.agents/skills/core/api-and-interface-design/reference.md +76 -0
- package/.agents/skills/core/browser-testing-with-devtools/SKILL.md +20 -327
- package/.agents/skills/core/browser-testing-with-devtools/reference.md +74 -0
- package/.agents/skills/core/code-review-and-quality/reference.md +16 -398
- package/.agents/skills/core/debugging-and-error-recovery/reference.md +14 -281
- package/.agents/skills/core/documentation-and-adrs/reference.md +42 -338
- package/.agents/skills/core/git-workflow-and-versioning/SKILL.md +28 -326
- package/.agents/skills/core/idea-refinement/SKILL.md +67 -193
- package/.agents/skills/core/security-and-hardening/SKILL.md +15 -31
- package/.agents/skills/core/security-and-hardening/reference.md +15 -273
- package/.agents/skills/skills.index.json +5 -5
- package/.agents/skills/stack/qa/gherkin-authoring/SKILL.md +16 -222
- package/.agents/skills/stack/qa/gherkin-authoring/reference.md +157 -0
- package/.agents/skills/stack/qa/playwright/SKILL.md +0 -29
- package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +19 -23
- package/.agents/skills/stack/qa/qa-harness/SKILL.md +35 -53
- package/.agents/skills/stack/qa/vitest/SKILL.md +0 -29
- package/.agents/workflows/audit-accessibility.md +34 -108
- package/.agents/workflows/audit-architecture.md +35 -123
- package/.agents/workflows/audit-clean-code.md +19 -78
- package/.agents/workflows/audit-data-model.md +32 -100
- package/.agents/workflows/audit-dependencies.md +47 -111
- package/.agents/workflows/audit-devops.md +16 -83
- package/.agents/workflows/audit-documentation.md +46 -93
- package/.agents/workflows/audit-navigability.md +26 -80
- package/.agents/workflows/audit-performance.md +40 -106
- package/.agents/workflows/audit-privacy.md +17 -80
- package/.agents/workflows/audit-quality.md +35 -99
- package/.agents/workflows/audit-security.md +20 -78
- package/.agents/workflows/audit-seo.md +20 -98
- package/.agents/workflows/audit-sre.md +20 -88
- package/.agents/workflows/audit-to-stories.md +1 -8
- package/.agents/workflows/audit-ux-ui.md +17 -80
- package/.agents/workflows/deliver.md +54 -9
- package/.agents/workflows/git-cleanup.md +50 -275
- package/.agents/workflows/helpers/audit-lens-core.md +230 -0
- package/.agents/workflows/helpers/code-review.md +11 -23
- package/.agents/workflows/helpers/deliver-story-reference.md +114 -17
- package/.agents/workflows/helpers/deliver-story.md +26 -186
- package/.agents/workflows/helpers/qa-core.md +174 -0
- package/.agents/workflows/helpers/qa-run-scenario-reference.md +35 -0
- package/.agents/workflows/helpers/qa-run-scenario.md +11 -25
- package/.agents/workflows/helpers/worktree-lifecycle.md +6 -67
- package/.agents/workflows/mandrel-update.md +7 -13
- package/.agents/workflows/plan.md +17 -15
- package/.agents/workflows/qa-assist.md +140 -269
- package/.agents/workflows/qa-explore.md +125 -316
- package/.agents/workflows/qa-run.md +180 -380
- package/docs/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/.agents/workflows/helpers/audit-dual-path.md +0 -59
- package/.agents/workflows/helpers/audit-self-check.md +0 -70
- package/.agents/workflows/helpers/audit-severity-scale.md +0 -19
|
@@ -4,40 +4,39 @@ description: Audit `package.json` for unused, outdated, and major-version-stale
|
|
|
4
4
|
|
|
5
5
|
# Dependency Update Audit
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
You are a DevOps Engineer & Security Researcher managing the dependency
|
|
8
|
+
lifecycle — outdated, vulnerable, or bloated packages and a safe upgrade path.
|
|
9
|
+
The shared lens machinery — read-only constraint, scope interpretation, report
|
|
10
|
+
envelope + finding-block skeleton, severity scale, self-cross-check, and
|
|
11
|
+
execution strategy — lives in
|
|
12
|
+
[`helpers/audit-lens-core.md`](helpers/audit-lens-core.md). Write the report to
|
|
13
|
+
`{{auditOutputDir}}/audit-dependencies-results.md`. Dimension values:
|
|
14
|
+
`Security Fix | Removal | Engine Drift | Major Upgrade | Supply-chain`. The
|
|
15
|
+
report adds a **Health Summary**, an **Upgrade Batches** section, and a
|
|
16
|
+
**Recommended Removals/Replacements** list.
|
|
17
|
+
|
|
18
|
+
> **Version-free titles (mandatory).** A finding title MUST NOT embed a concrete
|
|
19
|
+
> version number — write ``### `package.json` — lodash unused``, not ``… —
|
|
20
|
+
> lodash@4.17.20 unused``. Periodic re-runs re-detect the same issue at a
|
|
21
|
+
> drifted version; a version-free title keeps the finding's fingerprint stable
|
|
22
|
+
> so `audit-to-stories` dedupes it against the existing Story instead of filing
|
|
23
|
+
> a fresh duplicate on every bump.
|
|
24
|
+
|
|
25
|
+
## Scope
|
|
26
|
+
|
|
27
|
+
Interpret this lens's change-set fence per the core's Scope interpretation:
|
|
25
28
|
|
|
26
29
|
```text
|
|
27
30
|
{{changedFiles}}
|
|
28
31
|
```
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
restrict your analysis to those files (and their direct dependencies
|
|
32
|
-
when the lens explicitly calls for cross-file reasoning).
|
|
33
|
-
- If the block above renders as the literal string `{{changedFiles}}`
|
|
34
|
-
(i.e. no substitution was supplied), ignore this section entirely and
|
|
35
|
-
proceed with the full codebase-wide scan defined in the remaining
|
|
36
|
-
steps.
|
|
33
|
+
## Execution strategy
|
|
37
34
|
|
|
38
|
-
|
|
35
|
+
Run this lens as a single `subagent_type: auditor` dispatch returning the report
|
|
36
|
+
path + Executive Summary; sequential inline execution is the fallback (see the
|
|
37
|
+
core's Execution strategy).
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
## Step 1: Inventory, Staleness & Unused Detection
|
|
41
40
|
|
|
42
41
|
Run each probe as a concrete, machine-readable command so the Health Summary
|
|
43
42
|
counts are **exact** rather than eyeballed:
|
|
@@ -81,9 +80,8 @@ production code" standard.
|
|
|
81
80
|
`npm audit --json --omit=dev` (production-reachable only). An advisory
|
|
82
81
|
present in the full run but absent from the `--omit=dev` run is
|
|
83
82
|
**dev-only**; one present in both is **production-reachable**.
|
|
84
|
-
2. **Severity rubric.** Grade each advisory on the shared
|
|
85
|
-
|
|
86
|
-
as a function of the advisory's own CVSS band, its reachability
|
|
83
|
+
2. **Severity rubric.** Grade each advisory on the shared severity scale as a
|
|
84
|
+
function of the advisory's own CVSS band, its reachability
|
|
87
85
|
(production-reachable escalates; dev-only caps at Medium), and its
|
|
88
86
|
dependency position (a direct dependency whose version you control is more
|
|
89
87
|
actionable than a deep transitive one).
|
|
@@ -96,12 +94,12 @@ production code" standard.
|
|
|
96
94
|
|
|
97
95
|
## Step 3: Supply-chain scoped mode (lockfile-delta)
|
|
98
96
|
|
|
99
|
-
When the
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
When the change-set fence resolved to a file list **and that list contains a
|
|
98
|
+
lockfile** (`package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`), run this
|
|
99
|
+
lens as a **supply-chain delta pass** instead of a whole-manifest re-scan. The
|
|
100
|
+
close-time question is not "what is stale across the whole repo" — it is "what
|
|
101
|
+
just entered the dependency tree, and is it safe". Diff the lockfile against the
|
|
102
|
+
base branch and analyse only the delta:
|
|
105
103
|
|
|
106
104
|
1. **Enumerate the delta.** Run `git diff <base>...HEAD -- <lockfile>` and
|
|
107
105
|
list every **added** package and every **version-bumped** package the
|
|
@@ -118,89 +116,27 @@ safe". Diff the lockfile against the base branch and analyse only the delta:
|
|
|
118
116
|
(single-character edits, dropped scopes, hyphen/underscore swaps) that
|
|
119
117
|
suggests a typosquat, and flag it.
|
|
120
118
|
|
|
121
|
-
##
|
|
122
|
-
|
|
123
|
-
Generate and save a highly structured Markdown audit report to
|
|
124
|
-
`{{auditOutputDir}}/audit-dependencies-results.md`, using the exact template
|
|
125
|
-
below.
|
|
119
|
+
## Report additions
|
|
126
120
|
|
|
127
|
-
|
|
128
|
-
> [`Critical | High | Medium | Low` scale](helpers/audit-severity-scale.md).
|
|
129
|
-
>
|
|
130
|
-
> **Version-free titles (mandatory).** A finding title MUST NOT embed a
|
|
131
|
-
> concrete version number — write ``### `package.json` — lodash unused``, not
|
|
132
|
-
> ``… — lodash@4.17.20 unused``. Periodic re-runs of this lens re-detect the
|
|
133
|
-
> same issue at a drifted version; a version-free title keeps the finding's
|
|
134
|
-
> fingerprint stable so `audit-to-stories` dedupes it against the existing
|
|
135
|
-
> Story instead of filing a fresh duplicate on every bump.
|
|
121
|
+
Beyond the shared skeleton, emit these lens-specific report sections:
|
|
136
122
|
|
|
137
123
|
```markdown
|
|
138
|
-
# Dependency Audit Report
|
|
139
|
-
|
|
140
124
|
## Health Summary
|
|
141
125
|
|
|
142
126
|
- **Outdated Packages:** [exact count from `npm outdated --json`]
|
|
143
127
|
- **Unused Dependencies:** [exact count from `npx knip --production` / `depcheck`]
|
|
144
128
|
- **Vulnerabilities:** [Critical: #, High: #, Mod: #] (production-reachable / dev-only split)
|
|
145
129
|
- **Node-engine drift:** [None | describe the mismatch across engines / .nvmrc / CI matrix]
|
|
146
|
-
|
|
147
|
-
## Detailed Findings
|
|
148
|
-
|
|
149
|
-
[For every production-reachable Critical/High advisory, unused dependency, or
|
|
150
|
-
Node-engine drift, use the strict structure below. Lead each title with the
|
|
151
|
-
manifest the dependency lives in, and keep the title version-free:]
|
|
152
|
-
|
|
153
|
-
### `path/to/package.json` — [Package name — issue, no version]
|
|
154
|
-
|
|
155
|
-
- **Dimension:** [Security Fix | Removal | Engine Drift | Major Upgrade | Supply-chain]
|
|
156
|
-
- **Impact:** [Critical | High | Medium | Low]
|
|
157
|
-
- **Location:** `path/to/package.json:line`
|
|
158
|
-
- **Current State:** [Current vs target, the reachability verdict (production-reachable | dev-only), and the reason for the change]
|
|
159
|
-
- **Recommendation & Rationale:** [How to remediate and the breaking changes to watch for]
|
|
160
|
-
- **Acceptance signal:** [the command or observable that proves this finding is remediated — e.g. `npm audit --omit=dev` reporting zero for this advisory, or `npx knip --production` no longer listing the package]
|
|
161
|
-
- **Agent Prompt:**
|
|
162
|
-
`[A copy-pasteable, highly specific prompt to execute this update independently (e.g., npm install package@latest)]`
|
|
163
|
-
|
|
164
|
-
### Dev-only advisories (aggregate)
|
|
165
|
-
|
|
166
|
-
- **Dimension:** Security Fix
|
|
167
|
-
- **Impact:** [Low | Medium]
|
|
168
|
-
- **Location:** `package-lock.json`
|
|
169
|
-
- **Current State:** [N dev-only advisories with no production reachability; not release-gating]
|
|
170
|
-
- **Recommendation & Rationale:** [Batch-remediate on the next dependency-maintenance pass — do not block the release on these]
|
|
171
|
-
- **Acceptance signal:** `npm audit --json` dev-only advisory count returns to zero.
|
|
172
|
-
|
|
173
|
-
## Upgrade Batches
|
|
174
|
-
|
|
175
|
-
Group the safe upgrade path into batches so a maintainer can act on them as
|
|
176
|
-
discrete units. Each batch carries its own acceptance signal:
|
|
177
|
-
|
|
178
|
-
- **Batch: patch + minor bumps** — every non-breaking `npm outdated` entry
|
|
179
|
-
whose `wanted` satisfies the declared range, grouped into ONE batch.
|
|
180
|
-
- **Acceptance signal:** `npm outdated` reports no remaining patch/minor
|
|
181
|
-
drift and the test suite passes after the bump.
|
|
182
|
-
- **Batch: `<package>` major upgrade** — one batch **per** major bump (each
|
|
183
|
-
crosses a breaking boundary and lands independently).
|
|
184
|
-
- **Acceptance signal:** `<package>` at the new major with its migration
|
|
185
|
-
notes applied and the test suite green.
|
|
186
|
-
|
|
187
|
-
## Recommended Removals/Replacements
|
|
188
|
-
|
|
189
|
-
- Remove `[unused-package]` — no production import per `npx knip --production`.
|
|
190
|
-
- Replace `[heavy-library]` with `[light-library]` or native `[browser-api]`.
|
|
191
130
|
```
|
|
192
131
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
pass whose `kept <k> / dropped <d>` counts you record in the Executive
|
|
205
|
-
Summary, so the sequential single-pass path filters unverified findings just as
|
|
206
|
-
the orchestrated path's adversarial reviewer does.
|
|
132
|
+
- **Dev-only advisories (aggregate)** — one Detailed Findings entry collapsing
|
|
133
|
+
all dev-only advisories: Dimension `Security Fix`, Impact `Low | Medium`,
|
|
134
|
+
Location `package-lock.json`, Acceptance signal
|
|
135
|
+
``npm audit --json`` dev-only advisory count returns to zero.
|
|
136
|
+
- **Upgrade Batches** — group the safe upgrade path into discrete batches, each
|
|
137
|
+
with its own acceptance signal: one batch of all non-breaking patch/minor
|
|
138
|
+
bumps (`wanted` within range), and one batch **per** major bump (each crosses
|
|
139
|
+
a breaking boundary and lands independently).
|
|
140
|
+
- **Recommended Removals/Replacements** — remove unused packages (per
|
|
141
|
+
`npx knip --production`); replace heavy libraries with lighter or native
|
|
142
|
+
alternatives.
|
|
@@ -4,41 +4,31 @@ description: Audit CI/CD workflows, container images, infrastructure-as-code, an
|
|
|
4
4
|
|
|
5
5
|
# DevOps Infrastructure Audit
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
You are a Principal DevOps Engineer & Infrastructure Architect auditing this
|
|
8
|
+
repo's DevOps infrastructure, DX tooling, and CI/CD pipelines for
|
|
9
|
+
inefficiencies, security risks, and modernization opportunities. The shared lens
|
|
10
|
+
machinery — read-only constraint, scope interpretation, report envelope +
|
|
11
|
+
finding-block skeleton, severity scale, self-cross-check, and execution
|
|
12
|
+
strategy — lives in
|
|
13
|
+
[`helpers/audit-lens-core.md`](helpers/audit-lens-core.md). Write the report to
|
|
14
|
+
`{{auditOutputDir}}/audit-devops-results.md`. The report adds a **Proposed
|
|
15
|
+
Implementation Roadmap** section (a logical, phased plan).
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
## Scope
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
You are performing a comprehensive, read-only audit of this repository's DevOps
|
|
14
|
-
infrastructure, developer experience (DX) tooling, and CI/CD pipelines. Your
|
|
15
|
-
goal is to identify inefficiencies, security risks, and areas for modernization
|
|
16
|
-
without making any immediate changes.
|
|
17
|
-
|
|
18
|
-
## Scope (Story / plan-run mode)
|
|
19
|
-
|
|
20
|
-
When this lens is invoked from `/deliver` close lenses (or a plan-run audit), the
|
|
21
|
-
following block is populated with the Story (or plan-run) change-set file list.
|
|
22
|
-
Otherwise — for any manual `/audit-<dimension>` invocation — the block
|
|
23
|
-
renders the literal substitution token and you MUST treat it as **no
|
|
24
|
-
scope filter — run the lens codebase-wide** exactly as you would have
|
|
25
|
-
before this section existed.
|
|
19
|
+
Interpret this lens's change-set fence per the core's Scope interpretation:
|
|
26
20
|
|
|
27
21
|
```text
|
|
28
22
|
{{changedFiles}}
|
|
29
23
|
```
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
restrict your analysis to those files (and their direct dependencies
|
|
33
|
-
when the lens explicitly calls for cross-file reasoning).
|
|
34
|
-
- If the block above renders as the literal string `{{changedFiles}}`
|
|
35
|
-
(i.e. no substitution was supplied), ignore this section entirely and
|
|
36
|
-
proceed with the full codebase-wide scan defined in the remaining
|
|
37
|
-
steps.
|
|
25
|
+
## Execution strategy
|
|
38
26
|
|
|
39
|
-
|
|
27
|
+
Run this lens as a single `subagent_type: auditor` dispatch returning the report
|
|
28
|
+
path + Executive Summary; sequential inline execution is the fallback (see the
|
|
29
|
+
core's Execution strategy).
|
|
40
30
|
|
|
41
|
-
|
|
31
|
+
## Step 1: Detection Battery (Read-Only, Tool-First)
|
|
42
32
|
|
|
43
33
|
Do **not** audit CI/CD from memory. Run the deterministic battery below first
|
|
44
34
|
and let its output ground every finding. Each tool is **presence-gated**: when
|
|
@@ -142,60 +132,3 @@ environment protection rules / required reviewers on the production
|
|
|
142
132
|
environment, absent rollback or canary strategy, and publish steps that run
|
|
143
133
|
without provenance / SLSA attestation. Cite the `gh run list` history for the
|
|
144
134
|
release workflow's reliability.
|
|
145
|
-
|
|
146
|
-
## Step 3: Output Requirements
|
|
147
|
-
|
|
148
|
-
Generate and save a highly structured Markdown audit report to
|
|
149
|
-
`{{auditOutputDir}}/audit-devops-results.md`, using the exact template below.
|
|
150
|
-
|
|
151
|
-
> Grade every finding's severity on the shared
|
|
152
|
-
> [`Critical | High | Medium | Low` scale](helpers/audit-severity-scale.md).
|
|
153
|
-
|
|
154
|
-
```markdown
|
|
155
|
-
# DevOps Infrastructure Audit Report
|
|
156
|
-
|
|
157
|
-
## Executive Summary
|
|
158
|
-
|
|
159
|
-
[Provide a brief 2–3 sentence overview of the current infrastructure state and
|
|
160
|
-
highlight the most critical overarching themes from the findings.]
|
|
161
|
-
|
|
162
|
-
## Detailed Findings
|
|
163
|
-
|
|
164
|
-
[For every gap identified, use the following strict structure. Lead each title
|
|
165
|
-
with the primary file the finding lives in:]
|
|
166
|
-
|
|
167
|
-
### `path/to/primary-file.ext` — [Short title of the issue]
|
|
168
|
-
|
|
169
|
-
- **Dimension:** [e.g., Security & Compliance]
|
|
170
|
-
- **Impact:** [Critical | High | Medium | Low]
|
|
171
|
-
- **Location:** `path/to/primary-file.ext:line`
|
|
172
|
-
- **Current State:** [What is currently configured in the codebase]
|
|
173
|
-
- **Recommendation & Rationale:** [The specific fix and why it improves the
|
|
174
|
-
system]
|
|
175
|
-
- **Acceptance signal:** [the command or observable that proves this finding is remediated — e.g. a green CI run, a hardened config lint, or a re-run of this lens]
|
|
176
|
-
- **Agent Prompt:**
|
|
177
|
-
`[A copy-pasteable, highly specific prompt to execute this fix independently]`
|
|
178
|
-
|
|
179
|
-
## Proposed Implementation Roadmap
|
|
180
|
-
|
|
181
|
-
[Organize the recommended changes into a logical, phased approach — e.g., Phase
|
|
182
|
-
1: Critical Security & Fixing Broken Builds, Phase 2: Performance Optimizations,
|
|
183
|
-
Phase 3: Modernization / Tech Debt.]
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Constraint
|
|
189
|
-
|
|
190
|
-
Do NOT execute any code modifications, edit files, create branches, or install
|
|
191
|
-
packages. This is strictly a read-only analysis. Output the report and stop.
|
|
192
|
-
|
|
193
|
-
## Self-cross-check (mandatory — filter false positives before you finalize)
|
|
194
|
-
|
|
195
|
-
Before you write the report artifact from the previous step, run the shared
|
|
196
|
-
adversarial self-cross-check over your Detailed Findings — see
|
|
197
|
-
[`helpers/audit-self-check.md`](helpers/audit-self-check.md). It defines the
|
|
198
|
-
per-finding evidence bar, the exclusion list, and the final re-open-and-drop
|
|
199
|
-
pass whose `kept <k> / dropped <d>` counts you record in the Executive
|
|
200
|
-
Summary, so the sequential single-pass path filters unverified findings just as
|
|
201
|
-
the orchestrated path's adversarial reviewer does.
|
|
@@ -4,21 +4,21 @@ description: Audit the repository's main documentation for staleness, semantic d
|
|
|
4
4
|
|
|
5
5
|
# Documentation Staleness & Completeness Audit
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
You are a Staff Engineer & Documentation Steward verifying the repository's prose
|
|
8
|
+
documentation is **up to date and complete**. Prose rots silently: commands get
|
|
9
|
+
renamed, scripts move, workflows change shape, version/topology claims go stale.
|
|
10
|
+
The deterministic gates (`check-doc-links.js`, `check-lifecycle-doc-drift.js`,
|
|
11
|
+
`validate-docs-freshness.js`) catch broken links, generator drift, and
|
|
12
|
+
per-delivery freshness — they cannot tell whether the prose still describes how
|
|
13
|
+
the code actually behaves. That semantic verification is this lens's job. The
|
|
14
|
+
shared lens machinery — read-only constraint, scope interpretation, report
|
|
15
|
+
envelope + finding-block skeleton, severity scale, self-cross-check, and
|
|
16
|
+
execution strategy — lives in
|
|
17
|
+
[`helpers/audit-lens-core.md`](helpers/audit-lens-core.md). Write the report to
|
|
18
|
+
`{{auditOutputDir}}/audit-documentation-results.md`. Each finding carries a
|
|
19
|
+
**Category:** (`Broken Instruction | Stale Description | Missing Coverage |
|
|
20
|
+
Generator Drift | Link Integrity | History Bloat | Contradiction | Authority
|
|
21
|
+
Drift`); the report adds a **Target Set Coverage** table.
|
|
22
22
|
|
|
23
23
|
## Target set (config-driven union)
|
|
24
24
|
|
|
@@ -47,40 +47,32 @@ generator", not "edit the doc". Auto-generated changelog files
|
|
|
47
47
|
(`docs/CHANGELOG.md`, release-please-owned) are likewise excluded from
|
|
48
48
|
semantic review beyond Step 1's deterministic checks.
|
|
49
49
|
|
|
50
|
-
## Scope (
|
|
50
|
+
## Scope (deviant — intersect with the target set)
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Otherwise — for any manual `/audit-<dimension>` invocation — the block
|
|
55
|
-
renders the literal substitution token and you MUST treat it as **no
|
|
56
|
-
scope filter — run the lens codebase-wide** exactly as you would have
|
|
57
|
-
before this section existed.
|
|
52
|
+
This lens deviates from the shared change-set fence: it intersects the fence
|
|
53
|
+
with the config-driven target set above.
|
|
58
54
|
|
|
59
55
|
```text
|
|
60
56
|
{{changedFiles}}
|
|
61
57
|
```
|
|
62
58
|
|
|
63
|
-
- If the block
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- If the block
|
|
68
|
-
|
|
69
|
-
proceed with the full target-set audit defined in the remaining steps.
|
|
59
|
+
- If the block contains a newline-delimited list of file paths, restrict the
|
|
60
|
+
audit to the intersection of the target-set union and those files — plus any
|
|
61
|
+
target-set doc whose claims describe code in the change set (a renamed script
|
|
62
|
+
invalidates every doc that references it).
|
|
63
|
+
- If the block renders as the literal string `{{changedFiles}}` (no
|
|
64
|
+
substitution supplied), audit the full target-set union.
|
|
70
65
|
|
|
71
|
-
## Execution strategy
|
|
66
|
+
## Execution strategy
|
|
72
67
|
|
|
73
|
-
This
|
|
74
|
-
or
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
there as this lens's name.
|
|
68
|
+
This is a **heavyweight lens**: dispatch it as a single `subagent_type: auditor`
|
|
69
|
+
call, or fan its per-doc / per-dimension verification out across parallel
|
|
70
|
+
`auditor` subagents (parallel-tooling Rule 3) and merge under the
|
|
71
|
+
self-cross-check. Sequential inline execution is the fallback (see the core's
|
|
72
|
+
Execution strategy).
|
|
79
73
|
|
|
80
74
|
## Step 1: Deterministic Signal First
|
|
81
75
|
|
|
82
|
-
> Apply [`helpers/parallel-tooling.md`](helpers/parallel-tooling.md) when batching the scan below — independent reads belong in one turn, long shells run via `run_in_background` + `Monitor`.
|
|
83
|
-
|
|
84
76
|
Run the existing deterministic checkers before any semantic reading — they
|
|
85
77
|
are cheap, exact, and de-duplicate the easy findings:
|
|
86
78
|
|
|
@@ -195,48 +187,6 @@ escalation **after** assigning the base severity from the Step 2 guidance, and
|
|
|
195
187
|
name the doc's tier in the finding's Current State so the escalation is
|
|
196
188
|
auditable.
|
|
197
189
|
|
|
198
|
-
## Step 3: Output Requirements
|
|
199
|
-
|
|
200
|
-
Generate and save a highly structured Markdown audit report to
|
|
201
|
-
`{{auditOutputDir}}/audit-documentation-results.md`, using the exact
|
|
202
|
-
template below.
|
|
203
|
-
|
|
204
|
-
> Grade every finding's severity on the shared
|
|
205
|
-
> [`Critical | High | Medium | Low` scale](helpers/audit-severity-scale.md).
|
|
206
|
-
|
|
207
|
-
```markdown
|
|
208
|
-
# Documentation Audit Report
|
|
209
|
-
|
|
210
|
-
## Executive Summary
|
|
211
|
-
|
|
212
|
-
[Overview of documentation health (High/Medium/Low confidence that the docs
|
|
213
|
-
match the code), the deterministic-gate verdicts, and primary drift themes.]
|
|
214
|
-
|
|
215
|
-
## Target Set Coverage
|
|
216
|
-
|
|
217
|
-
| Doc | Source | Verdict |
|
|
218
|
-
| ------ | --------------------------------------------------------------------- | ------------------------------- |
|
|
219
|
-
| [path] | [docsContextFiles · docsFreshness · anchor · --paths] | [Current · Drifted · Excluded (generated)] |
|
|
220
|
-
|
|
221
|
-
## Detailed Findings
|
|
222
|
-
|
|
223
|
-
[For every gap identified, use the following strict structure. Lead each title
|
|
224
|
-
with the primary doc the finding lives in:]
|
|
225
|
-
|
|
226
|
-
### `path/to/primary-doc.md` — [Short title of the issue]
|
|
227
|
-
|
|
228
|
-
- **Category:** [Broken Instruction | Stale Description | Missing Coverage | Generator Drift | Link Integrity | History Bloat | Contradiction | Authority Drift]
|
|
229
|
-
- **Impact:** [Critical | High | Medium | Low] — for a Context Economy finding, this is the base severity **after** any read-tier escalation (Step 2.5); state the doc's tier in Current State.
|
|
230
|
-
- **Location:** `path/to/primary-doc.md:line`
|
|
231
|
-
- **Current State:** [The doc, the exact claim, and what the code actually
|
|
232
|
-
does — cite file paths and lines on both sides]
|
|
233
|
-
- **Recommendation & Rationale:** [The specific doc edit (or generator
|
|
234
|
-
rerun) and why it restores accuracy]
|
|
235
|
-
- **Acceptance signal:** [the command or observable that proves this finding is remediated — e.g. `npm run docs:check` passing, the corrected claim now matching the code, or a re-run of this lens]
|
|
236
|
-
- **Agent Prompt:**
|
|
237
|
-
`[A copy-pasteable, highly specific prompt to execute this doc fix independently]`
|
|
238
|
-
```
|
|
239
|
-
|
|
240
190
|
## Periodic full-scope sweep
|
|
241
191
|
|
|
242
192
|
Context Economy findings accrete slowly — a doc that is lean today grows a
|
|
@@ -257,19 +207,22 @@ deduplicates them against existing Issues by fingerprint, and opens
|
|
|
257
207
|
remediation Stories (or chains into `/plan --seed`) so the Context-Economy
|
|
258
208
|
findings land as actionable, tracked work rather than a report nobody reads.
|
|
259
209
|
|
|
260
|
-
## Constraint
|
|
210
|
+
## Constraint (lens-specific carve-out)
|
|
211
|
+
|
|
212
|
+
Run the deterministic checkers in `--check` mode only; the single write is the
|
|
213
|
+
report artifact. Do not edit any documentation or code.
|
|
261
214
|
|
|
262
|
-
|
|
263
|
-
deterministic checkers in `--check` mode only, and do not edit any
|
|
264
|
-
documentation or code. The single write is the report artifact. Provide the
|
|
265
|
-
analysis and remediation prompts; do not apply changes.
|
|
215
|
+
## Report additions
|
|
266
216
|
|
|
267
|
-
|
|
217
|
+
Beyond the shared skeleton (Executive Summary + Detailed Findings from the
|
|
218
|
+
core), this lens's report carries its own title and a Target Set Coverage table:
|
|
268
219
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
220
|
+
```markdown
|
|
221
|
+
# Documentation Audit Report
|
|
222
|
+
|
|
223
|
+
## Target Set Coverage
|
|
224
|
+
|
|
225
|
+
| Doc | Source | Verdict |
|
|
226
|
+
| ------ | ----------------------------------------------------- | ------------------------------------------ |
|
|
227
|
+
| [path] | [docsContextFiles · docsFreshness · anchor · --paths] | [Current · Drifted · Excluded (generated)] |
|
|
228
|
+
```
|
|
@@ -8,6 +8,22 @@ description: >-
|
|
|
8
8
|
|
|
9
9
|
# Navigability Audit
|
|
10
10
|
|
|
11
|
+
You are an Information-Architecture Reviewer & Frontend Navigation Auditor
|
|
12
|
+
evaluating **navigability**: every route a persona is entitled to reach has a
|
|
13
|
+
real navigation door, and every nav door points at a route that exists. The two
|
|
14
|
+
symmetric failure modes are the **orphaned route** (registered but no
|
|
15
|
+
nav-registry entry surfaces it for any persona — only a hardcoded deep-link
|
|
16
|
+
reaches it) and the **dead nav href** (a nav entry points at a route that does
|
|
17
|
+
not exist). This is **mechanism, not content**: the lens reads the consumer's
|
|
18
|
+
configured route tree and nav-registry SSOT and is a **silent no-op when neither
|
|
19
|
+
is configured**. The shared lens machinery — read-only constraint, scope
|
|
20
|
+
interpretation, report envelope + finding-block skeleton, severity scale,
|
|
21
|
+
self-cross-check, and execution strategy — lives in
|
|
22
|
+
[`helpers/audit-lens-core.md`](helpers/audit-lens-core.md). Write the report to
|
|
23
|
+
`{{auditOutputDir}}/audit-navigability-results.md`. Dimension values:
|
|
24
|
+
`Orphaned Route | Dead Nav Href`; extra finding fields **Route / Door:** and
|
|
25
|
+
**Persona(s):** (identifiers only — never full route bodies or persona PII).
|
|
26
|
+
|
|
11
27
|
## Applicability
|
|
12
28
|
|
|
13
29
|
**Web targets only.** Registered with `target: "web"` in
|
|
@@ -18,29 +34,6 @@ that has configured this lens's route-tree SSOT always clears the gate. The
|
|
|
18
34
|
gate only bites where the lens had no route data to read anyway — it converts a
|
|
19
35
|
silent no-op run into no run at all.
|
|
20
36
|
|
|
21
|
-
## Role
|
|
22
|
-
|
|
23
|
-
Information-Architecture Reviewer & Frontend Navigation Auditor
|
|
24
|
-
|
|
25
|
-
## Context & Objective
|
|
26
|
-
|
|
27
|
-
Evaluate the application's **navigability**: the property that every route a
|
|
28
|
-
persona is entitled to reach has a real navigation door (a menu item, link, or
|
|
29
|
-
button rendered in that persona's authenticated shell), and that every nav door
|
|
30
|
-
points at a route that actually exists. The two failure modes this lens names
|
|
31
|
-
are symmetric:
|
|
32
|
-
|
|
33
|
-
- **Orphaned route** — a route is registered in the route tree but no
|
|
34
|
-
nav-registry entry surfaces it for any persona. The feature ships but is
|
|
35
|
-
unreachable through the product; only a hardcoded deep-link reaches it.
|
|
36
|
-
- **Dead nav href** — a nav-registry entry points at a route (or path) that
|
|
37
|
-
does not exist in the route tree. The door is rendered but leads nowhere.
|
|
38
|
-
|
|
39
|
-
This is **mechanism, not content**: the lens reads the consumer's
|
|
40
|
-
configured route tree and nav-registry SSOT (see _Configuration_) and is a
|
|
41
|
-
**silent no-op when neither is configured**. Mandrel ships the slot and the
|
|
42
|
-
wiring; it never ships a specific consumer's route data or nav registry.
|
|
43
|
-
|
|
44
37
|
## Whole-route-tree scope (global lens — leak-guard-exempt)
|
|
45
38
|
|
|
46
39
|
Unlike the change-set-scoped lenses, this lens **always evaluates the whole
|
|
@@ -52,10 +45,10 @@ a nav href that the change set never touched.
|
|
|
52
45
|
Because of this, the navigability lens is registered in the **global-lens
|
|
53
46
|
allowlist** (`GLOBAL_LENS_ALLOWLIST` in
|
|
54
47
|
[`lib/audit-suite/selector.js`](../scripts/lib/audit-suite/selector.js)) and is
|
|
55
|
-
**exempt from the cross-epic-leak guard**
|
|
56
|
-
|
|
57
|
-
lens only — the guard is **not** weakened for any other lens, and
|
|
58
|
-
|
|
48
|
+
**exempt from the cross-epic-leak guard** that narrows every other lens's
|
|
49
|
+
evidence to the change set's `changedFiles`. The exemption is scoped to this
|
|
50
|
+
lens only — the guard is **not** weakened for any other lens, and it never lets
|
|
51
|
+
a foreign change set leak into a scoped lens.
|
|
59
52
|
|
|
60
53
|
```text
|
|
61
54
|
{{changedFiles}}
|
|
@@ -65,6 +58,12 @@ exemption never lets a foreign Epic's change set leak into a scoped lens.
|
|
|
65
58
|
populated: navigability is evaluated codebase-wide regardless. The block is
|
|
66
59
|
rendered only for envelope-shape parity with the scoped lenses.
|
|
67
60
|
|
|
61
|
+
## Execution strategy
|
|
62
|
+
|
|
63
|
+
Run this lens as a single `subagent_type: auditor` dispatch returning the report
|
|
64
|
+
path + Executive Summary; sequential inline execution is the fallback (see the
|
|
65
|
+
core's Execution strategy).
|
|
66
|
+
|
|
68
67
|
## Configuration
|
|
69
68
|
|
|
70
69
|
Read the consumer's navigability config (resolved from `.agentrc.json`):
|
|
@@ -141,56 +140,3 @@ hand):
|
|
|
141
140
|
the tool via `--refs`.
|
|
142
141
|
|
|
143
142
|
Only a route that clears **all** of these is a genuine orphan worth a finding.
|
|
144
|
-
|
|
145
|
-
## Step 4: Output Requirements
|
|
146
|
-
|
|
147
|
-
Generate and save a structured Markdown audit report to
|
|
148
|
-
`{{auditOutputDir}}/audit-navigability-results.md`, using the template below.
|
|
149
|
-
|
|
150
|
-
> Grade every finding's severity on the shared
|
|
151
|
-
> [`Critical | High | Medium | Low` scale](helpers/audit-severity-scale.md).
|
|
152
|
-
|
|
153
|
-
```markdown
|
|
154
|
-
# Navigability Audit report
|
|
155
|
-
|
|
156
|
-
## Executive Summary
|
|
157
|
-
|
|
158
|
-
[Reachability health (Score 1-10): count of orphaned routes and dead hrefs.]
|
|
159
|
-
|
|
160
|
-
## Detailed Findings
|
|
161
|
-
|
|
162
|
-
[For every orphaned route or dead nav href, use the following strict structure.
|
|
163
|
-
Lead each title with the primary file (route module or nav registry) the
|
|
164
|
-
finding lives in:]
|
|
165
|
-
|
|
166
|
-
### `path/to/nav-registry-or-route.ext` — [Short title of the issue]
|
|
167
|
-
|
|
168
|
-
- **Dimension:** [Orphaned Route | Dead Nav Href]
|
|
169
|
-
- **Impact:** [Critical | High | Medium | Low]
|
|
170
|
-
- **Location:** `path/to/nav-registry-or-route.ext:line`
|
|
171
|
-
- **Route / Door:** [the route path or nav-door identifier — identifier only]
|
|
172
|
-
- **Persona(s):** [the persona(s) affected]
|
|
173
|
-
- **Current State:** [why the route is unreachable or the href is dead]
|
|
174
|
-
- **Recommendation & Rationale:** [the nav-registry change that restores
|
|
175
|
-
reachability — add a door for the orphaned route, or fix/remove the dead
|
|
176
|
-
href]
|
|
177
|
-
- **Acceptance signal:** [the command or observable that proves this finding is remediated — e.g. a re-run of this lens reporting the route reachable]
|
|
178
|
-
- **Agent Prompt:**
|
|
179
|
-
`[A copy-pasteable, specific prompt to execute the nav-registry fix.]`
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Constraint
|
|
183
|
-
|
|
184
|
-
This is a **read-only** audit. Provide the critique and the nav-registry fixes,
|
|
185
|
-
but do not modify the route tree or the nav registry. Log route and door
|
|
186
|
-
identifiers only — never full route bodies, source contents, or persona data.
|
|
187
|
-
|
|
188
|
-
## Self-cross-check (mandatory — filter false positives before you finalize)
|
|
189
|
-
|
|
190
|
-
Before you write the report artifact from the previous step, run the shared
|
|
191
|
-
adversarial self-cross-check over your Detailed Findings — see
|
|
192
|
-
[`helpers/audit-self-check.md`](helpers/audit-self-check.md). It defines the
|
|
193
|
-
per-finding evidence bar, the exclusion list, and the final re-open-and-drop
|
|
194
|
-
pass whose `kept <k> / dropped <d>` counts you record in the Executive
|
|
195
|
-
Summary, so the sequential single-pass path filters unverified findings just as
|
|
196
|
-
the orchestrated path's adversarial reviewer does.
|