From 6087634ad720f9e5fa70b2db6d43341bc61712f4 Mon Sep 17 00:00:00 2001 From: Pascal Andy Date: Tue, 3 Nov 2026 10:00:07 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20release:?= =?UTF-8?q?=20move=20the=20removal=20of=20the=20example=20of=20the=20autho?= =?UTF-8?q?r=20path=20to=20its=20own=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../scripts/author-path-command.sh | 112 +---------------- .../scripts/author-path-remove.sh | 116 ++++++++++++++++++ .../release-nicely/scripts/author-path.sh | 2 + 3 files changed, 119 insertions(+), 111 deletions(-) create mode 100644 .agents/skills/release-nicely/scripts/author-path-remove.sh diff --git a/.agents/skills/release-nicely/scripts/author-path-command.sh b/.agents/skills/release-nicely/scripts/author-path-command.sh index e72b5d83..96ca6957 100644 --- a/.agents/skills/release-nicely/scripts/author-path-command.sh +++ b/.agents/skills/release-nicely/scripts/author-path-command.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Sourced by author-path.sh to rehearse example replacement and command creation. +# Sourced by author-path.sh to rehearse command creation. author-path-remove.sh rehearses example replacement. # Markdown backticks in patterns and fixture text are literal. # repo and scratch come from the sourcing script's caller. # shellcheck disable=SC2016,SC2154 @@ -174,113 +174,3 @@ EOF fct_fail '#324: the completed greeting does not pass just check' fi } - -# Replace the example with one complete command, following Remove the example. -fct_remove_example() { - local step file saw_files=0 saw_manifest=0 saw_catalog=0 saw_docs=0 saw_handler=0 - awk '/^## Remove the example$/ { active=1; next } active && /^## / { exit } active && /^[0-9]+\. / { print }' \ - "${repo}/AGENTS.md" >"${scratch}/remove-steps.txt" - while IFS= read -r step; do - printf 'author-path: follow %s\n' "${step}" - case "${step}" in - '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`' | \ - '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`. Rewrite `testdata/script/refusal.txtar` for a refusal of your command, or delete it when the command has none') - mkdir "${scratch}/removed" - while IFS= read -r file; do - mv "${repo}/${file}" "${scratch}/removed/${file##*/}" - done < <(printf '%s\n' "${step}" | awk -F '`' '{ for (i=2; i"${repo}/manifest.toml" <<'EOF' -format_version = 1 -contract_version = 1 -domain = "probe" - -[[commands]] -path = "probe" -summary = "probe.summary" -examples = ["ncly probe greet --json"] - -[[commands]] -path = "probe greet" -summary = "probe.greet.summary" -examples = ["ncly probe greet --json"] -effects = {} - -[commands.result.schema] -type = "object" -required = ["message"] -properties = { message = { type = "string" } } -EOF - saw_manifest=1 - ;; - *'Replace the `probe.inspect` catalog entries'*'`probe.summary`'*) - cat >"${repo}/locales/en.toml" <<'EOF' -["probe.summary"] -description = "Help summary of the author path domain." -other = "Give greetings" -EOF - fct_catalog - saw_catalog=1 - ;; - *'Remove the `ncly probe inspect` section'*'`spec.md`'*'`vision.md`, `qa.md`, `skill/SKILL.md`'*'`AGENTS.md`'*'`acceptance.sh`'*) - cat >"${repo}/spec.md" <<'EOF' -# Probe spec - -## ncly probe greet - -Success means that the answer gives the greeting ready. - -## Acceptance - -- `greeting`: the message is ready -EOF - cat >"${repo}/skill/SKILL.md" <<'EOF' ---- -name: probe -description: Use when an agent needs the author path greeting. ---- - -Run `ncly probe greet --json` to get the greeting. -EOF - printf '# Probe\n\nGive a greeting through `ncly probe greet`.\n' >"${repo}/vision.md" - if [[ -f "${repo}/qa.md" ]]; then - printf '# Probe QA\n\nRequire the greeting ready.\n' >"${repo}/qa.md" - fi - if [[ -f "${repo}/acceptance.sh" ]]; then - printf '#!/usr/bin/env bash\nset -Eeuo pipefail\ngo tool ncly probe greet --json\n' >"${repo}/acceptance.sh" - fi - sed 's/of `inspect`/of `greet`/' "${repo}/AGENTS.md" >"${repo}/AGENTS.md.new" - mv "${repo}/AGENTS.md.new" "${repo}/AGENTS.md" - saw_docs=1 - ;; - *'Remove its handler entry from `extension.go`'*'`//go:embed worker`'*'`Resources`'*'`gofmt -w .`'*) - awk '!/^\/\/go:embed worker$/ && !/^var workers embed.FS$/ && !/Resources: workers,/ && !/"probe inspect": inspect,/' \ - "${repo}/extension.go" >"${repo}/extension.go.new" - mv "${repo}/extension.go.new" "${repo}/extension.go" - fct_handler - sed 's/"message": "pending"/"message": "ready"/' "${repo}/greet.go" >"${repo}/greet.go.new" - mv "${repo}/greet.go.new" "${repo}/greet.go" - # The replacement must still have the shared helper that inspect.go once held. - printf '\nvar _ = usage\n' >>"${repo}/greet.go" - gofmt -w "${repo}" - saw_handler=1 - ;; - *) - fct_fail "#323 #324: unsupported Remove the example step: ${step}" - return - ;; - esac - done <"${scratch}/remove-steps.txt" - if [[ "${saw_files}${saw_manifest}${saw_catalog}${saw_docs}${saw_handler}" != 11111 ]]; then - fct_fail '#323 #324: Remove the example omits a required step for files, manifest, catalog, documentation, or handlers' - return - fi - fct_scenario - if ! fct_run remove-example "${repo}" just check; then - cat "${scratch}/remove-example.log" >&2 - fct_fail '#323 #324: example removal breaks the replacement command' - fi -} diff --git a/.agents/skills/release-nicely/scripts/author-path-remove.sh b/.agents/skills/release-nicely/scripts/author-path-remove.sh new file mode 100644 index 00000000..7859024f --- /dev/null +++ b/.agents/skills/release-nicely/scripts/author-path-remove.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +# Sourced by author-path.sh to rehearse Remove the example of the rendered AGENTS.md. +# Markdown backticks in patterns and fixture text are literal. +# repo and scratch come from the sourcing script's caller, and fct_catalog, fct_handler, +# and fct_scenario from author-path-command.sh. +# shellcheck disable=SC2016,SC2154 + +# Replace the example with one complete command, following Remove the example. +fct_remove_example() { + local step file saw_files=0 saw_manifest=0 saw_catalog=0 saw_docs=0 saw_handler=0 + awk '/^## Remove the example$/ { active=1; next } active && /^## / { exit } active && /^[0-9]+\. / { print }' \ + "${repo}/AGENTS.md" >"${scratch}/remove-steps.txt" + while IFS= read -r step; do + printf 'author-path: follow %s\n' "${step}" + case "${step}" in + '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`' | \ + '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`. Rewrite `testdata/script/refusal.txtar` for a refusal of your command, or delete it when the command has none') + mkdir "${scratch}/removed" + while IFS= read -r file; do + mv "${repo}/${file}" "${scratch}/removed/${file##*/}" + done < <(printf '%s\n' "${step}" | awk -F '`' '{ for (i=2; i"${repo}/manifest.toml" <<'EOF' +format_version = 1 +contract_version = 1 +domain = "probe" + +[[commands]] +path = "probe" +summary = "probe.summary" +examples = ["ncly probe greet --json"] + +[[commands]] +path = "probe greet" +summary = "probe.greet.summary" +examples = ["ncly probe greet --json"] +effects = {} + +[commands.result.schema] +type = "object" +required = ["message"] +properties = { message = { type = "string" } } +EOF + saw_manifest=1 + ;; + *'Replace the `probe.inspect` catalog entries'*'`probe.summary`'*) + cat >"${repo}/locales/en.toml" <<'EOF' +["probe.summary"] +description = "Help summary of the author path domain." +other = "Give greetings" +EOF + fct_catalog + saw_catalog=1 + ;; + *'Remove the `ncly probe inspect` section'*'`spec.md`'*'`vision.md`, `qa.md`, `skill/SKILL.md`'*'`AGENTS.md`'*'`acceptance.sh`'*) + cat >"${repo}/spec.md" <<'EOF' +# Probe spec + +## ncly probe greet + +Success means that the answer gives the greeting ready. + +## Acceptance + +- `greeting`: the message is ready +EOF + cat >"${repo}/skill/SKILL.md" <<'EOF' +--- +name: probe +description: Use when an agent needs the author path greeting. +--- + +Run `ncly probe greet --json` to get the greeting. +EOF + printf '# Probe\n\nGive a greeting through `ncly probe greet`.\n' >"${repo}/vision.md" + if [[ -f "${repo}/qa.md" ]]; then + printf '# Probe QA\n\nRequire the greeting ready.\n' >"${repo}/qa.md" + fi + if [[ -f "${repo}/acceptance.sh" ]]; then + printf '#!/usr/bin/env bash\nset -Eeuo pipefail\ngo tool ncly probe greet --json\n' >"${repo}/acceptance.sh" + fi + sed 's/of `inspect`/of `greet`/' "${repo}/AGENTS.md" >"${repo}/AGENTS.md.new" + mv "${repo}/AGENTS.md.new" "${repo}/AGENTS.md" + saw_docs=1 + ;; + *'Remove its handler entry from `extension.go`'*'`//go:embed worker`'*'`Resources`'*'`gofmt -w .`'*) + awk '!/^\/\/go:embed worker$/ && !/^var workers embed.FS$/ && !/Resources: workers,/ && !/"probe inspect": inspect,/' \ + "${repo}/extension.go" >"${repo}/extension.go.new" + mv "${repo}/extension.go.new" "${repo}/extension.go" + fct_handler + sed 's/"message": "pending"/"message": "ready"/' "${repo}/greet.go" >"${repo}/greet.go.new" + mv "${repo}/greet.go.new" "${repo}/greet.go" + # The replacement must still have the shared helper that inspect.go once held. + printf '\nvar _ = usage\n' >>"${repo}/greet.go" + gofmt -w "${repo}" + saw_handler=1 + ;; + *) + fct_fail "#323 #324: unsupported Remove the example step: ${step}" + return + ;; + esac + done <"${scratch}/remove-steps.txt" + if [[ "${saw_files}${saw_manifest}${saw_catalog}${saw_docs}${saw_handler}" != 11111 ]]; then + fct_fail '#323 #324: Remove the example omits a required step for files, manifest, catalog, documentation, or handlers' + return + fi + fct_scenario + if ! fct_run remove-example "${repo}" just check; then + cat "${scratch}/remove-example.log" >&2 + fct_fail '#323 #324: example removal breaks the replacement command' + fi +} diff --git a/.agents/skills/release-nicely/scripts/author-path.sh b/.agents/skills/release-nicely/scripts/author-path.sh index d00bf9c5..046dc2cb 100755 --- a/.agents/skills/release-nicely/scripts/author-path.sh +++ b/.agents/skills/release-nicely/scripts/author-path.sh @@ -8,6 +8,8 @@ set -Eeuo pipefail trap 'printf "author-path: unexpected failure at line %s; inspect %s\n" "${LINENO}" "${scratch:-the output}" >&2' ERR # shellcheck source=.agents/skills/release-nicely/scripts/author-path-command.sh source "$(dirname -- "${BASH_SOURCE[0]}")/author-path-command.sh" +# shellcheck source=.agents/skills/release-nicely/scripts/author-path-remove.sh +source "$(dirname -- "${BASH_SOURCE[0]}")/author-path-remove.sh" fct_fail() { printf 'author-path: FAIL %s\n' "$*" >&2 From 477de7e4fb4ff1559b332a64846d5a0129a8f9a4 Mon Sep 17 00:00:00 2001 From: Pascal Andy Date: Tue, 3 Nov 2026 10:00:19 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A7=B0=20skill:=20release:=20the=20au?= =?UTF-8?q?thor=20path=20rewrites=20the=20acceptance=20case,=20as=20the=20?= =?UTF-8?q?template=20of=20COR-104-T5=20asks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../scripts/author-path-remove.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.agents/skills/release-nicely/scripts/author-path-remove.sh b/.agents/skills/release-nicely/scripts/author-path-remove.sh index 7859024f..53c7e0cf 100644 --- a/.agents/skills/release-nicely/scripts/author-path-remove.sh +++ b/.agents/skills/release-nicely/scripts/author-path-remove.sh @@ -14,11 +14,26 @@ fct_remove_example() { printf 'author-path: follow %s\n' "${step}" case "${step}" in '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`' | \ - '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`. Rewrite `testdata/script/refusal.txtar` for a refusal of your command, or delete it when the command has none') + '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`. Rewrite `testdata/script/refusal.txtar` for a refusal of your command, or delete it when the command has none' | \ + '1. Delete `inspect.go`, `worker/inspect.py`, and `testdata/script/inspect.txtar`. Rewrite `testdata/script/refusal.txtar` for a refusal of your command, or delete it when the command has none. Rewrite `testdata/script/acceptance.txtar` for a property of your command') mkdir "${scratch}/removed" while IFS= read -r file; do mv "${repo}/${file}" "${scratch}/removed/${file##*/}" done < <(printf '%s\n' "${step}" | awk -F '`' '{ for (i=2; i"${repo}/testdata/script/acceptance.txtar" <<'EOF' +# spec: greeting +ncly probe greet --json +cp stdout answer.json +reads answer.json reference bad.json answer message + +-- reference -- +message: "ready" +-- bad.json -- +{"ok":true,"contract_version":1,"message":"pending"} +EOF + fi saw_files=1 ;; '2. Replace the example declaration at `probe inspect` and its examples in `manifest.toml`. Remove `[programs.python3]` when no command needs it' | \