fix(kyberforge): align skill factory with agentskills.io spec on directory rules

Move test infrastructure (validate.bats, new-skill.bats) from scripts/ to
tests/ — the spec defines scripts/ as executable code agents can run, so
test files don't belong there. Add tests/README.md placeholders with
bats-support dependency declaration.

Update skill-audit to permit tests/ and flag other unlisted directories,
add scripts/ purpose check, and add /skill-improve near-miss exclusion.
Update skill-improve and skill-write to cover tests/ in directory lists,
scaffold template, and authoring guidance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 19:16:47 +00:00
parent 4d36251b57
commit 3290b93640
10 changed files with 73 additions and 8 deletions

View File

@@ -25,5 +25,6 @@ Provide the path to the skill directory to audit when invoking.
| `scripts/validate.sh` | Structural validator — checks name format, name matches directory, description length, line count, placeholder detection, script executable bit, and interactive-prompt detection |
| `references/description-quality.md` | Spec-grounded rubric for description auditing — loaded when a finding is borderline |
| `references/body-discipline.md` | Spec-grounded rubric for body discipline auditing — loaded when padding vs necessity is unclear |
| `scripts/validate.bats` | Bats test suite for validate.sh — dev tooling, not shipped with the plugin |
| `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 |

View File

@@ -10,6 +10,7 @@ description: >
(findings only, no PASS noise) with Why and Fix per finding, suitable for agent
handoff to /skill-improve or human auditability. Do not use to run evals, fix
application code bugs, or perform general code review unrelated to skill quality.
Do not use when the user wants improvements applied — use /skill-improve instead.
allowed-tools: Bash Read
metadata:
category: factory
@@ -63,8 +64,9 @@ Check each pattern is appropriate and correctly formed:
### File structure
- Only spec-defined directories present: `scripts/`, `references/`, `assets/`
- No non-spec files (e.g. META.md, extra config files)
- Permitted directories: `scripts/`, `references/`, `assets/`, `tests/`; flag any other unlisted directory as FAIL — the spec allows additional dirs but this skill permits only these four to keep skills focused
- `scripts/` contains only executable code agents can run; test files (`.bats`, `*_test.*`, `test_*.sh`) in `scripts/` are a FAIL — they belong in `tests/`
- No non-spec files at the skill root (e.g. META.md, extra config files outside permitted directories)
- Optional directories contain real content — not just unfilled placeholder READMEs
- `README.md` present and accurately describes the skill and its files
- No cross-plugin path references — paths using `../`, `../../`, or absolute repo paths (e.g. `plugins/kyberforge/skills/...`) break when the plugin is installed to a cache; flag any found

View File

@@ -0,0 +1,26 @@
# tests/
Test files for scripts bundled with this skill.
## Dependencies
Tests require [bats-support](https://github.com/bats-core/bats-support) and
[bats-assert](https://github.com/bats-core/bats-assert) installed under
`tests/test_helper/`:
```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:
```bash
bats tests/
```
## Files
| File | Purpose |
|------|---------|
| `validate.bats` | Bats test suite for `scripts/validate.sh` |