Skip to content

Repository files navigation

/codify

Claude Code SkillLicense: MITGitHub starsGitHub last commit

Refactor any Claude Code skill by extracting deterministic operations into a Python script.

Every time a skill runs, the AI re-reads hundreds of lines of prose to re-derive mechanical operations: "does this file exist?", "run this regex", "copy with timestamp". This is wasteful. codify splits skills into two parts: code for mechanics, prompts for judgment.

Install

curl -fsSL https://raw.githubusercontent.com/anombyte93/codify/main/install.sh | bash

Installs to ~/.claude/skills/codify/. Run the same command to upgrade.

# Check for updates
bash ~/.claude/skills/codify/install.sh --check-update

Usage

/codify <skill-name>

Where <skill-name> is the directory name under ~/.claude/skills/.

How It Works

Phase 1: Analyze

Reads the skill's SKILL.md and classifies every block:

CategoryGoes toExamples
Deterministicscript.pyFile existence checks, regex validation, math, template loading, file copying, JSON parsing
JudgmentSKILL.mdUser questions, decisions, content generation, quality assessment, continuation logic

Phase 2: Build script.py

Creates a Python script with argparse subcommands. Every subcommand:

  • Does one thing well
  • Outputs JSON to stdout
  • Responds to --help
  • Uses stdlib only (no dependencies)

Phase 3: Rewrite SKILL.md

Replaces deterministic prose with script calls:

# Before (in SKILL.md)
Check if .taskmaster/ exists. If it does, look for PRD files
in .taskmaster/docs/. Read tasks.json to count tasks...
(~40 lines of detection logic)
# After (in SKILL.md)
python3 script.py preflight
# Returns JSON: has_taskmaster, prd_path, task_count, ...

Phase 4: Test & Backup

  • Runs --help on every subcommand
  • Runs read-only commands to verify JSON output
  • Saves original as SKILL.md.pre-codify

Real Results

SkillSKILL.md BeforeSKILL.md AfterReductionscript.py
prd-taskmaster1,342 lines302 lines77.5%1,079 lines (11 subcommands)
start637 lines204 lines68.0%320 lines (9 subcommands)

Architecture

script.py = AI's calculator and file manager (deterministic tools)
SKILL.md = AI's playbook for user interaction and decisions (judgment)

The AI calls script.py like any other tool. Script returns structured JSON. AI interprets the results and makes decisions. Neither replaces the other.

Requirements

License

MIT - see LICENSE


Built by Atlas AI

About

Refactor any Claude Code skill by extracting deterministic operations into a Python script. Reduces SKILL.md size by 60-80% while preserving all AI judgment.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages