fix(delivery): tighten delivery-repo-doc from first dogfood run
Why: the first drafting run against a real Ansible repo surfaced gaps the skill left to guesswork: pointer placement in a sectioned AGENTS.md, path-filtered and push-only workflows, link syntax, and caller-supplied facts. Implementation Notes: format.md pins the AGENTS.md placement rules without changing the exact line, notes that "skipped" checks pass, uses markdown links throughout section 5, and states the hard-stop consequence of an uninstalled skill. gathering.md covers mixed repos, which workflows count, the exact status-read tool calls and caller-supplied convention pointers. SKILL.md adds the fast-forward and dirty-tree rule, caller overrides, hook-failure handling and the remote-casing gotcha. Impact: delivery-repo-doc 0.1.0 -> 0.1.1. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
This commit is contained in:
1 parent
873b28ca96
commit
3f24daa58a
3 files changed
+44
-22
No files matched your search
@@ -9,7 +9,7 @@ compatibility: Requires git and a forge remote. Gitea needs the Gitea MCP server
|
||||
allowed-tools: Bash Read Write Edit
|
||||
metadata:
|
||||
category: delivery
|
||||
version: "0.1.0"
|
||||
version: "0.1.1"
|
||||
---
|
||||
|
||||
## Gotchas
|
||||
@@ -20,12 +20,15 @@ metadata:
|
||||
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, up to date. Identify the forge from
|
||||
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**.
|
||||
|
||||
@@ -39,10 +42,12 @@ named source file or forge status.
|
||||
|
||||
## Step 3 — Ask for human facts
|
||||
|
||||
Ask once, in one message, for every human-sourced value `references/gathering.md` lists that is
|
||||
still missing. 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.
|
||||
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
|
||||
|
||||
@@ -51,18 +56,20 @@ quote the value from it. Wait for the answer. A value the human declines to give
|
||||
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. If the repo has no root `AGENTS.md`, invoke `agentsmd-author` to create one carrying that
|
||||
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.
|
||||
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.
|
||||
`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.
|
||||
|
||||
@@ -47,6 +47,8 @@ do not restate it. A format change is an edit here, plus the consumers' parsers.
|
||||
- `<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
|
||||
|
||||
@@ -79,12 +81,12 @@ a user on this list set it.
|
||||
```text
|
||||
- Bot user: `<forge username>`
|
||||
- Kubeconfig: `<absolute path>` | none
|
||||
- Branch protection: in place | pending (<link to the tracking issue>)
|
||||
- Accepted risks: <link to ADR or issue>, … | none
|
||||
- Branch protection: in place | pending ([<title>](<url>))
|
||||
- Accepted risks: [<title>](<url>), … | none
|
||||
```
|
||||
|
||||
Delivery sessions export the kubeconfig path as `KUBECONFIG`. The value is a path only. Accepted
|
||||
risks are linked, never restated.
|
||||
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
|
||||
|
||||
@@ -93,13 +95,19 @@ anything else a delivery agent needs. Pointers only; no restating.
|
||||
|
||||
## AGENTS.md pointer line
|
||||
|
||||
The consuming repo's root `AGENTS.md` carries exactly this line, under whatever heading lists its
|
||||
agent docs (or at the end of the file when it has none):
|
||||
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
|
||||
@@ -128,7 +136,7 @@ agent docs (or at the end of the file when it has none):
|
||||
|
||||
- Bot user: `delivery-bot`
|
||||
- Kubeconfig: `/etc/delivery/kubeconfig-readonly`
|
||||
- Branch protection: in place
|
||||
- Branch protection: pending ([Branch protection setup](https://example.org/issues/12))
|
||||
- Accepted risks: [ADR-0032](https://example.org/adr/0032)
|
||||
|
||||
## Conventions
|
||||
@@ -142,9 +150,10 @@ The values in the skeleton are illustrative only; every real value comes from th
|
||||
|
||||
- [ ] 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.
|
||||
- [ ] 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 links, no secret values.
|
||||
- [ ] Section 5 holds paths and markdown links, no secret values.
|
||||
- [ ] Root `AGENTS.md` carries the pointer line exactly once.
|
||||
@@ -12,19 +12,24 @@ repo; facts only a human holds come from the human. A value with no source stays
|
||||
`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`.
|
||||
`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
|
||||
(Gitea: commit statuses via `gitea-prs`; 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.
|
||||
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.
|
||||
|
||||
@@ -37,7 +42,8 @@ repo; facts only a human holds come from the human. A value with no source stays
|
||||
|
||||
### Conventions
|
||||
|
||||
Point at the root `AGENTS.md`, `docs/adr/`, and any contributing or runbook docs that exist.
|
||||
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
|
||||
|
||||
|
||||
Reference in new issue
Block a user