-
-
Notifications
You must be signed in to change notification settings - Fork 6
CLAUDE_Templates
The CLAUDE.md file is the heart of your project's AI instructions. ClaudeAutoPM uses a sophisticated template system to generate customized CLAUDE.md files based on your project's configuration and needs.
The template system consists of:
- Base Template: Core instructions present in all configurations
- Add-on Modules: Feature-specific instructions added based on configuration
- Configuration Templates: Preset combinations for common scenarios
- Strategy Templates: Execution strategy definitions
autopm/.claude/templates/
├── claude-templates/ # CLAUDE.md components
│ ├── base.md # Base template
│ └── addons/ # Feature-specific add-ons
│ ├── azure-devops.md
│ ├── devops-agents.md
│ ├── devops-workflow.md
│ ├── docker-agents.md
│ ├── docker-workflow.md
│ ├── git-safety.md
│ ├── github-actions.md
│ ├── gitlab-ci.md
│ ├── jenkins.md
│ ├── minimal-agents.md
│ ├── minimal-workflow.md
│ └── no-cicd.md
├── config-templates/ # Configuration presets
│ ├── minimal.json
│ ├── docker-only.json
│ ├── full-devops.json
│ └── performance.json
└── strategies-templates/ # Execution strategies
├── sequential-safe.md
├── adaptive-smart.md
└── hybrid-parallel.md
The base.md template contains core instructions that apply to all projects:
# Project: {PROJECT_NAME}
You are an AI assistant helping with the {PROJECT_NAME} project.
## Core Guidelines
- Follow Test-Driven Development (TDD)
- Maintain code quality and documentation
- Use semantic commit messages
- Ensure security best practices
## Available Resources
- Agents: .claude/agents/
- Commands: .claude/commands/
- Rules: .claude/rules/
- Scripts: .claude/scripts/When Docker is enabled, docker-workflow.md is included:
## Docker-First Development
All development MUST happen inside Docker containers:
- Use docker-compose for local development
- Commands like npm, pip, gem run in containers
- Database operations through containerized services
Example:
- ❌ npm install express
- ✅ docker-compose run app npm install expressFor DevOps-enabled projects, devops-agents.md adds:
## DevOps Agents
You have access to specialized DevOps agents:
- @docker-containerization-expert
- @kubernetes-orchestrator
- @github-operations-specialist
- @azure-devops-specialistWhen Azure DevOps is configured, azure-devops.md includes:
## Azure DevOps Integration
Work items are managed in Azure DevOps:
- Use /pm:issue:show to view work items
- Use /pm:issue:start to begin work
- Use /pm:pr:create for pull requestsminimal.json generates a basic CLAUDE.md:
{
"includes": ["base.md", "minimal-agents.md", "minimal-workflow.md"],
"execution_strategy": "sequential-safe",
"features": {
"docker": false,
"kubernetes": false,
"parallel": false
}
}docker-only.json for containerized development:
{
"includes": ["base.md", "docker-workflow.md", "docker-agents.md"],
"execution_strategy": "adaptive-smart",
"features": {
"docker": true,
"kubernetes": false,
"parallel": true
}
}full-devops.json enables all features:
{
"includes": [
"base.md",
"docker-workflow.md",
"devops-workflow.md",
"docker-agents.md",
"devops-agents.md",
"github-actions.md",
"azure-devops.md"
],
"execution_strategy": "adaptive-smart",
"features": {
"docker": true,
"kubernetes": true,
"parallel": true,
"auto_pr": true
}
}During installation, users choose a configuration:
Select your installation scenario:
1) Minimal
2) Docker-only
3) Full DevOps
4) Performance
5) CustomThe installer assembles the CLAUDE.md:
# Load base template
content=$(cat base.md)
# Add selected add-ons
if [[ "$DOCKER_ENABLED" == "true" ]]; then
content+=$(cat addons/docker-workflow.md)
fi
# Replace variables
content=${content//\{PROJECT_NAME\}/$project_name}
content=${content//\{EXECUTION_STRATEGY\}/$strategy}Templates use placeholders replaced during generation:
| Placeholder | Replaced With |
|---|---|
{PROJECT_NAME} |
Your project name |
{GITHUB_OWNER} |
GitHub username/org |
{GITHUB_REPO} |
Repository name |
{EXECUTION_STRATEGY} |
Selected strategy |
{PRIMARY_LANGUAGE} |
Main programming language |
{DOCKER_ENABLED} |
Docker configuration |
The generated CLAUDE.md is placed in your project root.
Create a new add-on in .claude/templates/claude-templates/addons/:
# custom-feature.md
## My Custom Feature
Special instructions for my feature:
- Custom rule 1
- Custom rule 2Edit the base template for project-wide changes:
# Edit base template
nano autopm/.claude/templates/claude-templates/base.md
# Regenerate CLAUDE.md
autopm mergeAdd a new configuration preset:
// custom-preset.json
{
"name": "Custom Configuration",
"includes": [
"base.md",
"custom-feature.md"
],
"execution_strategy": "adaptive-smart",
"features": {
"custom_feature": true
}
}If you have an existing CLAUDE.md:
autopm merge
# Generates merge instructions for AI:
# 1. Preserves your customizations
# 2. Adds framework features
# 3. Resolves conflicts intelligentlyThe merge helper creates sections:
<!-- FRAMEWORK START -->
Framework-provided instructions
<!-- FRAMEWORK END -->
<!-- CUSTOM START -->
Your custom instructions
<!-- CUSTOM END -->For simple projects:
## Execution Strategy: Sequential
- Agents execute one at a time
- Safe for beginners
- Predictable behavior
- No resource conflictsFor most projects:
## Execution Strategy: Adaptive
- Intelligent parallelization
- Automatic dependency detection
- Optimal performance
- Resource-aware schedulingFor power users:
## Execution Strategy: Hybrid
- Maximum parallelization
- Aggressive optimization
- Requires powerful hardware
- Expert-level controlConfiguration chosen: Docker-only
Generated CLAUDE.md includes:
- Base instructions
- Docker workflow rules
- React-specific agents
- Container-based testing
Configuration chosen: Full DevOps
Generated CLAUDE.md includes:
- Base instructions
- Docker + Kubernetes workflows
- Python backend agents
- CI/CD pipeline instructions
- Azure DevOps integration
Configuration chosen: Minimal
Generated CLAUDE.md includes:
- Base instructions only
- Sequential execution
- Basic agents
- No containerization
| Variable | Description | Example |
|---|---|---|
PROJECT_NAME |
Project name | "my-app" |
PROJECT_TYPE |
Project type | "web", "api", "cli" |
PRIMARY_LANGUAGE |
Main language | "python", "javascript" |
FRAMEWORK |
Framework used | "react", "django", "express" |
DATABASE |
Database type | "postgresql", "mongodb" |
CLOUD_PROVIDER |
Cloud platform | "aws", "azure", "gcp" |
CI_CD_PLATFORM |
CI/CD system | "github", "azure-devops" |
- Start Simple: Begin with minimal configuration
- Iterative Enhancement: Add features as needed
- Version Control: Track CLAUDE.md changes in git
- Team Alignment: Ensure team uses same configuration
- Regular Updates: Regenerate after framework updates
# Check template exists
ls autopm/.claude/templates/claude-templates/
# Reinstall if missing
autopm install --repair# Check for typos in placeholders
grep '{.*}' CLAUDE.md
# Manually replace if needed
sed -i 's/{PROJECT_NAME}/my-project/g' CLAUDE.md# Backup existing
cp CLAUDE.md CLAUDE.md.backup
# Generate fresh
autopm merge --force
# Compare and merge manually
diff CLAUDE.md.backup CLAUDE.md