Author SHA1 Message Date
Defame1297andClaude Opus 5.5 40fcb08e94 docs(research): record Copilot CLI agent behaviour from docs
Findings for Wayfinder research ticket #187 (map #166): subagent
delegation from --agent sessions, pinned model handling, the agent
tool alias for strict tool lists, and preToolUse deny/ask hooks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
2026-11-22 16:34:06 +00:00
30 changed files with 413 additions and 4764 deletions

No files matched your search

+1 -29
View File
@@ -1,7 +1,7 @@
{
"name": "holocron",
"description": "AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.",
"version": "0.8.0",
"version": "0.7.0",
"owner": {
"name": "Mortis",
"url": "https://git.rkdr.net/Mortis/"
@@ -55,34 +55,6 @@
"version": "1.1.9",
"category": "Developer Tools",
"source": "./plugins/lint"
},
{
"name": "delivery",
"description": "Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.",
"version": "0.2.0",
"category": "Developer Tools",
"source": "./plugins/delivery"
},
{
"name": "ansible",
"description": "Skills for authoring, testing and dry-running Ansible playbooks, roles and collections.",
"version": "0.1.0",
"category": "Infrastructure",
"source": "./plugins/ansible"
},
{
"name": "gitops",
"description": "Skills for authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it.",
"version": "0.1.0",
"category": "Infrastructure",
"source": "./plugins/gitops"
},
{
"name": "k8s",
"description": "Skills for read-only diagnosis of workloads on a Kubernetes cluster.",
"version": "0.1.0",
"category": "Infrastructure",
"source": "./plugins/k8s"
}
]
}
-5
View File
@@ -57,8 +57,3 @@ build/
# to the file, not the directory: the sibling .claude-plugin/marketplace.json is
# compiled output that IS committed and must stay tracked.
/.claude-plugin/plugin.json
# Python bytecode. plugins/delivery ships a Python hook (.apm/hooks/guard.py);
# apm copies the whole hooks directory, so a stray cache would deploy with it.
__pycache__/
*.pyc
+2 -2
View File
@@ -70,8 +70,8 @@ repos:
always_run: true
- id: check-executables-allow-sync
name: Check executables allow keys sync
description: Verify root apm.yml's executables.allow carries a "<name>#<version>" key matching the apm.yml version of every plugin that ships executables (plugins/<name>/.apm/hooks/ or bin/), reporting every out-of-sync package in one run. apm's grant is version-blind, so a stale key still deploys; this is a record-keeping gate that fails a version bump made without the matching key edit, keeping each key an accurate record of what was approved (see ADR-0019's 2026-09-19 correction and docs/spec/gates.md)
name: Check executables allow key sync
description: Verify root apm.yml's executables.allow key names kyberforge's actual version -- apm matches that key by exact "<package>#<version>" lookup, so a version bump on one side alone silently stops deploying kyberforge's hooks/ and bin/ and lets the apm install go stale (see ADR-0019)
entry: bash scripts/check-executables-allow-sync.sh
language: system
stages: [pre-push]
+1 -1
View File
@@ -29,7 +29,7 @@ Fall back to raw shell only when no skill covers it.
- **Do not add repo-owned keys to `.claude/settings.json`.** apm treats it as its own deployed artifact and `apm audit --ci` replays the install and diffs, so anything apm would not have written is permanent drift that fails the `apm-audit-ci` pre-push hook. A hook you want here is authored in `plugins/<name>/.apm/hooks/` and deployed by apm, never hand-written into that file. The `SessionStart` entry already in it is exactly that: kyberforge authors it in `plugins/kyberforge/.apm/hooks/hooks.json` and apm merges it in, so it is apm's own output, it is what the replay expects, and it belongs in the commit — do not strip it (ADR-0019). Machine-specific settings go in the gitignored `.claude/settings.local.json`; shared enforcement goes in `.pre-commit-config.yaml`.
- **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again.
- **A `.apm/` edit is not live until it is on the remote's `main`.** Root `apm.yml`'s first-party dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `apm install` deploys from the lock; `apm update` is what re-resolves refs.
- **A `.apm/` edit is not live until it is on the remote's `main`.** The six dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `apm install` deploys from the lock; `apm update` is what re-resolves refs.
- **No pre-push hook needs the network — once `apm install` has run.** Root `apm.yml`'s marketplace has no remote package entries, so every hook resolves locally. The guarantee is a property of a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. Run `apm install` once on a new checkout and the offline guarantee holds from then on (`docs/spec/gates.md`, "Pushing without a network").
- **This repo and Gitea are the only source of truth.** All project state, decisions, and working conventions live here. Do not use an external memory system for this project — cached state diverges from the repo and you get a split brain. Before answering any design or architecture question, check `docs/adr/` for an existing decision.
+1 -1
View File
@@ -79,7 +79,7 @@ backend, registry, or SaaS — the Git repo is the marketplace.
_Avoid_: registry, store, catalogue
**holocron**:
This repository, in its role as a plugin marketplace and as the remote the first-party plugin dependencies
This repository, in its role as a plugin marketplace and as the remote the six plugin dependencies
resolve against.
_Avoid_: the marketplace, upstream
-4
View File
@@ -145,7 +145,3 @@ The guard added above (`tests/test-no-pipefail-early-exit-grep.sh`) reported the
## 2026-11-13 — Hook-exported GIT_DIR turned test fixtures loose on the real repo
Under the `run-tests` pre-push hook, git exports `GIT_DIR` to the hook, so a bats fixture's `git -C "$tmp" init/commit/update-ref` hit this repo instead of its temp dir: 84 failures, `core.bare=true` and an emptied index on every push. The 2026-07-05 "repo root is a bare checkout" entry was likely this bug's symptom, not the repo's real shape. Fix: `tests/run-tests.sh` unsets git's repo-locating env vars before any suite runs. Rule: a test that builds its own repo must never inherit the caller's git environment.
## 2026-11-22 — A local-path install skips the validation a remote install runs
#205 shipped `ansible` and `k8s` as `apm.yml`-only skeletons after a scratch consumer installed all four new packages from `../pkgs/<name>` with exit 0. Fetched from the remote, the same packages fail: apm accepts a remote subdirectory only when it has `.apm/`, declared dependencies or a `skills/` bundle (`detect_package_type` in `apm_cli/models/validation.py`). `gitops` failed too, through its dependency on `k8s`. So `main` published uninstallable packages until #206 added `.apm/.gitkeep`. A green local-path install says nothing about whether consumers can install. Fix: before merging a new or restructured package, push the branch and install it with `git:`/`path:`/`ref: <branch>`, or run `validate_apm_package` on a `git archive` export. `file://` URLs are rejected in the object form, so they can't stand in for the remote.
+5 -10
View File
@@ -2,31 +2,26 @@
The global AI development configuration repository — the authoritative source for agent definitions, skills, workflows, and prompts across all projects. Built as a homelab tool intended to scale to professional environments.
Content ships as installable plugins, each an apm (Agent Package Manager) package. This repo consumes its own plugins through apm (the ones root `apm.yml` lists), so the working copy runs the same released content every other consumer gets.
Content ships as six installable plugins, each an apm (Agent Package Manager) package. This repo consumes its own plugins through apm, so the working copy runs the same released content every other consumer gets.
## Repo layout
| Path | What it holds |
| --- | --- |
| `plugins/` | The apm packages — `bin`, `core`, `git`, `gitea`, `kyberforge`, `lint`, `mattpocock`, `delivery`, `ansible`, `gitops`, `k8s` — each carrying skills, and where relevant agents, hooks, and bundled assets |
| `plugins/` | Six apm packages — `bin`, `core`, `git`, `gitea`, `kyberforge`, `lint` — each carrying skills, and where relevant agents, hooks, and bundled assets |
| `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/` |
| `docs/` | Specs (`docs/spec/`), architectural decisions (`docs/adr/`), governance, research, and notes |
| `scripts/` | Install and check scripts used by the git hooks |
| `tests/` | `run-tests.sh`, `run-bats.sh`, the `test-*.sh` suites, and the bats submodules |
The plugins:
The six plugins:
- **kyberforge** — skills and agents for creating, maintaining, and managing an apm plugin marketplace for Claude Code (and GitHub Copilot through apm)
- **git** — conventional commits, branches, history, submodules, worktrees, remotes, pre-commit hook authoring and running (`pc-author` / `pc-run`), and an interactive router (`git-workflow`)
- **gitea** — issues, pull requests, labels, milestones, releases, branches, files, and an interactive router (`gitea-workflow`)
- **core** — authoring and auditing a repo's `AGENTS.md` and the provider adapter files that defer to it
- **lint** — configuring and running linters
- **mattpocock** — Matt Pocock's agent skills — planning, grilling, test-first development, triage and bug diagnosis — redistributed from upstream at a pinned release
- **delivery** — agents and skills for taking a change from spec to a verified merge through tracker-gated stages
- **ansible** — authoring, testing and dry-running Ansible playbooks, roles and collections
- **gitops** — authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it
- **k8s** — read-only diagnosis of workloads on a Kubernetes cluster
- **bin** — cross-cutting workflow skills not yet split into a focused plugin: research, documentation, TDD, prototyping, triage, diagnosis, architecture review, requirement grilling, compressed output (`caveman`), and re-orienting mid-task (`zoom-out`)
## Prerequisites
@@ -57,13 +52,13 @@ apm install
pre-commit install -t pre-commit -t commit-msg -t pre-push
```
**`apm install`** deploys the plugins root `apm.yml` lists into `.claude/skills/` and `.claude/agents/`. Both are gitignored install output, *not* authoring source — `plugins/<name>/.apm/` remains the only place to edit. It needs the network and materializes `apm_modules/` (which stays gitignored).
**`apm install`** deploys the six plugins into `.claude/skills/` and `.claude/agents/`. Both are gitignored install output, *not* authoring source — `plugins/<name>/.apm/` remains the only place to edit. It needs the network and materializes `apm_modules/` (which stays gitignored).
**Git hooks** must be wired for **all three stages**. This repo's `.pre-commit-config.yaml` has no `default_install_hook_types`, so a plain `pre-commit install` silently skips `commit-msg` (Conventional Commits) and `pre-push` (the full gate) — the `-t` flags above are not optional. The `pc-run` skill handles this and the troubleshooting around it, if you would rather not remember the flags.
## Keeping the install current
The first-party dependencies in root `apm.yml` are unpinned against the default branch, so deployed skills go stale whenever anyone merges. kyberforge's `SessionStart` hook keeps the install current automatically on launch, rewriting `apm.lock.yaml` in the process — an unexplained modification to it after opening a session is expected, not a bug. On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). The committed lock records a `main` commit too, just an older one. Discarding keeps lock churn unrelated to the branch out of its diff, and keeps the deployed tree consistent with the committed lock that `apm pack --check-clean` reads. The trade-off: the session then runs the older `main` the lock records, which is accepted on a feature branch. The discard also lasts only until the next session start, when the hook finds the lock behind `main` and refreshes again. Mechanism and rationale: `docs/adr/0019-session-start-hook-keeps-the-apm-install-current.md`.
The six dependencies in root `apm.yml` are unpinned against the default branch, so deployed skills go stale whenever anyone merges. kyberforge's `SessionStart` hook keeps the install current automatically on launch, rewriting `apm.lock.yaml` in the process — an unexplained modification to it after opening a session is expected, not a bug. On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `apm install`). The committed lock records a `main` commit too, just an older one. Discarding keeps lock churn unrelated to the branch out of its diff, and keeps the deployed tree consistent with the committed lock that `apm pack --check-clean` reads. The trade-off: the session then runs the older `main` the lock records, which is accepted on a feature branch. The discard also lasts only until the next session start, when the hook finds the lock behind `main` and refreshes again. Mechanism and rationale: `docs/adr/0019-session-start-hook-keeps-the-apm-install-current.md`.
Note the difference between the two commands:
+1 -870
View File
@@ -1,17 +1,7 @@
lockfile_version: '1'
generated_at: '2026-11-22T20:35:57.477158+00:00'
generated_at: '2026-11-22T07:54:40.193850+00:00'
apm_version: 0.28.0
dependencies:
- repo_url: Mortis/Holocron
name: ansible
host: git.rkdr.net
resolved_commit: 2815574a31b2a53bf98eda28ebefff804ea21b50
version: 0.1.0
virtual_path: plugins/ansible
is_virtual: true
package_type: apm_package
content_hash: sha256:aea4e2045eb8e678a27c860e5a989489decf47364fd3cbd8842d8f4299ee7495
declared_license: MIT
- repo_url: Mortis/Holocron
name: bin
host: git.rkdr.net
@@ -104,16 +94,6 @@ dependencies:
.claude/skills/provider-adapter-author/tests/validate-adapter.bats: sha256:1f9a3c193a2d1af6e180cdad48d8841c90b82144fbdf47cfa16bb209e771d0e9
content_hash: sha256:5202c3a41914b58c35d7943d8dbf7cbf507dac0198553b6c8fe1a961faa112f9
declared_license: MIT
- repo_url: Mortis/Holocron
name: delivery
host: git.rkdr.net
resolved_commit: 2815574a31b2a53bf98eda28ebefff804ea21b50
version: 0.1.0
virtual_path: plugins/delivery
is_virtual: true
package_type: apm_package
content_hash: sha256:7f1df520ad97d5582e2b73ff00fe7aff11c80ea528f6cb2c24d42b694b99cc62
declared_license: MIT
- repo_url: Mortis/Holocron
name: git
host: git.rkdr.net
@@ -314,26 +294,6 @@ dependencies:
.claude/skills/gitea-workflow/references/status-checkin.md: sha256:c6da98ecbe1d2919222bfb856cf10c3fb9971423e1eb6590a15f6fc7550f102d
content_hash: sha256:cfd5f5f130fdb31c2334c1852fa1ffac8752ad9b0395bb710c9daea6057f290b
declared_license: MIT
- repo_url: Mortis/Holocron
name: gitops
host: git.rkdr.net
resolved_commit: 2815574a31b2a53bf98eda28ebefff804ea21b50
version: 0.1.0
virtual_path: plugins/gitops
is_virtual: true
package_type: apm_package
content_hash: sha256:eef076b31b940b7d57620b9f13500c72b19ad0cee53a87d326179c3915e0b5a4
declared_license: MIT
- repo_url: Mortis/Holocron
name: k8s
host: git.rkdr.net
resolved_commit: 2815574a31b2a53bf98eda28ebefff804ea21b50
version: 0.1.0
virtual_path: plugins/k8s
is_virtual: true
package_type: apm_package
content_hash: sha256:606f68599dd005ca901e593904401e2ac59975df63d4935bc85ef5be95841ca0
declared_license: MIT
- repo_url: Mortis/Holocron
name: kyberforge
host: git.rkdr.net
@@ -623,178 +583,6 @@ dependencies:
package_type: apm_package
content_hash: sha256:474f27ecf7c6a86cc14bf36ddb59d09fa00e38d36a5243dcf405471ef8a3d568
declared_license: MIT
- repo_url: fluxcd/agent-skills
name: gitops-knowledge
host: github.com
resolved_commit: de81eb4ed7e991cac9da05adc2271b1bea8a4304
resolved_ref: v0.4.0
version: unknown
virtual_path: skills/gitops-knowledge
is_virtual: true
depth: 2
resolved_by: Mortis/Holocron
package_type: claude_skill
deployed_files:
- .claude/skills/gitops-knowledge
- .claude/skills/gitops-knowledge/SKILL.md
- .claude/skills/gitops-knowledge/assets/schemas/alert-notification-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/alert-notification-v1beta3.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/artifactgenerator-source-v1beta1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/bucket-source-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/externalartifact-source-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/fluxinstance-fluxcd-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/fluxreport-fluxcd-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/gitrepository-source-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/helmchart-source-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/helmrelease-helm-v2.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/helmrepository-source-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/imagepolicy-image-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/imagerepository-image-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/imageupdateautomation-image-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/kustomization-kustomize-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/ocirepository-source-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/provider-notification-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/provider-notification-v1beta3.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/receiver-notification-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/resourceset-fluxcd-v1.fields.txt
- .claude/skills/gitops-knowledge/assets/schemas/resourcesetinputprovider-fluxcd-v1.fields.txt
- .claude/skills/gitops-knowledge/evals/evals.json
- .claude/skills/gitops-knowledge/references/best-practices.md
- .claude/skills/gitops-knowledge/references/flux-cli.md
- .claude/skills/gitops-knowledge/references/flux-operator.md
- .claude/skills/gitops-knowledge/references/gitless-gitops.md
- .claude/skills/gitops-knowledge/references/gitless-image-automation.md
- .claude/skills/gitops-knowledge/references/helmrelease.md
- .claude/skills/gitops-knowledge/references/image-automation.md
- .claude/skills/gitops-knowledge/references/kustomization.md
- .claude/skills/gitops-knowledge/references/mcp-server.md
- .claude/skills/gitops-knowledge/references/monorepo-delivery.md
- .claude/skills/gitops-knowledge/references/notifications.md
- .claude/skills/gitops-knowledge/references/repo-patterns.md
- .claude/skills/gitops-knowledge/references/resourcesets.md
- .claude/skills/gitops-knowledge/references/sources.md
- .claude/skills/gitops-knowledge/references/terraform-bootstrap.md
- .claude/skills/gitops-knowledge/references/web-ui.md
deployed_file_hashes:
.claude/skills/gitops-knowledge/SKILL.md: sha256:847ad99e69083a0e0c1c54a86375129dd5f540830a790e39e6ee7686391592d7
.claude/skills/gitops-knowledge/assets/schemas/alert-notification-v1.fields.txt: sha256:8c5456fba106995a045e7c1a129f5d64228bf84310727df6ac7290896b4cda36
.claude/skills/gitops-knowledge/assets/schemas/alert-notification-v1beta3.fields.txt: sha256:e93ca64071bdeefe984c058ebeb1c8d25ca36ba7bacec7294c4933397ed0df73
.claude/skills/gitops-knowledge/assets/schemas/artifactgenerator-source-v1beta1.fields.txt: sha256:172136e39d223054f9cfa6361c775d03cb2aab8a39800ebe665cd8432776708d
.claude/skills/gitops-knowledge/assets/schemas/bucket-source-v1.fields.txt: sha256:0cf364c5deb5bfcdbb1508faf57ef0b0bcf9192d04a40bfcef6138b75a1a7e99
.claude/skills/gitops-knowledge/assets/schemas/externalartifact-source-v1.fields.txt: sha256:4f25b54b3019ca9ad82c9835f7f10d7ae69332c33f095a4079b210968629f551
.claude/skills/gitops-knowledge/assets/schemas/fluxinstance-fluxcd-v1.fields.txt: sha256:dec17d5cc2c48762ae09621b9bd405f5d397ff3b97d365489c4ecac9e1fdcc35
.claude/skills/gitops-knowledge/assets/schemas/fluxreport-fluxcd-v1.fields.txt: sha256:0c9c0dc2116651b4db06419c6683b3e952055ca5fb7be957a8c32c7b78ed9d63
.claude/skills/gitops-knowledge/assets/schemas/gitrepository-source-v1.fields.txt: sha256:94b657279c0d5dc97270faf780b470a95e768f0ce317b5092afa95210963b936
.claude/skills/gitops-knowledge/assets/schemas/helmchart-source-v1.fields.txt: sha256:1738b50f6ffa8c633e2b57c9638cde8ce72d444021bc454f0fd18ecdbdc356a0
.claude/skills/gitops-knowledge/assets/schemas/helmrelease-helm-v2.fields.txt: sha256:096abfb2af8b94f67f4aacf41555b94907790a9f28c9300c8aeb413093d238e9
.claude/skills/gitops-knowledge/assets/schemas/helmrepository-source-v1.fields.txt: sha256:e839b12b8c38b5531875693c2cbdbb946d4c3c32b5badaee26b34b6b801ae2b1
.claude/skills/gitops-knowledge/assets/schemas/imagepolicy-image-v1.fields.txt: sha256:93195c3b15ec3538f857b7a08b27371dd69f48b20de2192d842ac8d72211feba
.claude/skills/gitops-knowledge/assets/schemas/imagerepository-image-v1.fields.txt: sha256:5b73924f5e5893c2118231fbe775b4d35dbfbe1520193879397f342780f7ed5c
.claude/skills/gitops-knowledge/assets/schemas/imageupdateautomation-image-v1.fields.txt: sha256:1bf0551a92ebf04e2a469c655891f36b8b28d6dac4e95f3c80da4ec1f7290139
.claude/skills/gitops-knowledge/assets/schemas/kustomization-kustomize-v1.fields.txt: sha256:f4371c526e40e08e4dc02c2b6e72207324caa7908ae69d7f733e345906f3a5d8
.claude/skills/gitops-knowledge/assets/schemas/ocirepository-source-v1.fields.txt: sha256:0bb9bd4bbd117d69b1eb5e5dadff1e4e627d78f33858655385ab48b6548ed2be
.claude/skills/gitops-knowledge/assets/schemas/provider-notification-v1.fields.txt: sha256:8696475406efe789711de149db0eb595fdfb2f8ac5f93539ef02800fc3d68d33
.claude/skills/gitops-knowledge/assets/schemas/provider-notification-v1beta3.fields.txt: sha256:2ec58d89135b07e923b1b498046bdd1501b1728ea5a8fd2df5d0a9256303f483
.claude/skills/gitops-knowledge/assets/schemas/receiver-notification-v1.fields.txt: sha256:ce19fb2024204f95ca02dc6bce511304d6e820f74097a5ce594eb534c87cbdd9
.claude/skills/gitops-knowledge/assets/schemas/resourceset-fluxcd-v1.fields.txt: sha256:f6d39f60e5aeffbc1240a023ec591bbc863594617c88b6b44b09b43321280ca8
.claude/skills/gitops-knowledge/assets/schemas/resourcesetinputprovider-fluxcd-v1.fields.txt: sha256:1ba06611e5067d51244a9b126d16234b38cbf31f89a906ba5e5846048bdcfc3f
.claude/skills/gitops-knowledge/evals/evals.json: sha256:c17126e77b35154c52939411e0fbd4964fc9f729ae953cf8dae98c41bdb4f573
.claude/skills/gitops-knowledge/references/best-practices.md: sha256:f2fe8e504e692542ac9dfed39c06b4e24b6839fade132902558d65d88da41947
.claude/skills/gitops-knowledge/references/flux-cli.md: sha256:6f3cb0aede0fa83368e13fdb135b78728d42764823242c4859d93e937297b817
.claude/skills/gitops-knowledge/references/flux-operator.md: sha256:b0a4ace2e45c7b8075c848dd0d4da73ec73ecd827e16fd0a3809bf95a409d2b6
.claude/skills/gitops-knowledge/references/gitless-gitops.md: sha256:8cdb0282c492240550e730e8ae72acd74d61a0fcea8d1e82aad4f43d129501eb
.claude/skills/gitops-knowledge/references/gitless-image-automation.md: sha256:c4349fe449ab31763247cdf274c82d1206b81d942b58c0ad8b7d75af02ae8834
.claude/skills/gitops-knowledge/references/helmrelease.md: sha256:b433116db40a2954eb73fd436d86efe63431444d9ff946d8a6247552c630d52b
.claude/skills/gitops-knowledge/references/image-automation.md: sha256:7c2542cb166b9461e00b40f37c99227eaa2d4418e6ec62c5b37deb0f360039b6
.claude/skills/gitops-knowledge/references/kustomization.md: sha256:2d981af726b758f03b8b4ab1ddbaa557a5daa4fbb80c6a9a0a6b1225a53482c2
.claude/skills/gitops-knowledge/references/mcp-server.md: sha256:3a830790153ea9e9d05da9209d0dfbe96353b108681d00fcdc326b66a278d4f9
.claude/skills/gitops-knowledge/references/monorepo-delivery.md: sha256:e255773fb314c50c1b2b2bb49059f178ed74a95e397cb467b4ccbbc76263bdfc
.claude/skills/gitops-knowledge/references/notifications.md: sha256:269bd1d1d5eafbbdc00aed2d027e39767d37c749f2c6c3dcce9e7a2c2b21f8ef
.claude/skills/gitops-knowledge/references/repo-patterns.md: sha256:fb7eb661c6b94a5945c697ff4b663d37767710042ce05466d698da26576b4882
.claude/skills/gitops-knowledge/references/resourcesets.md: sha256:f5c89885a4c8e2f63f77aaa58c78ad50bbdd672b03cf434c030aba8f7e81a859
.claude/skills/gitops-knowledge/references/sources.md: sha256:c1719a4bc910a689451cfd4bf84873942e8f50fa57a95564be0b3e8095be34e7
.claude/skills/gitops-knowledge/references/terraform-bootstrap.md: sha256:ef57b252c031c598a8b13d5a819afabf24f0e0a102691e309daada8f134c8d6a
.claude/skills/gitops-knowledge/references/web-ui.md: sha256:03569a0215d1a524f2e52dc67b9a9c0cdd54bede827f03068d3a1149fdfb1a1d
content_hash: sha256:82c78d7036213e355bd2f9d0243742d4344e1a1f4b7a6f29a84b1a5fda1cc217
- repo_url: fluxcd/agent-skills
name: gitops-repo-audit
host: github.com
resolved_commit: de81eb4ed7e991cac9da05adc2271b1bea8a4304
resolved_ref: v0.4.0
version: unknown
virtual_path: skills/gitops-repo-audit
is_virtual: true
depth: 2
resolved_by: Mortis/Holocron
package_type: claude_skill
deployed_files:
- .claude/skills/gitops-repo-audit
- .claude/skills/gitops-repo-audit/SKILL.md
- .claude/skills/gitops-repo-audit/assets/schemas/alert-notification-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/alert-notification-v1beta3.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/artifactgenerator-source-v1beta1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/bucket-source-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/externalartifact-source-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/fluxinstance-fluxcd-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/fluxreport-fluxcd-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/gitrepository-source-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/helmchart-source-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/helmrelease-helm-v2.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/helmrepository-source-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/imagepolicy-image-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/imagerepository-image-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/imageupdateautomation-image-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/kustomization-kustomize-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/ocirepository-source-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/provider-notification-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/provider-notification-v1beta3.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/receiver-notification-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/resourceset-fluxcd-v1.fields.txt
- .claude/skills/gitops-repo-audit/assets/schemas/resourcesetinputprovider-fluxcd-v1.fields.txt
- .claude/skills/gitops-repo-audit/evals/evals.json
- .claude/skills/gitops-repo-audit/references/api-migration.md
- .claude/skills/gitops-repo-audit/references/best-practices.md
- .claude/skills/gitops-repo-audit/references/flux-api-summary.md
- .claude/skills/gitops-repo-audit/references/flux-operator-api-summary.md
- .claude/skills/gitops-repo-audit/references/repo-patterns.md
- .claude/skills/gitops-repo-audit/references/security-audit.md
- .claude/skills/gitops-repo-audit/scripts/check-deprecated.sh
- .claude/skills/gitops-repo-audit/scripts/discover.sh
- .claude/skills/gitops-repo-audit/scripts/validate.sh
deployed_file_hashes:
.claude/skills/gitops-repo-audit/SKILL.md: sha256:22aabcde2ba10c6fe1f05ed455b9b57e607c6d0658b61c9ccf892f4978cdc578
.claude/skills/gitops-repo-audit/assets/schemas/alert-notification-v1.fields.txt: sha256:8c5456fba106995a045e7c1a129f5d64228bf84310727df6ac7290896b4cda36
.claude/skills/gitops-repo-audit/assets/schemas/alert-notification-v1beta3.fields.txt: sha256:e93ca64071bdeefe984c058ebeb1c8d25ca36ba7bacec7294c4933397ed0df73
.claude/skills/gitops-repo-audit/assets/schemas/artifactgenerator-source-v1beta1.fields.txt: sha256:172136e39d223054f9cfa6361c775d03cb2aab8a39800ebe665cd8432776708d
.claude/skills/gitops-repo-audit/assets/schemas/bucket-source-v1.fields.txt: sha256:0cf364c5deb5bfcdbb1508faf57ef0b0bcf9192d04a40bfcef6138b75a1a7e99
.claude/skills/gitops-repo-audit/assets/schemas/externalartifact-source-v1.fields.txt: sha256:4f25b54b3019ca9ad82c9835f7f10d7ae69332c33f095a4079b210968629f551
.claude/skills/gitops-repo-audit/assets/schemas/fluxinstance-fluxcd-v1.fields.txt: sha256:dec17d5cc2c48762ae09621b9bd405f5d397ff3b97d365489c4ecac9e1fdcc35
.claude/skills/gitops-repo-audit/assets/schemas/fluxreport-fluxcd-v1.fields.txt: sha256:0c9c0dc2116651b4db06419c6683b3e952055ca5fb7be957a8c32c7b78ed9d63
.claude/skills/gitops-repo-audit/assets/schemas/gitrepository-source-v1.fields.txt: sha256:94b657279c0d5dc97270faf780b470a95e768f0ce317b5092afa95210963b936
.claude/skills/gitops-repo-audit/assets/schemas/helmchart-source-v1.fields.txt: sha256:1738b50f6ffa8c633e2b57c9638cde8ce72d444021bc454f0fd18ecdbdc356a0
.claude/skills/gitops-repo-audit/assets/schemas/helmrelease-helm-v2.fields.txt: sha256:096abfb2af8b94f67f4aacf41555b94907790a9f28c9300c8aeb413093d238e9
.claude/skills/gitops-repo-audit/assets/schemas/helmrepository-source-v1.fields.txt: sha256:e839b12b8c38b5531875693c2cbdbb946d4c3c32b5badaee26b34b6b801ae2b1
.claude/skills/gitops-repo-audit/assets/schemas/imagepolicy-image-v1.fields.txt: sha256:93195c3b15ec3538f857b7a08b27371dd69f48b20de2192d842ac8d72211feba
.claude/skills/gitops-repo-audit/assets/schemas/imagerepository-image-v1.fields.txt: sha256:5b73924f5e5893c2118231fbe775b4d35dbfbe1520193879397f342780f7ed5c
.claude/skills/gitops-repo-audit/assets/schemas/imageupdateautomation-image-v1.fields.txt: sha256:1bf0551a92ebf04e2a469c655891f36b8b28d6dac4e95f3c80da4ec1f7290139
.claude/skills/gitops-repo-audit/assets/schemas/kustomization-kustomize-v1.fields.txt: sha256:f4371c526e40e08e4dc02c2b6e72207324caa7908ae69d7f733e345906f3a5d8
.claude/skills/gitops-repo-audit/assets/schemas/ocirepository-source-v1.fields.txt: sha256:0bb9bd4bbd117d69b1eb5e5dadff1e4e627d78f33858655385ab48b6548ed2be
.claude/skills/gitops-repo-audit/assets/schemas/provider-notification-v1.fields.txt: sha256:8696475406efe789711de149db0eb595fdfb2f8ac5f93539ef02800fc3d68d33
.claude/skills/gitops-repo-audit/assets/schemas/provider-notification-v1beta3.fields.txt: sha256:2ec58d89135b07e923b1b498046bdd1501b1728ea5a8fd2df5d0a9256303f483
.claude/skills/gitops-repo-audit/assets/schemas/receiver-notification-v1.fields.txt: sha256:ce19fb2024204f95ca02dc6bce511304d6e820f74097a5ce594eb534c87cbdd9
.claude/skills/gitops-repo-audit/assets/schemas/resourceset-fluxcd-v1.fields.txt: sha256:f6d39f60e5aeffbc1240a023ec591bbc863594617c88b6b44b09b43321280ca8
.claude/skills/gitops-repo-audit/assets/schemas/resourcesetinputprovider-fluxcd-v1.fields.txt: sha256:1ba06611e5067d51244a9b126d16234b38cbf31f89a906ba5e5846048bdcfc3f
.claude/skills/gitops-repo-audit/evals/evals.json: sha256:a35a9392470be32858cc9f7fcbd5343f2a27d2f35de0e41718dfe60d976cedb5
.claude/skills/gitops-repo-audit/references/api-migration.md: sha256:bd0eea7f9f0f2499edd9f760f9792c5efa031fa17ca19279df8fcab443f7e402
.claude/skills/gitops-repo-audit/references/best-practices.md: sha256:0805c25709ba849c799e74a6c869cc9a3c62dd2689379153c06ebf8b92741f66
.claude/skills/gitops-repo-audit/references/flux-api-summary.md: sha256:d0e859a78164ab3341ccda2905b282c1ff02dc417f8af91fa2e746dbff72cf8c
.claude/skills/gitops-repo-audit/references/flux-operator-api-summary.md: sha256:4f1995923db2239844f0234ed8e3a7ef27cfdeaf1ad11d53ad4294b87f1fcf4d
.claude/skills/gitops-repo-audit/references/repo-patterns.md: sha256:ef3c9ff6af4aed2c2437f95d0166aac2bfd7ce2c244bfcbb380c3943ab4f7d0e
.claude/skills/gitops-repo-audit/references/security-audit.md: sha256:346bcf7e4d57a5b4e13b4b3d312e48db45abdc843402c068cf1a7e861ff9fa3f
.claude/skills/gitops-repo-audit/scripts/check-deprecated.sh: sha256:8804a3644f3424508bf5eb2f87a4068a4bebf15f93735db2d1cdce7812ff8821
.claude/skills/gitops-repo-audit/scripts/discover.sh: sha256:8e6cd89dced83d615a064c223af5603684dee54b82e3e613215283ed0ce70741
.claude/skills/gitops-repo-audit/scripts/validate.sh: sha256:788cc2cbf8e8f6b0307077cf854ab23acbe74b0c22f4213800723084c1e39610
content_hash: sha256:7d990c3800190e2077c2a4c9f435db4d0bbd9d69b4c0380730cd0e41580702f2
- repo_url: mattpocock/skills
name: code-review
host: github.com
@@ -3012,663 +2800,6 @@ deployments:
- git.rkdr.net/Mortis/Holocron/plugins/gitea
active_owner: git.rkdr.net/Mortis/Holocron/plugins/gitea
content_hash: sha256:c6da98ecbe1d2919222bfb856cf10c3fb9971423e1eb6590a15f6fc7550f102d
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: null
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/SKILL.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:847ad99e69083a0e0c1c54a86375129dd5f540830a790e39e6ee7686391592d7
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/alert-notification-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:8c5456fba106995a045e7c1a129f5d64228bf84310727df6ac7290896b4cda36
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/alert-notification-v1beta3.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:e93ca64071bdeefe984c058ebeb1c8d25ca36ba7bacec7294c4933397ed0df73
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/artifactgenerator-source-v1beta1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:172136e39d223054f9cfa6361c775d03cb2aab8a39800ebe665cd8432776708d
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/bucket-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:0cf364c5deb5bfcdbb1508faf57ef0b0bcf9192d04a40bfcef6138b75a1a7e99
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/externalartifact-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:4f25b54b3019ca9ad82c9835f7f10d7ae69332c33f095a4079b210968629f551
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/fluxinstance-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:dec17d5cc2c48762ae09621b9bd405f5d397ff3b97d365489c4ecac9e1fdcc35
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/fluxreport-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:0c9c0dc2116651b4db06419c6683b3e952055ca5fb7be957a8c32c7b78ed9d63
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/gitrepository-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:94b657279c0d5dc97270faf780b470a95e768f0ce317b5092afa95210963b936
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/helmchart-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:1738b50f6ffa8c633e2b57c9638cde8ce72d444021bc454f0fd18ecdbdc356a0
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/helmrelease-helm-v2.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:096abfb2af8b94f67f4aacf41555b94907790a9f28c9300c8aeb413093d238e9
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/helmrepository-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:e839b12b8c38b5531875693c2cbdbb946d4c3c32b5badaee26b34b6b801ae2b1
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/imagepolicy-image-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:93195c3b15ec3538f857b7a08b27371dd69f48b20de2192d842ac8d72211feba
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/imagerepository-image-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:5b73924f5e5893c2118231fbe775b4d35dbfbe1520193879397f342780f7ed5c
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/imageupdateautomation-image-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:1bf0551a92ebf04e2a469c655891f36b8b28d6dac4e95f3c80da4ec1f7290139
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/kustomization-kustomize-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:f4371c526e40e08e4dc02c2b6e72207324caa7908ae69d7f733e345906f3a5d8
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/ocirepository-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:0bb9bd4bbd117d69b1eb5e5dadff1e4e627d78f33858655385ab48b6548ed2be
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/provider-notification-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:8696475406efe789711de149db0eb595fdfb2f8ac5f93539ef02800fc3d68d33
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/provider-notification-v1beta3.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:2ec58d89135b07e923b1b498046bdd1501b1728ea5a8fd2df5d0a9256303f483
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/receiver-notification-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:ce19fb2024204f95ca02dc6bce511304d6e820f74097a5ce594eb534c87cbdd9
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/resourceset-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:f6d39f60e5aeffbc1240a023ec591bbc863594617c88b6b44b09b43321280ca8
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/assets/schemas/resourcesetinputprovider-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:1ba06611e5067d51244a9b126d16234b38cbf31f89a906ba5e5846048bdcfc3f
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/evals/evals.json
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:c17126e77b35154c52939411e0fbd4964fc9f729ae953cf8dae98c41bdb4f573
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/best-practices.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:f2fe8e504e692542ac9dfed39c06b4e24b6839fade132902558d65d88da41947
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/flux-cli.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:6f3cb0aede0fa83368e13fdb135b78728d42764823242c4859d93e937297b817
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/flux-operator.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:b0a4ace2e45c7b8075c848dd0d4da73ec73ecd827e16fd0a3809bf95a409d2b6
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/gitless-gitops.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:8cdb0282c492240550e730e8ae72acd74d61a0fcea8d1e82aad4f43d129501eb
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/gitless-image-automation.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:c4349fe449ab31763247cdf274c82d1206b81d942b58c0ad8b7d75af02ae8834
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/helmrelease.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:b433116db40a2954eb73fd436d86efe63431444d9ff946d8a6247552c630d52b
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/image-automation.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:7c2542cb166b9461e00b40f37c99227eaa2d4418e6ec62c5b37deb0f360039b6
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/kustomization.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:2d981af726b758f03b8b4ab1ddbaa557a5daa4fbb80c6a9a0a6b1225a53482c2
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/mcp-server.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:3a830790153ea9e9d05da9209d0dfbe96353b108681d00fcdc326b66a278d4f9
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/monorepo-delivery.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:e255773fb314c50c1b2b2bb49059f178ed74a95e397cb467b4ccbbc76263bdfc
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/notifications.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:269bd1d1d5eafbbdc00aed2d027e39767d37c749f2c6c3dcce9e7a2c2b21f8ef
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/repo-patterns.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:fb7eb661c6b94a5945c697ff4b663d37767710042ce05466d698da26576b4882
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/resourcesets.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:f5c89885a4c8e2f63f77aaa58c78ad50bbdd672b03cf434c030aba8f7e81a859
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/sources.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:c1719a4bc910a689451cfd4bf84873942e8f50fa57a95564be0b3e8095be34e7
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/terraform-bootstrap.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:ef57b252c031c598a8b13d5a819afabf24f0e0a102691e309daada8f134c8d6a
- kind: project-relative
target: claude
value: .claude/skills/gitops-knowledge/references/web-ui.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-knowledge
active_owner: fluxcd/agent-skills/skills/gitops-knowledge
content_hash: sha256:03569a0215d1a524f2e52dc67b9a9c0cdd54bede827f03068d3a1149fdfb1a1d
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: null
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/SKILL.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:22aabcde2ba10c6fe1f05ed455b9b57e607c6d0658b61c9ccf892f4978cdc578
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/alert-notification-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:8c5456fba106995a045e7c1a129f5d64228bf84310727df6ac7290896b4cda36
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/alert-notification-v1beta3.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:e93ca64071bdeefe984c058ebeb1c8d25ca36ba7bacec7294c4933397ed0df73
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/artifactgenerator-source-v1beta1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:172136e39d223054f9cfa6361c775d03cb2aab8a39800ebe665cd8432776708d
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/bucket-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:0cf364c5deb5bfcdbb1508faf57ef0b0bcf9192d04a40bfcef6138b75a1a7e99
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/externalartifact-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:4f25b54b3019ca9ad82c9835f7f10d7ae69332c33f095a4079b210968629f551
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/fluxinstance-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:dec17d5cc2c48762ae09621b9bd405f5d397ff3b97d365489c4ecac9e1fdcc35
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/fluxreport-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:0c9c0dc2116651b4db06419c6683b3e952055ca5fb7be957a8c32c7b78ed9d63
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/gitrepository-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:94b657279c0d5dc97270faf780b470a95e768f0ce317b5092afa95210963b936
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/helmchart-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:1738b50f6ffa8c633e2b57c9638cde8ce72d444021bc454f0fd18ecdbdc356a0
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/helmrelease-helm-v2.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:096abfb2af8b94f67f4aacf41555b94907790a9f28c9300c8aeb413093d238e9
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/helmrepository-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:e839b12b8c38b5531875693c2cbdbb946d4c3c32b5badaee26b34b6b801ae2b1
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/imagepolicy-image-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:93195c3b15ec3538f857b7a08b27371dd69f48b20de2192d842ac8d72211feba
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/imagerepository-image-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:5b73924f5e5893c2118231fbe775b4d35dbfbe1520193879397f342780f7ed5c
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/imageupdateautomation-image-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:1bf0551a92ebf04e2a469c655891f36b8b28d6dac4e95f3c80da4ec1f7290139
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/kustomization-kustomize-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:f4371c526e40e08e4dc02c2b6e72207324caa7908ae69d7f733e345906f3a5d8
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/ocirepository-source-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:0bb9bd4bbd117d69b1eb5e5dadff1e4e627d78f33858655385ab48b6548ed2be
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/provider-notification-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:8696475406efe789711de149db0eb595fdfb2f8ac5f93539ef02800fc3d68d33
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/provider-notification-v1beta3.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:2ec58d89135b07e923b1b498046bdd1501b1728ea5a8fd2df5d0a9256303f483
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/receiver-notification-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:ce19fb2024204f95ca02dc6bce511304d6e820f74097a5ce594eb534c87cbdd9
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/resourceset-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:f6d39f60e5aeffbc1240a023ec591bbc863594617c88b6b44b09b43321280ca8
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/assets/schemas/resourcesetinputprovider-fluxcd-v1.fields.txt
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:1ba06611e5067d51244a9b126d16234b38cbf31f89a906ba5e5846048bdcfc3f
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/evals/evals.json
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:a35a9392470be32858cc9f7fcbd5343f2a27d2f35de0e41718dfe60d976cedb5
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/references/api-migration.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:bd0eea7f9f0f2499edd9f760f9792c5efa031fa17ca19279df8fcab443f7e402
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/references/best-practices.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:0805c25709ba849c799e74a6c869cc9a3c62dd2689379153c06ebf8b92741f66
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/references/flux-api-summary.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:d0e859a78164ab3341ccda2905b282c1ff02dc417f8af91fa2e746dbff72cf8c
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/references/flux-operator-api-summary.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:4f1995923db2239844f0234ed8e3a7ef27cfdeaf1ad11d53ad4294b87f1fcf4d
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/references/repo-patterns.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:ef3c9ff6af4aed2c2437f95d0166aac2bfd7ce2c244bfcbb380c3943ab4f7d0e
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/references/security-audit.md
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:346bcf7e4d57a5b4e13b4b3d312e48db45abdc843402c068cf1a7e861ff9fa3f
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/scripts/check-deprecated.sh
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:8804a3644f3424508bf5eb2f87a4068a4bebf15f93735db2d1cdce7812ff8821
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/scripts/discover.sh
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:8e6cd89dced83d615a064c223af5603684dee54b82e3e613215283ed0ce70741
- kind: project-relative
target: claude
value: .claude/skills/gitops-repo-audit/scripts/validate.sh
runtime: null
scope: project
owners:
- fluxcd/agent-skills/skills/gitops-repo-audit
active_owner: fluxcd/agent-skills/skills/gitops-repo-audit
content_hash: sha256:788cc2cbf8e8f6b0307077cf854ab23acbe74b0c22f4213800723084c1e39610
- kind: project-relative
target: claude
value: .claude/skills/grill-me
+3 -35
View File
@@ -1,5 +1,5 @@
name: holocron
version: 0.8.0
version: 0.7.0
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
license: MIT
@@ -32,21 +32,9 @@ dependencies:
# wrapper rather than as direct entries, so the marketplace and this repo
# consume them by the same path. The pins live in plugins/mattpocock/apm.yml:
# third-party content is pinned, unlike the first-party entries above,
# which stay unpinned for default-branch parity. The same rule holds for the
# fluxcd skills gitops pins in plugins/gitops/apm.yml.
# which stay unpinned for default-branch parity.
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/mattpocock
# The delivery team and the infra tool packages (map #166). Their own
# sibling dependencies (git, gitea, mattpocock, k8s) resolve transitively
# and dedupe against the entries above.
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/delivery
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/ansible
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/gitops
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/k8s
mcp: []
# Turns apm's executable-trust gate ON. Without this block the gate is disabled
@@ -71,10 +59,6 @@ executables:
kyberforge#2.2.1:
hooks: true
bin: true
# delivery ships the guard hook (ADR-0032 enforcement layer 2). Same
# version-in-key convention as above, kept by the same sync check.
delivery#0.2.0:
hooks: true
marketplace:
# apm's Claude marketplace mapper only emits description:/version: into the
@@ -82,7 +66,7 @@ marketplace:
# top-level apm.yml description:/version: above are NOT inherited into the
# compiled output despite being used elsewhere (e.g. by `apm audit`).
description: AI development skills for Claude Code, and for GitHub Copilot through apm — factory, design, implement, review, and cross-cutting workflows.
version: 0.8.0
version: 0.7.0
owner:
name: Mortis
url: https://git.rkdr.net/Mortis/
@@ -130,19 +114,3 @@ marketplace:
- name: lint
source: ./plugins/lint
category: Developer Tools
- name: delivery
source: ./plugins/delivery
category: Developer Tools
- name: ansible
source: ./plugins/ansible
category: Infrastructure
- name: gitops
source: ./plugins/gitops
category: Infrastructure
- name: k8s
source: ./plugins/k8s
category: Infrastructure
@@ -35,9 +35,6 @@ approved) are human-set tracker state. `mattpocock`'s thinking tools (`wayfinder
- *Amended 2026-11-22 (holocron#173): QA ran on the pushed branch before the PR opened, and CI was
required on branch push as well as PR; both moved to the draft PR, and acceptance checks were
added.*
- Claude Code is the tested target; Copilot CLI is written to its documented behaviour but untested
until an account exists; other runtimes are best effort.
- *Amended 2026-11-22 (holocron#173): Copilot CLI was a tested target; with no account to test on,
it is supported from its documentation only.*
- Claude Code and Copilot CLI are the tested targets; other runtimes are best effort.
- Infra applies happen by merge (GitOps for Flux, Ansible and OpenTofu alike), so the PR gate is the
apply gate; the operator verifies and opens revert PRs, never reverting on its own.
@@ -11,10 +11,8 @@ Code and Copilot CLI. Decided in holocron#172.
Every package skill classifies each command it drives into one tier:
- **Read** — lint, syntax check, dry run, diff, `kubectl get/describe/logs`, `flux get`, an offline
render or rendered diff (`kustomize build`, `flux build --dry-run`). Free. Live `kubectl diff` and
`flux diff` are server-side dry runs that need write RBAC, so they fail under the read-only
kubeconfig and are not used.
- **Read** — lint, syntax check, dry run, diff, `kubectl get/describe/logs`, `flux get`, `flux diff`,
`kubectl diff`. Free.
- **Propose** — branch, commit, push, open a PR, comment. Free.
- **Apply-by-merge** — every change to infrastructure. Happens only through an approved merge; the
agent never runs it.
@@ -32,11 +30,8 @@ Every package skill classifies each command it drives into one tier:
Agents never decrypt Ansible Vault or Sealed Secrets and never read the material that would. Stage
sessions use a kubeconfig bound to the built-in `view` ClusterRole (which excludes Secrets) plus a
read-only aggregated role for `SealedSecret` objects. Ansible stage work runs only what succeeds with
a placeholder vault password (`--syntax-check`, `ansible-lint`, inventory reads). A real
`--check --diff` before merge is reopened: check mode still runs PR-controlled code (lookups,
`delegate_to: localhost`, `check_mode: false` tasks, plugins) with the production credentials, so
running it in CI on a bot PR hands the bot those credentials. Decided in
[Pre-merge Ansible dry run without exposing production credentials](https://git.rkdr.net/Mortis/Holocron/issues/200).
a placeholder vault password (`--syntax-check`, `ansible-lint`, inventory reads); a real
`--check --diff` runs in CI, which holds the password.
## Enforcement layers
@@ -47,19 +42,13 @@ running it in CI on a bot PR hands the bot those credentials. Decided in
4. **Credential boundary** in each consuming repo — the real control:
- agents act as a dedicated Gitea bot user;
- branch protection: approvals allowlist of humans only, dismiss stale approvals, bot off the
merge allowlist, protected file patterns for agent config, AGENTS.md and CI workflows; test
paths stay out, because protecting them would block the test author's own commits;
- every PR carries the dry run as a required status and a PR comment; apply happens after merge.
Flux's is an offline rendered diff of base and head that holds no cluster credential; a live
`flux diff` needs write RBAC, because Kubernetes authorises dry-run requests like real ones, so
it is not used. Ansible's pre-merge `--check --diff` is reopened (see Secrets); later
`tofu plan`;
merge allowlist, protected file patterns for agent config, AGENTS.md, CI workflows and tests;
- every PR carries the dry run (`--check --diff`, `flux diff`, later `tofu plan`) as a required
status and a PR comment; apply happens after merge;
- stage leads start only when a user on the human allowlist in `docs/agents/delivery.md` set the
gate label, checked against the issue timeline;
- a CI test-path check, run from `main`'s copy, fails if a commit after the test author's
(trailer `Delivery-Stage: test-author`) touches the globs in `.gitea/test-paths`; this check,
not file protection, guards tests. The implementer hands disputed tests back instead of editing
them.
- a CI check fails if test paths changed after the test author's commit; the implementer hands
disputed tests back instead of editing them.
5. Pre-commit and CI in the consuming repo are the deterministic backstop.
## Considered Options
@@ -84,27 +73,3 @@ running it in CI on a bot PR hands the bot those credentials. Decided in
starting it, keeping untrusted text out of it, and answering each ask.
- Headless sessions running repo-controlled config are not addressed here; launching from pinned
config is part of run mode.
- **Accepted risk:** agent sessions run as root on the dev box until [Agent unix user for delivery sessions](https://git.rkdr.net/Mortis/Holocron/issues/201) is
done. Root can read the vault password, the host SSH key and the admin kubeconfig, so on that
machine the credential boundary is a guardrail only. Partial mitigation: delivery sessions export
`KUBECONFIG` to a read-only kubeconfig, so accidental cluster writes fail.
- **Accepted risk:** same-repo branches reach repo secrets. The bot (the existing `Claude` Gitea
user) pushes same-repo branches; Gitea runs a `pull_request` workflow from the PR branch's own copy
and gives same-repo PRs the repo secrets, so a bot branch can read them. Protected file patterns
block the merge, not the run.
- **Accepted risk:** Copilot CLI's TUI auto-approves a hook `ask` (github/copilot-cli#3590, open
since v1.0.53), so on Copilot an odd-job ask may run without a human answer. The owner kept ask
on Copilot rather than deny; Copilot is untested in v1 and the credential boundary still holds.
- The guard hook (`plugins/delivery/.apm/hooks/guard.py`) also checks file-tool paths (Read, Grep,
Edit, Write, Copilot's `view`, Codex's `apply_patch`) against the secret-path globs, not only
shell commands. `kubectl`, `helm`, `flux` and `tofu` are allowlists of subcommands that change no
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
denied there; an unrecognised runtime is treated the same way.
- *Amended 2026-11-23 ([delivery guard hook](https://git.rkdr.net/Mortis/Holocron/issues/190)): Copilot ask kept
as an accepted risk; the guard covers file tools and uses read-verb allowlists.*
- *Amended 2026-11-22 ([Credential boundary setup in ansible-homelab-mono](https://git.rkdr.net/Mortis/Holocron/issues/184)): test paths left
the protected file patterns for the test-path check; the Flux dry run became an offline render,
and live `kubectl diff` left the Read tier;
the CI `--check --diff`, and with it the rejection of gated vault-touching check runs, were
reopened; the root-session and same-repo-branch risks were accepted.*
@@ -0,0 +1,250 @@
# Copilot CLI: custom agents, subagent delegation, pinned models and preToolUse hooks
Wayfinder research ticket, Gitea `Mortis/Holocron` #187 (map #166). Docs-only: Copilot CLI was not installed and no account was used, so nothing here was tested hands-on. Researched 2026-11-22.
Every claim is backed by a primary source: docs.github.com, or the `github/copilot-cli` repository's `changelog.md`, releases or issues. The docs.github.com pages carry no version or date, so they are cited as "retrieved 2026-11-22". At that date the newest changelog entry is **1.0.114 (2026-11-18)**. Changelog entries are cited as `vX.Y.Z (date)`. Some entries appear twice, in both 1.0.106 and 1.0.107, and this note cites the earlier one.
## Answers
1. **Delegation from a `--agent` session:** Yes, in both interactive and `-p` mode, as far as the docs and changelog show. The session agent dispatches subagents through the `task` tool, custom agents included, and the default `tools: ["*"]` keeps `task` available. No doc page says in so many words "a session started with `--agent` can delegate", so this is inferred. Agents are `*.agent.md` (or `*.md`) files in `~/.copilot/agents/`, `.github/agents/`, `.claude/agents/`, plugin `agents/`, or org/enterprise repositories.
2. **Pinned `model`:** Yes, it is honoured now, with caveats. #980 (ignored entirely) was fixed in 0.0.415 (2026-02-23). #2950 (ignored when the agent is delegated to via a prompt) was closed on 2026-10-04 as "resolved as of v1.0.91", but no 1.0.91 changelog entry mentions it. #4437 (a `.claude/agents` `model:` hijacking a `.github/agents` agent) is still open, and a fix was announced for v1.0.104. An explicit `--model`, a `subagents` override, or an Auto session model still beats the pinned model unless the agent sets `model-policy: required`.
3. **`tools` and delegation:** Yes. A restricted `tools` list must include the subagent tool. The documented custom-agent alias is **`agent`**, with compatible aliases **`custom-agent`** and **`Task`** (case-insensitive). The CLI's underlying tool is named **`task`**, with companions `read_agent`, `write_agent` and `list_agents`. `runSubagent` is not documented for Copilot CLI.
4. **preToolUse with `deny` and `ask`:** Yes, both are documented. `permissionDecision` takes `"allow"`, `"deny"` or `"ask"`. Hooks live in `.github/hooks/*.json`, `~/.copilot/hooks/*.json`, settings files, plugins or agent frontmatter. `ask` has been supported since 1.0.4 (2026-03-11), but autopilot and cloud agent convert it to deny, and `-p` behaviour for `ask` is not documented. Open bug #3590 reports the TUI auto-approving `ask` since 1.0.53.
---
## Q1. Delegation from a `--agent` session, and how custom agents are defined
### Delegation
- The main agent "can choose to delegate a task to a subsidiary subagent process" using a custom agent. You can also run a custom agent for the whole session with `/agent`, by naming it in a prompt, or with `copilot --agent=<id> --prompt "..."`. Source: [Invoke custom agents](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/invoke-custom-agents), retrieved 2026-11-22.
- "Selecting a custom agent for a whole session and delegating a subtask to one are different uses of the same profile." Source: [About custom agents (CLI)](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-custom-agents), retrieved 2026-11-22.
- The CLI command reference names the "Session agent (the default agent, or a custom agent selected with `--agent`)" as a role distinct from a "Custom agent spawned as a subagent — through the `task` tool". It also documents nesting: "When the depth limit is reached, the innermost agent cannot spawn further subagents." The default max depth is `6` (maximum `256`). Source: [CLI command reference, Custom agents reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#custom-agents-reference), retrieved 2026-11-22.
- The changelog contradicts the depth default. It says "Lower the default maximum sub-agent nesting depth from 6 to 4" in v1.0.71 (2026-07-16). I'm not certain which value is current. Either way, `maxDepth` can only be changed on usage-based billing plans.
- `tools` defaults to `["*"]` (all tools), so an agent without a `tools` list has `task`. Source: same CLI command reference, "Custom agent frontmatter fields".
- **`-p` / prompt mode:** the changelog records subagent dispatch working headlessly:
- v1.0.49 (2026-05-18): "Plugins loaded via --plugin-dir now correctly register their agents as available task(agent_type=...) subagents in prompt mode".
- v1.0.81 (2026-08-27): "`--agent <plugin>:<agent>` works headlessly".
- v1.0.106 (2026-11-05): "In `-p` mode, a sub-agent's streamed reply now ends with a line break ... the task tool's row".
- Issue [#4437](https://github.com/github/copilot-cli/issues/4437) (CLI 1.0.79) contains a working repro in which a custom orchestrator agent with tool `task` spawns `task(agent_type: developer, ...)`. That is user evidence, not documentation.
- **Not documented:** no page explicitly says that a custom agent selected with `--agent` together with `-p` can delegate to another custom agent. The evidence above strongly implies it can, but I'm not certain without a hands-on test.
### Definition: locations and precedence
From the [CLI command reference, "Custom agent locations"](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#custom-agent-locations), retrieved 2026-11-22. When two agents share an ID, the first one loaded wins.
| Priority | Scope | Location |
|---|---|---|
| 1 (highest) | User | `~/.copilot/agents/` |
| 2 | Project | `.github/agents/`, from the cwd up to the Git root (deepest wins) |
| 3 | Project | `.claude/agents/`, from the cwd up to the Git root |
| 4 | Added root | `.github/agents/` and `.claude/agents/` under `--add-dir` / `/add-dir` directories |
| 5 | Plugin | `<plugin>/agents/` |
| 6 (lowest) | Remote | Organization or enterprise agents |
- **Naming:** a file named `*.agent.md` or `*.md`. The agent ID is the file name minus that extension, and subdirectories are joined with `--`: `agents/team/reviewer.agent.md` becomes `team--reviewer`. The `name` field does not deduplicate. Sources: the CLI command reference above, and [Create custom agents for CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli), retrieved 2026-11-22.
- **Discovery changes in the changelog:**
- Agents are discovered recursively: v1.0.55 (2026-05-28).
- Nested `.github/agents` directories are found from subdirectories: v1.0.62 (2026-06-13).
- Agents added to `.github/agents/` during a session are used without reloading: v1.0.109 (2026-11-10).
- The original feature shipped in v0.0.353 (2025-10-28).
### Frontmatter fields
The field names differ between docs pages. The CLI command reference uses **camelCase** (`modelPolicy`, `reasoningEffort`). The CLI how-to and the `--model` option text use **kebab-case** (`model-policy`, `strict-tools-list`). Changelog v1.0.88 also uses `reasoning-effort`. I'm not certain whether both spellings are accepted. Kebab-case is what the how-to example and the changelog use.
| Field | Meaning (source) |
|---|---|
| `description` | Required. Shown in the agent list and in the `task` tool (CLI ref). |
| `name` | Optional display name, usable with `--agent` (CLI ref). |
| `tools` | List of tools; the default is `["*"]` (CLI ref). The config reference also allows a comma-separated string. |
| `model` | Model for the agent; inherits the outer agent's model when unset (CLI ref). The how-to says to use the provider-qualified ID for BYOK models. Display names have been accepted since v1.0.24. |
| `models` | List of models in priority order; overrides `model` (CLI ref). Changelog v1.0.83 instead says `model` itself can hold a list. |
| `modelPolicy` / `model-policy` | `preferred` (default) or `required` (CLI ref, how-to). |
| `reasoningEffort` / `reasoning-effort` | Default effort (CLI ref; changelog v1.0.66, v1.0.88). |
| `strict-tools-list` | `true` limits the agent to the listed tool groups "without adding the usual default tools" (how-to). |
| `include-custom-instructions` | Lets the agent receive AGENTS.md, CLAUDE.md and `copilot-instructions.md` when it runs as a subagent (CLI ref, how-to; v1.0.86). |
| `infer` | "Allow auto-delegation by the main agent", default `true` (CLI ref). The config reference marks it **retired** in favour of `disable-model-invocation` and `user-invocable` (v0.0.411, 2026-02-17). |
| `disable-model-invocation` | `true` means the agent must be selected by hand and is not auto-delegated (config ref). |
| `user-invocable` | `false` hides the agent from the picker so it is only reachable programmatically (config ref; v0.0.412). |
| `mcp-servers` | Per-agent MCP servers (CLI ref, config ref). |
| `hooks` | Agent-scoped hooks that apply only while the agent is selected (hooks ref; v1.0.97). |
| `deferred-tool-loading` | Opt-in tool search (changelog v1.0.52). |
Source for the config-reference rows: [Custom agents configuration](https://docs.github.com/en/copilot/reference/custom-agents-configuration), retrieved 2026-11-22.
- Unknown frontmatter keys produce a warning instead of blocking the load since v0.0.415 (2026-02-23).
- Since v1.0.106 (2026-11-05), `-p --agent` prints a warning to stderr for frontmatter keys that Copilot ignores.
- A custom agent whose name matches a built-in agent (`explore`, `task`, `general-purpose`, `code-review`, `research`, `rubber-duck`, `security-review`) is not offered for delegation, because "delegating to that name always runs the built-in agent". Source: v1.0.106 (2026-11-05).
## Q2. Is a pinned `model` honoured?
### Current documented behaviour
From the [CLI command reference, frontmatter fields](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#custom-agent-frontmatter-fields), retrieved 2026-11-22:
- The pinned model applies "whether the agent is dispatched through the `task` tool or started directly".
- Precedence, highest first:
1. an explicit per-call value (the `task` call's `model` argument);
2. the `subagents` override in `~/.copilot/settings.json` or the `/subagents` picker;
3. the agent's `model`, `models` or `reasoningEffort`;
4. the parent session's value.
- "A declared model or effort that can't be honored falls back to the session's value instead of failing the dispatch — unless the agent declares `modelPolicy: "required"`", in which case dispatch is refused.
- "When the session model is set to `Auto` (server-selected), subagents always inherit the resolved session model regardless of this field." Changelog v1.0.33 (2026-04-20) says the same: "Sub-agents in auto mode now inherit the session model".
- The `--model` option: "An explicit `--model` takes precedence over a custom agent's `model` unless the agent sets `model-policy: required`." Changelog v1.0.106 (2026-11-05) agrees: "Use explicit --model with custom agents unless the agent requires a specific model".
### Issues about the pinned model being ignored
| Issue | Title | Status | Fix / cross-check |
|---|---|---|---|
| [#980](https://github.com/github/copilot-cli/issues/980) | Model from agent.md isn't recognized | Closed, completed, 2026-04-07 | A comment says it was fixed in v0.0.415. The changelog for v0.0.415 (2026-02-23) agrees: "Custom agents support the `model` field ... unknown fields now warn instead of blocking agent load". Before that, 0.0.400 reported `agent uses unsupported fields: model` for a `.github/agents/*.agent.md` file. |
| [#2950](https://github.com/github/copilot-cli/issues/2950) | Calling custom agent via prompt ignores configured model in agent.md | Closed, completed, 2026-10-04 | Reported on 1.0.35. `--agent` honoured the model, but delegation through a prompt did not; a commenter adds that orchestrator subagents all ran on the orchestrator's model. It was closed by an automated comment saying "resolved as of v1.0.91". **The v1.0.91 changelog has no matching entry**, so I can't confirm which release fixed it. Candidate entries: v1.0.85 (2026-09-16), "Subagent launches honor explicit model, reasoning effort, and context tier preferences ..."; v1.0.62 (2026-06-13); v1.0.22 (2026-04-09), "Plugin agents respect the model specified in their frontmatter". |
| [#2758](https://github.com/github/copilot-cli/issues/2758) | Feature Request: Allow sub-agents to use the model specified in frontmatter/task() — add opt-out for the cost-multiplier guard | **Open** (filed 2026-04-16) | Logs show `Downgrading subagent model from "claude-sonnet-4.6" (1x) to session model "gpt-4.1" (0x)`, a downgrade applied when the session runs on a 0x model. No changelog entry removes this guard. The `modelPolicy: required` behaviour (refuse instead of substitute) may change it, but I'm not certain whether the guard still exists. |
| [#4437](https://github.com/github/copilot-cli/issues/4437) | Repo `.claude/agents/*/AGENT.md` `model:` field overrides session model for Copilot custom agents, breaking subagent spawns on BYOK providers | **Open**, `more-info-needed` | Reported on 1.0.79. On 2026-10-26 a collaborator said a fix "will ship in the next release (v1.0.104)". The v1.0.104 changelog has no matching entry. The issue is still open. |
| [#3891](https://github.com/github/copilot-cli/issues/3891) | Sub-agent `model:` override is silently dropped in BYOK / custom-provider mode | Closed, completed, 2026-07-16 | Changelog v1.0.62 (2026-06-13): "Keep custom agents on their configured model when using BYOK providers"; v1.0.65 (2026-06-24): "Keep custom-agent subagent model selections when using BYOK providers". |
| [#2133](https://github.com/github/copilot-cli/issues/2133), [#3070](https://github.com/github/copilot-cli/issues/3070) | `model` array syntax rejected / accept array | Closed, completed | Changelog v1.0.83 (2026-09-04): `model` can be a list. |
| [#2845](https://github.com/github/copilot-cli/issues/2845) | Model name shown in UI is different from the actual model loaded when custom agent enabled | Open | Display-only. Not verified further. |
| [#5241](https://github.com/github/copilot-cli/issues/5241) | Copilot app: selecting a custom agent ... doesn't apply its model or reasoning-effort | Open | Affects the Copilot desktop app, not the CLI. |
- **apm-specific issues:** I found none. Searches for "apm" and ".github/agents model" in `github/copilot-cli` returned no issue about agents deployed by apm.
- The issues that do involve `.github/agents/` are #980 (`.github/agents/*.md`) and #4437, where a `.github/agents/<name>.md` agent picks up the `model:` of a same-named `.claude/agents` agent.
- Copilot CLI itself has no notion of who wrote a file. An apm-deployed `.github/agents/*.agent.md` is treated like any other project agent, as far as the docs say.
## Q3. Which tool a `tools` list needs for delegation
- **Custom-agent tool alias table.** Source: [Custom agents configuration, "Tool aliases"](https://docs.github.com/en/copilot/reference/custom-agents-configuration#tool-aliases), retrieved 2026-11-22.
- The relevant row: primary alias **`agent`**, compatible aliases **`custom-agent`** and **`Task`**, purpose: "Allows a different custom agent to be invoked to accomplish a task."
- "All aliases are case insensitive."
- "All unrecognized tool names are ignored". A misspelled alias therefore fails silently and does not raise an error.
- **CLI tool names.** Source: [CLI command reference, "Agent and task delegation tools"](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#agent-and-task-delegation-tools), retrieved 2026-11-22.
- `task` ("Run subagents")
- `list_agents`
- `read_agent` ("Check background agent status")
- `write_agent` ("Send a message to a running agent")
- **Changelog:**
- v0.0.380 (2026-01-13): "Custom agent tool aliasing for the task tool".
- v1.0.64 (2026-06-23): "Keep task companion tools available to custom agents that use the task or agent alias". This implies that listing `agent` or `task` also brings in `read_agent`, `write_agent` and `list_agents`.
- **Hooks naming:** in Claude-format hooks, the runtime tool `task` maps to the Claude name `Agent`. Source: [CLI hooks reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-hooks-reference), retrieved 2026-11-22.
- **Recommendation:** list `agent`, which is the documented primary alias. Listing `task` (the raw tool name) is also accepted per v1.0.64.
- **`runSubagent`:** not documented for Copilot CLI on any page I read.
- **`strict-tools-list`:** without it, the CLI adds "the usual default tools" to a restricted list (how-to page). **Not documented:** whether `task` is one of those default tools. Don't rely on it; list `agent` explicitly.
- **Older bugs in this area (closed):**
- [#556](https://github.com/github/copilot-cli/issues/556), "Copilot CLI --agent use does not respect tool filtering", closed 2026-02-25.
- [#4594](https://github.com/github/copilot-cli/issues/4594) and [#4023](https://github.com/github/copilot-cli/issues/4023): the `web` and `search` aliases bound no tools. Closed 2026-10-26; fixed in v1.0.100 (2026-10-19) and v1.0.106.
- [#3531](https://github.com/github/copilot-cli/issues/3531): Claude-style scalar `tools: Read, Write, Bash`. Closed not_planned by its reporter (not GitHub staff), who said the scalar form already loads on 1.0.55.
## Q4. preToolUse hooks: `deny` and `ask` before a shell command
All points below come from the [CLI hooks reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-hooks-reference), retrieved 2026-11-22, unless noted.
### Config locations (all matching entries run)
- **Policy:** `/etc/github-copilot/policy.d/*.json`. Root-owned, loaded first, and cannot be disabled.
- **Repository:** `.github/hooks/*.json`.
- **User:** `~/.copilot/hooks/*.json` (or `$COPILOT_HOME/hooks/`). Added in v0.0.422 (2026-03-05).
- **Inline `hooks` key in settings files:**
- repository: `.github/copilot/settings.json`, `.github/copilot/settings.local.json`, `.claude/settings.json`, `.claude/settings.local.json`;
- user: `~/.copilot/settings.json`.
- `~/.copilot/config.json` is no longer read for hooks.
- **Plugins:** `hooks.json` or `hooks/hooks.json`.
- **Agent-scoped:** a `hooks` map in a custom agent's frontmatter. CLI only, and active only while that agent is selected (v1.0.97, 2026-10-13).
- **Trust:** repository hooks load only after folder trust is confirmed (v1.0.8). In `-p` they load only when the folder is already trusted, `COPILOT_ALLOW_ALL` is set, or `GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS=true` (CLI command reference env vars; changelog v1.0.40 and v1.0.49). Since v1.0.111 (2026-11-13), the CLI warns when `-p --trust-folder` runs from a subdirectory and skips the root hooks.
### Schema
```json
{
"version": 1,
"hooks": {
"preToolUse": [
{ "type": "command", "bash": "./scripts/guard.sh", "powershell": "...", "command": "...",
"cwd": ".", "env": { "K": "V" }, "timeoutSec": 30, "matcher": "bash|powershell" }
]
}
}
```
- `type` is `command` (the default) or `http`. HTTP entries take `url` (which must be https for preToolUse), `headers` and `allowedEnvVars`.
- `command` is the cross-platform fallback for `bash` and `powershell`. `exec` and `args` run without a shell.
- `timeoutSec` defaults to 30; `timeout` is an alias.
- `matcher` is a regex anchored as `^(?:PATTERN)$` against `toolName`. The changelog says the matcher was ignored before v1.0.36 (2026-04-24).
- PascalCase `PreToolUse` with the Claude-style nested `matcher`/`hooks` structure is also accepted (v1.0.6). Its matcher uses Claude tool names, so `bash` and `powershell` match as `Bash`.
### Input on stdin
- camelCase (`preToolUse`): `{ sessionId, timestamp (Unix ms), cwd, toolName, toolArgs }`. `toolArgs` is typed `unknown`.
- **Not documented:** whether `toolArgs` arrives as a JSON string or an object. I'm not certain.
- The shell tool is named `bash` or `powershell`.
- PascalCase (`PreToolUse`): `{ hook_event_name, session_id, timestamp (ISO 8601), cwd, tool_name ("Bash"), tool_input }`.
- Subagent calls also carry `agentId`, `agentType` and `parentAgentId`. Hooks fire for subagent tool calls since v1.0.49 (2026-05-18).
### Output on stdout
- `permissionDecision`: `"allow"`, `"deny"` or `"ask"`.
- `permissionDecisionReason`: required for `deny`.
- `modifiedArgs`: replacement tool arguments.
- If any hook returns `deny`, the tool call is blocked.
### Exit codes and failure modes
- Exit `0`: stdout is parsed.
- Exit `2`: treated as a deny that a stdout `allow` cannot override. Exit-2 deny was added in v1.0.70 (2026-07-09).
- Any other non-zero exit, or a crash, fails closed: the call is denied with "Denied by preToolUse hook (hook errored)". Since v1.0.57 (2026-06-01) a hook error denies the call instead of allowing it.
- **Command-hook timeouts fail open**, "even for `preToolUse` and policy hooks". So do HTTP hook network errors and non-2xx responses. Changelog v1.0.67 (2026-06-30): "Allow tool calls to continue when hooks time out".
### Is `ask` actually supported?
- **Documented:** yes. Changelog v1.0.4 (2026-03-11): "Hooks can now request user confirmation before tool execution with 'ask' permission decision". When the CLI can show the prompt, the user can deny with feedback, which is forwarded to the agent (v1.0.64).
- **Documented exceptions:**
- Under **autopilot**, `ask` is denied (v1.0.97).
- Under **cloud agent**, `ask` is treated as `deny`.
- In **ACP mode**, `ask` goes to the ACP client since v1.0.109 (2026-11-10), after [#5396](https://github.com/github/copilot-cli/issues/5396), which was closed.
- **`-p` (non-interactive) mode:** **not documented** for `ask`. The hooks reference points `-p` and CI users to `permissionRequest` hooks for programmatic allow and deny instead.
- **Issues:**
- [#3590](https://github.com/github/copilot-cli/issues/3590), "PreToolUse hook permissionDecision: "ask" auto-approved by TUI since v1.0.53": **open**. The prompt flashes and is auto-approved; 1.0.52 worked. Later changelog entries assume `ask` prompts work: v1.0.64 forwards rejection feedback, and v1.0.108 (2026-11-09) gives parallel calls their own confirmation. I'm not certain whether #3590 still reproduces on 1.0.114.
- [#4135](https://github.com/github/copilot-cli/issues/4135), "Hook `ask` decisions show raw JSON instead of diff view": open. Cosmetic.
- [#4237](https://github.com/github/copilot-cli/issues/4237), "Steering message in `preToolUse` "ask" denial is silently dropped": closed, completed, 2026-09-19.
- [#2647](https://github.com/github/copilot-cli/issues/2647), "preToolUse "ask" feedback is not shown to the agent": closed, completed, 2026-09-25.
- [#2893](https://github.com/github/copilot-cli/issues/2893), "preToolUse hooks silently bypassed under parallel tool calls (timeout->allow fallback + serial dispatch)": **open** (reported on 1.0.35). The documented timeout fail-open behaviour is the root cause. The hooks reference now says hooks for different calls in a parallel batch run concurrently, which may address the serial-dispatch half.
- [#2540](https://github.com/github/copilot-cli/issues/2540), "Plugin-defined preToolUse hooks (hooks.json) do not fire": open, `more-info-needed` (reported on 1.0.18).
- [#5326](https://github.com/github/copilot-cli/issues/5326), "Denied by preToolUse hook from ".github/hooks/rtk-rewrite.json" (hook errored)": open, on 1.0.104 in cloud. It shows how a repository hook that errors blocks every call (fail-closed). This matters here because this repo uses `rtk`.
## Limitations for `delivery` agents
These are the open bugs and undocumented behaviours that could affect our custom agents deployed by apm into `.github/agents/`. The status of each is as of 2026-11-22.
1. **The pinned model can be overridden without notice.**
- An explicit `--model`, a user `subagents` override, or an **Auto** session model all beat the agent's `model` (CLI command reference; v1.0.106).
- A model that can't be resolved falls back to the session model without failing.
- Mitigation: `model-policy: required` (documented). Its camelCase/kebab-case spelling is inconsistent across the docs.
2. **#4437, open.** A same-named `.claude/agents/<name>/AGENT.md` with a `model:` field overrides the `.github/agents/<name>.md` agent's model. A fix was announced for v1.0.104 but no changelog entry confirms it. This matters if apm deploys an agent to both `.claude/agents/` and `.github/agents/` under the same ID.
- Separate point, from the documented precedence: `.github/agents/` outranks `.claude/agents/`, and `~/.copilot/agents/` outranks both. A user-level agent with the same ID silently replaces the repo-deployed one.
3. **#2758, open.** A cost-multiplier guard reportedly downgrades a subagent's pinned model to the session model when the session runs on a 0x model. I'm not certain it still applies.
4. **#2950, closed.** Its auto-close cites v1.0.91, but no changelog entry confirms the fix. Verify on the installed version that orchestrator-delegated subagents run on their pinned models.
5. **The subagent tool must be in `tools`.** A restricted `tools` list needs `agent` (or `custom-agent`, `Task` or `task`) for the orchestrator to delegate. Unrecognized names are silently ignored. **Not documented:** whether `task` is among the "default tools" added when `strict-tools-list` is off.
6. **Subagents don't get AGENTS.md by default.** Custom agents spawned as subagents do not receive AGENTS.md, CLAUDE.md or `copilot-instructions.md` unless they set `include-custom-instructions: true`. This is documented behaviour, not a bug.
7. **#5124, open.** The `--agent <name>` selection is dropped about 1 second after interactive startup (a race with sign-in or MCP reload), and the session silently falls back to the default agent. Reported on 1.0.95. v1.0.108 has a related fix ("Keep built-in agents selected with --agent active ..."), which covers built-in agents only. I'm not certain it fixes custom agents.
8. **#4752, open.** `--agent <name>` does not find agents that exist only under an `--add-dir` directory (1.0.83). This doesn't matter for agents in the repo's own `.github/agents/`.
9. **#5543, open (filed 2026-11-21).** Subagents started by other subagents always run synchronously. `mode: "background"` is silently ignored and `write_agent` refuses them. This affects multi-level delivery chains.
10. **Subagent limits.** Concurrency is plan-capped (Free 2, Pro 4, Business 16, Enterprise 32), and depth defaults to 6 per the docs or 4 per changelog v1.0.71. Both limits are adjustable only on usage-based billing.
11. **Name collisions with built-in agents.** An agent that shares a built-in's name is never delegated to (v1.0.106). Avoid `task`, `explore`, `general-purpose`, `code-review`, `research`, `rubber-duck` and `security-review` as agent IDs or names.
12. **The `ask` hook is unreliable.**
- [#3590](https://github.com/github/copilot-cli/issues/3590) (open): the TUI auto-approves `ask` since 1.0.53.
- `ask` is denied under autopilot and under cloud agent.
- `-p` behaviour is not documented.
- Don't make `ask` the only safety gate; use `deny`, or exit code 2, for hard stops.
13. **Hooks fail open on timeout.** Command-hook timeouts allow the call, even for preToolUse (documented). Open issue [#2893](https://github.com/github/copilot-cli/issues/2893) describes the bypass. A guard hook must be fast and well inside `timeoutSec`.
14. **Repo hooks may not load in `-p`.** They load only in a trusted folder, with `COPILOT_ALLOW_ALL`, or with `GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS=true`. Since v1.0.111, the CLI warns when `-p` runs from a subdirectory and skips the root hooks.
15. **#2540, open.** Plugin-defined preToolUse hooks reportedly never fire. This is relevant if hooks are shipped through an apm or Copilot plugin instead of `.github/hooks/`.
## Sources
- [docs: Custom agents configuration (tool aliases, frontmatter)](https://docs.github.com/en/copilot/reference/custom-agents-configuration), retrieved 2026-11-22, undated
- [docs: Copilot CLI command reference (custom agents reference, tool names, `--model`, subagent limits)](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference), retrieved 2026-11-22, undated
- [docs: Create custom agents for CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli), retrieved 2026-11-22, undated
- [docs: Invoke custom agents](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/invoke-custom-agents), retrieved 2026-11-22, undated
- [docs: About custom agents (CLI)](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-custom-agents), retrieved 2026-11-22, undated
- [docs: Copilot CLI hooks reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-hooks-reference), retrieved 2026-11-22, undated
- [github/copilot-cli changelog.md](https://github.com/github/copilot-cli/blob/main/changelog.md), read 2026-11-22; covers 0.0.328 (2025-09-26) to 1.0.114 (2026-11-18)
- [github/copilot-cli releases](https://github.com/github/copilot-cli/releases)
- Issues in github/copilot-cli: [#556](https://github.com/github/copilot-cli/issues/556), [#980](https://github.com/github/copilot-cli/issues/980), [#2133](https://github.com/github/copilot-cli/issues/2133), [#2540](https://github.com/github/copilot-cli/issues/2540), [#2647](https://github.com/github/copilot-cli/issues/2647), [#2758](https://github.com/github/copilot-cli/issues/2758), [#2845](https://github.com/github/copilot-cli/issues/2845), [#2893](https://github.com/github/copilot-cli/issues/2893), [#2950](https://github.com/github/copilot-cli/issues/2950), [#3070](https://github.com/github/copilot-cli/issues/3070), [#3531](https://github.com/github/copilot-cli/issues/3531), [#3590](https://github.com/github/copilot-cli/issues/3590), [#3891](https://github.com/github/copilot-cli/issues/3891), [#4023](https://github.com/github/copilot-cli/issues/4023), [#4135](https://github.com/github/copilot-cli/issues/4135), [#4237](https://github.com/github/copilot-cli/issues/4237), [#4437](https://github.com/github/copilot-cli/issues/4437), [#4594](https://github.com/github/copilot-cli/issues/4594), [#4752](https://github.com/github/copilot-cli/issues/4752), [#5124](https://github.com/github/copilot-cli/issues/5124), [#5241](https://github.com/github/copilot-cli/issues/5241), [#5326](https://github.com/github/copilot-cli/issues/5326), [#5396](https://github.com/github/copilot-cli/issues/5396), [#5543](https://github.com/github/copilot-cli/issues/5543)
-5
View File
@@ -42,11 +42,6 @@ These are routing boundaries, not inventories — they answer "where does a new
| `gitea` | Anything reached through the Gitea HTTP API rather than the git wire protocol — the forge's own objects |
| `kyberforge` | Creating and maintaining a Claude Code / Copilot CLI plugin marketplace — this repo's own meta-tooling |
| `lint` | Configuring and running linters against a target repo; repo-agnostic, first linter is Vale |
| `mattpocock` | Third-party skills redistributed from upstream at a pinned release; no first-party content |
| `delivery` | Taking a change from spec to a verified merge through tracker-gated stages; the stage-lead and specialist agents, not any one tool's know-how |
| `ansible` | Authoring, testing and dry-running Ansible playbooks, roles and collections |
| `gitops` | Authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it; pod-level problems hand off to `k8s` |
| `k8s` | Read-only diagnosis of workloads on a Kubernetes cluster |
| `bin` | Unsorted skills that have not earned a home yet |
One compiler produces the generated content in the tree:
+13 -23
View File
@@ -55,7 +55,7 @@ Nine hooks, grouped below by what they guard rather than by the order `.pre-comm
| Hook | Guards |
|---|---|
| `check-scope-walkup-sync` | `validate.sh`, `validate-provenance.sh`, `new-agent.sh` and `new-skill.sh`'s four independent `$HOME`/`.git`/`apm.yml` walk-up ports still agree behaviorally |
| `check-executables-allow-sync` | root `apm.yml`'s `executables.allow` carries a `<name>#<version>` key naming the actual version of every plugin that ships executables (`.apm/hooks/` or `bin/`) (see [apm gates](#apm-gates)) |
| `check-executables-allow-sync` | root `apm.yml`'s `executables.allow` key names kyberforge's actual version (see [apm gates](#apm-gates)) |
`check-executables-allow-sync` is the odd one in this group: the drift it guards is in a
hand-written key rather than in generated text, and it is a record-keeping gate — the grant itself is
@@ -72,7 +72,7 @@ version-blind, so a stale key deploys fine (see [apm gates](#apm-gates)).
| 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 of the seven plugin packages, waiving only a package's `lockfile-exists` (see [below](#apm-audit-ci)) |
| `apm-pack-check-clean` | `apm pack --check-versions --check-clean --dry-run` — 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)
@@ -1157,7 +1157,7 @@ exclusion landed.
### `apm-audit-ci`
`scripts/apm-audit-ci.sh` runs `apm audit --ci` **once per manifest** — the root one and each of the
plugin packages under `plugins/` — because the root-only invocation audits the marketplace manifest and
seven plugin packages — because the root-only invocation audits the marketplace manifest and
**nothing else**, and `apm-pack-check-clean` does not parse plugin `dependencies:` blocks either.
Verified: a malformed dependency entry passes
`apm pack --check-versions --check-clean --dry-run` and fails `apm audit --ci` in that package's
@@ -1249,32 +1249,22 @@ it is never called with a single key: `install/exec_gate.py` builds a candidate
the version-blind name alongside `<package>#<version>`, and `materialize_exec_map` stores every
approved key **under its version-blind name as well**. `_map_grants` matches the same three ways.
**Correction (2026-09-19):** verified against apm 0.28.0, a package version bump therefore does
**Correction (2026-09-19):** verified against apm 0.28.0, a kyberforge version bump therefore does
*not* stop the entry matching — approving `owner/repo#2.0.0` also covers `owner/repo#2.1.0` through
the version-blind alias. The earlier claim here ("no wildcard and no version-less form", so the
entry silently stops matching and the `SessionStart` hook stops deploying) described apm's behaviour
wrongly, and ADR-0019 carries the same correction.
The gate is still required, for a repo-level reason rather than an apm-level one: it asserts each
key matches its plugin's `version:`, so a bump without a key edit fails *this repo's* pre-push, and
every key stays an accurate record of what was approved.
The gate is still required, for a repo-level reason rather than an apm-level one:
`scripts/check-executables-allow-sync.sh` asserts the key matches `plugins/kyberforge/apm.yml`'s
`version:`, so a bump without a key edit fails *this repo's* pre-push, and the key stays an accurate
record of what was approved.
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/<name>/bin/` exists — kyberforge ships both, delivery ships a guard hook. For each one it
reads `name:` and `version:` from `plugins/<name>/apm.yml` and asserts root `apm.yml` carries the
`<name>#<version>` key under `executables.allow`. Keys use the package name, so a `name:` that
differs from the directory name fails rather than being guessed at. Every failing package is
reported in one run, each with its own Why/Fix block; a stale `<name>#<other-version>` key is quoted
back as "found instead". It also fails on a shipping plugin with no `apm.yml`, a missing `version:`,
a missing root `apm.yml`, or no `executables.allow` mapping. A repo with no executable-shipping
plugin at all is the one no-op, and a plugin with neither directory needs no key.
A comment in the `executables:` block stays as the human-facing pointer; the hook is what actually
holds. It parses with PyYAML where importable and falls back to a two-shape scan otherwise, so a
missing pip package cannot become the thing that blocks every push. The PyYAML reader refuses an
unquoted two-component version, which YAML reads as a float, instead of comparing a form the reader
invented.
`scripts/check-executables-allow-sync.sh` parses `version:` out of `plugins/kyberforge/apm.yml` and
asserts root `apm.yml` carries the matching `kyberforge#<version>` key. A comment in the
`executables:` block stays as the human-facing pointer; the hook is what actually holds. It parses
with PyYAML where importable and falls back to a two-shape scan otherwise, so a missing pip package
cannot become the thing that blocks every push.
## `.claude/settings.json`
View File
Whitespace-only changes.
-35
View File
@@ -1,35 +0,0 @@
name: ansible
version: 0.1.0
description: Skills for authoring, testing and dry-running Ansible playbooks, roles and collections.
author:
name: Mortis
url: https://git.rkdr.net/Mortis/
license: MIT
homepage: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/ansible
repository: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/ansible
keywords:
- ansible
- molecule
- ansible-lint
- playbook
- collection
# Constrains what .apm/ may contain: instructions, skill, hybrid, or prompts
type: hybrid
# 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
targets:
- claude
- copilot
- codex
includes: auto
dependencies:
apm: []
mcp: []
devDependencies:
apm: []
scripts: {}
File diff suppressed because it is too large. Load diff
-16
View File
@@ -1,16 +0,0 @@
{
"hooks": {
"PreToolUse": [
{
"hooks": [
{
"command": "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/guard.py",
"onFailure": "block",
"timeout": 10,
"type": "command"
}
]
}
]
}
}
@@ -1,78 +0,0 @@
---
name: delivery-repo-doc
description: >
Use when onboarding a repo to the delivery team or when its `docs/agents/delivery.md` has
drifted, e.g. a renamed CI check. Owns that file's format. Not writing AGENTS.md ->
`agentsmd-author`.
compatibility: Requires git and a forge remote. Gitea needs the Gitea MCP server (through the
gitea-* skills); GitHub needs an authenticated gh CLI.
allowed-tools: Bash Read Write Edit
metadata:
category: delivery
version: "0.1.1"
---
## Gotchas
- A glob with no installed tool skill is left out, never mapped to the closest-sounding skill: a
guess stalls every consumer stage.
- A status-check name derived from a workflow file is a candidate; the forge's reported string is
what consumers match, character for character.
- Commit authors, CODEOWNERS and collaborator lists are not sources for the allowlist or bot user:
they name who *can* act, not who is *allowed* to.
- The git remote's owner casing can differ from the forge's. Take user and owner names from the
forge or the human, never the remote URL.
- The kubeconfig is recorded as a path. Opening it, or any credential file, is outside this skill's
Read and Propose tiers.
## Step 1 — Locate
Work in the consuming repo's checkout, on its default branch, fast-forward pulled via
`git-branches`. On a dirty working tree, stop and report it. Identify the forge from
the `origin` remote (Gitea or GitHub). If `docs/agents/delivery.md` exists, this run is an
**update**; otherwise a **draft**.
Read `references/format.md` now; it is the only definition of the file's syntax.
## Step 2 — Gather repo facts
Read `references/gathering.md` and collect every repo-sourced value: contents → skills, CI check
names with roles, test paths, convention pointers. Done when every section 1–3 and 6 value has a
named source file or forge status.
## Step 3 — Ask for human facts
A human fact the caller already supplied, directly or through a source it named, is used as given.
Ask once, in one message, for every other human-sourced value `references/gathering.md` lists. On
an update, ask only for values the human must re-confirm because the repo changed. A source the
human points at, such as a tracker issue's resolution comment, counts as an answer; quote the value
from it. Wait for the answer. A value the human declines to give stays out, and the PR body names it
as open.
## Step 4 — Write
- **Draft**: write `docs/agents/delivery.md` from the format's skeleton, with this repo's values.
- **Update**: compare each existing item against the facts from Steps 2–3 and edit only the
drifted items. Leave every confirmed item byte-for-byte.
Then the pointer line: if the root `AGENTS.md` lacks the exact line from `references/format.md`,
add it where that file's placement rule says. If the repo has no root `AGENTS.md`, invoke `agentsmd-author` to create one carrying that
line, and edit nothing else in it.
Run the format's validation checklist. Every box ticked is the completion bar.
## Step 5 — Propose
Both files go in one PR. Every command here is in the Read or Propose tier. A branch name or commit
message the caller gives overrides the defaults below.
1. Branch `docs/delivery-repo-doc` from the default branch via `git-branches`.
2. Commit via `git-commits`: `docs(agents): add delivery repo facts` on a draft,
`docs(agents): update delivery repo facts` on an update. On a hook failure, fix the cause and
re-run only that hook, then commit again; `--no-verify` and `SKIP=` stay off the table.
3. Push via `git-remotes`.
4. Open the PR: Gitea via `gitea-prs`; GitHub via `gh pr create`. The body lists each value's source
(file, forge status, or the human's answer and where it was given) and any open values.
Report the PR link and stop. A human merges: `docs/agents/**` and `AGENTS.md` sit behind protected
file patterns, and the merge is theirs either way.
@@ -1,159 +0,0 @@
# The `docs/agents/delivery.md` format
This file is the single source of truth for the format. `delivery-handoff`, `delivery-ci-checks`,
`delivery-qa` and `delivery-operator` cite it as "`delivery-repo-doc`'s `references/format.md`" and
do not restate it. A format change is an edit here, plus the consumers' parsers.
## File rules
- Path: `docs/agents/delivery.md` at the consuming repo's root. One file per repo.
- First line: `# Delivery`.
- Exactly six `##` sections, with these headings verbatim and in this order:
1. `## Contents → skills`
2. `## CI checks`
3. `## Test paths`
4. `## Human allowlist`
5. `## Credential boundary`
6. `## Conventions`
- No other `##` headings, and no `###` headings inside sections 1–4.
- Sections 1–4 are **parsed**: they contain only list items in the item syntax below, one per line,
starting `- ` at column 0. Blank lines are allowed; prose, sub-bullets, tables and comments are
not. Every backticked value is taken verbatim, with no escaping.
- An empty parsed section holds the single item `- none`. Section 4 is never empty.
- Sections 5–6 are read by agents, not parsers; their item labels below are a convention.
## Item syntax
### 1. Contents → skills
```text
- `<glob>`: `<skill>`, `<skill>`
```
- `<glob>` is a repo-relative path glob (`**` crosses directories).
- One or more installed skill names, each backticked, comma-separated.
- A consumer loads exactly the listed skills for a changed path matching the glob, the union across
every matching line. A listed skill that is not installed is a hard stop for the consumer
(`Status/Ready for Human`, handoff "missing skill `<name>`"), so a glob with no installed tool
skill is left out entirely.
### 2. CI checks
```text
- `<status check name>`: <role>
```
- `<status check name>` is the exact string the forge shows on a PR's head commit.
- `<role>` is exactly one of: `dry-run`, `test-path`, `test`, `lint`, `build`, `other`.
- `dry-run` appears on exactly one item. `test-path` appears on at most one item, and on exactly
one when the repo has a test-path check.
- Whatever its role, a consumer treats a check reported as "skipped" (a path-filtered workflow
whose paths did not match) as passing.
### 3. Test paths
Either a pointer, as the only item, when the repo's test-path check reads its own globs file:
```text
- globs file: `<repo-relative path>`
```
or one item per glob:
```text
- `<glob>`
```
These are the paths the test author owns; after the commit with trailer
`Delivery-Stage: test-author`, the implementer may not touch them.
### 4. Human allowlist
```text
- `<forge username>`
```
Humans only. Stage leads accept a gate label or an approval only when the issue or PR timeline shows
a user on this list set it.
### 5. Credential boundary
```text
- Bot user: `<forge username>`
- Kubeconfig: `<absolute path>` | none
- Branch protection: in place | pending ([<title>](<url>))
- Accepted risks: [<title>](<url>), … | none
```
Every link in this section is a markdown link. Delivery sessions export the kubeconfig path as
`KUBECONFIG`. The value is a path only. Accepted risks are linked, never restated.
### 6. Conventions
Short prose or bullets pointing at the repo's own docs (`AGENTS.md`, ADRs, contributing guides) for
anything else a delivery agent needs. Pointers only; no restating.
## AGENTS.md pointer line
The consuming repo's root `AGENTS.md` carries this line verbatim, exactly once:
```text
- Delivery team facts (checks, test paths, human allowlist, credential boundary): `docs/agents/delivery.md`
```
Placement only decides where the line sits; the line itself never changes:
- The heading that lists agent docs holds a flat bullet list: add the line to that list.
- That heading uses `###` subsections with prose: add a `### Delivery` subsection under it, holding
only the line.
- No such heading: add the line at the end of the file.
## Full skeleton
```markdown
# Delivery
## Contents → skills
- `clusters/**`: `flux-diagnose`, `k8s-diagnose`
- `roles/**`: `ansible-lint`
## CI checks
- `ci / render-diff (pull_request)`: dry-run
- `ci / test-paths (pull_request)`: test-path
- `ci / lint (pull_request)`: lint
## Test paths
- globs file: `.gitea/test-paths`
## Human allowlist
- `alice`
## Credential boundary
- Bot user: `delivery-bot`
- Kubeconfig: `/etc/delivery/kubeconfig-readonly`
- Branch protection: pending ([Branch protection setup](https://example.org/issues/12))
- Accepted risks: [ADR-0032](https://example.org/adr/0032)
## Conventions
Repo conventions live in `AGENTS.md`; decisions in `docs/adr/`.
```
The values in the skeleton are illustrative only; every real value comes from the repo or the human.
## Validation checklist
- [ ] First line `# Delivery`; six `##` headings, verbatim, in order.
- [ ] Sections 1–4 hold only items in the syntax above, or `- none`.
- [ ] Every skill in section 1 is installed. A listed skill that is not installed makes every
consumer hard-stop on any change matching its glob.
- [ ] Section 2: exactly one `dry-run`; one `test-path` if the repo has that check.
- [ ] Section 3 is the `globs file:` pointer whenever a test-path check reads a globs file.
- [ ] Section 4 is non-empty and every name came from the human or a source they named.
- [ ] Section 5 holds paths and markdown links, no secret values.
- [ ] Root `AGENTS.md` carries the pointer line exactly once.
@@ -1,57 +0,0 @@
# Gathering the facts
Every value in `docs/agents/delivery.md` has exactly one source. Facts the repo holds come from the
repo; facts only a human holds come from the human. A value with no source stays out.
## Repo-sourced
### Contents → skills
1. List the repo's top-level layout and the tool each area belongs to: Flux/Kustomize manifests
(`kustomization.yaml`, `HelmRelease`), Kubernetes manifests, Ansible (`playbooks/`, `roles/`,
`inventory/`, `ansible.cfg`), OpenTofu (`*.tf`, `.terraform.lock.hcl`).
2. The installed skills are the session's available-skills listing. Map a glob only to tool skills
in that listing whose description covers the area's tool.
3. In a mixed repo (for example Ansible at the top level, Flux under `clusters/`), map each area
with its own glob, and leave out any area with no installed tool skill.
### CI checks
1. Read every workflow under `.gitea/workflows/` or `.github/workflows/` that runs on
`pull_request`. A path-filtered `pull_request` workflow still counts: Gitea reports it as
"skipped" when its paths don't match. List it, usually with role `test`. Workflows that run only
on push, schedule or dispatch are not PR checks; leave them out.
2. Derive each candidate name:
- Gitea Actions: `<workflow name> / <job name> (<event>)`. The workflow name is the file's
top-level `name:` (else the file name); the job name is the job's `name:` (else the job id).
- GitHub Actions: the job's `name:` (else the job id); matrix jobs append their values in
parentheses.
3. Confirm each candidate against the statuses the forge reports on the head commit of a recent PR
where that check reported at least once. Gitea: `gitea-prs` → `pull_request_read` method
`get_status`, or `commit_read` status on the head SHA; GitHub: `gh pr checks <number>`. The
forge's string wins over the derived one. With no PR to read, keep the derived name and say so in the PR body.
4. Assign roles. `test-path` is the check that fails when a commit after the
`Delivery-Stage: test-author` commit touches the test globs. `dry-run` comes from the human.
### Test paths
1. Read the test-path check's workflow and find the file it reads its globs from (for example
`.gitea/test-paths`). If one exists, the section is the `globs file:` pointer.
2. Otherwise list the globs where the repo's tests live (Molecule scenarios, `tests/`, policy tests).
Confirm them with the human in the Step 3 question.
### Conventions
Point at the root `AGENTS.md`, `docs/adr/`, and any contributing or runbook docs that exist. A list
of pointers the human or caller supplies replaces these defaults.
## Human-sourced
SKILL.md Step 3 asks for these:
- Human allowlist: forge usernames.
- Bot user the agents act as.
- Read-only kubeconfig path, or "no cluster".
- Branch-protection status: in place, or pending with the tracking link.
- Which CI check is the dry run.
- Accepted risks: the ADR or issue links, or "none".
-46
View File
@@ -1,46 +0,0 @@
name: delivery
version: 0.2.0
description: Agents and skills for taking a change from spec to a verified merge through tracker-gated stages.
author:
name: Mortis
url: https://git.rkdr.net/Mortis/
license: MIT
homepage: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/delivery
repository: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/delivery
keywords:
- delivery
- agents
- stages
- handoff
- gitea
# Constrains what .apm/ may contain: instructions, skill, hybrid, or prompts
type: hybrid
# 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
targets:
- claude
- copilot
- codex
includes: auto
# Sibling packages are addressed in the same git+path form the root apm.yml
# uses, so a consumer outside this repo resolves them from the remote.
# Unpinned (default branch) like every first-party entry (ADR-0018).
# mattpocock supplies `grilling` until a later effort decouples it (#166,
# ADR-0031).
dependencies:
apm:
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/git
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/gitea
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/mattpocock
mcp: []
devDependencies:
apm: []
scripts: {}
-188
View File
@@ -1,188 +0,0 @@
# Guard hook
`delivery` ships one pre-tool-use hook, `.apm/hooks/guard.py`. It is ADR-0032's enforcement layer
2, a guardrail above the credential boundary and not the boundary itself. The decisions behind it are
in the `delivery guard hook` ticket (holocron#190) and ADR-0032's 2026-11-23 amendment.
## What it decides
| Tier | Examples | Claude Code | Copilot CLI | Codex / unknown |
|---|---|---|---|---|
| Never | `kubectl`/`kubecolor` subcommands outside the allowlist, `helm`/`helm3` install/upgrade/uninstall/rollback, `helm get values/manifest/hooks/all`, `helm diff --show-secrets`, `helm secrets` and `helm-secrets` except `encrypt`, `helmfile` subcommands outside the allowlist, `flux suspend/delete/…`, `flux debug --show-values/--show-vars`, `tofu`/`terraform`/`terragrunt destroy`, `tofu apply -destroy`, `tofu init -migrate-state/-force-copy`, `tofu state` (except `list`), `tofu show` without a plan file or with `-json`, `tofu output -json/-raw`, `git … --no-verify` (and its abbreviations), `git commit -n`, `SKIP=`/`SKIP+=`, `HUSKY=0`, `LEFTHOOK=0`, `core.hooksPath` overrides (`-c`, `--config-env`, `GIT_CONFIG_*`, `git config`), git aliases carrying `--no-verify` or a guarded `!` command (`-c alias.…` or `git config alias.…`), `pre-commit uninstall`, writing, moving, removing or `chmod`-ing anything under `.git/hooks/`, `ansible-vault view/decrypt/edit/rekey`, `kubeseal --recovery-*`, `sops` in any decrypting mode (including bare `sops <file>`), `gpg --export-secret-keys/-subkeys`, `kubectl get secret -o …`/`--template`, `kubectl get -k … -o …`, `kubectl get -f <file named *secret*, not *sealed*> -o …`, `kubectl get --raw …secrets…`, `kubectl config view --raw`, any mention of a secret path | deny | deny | deny |
| Odd job | `ansible-playbook` / ad-hoc `ansible` / `ansible-pull` without `--check`, `ansible-console`, `tofu apply/import/refresh/test`, `flux reconcile` | ask | ask | deny |
| Read / Propose | everything else | allow | allow | allow |
`kubectl`, `helm`, `helmfile`, `flux` and `tofu` are **allowlists**: a subcommand the guard does not list as
allowed is denied. Widen the allowlist in `guard.py` and its test table together. The allowed sets
are "no cluster or state change and no secret printed", not strictly read-only. `helm pull`,
`package`, `create` and `repo add/update`, `tofu init`, `plan` and `get`, `helm diff upgrade/install/revision/rollback` (the read-only helm-diff plugin), `kubectl wait`, and
`kubectl create … --dry-run=client` (which renders a Secret to pipe into `kubeseal`) all write local
files or caches. When `--dry-run` is given twice, the last one counts. `helmfile` allows `template`,
`lint`, `build`, `list`, `deps`, `repos`, `version`, `help`, `write-values` and `show-dag`.
`terragrunt` follows the `tofu` rule and also allows its own HCL commands: `hclfmt`, `hcl fmt`,
`hcl validate`, `render-json` and `render`. `--help` is always allowed.
Secret paths are basename globs: `.vault_pass*`, `vault_pass*`, `*vault_password*` (and the `-`
spellings), `*deploy_key*`, `*.tfstate`, `*.tfstate.*`, `id_rsa*`/`id_ed25519*`/`id_ecdsa*`/`id_dsa*`,
`*.key`, `key.pem`, `*-key.pem`, `*_key.pem`, `privkey*.pem`, `*private*.pem`, `*.p12`, `*.pfx` and
`.git-credentials*`. The undotted vault-password names and `*deploy_key*` also fit source and docs
about them, so a doc or data suffix (`.yml`, `.yaml`, `.md`, `.rst`, `.j2`, `.adoc`, `.html`)
exempts them. A code suffix (`.py`, `.sh`, …) exempts only a test file: `test_vault_password.py`
is fine, but `vault_pass.py` and `vault-pass.sh` are the usual names of an Ansible vault-password
script, which prints the password when run. `vault_password` and `.vault_pass.yml` are not exempt. git's `REV:path` form is checked by its path (`git show HEAD:.vault_pass`). Also covered:
- the admin kubeconfig `.kube/config` and its backups (`config.*`, `config~`). Other kubeconfigs in
`.kube`, such as `.kube/configs/stage-ro.yaml`, are fine.
- the `.kube` and `.ssh` directories as a whole, and any glob inside them (`~/.ssh/id*`,
`~/.kube/*`)
- `sops/age/keys.txt`, `/etc/rancher/k3s/k3s.yaml` and `/etc/kubernetes/admin.conf`
Any other shell glob with at least three literal characters (`.vault_pa*`) counts if it could
expand to a secret name. Redirect targets are checked the same way for every program, so
`echo x > terraform.tfstate` and `grep < ~/.ssh/id_rsa .` are denied.
An option name is never a path: only its `=value` is checked. So `--vault-password-file` itself
does not count, and `ansible-vault encrypt --vault-password-file ~/placeholder vars.yml` (the
placeholder-password stage workflow) is allowed, while `--vault-password-file .vault_pass` is not.
Exemptions:
- `.pub` files.
- The values of `--vault-password-file`, `--vault-id`, `--private-key` and `--key-file`, for
`ansible-playbook`, `ansible` and `ansible-pull` only. Ansible reads those itself, and that run is
already an Odd job. Elsewhere, `ansible-inventory` and `ansible-vault` included, the value is
checked like any path.
- SSH keys handed to ssh: `ssh -i`, `scp -i`, `sftp -i`, `ssh-add`, and the command in
`GIT_SSH_COMMAND` or `core.sshCommand`, which the guard reads as a command.
- The search pattern of `grep`/`rg`/`ag`/`ack`/`git grep`, wherever the program sits after
unwrapping (so `rtk grep vault_pass ansible.cfg` is allowed). The exemption doesn't apply once
`-e` or `-f` makes the pattern explicit.
- The filter of `jq`, `gojq` and `yq` (`jq -r '.tls.key' x.json`), unless `-f` reads it from a
file. The files they read are still checked.
- The `-k`/`-m` test selector of `pytest` and `python -m pytest`.
- File-name patterns: the values of `--include`, `--exclude`, `--exclude-dir`, `--glob`/`-g` and
`--iglob` for the search tools, and of `find -name`/`-iname`/`-path`/`-ipath`/`-regex`. A
directory `find` searches is still checked, so `find ~/.ssh -name id_rsa` is denied. A `find`
that deletes or runs something (`-delete`, `-exec`, `-execdir`, `-ok`) loses this exemption, so
`find . -name '*.tfstate' -delete` is denied, and so is any such `find` naming `.git/hooks`.
- Prose: the `-m`/`--message` value of `git commit`, `tag`, `merge`, `notes`, `stash` and
`revert`, and the title, body and notes values of `gh` and `tea`. `git commit -m x --no-verify`
is still denied: only the secret-path check skips the message. The search values of
`git log -S`/`-G`/`--grep` are skipped by the `--no-verify` check.
- Programs that only print or stat their arguments: `echo`, `printf`, `ls`, `stat`, `test`. Their
redirect targets are still checked.
- `git rm`, `check-ignore`, `ls-files` and `status`.
Pointing at the admin `~/.kube/config` is denied on purpose: stage sessions use the read-only
kubeconfig. File tools are checked too: Read, Grep, Edit and Write paths, Copilot's `view`, and
Codex's `apply_patch` targets, including `Move to`. Write and Edit under `.git/hooks/` are denied;
reading there is fine.
## How it reads a command
The script tokenises the shell line itself. It handles:
- quoting and escapes, including backslash-newline and `$'…'` with escaped quotes
- `;`, `&&`, `||`, `|`, newlines, subshells, braces, `function NAME { … }` and `((…))`
- redirections, which never become words of the command. The fd number in `2>&1` is dropped, and
the target is checked for secret paths and `.git/hooks/`.
- here-documents. A body is data, so commit messages and PR bodies may name any command. Two
exceptions: an unquoted delimiter's body (`<<EOF`) still runs its `$(…)` and backticks, which
are checked, and a body fed to a shell or ssh (`bash -`, `sh -s`, `ssh host`) is a script, which
is checked.
It parses the body of `$(…)`, `<(…)` and `>(…)` with the same rules as the rest of the line, so a
quote or bracket in a here-document inside `$(…)` cannot hide what follows. Backtick bodies are
parsed too. It also unwraps:
- shells: `bash`/`sh`/… `-c` (including clusters such as `-lc`, `-o opt -c` and
`-euo pipefail -c`), here-strings,
here-documents, and a shell reading a pipe, which is denied when the line mentions a guarded tool.
`bash <(…)`, `source <(…)`, `. <(…)` and a `-c` string holding a `$(…)` are built at run time,
so they are denied when the line mentions a guarded tool.
- `eval` (the same run-time rule), `trap 'cmd' SIG`, and leading `NAME=value` / `NAME+=value`
assignments
- `env` (including `-S`), `sudo`, `doas`, `su -c`, `script -c`, `flock`, `strace`, `systemd-run`,
`chroot`, `busybox`, `k3s`, `microk8s`
- `nohup`, `setsid`, `time`, `command` and `exec` (by basename, with their options)
- `timeout`, `nice`, `xargs`, `parallel`, `watch`, `find -exec`, `ssh host <cmd>`
- `nix-shell --run`, `nix shell/develop -c`, `tmux new-session/new-window/split-window`
- git's own shell-outs: `rebase --exec`, `bisect run`, `submodule foreach` and `!` aliases
- `rtk` (`rtk <tool>`, `rtk run`, `rtk proxy`)
- project runners: `uv`/`poetry`/`pipenv`/`pdm`/`hatch`/`pipx run`, `uv tool run`, `uvx`,
`direnv exec`, `mise exec`, `devbox run`, and secret injectors `aws-vault exec`, `op run` and
`doppler run`
In an option cluster, a last letter that takes a value consumes the next word, for shells and for
every wrapper: `sudo -iu root kubectl …` runs `kubectl`, not `root`.
It takes the program's basename and drops a `.exe` suffix, so `/usr/bin/kubectl`, `\kubectl` and
`kubectl.exe` are all `kubectl`. It denies, rather than guesses, when a program name is built at run
time (`$k apply`) and the line mentions a guarded tool, when the program name is a glob, or when an
unquoted brace expansion hides a guarded command. A guarded tool counts only as a whole name, so
`.pre-commit-config.yaml` is not `pre-commit`.
The PowerShell tool gets a PowerShell mode of the same tokenizer, not a full PowerShell parser. The
backtick is the escape and line-continuation character, backslash is a plain path separator, `''`
escapes a single quote, and `@'…'@` here-strings are read. Program names are matched without case.
It unwraps `iex`/`Invoke-Expression`, `cmd /c` and `pwsh`/`powershell -Command`, and denies
`-EncodedCommand`.
Copilot lets a timed-out hook's call through, so the guard refuses input it cannot read well inside
the 10-second budget. It denies outright a command longer than 256 KB, a simple command of more than
2,000 words, a line of more than 5,000 commands, substitutions nested more than 40 deep, and more
than 32 wrappers inside one another (`sudo sudo …`, `find -exec find -exec …`). Each of these
finishes well under a second.
**Known gaps, by construction:**
- a script the agent writes and then runs
- `python -c` or `node -e` subprocesses
- MCP tools, which carry no shell command
- secret files at an unusual path
- `cd ~/.kube && cat config`, because the guard does not track the working directory
- file names produced at run time, such as `ls ~/.ssh/id_* | xargs cat`: `xargs` reads its
arguments from the pipe, which the guard cannot see
- a shell reading a pipe when the line mentions no guarded tool, such as `curl … | bash`
- what an allowed command prints at run time, such as `ansible -C -m debug` of a vaulted variable
The credential boundary covers all of these: the read-only kubeconfig, no vault password and no
apply credentials in stage sessions.
## Runtimes
The script tells runtimes apart by where apm deployed it:
| Deployed under | Runtime | Notes |
|---|---|---|
| `.claude/hooks/` | Claude Code | Output is `hookSpecificOutput.permissionDecision`. `onFailure: block` makes a crash or timeout block the call (Claude Code ≥ 2.1.295). Verified live on 2.1.326. |
| `.github/hooks/scripts/` | Copilot CLI | Output is top-level `permissionDecision` plus a reason. A non-zero exit denies, but a **timeout lets the call through**. The TUI auto-approves `ask` (ADR-0032 accepted risk). apm writes the entry in Claude's nested shape with `command`/`timeout`, and Copilot's docs accept both keys but don't document the nested group, so it is **unverified** until a Copilot account exists. |
| `.codex/hooks/` | Codex | `ask` is unsupported, so the guard denies with exit 2 and the reason on stderr. apm deploys only if `.codex/` already exists, and Codex skips project hooks until a human trusts them. Codex resolves the relative command from the session cwd, so a session started in a subdirectory may not find the script. |
| anywhere else | unknown | Treated like Codex: odd jobs are denied, with exit 2. The payload's shape (`toolName` or `tool_name`) picks only how the payload is read, never the runtime. |
## What a consuming repo needs
- `python3` on PATH. The script uses the standard library only. Without python3 the hook cannot
start, which blocks every tool call on Claude Code and Copilot. That's deliberate.
- An `executables.allow` grant for the package in the repo's `apm.yml`, when that repo turns on apm's
executable-trust gate:
```yaml
executables:
allow:
delivery:
hooks: true
```
apm 0.28.0 prints "parked pending approval" even when the grant matches (holocron#208). Check that
the hook actually deployed by looking for `guard.py` under `.claude/hooks/delivery/` and the
`PreToolUse` entry in `.claude/settings.json`. Don't rely on the install exit code.
- Host hardening is documented, not shipped (ADR-0032 layer 3). Examples are Claude permission
deny rules, sandbox `denyRead` on the vault password file, and managed settings with
`allowManagedHooksOnly` so the guard cannot be switched off.
## Tests
`tests/test-delivery-guard-hook.sh` copies the script to each runtime's deploy path and drives it
with Claude, Copilot and Codex payloads. It covers the deny, ask and allow tables, bypass attempts
(quoting, `bash -c`, `env`, `sudo`, `xargs`, `find -exec`, substitution, `eval`, dynamic program
names), PowerShell, the per-runtime output shape, and fail-closed handling of malformed payloads.
A malformed payload is denied: not JSON or not an object, no tool name, a shell tool whose input is
not an object or carries no command string (read from `command`, `cmd`, `input` or `chars`), and
Copilot `toolArgs` that is not an object. It also covers the time the guard takes on pathological
input and the `hooks.json` invariants.
-44
View File
@@ -1,44 +0,0 @@
name: gitops
version: 0.1.0
description: Skills for authoring, auditing and diagnosing a Flux GitOps repository, including the secrets sealed into it.
author:
name: Mortis
url: https://git.rkdr.net/Mortis/
license: MIT
homepage: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/gitops
repository: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/gitops
keywords:
- gitops
- flux
- kustomize
- helm
- sealed-secrets
# Constrains what .apm/ may contain: instructions, skill, hybrid, or prompts
type: hybrid
# 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
targets:
- claude
- copilot
- codex
includes: auto
# Third-party content is pinned (same rule as plugins/mattpocock); bump both
# fluxcd tags together. gitops-cluster-debug is NOT pulled: it needs
# flux-operator-mcp, and these packages drive CLIs, never MCP servers (#171).
# k8s is a sibling, unpinned like every first-party dependency (ADR-0018):
# Flux diagnosis hands pod-level problems to it (#171).
dependencies:
apm:
- git: https://git.rkdr.net/Mortis/Holocron.git
path: plugins/k8s
- fluxcd/agent-skills/skills/gitops-knowledge#v0.4.0
- fluxcd/agent-skills/skills/gitops-repo-audit#v0.4.0
mcp: []
devDependencies:
apm: []
scripts: {}
View File
Whitespace-only changes.
-34
View File
@@ -1,34 +0,0 @@
name: k8s
version: 0.1.0
description: Skills for read-only diagnosis of workloads on a Kubernetes cluster.
author:
name: Mortis
url: https://git.rkdr.net/Mortis/
license: MIT
homepage: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/k8s
repository: https://git.rkdr.net/Mortis/Holocron/src/branch/main/plugins/k8s
keywords:
- kubernetes
- k8s
- kubectl
- diagnosis
# Constrains what .apm/ may contain: instructions, skill, hybrid, or prompts
type: hybrid
# 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
targets:
- claude
- copilot
- codex
includes: auto
dependencies:
apm: []
mcp: []
devDependencies:
apm: []
scripts: {}
+26 -28
View File
@@ -10,8 +10,7 @@ Author hooks in `plugins/kyberforge/.apm/hooks/*.json`. `.apm/` is the only cont
plugin root and no per-plugin `plugin.json`, so `.apm/hooks/` is both where you edit and what ships.
apm merges every `*.json` in that directory into a single hook definition and writes the event
bindings into each target the consuming project enables: `.claude/settings.json` for Claude Code,
and per-target files for Copilot and Codex (see "Deployed shape" and "Other runtimes" below). Scripts a
bindings into the consuming project's `.claude/settings.json`; see "Deployed shape" below. Scripts a
hook invokes live in the same directory, alongside the JSON that references them.
## Hook file structure
@@ -70,15 +69,9 @@ tracked in a `.claude/apm-hooks.json` sidecar, so an uninstall removes them with
hand-authored hooks. Both `.claude/hooks/` and the sidecar are gitignored install output.
Note that apm's **executable-trust gate is off** unless the consuming project's `apm.yml` has an
`executables:` block — without one, package hooks deploy with no prompt. The grant is
**version-blind**: apm also matches an allow key such as `kyberforge#<version>` by its bare package
name, so a version bump on one side does not stop the hook deploying (verified against apm 0.28.0;
the correction is recorded in ADR-0019 and `docs/spec/gates.md`). This repo still keeps each key at
`<name>#<version>` as a record of which version was reviewed, and `check-executables-allow-sync` is
the pre-push gate that holds every plugin shipping `.apm/hooks/` or `bin/` to that.
apm 0.28.0 prints "parked pending approval" for a granted package even when it deploys the hook
(holocron#208). Check for the deployed script and settings entry, not the warning.
`executables:` block — without one, package hooks deploy with no prompt. The allow key is
version-pinned (`kyberforge#<version>`), so a version bump on one side alone stops the hook
deploying; `check-executables-allow-sync` is the pre-push gate that catches it. See ADR-0019.
## The SessionStart hook
@@ -112,27 +105,32 @@ stages a genuinely outdated dependency against the **real** `apm` — a local gi
`url.<path>.insteadOf` rewrites, so it needs no network — and replays that genuine output through the
hook.
## Other runtimes
## GitHub Copilot CLI
An earlier version of this section said Copilot loads no hooks from an apm package, because nothing
pointed Copilot at a hooks file and apm wrote only a Claude-shaped definition. That no longer holds:
apm 0.28.0 shapes and deploys hooks per target itself, with no `plugin.json` pointer involved.
Sources: `docs/research/infra-packages/enforcement-hooks.md` on the `research/enforcement-hooks`
branch, and the [delivery guard hook](https://git.rkdr.net/Mortis/Holocron/issues/190) work.
**Copilot loads no hooks from this plugin.** Two independent reasons, either one sufficient:
| Target | Where apm writes the hook | Status |
|---|---|---|
| `copilot` | One file per hook, `.github/hooks/<pkg>-<name>.json`, with the script under `.github/hooks/scripts/<pkg>/.apm/hooks/`. Event names are renamed to camelCase and `version: 1` is added. | **Unverified.** Entries keep Claude's nested matcher group with `command`/`timeout`. Copilot's docs accept `command`/`timeout` as aliases for `bash`/`powershell`, but don't document the nested group, so whether Copilot CLI runs the hook is untested until a Copilot account exists. |
| `codex` | Merged into `.codex/hooks.json`, with the script under `.codex/hooks/<pkg>/.apm/hooks/`. Claude's event names and shape are kept. | apm skips the target unless `.codex/` already exists, and Codex runs project hooks only after a human trusts them. |
- **Nothing can point Copilot at a hooks file.** Copilot types `hooks` as a `plugin.json` field of
type "string or object" with **no default**
(`docs/research/docs/github-copilot-plugins/configuration.md:47`), so there is no convention path
for it to scan — it reads hooks only via an explicit pointer. Since ADR-0024 there is no
per-plugin Copilot manifest at all, so there is nothing to carry that pointer.
- **The two ecosystems do not share a hooks format.** Copilot reads a differently-shaped
`hooks.json`: `version: 1` is required, each entry is `type: "command"` with separate `bash` and
`powershell` scripts, and the lifecycle points are lowercase and differently named (`sessionStart`,
`sessionEnd`, `userPromptSubmitted`, `preToolUse`, `postToolUse`, `errorOccurred`, `agentStop`).
See `docs/research/docs/github-copilot-plugins/configuration.md`. apm merges `.apm/hooks/*.json`
into one definition with no per-target shaping, and that definition is Claude-shaped.
Only enabled targets get a hook: this repo's root `apm.yml` targets `claude` alone, so nothing lands
in `.github/hooks/` or `.codex/` here. VS Code's Copilot reads both `.github/hooks/` and
`.claude/settings.json`, so a package installed for both `claude` and `copilot` runs each hook
twice there.
The second reason is why "just add a pointer" was rejected even while a Copilot manifest existed: a
pointer would tell Copilot that a Claude-shaped file is Copilot-shaped, trading an incomplete
manifest for a wrong one. ADR-0024 consequence 7 records that the question is now moot — the
manifest it argued about is gone — but the schema mismatch it turned on is not, and it is what any
future Copilot hooks support has to solve.
**The `SessionStart` hook is Claude-only in practice.** `check-apm-current.sh` answers with Claude
Code's `reloadSkills` output and reads `${CLAUDE_PROJECT_DIR}`, so on another runtime it at most
runs the update without reloading anything.
**What this costs you:** a hook authored under `.apm/hooks/` reaches Claude Code and not Copilot.
That is a real limitation, and it is the accepted one until apm emits a per-target hooks file or the
two schemas converge. If you need a Copilot hook today, raise it — it needs an upstream change or a
second authoring path, not a pointer.
## Symlinks under `.apm/` do not survive, and nothing reports it
+89 -221
View File
@@ -1,29 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
# Fails the push when root apm.yml's executables.allow stops naming the actual
# version of every plugin that ships executables. A plugin ships executables
# when plugins/<name>/.apm/hooks/ or plugins/<name>/bin/ exists; each one needs
# a '<name>#<version>' key, where <name> and <version> come from its own
# apm.yml (and <name> must equal the directory name, since keys use the
# package name). Every failing package is reported in one run.
#
# The grant itself is version-blind — apm matches the version-less name
# alongside '<package>#<version>' (exec_gate.py builds the candidate list,
# _map_grants matches it) — so a stale key keeps granting the package's hooks/
# and bin/ and deployment does not break. What this gate buys is repo-level,
# not apm-level: a version bump without the matching key edit fails this
# repo's own pre-push, so each key stays an accurate record of what was
# approved. See ADR-0019's 2026-09-19 correction and docs/spec/gates.md,
# Fails the push when root apm.yml's executables.allow key stops naming
# kyberforge's actual version. The grant itself is version-blind — apm matches
# the version-less name alongside '<package>#<version>' (exec_gate.py builds
# the candidate list, _map_grants matches it) — so a stale key keeps granting
# kyberforge's hooks/ and bin/ and deployment does not break. What this gate
# buys is repo-level, not apm-level: a version bump without the matching key
# edit fails this repo's own pre-push, so the key stays an accurate record of
# what was approved. See ADR-0019's 2026-09-19 correction and docs/spec/gates.md,
# "check-executables-allow-sync"; nothing else in the pre-push gate compares
# these files.
# these two files.
#
# Run from repo root or pass REPO_ROOT as arg.
REPO_ROOT="${1:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
# A nonexistent REPO_ROOT fails loudly rather than falling through to the
# "no executable-shipping plugin here" no-op below: that no-op is for a repo
# that legitimately ships no executables, not for a typo'd or stale path, and
# "no kyberforge plugin here" no-op below: that no-op is for a repo that
# legitimately does not ship the plugin, not for a typo'd or stale path, and
# exit 0 would read as "checked, in sync" when nothing was compared at all.
if [[ ! -d "$REPO_ROOT" ]]; then
echo "FAIL: executables-allow sync check: REPO_ROOT '$REPO_ROOT' is not a directory." >&2
@@ -32,69 +26,28 @@ if [[ ! -d "$REPO_ROOT" ]]; then
fi
REPO_ROOT="$(cd "$REPO_ROOT" && pwd)"
PLUGIN_DIR="$REPO_ROOT/plugins/kyberforge"
PLUGIN_MANIFEST="$PLUGIN_DIR/apm.yml"
ROOT_MANIFEST="$REPO_ROOT/apm.yml"
# ---------------------------------------------------------------------------
# Discovery
# ---------------------------------------------------------------------------
# PLUGINS: directory names of every plugin that ships executables. READABLE
# (below) is the subset whose apm.yml exists; only those reach the readers.
PLUGINS=()
shopt -s nullglob
for plugin_dir in "$REPO_ROOT"/plugins/*/; do
plugin_dir="${plugin_dir%/}"
if [[ -d "$plugin_dir/.apm/hooks" || -d "$plugin_dir/bin" ]]; then
PLUGINS+=("${plugin_dir##*/}")
fi
done
shopt -u nullglob
# Only a repo with no executable-shipping plugin at all is a legitimate no-op —
# there is no version to pin and no hook to deploy.
if [[ ${#PLUGINS[@]} -eq 0 ]]; then
# Only a repo with no kyberforge plugin at all is a legitimate no-op — there is
# no version to pin and no hook to deploy.
if [[ ! -d "$PLUGIN_DIR" ]]; then
exit 0
fi
FAILED=0
# "hooks/ and bin/", "hooks/" or "bin/" — what the plugin actually ships, so a
# message never claims a package has a bin/ it does not.
ships() {
local dir="$REPO_ROOT/plugins/$1"
if [[ -d "$dir/.apm/hooks" && -d "$dir/bin" ]]; then
printf 'hooks/ and bin/'
elif [[ -d "$dir/.apm/hooks" ]]; then
printf 'hooks/'
else
printf 'bin/'
fi
}
# "hooks: true, bin: true" etc. — the allow entry body the plugin needs.
grants() {
local dir="$REPO_ROOT/plugins/$1" out=""
if [[ -d "$dir/.apm/hooks" ]]; then out="hooks: true"; fi
if [[ -d "$dir/bin" ]]; then out+="${out:+, }bin: true"; fi
printf '%s' "$out"
}
READABLE=()
for plugin in ${PLUGINS[@]+"${PLUGINS[@]}"}; do
if [[ -f "$REPO_ROOT/plugins/$plugin/apm.yml" ]]; then
READABLE+=("$plugin")
continue
fi
echo "FAIL: plugins/$plugin/ ships $(ships "$plugin") but has no apm.yml, so its version cannot be read." >&2
if [[ ! -f "$PLUGIN_MANIFEST" ]]; then
echo "FAIL: plugins/kyberforge/ exists but has no apm.yml, so its version cannot be read." >&2
echo " Why: this gate compares that version against root apm.yml's executables.allow key;" >&2
echo " without the manifest it would exit 0 having compared nothing." >&2
echo " Fix: restore plugins/$plugin/apm.yml, or remove plugins/$plugin/ entirely." >&2
FAILED=1
done
echo " Fix: restore plugins/kyberforge/apm.yml, or remove plugins/kyberforge/ entirely." >&2
exit 1
fi
if [[ ! -f "$ROOT_MANIFEST" ]]; then
echo "FAIL: root apm.yml is missing, so no executables allow key can be verified (${PLUGINS[*]})." >&2
echo "FAIL: root apm.yml is missing, so kyberforge's executables allow key cannot be verified." >&2
echo " Why: apm reads executables.allow from the consuming package's manifest; with no root" >&2
echo " manifest nothing grants these packages' hooks/ and bin/ permission to deploy." >&2
echo " manifest nothing grants kyberforge's hooks/ and bin/ permission to deploy." >&2
echo " Fix: restore apm.yml at the repo root." >&2
exit 1
fi
@@ -105,30 +58,16 @@ fi
# Both readers emit the same line protocol, so the rest of the script does not
# care which ran:
#
# v<TAB><plugin dir><TAB><version> once per readable plugin (version may be empty)
# n<TAB><plugin dir><TAB><name> once per readable plugin (name may be empty)
# e<TAB><plugin dir><TAB><message> zero or more — the plugin's facts are unusable
# a<TAB>present|absent exactly once — is executables.allow a mapping?
# k<TAB><allow key> zero or more
# v<TAB><kyberforge version> exactly once
# a<TAB>present|absent exactly once — is executables.allow a mapping?
# k<TAB><allow key> zero or more
#
# python3 + PyYAML is preferred where importable; the fallback below is not a
# YAML parser, it recognises only the shapes these manifests use. PyYAML stays
# optional so a missing pip package can't block every push (ADR-0019).
reader_args() {
local plugin
printf '%s\0' "$ROOT_MANIFEST"
for plugin in ${READABLE[@]+"${READABLE[@]}"}; do
printf '%s\0%s\0' "$plugin" "$REPO_ROOT/plugins/$plugin/apm.yml"
done
}
# YAML parser, it recognises only the two shapes these manifests use. PyYAML
# stays optional so a missing pip package can't block every push (ADR-0019).
read_facts_python() {
local args=() arg
while IFS= read -r -d '' arg; do
args+=("$arg")
done < <(reader_args)
python3 - ${args[@]+"${args[@]}"} << 'PY'
python3 - "$ROOT_MANIFEST" "$PLUGIN_MANIFEST" << 'PY'
import sys
import yaml
@@ -139,25 +78,19 @@ def load(path):
return data if isinstance(data, dict) else {}
root = load(sys.argv[1])
pairs = sys.argv[2:]
root, plugin = load(sys.argv[1]), load(sys.argv[2])
for plugin_dir, path in zip(pairs[::2], pairs[1::2]):
plugin = load(path)
version = plugin.get("version")
# A 2-component version parses as a YAML float and would render back as
# e.g. "1.5" from 1.50 — a mismatch invented by the reader rather than
# found in the files. Refuse instead of guessing; semver keys here are
# always strings.
if version is not None and not isinstance(version, str):
print(
"e\t%s\tversion: is not a string (%r) — quote it so the "
"executables.allow key can be compared verbatim." % (plugin_dir, version)
)
continue
name = plugin.get("name")
print("v\t%s\t%s" % (plugin_dir, "" if version is None else version))
print("n\t%s\t%s" % (plugin_dir, "" if name is None else name))
version = plugin.get("version")
# A 2-component version parses as a YAML float and would render back as e.g.
# "1.5" from 1.50 — a mismatch invented by the reader rather than found in the
# files. Refuse instead of guessing; semver keys here are always strings.
if version is not None and not isinstance(version, str):
sys.stderr.write(
"kyberforge's version: is not a string (%r) — quote it so the "
"executables.allow key can be compared verbatim.\n" % (version,)
)
raise SystemExit(2)
print("v\t%s" % ("" if version is None else version))
executables = root.get("executables")
allow = executables.get("allow") if isinstance(executables, dict) else None
@@ -181,24 +114,14 @@ unquote() {
printf '%s\n' "$value"
}
# top_level_scalar <file> <key> — the first column-0 '<key>:' value, unquoted.
top_level_scalar() {
local line
while IFS= read -r line || [[ -n "$line" ]]; do
[[ "$line" == "$2:"* ]] || continue
unquote "${line#"$2":}"
return
done < "$1"
}
read_facts_bash() {
local line allow_state="absent" in_executables=0 in_allow=0 key plugin manifest
local line version="" allow_state="absent" in_executables=0 in_allow=0 key
for plugin in ${READABLE[@]+"${READABLE[@]}"}; do
manifest="$REPO_ROOT/plugins/$plugin/apm.yml"
printf 'v\t%s\t%s\n' "$plugin" "$(top_level_scalar "$manifest" version)"
printf 'n\t%s\t%s\n' "$plugin" "$(top_level_scalar "$manifest" name)"
done
while IFS= read -r line || [[ -n "$line" ]]; do
[[ "$line" == version:* ]] || continue
version="$(unquote "${line#version:}")"
break
done < "$PLUGIN_MANIFEST"
while IFS= read -r line || [[ -n "$line" ]]; do
# Blank and full-line comments carry no structure at any depth.
@@ -237,17 +160,17 @@ read_facts_bash() {
fi
done < "$ROOT_MANIFEST"
printf 'v\t%s\n' "$version"
printf 'a\t%s\n' "$allow_state"
}
if command -v python3 > /dev/null 2>&1 && python3 -c 'import yaml' > /dev/null 2>&1; then
READER="python3 + PyYAML"
if ! FACTS="$(read_facts_python)"; then
echo "FAIL: could not read apm.yml or a plugin's apm.yml (see the parser error above)." >&2
echo " Why: this gate compares each executable-shipping plugin's version against root" >&2
echo " apm.yml's executables.allow keys; an unreadable manifest means the comparison" >&2
echo " did not happen." >&2
echo " Fix: make the manifests valid YAML, then re-run." >&2
echo "FAIL: could not read apm.yml / plugins/kyberforge/apm.yml (see the parser error above)." >&2
echo " Why: this gate compares kyberforge's version against root apm.yml's executables.allow" >&2
echo " key; an unreadable manifest means the comparison did not happen." >&2
echo " Fix: make both manifests valid YAML, then re-run." >&2
exit 1
fi
else
@@ -255,104 +178,49 @@ else
FACTS="$(read_facts_bash)"
fi
# fact <tag> <plugin dir> — the third field of that plugin's <tag> line.
fact() {
awk -F'\t' -v t="$1" -v d="$2" '$1 == t && $2 == d { sub(/^[^\t]*\t[^\t]*\t/, ""); print; exit }' <<< "$FACTS"
}
VERSION="$(printf '%s\n' "$FACTS" | sed -n 's/^v\t//p')"
ALLOW_STATE="$(printf '%s\n' "$FACTS" | sed -n 's/^a\t//p')"
ALLOW_KEYS="$(printf '%s\n' "$FACTS" | sed -n 's/^k\t//p')"
# ---------------------------------------------------------------------------
# Per-package checks
# ---------------------------------------------------------------------------
# EXPECTED: plugin dir names whose manifest is usable; the key each needs is
# '<dir>#<version>' because a usable manifest's name: equals its dir name.
EXPECTED=()
for plugin in ${READABLE[@]+"${READABLE[@]}"}; do
error="$(fact e "$plugin")"
if [[ -n "$error" ]]; then
echo "FAIL: plugins/$plugin/apm.yml: $error" >&2
echo " Why: a non-string version would be compared in a form the reader invented rather" >&2
echo " than the one written in the file." >&2
echo " Fix: quote the version, e.g. version: \"1.5\" (read by $READER)." >&2
FAILED=1
continue
fi
version="$(fact v "$plugin")"
name="$(fact n "$plugin")"
if [[ "$name" != "$plugin" ]]; then
echo "FAIL: plugins/$plugin/apm.yml declares name: '${name}', which does not match its directory '$plugin'." >&2
echo " Why: executables.allow keys use the package name; with the two disagreeing this gate" >&2
echo " cannot tell which '<name>#<version>' key root apm.yml should carry." >&2
echo " Fix: make plugins/$plugin/apm.yml's name: equal '$plugin', or rename the directory (read by $READER)." >&2
FAILED=1
continue
fi
if [[ -z "$version" ]]; then
echo "FAIL: plugins/$plugin/apm.yml declares no version:, so no allow key can be checked against it." >&2
echo " Why: the executables.allow key is '<package>#<version>'; with no version there is" >&2
echo " nothing for root apm.yml's key to stay in sync with." >&2
echo " Fix: give plugins/$plugin/apm.yml a top-level version: (read by $READER)." >&2
FAILED=1
continue
fi
EXPECTED+=("$plugin")
done
if [[ ${#EXPECTED[@]} -gt 0 && "$ALLOW_STATE" != "present" ]]; then
summary=""
for plugin in ${EXPECTED[@]+"${EXPECTED[@]}"}; do
summary+="${summary:+, }$plugin#$(fact v "$plugin")"
done
echo "FAIL: root apm.yml has no executables.allow mapping, but these packages ship executables: $summary." >&2
echo " Why: without an allow entry apm refuses to deploy a package's hooks/ and bin/ — for" >&2
echo " kyberforge that means the SessionStart hook that keeps this install level with the" >&2
echo " remote never runs and the deployed skills go stale silently (ADR-0019)." >&2
echo " Fix: add to root apm.yml:" >&2
echo " executables:" >&2
echo " allow:" >&2
for plugin in ${EXPECTED[@]+"${EXPECTED[@]}"}; do
echo " $plugin#$(fact v "$plugin"):" >&2
if [[ -d "$REPO_ROOT/plugins/$plugin/.apm/hooks" ]]; then echo " hooks: true" >&2; fi
if [[ -d "$REPO_ROOT/plugins/$plugin/bin" ]]; then echo " bin: true" >&2; fi
done
if [[ -z "$VERSION" ]]; then
echo "FAIL: plugins/kyberforge/apm.yml declares no version:, so no allow key can be checked against it." >&2
echo " Why: apm's executables.allow lookup is keyed on '<package>#<version>' exactly; with no" >&2
echo " version there is nothing for root apm.yml's key to stay in sync with." >&2
echo " Fix: give plugins/kyberforge/apm.yml a top-level version: (read by $READER)." >&2
exit 1
fi
for plugin in ${EXPECTED[@]+"${EXPECTED[@]}"}; do
expected_key="$plugin#$(fact v "$plugin")"
if grep -qxF -- "$expected_key" <<< "$ALLOW_KEYS"; then
continue
fi
EXPECTED_KEY="kyberforge#$VERSION"
stale_keys=()
while IFS= read -r key; do
if [[ -n "$key" && "$key" == "$plugin#"* ]]; then stale_keys+=("$key"); fi
done <<< "$ALLOW_KEYS"
if [[ "$ALLOW_STATE" != "present" ]]; then
echo "FAIL: root apm.yml has no executables.allow mapping, but plugins/kyberforge is version $VERSION." >&2
echo " Why: without an allow entry apm refuses to deploy kyberforge's hooks/ and bin/, so the" >&2
echo " SessionStart hook that keeps this install level with the remote never runs and the" >&2
echo " deployed skills go stale silently (ADR-0019)." >&2
echo " Fix: add to root apm.yml:" >&2
echo " executables:" >&2
echo " allow:" >&2
echo " $EXPECTED_KEY:" >&2
echo " hooks: true" >&2
echo " bin: true" >&2
exit 1
fi
echo "FAIL: root apm.yml's executables.allow has no '$expected_key' key, but that is $plugin's version." >&2
if [[ ${#stale_keys[@]} -gt 0 ]]; then
echo " Found instead:" >&2
printf ' %s\n' ${stale_keys[@]+"${stale_keys[@]}"} >&2
echo " Why: nothing is broken right now — apm's grant is version-blind, so a key naming another" >&2
echo " version still grants $plugin's $(ships "$plugin"). This gate is a repo-level record" >&2
echo " check: a version bump without the matching key edit fails here, which is what keeps" >&2
echo " the key an accurate record of what was approved (ADR-0019, 2026-09-19 correction)." >&2
echo " Fix: bump the key in root apm.yml to '$expected_key:' — the version bump in" >&2
echo " plugins/$plugin/apm.yml is not complete without it." >&2
else
echo " Why: $plugin ships $(ships "$plugin") and no key grants them, so apm refuses to deploy" >&2
echo " them; this gate also keeps each key an accurate record of what was approved" >&2
echo " (ADR-0019, 2026-09-19 correction)." >&2
echo " Fix: add '$expected_key:' under executables.allow in root apm.yml, granting" >&2
echo " $(grants "$plugin")." >&2
fi
FAILED=1
done
if grep -qxF "$EXPECTED_KEY" <<< "$ALLOW_KEYS"; then
exit 0
fi
exit "$FAILED"
STALE_KEYS="$(printf '%s\n' "$ALLOW_KEYS" | grep '^kyberforge#' || true)"
echo "FAIL: root apm.yml's executables.allow has no '$EXPECTED_KEY' key, but that is kyberforge's version." >&2
if [[ -n "$STALE_KEYS" ]]; then
echo " Found instead:" >&2
printf '%s\n' "$STALE_KEYS" | sed 's/^/ /' >&2
fi
echo " Why: nothing is broken right now — apm's grant is version-blind, so a key naming another" >&2
echo " version still grants kyberforge's hooks/ and bin/. This gate is a repo-level record" >&2
echo " check: a version bump without the matching key edit fails here, which is what keeps" >&2
echo " the key an accurate record of what was approved (ADR-0019, 2026-09-19 correction)." >&2
echo " Fix: bump the key in root apm.yml to '$EXPECTED_KEY:' — the version bump in" >&2
echo " plugins/kyberforge/apm.yml is not complete without it." >&2
exit 1
+11 -125
View File
@@ -1,12 +1,11 @@
#!/usr/bin/env bash
# Tests for scripts/check-executables-allow-sync.sh — the pre-push gate that
# keeps root apm.yml's executables.allow keys level with the version of every
# plugin that ships executables (plugins/<name>/.apm/hooks/ or bin/).
# keeps root apm.yml's executables.allow key level with kyberforge's version.
#
# Fixtures are skeletons (root apm.yml + plugins/<name>/apm.yml + an empty
# hooks/ or bin/ dir) rather than copies of the real repo: the gate reads
# exactly those files, and a hand-built fixture is the only way to construct
# the drift it exists to catch without editing the real manifests.
# Fixtures are two-file skeletons (root apm.yml + plugins/kyberforge/apm.yml)
# rather than copies of the real repo: the gate reads exactly those two files,
# and a hand-built fixture is the only way to construct the drift it exists to
# catch without editing the real manifests.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
@@ -37,8 +36,7 @@ make_fixture() {
local version_line="$1" executables_block="$2" dir
dir="$(mktemp -d)"
FIXTURES+=("$dir")
# kyberforge ships both hooks and bin, which is what makes the gate check it.
mkdir -p "$dir/plugins/kyberforge/.apm/hooks" "$dir/plugins/kyberforge/bin"
mkdir -p "$dir/plugins/kyberforge"
{
echo "name: kyberforge"
@@ -63,17 +61,6 @@ make_fixture() {
printf '%s\n' "$dir"
}
# add_plugin <fixture> <dir> <version-line> [<name>] — a second plugin that
# ships hooks only (like delivery). <name> defaults to <dir>.
add_plugin() {
local dir="$1/plugins/$2"
mkdir -p "$dir/.apm/hooks"
{
echo "name: ${4:-$2}"
echo "$3"
} > "$dir/apm.yml"
}
MATCHING_BLOCK='executables:
allow:
kyberforge#1.5.0:
@@ -86,23 +73,6 @@ STALE_BLOCK='executables:
hooks: true
bin: true'
TWO_MATCHING_BLOCK='executables:
allow:
kyberforge#1.5.0:
hooks: true
bin: true
# delivery ships a guard hook; an indented comment must not read as a key.
delivery#0.1.0:
hooks: true'
TWO_STALE_BLOCK='executables:
allow:
kyberforge#1.4.0:
hooks: true
bin: true
delivery#0.0.9:
hooks: true'
OTHER_PACKAGE_BLOCK='executables:
allow:
git#1.0.0:
@@ -195,23 +165,17 @@ run_gate "$REPO_ROOT/definitely-not-a-directory"
[[ $GATE_RC -ne 0 ]] && pass "fails on a nonexistent REPO_ROOT" \
|| fail "a bad path must not exit 0 — that reads as 'checked, in sync'"
# No executable-shipping plugin at all is the one legitimate no-op: nothing to pin.
# No kyberforge plugin at all is the one legitimate no-op: nothing to pin.
NO_PLUGIN="$(mktemp -d)"; FIXTURES+=("$NO_PLUGIN")
echo "name: someone-else" > "$NO_PLUGIN/apm.yml"
run_gate "$NO_PLUGIN"
[[ $GATE_RC -eq 0 ]] && pass "no-ops in a repo with no executable-shipping plugin" \
|| fail "a repo without any plugins/*/.apm/hooks or bin has nothing to check"
[[ $GATE_RC -eq 0 ]] && pass "no-ops in a repo with no kyberforge plugin" \
|| fail "a repo without plugins/kyberforge/ has nothing to check"
# A plugin dir that ships nothing executable is not this gate's business.
# ...but a kyberforge directory with no manifest is drift, not a no-op.
mkdir -p "$NO_PLUGIN/plugins/kyberforge"
run_gate "$NO_PLUGIN"
[[ $GATE_RC -eq 0 ]] && pass "no-ops when plugins/kyberforge/ ships no hooks/ or bin/" \
|| fail "a plugin dir without hooks/ or bin/ has nothing to check"
# ...but one that ships executables with no manifest is drift, not a no-op.
mkdir -p "$NO_PLUGIN/plugins/kyberforge/.apm/hooks"
run_gate "$NO_PLUGIN"
[[ $GATE_RC -ne 0 ]] && pass "fails when plugins/kyberforge/ ships hooks but has no apm.yml" \
[[ $GATE_RC -ne 0 ]] && pass "fails when plugins/kyberforge/ has no apm.yml" \
|| fail "a plugin dir with no manifest must not silently pass"
F="$(make_fixture "description: no version here" "$MATCHING_BLOCK")"
@@ -219,68 +183,6 @@ run_gate "$F"
[[ $GATE_RC -ne 0 ]] && pass "fails when the plugin manifest declares no version" \
|| fail "no version means nothing to compare — must fail, not pass"
# ---------------------------------------------------------------------------
echo ""
echo "--- several executable-shipping plugins ---"
# ---------------------------------------------------------------------------
F="$(make_fixture "version: 1.5.0" "$TWO_MATCHING_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0"
run_gate "$F"
[[ $GATE_RC -eq 0 ]] && pass "exits 0 when both shipping plugins have matching keys" \
|| fail "two in-sync packages should pass, got rc=$GATE_RC"
F="$(make_fixture "version: 1.5.0" "$MATCHING_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0"
run_gate "$F"
[[ $GATE_RC -ne 0 ]] && pass "fails when the second package's key is missing" \
|| fail "a shipping plugin with no allow key must fail"
OUT="$(bash "$SCRIPT" "$F" 2>&1 || true)"
grep -q "delivery#0.1.0" <<< "$OUT" && pass "names the second package's expected key" \
|| fail "the failure must state delivery#0.1.0"
grep -q "kyberforge#" <<< "$OUT" && fail "an in-sync kyberforge must not be reported" \
|| pass "does not report the package that is in sync"
F="$(make_fixture "version: 1.5.0" "$TWO_STALE_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0"
OUT="$(bash "$SCRIPT" "$F" 2>&1 || true)"
grep -q "kyberforge#1.5.0" <<< "$OUT" && grep -q "delivery#0.1.0" <<< "$OUT" \
&& pass "reports every failing package in one run" \
|| fail "both stale packages must be named, got: $OUT"
grep -q "kyberforge#1.4.0" <<< "$OUT" && grep -q "delivery#0.0.9" <<< "$OUT" \
&& pass "quotes back each package's stale key" || fail "each stale key must be quoted back"
F="$(make_fixture "version: 1.5.0" "")"
add_plugin "$F" delivery "version: 0.1.0"
OUT="$(bash "$SCRIPT" "$F" 2>&1 || true)"
grep -q "kyberforge#1.5.0" <<< "$OUT" && grep -q "delivery#0.1.0" <<< "$OUT" \
&& pass "missing executables.allow lists every package's key to add" \
|| fail "the add-this block must name every shipping package"
# A plugin with no hooks/ or bin/ needs no key, whatever its version.
F="$(make_fixture "version: 1.5.0" "$MATCHING_BLOCK")"
mkdir -p "$F/plugins/docs-only/.apm/skills"
printf 'name: docs-only\nversion: 9.9.9\n' > "$F/plugins/docs-only/apm.yml"
run_gate "$F"
[[ $GATE_RC -eq 0 ]] && pass "ignores a plugin that ships no hooks/ or bin/" \
|| fail "a plugin without executables must not need an allow key"
# Keys use the package name, so the dir name and name: must agree.
F="$(make_fixture "version: 1.5.0" "$TWO_MATCHING_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0" "delivery-renamed"
run_gate "$F"
[[ $GATE_RC -ne 0 ]] && pass "fails when a plugin's name: differs from its directory" \
|| fail "a dir/name mismatch must fail"
OUT="$(bash "$SCRIPT" "$F" 2>&1 || true)"
grep -q "delivery-renamed" <<< "$OUT" && pass "names the mismatched name:" \
|| fail "the failure must quote the mismatched name:"
# A 2-component version is a YAML float; the PyYAML reader refuses to guess.
F="$(make_fixture "version: 1.5" "$MATCHING_BLOCK")"
run_gate "$F"
[[ $GATE_RC -ne 0 ]] && pass "refuses an unquoted 2-component version" \
|| fail "a float version must fail rather than be compared in reader-invented form"
# ---------------------------------------------------------------------------
echo ""
echo "--- the fallback reader agrees with the PyYAML reader ---"
@@ -319,22 +221,6 @@ F="$(make_fixture "version: 1.5.0" "$OTHER_PACKAGE_BLOCK")"
run_fallback "$F"
[[ $GATE_RC -ne 0 ]] && pass "fallback fails when no kyberforge key is present" || fail "fallback missed an absent key"
F="$(make_fixture "version: 1.5.0" "$TWO_MATCHING_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0"
run_fallback "$F"
[[ $GATE_RC -eq 0 ]] && pass "fallback passes two in-sync packages" || fail "fallback should pass two in-sync packages"
F="$(make_fixture "version: 1.5.0" "$TWO_STALE_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0"
OUT="$(PATH="$NO_YAML_BIN:$PATH" bash "$SCRIPT" "$F" 2>&1 || true)"
grep -q "kyberforge#1.5.0" <<< "$OUT" && grep -q "delivery#0.1.0" <<< "$OUT" \
&& pass "fallback reports both stale packages" || fail "fallback must name both stale packages"
F="$(make_fixture "version: 1.5.0" "$TWO_MATCHING_BLOCK")"
add_plugin "$F" delivery "version: 0.1.0" "delivery-renamed"
run_fallback "$F"
[[ $GATE_RC -ne 0 ]] && pass "fallback fails a dir/name mismatch" || fail "fallback missed a dir/name mismatch"
run_fallback "$REPO_ROOT"
[[ $GATE_RC -eq 0 ]] && pass "fallback passes the real repo" || fail "fallback disagrees with PyYAML on the real repo"
-761
View File
@@ -1,761 +0,0 @@
#!/usr/bin/env bash
# Tests for plugins/delivery/.apm/hooks/guard.py, the delivery guard hook
# (ADR-0032 enforcement layer 2): deny the Never tier everywhere, ask before
# Odd jobs where the runtime honours ask, allow the rest.
#
# The hook tells runtimes apart by where apm deployed it, so each runtime is
# exercised by copying the script to that runtime's deploy path.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SRC="$REPO_ROOT/plugins/delivery/.apm/hooks/guard.py"
HOOKS_JSON="$REPO_ROOT/plugins/delivery/.apm/hooks/hooks.json"
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; }
WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
for d in .claude/hooks/delivery/.apm/hooks .github/hooks/scripts/delivery/.apm/hooks \
.codex/hooks/delivery/.apm/hooks elsewhere; do
mkdir -p "$WORK/$d"
cp "$SRC" "$WORK/$d/guard.py"
done
CLAUDE="$WORK/.claude/hooks/delivery/.apm/hooks/guard.py"
COPILOT="$WORK/.github/hooks/scripts/delivery/.apm/hooks/guard.py"
CODEX="$WORK/.codex/hooks/delivery/.apm/hooks/guard.py"
UNKNOWN="$WORK/elsewhere/guard.py"
# decision <script> <payload-json> -> prints allow|ask|deny
decision() {
local script="$1" payload="$2" out rc
set +e
out="$(printf '%s' "$payload" | python3 "$script" 2> /dev/null)"
rc=$?
set -e
if [[ $rc -eq 2 ]]; then
echo deny
return
fi
if [[ $rc -ne 0 ]]; then
echo "error($rc)"
return
fi
if [[ -z "$out" ]]; then
echo allow
return
fi
python3 -c '
import json, sys
d = json.loads(sys.argv[1])
print(d.get("permissionDecision") or d["hookSpecificOutput"]["permissionDecision"])
' "$out"
}
claude_bash() {
python3 -c 'import json,sys; print(json.dumps({"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":sys.argv[1]}}))' "$1"
}
expect_claude() {
local want="$1" cmd="$2" got
got="$(decision "$CLAUDE" "$(claude_bash "$cmd")")"
if [[ "$got" == "$want" ]]; then pass; else fail "claude: want $want, got $got: $cmd"; fi
}
echo "== Shell commands on Claude Code"
# Each line: expected<TAB>command
while IFS=$'\t' read -r want cmd; do
[[ -z "$want" || "$want" == \#* ]] && continue
expect_claude "$want" "$cmd"
done << 'CASES'
# --- Read tier: allowed
allow ls -la
allow git status && git diff --stat
allow kubectl get pods -A
allow kubectl -n flux-system get kustomizations
allow kubectl describe secret db-creds
allow kubectl get secrets
allow kubectl get secrets -o name
allow kubectl logs deploy/app -c main --tail=50
allow kubectl config view
allow kubectl auth can-i get pods
allow kubectl rollout status deploy/app
allow kubectl kustomize clusters/home
allow helm template charts/app
allow helm list -A
allow helm get notes app
allow flux get kustomizations -A
allow flux build kustomization apps --path ./clusters/home --dry-run
allow flux create source git x --url=https://example.com --export
allow tofu plan -out=plan.tfplan
allow tofu -chdir=infra validate
allow tofu state list
allow tofu show plan.tfplan
allow tofu output
allow ansible-playbook site.yml --check --diff
allow ansible-playbook -C site.yml
allow ansible-playbook -vC site.yml
allow ansible-playbook site.yml --syntax-check
allow ansible-playbook site.yml --list-tasks
allow ansible-lint playbooks/
allow ansible-inventory --graph
allow ansible-vault encrypt_string --stdin-name x
allow kubeseal --cert pub-cert.pem -o yaml < secret.yaml
allow git commit -m "fix: rename id_rsa handling"
allow git commit -am "msg"
allow git commit -m "-n is fine inside a message"
allow git push -n origin feat/x
allow git push origin feat/x
allow grep -rn vault_password_file ansible.cfg
allow echo "do not run kubectl apply here"
allow ssh-keygen -y -f /dev/null; cat id_rsa.pub
allow molecule test
allow command -v kubectl
allow pre-commit run --all-files
allow "$PYTHON" script.py && git log
# --- Never tier: direct cluster mutation
deny kubectl apply -f deploy.yaml
deny kubectl -n prod delete pod x
deny kubectl edit deploy/app
deny kubectl patch deploy app -p '{}'
deny kubectl scale deploy/app --replicas=0
deny kubectl rollout restart deploy/app
deny kubectl label node n1 a=b
deny kubectl exec -it pod -- sh
deny kubectl create secret generic x --from-literal=a=b
deny kubectl diff -f deploy.yaml
deny helm install app charts/app
deny helm upgrade --install app charts/app
deny helm uninstall app
deny helm rollback app 1
deny helm get values app
deny flux suspend kustomization apps
deny flux delete source git x
deny flux export source git --all --with-credentials
# --- Never tier: tofu
deny tofu destroy
deny terraform destroy -auto-approve
deny tofu apply -destroy
deny tofu state rm aws_instance.x
deny tofu state mv a b
deny tofu state pull
deny tofu state show aws_instance.x
deny tofu show
deny tofu output -json
deny tofu taint aws_instance.x
# --- Never tier: hook bypass
deny git commit --no-verify -m x
deny git commit -n -m x
deny git commit -nm x
deny git push --no-verify
deny SKIP=ansible-lint git commit -m x
deny export SKIP=all
deny git -c core.hooksPath=/dev/null commit -m x
deny git config core.hooksPath /tmp/none
# --- Never tier: secrets
deny ansible-vault view group_vars/all/vault.yml
deny ansible-vault decrypt group_vars/all/vault.yml
deny ansible-vault edit group_vars/all/vault.yml
deny ansible-vault rekey vault.yml
deny kubeseal --recovery-unseal --recovery-private-key key.pem < s.yaml
deny sops -d secrets.enc.yaml
deny kubectl get secret db-creds -o yaml
deny kubectl get secrets -n kube-system -ojsonpath='{.items}'
deny kubectl get secret/db-creds --output=json
deny kubectl config view --raw
deny cat .vault_pass
deny cat ~/.ansible/vault_password.txt
deny head -1 /root/.ssh/id_ed25519
deny less terraform.tfstate
deny cp terraform.tfstate.backup /tmp/x
deny cat ~/.kube/config
deny base64 < .vault_pass
deny git add .vault_pass
deny cat tls.key
# --- Odd jobs: ask
ask ansible-playbook site.yml
ask ansible-playbook -i inventory/prod site.yml --limit web
ask ansible-playbook site.yml --vault-password-file .vault_pass
ask ansible-playbook site.yml --private-key ~/.ssh/id_ed25519
ask ansible all -m shell -a uptime
ask tofu apply plan.tfplan
ask terraform apply -auto-approve
ask flux reconcile kustomization apps --with-source
# --- Bypass attempts
deny bash -c "kubectl apply -f x.yaml"
deny sh -lc 'kubectl delete ns prod'
deny bash -c "bash -c 'helm uninstall app'"
deny env kubectl apply -f x
deny env -i PATH=/usr/bin kubectl apply -f x
deny env -S "kubectl apply -f x"
deny FOO=1 kubectl apply -f x
deny /usr/local/bin/kubectl apply -f x
deny \kubectl apply -f x
deny "kubectl" apply -f x
deny k'ube'ctl apply -f x
deny ku\bectl apply -f x
deny sudo -u root kubectl apply -f x
deny sudo -E helm upgrade app charts/app
deny nohup kubectl delete pod x &
deny timeout 30 kubectl apply -f x
deny nice -n 10 tofu destroy
deny command kubectl apply -f x
deny exec kubectl apply -f x
deny echo x | xargs kubectl delete pod
deny find . -name '*.yaml' -exec kubectl apply -f {} \;
deny true && kubectl apply -f x
deny false || kubectl apply -f x
deny ls; kubectl apply -f x
deny ls | kubectl apply -f -
deny (kubectl apply -f x)
deny { kubectl apply -f x; }
deny if true; then kubectl apply -f x; fi
deny echo $(kubectl delete pod x)
deny echo "$(ansible-vault view v.yml)"
deny echo `kubectl apply -f x`
deny diff <(kubectl get secret x -o yaml) a.yaml
deny eval "kubectl apply -f x"
deny eval kubectl delete pod x
deny k=kubectl; $k apply -f x
deny "$(which kubectl)" apply -f x
deny watch -n 5 kubectl delete pod x
deny kubectl --context prod apply -f x
deny kubectl --kubeconfig=/tmp/k apply -f x
deny helm -n prod upgrade app charts/app
deny git -C /repo commit --no-verify -m x
deny env SKIP=ansible-lint git commit -m x
deny cat .vault_pass | base64
deny cat .vault""_pass
deny $'kubectl' apply -f x
ask bash -c 'ansible-playbook site.yml'
ask sudo ansible-playbook site.yml
# --- Runners: rtk (mandated in some repos) and project-venv runners
allow rtk git status
allow rtk kubectl get pods
deny rtk kubectl apply -f x
deny rtk git commit --no-verify -m x
deny rtk run "kubectl delete pod x"
deny rtk proxy helm upgrade app charts/app
deny rtk read .vault_pass
allow uv run ansible-playbook site.yml --check
ask uv run ansible-playbook site.yml
ask poetry run ansible-playbook site.yml
deny uv run --with x ansible-vault view v.yml
ask direnv exec . ansible-playbook site.yml
allow uv sync
# --- Regressions from the factory-audit review: bypasses that got allow
deny git commit --no-verif -m x
deny git commit --no-ve -m x
deny git --config-env=core.hooksPath=HP commit -m x
deny GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=/dev/null git commit -m x
deny git -c alias.c='commit --no-verify' c -m x
deny git -c alias.k='!kubectl delete pod x' k
deny SKIP+=lint git commit -m x
deny grep .vault_pass -e ''
deny rg .vault_pass -e ''
deny grep -f .vault_pass ansible.cfg
deny cat .vault_pa*
deny cat ~/.kube/conf*
deny cat ~/.kube/config.bak
deny cp -r ~/.kube /tmp/k
deny kubectl get --raw /api/v1/namespaces/default/secrets/db
deny kubectl get secret db --template={{.data}}
deny kubectl get secrets.v1. db -o yaml
deny kubectl --username get delete pod x
deny kubectl --password p delete pod x
deny bash -o pipefail -c 'kubectl delete pod x'
deny bash -O extglob -c 'kubectl delete pod x'
deny echo 'kubectl delete pod x' | bash
deny bash <<< 'kubectl delete pod x'
deny script -qc 'kubectl delete pod x' /dev/null
deny su -lc 'kubectl delete pod x'
deny /usr/bin/time kubectl delete pod x
deny /usr/bin/time -f %e kubectl delete pod x
deny /usr/bin/nohup kubectl delete pod x
deny setsid -f kubectl delete pod x
deny nohup -- kubectl delete pod x
deny {kubectl,delete,pod,x}
deny git commit {--no-verify,-m,x}
deny /usr/bin/kube?tl delete pod x
deny coproc X { kubectl delete pod y; }
deny kubecolor delete pod x
deny helm3 uninstall rel
deny terragrunt destroy
deny terragrunt run-all destroy
deny parallel kubectl delete pod ::: x
deny ssh host kubectl delete pod x
deny git rebase --exec 'kubectl delete pod x' HEAD~1
deny git rebase -x 'kubectl delete pod x' HEAD~1
deny git bisect run kubectl delete pod x
deny git submodule foreach 'kubectl delete pod x'
ask uvx --from ansible-core ansible-playbook site.yml
ask uv tool run ansible-playbook site.yml
deny EDITOR=cat sops secrets.enc.yaml
deny flux debug hr app --show-values
deny tofu show -json plan.out
deny pre-commit uninstall
deny xargs -a .vault_pass echo
# --- Regressions from the review: read work that was wrongly denied
allow rtk grep vault_pass ansible.cfg
allow git grep vault_pass
allow git grep -n -- --no-verify
allow echo '*.tfstate' >> .gitignore
allow git rm --cached .vault_pass
allow ls -la .vault_pass
allow git config core.hooksPath
allow git config --get core.hooksPath
allow kubectl apply --help
allow cat monkey.pem
allow kubectl create configmap x --from-file=a.txt --dry-run=client -o yaml
allow kubectl create secret generic x --from-literal=a=b --dry-run=client -o yaml
allow ssh -i ~/.ssh/id_ed25519 host uptime
allow grep -A 3 vault_pass ansible.cfg
allow sops --encrypt secrets.yaml
allow sops updatekeys secrets.enc.yaml
allow wc -l *
allow flux debug hr app
# --- Kept on purpose: the admin kubeconfig is not the stage session's
deny export KUBECONFIG=~/.kube/config
deny kubectl --kubeconfig ~/.kube/config get pods
# --- Second review: ANSI-C quoting with an escaped quote
deny echo $'don\'t' && git push --no-verify
deny git commit -m $'fix: don\'t\n\nbody' && kubectl delete ns prod
# --- Second review: redirect operands are not words, but are checked
deny tofu show -no-color 2>&1
deny tofu show > /tmp/state.txt
deny </dev/null kubectl delete ns prod
deny 2>/dev/null git push --no-verify
deny exec 2>&1 kubectl delete ns prod
deny echo x > terraform.tfstate
deny : > ~/.kube/config
deny grep < ~/.ssh/id_rsa .
deny printf '%s' "$(<.vault_pass)"
deny while read l; do :; done < .vault_pass
allow kubectl get pods 2>&1 | tee /tmp/pods.txt
allow echo ok > /tmp/out.txt
# --- Second review: globs and whole directories under .ssh and .kube
deny cat ~/.ssh/id*
deny cat ~/.ssh/*
deny cat ~/.kube/*
deny head ~/.kube/c*
deny tar czf /tmp/k.tgz ~/.ssh
deny grep -r '' ~/.ssh
deny find ~/.ssh -name id_rsa -exec cat {} \;
allow ls -la ~/.ssh ~/.kube
allow cat ~/.ssh/known_hosts
# --- Second review: key names with suffixes
deny cat ~/.ssh/id_ed25519_work
deny cat ~/.ssh/id_rsa.bak
deny cat ~/.ssh/id_ecdsa_old
allow cat ~/.ssh/id_ed25519_work.pub
# --- Second review: more secret material
deny flux debug kustomization apps --show-vars
deny cat ~/.config/sops/age/keys.txt
deny cat /etc/rancher/k3s/k3s.yaml
deny cat /etc/kubernetes/admin.conf
deny cat ~/.git-credentials
deny gpg --export-secret-keys -a me
deny gpg --armor --export-secret-subkeys me
allow gpg --armor --export me
deny ansible-inventory -i inv --list --vault-password-file .vault_pass
deny grep -T vault_pass .vault_pass
# --- Second review: hook bypass through git config and .git/hooks
deny git config alias.c 'commit --no-verify'
deny git config --global alias.p 'push --no-verify'
deny git config alias.k '!kubectl delete ns prod'
allow git config alias.st status
deny rm -f .git/hooks/pre-commit
deny chmod -x .git/hooks/pre-push
deny mv .git/hooks/pre-commit /tmp/
deny cp /tmp/noop .git/hooks/pre-commit
deny echo exit 0 > .git/hooks/pre-commit
allow ls .git/hooks
allow cat .git/hooks/pre-commit
# --- Second review: scripts built at run time
deny source <(echo kubectl delete pod a)
deny . <(echo kubectl delete pod a)
deny bash -c "$(echo kubectl delete pod a)"
deny eval "$(echo kubectl delete pod a)"
allow source .venv/bin/activate
# --- Second review: tokenizer and unwrapping
deny function f { kubectl delete ns prod; }; f
deny trap 'kubectl delete ns test' EXIT
deny parallel 'kubectl delete ns {}' ::: a b
deny nix-shell -p kubectl --run 'kubectl delete ns prod'
deny nix shell nixpkgs#kubectl -c kubectl delete ns prod
deny aws-vault exec prod -- kubectl delete ns prod
deny op run -- kubectl delete ns prod
deny op run -- cat ~/.kube/config
deny doppler run -- kubectl delete ns prod
deny chroot / kubectl delete ns prod
deny tmux new-session -d 'kubectl delete ns prod'
deny echo $(( $(kubectl delete ns x | wc -l) + 1 ))
deny case $x in a) kubectl delete ns x;; esac
deny k''ubectl delete ns x
deny $'\x6bubectl' delete ns x
# --- Second review: program names
deny k3s kubectl delete ns prod
deny microk8s kubectl delete ns prod
deny terraform.exe destroy
deny helm.exe uninstall x
deny git.exe commit --no-verify -m x
allow helmfile template
allow helmfile -e prod lint
allow helmfile list
allow helmfile write-values
deny helmfile apply
deny helmfile -e prod destroy
deny helmfile sync
deny helmfile delete
deny helmfile diff
# --- Second review: allowlist holes
deny helm get hooks app
deny kubectl get -k overlays/prod -o yaml
allow kubectl get -k overlays/prod
deny tofu init -migrate-state
deny tofu init -force-copy
allow tofu init -upgrade
deny kubectl create secret generic x --from-literal=a=b --dry-run=client --dry-run=none -o yaml
# --- Second review: false denies on normal work
allow git commit -m "docs: never read ~/.kube/config"
allow git commit -m "chore: ignore *.tfstate"
allow git commit -m "fix: rotate tls.key"
allow git commit -am "fix: rotate tls.key"
allow gh pr create --title "Stop tracking *.tfstate" --body x
allow gh issue create --title "Guard misses id_rsa.bak" --body "see terraform.tfstate.backup handling"
deny git commit -m x --no-verify
deny git commit -F .vault_pass
deny git commit -S --no-verify -m x
allow find . -name '*.tfstate'
allow find . -name '*.pem' -newer x
allow rg --glob='!*.tfstate' password .
allow grep -rn token . --exclude='*.key'
allow git log --oneline -S '--no-verify'
allow git log --grep --no-verify
allow GIT_SSH_COMMAND='ssh -i ~/.ssh/id_ed25519' git push origin feat/x
deny GIT_SSH_COMMAND='cat ~/.ssh/id_rsa' git fetch
allow git -c core.sshCommand='ssh -i ~/.ssh/id_ed25519' fetch
allow scp -i ~/.ssh/id_ed25519 f host:
allow sftp -i ~/.ssh/id_ed25519 host
allow ssh-add ~/.ssh/id_ed25519
allow kubectl --kubeconfig ~/.kube/configs/stage-ro.yaml get pods
allow KUBECONFIG=~/.kube/config-readonly kubectl get pods
deny cat ~/.kube/config~
deny cat ~/.kube/config.prod
allow kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{","}{end}'
allow helm template . --set 'hosts={a,b}'
allow tofu plan -var 'tags={env="dev",team="x"}'
allow "$VENV/bin/python" -m yamllint .pre-commit-config.yaml
allow terragrunt run --all plan
deny terragrunt run --all destroy
# --- Other hook managers' skip switches
deny HUSKY=0 git commit -m x
deny LEFTHOOK=0 git commit -m x
# --- Third review: a short-option cluster ending in a value-taking letter
deny bash -euo pipefail -c 'kubectl delete ns prod'
deny bash -eo pipefail -c "cat ~/.ssh/id_rsa"
deny sh -euo pipefail -c 'git push --no-verify'
deny bash -xeuo pipefail -c 'helm uninstall app'
deny bash -ec 'kubectl delete ns prod'
allow bash -euo pipefail -c 'kubectl get pods'
deny sudo -iu root kubectl delete ns prod
deny sudo -Eu root kubectl delete ns prod
deny sudo -nu root kubectl delete ns prod
# --- Third review: jq/yq filters are not paths; the files they read are
allow jq -r '.metadata.key' x.json
allow jq '.data.key' cm.json
allow jq -r '.private.key' x.json
allow jq --arg k v '.tls.key' x.json
allow yq '.spec.tls.key' values.yaml
allow yq e '.tls.key' values.yaml
deny jq . terraform.tfstate
deny yq e '.a' ~/.kube/config
# --- Third review: option names are not paths
allow ansible-inventory -i inventory --graph --vault-password-file ./placeholder-pass
allow ansible-vault encrypt --vault-password-file ~/placeholder vars.yml
allow ansible-vault encrypt_string --vault-password-file /dev/null 'x'
deny ansible-vault encrypt --vault-password-file .vault_pass vars.yml
deny ansible-vault view --vault-password-file /dev/null vars.yml
# --- Third review: source and docs that merely mention the vault password
allow pytest -k vault_password tests/
allow python3 -m pytest -k vault_password tests/
allow pytest tests/test_vault_password.py -q
allow git add roles/common/tasks/vault_password.yml
allow git diff -- docs/vault-password-handling.md
allow pytest tests/vault_password_test.py
deny ./vault_pass.py
deny cat vault-pass.sh
deny bash scripts/vault_password.sh
deny ansible-inventory --list --vault-password-file vault_pass.py
deny cat vault_password
deny cat .vault_pass.yml
# --- Third review: find that deletes or runs something loses its pattern exemption
deny find .git/hooks -type f -delete
deny find .git/hooks -name pre-commit -delete
deny find . -path ./.git/hooks -prune -o -print -exec rm {} +
deny find . -name '*.tfstate' -delete
deny find . -name '*.tfstate' -exec rm {} +
allow find .git/hooks -type f
# --- Third review: kubectl get -f on a Secret manifest
deny kubectl get -f secret.yaml -o yaml
deny kubectl get -f manifests/db-secret.yaml -o json
allow kubectl get -f sealed-secret.yaml -o yaml
allow kubectl get -f deploy.yaml -o yaml
# --- Third review: policy widenings
allow terragrunt hclfmt
allow terragrunt hcl fmt --check
allow terragrunt render-json
deny tofu hclfmt
allow helm diff upgrade x charts/x
allow helm diff revision x 1 2
deny helm diff upgrade x charts/x --show-secrets
# --- Third review: more secret reads
deny git show HEAD:.vault_pass
deny git cat-file -p HEAD:.vault_pass
allow git show HEAD:README.md
deny cat ./deploy_key
deny cat ~/.ssh/github_deploy_key
allow cat deploy_key.pub
deny helm secrets decrypt secrets.yaml
deny helm secrets view secrets.yaml
deny helm secrets edit secrets.yaml
deny helm-secrets decrypt secrets.yaml
allow helm secrets encrypt secrets.yaml
# --- By design, kept as they are
deny kubectl apply --dry-run=client -f deploy.yaml
deny kubectl config set-context --current --namespace=dev
deny cat .vault_pass.example
ask ansible all -m ping
CASES
# Multi-line commands do not survive the line-per-case table above; test them
# directly.
expect_claude deny $'ls\nkubectl apply -f x'
expect_claude deny $'cat <<EOF | sh\nkubectl apply -f x\nEOF'
expect_claude deny $'ls \\\n && kubectl apply -f x'
expect_claude deny $'bash <<EOF\nkubectl delete pod x\nEOF'
expect_claude deny $'kube\\\nctl delete pod x'
# Here-doc bodies are data: commit messages and PR bodies may name commands.
expect_claude allow $'git commit -F- <<\'EOF\'\nkubectl apply is denied by the guard\nEOF'
expect_claude allow $'gh pr create --title t --body "$(cat <<\'EOF\'\nhelm uninstall foo is blocked; don\'t worry\nEOF\n)"'
expect_claude allow $'cat > notes.md <<\'EOF\'\nhelm uninstall foo\nEOF'
expect_claude allow $'cat <<-EOF > x\n\tkubectl delete pod x\n\tEOF\nls'
# ...but the command after the here-doc is still checked.
expect_claude deny $'cat > notes.md <<EOF\nhello\nEOF\nkubectl apply -f x'
# A quote or bracket inside a here-doc inside $(...) must not hide the rest of
# the line.
expect_claude deny $'git commit -m "$(cat <<\'EOF\'\nfix: it\'s done\nEOF\n)" && git push --no-verify'
expect_claude deny $'git commit -m "$(cat <<\'EOF\'\nfix: it\'s done\nEOF\n)" && kubectl delete ns prod'
expect_claude deny $'rtk git commit -m "$(cat <<\'EOF\'\nIt\'s done\nEOF\n)" && rtk git push --no-verify'
expect_claude deny $'gh pr create --title x --body "$(cat <<\'EOF\'\nWe don\'t need this\nEOF\n)"\nkubectl delete ns prod'
expect_claude deny $'git commit -m "$(cat <<\'EOF\'\nfix: guard (see ADR-0032\nEOF\n)" && git push --no-verify'
expect_claude allow $'gh pr create --title x --body "$(cat <<\'EOF\'\n## Summary\n1) run `kubectl apply -f x` after merge\nEOF\n)"'
expect_claude allow $'git commit -m "$(cat <<\'EOF\'\nfix(guard): handle kubectl apply (ADR-0032)\n\nIt\'s fine.\nEOF\n)"'
# An unquoted here-doc body expands $(...) and backticks; a quoted one does not.
expect_claude deny $'cat <<EOF\n$(kubectl delete ns prod)\nEOF'
expect_claude deny $'cat > notes.md <<EOF\nresult: `kubectl delete ns prod`\nEOF'
expect_claude allow $'cat > notes.md <<\'EOF\'\nresult: `kubectl delete ns prod` $(helm uninstall x)\nEOF'
# No here-doc inside arithmetic.
expect_claude deny $'(( y = 1 << 2 ))\nkubectl delete ns prod'
expect_claude deny $'echo $(( 1 << 2 ))\nkubectl delete ns prod'
# A here-doc fed to a shell or ssh is a script.
expect_claude deny $'ssh node1 <<\'EOF\'\nsudo kubectl delete ns prod\nEOF'
expect_claude deny $'bash - <<\'EOF\'\nkubectl delete ns prod\nEOF'
expect_claude deny $'sh -s <<\'EOF\'\nkubectl delete ns prod\nEOF'
expect_claude allow $'bash - <<\'EOF\'\nkubectl get pods\nEOF'
echo "== PowerShell tool"
ps_case() {
local want="$1" cmd="$2" got payload
payload="$(python3 -c 'import json,sys; print(json.dumps({"tool_name":"PowerShell","tool_input":{"command":sys.argv[1]}}))' "$cmd")"
got="$(decision "$CLAUDE" "$payload")"
if [[ "$got" == "$want" ]]; then pass; else fail "powershell: want $want, got $got: $cmd"; fi
}
ps_case deny 'Get-Content C:\Users\me\.ssh\id_rsa'
ps_case deny 'type $env:USERPROFILE\.kube\config'
ps_case deny 'Get-Content .\.vault_pass'
ps_case deny $'git push `\n --no-verify'
ps_case deny 'cmd /c kubectl delete ns prod'
ps_case deny "iex 'kubectl delete ns prod'"
ps_case deny 'Invoke-Expression "kubectl delete ns prod"'
ps_case deny "& 'C:\\tools\\kubectl.exe' delete ns prod"
ps_case deny "pwsh -Command 'kubectl delete ns prod'"
ps_case allow 'Get-ChildItem C:\repo'
ps_case allow 'kubectl get pods'
ps_case allow "git commit -m 'it''s fine'"
echo "== File tools"
file_case() {
local want="$1" script="$2" payload="$3" got
got="$(decision "$script" "$payload")"
if [[ "$got" == "$want" ]]; then pass; else fail "file tool: want $want, got $got: $payload"; fi
}
file_case deny "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/repo/.vault_pass"}}'
file_case deny "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/root/.ssh/id_ed25519"}}'
file_case deny "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/repo/infra/terraform.tfstate"}}'
file_case deny "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/root/.kube/config"}}'
file_case deny "$CLAUDE" '{"tool_name":"Grep","tool_input":{"pattern":".","path":"/repo/.vault_pass"}}'
file_case deny "$CLAUDE" '{"tool_name":"Grep","tool_input":{"pattern":".","path":"/repo","glob":"*.tfstate"}}'
file_case deny "$CLAUDE" '{"tool_name":"Edit","tool_input":{"file_path":"/repo/terraform.tfstate","old_string":"a","new_string":"b"}}'
file_case allow "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/repo/ansible.cfg"}}'
file_case allow "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/root/.ssh/id_ed25519.pub"}}'
file_case allow "$CLAUDE" '{"tool_name":"Glob","tool_input":{"pattern":"**/*.yml"}}'
file_case allow "$CLAUDE" '{"tool_name":"mcp__gitea__issue_read","tool_input":{"method":"get"}}'
file_case deny "$COPILOT" '{"toolName":"view","toolArgs":"{\"path\":\"/repo/.vault_pass\"}"}'
file_case allow "$COPILOT" '{"toolName":"view","toolArgs":"{\"path\":\"/repo/README.md\"}"}'
file_case deny "$CODEX" '{"tool_name":"apply_patch","tool_input":{"command":"*** Begin Patch\n*** Update File: infra/terraform.tfstate\n*** End Patch"}}'
file_case allow "$CODEX" '{"tool_name":"apply_patch","tool_input":{"command":"*** Begin Patch\n*** Update File: README.md\n*** End Patch"}}'
file_case deny "$CODEX" '{"tool_name":"apply_patch","tool_input":{"command":"*** Begin Patch\n*** Update File: notes.txt\n*** Move to: /home/me/.ssh/id_rsa\n*** End Patch"}}'
file_case deny "$CLAUDE" '{"tool_name":"Grep","tool_input":{"pattern":".","path":"/home/me/.ssh"}}'
file_case deny "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/home/me/.ssh/id_ed25519_github"}}'
file_case deny "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"C:\\Users\\me\\.ssh\\id_rsa"}}'
file_case deny "$CLAUDE" '{"tool_name":"Write","tool_input":{"file_path":"/repo/.git/hooks/pre-commit","content":"exit 0"}}'
file_case allow "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/repo/.git/hooks/pre-commit"}}'
file_case allow "$CLAUDE" '{"tool_name":"Read","tool_input":{"file_path":"/root/.ssh/known_hosts"}}'
echo "== Per-runtime output"
runtime_case() {
local label="$1" want="$2" script="$3" payload="$4" got
got="$(decision "$script" "$payload")"
if [[ "$got" == "$want" ]]; then pass; else fail "$label: want $want, got $got"; fi
}
ODD_CLAUDE="$(claude_bash 'ansible-playbook site.yml')"
NEVER_CLAUDE="$(claude_bash 'kubectl apply -f x')"
ODD_COPILOT='{"toolName":"bash","toolArgs":"{\"command\":\"ansible-playbook site.yml\"}"}'
NEVER_COPILOT='{"toolName":"bash","toolArgs":"{\"command\":\"kubectl apply -f x\"}"}'
OK_COPILOT='{"toolName":"bash","toolArgs":"{\"command\":\"kubectl get pods\"}"}'
runtime_case "claude odd job asks" ask "$CLAUDE" "$ODD_CLAUDE"
runtime_case "copilot odd job asks" ask "$COPILOT" "$ODD_COPILOT"
runtime_case "copilot never denies" deny "$COPILOT" "$NEVER_COPILOT"
runtime_case "copilot read allows" allow "$COPILOT" "$OK_COPILOT"
runtime_case "codex odd job denies (no ask)" deny "$CODEX" "$ODD_CLAUDE"
runtime_case "codex never denies" deny "$CODEX" "$NEVER_CLAUDE"
runtime_case "unknown runtime odd job denies" deny "$UNKNOWN" "$ODD_CLAUDE"
# The payload's shape picks only how it is parsed, never the runtime.
runtime_case "camelCase payload outside a deploy path is unknown" deny "$UNKNOWN" "$ODD_COPILOT"
runtime_case "unknown runtime read allows" allow "$UNKNOWN" "$OK_COPILOT"
CODEX_LIST="$(python3 -c 'import json; print(json.dumps({"tool_name":"exec_command","tool_input":{"cmd":["bash","-lc","git commit -m \"$(cat <<'"'"'EOF'"'"'\nit'"'"'s\nEOF\n)\" && git push --no-verify"]}}))')"
runtime_case "codex list-form command with a here-doc" deny "$CODEX" "$CODEX_LIST"
# Shape checks: Claude needs hookSpecificOutput with hookEventName; Copilot
# needs a reason with every deny; Codex needs exit 2 with the reason on stderr.
out="$(claude_bash 'kubectl apply -f x' | python3 "$CLAUDE")"
if python3 -c '
import json, sys
h = json.loads(sys.argv[1])["hookSpecificOutput"]
assert h["hookEventName"] == "PreToolUse" and h["permissionDecision"] == "deny"
assert "ADR-0032" in h["permissionDecisionReason"]
' "$out"; then pass; else fail "claude deny output shape: $out"; fi
out="$(printf '%s' "$NEVER_COPILOT" | python3 "$COPILOT")"
if python3 -c '
import json, sys
d = json.loads(sys.argv[1])
assert d["permissionDecision"] == "deny" and d["permissionDecisionReason"]
' "$out"; then pass; else fail "copilot deny output shape: $out"; fi
set +e
err="$(claude_bash 'kubectl apply -f x' | python3 "$CODEX" 2>&1 > /dev/null)"
rc=$?
set -e
if [[ $rc -eq 2 && "$err" == *ADR-0032* ]]; then pass; else fail "codex deny: rc=$rc stderr=$err"; fi
echo "== Fail closed"
runtime_case "malformed payload denies on claude" deny "$CLAUDE" '{not json'
runtime_case "malformed payload denies on copilot" deny "$COPILOT" '{not json'
runtime_case "malformed payload denies on codex" deny "$CODEX" '{not json'
runtime_case "empty stdin denies" deny "$CLAUDE" ''
runtime_case "empty object denies" deny "$CLAUDE" '{}'
runtime_case "null payload denies" deny "$CLAUDE" 'null'
runtime_case "array payload denies" deny "$CLAUDE" '[]'
runtime_case "string tool_input denies" deny "$CLAUDE" '{"tool_name":"Bash","tool_input":"kubectl delete ns prod"}'
runtime_case "missing tool_input denies" deny "$CLAUDE" '{"tool_name":"Bash"}'
runtime_case "non-string command denies" deny "$CLAUDE" '{"tool_name":"Bash","tool_input":{"command":42}}'
runtime_case "command without a tool name denies" deny "$CLAUDE" '{"tool_input":{"command":"ls"}}'
runtime_case "cmd key is read" deny "$CLAUDE" '{"tool_name":"Bash","tool_input":{"cmd":"kubectl delete ns prod"}}'
runtime_case "cmd key read allows" allow "$CLAUDE" '{"tool_name":"Bash","tool_input":{"cmd":"ls"}}'
runtime_case "codex exec_command cmd" deny "$CODEX" '{"tool_name":"exec_command","tool_input":{"cmd":"kubectl delete ns prod"}}'
runtime_case "codex write_stdin chars" deny "$CODEX" '{"tool_name":"write_stdin","tool_input":{"session_id":1,"chars":"kubectl delete ns prod\n"}}'
runtime_case "copilot list toolArgs denies" deny "$COPILOT" '{"toolName":"bash","toolArgs":["kubectl get pods"]}'
runtime_case "copilot write_bash input" deny "$COPILOT" '{"toolName":"write_bash","toolArgs":"{\"sessionId\":\"1\",\"input\":\"kubectl delete ns prod\\n\"}"}'
echo "== Size and time"
# Copilot lets a timed-out hook's call through, so the guard must stay fast
# on pathological input and refuse oversized input outright.
if python3 - "$CLAUDE" << 'PY'
import json, subprocess, sys, time
guard = sys.argv[1]
ids = ",".join(str(i) for i in range(9000))
cases = {
"inline JSON with many commas": ("curl -d '{\"ids\":[%s],\"m\":{\"x\":1}}' http://h" % ids, "allow"),
"many dynamic programs": (";".join(['"$a" x'] * 8000) + ";kubectl get pods", "deny"),
"deep substitution": ("echo " + "$(" * 5000 + "x" + ")" * 5000, "deny"),
"many here-docs": ("cat " + "<<A " * 10000 + "\n" + "x\n" * 10000, "allow"),
"oversized command": ("echo " + "a " * 150000, "deny"),
}
# A long run of a prefix word, then a guarded command: each prefix is one
# unwrap step, so these must stay linear.
for tok in ("! ", "{ ", "time ", "nohup ", "sudo ", "find . -exec ", "eval ",
"env -S ", "ssh h ", "xargs ", "watch ", "rtk run ", "A=1 "):
for size in (64 * 1024, 250 * 1024):
body = tok * ((size - 30) // len(tok))
cases["%r x %dKB" % (tok.strip(), size // 1024)] = (
body + "kubectl delete ns prod", "deny")
bad = []
for name, (cmd, want) in cases.items():
payload = json.dumps({"tool_name": "Bash", "tool_input": {"command": cmd}})
start = time.time()
r = subprocess.run(["python3", guard], input=payload, capture_output=True, text=True)
took = time.time() - start
got = "allow"
if r.stdout.strip():
got = json.loads(r.stdout)["hookSpecificOutput"]["permissionDecision"]
print(" %-30s %7d bytes %-5s %.2fs" % (name, len(cmd), got, took))
if got != want or took > 3:
bad.append(name)
assert not bad, bad
PY
then pass; else fail "pathological input: wrong verdict or slower than 3s"; fi
echo "== Hook definition"
if python3 - "$HOOKS_JSON" << 'PY'
import json, sys
doc = json.load(open(sys.argv[1]))
groups = doc["hooks"]["PreToolUse"]
assert len(groups) == 1, groups
# No matcher: the script dispatches on tool name itself, because matchers are
# written verbatim to every target and the shell tool is named differently on
# each runtime.
assert "matcher" not in groups[0], groups[0]
(h,) = groups[0]["hooks"]
# The .apm/ path is the one that resolves after install (kyberforge docs/hooks.md).
assert h["command"] == "${CLAUDE_PLUGIN_ROOT}/.apm/hooks/guard.py", h
# Claude Code fails open on a hook error unless told otherwise.
assert h["onFailure"] == "block", h
# Copilot lets a timed-out hook's call through; keep the budget short but sane.
assert 1 <= h["timeout"] <= 30, h
PY
then pass; else fail "hooks.json shape"; fi
if [[ -x "$SRC" ]]; then pass; else fail "guard.py is not executable"; fi
if head -1 "$SRC" | grep -qx '#!/usr/bin/env python3'; then pass; else fail "guard.py shebang"; fi
# Standard library only: a missing dependency would stop every tool call.
if python3 - "$SRC" << 'PY'
import ast, sys
tree = ast.parse(open(sys.argv[1]).read())
mods = set()
for node in ast.walk(tree):
if isinstance(node, ast.Import):
mods.update(a.name.split(".")[0] for a in node.names)
elif isinstance(node, ast.ImportFrom):
mods.add(node.module.split(".")[0])
extra = mods - {"fnmatch", "json", "os", "re", "sys"}
assert not extra, extra
PY
then pass; else fail "guard.py imports outside the allowed stdlib set"; fi
echo
echo "delivery guard hook: $PASS passed, $FAIL failed"
[[ $FAIL -eq 0 ]]