Compare commits
42
Commits
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "holocron",
|
"name": "holocron",
|
||||||
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
|
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
|
||||||
"version": "0.9.2",
|
"version": "0.9.4",
|
||||||
"owner": {
|
"owner": {
|
||||||
"name": "Mortis",
|
"name": "Mortis",
|
||||||
"url": "https://git.rkdr.net/Mortis/"
|
"url": "https://git.rkdr.net/Mortis/"
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kyberforge",
|
"name": "kyberforge",
|
||||||
"description": "Skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code and GitHub Copilot.",
|
"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",
|
"category": "Developer Tools",
|
||||||
"source": "./plugins/kyberforge"
|
"source": "./plugins/kyberforge"
|
||||||
},
|
},
|
||||||
@@ -24,21 +24,21 @@
|
|||||||
{
|
{
|
||||||
"name": "git",
|
"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.",
|
"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.3.9",
|
"version": "1.4.1",
|
||||||
"category": "Version Control",
|
"category": "Version Control",
|
||||||
"source": "./plugins/git"
|
"source": "./plugins/git"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gitea",
|
"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.",
|
"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",
|
"category": "Version Control",
|
||||||
"source": "./plugins/gitea"
|
"source": "./plugins/gitea"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "core",
|
"name": "core",
|
||||||
"description": "Skills for authoring and auditing a repo's AGENTS.md and the provider adapter files that defer to it.",
|
"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",
|
"category": "Productivity",
|
||||||
"source": "./plugins/core"
|
"source": "./plugins/core"
|
||||||
},
|
},
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
{
|
{
|
||||||
"name": "delivery",
|
"name": "delivery",
|
||||||
"description": "Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.",
|
"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",
|
"category": "Developer Tools",
|
||||||
"source": "./plugins/delivery"
|
"source": "./plugins/delivery"
|
||||||
},
|
},
|
||||||
@@ -90,6 +90,13 @@
|
|||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"category": "Productivity",
|
"category": "Productivity",
|
||||||
"source": "./plugins/plan"
|
"source": "./plugins/plan"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rtk",
|
||||||
|
"description": "A Claude Code hook that routes Bash tool calls through rtk, the token-saving command wrapper, when rtk is installed.",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"category": "Developer Tools",
|
||||||
|
"source": "./plugins/rtk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,28 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_apm_source": "Mortis/Holocron/plugins/delivery"
|
"_apm_source": "Mortis/Holocron/plugins/delivery"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matcher": "Bash",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/git/.apm/hooks/refuse-push-to-main.py\"",
|
||||||
|
"timeout": 10
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_apm_source": "Mortis/Holocron/plugins/git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matcher": "Bash",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh\"",
|
||||||
|
"timeout": 10
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_apm_source": "Mortis/Holocron/plugins/rtk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"SessionStart": [
|
"SessionStart": [
|
||||||
|
|||||||
@@ -11,6 +11,26 @@
|
|||||||
"timeout": 10
|
"timeout": 10
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matcher": "Bash",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/git/.apm/hooks/refuse-push-to-main.py\"",
|
||||||
|
"timeout": 10
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matcher": "Bash",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh\"",
|
||||||
|
"timeout": 10
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"SessionStart": [
|
"SessionStart": [
|
||||||
|
|||||||
@@ -273,8 +273,8 @@ repos:
|
|||||||
|
|
||||||
- id: check-rtk-prefix
|
- id: check-rtk-prefix
|
||||||
stages: ['pre-commit']
|
stages: ['pre-commit']
|
||||||
name: ADR-0023 rtk prefix on executable git commands
|
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 literal string ADR-0023 on its own line
|
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
|
entry: scripts/check-rtk-prefix.sh
|
||||||
language: script
|
language: script
|
||||||
files: '^plugins/[^/]+/\.apm/(skills/.*\.md|agents/.*\.agent\.md)$'
|
files: '^plugins/[^/]+/\.apm/(skills/.*\.md|agents/.*\.agent\.md)$'
|
||||||
|
|||||||
@@ -155,3 +155,7 @@ Under the `run-tests` pre-push hook, git exported `GIT_DIR` to the hook, so a ba
|
|||||||
## 2026-11-26 — A hook's GIT_DIR leaks through any tool that runs git
|
## 2026-11-26 — A hook's GIT_DIR leaks through any tool that runs git
|
||||||
|
|
||||||
#204: pushing from a linked worktree left the shared `.git/config` with `core.bare=true` and the worktree on a detached HEAD at the lock-pinned commit. git exports an absolute `GIT_DIR` to hooks run from a linked worktree. `apm-audit-ci` ran `apm audit --ci`, and its drift replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an env copied from `os.environ`. The inherited `GIT_DIR` won, so both operations hit this repo instead of the temp dir. The 2026-11-13 fix did not cover this: it scrubbed the env only inside `tests/run-tests.sh`, and the apm hooks never pass through that file. Fix: `scripts/lib/clean-git-env.sh` unsets the repo-locating vars, and both `scripts/apm-audit-ci.sh` and the new `scripts/apm-pack-check-clean.sh` source it before calling apm. `tests/test-apm-hooks-git-env.sh` reproduces the leak with a stub `apm`. Rule: any hook that shells out to a tool that runs git must scrub `GIT_*` first. Scrubbing one entry point does not protect the others. *2026-12-02 (#272):* apm 0.39.3's `apm_cli/utils/git_env.py` provides `git_subprocess_env`, which strips `GIT_DIR` and the other repo-locating vars. The leak was not re-tested on 0.39.3, and the scrub stays, because the rule is about the hook, not about one tool version.
|
#204: pushing from a linked worktree left the shared `.git/config` with `core.bare=true` and the worktree on a detached HEAD at the lock-pinned commit. git exports an absolute `GIT_DIR` to hooks run from a linked worktree. `apm-audit-ci` ran `apm audit --ci`, and its drift replay (apm 0.28.0) runs `git init` and `git checkout` in a temp dir with an env copied from `os.environ`. The inherited `GIT_DIR` won, so both operations hit this repo instead of the temp dir. The 2026-11-13 fix did not cover this: it scrubbed the env only inside `tests/run-tests.sh`, and the apm hooks never pass through that file. Fix: `scripts/lib/clean-git-env.sh` unsets the repo-locating vars, and both `scripts/apm-audit-ci.sh` and the new `scripts/apm-pack-check-clean.sh` source it before calling apm. `tests/test-apm-hooks-git-env.sh` reproduces the leak with a stub `apm`. Rule: any hook that shells out to a tool that runs git must scrub `GIT_*` first. Scrubbing one entry point does not protect the others. *2026-12-02 (#272):* apm 0.39.3's `apm_cli/utils/git_env.py` provides `git_subprocess_env`, which strips `GIT_DIR` and the other repo-locating vars. The leak was not re-tested on 0.39.3, and the scrub stays, because the rule is about the hook, not about one tool version.
|
||||||
|
|
||||||
|
## 2026-12-06 — Two correct gates can make a first landing unpushable
|
||||||
|
|
||||||
|
#179: `check-executables-allow-sync` requires a new hook-shipping plugin's git+path entry in root `apm.yml`, while root deps resolve from the remote's `main` (ADR-0019), so `apm-audit-ci`'s `ref-consistency` fails until the plugin lands — no state of the branch passes both. Fix: a narrow, self-expiring waiver in `scripts/apm-audit-ci.sh` keyed on the plugin being absent from local `origin/main`. Rule: when adding a gate that reads the remote's `main`, check what a first landing of the thing it guards looks like.
|
||||||
@@ -8,7 +8,7 @@ Content ships as installable plugins, each an apm (Agent Package Manager) packag
|
|||||||
|
|
||||||
| Path | What it holds |
|
| Path | What it holds |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `plugins/` | The apm packages — `bin`, `core`, `git`, `gitea`, `kyberforge`, `lint`, `mattpocock`, `delivery`, `ansible`, `gitops`, `k8s`, `plan` — each carrying skills, and where relevant agents, hooks, and bundled assets |
|
| `plugins/` | The apm packages — `bin`, `core`, `git`, `gitea`, `kyberforge`, `lint`, `mattpocock`, `delivery`, `ansible`, `gitops`, `k8s`, `plan`, `rtk` — each carrying skills, and where relevant agents, hooks, and bundled assets |
|
||||||
| `providers/claude-code/` | Claude Code adapter, deployed to `~/.claude/` via `scripts/install.sh` |
|
| `providers/claude-code/` | Claude Code adapter, deployed to `~/.claude/` via `scripts/install.sh` |
|
||||||
| `core/` | Provider-agnostic always-on content — `core/AGENTS.md` and `core/instructions/` |
|
| `core/` | Provider-agnostic always-on content — `core/AGENTS.md` and `core/instructions/` |
|
||||||
| `docs/` | Specs (`docs/spec/`), architectural decisions (`docs/adr/`), governance, research, and notes |
|
| `docs/` | Specs (`docs/spec/`), architectural decisions (`docs/adr/`), governance, research, and notes |
|
||||||
@@ -37,7 +37,7 @@ Install all of these before setting up. Each one is a hard dependency of a git h
|
|||||||
| Tool | Why | Install |
|
| Tool | Why | Install |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `uv` | Runs this repo's pinned apm. The root `pyproject.toml` pins `apm-cli==0.39.3` and `uv.lock` locks it (ADR-0034); the `apm-audit-ci` and `apm-pack-check-clean` pre-push hooks run it as `uv run --frozen apm` through `scripts/lib/apm.sh`, and fail below apm 0.39.2 | https://docs.astral.sh/uv/getting-started/installation/. A global `apm` is not needed and not used: a bare `apm` here may be an older one that refuses the v4 `apm.lock.yaml` |
|
| `uv` | Runs this repo's pinned apm. The root `pyproject.toml` pins `apm-cli==0.39.3` and `uv.lock` locks it (ADR-0034); the `apm-audit-ci` and `apm-pack-check-clean` pre-push hooks run it as `uv run --frozen apm` through `scripts/lib/apm.sh`, and fail below apm 0.39.2 | https://docs.astral.sh/uv/getting-started/installation/. A global `apm` is not needed and not used: a bare `apm` here may be an older one that refuses the v4 `apm.lock.yaml` |
|
||||||
| `python3` + PyYAML | Required by `scripts/skill-size-check.sh` (the `skill-size-check` pre-commit hook) and `scripts/check-skill-version-bump.sh` (the `check-skill-version-bump` pre-push hook), which both parse YAML frontmatter | `python3` is usually present — pre-commit is itself a Python application. `pip install pyyaml` if the hook reports PyYAML missing |
|
| `python3` + PyYAML | Required by `scripts/skill-size-check.sh` (the `skill-size-check` pre-commit hook) and `scripts/check-skill-version-bump.sh` (the `check-skill-version-bump` pre-push hook), which both parse YAML frontmatter. `scripts/install.sh` needs `python3` (not PyYAML) to merge the Claude Code settings | `python3` is usually present — pre-commit is itself a Python application. `pip install pyyaml` if the hook reports PyYAML missing |
|
||||||
| `vale` | Required by the `vale-audit-prefilter-skill` / `-agent` pre-commit hooks, and by the `test-vale-wrap.sh` suite that `run-tests --strict` runs at pre-push | `brew install vale` (macOS), `snap install vale` (Linux), `choco install vale` (Windows), or https://vale.sh/docs/vale-cli/installation/ |
|
| `vale` | Required by the `vale-audit-prefilter-skill` / `-agent` pre-commit hooks, and by the `test-vale-wrap.sh` suite that `run-tests --strict` runs at pre-push | `brew install vale` (macOS), `snap install vale` (Linux), `choco install vale` (Windows), or https://vale.sh/docs/vale-cli/installation/ |
|
||||||
| `claude` CLI | Required by the `validate-marketplace` pre-push hook | Claude Code |
|
| `claude` CLI | Required by the `validate-marketplace` pre-push hook | Claude Code |
|
||||||
|
|
||||||
|
|||||||
+132
-79
@@ -1,5 +1,5 @@
|
|||||||
lockfile_version: '4'
|
lockfile_version: '4'
|
||||||
generated_at: '2026-12-02T11:24:59.920648+00:00'
|
generated_at: '2026-12-06T15:33:54.945486+00:00'
|
||||||
apm_version: 0.39.3
|
apm_version: 0.39.3
|
||||||
manifest_targets:
|
manifest_targets:
|
||||||
- claude
|
- claude
|
||||||
@@ -7,7 +7,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: ansible
|
name: ansible
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
virtual_path: plugins/ansible
|
virtual_path: plugins/ansible
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -25,7 +25,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: bin
|
name: bin
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 5.0.0
|
version: 5.0.0
|
||||||
virtual_path: plugins/bin
|
virtual_path: plugins/bin
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -75,7 +75,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: core
|
name: core
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 1.1.4
|
version: 1.1.4
|
||||||
virtual_path: plugins/core
|
virtual_path: plugins/core
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -153,8 +153,8 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: delivery
|
name: delivery
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 0.8.0
|
version: 0.8.1
|
||||||
virtual_path: plugins/delivery
|
virtual_path: plugins/delivery
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
package_type: apm_package
|
package_type: apm_package
|
||||||
@@ -240,7 +240,7 @@ dependencies:
|
|||||||
.claude/skills/delivery-verify/references/report.md: sha256:1bec37e1358d5a56f347e32ca996c693d2f785e7c833f5c6351b6c07380b7e89
|
.claude/skills/delivery-verify/references/report.md: sha256:1bec37e1358d5a56f347e32ca996c693d2f785e7c833f5c6351b6c07380b7e89
|
||||||
.claude/skills/delivery-verify/references/revert.md: sha256:d046d1a8f58ac2c41b084a7e669315ec8a6aebcbf86583355db07dd60260c3bb
|
.claude/skills/delivery-verify/references/revert.md: sha256:d046d1a8f58ac2c41b084a7e669315ec8a6aebcbf86583355db07dd60260c3bb
|
||||||
.claude/skills/delivery-verify/references/tiers.md: sha256:28193c90454e4c000f8502155de00e974ce1ffa5db81d7315c23aced67594bdc
|
.claude/skills/delivery-verify/references/tiers.md: sha256:28193c90454e4c000f8502155de00e974ce1ffa5db81d7315c23aced67594bdc
|
||||||
content_hash: sha256:aa6b3fc8d874c6744121fb5d08b613e830d5b95670b659e67e1c49a569d1d042
|
content_hash: sha256:baa8dc9cf894db4f43df6a07ef7058b32358038b032b712821bce03313bfc925
|
||||||
package_targets:
|
package_targets:
|
||||||
- claude
|
- claude
|
||||||
- codex
|
- codex
|
||||||
@@ -272,13 +272,14 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: git
|
name: git
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 1.3.9
|
version: 1.4.0
|
||||||
virtual_path: plugins/git
|
virtual_path: plugins/git
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
package_type: apm_package
|
package_type: apm_package
|
||||||
deployed_files:
|
deployed_files:
|
||||||
- .claude/agents/git-orchestrate.md
|
- .claude/agents/git-orchestrate.md
|
||||||
|
- .claude/hooks/git/.apm/hooks/refuse-push-to-main.py
|
||||||
- .claude/skills/git-branches
|
- .claude/skills/git-branches
|
||||||
- .claude/skills/git-branches/LICENSE
|
- .claude/skills/git-branches/LICENSE
|
||||||
- .claude/skills/git-branches/SKILL.md
|
- .claude/skills/git-branches/SKILL.md
|
||||||
@@ -345,6 +346,7 @@ dependencies:
|
|||||||
- .claude/skills/pc-run/references/sources.md
|
- .claude/skills/pc-run/references/sources.md
|
||||||
deployed_file_hashes:
|
deployed_file_hashes:
|
||||||
.claude/agents/git-orchestrate.md: sha256:c9122bac28dc079efb041acc720dd097c62fdb49d9b1d9a62b15ac5ee6c47032
|
.claude/agents/git-orchestrate.md: sha256:c9122bac28dc079efb041acc720dd097c62fdb49d9b1d9a62b15ac5ee6c47032
|
||||||
|
.claude/hooks/git/.apm/hooks/refuse-push-to-main.py: sha256:2a8b9c3e53e1c1d388c254aa65f66632315eb4a289b25e8ef1a3008bf08513f9
|
||||||
.claude/skills/git-branches/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/git-branches/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/git-branches/SKILL.md: sha256:61de940e705c463a6947fa1b2b4946fe3793d521fad0074d824ede742a948a78
|
.claude/skills/git-branches/SKILL.md: sha256:61de940e705c463a6947fa1b2b4946fe3793d521fad0074d824ede742a948a78
|
||||||
.claude/skills/git-branches/references/branch-operations.md: sha256:4406d74f819ee48209213b7160a0ead96cafeb1bc7f520134b1b720c2612e19d
|
.claude/skills/git-branches/references/branch-operations.md: sha256:4406d74f819ee48209213b7160a0ead96cafeb1bc7f520134b1b720c2612e19d
|
||||||
@@ -400,7 +402,7 @@ dependencies:
|
|||||||
.claude/skills/pc-run/references/failure-patterns.md: sha256:c760a933a937d5c33206f918089a49afd8335de3854093f5c32494e71019378c
|
.claude/skills/pc-run/references/failure-patterns.md: sha256:c760a933a937d5c33206f918089a49afd8335de3854093f5c32494e71019378c
|
||||||
.claude/skills/pc-run/references/install.md: sha256:71ec08d58b8797b09574a827ea06d2c9656e3394d40534860fdaf333f5c19070
|
.claude/skills/pc-run/references/install.md: sha256:71ec08d58b8797b09574a827ea06d2c9656e3394d40534860fdaf333f5c19070
|
||||||
.claude/skills/pc-run/references/sources.md: sha256:ed47302b3fa003ca203cf6677905032f687ff5e07e3d551593865116d9ce11f1
|
.claude/skills/pc-run/references/sources.md: sha256:ed47302b3fa003ca203cf6677905032f687ff5e07e3d551593865116d9ce11f1
|
||||||
content_hash: sha256:e2b1ba4a5767a1355926347fb0771f1c0a175c19331fd959deb88696eb7e7a1d
|
content_hash: sha256:3a10096fdd99fc2c8cbe962bbff0679c0998f09bef8fb19cf961fef01fdc4e9c
|
||||||
package_targets:
|
package_targets:
|
||||||
- claude
|
- claude
|
||||||
- codex
|
- codex
|
||||||
@@ -437,10 +439,11 @@ dependencies:
|
|||||||
- path: LICENSE
|
- path: LICENSE
|
||||||
source: LICENSE
|
source: LICENSE
|
||||||
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
|
exec_status: deployed
|
||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: gitea
|
name: gitea
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 1.3.10
|
version: 1.3.10
|
||||||
virtual_path: plugins/gitea
|
virtual_path: plugins/gitea
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -568,7 +571,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: gitops
|
name: gitops
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
virtual_path: plugins/gitops
|
virtual_path: plugins/gitops
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -604,7 +607,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: k8s
|
name: k8s
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
virtual_path: plugins/k8s
|
virtual_path: plugins/k8s
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -636,8 +639,8 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: kyberforge
|
name: kyberforge
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 2.3.0
|
version: 2.3.1
|
||||||
virtual_path: plugins/kyberforge
|
virtual_path: plugins/kyberforge
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
package_type: apm_package
|
package_type: apm_package
|
||||||
@@ -667,6 +670,7 @@ dependencies:
|
|||||||
- .claude/skills/apm-install/LICENSE
|
- .claude/skills/apm-install/LICENSE
|
||||||
- .claude/skills/apm-install/SKILL.md
|
- .claude/skills/apm-install/SKILL.md
|
||||||
- .claude/skills/apm-install/references/sources.md
|
- .claude/skills/apm-install/references/sources.md
|
||||||
|
- .claude/skills/apm-install/references/uv-pin.md
|
||||||
- .claude/skills/apm-workflow
|
- .claude/skills/apm-workflow
|
||||||
- .claude/skills/apm-workflow/LICENSE
|
- .claude/skills/apm-workflow/LICENSE
|
||||||
- .claude/skills/apm-workflow/SKILL.md
|
- .claude/skills/apm-workflow/SKILL.md
|
||||||
@@ -775,7 +779,7 @@ dependencies:
|
|||||||
- .claude/skills/skill-author/tests/README.md
|
- .claude/skills/skill-author/tests/README.md
|
||||||
- .claude/skills/skill-author/tests/new-skill.bats
|
- .claude/skills/skill-author/tests/new-skill.bats
|
||||||
deployed_file_hashes:
|
deployed_file_hashes:
|
||||||
.claude/agents/apm-orchestrate.md: sha256:7c4b7efb58ecdd26fea835613d0f7f909706607cac4f002a0df2db2a3a0ee477
|
.claude/agents/apm-orchestrate.md: sha256:89e9a5332907e8c32d0c903dfab5bcf5408aac985c98627cf5247b2a24c924a7
|
||||||
.claude/hooks/kyberforge/.apm/hooks/check-apm-current.sh: sha256:30d9160d25eb712fe7a4d206d12c3779cf13725ccba2f09843713a6f3ebe9ca4
|
.claude/hooks/kyberforge/.apm/hooks/check-apm-current.sh: sha256:30d9160d25eb712fe7a4d206d12c3779cf13725ccba2f09843713a6f3ebe9ca4
|
||||||
.claude/skills/agent-author/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/agent-author/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/agent-author/SKILL.md: sha256:7b4ac3c654912459752af14674d8690261e009cfbe022228f14f957150e9b85e
|
.claude/skills/agent-author/SKILL.md: sha256:7b4ac3c654912459752af14674d8690261e009cfbe022228f14f957150e9b85e
|
||||||
@@ -796,16 +800,17 @@ dependencies:
|
|||||||
.claude/skills/agent-author/tests/README.md: sha256:c844e519db989f64ca5ddfe8b9f3f81c70d71434bd9720136c1a1498aed88808
|
.claude/skills/agent-author/tests/README.md: sha256:c844e519db989f64ca5ddfe8b9f3f81c70d71434bd9720136c1a1498aed88808
|
||||||
.claude/skills/agent-author/tests/new-agent.bats: sha256:1bd8c4a9bb404b4e189e4eaac65c17f831d9905a9afa6879c162712cadcce6ef
|
.claude/skills/agent-author/tests/new-agent.bats: sha256:1bd8c4a9bb404b4e189e4eaac65c17f831d9905a9afa6879c162712cadcce6ef
|
||||||
.claude/skills/apm-install/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/apm-install/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/apm-install/SKILL.md: sha256:2d4c1ac4a7f68f79ba4c84b7be94addd4452827c71dda3f465a4454f36047c74
|
.claude/skills/apm-install/SKILL.md: sha256:a007ebb9c6e5526aec9b8278987d6863b4fee9a16ab62f64bc7d45965251eac0
|
||||||
.claude/skills/apm-install/references/sources.md: sha256:b80245ff8ae179d458572cb9b03621d00bf7e2f052f0cd71b88112c0ea8a91ce
|
.claude/skills/apm-install/references/sources.md: sha256:4010e5711cbc502e5059f502c6f607d2726a1a1183a280321f42352b2b279fa8
|
||||||
|
.claude/skills/apm-install/references/uv-pin.md: sha256:9c8c936dfa275d584ef3749ad7d98d46a3553fda8e7356fa6cb74baa76ee4054
|
||||||
.claude/skills/apm-workflow/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/apm-workflow/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/apm-workflow/SKILL.md: sha256:96c90f05891a669b05ccb5d33638d0bee6231d7251cddfedc84ea337617c530e
|
.claude/skills/apm-workflow/SKILL.md: sha256:f9f2023185e9ca846835d66b91a3f8777de2f0a186e3db51922bae70ce2b9233
|
||||||
.claude/skills/apm-workflow/references/audit.md: sha256:9b3fe128cbe133c8f2880a968b4cd6e875cc0eb79ef6738a9bfdabdf28446fe2
|
.claude/skills/apm-workflow/references/audit.md: sha256:fbe286392114c3a34ad59b9da13099176c97ff04184834408755791697c1c9c4
|
||||||
.claude/skills/apm-workflow/references/compile.md: sha256:9c7b50645c7da1b442263eb7fd45eb11da09a6356f0f8be65a5b1eb1510f4b53
|
.claude/skills/apm-workflow/references/compile.md: sha256:ef2827e42ab2573b87dbf01a0e6ce0b6993ab03f97ce8d9ebcec53d1af66841e
|
||||||
.claude/skills/apm-workflow/references/configure.md: sha256:7633f1cbdaa01d2e889ff114ea67d4e7f0d7d9f41ef77aa21156a6226a04ffc7
|
.claude/skills/apm-workflow/references/configure.md: sha256:bbb2d903ff1e7dc353c7bc100472010d8c1c0ee41326c46f1002ccc531b4ecd8
|
||||||
.claude/skills/apm-workflow/references/install.md: sha256:e729386bee5e2b67ce16b4c6c85446ce7b47d3122b68c148a571bd00a8550ad5
|
.claude/skills/apm-workflow/references/install.md: sha256:e729386bee5e2b67ce16b4c6c85446ce7b47d3122b68c148a571bd00a8550ad5
|
||||||
.claude/skills/apm-workflow/references/marketplace.md: sha256:1ed67d9a7bb241d2050c7ad4b45799a936ea4df480e8fecbdf69bb1f9eef7211
|
.claude/skills/apm-workflow/references/marketplace.md: sha256:23be8060f3831f91c1e30e7ac3f36fabfd9faf9cd991f3fa665000a7c2348e77
|
||||||
.claude/skills/apm-workflow/references/sources.md: sha256:4ae44a9e82e8ec3bd4b1a61f32adbd3f3ff5fab21db3b4162765b2c0553e49fd
|
.claude/skills/apm-workflow/references/sources.md: sha256:05f8c11cd75d3c4a0949be19c63f23389fbe10e89015ce16dc9e7225964e4d12
|
||||||
.claude/skills/factory-audit/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/factory-audit/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/factory-audit/SKILL.md: sha256:9eb6d4bf2bf9483e756e93da0bf3752b0dc86cd641b486bbe5c3fd48948f5c40
|
.claude/skills/factory-audit/SKILL.md: sha256:9eb6d4bf2bf9483e756e93da0bf3752b0dc86cd641b486bbe5c3fd48948f5c40
|
||||||
.claude/skills/factory-audit/assets/vale/.vale.ini: sha256:74ad1f946bfaa7a73296a9300082269febacc77cc4953296257cd07a93343f29
|
.claude/skills/factory-audit/assets/vale/.vale.ini: sha256:74ad1f946bfaa7a73296a9300082269febacc77cc4953296257cd07a93343f29
|
||||||
@@ -847,37 +852,37 @@ dependencies:
|
|||||||
.claude/skills/factory-audit/tests/validate-provenance-skill.bats: sha256:0ca63a4790035fce3d3907179a6c3831b681bdba5f7ae099183c86a65cb581cc
|
.claude/skills/factory-audit/tests/validate-provenance-skill.bats: sha256:0ca63a4790035fce3d3907179a6c3831b681bdba5f7ae099183c86a65cb581cc
|
||||||
.claude/skills/factory-audit/tests/validate-skill.bats: sha256:4065195bfe9faf5338e858acc7e97f3a6fe67004f083fbdb0a3717f097b7a4d3
|
.claude/skills/factory-audit/tests/validate-skill.bats: sha256:4065195bfe9faf5338e858acc7e97f3a6fe67004f083fbdb0a3717f097b7a4d3
|
||||||
.claude/skills/forge/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/forge/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/forge/SKILL.md: sha256:562249dd1a0a2632e2b5bdeac864a6cdc6ab33a2d05a59ed1fb1fb919a42ee98
|
.claude/skills/forge/SKILL.md: sha256:cac9e59ddb27305698c946d7859a8d34dc331b0edba8a63f10c93595bfdc6e80
|
||||||
.claude/skills/forge/references/apm-routes.md: sha256:b7d74d12ff34648be968db3e9db66c1be2efa420cad0eceea20374aa100659aa
|
.claude/skills/forge/references/apm-routes.md: sha256:b7d74d12ff34648be968db3e9db66c1be2efa420cad0eceea20374aa100659aa
|
||||||
.claude/skills/forge/references/author-routes.md: sha256:cfbc0502a60d1f444c2e5e76a392329cfa92b1ec51d1f365cc0772312e064a4d
|
.claude/skills/forge/references/author-routes.md: sha256:110bae34e6046430bfa6f89aa25afa5fba4046f2786f9a5eb4a844406198fc0e
|
||||||
.claude/skills/forge/references/sources.md: sha256:77b03bb128d339b056958fbe91c00bd16020ab89c5c0aca297eb1c3494874df8
|
.claude/skills/forge/references/sources.md: sha256:bf287c9070c2092bc328ae5c92ed3605901847a6aa8711cb804f9243cb567209
|
||||||
.claude/skills/forge/references/version-bump.md: sha256:8e6275fd5bc7f9ee1bfeea8b9cdecdd43eb1c838e9e499bba9a35b2a581885ec
|
.claude/skills/forge/references/version-bump.md: sha256:8e6275fd5bc7f9ee1bfeea8b9cdecdd43eb1c838e9e499bba9a35b2a581885ec
|
||||||
.claude/skills/instructions-author/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/instructions-author/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/instructions-author/SKILL.md: sha256:c3b00c42b0831ff292bd6616935bc3f0e7d6ec7be24961ccd52cc5a21d6a2145
|
.claude/skills/instructions-author/SKILL.md: sha256:cc0f06e9adf7f3610559d809d2709a17fcbe5ad08afd1b4a2abab3921c6ba273
|
||||||
.claude/skills/instructions-author/assets/README.md: sha256:f661694f81755f0a839434569edbcb28c544dc9f32bdec6f8db622e2f19b8e1e
|
.claude/skills/instructions-author/assets/README.md: sha256:f661694f81755f0a839434569edbcb28c544dc9f32bdec6f8db622e2f19b8e1e
|
||||||
.claude/skills/instructions-author/assets/templates/instructions.md: sha256:bd34264c24288ce4f8baac8febb41aff379f1141a41cca7c71a527fac28dea07
|
.claude/skills/instructions-author/assets/templates/instructions.md: sha256:808c494bc9e39e11919ac06276a76b9e6b470f174e1d0c1e5ae99cdb10773891
|
||||||
.claude/skills/instructions-author/references/content.md: sha256:62e9ad15c5e78d96b8f11dfe9c6e700d8032a13f855c4eca3ef3f4ba92c16fd8
|
.claude/skills/instructions-author/references/content.md: sha256:62e9ad15c5e78d96b8f11dfe9c6e700d8032a13f855c4eca3ef3f4ba92c16fd8
|
||||||
.claude/skills/instructions-author/references/create.md: sha256:ac1ca52ea450f58b7245830e8367fa1a89401963024b3a4d80b4dde169a0ef31
|
.claude/skills/instructions-author/references/create.md: sha256:2d5575b992ee2d20c4c9172c4211bef513343833b677ab6ffa435dc4c054c572
|
||||||
.claude/skills/instructions-author/references/improve.md: sha256:0bbeef069056ae2be02bb87e22a112f20e195b0736f7c1d80c106726e1942252
|
.claude/skills/instructions-author/references/improve.md: sha256:a202d998e8919f7904c80f7e8ff48849bc382b6273edeebb54ac2d43d40f2f1d
|
||||||
.claude/skills/instructions-author/references/schema.md: sha256:6cc0c7cee226ae0a794d65093f4dd9e2e19c9cea14be616ba252bcc957e04b9b
|
.claude/skills/instructions-author/references/schema.md: sha256:70baea540110336b232cf7246f6642eae2e245eb5b778495ea1c81e64cd089a8
|
||||||
.claude/skills/instructions-author/references/sources.md: sha256:ce16c0e62de3c99f74cfc259a2d8d7d99fde0f9f4830cf07ed2bfb2e520889c2
|
.claude/skills/instructions-author/references/sources.md: sha256:8698626b025ad01eb25dbdd99700397750774aac19185d41318210b55f68023d
|
||||||
.claude/skills/instructions-author/references/target-mapping.md: sha256:cc2b132ef7d72cac3f6abd2b8aa1feb48edda7c7bbb219b8abc953995b21877b
|
.claude/skills/instructions-author/references/target-mapping.md: sha256:70248f44d19ed5a566af1fd6262ab0378483f9f7da7795f89f81203b37f602c8
|
||||||
.claude/skills/instructions-author/references/verify.md: sha256:4314b25d7b7ff036684f2ab3ceb96c1b13bd0705be04f3e888d15b2e0690f02c
|
.claude/skills/instructions-author/references/verify.md: sha256:42ee7a18494f0690a191edf86a5769f77414ecd3cede5477d56d2ae603ddb3de
|
||||||
.claude/skills/instructions-author/scripts/README.md: sha256:c407aa61e93451956d0d6ee00a5dcca51f301ae9cdfa6d7d0ec63e89e8219874
|
.claude/skills/instructions-author/scripts/README.md: sha256:c407aa61e93451956d0d6ee00a5dcca51f301ae9cdfa6d7d0ec63e89e8219874
|
||||||
.claude/skills/instructions-author/scripts/new-instructions.sh: sha256:d914dc304fbb8f56cf71375e631ffdc868b2d2f5a91b566a11e1aa79a23c97e1
|
.claude/skills/instructions-author/scripts/new-instructions.sh: sha256:d914dc304fbb8f56cf71375e631ffdc868b2d2f5a91b566a11e1aa79a23c97e1
|
||||||
.claude/skills/instructions-author/tests/README.md: sha256:4637a0a171cf515e5bc9163682e1951b54fd41fd37927b19c3b8e0e464752885
|
.claude/skills/instructions-author/tests/README.md: sha256:4ed182558fde1dec432f80f38e9d9810f5e6857731b24c7166bfbfd59c0c0aa8
|
||||||
.claude/skills/instructions-author/tests/new-instructions.bats: sha256:ae34a57d331379990fc0b72396819497f973c3fa0a52016a99e9db4173ff2036
|
.claude/skills/instructions-author/tests/new-instructions.bats: sha256:be168768d1f2abd62f4c810e0592f86d3bf2c1533d7cd56588fb2b1b876ecbda
|
||||||
.claude/skills/prompt-author/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
.claude/skills/prompt-author/LICENSE: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
.claude/skills/prompt-author/SKILL.md: sha256:9d772ba7e35451eb8602f11a79ab9042582ae2514082193deb26161bdbe51ff0
|
.claude/skills/prompt-author/SKILL.md: sha256:c3cd5ebce0d364150c85b71ba7b848e4e5d710e0872fe2a31bb48e368c28dde8
|
||||||
.claude/skills/prompt-author/assets/README.md: sha256:8825773a7c8c388774fa4fc94d275bebada649cbc1c23af00477b02c5d07e48a
|
.claude/skills/prompt-author/assets/README.md: sha256:8825773a7c8c388774fa4fc94d275bebada649cbc1c23af00477b02c5d07e48a
|
||||||
.claude/skills/prompt-author/assets/templates/prompt.md: sha256:f2ec5fafcde549e503f497af7a64f1aee2d82ea842995a7e1ec5400ec6c105c8
|
.claude/skills/prompt-author/assets/templates/prompt.md: sha256:25449e1bbda461503295ffc0b19cdf5f7d7971c162b03e78368b92177749368b
|
||||||
.claude/skills/prompt-author/references/content.md: sha256:caee9c72f3ad61d933190b770983187689c3cffca7700c2fa27666178f59e43a
|
.claude/skills/prompt-author/references/content.md: sha256:caee9c72f3ad61d933190b770983187689c3cffca7700c2fa27666178f59e43a
|
||||||
.claude/skills/prompt-author/references/create.md: sha256:e552bcf8347d599c80603680fa39aeecc63c806c2df38a81a0647ea6ecea0512
|
.claude/skills/prompt-author/references/create.md: sha256:090aac699825ff41b8fd017140b271134900b29a358bb1608f600df0bd6a117f
|
||||||
.claude/skills/prompt-author/references/improve.md: sha256:fb830bdd8af6f99ff1cb946bb83888a4afdbdc3810e8cbc88437599b1bc313fb
|
.claude/skills/prompt-author/references/improve.md: sha256:f3c8b5e0f010bc952cc2d64e908327302a79b09ba0452943569a2d836466b10a
|
||||||
.claude/skills/prompt-author/references/schema.md: sha256:6bdf4311878583b869b7d4b164c1e9cc8f8c7a2a578a30dabfd33a0afbf88ac5
|
.claude/skills/prompt-author/references/schema.md: sha256:e578e5e747e1adad70fe5d4cf330d1c6b86dc2616715b79f6c1730cb6ea0955f
|
||||||
.claude/skills/prompt-author/references/sources.md: sha256:f465df6f1a7cb548f1c313bdddf237c8dd993374253286af53c42d86b98918c5
|
.claude/skills/prompt-author/references/sources.md: sha256:8bec78b627a1d490e27a65c289f612fb108d3d1bac2ed53bcd4152b29a4c303d
|
||||||
.claude/skills/prompt-author/references/target-mapping.md: sha256:a1b30f19f565ef701c680b11bd94c7a813dd1899acf17ce109bd35279e5ff204
|
.claude/skills/prompt-author/references/target-mapping.md: sha256:e535f2e166b87798dbaf353f7a3076b736b195f94b9c7969409dfea2a7e531fd
|
||||||
.claude/skills/prompt-author/references/verify.md: sha256:11175c3cecbd11f9a940de62c646c54234789c4e46ebd69ecd20a9d6bd9b4874
|
.claude/skills/prompt-author/references/verify.md: sha256:da80855b36ff07003ffe5cda6a6e3a3be7fe75f92480a597fd921261675ba834
|
||||||
.claude/skills/prompt-author/scripts/README.md: sha256:9f6bdbf2ea24ba764cd8791d128e2593e4c2eb96802faa667ea9d6af018fadf7
|
.claude/skills/prompt-author/scripts/README.md: sha256:9f6bdbf2ea24ba764cd8791d128e2593e4c2eb96802faa667ea9d6af018fadf7
|
||||||
.claude/skills/prompt-author/scripts/new-prompt.sh: sha256:f5f0fc5cc3dedf23ea754b2620b56a808cd65f1714144ec04ea797bd25340dcd
|
.claude/skills/prompt-author/scripts/new-prompt.sh: sha256:f5f0fc5cc3dedf23ea754b2620b56a808cd65f1714144ec04ea797bd25340dcd
|
||||||
.claude/skills/prompt-author/tests/README.md: sha256:975f6940b83a8f9650656a7acdab870289031d91db74d4ab74da298b3df01bbd
|
.claude/skills/prompt-author/tests/README.md: sha256:975f6940b83a8f9650656a7acdab870289031d91db74d4ab74da298b3df01bbd
|
||||||
@@ -899,7 +904,7 @@ dependencies:
|
|||||||
.claude/skills/skill-author/scripts/new-skill.sh: sha256:a7e99f04da68230372ca8b14da8c5e6a4a035efdd5d10d9c77e2e8c92da85c35
|
.claude/skills/skill-author/scripts/new-skill.sh: sha256:a7e99f04da68230372ca8b14da8c5e6a4a035efdd5d10d9c77e2e8c92da85c35
|
||||||
.claude/skills/skill-author/tests/README.md: sha256:81d301b04a489d5340234948188ff96466c3c3ab7f20a88ec2e570d1434a7b8c
|
.claude/skills/skill-author/tests/README.md: sha256:81d301b04a489d5340234948188ff96466c3c3ab7f20a88ec2e570d1434a7b8c
|
||||||
.claude/skills/skill-author/tests/new-skill.bats: sha256:105d6fb09203f84a17a040b1fc91a674313c1dafcd4ddd0d267b36795c22d410
|
.claude/skills/skill-author/tests/new-skill.bats: sha256:105d6fb09203f84a17a040b1fc91a674313c1dafcd4ddd0d267b36795c22d410
|
||||||
content_hash: sha256:06daf8d14852025eca1bb528105d8cbd5b1ec091f8040754a5afcc91ca66763c
|
content_hash: sha256:afd91f772288434d07511463f36877daf63e4240929c28a33bba727fcb3aaddc
|
||||||
package_targets:
|
package_targets:
|
||||||
- claude
|
- claude
|
||||||
- codex
|
- codex
|
||||||
@@ -943,7 +948,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: lint
|
name: lint
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 1.1.9
|
version: 1.1.9
|
||||||
virtual_path: plugins/lint
|
virtual_path: plugins/lint
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -989,7 +994,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: mattpocock
|
name: mattpocock
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 0.5.0
|
version: 0.5.0
|
||||||
virtual_path: plugins/mattpocock
|
virtual_path: plugins/mattpocock
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -1007,7 +1012,7 @@ dependencies:
|
|||||||
- repo_url: Mortis/Holocron
|
- repo_url: Mortis/Holocron
|
||||||
name: plan
|
name: plan
|
||||||
host: git.rkdr.net
|
host: git.rkdr.net
|
||||||
resolved_commit: feef6d8307362ebe6bbd8a42f26aa5e8ae955e09
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
version: 0.5.0
|
version: 0.5.0
|
||||||
virtual_path: plugins/plan
|
virtual_path: plugins/plan
|
||||||
is_virtual: true
|
is_virtual: true
|
||||||
@@ -1066,6 +1071,27 @@ dependencies:
|
|||||||
- path: LICENSE
|
- path: LICENSE
|
||||||
source: LICENSE
|
source: LICENSE
|
||||||
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
|
- repo_url: Mortis/Holocron
|
||||||
|
name: rtk
|
||||||
|
host: git.rkdr.net
|
||||||
|
resolved_commit: 0b04fa1e669620ca59662d3d129a682bbd1f96f0
|
||||||
|
version: 0.1.0
|
||||||
|
virtual_path: plugins/rtk
|
||||||
|
is_virtual: true
|
||||||
|
package_type: apm_package
|
||||||
|
deployed_files:
|
||||||
|
- .claude/hooks/rtk/.apm/hooks/route-through-rtk.sh
|
||||||
|
deployed_file_hashes:
|
||||||
|
.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh: sha256:55f323f2349748e0d99051d5a6e592ea5c6e9b1e48ca2e8a6377885ab665f562
|
||||||
|
content_hash: sha256:0f258821b61a9d6712a65bcbeeabade2bf899c3dfd82bf695586f7b82d88eae1
|
||||||
|
package_targets:
|
||||||
|
- claude
|
||||||
|
declared_license: MIT
|
||||||
|
carried_licenses:
|
||||||
|
- path: LICENSE
|
||||||
|
source: LICENSE
|
||||||
|
hash: sha256:9d3692e6b35e0e43b81e096352f11c6b884e7004d78d3dcd92768232c6704525
|
||||||
|
exec_status: deployed
|
||||||
- repo_url: fluxcd/agent-skills
|
- repo_url: fluxcd/agent-skills
|
||||||
name: gitops-knowledge
|
name: gitops-knowledge
|
||||||
host: github.com
|
host: github.com
|
||||||
@@ -1795,7 +1821,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:7c4b7efb58ecdd26fea835613d0f7f909706607cac4f002a0df2db2a3a0ee477
|
content_hash: sha256:89e9a5332907e8c32d0c903dfab5bcf5408aac985c98627cf5247b2a24c924a7
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/agents/delivery-implement-lead.md
|
value: .claude/agents/delivery-implement-lead.md
|
||||||
@@ -1949,6 +1975,15 @@ deployments:
|
|||||||
- git.rkdr.net/Mortis/Holocron/plugins/delivery
|
- git.rkdr.net/Mortis/Holocron/plugins/delivery
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/delivery
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/delivery
|
||||||
content_hash: sha256:2b84958d8d2ab1c3a17e8857d9797e9535b25a8c36b40cc9d34537df0c4a446b
|
content_hash: sha256:2b84958d8d2ab1c3a17e8857d9797e9535b25a8c36b40cc9d34537df0c4a446b
|
||||||
|
- kind: project-relative
|
||||||
|
target: claude
|
||||||
|
value: .claude/hooks/git/.apm/hooks/refuse-push-to-main.py
|
||||||
|
runtime: null
|
||||||
|
scope: project
|
||||||
|
owners:
|
||||||
|
- git.rkdr.net/Mortis/Holocron/plugins/git
|
||||||
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/git
|
||||||
|
content_hash: sha256:2a8b9c3e53e1c1d388c254aa65f66632315eb4a289b25e8ef1a3008bf08513f9
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/hooks/kyberforge/.apm/hooks/check-apm-current.sh
|
value: .claude/hooks/kyberforge/.apm/hooks/check-apm-current.sh
|
||||||
@@ -1958,6 +1993,15 @@ deployments:
|
|||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:30d9160d25eb712fe7a4d206d12c3779cf13725ccba2f09843713a6f3ebe9ca4
|
content_hash: sha256:30d9160d25eb712fe7a4d206d12c3779cf13725ccba2f09843713a6f3ebe9ca4
|
||||||
|
- kind: project-relative
|
||||||
|
target: claude
|
||||||
|
value: .claude/hooks/rtk/.apm/hooks/route-through-rtk.sh
|
||||||
|
runtime: null
|
||||||
|
scope: project
|
||||||
|
owners:
|
||||||
|
- git.rkdr.net/Mortis/Holocron/plugins/rtk
|
||||||
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/rtk
|
||||||
|
content_hash: sha256:55f323f2349748e0d99051d5a6e592ea5c6e9b1e48ca2e8a6377885ab665f562
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/agent-author
|
value: .claude/skills/agent-author
|
||||||
@@ -2308,7 +2352,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:2d4c1ac4a7f68f79ba4c84b7be94addd4452827c71dda3f465a4454f36047c74
|
content_hash: sha256:a007ebb9c6e5526aec9b8278987d6863b4fee9a16ab62f64bc7d45965251eac0
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-install/references/sources.md
|
value: .claude/skills/apm-install/references/sources.md
|
||||||
@@ -2317,7 +2361,16 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:b80245ff8ae179d458572cb9b03621d00bf7e2f052f0cd71b88112c0ea8a91ce
|
content_hash: sha256:4010e5711cbc502e5059f502c6f607d2726a1a1183a280321f42352b2b279fa8
|
||||||
|
- kind: project-relative
|
||||||
|
target: claude
|
||||||
|
value: .claude/skills/apm-install/references/uv-pin.md
|
||||||
|
runtime: null
|
||||||
|
scope: project
|
||||||
|
owners:
|
||||||
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
|
content_hash: sha256:9c8c936dfa275d584ef3749ad7d98d46a3553fda8e7356fa6cb74baa76ee4054
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-workflow
|
value: .claude/skills/apm-workflow
|
||||||
@@ -2344,7 +2397,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:96c90f05891a669b05ccb5d33638d0bee6231d7251cddfedc84ea337617c530e
|
content_hash: sha256:f9f2023185e9ca846835d66b91a3f8777de2f0a186e3db51922bae70ce2b9233
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-workflow/references/audit.md
|
value: .claude/skills/apm-workflow/references/audit.md
|
||||||
@@ -2353,7 +2406,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:9b3fe128cbe133c8f2880a968b4cd6e875cc0eb79ef6738a9bfdabdf28446fe2
|
content_hash: sha256:fbe286392114c3a34ad59b9da13099176c97ff04184834408755791697c1c9c4
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-workflow/references/compile.md
|
value: .claude/skills/apm-workflow/references/compile.md
|
||||||
@@ -2362,7 +2415,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:9c7b50645c7da1b442263eb7fd45eb11da09a6356f0f8be65a5b1eb1510f4b53
|
content_hash: sha256:ef2827e42ab2573b87dbf01a0e6ce0b6993ab03f97ce8d9ebcec53d1af66841e
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-workflow/references/configure.md
|
value: .claude/skills/apm-workflow/references/configure.md
|
||||||
@@ -2371,7 +2424,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:7633f1cbdaa01d2e889ff114ea67d4e7f0d7d9f41ef77aa21156a6226a04ffc7
|
content_hash: sha256:bbb2d903ff1e7dc353c7bc100472010d8c1c0ee41326c46f1002ccc531b4ecd8
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-workflow/references/install.md
|
value: .claude/skills/apm-workflow/references/install.md
|
||||||
@@ -2389,7 +2442,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:1ed67d9a7bb241d2050c7ad4b45799a936ea4df480e8fecbdf69bb1f9eef7211
|
content_hash: sha256:23be8060f3831f91c1e30e7ac3f36fabfd9faf9cd991f3fa665000a7c2348e77
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/apm-workflow/references/sources.md
|
value: .claude/skills/apm-workflow/references/sources.md
|
||||||
@@ -2398,7 +2451,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:4ae44a9e82e8ec3bd4b1a61f32adbd3f3ff5fab21db3b4162765b2c0553e49fd
|
content_hash: sha256:05f8c11cd75d3c4a0949be19c63f23389fbe10e89015ce16dc9e7225964e4d12
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/caveman
|
value: .claude/skills/caveman
|
||||||
@@ -3451,7 +3504,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:562249dd1a0a2632e2b5bdeac864a6cdc6ab33a2d05a59ed1fb1fb919a42ee98
|
content_hash: sha256:cac9e59ddb27305698c946d7859a8d34dc331b0edba8a63f10c93595bfdc6e80
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/forge/references/apm-routes.md
|
value: .claude/skills/forge/references/apm-routes.md
|
||||||
@@ -3469,7 +3522,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:cfbc0502a60d1f444c2e5e76a392329cfa92b1ec51d1f365cc0772312e064a4d
|
content_hash: sha256:110bae34e6046430bfa6f89aa25afa5fba4046f2786f9a5eb4a844406198fc0e
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/forge/references/sources.md
|
value: .claude/skills/forge/references/sources.md
|
||||||
@@ -3478,7 +3531,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:77b03bb128d339b056958fbe91c00bd16020ab89c5c0aca297eb1c3494874df8
|
content_hash: sha256:bf287c9070c2092bc328ae5c92ed3605901847a6aa8711cb804f9243cb567209
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/forge/references/version-bump.md
|
value: .claude/skills/forge/references/version-bump.md
|
||||||
@@ -5269,7 +5322,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:c3b00c42b0831ff292bd6616935bc3f0e7d6ec7be24961ccd52cc5a21d6a2145
|
content_hash: sha256:cc0f06e9adf7f3610559d809d2709a17fcbe5ad08afd1b4a2abab3921c6ba273
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/assets/README.md
|
value: .claude/skills/instructions-author/assets/README.md
|
||||||
@@ -5287,7 +5340,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:bd34264c24288ce4f8baac8febb41aff379f1141a41cca7c71a527fac28dea07
|
content_hash: sha256:808c494bc9e39e11919ac06276a76b9e6b470f174e1d0c1e5ae99cdb10773891
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/references/content.md
|
value: .claude/skills/instructions-author/references/content.md
|
||||||
@@ -5305,7 +5358,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:ac1ca52ea450f58b7245830e8367fa1a89401963024b3a4d80b4dde169a0ef31
|
content_hash: sha256:2d5575b992ee2d20c4c9172c4211bef513343833b677ab6ffa435dc4c054c572
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/references/improve.md
|
value: .claude/skills/instructions-author/references/improve.md
|
||||||
@@ -5314,7 +5367,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:0bbeef069056ae2be02bb87e22a112f20e195b0736f7c1d80c106726e1942252
|
content_hash: sha256:a202d998e8919f7904c80f7e8ff48849bc382b6273edeebb54ac2d43d40f2f1d
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/references/schema.md
|
value: .claude/skills/instructions-author/references/schema.md
|
||||||
@@ -5323,7 +5376,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:6cc0c7cee226ae0a794d65093f4dd9e2e19c9cea14be616ba252bcc957e04b9b
|
content_hash: sha256:70baea540110336b232cf7246f6642eae2e245eb5b778495ea1c81e64cd089a8
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/references/sources.md
|
value: .claude/skills/instructions-author/references/sources.md
|
||||||
@@ -5332,7 +5385,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:ce16c0e62de3c99f74cfc259a2d8d7d99fde0f9f4830cf07ed2bfb2e520889c2
|
content_hash: sha256:8698626b025ad01eb25dbdd99700397750774aac19185d41318210b55f68023d
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/references/target-mapping.md
|
value: .claude/skills/instructions-author/references/target-mapping.md
|
||||||
@@ -5341,7 +5394,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:cc2b132ef7d72cac3f6abd2b8aa1feb48edda7c7bbb219b8abc953995b21877b
|
content_hash: sha256:70248f44d19ed5a566af1fd6262ab0378483f9f7da7795f89f81203b37f602c8
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/references/verify.md
|
value: .claude/skills/instructions-author/references/verify.md
|
||||||
@@ -5350,7 +5403,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:4314b25d7b7ff036684f2ab3ceb96c1b13bd0705be04f3e888d15b2e0690f02c
|
content_hash: sha256:42ee7a18494f0690a191edf86a5769f77414ecd3cede5477d56d2ae603ddb3de
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/scripts/README.md
|
value: .claude/skills/instructions-author/scripts/README.md
|
||||||
@@ -5377,7 +5430,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:4637a0a171cf515e5bc9163682e1951b54fd41fd37927b19c3b8e0e464752885
|
content_hash: sha256:4ed182558fde1dec432f80f38e9d9810f5e6857731b24c7166bfbfd59c0c0aa8
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/instructions-author/tests/new-instructions.bats
|
value: .claude/skills/instructions-author/tests/new-instructions.bats
|
||||||
@@ -5386,7 +5439,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:ae34a57d331379990fc0b72396819497f973c3fa0a52016a99e9db4173ff2036
|
content_hash: sha256:be168768d1f2abd62f4c810e0592f86d3bf2c1533d7cd56588fb2b1b876ecbda
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/k8s-diagnose
|
value: .claude/skills/k8s-diagnose
|
||||||
@@ -5620,7 +5673,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:9d772ba7e35451eb8602f11a79ab9042582ae2514082193deb26161bdbe51ff0
|
content_hash: sha256:c3cd5ebce0d364150c85b71ba7b848e4e5d710e0872fe2a31bb48e368c28dde8
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/assets/README.md
|
value: .claude/skills/prompt-author/assets/README.md
|
||||||
@@ -5638,7 +5691,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:f2ec5fafcde549e503f497af7a64f1aee2d82ea842995a7e1ec5400ec6c105c8
|
content_hash: sha256:25449e1bbda461503295ffc0b19cdf5f7d7971c162b03e78368b92177749368b
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/references/content.md
|
value: .claude/skills/prompt-author/references/content.md
|
||||||
@@ -5656,7 +5709,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:e552bcf8347d599c80603680fa39aeecc63c806c2df38a81a0647ea6ecea0512
|
content_hash: sha256:090aac699825ff41b8fd017140b271134900b29a358bb1608f600df0bd6a117f
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/references/improve.md
|
value: .claude/skills/prompt-author/references/improve.md
|
||||||
@@ -5665,7 +5718,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:fb830bdd8af6f99ff1cb946bb83888a4afdbdc3810e8cbc88437599b1bc313fb
|
content_hash: sha256:f3c8b5e0f010bc952cc2d64e908327302a79b09ba0452943569a2d836466b10a
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/references/schema.md
|
value: .claude/skills/prompt-author/references/schema.md
|
||||||
@@ -5674,7 +5727,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:6bdf4311878583b869b7d4b164c1e9cc8f8c7a2a578a30dabfd33a0afbf88ac5
|
content_hash: sha256:e578e5e747e1adad70fe5d4cf330d1c6b86dc2616715b79f6c1730cb6ea0955f
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/references/sources.md
|
value: .claude/skills/prompt-author/references/sources.md
|
||||||
@@ -5683,7 +5736,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:f465df6f1a7cb548f1c313bdddf237c8dd993374253286af53c42d86b98918c5
|
content_hash: sha256:8bec78b627a1d490e27a65c289f612fb108d3d1bac2ed53bcd4152b29a4c303d
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/references/target-mapping.md
|
value: .claude/skills/prompt-author/references/target-mapping.md
|
||||||
@@ -5692,7 +5745,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:a1b30f19f565ef701c680b11bd94c7a813dd1899acf17ce109bd35279e5ff204
|
content_hash: sha256:e535f2e166b87798dbaf353f7a3076b736b195f94b9c7969409dfea2a7e531fd
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/references/verify.md
|
value: .claude/skills/prompt-author/references/verify.md
|
||||||
@@ -5701,7 +5754,7 @@ deployments:
|
|||||||
owners:
|
owners:
|
||||||
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
- git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
active_owner: git.rkdr.net/Mortis/Holocron/plugins/kyberforge
|
||||||
content_hash: sha256:11175c3cecbd11f9a940de62c646c54234789c4e46ebd69ecd20a9d6bd9b4874
|
content_hash: sha256:da80855b36ff07003ffe5cda6a6e3a3be7fe75f92480a597fd921261675ba834
|
||||||
- kind: project-relative
|
- kind: project-relative
|
||||||
target: claude
|
target: claude
|
||||||
value: .claude/skills/prompt-author/scripts/README.md
|
value: .claude/skills/prompt-author/scripts/README.md
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: holocron
|
name: holocron
|
||||||
version: 0.9.2
|
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.
|
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|
||||||
@@ -51,6 +51,9 @@ dependencies:
|
|||||||
# Ticket and idea planning, up to an agent-ready spec and breakdown.
|
# Ticket and idea planning, up to an agent-ready spec and breakdown.
|
||||||
- git: https://git.rkdr.net/Mortis/Holocron.git
|
- git: https://git.rkdr.net/Mortis/Holocron.git
|
||||||
path: plugins/plan
|
path: plugins/plan
|
||||||
|
# Routes Bash tool calls through rtk when it is installed (#179).
|
||||||
|
- git: https://git.rkdr.net/Mortis/Holocron.git
|
||||||
|
path: plugins/rtk
|
||||||
mcp: []
|
mcp: []
|
||||||
|
|
||||||
# Turns apm's executable-trust gate ON. Without this block the gate is disabled
|
# Turns apm's executable-trust gate ON. Without this block the gate is disabled
|
||||||
@@ -79,12 +82,18 @@ dependencies:
|
|||||||
# remote (ADR-0019).
|
# remote (ADR-0019).
|
||||||
executables:
|
executables:
|
||||||
allow:
|
allow:
|
||||||
git.rkdr.net/Mortis/Holocron/plugins/kyberforge#2.3.1:
|
git.rkdr.net/Mortis/Holocron/plugins/kyberforge#2.3.2:
|
||||||
hooks: true
|
hooks: true
|
||||||
bin: true
|
bin: true
|
||||||
# delivery ships the guard hook (ADR-0032 enforcement layer 2). Same
|
# delivery ships the guard hook (ADR-0032 enforcement layer 2). Same
|
||||||
# full-identity, version-in-key convention as above, kept by the same check.
|
# 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.1:
|
||||||
|
hooks: true
|
||||||
|
# rtk ships the hook that routes Bash tool calls through rtk.
|
||||||
|
git.rkdr.net/Mortis/Holocron/plugins/rtk#0.1.0:
|
||||||
hooks: true
|
hooks: true
|
||||||
|
|
||||||
marketplace:
|
marketplace:
|
||||||
@@ -93,7 +102,7 @@ marketplace:
|
|||||||
# top-level apm.yml description:/version: above are NOT inherited into the
|
# top-level apm.yml description:/version: above are NOT inherited into the
|
||||||
# compiled output despite being used elsewhere (e.g. by `apm audit`).
|
# 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.
|
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
|
||||||
version: 0.9.2
|
version: 0.9.4
|
||||||
owner:
|
owner:
|
||||||
name: Mortis
|
name: Mortis
|
||||||
url: https://git.rkdr.net/Mortis/
|
url: https://git.rkdr.net/Mortis/
|
||||||
@@ -164,3 +173,7 @@ marketplace:
|
|||||||
- name: plan
|
- name: plan
|
||||||
source: ./plugins/plan
|
source: ./plugins/plan
|
||||||
category: Productivity
|
category: Productivity
|
||||||
|
|
||||||
|
- name: rtk
|
||||||
|
source: ./plugins/rtk
|
||||||
|
category: Developer Tools
|
||||||
@@ -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
|
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
|
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.
|
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.
|
||||||
@@ -2,6 +2,22 @@
|
|||||||
|
|
||||||
**Status:** Accepted (2026-09-20)
|
**Status:** Accepted (2026-09-20)
|
||||||
|
|
||||||
|
*Amended 2026-12-06 ([rtk routing hook](https://git.rkdr.net/Mortis/Holocron/issues/179)): "the root
|
||||||
|
manifest is never waived" below now holds for `lockfile-exists` only. The root has one narrow
|
||||||
|
waiver: `ref-consistency` for a plugin not yet on `origin/main`. Root `apm.yml`'s first-party
|
||||||
|
dependencies resolve from the remote's `main` (ADR-0019), so the lock cannot record a plugin before it
|
||||||
|
lands. `check-executables-allow-sync` meanwhile requires a hook- or bin-shipping plugin's git+path
|
||||||
|
entry before it can be pushed, so without the waiver such a plugin could never land. The waiver applies
|
||||||
|
only when all of these hold: the output reads `1 of 3 check(s) failed` and its one failing row is
|
||||||
|
`ref-consistency`; the details block appears exactly once and every line in it is `<identity>/plugins/<name>: not found
|
||||||
|
in lockfile`, for root `apm.yml`'s own entry and a name that starts alphanumeric and holds no `..`;
|
||||||
|
`plugins/<name>/apm.yml` is in the working tree and absent from the local `origin/main`, which must
|
||||||
|
resolve. On apm 0.39.3 a failing `ref-consistency` stops the root run after three checks, so the hook then
|
||||||
|
re-runs `apm audit --ci` on a scratch copy of the tree with those plugins' `dependencies.apm` entries
|
||||||
|
removed, and the push passes only if that run reports `All 15 check(s) passed`. The working tree is
|
||||||
|
never written. The waiver lapses for each plugin once it is on `origin/main`, when the follow-up PR that
|
||||||
|
records it in the lock is required.*
|
||||||
|
|
||||||
*Amended 2026-12-02 (holocron#272): re-verified on apm 0.39.3 in a scratch copy of
|
*Amended 2026-12-02 (holocron#272): re-verified on apm 0.39.3 in a scratch copy of
|
||||||
`plugins/mattpocock`. Without a package lock, the same line and `1 of 1 check(s) failed` appear, so
|
`plugins/mattpocock`. Without a package lock, the same line and `1 of 1 check(s) failed` appear, so
|
||||||
the waiver is unchanged. With one from `apm lock`, the rest of the root set arms (fourteen more
|
the waiver is unchanged. With one from `apm lock`, the rest of the root set arms (fourteen more
|
||||||
|
|||||||
@@ -127,6 +127,14 @@ passed. Failed tasks are shown in the PR comment for the approver to judge. Deci
|
|||||||
cluster or state and print no secret: anything not on the list is denied, so an unlisted mutating
|
cluster or state and print no secret: anything not on the list is denied, so an unlisted mutating
|
||||||
subcommand fails safe. Codex cannot ask, so odd jobs are
|
subcommand fails safe. Codex cannot ask, so odd jobs are
|
||||||
denied there; an unrecognised runtime is treated the same way.
|
denied there; an unrecognised runtime is treated the same way.
|
||||||
|
- *Amended 2026-12-05 ([rtk routing hook](https://git.rkdr.net/Mortis/Holocron/issues/179)): the
|
||||||
|
opt-in `rtk` plugin ships a Claude Code hook that rewrites Bash commands through `rtk hook claude`
|
||||||
|
and may return `permissionDecision: allow`, skipping the permission prompt. Accepted, because hooks
|
||||||
|
are guardrails, not the boundary; `git`'s push guard still sees `rtk git push`, as `rtk` is one of
|
||||||
|
its wrappers.*
|
||||||
|
- *Amended 2026-12-04 ([git push-to-main hook](https://git.rkdr.net/Mortis/Holocron/issues/178)): `git`
|
||||||
|
ships its own guardrail hook beside `delivery`'s, refusing a `git push` to `main` on Claude Code
|
||||||
|
only. It fails open and has an opt-out; branch protection stays the real control.*
|
||||||
- *Amended 2026-11-25 ([Pre-merge Ansible dry run without exposing production credentials](https://git.rkdr.net/Mortis/Holocron/issues/200)):
|
- *Amended 2026-11-25 ([Pre-merge Ansible dry run without exposing production credentials](https://git.rkdr.net/Mortis/Holocron/issues/200)):
|
||||||
the reopened Ansible `--check --diff` now runs in CI from the base branch's copy with production
|
the reopened Ansible `--check --diff` now runs in CI from the base branch's copy with production
|
||||||
credentials — automatic on human-authored PRs, gated on bot PRs by an allowlisted human's
|
credentials — automatic on human-authored PRs, gated on bot PRs by an allowlisted human's
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
# Bundled Claude Code skills are turned off at user level
|
||||||
|
|
||||||
|
**Status: accepted (2026-12-03), amended 2026-12-06 (#286).**
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
Issue #266. Claude Code ships bundled skills and syncs skills from the claude.ai account, and the
|
||||||
|
operator wants only this repo's plugin skills. Claude Code 2.1.334 has no allowlist: a skill missing
|
||||||
|
from `skillOverrides` is on, and `Skill(x)` allow rules do not restrict other skills. The operator
|
||||||
|
wanted a setting that also covers bundled skills added later. A custom `/ship` is also not loaded
|
||||||
|
where the built-in one is available.
|
||||||
|
|
||||||
|
On Claude Code 2.1.337 the switch does not cover built-in plugins (`cc-plugin-*@builtin`). Their
|
||||||
|
skills `design`, `doctor` and `plugin-authoring` still load, and so do their tools (#286).
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
**Bundled skills are turned off with one switch; built-in plugin skills need a per-name list.** The
|
||||||
|
settings live at user level in `providers/claude-code/settings.json`, which `scripts/install.sh` deploys to
|
||||||
|
`~/.claude/settings.json`:
|
||||||
|
|
||||||
|
- `disableBundledSkills: true`
|
||||||
|
- `syncClaudeAiSkills: false`
|
||||||
|
- `env.CLAUDE_CODE_DISABLE_SHIP: "1"`, the documented fix for the custom `/ship`.
|
||||||
|
- `skillOverrides.init: "off"`
|
||||||
|
- `skillOverrides` `design`, `doctor` and `plugin-authoring`: `"off"`, for the built-in plugin skills.
|
||||||
|
- `enabledPlugins`: `cc-plugin-easel@builtin` and `cc-plugin-plugin-authoring@builtin` set to `false`.
|
||||||
|
`cc-plugin-privacy`, `-agents-md`, `-telemetry` and `-verbs` stay on: they add no skills and their
|
||||||
|
behaviour has not been checked.
|
||||||
|
- `syncClaudeAiPlugins: false`, the plugin counterpart of `syncClaudeAiSkills`.
|
||||||
|
|
||||||
|
**A per-name `skillOverrides` blocklist is accepted for built-in plugin skills only**, because the
|
||||||
|
single switch does not reach them. Bundled skills stay under the switch. `enabledPlugins` lives in
|
||||||
|
this user-level file, so ADR-0018's ban on it in the project `.claude/settings.json` does not apply.
|
||||||
|
|
||||||
|
Holocron does not distribute these settings to consumer repos. User-level settings already apply to
|
||||||
|
every repo on the machine, and another machine needs its own `install.sh` run.
|
||||||
|
|
||||||
|
**`install.sh` must merge into an existing `~/.claude/settings.json` before these settings are
|
||||||
|
deployed.** It used to copy the file over, which would have dropped 11 of the operator's 13 top-level
|
||||||
|
keys. Done since: `scripts/merge-json.py` merges the file, and `tests/test-install.sh` covers it.
|
||||||
|
|
||||||
|
## Considered options
|
||||||
|
|
||||||
|
**A `skillOverrides` blocklist (rejected as the general mechanism).** It needs a new entry for each unwanted skill that ships.
|
||||||
|
It is now used for built-in plugin skills (#286), but is still rejected as the general mechanism.
|
||||||
|
|
||||||
|
**`skillOverrides` in the committed `.claude/settings.json`, as #266 proposed (rejected).** apm owns
|
||||||
|
that file and `apm audit --ci` fails on hand-added keys (AGENTS.md, ADR-0018, ADR-0019). apm 0.39.3
|
||||||
|
cannot write the key either.
|
||||||
|
|
||||||
|
**A PreToolUse hook on the Skill tool (rejected).** It can refuse a call but cannot hide a skill or
|
||||||
|
resolve a name collision.
|
||||||
|
|
||||||
|
**Turning off only the three unwanted synced skills in the claude.ai account (rejected).** The
|
||||||
|
operator chose to turn off all syncing.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
1. `simplify`, `loop`, `update-config` and `claude-api` are lost and cannot be re-enabled one by one
|
||||||
|
(tested).
|
||||||
|
2. All synced `anthropic-skills:*` are lost, including `pdf`, `docx`, `xlsx` and
|
||||||
|
`satisfactory-helper`. Claude Code moves the synced copies to `.trash`.
|
||||||
|
3. New built-in commands, as opposed to bundled skills, are not covered.
|
||||||
|
4. Each new built-in plugin skill needs its own `skillOverrides` entry.
|
||||||
|
5. The `cc-plugin-easel` chart tool and the `cc-plugin-plugin-authoring` `scan_secrets` MCP server are
|
||||||
|
lost.
|
||||||
|
|
||||||
|
## Evidence
|
||||||
|
|
||||||
|
- **Tested** in headless mode on Claude Code 2.1.334: the effect of `disableBundledSkills` on bundled
|
||||||
|
skills, and `skillOverrides.init: "off"`.
|
||||||
|
- **Documented, not tested:** that the custom `/ship` loads in an interactive session with
|
||||||
|
`CLAUDE_CODE_DISABLE_SHIP=1`.
|
||||||
|
- **From the docs only:** the `syncClaudeAiSkills` behaviour.
|
||||||
|
- **Tested** in headless mode on Claude Code 2.1.337, from the `init` event of
|
||||||
|
`claude -p … --output-format stream-json --verbose`: `skillOverrides` for `design`, `doctor` and
|
||||||
|
`plugin-authoring`, and `enabledPlugins` for the two plugins. Confirmed after `scripts/install.sh`:
|
||||||
|
the `init` event lists none of the three skills and only the four plugins kept on.
|
||||||
|
- **From the setting's description in the binary only:** the `syncClaudeAiPlugins` behaviour.
|
||||||
|
- Sources: code.claude.com/docs/en/settings-reference, `/skills` and `/ship-command-troubleshooting`.
|
||||||
|
|
||||||
|
Related: ADR-0018, ADR-0019; #266, #286.
|
||||||
@@ -13,9 +13,10 @@ project repo (local overrides)
|
|||||||
|
|
||||||
## Content deployment model
|
## Content deployment model
|
||||||
|
|
||||||
`scripts/install.sh` is a **deployer**, not a composer. It sources `scripts/deploy-manifest.sh` and deploys three categories:
|
`scripts/install.sh` is a **deployer**, not a composer, with one exception: user settings are merged, not copied. It sources `scripts/deploy-manifest.sh` and deploys four categories:
|
||||||
|
|
||||||
- **Files** (`DEPLOY_FILES`): `providers/claude-code/CLAUDE.md` → `~/.claude/CLAUDE.md`; `providers/claude-code/settings.json` → `~/.claude/settings.json`; `core/AGENTS.md` → `~/.agents/AGENTS.md`
|
- **Files** (`DEPLOY_FILES`): `providers/claude-code/CLAUDE.md` → `~/.claude/CLAUDE.md`; `core/AGENTS.md` → `~/.agents/AGENTS.md`
|
||||||
|
- **Merged JSON** (`DEPLOY_JSON_MERGES`): `providers/claude-code/settings.json` → `~/.claude/settings.json`. Settings only the user has are kept, including inside nested objects; where both set a value, the repo's wins, and arrays are replaced whole. Removing a setting from the repo does not remove it from a user's file. An existing file that is not a valid JSON object stops the install and is left untouched (ADR-0035)
|
||||||
- **Executables** (`DEPLOY_EXECUTABLES`): `providers/claude-code/statusline-command.sh` → `~/.claude/statusline-command.sh` (with `+x`)
|
- **Executables** (`DEPLOY_EXECUTABLES`): `providers/claude-code/statusline-command.sh` → `~/.claude/statusline-command.sh` (with `+x`)
|
||||||
- **Directories** (`DEPLOY_DIRS`): `core/` → `~/.claude/core/` (destination fully replaced on each deploy)
|
- **Directories** (`DEPLOY_DIRS`): `core/` → `~/.claude/core/` (destination fully replaced on each deploy)
|
||||||
|
|
||||||
|
|||||||
+53
-9
@@ -72,7 +72,7 @@ version-blind, so a stale key deploys fine (see [apm gates](#apm-gates)).
|
|||||||
|
|
||||||
| Hook | Guards |
|
| Hook | Guards |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `apm-audit-ci` | `scripts/apm-audit-ci.sh` — `apm audit --ci` once per manifest, root plus each plugin package under `plugins/`, waiving only a package's `lockfile-exists` (see [below](#apm-audit-ci)) |
|
| `apm-audit-ci` | `scripts/apm-audit-ci.sh` — `apm audit --ci` once per manifest, root plus each plugin package under `plugins/`, waiving only a package's `lockfile-exists` and the root's `ref-consistency` for a plugin not yet on `origin/main` (see [below](#apm-audit-ci)) |
|
||||||
| `apm-pack-check-clean` | `scripts/apm-pack-check-clean.sh` — `apm pack --check-versions --check-clean --dry-run` with a scrubbed git env (see [`apm-audit-ci`](#apm-audit-ci)) — the compiled marketplace still matches what `apm.yml` + `.apm/` would generate, and per-package versions agree with the `per_package` strategy |
|
| `apm-pack-check-clean` | `scripts/apm-pack-check-clean.sh` — `apm pack --check-versions --check-clean --dry-run` with a scrubbed git env (see [`apm-audit-ci`](#apm-audit-ci)) — the compiled marketplace still matches what `apm.yml` + `.apm/` would generate, and per-package versions agree with the `per_package` strategy |
|
||||||
|
|
||||||
**Host validators** (needs the `claude` CLI on PATH)
|
**Host validators** (needs the `claude` CLI on PATH)
|
||||||
@@ -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.
|
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
|
**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
|
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
|
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.
|
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
|
### The clause-3 opt-out
|
||||||
|
|
||||||
A command that is deliberately bare — because rtk rewrites the output the skill parses, or because
|
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
|
the command is interactive — is exempted by putting the marker `rtk-bare:` and its reason **on the
|
||||||
line**: in a shell comment for a code line, in the cell text for a table row.
|
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
|
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
|
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
|
silently disarm every checked line around the marked one. The cost is a repeated `# rtk-bare:` in
|
||||||
ADR-0023` in the three blocks of `git-log-format.md` where every line is deliberately bare; that
|
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.
|
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
|
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.
|
boundary, and a stricter form would only move the same trust to a different string.
|
||||||
|
|
||||||
@@ -1232,7 +1234,48 @@ The cause is that apm treats any directory holding both `apm.yml` and `apm.lock.
|
|||||||
root**, and a plugin package is not one. `scripts/apm-audit-ci.sh` therefore waives `lockfile-exists`
|
root**, and a plugin package is not one. `scripts/apm-audit-ci.sh` therefore waives `lockfile-exists`
|
||||||
and nothing else, and only for a non-root manifest: it asserts the string `1 of 1 check(s) failed`,
|
and nothing else, and only for a non-root manifest: it asserts the string `1 of 1 check(s) failed`,
|
||||||
so any second failing check changes the count and the run fails normally, and output it does not
|
so any second failing check changes the count and the run fails normally, and output it does not
|
||||||
recognise fails closed. The root manifest is never waived. Recorded as ADR-0026.
|
recognise fails closed. The root manifest is never waived for `lockfile-exists`. Recorded as ADR-0026.
|
||||||
|
|
||||||
|
**The root has one waiver of its own: `ref-consistency` for a plugin not yet on `origin/main`.**
|
||||||
|
Root `apm.yml`'s first-party dependencies resolve from the remote's `main` (ADR-0019), so the lock
|
||||||
|
cannot record a plugin before it lands, while `check-executables-allow-sync` refuses a push of a
|
||||||
|
hook- or bin-shipping plugin whose git+path entry is missing from root `apm.yml`. Without a waiver a
|
||||||
|
first-landing executable-shipping plugin is unpushable: root `ref-consistency` fails with
|
||||||
|
`<identity>/plugins/<name>: not found in lockfile`. On apm 0.39.3 a failing `ref-consistency` cuts
|
||||||
|
the root run to three checks (holocron#179), so the hook waives it only when the output reads `1 of
|
||||||
|
3 check(s) failed`, the one failing row is `ref-consistency`, and every line of its details block is
|
||||||
|
that `not found in lockfile` form for an identity equal to root `apm.yml`'s own git+path entry for
|
||||||
|
`plugins/<name>` (derived by `check-executables-allow-sync`'s rule). Each `plugins/<name>/apm.yml`
|
||||||
|
must also exist in the working tree and be absent from the **local** `origin/main`, which must
|
||||||
|
resolve; nothing is fetched. A plugin name must start with a letter or digit and may not contain
|
||||||
|
`..`. Any other output fails closed. The waiver lapses for a plugin by itself: once it is on
|
||||||
|
`origin/main`, the follow-up PR that records it in the lock is required. Because the hook reads
|
||||||
|
only the local `origin/main` ref, a stale or unfetched one keeps the waiver alive after the plugin
|
||||||
|
has landed. That fails safe: the waiver still requires the full 15-check re-run below to pass, so
|
||||||
|
it waives only the `not found in lockfile` rows. `git fetch` refreshes the ref and ends the waiver.
|
||||||
|
|
||||||
|
**The waiver re-runs the full root check set before it passes.** The cut-short run never reaches the
|
||||||
|
other twelve root checks (`content-integrity`, `hook-approval-pins`, `local-bundle-hooks`,
|
||||||
|
`exec-status-current`, `deployed-files-present` and the rest), so the three-check result alone
|
||||||
|
would let a defect in any of them through. Once the conditions above hold, the hook copies the working
|
||||||
|
tree (minus `.git`, `.venv` and `.claude/worktrees`) into a `mktemp -d` directory with `tar`. In the
|
||||||
|
copy it drops only the `dependencies:` > `apm:` items whose `path:` names a waived plugin, checks
|
||||||
|
that the reduced `apm.yml` differs from the original by those deletions alone and that no entry for
|
||||||
|
a waived plugin survived, and runs `git init`. It gives that repo the git state apm reads: the
|
||||||
|
same `origin` URL, for org-policy discovery, and a copy of the real repo's `info/exclude` (from
|
||||||
|
`git rev-parse --git-path info/exclude`, so a linked worktree's shared one), which
|
||||||
|
`deployed-files-present` consults through `git check-ignore`. It then runs `apm audit --ci` there. The push passes only
|
||||||
|
if that run exits 0 and prints `All 15 check(s) passed`. On this branch (holocron#179, apm 0.39.3) it
|
||||||
|
does, and the hook prints `root re-run without the unlanded plugins: All 15 check(s) passed`. A copy
|
||||||
|
was chosen over swapping `apm.yml` in place under a `trap`: the copy never writes the working tree, so
|
||||||
|
the tree stays byte-identical even after `SIGKILL`, and a concurrent apm never sees a reduced
|
||||||
|
manifest. `.git` is not copied because in a linked worktree it points into the shared gitdir. `.venv`
|
||||||
|
is not copied because apm runs from the real one via `uv run --project`. `.claude/worktrees` is not
|
||||||
|
copied because each worktree there is a full checkout that can carry its own `.venv`. Leaving it out
|
||||||
|
hides nothing: it is ignored through `info/exclude`, and the root checks look only at lock-recorded
|
||||||
|
deployed paths, none of which is under it. The scratch directory is
|
||||||
|
removed on exit, including on `INT`, `TERM` and `HUP`. The script header records the full reasoning.
|
||||||
|
`tests/test-apm-audit-ci-waiver.sh` covers the waiver, the re-run, and each of its guards.
|
||||||
|
|
||||||
**Dropping `--ci` for package directories was considered and rejected.** It is the smaller change
|
**Dropping `--ci` for package directories was considered and rejected.** It is the smaller change
|
||||||
and it is wrong. Verified on apm 0.28.0, and again on 0.39.3 (holocron#272), against a scratch
|
and it is wrong. Verified on apm 0.28.0, and again on 0.39.3 (holocron#272), against a scratch
|
||||||
@@ -1357,7 +1400,8 @@ every key stays an accurate record of what was approved.
|
|||||||
|
|
||||||
It covers every plugin that ships executables, not one named package. The script scans
|
It covers every plugin that ships executables, not one named package. The script scans
|
||||||
`plugins/*/` and treats a plugin as shipping executables when `plugins/<name>/.apm/hooks/` or
|
`plugins/*/` and treats a plugin as shipping executables when `plugins/<name>/.apm/hooks/` or
|
||||||
`plugins/<name>/bin/` exists — kyberforge ships both, delivery ships a guard hook. For each one it
|
`plugins/<name>/bin/` exists — kyberforge ships both, delivery ships a guard hook,
|
||||||
|
git ships a hook that refuses a push to `main`. For each one it
|
||||||
reads `name:` and `version:` from `plugins/<name>/apm.yml` and asserts root `apm.yml` carries the
|
reads `name:` and `version:` from `plugins/<name>/apm.yml` and asserts root `apm.yml` carries the
|
||||||
`<identity>#<version>` key under `executables.allow`. The `name:` must equal the directory name, so
|
`<identity>#<version>` key under `executables.allow`. The `name:` must equal the directory name, so
|
||||||
one that differs fails rather than being guessed at. Every failing package is
|
one that differs fails rather than being guessed at. Every failing package is
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ metadata:
|
|||||||
category: docs
|
category: docs
|
||||||
source_keys:
|
source_keys:
|
||||||
- adr-0002-0003-two-tier-claude-md
|
- adr-0002-0003-two-tier-claude-md
|
||||||
version: "0.1.3"
|
version: "0.1.4"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Gotchas
|
## Gotchas
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ def read_text(path):
|
|||||||
byte is the complete signal and is checked first: no plausible markdown
|
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
|
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,
|
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 —
|
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
|
nothing was graded — so it exits 3 rather than 1. Exit 1 sends the skill's
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: core
|
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.
|
description: Skills for authoring and auditing a repo's AGENTS.md and the provider adapter files that defer to it.
|
||||||
author:
|
author:
|
||||||
name: Mortis
|
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
|
allowed-tools: Read Write Edit Bash
|
||||||
metadata:
|
metadata:
|
||||||
category: delivery
|
category: delivery
|
||||||
version: "0.2.0"
|
version: "0.2.1"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Gotchas
|
## 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:
|
Stage only files under the test paths, then check the staged set before committing:
|
||||||
|
|
||||||
```bash
|
```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
|
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
|
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:
|
metadata:
|
||||||
category: delivery
|
category: delivery
|
||||||
version: "0.1.0"
|
version: "0.1.1"
|
||||||
---
|
---
|
||||||
|
|
||||||
## Gotchas
|
## 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:
|
the merge commit whose message reverts it, oldest first:
|
||||||
|
|
||||||
```bash
|
```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
|
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**.
|
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:
|
ancestor carrying a status with the same name:
|
||||||
|
|
||||||
```bash
|
```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
|
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
|
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
|
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:
|
the default branch's first-parent commits after the merge commit, oldest first:
|
||||||
|
|
||||||
```bash
|
```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
|
found no revert, so none of these is at or after one. Read each SHA's statuses with
|
||||||
`mcp__gitea__commit_read` `get_status`:
|
`mcp__gitea__commit_read` `get_status`:
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: delivery
|
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.
|
description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.
|
||||||
author:
|
author:
|
||||||
name: Mortis
|
name: Mortis
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"PreToolUse": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"command": "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/refuse-push-to-main.py",
|
||||||
|
"timeout": 10,
|
||||||
|
"type": "command"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"matcher": "Bash"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
+265
@@ -0,0 +1,265 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""PreToolUse hook: refuse a `git push` that can update `main`.
|
||||||
|
|
||||||
|
A guardrail against accidents, not a security boundary: whatever it cannot read
|
||||||
|
in the command line goes through. Limits and opt-out: the git plugin's README.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import fnmatch
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import shlex
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
MAIN_NAMES = ("main", "heads/main", "refs/heads/main")
|
||||||
|
|
||||||
|
HEREDOC = re.compile(
|
||||||
|
r"""(?<!<)<<(-?)[ \t]*(?:'([^']+)'|"([^"]+)"|\\?([^\s;&|()<>'"`\\]+))"""
|
||||||
|
)
|
||||||
|
WORD = r"""(?:[^ \t\r\n;&|()`<>'"\\]|\\.|'[^']*'|"(?:[^"\\]|\\.)*")+"""
|
||||||
|
TOKEN = re.compile(
|
||||||
|
rf"""(?P<skip>[ \t\r]+|\#[^\n]*|(?:\d*|&)[<>]+[&|]?[ \t]*(?:{WORD})?)
|
||||||
|
|(?P<separator>[;&|()`\n]+)
|
||||||
|
|(?P<word>{WORD})""",
|
||||||
|
re.S | re.X,
|
||||||
|
)
|
||||||
|
|
||||||
|
ASSIGNMENT = re.compile(r"\w+=")
|
||||||
|
SHELL_KEYWORDS = {"!", "{", "if", "then", "elif", "else", "while", "until", "do"}
|
||||||
|
WRAPPERS = {
|
||||||
|
"rtk",
|
||||||
|
"proxy",
|
||||||
|
"command",
|
||||||
|
"env",
|
||||||
|
"exec",
|
||||||
|
"nohup",
|
||||||
|
"sudo",
|
||||||
|
"time",
|
||||||
|
"timeout",
|
||||||
|
"xargs",
|
||||||
|
}
|
||||||
|
WRAPPER_ARGUMENT = re.compile(r"-|\d+[smhd]?$")
|
||||||
|
|
||||||
|
SHORT_PUSH_OPTIONS = {"h": "--help", "n": "--dry-run"}
|
||||||
|
GIT_OPTIONS_WITH_VALUE = {"-c", "--git-dir", "--work-tree", "--namespace", "--config-env"}
|
||||||
|
REBASE_OPTIONS_WITH_VALUE = {
|
||||||
|
"--onto",
|
||||||
|
"-s",
|
||||||
|
"--strategy",
|
||||||
|
"-X",
|
||||||
|
"--strategy-option",
|
||||||
|
"-x",
|
||||||
|
"--exec",
|
||||||
|
}
|
||||||
|
PUSH_OPTIONS_WITH_VALUE = {
|
||||||
|
"--repo",
|
||||||
|
"--push-option",
|
||||||
|
"--receive-pack",
|
||||||
|
"--exec",
|
||||||
|
"--recurse-submodules",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def strip_heredocs(command):
|
||||||
|
lines = command.split("\n")
|
||||||
|
# A `<<` that nothing closes is text or arithmetic, not a heredoc.
|
||||||
|
closing_lines = {line.lstrip("\t") for line in lines}
|
||||||
|
kept, pending = [], []
|
||||||
|
for line in lines:
|
||||||
|
if pending:
|
||||||
|
dash, delimiter = pending[0]
|
||||||
|
if (line.lstrip("\t") if dash else line) == delimiter:
|
||||||
|
pending.pop(0)
|
||||||
|
continue
|
||||||
|
kept.append(line)
|
||||||
|
for dash, *quotings in HEREDOC.findall(line):
|
||||||
|
delimiter = "".join(quotings)
|
||||||
|
if delimiter in closing_lines:
|
||||||
|
pending.append((dash, delimiter))
|
||||||
|
return "\n".join(kept)
|
||||||
|
|
||||||
|
|
||||||
|
def simple_commands(command):
|
||||||
|
"""Split a command line into word lists; None when it does not parse.
|
||||||
|
|
||||||
|
A subshell's parentheses come out as the commands ["("] and [")"].
|
||||||
|
"""
|
||||||
|
command = re.sub(r"(?<!\\)\\\n", "", strip_heredocs(command))
|
||||||
|
commands, position = [[]], 0
|
||||||
|
while position < len(command):
|
||||||
|
token = TOKEN.match(command, position)
|
||||||
|
if not token:
|
||||||
|
return None
|
||||||
|
if token["separator"]:
|
||||||
|
commands += [[c] for c in token["separator"] if c in "()"]
|
||||||
|
commands.append([])
|
||||||
|
elif token["word"]:
|
||||||
|
commands[-1].append("".join(shlex.split(token["word"])))
|
||||||
|
position = token.end()
|
||||||
|
return commands
|
||||||
|
|
||||||
|
|
||||||
|
def strip_prefixes(words):
|
||||||
|
wrapped = False
|
||||||
|
for index, word in enumerate(words):
|
||||||
|
if word in WRAPPERS:
|
||||||
|
wrapped = True
|
||||||
|
elif not (
|
||||||
|
word in SHELL_KEYWORDS
|
||||||
|
or ASSIGNMENT.match(word)
|
||||||
|
or (wrapped and WRAPPER_ARGUMENT.match(word))
|
||||||
|
):
|
||||||
|
return words[index:]
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def split_git_command(arguments, directory):
|
||||||
|
"""(directory it runs in, subcommand, the subcommand's arguments)."""
|
||||||
|
rest = iter(arguments)
|
||||||
|
for word in rest:
|
||||||
|
if word == "-C":
|
||||||
|
directory = resolve(directory, next(rest, ""))
|
||||||
|
elif word in GIT_OPTIONS_WITH_VALUE:
|
||||||
|
next(rest, None)
|
||||||
|
elif not word.startswith("-"):
|
||||||
|
return directory, word, list(rest)
|
||||||
|
return directory, "", []
|
||||||
|
|
||||||
|
|
||||||
|
def resolve(directory, target):
|
||||||
|
# Not normalised: a target such as `$X/..` must stay a path that does not
|
||||||
|
# exist, so that the branch lookup fails and the push is allowed.
|
||||||
|
return os.path.join(directory, os.path.expanduser(target))
|
||||||
|
|
||||||
|
|
||||||
|
def changes_branch(subcommand, arguments):
|
||||||
|
if subcommand == "branch":
|
||||||
|
return not {"-m", "-M", "--move"}.isdisjoint(arguments)
|
||||||
|
if subcommand == "rebase": # `git rebase <upstream> <branch>` checks out <branch>
|
||||||
|
rest, names = iter(arguments), []
|
||||||
|
for argument in rest:
|
||||||
|
if argument in REBASE_OPTIONS_WITH_VALUE:
|
||||||
|
next(rest, None)
|
||||||
|
elif not argument.startswith("-"):
|
||||||
|
names.append(argument)
|
||||||
|
return len(names) > 1
|
||||||
|
return subcommand == "switch" or (subcommand == "checkout" and "--" not in arguments)
|
||||||
|
|
||||||
|
|
||||||
|
def parse_push(arguments):
|
||||||
|
"""(long-form option names, refspecs) of a git push."""
|
||||||
|
options, positional = set(), []
|
||||||
|
rest = iter(arguments)
|
||||||
|
for argument in rest:
|
||||||
|
if argument == "--":
|
||||||
|
positional.extend(rest)
|
||||||
|
elif argument.startswith("--"):
|
||||||
|
options.add(argument.split("=")[0])
|
||||||
|
if argument in PUSH_OPTIONS_WITH_VALUE:
|
||||||
|
next(rest, None)
|
||||||
|
elif argument.startswith("-"):
|
||||||
|
flags, push_option, value = argument[1:].partition("o")
|
||||||
|
options.update(SHORT_PUSH_OPTIONS.get(f, f) for f in flags)
|
||||||
|
if push_option and not value:
|
||||||
|
next(rest, None)
|
||||||
|
else:
|
||||||
|
positional.append(argument)
|
||||||
|
return options, positional[1:]
|
||||||
|
|
||||||
|
|
||||||
|
def updates_main(arguments, on_main):
|
||||||
|
"""Whether a push can update main. `on_main` is called only when it matters."""
|
||||||
|
options, refspecs = parse_push(arguments)
|
||||||
|
if options & {"--dry-run", "--help"}:
|
||||||
|
return False
|
||||||
|
if options & {"--all", "--branches", "--mirror"}:
|
||||||
|
return True
|
||||||
|
if not refspecs:
|
||||||
|
return "--tags" not in options and on_main()
|
||||||
|
|
||||||
|
rest = iter(refspecs)
|
||||||
|
for refspec in rest:
|
||||||
|
if refspec == "tag":
|
||||||
|
next(rest, None)
|
||||||
|
continue
|
||||||
|
source, colon, destination = refspec.removeprefix("+").partition(":")
|
||||||
|
if colon and not source and not destination:
|
||||||
|
return True
|
||||||
|
target = destination if colon else source
|
||||||
|
if any(fnmatch.fnmatchcase(name, target) for name in MAIN_NAMES):
|
||||||
|
return True
|
||||||
|
if not colon and source in ("HEAD", "@") and on_main():
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def current_branch_is_main(directory):
|
||||||
|
head = subprocess.run(
|
||||||
|
["git", "-C", directory, "symbolic-ref", "--quiet", "HEAD"], capture_output=True, text=True
|
||||||
|
)
|
||||||
|
return head.stdout.strip() == "refs/heads/main"
|
||||||
|
|
||||||
|
|
||||||
|
def pushes_to_main(command, directory):
|
||||||
|
if "git" not in command or "push" not in command:
|
||||||
|
return False
|
||||||
|
outer_directories = []
|
||||||
|
branch_change = None # (directory, whether it went to main) of the latest one
|
||||||
|
for all_words in simple_commands(command) or []:
|
||||||
|
words = strip_prefixes(all_words)
|
||||||
|
if not words:
|
||||||
|
continue
|
||||||
|
name, arguments = os.path.basename(words[0]), words[1:]
|
||||||
|
if name == "(":
|
||||||
|
outer_directories.append(directory)
|
||||||
|
elif name == ")" and outer_directories:
|
||||||
|
directory = outer_directories.pop()
|
||||||
|
elif name in ("cd", "pushd", "popd"):
|
||||||
|
directory = resolve(directory, words[-1])
|
||||||
|
elif name in ("gh", "tea") and "checkout" in arguments:
|
||||||
|
branch_change = (directory, False)
|
||||||
|
elif name == "git":
|
||||||
|
repo, subcommand, arguments = split_git_command(arguments, directory)
|
||||||
|
# xargs adds refspecs, and another git dir has its own branch.
|
||||||
|
unknown = "xargs" in all_words or any(
|
||||||
|
w.startswith(("GIT_DIR=", "--git-dir")) for w in all_words
|
||||||
|
)
|
||||||
|
|
||||||
|
def on_main():
|
||||||
|
if unknown:
|
||||||
|
return False
|
||||||
|
if branch_change:
|
||||||
|
return branch_change == (repo, True)
|
||||||
|
return current_branch_is_main(repo)
|
||||||
|
|
||||||
|
if changes_branch(subcommand, arguments):
|
||||||
|
names = [a for a in arguments if not a.startswith("-")]
|
||||||
|
branch_change = (repo, subcommand != "branch" and names == ["main"])
|
||||||
|
elif subcommand == "push" and updates_main(arguments, on_main):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# apm deploys this file to Copilot and Codex too, where it must do nothing.
|
||||||
|
if "/.claude/hooks/" not in os.path.abspath(__file__).replace("\\", "/"):
|
||||||
|
return 0
|
||||||
|
if os.environ.get("GIT_ALLOW_PUSH_TO_MAIN") == "1":
|
||||||
|
return 0
|
||||||
|
payload = json.load(sys.stdin)
|
||||||
|
if payload["tool_name"] != "Bash":
|
||||||
|
return 0
|
||||||
|
if pushes_to_main(payload["tool_input"]["command"], payload["cwd"]):
|
||||||
|
print(
|
||||||
|
"Refused: this git push can update main. "
|
||||||
|
"Push a feature branch by name and open a pull request instead.",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
return 2
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
@@ -8,7 +8,7 @@ description: >
|
|||||||
Not branch lifecycle -> `git-branches`.
|
Not branch lifecycle -> `git-branches`.
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
version: "0.1.8"
|
version: "0.1.9"
|
||||||
category: git
|
category: git
|
||||||
source_keys:
|
source_keys:
|
||||||
- conventional-commits-spec
|
- conventional-commits-spec
|
||||||
@@ -65,7 +65,7 @@ For an agent caller, return:
|
|||||||
"scope": "api",
|
"scope": "api",
|
||||||
"description": "add user authentication",
|
"description": "add user authentication",
|
||||||
"body": "optional body text, or null",
|
"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:
|
ADR:
|
||||||
RFC:
|
RFC:
|
||||||
Design:
|
Design:
|
||||||
Co-authored-by:
|
|
||||||
Reviewed-by:
|
Reviewed-by:
|
||||||
Signed-off-by:
|
Signed-off-by:
|
||||||
BREAKING CHANGE:
|
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
|
<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).
|
- Exception: `BREAKING CHANGE` (space allowed, uppercase).
|
||||||
- Multiple footers allowed, one per line.
|
- Multiple footers allowed, one per line.
|
||||||
- Blank line required before the footer block.
|
- Blank line required before the footer block.
|
||||||
@@ -99,7 +99,7 @@ Valid footer examples:
|
|||||||
```text
|
```text
|
||||||
Reviewed-by: Z
|
Reviewed-by: Z
|
||||||
Refs: #123
|
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
|
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.
|
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.
|
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`.
|
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.
|
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`.
|
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`.
|
||||||
@@ -8,7 +8,7 @@ description: >
|
|||||||
`git-commits`. Not a Gitea server's history -> `gitea-branches`.
|
`git-commits`. Not a Gitea server's history -> `gitea-branches`.
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0.3"
|
version: "1.0.4"
|
||||||
category: git
|
category: git
|
||||||
source_keys:
|
source_keys:
|
||||||
- git-scm-bisect-docs
|
- 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.
|
is showing line content.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git log -L 10,20:file.txt # bare (ADR-0023)
|
git log -L 10,20:file.txt # rtk-bare: rtk truncates diff lines
|
||||||
git log -L /start_pattern/,/end_pattern/:file.txt # bare (ADR-0023)
|
git log -L /start_pattern/,/end_pattern/:file.txt # rtk-bare: rtk truncates diff lines
|
||||||
git log -L :myfunction:src/app.c # bare (ADR-0023)
|
git log -L :myfunction:src/app.c # rtk-bare: rtk truncates diff lines
|
||||||
git log -L /init/,+15:config.py # bare (ADR-0023); 15 lines after first /init/ match
|
git log -L /init/,+15:config.py # rtk-bare: rtk truncates diff lines; 15 lines after first /init/ match
|
||||||
```
|
```
|
||||||
|
|
||||||
Range formats:
|
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.
|
the output is no longer one record per line.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git diff --name-only # bare (ADR-0023); only filenames, one per line
|
git diff --name-only # rtk-bare: rtk adds a trailer; only filenames, one per line
|
||||||
git diff --name-status # bare (ADR-0023); status letter + filename 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`.
|
`--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.
|
renderer and emits none of the `[-removed-] {+added+}` markers.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git diff --word-diff # bare (ADR-0023); inline word-level diff, [-removed-] {+added+} markers
|
git diff --word-diff # rtk-bare: rtk drops the word-diff; inline word-level diff, [-removed-] {+added+} markers
|
||||||
git diff --word-diff=color # bare (ADR-0023); color only, no markers
|
git diff --word-diff=color # rtk-bare: rtk drops the word-diff; color only, no markers
|
||||||
git diff --word-diff=porcelain # bare (ADR-0023); machine-readable: +/- prefixed lines, ~ for newlines
|
git diff --word-diff=porcelain # rtk-bare: rtk drops the word-diff; 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-regex=<re> # rtk-bare: rtk drops the word-diff; define what counts as a "word"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Whitespace Flags
|
### Whitespace Flags
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ description: >
|
|||||||
Not submodule pointers -> `git-submodules`.
|
Not submodule pointers -> `git-submodules`.
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0.4"
|
version: "1.0.5"
|
||||||
category: git
|
category: git
|
||||||
source_keys:
|
source_keys:
|
||||||
- git-scm-remote-docs
|
- git-scm-remote-docs
|
||||||
|
|||||||
@@ -50,13 +50,13 @@ Two mitigations:
|
|||||||
# poisoned by an unrelated fetch.
|
# poisoned by an unrelated fetch.
|
||||||
# The inner `git config` is bare: its stdout becomes a remote URL, so any
|
# The inner `git config` is bare: its stdout becomes a remote URL, so any
|
||||||
# output rewriting would poison the remote silently.
|
# 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
|
rtk git push --force-with-lease origin-push
|
||||||
|
|
||||||
# Option 2 — explicit SHA via a local tag, unaffected by tracking-branch state
|
# Option 2 — explicit SHA via a local tag, unaffected by tracking-branch state
|
||||||
rtk git fetch
|
rtk git fetch
|
||||||
rtk git tag base master
|
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
|
rtk git push --force-with-lease=master:base master:master
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ description: >
|
|||||||
Not interactive multi-step git guidance -> `git-workflow`.
|
Not interactive multi-step git guidance -> `git-workflow`.
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0.3"
|
version: "1.0.4"
|
||||||
category: git
|
category: git
|
||||||
source_keys:
|
source_keys:
|
||||||
- git-scm-worktree-docs
|
- 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` |
|
| 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 |
|
| 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 |
|
| **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>` |
|
| Lock or unlock | `rtk git worktree lock [--reason <str>] <path>` / `rtk git worktree unlock <path>` |
|
||||||
| Move | `rtk git worktree move <from> <to>` |
|
| Move | `rtk git worktree move <from> <to>` |
|
||||||
| Remove | `rtk git worktree remove <path>` |
|
| Remove | `rtk git worktree remove <path>` |
|
||||||
|
|||||||
+58
-1
@@ -25,7 +25,7 @@ The entry above is unpinned and tracks the remote's default branch. To pin a rel
|
|||||||
|
|
||||||
## Conventions
|
## 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.
|
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.
|
||||||
|
|
||||||
@@ -35,9 +35,66 @@ Installing this plugin without `rtk`? Every prefixed command is a plain `git` in
|
|||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Skills | `.apm/skills/` | `git-commits`, `git-branches`, `git-history`, `git-remotes`, `git-submodules`, `git-workflow`, `git-worktrees`, `pc-author`, `pc-run` |
|
| Skills | `.apm/skills/` | `git-commits`, `git-branches`, `git-history`, `git-remotes`, `git-submodules`, `git-workflow`, `git-worktrees`, `pc-author`, `pc-run` |
|
||||||
| Agents | `.apm/agents/` | `git-orchestrate` |
|
| Agents | `.apm/agents/` | `git-orchestrate` |
|
||||||
|
| Hooks | `.apm/hooks/` | `refuse-push-to-main.py`, see [Push-to-main hook](#push-to-main-hook) |
|
||||||
|
|
||||||
`.apm/` is the authoring source and the only thing apm deploys (ADR-0024).
|
`.apm/` is the authoring source and the only thing apm deploys (ADR-0024).
|
||||||
|
|
||||||
|
## Push-to-main hook
|
||||||
|
|
||||||
|
On Claude Code, a `PreToolUse` hook refuses a Bash `git push` that can update `main`:
|
||||||
|
|
||||||
|
- an explicit destination: `main`, `HEAD:main`, `<branch>:main`, `refs/heads/main`, or deleting `main`
|
||||||
|
- a bare `git push`, `HEAD` or `@` while `main` is checked out
|
||||||
|
- a bulk push: `--all`, `--mirror`, `:`, or a wildcard refspec that covers `main`
|
||||||
|
- any of these with `--force` or `--force-with-lease`
|
||||||
|
|
||||||
|
Pushes to other branches, tag pushes and `--dry-run` go through. apm also deploys the files to Copilot and Codex, where the hook does nothing.
|
||||||
|
|
||||||
|
### Limits
|
||||||
|
|
||||||
|
The hook is a guardrail against accidents. Server-side branch protection is the real control. If the hook itself fails, the push goes through. It does not see:
|
||||||
|
|
||||||
|
- git aliases, shell variables such as `$BRANCH`, scripts, `bash -c`, command substitution inside double quotes, or pushes made through an MCP server
|
||||||
|
- git config that redirects a push (`push.default=upstream`, `remote.<name>.push`)
|
||||||
|
- a push behind a wrapper option that takes a separate value, such as `sudo -u <user>` or `env -u <name>`
|
||||||
|
- a command line the hook cannot parse, for example `$'...'` with an escaped quote
|
||||||
|
- a bare `git push`, `HEAD` or `@` in a command that makes the branch unknown:
|
||||||
|
- an earlier `git switch` or `git checkout` to anything but a literal `main`, `git branch -m`, `git rebase <upstream> <branch>`, `gh pr checkout` or `tea pr checkout`
|
||||||
|
- an earlier `cd` to a path that is not literal
|
||||||
|
- `--git-dir`, `GIT_DIR=` or `xargs` on the push itself
|
||||||
|
|
||||||
|
### Opt-out
|
||||||
|
|
||||||
|
To allow pushes to `main`, set the variable under `env` in `.claude/settings.json`, or in `.claude/settings.local.json` for yourself only:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"GIT_ALLOW_PUSH_TO_MAIN": "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Claude Code puts `env` values into its own environment, which hooks inherit. Setting the variable inside the command (`GIT_ALLOW_PUSH_TO_MAIN=1 git push`) has no effect. After you remove the setting, restart Claude Code for the hook to refuse again.
|
||||||
|
|
||||||
|
### Approval
|
||||||
|
|
||||||
|
The hook is an executable primitive, so whether it deploys depends on the `executables:` block in the consuming project's `apm.yml`:
|
||||||
|
|
||||||
|
- **No `executables:` block:** hooks deploy without approval.
|
||||||
|
- **With an `executables:` block:** the hook is parked until it is granted. Grant it in one of two ways, then run `apm install` and commit the `executables` entry:
|
||||||
|
- `apm approve` writes the entry and pins it to the hook's content, so a later change to the script needs approval again.
|
||||||
|
- A hand-written entry under the full package identity is not pinned:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
executables:
|
||||||
|
allow:
|
||||||
|
git.rkdr.net/Mortis/Holocron/plugins/git:
|
||||||
|
hooks: true
|
||||||
|
```
|
||||||
|
|
||||||
|
The first `apm approve` in a project creates the block and so turns the gate on. The next install then parks every other package's unapproved executables.
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
Defame1297
|
Defame1297
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name: git
|
name: git
|
||||||
version: 1.3.9
|
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.
|
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:
|
author:
|
||||||
name: Mortis
|
name: Mortis
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ compatibility: Requires Gitea MCP server configured with a token with write:repo
|
|||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
category: integration
|
category: integration
|
||||||
version: "0.1.4"
|
version: "0.1.5"
|
||||||
source_keys:
|
source_keys:
|
||||||
- gitea-mcp-repo
|
- gitea-mcp-repo
|
||||||
- gitea-mcp-slim-go
|
- gitea-mcp-slim-go
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Sources
|
# Sources
|
||||||
|
|
||||||
**Note on call signatures:** per `docs/adr/0011-gitea-skill-deep-modules.md`, the tool parameter
|
**Note on call signatures:** the tool parameter signatures in `references/branches.md` and
|
||||||
signatures in `references/branches.md` and `references/commits.md` were re-verified live via
|
`references/commits.md` were re-verified live via `ToolSearch` against the deployed `gitea-mcp`
|
||||||
`ToolSearch` against the deployed `gitea-mcp` server — **last verified against v1.7.0**, as reported
|
server — **last verified against v1.7.0**, as reported by `get_gitea_mcp_server_version` — rather
|
||||||
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
|
than copied verbatim from `api-reference.md` below, because API docs can drift from the actual MCP
|
||||||
that a prior skill was authored from API docs that had drifted from the actual MCP tool schema.
|
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
|
The research docs cited here informed gotchas, response shapes, and workflow context, not the
|
||||||
parameter lists themselves.
|
parameter lists themselves.
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ compatibility: Requires Gitea MCP server configured with write:issue and write:r
|
|||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
category: integration
|
category: integration
|
||||||
version: "0.1.5"
|
version: "0.1.6"
|
||||||
source_keys:
|
source_keys:
|
||||||
- gitea-mcp-repo
|
- gitea-mcp-repo
|
||||||
- gitea-mcp-slim-go
|
- gitea-mcp-slim-go
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ source_keys:
|
|||||||
|
|
||||||
# Create-flow enrichments
|
# 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 →
|
`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
|
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
|
milestone fit doesn't block label inference, and so on — but this is the order that lets later
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
# Sources
|
# Sources
|
||||||
|
|
||||||
**Note on call signatures:** per `docs/adr/0011-gitea-skill-deep-modules.md`, the tool parameter
|
**Note on call signatures:** the tool parameter signatures in `references/issues.md` and
|
||||||
signatures in `references/issues.md` and `references/search.md` are re-verified live via
|
`references/search.md` are re-verified live via `ToolSearch` against the deployed `gitea-mcp`
|
||||||
`ToolSearch` against the deployed `gitea-mcp` server — they are not copied verbatim from
|
server — they are not copied verbatim from `api-reference.md`, because API docs can drift from the
|
||||||
`api-reference.md`. This resolves issue #6 comment #849's root-cause finding that a prior skill was
|
actual MCP tool schema, and a skill authored from them once shipped a wrong parameter. That re-verification is
|
||||||
authored from API docs that had drifted from the actual MCP tool schema. That re-verification is
|
|
||||||
ongoing, not one-off: an earlier live check recorded `list_issues` as lacking the `type` and
|
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
|
`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.
|
gitea-mcp **v1.7.0**, which is the version these signatures are current as of.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ metadata:
|
|||||||
- gitea-mcp-slim-go
|
- gitea-mcp-slim-go
|
||||||
- context7-websites-gitea
|
- context7-websites-gitea
|
||||||
- context7-gitea-tea-cli
|
- 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
|
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
|
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.
|
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
|
`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
|
`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
|
as a worked example of what the field looks like in practice — it is not a property of the taxonomy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: gitea
|
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.
|
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:
|
author:
|
||||||
name: Mortis
|
name: Mortis
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: >
|
|||||||
Not read-only review -> `factory-audit`. Not skills -> `skill-author`.
|
Not read-only review -> `factory-audit`. Not skills -> `skill-author`.
|
||||||
allowed-tools: Bash Read Write Edit
|
allowed-tools: Bash Read Write Edit
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0.4"
|
version: "1.0.5"
|
||||||
category: factory
|
category: factory
|
||||||
source_keys:
|
source_keys:
|
||||||
- context7-websites-code-claude
|
- context7-websites-code-claude
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## templates/
|
## templates/
|
||||||
|
|
||||||
Annotated agent definition templates copied by `scripts/new-agent.sh` when scaffolding a new agent.
|
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.
|
- **`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`).
|
- **`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:
|
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
|
a trigger clause opening "Use when", at most one capability clause, and a
|
||||||
boundary clause naming a real sibling skill or agent.
|
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
|
Do not open with an action verb ("Reviews...", "Analyzes...") — that rule was
|
||||||
deleted.
|
deleted.
|
||||||
Never write "Use proactively" here. It steers the Claude Code runtime and does
|
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:
|
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
|
a trigger clause opening "Use when", at most one capability clause, and a
|
||||||
boundary clause naming a real sibling skill or agent.
|
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
|
Do not open with an action verb ("Reviews...", "Analyzes...") — that rule was
|
||||||
deleted.
|
deleted.
|
||||||
"Use proactively" is valid HERE and only here: it steers the Claude Code runtime
|
"Use proactively" is valid HERE and only here: it steers the Claude Code runtime
|
||||||
|
|||||||
+1
-1
@@ -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:
|
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
|
a trigger clause opening "Use when", at most one capability clause, and a
|
||||||
boundary clause naming a real sibling skill or agent.
|
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.
|
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
|
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.
|
in Copilot, and factory-audit's KyberforgeCopilot.ProactivePhrase grades it a hard FAIL.
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ else
|
|||||||
if [[ "$SCOPE" == "plugin" ]]; then
|
if [[ "$SCOPE" == "plugin" ]]; then
|
||||||
echo " 1. Fill in $APM_FILE — replace every FILL IN: placeholder. Optional fields are" >&2
|
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 " 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 " 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 " 2. Populate $SOURCES_DIR/sources.md with research sources, or delete it" >&2
|
||||||
echo " 3. Validate: $VALIDATE_HINT $APM_FILE" >&2
|
echo " 3. Validate: $VALIDATE_HINT $APM_FILE" >&2
|
||||||
@@ -294,7 +294,7 @@ else
|
|||||||
else
|
else
|
||||||
echo " 1. Fill in $CC_FILE — replace every FILL IN: placeholder. Optional fields are" >&2
|
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 " 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 " 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 " 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
|
echo " fields it names must not cross over from the file above." >&2
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ description: >
|
|||||||
fixes -> agent-author.
|
fixes -> agent-author.
|
||||||
allowed-tools: Bash Read
|
allowed-tools: Bash Read
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0.7"
|
version: "1.0.8"
|
||||||
category: factory
|
category: factory
|
||||||
source_keys:
|
source_keys:
|
||||||
- agentskills-home
|
- agentskills-home
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# lib-boundary-resolver.sh — SOURCED, never executed.
|
# 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
|
# 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
|
# 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
|
# hook resolve boundary targets through the same code rather than through
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
|
|
||||||
IFS='' read -r -d '' KYBERFORGE_RESOLVER_PY <<'KYBERFORGE_ADR0020_RESOLVER_PY' || true
|
IFS='' read -r -d '' KYBERFORGE_RESOLVER_PY <<'KYBERFORGE_RESOLVER_PY_END' || true
|
||||||
# ===== BEGIN ADR-0020 SHARED BOUNDARY RESOLVER =====
|
# ===== BEGIN SHARED BOUNDARY RESOLVER =====
|
||||||
# ONE resolver, and this is its only copy. Sourced from this file by:
|
# ONE resolver, and this is its only copy. Sourced from this file by:
|
||||||
# plugins/kyberforge/.apm/skills/factory-audit/scripts/validate.sh (both modes)
|
# plugins/kyberforge/.apm/skills/factory-audit/scripts/validate.sh (both modes)
|
||||||
# scripts/skill-size-check.sh (the repo-root commit hook)
|
# 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
|
# 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
|
# wrongly reach for the deployed trees — including the user's global
|
||||||
# ~/.claude/skills, making the verdict depend on what happens to be
|
# ~/.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)
|
root, root_has_plugins = _authoring_root(start)
|
||||||
if root:
|
if root:
|
||||||
_collect_authoring_root(root, names)
|
_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
|
# 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
|
# condition, pc-run's "run pre-commit hooks" reads as a route to a
|
||||||
# non-existent `pre-commit` skill.
|
# 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:
|
# `Not <thing> -> <skill-name>`. The example that motivated it is gone:
|
||||||
# diagnose's process chain "fix -> regression-test", which without the
|
# diagnose's process chain "fix -> regression-test", which without the
|
||||||
# gate read as a route to a non-existent `regression-test` skill, was cut
|
# 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.
|
# that had no escape hatch.
|
||||||
#
|
#
|
||||||
# EXPLICIT ROUTE NOTATION is exempt from corroboration and always blocks:
|
# 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
|
# 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
|
# 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
|
# 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.
|
# 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
|
# `/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
|
# 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
|
# 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
|
# 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)
|
r"\bnot\b%s*?(?:->|→)\s*(%s)\b" % (CLAUSE_BODY, NAME_HYPH), re.I)
|
||||||
BACKTICK = re.compile(r"`(%s)`" % 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
|
# 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_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)
|
BOUNDARY_ARROW = re.compile(r"\bnot\b%s*?(?:->|→)" % CLAUSE_BODY, re.I)
|
||||||
# Sentence boundaries decide the CORROBORATION scope above, so getting one wrong
|
# 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.
|
"""True if the name is written in route NOTATION rather than in prose.
|
||||||
|
|
||||||
Two forms qualify: `/name` (Claude Code's invocation syntax, detected from
|
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
|
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
|
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.
|
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
|
_terminal() and a follower outside FOLLOWER_OK set may_dangle=False. The
|
||||||
target then reached unresolved_targets() unblockable — and, before the
|
target then reached unresolved_targets() unblockable — and, before the
|
||||||
companion fix there, unreported as well. `... use /no-such-skill
|
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.
|
author who wants a route checked unconditionally.
|
||||||
"""
|
"""
|
||||||
if not name:
|
if not name:
|
||||||
@@ -788,7 +788,7 @@ def _clause_end(description, pos):
|
|||||||
|
|
||||||
|
|
||||||
def _arrow_clause_spans(description):
|
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
|
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
|
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.
|
"""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
|
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
|
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
|
that deserves its own message, and telling it apart needs the arrow targets
|
||||||
alone rather than every target in the description.
|
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
|
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.
|
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
|
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
|
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
|
— 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
|
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"
|
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
|
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
|
The clause is REJECTED rather than the arrow scan extended. Extending it
|
||||||
would widen the resolver's deliberately conservative false-positive tuning
|
would widen the resolver's deliberately conservative false-positive tuning
|
||||||
@@ -1037,7 +1037,7 @@ def unresolved_body_targets(body, known):
|
|||||||
# --- Frontmatter ----------------------------------------------------------
|
# --- Frontmatter ----------------------------------------------------------
|
||||||
# Tolerant on the way in, HARD-FAILING on the way out. A UTF-8 BOM, a leading
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
description is present. A line regex cannot: `description:` with no value
|
||||||
followed by `model: sonnet` lets `\\s*` cross the newline and captures the
|
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
|
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
|
genuinely empty folded value. That combination exited 0 with zero output on
|
||||||
a BLOCKING pre-push gate.
|
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
|
`disable-model-invocation: true` removes a skill from the model-visible
|
||||||
listing entirely — it is not preloaded, and the Skill tool refuses to call
|
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:
|
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
|
no trigger list, no boundary clause. No validator knew the field existed
|
||||||
(issue #108), so the boundary-clause SUGGESTION fired on exactly the shape
|
(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))):
|
if not os.path.isfile(os.path.join(skill_dir, 'references', match.group(1))):
|
||||||
missing.add('references/' + match.group(1))
|
missing.add('references/' + match.group(1))
|
||||||
return sorted(missing)
|
return sorted(missing)
|
||||||
# ===== END ADR-0020 SHARED BOUNDARY RESOLVER =====
|
# ===== END SHARED BOUNDARY RESOLVER =====
|
||||||
KYBERFORGE_ADR0020_RESOLVER_PY
|
KYBERFORGE_RESOLVER_PY_END
|
||||||
KYBERFORGE_RESOLVER_PY="${KYBERFORGE_RESOLVER_PY%$'\n'}"
|
KYBERFORGE_RESOLVER_PY="${KYBERFORGE_RESOLVER_PY%$'\n'}"
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# lib-checks-agent.sh — SOURCED, never executed.
|
# lib-checks-agent.sh — SOURCED, never executed.
|
||||||
#
|
#
|
||||||
# agent-audit's structural check suite: everything in its validate.sh that is
|
# 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
|
# resolver's markers. validate.sh reassembles
|
||||||
#
|
#
|
||||||
# $KYBERFORGE_AGENT_PREAMBLE_PY
|
# $KYBERFORGE_AGENT_PREAMBLE_PY
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
#
|
#
|
||||||
# The dimension vocabulary and the tiers here are agent-audit's and are
|
# 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
|
# 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
|
# context-budget description gates and no body word gate at all; adding one would
|
||||||
# contradict the ADR.
|
# be wrong (see the body-gate note below).
|
||||||
#
|
#
|
||||||
# Consumed by: validate.sh, agent mode.
|
# Consumed by: validate.sh, agent mode.
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
@@ -36,7 +36,7 @@ kyberforge_agent_preflight() {
|
|||||||
# dependency sends the reader to install the wrong thing.
|
# dependency sends the reader to install the wrong thing.
|
||||||
if ! command -v python3 > /dev/null 2>&1; then
|
if ! command -v python3 > /dev/null 2>&1; then
|
||||||
echo "Error: python3 is required but was not found on PATH." >&2
|
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
|
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.
|
# 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.
|
# 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
|
if ! python3 -c 'import yaml' > /dev/null 2>&1; then
|
||||||
echo "Error: PyYAML is required but is not importable by python3." >&2
|
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
|
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, the never-ran tier: a missing hard dependency is not a findings result.
|
||||||
exit 2
|
exit 2
|
||||||
@@ -62,13 +62,13 @@ import yaml
|
|||||||
|
|
||||||
# Output is UTF-8 for the same reason input is: under LC_ALL=C the streams
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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.
|
# 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
|
# 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
|
# equivalent, and the block is one sourced copy all three share, so each
|
||||||
# consumer's own startup stays in its own preamble.
|
# 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 length limit (chars) — content beyond this is silently truncated
|
||||||
COPILOT_BODY_LIMIT = 30000
|
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
|
# every session exactly like a skill's, so agents take the SAME description
|
||||||
# gates. These two constants are DUPLICATED in three places:
|
# gates. These two constants are DUPLICATED in three places:
|
||||||
# scripts/skill-size-check.sh, lib-checks-skill.sh beside this file, and here.
|
# 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.
|
# rather than silently diverging.
|
||||||
#
|
#
|
||||||
# Agents deliberately take NO body word gate, and adding one here would
|
# 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
|
# 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
|
# 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.
|
# not transfer. Agent body length falls out of the delegation rule instead.
|
||||||
@@ -170,7 +170,7 @@ suggestions = []
|
|||||||
|
|
||||||
def fail(msg):
|
def fail(msg):
|
||||||
# stderr, matching scripts/skill-size-check.sh's ERROR routing. All three
|
# 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
|
# stderr, everything advisory (SUGGESTION / INFO) goes to stdout. Both repo
|
||||||
# callers (check-apm-agents-valid.sh, check-scope-walkup-sync.sh) capture
|
# callers (check-apm-agents-valid.sh, check-scope-walkup-sync.sh) capture
|
||||||
# `2>&1`, so nothing a human reads moves.
|
# `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
|
`\\s*` after the colon crosses the newline, so `description:` with no value
|
||||||
followed by `model: sonnet` captured `model: sonnet` as the description.
|
followed by `model: sonnet` captured `model: sonnet` as the description.
|
||||||
That made the value look present, skipped the "missing or empty" failure,
|
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
|
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
|
pre-push gate. This function is now used only for fields with no folding
|
||||||
semantics (name, tools); description goes through description_value(), the
|
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
|
# `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
|
# 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.
|
# 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}")
|
f"not run — {local_fname}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def check_description_budget(value, local_fname, by_hand=False):
|
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
|
carrying `disable-model-invocation: true` is absent from the model-visible
|
||||||
listing, so the 250-character SUGGESTION — a routing-quality budget — has
|
listing, so the 250-character SUGGESTION — a routing-quality budget — has
|
||||||
no listing to apply to. The 400-character ceiling is unaffected.
|
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)
|
dlen = len(value)
|
||||||
if dlen > DESC_MAX_CHARS:
|
if dlen > DESC_MAX_CHARS:
|
||||||
fail(f"description is {dlen} chars — exceeds the {DESC_MAX_CHARS}-character "
|
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"agent is invoked. Keep a trigger clause, at most one capability clause, "
|
||||||
f"and a boundary clause; move capability enumeration, output-format detail, "
|
f"and a boundary clause; move capability enumeration, output-format detail, "
|
||||||
f"composition notes and implementation detail to the body — {local_fname}")
|
f"composition notes and implementation detail to the body — {local_fname}")
|
||||||
elif dlen > DESC_SUGGEST_CHARS and not by_hand:
|
elif dlen > DESC_SUGGEST_CHARS and not by_hand:
|
||||||
suggest(f"description is {dlen} chars — over the {DESC_SUGGEST_CHARS}-character "
|
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"what moves the corpus average; the FAIL tier only stops outliers "
|
||||||
f"— {local_fname}")
|
f"— {local_fname}")
|
||||||
|
|
||||||
def check_boundary(value, fpath, local_fname, by_hand=False):
|
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
|
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
|
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'
|
status = boundary_clause_status(value) if not by_hand else 'present'
|
||||||
if status == 'absent':
|
if status == 'absent':
|
||||||
suggest(f"description has no boundary clause — add the prose form (\"Do not use "
|
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}")
|
f"so the router knows where NOT to send this agent — {local_fname}")
|
||||||
elif status == 'unparsed':
|
elif status == 'unparsed':
|
||||||
suggest(f"description has an arrow boundary clause (\"Not X -> y\") from which no "
|
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
|
# 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
|
# 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
|
# 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.
|
# early-returned on the empty folded value. Exit 0, zero output, no gate run.
|
||||||
folded = agent_description(fm, local_fname)
|
folded = agent_description(fm, local_fname)
|
||||||
if folded is None:
|
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
|
# 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
|
# 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
|
# 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.
|
# early-returned on the empty folded value. Exit 0, zero output, no gate run.
|
||||||
folded = agent_description(fm, local_fname)
|
folded = agent_description(fm, local_fname)
|
||||||
if folded is None:
|
if folded is None:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# lib-checks-skill.sh — SOURCED, never executed.
|
# lib-checks-skill.sh — SOURCED, never executed.
|
||||||
#
|
#
|
||||||
# skill-audit's structural check suite: everything in its validate.sh that is
|
# 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
|
# resolver's markers. validate.sh reassembles
|
||||||
#
|
#
|
||||||
# $KYBERFORGE_SKILL_PREAMBLE_PY
|
# $KYBERFORGE_SKILL_PREAMBLE_PY
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
# INFO tiers here are skill-audit's and are deliberately NOT reconciled with
|
# 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
|
# 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
|
# 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.
|
# Consumed by: validate.sh, skill mode.
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
@@ -35,7 +35,7 @@ kyberforge_skill_preflight() {
|
|||||||
# dependency sends the reader to install the wrong thing.
|
# dependency sends the reader to install the wrong thing.
|
||||||
if ! command -v python3 > /dev/null 2>&1; then
|
if ! command -v python3 > /dev/null 2>&1; then
|
||||||
echo "Error: python3 is required but was not found on PATH." >&2
|
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
|
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.
|
# 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.
|
# 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
|
if ! python3 -c 'import yaml' > /dev/null 2>&1; then
|
||||||
echo "Error: PyYAML is required but is not importable by python3." >&2
|
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
|
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, the never-ran tier: a missing hard dependency is not a findings result.
|
||||||
exit 2
|
exit 2
|
||||||
@@ -61,13 +61,13 @@ import yaml
|
|||||||
|
|
||||||
# Output is UTF-8 for the same reason input is: under LC_ALL=C the streams
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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.
|
# 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
|
# 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
|
# equivalent, and the block is one sourced copy all three share, so each
|
||||||
# consumer's own startup stays in its own preamble.
|
# consumer's own startup stays in its own preamble.
|
||||||
@@ -92,7 +92,7 @@ def ok(msg):
|
|||||||
|
|
||||||
def fail(msg):
|
def fail(msg):
|
||||||
# stderr, matching scripts/skill-size-check.sh's ERROR routing. All three
|
# 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.
|
# stderr, everything advisory (PASS / SUGGESTION / INFO) goes to stdout.
|
||||||
# Both repo callers capture `2>&1`, so nothing a human reads moves.
|
# Both repo callers capture `2>&1`, so nothing a human reads moves.
|
||||||
global failed
|
global failed
|
||||||
@@ -102,7 +102,7 @@ def fail(msg):
|
|||||||
def suggest(msg):
|
def suggest(msg):
|
||||||
# SUGGESTIONs are printed after every check and NEVER touch the exit code.
|
# SUGGESTIONs are printed after every check and NEVER touch the exit code.
|
||||||
# factory-audit's SKILL.md Step 4 report counts them into its
|
# 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).
|
# rather than another silently-ignored warning (ADR-0013).
|
||||||
suggestions.append(msg)
|
suggestions.append(msg)
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ except FrontmatterError as exc:
|
|||||||
|
|
||||||
dir_name = os.path.basename(skill_dir)
|
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
|
# 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
|
# 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
|
# apply to it — the audit's own references/skill-description-quality.md Step 0 says
|
||||||
@@ -211,8 +211,8 @@ if desc:
|
|||||||
else:
|
else:
|
||||||
fail("description field is missing or empty")
|
fail("description field is missing or empty")
|
||||||
|
|
||||||
# description length — agentskills.io spec backstop. UNCHANGED by ADR-0020:
|
# description length — agentskills.io spec backstop. UNCHANGED by the context budget:
|
||||||
# 1024 is the specification's hard limit, and the ADR-0020 budget gate below
|
# 1024 is the specification's hard limit, and the context-budget gate below
|
||||||
# sits underneath it rather than replacing it.
|
# sits underneath it rather than replacing it.
|
||||||
if desc:
|
if desc:
|
||||||
dlen = len(desc)
|
dlen = len(desc)
|
||||||
@@ -295,12 +295,12 @@ MAX_LINES = 500
|
|||||||
# for the full measurement.
|
# for the full measurement.
|
||||||
MAX_WORDS = 2770
|
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
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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.
|
# prompt of a fresh context rather than competing with a live conversation.
|
||||||
#
|
#
|
||||||
@@ -331,33 +331,33 @@ else:
|
|||||||
|
|
||||||
body = content[body_start:]
|
body = content[body_start:]
|
||||||
|
|
||||||
# --- ADR-0020: description budget -----------------------------------------
|
# --- context budget: description budget ------------------------------------
|
||||||
if desc:
|
if desc:
|
||||||
dlen = len(desc)
|
dlen = len(desc)
|
||||||
if dlen > DESC_MAX_CHARS:
|
if dlen > DESC_MAX_CHARS:
|
||||||
fail(f"description is {dlen} chars — exceeds the {DESC_MAX_CHARS}-character "
|
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"skill is invoked. Keep a trigger clause, at most one capability clause, "
|
||||||
f"and a boundary clause; move capability enumeration, output-format detail, "
|
f"and a boundary clause; move capability enumeration, output-format detail, "
|
||||||
f"composition notes and implementation detail to the body or a references/ file")
|
f"composition notes and implementation detail to the body or a references/ file")
|
||||||
elif dlen > DESC_SUGGEST_CHARS and not by_hand:
|
elif dlen > DESC_SUGGEST_CHARS and not by_hand:
|
||||||
suggest(f"description is {dlen} chars — over the {DESC_SUGGEST_CHARS}-character "
|
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"what moves the corpus average; the FAIL tier only stops outliers")
|
||||||
elif by_hand:
|
elif by_hand:
|
||||||
ok(f"description length {dlen} chars (hand-invoked: the {DESC_SUGGEST_CHARS}-character "
|
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)")
|
f"routing target does not apply, the {DESC_MAX_CHARS}-character ceiling still does)")
|
||||||
else:
|
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.
|
# Counts the BODY ONLY — everything after the closing --- of the frontmatter.
|
||||||
# This is a different measurement from MAX_WORDS above, which counts the whole
|
# This is a different measurement from MAX_WORDS above, which counts the whole
|
||||||
# file including frontmatter as a spec-conformance backstop. Both are reported.
|
# file including frontmatter as a spec-conformance backstop. Both are reported.
|
||||||
body_word_count = len(body.split())
|
body_word_count = len(body.split())
|
||||||
if body_word_count > BODY_MAX_WORDS:
|
if body_word_count > BODY_MAX_WORDS:
|
||||||
fail(f"SKILL.md body is {body_word_count} words — exceeds the {BODY_MAX_WORDS}-word "
|
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"limit above). Move lookup tables, spec restatements, output schemas, templates "
|
||||||
f"and rationale prose to references/ behind an explicit "
|
f"and rationale prose to references/ behind an explicit "
|
||||||
f"\"If X, read `references/file.md`\" trigger. At two or more mutually exclusive "
|
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")
|
f"common to every branch, each flow gets its own self-contained references/ file")
|
||||||
elif body_word_count > BODY_SUGGEST_WORDS:
|
elif body_word_count > BODY_SUGGEST_WORDS:
|
||||||
suggest(f"SKILL.md body is {body_word_count} words — over the {BODY_SUGGEST_WORDS}-word "
|
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:
|
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 -----------------------------------------
|
# --- Reference pointers must exist -----------------------------------------
|
||||||
# FAIL, not SUGGESTION: a dispatch table naming a references/ file that is not
|
# 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"{round(100.0 * GOTCHA_MAX_BODY_FRACTION)}% guideline. Move the durable "
|
||||||
f"parts to references/ and keep the section for live traps")
|
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
|
# SUGGESTION, not FAIL: detecting the absence is deterministic, but whether
|
||||||
# this particular skill warrants a boundary clause is judgment. Both accepted
|
# this particular skill warrants a boundary clause is judgment. Both accepted
|
||||||
# shapes count — the prose markers and the compressed `Not <thing> -> <name>`.
|
# shapes count — the prose markers and the compressed `Not <thing> -> <name>`.
|
||||||
@@ -417,7 +417,7 @@ elif desc:
|
|||||||
ok("description has a boundary clause")
|
ok("description has a boundary clause")
|
||||||
elif status == 'absent':
|
elif status == 'absent':
|
||||||
suggest("description has no boundary clause — add the prose form (\"Do not use "
|
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")
|
"so the router knows where NOT to send this skill")
|
||||||
else:
|
else:
|
||||||
suggest("description has an arrow boundary clause (\"Not X -> y\") from which no "
|
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"nothing. Split it into one arrow per target: \"Not X -> {first}. "
|
||||||
f"Not Y -> {second}.\"")
|
f"Not Y -> {second}.\"")
|
||||||
|
|
||||||
# --- ADR-0020: resolvable boundary targets ---------------------------------
|
# --- resolvable boundary targets -------------------------------------------
|
||||||
# The resolution universe comes from the SKILL's own location: the authoring
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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.
|
# 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.
|
# lib-boundary-resolver.sh, instead of being embedded twice.
|
||||||
#
|
#
|
||||||
# Detection never guesses. A target that matches neither shape is a hard exit 2
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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() {
|
make_apm_agent_with_desc() {
|
||||||
local root="$1" name="$2" desc="$3"
|
local root="$1" name="$2" desc="$3"
|
||||||
mkdir -p "$root/.apm/agents"
|
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
|
# Agents take the SAME description gates as skills: name + description is
|
||||||
# preloaded into every session identically. Agents take NO body word gate — see
|
# preloaded into every session identically. Agents take NO body word gate — see
|
||||||
# the final test in this block, which pins that asymmetry.
|
# 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"
|
local root="$TMPDIR/pkg"
|
||||||
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 250)"
|
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 250)"
|
||||||
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
||||||
@@ -685,7 +685,7 @@ EOF
|
|||||||
refute_output --partial "SUGGESTION"
|
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"
|
local root="$TMPDIR/pkg"
|
||||||
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 251)"
|
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 251)"
|
||||||
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
||||||
@@ -694,7 +694,7 @@ EOF
|
|||||||
assert_output --partial "description is 251 chars"
|
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"
|
local root="$TMPDIR/pkg"
|
||||||
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 400)"
|
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 400)"
|
||||||
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
||||||
@@ -702,16 +702,16 @@ EOF
|
|||||||
assert_output --partial "SUGGESTION"
|
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"
|
local root="$TMPDIR/pkg"
|
||||||
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 401)"
|
make_apm_agent_with_desc "$root" "my-agent" "$(desc_of_length 401)"
|
||||||
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
run bash "$SCRIPT" "$root/.apm/agents/my-agent.agent.md"
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial "description is 401 chars"
|
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"
|
local root="$TMPDIR/pkg"
|
||||||
mkdir -p "$root/.apm/agents"
|
mkdir -p "$root/.apm/agents"
|
||||||
cat > "$root/apm.yml" <<EOF
|
cat > "$root/apm.yml" <<EOF
|
||||||
@@ -735,7 +735,7 @@ EOF
|
|||||||
assert_output --partial "description is 450 chars"
|
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 root="$TMPDIR/project"
|
||||||
local desc
|
local desc
|
||||||
desc="$(python3 -c "print('x' * 401)")"
|
desc="$(python3 -c "print('x' * 401)")"
|
||||||
@@ -758,10 +758,10 @@ You are a test agent. When invoked, do the thing.
|
|||||||
EOF
|
EOF
|
||||||
run bash "$SCRIPT" "$root/.claude/agents/my-agent.md"
|
run bash "$SCRIPT" "$root/.claude/agents/my-agent.md"
|
||||||
assert_failure
|
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"
|
local root="$TMPDIR/pkg"
|
||||||
mkdir -p "$root/.apm/agents"
|
mkdir -p "$root/.apm/agents"
|
||||||
cat > "$root/apm.yml" <<EOF
|
cat > "$root/apm.yml" <<EOF
|
||||||
@@ -771,9 +771,9 @@ type: skill
|
|||||||
EOF
|
EOF
|
||||||
# Deliberate asymmetry, not an oversight: a skill body is loaded into the
|
# Deliberate asymmetry, not an oversight: a skill body is loaded into the
|
||||||
# caller's context and competes with the live conversation, while an agent
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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.
|
# 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$`)
|
# exported Vale hook matches with `(^|/)agents/[^/]+\.md$`)
|
||||||
#
|
#
|
||||||
# A misclassification here is silent and total — the skill rubric would run
|
# 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
|
# against an agent file, so ADR-0022's metadata.version and the 900-word
|
||||||
# body ceiling would both be applied to an artifact that ADR-0020 explicitly
|
# 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
|
# exempts from the latter (see the 1,500-word body test above, which AGENTS.md
|
||||||
# cites as the pin for that asymmetry).
|
# cites as the pin for that asymmetry).
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ setup() {
|
|||||||
|
|
||||||
# Helper: create a minimal valid skill directory.
|
# 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
|
# missing-boundary-clause SUGGESTION fires on any description without one, so
|
||||||
# a fixture that omits it is never "otherwise clean" — every test asserting
|
# a fixture that omits it is never "otherwise clean" — every test asserting
|
||||||
# SUGGESTION-freedom would be asserting the boundary check's absence instead
|
# 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
|
# Helper: create a skill directory with an exact description length and an
|
||||||
# exact body word count. <desc> is used verbatim; <body_words> "word"
|
# 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() {
|
make_sized_skill() {
|
||||||
local dir="$1" desc="$2" body_words="$3"
|
local dir="$1" desc="$2" body_words="$3"
|
||||||
local name
|
local name
|
||||||
@@ -136,7 +136,7 @@ teardown() {
|
|||||||
assert_success
|
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 skill="$TMPDIR/my-skill"
|
||||||
local name
|
local name
|
||||||
name="$(basename "$skill")"
|
name="$(basename "$skill")"
|
||||||
@@ -155,10 +155,10 @@ Do the thing.
|
|||||||
EOF
|
EOF
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
# Two independent gates on one value: the spec limit still PASSES at
|
# 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.
|
# 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 "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
|
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
|
# These sit UNDER the agentskills.io 1024-character spec backstop above, which
|
||||||
# is unchanged. Both ceilings are inclusive: exactly at the number passes that
|
# is unchanged. Both ceilings are inclusive: exactly at the number passes that
|
||||||
# tier, one past it trips.
|
# 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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "$(desc_of_length 250)" 10
|
make_sized_skill "$skill" "$(desc_of_length 250)" 10
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -536,7 +536,7 @@ PY
|
|||||||
refute_output --partial "SUGGESTION"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "$(desc_of_length 251)" 10
|
make_sized_skill "$skill" "$(desc_of_length 251)" 10
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -546,7 +546,7 @@ PY
|
|||||||
assert_output --partial "All checks passed (1 suggestion(s))."
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "$(desc_of_length 400)" 10
|
make_sized_skill "$skill" "$(desc_of_length 400)" 10
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -554,16 +554,16 @@ PY
|
|||||||
assert_output --partial "SUGGESTION"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "$(desc_of_length 401)" 10
|
make_sized_skill "$skill" "$(desc_of_length 401)" 10
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial "description is 401 chars"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
mkdir -p "$skill"
|
mkdir -p "$skill"
|
||||||
# A >-folded block scalar: 11 lines of 40 chars folded with 10 joining
|
# A >-folded block scalar: 11 lines of 40 chars folded with 10 joining
|
||||||
@@ -582,17 +582,17 @@ PY
|
|||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial "description is 450 chars"
|
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
|
# Distinct from the 2,770-word whole-file spec ceiling above, which counts
|
||||||
# frontmatter too and is unchanged. Do not unify them.
|
# 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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 600
|
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 600
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -600,7 +600,7 @@ PY
|
|||||||
refute_output --partial "SUGGESTION"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 601
|
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 601
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -609,7 +609,7 @@ PY
|
|||||||
assert_output --partial "All checks passed (1 suggestion(s))."
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 900
|
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 900
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -617,16 +617,16 @@ PY
|
|||||||
assert_output --partial "body is 900 words"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 901
|
make_sized_skill "$skill" "A short valid description. Do not use for anything else." 901
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output --partial "body is 901 words"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
# 895 body words plus a description long enough that the WHOLE FILE is well
|
# 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
|
# 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
|
make_sized_skill "$skill" "$(python3 -c "print(' '.join(['w'] * 100))")" 895
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
assert_success
|
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
|
# Resolved against the AUTHORING SOURCE (plugins/*/.apm/skills/ and
|
||||||
# plugins/*/.apm/agents/), never .claude/skills/, so the check works offline 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.
|
# 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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# `fixture-sibling-skill` is the corroborator: a prose-form target only earns
|
# `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'"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# Same grammar as the case above and as "run \`pre-commit\` instead" — a
|
# 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"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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'"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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'"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# The escape hatch from the SUGGESTION tier: `/name` and `-> name` are never
|
# 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'"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# "run pre-commit hooks" is pc-run's real phrasing. A naive extractor reads
|
# "run pre-commit hooks" is pc-run's real phrasing. A naive extractor reads
|
||||||
@@ -732,10 +732,10 @@ PY
|
|||||||
refute_output --partial "pre-commit"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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.
|
# 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
|
make_sized_skill "$skill" "Reproduce → minimise → instrument → fix → regression-test. Use when a bug is reported." 10
|
||||||
run bash "$SCRIPT" "$skill"
|
run bash "$SCRIPT" "$skill"
|
||||||
@@ -743,7 +743,7 @@ PY
|
|||||||
refute_output --partial "regression-test"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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'"
|
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
|
# 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
|
# 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
|
# 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
|
# A skill carrying `disable-model-invocation: true` is absent from the
|
||||||
# model-visible listing entirely: not preloaded, and the Skill tool refuses to
|
# model-visible listing entirely: not preloaded, and the Skill tool refuses to
|
||||||
@@ -815,7 +815,7 @@ make_hand_invoked_skill() {
|
|||||||
} > "$dir/SKILL.md"
|
} > "$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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_hand_invoked_skill "$skill" \
|
make_hand_invoked_skill "$skill" \
|
||||||
"Tell the agent to zoom out and give broader context or a higher level perspective." 10
|
"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"
|
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
|
# The control. Without it the case above is satisfied by an audit that
|
||||||
# stopped checking boundary clauses altogether.
|
# stopped checking boundary clauses altogether.
|
||||||
local skill="$TMPDIR/my-skill"
|
local skill="$TMPDIR/my-skill"
|
||||||
@@ -836,7 +836,7 @@ make_hand_invoked_skill() {
|
|||||||
assert_output --partial "has no boundary clause"
|
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"
|
local skill="$TMPDIR/my-skill"
|
||||||
make_hand_invoked_skill "$skill" \
|
make_hand_invoked_skill "$skill" \
|
||||||
"$(python3 -c "print('Tell the agent to zoom out. ' + 'x' * 273)")" 10
|
"$(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"
|
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
|
# 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
|
# routing-quality target: a hand-invoked description is still the one line
|
||||||
# the user reads when choosing from the `/` menu.
|
# the user reads when choosing from the `/` menu.
|
||||||
@@ -857,7 +857,7 @@ make_hand_invoked_skill() {
|
|||||||
assert_output --partial "400-character"
|
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
|
# 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.
|
# with the caller's live conversation the same way, so no body tier moves.
|
||||||
local skill="$TMPDIR/my-skill"
|
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
|
# 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
|
# continuation is wired to the prose route verbs and never to arrows. So this
|
||||||
@@ -878,7 +878,7 @@ make_hand_invoked_skill() {
|
|||||||
# extractor widened.
|
# 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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# A bare `Not ... ->` sentence carries no BOUNDARY_MARKER, so the backtick
|
# 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"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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
|
# `[^.;]` 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
|
# 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.
|
# 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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-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
|
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"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# The silent half of #110: this clause produced no target at all, so it was
|
# 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'"
|
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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# A single-word target is deliberately not matchable bare, because
|
# 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
|
# boundary_clause_status() used to test `BOUNDARY_ARROW.search(description) and
|
||||||
# not _arrow_targets(description)`. Both operands took the WHOLE description,
|
# 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.
|
# 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
|
local skill
|
||||||
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
skill="$(make_fixture_tree "$TMPDIR/tree" "my-skill")"
|
||||||
# Written by hand rather than through make_sized_skill: the `>` folded
|
# 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
|
# 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
|
# 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
|
# default raised UnicodeEncodeError while PRINTING — after every check had
|
||||||
# already run, losing the whole report at the last step.
|
# 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`.
|
Not read-only review -> `factory-audit`. Not agent files -> `agent-author`.
|
||||||
allowed-tools: Bash Read Write Edit
|
allowed-tools: Bash Read Write Edit
|
||||||
metadata:
|
metadata:
|
||||||
version: "1.0.7"
|
version: "1.0.8"
|
||||||
category: factory
|
category: factory
|
||||||
source_keys:
|
source_keys:
|
||||||
- agentskills-home
|
- agentskills-home
|
||||||
@@ -55,6 +55,6 @@ Gates `/factory-audit` enforces in both flows:
|
|||||||
|
|
||||||
## Step 4 — Validate and close
|
## 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.
|
Bump `metadata.version`: the **minor** version on create (new skills start at `0.1.0`) and the **patch** version on improve.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name: kyberforge
|
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.
|
description: Skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code and GitHub Copilot.
|
||||||
author:
|
author:
|
||||||
name: Mortis
|
name: Mortis
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"PreToolUse": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"command": "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/route-through-rtk.sh",
|
||||||
|
"timeout": 10,
|
||||||
|
"type": "command"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"matcher": "Bash"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# PreToolUse hook: route a Bash tool call through `rtk hook claude`, which may
|
||||||
|
# rewrite the command to its rtk-prefixed form. rtk's output is passed through
|
||||||
|
# when rtk succeeds. The hook always exits 0: a PreToolUse exit 2 blocks the tool
|
||||||
|
# call, and rtk exits 2 on a usage error (e.g. an rtk without `hook claude`), so
|
||||||
|
# any rtk failure is swallowed and the call proceeds unchanged. Without rtk on
|
||||||
|
# PATH it does nothing. Limits: the rtk plugin's README.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# apm could deploy this file to other runtimes, where it must do nothing.
|
||||||
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/"
|
||||||
|
case "$here" in
|
||||||
|
*/.claude/hooks/*) ;;
|
||||||
|
*) exit 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
command -v rtk > /dev/null 2>&1 || exit 0
|
||||||
|
|
||||||
|
# stdin (the hook payload) is inherited by rtk inside the substitution.
|
||||||
|
out="$(rtk hook claude)" || exit 0
|
||||||
|
[[ -z "$out" ]] || printf '%s\n' "$out"
|
||||||
|
exit 0
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
# rtk
|
||||||
|
|
||||||
|
A Claude Code hook that routes Bash tool calls through rtk, the token-saving command wrapper, when rtk is installed.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
apm is the only supported install path (ADR-0024). Declare this package in the consuming project's `apm.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dependencies:
|
||||||
|
apm:
|
||||||
|
- git: https://git.rkdr.net/Mortis/Holocron.git
|
||||||
|
path: plugins/rtk
|
||||||
|
```
|
||||||
|
|
||||||
|
Then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apm install
|
||||||
|
```
|
||||||
|
|
||||||
|
The entry above is unpinned and tracks the remote's default branch. To pin a release, add `ref: rtk-v<x.y.z>` after `path:`; see [Pinning a plugin to a release](../../README.md#pinning-a-plugin-to-a-release).
|
||||||
|
|
||||||
|
The plugin is opt-in: nothing else in the marketplace depends on it. It does not run `rtk init` and changes no rtk configuration.
|
||||||
|
|
||||||
|
**Native plugin installs do not work.** This package ships no per-plugin manifest and no flat content directories, so a host that installs it natively gets nothing — and Claude Code raises no error while doing it (ADR-0024).
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
| Component | Path | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| Hooks | `.apm/hooks/` | `route-through-rtk.sh`, see [Routing hook](#routing-hook) |
|
||||||
|
|
||||||
|
`.apm/` is the authoring source and the only thing apm deploys (ADR-0024).
|
||||||
|
|
||||||
|
## Routing hook
|
||||||
|
|
||||||
|
On Claude Code, a `PreToolUse` hook on the Bash tool passes each call to `rtk hook claude`. rtk decides whether to rewrite the command, for example `git status` to `rtk git status`, and the hook passes rtk's answer back to Claude Code unchanged. A command rtk does not handle runs as written.
|
||||||
|
|
||||||
|
- **Without rtk on `PATH`,** the hook exits 0 and prints nothing, so the command runs as written.
|
||||||
|
- **Claude Code only.** The package targets `claude`, and the script does nothing unless it runs from a `.claude/hooks/` path.
|
||||||
|
- **Tested with rtk 0.42.4.** Older versions may lack `rtk hook claude`.
|
||||||
|
|
||||||
|
### Rewritten commands may come back pre-approved
|
||||||
|
|
||||||
|
rtk's answer can carry `permissionDecision: allow`, which skips Claude Code's permission prompt for the rewritten command. The hook passes that through. Hooks here are guardrails, not the safety boundary (ADR-0032); if you rely on the permission prompt for Bash, do not install this plugin.
|
||||||
|
|
||||||
|
### Overlap with a global rtk hook
|
||||||
|
|
||||||
|
`rtk init -g` installs rtk's own hook into `~/.claude/settings.json`. Check for one with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rtk init --show
|
||||||
|
```
|
||||||
|
|
||||||
|
Running both is harmless: rtk leaves a command that already starts with `rtk` alone, so the second hook does nothing. It still runs rtk twice per Bash call, so keep one of the two — this plugin for a per-project install that apm keeps up to date, or the global hook for every project on the machine.
|
||||||
|
|
||||||
|
### Approval
|
||||||
|
|
||||||
|
The hook is an executable primitive, so whether it deploys depends on the `executables:` block in the consuming project's `apm.yml`:
|
||||||
|
|
||||||
|
- **No `executables:` block:** hooks deploy without approval.
|
||||||
|
- **With an `executables:` block:** the hook is parked until it is granted. Grant it in one of two ways, then run `apm install` and commit the `executables` entry:
|
||||||
|
- `apm approve` writes the entry and pins it to the hook's content, so a later change to the script needs approval again.
|
||||||
|
- A hand-written entry under the full package identity is not pinned:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
executables:
|
||||||
|
allow:
|
||||||
|
git.rkdr.net/Mortis/Holocron/plugins/rtk:
|
||||||
|
hooks: true
|
||||||
|
```
|
||||||
|
|
||||||
|
The first `apm approve` in a project creates the block and so turns the gate on. The next install then parks every other package's unapproved executables.
|
||||||
|
|
||||||
|
This repo hand-writes its grant in the root `apm.yml` and does not run `apm approve`.
|
||||||
|
|
||||||
|
### "ambiguous duplicate APM-owned hook entry"
|
||||||
|
|
||||||
|
`apm audit` raises this error, with or without `--ci`, unless drift checking is off with `--no-drift`. It reports it as a drift finding on `.claude/settings.json`. `apm export-patch` runs the same check. `apm install --frozen` runs it too, but reports only that an APM-managed hook entry was edited or removed. The cause is `.claude/settings.json` holding more byte-identical copies of an APM-owned hook entry than `.claude/apm-hooks.json` records. It happens when the same hook entry is pasted in by hand or merged in twice. To fix it, remove the duplicate entries from `.claude/settings.json`, keeping none of the hand-added copies, then run `apm install` again.
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
Defame1297
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
name: rtk
|
||||||
|
version: 0.1.0
|
||||||
|
description: A Claude Code hook that routes Bash tool calls through rtk, the token-saving command wrapper, when rtk is installed.
|
||||||
|
author:
|
||||||
|
name: Mortis
|
||||||
|
url: https://git.rkdr.net/Mortis/
|
||||||
|
license: MIT
|
||||||
|
homepage: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/rtk
|
||||||
|
repository: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/rtk
|
||||||
|
keywords:
|
||||||
|
- rtk
|
||||||
|
- hooks
|
||||||
|
- tokens
|
||||||
|
# Which agent platforms to deploy to.
|
||||||
|
# Resolution order: --target flag > this field > auto-detect from filesystem.
|
||||||
|
# Accepted values: agent-skills, antigravity, claude, codex, copilot, cursor, gemini, grok-build, kiro, opencode, windsurf
|
||||||
|
# Claude only: the hook speaks `rtk hook claude`. The script also refuses to act
|
||||||
|
# outside .claude/hooks/, in case a consumer forces another target.
|
||||||
|
targets:
|
||||||
|
- claude
|
||||||
|
type: hybrid
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
apm: []
|
||||||
|
mcp: []
|
||||||
|
includes: auto
|
||||||
|
devDependencies:
|
||||||
|
apm: []
|
||||||
|
scripts: {}
|
||||||
@@ -1,7 +1,23 @@
|
|||||||
{
|
{
|
||||||
|
"disableBundledSkills": true,
|
||||||
|
"enabledPlugins": {
|
||||||
|
"cc-plugin-easel@builtin": false,
|
||||||
|
"cc-plugin-plugin-authoring@builtin": false
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"CLAUDE_CODE_DISABLE_SHIP": "1"
|
||||||
|
},
|
||||||
|
"skillOverrides": {
|
||||||
|
"design": "off",
|
||||||
|
"doctor": "off",
|
||||||
|
"init": "off",
|
||||||
|
"plugin-authoring": "off"
|
||||||
|
},
|
||||||
"statusLine": {
|
"statusLine": {
|
||||||
"command": "bash ~/.claude/statusline-command.sh",
|
"command": "bash ~/.claude/statusline-command.sh",
|
||||||
"type": "command"
|
"type": "command"
|
||||||
},
|
},
|
||||||
|
"syncClaudeAiPlugins": false,
|
||||||
|
"syncClaudeAiSkills": false,
|
||||||
"theme": "dark"
|
"theme": "dark"
|
||||||
}
|
}
|
||||||
+283
-2
@@ -47,7 +47,8 @@
|
|||||||
# discarded precisely where it earns its keep.
|
# discarded precisely where it earns its keep.
|
||||||
#
|
#
|
||||||
# The waiver is therefore narrow on three axes, and fails closed on each:
|
# The waiver is therefore narrow on three axes, and fails closed on each:
|
||||||
# 1. the root manifest is never waived, whatever it reports
|
# 1. the root manifest is never waived for it (the root's own, separate
|
||||||
|
# waiver is described below)
|
||||||
# 2. the failing check must be `lockfile-exists` and no other -- the
|
# 2. the failing check must be `lockfile-exists` and no other -- the
|
||||||
# "1 of 1 check(s) failed" assertion is what makes that true, since any
|
# "1 of 1 check(s) failed" assertion is what makes that true, since any
|
||||||
# second failing check changes the count and the run fails normally
|
# second failing check changes the count and the run fails normally
|
||||||
@@ -57,6 +58,86 @@
|
|||||||
# line silently turns the waiver off, which fails the push rather than hiding a
|
# line silently turns the waiver off, which fails the push rather than hiding a
|
||||||
# defect. If that happens, re-verify against the new output and update the two
|
# defect. If that happens, re-verify against the new output and update the two
|
||||||
# patterns below rather than widening them.
|
# patterns below rather than widening them.
|
||||||
|
#
|
||||||
|
# THE SECOND WAIVER: A PLUGIN NOT YET ON origin/main (ROOT MANIFEST ONLY)
|
||||||
|
#
|
||||||
|
# Root apm.yml's first-party dependencies resolve from the remote's `main`
|
||||||
|
# (ADR-0019), so the lock cannot record a plugin until that plugin has landed.
|
||||||
|
# check-executables-allow-sync.sh meanwhile requires a hook- or bin-shipping
|
||||||
|
# plugin to have its git+path entry in root apm.yml before it can be pushed at
|
||||||
|
# all. Together they make a first-landing executable-shipping plugin
|
||||||
|
# unpushable: the entry is mandatory, and the root `ref-consistency` check then
|
||||||
|
# fails it as `<identity>/plugins/<name>: not found in lockfile`. Verified on
|
||||||
|
# apm 0.39.3 (#179): a failing ref-consistency cuts the root run short at three
|
||||||
|
# checks (lockfile-exists, ref-consistency, drift), so the sole-failure line is
|
||||||
|
# `1 of 3 check(s) failed`.
|
||||||
|
#
|
||||||
|
# So the root manifest's audit is waived when, and only when, ALL of these hold:
|
||||||
|
# 1. the failure count is exactly "1 of 3 check(s) failed" and the one
|
||||||
|
# failing row is ref-consistency -- any second failure changes the count
|
||||||
|
# 2. the ref-consistency details block exists and EVERY line in it reads
|
||||||
|
# `<identity>/plugins/<name>: not found in lockfile`, where <identity> is
|
||||||
|
# the one root apm.yml's own git+path entry for plugins/<name> yields,
|
||||||
|
# derived by check-executables-allow-sync.sh's rule
|
||||||
|
# 3. plugins/<name>/apm.yml exists in the working tree
|
||||||
|
# 4. plugins/<name>/apm.yml is absent from the LOCAL origin/main ref -- no
|
||||||
|
# fetch, the hook stays offline -- and origin/main must resolve
|
||||||
|
# 5. a re-run of `apm audit --ci` against the root with those plugins'
|
||||||
|
# `dependencies.apm` entries removed passes with "All 15 check(s) passed"
|
||||||
|
# Anything else, including output in a shape not recognised here, fails the
|
||||||
|
# push. The waiver lapses for a plugin by itself: once it is on origin/main,
|
||||||
|
# condition 4 is false and the follow-up lock PR has to record it.
|
||||||
|
#
|
||||||
|
# WHY THE RE-RUN (CONDITION 5)
|
||||||
|
#
|
||||||
|
# The cut-short run is exactly the problem: while ref-consistency fails, apm
|
||||||
|
# never runs the other twelve root checks (content-integrity,
|
||||||
|
# hook-approval-pins, local-bundle-hooks, exec-status-current,
|
||||||
|
# deployed-files-present, ...), so waiving the three-check run alone would let
|
||||||
|
# a defect in any of them through. Removing the unlanded plugins' entries is
|
||||||
|
# the one change that makes ref-consistency pass, and apm then runs the full
|
||||||
|
# set. Verified on apm 0.39.3 (#179): this branch's root, so reduced, prints
|
||||||
|
# "All 15 check(s) passed". The count is asserted, not just the exit code, so
|
||||||
|
# an apm that runs fewer checks, or adds one, fails closed until re-verified.
|
||||||
|
#
|
||||||
|
# The re-run happens in a SCRATCH COPY, never in place. The working tree minus
|
||||||
|
# .git and .venv is copied with tar into a mktemp -d dir, apm.yml is reduced
|
||||||
|
# there, and apm runs there. An in-place swap of apm.yml guarded by a trap was
|
||||||
|
# the alternative and is weaker: no trap survives SIGKILL or a power cut, and
|
||||||
|
# for the swap's duration a concurrent apm (the SessionStart hook, another
|
||||||
|
# shell) would read the reduced manifest. The copy never writes the working
|
||||||
|
# tree at all, so it is byte-identical afterwards whatever happens; at worst a
|
||||||
|
# killed run leaks a temp dir. What the copy holds, and why:
|
||||||
|
# * everything apm reads for the root audit -- apm.yml, apm.lock.yaml,
|
||||||
|
# apm_modules/ (the cache-only replay's source), .claude/ and every other
|
||||||
|
# deployed tree (deployed-files-present, content-integrity, drift), and
|
||||||
|
# the plugins/ sources the marketplace and local entries name. Copying the
|
||||||
|
# whole tree rather than a hand-picked list means a check that starts
|
||||||
|
# reading another path cannot silently see an empty one.
|
||||||
|
# * NOT .git: from a linked worktree it is a pointer file into the shared
|
||||||
|
# gitdir, and a git command run in the copy could then refresh that
|
||||||
|
# worktree's real index. A fresh `git init` stands in for it, carrying the
|
||||||
|
# two pieces of git state apm reads: the origin remote's URL (org-policy
|
||||||
|
# discovery; the copy prints the same policy line the real root does) and
|
||||||
|
# the repo's info/exclude, copied from `git rev-parse --git-path
|
||||||
|
# info/exclude` (which resolves to the shared gitdir in a linked worktree)
|
||||||
|
# when it exists. deployed-files-present runs `git check-ignore` on each
|
||||||
|
# lock-recorded path that is absent, and an absent path ignored only
|
||||||
|
# through info/exclude must not count as missing in the copy either.
|
||||||
|
# .gitignore files travel with the tree, and core.excludesFile is the same
|
||||||
|
# user-level config for both runs.
|
||||||
|
# * NOT .venv: apm runs through `uv run --project <repo root>`, so the
|
||||||
|
# environment is the real one; .venv is no apm input and most of the size.
|
||||||
|
# * NOT .claude/worktrees: Claude Code's linked worktrees, each a full
|
||||||
|
# checkout that can carry its own .venv. They are ignored through
|
||||||
|
# info/exclude, and no root check reads them: deployed-files-present and
|
||||||
|
# content-integrity look up lock-recorded paths, none of which is under
|
||||||
|
# .claude/worktrees, and drift compares the replay's deployed files
|
||||||
|
# against the same paths in the tree. Leaving them out hides nothing the
|
||||||
|
# real audit would see.
|
||||||
|
# Only list items under `dependencies:` > `apm:` whose `path:` names a waived
|
||||||
|
# plugin are removed (comments and every other line kept), and the result is
|
||||||
|
# checked to differ from the original by deletions only, each waived entry gone.
|
||||||
|
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
@@ -74,6 +155,194 @@ require_apm_version || exit 1
|
|||||||
|
|
||||||
readonly WAIVED_CHECK='declares dependencies but apm.lock.yaml is absent'
|
readonly WAIVED_CHECK='declares dependencies but apm.lock.yaml is absent'
|
||||||
readonly SOLE_FAILURE='1 of 1 check(s) failed'
|
readonly SOLE_FAILURE='1 of 1 check(s) failed'
|
||||||
|
readonly REF_SOLE_FAILURE='1 of 3 check(s) failed'
|
||||||
|
readonly REF_FAILED_ROW='^\| \[x\] +\| ref-consistency +\|'
|
||||||
|
readonly REF_DETAILS_HEADER=' ref-consistency details:'
|
||||||
|
# The name must start alphanumeric, which rules out `.` and `..`; `..`
|
||||||
|
# anywhere else is rejected separately in ref_waivable.
|
||||||
|
readonly REF_DETAIL='^ - (.+)/plugins/([A-Za-z0-9][A-Za-z0-9._-]*): not found in lockfile$'
|
||||||
|
readonly ROOT_FULL_PASS='All 15 check(s) passed'
|
||||||
|
|
||||||
|
# dep_identity <plugin dir name> -- the identity root apm.yml's git+path entry
|
||||||
|
# for plugins/<name> yields: <host>/<owner>/<repo>/plugins/<name>. The URL rule
|
||||||
|
# is check-executables-allow-sync.sh's identity(): drop the scheme (or turn an
|
||||||
|
# scp-like host:path into host/path), any user@, a trailing / and .git. Empty
|
||||||
|
# when there is no such entry. A line scan of the one shape root apm.yml uses
|
||||||
|
# (`dependencies:` > `apm:` > `- git:` / `path:` items), not a YAML parse: an
|
||||||
|
# entry in any other shape yields nothing, and so fails closed.
|
||||||
|
dep_identity() {
|
||||||
|
local want="plugins/$1" url
|
||||||
|
url="$(awk -v want="$want" '
|
||||||
|
function unq(v) {
|
||||||
|
sub(/^[ \t]+/, "", v); sub(/[ \t]+$/, "", v)
|
||||||
|
if (v ~ /^".*"$/ || v ~ /^\047.*\047$/) v = substr(v, 2, length(v) - 2)
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
function flush() { if (g != "" && p == want) print g; g = ""; p = "" }
|
||||||
|
/^[ \t]*(#|$)/ { next }
|
||||||
|
/^[^ ]/ { flush(); in_deps = ($0 ~ /^dependencies:/); in_apm = 0; next }
|
||||||
|
!in_deps { next }
|
||||||
|
/^ [^ ]/ { flush(); in_apm = ($0 ~ /^ apm:/); next }
|
||||||
|
!in_apm { next }
|
||||||
|
/^ - / { flush(); sub(/^ - /, " ") }
|
||||||
|
/^ git:/ { v = $0; sub(/^ git:/, "", v); g = unq(v); next }
|
||||||
|
/^ path:/ { v = $0; sub(/^ path:/, "", v); p = unq(v); sub(/^\.\//, "", p); sub(/\/$/, "", p); next }
|
||||||
|
END { flush() }
|
||||||
|
' apm.yml 2>/dev/null | head -n 1)"
|
||||||
|
[ -n "$url" ] || return 0
|
||||||
|
if [[ "$url" == *://* ]]; then
|
||||||
|
url="${url#*://}"
|
||||||
|
elif [[ "$url" == *:* ]]; then
|
||||||
|
url="${url/://}"
|
||||||
|
fi
|
||||||
|
url="${url#*@}"
|
||||||
|
url="${url%/}"
|
||||||
|
url="${url%.git}"
|
||||||
|
printf '%s/%s' "$url" "$want"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ref_waivable <audit output> -- succeeds, printing each waived plugin dir name
|
||||||
|
# on its own line, only when the root output is exactly the unlanded-plugin
|
||||||
|
# ref-consistency failure described in the header. Otherwise prints why on
|
||||||
|
# stderr and fails.
|
||||||
|
ref_waivable() {
|
||||||
|
local output="$1" details line identity name names=""
|
||||||
|
grep -qF "$REF_SOLE_FAILURE" <<<"$output" || return 1
|
||||||
|
grep -qE "$REF_FAILED_ROW" <<<"$output" || return 1
|
||||||
|
[ "$(grep -cxF "$REF_DETAILS_HEADER" <<<"$output")" -eq 1 ] || return 1
|
||||||
|
# The details block: every line after the header up to the first blank one.
|
||||||
|
details="$(awk -v h="$REF_DETAILS_HEADER" '
|
||||||
|
$0 == h { on = 1; next }
|
||||||
|
on && /^[ \t]*$/ { exit }
|
||||||
|
on { print }
|
||||||
|
' <<<"$output")"
|
||||||
|
[ -n "$details" ] || return 1
|
||||||
|
if ! git rev-parse --verify --quiet 'origin/main^{commit}' >/dev/null; then
|
||||||
|
echo 'apm audit --ci: ref-consistency not waived: origin/main does not resolve locally, so whether a plugin has landed is unknown' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [[ ! "$line" =~ $REF_DETAIL ]]; then
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: unrecognised detail line: $line" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
identity="${BASH_REMATCH[1]}"
|
||||||
|
name="${BASH_REMATCH[2]}"
|
||||||
|
if [[ "$name" == *..* ]]; then
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: plugin name '$name' contains '..'" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ "$identity/plugins/$name" != "$(dep_identity "$name")" ]; then
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: $identity/plugins/$name is not root apm.yml's git+path entry for plugins/$name" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ ! -f "plugins/$name/apm.yml" ]; then
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: plugins/$name/apm.yml is not in the working tree" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if git cat-file -e "origin/main:plugins/$name/apm.yml" 2>/dev/null; then
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: plugins/$name is already on origin/main, so the lock must record it" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
names+="$name"$'\n'
|
||||||
|
done <<<"$details"
|
||||||
|
printf '%s' "$names"
|
||||||
|
}
|
||||||
|
|
||||||
|
# reduce_manifest <names, one per line> -- prints apm.yml (cwd) with every
|
||||||
|
# `dependencies:` > `apm:` list item whose `path:` is plugins/<name> for a
|
||||||
|
# listed name removed, and every other line unchanged. Same line scan, and the
|
||||||
|
# same one shape, as dep_identity.
|
||||||
|
reduce_manifest() {
|
||||||
|
REDUCE_NAMES="$1" awk '
|
||||||
|
BEGIN { n = split(ENVIRON["REDUCE_NAMES"], a, "\n"); for (i = 1; i <= n; i++) if (a[i] != "") drop["plugins/" a[i]] = 1 }
|
||||||
|
function flush() { if (buf != "" && !(p in drop)) printf "%s", buf; buf = ""; p = ""; in_item = 0 }
|
||||||
|
/^[^ \t#]/ && $0 !~ /^$/ { flush(); in_deps = ($0 ~ /^dependencies:/); in_apm = 0; print; next }
|
||||||
|
!in_deps { print; next }
|
||||||
|
/^ [^ #]/ { flush(); in_apm = ($0 ~ /^ apm:/); print; next }
|
||||||
|
!in_apm { print; next }
|
||||||
|
/^ - / { flush(); in_item = 1; buf = $0 "\n"
|
||||||
|
v = $0; sub(/^ - /, "", v)
|
||||||
|
if (v ~ /^path:/) { sub(/^path:/, "", v); setp(v) }
|
||||||
|
next }
|
||||||
|
in_item && /^ / {
|
||||||
|
if ($0 ~ /^ path:/) { v = $0; sub(/^ path:/, "", v); setp(v) }
|
||||||
|
buf = buf $0 "\n"; next }
|
||||||
|
{ flush(); print }
|
||||||
|
function setp(v) {
|
||||||
|
sub(/^[ \t]+/, "", v); sub(/[ \t]+$/, "", v)
|
||||||
|
if (v ~ /^".*"$/ || v ~ /^\047.*\047$/) v = substr(v, 2, length(v) - 2)
|
||||||
|
sub(/^\.\//, "", v); sub(/\/$/, "", v); p = v
|
||||||
|
}
|
||||||
|
END { flush() }
|
||||||
|
' apm.yml
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRATCH=""
|
||||||
|
cleanup() { [ -z "$SCRATCH" ] || rm -rf "$SCRATCH"; }
|
||||||
|
trap cleanup EXIT
|
||||||
|
trap 'exit 130' INT
|
||||||
|
trap 'exit 143' TERM HUP
|
||||||
|
|
||||||
|
# reduced_root_audit <names, one per line> -- condition 5 of the second waiver:
|
||||||
|
# re-runs the root audit in a scratch copy with the named plugins' dependency
|
||||||
|
# entries removed (header, "WHY THE RE-RUN"). Succeeds only when that run exits
|
||||||
|
# 0 and reports the full root check set passing; otherwise prints why, and
|
||||||
|
# apm's output, on stderr and fails.
|
||||||
|
reduced_root_audit() {
|
||||||
|
local names="$1" origin exclude name rerun rc delta
|
||||||
|
SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/apm-audit-ci.XXXXXX")" || return 1
|
||||||
|
if ! tar -C . --exclude=./.git --exclude=./.venv --exclude=./.claude/worktrees -cf - . |
|
||||||
|
tar -C "$SCRATCH" -xf -; then
|
||||||
|
echo 'apm audit --ci: ref-consistency not waived: could not copy the tree for the re-run' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! reduce_manifest "$names" >"$SCRATCH/apm.yml"; then
|
||||||
|
echo 'apm audit --ci: ref-consistency not waived: could not reduce apm.yml for the re-run' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
# Deletions only: diff's normal format prints a `NdM` / `N,MdK` header and
|
||||||
|
# `< ` lines for each deleted range, and anything else is an addition or a
|
||||||
|
# change. A here-string, not a pipe into grep -q (see the axis-1 comment
|
||||||
|
# below), and an empty delta fails too: something must have been removed.
|
||||||
|
delta="$(diff apm.yml "$SCRATCH/apm.yml")"
|
||||||
|
if grep -qvE '^([0-9]+(,[0-9]+)?d[0-9]+|< .*|<)$' <<<"$delta"; then
|
||||||
|
echo 'apm audit --ci: ref-consistency not waived: reducing apm.yml changed more than the waived entries' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
while IFS= read -r name; do
|
||||||
|
[ -n "$name" ] || continue
|
||||||
|
if [ -n "$(cd "$SCRATCH" && dep_identity "$name")" ]; then
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: could not remove plugins/$name's entry for the re-run" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done <<<"$names"
|
||||||
|
if ! git init -q "$SCRATCH"; then
|
||||||
|
echo 'apm audit --ci: ref-consistency not waived: could not git init the re-run copy' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if origin="$(git remote get-url origin 2>/dev/null)"; then
|
||||||
|
git -C "$SCRATCH" remote add origin "$origin" || return 1
|
||||||
|
fi
|
||||||
|
# The real repo's ignore rules for deployed-files-present (header, "NOT
|
||||||
|
# .git"). --git-path resolves to the shared gitdir from a linked worktree.
|
||||||
|
exclude="$(git rev-parse --path-format=absolute --git-path info/exclude 2>/dev/null)" || exclude=""
|
||||||
|
if [ -n "$exclude" ] && [ -f "$exclude" ]; then
|
||||||
|
if ! mkdir -p "$SCRATCH/.git/info" || ! cp "$exclude" "$SCRATCH/.git/info/exclude"; then
|
||||||
|
echo 'apm audit --ci: ref-consistency not waived: could not copy info/exclude into the re-run copy' >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
rc=0
|
||||||
|
rerun="$(cd "$SCRATCH" && run_apm audit --ci 2>&1)" || rc=$?
|
||||||
|
if [ "$rc" -ne 0 ] || ! grep -qF "$ROOT_FULL_PASS" <<<"$rerun"; then
|
||||||
|
printf '%s\n' "$rerun" >&2
|
||||||
|
echo "apm audit --ci: ref-consistency not waived: the root re-run without the unlanded plugins did not report '$ROOT_FULL_PASS' (exit $rc)" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
rm -rf "$SCRATCH"
|
||||||
|
SCRATCH=""
|
||||||
|
}
|
||||||
|
|
||||||
status=0
|
status=0
|
||||||
|
|
||||||
@@ -85,7 +354,19 @@ for manifest_dir in . plugins/*/; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Axis 1: the root is never waived.
|
# The root's one waiver: plugins not yet on origin/main (header, second
|
||||||
|
# waiver).
|
||||||
|
if [ "$manifest_dir" = "." ] && waived="$(ref_waivable "$output")" &&
|
||||||
|
reduced_root_audit "$waived"; then
|
||||||
|
printf 'apm audit --ci: root re-run without the unlanded plugins: %s\n' "$ROOT_FULL_PASS"
|
||||||
|
while IFS= read -r name; do
|
||||||
|
printf 'apm audit --ci: waived ref-consistency for plugins/%s (not yet on origin/main; ADR-0019)\n' \
|
||||||
|
"$name"
|
||||||
|
done <<<"$waived"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Axis 1: the root is never waived for lockfile-exists.
|
||||||
# Here-strings, not `printf ... | grep -q`: under `set -o pipefail` grep -q
|
# Here-strings, not `printf ... | grep -q`: under `set -o pipefail` grep -q
|
||||||
# exits on its first match, SIGPIPEs the writer, and the writer's death
|
# exits on its first match, SIGPIPEs the writer, and the writer's death
|
||||||
# becomes the pipeline's status -- a race tests/test-no-pipefail-early-exit-grep.sh
|
# becomes the pipeline's status -- a race tests/test-no-pipefail-early-exit-grep.sh
|
||||||
|
|||||||
+16
-13
@@ -1,11 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# ADR-0023 clause 1, and ONLY clause 1: an executable, instructed local git
|
# Clause 1, and ONLY clause 1, of the rtk-prefix rule: an executable, instructed
|
||||||
# command in plugin skill or agent content is written `rtk git`, never bare
|
# local git command in plugin skill or agent content is written `rtk git`, never
|
||||||
# `git`.
|
# 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:
|
# is machine-decidable:
|
||||||
#
|
#
|
||||||
# 1. executable + instructed -> `rtk git` <- this hook
|
# 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
|
# 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
|
# 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
|
# putting the literal marker `rtk-bare:` on the SAME LINE, followed by the reason
|
||||||
# a code line, in the cell text for a table row. Per-line, never per-block: a
|
# — 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
|
# fenced block routinely mixes `rtk git` steps with one deliberately-bare
|
||||||
# command (references/push.md does exactly that), and a block-level marker would
|
# command (references/push.md does exactly that), and a block-level marker would
|
||||||
# silently disarm the checked lines around the marked one.
|
# silently disarm the checked lines around the marked one.
|
||||||
#
|
#
|
||||||
# The marker is a bare substring match, so a line that merely *mentions*
|
# 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
|
# 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.
|
# form would only move the same trust to a different string.
|
||||||
|
|
||||||
@@ -55,7 +58,7 @@ if [[ $# -eq 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v python3 > /dev/null 2>&1; then
|
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
|
echo " Fix: install python3 (pre-commit itself is a Python application, so it is almost certainly already present)." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -66,7 +69,7 @@ exec python3 -u - "$@" <<'PY'
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
MARKER = "ADR-0023"
|
MARKER = "rtk-bare:"
|
||||||
SHELL_INFO = {"bash", "sh", "shell", "zsh", "console", "shell-session"}
|
SHELL_INFO = {"bash", "sh", "shell", "zsh", "console", "shell-session"}
|
||||||
|
|
||||||
FENCE_OPEN = re.compile(r"^\s*(?P<f>`{3,}|~{3,})\s*(?P<info>[^\s`]*)")
|
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):
|
for line_no, text in check(path):
|
||||||
failed = True
|
failed = True
|
||||||
print(
|
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,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
|
|
||||||
if failed:
|
if failed:
|
||||||
print("", file=sys.stderr)
|
print("", file=sys.stderr)
|
||||||
print(
|
print(
|
||||||
"Fix: write `rtk git <subcommand>` (ADR-0023 clause 1). If this command must stay bare\n"
|
"Fix: write `rtk git <subcommand>`. If this command must stay bare because rtk rewrites\n"
|
||||||
"because rtk rewrites output the skill parses, or because it is interactive (clause 3),\n"
|
"output the skill parses, or because it is interactive, record the opt-out on the same\n"
|
||||||
"say so inline and put the literal string ADR-0023 on the same line to record the opt-out.",
|
"line as `rtk-bare: <reason>` (e.g. `# rtk-bare: the output is parsed`).",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@@ -7,10 +7,14 @@
|
|||||||
# Individual files — copied verbatim
|
# Individual files — copied verbatim
|
||||||
DEPLOY_FILES=(
|
DEPLOY_FILES=(
|
||||||
"providers/claude-code/CLAUDE.md:.claude/CLAUDE.md"
|
"providers/claude-code/CLAUDE.md:.claude/CLAUDE.md"
|
||||||
"providers/claude-code/settings.json:.claude/settings.json"
|
|
||||||
"core/AGENTS.md:.agents/AGENTS.md"
|
"core/AGENTS.md:.agents/AGENTS.md"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# JSON files — merged into an existing destination; this repo's values win
|
||||||
|
DEPLOY_JSON_MERGES=(
|
||||||
|
"providers/claude-code/settings.json:.claude/settings.json"
|
||||||
|
)
|
||||||
|
|
||||||
# Files that also need the executable bit set
|
# Files that also need the executable bit set
|
||||||
DEPLOY_EXECUTABLES=(
|
DEPLOY_EXECUTABLES=(
|
||||||
"providers/claude-code/statusline-command.sh:.claude/statusline-command.sh"
|
"providers/claude-code/statusline-command.sh:.claude/statusline-command.sh"
|
||||||
|
|||||||
+8
-1
@@ -7,6 +7,13 @@ source "$REPO_ROOT/scripts/deploy-manifest.sh"
|
|||||||
|
|
||||||
echo "Installing from $REPO_ROOT..."
|
echo "Installing from $REPO_ROOT..."
|
||||||
|
|
||||||
|
# First, so an unmergeable file stops the install before anything is deployed.
|
||||||
|
for entry in "${DEPLOY_JSON_MERGES[@]}"; do
|
||||||
|
dest="$HOME/${entry##*:}"
|
||||||
|
mkdir -p "$(dirname "$dest")"
|
||||||
|
python3 "$REPO_ROOT/scripts/merge-json.py" "$REPO_ROOT/${entry%%:*}" "$dest"
|
||||||
|
done
|
||||||
|
|
||||||
for entry in "${DEPLOY_FILES[@]}"; do
|
for entry in "${DEPLOY_FILES[@]}"; do
|
||||||
dest="$HOME/${entry##*:}"
|
dest="$HOME/${entry##*:}"
|
||||||
mkdir -p "$(dirname "$dest")"
|
mkdir -p "$(dirname "$dest")"
|
||||||
@@ -47,7 +54,7 @@ fi
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Deployed:"
|
echo "Deployed:"
|
||||||
for entry in "${DEPLOY_FILES[@]}" "${DEPLOY_EXECUTABLES[@]}"; do
|
for entry in "${DEPLOY_FILES[@]}" "${DEPLOY_JSON_MERGES[@]}" "${DEPLOY_EXECUTABLES[@]}"; do
|
||||||
echo " ~/${entry##*:}"
|
echo " ~/${entry##*:}"
|
||||||
done
|
done
|
||||||
for entry in "${DEPLOY_DIRS[@]}"; do
|
for entry in "${DEPLOY_DIRS[@]}"; do
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
"""Merge the JSON object in SRC into DEST. SRC wins; keys only DEST has are kept."""
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
|
||||||
|
def merge(base, override):
|
||||||
|
if not (isinstance(base, dict) and isinstance(override, dict)):
|
||||||
|
return override
|
||||||
|
merged = dict(base)
|
||||||
|
for key, value in override.items():
|
||||||
|
merged[key] = merge(base[key], value) if key in base else value
|
||||||
|
return merged
|
||||||
|
|
||||||
|
|
||||||
|
def merged_text(src_text, dest):
|
||||||
|
with open(dest, encoding="utf-8") as f:
|
||||||
|
existing = json.load(f)
|
||||||
|
if not isinstance(existing, dict):
|
||||||
|
raise ValueError("top level is not a JSON object")
|
||||||
|
# json.load accepts NaN and Infinity, which are not valid JSON.
|
||||||
|
before = json.dumps(existing, indent=2, ensure_ascii=False, allow_nan=False)
|
||||||
|
after = json.dumps(merge(existing, json.loads(src_text)), indent=2, ensure_ascii=False)
|
||||||
|
return None if after == before else after + "\n"
|
||||||
|
|
||||||
|
|
||||||
|
def replace_file(dest, text):
|
||||||
|
# Renaming a complete temporary file over dest means a failure never truncates it.
|
||||||
|
fd, tmp = tempfile.mkstemp(dir=os.path.dirname(dest), prefix=".merge-json.")
|
||||||
|
try:
|
||||||
|
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
||||||
|
f.write(text)
|
||||||
|
f.flush()
|
||||||
|
os.fsync(f.fileno())
|
||||||
|
if os.path.exists(dest):
|
||||||
|
shutil.copymode(dest, tmp)
|
||||||
|
os.replace(tmp, dest)
|
||||||
|
except BaseException:
|
||||||
|
os.unlink(tmp)
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
src, dest_arg = sys.argv[1:]
|
||||||
|
# Renaming over a symlink would replace the link, so write to its target.
|
||||||
|
dest = os.path.realpath(dest_arg)
|
||||||
|
with open(src, encoding="utf-8") as f:
|
||||||
|
text = f.read()
|
||||||
|
try:
|
||||||
|
if os.path.exists(dest):
|
||||||
|
text = merged_text(text, dest)
|
||||||
|
if text is not None:
|
||||||
|
replace_file(dest, text)
|
||||||
|
except (OSError, ValueError) as error:
|
||||||
|
sys.exit(f"ERROR: cannot merge settings into {dest_arg}, left unchanged: {error}")
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
@@ -502,7 +502,7 @@ fi
|
|||||||
KYBERFORGE_RESOLVER_PY=''
|
KYBERFORGE_RESOLVER_PY=''
|
||||||
# shellcheck source=../plugins/kyberforge/.apm/skills/factory-audit/scripts/lib-boundary-resolver.sh
|
# shellcheck source=../plugins/kyberforge/.apm/skills/factory-audit/scripts/lib-boundary-resolver.sh
|
||||||
. "$RESOLVER_LIB"
|
. "$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 "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 " 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
|
echo " Fix: restore the resolver here-doc in lib-boundary-resolver.sh." >&2
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
|||||||
TMPDIR_T="$(mktemp -d)"
|
TMPDIR_T="$(mktemp -d)"
|
||||||
trap 'rm -rf "$TMPDIR_T"' EXIT
|
trap 'rm -rf "$TMPDIR_T"' EXIT
|
||||||
|
|
||||||
BEGIN_MARKER='# ===== BEGIN ADR-0020 SHARED BOUNDARY RESOLVER ====='
|
BEGIN_MARKER='# ===== BEGIN SHARED BOUNDARY RESOLVER ====='
|
||||||
END_MARKER='# ===== END ADR-0020 SHARED BOUNDARY RESOLVER ====='
|
END_MARKER='# ===== END SHARED BOUNDARY RESOLVER ====='
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# 1. The resolver has one copy, and the root hook runs it
|
# 1. The resolver has one copy, and the root hook runs it
|
||||||
|
|||||||
Executable
+329
@@ -0,0 +1,329 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Tests scripts/apm-audit-ci.sh's root ref-consistency waiver: a plugin whose
|
||||||
|
# git+path entry is in root apm.yml but which is not yet on origin/main (#179,
|
||||||
|
# ADR-0019). See docs/spec/gates.md, "apm-audit-ci".
|
||||||
|
#
|
||||||
|
# Same seam as tests/test-apm-gate-invocation.sh: a stub `apm`, reached through
|
||||||
|
# the APM override so no uv or real apm runs. The stub prints canned `audit
|
||||||
|
# --ci` output for the root manifest ($STUB_ROOT_OUTPUT, exit 1) and passes in
|
||||||
|
# every plugin directory. The waiver's re-run is told apart by where it runs:
|
||||||
|
# under $TMPDIR, the script's mktemp scratch copy, where the stub saves the manifest it was given ($STUB_RERUN_LOG) and prints
|
||||||
|
# $STUB_RERUN_OUTPUT (default: the full root pass) with exit $STUB_RERUN_RC
|
||||||
|
# (default 0). With $STUB_GIT_LOG set it also saves the copy's
|
||||||
|
# .git/info/exclude and notes whether .claude/worktrees was copied. The fixture
|
||||||
|
# is a throwaway git repo whose
|
||||||
|
# refs/remotes/origin/main is set with update-ref -- nothing is fetched.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
AUDIT="$REPO_ROOT/scripts/apm-audit-ci.sh"
|
||||||
|
PASS=0
|
||||||
|
FAIL=0
|
||||||
|
|
||||||
|
pass() { echo " PASS: $1"; PASS=$((PASS + 1)); }
|
||||||
|
fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
||||||
|
|
||||||
|
unset APM GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_OBJECT_DIRECTORY GIT_COMMON_DIR
|
||||||
|
|
||||||
|
TMP="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$TMP"' EXIT
|
||||||
|
|
||||||
|
BIN="$TMP/bin"
|
||||||
|
mkdir -p "$BIN"
|
||||||
|
cat > "$BIN/apm" << 'EOF'
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
if [[ "${1:-}" == --version ]]; then
|
||||||
|
echo "Agent Package Manager (APM) CLI version 0.39.3"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [[ -f apm.lock.yaml.root-marker ]]; then
|
||||||
|
if [[ "$PWD" != "$TMPDIR"/* ]]; then
|
||||||
|
printf '%s\n' "$STUB_ROOT_OUTPUT"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
[[ -z "${STUB_RERUN_LOG:-}" ]] || cp apm.yml "$STUB_RERUN_LOG"
|
||||||
|
if [[ -n "${STUB_GIT_LOG:-}" ]]; then
|
||||||
|
cp .git/info/exclude "$STUB_GIT_LOG.exclude" 2> /dev/null || true
|
||||||
|
[[ ! -e .claude/worktrees ]] || touch "$STUB_GIT_LOG.worktrees"
|
||||||
|
fi
|
||||||
|
printf '%s\n' "${STUB_RERUN_OUTPUT-[*] All 15 check(s) passed}"
|
||||||
|
exit "${STUB_RERUN_RC:-0}"
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
EOF
|
||||||
|
chmod +x "$BIN/apm"
|
||||||
|
|
||||||
|
IDENTITY="git.rkdr.net/Mortis/Holocron"
|
||||||
|
|
||||||
|
# The output apm 0.39.3 printed for this branch's root manifest (#179).
|
||||||
|
root_output() { # <failing count line> <extra failing row> <detail lines...>
|
||||||
|
local count="$1" extra="$2"
|
||||||
|
shift 2
|
||||||
|
printf '%s\n' \
|
||||||
|
'[+] No drift detected' \
|
||||||
|
'+------------------------------------------------------------------------------+' \
|
||||||
|
'| Status | Check | Message |' \
|
||||||
|
'|----------+-----------------+-------------------------------------------------|' \
|
||||||
|
'| [+] | lockfile-exists | Lockfile present |' \
|
||||||
|
"| [x] | ref-consistency | $# ref mismatch -- run 'apm install' to update |" \
|
||||||
|
'| | | lockfile |'
|
||||||
|
if [[ -n "$extra" ]]; then printf '%s\n' "$extra"; else
|
||||||
|
printf '%s\n' '| [+] | drift | no drift detected against lockfile |'
|
||||||
|
fi
|
||||||
|
printf '%s\n' \
|
||||||
|
'+------------------------------------------------------------------------------+' \
|
||||||
|
'' \
|
||||||
|
' ref-consistency details:'
|
||||||
|
local d
|
||||||
|
for d in "$@"; do printf ' - %s\n' "$d"; done
|
||||||
|
printf '%s\n' '' "$count"
|
||||||
|
}
|
||||||
|
|
||||||
|
# make_fixture <dir> — a repo with root apm.yml naming plugins/core and
|
||||||
|
# plugins/rtk, both plugin dirs present, origin/main at a commit holding
|
||||||
|
# plugins/core only.
|
||||||
|
make_fixture() {
|
||||||
|
local dir="$1"
|
||||||
|
mkdir -p "$dir/plugins/core" "$dir/plugins/rtk"
|
||||||
|
cat > "$dir/apm.yml" << EOF
|
||||||
|
name: fixture
|
||||||
|
dependencies:
|
||||||
|
apm:
|
||||||
|
- git: https://$IDENTITY.git
|
||||||
|
path: plugins/core
|
||||||
|
# Routes Bash tool calls through rtk.
|
||||||
|
- git: https://$IDENTITY.git
|
||||||
|
path: plugins/rtk
|
||||||
|
mcp: []
|
||||||
|
EOF
|
||||||
|
printf 'name: core\nversion: 1.0.0\n' > "$dir/plugins/core/apm.yml"
|
||||||
|
touch "$dir/apm.lock.yaml.root-marker"
|
||||||
|
git -C "$dir" init -q
|
||||||
|
git -C "$dir" add apm.yml plugins/core/apm.yml
|
||||||
|
git -C "$dir" -c user.name=t -c user.email=t@t commit -qm base
|
||||||
|
git -C "$dir" update-ref refs/remotes/origin/main HEAD
|
||||||
|
printf 'name: rtk\nversion: 0.1.0\n' > "$dir/plugins/rtk/apm.yml"
|
||||||
|
}
|
||||||
|
|
||||||
|
RC=0
|
||||||
|
OUT=""
|
||||||
|
# TMPDIR is a fresh per-run dir, so the re-run's scratch copy can be checked
|
||||||
|
# for cleanup.
|
||||||
|
TMPD="$TMP/tmpdir"
|
||||||
|
run_audit() { # <dir> <root output> [VAR=value ...]
|
||||||
|
local dir="$1" root="$2"
|
||||||
|
shift 2
|
||||||
|
RC=0
|
||||||
|
rm -rf "$TMPD"
|
||||||
|
mkdir -p "$TMPD"
|
||||||
|
OUT="$(cd "$dir" && env APM="$BIN/apm" STUB_ROOT_OUTPUT="$root" TMPDIR="$TMPD" "$@" \
|
||||||
|
bash "$AUDIT" 2>&1)" || RC=$?
|
||||||
|
}
|
||||||
|
tmp_clean() { [[ -z "$(ls -A "$TMPD")" ]]; }
|
||||||
|
|
||||||
|
WAIVER_LINE='apm audit --ci: waived ref-consistency for plugins/rtk (not yet on origin/main; ADR-0019)'
|
||||||
|
SOLE='[x] 1 of 3 check(s) failed'
|
||||||
|
RTK_DETAIL="$IDENTITY/plugins/rtk: not found in lockfile"
|
||||||
|
|
||||||
|
echo "--- waived: one plugin not yet on origin/main ---"
|
||||||
|
F="$TMP/waived"
|
||||||
|
make_fixture "$F"
|
||||||
|
cp "$F/apm.yml" "$TMP/apm.yml.orig"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_RERUN_LOG="$TMP/rerun.yml"
|
||||||
|
[[ $RC -eq 0 ]] && pass "exits 0" || fail "exited $RC: $OUT"
|
||||||
|
grep -qxF "$WAIVER_LINE" <<< "$OUT" && pass "prints the waiver line" || fail "no waiver line: $OUT"
|
||||||
|
grep -qxF 'apm audit --ci: root re-run without the unlanded plugins: All 15 check(s) passed' <<< "$OUT" \
|
||||||
|
&& pass "reports the full-set re-run" || fail "no re-run line: $OUT"
|
||||||
|
# The re-run's manifest is the original minus exactly the rtk item.
|
||||||
|
if [[ -f "$TMP/rerun.yml" ]] && diff "$TMP/apm.yml.orig" "$TMP/rerun.yml" > "$TMP/rerun.diff"; then
|
||||||
|
fail "the re-run saw an unreduced apm.yml"
|
||||||
|
elif [[ "$(cat "$TMP/rerun.diff" 2>/dev/null)" == "$(printf '%s\n' '7,8d6' \
|
||||||
|
"< - git: https://$IDENTITY.git" '< path: plugins/rtk')" ]]; then
|
||||||
|
pass "the re-run's apm.yml drops only the plugins/rtk entry"
|
||||||
|
else
|
||||||
|
fail "unexpected re-run manifest: $(cat "$TMP/rerun.diff" 2>/dev/null)"
|
||||||
|
fi
|
||||||
|
cmp -s "$TMP/apm.yml.orig" "$F/apm.yml" && [[ -z "$(git -C "$F" status --porcelain -- apm.yml)" ]] \
|
||||||
|
&& pass "leaves the working tree's apm.yml byte-identical" || fail "apm.yml changed"
|
||||||
|
tmp_clean && pass "removes the scratch copy" || fail "scratch left behind: $(ls -A "$TMPD")"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- the re-run copy: carries info/exclude, leaves out .claude/worktrees ---"
|
||||||
|
F="$TMP/excl"
|
||||||
|
make_fixture "$F"
|
||||||
|
printf '%s\n' '# fixture marker' '**/.claude/worktrees/' >> "$F/.git/info/exclude"
|
||||||
|
mkdir -p "$F/.claude/worktrees/wt/.venv"
|
||||||
|
touch "$F/.claude/worktrees/wt/.venv/big"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_GIT_LOG="$TMP/gitlog"
|
||||||
|
[[ $RC -eq 0 ]] && pass "still waived" || fail "exited $RC: $OUT"
|
||||||
|
cmp -s "$F/.git/info/exclude" "$TMP/gitlog.exclude" \
|
||||||
|
&& pass "the copy's .git/info/exclude is the repo's" || fail "info/exclude not carried into the copy"
|
||||||
|
[[ ! -e "$TMP/gitlog.worktrees" ]] && pass ".claude/worktrees is not copied" || fail ".claude/worktrees was copied"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: the reduction changes a line, not only deletes (deletions-only guard) ---"
|
||||||
|
F="$TMP/nonl"
|
||||||
|
make_fixture "$F"
|
||||||
|
# No trailing newline: awk prints one back, so the reduced manifest's last
|
||||||
|
# line differs from the original's, a change rather than a deletion.
|
||||||
|
printf '%s' "$(cat "$F/apm.yml")" > "$F/apm.yml.new" && mv "$F/apm.yml.new" "$F/apm.yml"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& grep -qF "changed more than the waived entries" <<< "$OUT" \
|
||||||
|
&& pass "fails when the reduced apm.yml differs by more than deletions" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: the reduction leaves an rtk entry in place ---"
|
||||||
|
F="$TMP/blank"
|
||||||
|
make_fixture "$F"
|
||||||
|
# A blank line inside the rtk item: dep_identity skips it and still finds the
|
||||||
|
# entry, but reduce_manifest ends the item there and keeps it whole.
|
||||||
|
sed -i '/# Routes Bash/{n;s|$|\n|}' "$F/apm.yml"
|
||||||
|
grep -qx '' "$F/apm.yml" || fail "fixture: no blank line in the rtk item"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when nothing was removed" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
# A second, blank-split rtk item after a normal one: the normal one is
|
||||||
|
# removed, a pure deletion, so only the post-reduce dep_identity guard sees the
|
||||||
|
# entry that survived.
|
||||||
|
F="$TMP/dup"
|
||||||
|
make_fixture "$F"
|
||||||
|
awk -v e=" - git: https://$IDENTITY.git"$'\n\n'" path: plugins/rtk" \
|
||||||
|
'/^ mcp:/ { print e } { print }' "$F/apm.yml" > "$F/apm.yml.new"
|
||||||
|
mv "$F/apm.yml.new" "$F/apm.yml"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& grep -qF "could not remove plugins/rtk's entry" <<< "$OUT" \
|
||||||
|
&& pass "fails when an rtk entry survives a deletions-only reduction" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: the full-set re-run fails ---"
|
||||||
|
F="$TMP/waived"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_RERUN_RC=1 \
|
||||||
|
STUB_RERUN_OUTPUT="$(printf '%s\n' '| [x] | content-integrity | hidden Unicode |' '[x] 1 of 15 check(s) failed')"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& grep -qF "content-integrity" <<< "$OUT" \
|
||||||
|
&& pass "fails, showing the re-run's failing check" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
cmp -s "$TMP/apm.yml.orig" "$F/apm.yml" && pass "apm.yml still byte-identical" || fail "apm.yml changed"
|
||||||
|
tmp_clean && pass "removes the scratch copy on failure too" || fail "scratch left behind: $(ls -A "$TMPD")"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_RERUN_RC=1
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when the re-run exits non-zero despite a passing summary" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_RERUN_OUTPUT='[*] All 14 check(s) passed'
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when the re-run runs fewer than the full set" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")" STUB_RERUN_OUTPUT=''
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when the re-run prints no summary" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: the plugin is already on origin/main ---"
|
||||||
|
F="$TMP/landed"
|
||||||
|
make_fixture "$F"
|
||||||
|
git -C "$F" add plugins/rtk/apm.yml
|
||||||
|
git -C "$F" -c user.name=t -c user.email=t@t commit -qm landed
|
||||||
|
git -C "$F" update-ref refs/remotes/origin/main HEAD
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "plugins/rtk is already on origin/main" <<< "$OUT" \
|
||||||
|
&& pass "fails, naming the landed plugin" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: a second check also fails ---"
|
||||||
|
F="$TMP/second"
|
||||||
|
make_fixture "$F"
|
||||||
|
run_audit "$F" "$(root_output '[x] 2 of 3 check(s) failed' \
|
||||||
|
'| [x] | drift | 1 file(s) differ |' "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when drift fails too" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: one of three fails, but it is not ref-consistency ---"
|
||||||
|
F="$TMP/otherrow"
|
||||||
|
make_fixture "$F"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" \
|
||||||
|
'| [x] | drift | 1 file(s) differ |' "$RTK_DETAIL" |
|
||||||
|
sed 's/^| \[x\] | ref-consistency/| [+] | ref-consistency/')"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when the sole failing row is drift" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: a duplicated details header ---"
|
||||||
|
F="$TMP/duphdr"
|
||||||
|
make_fixture "$F"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL"
|
||||||
|
printf '%s\n' '' ' ref-consistency details:' ' - github.com/acme/skills: not found in lockfile')"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when a second details block could hide a detail" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: a plugin name that is . or .., or holds .. ---"
|
||||||
|
F="$TMP/dotnames"
|
||||||
|
make_fixture "$F"
|
||||||
|
# Each entry goes inside the apm: list, above ` mcp: []`, so dep_identity
|
||||||
|
# finds it and only the name guards stand between it and a waiver.
|
||||||
|
for n in .. . .hidden a..b; do
|
||||||
|
awk -v e=" - git: https://$IDENTITY.git"$'\n'" path: plugins/$n" \
|
||||||
|
'/^ mcp:/ { print e } { print }' "$F/apm.yml" > "$F/apm.yml.new"
|
||||||
|
mv "$F/apm.yml.new" "$F/apm.yml"
|
||||||
|
mkdir -p "$F/plugins/$n"
|
||||||
|
[[ -f "$F/plugins/$n/apm.yml" ]] || printf 'name: x\n' > "$F/plugins/$n/apm.yml"
|
||||||
|
done
|
||||||
|
for n in .. . .hidden; do
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$IDENTITY/plugins/$n: not found in lockfile")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "unrecognised detail line" <<< "$OUT" \
|
||||||
|
&& pass "fails on plugins/$n" || fail "must fail on plugins/$n (rc=$RC): $OUT"
|
||||||
|
done
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$IDENTITY/plugins/a..b: not found in lockfile")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "contains '..'" <<< "$OUT" \
|
||||||
|
&& pass "fails on plugins/a..b" || fail "must fail on plugins/a..b (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: a mismatch outside plugins/ ---"
|
||||||
|
F="$TMP/nonplugin"
|
||||||
|
make_fixture "$F"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "github.com/acme/skills: not found in lockfile")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "unrecognised detail line" <<< "$OUT" \
|
||||||
|
&& pass "fails on a non-plugins detail" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL" "github.com/acme/skills: not found in lockfile")"
|
||||||
|
[[ $RC -ne 0 ]] && ! grep -qF "waived ref-consistency" <<< "$OUT" \
|
||||||
|
&& pass "fails when an unlanded plugin is mixed with a non-plugins detail" \
|
||||||
|
|| fail "must fail on a mixed block (rc=$RC): $OUT"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$IDENTITY/plugins/rtk: ref main != abc123")"
|
||||||
|
[[ $RC -ne 0 ]] && pass "fails on a plugins/ detail of another kind" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: the identity is not root apm.yml's entry ---"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "git.example.com/Other/Repo/plugins/rtk: not found in lockfile")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "is not root apm.yml's git+path entry" <<< "$OUT" \
|
||||||
|
&& pass "fails on a foreign identity" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- not waived: plugins/<name>/apm.yml is absent ---"
|
||||||
|
F="$TMP/absent"
|
||||||
|
make_fixture "$F"
|
||||||
|
rm "$F/plugins/rtk/apm.yml"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "plugins/rtk/apm.yml is not in the working tree" <<< "$OUT" \
|
||||||
|
&& pass "fails when the plugin manifest is missing" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- fails closed: origin/main does not resolve ---"
|
||||||
|
F="$TMP/noorigin"
|
||||||
|
make_fixture "$F"
|
||||||
|
git -C "$F" update-ref -d refs/remotes/origin/main
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "" "$RTK_DETAIL")"
|
||||||
|
[[ $RC -ne 0 ]] && grep -qF "origin/main does not resolve locally" <<< "$OUT" \
|
||||||
|
&& pass "fails without origin/main" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- fails closed: unrecognised output ---"
|
||||||
|
F="$TMP/garbled"
|
||||||
|
make_fixture "$F"
|
||||||
|
run_audit "$F" "something apm never printed"
|
||||||
|
[[ $RC -ne 0 ]] && pass "fails on output of an unknown shape" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
run_audit "$F" "$(root_output "$SOLE" "")"
|
||||||
|
[[ $RC -ne 0 ]] && pass "fails on an empty details block" || fail "must fail (rc=$RC): $OUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Results: $PASS passed, $FAIL failed"
|
||||||
|
[[ "$FAIL" -eq 0 ]]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
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
|
# 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
|
# 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
|
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"
|
fail "the pre-sweep corpus passed — the gate would not have caught the #113 drift"
|
||||||
else
|
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
|
if [[ "$hits" -lt 20 ]]; then
|
||||||
fail "the pre-sweep corpus produced only $hits findings — too few to be the known drift"
|
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
|
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"
|
```' "prefixed commands"
|
||||||
|
|
||||||
expect clean '```bash
|
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
|
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
|
expect clean '```text
|
||||||
git worktree list --porcelain -z
|
git worktree list --porcelain -z
|
||||||
@@ -167,7 +171,7 @@ expect clean '| Operation | Run |
|
|||||||
|
|
||||||
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"
|
"a bare Run cell carrying the opt-out marker"
|
||||||
|
|
||||||
# The clause-2 shapes that made an every-span check unusable. Both are real rows
|
# 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
|
elif (cd "$REPO_ROOT" && bash "$SCRIPT" ${LIVE[@]+"${LIVE[@]}"} > "$RUN_TMP/live.out" 2>&1); then
|
||||||
pass "the ${#LIVE[@]} in-scope corpus files pass"
|
pass "the ${#LIVE[@]} in-scope corpus files pass"
|
||||||
else
|
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"
|
sed 's/^/ /' "$RUN_TMP/live.out"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ git -C "$TEMP_REPO" init -q
|
|||||||
cat > "$TEMP_REPO/scripts/deploy-manifest.sh" << 'EOF'
|
cat > "$TEMP_REPO/scripts/deploy-manifest.sh" << 'EOF'
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
DEPLOY_FILES=()
|
DEPLOY_FILES=()
|
||||||
|
DEPLOY_JSON_MERGES=()
|
||||||
DEPLOY_EXECUTABLES=()
|
DEPLOY_EXECUTABLES=()
|
||||||
DEPLOY_DIRS=()
|
DEPLOY_DIRS=()
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Executable
+247
@@ -0,0 +1,247 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Tests for plugins/git/.apm/hooks/refuse-push-to-main.py, the PreToolUse hook
|
||||||
|
# that refuses a `git push` to `main` (#178).
|
||||||
|
#
|
||||||
|
# The hook acts only when run from a .claude/hooks/ path, so it is copied to the
|
||||||
|
# path apm deploys it to and driven with real payloads against fixture repos.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_OBJECT_DIRECTORY GIT_COMMON_DIR
|
||||||
|
unset GIT_ALLOW_PUSH_TO_MAIN
|
||||||
|
|
||||||
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
HOOKS_DIR="$REPO_ROOT/plugins/git/.apm/hooks"
|
||||||
|
SRC="$HOOKS_DIR/refuse-push-to-main.py"
|
||||||
|
PASS=0
|
||||||
|
FAIL=0
|
||||||
|
|
||||||
|
pass() { PASS=$((PASS + 1)); }
|
||||||
|
fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
||||||
|
|
||||||
|
command -v python3 > /dev/null 2>&1 || { echo "python3 required"; exit 77; }
|
||||||
|
[[ -f "$SRC" ]] || { echo "FAIL: $SRC does not exist"; exit 1; }
|
||||||
|
|
||||||
|
WORK="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$WORK"' EXIT
|
||||||
|
|
||||||
|
for d in .claude/hooks/git/.apm/hooks .github/hooks/scripts/git/.apm/hooks \
|
||||||
|
.codex/hooks/git/.apm/hooks elsewhere; do
|
||||||
|
mkdir -p "$WORK/$d"
|
||||||
|
cp "$SRC" "$WORK/$d/"
|
||||||
|
done
|
||||||
|
HOOK="$WORK/.claude/hooks/git/.apm/hooks/refuse-push-to-main.py"
|
||||||
|
|
||||||
|
git init -q -b main "$WORK/on-main"
|
||||||
|
git init -q -b feat "$WORK/on-feat"
|
||||||
|
|
||||||
|
# decision <script> <cwd> <command> -> allow|refuse|error(...)
|
||||||
|
# The payload is escaped in bash because a Python start per case doubles the run
|
||||||
|
# time. The timeout is the one in hooks.json.
|
||||||
|
decision() {
|
||||||
|
local command="$3" out rc=0
|
||||||
|
command="${command//\\/\\\\}"
|
||||||
|
command="${command//\"/\\\"}"
|
||||||
|
command="${command//$'\n'/\\n}"
|
||||||
|
command="${command//$'\t'/\\t}"
|
||||||
|
out="$(timeout 10 "$1" 2>&1 <<< "{\"tool_name\":\"Bash\",\"cwd\":\"$2\",\"tool_input\":{\"command\":\"$command\"}}")" || rc=$?
|
||||||
|
if [[ $rc -eq 0 && -z "$out" ]]; then
|
||||||
|
echo allow
|
||||||
|
elif [[ $rc -eq 2 && "$out" == *main* ]]; then
|
||||||
|
echo refuse
|
||||||
|
else
|
||||||
|
echo "error($rc: $out)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# expect <allow|refuse> <main|feat> <command>
|
||||||
|
expect() {
|
||||||
|
local got
|
||||||
|
got="$(decision "$HOOK" "$WORK/on-$2" "$3")"
|
||||||
|
if [[ "$got" == "$1" ]]; then pass; else fail "on $2: want $1, got $got: ${3:0:200}"; fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "== Refused from any branch"
|
||||||
|
while IFS= read -r args; do
|
||||||
|
expect refuse feat "git push $args"
|
||||||
|
done << 'CASES'
|
||||||
|
origin main
|
||||||
|
origin +main
|
||||||
|
origin heads/main
|
||||||
|
origin refs/heads/main
|
||||||
|
origin HEAD:main
|
||||||
|
origin feat:main
|
||||||
|
origin feat:refs/heads/main
|
||||||
|
origin main --tags
|
||||||
|
origin :main
|
||||||
|
-d origin main
|
||||||
|
--delete origin main
|
||||||
|
origin --all
|
||||||
|
origin --branches
|
||||||
|
--mirror origin
|
||||||
|
origin :
|
||||||
|
origin +:
|
||||||
|
origin refs/heads/*:refs/heads/*
|
||||||
|
origin 'refs/heads/*:refs/heads/*'
|
||||||
|
origin feat main
|
||||||
|
-o ci.skip origin "main"
|
||||||
|
CASES
|
||||||
|
expect refuse main "git push origin main"
|
||||||
|
|
||||||
|
# Every prefix with an explicit destination and with a branch-dependent form.
|
||||||
|
for prefix in "git push --force" "git push -f" "git push --force-with-lease" \
|
||||||
|
"git push --force-with-lease=main:abc123" "rtk git push" "git -c k=v push" \
|
||||||
|
"git -C . push" "git add . && git push"; do
|
||||||
|
expect refuse feat "$prefix origin main"
|
||||||
|
expect refuse feat "$prefix origin HEAD:main"
|
||||||
|
expect refuse main "$prefix"
|
||||||
|
expect refuse main "$prefix origin HEAD"
|
||||||
|
expect allow feat "$prefix"
|
||||||
|
expect allow feat "$prefix origin HEAD"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "== Refused while on main, allowed on a feature branch"
|
||||||
|
while IFS= read -r args; do
|
||||||
|
expect refuse main "git push $args"
|
||||||
|
expect allow feat "git push $args"
|
||||||
|
done << 'CASES'
|
||||||
|
|
||||||
|
origin
|
||||||
|
--follow-tags
|
||||||
|
-o ci.skip origin
|
||||||
|
--repo=origin
|
||||||
|
origin HEAD
|
||||||
|
origin @
|
||||||
|
origin 2>&1 | tail -5
|
||||||
|
CASES
|
||||||
|
expect refuse feat "git -C $WORK/on-main push"
|
||||||
|
expect refuse feat "git -C ../on-main push origin HEAD"
|
||||||
|
expect allow main "git -C $WORK/on-feat push"
|
||||||
|
|
||||||
|
echo "== Allowed from any branch"
|
||||||
|
while IFS= read -r cmd; do
|
||||||
|
expect allow main "$cmd"
|
||||||
|
done << 'CASES'
|
||||||
|
git push origin feat
|
||||||
|
git push -u origin feat
|
||||||
|
git push origin main:feat
|
||||||
|
git push origin main-fix
|
||||||
|
git push origin feature/main
|
||||||
|
git push --tags
|
||||||
|
git push origin --tags
|
||||||
|
git push origin tag v1
|
||||||
|
git push origin tag main
|
||||||
|
git push origin refs/tags/main
|
||||||
|
git push --dry-run origin main
|
||||||
|
git push --help
|
||||||
|
git push -h
|
||||||
|
git push -n origin main
|
||||||
|
git push -o main origin feat
|
||||||
|
git push origin 'refs/heads/feat/*:refs/heads/feat/*'
|
||||||
|
git status
|
||||||
|
git log origin main
|
||||||
|
git commit -m "git push origin main"
|
||||||
|
git commit -m "wip; git push origin main"
|
||||||
|
echo git push origin main
|
||||||
|
echo "git push origin main"
|
||||||
|
git switch -c feat && git push -u origin HEAD
|
||||||
|
git checkout -b feat && git push
|
||||||
|
cd /somewhere/else && git push
|
||||||
|
git push origin "main
|
||||||
|
CASES
|
||||||
|
|
||||||
|
echo "== Earlier branch or directory changes"
|
||||||
|
while IFS=$'\t' read -r want branch cmd; do
|
||||||
|
expect "$want" "$branch" "${cmd//WORK/$WORK}"
|
||||||
|
done << 'CASES'
|
||||||
|
allow main gh pr checkout 5 && git push
|
||||||
|
allow main tea pr checkout 5 && git push
|
||||||
|
allow main rtk gh pr checkout 5 && git push
|
||||||
|
allow main git branch -m feat && git push -u origin HEAD
|
||||||
|
allow main git branch -M feat && git push -u origin HEAD
|
||||||
|
allow main git branch --move feat && git push -u origin HEAD
|
||||||
|
allow main git switch feat && cd sub && git push
|
||||||
|
allow main git checkout main && git pull && git checkout -b x && git push -u origin HEAD
|
||||||
|
refuse main git branch -a && git push
|
||||||
|
allow feat git switch main && git pull && git rebase main feat && git push
|
||||||
|
allow main git fetch && git rebase origin/main feat && git push --force-with-lease
|
||||||
|
allow main git rebase --onto main old feat && git push
|
||||||
|
refuse main git rebase origin/main && git push
|
||||||
|
refuse main git rebase --onto origin/main old && git push
|
||||||
|
refuse main git rebase -x true origin/main && git push
|
||||||
|
allow feat cd WORK/on-main && git switch main && git pull; cd WORK/on-feat && git push
|
||||||
|
allow main echo feat | xargs git push origin
|
||||||
|
allow main echo feat | xargs -n 1 git push origin HEAD
|
||||||
|
refuse feat git checkout main && git merge feat && git push
|
||||||
|
refuse feat git switch main && git pull && git push origin HEAD
|
||||||
|
refuse feat git -C WORK/on-feat switch main && git -C WORK/on-feat push
|
||||||
|
refuse feat cd WORK/on-main && git push
|
||||||
|
refuse feat cd ../on-main && git push origin HEAD
|
||||||
|
refuse feat cd WORK && cd on-main && git push
|
||||||
|
allow main cd WORK/on-feat && git push
|
||||||
|
allow main cd "$(git rev-parse --show-toplevel)" && git push
|
||||||
|
allow main cd $REPO/.. && git push
|
||||||
|
allow main cd - && git push
|
||||||
|
allow feat (cd WORK/on-main && git pull) && git push
|
||||||
|
refuse main (cd WORK/on-feat && git pull) && git push
|
||||||
|
allow main git --git-dir=WORK/on-feat/.git push
|
||||||
|
allow main git --git-dir WORK/on-feat/.git push origin HEAD
|
||||||
|
allow main GIT_DIR=WORK/on-feat/.git git push
|
||||||
|
refuse feat git --git-dir=WORK/on-feat/.git push origin main
|
||||||
|
CASES
|
||||||
|
|
||||||
|
echo "== Shell shapes"
|
||||||
|
expect refuse feat "exec git push origin main"
|
||||||
|
expect refuse feat "echo x | xargs git push origin main"
|
||||||
|
expect refuse feat $'git push origin ma\\\nin'
|
||||||
|
expect allow feat $'cat > a <<\'A\' && cat > b <<\'B\'\none\nA\ngit push origin main\nB'
|
||||||
|
expect allow feat $'cat > a <<\'END OF\'\ngit push origin main\nEND OF'
|
||||||
|
expect refuse feat $'git commit -m "explain <<EOF"\ngit push origin main'
|
||||||
|
expect refuse feat $'echo $((1<<2))\ngit push origin main'
|
||||||
|
printf -v many_heredocs 'cat <<EOF%d\n' {1..5000}
|
||||||
|
expect allow feat "${many_heredocs}git log; echo push"
|
||||||
|
expect refuse feat "cd /somewhere/else && git push origin main"
|
||||||
|
expect refuse feat "git switch -c x && git push origin HEAD:main"
|
||||||
|
expect refuse main "git checkout -- file.txt && git push"
|
||||||
|
expect refuse feat "timeout 60 git push origin main"
|
||||||
|
expect refuse feat "if true; then git push origin main; fi"
|
||||||
|
expect refuse feat "(git push origin main)"
|
||||||
|
expect refuse feat "git push origin main 2>&1 | tail -5"
|
||||||
|
expect refuse feat $'git push \\\n origin main'
|
||||||
|
expect refuse feat $'# don\'t forget to push\ngit push origin main'
|
||||||
|
expect refuse feat $'git status\ngit push origin main'
|
||||||
|
expect allow feat $'cat > notes.md <<\'EOF\'\ngit push origin main\nit\'s text\nEOF'
|
||||||
|
expect allow feat $'cat <<-EOF\n\tgit push origin main\n\tEOF'
|
||||||
|
expect allow feat $'git commit -m "$(cat <<\'EOF\'\nfix: x\n\ngit push origin main\nEOF\n)"'
|
||||||
|
expect allow feat $'git commit -m "fix: x\n\ngit push origin main"'
|
||||||
|
expect refuse feat $'cat > notes.md <<EOF\nit\'s text\nEOF\ngit push origin main'
|
||||||
|
|
||||||
|
echo "== Runtime: acts only from .claude/hooks/"
|
||||||
|
for d in .github/hooks/scripts/git/.apm/hooks .codex/hooks/git/.apm/hooks elsewhere; do
|
||||||
|
got="$(decision "$WORK/$d/refuse-push-to-main.py" "$WORK/on-main" "git push origin main")"
|
||||||
|
if [[ "$got" == allow ]]; then pass; else fail "$d: want allow, got $got"; fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "== Opt-out: only from the hook's own environment"
|
||||||
|
export GIT_ALLOW_PUSH_TO_MAIN=1
|
||||||
|
expect allow main "git push origin main"
|
||||||
|
export GIT_ALLOW_PUSH_TO_MAIN=0
|
||||||
|
expect refuse main "git push origin main"
|
||||||
|
unset GIT_ALLOW_PUSH_TO_MAIN
|
||||||
|
expect refuse main "GIT_ALLOW_PUSH_TO_MAIN=1 git push origin main"
|
||||||
|
expect refuse main "env GIT_ALLOW_PUSH_TO_MAIN=1 git push origin main"
|
||||||
|
expect refuse main "export GIT_ALLOW_PUSH_TO_MAIN=1 && git push origin main"
|
||||||
|
|
||||||
|
echo "== hooks.json"
|
||||||
|
if python3 - "$HOOKS_DIR/hooks.json" << 'PY'
|
||||||
|
import json, sys
|
||||||
|
(entry,) = json.load(open(sys.argv[1]))["hooks"]["PreToolUse"]
|
||||||
|
(hook,) = entry["hooks"]
|
||||||
|
assert entry["matcher"] == "Bash"
|
||||||
|
assert hook["command"] == "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/refuse-push-to-main.py"
|
||||||
|
assert "onFailure" not in hook
|
||||||
|
PY
|
||||||
|
then pass; else fail "hooks.json does not wire the script as expected"; fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Passed: $PASS Failed: $FAIL"
|
||||||
|
[[ $FAIL -eq 0 && $PASS -gt 0 ]]
|
||||||
@@ -74,6 +74,123 @@ else
|
|||||||
fail "idempotent: ~/.agents/AGENTS.md corrupted after second install"
|
fail "idempotent: ~/.agents/AGENTS.md corrupted after second install"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SETTINGS_SRC="$REPO_ROOT/providers/claude-code/settings.json"
|
||||||
|
|
||||||
|
if cmp -s "$SETTINGS_SRC" "$TEMP_HOME/.claude/settings.json"; then
|
||||||
|
pass "idempotent: settings.json still identical to source after second install"
|
||||||
|
else
|
||||||
|
fail "idempotent: settings.json changed by second install"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "--- settings.json is merged into an existing file (ADR-0035) ---"
|
||||||
|
|
||||||
|
new_home() {
|
||||||
|
local home
|
||||||
|
home="$(mktemp -d "$TEMP_HOME/merge.XXXXXX")"
|
||||||
|
mkdir -p "$home/.claude"
|
||||||
|
echo "$home"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_into() {
|
||||||
|
HOME="$1" bash "$REPO_ROOT/scripts/install.sh" 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Asserts a Python expression over the parsed JSON file, bound to `s`.
|
||||||
|
check_json() {
|
||||||
|
local file="$1" expr="$2" name="$3"
|
||||||
|
if python3 -c 'import json, sys; s = json.load(open(sys.argv[1], encoding="utf-8")); sys.exit(not eval(sys.argv[2]))' "$file" "$expr" 2> /dev/null; then
|
||||||
|
pass "$name"
|
||||||
|
else
|
||||||
|
fail "$name"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_json "$SETTINGS_SRC" \
|
||||||
|
's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False and s["env"]["CLAUDE_CODE_DISABLE_SHIP"] == "1" and s["skillOverrides"]["init"] == "off"' \
|
||||||
|
"repo settings turn off bundled and synced skills"
|
||||||
|
check_json "$SETTINGS_SRC" \
|
||||||
|
'all(s["skillOverrides"][k] == "off" for k in ("design", "doctor", "plugin-authoring")) and s["enabledPlugins"]["cc-plugin-easel@builtin"] is False and s["enabledPlugins"]["cc-plugin-plugin-authoring@builtin"] is False and s["syncClaudeAiPlugins"] is False' \
|
||||||
|
"repo settings turn off built-in plugin skills and synced plugins"
|
||||||
|
|
||||||
|
MERGE_HOME="$(new_home)"
|
||||||
|
MERGED="$MERGE_HOME/.claude/settings.json"
|
||||||
|
cat > "$MERGED" << 'EOF'
|
||||||
|
{
|
||||||
|
"model": "opus",
|
||||||
|
"theme": "light",
|
||||||
|
"permissions": {"allow": ["Bash(ls:*)"]},
|
||||||
|
"env": {"MY_VAR": "kept", "CLAUDE_CODE_DISABLE_SHIP": "0"},
|
||||||
|
"skillOverrides": {"other": "off", "init": "on"},
|
||||||
|
"enabledPlugins": {"operator-plugin@x": true, "cc-plugin-easel@builtin": true}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
chmod 640 "$MERGED"
|
||||||
|
install_into "$MERGE_HOME" > /dev/null || fail "install over existing settings exited non-zero"
|
||||||
|
|
||||||
|
check_json "$MERGED" 's["model"] == "opus" and s["permissions"] == {"allow": ["Bash(ls:*)"]}' \
|
||||||
|
"top-level settings the repo does not set are kept"
|
||||||
|
check_json "$MERGED" 's["env"]["MY_VAR"] == "kept" and s["skillOverrides"]["other"] == "off"' \
|
||||||
|
"nested entries the repo does not set are kept"
|
||||||
|
check_json "$MERGED" 's["theme"] == "dark" and s["env"]["CLAUDE_CODE_DISABLE_SHIP"] == "1" and s["skillOverrides"]["init"] == "off"' \
|
||||||
|
"the repo's value wins where both set one"
|
||||||
|
check_json "$MERGED" 's["disableBundledSkills"] is True and s["syncClaudeAiSkills"] is False' \
|
||||||
|
"settings only the repo has are added"
|
||||||
|
check_json "$MERGED" 's["enabledPlugins"]["operator-plugin@x"] is True' \
|
||||||
|
"the operator's own plugin entries are kept"
|
||||||
|
check_json "$MERGED" 's["enabledPlugins"]["cc-plugin-easel@builtin"] is False and s["enabledPlugins"]["cc-plugin-plugin-authoring@builtin"] is False' \
|
||||||
|
"the repo turns off built-in plugins the operator had enabled"
|
||||||
|
check_json "$MERGED" 's["skillOverrides"]["other"] == "off" and all(s["skillOverrides"][k] == "off" for k in ("design", "doctor", "plugin-authoring"))' \
|
||||||
|
"new skill overrides are added beside the operator's own"
|
||||||
|
check_json "$MERGED" 's["syncClaudeAiPlugins"] is False' \
|
||||||
|
"plugin sync is turned off in merged settings"
|
||||||
|
|
||||||
|
if [[ "$(find "$MERGED" -perm 640)" == "$MERGED" ]]; then
|
||||||
|
pass "the existing file's permissions are kept"
|
||||||
|
else
|
||||||
|
fail "the existing file's permissions changed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp "$MERGED" "$MERGE_HOME/first-run.json"
|
||||||
|
install_into "$MERGE_HOME" > /dev/null || fail "second install exited non-zero"
|
||||||
|
if cmp -s "$MERGE_HOME/first-run.json" "$MERGED"; then
|
||||||
|
pass "a second run leaves the merged settings unchanged"
|
||||||
|
else
|
||||||
|
fail "a second run changed the merged settings"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for invalid in '{"model": "opus",' '["not an object"]' '{"x": NaN}' ''; do
|
||||||
|
BAD_HOME="$(new_home)"
|
||||||
|
BAD="$BAD_HOME/.claude/settings.json"
|
||||||
|
printf '%s' "$invalid" > "$BAD"
|
||||||
|
printf '%s' "$invalid" > "$BAD_HOME/before"
|
||||||
|
if output="$(install_into "$BAD_HOME")"; then
|
||||||
|
fail "install accepted invalid settings: '$invalid'"
|
||||||
|
elif [[ "$output" == *"$BAD"* && "$output" != *Traceback* ]]; then
|
||||||
|
pass "invalid settings exit non-zero with an error naming the file: '$invalid'"
|
||||||
|
else
|
||||||
|
fail "invalid settings gave no clear error: '$invalid'"
|
||||||
|
fi
|
||||||
|
if cmp -s "$BAD_HOME/before" "$BAD"; then
|
||||||
|
pass "invalid settings are left untouched: '$invalid'"
|
||||||
|
else
|
||||||
|
fail "invalid settings were changed: '$invalid'"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
LINK_HOME="$(new_home)"
|
||||||
|
mkdir "$LINK_HOME/dotfiles"
|
||||||
|
echo '{"model": "opus"}' > "$LINK_HOME/dotfiles/settings.json"
|
||||||
|
ln -s ../dotfiles/settings.json "$LINK_HOME/.claude/settings.json"
|
||||||
|
install_into "$LINK_HOME" > /dev/null || fail "install through a symlink exited non-zero"
|
||||||
|
if [[ -L "$LINK_HOME/.claude/settings.json" ]]; then
|
||||||
|
pass "a symlinked settings file stays a symlink"
|
||||||
|
else
|
||||||
|
fail "a symlinked settings file was replaced by a regular file"
|
||||||
|
fi
|
||||||
|
check_json "$LINK_HOME/dotfiles/settings.json" 's["model"] == "opus" and s["theme"] == "dark"' \
|
||||||
|
"the symlink's target receives the merge"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Results: $PASS passed, $FAIL failed"
|
echo "Results: $PASS passed, $FAIL failed"
|
||||||
[[ $FAIL -eq 0 ]]
|
[[ $FAIL -eq 0 ]]
|
||||||
+60
@@ -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 ]]
|
||||||
Executable
+127
@@ -0,0 +1,127 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Tests for plugins/rtk/.apm/hooks/route-through-rtk.sh, the PreToolUse hook
|
||||||
|
# that routes a Bash tool call through `rtk hook claude` (#179).
|
||||||
|
#
|
||||||
|
# The hook acts only when run from a .claude/hooks/ path, so it is copied to the
|
||||||
|
# path apm deploys it to and driven with real payloads, against a stub rtk, no
|
||||||
|
# rtk at all, and the real rtk when one is installed.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
HOOKS_DIR="$REPO_ROOT/plugins/rtk/.apm/hooks"
|
||||||
|
SRC="$HOOKS_DIR/route-through-rtk.sh"
|
||||||
|
PASS=0
|
||||||
|
FAIL=0
|
||||||
|
|
||||||
|
pass() { PASS=$((PASS + 1)); }
|
||||||
|
fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); }
|
||||||
|
|
||||||
|
[[ -f "$SRC" ]] || { echo "FAIL: $SRC does not exist"; exit 1; }
|
||||||
|
REAL_RTK="$(command -v rtk || true)"
|
||||||
|
TIMEOUT="$(command -v timeout || true)"
|
||||||
|
[[ -n "$TIMEOUT" ]] || { echo "FAIL: timeout(1) is not on PATH; install coreutils to run these tests"; exit 1; }
|
||||||
|
|
||||||
|
WORK="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$WORK"' EXIT
|
||||||
|
|
||||||
|
for d in .claude/hooks/rtk/.apm/hooks elsewhere; do
|
||||||
|
mkdir -p "$WORK/$d"
|
||||||
|
cp "$SRC" "$WORK/$d/"
|
||||||
|
done
|
||||||
|
HOOK="$WORK/.claude/hooks/rtk/.apm/hooks/route-through-rtk.sh"
|
||||||
|
|
||||||
|
# A PATH with only what the hook and the stub need: no rtk on it.
|
||||||
|
mkdir -p "$WORK/base-bin"
|
||||||
|
for tool in bash cat dirname; do
|
||||||
|
ln -s "$(command -v "$tool")" "$WORK/base-bin/$tool"
|
||||||
|
done
|
||||||
|
|
||||||
|
# A stub rtk that records its arguments and stdin and prints a marker.
|
||||||
|
mkdir -p "$WORK/stub-bin"
|
||||||
|
cat > "$WORK/stub-bin/rtk" << STUB
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
printf '%s\n' "\$*" > "$WORK/stub-args"
|
||||||
|
cat > "$WORK/stub-stdin"
|
||||||
|
echo stub-output
|
||||||
|
STUB
|
||||||
|
chmod +x "$WORK/stub-bin/rtk"
|
||||||
|
|
||||||
|
payload() {
|
||||||
|
printf '{"tool_name":"Bash","tool_input":{"command":"%s"}}' "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# run <hook> <PATH> <command>: sets OUT and RC.
|
||||||
|
run() {
|
||||||
|
RC=0
|
||||||
|
OUT="$(payload "$3" | PATH="$2" "$TIMEOUT" 10 "$1" 2> "$WORK/stderr")" || RC=$?
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "== Stub rtk receives 'hook claude' and the payload"
|
||||||
|
rm -f "$WORK/stub-args" "$WORK/stub-stdin"
|
||||||
|
run "$HOOK" "$WORK/stub-bin:$WORK/base-bin" "git status"
|
||||||
|
if [[ $RC -eq 0 && "$OUT" == stub-output ]]; then pass; else fail "want rc 0 and stub output, got $RC: $OUT"; fi
|
||||||
|
if [[ "$(cat "$WORK/stub-args" 2> /dev/null)" == "hook claude" ]]; then pass; else fail "stub args: $(cat "$WORK/stub-args" 2> /dev/null)"; fi
|
||||||
|
if [[ "$(cat "$WORK/stub-stdin" 2> /dev/null)" == "$(payload "git status")" ]]; then pass; else fail "stub stdin: $(cat "$WORK/stub-stdin" 2> /dev/null)"; fi
|
||||||
|
|
||||||
|
# stub_rtk <name> <body>: writes a stub rtk with <body> to $WORK/<name>/rtk.
|
||||||
|
stub_rtk() {
|
||||||
|
mkdir -p "$WORK/$1"
|
||||||
|
printf '#!/usr/bin/env bash\ncat > /dev/null\n%s\n' "$2" > "$WORK/$1/rtk"
|
||||||
|
chmod +x "$WORK/$1/rtk"
|
||||||
|
}
|
||||||
|
stub_rtk fail2-bin "echo 'error: unrecognized subcommand' >&2; exit 2"
|
||||||
|
stub_rtk fail1-bin "exit 1"
|
||||||
|
stub_rtk silent-bin "exit 0"
|
||||||
|
|
||||||
|
echo "== rtk exits 2 (usage error): exit 0, no stdout, never blocks"
|
||||||
|
run "$HOOK" "$WORK/fail2-bin:$WORK/base-bin" "git status"
|
||||||
|
if [[ $RC -eq 0 && -z "$OUT" ]]; then pass; else fail "rtk exit 2: want exit 0 and no stdout, got $RC: $OUT"; fi
|
||||||
|
|
||||||
|
echo "== rtk exits 1: exit 0, no stdout"
|
||||||
|
run "$HOOK" "$WORK/fail1-bin:$WORK/base-bin" "git status"
|
||||||
|
if [[ $RC -eq 0 && -z "$OUT" ]]; then pass; else fail "rtk exit 1: want exit 0 and no stdout, got $RC: $OUT"; fi
|
||||||
|
|
||||||
|
echo "== rtk prints nothing: exit 0, no stdout at all (not even a newline)"
|
||||||
|
RC=0
|
||||||
|
payload "git status" | PATH="$WORK/silent-bin:$WORK/base-bin" "$TIMEOUT" 10 "$HOOK" > "$WORK/raw-out" 2> "$WORK/stderr" || RC=$?
|
||||||
|
if [[ $RC -eq 0 && ! -s "$WORK/raw-out" ]]; then pass; else fail "silent rtk: want exit 0 and zero-byte stdout, got $RC: $(od -c "$WORK/raw-out")"; fi
|
||||||
|
|
||||||
|
echo "== rtk absent: exit 0, no output"
|
||||||
|
run "$HOOK" "$WORK/base-bin" "git status"
|
||||||
|
if [[ $RC -eq 0 && -z "$OUT" && ! -s "$WORK/stderr" ]]; then pass; else fail "want silent exit 0, got $RC: $OUT $(cat "$WORK/stderr")"; fi
|
||||||
|
|
||||||
|
echo "== Runtime: acts only from .claude/hooks/"
|
||||||
|
rm -f "$WORK/stub-args"
|
||||||
|
run "$WORK/elsewhere/route-through-rtk.sh" "$WORK/stub-bin:$WORK/base-bin" "git status"
|
||||||
|
if [[ $RC -eq 0 && -z "$OUT" && ! -e "$WORK/stub-args" ]]; then pass; else fail "elsewhere: want silent exit 0, got $RC: $OUT"; fi
|
||||||
|
|
||||||
|
echo "== Real rtk"
|
||||||
|
if [[ -z "$REAL_RTK" ]]; then
|
||||||
|
echo " SKIP: rtk is not installed; the real-rtk cases did not run"
|
||||||
|
else
|
||||||
|
REAL_PATH="$(dirname "$REAL_RTK"):$WORK/base-bin"
|
||||||
|
run "$HOOK" "$REAL_PATH" "git status"
|
||||||
|
if [[ $RC -eq 0 && "$OUT" == *'"command":"rtk git status"'* ]]; then pass; else fail "git status: want rewrite, got $RC: $OUT"; fi
|
||||||
|
# Depends on rtk's built-in rules as of 0.42.4: `echo` has no rewrite rule,
|
||||||
|
# so rtk passes it through with no output. A later rtk may add one.
|
||||||
|
run "$HOOK" "$REAL_PATH" "echo hello"
|
||||||
|
if [[ $RC -eq 0 && -z "$OUT" ]]; then pass; else fail "echo hello: want no output, got $RC: $OUT"; fi
|
||||||
|
# Backs the README's "running both hooks is harmless": rtk leaves a command
|
||||||
|
# that already starts with rtk alone, so a second hook adds nothing.
|
||||||
|
run "$HOOK" "$REAL_PATH" "rtk git status"
|
||||||
|
if [[ $RC -eq 0 && -z "$OUT" ]]; then pass; else fail "rtk git status: want no output, got $RC: $OUT"; fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "== hooks.json"
|
||||||
|
if python3 - "$HOOKS_DIR/hooks.json" << 'PY'
|
||||||
|
import json, sys
|
||||||
|
(entry,) = json.load(open(sys.argv[1]))["hooks"]["PreToolUse"]
|
||||||
|
(hook,) = entry["hooks"]
|
||||||
|
assert entry["matcher"] == "Bash"
|
||||||
|
assert hook["command"] == "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/route-through-rtk.sh"
|
||||||
|
PY
|
||||||
|
then pass; else fail "hooks.json does not wire the script as expected"; fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Passed: $PASS Failed: $FAIL"
|
||||||
|
[[ $FAIL -eq 0 && $PASS -gt 0 ]]
|
||||||
Reference in new issue
Block a user