JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 38
  • Score
    100M100P100Q101029F
  • License MIT

IDE-native documentation system with AI-powered slash commands

Package Exports

  • @dennis-webb/documind
  • @dennis-webb/documind/install.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dennis-webb/documind) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

DocuMind ๐Ÿง 

Test Suite npm version Coverage Node.js License: MIT

IDE-Native Documentation System with Automatic Dual-Purpose Generation

DocuMind transforms how you document your projects by enabling documentation commands directly in your IDE through AI assistants. When you run /document commands, DocuMind automatically generates BOTH human-readable and AI-optimized documentation in one operation, providing comprehensive coverage without additional complexity.

โœจ Features

  • ๐ŸŽฏ Slash Commands: Use /document bootstrap, /document expand [concept], etc.
  • ๐Ÿค– Dual-Purpose Generation: Automatically creates both human and AI documentation
  • ๐Ÿ—ฃ๏ธ Natural Language: "Document the authentication system" โ†’ comprehensive documentation
  • ๐Ÿ”Œ IDE Native: Works with GitHub Copilot, Claude, Cursor, Gemini CLI
  • ๐Ÿ“ฆ Zero Install: Clone repo โ†’ commands work instantly for everyone
  • ๐Ÿ”„ Version Controlled: All configuration tracked in git
  • ๐ŸŽจ Template System: Consistent, professional documentation structure
  • ๐Ÿ”— Smart Linking: Automatic cross-references and navigation
  • โšก AI Orchestration: Seamless coordination between human and AI documentation

๐Ÿš€ Quick Start

Installation

# Install directly from npm (creates .documind/ in the current project)
npx @dennis-webb/documind init

# Or, if you've added DocuMind as a dependency, use the helper script
npm run documind:init

First Use

After installation, try any of these with your AI assistant:

/document bootstrap
/document expand authentication  
/document analyze stripe-integration
"Document the API endpoints"
"Create a getting started guide"
"Update the deployment documentation"

๐Ÿ“‹ Commands

Command Description Output
/document bootstrap Generate complete documentation Human docs in /docs/ + AI docs in /docs/ai/
/document expand [concept] Document specific concepts Dual-purpose concept documentation
/document update [section] Refresh existing docs Updated human + AI versions
/document analyze [integration] Document external services Integration guides (both formats)
/document index Rebuild navigation Updated navigation + AI index
/document search [query] Find documentation Search both human and AI docs

Natural Language Support

DocuMind recognizes these patterns automatically:

  • "Document this component" โ†’ /document expand [component]
  • "Update the setup guide" โ†’ /document update setup-guide
  • "How do we use MongoDB?" โ†’ /document analyze mongodb
  • "Create API documentation" โ†’ /document expand api

๐ŸŽฏ Supported AI Tools

DocuMind works with all major AI coding assistants, automatically orchestrating dual-purpose documentation generation:

GitHub Copilot

  • Reads .github/copilot-instructions.md
  • Automatically executes AI orchestrator for comprehensive generation
  • Presents both human and AI documentation results

Claude (Anthropic)

  • Uses CLAUDE.md instructions for automatic dual-purpose generation
  • Natural language command recognition with orchestrator execution
  • Seamless presentation of comprehensive documentation results

Cursor IDE

  • Integrates via .cursor/rules/documind.mdc with automatic orchestration
  • Also supports .cursorrules format
  • Smart detection and dual-purpose generation

Gemini CLI

  • Configured through GEMINI.md for comprehensive documentation
  • Command pattern recognition with automatic AI orchestration
  • Structured presentation of both documentation types

๐Ÿ“ Project Structure

After installation, DocuMind creates:

your-project/
โ”œโ”€โ”€ .documind/                          # Core system (immutable)
โ”‚   โ”œโ”€โ”€ VERSION                         # Version tracking
โ”‚   โ”œโ”€โ”€ commands.md                     # Command definitions  
โ”‚   โ”œโ”€โ”€ system.md                       # System instructions
โ”‚   โ”œโ”€โ”€ templates/                      # Documentation templates
โ”‚   โ””โ”€โ”€ scripts/                        # Install/update scripts
โ”‚
โ”œโ”€โ”€ .github/copilot-instructions.md     # GitHub Copilot config
โ”œโ”€โ”€ CLAUDE.md                           # Claude instructions
โ”œโ”€โ”€ .cursor/rules/documind.mdc          # Cursor rules
โ”œโ”€โ”€ .cursorrules                        # Legacy Cursor support
โ”œโ”€โ”€ GEMINI.md                           # Gemini CLI instructions
โ”‚
โ””โ”€โ”€ docs/                               # Generated documentation
    โ”œโ”€โ”€ README.md                       # Master index
    โ”œโ”€โ”€ 01-getting-oriented/            # Project overview
    โ”œโ”€โ”€ 02-core-concepts/               # Key concepts
    โ”œโ”€โ”€ 03-integrations/                # External services
    โ”œโ”€โ”€ 04-development/                 # Developer guides
    โ””โ”€โ”€ ai/                             # AI-optimized documentation
        โ”œโ”€โ”€ AI_README.md                # AI master index
        โ””โ”€โ”€ *-ai.md                     # AI-optimized files

๐ŸŽจ Documentation Templates

DocuMind includes professional templates for:

  • Concepts: Core abstractions and patterns
  • Integrations: External service documentation
  • Architecture: System design and structure
  • Getting Started: Setup and onboarding guides
  • API Reference: Complete API documentation

๐Ÿ”„ Workflow Example

  1. Install DocuMind in your project
  2. Commit the configuration files to git
  3. Team members clone - commands work immediately
  4. Use natural language or slash commands
  5. Documentation is generated in /docs
  6. Navigation updates automatically
# Developer A installs
npx @documind/core init
git add . && git commit -m "Add DocuMind documentation system"

# Developer B clones and immediately has access
git clone repo && cd repo
# In IDE with AI: "Document the authentication system"
# โ†’ Full auth documentation generated automatically

๐Ÿง  How It Works

  1. AI assistants read the instruction files (CLAUDE.md, .cursorrules, etc.)
  2. Commands are recognized through natural language or slash syntax
  3. DocuMind detection automatically checks for installation and capabilities
  4. AI orchestrator executes to coordinate dual-purpose generation
  5. Templates provide structure for both human and AI documentation
  6. Both documentation types are generated simultaneously
  7. Navigation updates automatically for both human and AI indexes
  8. Results presented comprehensively showing both documentation types

Automatic Dual-Purpose Generation

When you run /document bootstrap, DocuMind automatically:

  • ๐Ÿ“š Generates human-readable documentation in /docs/
  • ๐Ÿค– Creates AI-optimized documentation in /docs/ai/
  • ๐Ÿ”— Updates navigation and cross-references for both
  • ๐Ÿ“Š Tracks token counts and generation metrics
  • โœ… Presents comprehensive results to the user

This happens transparently - users don't need to understand the dual-purpose nature.

๐Ÿค– AI Integration Features

Automatic Detection and Orchestration

DocuMind includes sophisticated AI integration capabilities:

graph LR
    A[User: /document bootstrap] --> B[AI Agent]
    B --> C[Detect DocuMind]
    C --> D[Execute Orchestrator]
    D --> E[Generate Human Docs]
    D --> F[Generate AI Docs]
    E --> G[Present Results]
    F --> G

Key Components

  • AI Orchestrator (ai-orchestrator.js): Coordinates dual-purpose generation
  • Detection Utility (detect-documind.js): Checks installation and capabilities
  • Enhanced AI Configs: Updated instructions for all major AI tools
  • Workflow Automation: Seamless execution without user intervention

Example AI Interaction

When you ask Claude: "Document the authentication system"

  1. ๐Ÿ” Detection: Claude checks for DocuMind installation
  2. โšก Execution: Runs ai-orchestrator.js expand authentication
  3. ๐Ÿ“š Generation: Creates both human and AI documentation
  4. ๐Ÿ“Š Results:
    โœ… Authentication documentation generated!
    
    ๐Ÿ“š Human Documentation:
    - /docs/02-core-concepts/authentication.md
    
    ๐Ÿค– AI Documentation:
    - /docs/ai/authentication-concept-ai.md (2,850 tokens)
    
    Both versions now available and cross-linked.

Supported Workflows

Workflow Human Output AI Output Use Case
Bootstrap Complete /docs/ structure Full /docs/ai/ with token metrics Project initialization
Expand Concept documentation AI-optimized concept files Feature documentation
Analyze Integration guides Service-specific AI docs External service docs
Update Refreshed human docs Updated AI versions Maintenance
Search Human doc matches AI doc matches with context Content discovery

Fallback Behavior

If DocuMind isn't installed, AI agents automatically:

  • Use their native documentation capabilities
  • Suggest DocuMind installation for enhanced features
  • Maintain full productivity without interruption

๐Ÿ“ฆ Installation Options

GitHub Template

gh repo create my-app --template documind/template

Manual Installation

git clone https://github.com/denniswebb/documind.git
cd documind
node install.js init ../your-project

๐Ÿ”ง Configuration

Environment Detection

DocuMind automatically detects your AI tools and generates appropriate configuration files:

  • Existing .github/ โ†’ GitHub Copilot support
  • Existing .cursor/ โ†’ Cursor IDE support
  • Custom detection logic for other tools

Manual Configuration

You can customize the system by editing:

  • Command definitions in .documind/core/commands.md
  • System behavior in .documind/core/system.md
  • Templates in .documind/templates/

๐Ÿš€ Advanced Usage

Programmatic Usage

// Example usage for local development
const { spawn } = require('child_process');

const documindCli = require.resolve('@dennis-webb/documind/install.js');

function runDocuMind(command, extraArgs = []) {
  return spawn('node', [documindCli, command, ...extraArgs], {
    stdio: 'inherit'
  });
}

runDocuMind('init');
runDocuMind('update');

Custom Commands

Add your own documentation patterns by extending the command definitions:

### /document custom [target]
Your custom documentation command
- Maps to specific templates
- Follows your conventions

๐Ÿ”„ Updates

Keep DocuMind current:

# Update from local development
npx @dennis-webb/documind update
# or, if developing from a cloned copy of this repo
node install.js update

๐Ÿงช Testing

DocuMind includes comprehensive testing with Node.js built-in test runner and GitHub Actions CI/CD.

Running Tests

# Run all tests
npm test

# Run specific test suites
npm run test:integration   # Integration tests only
npm run test:performance   # Performance tests only

# Run tests with coverage
npm run test:coverage

# Validate coverage thresholds
npm run coverage:validate

# Generate coverage reports
npm run coverage:report

Test Structure

tests/
โ”œโ”€โ”€ unit/                  # Unit tests for core functionality
โ”‚   โ”œโ”€โ”€ install.test.js           # Installation script tests
โ”‚   โ”œโ”€โ”€ generate-commands.test.js # Command generation tests
โ”‚   โ”œโ”€โ”€ update.test.js             # Update script tests
โ”‚   โ”œโ”€โ”€ template-processing.test.js # Template system tests
โ”‚   โ””โ”€โ”€ gitignore-operations.test.js # Git integration tests
โ”‚
โ”œโ”€โ”€ integration/          # Integration and end-to-end tests
โ”‚   โ”œโ”€โ”€ fresh-install.test.js      # Fresh installation workflow
โ”‚   โ”œโ”€โ”€ ai-detection.test.js       # AI tool detection tests
โ”‚   โ”œโ”€โ”€ update-workflow.test.js    # Update process tests
โ”‚   โ”œโ”€โ”€ error-handling.test.js     # Error scenario tests
โ”‚   โ”œโ”€โ”€ full-deployment.test.js    # Complete deployment validation
โ”‚   โ””โ”€โ”€ platform-compatibility.test.js # Cross-platform tests
โ”‚
โ”œโ”€โ”€ performance/          # Performance and speed tests
โ”‚   โ””โ”€โ”€ install-speed.test.js      # Installation speed benchmarks
โ”‚
โ””โ”€โ”€ utils/                # Test utilities and helpers
    โ”œโ”€โ”€ test-environment.js        # Test environment setup
    โ”œโ”€โ”€ mock-repo.js               # Mock repository generator
    โ””โ”€โ”€ assertions.js              # Custom test assertions

Coverage Requirements

  • Lines: โ‰ฅ90%
  • Functions: โ‰ฅ90%
  • Branches: โ‰ฅ80%
  • Statements: โ‰ฅ90%

CI/CD Pipeline

Our GitHub Actions workflow tests across:

  • Node.js versions: 16.x, 18.x, 20.x, 21.x
  • Operating system: Ubuntu (latest)
  • Test categories: Unit, integration, performance
  • Quality checks: Linting, security audit, coverage validation

Performance Benchmarks

  • Small projects: <5 seconds installation
  • Medium projects: <15 seconds installation
  • Large projects: <30 seconds installation
  • Updates: <5 seconds

Local Development Testing

# Run tests in watch mode
npm run test:watch

# Test against multiple Node.js versions
npm run test:matrix

# Performance testing
npm run test:performance

# Coverage validation
npm run coverage:validate

๐ŸŽฏ Design Principles

  1. IDE Native: Feels like a natural extension of your development environment
  2. Zero Install: Works immediately after cloning for all team members
  3. AI Agnostic: Supports any AI assistant that can read instruction files
  4. Version Controlled: All configuration is tracked and shareable
  5. Non-Invasive: Integrates with existing workflows without disruption

๐Ÿค Contributing

We welcome contributions! See our Contributing Guide for:

  • How to report bugs
  • How to suggest features
  • Development setup
  • Pull request process

๐Ÿ“„ License

MIT License - see LICENSE for details.


Making documentation as natural as having a conversation with your AI assistant# Test change to trigger workflow