Compare commits

...
8 Commits
Author SHA1 Message Date
Defame1297andClaude Opus 5.5 75ec543b4b test(plugins): guard the consumer-neutral test's array expansion
test-vale-wrap's bash 3.2 scan flags a bare "${arr[@]}" expansion under
set -u. Use the guarded form the repo's other scripts use.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 22:18:55 +00:00
Defame1297andClaude Opus 5.5 05dffc3e45 docs(plugins): fix rtk-bare placement wording and a resolver typo
The git README said the marker goes on its own line; the gate requires
it on the same line as the bare command.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 21:33:34 +00:00
Defame1297andClaude Opus 5.5 0b8e5451b6 chore(release): bump git, gitea, delivery, core and kyberforge patches
Patch bumps for the consumer-neutral content changes on this branch:
git 1.4.1, gitea 1.3.11, delivery 0.8.2, core 1.1.5, kyberforge 2.3.2.
The root executables.allow keys follow, the catalog moves to 0.9.4, and
the marketplace is updated to match what apm pack generates.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 18:32:09 +00:00
Defame1297andClaude Opus 5.5 08fcc8be56 test(plugins): assert git and gitea content is consumer-neutral
Add an acceptance test for #177. It fails, printing file:line, when the
git or gitea .apm/ content carries a Co-authored-by trailer example, an
ADR citation or docs/adr path, or the Mortis/Holocron slug, or when any
of git, gitea, delivery, core and kyberforge cite ADR-0023 or ADR-0020.
run-tests picks it up as a tracked tests/test-*.sh suite.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 18:32:04 +00:00
Defame1297andClaude Opus 5.5 5b1bdd51fa fix(plugins): state the ADR-0020 rule instead of citing it in core and kyberforge
Plugin content is deployed into other repos, where this repo's ADR numbers
mean nothing. Replace every ADR-0020 citation in core and kyberforge
deployed content with the rule it stands for (the context budget, the
compressed boundary form, the shared boundary resolver), in comments,
user-visible validator messages and bats test names. Rename the resolver's
heredoc delimiter and BEGIN/END markers neutrally, and update their
repo-internal readers (skill-size-check.sh, test-adr0020-contract.sh,
gates.md). No behaviour change. Patch-bump the four touched skills.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 18:29:24 +00:00
Defame1297andClaude Opus 5.5 7dc741d1a7 fix(plugins): make git and gitea skill content repo-neutral
Consumer repos install these skills, so they must not carry this
repo's attribution policy, slug, ADR paths, or issue references.

git-commits trailer examples now show only neutral trailers, and
commit-template.md defers AI-attribution and co-author trailers to the
consumer repo's AGENTS.md, CONTRIBUTING, or session instructions. The
gitea sources notes state the live-verification rule plainly instead
of citing an ADR, and labels.md drops the repo slug.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 18:18:04 +00:00
Defame1297andClaude Opus 5.5 f3075ae01e fix(plugins): mark bare commands with rtk-bare: instead of citing ADR-0023
Every deliberately bare git command in git and delivery skill content
now carries `rtk-bare: <reason>` on its own line, and the delivery-verify
prose explains the bare command without an ADR citation. The git
README names the new marker. Bumps metadata.version of
delivery-test-first, delivery-verify, git-remotes, git-history and
git-worktrees.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 18:16:28 +00:00
Defame1297andClaude Opus 5.5 435ea59e93 refactor(gates): rename the rtk-prefix opt-out marker to rtk-bare:
check-rtk-prefix now exempts a deliberately bare git command only when
the line carries `rtk-bare: <reason>`. The old literal `ADR-0023` is no
longer accepted: plugin content is consumed by other repos and must not
cite this repo's ADRs. The test pins the new marker and adds a case
showing the old string no longer exempts a line. gates.md and an
ADR-0023 addendum record the rename.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
2026-12-06 18:16:08 +00:00
53 changed files with 315 additions and 236 deletions

No files matched your search

+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "holocron",
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
"version": "0.9.3",
"version": "0.9.4",
"owner": {
"name": "Mortis",
"url": "https://git.rkdr.net/Mortis/"
@@ -10,7 +10,7 @@
{
"name": "kyberforge",
"description": "Skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code and GitHub Copilot.",
"version": "2.3.1",
"version": "2.3.2",
"category": "Developer Tools",
"source": "./plugins/kyberforge"
},
@@ -24,21 +24,21 @@
{
"name": "git",
"description": "Skills and agents for working with a local Git clone over the git wire protocol, and for authoring and running the pre-commit hooks that guard it.",
"version": "1.4.0",
"version": "1.4.1",
"category": "Version Control",
"source": "./plugins/git"
},
{
"name": "gitea",
"description": "Skills and agents for working with a Gitea forge through its HTTP API — the forge's own objects, as distinct from the local git clone.",
"version": "1.3.10",
"version": "1.3.11",
"category": "Version Control",
"source": "./plugins/gitea"
},
{
"name": "core",
"description": "Skills for authoring and auditing a repo's AGENTS.md and the provider adapter files that defer to it.",
"version": "1.1.4",
"version": "1.1.5",
"category": "Productivity",
"source": "./plugins/core"
},
@@ -59,7 +59,7 @@
{
"name": "delivery",
"description": "Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.",
"version": "0.8.1",
"version": "0.8.2",
"category": "Developer Tools",
"source": "./plugins/delivery"
},
+2 -2
View File
@@ -273,8 +273,8 @@ repos:
- id: check-rtk-prefix
stages: ['pre-commit']
name: ADR-0023 rtk prefix on executable git commands
description: Enforce ADR-0023 clause 1 -- an executable, instructed git command in a shell code fence or a dispatch-table Run cell is written `rtk git`. Clauses 2 and 3 are not machine-decidable; a deliberately bare command opts out with the literal string ADR-0023 on its own line
name: rtk prefix on executable git commands (ADR-0023)
description: Enforce ADR-0023 clause 1 -- an executable, instructed git command in a shell code fence or a dispatch-table Run cell is written `rtk git`. Clauses 2 and 3 are not machine-decidable; a deliberately bare command opts out with the rtk-bare marker and its reason on the same line
entry: scripts/check-rtk-prefix.sh
language: script
files: '^plugins/[^/]+/\.apm/(skills/.*\.md|agents/.*\.agent\.md)$'
+5 -5
View File
@@ -1,5 +1,5 @@
name: holocron
version: 0.9.3
version: 0.9.4
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
license: MIT
@@ -82,15 +82,15 @@ dependencies:
# remote (ADR-0019).
executables:
allow:
git.rkdr.net/Mortis/Holocron/plugins/kyberforge#2.3.1:
git.rkdr.net/Mortis/Holocron/plugins/kyberforge#2.3.2:
hooks: true
bin: true
# delivery ships the guard hook (ADR-0032 enforcement layer 2). Same
# full-identity, version-in-key convention as above, kept by the same check.
git.rkdr.net/Mortis/Holocron/plugins/delivery#0.8.1:
git.rkdr.net/Mortis/Holocron/plugins/delivery#0.8.2:
hooks: true
# git ships the hook that refuses a push to main.
git.rkdr.net/Mortis/Holocron/plugins/git#1.4.0:
git.rkdr.net/Mortis/Holocron/plugins/git#1.4.1:
hooks: true
# rtk ships the hook that routes Bash tool calls through rtk.
git.rkdr.net/Mortis/Holocron/plugins/rtk#0.1.0:
@@ -102,7 +102,7 @@ marketplace:
# top-level apm.yml description:/version: above are NOT inherited into the
# compiled output despite being used elsewhere (e.g. by `apm audit`).
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
version: 0.9.3
version: 0.9.4
owner:
name: Mortis
url: https://git.rkdr.net/Mortis/
@@ -166,3 +166,12 @@ that was false about the `gitea-*` skills and a citation to a file that does not
A `check-rtk-prefix` pre-commit hook and `tests/test-check-rtk-prefix.sh` land with it; the test runs
the gate against the pre-sweep corpus on `main` and asserts it fails there, because a gate that only
passes on the fixed tree proves nothing about the drift it was written for.
## Addendum (2026-12-06): the opt-out marker is `rtk-bare:`
The clause-3 opt-out marker that `check-rtk-prefix` accepts is now `rtk-bare:`, written on the same
line as the bare command and followed by its reason (`# rtk-bare: the output is parsed`). It replaces
the literal string `ADR-0023`, which the gate no longer accepts. The cause is issue #177: plugin
content is consumed by other repos, and a marker that cites this repo's ADR leaks a reference those
consumers cannot follow. The decision itself is unchanged — the three clauses, the per-line scope and
the inline-reason requirement all stand; only the marker string moved.
+8 -6
View File
@@ -498,7 +498,7 @@ directory (the self-contained constraint in `docs/spec/architecture.md`, "Plugin
so drift fails CI rather than silently letting an audit bless a skill the commit hook then rejects.
**The shared boundary resolver is one copy** (ADR-0025, then 2026-09-16). It lives between the
`BEGIN`/`END ADR-0020 SHARED BOUNDARY RESOLVER` markers in `factory-audit/scripts/lib-boundary-resolver.sh`.
`BEGIN`/`END SHARED BOUNDARY RESOLVER` markers in `factory-audit/scripts/lib-boundary-resolver.sh`.
ADR-0025 collapsed the two copies inside `skill-audit`'s and `agent-audit`'s `validate.sh` into that
file. `scripts/skill-size-check.sh` kept an embedded, byte-identical third copy while it was also
exported through `.pre-commit-hooks.yaml`, whose consumers could not reach a file inside the plugin.
@@ -734,16 +734,18 @@ checking only a leading span flags neither, and still catches the ordinary
### The clause-3 opt-out
A command that is deliberately bare — because rtk rewrites the output the skill parses, or because
the command is interactive — is exempted by putting the literal string `ADR-0023` **on the same
line**: in a shell comment for a code line, in the cell text for a table row.
the command is interactive — is exempted by putting the marker `rtk-bare:` and its reason **on the
same line**: in a shell comment for a code line, in the cell text for a table row. The marker was
`ADR-0023` until issue #177; it is neutral because plugin content is consumed by other repos and must
not cite this repo's ADRs. The old string no longer exempts a line.
Per line, never per block. A fenced procedure routinely mixes `rtk git` steps with one deliberately
bare command (`git-remotes/references/push.md` does exactly that), and a block-level marker would
silently disarm every checked line around the marked one. The cost is a repeated `# bare per
ADR-0023` in the three blocks of `git-log-format.md` where every line is deliberately bare; that
silently disarm every checked line around the marked one. The cost is a repeated `# rtk-bare:` in
the three blocks of `git-log-format.md` where every line is deliberately bare; that
repetition is the price of the marked line being the only line the marker speaks for.
The marker is a plain substring match, so a line that mentions `ADR-0023` for an unrelated reason is
The marker is a plain substring match, so a line that mentions `rtk-bare:` for an unrelated reason is
also exempt. Accepted deliberately: the marker records an author's opt-out, it is not a security
boundary, and a stricter form would only move the same trust to a different string.
@@ -11,7 +11,7 @@ metadata:
category: docs
source_keys:
- adr-0002-0003-two-tier-claude-md
version: "0.1.3"
version: "0.1.4"
---
## Gotchas
@@ -202,7 +202,7 @@ def read_text(path):
byte is the complete signal and is checked first: no plausible markdown
adapter contains one, and every UTF-16/32 encoding of ASCII is full of
them. A file this gate cannot read gets an encoding diagnostic and exit 2,
the same policy the ADR-0020 validators' read_text() uses.
the same policy factory-audit's validators' read_text() uses.
A file that exists but cannot be read at all is neither a pass nor a FAIL —
nothing was graded — so it exits 3 rather than 1. Exit 1 sends the skill's
+1 -1
View File
@@ -1,5 +1,5 @@
name: core
version: 1.1.4
version: 1.1.5
description: Skills for authoring and auditing a repo's AGENTS.md and the provider adapter files that defer to it.
author:
name: Mortis
@@ -9,7 +9,7 @@ compatibility: Requires git with push access to the work branch, and a consuming
allowed-tools: Read Write Edit Bash
metadata:
category: delivery
version: "0.2.0"
version: "0.2.1"
---
## Gotchas
@@ -58,7 +58,7 @@ Read only the matched flow's reference — each is self-contained.
Stage only files under the test paths, then check the staged set before committing:
```bash
git diff --cached --name-only # bare: the path list is parsed (ADR-0023)
git diff --cached --name-only # rtk-bare: the path list is parsed
```
Any path outside the test paths → unstage it. Commit exactly once per run, with a Conventional
@@ -9,7 +9,7 @@ compatibility: Requires git, a Gitea forge with Actions reached through the Gite
allowed-tools: Read Bash mcp__gitea__pull_request_read mcp__gitea__list_pull_requests mcp__gitea__commit_read mcp__gitea__actions_run_read mcp__gitea__get_file_contents
metadata:
category: delivery
version: "0.1.0"
version: "0.1.1"
---
## Gotchas
@@ -13,10 +13,10 @@ in Step 1, before any waiting, and again where `references/apply-wait.md` and
the merge commit whose message reverts it, oldest first:
```bash
git log --reverse --format=%H -F --grep='Reverts merge commit <merge commit>' --grep='This reverts commit <merge commit>' <merge commit>..origin/<base> # ADR-0023: parsed
git log --reverse --format=%H -F --grep='Reverts merge commit <merge commit>' --grep='This reverts commit <merge commit>' <merge commit>..origin/<base> # rtk-bare: the output is parsed
```
Bare `git`, per ADR-0023: rtk filters `git log` and this output is parsed. Full 40-character
Bare `git`, not `rtk git`: rtk filters `git log` and this output is parsed. Full 40-character
SHA in both patterns. Not `--first-parent`: a revert PR merged with a merge commit puts the
revert on the second parent. The first SHA listed is the **revert commit**.
@@ -36,10 +36,10 @@ Otherwise tied when both hold:
ancestor carrying a status with the same name:
```bash
git log --first-parent --format=%H -n 50 <merge commit>^1 # ADR-0023: parsed
git log --first-parent --format=%H -n 50 <merge commit>^1 # rtk-bare: the output is parsed
```
Bare `git`, per ADR-0023: rtk filters `git log` and this output is parsed. Read each SHA's
Bare `git`, not `rtk git`: rtk filters `git log` and this output is parsed. Read each SHA's
statuses with `mcp__gitea__commit_read` `get_status`, newest first. A `skipped` status ran
nothing, so pass over it, but only when every row of its workflow (the status name's prefix
before ` / `) on that commit is `success` or `skipped`; otherwise a failure there may have
@@ -32,10 +32,10 @@ For each such workflow, run `references/already-reverted.md` again (a revert →
the default branch's first-parent commits after the merge commit, oldest first:
```bash
git log --first-parent --reverse --format=%H <merge commit>..origin/<default branch> # ADR-0023: parsed
git log --first-parent --reverse --format=%H <merge commit>..origin/<default branch> # rtk-bare: the output is parsed
```
Bare `git`, per ADR-0023: rtk filters `git log` and this output is parsed. That check's fetch
Bare `git`, not `rtk git`: rtk filters `git log` and this output is parsed. That check's fetch
found no revert, so none of these is at or after one. Read each SHA's statuses with
`mcp__gitea__commit_read` `get_status`:
+1 -1
View File
@@ -1,5 +1,5 @@
name: delivery
version: 0.8.1
version: 0.8.2
description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.
author:
name: Mortis
+2 -2
View File
@@ -8,7 +8,7 @@ description: >
Not branch lifecycle -> `git-branches`.
metadata:
version: "0.1.8"
version: "0.1.9"
category: git
source_keys:
- conventional-commits-spec
@@ -65,7 +65,7 @@ For an agent caller, return:
"scope": "api",
"description": "add user authentication",
"body": "optional body text, or null",
"footers": ["Fixes: #123", "Refs: #456", "Co-authored-by: Bob <bob@example.com>"]
"footers": ["Fixes: #123", "Refs: #456", "Signed-off-by: Bob <bob@example.com>"]
}
}
```
@@ -59,8 +59,10 @@ Refs:
ADR:
RFC:
Design:
Co-authored-by:
Reviewed-by:
Signed-off-by:
BREAKING CHANGE:
```
Add an AI-attribution or co-author trailer only when the repo's AGENTS.md or CONTRIBUTING, or the
session instructions, ask for one, and use exactly the form they give.
@@ -90,7 +90,7 @@ Rules:
<token> #<value> # for issue references
```
- Tokens use hyphens for word separation: `Reviewed-by`, `Co-authored-by`, `Refs`.
- Tokens use hyphens for word separation: `Reviewed-by`, `Signed-off-by`, `Refs`.
- Exception: `BREAKING CHANGE` (space allowed, uppercase).
- Multiple footers allowed, one per line.
- Blank line required before the footer block.
@@ -99,7 +99,7 @@ Valid footer examples:
```text
Reviewed-by: Z
Refs: #123
Co-authored-by: Alice <alice@example.com>
Signed-off-by: Alice <alice@example.com>
BREAKING CHANGE: the `--format` flag now requires a value
```
@@ -12,6 +12,6 @@ source_keys:
3. **Determine the scope** — infer it from the files changed (`api`, `db`, `cli`, `config`). Scope is optional, but it identifies which part of the system moved and is worth setting.
4. **Write the description** — imperative mood, no trailing period: "add user authentication", "fix race condition in cache". Neither source spec sets a target below the 100-character header maximum, but convention favours roughly 50 characters so `git log --oneline` stays readable.
5. **Add a body when the change is non-trivial** — blank line first, wrapped at 100 characters. Explain *why*, not what: the diff already shows what changed, and the message's job is the context the diff cannot carry — motivation, root cause, tradeoffs. Follow the Why / Implementation Notes / Impact structure in `references/commit-template.md`.
6. **Add footers where they apply** — `Fixes: #123`, `Refs: #123`, `ADR: 0012`, `Co-authored-by: Name <email>`, `BREAKING CHANGE: description`. For the full trailer list, read `references/commit-template.md`.
6. **Add footers where they apply** — `Fixes: #123`, `Refs: #123`, `ADR: 0012`, `Signed-off-by: Name <email>`, `BREAKING CHANGE: description`. For the full trailer list, read `references/commit-template.md`.
7. **Signal a breaking change with `!` before the colon** — `feat!: drop Node 6` is visible in `git log --oneline`, where the `BREAKING CHANGE:` footer alone is machine-readable but hidden. Use both when the break needs describing.
8. **Validate, confirm, execute** — check header length, type, lowercase subject and trailing period against commitlint, show the message, and commit only once the caller has approved. Never add `--no-verify`.
+1 -1
View File
@@ -8,7 +8,7 @@ description: >
`git-commits`. Not a Gitea server's history -> `gitea-branches`.
metadata:
version: "1.0.3"
version: "1.0.4"
category: git
source_keys:
- git-scm-bisect-docs
@@ -166,10 +166,10 @@ line at roughly 72 characters with an ellipsis, on the one query whose whole poi
is showing line content.
```bash
git log -L 10,20:file.txt # bare (ADR-0023)
git log -L /start_pattern/,/end_pattern/:file.txt # bare (ADR-0023)
git log -L :myfunction:src/app.c # bare (ADR-0023)
git log -L /init/,+15:config.py # bare (ADR-0023); 15 lines after first /init/ match
git log -L 10,20:file.txt # rtk-bare: rtk truncates diff lines
git log -L /start_pattern/,/end_pattern/:file.txt # rtk-bare: rtk truncates diff lines
git log -L :myfunction:src/app.c # rtk-bare: rtk truncates diff lines
git log -L /init/,+15:config.py # rtk-bare: rtk truncates diff lines; 15 lines after first /init/ match
```
Range formats:
@@ -213,8 +213,8 @@ Bare `git`, not `rtk git`: rtk appends a blank line and a `Changes:` trailer, so
the output is no longer one record per line.
```bash
git diff --name-only # bare (ADR-0023); only filenames, one per line
git diff --name-status # bare (ADR-0023); status letter + filename per line
git diff --name-only # rtk-bare: rtk adds a trailer; only filenames, one per line
git diff --name-status # rtk-bare: rtk adds a trailer; status letter + filename per line
```
`--name-status` uses the same status letters as `--diff-filter`.
@@ -225,10 +225,10 @@ Bare `git`, not `rtk git`: rtk replaces the word-diff with its own diffstat
renderer and emits none of the `[-removed-] {+added+}` markers.
```bash
git diff --word-diff # bare (ADR-0023); inline word-level diff, [-removed-] {+added+} markers
git diff --word-diff=color # bare (ADR-0023); color only, no markers
git diff --word-diff=porcelain # bare (ADR-0023); machine-readable: +/- prefixed lines, ~ for newlines
git diff --word-diff-regex=<re> # bare (ADR-0023); define what counts as a "word"
git diff --word-diff # rtk-bare: rtk drops the word-diff; inline word-level diff, [-removed-] {+added+} markers
git diff --word-diff=color # rtk-bare: rtk drops the word-diff; color only, no markers
git diff --word-diff=porcelain # rtk-bare: rtk drops the word-diff; machine-readable: +/- prefixed lines, ~ for newlines
git diff --word-diff-regex=<re> # rtk-bare: rtk drops the word-diff; define what counts as a "word"
```
### Whitespace Flags
+1 -1
View File
@@ -10,7 +10,7 @@ description: >
Not submodule pointers -> `git-submodules`.
metadata:
version: "1.0.4"
version: "1.0.5"
category: git
source_keys:
- git-scm-remote-docs
@@ -50,13 +50,13 @@ Two mitigations:
# poisoned by an unrelated fetch.
# The inner `git config` is bare: its stdout becomes a remote URL, so any
# output rewriting would poison the remote silently.
rtk git remote add origin-push $(git config remote.origin.url) # inner bare (ADR-0023)
rtk git remote add origin-push $(git config remote.origin.url) # rtk-bare: inner command; rewritten output would corrupt the URL
rtk git push --force-with-lease origin-push
# Option 2 — explicit SHA via a local tag, unaffected by tracking-branch state
rtk git fetch
rtk git tag base master
git rebase -i master # bare, not `rtk` (ADR-0023): interactive sequence editor
git rebase -i master # rtk-bare: interactive sequence editor
rtk git push --force-with-lease=master:base master:master
```
@@ -8,7 +8,7 @@ description: >
Not interactive multi-step git guidance -> `git-workflow`.
metadata:
version: "1.0.3"
version: "1.0.4"
category: git
source_keys:
- git-scm-worktree-docs
@@ -32,7 +32,7 @@ metadata:
| Create a local branch tracking a remote one | `rtk git worktree add --track -b <branch> <path> <remote>/<branch>` — always correct. `git worktree add <path> <branch>` expands to exactly this, but **only** under the conditions in `references/worktrees.md` |
| Throwaway experiment, no branch | `rtk git worktree add -d <path>` — detached HEAD |
| **Never** `git worktree add <path> <remote>/<branch>` | That ref resolves, so the shortcut never fires and you get **a detached HEAD, no branch, no upstream**. Commits there go unreachable once HEAD moves, and `git push` needs an explicit refspec. Use the tracking row above |
| List | `git worktree list -v` to read, or `git worktree list --porcelain -z` to parse — both bare (ADR-0023): rtk re-renders the output and drops the porcelain flags |
| List | `git worktree list -v` to read, or `git worktree list --porcelain -z` to parse — rtk-bare: rtk re-renders the output and drops the porcelain flags |
| Lock or unlock | `rtk git worktree lock [--reason <str>] <path>` / `rtk git worktree unlock <path>` |
| Move | `rtk git worktree move <from> <to>` |
| Remove | `rtk git worktree remove <path>` |
+1 -1
View File
@@ -25,7 +25,7 @@ The entry above is unpinned and tracks the remote's default branch. To pin a rel
## Conventions
Skills here run local git commands through the org's `rtk` wrapper. **When a command is prefixed, when it stays bare, and why some executable commands must stay bare are all decided by ADR-0023** (`docs/adr/0023-rtk-prefix-marks-executable-commands-only.md`), which is repo-wide and not specific to this plugin. `check-rtk-prefix` enforces the part of it that is machine-decidable.
Skills here run local git commands through the org's `rtk` wrapper. **When a command is prefixed, when it stays bare, and why some executable commands must stay bare are all decided by ADR-0023** (`docs/adr/0023-rtk-prefix-marks-executable-commands-only.md`), which is repo-wide and not specific to this plugin. `check-rtk-prefix` enforces the part of it that is machine-decidable. A command that must stay bare carries `rtk-bare: <reason>` on the same line as the command (in a trailing comment or the same table cell), which is the gate's opt-out marker.
Installing this plugin without `rtk`? Every prefixed command is a plain `git` invocation with a word in front of it — drop the `rtk ` and it is correct.
+1 -1
View File
@@ -1,5 +1,5 @@
name: git
version: 1.4.0
version: 1.4.1
description: Skills and agents for working with a local Git clone over the git wire protocol, and for authoring and running the pre-commit hooks that guard it.
author:
name: Mortis
@@ -12,7 +12,7 @@ compatibility: Requires Gitea MCP server configured with a token with write:repo
metadata:
category: integration
version: "0.1.4"
version: "0.1.5"
source_keys:
- gitea-mcp-repo
- gitea-mcp-slim-go
@@ -1,10 +1,10 @@
# Sources
**Note on call signatures:** per `docs/adr/0011-gitea-skill-deep-modules.md`, the tool parameter
signatures in `references/branches.md` and `references/commits.md` were re-verified live via
`ToolSearch` against the deployed `gitea-mcp` server — **last verified against v1.7.0**, as reported
by `get_gitea_mcp_server_version` — rather than copied verbatim from `api-reference.md` below. This resolves issue #6 comment #849's root-cause finding
that a prior skill was authored from API docs that had drifted from the actual MCP tool schema.
**Note on call signatures:** the tool parameter signatures in `references/branches.md` and
`references/commits.md` were re-verified live via `ToolSearch` against the deployed `gitea-mcp`
server — **last verified against v1.7.0**, as reported by `get_gitea_mcp_server_version` — rather
than copied verbatim from `api-reference.md` below, because API docs can drift from the actual MCP
tool schema, and a skill authored from them once shipped a wrong parameter.
The research docs cited here informed gotchas, response shapes, and workflow context, not the
parameter lists themselves.
@@ -14,7 +14,7 @@ compatibility: Requires Gitea MCP server configured with write:issue and write:r
metadata:
category: integration
version: "0.1.5"
version: "0.1.6"
source_keys:
- gitea-mcp-repo
- gitea-mcp-slim-go
@@ -8,7 +8,7 @@ source_keys:
# Create-flow enrichments
Closes out the four enrichments deferred from issue #6 comment #848. Run in this order before the
Four enrichments to the create flow. Run them in this order before the
`issue_write method: "create"` call in SKILL.md's create dispatch: **labels → milestone →
assignee → dependency link**. Each step is independent and skippable on its own — a missing
milestone fit doesn't block label inference, and so on — but this is the order that lets later
@@ -1,10 +1,9 @@
# Sources
**Note on call signatures:** per `docs/adr/0011-gitea-skill-deep-modules.md`, the tool parameter
signatures in `references/issues.md` and `references/search.md` are re-verified live via
`ToolSearch` against the deployed `gitea-mcp` server — they are not copied verbatim from
`api-reference.md`. This resolves issue #6 comment #849's root-cause finding that a prior skill was
authored from API docs that had drifted from the actual MCP tool schema. That re-verification is
**Note on call signatures:** the tool parameter signatures in `references/issues.md` and
`references/search.md` are re-verified live via `ToolSearch` against the deployed `gitea-mcp`
server — they are not copied verbatim from `api-reference.md`, because API docs can drift from the
actual MCP tool schema, and a skill authored from them once shipped a wrong parameter. That re-verification is
ongoing, not one-off: an earlier live check recorded `list_issues` as lacking the `type` and
`milestones` parameters `api-reference.md` documents, and both are present on the deployed
gitea-mcp **v1.7.0**, which is the version these signatures are current as of.
@@ -16,7 +16,7 @@ metadata:
- gitea-mcp-slim-go
- context7-websites-gitea
- context7-gitea-tea-cli
version: "0.1.7"
version: "0.1.8"
allowed-tools: Bash mcp__gitea__label_read mcp__gitea__label_write mcp__gitea__milestone_read mcp__gitea__milestone_write
---
@@ -61,7 +61,7 @@ per repo label. That does not contradict `label_write`'s schema, which annotates
server-side; where it is `false` labels in that scope stack legitimately. Read the field — never
infer exclusivity from the `/` in a name, and never carry another repo's map over.
On the instance this skill was authored against (`Mortis/Holocron`) the split ran: every
On the repo this skill was authored against the split ran: every
`Priority/*`, `Reviewed/*` and `Status/*` label `exclusive: true`, every `Kind/*` label and
`Compat/Breaking` `exclusive: false`. That is one repo's configuration at one point in time, recorded
as a worked example of what the field looks like in practice — it is not a property of the taxonomy
+1 -1
View File
@@ -1,5 +1,5 @@
name: gitea
version: 1.3.10
version: 1.3.11
description: Skills and agents for working with a Gitea forge through its HTTP API — the forge's own objects, as distinct from the local git clone.
author:
name: Mortis
@@ -6,7 +6,7 @@ description: >
Not read-only review -> `factory-audit`. Not skills -> `skill-author`.
allowed-tools: Bash Read Write Edit
metadata:
version: "1.0.4"
version: "1.0.5"
category: factory
source_keys:
- context7-websites-code-claude
@@ -3,7 +3,7 @@
## templates/
Annotated agent definition templates copied by `scripts/new-agent.sh` when scaffolding a new agent.
All three scaffold the `description` in the three-part ADR-0020 shape — a `Use when` trigger clause, at most one capability clause, and a boundary clause — rather than the deleted action-verb opener, and each carries a delegate-don't-restate note in the body.
All three scaffold the `description` in the three-part context-budget shape — a `Use when` trigger clause, at most one capability clause, and a boundary clause — rather than the deleted action-verb opener, and each carries a delegate-don't-restate note in the body.
- **`claude-code.md`** — Claude Code agent definition template (project/user scope). Includes all supported frontmatter fields (required and optional) with inline guidance comments and `FILL IN:` placeholders.
- **`copilot.agent.md.template`** — Copilot CLI agent definition template (CLI format, project/user scope). Excludes cloud/IDE-only fields (`target`, `user-invocable`, `disable-model-invocation`, `mcp-servers`) and Claude Code-only fields. Uses Copilot tool aliases (`execute`, `read`, `edit`, `search`, `agent`, `web`).
@@ -32,7 +32,7 @@ description: FILL IN: Use when <trigger>. <One capability clause.> Not <thing> -
session whether or not this agent is ever used. Three parts, nothing else:
a trigger clause opening "Use when", at most one capability clause, and a
boundary clause naming a real sibling skill or agent.
250 characters is the target, 400 the hard ceiling (ADR-0020).
250 characters is the target, 400 the hard ceiling (context budget).
Do not open with an action verb ("Reviews...", "Analyzes...") — that rule was
deleted.
Never write "Use proactively" here. It steers the Claude Code runtime and does
@@ -12,7 +12,7 @@ description: FILL IN: Use when <trigger>. <One capability clause.> Not <thing> -
session whether or not this agent is ever used. Three parts, nothing else:
a trigger clause opening "Use when", at most one capability clause, and a
boundary clause naming a real sibling skill or agent.
250 characters is the target, 400 the hard ceiling (ADR-0020).
250 characters is the target, 400 the hard ceiling (context budget).
Do not open with an action verb ("Reviews...", "Analyzes...") — that rule was
deleted.
"Use proactively" is valid HERE and only here: it steers the Claude Code runtime
@@ -17,7 +17,7 @@ description: FILL IN: Use when <trigger>. <One capability clause.> Not <thing> -
every session whether or not this agent is ever used. Three parts, nothing else:
a trigger clause opening "Use when", at most one capability clause, and a
boundary clause naming a real sibling skill or agent.
250 characters is the target, 400 the hard ceiling (ADR-0020).
250 characters is the target, 400 the hard ceiling (context budget).
Do not open with an action verb ("Reviews...", "Analyzes...") — that rule was deleted.
Never write "Use proactively" here. It steers the Claude Code runtime and does nothing
in Copilot, and factory-audit's KyberforgeCopilot.ProactivePhrase grades it a hard FAIL.
@@ -285,7 +285,7 @@ else
if [[ "$SCOPE" == "plugin" ]]; then
echo " 1. Fill in $APM_FILE — replace every FILL IN: placeholder. Optional fields are" >&2
echo " scaffolded there as commented blocks; uncomment the ones that apply." >&2
echo " Description: 250 chars target / 400 ceiling (ADR-0020). The body has no" >&2
echo " Description: 250 chars target / 400 ceiling (context budget). The body has no" >&2
echo " word gate — delegate to a skill instead of restating what it does." >&2
echo " 2. Populate $SOURCES_DIR/sources.md with research sources, or delete it" >&2
echo " 3. Validate: $VALIDATE_HINT $APM_FILE" >&2
@@ -294,7 +294,7 @@ else
else
echo " 1. Fill in $CC_FILE — replace every FILL IN: placeholder. Optional fields are" >&2
echo " scaffolded there as commented blocks; uncomment the ones that apply." >&2
echo " Description: 250 chars target / 400 ceiling (ADR-0020). The body has no" >&2
echo " Description: 250 chars target / 400 ceiling (context budget). The body has no" >&2
echo " word gate — delegate to a skill instead of restating what it does." >&2
echo " 2. Fill in $CP_FILE — same, and heed its closing comment: the Claude Code-only" >&2
echo " fields it names must not cross over from the file above." >&2
@@ -7,7 +7,7 @@ description: >
fixes -> agent-author.
allowed-tools: Bash Read
metadata:
version: "1.0.7"
version: "1.0.8"
category: factory
source_keys:
- agentskills-home
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# lib-boundary-resolver.sh — SOURCED, never executed.
#
# The ADR-0020 shared boundary resolver — the ONE copy in the repo. Both of
# The shared boundary resolver — the ONE copy in the repo. Both of
# validate.sh's modes compose it into the Python program they run, and so does
# the repo-root hook scripts/skill-size-check.sh, so the audit and the commit
# hook resolve boundary targets through the same code rather than through
@@ -40,8 +40,8 @@
# shellcheck shell=bash
# shellcheck disable=SC2034
IFS='' read -r -d '' KYBERFORGE_RESOLVER_PY <<'KYBERFORGE_ADR0020_RESOLVER_PY' || true
# ===== BEGIN ADR-0020 SHARED BOUNDARY RESOLVER =====
IFS='' read -r -d '' KYBERFORGE_RESOLVER_PY <<'KYBERFORGE_RESOLVER_PY_END' || true
# ===== BEGIN SHARED BOUNDARY RESOLVER =====
# ONE resolver, and this is its only copy. Sourced from this file by:
# plugins/kyberforge/.apm/skills/factory-audit/scripts/validate.sh (both modes)
# scripts/skill-size-check.sh (the repo-root commit hook)
@@ -357,7 +357,7 @@ def known_targets(start_dir):
# already added, so a one-plugin monorepo shows a delta of zero and would
# wrongly reach for the deployed trees — including the user's global
# ~/.claude/skills, making the verdict depend on what happens to be
# installed (ADR-0020 lines 118-127).
# installed.
root, root_has_plugins = _authoring_root(start)
if root:
_collect_authoring_root(root, names)
@@ -373,7 +373,7 @@ def known_targets(start_dir):
# carrying "do not"/"instead"/"rather than"/"not for"). Without the second
# condition, pc-run's "run pre-commit hooks" reads as a route to a
# non-existent `pre-commit` skill.
# * A BARE arrow target counts only in ADR-0020's compressed boundary form,
# * A BARE arrow target counts only in the compressed boundary form,
# `Not <thing> -> <skill-name>`. The example that motivated it is gone:
# diagnose's process chain "fix -> regression-test", which without the
# gate read as a route to a non-existent `regression-test` skill, was cut
@@ -456,7 +456,7 @@ def known_targets(start_dir):
# that had no escape hatch.
#
# EXPLICIT ROUTE NOTATION is exempt from corroboration and always blocks:
# ADR-0020's compressed arrow (`Not <thing> -> <name>`) and Claude Code's
# the compressed arrow (`Not <thing> -> <name>`) and Claude Code's
# invocation form (`/<name>`). Neither is ever how English cites a tool — nobody
# writes `-> pre-commit` or `/pre-commit` to mean the hook — so there is no
# ambiguity to resolve, and an author who wants a route checked unconditionally
@@ -486,7 +486,7 @@ def known_targets(start_dir):
#
# THE TWO SWEEPS ARE GATED DIFFERENTLY, and the asymmetry is the whole point.
# `/name` is Claude Code's invocation syntax and nothing else — no English
# sentence contains one by accident — so the ADR-0020 amendment and
# sentence contains one by accident — so the boundary-target contract and
# docs/spec/gates.md both promise it blocks UNCONDITIONALLY, for any name. So
# NOTATION_SLASH is swept over every sentence, boundary marker or not. Gating it
# on BOUNDARY_MARKER made that promise false for the last sentence of
@@ -590,7 +590,7 @@ ARROW_BOUNDARY = re.compile(
r"\bnot\b%s*?(?:->|→)\s*(%s)\b" % (CLAUSE_BODY, NAME_HYPH), re.I)
BACKTICK = re.compile(r"`(%s)`" % NAME_HYPH, re.I)
# A boundary clause takes two shapes and BOTH count: the prose markers, and
# ADR-0020's compressed arrow form `Not <thing> -> <name>`.
# the compressed arrow form `Not <thing> -> <name>`.
BOUNDARY_MARKER = re.compile(r"\b(?:do\s+not|instead|rather\s+than|not\s+for)\b", re.I)
BOUNDARY_ARROW = re.compile(r"\bnot\b%s*?(?:->|→)" % CLAUSE_BODY, re.I)
# Sentence boundaries decide the CORROBORATION scope above, so getting one wrong
@@ -672,7 +672,7 @@ def _notation(text, start, arrow):
"""True if the name is written in route NOTATION rather than in prose.
Two forms qualify: `/name` (Claude Code's invocation syntax, detected from
the character before the name) and `-> name` (ADR-0020's compressed boundary
the character before the name) and `-> name` (the compressed boundary
form, passed in by the caller that matched the arrow). A backticked name
does NOT qualify — a code span is how a tool, a file and a skill are all
cited, so it carries no intent the follower test hasn't already read.
@@ -690,7 +690,7 @@ def _add(out, text, name, start, end, strict=None, arrow=False):
_terminal() and a follower outside FOLLOWER_OK set may_dangle=False. The
target then reached unresolved_targets() unblockable — and, before the
companion fix there, unreported as well. `... use /no-such-skill
afterwards.` exited 0 in total silence, on the one form ADR-0020 offers an
afterwards.` exited 0 in total silence, on the one form the contract offers an
author who wants a route checked unconditionally.
"""
if not name:
@@ -788,7 +788,7 @@ def _clause_end(description, pos):
def _arrow_clause_spans(description):
"""(start, end) for EACH ADR-0020 arrow clause, one span per clause.
"""(start, end) for EACH compressed arrow clause, one span per clause.
A clause runs from its `Not` to whichever comes first: the start of the
NEXT arrow clause, or the end of the clause body. Bounding on the next
@@ -808,7 +808,7 @@ def _arrow_clause_parses(clause):
"""True when either arrow extractor reads a target out of ONE clause.
Kept apart from boundary_targets() because the arrow form is the one shape
that ALWAYS names a target: ADR-0020's `Not <thing> -> <name>`. A clause
that ALWAYS names a target: the compressed `Not <thing> -> <name>`. A clause
written that way from which nothing could be extracted is a parse failure
that deserves its own message, and telling it apart needs the arrow targets
alone rather than every target in the description.
@@ -828,7 +828,7 @@ def boundary_clause_status(description):
the second sends the author hunting for a problem that is not there, and
three of them reworded a correct clause to satisfy a regex instead.
'unparsed' is the narrow, certain case: an ADR-0020 arrow clause was
'unparsed' is the narrow, certain case: a compressed arrow clause was
detected and NO target came out of IT. The arrow form always names one, so
zero targets means the name is written in a shape the extractor cannot see
— a single-word bare target (`Not X -> forge`, which has to be written
@@ -865,7 +865,7 @@ def multi_target_arrow_clauses(description):
never to arrows, so `Not X -> a or b` resolved `a`, left `b` neither
resolved nor reported, and then printed "1 of 1 boundary target(s) resolve"
on a clause naming two — a gate under-reporting its own coverage, which is
the one failure mode ADR-0020 says a gate must not have.
the one failure mode a gate must never have.
The clause is REJECTED rather than the arrow scan extended. Extending it
would widen the resolver's deliberately conservative false-positive tuning
@@ -1037,7 +1037,7 @@ def unresolved_body_targets(body, known):
# --- Frontmatter ----------------------------------------------------------
# Tolerant on the way in, HARD-FAILING on the way out. A UTF-8 BOM, a leading
# blank line, trailing whitespace after either `---`, or CRLF line endings all
# defeated the old `^---\n(.*?)\n---`, and the miss was SILENT: every ADR-0020
# defeated the old `^---\n(.*?)\n---`, and the miss was SILENT: every context-budget
# check was skipped and the file reported green (measured: a 550-character
# description with a 1,000-word body exited 0 behind a BOM). A file that cannot
# be measured must never report green, so every caller of these two ERRORs on a
@@ -1076,7 +1076,7 @@ def description_value(fm_text):
description is present. A line regex cannot: `description:` with no value
followed by `model: sonnet` lets `\\s*` cross the newline and captures the
NEXT key, which reads as a non-empty description, skips the "missing or
empty" failure, and then early-returns out of every ADR-0020 gate on the
empty" failure, and then early-returns out of every context-budget gate on the
genuinely empty folded value. That combination exited 0 with zero output on
a BLOCKING pre-push gate.
"""
@@ -1111,7 +1111,7 @@ def hand_invoked(fm_text):
`disable-model-invocation: true` removes a skill from the model-visible
listing entirely — it is not preloaded, and the Skill tool refuses to call
it — so its description is never matched against user intent. ADR-0020 and
it — so its description is never matched against user intent. The context budget and
skill-author's contract give such a skill ONE plain human-facing sentence:
no trigger list, no boundary clause. No validator knew the field existed
(issue #108), so the boundary-clause SUGGESTION fired on exactly the shape
@@ -1276,6 +1276,6 @@ def missing_reference_pointers(body, skill_dir):
if not os.path.isfile(os.path.join(skill_dir, 'references', match.group(1))):
missing.add('references/' + match.group(1))
return sorted(missing)
# ===== END ADR-0020 SHARED BOUNDARY RESOLVER =====
KYBERFORGE_ADR0020_RESOLVER_PY
# ===== END SHARED BOUNDARY RESOLVER =====
KYBERFORGE_RESOLVER_PY_END
KYBERFORGE_RESOLVER_PY="${KYBERFORGE_RESOLVER_PY%$'\n'}"
@@ -2,7 +2,7 @@
# lib-checks-agent.sh — SOURCED, never executed.
#
# agent-audit's structural check suite: everything in its validate.sh that is
# NOT the ADR-0020 shared boundary resolver, lifted verbatim and split at the
# NOT the shared boundary resolver, lifted verbatim and split at the
# resolver's markers. validate.sh reassembles
#
# $KYBERFORGE_AGENT_PREAMBLE_PY
@@ -17,8 +17,8 @@
#
# The dimension vocabulary and the tiers here are agent-audit's and are
# deliberately NOT reconciled with lib-checks-skill.sh's. Agents take the
# ADR-0020 description gates and no body word gate at all; adding one would
# contradict the ADR.
# context-budget description gates and no body word gate at all; adding one would
# be wrong (see the body-gate note below).
#
# Consumed by: validate.sh, agent mode.
# shellcheck shell=bash
@@ -36,7 +36,7 @@ kyberforge_agent_preflight() {
# dependency sends the reader to install the wrong thing.
if ! command -v python3 > /dev/null 2>&1; then
echo "Error: python3 is required but was not found on PATH." >&2
echo " Why: skipping the ADR-0020 description and boundary-target gates would be a vacuous pass." >&2
echo " Why: skipping the description and boundary-target gates would be a vacuous pass." >&2
echo " Fix: install python3 (pre-commit itself is a Python application, so it is almost certainly already present)." >&2
# Exit 2, the never-ran tier: no check ran, so this is not a findings result.
# lib-provenance-*.sh has always exited 2 here; this matches it.
@@ -45,7 +45,7 @@ kyberforge_agent_preflight() {
if ! python3 -c 'import yaml' > /dev/null 2>&1; then
echo "Error: PyYAML is required but is not importable by python3." >&2
echo " Why: skipping the ADR-0020 description and boundary-target gates would be a vacuous pass." >&2
echo " Why: skipping the description and boundary-target gates would be a vacuous pass." >&2
echo " Fix: python3 -m pip install PyYAML (or your distro's python3-yaml package)." >&2
# Exit 2, the never-ran tier: a missing hard dependency is not a findings result.
exit 2
@@ -62,13 +62,13 @@ import yaml
# Output is UTF-8 for the same reason input is: under LC_ALL=C the streams
# default to ASCII, and this script's own message text carries em dashes (the
# ADR-0020 boundary SUGGESTION is one). Pinning only the reads moved the crash
# boundary-clause SUGGESTION is one). Pinning only the reads moved the crash
# from the read to the write — a UnicodeEncodeError raised while PRINTING, after
# every check has already run, which loses the whole report and (here) flips a
# clean exit 0 into a traceback and an exit 1. read_text() in the shared
# resolver block below pins the reads; this pins the writes.
#
# Deliberately OUTSIDE the ADR-0020 shared boundary resolver block: the two
# Deliberately OUTSIDE the shared boundary resolver block: the two
# validate.sh modes print findings, skill-size-check.sh has its own top-level
# equivalent, and the block is one sourced copy all three share, so each
# consumer's own startup stays in its own preamble.
@@ -141,7 +141,7 @@ SUBAGENT_UNAVAILABLE_TOOLS = {
# Copilot body length limit (chars) — content beyond this is silently truncated
COPILOT_BODY_LIMIT = 30000
# ADR-0020 description budget. An agent's name + description is preloaded into
# Context-budget description limit. An agent's name + description is preloaded into
# every session exactly like a skill's, so agents take the SAME description
# gates. These two constants are DUPLICATED in three places:
# scripts/skill-size-check.sh, lib-checks-skill.sh beside this file, and here.
@@ -157,7 +157,7 @@ COPILOT_BODY_LIMIT = 30000
# rather than silently diverging.
#
# Agents deliberately take NO body word gate, and adding one here would
# contradict ADR-0020: a skill body is loaded into the caller's context and
# be wrong: a skill body is loaded into the caller's context and
# competes with the live conversation, while an agent body becomes the system
# prompt of a fresh context. The rationale for the 900-word skill ceiling does
# not transfer. Agent body length falls out of the delegation rule instead.
@@ -170,7 +170,7 @@ suggestions = []
def fail(msg):
# stderr, matching scripts/skill-size-check.sh's ERROR routing. All three
# scripts in the ADR-0020 family now agree: findings that fail the run go to
# scripts that run the context-budget gates now agree: findings that fail the run go to
# stderr, everything advisory (SUGGESTION / INFO) goes to stdout. Both repo
# callers (check-apm-agents-valid.sh, check-scope-walkup-sync.sh) capture
# `2>&1`, so nothing a human reads moves.
@@ -208,7 +208,7 @@ def extract_field(fm, field):
`\\s*` after the colon crosses the newline, so `description:` with no value
followed by `model: sonnet` captured `model: sonnet` as the description.
That made the value look present, skipped the "missing or empty" failure,
and then every ADR-0020 gate early-returned on the genuinely empty folded
and then every context-budget gate early-returned on the genuinely empty folded
value — a valueless description exited 0 with zero output on a BLOCKING
pre-push gate. This function is now used only for fields with no folding
semantics (name, tools); description goes through description_value(), the
@@ -234,14 +234,14 @@ def agent_description(fm, local_fname):
# `exc` carries the whole clause — invalid YAML, a non-mapping block, or
# a description of the wrong type. Do not prefix a diagnosis here; the
# last one named a syntax error for two failures that have none.
fail(f"{exc} — the ADR-0020 description and boundary-target gates could "
fail(f"{exc} — the description and boundary-target gates could "
f"not run — {local_fname}")
return None
def check_description_budget(value, local_fname, by_hand=False):
"""ADR-0020 description gates — identical for every scope.
"""context-budget description gates — identical for every scope.
`by_hand` is ADR-0020's hand-invocation carve-out (issue #108): an agent
`by_hand` is the hand-invocation carve-out (issue #108): an agent
carrying `disable-model-invocation: true` is absent from the model-visible
listing, so the 250-character SUGGESTION — a routing-quality budget — has
no listing to apply to. The 400-character ceiling is unaffected.
@@ -251,18 +251,18 @@ def check_description_budget(value, local_fname, by_hand=False):
dlen = len(value)
if dlen > DESC_MAX_CHARS:
fail(f"description is {dlen} chars — exceeds the {DESC_MAX_CHARS}-character "
f"ADR-0020 ceiling. It is preloaded into every session whether or not the "
f"context-budget ceiling. It is preloaded into every session whether or not the "
f"agent is invoked. Keep a trigger clause, at most one capability clause, "
f"and a boundary clause; move capability enumeration, output-format detail, "
f"composition notes and implementation detail to the body — {local_fname}")
elif dlen > DESC_SUGGEST_CHARS and not by_hand:
suggest(f"description is {dlen} chars — over the {DESC_SUGGEST_CHARS}-character "
f"ADR-0020 target (hard fail at {DESC_MAX_CHARS}). The SUGGESTION tier is "
f"context-budget target (hard fail at {DESC_MAX_CHARS}). The SUGGESTION tier is "
f"what moves the corpus average; the FAIL tier only stops outliers "
f"— {local_fname}")
def check_boundary(value, fpath, local_fname, by_hand=False):
"""ADR-0020 boundary clause + resolvable boundary targets.
"""Boundary clause + resolvable boundary targets.
agent-author's SKILL.md states that an agent's boundary targets must
resolve, but until this ran no script checked it — the contract was
@@ -287,7 +287,7 @@ def check_boundary(value, fpath, local_fname, by_hand=False):
status = boundary_clause_status(value) if not by_hand else 'present'
if status == 'absent':
suggest(f"description has no boundary clause — add the prose form (\"Do not use "
f"for X — use `y` instead\") or ADR-0020's compressed form (\"Not X -> y\") "
f"for X — use `y` instead\") or the compressed form (\"Not X -> y\") "
f"so the router knows where NOT to send this agent — {local_fname}")
elif status == 'unparsed':
suggest(f"description has an arrow boundary clause (\"Not X -> y\") from which no "
@@ -527,7 +527,7 @@ def check_apm_agent_file(fpath, allowlist, stem):
# Presence is decided on the FOLDED value, never on a line regex. Deciding
# it on extract_field's raw capture is what let `description:` with no value
# pass this gate in total silence: the capture picked up the next key, so
# "missing or empty" never fired, and every ADR-0020 check below then
# "missing or empty" never fired, and every context-budget check below then
# early-returned on the empty folded value. Exit 0, zero output, no gate run.
folded = agent_description(fm, local_fname)
if folded is None:
@@ -624,7 +624,7 @@ def check_file(fpath, file_provider):
# Presence is decided on the FOLDED value, never on a line regex. Deciding
# it on extract_field's raw capture is what let `description:` with no value
# pass this gate in total silence: the capture picked up the next key, so
# "missing or empty" never fired, and every ADR-0020 check below then
# "missing or empty" never fired, and every context-budget check below then
# early-returned on the empty folded value. Exit 0, zero output, no gate run.
folded = agent_description(fm, local_fname)
if folded is None:
@@ -2,7 +2,7 @@
# lib-checks-skill.sh — SOURCED, never executed.
#
# skill-audit's structural check suite: everything in its validate.sh that is
# NOT the ADR-0020 shared boundary resolver, lifted verbatim and split at the
# NOT the shared boundary resolver, lifted verbatim and split at the
# resolver's markers. validate.sh reassembles
#
# $KYBERFORGE_SKILL_PREAMBLE_PY
@@ -17,7 +17,7 @@
# INFO tiers here are skill-audit's and are deliberately NOT reconciled with
# lib-checks-agent.sh's. The two suites disagree on purpose: a skill body is
# loaded into the caller's context, an agent body becomes the system prompt of
# a fresh one, so ADR-0020 gives skills a body word budget and agents none.
# a fresh one, so the context budget gives skills a body word budget and agents none.
#
# Consumed by: validate.sh, skill mode.
# shellcheck shell=bash
@@ -35,7 +35,7 @@ kyberforge_skill_preflight() {
# dependency sends the reader to install the wrong thing.
if ! command -v python3 > /dev/null 2>&1; then
echo "Error: python3 is required but was not found on PATH." >&2
echo " Why: skipping the ADR-0020 description, body and boundary-target gates would be a vacuous pass." >&2
echo " Why: skipping the description, body and boundary-target gates would be a vacuous pass." >&2
echo " Fix: install python3 (pre-commit itself is a Python application, so it is almost certainly already present)." >&2
# Exit 2, the never-ran tier: no check ran, so this is not a findings result.
# lib-provenance-*.sh has always exited 2 here; this matches it.
@@ -44,7 +44,7 @@ kyberforge_skill_preflight() {
if ! python3 -c 'import yaml' > /dev/null 2>&1; then
echo "Error: PyYAML is required but is not importable by python3." >&2
echo " Why: skipping the ADR-0020 description, body and boundary-target gates would be a vacuous pass." >&2
echo " Why: skipping the description, body and boundary-target gates would be a vacuous pass." >&2
echo " Fix: python3 -m pip install PyYAML (or your distro's python3-yaml package)." >&2
# Exit 2, the never-ran tier: a missing hard dependency is not a findings result.
exit 2
@@ -61,13 +61,13 @@ import yaml
# Output is UTF-8 for the same reason input is: under LC_ALL=C the streams
# default to ASCII, and this script's own message text carries em dashes (the
# ADR-0020 boundary SUGGESTION is one). Pinning only the reads moved the crash
# boundary-clause SUGGESTION is one). Pinning only the reads moved the crash
# from the read to the write — a UnicodeEncodeError raised while PRINTING, after
# every check has already run, which loses the whole report and (here) flips a
# clean exit 0 into a traceback and an exit 1. read_text() in the shared
# resolver block below pins the reads; this pins the writes.
#
# Deliberately OUTSIDE the ADR-0020 shared boundary resolver block: the two
# Deliberately OUTSIDE the shared boundary resolver block: the two
# validate.sh modes print findings, skill-size-check.sh has its own top-level
# equivalent, and the block is one sourced copy all three share, so each
# consumer's own startup stays in its own preamble.
@@ -92,7 +92,7 @@ def ok(msg):
def fail(msg):
# stderr, matching scripts/skill-size-check.sh's ERROR routing. All three
# scripts in the ADR-0020 family now agree: findings that fail the run go to
# scripts that run the context-budget gates now agree: findings that fail the run go to
# stderr, everything advisory (PASS / SUGGESTION / INFO) goes to stdout.
# Both repo callers capture `2>&1`, so nothing a human reads moves.
global failed
@@ -102,7 +102,7 @@ def fail(msg):
def suggest(msg):
# SUGGESTIONs are printed after every check and NEVER touch the exit code.
# factory-audit's SKILL.md Step 4 report counts them into its
# `PASS (N suggestions)` result line, which is what makes the ADR-0020 SUGGESTION tier visible
# `PASS (N suggestions)` result line, which is what makes the context-budget SUGGESTION tier visible
# rather than another silently-ignored warning (ADR-0013).
suggestions.append(msg)
@@ -167,7 +167,7 @@ except FrontmatterError as exc:
dir_name = os.path.basename(skill_dir)
# ADR-0020's hand-invocation carve-out (issue #108). `disable-model-invocation:
# the hand-invocation carve-out (issue #108). `disable-model-invocation:
# true` takes the skill out of the model-visible listing entirely, so the
# trigger/capability/boundary rules and the 250-character routing target do not
# apply to it — the audit's own references/skill-description-quality.md Step 0 says
@@ -211,8 +211,8 @@ if desc:
else:
fail("description field is missing or empty")
# description length — agentskills.io spec backstop. UNCHANGED by ADR-0020:
# 1024 is the specification's hard limit, and the ADR-0020 budget gate below
# description length — agentskills.io spec backstop. UNCHANGED by the context budget:
# 1024 is the specification's hard limit, and the context-budget gate below
# sits underneath it rather than replacing it.
if desc:
dlen = len(desc)
@@ -295,12 +295,12 @@ MAX_LINES = 500
# for the full measurement.
MAX_WORDS = 2770
# ADR-0020 context-budget gates. DUPLICATED from scripts/skill-size-check.sh
# Context-budget gates. DUPLICATED from scripts/skill-size-check.sh
# for exactly the same cache-isolation reason as MAX_LINES/MAX_WORDS above, and
# carrying the same warning — tests/test-skill-size-check.sh asserts the copies
# agree, so drift fails CI instead of shipping an audit that disagrees with the
# commit hook. lib-checks-agent.sh, beside this file, holds a third copy of the
# two description constants; per ADR-0020 agents take the description gates and
# two description constants; agents take the description gates and
# deliberately take NO body word gate, because an agent body becomes the system
# prompt of a fresh context rather than competing with a live conversation.
#
@@ -331,33 +331,33 @@ else:
body = content[body_start:]
# --- ADR-0020: description budget -----------------------------------------
# --- context budget: description budget ------------------------------------
if desc:
dlen = len(desc)
if dlen > DESC_MAX_CHARS:
fail(f"description is {dlen} chars — exceeds the {DESC_MAX_CHARS}-character "
f"ADR-0020 ceiling. It is preloaded into every session whether or not the "
f"context-budget ceiling. It is preloaded into every session whether or not the "
f"skill is invoked. Keep a trigger clause, at most one capability clause, "
f"and a boundary clause; move capability enumeration, output-format detail, "
f"composition notes and implementation detail to the body or a references/ file")
elif dlen > DESC_SUGGEST_CHARS and not by_hand:
suggest(f"description is {dlen} chars — over the {DESC_SUGGEST_CHARS}-character "
f"ADR-0020 target (hard fail at {DESC_MAX_CHARS}). The SUGGESTION tier is "
f"context-budget target (hard fail at {DESC_MAX_CHARS}). The SUGGESTION tier is "
f"what moves the corpus average; the FAIL tier only stops outliers")
elif by_hand:
ok(f"description length {dlen} chars (hand-invoked: the {DESC_SUGGEST_CHARS}-character "
f"routing target does not apply, the {DESC_MAX_CHARS}-character ceiling still does)")
else:
ok(f"description length {dlen} chars (ADR-0020 target: {DESC_SUGGEST_CHARS})")
ok(f"description length {dlen} chars (context-budget target: {DESC_SUGGEST_CHARS})")
# --- ADR-0020: body budget -------------------------------------------------
# --- context budget: body budget -------------------------------------------
# Counts the BODY ONLY — everything after the closing --- of the frontmatter.
# This is a different measurement from MAX_WORDS above, which counts the whole
# file including frontmatter as a spec-conformance backstop. Both are reported.
body_word_count = len(body.split())
if body_word_count > BODY_MAX_WORDS:
fail(f"SKILL.md body is {body_word_count} words — exceeds the {BODY_MAX_WORDS}-word "
f"ADR-0020 ceiling (body only; separate from the {MAX_WORDS}-word whole-file "
f"context-budget ceiling (body only; separate from the {MAX_WORDS}-word whole-file "
f"limit above). Move lookup tables, spec restatements, output schemas, templates "
f"and rationale prose to references/ behind an explicit "
f"\"If X, read `references/file.md`\" trigger. At two or more mutually exclusive "
@@ -365,9 +365,9 @@ if body_word_count > BODY_MAX_WORDS:
f"common to every branch, each flow gets its own self-contained references/ file")
elif body_word_count > BODY_SUGGEST_WORDS:
suggest(f"SKILL.md body is {body_word_count} words — over the {BODY_SUGGEST_WORDS}-word "
f"ADR-0020 target (hard fail at {BODY_MAX_WORDS})")
f"context-budget target (hard fail at {BODY_MAX_WORDS})")
else:
ok(f"SKILL.md body word count {body_word_count} (ADR-0020 target: {BODY_SUGGEST_WORDS})")
ok(f"SKILL.md body word count {body_word_count} (context-budget target: {BODY_SUGGEST_WORDS})")
# --- Reference pointers must exist -----------------------------------------
# FAIL, not SUGGESTION: a dispatch table naming a references/ file that is not
@@ -396,7 +396,7 @@ if gotchas is not None:
f"{round(100.0 * GOTCHA_MAX_BODY_FRACTION)}% guideline. Move the durable "
f"parts to references/ and keep the section for live traps")
# --- ADR-0020: boundary clause present -------------------------------------
# --- boundary clause present -----------------------------------------------
# SUGGESTION, not FAIL: detecting the absence is deterministic, but whether
# this particular skill warrants a boundary clause is judgment. Both accepted
# shapes count — the prose markers and the compressed `Not <thing> -> <name>`.
@@ -417,7 +417,7 @@ elif desc:
ok("description has a boundary clause")
elif status == 'absent':
suggest("description has no boundary clause — add the prose form (\"Do not use "
"for X — use `y` instead\") or ADR-0020's compressed form (\"Not X -> y\") "
"for X — use `y` instead\") or the compressed form (\"Not X -> y\") "
"so the router knows where NOT to send this skill")
else:
suggest("description has an arrow boundary clause (\"Not X -> y\") from which no "
@@ -436,7 +436,7 @@ elif desc:
f"nothing. Split it into one arrow per target: \"Not X -> {first}. "
f"Not Y -> {second}.\"")
# --- ADR-0020: resolvable boundary targets ---------------------------------
# --- resolvable boundary targets -------------------------------------------
# The resolution universe comes from the SKILL's own location: the authoring
# root above it (every sibling plugin in the monorepo), its own apm package, and
# the packages that package declares in apm.yml dependencies.apm. It is never
@@ -5,7 +5,7 @@ set -euo pipefail
# target is a skill directory or an agent definition file and runs the matching
# check suite; the two suites live in lib-checks-skill.sh and lib-checks-agent.sh
# and are unchanged from the skill-audit / agent-audit scripts they came from.
# The ADR-0020 boundary resolver both of them need is sourced once, from
# The shared boundary resolver both of them need is sourced once, from
# lib-boundary-resolver.sh, instead of being embedded twice.
#
# Detection never guesses. A target that matches neither shape is a hard exit 2
@@ -36,7 +36,7 @@ EOF
}
# Helper: a description of EXACTLY <n> characters that carries a boundary
# clause and names no routing target. ADR-0020's missing-boundary-clause
# clause and names no routing target. The missing-boundary-clause
# SUGGESTION fires on any description without one, so a fixture that omits it
# is never "otherwise clean" and a test refuting SUGGESTION would be asserting
# the boundary check's absence instead of the thing it names. The clause is
@@ -54,7 +54,7 @@ PY
}
# Helper: same shape as make_apm_agent, but the description is supplied
# verbatim — used by the ADR-0020 description-budget tests.
# verbatim — used by the description-budget tests.
make_apm_agent_with_desc() {
local root="$1" name="$2" desc="$3"
mkdir -p "$root/.apm/agents"
@@ -670,14 +670,14 @@ EOF
}
# ---------------------------------------------------------------------------
# ADR-0020 — description budget (250 SUGGESTION / 400 FAIL)
# Context budget — description (250 SUGGESTION / 400 FAIL)
#
# Agents take the SAME description gates as skills: name + description is
# preloaded into every session identically. Agents take NO body word gate — see
# the final test in this block, which pins that asymmetry.
# ---------------------------------------------------------------------------
@test "ADR-0020: agent description of exactly 250 chars raises no suggestion" {
@test "context budget: agent description of exactly 250 chars raises no suggestion" {
local root="$TMPDIR/pkg"
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 250)"
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
@@ -685,7 +685,7 @@ EOF
refute_output --partial "SUGGESTION"
}
@test "ADR-0020: agent description of 251 chars raises a SUGGESTION and still exits 0" {
@test "context budget: agent description of 251 chars raises a SUGGESTION and still exits 0" {
local root="$TMPDIR/pkg"
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 251)"
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
@@ -694,7 +694,7 @@ EOF
assert_output --partial "description is 251 chars"
}
@test "ADR-0020: agent description of exactly 400 chars is a SUGGESTION, not a FAIL" {
@test "context budget: agent description of exactly 400 chars is a SUGGESTION, not a FAIL" {
local root="$TMPDIR/pkg"
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 400)"
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
@@ -702,16 +702,16 @@ EOF
assert_output --partial "SUGGESTION"
}
@test "ADR-0020: agent description of 401 chars FAILs and exits non-zero" {
@test "context budget: agent description of 401 chars FAILs and exits non-zero" {
local root="$TMPDIR/pkg"
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 401)"
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
assert_failure
assert_output --partial "description is 401 chars"
assert_output --partial "400-character ADR-0020 ceiling"
assert_output --partial "400-character context-budget ceiling"
}
@test "ADR-0020: agent description length is measured after YAML folding is resolved" {
@test "context budget: agent description length is measured after YAML folding is resolved" {
local root="$TMPDIR/pkg"
mkdir -p "$root/.apm/agents"
cat > "$root/apm.yml" <<EOF
@@ -735,7 +735,7 @@ EOF
assert_output --partial "description is 450 chars"
}
@test "ADR-0020: the description gate applies at project scope too" {
@test "context budget: the description gate applies at project scope too" {
local root="$TMPDIR/project"
local desc
desc="$(python3 -c "print('x' * 401)")"
@@ -758,10 +758,10 @@ You are a test agent. When invoked, do the thing.
EOF
run bash "$SCRIPT" "$root/.claude/agents/my-agent.md"
assert_failure
assert_output --partial "400-character ADR-0020 ceiling"
assert_output --partial "400-character context-budget ceiling"
}
@test "ADR-0020: agents take NO body word gate — a body far over the 900-word skill ceiling passes" {
@test "context budget: agents take NO body word gate — a body far over the 900-word skill ceiling passes" {
local root="$TMPDIR/pkg"
mkdir -p "$root/.apm/agents"
cat > "$root/apm.yml" <<EOF
@@ -771,9 +771,9 @@ type: skill
EOF
# Deliberate asymmetry, not an oversight: a skill body is loaded into the
# caller's context and competes with the live conversation, while an agent
# body becomes the system prompt of a fresh context. ADR-0020 gates the
# body becomes the system prompt of a fresh context. The context budget gates the
# former at 900 words and explicitly declines to gate the latter. If a body
# word gate is ever added here, it contradicts the ADR.
# word gate is ever added here, it contradicts that rule.
#
# The description carries a boundary clause so the ONLY thing this test can
# go red on is a body finding. Without one, the missing-boundary-clause
@@ -1026,7 +1026,7 @@ EOF
#
# read_text() in the shared resolver block pins the READS to UTF-8. That moved
# the LC_ALL=C crash to the WRITE: this script's own message text carries em
# dashes (the ADR-0020 boundary SUGGESTION is one), so the streams' ASCII
# dashes (the boundary-clause SUGGESTION is one), so the streams' ASCII
# default raised UnicodeEncodeError while PRINTING — after every check had
# already run. Here it also flipped a clean exit 0 into a traceback and exit 1.
# ---------------------------------------------------------------------------
@@ -1061,8 +1061,8 @@ EOF
# exported Vale hook matches with `(^|/)agents/[^/]+\.md$`)
#
# A misclassification here is silent and total — the skill rubric would run
# against an agent file, so ADR-0022's metadata.version and ADR-0020's 900-word
# body ceiling would both be applied to an artifact that ADR-0020 explicitly
# against an agent file, so ADR-0022's metadata.version and the 900-word
# body ceiling would both be applied to an artifact that the context budget explicitly
# exempts from the latter (see the 1,500-word body test above, which AGENTS.md
# cites as the pin for that asymmetry).
# ---------------------------------------------------------------------------
@@ -10,7 +10,7 @@ setup() {
# Helper: create a minimal valid skill directory.
#
# The description carries a boundary clause deliberately. ADR-0020's
# The description carries a boundary clause deliberately. The
# missing-boundary-clause SUGGESTION fires on any description without one, so
# a fixture that omits it is never "otherwise clean" — every test asserting
# SUGGESTION-freedom would be asserting the boundary check's absence instead
@@ -55,7 +55,7 @@ PY
# Helper: create a skill directory with an exact description length and an
# exact body word count. <desc> is used verbatim; <body_words> "word"
# tokens follow the frontmatter. Used by the ADR-0020 boundary tests.
# tokens follow the frontmatter. Used by the boundary tests.
make_sized_skill() {
local dir="$1" desc="$2" body_words="$3"
local name
@@ -136,7 +136,7 @@ teardown() {
assert_success
}
@test "the 1024-char agentskills.io spec backstop is unchanged and separate from the ADR-0020 ceiling" {
@test "the 1024-char agentskills.io spec backstop is unchanged and separate from the context-budget ceiling" {
local skill="$TMPDIR/my-skill"
local name
name="$(basename "$skill")"
@@ -155,10 +155,10 @@ Do the thing.
EOF
run bash "$SCRIPT" "$skill"
# Two independent gates on one value: the spec limit still PASSES at
# exactly 1024 (its own boundary is unmoved), while ADR-0020's 400-char
# exactly 1024 (its own boundary is unmoved), while the 400-char
# ceiling FAILs. The run fails on the second, not the first.
assert_output --partial "description length 1024 chars (agentskills.io spec limit: 1024)"
assert_output --partial "400-character ADR-0020 ceiling"
assert_output --partial "400-character context-budget ceiling"
assert_failure
}
@@ -521,14 +521,14 @@ PY
}
# ---------------------------------------------------------------------------
# ADR-0020 — description budget (250 SUGGESTION / 400 FAIL)
# Context budget — description (250 SUGGESTION / 400 FAIL)
#
# These sit UNDER the agentskills.io 1024-character spec backstop above, which
# is unchanged. Both ceilings are inclusive: exactly at the number passes that
# tier, one past it trips.
# ---------------------------------------------------------------------------
@test "ADR-0020: description of exactly 250 chars raises no suggestion" {
@test "context budget: description of exactly 250 chars raises no suggestion" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "$(desc_of_length 250)" 10
run bash "$SCRIPT" "$skill"
@@ -536,7 +536,7 @@ PY
refute_output --partial "SUGGESTION"
}
@test "ADR-0020: description of 251 chars raises a SUGGESTION and still exits 0" {
@test "context budget: description of 251 chars raises a SUGGESTION and still exits 0" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "$(desc_of_length 251)" 10
run bash "$SCRIPT" "$skill"
@@ -546,7 +546,7 @@ PY
assert_output --partial "All checks passed (1 suggestion(s))."
}
@test "ADR-0020: description of exactly 400 chars is a SUGGESTION, not a FAIL" {
@test "context budget: description of exactly 400 chars is a SUGGESTION, not a FAIL" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "$(desc_of_length 400)" 10
run bash "$SCRIPT" "$skill"
@@ -554,16 +554,16 @@ PY
assert_output --partial "SUGGESTION"
}
@test "ADR-0020: description of 401 chars FAILs and exits non-zero" {
@test "context budget: description of 401 chars FAILs and exits non-zero" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "$(desc_of_length 401)" 10
run bash "$SCRIPT" "$skill"
assert_failure
assert_output --partial "description is 401 chars"
assert_output --partial "400-character ADR-0020 ceiling"
assert_output --partial "400-character context-budget ceiling"
}
@test "ADR-0020: description length is measured after YAML folding is resolved" {
@test "context budget: description length is measured after YAML folding is resolved" {
local skill="$TMPDIR/my-skill"
mkdir -p "$skill"
# A >-folded block scalar: 11 lines of 40 chars folded with 10 joining
@@ -582,17 +582,17 @@ PY
run bash "$SCRIPT" "$skill"
assert_failure
assert_output --partial "description is 450 chars"
assert_output --partial "400-character ADR-0020 ceiling"
assert_output --partial "400-character context-budget ceiling"
}
# ---------------------------------------------------------------------------
# ADR-0020 — body budget (600 SUGGESTION / 900 FAIL), body ONLY
# Context budget — body (600 SUGGESTION / 900 FAIL), body ONLY
#
# Distinct from the 2,770-word whole-file spec ceiling above, which counts
# frontmatter too and is unchanged. Do not unify them.
# ---------------------------------------------------------------------------
@test "ADR-0020: body of exactly 600 words raises no suggestion" {
@test "context budget: body of exactly 600 words raises no suggestion" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 600
run bash "$SCRIPT" "$skill"
@@ -600,7 +600,7 @@ PY
refute_output --partial "SUGGESTION"
}
@test "ADR-0020: body of 601 words raises a SUGGESTION and still exits 0" {
@test "context budget: body of 601 words raises a SUGGESTION and still exits 0" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 601
run bash "$SCRIPT" "$skill"
@@ -609,7 +609,7 @@ PY
assert_output --partial "All checks passed (1 suggestion(s))."
}
@test "ADR-0020: body of exactly 900 words is a SUGGESTION, not a FAIL" {
@test "context budget: body of exactly 900 words is a SUGGESTION, not a FAIL" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 900
run bash "$SCRIPT" "$skill"
@@ -617,16 +617,16 @@ PY
assert_output --partial "body is 900 words"
}
@test "ADR-0020: body of 901 words FAILs and exits non-zero" {
@test "context budget: body of 901 words FAILs and exits non-zero" {
local skill="$TMPDIR/my-skill"
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 901
run bash "$SCRIPT" "$skill"
assert_failure
assert_output --partial "body is 901 words"
assert_output --partial "900-word ADR-0020 ceiling"
assert_output --partial "900-word context-budget ceiling"
}
@test "ADR-0020: the body gate counts the body only — frontmatter words do not count toward it" {
@test "context budget: the body gate counts the body only — frontmatter words do not count toward it" {
local skill="$TMPDIR/my-skill"
# 895 body words plus a description long enough that the WHOLE FILE is well
# over 900 words. The body gate must stay silent; the 2,770-word whole-file
@@ -634,11 +634,11 @@ PY
make_sized_skill "$skill" "$(python3 -c "print(' '.join(['w'] * 100))")" 895
run bash "$SCRIPT" "$skill"
assert_success
refute_output --partial "900-word ADR-0020 ceiling"
refute_output --partial "900-word context-budget ceiling"
}
# ---------------------------------------------------------------------------
# ADR-0020 — resolvable boundary targets
# resolvable boundary targets
#
# Resolved against the AUTHORING SOURCE (plugins/*/.apm/skills/ and
# plugins/*/.apm/agents/), never .claude/skills/, so the check works offline and
@@ -646,7 +646,7 @@ PY
# than leaning on this repo's live skills.
# ---------------------------------------------------------------------------
@test "ADR-0020: a boundary target naming an existing sibling skill resolves" {
@test "boundary: a boundary target naming an existing sibling skill resolves" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Do not use for the other thing — use fixture-sibling-skill instead." 10
@@ -655,7 +655,7 @@ PY
assert_output --partial "boundary target(s) resolve"
}
@test "ADR-0020: a boundary target naming a non-existent skill FAILs when its sentence names one that resolves" {
@test "boundary: a boundary target naming a non-existent skill FAILs when its sentence names one that resolves" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# `fixture-sibling-skill` is the corroborator: a prose-form target only earns
@@ -667,7 +667,7 @@ PY
assert_output --partial "routes to 'fixture-missing-skill'"
}
@test "ADR-0020: a LONE boundary target naming a non-existent skill is a SUGGESTION, not a FAIL" {
@test "boundary: a LONE boundary target naming a non-existent skill is a SUGGESTION, not a FAIL" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# Same grammar as the case above and as "run \`pre-commit\` instead" — a
@@ -682,7 +682,7 @@ PY
refute_output --partial "FAIL description routes to"
}
@test "ADR-0020: a boundary target naming an AGENT file resolves (agents are valid routing targets)" {
@test "boundary: a boundary target naming an AGENT file resolves (agents are valid routing targets)" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Do not use when the caller is an agent — invoke fixture-sibling-agent instead." 10
@@ -691,7 +691,7 @@ PY
assert_output --partial "boundary target(s) resolve"
}
@test "ADR-0020: a /slash-command boundary target that does not resolve FAILs" {
@test "boundary: a /slash-command boundary target that does not resolve FAILs" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Do not use when improvements are wanted — use /fixture-missing-improve instead." 10
@@ -700,7 +700,7 @@ PY
assert_output --partial "routes to 'fixture-missing-improve'"
}
@test "ADR-0020: a backticked name that does not resolve FAILs when its sentence names one that resolves" {
@test "boundary: a backticked name that does not resolve FAILs when its sentence names one that resolves" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Composes \`fixture-sibling-skill\` and \`fixture-missing-helper\` for the shared part." 10
@@ -709,7 +709,7 @@ PY
assert_output --partial "routes to 'fixture-missing-helper'"
}
@test "ADR-0020: a /slash-command target is route NOTATION and FAILs on its own, uncorroborated" {
@test "boundary: a /slash-command target is route NOTATION and FAILs on its own, uncorroborated" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# The escape hatch from the SUGGESTION tier: `/name` and `-> name` are never
@@ -721,7 +721,7 @@ PY
assert_output --partial "routes to 'fixture-missing-notation'"
}
@test "ADR-0020: a bare hyphenated word outside a boundary sentence is not read as a routing target" {
@test "boundary: a bare hyphenated word outside a boundary sentence is not read as a routing target" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# "run pre-commit hooks" is pc-run's real phrasing. A naive extractor reads
@@ -732,10 +732,10 @@ PY
refute_output --partial "pre-commit"
}
@test "ADR-0020: an arrow chain outside a boundary clause is not read as a routing target" {
@test "boundary: an arrow chain outside a boundary clause is not read as a routing target" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# diagnose's real process chain. Only ADR-0020's `Not <thing> -> <skill>`
# diagnose's real process chain. Only the compressed `Not <thing> -> <skill>`
# form makes a bare arrow target a route.
make_sized_skill "$skill" "Reproduce → minimise → instrument → fix → regression-test. Use when a bug is reported." 10
run bash "$SCRIPT" "$skill"
@@ -743,7 +743,7 @@ PY
refute_output --partial "regression-test"
}
@test "ADR-0020: MCP tool names and capitalised tool names are not read as routing targets" {
@test "boundary: MCP tool names and capitalised tool names are not read as routing targets" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when writing issues. Do not use for local files (use Read/Write/Edit) — that write goes through \`issue_write\`/\`pull_request_write\` instead." 10
@@ -752,7 +752,7 @@ PY
refute_output --partial "routes to"
}
@test "ADR-0020: ADR's compressed boundary form (Not <thing> -> <skill>) is checked" {
@test "boundary: the compressed boundary form (Not <thing> -> <skill>) is checked" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Not the other thing → fixture-missing-target." 10
@@ -761,7 +761,7 @@ PY
assert_output --partial "routes to 'fixture-missing-target'"
}
@test "ADR-0020: the boundary check declines rather than false-FAILs when no authoring source is found" {
@test "boundary: the boundary check declines rather than false-FAILs when no authoring source is found" {
# Deliberately NOT built with make_fixture_tree: this skill sits in a bare
# temp directory with no plugins/*/.apm/ above it and no .git, so the resolver
# legitimately has no universe. That is a real path (a skill being drafted
@@ -779,7 +779,7 @@ PY
}
# ---------------------------------------------------------------------------
# ADR-0020 — the hand-invocation carve-out (issue #108)
# the hand-invocation carve-out (issue #108)
#
# A skill carrying `disable-model-invocation: true` is absent from the
# model-visible listing entirely: not preloaded, and the Skill tool refuses to
@@ -815,7 +815,7 @@ make_hand_invoked_skill() {
} > "$dir/SKILL.md"
}
@test "ADR-0020: a hand-invoked skill is not asked for a boundary clause" {
@test "hand-invoked: a hand-invoked skill is not asked for a boundary clause" {
local skill="$TMPDIR/my-skill"
make_hand_invoked_skill "$skill" \
"Tell the agent to zoom out and give broader context or a higher level perspective." 10
@@ -825,7 +825,7 @@ make_hand_invoked_skill() {
assert_output --partial "hand-invoked"
}
@test "ADR-0020: the SAME description without the flag IS asked for a boundary clause" {
@test "hand-invoked: the SAME description without the flag IS asked for a boundary clause" {
# The control. Without it the case above is satisfied by an audit that
# stopped checking boundary clauses altogether.
local skill="$TMPDIR/my-skill"
@@ -836,7 +836,7 @@ make_hand_invoked_skill() {
assert_output --partial "has no boundary clause"
}
@test "ADR-0020: a hand-invoked skill is exempt from the 250-character description target" {
@test "hand-invoked: a hand-invoked skill is exempt from the 250-character description target" {
local skill="$TMPDIR/my-skill"
make_hand_invoked_skill "$skill" \
"$(python3 -c "print('Tell the agent to zoom out. ' + 'x' * 273)")" 10
@@ -845,7 +845,7 @@ make_hand_invoked_skill() {
refute_output --partial "over the 250-character"
}
@test "ADR-0020: a hand-invoked description over 400 chars still FAILS" {
@test "hand-invoked: a hand-invoked description over 400 chars still FAILS" {
# The half the carve-out does NOT lift. 400 is an outlier stop, not a
# routing-quality target: a hand-invoked description is still the one line
# the user reads when choosing from the `/` menu.
@@ -857,7 +857,7 @@ make_hand_invoked_skill() {
assert_output --partial "400-character"
}
@test "ADR-0020: a hand-invoked body over 900 words still FAILS" {
@test "hand-invoked: a hand-invoked body over 900 words still FAILS" {
# The body is loaded on invocation exactly like any other body and competes
# with the caller's live conversation the same way, so no body tier moves.
local skill="$TMPDIR/my-skill"
@@ -868,7 +868,7 @@ make_hand_invoked_skill() {
}
# ---------------------------------------------------------------------------
# ADR-0020 — one arrow, one target (issue #107)
# one arrow, one target (issue #107)
#
# Only the FIRST target after an arrow was resolved: the conjunction
# continuation is wired to the prose route verbs and never to arrows. So this
@@ -878,7 +878,7 @@ make_hand_invoked_skill() {
# extractor widened.
# ---------------------------------------------------------------------------
@test "ADR-0020: an arrow clause naming two targets is reported, not silently half-checked" {
@test "boundary: an arrow clause naming two targets is reported, not silently half-checked" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# A bare `Not ... ->` sentence carries no BOUNDARY_MARKER, so the backtick
@@ -890,7 +890,7 @@ make_hand_invoked_skill() {
assert_output --partial "names more than one target"
}
@test "ADR-0020: one arrow per target — the convention the suggestion asks for — is silent" {
@test "boundary: one arrow per target — the convention the suggestion asks for — is silent" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Not the other thing -> \`fixture-sibling-skill\`." 10
@@ -900,7 +900,7 @@ make_hand_invoked_skill() {
}
# ---------------------------------------------------------------------------
# ADR-0020 — a dotted filename in a boundary clause (issue #110)
# a dotted filename in a boundary clause (issue #110)
#
# `[^.;]` could not cross the `.` in `AGENTS.md`, so a clause naming a dotted
# file between "Not" and the arrow was invisible. With a backticked target that
@@ -909,7 +909,7 @@ make_hand_invoked_skill() {
# extracted, so the dangling check silently did not run on it.
# ---------------------------------------------------------------------------
@test "ADR-0020: a boundary clause naming a dotted filename is not reported as missing" {
@test "boundary: a boundary clause naming a dotted filename is not reported as missing" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
make_sized_skill "$skill" "Use when doing the thing. Not AGENTS.md -> \`fixture-sibling-skill\`." 10
@@ -919,7 +919,7 @@ make_hand_invoked_skill() {
assert_output --partial "description has a boundary clause"
}
@test "ADR-0020: a BARE target after a dotted filename is extracted and checked" {
@test "boundary: a BARE target after a dotted filename is extracted and checked" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# The silent half of #110: this clause produced no target at all, so it was
@@ -931,7 +931,7 @@ make_hand_invoked_skill() {
assert_output --partial "routes to 'fixture-missing-dotted'"
}
@test "ADR-0020: an arrow clause yielding no target is reported as unparsed, not as missing" {
@test "boundary: an arrow clause yielding no target is reported as unparsed, not as missing" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# A single-word target is deliberately not matchable bare, because
@@ -946,7 +946,7 @@ make_hand_invoked_skill() {
}
# ---------------------------------------------------------------------------
# ADR-0020 — the unparsed diagnostic is PER CLAUSE, not per description
# the unparsed diagnostic is PER CLAUSE, not per description
#
# boundary_clause_status() used to test `BOUNDARY_ARROW.search(description) and
# not _arrow_targets(description)`. Both operands took the WHOLE description,
@@ -962,7 +962,7 @@ make_hand_invoked_skill() {
# class: no ERROR, no SUGGESTION, exit 0.
# ---------------------------------------------------------------------------
@test "ADR-0020: an unparsed arrow clause is reported even when a sibling clause parses" {
@test "boundary: an unparsed arrow clause is reported even when a sibling clause parses" {
local skill
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
# Written by hand rather than through make_sized_skill: the `>` folded
@@ -992,7 +992,7 @@ EOF
#
# read_text() in the shared resolver block pins the READS to UTF-8. That moved
# the LC_ALL=C crash to the WRITE: this script's own message text carries em
# dashes (the ADR-0020 boundary SUGGESTION is one), so the streams' ASCII
# dashes (the boundary-clause SUGGESTION is one), so the streams' ASCII
# default raised UnicodeEncodeError while PRINTING — after every check had
# already run, losing the whole report at the last step.
# ---------------------------------------------------------------------------
@@ -6,7 +6,7 @@ description: >
Not read-only review -> `factory-audit`. Not agent files -> `agent-author`.
allowed-tools: Bash Read Write Edit
metadata:
version: "1.0.7"
version: "1.0.8"
category: factory
source_keys:
- agentskills-home
@@ -55,6 +55,6 @@ Gates `/factory-audit` enforces in both flows:
## Step 4 — Validate and close
Run `/factory-audit` on the resolved skill directory; resolve every FAIL before reporting done. It checks name-to-directory match, placeholders, both size budgets, boundary-target resolution and script hygiene — do not hand-check those. Hand-check the one thing it misses: an empty body reports `PASS SKILL.md body word count 0 (ADR-0020 target: 600)`, so confirm at least one non-empty section exists.
Run `/factory-audit` on the resolved skill directory; resolve every FAIL before reporting done. It checks name-to-directory match, placeholders, both size budgets, boundary-target resolution and script hygiene — do not hand-check those. Hand-check the one thing it misses: an empty body reports `PASS SKILL.md body word count 0 (context-budget target: 600)`, so confirm at least one non-empty section exists.
Bump `metadata.version`: the **minor** version on create (new skills start at `0.1.0`) and the **patch** version on improve.
+1 -1
View File
@@ -1,5 +1,5 @@
name: kyberforge
version: 2.3.1
version: 2.3.2
description: Skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code and GitHub Copilot.
author:
name: Mortis
+16 -13
View File
@@ -1,11 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
# ADR-0023 clause 1, and ONLY clause 1: an executable, instructed local git
# command in plugin skill or agent content is written `rtk git`, never bare
# `git`.
# Clause 1, and ONLY clause 1, of the rtk-prefix rule: an executable, instructed
# local git command in plugin skill or agent content is written `rtk git`, never
# bare `git`. The rule and its rationale are in
# docs/adr/0023-rtk-prefix-marks-executable-commands-only.md.
#
# WHY THIS IS NARROW ON PURPOSE. ADR-0023 has three clauses, and only the first
# WHY THIS IS NARROW ON PURPOSE. The rule has three clauses, and only the first
# is machine-decidable:
#
# 1. executable + instructed -> `rtk git` <- this hook
@@ -39,14 +40,16 @@ set -euo pipefail
#
# CLAUSE-3 OPT-OUT. A site that is deliberately bare because rtk rewrites the
# output the skill parses, or because the command is interactive, is exempted by
# putting the literal string `ADR-0023` on the SAME LINE — in a shell comment for
# a code line, in the cell text for a table row. Per-line, never per-block: a
# putting the literal marker `rtk-bare:` on the SAME LINE, followed by the reason
# — in a shell comment for a code line, in the cell text for a table row. The
# marker is neutral on purpose: plugin content is consumed by other repos, so it
# must not cite this repo's ADRs. Per-line, never per-block: a
# fenced block routinely mixes `rtk git` steps with one deliberately-bare
# command (references/push.md does exactly that), and a block-level marker would
# silently disarm the checked lines around the marked one.
#
# The marker is a bare substring match, so a line that merely *mentions*
# ADR-0023 for an unrelated reason is also exempt. That is accepted: the marker
# `rtk-bare:` for an unrelated reason is also exempt. That is accepted: the marker
# is an author's deliberate opt-out, not a security boundary, and a stricter
# form would only move the same trust to a different string.
@@ -55,7 +58,7 @@ if [[ $# -eq 0 ]]; then
fi
if ! command -v python3 > /dev/null 2>&1; then
echo "ERROR: python3 is required for the ADR-0023 rtk-prefix gate but was not found on PATH." >&2
echo "ERROR: python3 is required for the rtk-prefix gate but was not found on PATH." >&2
echo " Fix: install python3 (pre-commit itself is a Python application, so it is almost certainly already present)." >&2
exit 1
fi
@@ -66,7 +69,7 @@ exec python3 -u - "$@" <<'PY'
import re
import sys
MARKER = "ADR-0023"
MARKER = "rtk-bare:"
SHELL_INFO = {"bash", "sh", "shell", "zsh", "console", "shell-session"}
FENCE_OPEN = re.compile(r"^\s*(?P<f>`{3,}|~{3,})\s*(?P<info>[^\s`]*)")
@@ -182,16 +185,16 @@ for path in sys.argv[1:]:
for line_no, text in check(path):
failed = True
print(
f"ADR-0023: {path}:{line_no}: executable git command is not prefixed with `rtk`: {text}",
f"check-rtk-prefix: {path}:{line_no}: executable git command is not prefixed with `rtk`: {text}",
file=sys.stderr,
)
if failed:
print("", file=sys.stderr)
print(
"Fix: write `rtk git <subcommand>` (ADR-0023 clause 1). If this command must stay bare\n"
"because rtk rewrites output the skill parses, or because it is interactive (clause 3),\n"
"say so inline and put the literal string ADR-0023 on the same line to record the opt-out.",
"Fix: write `rtk git <subcommand>`. If this command must stay bare because rtk rewrites\n"
"output the skill parses, or because it is interactive, record the opt-out on the same\n"
"line as `rtk-bare: <reason>` (e.g. `# rtk-bare: the output is parsed`).",
file=sys.stderr,
)
sys.exit(1)
+1 -1
View File
@@ -502,7 +502,7 @@ fi
KYBERFORGE_RESOLVER_PY=''
# shellcheck source=../plugins/kyberforge/.apm/skills/factory-audit/scripts/lib-boundary-resolver.sh
. "$RESOLVER_LIB"
if [[ "$KYBERFORGE_RESOLVER_PY" != *'BEGIN ADR-0020 SHARED BOUNDARY RESOLVER'* ]]; then
if [[ "$KYBERFORGE_RESOLVER_PY" != *'BEGIN SHARED BOUNDARY RESOLVER'* ]]; then
echo "ERROR: $RESOLVER_LIB did not define the ADR-0020 boundary resolver (KYBERFORGE_RESOLVER_PY is empty or has lost its BEGIN marker)." >&2
echo " Why: running the gates without it would either crash on an undefined name or, worse, pass having resolved nothing." >&2
echo " Fix: restore the resolver here-doc in lib-boundary-resolver.sh." >&2
+2 -2
View File
@@ -66,8 +66,8 @@ fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
TMPDIR_T="$(mktemp -d)"
trap 'rm -rf "$TMPDIR_T"' EXIT
BEGIN_MARKER='# ===== BEGIN ADR-0020 SHARED BOUNDARY RESOLVER ====='
END_MARKER='# ===== END ADR-0020 SHARED BOUNDARY RESOLVER ====='
BEGIN_MARKER='# ===== BEGIN SHARED BOUNDARY RESOLVER ====='
END_MARKER='# ===== END SHARED BOUNDARY RESOLVER ====='
# ---------------------------------------------------------------------------
# 1. The resolver has one copy, and the root hook runs it
+9 -5
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
# Tests for scripts/check-rtk-prefix.sh — ADR-0023 clause 1.
# Tests for scripts/check-rtk-prefix.sh — clause 1 of the rtk-prefix rule (ADR-0023).
#
# Case 1 is the one that earns the rest: it runs the gate against the corpus as
# it stood BEFORE the #113 sweep, and asserts it fails there. A gate that only
@@ -91,7 +91,7 @@ else
if bash "$SCRIPT" ${PRE_PATHS[@]+"${PRE_PATHS[@]}"} > "$RUN_TMP/pre.out" 2>&1; then
fail "the pre-sweep corpus passed — the gate would not have caught the #113 drift"
else
hits="$(grep -c '^ADR-0023: ' "$RUN_TMP/pre.out" || true)"
hits="$(grep -c '^check-rtk-prefix: ' "$RUN_TMP/pre.out" || true)"
if [[ "$hits" -lt 20 ]]; then
fail "the pre-sweep corpus produced only $hits findings — too few to be the known drift"
elif ! grep -q 'gitea-issues/SKILL.md.*git remote get-url origin' "$RUN_TMP/pre.out"; then
@@ -135,8 +135,12 @@ rtk git push
```' "prefixed commands"
expect clean '```bash
git stash list # rtk-bare: rtk prints "No stashes" where git prints nothing
```' "a bare command carrying the rtk-bare: opt-out marker"
expect dirty '```bash
git stash list # bare per ADR-0023: rtk prints "No stashes" where git prints nothing
```' "a bare command carrying the ADR-0023 opt-out marker"
```' "the retired ADR-0023 marker no longer exempts a bare command"
expect clean '```text
git worktree list --porcelain -z
@@ -167,7 +171,7 @@ expect clean '| Operation | Run |
expect clean '| Operation | Run |
|---|---|
| List | `git worktree list -v` — bare per ADR-0023 |' \
| List | `git worktree list -v` — rtk-bare: the output is parsed |' \
"a bare Run cell carrying the opt-out marker"
# The clause-2 shapes that made an every-span check unusable. Both are real rows
@@ -225,7 +229,7 @@ if [[ ${#LIVE[@]} -eq 0 ]]; then
elif (cd "$REPO_ROOT" && bash "$SCRIPT" ${LIVE[@]+"${LIVE[@]}"} > "$RUN_TMP/live.out" 2>&1); then
pass "the ${#LIVE[@]} in-scope corpus files pass"
else
fail "the live corpus has ADR-0023 clause-1 violations"
fail "the live corpus has clause-1 violations"
sed 's/^/ /' "$RUN_TMP/live.out"
fi
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
# Acceptance test for issue #177: deployed plugin content must not carry this
# repo's internal references, because it ships into consumer repos where those
# references point nowhere.
#
# * git and gitea `.apm/` content: no Co-authored-by trailer examples (any
# case), no ADR citations (`ADR-0`, `docs/adr`), no `Mortis/Holocron` slug.
# * git, gitea, delivery, core and kyberforge `.apm/` content: no ADR-0023
# (now the `rtk-bare:` marker) and no ADR-0020 (the rule is stated inline).
#
# Other ADR citations in delivery, core and kyberforge are out of #177's scope
# and deliberately not asserted here. Every hit is printed as file:line.
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PASS=0
FAIL=0
pass() { echo " PASS: $1"; PASS=$((PASS + 1)); }
fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
# assert_absent <label> <grep flags> <pattern> <plugin>...
# Fails, printing file:line:text for every hit, when <pattern> occurs in any
# named plugin's .apm/ tree. A missing .apm/ dir fails too: a renamed plugin
# must not turn the check vacuous.
assert_absent() {
local label="$1" flags="$2" pattern="$3"
shift 3
local dirs=() plugin hits
for plugin in "$@"; do
if [[ ! -d "$REPO_ROOT/plugins/$plugin/.apm" ]]; then
fail "$label: plugins/$plugin/.apm does not exist"
return
fi
dirs+=("plugins/$plugin/.apm")
done
# grep exits 1 on no match, which is the passing case here. The guarded
# expansion keeps bash 3.2 happy under `set -u`.
hits="$(cd "$REPO_ROOT" && grep -rnI $flags -e "$pattern" -- ${dirs[@]+"${dirs[@]}"} || true)"
if [[ -z "$hits" ]]; then
pass "$label"
else
fail "$label"
printf '%s\n' "$hits" | sed 's/^/ /'
fi
}
echo "Plugin content is consumer-neutral (#177)"
assert_absent "git/gitea: no Co-authored-by" "-i" "Co-authored-by" git gitea
assert_absent "git/gitea: no ADR-0 citation" "" "ADR-0" git gitea
assert_absent "git/gitea: no docs/adr path" "" "docs/adr" git gitea
assert_absent "git/gitea: no Mortis/Holocron slug" "" "Mortis/Holocron" git gitea
assert_absent "no ADR-0023 citation" "" "ADR-0023" git gitea delivery core kyberforge
assert_absent "no ADR-0020 citation" "" "ADR-0020" git gitea delivery core kyberforge
echo ""
echo "Results: $PASS passed, $FAIL failed"
[[ $FAIL -eq 0 ]]