Skip to content

Commit d0c638e

Browse files
author
Secure TDD Framework
committed
fix(skills): standardize all skill names and directories to kebab-case and add frontmatter validator
1 parent 8638c8e commit d0c638e

15 files changed

Lines changed: 75 additions & 32 deletions

File tree

‎.agents/lib/engine_codemender.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ run_codemender_gate() {
198198
199199
Action Required: Execute the Secure TDD Loop sequentially for each finding:
200200
For each finding below (one at a time):
201-
1. Invoke 'security_test_writer' to author one failing boundary test in tests/ (assert RED).
202-
2. Invoke 'defensive_developer' to apply the minimal defensive fix (assert GREEN).
201+
1. Invoke 'security-test-writer' to author one failing boundary test in tests/ (assert RED).
202+
2. Invoke 'defensive-developer' to apply the minimal defensive fix (assert GREEN).
203203
3. Run the local test to confirm it passes before moving to the next finding.
204204
Once all findings are resolved, run the full regression test suite ($SECURITY_GATE_TEST_CMD) and retry 'git push'.
205205

‎.agents/lib/engine_semgrep.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ run_semgrep_gate() {
141141
142142
Action Required: Execute the Secure TDD Loop sequentially for each finding:
143143
For each finding below (one at a time):
144-
1. Invoke 'security_test_writer' to author one failing boundary test in tests/ (assert RED).
145-
2. Invoke 'defensive_developer' to apply the minimal defensive fix (assert GREEN).
144+
1. Invoke 'security-test-writer' to author one failing boundary test in tests/ (assert RED).
145+
2. Invoke 'defensive-developer' to apply the minimal defensive fix (assert GREEN).
146146
3. Run the local test to confirm it passes before moving to the next finding.
147147
Once all findings are resolved, run the full regression test suite ($SECURITY_GATE_TEST_CMD) and retry 'git push'.
148148

‎.agents/lib/gate_common.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ evolve_context_and_skills() {
221221
fi
222222
fi
223223

224-
echo "Continuous Evolution Suggestion: Consider updating relevant SKILL.md files (e.g. security_test_writer / defensive_developer) to encode $rule_desc." >&2
224+
echo "Continuous Evolution Suggestion: Consider updating relevant SKILL.md files (e.g. security-test-writer / defensive-developer) to encode $rule_desc." >&2
225225
}
226226

227227
read_lines_into_array() {

.agents/skills/defensive_developer/SKILL.md renamed to .agents/skills/defensive-developer/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: defensive_developer
2+
name: defensive-developer
33
description: Implements clean, maintainable production code to deliver features and satisfy functional and security test assertions (Phase C: GREEN).
44
---
55

.agents/skills/history_context_seeder/SKILL.md renamed to .agents/skills/history-context-seeder/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: history_context_seeder
2+
name: history-context-seeder
33
description: Analyzes repository Git history for past bug fixes, architectural conventions, and security patterns to seed CONTEXT.md on onboarding.
44
---
55

.agents/skills/local_refactor_scanner/SKILL.md renamed to .agents/skills/local-refactor-scanner/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: local_refactor_scanner
2+
name: local-refactor-scanner
33
description: Refactors code for quality and maintainability, executes full test suite regression passes, and runs local deterministic security/lint scans (Phase D: REFACTOR).
44
---
55

@@ -28,6 +28,6 @@ Refactor implementation for clean code structure, modularity, and maintainabilit
2828
2. Refactor code for clarity, maintainability, and helper reuse.
2929
3. Run local linters and security scanners on changed files.
3030
4. Run the full test suite to guarantee 100% passing tests.
31-
5. **Continuous Evolution**: Capture new conventions in `CONTEXT.md` and suggest/apply updates to `SKILL.md` instructions via `skill_evolution_updater` to permanently prevent recurrence of issues.
31+
5. **Continuous Evolution**: Capture new conventions in `CONTEXT.md` and suggest/apply updates to `SKILL.md` instructions via `skill-evolution-updater` to permanently prevent recurrence of issues.
3232

3333

.agents/skills/security_test_writer/SKILL.md renamed to .agents/skills/security-test-writer/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: security_test_writer
2+
name: security-test-writer
33
description: Authors test-first unit and integration tests covering functional behavior, edge cases, and security boundaries (Phase B: RED).
44
---
55

.agents/skills/skill_evolution_updater/SKILL.md renamed to .agents/skills/skill-evolution-updater/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: skill_evolution_updater
2+
name: skill-evolution-updater
33
description: Extracts systemic conventions from resolved bugs, patterns, and refactors to update CONTEXT.md and agent skills (Continuous Evolution).
44
---
55

.agents/skills/threat_model_assessor/SKILL.md renamed to .agents/skills/threat-model-assessor/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: threat_model_assessor
2+
name: threat-model-assessor
33
description: Plans feature architecture, functional requirements, and evaluates STRIDE security boundaries (Phase A: Plan).
44
---
55

‎.agents/tests/run_tests.sh‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,34 @@ test_pipeline_tools_missing_passes_smoothly() {
318318
cleanup_repo "$repo"
319319
}
320320

321+
test_skills_frontmatter_valid() {
322+
local skills_dir="$AGENTS_DIR/skills"
323+
[ -d "$skills_dir" ] || return 0
324+
local bad=0
325+
for skill_md in "$skills_dir"/*/SKILL.md; do
326+
[ -f "$skill_md" ] || continue
327+
local folder_name
328+
folder_name=$(basename "$(dirname "$skill_md")")
329+
local fm_name
330+
fm_name=$(awk '/^---$/{f=!f; next} f && /^name:/{sub(/^name:[[:space:]]*/, ""); print; exit}' "$skill_md")
331+
local fm_desc
332+
fm_desc=$(awk '/^---$/{f=!f; next} f && /^description:/{sub(/^description:[[:space:]]*/, ""); print; exit}' "$skill_md")
333+
if [[ ! "$fm_name" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
334+
bad=1
335+
log_fail "skill frontmatter name [$fm_name] in $skill_md must be kebab-case"
336+
fi
337+
if [ "$fm_name" != "$folder_name" ]; then
338+
bad=1
339+
log_fail "skill frontmatter name [$fm_name] does not match directory [$folder_name]"
340+
fi
341+
if [ -z "$fm_desc" ]; then
342+
bad=1
343+
log_fail "skill frontmatter description missing in $skill_md"
344+
fi
345+
done
346+
assert_eq "skills: all SKILL.md files use valid kebab-case frontmatter" "0" "$bad"
347+
}
348+
321349
# --- run -----------------------------------------------------------------
322350

323351
for t in \
@@ -339,6 +367,7 @@ for t in \
339367
test_pipeline_semgrep_to_codemender_flow \
340368
test_pipeline_deterministic_error_fail_open_proceeds_to_stage2 \
341369
test_pipeline_tools_missing_passes_smoothly \
370+
test_skills_frontmatter_valid \
342371
; do
343372
echo "-- $t"
344373
"$t"

0 commit comments

Comments
 (0)