Skip to main content

Claude Code boilerplate generator — scaffolds CLAUDE.md, repo-namespaced skills, settings, hooks, and CI workflows

Project description

klausify

Claude Code boilerplate generator. One command to make any repo Claude Code-ready.

Install

pip install klausify

Requires conventions-cli (installed automatically).

Quick Start

cd your-repo
klausify init

That's it. You'll be prompted for your base branch (auto-detects dev, main, etc.), then klausify generates everything.

What Gets Generated

CLAUDE.md                                      # Repo conventions, project-wide section (via conventions-cli)

.claude/
├── settings.json                              # Tool permissions + deny rules + PreToolUse/PostToolUse hooks
├── hooks/
│   ├── read_injection_guard.py                # Scans Read/WebFetch content for prompt-injection markers
│   └── git_commit_guard.py                    # Runs format + lint when Claude tries to `git commit`
├── rules/
│   └── <glob-stem>.md                         # Path-scoped rule buckets (zero or more, emitted by conventions-cli 1.4+)
└── skills/
    ├── .klausify-version                      # Marker tracking which klausify version generated the skills
    ├── <repo>-review/SKILL.md                 # PR review with parallel sub-agents and repo-specific checks
    ├── <repo>-plan/SKILL.md                   # Multi-phase plan + implement (discovery, parallel architects, review)
    ├── <repo>-debug/SKILL.md                  # Debug an error with root-cause analysis and a failing test
    ├── <repo>-implement/SKILL.md              # Implement a pasted ticket/design with plan-mode investigation
    ├── <repo>-refactor/SKILL.md               # Refactor code while preserving behavior, test-backed
    ├── <repo>-test/SKILL.md                   # Write tests for current changes
    ├── <repo>-fix/SKILL.md                    # Fix lint/format/type errors
    ├── <repo>-pr/SKILL.md                     # Generate a PR description
    ├── <repo>-commit/SKILL.md                 # Generate a commit message
    ├── <repo>-explain/SKILL.md                # Explain code or current diff
    └── <repo>-new-worktree/SKILL.md           # Create a git worktree for a task

.github/
└── PULL_REQUEST_TEMPLATE.md                   # Only if repo doesn't have one

.gitignore                                     # Appends klausify output exclusions

What each piece does

CLAUDE.md — Auto-detected conventions, architecture, commands, and pitfalls for your repo. As of 0.2.0 path-scoped rules are split out into individual files under .claude/rules/<glob-stem>.md (each with paths: frontmatter) so rules apply where they belong instead of as a flat list — CLAUDE.md itself holds the project-wide content. This is what Claude Code reads to understand your project.

settings.json — Auto-detects your stack (Python, Node, Go, Rust, Make) and sets tool permissions. Detects sensitive files (.env, *.pem, credentials*) and adds deny rules so Claude can't read them.

Skills — Each repo gets a set of namespaced skills (<repo>-<skill>) so Claude Code auto-triggers them by description and they don't collide across repos. The bundled set is listed below; the canonical list lives in SKILL_NAMES in src/klausify/skills.py.

Skill What it does Output
<repo>-review Senior-level PR review against your base branch. Small PRs get a single-pass review; larger PRs fan out to parallel sub-agents (correctness, architecture, security, scope, plus an Agentic & Evals lens when the diff touches AI/agent/eval code) with a validation phase that removes false positives REVIEW_OUTPUT.md
<repo>-plan Multi-phase task planning + implementation: discovery → parallel exploration → clarify → parallel architectures → approval → implement → parallel review → summary. The approved plan is written to plan.md and used as a resumable checklist plan.md
<repo>-test Writes tests for current changes matching your repo's test patterns. Covers happy path, edge cases, and error paths without over-mocking
<repo>-fix Fixes all lint, format, and type errors
<repo>-pr Generates a ready-to-paste PR description pr-description.md
<repo>-commit Generates a commit message from staged changes
<repo>-debug Five-phase debug flow: reproduce, diagnose root cause, write a failing test, fix, verify against the full suite
<repo>-implement Implements a pasted ticket or design doc. Uses plan mode to investigate and plan before editing, enforces scope rules, and writes failing tests first for bug fixes
<repo>-refactor Refactors code while preserving behavior exactly. Requires a passing test baseline, runs tests between every incremental step
<repo>-new-worktree Creates a git worktree with a branch named for your task
<repo>-explain Explains code or concept; defaults to explaining the current diff

Git-commit guard — A PreToolUse hook on Bash that watches for git commit invocations. When Claude is about to commit, the guard runs your auto-detected format + lint commands and blocks the commit on any non-zero exit. Project-specific commands are baked into .claude/hooks/git_commit_guard.py at scaffold time.

Read-injection guard — A PreToolUse hook (for Read) and PostToolUse hook (for WebFetch) that scans content for prompt-injection markers (ignore previous instructions, ChatML/Llama control tokens, role-prefix injection, persona reassignment) before Claude consumes it. Local files matching the patterns are blocked; web responses are surfaced back as untrusted-content warnings. Pure-stdlib Python so the repo stays portable. Lives at .claude/hooks/read_injection_guard.py.

PR template — A basic PR template, only created if your repo doesn't already have one (checks root, .github/, and docs/).

.gitignore — Appends pr-description.md, REVIEW_OUTPUT.md, and plan.md so generated outputs don't get committed.

Migrating from 0.1.x

If you ran an earlier version of klausify, you have .claude/commands/*.md files. On the next klausify init (with 0.2.0+) those files — and only the ones klausify itself created (tracked via .claude/commands/.klausify-version) — are removed and replaced with .claude/skills/<repo>-<skill>/SKILL.md. Any commands you wrote yourself are left alone.

If you've already klausified at 0.2.0+ and want to refresh after upgrading klausify itself, use klausify init --force (or the klausify-update skill if you have the plugin installed).

Options

klausify init [OPTIONS]

Options:
  -r, --repo PATH             Target repository (default: current directory)
  -f, --force                 Overwrite existing files
  -b, --base-branch TEXT      Base branch for diffs (default: auto-detect, prompts)
  --skip-enrich               Skip Claude CLI enrichment (faster, no API call)
  --review-template PATH      Use a custom review prompt instead of the default

Custom review template

If your team has a specific review checklist (e.g. domain-specific checks, security requirements), pass it in:

klausify init --review-template path/to/your-review.md

The template will be used as the body of the <repo>-review skill instead of the default. Custom templates are responsible for supplying their own SKILL.md frontmatter.

Individual Commands

You can run each step individually:

klausify checklist              # Regenerate the review skill from CLAUDE.md
klausify skills                 # Regenerate all skills
klausify settings               # Regenerate settings.json
klausify hooks                  # Regenerate hook configs
klausify github                 # Regenerate PR template

All subcommands support --repo, --force, and --base-branch where applicable.

How It Works

  1. Runs conventions discover --claude --init to analyze your codebase and generate CLAUDE.md with path-scoped conventions and architecture sections
  2. Parses CLAUDE.md to extract conventions, commands, and pitfalls (including which file globs each rule applies to)
  3. Injects those into the review skill template so <repo>-review checks repo-specific rules with the right path scope
  4. Detects your stack from marker files (pyproject.toml, package.json, go.mod, etc.)
  5. Sets permissions, deny rules, and hooks based on what it finds
  6. Skips anything that already exists (PR template) unless --force is used

Claude Code Integration

klausify can be used three ways with Claude Code:

As a CLI (simplest)

pip install klausify
klausify init

As a Claude Code Plugin

Add the klausify marketplace, then install the plugin:

/plugin marketplace add steph-dove/klausify
/plugin install klausify@klausify

This gives you two plugin-level skills — klausify-init (scaffold a fresh repo) and klausify-update (refresh generated boilerplate after upgrading klausify) — plus the MCP server. The plugin manifest lives in .claude-plugin/plugin.json and the marketplace entry in .claude-plugin/marketplace.json.

As an MCP Server

Add klausify as an MCP server so Claude can invoke it directly:

pip install klausify[mcp]
claude mcp add --transport stdio klausify -- klausify-mcp

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "klausify": {
      "command": "klausify-mcp",
      "env": { "PYTHONUNBUFFERED": "1" }
    }
  }
}

The MCP server exposes these tools: klausify_init, klausify_checklist, klausify_skills, klausify_settings, klausify_status.

Requirements

Contributing

See CONTRIBUTING.md for contributor guidelines.

License

MIT — see LICENSE for details.

Ownership and Governance

klausify is an open-source project owned and maintained by Dovatech LLC.

Dovatech LLC is a privately held company founded and wholly owned by Stephanie Dover, who is also the original author and lead maintainer of this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klausify-0.2.1.tar.gz (59.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klausify-0.2.1-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file klausify-0.2.1.tar.gz.

File metadata

  • Download URL: klausify-0.2.1.tar.gz
  • Upload date:
  • Size: 59.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for klausify-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a9e7a8cf3112bf62bb132c023b4662d8ab23e665bab4cdd71105c5a2d5580625
MD5 a857e6b2cb46850294684d5f695cce70
BLAKE2b-256 a33198aa91b6427753af79ea76dc27b381f78ee0c74e116e9e853264aabedefa

See more details on using hashes here.

File details

Details for the file klausify-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: klausify-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for klausify-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3602481e3bdeda7ba3c61a3f66cb9c6bed2042c5dbef2b6d2970ce3d28e0de3
MD5 ed243a63c977f31465447f0ba15665b2
BLAKE2b-256 6017caa673447c4c63468ebba8da06965b7771411d49e37469baf95be58dd539

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page