aboutsummaryrefslogtreecommitdiffstats
path: root/.agents/skills/skill-quality-reviewer/scripts
diff options
context:
space:
mode:
authorsillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
committersillylaird <sillyfanboy@gmail.com>2026-09-03 00:33:59 +0000
commit898b52edcb47bcb3e9d6106e74ca73e74ea01e70 (patch)
tree85c6ee5ad58b860144551184d4cf86b560c62b91 /.agents/skills/skill-quality-reviewer/scripts
downloadwww-main.tar.gz
www-main.zip
import live www.sillylaird.ca webrootHEADmain
Diffstat (limited to '.agents/skills/skill-quality-reviewer/scripts')
-rwxr-xr-x.agents/skills/skill-quality-reviewer/scripts/extract-yaml.sh28
-rwxr-xr-x.agents/skills/skill-quality-reviewer/scripts/skill-audit.py39
2 files changed, 67 insertions, 0 deletions
diff --git a/.agents/skills/skill-quality-reviewer/scripts/extract-yaml.sh b/.agents/skills/skill-quality-reviewer/scripts/extract-yaml.sh
new file mode 100755
index 0000000..55f81a6
--- /dev/null
+++ b/.agents/skills/skill-quality-reviewer/scripts/extract-yaml.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# extract-yaml.sh - Extract YAML frontmatter from SKILL.md files
+# Part of skill-quality-reviewer
+
+# Usage: ./extract-yaml.sh <path-to-skill>
+# Example: ./extract-yaml.sh ~/.claude/skills/git-workflow
+
+set -euo pipefail
+
+# Check if path provided
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 <path-to-skill>"
+ echo "Example: $0 ~/.claude/skills/git-workflow"
+ exit 1
+fi
+
+SKILL_PATH="$1"
+SKILL_FILE="${SKILL_PATH}/SKILL.md"
+
+# Check if SKILL.md exists
+if [ ! -f "$SKILL_FILE" ]; then
+ echo "Error: SKILL.md not found at ${SKILL_FILE}"
+ exit 1
+fi
+
+# Extract YAML frontmatter (between --- lines)
+# Using sed to extract content between first and second ---
+sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$SKILL_FILE"
diff --git a/.agents/skills/skill-quality-reviewer/scripts/skill-audit.py b/.agents/skills/skill-quality-reviewer/scripts/skill-audit.py
new file mode 100755
index 0000000..8f047c3
--- /dev/null
+++ b/.agents/skills/skill-quality-reviewer/scripts/skill-audit.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+from __future__ import annotations
+
+import argparse
+import re
+from pathlib import Path
+
+REF_RE = re.compile(r'(references/[^\s)`]+|examples/[^\s)`]+|scripts/[^\s)`]+|assets/[^\s)`]+)')
+
+
+def parse_args() -> argparse.Namespace:
+ parser = argparse.ArgumentParser(description='Audit a skill for missing local references and rough size metrics.')
+ parser.add_argument('skill_path', help='Path to the skill directory')
+ return parser.parse_args()
+
+
+def main() -> int:
+ args = parse_args()
+ root = Path(args.skill_path).expanduser().resolve()
+ skill_md = root / 'SKILL.md'
+ if not skill_md.exists():
+ print('missing SKILL.md')
+ return 1
+ text = skill_md.read_text(encoding='utf-8')
+ words = len(re.findall(r'\w+', text))
+ print(f'word_count={words}')
+ refs = sorted(set(match.rstrip('*:.,') for match in REF_RE.findall(text)))
+ missing = [ref for ref in refs if not (root / ref).exists()]
+ if missing:
+ print('missing_refs=')
+ for ref in missing:
+ print(f'- {ref}')
+ else:
+ print('missing_refs=0')
+ return 0
+
+
+if __name__ == '__main__':
+ raise SystemExit(main())