一键导入
codify
// Refactor any skill by extracting deterministic operations into a Python script and slimming the SKILL.md to only AI judgment parts. Use when user says /codify, codify a skill, or optimize a skill.
// Refactor any skill by extracting deterministic operations into a Python script and slimming the SKILL.md to only AI judgment parts. Use when user says /codify, codify a skill, or optimize a skill.
Log an accomplishment to Daily_Accomplishments and session-context. Use when the user wants to record a win, milestone, or personal achievement.
Smart PRD generator with TaskMaster integration. Detects existing PRDs and offers execute/update/replace options. Generates comprehensive technical PRDs optimized for task breakdown, validates with 13 automated checks, and optionally executes tasks autonomously with datetime tracking and rollback support. Use when user requests "PRD", "product requirements", or mentions task-driven development. Defaults to PRD generation with handoff to TaskMaster. Optionally supports autonomous execution with 4 modes.
Use when writing ANY implementation code, fixing bugs, or modifying existing code. Delegates research to a fast subagent that distills WebSearch results into compact RAG-efficient summaries. Main context never sees raw output.
Session initialization and lifecycle management: bootstraps session context, organizes files, generates CLAUDE.md, manages soul purpose lifecycle with completion protocol and active context harvesting. Use when user says /start, /init, bootstrap session, initialize session, or organize project.
| name | codify |
| description | Refactor any skill by extracting deterministic operations into a Python script and slimming the SKILL.md to only AI judgment parts. Use when user says /codify, codify a skill, or optimize a skill. |
| user-invocable | true |
| allowed-tools | ["Read","Write","Edit","Bash","Glob","Grep","AskUserQuestion"] |
/codify <skill-name>— Extract deterministic logic from a skill's SKILL.md into a Python script.
Takes a skill's SKILL.md and splits it into:
<skill-dir>/script.py) — all deterministic operations (file ops, validation, parsing, template copying)/codify <skill-name> — the skill directory name under ~/.claude/skills/. If omitted, list available skills and ask.
~/.claude/skills/<skill-name>/SKILL.mdDETERMINISTIC (goes into script.py):
JUDGMENT (stays in SKILL.md):
SKILL: <name> (<line-count> lines)
DETERMINISTIC operations found:
- <description of each operation that will become a script subcommand>
JUDGMENT operations (staying in SKILL.md):
- <description of each AI reasoning block>
Proposed script subcommands:
- <subcommand-name>: <what it does>
- <subcommand-name>: <what it does>
Ask user to approve or adjust before proceeding.
Create ~/.claude/skills/<skill-name>/script.py following these rules:
Script Architecture:
_out(data) helper--help for every subcommandchmod +x)#!/usr/bin/env python3Subcommand Design:
--flag (not positional){"status": "ok", ...} on success{"status": "error", "message": "..."} and exit(1) on failureCode Quality:
Rewrite the SKILL.md keeping:
Replace with script calls:
Preserve and update frontmatter:
name, description, user-invocable unchangedallowed-tools if missing — list tools the skill actually uses (Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, etc.)description if the workflow changed significantlyAdd a Script Reference table at the bottom:
## Script Reference
All commands output JSON. Run from skill directory.
| Command | Purpose |
|---------|---------|
| `subcommand-1 --flag` | What it does |
| `subcommand-2 --flag` | What it does |
Target: Reduce SKILL.md by 50-70% while preserving all behavior.
Run each script subcommand with --help to verify it parses.
Run preflight or equivalent read-only command against the current project to verify JSON output.
Report results.
Before overwriting SKILL.md, save original as SKILL.md.pre-codify.
/codify start
Result: The transformation we just did — 637-line SKILL.md with 7 Agent Ref sections became 204-line SKILL.md + 320-line session-init.py script with 9 subcommands.