fix(kyberforge): resolve PR #144 review and audit round 3

- factory-audit: hook events judged per deployed target after apm's
  rename (Claude/Copilot event sets FAIL, others SUGGESTION); Claude
  plugin layouts accepted as hook sources; interpreter options and
  sh -c strings checked; bats 378 -> 386
- primitive-author: Must 4/5 match the audit; reference hand-back
  points at the right steps; Step 4.2 --target all fallback
- skill-author: new-skill.sh repair only on the template marker line,
  so complete skills stay a no-op; provenance and calibration text
- forge: restore "already named" qualifier; drop false HITL claim
- apm-workflow: token example uses an env var
- docs/hooks.md: the apm-hooks.json sidecar is committed, not ignored

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkT7RSDwDbmrM9T34b6sTi
This commit is contained in:
2026-09-28 21:32:18 +00:00
parent 965208bddd
commit 5d0f988ed8
18 changed files with 395 additions and 140 deletions

View File

@@ -132,6 +132,25 @@ teardown() {
assert_success
}
@test "a complete skill whose text mentions SKILL_NAME stays a true no-op" {
# Only the template's exact marker lines mark a half-built scaffold. A
# finished skill that merely mentions the token must not be rewritten.
mkdir -p "$DEST/my-tool/tests"
printf -- '---\nname: my-tool\n---\n\nUse `__SKILL_NAME_PLACEHOLDER__` here.\n' \
> "$DEST/my-tool/SKILL.md"
printf 'Set SKILL_NAME before running.\n' > "$DEST/my-tool/tests/README.md"
cp "$DEST/my-tool/SKILL.md" "$DEST/skill.orig"
cp "$DEST/my-tool/tests/README.md" "$DEST/readme.orig"
run bash "$SCRIPT" my-tool "$DEST"
assert_success
assert_output --partial "nothing to do"
refute_output --partial "Repaired"
run cmp "$DEST/skill.orig" "$DEST/my-tool/SKILL.md"
assert_success
run cmp "$DEST/readme.orig" "$DEST/my-tool/tests/README.md"
assert_success
}
# ---------------------------------------------------------------------------
# Mode detection: package vs standalone
# ---------------------------------------------------------------------------