Skip to content

Stop writing documentation. Start generating it. Built with ❤️ for developers who hate writing docs but love having them.

License

Notifications You must be signed in to change notification settings

mgiovani/ai-cursor-init

Repository files navigation

🚀 AI Cursor Init

Stop writing documentation. Start generating it.

License: MIT PRs Welcome

The AI-powered documentation framework that lives inside your IDE. Generate Architecture Decision Records, system diagrams, and onboarding guides with simple slash commands. No installations, no setup, no excuses.


What Makes This Special?

🎯 Zero Installation → Copy 1 folder, start documenting
🤖 AI-Powered → Analyzes your code to generate contextual docs
Instant Results → Type /init-docs and watch magic happen
🔄 Always Fresh → Docs that sync with your codebase automatically
🛡️ Security First → Static analysis by default, no code execution

🎬 See It In Action

# In Cursor IDE (Chat with Agent Mode), just type:
/init-docs          # 📚 Scaffold complete documentation

Result: Professional documentation that would take hours to write, generated in seconds.

📸 Visual Showcase

🏗️ System Architecture Documentation

Auto-generated architecture overview with intelligent component mapping:

System Architecture Example

🚀 Onboarding Guide Generation

Context-aware onboarding documentation tailored to your project:

Onboarding Doc Example

📋 Advanced Onboarding Features

Comprehensive setup guides with framework-specific instructions:

Onboarding Doc Example 2

🗂️ Data Model Generation

Professional ER diagrams and database schema documentation:

Data Model Generation


🎯 See Real Examples (Framework Generated Its Own Docs!)

Want to see the quality? This project uses its own framework! Check out the docs/ folder to see:

Every single document was generated by the framework itself - that's the power of AI-driven documentation! 🤖✨


🚀 Quick Start (2 minutes to awesome docs)

Zero Configuration (Recommended)

# 1. Clone this repo
git clone https://github.com/mgiovani/ai-cursor-init.git

# 2. Copy to your project (ONLY ONE FOLDER!)
cp -r ai-cursor-init/.cursor/ your-project/

# 3. Open your project in Cursor and type:
/init-docs

That's it! The framework analyzes your project and generates all useful documentation automatically:

  • Always: Architecture overview, onboarding guide, ADRs
  • If database models found: ER diagrams, database operations guide
  • If API endpoints found: API documentation, security flows
  • If deployment configs found: Infrastructure and deployment docs
  • If open source/team project: Contributing guidelines, RFC templates

Opt-Out Configuration (Optional)

Don't want certain documentation? Create .cursor-init.yaml to disable specific types:

# .cursor-init.yaml (optional - only to disable unwanted docs)
documentation:
  data:
    database_ops: false     # Skip database operations guide
  infrastructure:
    deployment: false       # Skip deployment documentation
    security: false         # Skip security flow diagrams
  development:
    rfc: false             # Skip RFC template setup

🎯 What You Get

Command What It Does AI Enhancement Time Saved
/init-docs Complete documentation scaffold Context-aware generation 2-3 hours
/adr "Decision" Architecture Decision Record Project-specific insights 30-45 min
/gen-er-diagram Database schema visualization Auto-detection & relationships 1-2 hours
/gen-arch-diagram System architecture diagram Intelligent component mapping 1-2 hours
/update-docs Sync docs with code changes Smart content enhancement 30-60 min
/check-docs Quality validation & freshness Semantic analysis 15-30 min

Total time saved per project: 6-10 hours


🏗️ Generated Documentation Structure

docs/
├── 📋 architecture.md          # System overview & components
├── 🚀 onboarding.md           # Setup guide for new developers  
├── 🗂️ data-model.md           # ER diagrams & database schema
├── adr/                       # Architecture Decision Records
│   ├── 0001-record-architecture-decisions.md
│   ├── 0002-choose-database-technology.md
│   └── 0003-api-authentication-strategy.md
└── rfc/                       # Request for Comments
    ├── new-feature-proposal.md
    └── api-versioning-strategy.md

Every file is:

  • Contextual - Generated from your actual code
  • Professional - Follows industry best practices
  • Maintainable - Updates automatically with code changes
  • Version Controlled - Markdown files alongside your code

📋 Available Commands

Core Documentation

  • /init-docs - Set up complete documentation structure
  • /update-docs - Refresh documentation with code changes
  • /check-docs - Validate documentation quality

Architecture Decision Records

  • /adr "Decision Title" - Create new ADR with context
  • /rfc "RFC Title" - Create new Request for Comments document
  • Example: /adr "Choose Database Technology"

Diagram Generation

  • /gen-er-diagram - Database schema diagrams
  • /gen-arch-diagram - System architecture diagrams
  • /gen-onboarding-diagram - Setup flow diagrams
  • /gen-dependency-diagram - External service diagrams
  • /gen-security-diagram - Security flow diagrams
  • /gen-deployment-diagram - Infrastructure diagrams

Template Management

  • /add-template TemplateName path/to/template.md - Add custom template
  • /list-templates - Show available templates

Maintenance

  • /sync-docs - Sync all documentation
  • /sync-doc filename.md - Sync specific document
  • /sync-category category - Sync specific category (adr, architecture, etc.)

🎨 Smart Templates & Auto-Detection

Zero-Config Defaults

Works immediately with smart detection:

  • Web APIs → API-focused architecture docs
  • Frontend Applications → Component-based system diagrams
  • Database Models → Detailed ER diagrams with relationships
  • Any Framework → Framework-appropriate documentation

Template Variants

  • ADRs: Nygard, MADR, Comprehensive, Lightweight
  • Architecture: Google Style, Enterprise, Arc42
  • Onboarding: Developer, Contributor, User
  • Data Model: Simple, Comprehensive

Optional Configuration

Choose exactly what documentation you need:

# .cursor-init.yaml (optional customization)
documentation:
  core:
    architecture: true    # System overview
    onboarding: true     # Developer setup guide
    adr: true           # Architecture decisions
  data:
    data_model: true    # Database schema
    database_ops: false # Performance & operations
    data_security: false # Security policies
  infrastructure:
    deployment: false   # CI/CD & infrastructure
    dependencies: false # External services
    security: false    # Security flows
  development:
    rfc: false         # Request for Comments
    contributing: false # Contribution guides
    api_docs: false    # API documentation

Common Configurations

Startup/Small Team:

documentation:
  core: { architecture: true, onboarding: true, adr: true }
  data: { data_model: true }
  development: { contributing: true }

Enterprise/Large Team:

documentation:
  core: { architecture: true, onboarding: true, adr: true }
  data: { data_model: true, database_ops: true, data_security: true }
  infrastructure: { deployment: true, dependencies: true, security: true }
  development: { rfc: true, contributing: true, api_docs: true }

🛡️ Security & Trust

Safe by Design:

  • 🔒 Static Analysis Only - No code execution by default
  • 🏖️ Sandboxed Operations - Isolated environment for advanced features
  • ⏱️ Resource Limits - Timeouts and memory constraints
  • 🔍 Transparent Operations - See exactly what's being analyzed

Enterprise Ready:

  • ✅ MIT Licensed
  • ✅ No external API calls
  • ✅ Works offline
  • ✅ No data collection

🔧 Advanced Features

Custom Templates

/add-template MyTemplate path/to/template.md
/list-templates  # See all available templates

Bulk Operations

/sync-docs          # Update all documentation
/sync-category adr  # Update only ADRs

🤝 Contributing

We're building the future of developer documentation. Join us!

Quick Contribution Ideas

  • 📝 Add templates for new frameworks (Vue, Angular, Spring Boot)
  • 🎨 Create new documentation styles
  • 🔧 Improve framework detection logic
  • 📚 Write tutorials and examples

📊 Project Stats

  • 🏗️ 21 Built-in Templates across 6 document types
  • 🎯 16 Slash Commands for instant documentation
  • 🔧 Universal Framework Support via AI detection
  • 0 Dependencies for basic functionality
  • 🛡️ 100% Static Analysis for security

📄 License

MIT License - see LICENSE for details.


Star This Repo

If this tool saved you time, give us a star! It helps other developers discover the project.

GitHub stars


Built with ❤️ for developers who hate writing docs but love having them.

About

Stop writing documentation. Start generating it. Built with ❤️ for developers who hate writing docs but love having them.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published