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:
@@ -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