Code Documentation

Comprehensive documentation of the Claude Code Baseline project structure, scripts, templates, and components.

Project Structure

{{BASELINE_ROOT}}\
โ”œโ”€โ”€ ๐Ÿ“„ README.md                          # Main repository README
โ”œโ”€โ”€ ๐Ÿ“„ CLAUDE.md                          # AI assistant guidance
โ”œโ”€โ”€ ๐Ÿ“„ NEW-PROJECT-SETUP.md               # New project guide
โ”œโ”€โ”€ ๐Ÿ“„ EXISTING-PROJECT-GUIDE.md          # Existing project integration guide
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ baseline_docs/                     # 11 baseline documentation templates
โ”‚   โ”œโ”€โ”€ README.md
โ”‚   โ”œโ”€โ”€ README-USAGE.md
โ”‚   โ”œโ”€โ”€ IMPLEMENTATION-PLAN.md
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md
โ”‚   โ”œโ”€โ”€ API-ENDPOINTS.md
โ”‚   โ”œโ”€โ”€ DATABASE-SCHEMA.md
โ”‚   โ”œโ”€โ”€ USER-GUIDES.md
โ”‚   โ”œโ”€โ”€ TESTING-STRATEGY.md
โ”‚   โ”œโ”€โ”€ DEPLOYMENT.md
โ”‚   โ”œโ”€โ”€ MAINTENANCE.md
โ”‚   โ””โ”€โ”€ TROUBLESHOOTING.md
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ coding-standards/                  # 13 modular coding standards
โ”‚   โ”œโ”€โ”€ README.md                           # Central navigation hub
โ”‚   โ”œโ”€โ”€ 01-pseudo-code-standards.md
โ”‚   โ”œโ”€โ”€ 02-php-standards.md
โ”‚   โ”œโ”€โ”€ 03-javascript-standards.md
โ”‚   โ”œโ”€โ”€ 04-database-standards.md
โ”‚   โ”œโ”€โ”€ 05-api-standards.md
โ”‚   โ”œโ”€โ”€ 06-security-standards.md
โ”‚   โ”œโ”€โ”€ 07-testing-standards.md
โ”‚   โ”œโ”€โ”€ 08-documentation-standards.md
โ”‚   โ”œโ”€โ”€ 09-git-workflow-standards.md
โ”‚   โ”œโ”€โ”€ 10-code-review-standards.md
โ”‚   โ”œโ”€โ”€ 11-deployment-standards.md
โ”‚   โ””โ”€โ”€ 12-performance-standards.md
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ scripts/                           # PowerShell automation scripts
โ”‚   โ”œโ”€โ”€ new-project.ps1                     # Create new projects
โ”‚   โ”œโ”€โ”€ add-baseline-to-existing-project.ps1
โ”‚   โ””โ”€โ”€ backup-project.ps1
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ agents/                            # AI agent templates (8 agents)
โ”‚   โ”œโ”€โ”€ gen-docs.md                         # Documentation generation
โ”‚   โ”œโ”€โ”€ code-review.md                      # Code review agent
โ”‚   โ”œโ”€โ”€ test-generator.md                   # Test generation
โ”‚   โ”œโ”€โ”€ security-audit.md                   # Security auditing
โ”‚   โ”œโ”€โ”€ refactor.md                         # Code refactoring
โ”‚   โ”œโ”€โ”€ api-designer.md                     # API design
โ”‚   โ”œโ”€โ”€ db-optimizer.md                     # Database optimization
โ”‚   โ””โ”€โ”€ troubleshooter.md                   # Problem diagnosis
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ claude_wip/                        # Claude's working directory
โ”‚   โ”œโ”€โ”€ drafts/                             # Work in progress
โ”‚   โ”œโ”€โ”€ analysis/                           # Analysis documents
โ”‚   โ”œโ”€โ”€ scratch/                            # Temporary files
โ”‚   โ””โ”€โ”€ backups/                            # Backup files
โ”‚
โ””โ”€โ”€ ๐Ÿ“ project_docs/                      # HTML documentation site
    โ”œโ”€โ”€ index.html
    โ”œโ”€โ”€ code-documentation.html (this page)
    โ”œโ”€โ”€ changelog.html
    โ”œโ”€โ”€ todo.html
    โ”œโ”€โ”€ how-to-guides.html
    โ”œโ”€โ”€ css/custom.css
    โ””โ”€โ”€ includes/
        โ”œโ”€โ”€ header.html
        โ””โ”€โ”€ footer.html

PowerShell Scripts

new-project.ps1
Create New Projects with Baseline

Automated script to create new projects from the baseline in ~30 seconds. Handles directory creation, file copying, and template variable replacement.

Key Features:
  • Template Variables: Automatically replaces {{PROJECT_NAME}}, {{REPO_PATH}}, etc.
  • Directory Structure: Creates organized docs/, scripts/, tests/ structure
  • Component Selection: Choose which baseline components to include
  • Git Integration: Optional git repository initialization
  • Verification: Validates all files copied successfully
Usage:
.\new-project.ps1 `
    -ProjectName "MyApp" `
    -DestinationPath "[YOUR-PROJECT-PATH]" `
    -CompanyName "ACME Corp" `
    -InitGit
Parameters:
Parameter Required Description
-ProjectName โœ… Yes Name of the new project
-DestinationPath โœ… Yes Where to create the project
-CompanyName โŒ No Company name for templates
-InitGit โŒ No Initialize git repository
-SkipStandards โŒ No Skip copying coding standards
View Full Documentation
add-baseline-to-existing-project.ps1
Safely Add Baseline to Existing Projects

Safely integrate the baseline documentation into existing projects with automatic backups, conflict detection, and guaranteed no-overwrite protection.

Safety Features:
  • ๐Ÿ›ก๏ธ Never Overwrites: Existing files are never touched
  • ๐Ÿ’พ Automatic Backup: Creates timestamped backup before changes
  • ๐Ÿ” Conflict Detection: Reports all conflicts before proceeding
  • ๐Ÿ”„ Automatic Rollback: Reverts on any error
  • ๐Ÿงช Dry-Run Mode: Preview without making changes
  • ๐Ÿ“‹ Detailed Logging: Full report of all actions
Usage:
# Basic usage
.\add-baseline-to-existing-project.ps1 -ProjectPath "[YOUR-PROJECT-PATH]"

# Dry-run (preview only)
.\add-baseline-to-existing-project.ps1 -ProjectPath "[YOUR-PROJECT-PATH]" -DryRun

# Custom conflict resolution
.\add-baseline-to-existing-project.ps1 `
    -ProjectPath "[YOUR-PROJECT-PATH]" `
    -ConflictStrategy "suffix" `
    -BackupStrategy "selective"
Conflict Resolution Strategies:
Strategy Behavior Best For
skip Skip conflicting files (safest) Production projects, first-time integration
suffix Add .baseline suffix to new files When you want both versions
interactive Ask for each conflict Full control over each decision
alternate-directory Place in baseline_proposed/ Review before manual merge
View Full Documentation
backup-project.ps1
Project Backup Utility

Create timestamped backups of your project before major changes.

Usage:
.\backup-project.ps1 -ProjectPath "[YOUR-PROJECT-PATH]" -BackupPath "[YOUR-BACKUP-PATH]"

AI Agent System

The baseline includes 8 specialized AI agent templates designed to work with Claude Code. These agents provide focused assistance for specific development tasks.

Available Agents:
gen-docs.md

Generates comprehensive documentation from code and comments.

code-review.md

Performs thorough code reviews with best practice recommendations.

test-generator.md

Generates unit and integration tests for your code.

security-audit.md

Audits code for security vulnerabilities and OWASP compliance.

refactor.md

Suggests and implements code refactoring improvements.

api-designer.md

Designs RESTful APIs following best practices.

db-optimizer.md

Optimizes database schemas, queries, and indexes.

troubleshooter.md

Diagnoses and resolves common development issues.

Note: Agent templates can be installed to C:\Users\{{USERNAME}}\.claude\agents\ for use across all projects.

Baseline Documentation Templates

11 comprehensive documentation templates covering all aspects of software projects. Each template includes detailed sections, examples, and guidance.

Core Documentation
  • README.md - Project overview and quick start
  • README-USAGE.md - Detailed usage instructions
  • IMPLEMENTATION-PLAN.md - Development roadmap
  • ARCHITECTURE.md - System architecture and design
  • API-ENDPOINTS.md - API documentation
  • DATABASE-SCHEMA.md - Database structure
Operational Documentation
  • USER-GUIDES.md - End-user documentation
  • TESTING-STRATEGY.md - Testing approach
  • DEPLOYMENT.md - Deployment procedures
  • MAINTENANCE.md - Maintenance guidelines
  • TROUBLESHOOTING.md - Common issues and solutions
Template Variables: All templates use variables like {{PROJECT_NAME}} that are automatically replaced when creating new projects.
View All Templates

Coding Standards

13 modular coding standards documents covering best practices for enterprise development. Each standard is compliance-aligned and battle-tested in production environments.

Standards Modules:
  • 01. Pseudo-Code Standards
    Planning and algorithm design
  • 02. PHP Standards
    PHP best practices, PSR compliance
  • 03. JavaScript Standards
    Modern JS/ES6+, frameworks
  • 04. Database Standards
    Schema design, query optimization
  • 05. API Standards
    RESTful design, versioning
  • 06. Security Standards
    OWASP Top 10, secure coding
  • 07. Testing Standards
    Unit, integration, E2E testing
  • 08. Documentation Standards
    Code comments, API docs
  • 09. Git Workflow Standards
    Branching, commits, PRs
  • 10. Code Review Standards
    Review process, checklists
  • 11. Deployment Standards
    CI/CD, release management
  • 12. Performance Standards
    Optimization, monitoring
  • README.md
    Central navigation hub
Modular Design: Each standard is self-contained with cross-references. Use the README.md hub for easy navigation.
View Standards Hub

Claude WIP Convention

Standardized Working Directory for AI Assistants

The claude_wip/ directory is a standardized convention for organizing work-in-progress files, analysis documents, drafts, and temporary files created during AI-assisted development.

Directory Structure:
claude_wip/
โ”œโ”€โ”€ drafts/          # Work in progress documents
โ”œโ”€โ”€ analysis/        # Analysis and planning documents
โ”œโ”€โ”€ scratch/         # Temporary experimental files
โ””โ”€โ”€ backups/         # Backup files and rollback points
Purpose:
  • Organization: Keep AI-generated content separate from production code
  • Consistency: Same structure across all projects
  • Clarity: Easy to identify work-in-progress vs finalized content
  • Safety: Protected directory for experimental changes
Usage Guidelines:
  • All AI drafts and analysis go in claude_wip/
  • Never commit sensitive information to this directory
  • Clean up periodically to remove obsolete files
  • Use descriptive filenames with dates (e.g., api-design-analysis-2025-01-15.md)

Template Variable System

Automated Project Customization

All baseline documentation templates use placeholder variables that are automatically replaced when creating new projects with the PowerShell scripts.

Available Variables:
Variable Description Example Value
{{PROJECT_NAME}} Project name MyApp
{{COMPANY_NAME}} Company or organization name ACME Corporation
{{REPO_PATH}} Full path to repository [YOUR-PROJECT-PATH]
{{CLAUDE_WIP_PATH}} Path to claude_wip directory [YOUR-PROJECT-PATH]\claude_wip
{{DATE}} Current date 2025-01-15
{{YEAR}} Current year 2025
How It Works:
  1. Write documentation templates using {{VARIABLE_NAME}} placeholders
  2. Run new-project.ps1 with your project details
  3. Script automatically replaces all variables with actual values
  4. Get fully customized documentation instantly
Pro Tip: You can add custom variables by modifying the PowerShell scripts or using a configuration file.