Skip to content

DrLux/claude-code-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Template

Template for senior Python projects with Claude Code configured deterministically. Implements the three-layer system: advisory (CLAUDE.md + rules), deterministic (hooks), and on-demand (skills + commands + agents).

Create a new project from this template

Quick way (1 command):

gh repo create my-new-project --template DrLux/claude-code-template --private --clone
cd my-new-project

From GitHub: click "Use this template" on github.com/DrLux/claude-code-template, then clone the created repo.

Both methods create a repo with a clean history, without template commits.

After creation:

# 1. Customize CLAUDE.md with your project's stack and invariants
# (replace all placeholders [PROJECT NAME], [e.g. FastAPI], etc.)

# 2. Initialize the project context
touch .claudememory       # will be populated by /memory-update
touch CLAUDE.local.md     # personal notes and PR feedback — never commit

# 3. First session: generate the architectural map
/architect

Once per machine (global developer identity):

cp templates/global-memory.md ~/.claude/memory.md
# Edit ~/.claude/memory.md to match your profile

How to use this template (manual setup)

# 1. Clone the template into the new project directory
git clone https://github.com/DrLux/claude-code-template.git my-project
cd my-project

# 2. Remove the template history and initialize your repo
rm -rf .git
git init

# 3. Customize CLAUDE.md with your project's stack and invariants
# (replace all placeholders [PROJECT NAME], [e.g. FastAPI], etc.)

# 4. Copy the global developer identity (once per machine)
cp templates/global-memory.md ~/.claude/memory.md
# Edit ~/.claude/memory.md to match your profile

# 5. Initialize the project context
touch .claudememory       # will be populated by /memory-update
touch CLAUDE.local.md     # personal notes and PR feedback — never commit

# 6. First session: generate the architectural map
/architect

Structure

.
├── .claude/
│   ├── settings.json           — hook configuration
│   ├── hooks/                  — deterministic scripts (linting, tests, security)
│   ├── skills/                 — commands with side effects (commit)
│   ├── commands/               — on-demand commands (architect, pythonic, docstrings)
│   ├── rules/                  — thematic rules loaded automatically
│   └── agents/                 — specialized subprocesses (reviewer, test-writer)
├── templates/
│   └── global-memory.md        — template for ~/.claude/memory.md (global, do not commit)
├── CLAUDE.md                   — project manifest (committed, shared with team)
├── CLAUDE.local.md             — personal notes (gitignored)
├── ARCHITECT.md                — architectural map (generated by /architect)
└── .claudememory               — dynamic project state (gitignored)

Control plane

Layer Files Behavior
Advisory CLAUDE.md, .claude/rules/ Claude reads and interprets
Deterministic .claude/hooks/ Executed automatically, non-bypassable
On-demand .claude/skills/, .claude/commands/ Activated only on explicit invocation

Available commands

Skill/Command Function
/commit Assisted commit with human confirmation (never pushes)
/architect Rescans the repo and regenerates ARCHITECT.md (auto-triggers on ExitPlanMode)
/pythonic Idiomatic Python 3.10+ refactoring
/docstrings Adds Google-style docstrings to public APIs
/memory-update Updates .claudememory with the session state

Active hooks

Hook Trigger Action
SessionStart Session start Loads .claudememory + git log
PreToolUse Every Bash command Blocks destructive patterns
PostToolUse .py file write ruff --fix + mypy
PostToolBatch End of write batch cross-file mypy
ExitPlanMode Plan approval Auto-runs /architect to update architecture map
Stop Session end pytest + ARCHITECT.md update

Global developer identity setup

Copy templates/global-memory.md to ~/.claude/memory.md and customize:

  • Seniority Contract: adapt to your level and domain
  • Technical Philosophy: reflects your preferences
  • Toolchain Standard: modify if you use different stacks

Last updated: 01/06/2026

About

Claude Code template with hooks, skills, rules and agents for Python senior projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages