How-To Guides

Step-by-step instructions for using the Claude Code Baseline effectively. Learn how to create projects, integrate baseline, and leverage AI agents.

Creating New Projects

Use the new-project.ps1 script to create a fully-structured project with baseline documentation in under 30 seconds.

Prerequisites
  • Windows PowerShell 5.1 or PowerShell 7+
  • Git (optional, for repository initialization)
  • Text editor (VS Code recommended)
Step-by-Step Instructions
1 Navigate to Baseline Directory
cd {{BASELINE_ROOT}}
2 Run the Script
.\new-project.ps1 `
    -ProjectName "MyAwesomeApp" `
    -DestinationPath "{{PROJECT_PATH}}"
3 Add Optional Parameters (if needed)
.\new-project.ps1 `
    -ProjectName "MyAwesomeApp" `
    -DestinationPath "{{PROJECT_PATH}}" `
    -CompanyName "ACME Corporation" `
    -InitGit `
    -Verbose

-CompanyName replaces {{COMPANY_NAME}} in templates
-InitGit creates a git repository
-Verbose shows detailed output

4 Review Output

The script will:

  • Create directory structure
  • Copy baseline documentation
  • Copy coding standards
  • Replace template variables
  • Create claude_wip/ directory
  • Initialize git (if requested)
  • Verify all files
5 Open Your New Project
cd {{PROJECT_PATH}}
code .
Success! Your project now has complete baseline documentation, coding standards, and a standardized structure ready for development.
Available Parameters
Parameter Required Description Default
-ProjectName Yes Name of your project -
-DestinationPath Yes Where to create the project -
-CompanyName No Your company/organization name "Your Company"
-InitGit No Initialize git repository false
-SkipStandards No Skip copying coding standards false
-Verbose No Show detailed output false
What Gets Created
my-awesome-app/
├── docs/
│   ├── baseline/              # 11 documentation templates
│   └── coding-standards/      # 13 coding standard modules
├── claude_wip/                # AI working directory
│   ├── drafts/
│   ├── analysis/
│   ├── scratch/
│   └── backups/
├── scripts/                   # Empty, ready for your scripts
├── tests/                     # Empty, ready for tests
└── CLAUDE.md                  # AI guidance file

Adding to Existing Projects

Safely integrate the baseline into existing projects without overwriting any files.

Safety First: This script NEVER overwrites existing files and always creates a backup before making changes.
Step-by-Step Instructions
1 Preview Changes (Dry-Run)

Always start with a dry-run to see what would happen:

.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -DryRun

This shows you what would be copied/created without actually doing it.

2 Review Conflicts

The dry-run will report any conflicts:

CONFLICT: [YOUR-PROJECT-PATH]\CLAUDE.md already exists
CONFLICT: [YOUR-PROJECT-PATH]\docs\baseline\README.md already exists

Choose a conflict resolution strategy:
- skip: Skip conflicting files (safest)
- suffix: Add .baseline suffix to new files
- interactive: Ask for each conflict
- alternate-directory: Place in baseline_proposed/
3 Choose Conflict Resolution

Select the strategy that fits your needs:

# Option A: Skip conflicts (safest)
.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -ConflictStrategy "skip"

# Option B: Add suffix to new files
.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -ConflictStrategy "suffix"

# Option C: Interactive prompts
.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -ConflictStrategy "interactive"

# Option D: Alternate directory
.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -ConflictStrategy "alternate-directory"
4 Apply Changes

Run without -DryRun to apply:

.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -ConflictStrategy "skip" `
    -BackupStrategy "selective"
5 Verify Results

Check the output for:

  • Backup location (e.g., .baseline-backup-20250115-143022/)
  • Files copied successfully
  • Conflicts skipped or resolved
  • Rollback instructions (if needed)
Conflict Resolution Strategies
Strategy Behavior Use When
skip Skip files that already exist Production projects, first-time integration, maximum safety
suffix Add .baseline suffix to new files You want both versions for comparison
interactive Prompt for each conflict Small projects, need full control
alternate-directory Place in baseline_proposed/ Review before manually merging
Backup Strategies
Strategy What Gets Backed Up Recommended For
full Entire project (excludes node_modules, vendor, etc.) Small to medium projects
selective Only potentially affected files Large projects, faster backup (default)
git-stash Uses git stash for backup Git projects with no uncommitted changes
Rollback: If something goes wrong, the script automatically rolls back changes. You can also manually restore from the backup directory created.

Using AI Agents

Leverage specialized AI agents for documentation, code review, testing, and more.

What Are AI Agents?

AI agents are pre-configured prompt templates that guide Claude Code to perform specific tasks with domain expertise. Each agent is specialized for a particular development task.

Available Agents
gen-docs

Generates comprehensive documentation from code

code-review

Performs thorough code reviews

test-generator

Generates unit and integration tests

security-audit

Audits code for security vulnerabilities

Installation
1 Copy Agent Templates

Copy agents to Claude Code's agent directory:

# Create agents directory if it doesn't exist
mkdir C:\Users\{{USERNAME}}\.claude\agents -Force

# Copy agent templates
copy {{BASELINE_ROOT}}\agents\*.md C:\Users\{{USERNAME}}\.claude\agents\
2 Verify Installation
dir C:\Users\{{USERNAME}}\.claude\agents

You should see all 8 agent .md files.

Using Agents in Claude Code
1 Invoke an Agent

In Claude Code, type the agent name:

@gen-docs
2 Provide Context

Give the agent the files or code to work with:

@gen-docs Please document the API endpoints in src/api/endpoints.php
3 Review and Refine

The agent will generate output based on its specialization. You can then:

  • Ask for revisions
  • Request different formats
  • Add more context
  • Combine with other agents
Example Use Cases

@gen-docs Generate API documentation for all endpoints in src/api/
Include request/response examples and error codes.

@code-review Review src/controllers/UserController.php
Focus on security, performance, and PSR compliance.

@test-generator Create unit tests for src/utils/Validator.php
Include edge cases and error scenarios.

@security-audit Audit the authentication system in src/auth/
Check for OWASP Top 10 vulnerabilities.
Pro Tip: You can chain multiple agents. For example, use @refactor to improve code, then @test-generator to create tests for the refactored code.

Customizing Coding Standards

Adapt the baseline coding standards to match your team's preferences and requirements.

When to Customize
  • Your team uses different naming conventions
  • Organization has specific compliance requirements
  • Using different frameworks or tools than defaults
  • Need to add language-specific standards
How to Customize
1 Identify the Standard to Modify

Standards are modular - find the one you need:

coding-standards/
├── 01-pseudo-code-standards.md
├── 02-php-standards.md
├── 03-javascript-standards.md
└── ... (13 total)
2 Make a Backup
copy coding-standards\02-php-standards.md coding-standards\02-php-standards.md.backup
3 Edit the Standard

Open in your editor and modify:

code coding-standards\02-php-standards.md
4 Update Cross-References

If you change section names, update references in:

  • coding-standards/README.md (navigation hub)
  • Other standards that reference this one
  • CLAUDE.md if applicable
5 Document Your Changes

Add a note at the top of the modified standard:

# PHP Coding Standards

**Customized for ACME Corporation - Last Updated: 2025-01-15**

**Changes from baseline:**
- Added Symfony-specific guidelines
- Modified namespace conventions
- Added company-specific security requirements
Common Customizations
Area Common Changes File to Edit
Naming Conventions CamelCase vs snake_case preferences 02-php-standards.md, 03-javascript-standards.md
Code Style Indentation, braces, line length Language-specific standards files
Documentation Comment format, required sections 08-documentation-standards.md
Git Workflow Branch naming, commit messages 09-git-workflow-standards.md
Testing Coverage requirements, test structure 07-testing-standards.md
Important: If you customize the baseline repo, document your changes so they can be reapplied when upgrading to newer baseline versions.

Working with Template Variables

Template variables allow baseline documentation to be automatically customized for each project without manual editing.

Available Variables
Variable Description Example Value
{{PROJECT_NAME}} Project name MyAwesomeApp
{{COMPANY_NAME}} Company/organization name ACME Corporation
{{REPO_PATH}} Full path to repository {{PROJECT_PATH}}
{{CLAUDE_WIP_PATH}} Path to claude_wip directory {{PROJECT_PATH}}\claude_wip
{{DATE}} Current date 2025-01-15
{{YEAR}} Current year 2025
How They Work
1 Template Files Contain Variables

Example from README.md:

# {{PROJECT_NAME}}

**Company:** {{COMPANY_NAME}}
**Repository:** {{REPO_PATH}}
**Last Updated:** {{DATE}}
2 Script Replaces Variables

When you run new-project.ps1:

.\new-project.ps1 `
    -ProjectName "MyAwesomeApp" `
    -CompanyName "ACME Corp" `
    -DestinationPath "{{PROJECT_PATH}}"
3 Result is Customized

The created file becomes:

# MyAwesomeApp

**Company:** ACME Corp
**Repository:** {{PROJECT_PATH}}
**Last Updated:** 2025-01-15
Adding Custom Variables
1 Edit the PowerShell Script

Add your variable to new-project.ps1:

# Add parameter
param(
    [string]$ProjectName,
    [string]$Author,  # New parameter
    # ... other params
)

# Add to replacement map
$replacements = @{
    '{{PROJECT_NAME}}' = $ProjectName
    '{{AUTHOR}}' = $Author  # New variable
    # ... other replacements
}
2 Use in Templates

Add to baseline templates:

**Author:** {{AUTHOR}}
**Contact:** {{AUTHOR}}@company.com
3 Use When Creating Projects
.\new-project.ps1 `
    -ProjectName "MyApp" `
    -Author "John Smith" `
    -DestinationPath "[YOUR-PROJECT-PATH]"
Pro Tip: You can also use a configuration file (JSON/YAML) to store common values and avoid typing them every time.

Troubleshooting

Common issues and their solutions.

PowerShell Script Issues
Execution Policy Error

Error: "cannot be loaded because running scripts is disabled"

Solution:

# Check current policy
Get-ExecutionPolicy

# Set to allow scripts (run as Administrator)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Path with Spaces Error

Error: Script fails when path contains spaces

Solution: Use quotes around paths:

.\new-project.ps1 `
    -ProjectName "MyApp" `
    -DestinationPath "[YOUR Projects\myapp"  # Quoted path
Permission Denied

Error: "Access to the path is denied"

Solution:

  • Run PowerShell as Administrator
  • Check folder permissions
  • Ensure destination folder is not open in another program
Template Variable Issues
Variables Not Replaced

Symptom: Created files still contain {{PROJECT_NAME}} etc.

Solutions:

  • Verify you're using the latest script version
  • Check that variable names match exactly (case-sensitive)
  • Use -Verbose flag to see replacement details
Git Issues
Git Init Fails

Error: "git is not recognized"

Solution:

  • Install Git from git-scm.com
  • Add Git to PATH
  • Or omit -InitGit flag
AI Agent Issues
Agent Not Found

Error: "@gen-docs not recognized"

Solution:

  • Verify agents are installed in ~/.claude/agents/
  • Check file extensions are .md
  • Restart Claude Code
Getting Help
Still Having Issues?
  • Check the the troubleshooting section above file
  • Review the -Verbose output from scripts
  • Check the backup directory for clues
  • Open an issue on GitHub