@erclx/aitk 0.32.0 → 0.33.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/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/bash-script/REQUIREMENT.md +36 -0
- package/claude/skills/ci-workflow/REQUIREMENT.md +35 -0
- package/claude/skills/claude-seed-sync/REQUIREMENT.md +40 -0
- package/claude/skills/docs-sync/REQUIREMENT.md +38 -0
- package/docs/agents.md +17 -9
- package/package.json +1 -1
- package/src/claude/skills-list.ts +6 -0
- package/src/commands/context.ts +27 -4
- package/src/context/audit.ts +46 -3
- package/src/context/folders.ts +9 -1
- package/standards/tasks.md +27 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bash-script
|
|
3
|
+
description: Scope boundary for the interactive script house style and the stream discipline underneath it
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bash script requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a session asked for a human-facing shell tool writes one whose frame decoration, log lines, and prompts all land on stdout, so the script cannot be piped and any data it emits arrives mixed with its own presentation.
|
|
11
|
+
|
|
12
|
+
Three more failures share a cause, which is that an interactive script is written as though a person is always watching. A prompt blocks forever when stdin is not a terminal, which is the shape every CI job and every agent run has. A cancellation path prints both a cancel line and an error, or an exit trap prints a closing frame the success path already printed, so the same run reports twice. And each generated script picks its own icons, casing, and frame characters, so a folder of them reads as several unrelated tools.
|
|
13
|
+
|
|
14
|
+
The visual conventions this skill fixes are otherwise arbitrary. Their value is that they are the same across every script, which is a property no individual script can establish for itself.
|
|
15
|
+
|
|
16
|
+
## Must
|
|
17
|
+
|
|
18
|
+
- Keep every frame, log line, and prompt on stderr, and reserve stdout for data. `--help` is the one exception, since its consumer is a person rather than a pipe.
|
|
19
|
+
- Guard every prompt on an attached terminal and refuse inside the frame rather than blocking on a read that will never return
|
|
20
|
+
- Give the timeline one owner per exit path, so success, cancellation, and error each close it exactly once
|
|
21
|
+
- Copy the shared templates rather than restating them, keeping only the colors and functions the script uses
|
|
22
|
+
|
|
23
|
+
## Must not
|
|
24
|
+
|
|
25
|
+
- Assert a convention the generated script cannot be checked against by reading it. A rule that cannot be verified from the output is style with no gate behind it.
|
|
26
|
+
- Carry a second copy of the timeline, logging, or prompt implementations. The bundled reference is the single copy, and a body that restates it drifts from it.
|
|
27
|
+
|
|
28
|
+
## Guards
|
|
29
|
+
|
|
30
|
+
- A request for a script with no human at the terminal stops and routes to `cli-script` rather than generating a timeline nothing will render
|
|
31
|
+
|
|
32
|
+
## Out of scope
|
|
33
|
+
|
|
34
|
+
- Non-interactive automation, CI, and agent-run scripts: `cli-script`, which keeps the error handling and the stdout contract and drops the timeline, the icons, and the prompts
|
|
35
|
+
- GitHub Actions workflow files: `ci-workflow`
|
|
36
|
+
- What the generated script does. This skill fixes the shape of the output and the stream it goes to, and the commands belong to the request.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-workflow
|
|
3
|
+
description: Scope boundary for pipeline structure against job contents, and the reproducibility rules under it
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI workflow requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a session writes a pipeline whose jobs run in sequence because `needs` was used to express the order a person reads them in rather than a data dependency. The pipeline then costs the sum of its jobs where it could have cost the longest one, and the waste compounds on every push.
|
|
11
|
+
|
|
12
|
+
The rest are reproducibility failures that surface as flakes. An action pinned to a moving ref changes under the project, so a run that passed yesterday fails today with no commit behind it and the diff explains nothing. A cache keyed on a static string serves a stale browser or toolchain after a version bump, and the failure reads as a broken test rather than a stale cache. Artifacts upload on every run and never expire, so storage grows with the commit count while the ones worth reading are the failures. And a workflow with no manual trigger can only be reproduced by pushing a commit, which is the wrong instrument for a run that failed for an environmental reason.
|
|
13
|
+
|
|
14
|
+
## Must
|
|
15
|
+
|
|
16
|
+
- Gate a job only on a data dependency or on a cost that justifies the wait, and leave every other job parallel
|
|
17
|
+
- Pin every action to a tag that cannot cross a major version
|
|
18
|
+
- Key a cache on the version string of the thing it caches
|
|
19
|
+
- Give every workflow a manual trigger beside its primary one
|
|
20
|
+
- Bound artifact upload to failures and set an expiry on it
|
|
21
|
+
|
|
22
|
+
## Must not
|
|
23
|
+
|
|
24
|
+
- Own what runs inside a job. The build, test, and deploy commands come from the project, and a workflow asserting its own is a second copy of the project's scripts.
|
|
25
|
+
- Enumerate the job set as a fixed list. Projects add and remove jobs, and what has to survive that is the parallel and gated structure rather than the roster.
|
|
26
|
+
|
|
27
|
+
## Guards
|
|
28
|
+
|
|
29
|
+
- A request for a deploy, publish, or release step stops at the gate. The job's contents carry credentials and an environment this skill cannot see, so it emits the `needs` wiring and names what the caller has to fill in rather than guessing a deploy command.
|
|
30
|
+
|
|
31
|
+
## Out of scope
|
|
32
|
+
|
|
33
|
+
- The shell scripts a job invokes: `cli-script`
|
|
34
|
+
- Secrets, environments, and deploy targets, which live in the repository settings rather than in the workflow this skill writes
|
|
35
|
+
- CI systems other than GitHub Actions. The structure rules generalize and the file format does not, so a different system is a different skill rather than a flag on this one.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-seed-sync
|
|
3
|
+
description: Scope boundary for section-granular seed reconciliation against the bulk install and sync commands
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude seed sync requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a project that edited an installed seed or standard has two ways to take an upstream change and both lose something. `aitk standards install` overwrites every file, so the edits are gone with no record of what they were. `aitk standards sync` updates only files it already finds and adds none, so a standard written after the project installed never arrives at all. Neither can deliver one upstream section into a file the project has customized, which is the case a grown project is always in.
|
|
11
|
+
|
|
12
|
+
A whole-file diff does not close it either. It cannot separate a section the user rewrote on purpose from a section the toolkit moved on without them, so the choice reaches the user as accept everything or lose everything, and the safe answer is always to skip.
|
|
13
|
+
|
|
14
|
+
Two failures belong to the audit rather than to the diff. A decision taken in chat dies with the session, so an audit half applied cannot be resumed and the second run starts over. And a file the toolkit generates rather than ships, such as an index rebuilt from sibling frontmatter, is absent from every source catalog by design, so a naive comparison reports it as a local addition and invites the user to reconcile something nothing owns.
|
|
15
|
+
|
|
16
|
+
## Must
|
|
17
|
+
|
|
18
|
+
- Read seed and standard content from the CLI rather than holding a copy, so the audit and the install cannot disagree
|
|
19
|
+
- Diff per section, treating the preamble as a section of its own
|
|
20
|
+
- Separate a customized section from a stale one, and default the customized one to no action
|
|
21
|
+
- Persist the proposal and every decision to a review file that stays the source of truth across re-pings
|
|
22
|
+
- Apply one section at a time, never by rewriting a file
|
|
23
|
+
|
|
24
|
+
## Must not
|
|
25
|
+
|
|
26
|
+
- Propose removing a section present only in the target. Those are the customizations the skill exists to preserve.
|
|
27
|
+
- Write a target file before a decision is recorded against the item
|
|
28
|
+
- Read an empty decision slot as consent
|
|
29
|
+
|
|
30
|
+
## Guards
|
|
31
|
+
|
|
32
|
+
- No `aitk` on PATH, or no `.claude/` directory at the project root, stops before any read
|
|
33
|
+
|
|
34
|
+
## Out of scope
|
|
35
|
+
|
|
36
|
+
- Bulk install and sync of a whole domain, which `aitk <domain> install` and `aitk <domain> sync` own and `toolkit-cli` documents. Reach for this skill when the target holds edits worth keeping, and for those commands when it does not.
|
|
37
|
+
- Golden configs, which overwrite by design and carry no section structure to diff
|
|
38
|
+
- Governance rules: `aitk gov sync`
|
|
39
|
+
- First-time scaffold of a project that has installed nothing yet: `setup-init`
|
|
40
|
+
- Public `README.md` and `docs/` prose: `docs-sync`
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-sync
|
|
3
|
+
description: Scope boundary for consumer-facing prose against the agent-facing docs the ship chain syncs beside it
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Docs sync requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a rename or a dropped flag ships with the README still describing the old surface. Nothing fails, because no test reads prose, so the doc stays wrong until a person hits it.
|
|
11
|
+
|
|
12
|
+
Three failures belong to the sync itself rather than to the drift. A session that syncs by rewriting whole files churns sections the change never reached, which costs the reviewer the ability to tell the sync from the feature. A doc edited earlier in the same session reads as current while a later change leaves one of its sections stale, so file-level classification passes where section-level would not. And a hardcoded doc list never checks the file someone added after the list was written.
|
|
13
|
+
|
|
14
|
+
The quiet one is the baseline. A diff resolved against a bare local ref equals HEAD on `main` and on a branch before its first commit, so every committed change drops out of the set. The skill then reports nothing to sync, which reads as a clean result rather than as an admission that it could not see the work.
|
|
15
|
+
|
|
16
|
+
## Must
|
|
17
|
+
|
|
18
|
+
- Resolve one merge base, prefer the remote ref over the local one, and reuse it everywhere the skill reads the diff
|
|
19
|
+
- Say so in the output when the baseline degrades, rather than reporting a clean pass off a set it could not build
|
|
20
|
+
- Discover the doc set by glob at run time
|
|
21
|
+
- Classify and rewrite at section level, so a partly stale file is partly rewritten
|
|
22
|
+
- Write immediately after the preview, since the tool permission dialog is the confirmation gate
|
|
23
|
+
|
|
24
|
+
## Must not
|
|
25
|
+
|
|
26
|
+
- Touch a section the change does not reach
|
|
27
|
+
- Rewrite a doc to match the diff when the doc records an intent the diff departed from. That is a finding rather than a sync.
|
|
28
|
+
|
|
29
|
+
## Guards
|
|
30
|
+
|
|
31
|
+
- No committed change and no working-tree change stops the skill before it reads any doc
|
|
32
|
+
|
|
33
|
+
## Out of scope
|
|
34
|
+
|
|
35
|
+
- `.claude/` planning docs, tasks, plans, and context entries: `claude-docs`, which runs immediately before this skill in the ship chain and resolves the same baseline. The split is by audience, so a file's location decides which skill owns it rather than its subject.
|
|
36
|
+
- `CLAUDE.md` and the installed seed docs: `claude-seed-sync`, which reconciles them per section against the toolkit source
|
|
37
|
+
- Changelog entries, which release tooling generates from commit messages
|
|
38
|
+
- Whether the prose conforms to its standards. `claude-standards-audit` reports violations and fixes none, and this skill writes prose it does not audit.
|
package/docs/agents.md
CHANGED
|
@@ -399,6 +399,8 @@ The table check reports a catalog that grows a row per shipped thing, not a tabl
|
|
|
399
399
|
|
|
400
400
|
The provenance check reports the markers narrating how a domain reached its shape rather than describing what it is: a date, a change number, or a release label. The standard admits a rejected alternative and the reasoning that killed it while refusing the provenance attached to it, so a marker names a line to read rather than a line to delete. Findings group by entry and sort left to right within a line, since what a reader acts on is which file to open. Fenced blocks are excluded, which keeps a pinned version in an install command from reading as a claim the entry makes. Frontmatter is excluded with them, since the content checks read the body alone, and that is what keeps a diagram entry's dated `verified` stamp a record of its last check rather than a marker to settle. Length is the exception, counting the whole file, so a reader applying the 150-rendered-line checkpoint against the body alone lands a few lines under what the tool reports.
|
|
401
401
|
|
|
402
|
+
This one check covers `.claude/context/` alone, while length, depth, and the table finding reach every audited folder. The rule is stated in `.claude/standards/context.md`, which opens its scope by handing diagrams and wireframes to `diagrams.md` and `wireframes.md`, and the sibling standards do not restate it. A marker reported in a diagram entry would cite a rule that entry's own standard routes elsewhere. The split is between kinds of rule rather than kinds of folder: a threshold on how far a reader travels generalizes across entry types, while a rule about what an entry may say is the jurisdiction a scope statement exists to settle. The scoping key is the folder an entry was audited under, so `--folder` still reaches a folder the default list does not carry, and a domain split into `context/<sub-area>/` is governed as `context`. Every run states the reach, including a run where no audited folder is the governed one. The JSON record carries it as `checkpoints.provenanceFolder` and a per-folder `governsContent`.
|
|
403
|
+
|
|
402
404
|
Index drift compares an index against its siblings in both directions. An entry the index does not link is invisible to a session choosing what to open, and a linked name resolving to nothing sends one to a path that opens nothing.
|
|
403
405
|
|
|
404
406
|
### The citation gate
|
|
@@ -413,15 +415,15 @@ What remains is a sentence naming a hypothetical entry to show the shape of a na
|
|
|
413
415
|
|
|
414
416
|
Use these to discover what's available instead of hardcoding names.
|
|
415
417
|
|
|
416
|
-
| Command | Returns
|
|
417
|
-
| -------------------------------- |
|
|
418
|
-
| `aitk tooling list --json` | Stacks, extends chain, dep and script counts
|
|
419
|
-
| `aitk snippets list --json` | Presets and categories with their slugs
|
|
420
|
-
| `aitk standards list --json` | Standards docs and the paths each governs
|
|
421
|
-
| `aitk gov list --json` | Governance stacks and rule sets
|
|
422
|
-
| `aitk claude seeds list --json` | Seed doc sources with content
|
|
423
|
-
| `aitk claude skills list --json` | Plugin skills
|
|
424
|
-
| `aitk docs list --json` | Consumer docs plus per-domain context
|
|
418
|
+
| Command | Returns |
|
|
419
|
+
| -------------------------------- | --------------------------------------------- |
|
|
420
|
+
| `aitk tooling list --json` | Stacks, extends chain, dep and script counts |
|
|
421
|
+
| `aitk snippets list --json` | Presets and categories with their slugs |
|
|
422
|
+
| `aitk standards list --json` | Standards docs and the paths each governs |
|
|
423
|
+
| `aitk gov list --json` | Governance stacks and rule sets |
|
|
424
|
+
| `aitk claude seeds list --json` | Seed doc sources with content |
|
|
425
|
+
| `aitk claude skills list --json` | Plugin skills, descriptions, requirement flag |
|
|
426
|
+
| `aitk docs list --json` | Consumer docs plus per-domain context |
|
|
425
427
|
|
|
426
428
|
Every catalog serializes through `JSON.stringify`, so a name carrying a quote
|
|
427
429
|
emits valid JSON. `aitk tooling list` and `aitk snippets list` previously built
|
|
@@ -448,6 +450,12 @@ or unparseable returns an empty description rather than failing the listing, so
|
|
|
448
450
|
one malformed file cannot hide the rest of the catalog. `--names` emits skill
|
|
449
451
|
names one per line.
|
|
450
452
|
|
|
453
|
+
Each entry also carries `requirement`, whether the folder holds a sibling
|
|
454
|
+
`REQUIREMENT.md`. Coverage of that file is selective by design, so a `false` is
|
|
455
|
+
not a gap to close and the flag answers which skills carry one without a caller
|
|
456
|
+
listing the directory itself. It says nothing about why, which is a judgment the
|
|
457
|
+
toolkit records against its own corpus rather than in the catalog.
|
|
458
|
+
|
|
451
459
|
## Non-interactive examples
|
|
452
460
|
|
|
453
461
|
```bash
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ const FRONTMATTER = /^---\n([\s\S]*?)\n---/
|
|
|
6
6
|
export interface SkillListing {
|
|
7
7
|
readonly name: string
|
|
8
8
|
readonly description: string
|
|
9
|
+
readonly requirement: boolean
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -15,6 +16,10 @@ export interface SkillListing {
|
|
|
15
16
|
*
|
|
16
17
|
* The folder name wins over the frontmatter `name` when they disagree, because
|
|
17
18
|
* Claude Code invokes a skill by its directory.
|
|
19
|
+
*
|
|
20
|
+
* `requirement` reports whether the folder carries `REQUIREMENT.md`. Coverage is
|
|
21
|
+
* selective by design, so a false is not a gap to close and this field carries no
|
|
22
|
+
* reason for one. The toolkit records those separately from the catalog.
|
|
18
23
|
*/
|
|
19
24
|
export function listSkills(root: string): SkillListing[] {
|
|
20
25
|
const skillsRoot = join(root, 'claude', 'skills')
|
|
@@ -30,6 +35,7 @@ export function listSkills(root: string): SkillListing[] {
|
|
|
30
35
|
return paths.map((path) => ({
|
|
31
36
|
name: dirname(path),
|
|
32
37
|
description: readDescription(join(skillsRoot, path)),
|
|
38
|
+
requirement: existsSync(join(skillsRoot, dirname(path), 'REQUIREMENT.md')),
|
|
33
39
|
}))
|
|
34
40
|
}
|
|
35
41
|
|
package/src/commands/context.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { resolve } from 'node:path'
|
|
|
2
2
|
import type { Command } from 'commander'
|
|
3
3
|
import {
|
|
4
4
|
type EntryReport,
|
|
5
|
+
governsContent,
|
|
5
6
|
LENGTH_CHECKPOINT,
|
|
6
7
|
measureFolders,
|
|
7
8
|
PEER_BULLET_CHECKPOINT,
|
|
9
|
+
PROVENANCE_FOLDER,
|
|
8
10
|
RENDER_WIDTH,
|
|
9
11
|
RUN_CHECKPOINT,
|
|
10
12
|
} from '@/context/audit'
|
|
@@ -90,8 +92,8 @@ function parseFolders(list: string | undefined): string[] | string {
|
|
|
90
92
|
|
|
91
93
|
if (names.length === 0) return 'Empty --folder list. Pass at least one name.'
|
|
92
94
|
|
|
93
|
-
// `..` would resolve the
|
|
94
|
-
//
|
|
95
|
+
// `..` would resolve the audited folder above `.claude/`, taking the scan
|
|
96
|
+
// and the citation pattern outside the tree the audit describes.
|
|
95
97
|
const invalid = names.filter((name) => !FOLDER_NAME.test(name))
|
|
96
98
|
if (invalid.length > 0) {
|
|
97
99
|
return `--folder takes folder names under .claude/, not paths: ${invalid.join(', ')}`
|
|
@@ -138,7 +140,7 @@ async function runAudit(
|
|
|
138
140
|
reportLength(entries)
|
|
139
141
|
reportDepth(entries)
|
|
140
142
|
reportTables(entries)
|
|
141
|
-
reportProvenance(entries)
|
|
143
|
+
reportProvenance(entries, folders)
|
|
142
144
|
reportDrift(drift)
|
|
143
145
|
outro()
|
|
144
146
|
}
|
|
@@ -150,6 +152,7 @@ async function runAudit(
|
|
|
150
152
|
folders: folders.map((folder) => ({
|
|
151
153
|
path: folder.rel,
|
|
152
154
|
entries: folder.entries.length,
|
|
155
|
+
governsContent: governsContent(folder),
|
|
153
156
|
})),
|
|
154
157
|
citations: {
|
|
155
158
|
scanned: citations.scanned,
|
|
@@ -164,6 +167,7 @@ async function runAudit(
|
|
|
164
167
|
runCountsBlankLines: true,
|
|
165
168
|
renderWidth: RENDER_WIDTH,
|
|
166
169
|
peerBullet: PEER_BULLET_CHECKPOINT,
|
|
170
|
+
provenanceFolder: PROVENANCE_FOLDER,
|
|
167
171
|
},
|
|
168
172
|
})}\n`,
|
|
169
173
|
)
|
|
@@ -332,9 +336,28 @@ function reportTables(entries: readonly EntryReport[]): void {
|
|
|
332
336
|
* time, and a flat list of those buries the entries holding one. What a reader
|
|
333
337
|
* acts on is which file to open, so the count sits beside the name and the
|
|
334
338
|
* lines follow it.
|
|
339
|
+
*
|
|
340
|
+
* The reach is stated on every run, including the run where nothing is in
|
|
341
|
+
* scope. A check that covered three folders and now covers one reads as quietly
|
|
342
|
+
* missing things unless the report says which folder it measured.
|
|
335
343
|
*/
|
|
336
|
-
function reportProvenance(
|
|
344
|
+
function reportProvenance(
|
|
345
|
+
entries: readonly EntryReport[],
|
|
346
|
+
folders: readonly AuditedFolder[],
|
|
347
|
+
): void {
|
|
337
348
|
logStep('Provenance')
|
|
349
|
+
|
|
350
|
+
const governed = folders.filter(governsContent)
|
|
351
|
+
if (governed.length === 0) {
|
|
352
|
+
logInfo(
|
|
353
|
+
`Out of scope. The rule is stated in the standard governing .claude/${PROVENANCE_FOLDER}/, and no audited folder is that one.`,
|
|
354
|
+
)
|
|
355
|
+
return
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
logInfo(
|
|
359
|
+
`Covers .claude/${PROVENANCE_FOLDER}/ alone, whose standard carries the rule. The sibling standards do not restate it.`,
|
|
360
|
+
)
|
|
338
361
|
logInfo('Fenced blocks are excluded. A marker is a judgment, never a defect.')
|
|
339
362
|
|
|
340
363
|
const carrying = entries
|
package/src/context/audit.ts
CHANGED
|
@@ -61,6 +61,25 @@ const PROVENANCE: readonly { kind: ProvenanceKind; pattern: RegExp }[] = [
|
|
|
61
61
|
{ kind: 'release', pattern: /\bv\d+\.\d+(?:\.\d+)?\b/g },
|
|
62
62
|
]
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* The folder whose standard carries the exclusion above.
|
|
66
|
+
*
|
|
67
|
+
* `standards/context.md` opens its scope by handing diagrams and wireframes to
|
|
68
|
+
* `diagrams.md` and `wireframes.md`, so a marker reported in either would cite
|
|
69
|
+
* a rule that entry's own standard routes elsewhere. The length, depth, and
|
|
70
|
+
* table checkpoints are quoted from the same standard and keep reaching every
|
|
71
|
+
* audited folder, because a threshold on how far a reader travels generalizes
|
|
72
|
+
* across entry types while a rule about what an entry may say does not.
|
|
73
|
+
*
|
|
74
|
+
* Restating the exclusion in the sibling standards was the alternative. It
|
|
75
|
+
* duplicates one knowledge item across three surfaces, which the root
|
|
76
|
+
* instruction file forbids, and pointing is not available because the surface
|
|
77
|
+
* they would point at is the one disclaiming them. Should a diagram entry ever
|
|
78
|
+
* accumulate narration, the escalation is an attribute standard owning the rule
|
|
79
|
+
* across document types, not restoring this reach without an owner.
|
|
80
|
+
*/
|
|
81
|
+
export const PROVENANCE_FOLDER = 'context'
|
|
82
|
+
|
|
64
83
|
export type ProvenanceKind = 'date' | 'change' | 'release'
|
|
65
84
|
|
|
66
85
|
export interface TableFinding {
|
|
@@ -95,6 +114,7 @@ export interface EntryReport {
|
|
|
95
114
|
/** First line of the longest run, or 0 when the entry has no run at all. */
|
|
96
115
|
readonly longestRunLine: number
|
|
97
116
|
readonly catalogTables: readonly TableFinding[]
|
|
117
|
+
/** Empty for an entry no standard bans a change narrative in. */
|
|
98
118
|
readonly provenance: readonly ProvenanceFinding[]
|
|
99
119
|
}
|
|
100
120
|
|
|
@@ -320,7 +340,18 @@ function provenance(lines: readonly BodyLine[]): ProvenanceFinding[] {
|
|
|
320
340
|
.map((each) => each.finding)
|
|
321
341
|
}
|
|
322
342
|
|
|
323
|
-
|
|
343
|
+
/**
|
|
344
|
+
* Measures one entry, scanning for provenance only when a standard claims it.
|
|
345
|
+
*
|
|
346
|
+
* The caller passes jurisdiction rather than deriving it from `rel`, because a
|
|
347
|
+
* path prefix hardcodes what `--folder` exists to override and misses a domain
|
|
348
|
+
* split into `context/<sub-area>/`.
|
|
349
|
+
*/
|
|
350
|
+
export function measureEntry(
|
|
351
|
+
rel: string,
|
|
352
|
+
source: string,
|
|
353
|
+
governsContent = true,
|
|
354
|
+
): EntryReport {
|
|
324
355
|
const lines = bodyLines(source)
|
|
325
356
|
const run = longestRun(lines)
|
|
326
357
|
|
|
@@ -333,7 +364,7 @@ export function measureEntry(rel: string, source: string): EntryReport {
|
|
|
333
364
|
longestRun: run.length,
|
|
334
365
|
longestRunLine: run.line,
|
|
335
366
|
catalogTables: catalogTables(lines),
|
|
336
|
-
provenance: provenance(lines),
|
|
367
|
+
provenance: governsContent ? provenance(lines) : [],
|
|
337
368
|
}
|
|
338
369
|
}
|
|
339
370
|
|
|
@@ -341,6 +372,9 @@ export function measureEntry(rel: string, source: string): EntryReport {
|
|
|
341
372
|
* Measures every entry in the audited folders. A generated `index.md` is not
|
|
342
373
|
* among them, since its body is rewritten on every regen and no checkpoint
|
|
343
374
|
* describes a catalog.
|
|
375
|
+
*
|
|
376
|
+
* Jurisdiction is applied here rather than at the report, so the JSON record
|
|
377
|
+
* and the printed run agree on which entries a content rule reached.
|
|
344
378
|
*/
|
|
345
379
|
export async function measureFolders(
|
|
346
380
|
root: string,
|
|
@@ -351,10 +385,19 @@ export async function measureFolders(
|
|
|
351
385
|
for (const folder of folders) {
|
|
352
386
|
for (const path of folder.entries) {
|
|
353
387
|
reports.push(
|
|
354
|
-
measureEntry(
|
|
388
|
+
measureEntry(
|
|
389
|
+
relative(root, path),
|
|
390
|
+
await readFile(path, 'utf8'),
|
|
391
|
+
governsContent(folder),
|
|
392
|
+
),
|
|
355
393
|
)
|
|
356
394
|
}
|
|
357
395
|
}
|
|
358
396
|
|
|
359
397
|
return reports
|
|
360
398
|
}
|
|
399
|
+
|
|
400
|
+
/** Reports whether the folder's standard is the one carrying the exclusion. */
|
|
401
|
+
export function governsContent(folder: AuditedFolder): boolean {
|
|
402
|
+
return folder.name === PROVENANCE_FOLDER
|
|
403
|
+
}
|
package/src/context/folders.ts
CHANGED
|
@@ -18,6 +18,13 @@ export const DEFAULT_FOLDERS: readonly string[] = [
|
|
|
18
18
|
]
|
|
19
19
|
|
|
20
20
|
export interface AuditedFolder {
|
|
21
|
+
/**
|
|
22
|
+
* The requested folder name this was resolved under, which is what says
|
|
23
|
+
* which standard governs the entries. A nested split folder carries the name
|
|
24
|
+
* of the folder it sits beneath rather than its own, so
|
|
25
|
+
* `.claude/context/claude-plugin` is governed as `context`.
|
|
26
|
+
*/
|
|
27
|
+
readonly name: string
|
|
21
28
|
/** Repo-relative folder path, used verbatim in every report line. */
|
|
22
29
|
readonly rel: string
|
|
23
30
|
readonly indexPath: string
|
|
@@ -35,7 +42,7 @@ export interface AuditedFolder {
|
|
|
35
42
|
* here for the sole reason that this repository has no wireframes.
|
|
36
43
|
*/
|
|
37
44
|
export function presentNames(folders: readonly AuditedFolder[]): string[] {
|
|
38
|
-
return [...new Set(folders.map((folder) => folder.
|
|
45
|
+
return [...new Set(folders.map((folder) => folder.name))]
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
async function readEntries(dir: string): Promise<string[]> {
|
|
@@ -80,6 +87,7 @@ export async function resolveFolders(
|
|
|
80
87
|
|
|
81
88
|
for (const each of [...new Set(dirs)].sort()) {
|
|
82
89
|
folders.push({
|
|
90
|
+
name,
|
|
83
91
|
rel: relative(root, each),
|
|
84
92
|
indexPath: `${each}/${INDEX_FILE}`,
|
|
85
93
|
entries: await readEntries(each),
|
package/standards/tasks.md
CHANGED
|
@@ -48,7 +48,33 @@ Readiness is three groups under fixed headings, `## Run now`, `## Up next`, and
|
|
|
48
48
|
- `## Up next`: a written plan exists, and the task either collides with something running or waits on another task to land. The blocker column names which.
|
|
49
49
|
- `## Needs a plan`: everything else. The task has no plan, or the plan it carries no longer describes the work.
|
|
50
50
|
|
|
51
|
-
Each group fixes its own columns, which follow from the test above it rather than from preference. `## Run now`
|
|
51
|
+
Each group fixes its own columns, which follow from the test above it rather than from preference. Neither half of the `## Run now` test is checkable without the file set and the plan sitting beside the task. The blocker column under `## Up next` names whether a collision or a dependency holds the row. `## Needs a plan` states no file set at all, because a task with no plan has no bounded one to state. A group with no rows keeps its heading and its header row.
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
---
|
|
55
|
+
title: Priority
|
|
56
|
+
description: One line on what the board covers
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
# Priority
|
|
60
|
+
|
|
61
|
+
## Run now
|
|
62
|
+
|
|
63
|
+
| Task | Touches | Plan |
|
|
64
|
+
| ------------------------------- | ----------------------- | ------------------------------------ |
|
|
65
|
+
| [vXX.Y <slug>](vXX.Y-<slug>.md) | <what the task touches> | [<slug>](../plans/feature-<slug>.md) |
|
|
66
|
+
|
|
67
|
+
## Up next
|
|
68
|
+
|
|
69
|
+
| Task | Touches | Waiting on |
|
|
70
|
+
| ---- | ------- | ---------- |
|
|
71
|
+
|
|
72
|
+
## Needs a plan
|
|
73
|
+
|
|
74
|
+
| Task | Waiting on |
|
|
75
|
+
| ------------------------------- | --------------------------------------- |
|
|
76
|
+
| [vXX.Y <slug>](vXX.Y-<slug>.md) | <the collision or the task it waits on> |
|
|
77
|
+
```
|
|
52
78
|
|
|
53
79
|
The tests live here so the board does not carry them. Writing them as a sentence under each heading produces the paragraph the rule above deletes, and a criterion with no home gets restated from memory every time the board is touched.
|
|
54
80
|
|