Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions .agents/skills/release-nicely/scripts/author-path-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ other = "Give a greeting"
EOF
}

fct_manifest() {
cat >>"${repo}/manifest.toml" <<'EOF'

[[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
}

fct_handler() {
cat >"${repo}/greet.go" <<'EOF'
package probe
Expand Down Expand Up @@ -48,6 +64,9 @@ fct_command_order() {
while IFS= read -r step; do
printf 'author-path: follow %s\n' "${step}"
case "${step}" in
'1. Record the intake facts under `## Intake` in `vision.md`'*)
# The probe wraps no program, so its intake holds no fact to record.
;;
*'`spec.md`'* | "1. Write the command's spec before its implementation.")
cat >>"${repo}/spec.md" <<'EOF'

Expand All @@ -62,19 +81,7 @@ EOF
saw_spec=1
;;
*'`manifest.toml`'* | '2. Prepare the manifest, catalog, and placeholder handler until `extension.Check` passes.')
cat >>"${repo}/manifest.toml" <<'EOF'

[[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
fct_manifest
saw_manifest=1
if [[ "${step}" == '2. Prepare the manifest, catalog, and placeholder handler until `extension.Check` passes.' ]]; then
fct_catalog
Expand All @@ -91,6 +98,23 @@ EOF
fct_handler
saw_handler=1
;;
'3. Write the first scenario at the public command boundary'*)
# A handler that does no work lets the scenario reach its assertion,
# and Change a command declares it in the manifest and the catalog.
if ! grep -qF 'Declare the command in the manifest and the catalog, so `extension.Check` passes.' "${scratch}/author-AGENTS.md"; then
fct_fail '#324: Change a command no longer declares the command before the scenario'
return
fi
fct_manifest
saw_manifest=1
fct_catalog
saw_catalog=1
fct_handler
saw_handler=1
fct_scenario
saw_scenario=1
break
;;
*'`testdata/script/`'* | '3. Write a scenario that fails for the missing behavior.')
fct_scenario
saw_scenario=1
Expand Down
6 changes: 6 additions & 0 deletions .agents/skills/release-nicely/scripts/author-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ fct_execute_this() {
cp -R "${repo}" "${scratch}/removal"
repo="${scratch}/removal"
fct_remove_example
# Since #406, Change a command sends the author to the rounds of the skill,
# and round 1 gives the numbered order of the work.
awk '/^## Change a command$/ { active=1; next } active && /^## / { exit } active && /^[0-9]+\. / { print }' \
"${scratch}/author-AGENTS.md" >"${scratch}/change-steps.txt"
if [[ ! -s "${scratch}/change-steps.txt" ]]; then
awk '/^### Round 1$/ { active=1; next } active && /^#/ { exit } active && /^[0-9]+\. / { print }' \
"${scratch}/rendered/.agents/skills/nicely-extension/SKILL.md" >"${scratch}/change-steps.txt"
fi
cp -R "${scratch}/rendered" "${scratch}/command"
repo="${scratch}/command"
fct_command_order
Expand Down
Loading