fix(kyberforge): fix template test docs, dangling skill ref, and README table consistency
- Rewrite assets/templates/tests/README.md with correct repo-root context and SKILL_NAME placeholder in bats run command (was: `bats tests/`, wrong CWD) - Add sed substitution for tests/README.md in new-skill.sh so SKILL_NAME is replaced in scaffolded test docs; test added to new-skill.bats (red→green) - Remove /write-eval reference from skill-improve SKILL.md; reword as direct action since the skill does not exist in the kyberforge plugin - Remove self-referential README.md rows from skill-audit and skill-improve Files tables to match template and skill-write convention Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,4 +27,3 @@ Provide the path to the skill directory to audit when invoking.
|
||||
| `references/body-discipline.md` | Spec-grounded rubric for body discipline auditing — loaded when padding vs necessity is unclear |
|
||||
| `tests/validate.bats` | Bats test suite for validate.sh |
|
||||
| `tests/README.md` | Setup instructions for bats-support and bats-assert test dependencies |
|
||||
| `README.md` | This file |
|
||||
|
||||
@@ -23,4 +23,3 @@ Provide the skill directory path and any signal files in the conversation. The s
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `SKILL.md` | Skill instructions for agents |
|
||||
| `README.md` | Human-facing description of the skill and its files |
|
||||
|
||||
@@ -73,4 +73,4 @@ If a signal points to a script or reference file, edit that file directly rather
|
||||
|
||||
Run `/skill-audit` on the skill directory. Resolve any FAIL findings before considering the improvement complete.
|
||||
|
||||
If the skill has no `evals/` directory, note it after the audit: "No evals found — consider running `/write-eval` to add test coverage so future improvement cycles have quantitative signals to work from."
|
||||
If the skill has no `evals/` directory, note it after the audit: "No evals found — consider adding an `evals/` directory with assertion-based test cases to give future improvement cycles quantitative signals to work from."
|
||||
|
||||
@@ -9,20 +9,23 @@ to break silently — validators, parsers, generators, anything with branching
|
||||
logic or edge cases. Test infrastructure (`.bats`, `*_test.*`, `test_*.sh`)
|
||||
belongs here, not in `scripts/`.
|
||||
|
||||
## Test runner
|
||||
## Dependencies
|
||||
|
||||
Tests are run with [Bats](https://bats-core.readthedocs.io) for shell scripts.
|
||||
Install support libraries under `tests/test_helper/`:
|
||||
Tests require [bats-support](https://github.com/bats-core/bats-support) and
|
||||
[bats-assert](https://github.com/bats-core/bats-assert). The test files load
|
||||
helpers from the repo root's `tests/test_helper/`.
|
||||
|
||||
From the repo root:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/bats-core/bats-support tests/test_helper/bats-support
|
||||
git clone https://github.com/bats-core/bats-assert tests/test_helper/bats-assert
|
||||
```
|
||||
|
||||
Run all tests:
|
||||
Run all tests for this skill (from the repo root):
|
||||
|
||||
```bash
|
||||
bats tests/
|
||||
bats <destination-dir>/SKILL_NAME/tests/
|
||||
```
|
||||
|
||||
## If no tests are needed
|
||||
|
||||
@@ -76,6 +76,7 @@ cp -r "$TEMPLATES_DIR" "$TARGET"
|
||||
# Set skill name in templates
|
||||
sed -i "s/SKILL_NAME/$SKILL_NAME/g" "$TARGET/SKILL.md"
|
||||
sed -i "s/SKILL_NAME/$SKILL_NAME/g" "$TARGET/README.md"
|
||||
sed -i "s/SKILL_NAME/$SKILL_NAME/g" "$TARGET/tests/README.md"
|
||||
|
||||
echo "Scaffold created: $TARGET"
|
||||
echo ""
|
||||
|
||||
@@ -59,6 +59,12 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "substitutes skill name in tests/README.md" {
|
||||
bash "$SCRIPT" my-tool "$DEST"
|
||||
run grep "my-tool" "$DEST/my-tool/tests/README.md"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "skill name with numbers is valid" {
|
||||
run bash "$SCRIPT" my-tool-2 "$DEST"
|
||||
assert_success
|
||||
|
||||
Reference in New Issue
Block a user