majiayu000/spellbook / skills/skill-creator
skill-creator
VerifiedCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
| File | Kind | Size |
|---|---|---|
| LICENSE.txt | markdown | 11.1 KB |
| SKILL.md | skill md | 33.1 KB |
| agents/analyzer.md | markdown | 10.1 KB |
| agents/comparator.md | markdown | 7.1 KB |
| agents/grader.md | markdown | 8.8 KB |
| assets/eval_review.html | other | 6.9 KB |
| eval-viewer/generate_review.py | script | 16.0 KB |
| eval-viewer/viewer.html | other | 44.0 KB |
| references/quality-playbook.md | markdown | 2.9 KB |
| references/schemas.md | markdown | 13.0 KB |
| requirements.txt | manifest | 17 B |
| scripts/aggregate_benchmark.pyexecutable | script | 15.0 KB |
| scripts/generate_report.pyexecutable | script | 12.5 KB |
| scripts/improve_description.pyexecutable | script | 10.5 KB |
| scripts/package_skill.pyexecutable | script | 5.9 KB |
| scripts/path_safety.py | script | 3.2 KB |
| scripts/quick_validate.pyexecutable | script | 5.8 KB |
| scripts/run_eval.pyexecutable | script | 11.9 KB |
| scripts/run_loop.pyexecutable | script | 13.4 KB |
| scripts/utils.py | script | 1.6 KB |
scripts/path_safety.py
View on GitHub"""Path safety helpers for skill packaging and generation scripts."""
from __future__ import annotations
import os
import re
from pathlib import Path, PurePosixPath, PureWindowsPath
class UnsafePathError(ValueError):
"""Raised when an untrusted path or name would escape its container."""
SAFE_KEBAB_RE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
def is_relative_to(path: Path, directory: Path) -> bool:
"""Return whether ``path`` is contained by ``directory``."""
try:
path.relative_to(directory)
return True
except ValueError:
return False
def safe_kebab_name(value: str, *, kind: str = "name") -> str:
"""Validate a single untrusted kebab-case path component."""
if not value:
raise UnsafePathError(f"{kind} must not be empty")
if value in {".", ".."}:
raise UnsafePathError(f"{kind} must not be {value!r}")
if "/" in value or "\\" in value:
raise UnsafePathError(f"{kind} must not contain path separators: {value!r}")
if not SAFE_KEBAB_RE.fullmatch(value):
raise UnsafePathError(
f"{kind} must be kebab-case lowercase letters, digits, and hyphens: {value!r}"
)
if len(value) > 64:
raise UnsafePathError(f"{kind} is too long ({len(value)} characters); maximum is 64")
return value
def _reject_absolute_or_drive(path: Path | str, *, kind: str) -> None:
raw = str(path)
if Path(raw).is_absolute() or PureWindowsPath(raw).is_absolute() or PureWindowsPath(raw).drive:
raise UnsafePathError(f"{kind} must be relative: {raw!r}")
def safe_output_path(base: Path, candidate: Path | str, *, kind: str = "output") -> Path:
"""Join ``candidate`` under ``base`` and reject traversal or absolute paths."""
_reject_absolute_or_drive(candidate, kind=kind)
candidate_path = Path(candidate)
if any(part in {"", ".", ".."} for part in candidate_path.parts):
raise UnsafePathError(f"{kind} contains unsafe component: {candidate!r}")
if any("\\" in part for part in candidate_path.parts):
raise UnsafePathError(f"{kind} contains unsafe separator: {candidate!r}")
base_path = Path(base).expanduser().resolve()
output = Path(os.path.normpath(base_path / candidate_path))
if not is_relative_to(output, base_path):
raise UnsafePathError(f"{kind} escapes destination directory: {output}")
return output
def safe_archive_name(*parts: Path | str) -> str:
"""Build a portable relative archive member name."""
raw_parts: list[str] = []
for part in parts:
_reject_absolute_or_drive(part, kind="archive name")
normalized = PurePosixPath(str(part).replace("\\", "/"))
if normalized.is_absolute():
raise UnsafePathError(f"archive name must be relative: {part!r}")
raw_parts.extend(normalized.parts)
if not raw_parts:
raise UnsafePathError("archive name must not be empty")
if any(part in {"", ".", "..", "/"} for part in raw_parts):
raise UnsafePathError(f"archive name contains unsafe component: {'/'.join(raw_parts)!r}")
if any("\\" in part for part in raw_parts):
raise UnsafePathError(f"archive name contains unsafe separator: {'/'.join(raw_parts)!r}")
return PurePosixPath(*raw_parts).as_posix()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |