fix(kyberforge): address independent review of #154

Quote the template description so the raw scaffold is valid YAML, reject
newline-containing names in new-instructions.sh, correct the empty-compile
facts (exit 1, --clean exits 0), and finish removing commit steps from the
skill-author, agent-author and forge references. Adds regression tests.

Refs #148

Co-Authored-By: Claude Code <[email protected]>
Claude-Session: https://claude.ai/code/session_01KkT7RSDwDbmrM9T34b6sTi
This commit is contained in:
Defame1297andClaude Code committed 2026-10-01 16:28:15 +00:00
1 parent d576695bb9
commit 68fa2abb62
11 files changed
+34 -17

No files matched your search

@@ -7,8 +7,8 @@ source_keys:
# Creating a new agent
Return to `SKILL.md` Step 4 once Step 3 below is done — validation, the version bump and commit
verification are shared with the improve flow and are not repeated here.
Return to `SKILL.md` Step 4 once Step 3 below is done — validation and the version bump
are shared with the improve flow and are not repeated here.
## Prerequisites
@@ -5,8 +5,8 @@ source_keys:
# Improving an existing agent
Return to `SKILL.md` Step 4 once Step 4 below is done — validation, the version bump and commit
verification are shared with the create flow and are not repeated here.
Return to `SKILL.md` Step 4 once Step 4 below is done — validation and the version bump
are shared with the create flow and are not repeated here.
## Step 1 — Verify inputs
@@ -35,7 +35,7 @@ Fall back to an **inline invocation** — same conversation, no subagent — whe
## Two-tier verification
Both author skills already close out with their own inline audit, in the same context as the
The skill and agent author skills already close out with their own inline audit, in the same context as the
authoring work: `skill-author` and `agent-author` each invoke `factory-audit` on what they wrote.
That is tier one, and forge does not change it.
@@ -31,7 +31,7 @@ brief:
> "The package at `<package-path>` gained a new `<artifact-type>` (`<artifact-name>`). Bump the
> `version` field in that package's `apm.yml`. Determine whether to bump minor (0.1.0) or patch
> (0.0.1) based on whether this is a new capability (minor) or a fix/refactor (patch). Do not
> release or tag — just update `apm.yml` and commit."
> release or tag — just update `apm.yml`."
Clean context rather than a fork is the point: the bump decision is made independently, without
anchoring on the authoring conversation that just argued for the artifact's significance.
@@ -1,6 +1,6 @@
---
# Delete these comments once filled in; Copilot receives this file verbatim.
description: FILL IN: one line on what this rule covers. Only Copilot and Cursor keep it.
description: "FILL IN: one line on what this rule covers. Only Copilot and Cursor keep it."
applyTo: "FILL IN: quoted glob, e.g. **/*.py"
# applyTo is always quoted: an unquoted ** is a YAML alias error and the rule
# deploys unscoped. Several globs: "**/*.css,**/*.scss". Delete the line only
@@ -50,7 +50,7 @@ For Claude Code the body's first line or heading is the only descriptive text th
- `--target claude` writes `CLAUDE.md`; Gemini writes `GEMINI.md` and `AGENTS.md`; every other target writes `AGENTS.md`.
- Compile skips instructions already deployed natively, for Claude, Copilot and Antigravity only. With rules populated, `--target claude` exits 0, prints "produced no output files" and writes nothing. `--force-instructions` (alias `--no-dedup`) overrides.
- Cursor, Windsurf, Kiro, Grok, Codex and OpenCode have no dedup: compile writes `AGENTS.md` that repeats rules the tool already loads natively.
- A compile with no instruction primitives exits 0.
- A package with no instruction primitives (skills only) makes plain `apm compile` exit 1 with "No instruction files found"; `apm compile --clean` exits 0.
## Native format facts
@@ -40,7 +40,7 @@ fi
NAME="$1"
ROOT="${2/#\~/$HOME}"
if ! grep -qE '^[a-z0-9]+(-[a-z0-9]+)*$' <<< "$NAME"; then
if [[ ! $NAME =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
echo "Error: name must use lowercase letters, numbers, and hyphens only." >&2
echo " No leading, trailing, or consecutive hyphens." >&2
echo " Received: '$NAME'" >&2
@@ -21,7 +21,7 @@ make_package() {
fill() {
sed -i -E \
-e '/^#/{/^# FILL IN/!d}' \
-e 's/^description: FILL IN.*/description: Python style rules/' \
-e 's/^description: .?FILL IN.*/description: Python style rules/' \
-e 's/^applyTo: .*/applyTo: "**\/*.py"/' \
-e 's/^# FILL IN.*/# Python style/' \
-e 's/^- FILL IN.*/- Use type hints./' \
@@ -217,3 +217,21 @@ need_apm() {
assert_output --partial "Missing 'description'"
assert_output --partial "Empty content"
}
@test "rejects a name containing a newline" {
make_package
run bash "$SCRIPT" $'my-rule\nextra' "$ROOT"
assert_failure
assert_output --partial "lowercase letters"
assert [ ! -d "$ROOT/.apm" ]
}
@test "the raw scaffold is valid YAML and compiles with no parse warnings" {
need_apm
make_package
run bash "$SCRIPT" my-rule "$ROOT"
assert_success
cd "$ROOT"
run apm compile --dry-run --target claude
refute_output --partial "Failed to parse"
}
@@ -9,8 +9,8 @@ source_keys:
# Creating a new skill
Return to `SKILL.md` Step 4 once Step 6 below is done — validation, versioning and commit
verification are shared with the improve flow and are not repeated here.
Return to `SKILL.md` Step 4 once Step 6 below is done — validation and versioning
are shared with the improve flow and are not repeated here.
## Prerequisites
@@ -7,8 +7,8 @@ source_keys:
# Improving an existing skill
Return to `SKILL.md` Step 4 once Step 4 below is done — validation, versioning and commit
verification are shared with the create flow and are not repeated here.
Return to `SKILL.md` Step 4 once Step 4 below is done — validation and versioning
are shared with the create flow and are not repeated here.
## Step 1 — Verify inputs