@erclx/canon 5.38.0 → 5.39.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/README.md +1 -1
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/api-design/SKILL.md +12 -9
- package/claude/skills/auto-ship/SKILL.md +43 -23
- package/claude/skills/backlog-triage/SKILL.md +62 -53
- package/claude/skills/backlog-triage/references/apply.md +69 -0
- package/claude/skills/build-in-slices/SKILL.md +8 -4
- package/claude/skills/canon-cli/SKILL.md +5 -1
- package/claude/skills/canon-feedback/SKILL.md +18 -8
- package/claude/skills/canon-feedback-triage/SKILL.md +10 -3
- package/claude/skills/canvas-board/SKILL.md +36 -17
- package/claude/skills/ci-workflow/SKILL.md +5 -4
- package/claude/skills/code-craft/SKILL.md +10 -6
- package/claude/skills/codebase-layout/SKILL.md +3 -5
- package/claude/skills/context-fold/REQUIREMENT.md +4 -4
- package/claude/skills/context-fold/SKILL.md +42 -23
- package/claude/skills/context-fold/references/context-refresh.md +4 -3
- package/claude/skills/context-fold/references/context.md +79 -64
- package/claude/skills/create-rule/SKILL.md +7 -3
- package/claude/skills/create-skill/SKILL.md +27 -7
- package/claude/skills/create-skill/references/skill-reference.md +41 -17
- package/claude/skills/decision-escalate/SKILL.md +8 -5
- package/claude/skills/deploy-app/SKILL.md +1 -1
- package/claude/skills/deprecation-migration/SKILL.md +12 -4
- package/claude/skills/design-taste/SKILL.md +17 -11
- package/claude/skills/docs-sync/REQUIREMENT.md +1 -0
- package/claude/skills/docs-sync/SKILL.md +17 -6
- package/claude/skills/docs-sync/references/docs.md +54 -21
- package/claude/skills/docs-sync/references/readme.md +32 -8
- package/claude/skills/document-health/SKILL.md +3 -4
- package/claude/skills/draft-and-pick/SKILL.md +73 -47
- package/claude/skills/draft-doc/SKILL.md +9 -4
- package/claude/skills/draft-doc/references/context.md +4 -4
- package/claude/skills/draft-doc/references/docs.md +1 -0
- package/claude/skills/draft-doc/references/wiki.md +3 -2
- package/claude/skills/draft-figure/SKILL.md +9 -7
- package/claude/skills/draft-identity/SKILL.md +24 -52
- package/claude/skills/draft-identity/references/card-route.md +46 -0
- package/claude/skills/draft-ready/SKILL.md +19 -7
- package/claude/skills/draft-screencast/SKILL.md +6 -112
- package/claude/skills/draft-screencast/references/beats-template.md +119 -0
- package/claude/skills/draft-slides/SKILL.md +7 -4
- package/claude/skills/git-branch/SKILL.md +3 -3
- package/claude/skills/git-commit/SKILL.md +5 -3
- package/claude/skills/git-followup/SKILL.md +16 -9
- package/claude/skills/git-issue/SKILL.md +6 -5
- package/claude/skills/git-pr/SKILL.md +56 -44
- package/claude/skills/git-ship/SKILL.md +43 -34
- package/claude/skills/git-ship/references/ci-watch.md +31 -0
- package/claude/skills/git-split/SKILL.md +28 -100
- package/claude/skills/git-split/references/independent.md +40 -0
- package/claude/skills/git-split/references/stacked.md +73 -0
- package/claude/skills/git-stage/SKILL.md +9 -7
- package/claude/skills/git-worktree/SKILL.md +27 -49
- package/claude/skills/git-worktree/references/cleanup.md +55 -0
- package/claude/skills/markdown-craft/SKILL.md +2 -2
- package/claude/skills/markdown-craft/references/markdown.md +82 -53
- package/claude/skills/plan-feature/SKILL.md +52 -46
- package/claude/skills/plan-feature/references/batches.md +46 -0
- package/claude/skills/plan-groundwork/SKILL.md +60 -74
- package/claude/skills/plan-groundwork/references/output.md +48 -0
- package/claude/skills/plan-intake/SKILL.md +28 -21
- package/claude/skills/plan-intake-answer/SKILL.md +14 -13
- package/claude/skills/read-frames/SKILL.md +2 -0
- package/claude/skills/record-screencast/SKILL.md +31 -11
- package/claude/skills/review-address/SKILL.md +76 -158
- package/claude/skills/review-address/references/rebase-only.md +34 -0
- package/claude/skills/review-craft/SKILL.md +27 -11
- package/claude/skills/review-pr/SKILL.md +91 -40
- package/claude/skills/review-ui/SKILL.md +62 -37
- package/claude/skills/review-ui/references/hosted-preview.md +30 -0
- package/claude/skills/role-orchestrator/SKILL.md +105 -74
- package/claude/skills/role-orchestrator/references/orchestrator-filing.md +26 -0
- package/claude/skills/role-planner/SKILL.md +66 -64
- package/claude/skills/role-reviewer/SKILL.md +57 -46
- package/claude/skills/role-worker/SKILL.md +68 -63
- package/claude/skills/search-craft/SKILL.md +7 -5
- package/claude/skills/session-compact/SKILL.md +16 -11
- package/claude/skills/session-map/SKILL.md +31 -10
- package/claude/skills/session-relay/SKILL.md +32 -65
- package/claude/skills/session-resume/SKILL.md +18 -13
- package/claude/skills/session-worktree/SKILL.md +70 -42
- package/claude/skills/systematic-debugging/SKILL.md +6 -1
- package/claude/skills/target-check/SKILL.md +13 -6
- package/claude/skills/target-setup/SKILL.md +39 -27
- package/claude/skills/task-board/SKILL.md +68 -60
- package/claude/skills/task-board/references/create-report.md +36 -0
- package/claude/skills/task-complete/SKILL.md +20 -18
- package/claude/skills/teach-workspace/SKILL.md +61 -33
- package/claude/skills/test-craft/SKILL.md +2 -1
- package/claude/skills/test-first/SKILL.md +15 -9
- package/claude/skills/ui-checklist/SKILL.md +18 -16
- package/claude/skills/ux-audit/SKILL.md +9 -10
- package/claude/skills/ux-measure/SKILL.md +22 -18
- package/claude/skills/video-craft/SKILL.md +15 -7
- package/claude/skills/write-human/SKILL.md +9 -1
- package/claude/skills/youtube-transcripts/SKILL.md +2 -1
- package/docs/agents/context-audit-checks.md +19 -1
- package/docs/agents/context-audit.md +2 -2
- package/docs/agents/driver.md +1 -1
- package/docs/agents/hooks.md +21 -1
- package/docs/agents/index.md +10 -14
- package/docs/agents/indexes.md +25 -29
- package/docs/agents/install-and-sync.md +124 -235
- package/docs/agents/markdown-audit-density.md +39 -0
- package/docs/agents/markdown-audit-weight.md +9 -7
- package/docs/agents/markdown-audit.md +18 -14
- package/docs/agents/migrate.md +41 -16
- package/docs/agents/output-shape.md +60 -45
- package/docs/agents/overview.md +36 -12
- package/docs/agents/routing.md +1 -1
- package/docs/agents/rule-citations.md +1 -1
- package/docs/agents/skills-reach.md +1 -1
- package/docs/agents/targets.md +25 -77
- package/docs/target/migrations.md +1 -1
- package/docs/target/projects.md +2 -2
- package/docs/workflow/ai-workflow.md +2 -2
- package/docs/workflow/parallel-features.md +2 -2
- package/docs/workflow/skill-map.md +1 -1
- package/docs/workflow/visual-design-workflow.md +1 -1
- package/package.json +1 -1
- package/src/commands/claude.ts +1 -1
- package/src/commands/context.ts +106 -7
- package/src/commands/hooks.ts +63 -0
- package/src/commands/markdown.ts +169 -32
- package/src/context/audit.ts +256 -5
- package/src/context/classify/prompts.ts +1 -1
- package/src/context/gate.ts +23 -7
- package/src/context/shape-gated.ts +28 -0
- package/src/design/document.ts +1 -1
- package/src/design/tokens.ts +1 -1
- package/src/gate/measures.ts +15 -190
- package/src/gate/stages.ts +7 -23
- package/src/hooks/reply-links.ts +110 -0
- package/src/markdown/density.ts +258 -0
- package/src/markdown/gate.ts +57 -18
- package/src/markdown/reference-shape.ts +103 -0
- package/src/markdown/scope.ts +174 -0
- package/src/markdown/structure.ts +9 -59
- package/src/shipped/references.ts +1 -1
- package/tooling/claude/seeds/.claude/hooks/reply-links.sh +72 -0
- package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +22 -1
- package/tooling/claude/seeds/.claude/settings.json +4 -0
- package/docs/agents/commands.md +0 -154
- package/docs/agents/docs.md +0 -27
- package/docs/agents/drift-surfaces.md +0 -201
- package/docs/agents/gov-detect.md +0 -47
- package/docs/agents/scripting.md +0 -142
- package/src/markdown/growth.ts +0 -43
|
@@ -19,10 +19,28 @@ It reports rather than gates by default, the closer call because a missing secti
|
|
|
19
19
|
|
|
20
20
|
### The closed set
|
|
21
21
|
|
|
22
|
-
The
|
|
22
|
+
The section also reports an H2 outside the closed set. A context entry allows `Overview`, `Layout`, and `Gotchas` and no other H2. The finding is per entry, since an extra heading is a fact about the file carrying it, and it gates under `--gate` alone. Fenced blocks and stub seeds are skipped, and a retired `Decisions` H2 goes to the shape check.
|
|
23
23
|
|
|
24
24
|
The record carries it as a top-level `extraSections` array of `{ rel, headings }`, and the set itself as `checkpoints.allowedSectionsByFolder`, keyed on the folder name the way `requiredSectionsByFolder` is. Both are additive.
|
|
25
25
|
|
|
26
|
+
### The section shape
|
|
27
|
+
|
|
28
|
+
The Shape section reports where a context entry breaks the shape inside its sections. Each finding carries a line and one of eight kinds.
|
|
29
|
+
|
|
30
|
+
- `retired-section`: a `## Decisions` H2
|
|
31
|
+
- `gotcha-count`, `gotcha-heading`, `gotcha-paragraph`: a `Gotchas` section past five bullets, holding a heading, or holding a paragraph
|
|
32
|
+
- `layout-heading`: a Layout H3 titled neither a code-spanned path nor `Other folders`
|
|
33
|
+
- `layout-bullets`, `layout-paragraphs`: a folder H3 past five bullets or past its one-paragraph lead
|
|
34
|
+
- `layout-depth`: any heading below H3 under `Layout`
|
|
35
|
+
|
|
36
|
+
Bullets count at any indent and across any paragraph, so a list split by a bold label counts as one. A line continuing a list item belongs to the item. `Other folders` is exempt from both folder caps.
|
|
37
|
+
|
|
38
|
+
### Where the shape gates
|
|
39
|
+
|
|
40
|
+
A shape finding gates under `--gate` only for an entry under a prefix that `SHAPE_GATED_FOLDERS` in `src/context/shape-gated.ts` lists, read from the repository root. Every other entry reports and never fails a push. A seed tree is matched by its toolkit path, such as `tooling/base/seeds/`.
|
|
41
|
+
|
|
42
|
+
The record carries a top-level `shapeFindings` array of `{ rel, gated, issues }`, and each entry carries its own `shape` list. The caps sit under `checkpoints` as `gotchaCap`, `layoutBulletCap`, and `layoutParagraphCap`, beside `retiredSectionsByFolder` and `shapeGatedFolders`. All are additive.
|
|
43
|
+
|
|
26
44
|
## Reference form
|
|
27
45
|
|
|
28
46
|
The reference-form check reports an entry naming a sibling entry by bare filename where `claude/skills/context-fold/references/context.md` asks for the path it sits at. A bare name resolves against whichever folder its reader is already in, so a domain that splits into subfolders strands every inbound reference and the break surfaces nowhere. A path is checkable, which is what makes the form rule worth measuring at all: once a reference spells its path, the citation gate resolves it and a split that moves the file fails the push.
|
|
@@ -23,7 +23,7 @@ canon context audit tooling/base/seeds --gate
|
|
|
23
23
|
| `--json` | Add a machine-readable record on stdout, keeping the frame |
|
|
24
24
|
| `--folder <list>` | Comma-separated folder names (default: the three below) |
|
|
25
25
|
| `--citations-only` | Run the gating citation check alone, printing nothing when it passes |
|
|
26
|
-
| `--gate` | Fail on a missing
|
|
26
|
+
| `--gate` | Fail on a missing section, an off-set H2, gated shape break, or drift too |
|
|
27
27
|
|
|
28
28
|
`--citations-only` and `--gate` refuse together. The first runs the citation check alone, so the two findings the second adds are never measured, and a run honoring both would exit clean on a file short a required section.
|
|
29
29
|
|
|
@@ -43,7 +43,7 @@ Exit codes are `0` for a clean run, `1` for a refusal, and `2` for a gating find
|
|
|
43
43
|
|
|
44
44
|
Entry length, reference form, table, provenance, the record's claim classification, and every word figure no record caps print and return `0` under every mode, because each is a judgment or a weight read alongside one, and failing a push on either would make the check something to route around.
|
|
45
45
|
|
|
46
|
-
Required-section, off-set H2, and index findings sit between the two. Both are answerable from the file rather than weighed, so `--gate` promotes them to failing codes while a bare run leaves them advisory. The toolkit runs the bare form against itself and the widened form against the seed tree, described below.
|
|
46
|
+
Required-section, off-set H2, and index findings sit between the two. Both are answerable from the file rather than weighed, so `--gate` promotes them to failing codes while a bare run leaves them advisory. A section shape break, such as a `## Decisions` H2 or a sixth gotcha, gates under `--gate` only in a shape-gated folder. The toolkit runs the bare form against itself and the widened form against the seed tree, described below.
|
|
47
47
|
|
|
48
48
|
## The seed gate
|
|
49
49
|
|
package/docs/agents/driver.md
CHANGED
|
@@ -100,4 +100,4 @@ An unreachable page refuses rather than returning an empty report, since nothing
|
|
|
100
100
|
|
|
101
101
|
The browser binary installs separately from the package, once, with `bunx playwright install chromium`. The command ships to targets like `demo`, `inventory`, and `capture`, because its whole purpose is measuring a page inside someone else's project. It reaches nothing under `src/capture/`, so the two surfaces move independently.
|
|
102
102
|
|
|
103
|
-
See `
|
|
103
|
+
See `canon --help` for where this sits among the browser commands, and `capture.md` for the single-state render it adds an axis to.
|
package/docs/agents/hooks.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Hooks
|
|
3
|
-
description: Running the post-merge steps through one verb, the order and the child call behind each, the root and working directory each step reads, the skip switches,
|
|
3
|
+
description: Running the post-merge steps through one verb, the order and the child call behind each, the root and working directory each step reads, the skip switches, the line each record maps to, and the reply link check
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Hooks
|
|
@@ -38,6 +38,26 @@ The reclaim takes no `--root`. It refuses the worktree its own working directory
|
|
|
38
38
|
|
|
39
39
|
Each step is a separate process rather than an in-process call, so the plugin update runs the binary the upgrade just installed. Every child, and every `git` read, runs with the repository variables a hook exports stripped, since `GIT_DIR` beats `-C`.
|
|
40
40
|
|
|
41
|
+
## Reply links
|
|
42
|
+
|
|
43
|
+
`canon hooks reply-links` checks that every markdown link in a reply names a file on disk. The `Stop` hook `reply-links.sh` runs it on the closing message of a turn, so a dead link is corrected in the same turn.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
printf '%s' "$reply" | canon hooks reply-links
|
|
47
|
+
canon hooks reply-links --json < reply.md
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| Option | Behavior |
|
|
51
|
+
| --------------- | ------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `--root <path>` | Root a relative link resolves against, the main worktree root from `git worktree list` if omitted |
|
|
53
|
+
| `--json` | Write `{ ok, missing, message }` to stdout. `message` is present only when `ok` is false |
|
|
54
|
+
|
|
55
|
+
The reply comes on stdin, and a terminal on stdin is refused. A relative link resolves against the root, an absolute one is checked as written. The check skips placeholders such as `<path>`, globs, URLs, anchors, and any link inside a code span or fence. A `:42`, `:42-50`, or `#L42` tail is stripped before the check.
|
|
56
|
+
|
|
57
|
+
Each entry in `missing` carries the `destination` as written and the `path` that was checked. A link into `.claude/worktrees/<name>/.canon/` also carries a `suggestion` with the main-root path when that file exists there.
|
|
58
|
+
|
|
59
|
+
Exit codes: `0` when every link resolves or the reply holds none, `1` when at least one does not. The missing list goes to stderr. The hook turns a finding into exit 2 so the session continues, and exits 1 without blocking when it could not run the check, such as with no `jq` or no `canon` on `PATH`.
|
|
60
|
+
|
|
41
61
|
## Skip switches
|
|
42
62
|
|
|
43
63
|
| Variable | Skips |
|
package/docs/agents/index.md
CHANGED
|
@@ -12,29 +12,26 @@ CLI catalog and invocation rules for agents, split by command domain. Start with
|
|
|
12
12
|
- [Canvas](canvas.md): The canvas server, its content format, and the verbs that list, arrange, fit, select, edit, mark, and capture frames
|
|
13
13
|
- [Capture](capture.md): Rendering HTML sources to PNG, what the command asserts about fonts, and why the selector has no default
|
|
14
14
|
- [Census](census.md): Tracked-plus-untracked file count, a breakdown by extension, and a line total that skips whatever reads as binary
|
|
15
|
-
- [Command catalog](commands.md): Every top-level command with its purpose, each domain's subcommands and the page describing them, the browser commands, and the version skew report
|
|
16
15
|
- [Comments](comments.md): Comment density by language and kind, the two structural exclusions, and how the degradation sweep finds its vocabulary
|
|
17
16
|
- [Context audit checks](context-audit-checks.md): What each non-gating check reports, the unit each checkpoint is measured in, the requirements record's word cap, which folders each check reaches, and what moved to the attribute tier
|
|
18
17
|
- [Context audit](context-audit.md): Running the audit, its flags and folder scope, the exit codes, the citation gate, and the widened gate the seed stage runs
|
|
19
18
|
- [Doc classifier](context-classify.md): Classifying canonical-doc content as keep, replace/rewrite, history, or move in diff and sweep mode, the classifier setting pair, the record shape, and the exit codes
|
|
20
19
|
- [Self-stated counts](counts.md): Reading a sentence that asserts a closed catalog's size, how a match is decided, the plausibility filter that keeps a generic word from matching a subset, and why the sweep reports rather than gates
|
|
21
20
|
- [Demo](demo.md): Compiling a screencast draft into a runnable plan, driving a served application to a recording and a still, reading numbered frames back out of a recording, the pointer the recording paints, and what each refusal reports
|
|
22
|
-
- [Docs](docs.md): How canon docs resolves the toolkit's own reference surface from an install root, and how a split domain is named
|
|
23
|
-
- [Drift surfaces](drift-surfaces.md): The seven sections canon sync --check reports beside the per-domain scan, being seeds, superseded artifacts, unmigrated domains, surfaces at the old root, new rules and skills, and the reverse walk, with the managed-target gate and what counts toward the exit code
|
|
24
21
|
- [Driver](driver.md): Walking a page through named interactions, the probe catalog and the false finding each one carries, why viewport heights are never defaulted, and what each refusal reports
|
|
25
22
|
- [Merge gate](gate.md): Running the gate this repository verifies a branch with, what the stage table holds and what stays a script, how the changed set scopes three stages, and why a stage that cannot read its input reports rather than passing
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [Install and sync](install-and-sync.md): What each install and sync verb writes, refuses, or leaves alone, and how drift is attributed in a target project
|
|
23
|
+
- [Hooks](hooks.md): Running the post-merge steps through one verb, the order and the child call behind each, the root and working directory each step reads, the skip switches, the line each record maps to, and the reply link check
|
|
24
|
+
- [Indexes](indexes.md): How canon indexes regen and canon indexes list resolve paths, what they stage, and the record and exit codes each emits
|
|
25
|
+
- [Install and sync](install-and-sync.md): What each install and sync verb writes, refuses, or leaves alone, the drift report and its seven side sections, the rule detection record, and version skew states
|
|
30
26
|
- [Intake](intake.md): Reading intake folder counts and items, the three read states an item can be in, landing a batch of selections in one cluster, the refusal reasons, and why a call is scoped to one file
|
|
31
27
|
- [Key changes bijection](key-changes.md): Comparing the files a pull request body's Key changes names against its own diff, the two directions and the split inside each that decides what is worth raising, the span rules the extractor was measured into, and the three refusals that separate a clean pass from a read that produced nothing
|
|
32
28
|
- [Label coverage](label-coverage.md): Reading a changed set against the pull request label map, the two tables it matches, how a gap is separated from a decision, and why an absent map is an answer
|
|
33
|
-
- [Markdown audit
|
|
34
|
-
- [Markdown audit](markdown-audit.md):
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
29
|
+
- [Markdown audit density](markdown-audit-density.md): The six layout limits the markdown audit measures, what each one counts, which paths take a finding, and how a folder's gate turns on
|
|
30
|
+
- [Markdown audit weight](markdown-audit-weight.md): The advisory sections of the markdown audit, being bullet and paragraph weight, run depth, the two cadence numbers, and the length ceiling, with the samples behind each checkpoint and which of those numbers gate through density
|
|
31
|
+
- [Markdown audit](markdown-audit.md): Running the audit over any markdown path, where its bans and checkpoints are read from, what each check reports, how a reference page opts into its shape check, and why bans, dead links, and density or reference shape on a gated path fail while the rest reports
|
|
32
|
+
- [Migrate](migrate.md): What each canon migrate verb moves, the markers that keep an old spelling, and what each one refuses
|
|
33
|
+
- [Output shape](output-shape.md): The framed output shape every command renders into, the JSON and color modes, the exit discipline, the runtime catalogs, and a headless invocation per domain
|
|
34
|
+
- [Overview](overview.md): What this folder covers, the invocation rules every command inherits, and how canon docs resolves a topic name
|
|
38
35
|
- [The pull request evidence layout](pr-evidence-layout.md): How canon pr evidence groups screenshots into one block per view with a row per width and a column per theme, when a base column appears, where a name outside the form lands, how the commit line links, and when the blocks open
|
|
39
36
|
- [The pull request evidence comparison](pr-evidence.md): What canon pr evidence compares, the marker that lets it edit its own comment rather than duplicate it, the refusal reasons it names, what the --check read reports as owed, and why the comparison anchors at the merge base rather than the previous push
|
|
40
37
|
- [The pull request frame store](pr-frames.md): How canon pr frames pushes a UI review frame to a never-merged branch through the GitHub API and returns a branch-path link, which ref it writes, the pass segment that keeps an earlier image fixed, the refusal reasons it names, and how --drop and --prune rewrite the branch so a dropped frame leaves history
|
|
@@ -51,7 +48,6 @@ CLI catalog and invocation rules for agents, split by command domain. Start with
|
|
|
51
48
|
- [Routing report](routing.md): Reading per CLAUDE.md section how many bullets name a path, what counts as naming one, when a rule counts as covering it, the two refusals, and why the verb reports rather than gates
|
|
52
49
|
- [Rule citations](rule-citations.md): Resolving every path a governance rule cites and every frontmatter glob the internal corpus declares, the one form a citation is written in, the shapes that look like citations and are not, the two classes where an absent path is correct, why the glob half reads one corpus, and why this one gates
|
|
53
50
|
- [Sandbox](sandbox.md): Scenario routing, the expectation scoring surface, and the coverage census over scenarios and skills
|
|
54
|
-
- [Scripting](scripting.md): The runtime catalogs that replace hardcoded names, what each carries, and a headless invocation per domain
|
|
55
51
|
- [Sessions transfer](sessions-transfer.md): Moving a session to another machine, the export bundle and its manifest, placing it with import, the refusal reasons, and what a resume on the target depends on
|
|
56
52
|
- [Sessions](sessions.md): Resolving live peer sessions to the worktree and branch each holds, reading which row is the caller, the liveness confidence field, what each session surface can see, and where moving a session to another machine is described
|
|
57
53
|
- [Skill audit](skills-audit.md): Measuring both skill corpora against the skill standards, the checks it reads, the requirement gate that is the only failing one, and the drift verb that names bodies rewritten since a ref
|
|
@@ -59,7 +55,7 @@ CLI catalog and invocation rules for agents, split by command domain. Start with
|
|
|
59
55
|
- [Slides](slides.md): Where a deck folder lives and what it holds, what it declares for the whole deck in deck.json, the faces it embeds, what each slide declares on its own body, transitions and entrances, the master built from the project's tokens, speaker notes, charts, and what each refusal reports
|
|
60
56
|
- [State-scoped risk](state-scoped-risk.md): Reading committed state rather than an arriving change, the shipped-tree corpus the secret scan reads, what it keys on and how a deliberate value is exempted, the advisory check and its network failure mode, and why one gates while the other reports
|
|
61
57
|
- [Superseded values](superseded.md): Reading where the tree still asserts a value a changed convention no longer produces, why the sweep keys on the value rather than the file, the family stem behind a templated citation, the exemption marker, the blind spots it cannot reach, and why it reports rather than gates
|
|
62
|
-
- [Targets](targets.md): The projects this toolkit installed into,
|
|
58
|
+
- [Targets](targets.md): The projects this toolkit installed into, where each answer comes from, and the cross-target pull request read
|
|
63
59
|
- [Tasks archive](tasks-archive.md): Archiving a shipped task by stem or pull request, declining one decided against, the refusal reasons each carries, and how the plan and ready folder move with the task
|
|
64
60
|
- [Tasks plans](tasks-plans.md): The five verbs that read or write a task's plan, being where it sits and who cites it, whether it waits on the operator, the branch it derives, what a branch reached against what it declared, and writing its Plan line
|
|
65
61
|
- [Tasks validate](tasks-validate.md): Validating the board against the tree, the seven checks, the five report arrays, the exit codes, and the refusal reasons
|
package/docs/agents/indexes.md
CHANGED
|
@@ -1,51 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Indexes
|
|
3
|
-
description:
|
|
3
|
+
description: How canon indexes regen and canon indexes list resolve paths, what they stage, and the record and exit codes each emits
|
|
4
|
+
kind: reference
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Indexes
|
|
7
8
|
|
|
8
|
-
`canon indexes regen` rewrites `index.md` files from sibling frontmatter, so a hand edit to a generated index is lost
|
|
9
|
+
`canon indexes regen [paths…]` rewrites `index.md` files from sibling frontmatter, so a hand edit to a generated index is lost. `canon indexes list [path]` flattens each folder's `title` and `subtitle` plus each sibling's `title` and `description` into one catalog sorted by path.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
`regen` takes `--dry-run`, `--json`, `--root <path>` (default the current directory), and `--no-stage`. `list` takes `--json`.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
- With no paths `regen` walks the current directory, pruning `.git`, `node_modules`, and anything git ignores
|
|
14
|
+
- With paths, each resolves by walking up to the nearest indexed ancestor, bounded by `--root`, without consulting git. That is how `.canon/tasks/` and `.canon/memory/` stay current.
|
|
15
|
+
- A `PostToolUse` hook on `Write|Edit|MultiEdit` drives it, so a shell `mv` fires nothing. Run it after the last move.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
## Output
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
| --------------- | ---------------------------------------------------------------- |
|
|
18
|
-
| `--dry-run` | Report which indexes would change without writing |
|
|
19
|
-
| `--json` | Emit a machine-readable record per index on stdout |
|
|
20
|
-
| `--root <path>` | Walk-up boundary when positional paths are passed (default: CWD) |
|
|
21
|
-
| `--no-stage` | Skip the auto `git add` on modified indexes |
|
|
22
|
-
|
|
23
|
-
Exit codes: `0` clean, `1` frontmatter error or missing index, `2` drift found in `--dry-run`.
|
|
24
|
-
|
|
25
|
-
An exit code says nothing about a call made from a session, since a shell profile may wrap the binary in a function taking its status from a later command. Read the record's `results` array rather than the exit when a skill consumes this, on the write pass as well as the dry run.
|
|
26
|
-
|
|
27
|
-
When positional paths are passed inside a git repo, modified `index.md` files are staged so lint-staged and Claude `PostToolUse` hooks commit the regenerated catalog. Whole-repo walks never auto-stage, and neither does a path git ignores, since staging one always fails and the warning would fire on every edit.
|
|
28
|
-
|
|
29
|
-
Skills can parse drift without branching on exit code:
|
|
19
|
+
`regen --json` emits a record per index in `results`, each with an `action`. A dry run reports drift as `would-write`.
|
|
30
20
|
|
|
31
21
|
```bash
|
|
32
22
|
canon indexes regen --dry-run --json | jq '.results[] | select(.action == "would-write")'
|
|
33
23
|
```
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
With paths inside a git repo, modified indexes are staged. A whole-repo walk and a git-ignored path never stage.
|
|
36
26
|
|
|
37
|
-
`
|
|
27
|
+
`list --json` emits `{ root, entries, errors }`.
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
- Each entry is `{ path, title, description }`, and an `index.md` row takes its `subtitle` as `description`
|
|
30
|
+
- A folder failing validation lands in `errors`, drops out of `entries`, and prints one `ERROR:` line on stderr
|
|
31
|
+
- Git-ignored folders never appear, so `.canon/tasks/` and `.canon/memory/` are absent
|
|
42
32
|
|
|
43
|
-
|
|
33
|
+
## Refusals
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
Read the record's `results` rather than the exit, on a write pass as well as a dry run.
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
| Verb | Exit | Means |
|
|
38
|
+
| ------- | ---- | ---------------------------------------------------------- |
|
|
39
|
+
| `regen` | 0 | Clean |
|
|
40
|
+
| `regen` | 1 | A frontmatter error or a missing index |
|
|
41
|
+
| `regen` | 2 | Drift found under `--dry-run` |
|
|
42
|
+
| `list` | 0 | No errors |
|
|
43
|
+
| `list` | 1 | The root is not a directory, or a folder failed validation |
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
## See also
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
- `canon docs context-model`: the frontmatter contract and when to adopt indexes
|