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 ๐ง
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
- Install DocuMind in your project
- Commit the configuration files to git
- Team members clone - commands work immediately
- Use natural language or slash commands
- Documentation is generated in
/docs
- 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
- AI assistants read the instruction files (CLAUDE.md, .cursorrules, etc.)
- Commands are recognized through natural language or slash syntax
- DocuMind detection automatically checks for installation and capabilities
- AI orchestrator executes to coordinate dual-purpose generation
- Templates provide structure for both human and AI documentation
- Both documentation types are generated simultaneously
- Navigation updates automatically for both human and AI indexes
- 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"
- ๐ Detection: Claude checks for DocuMind installation
- โก Execution: Runs
ai-orchestrator.js expand authentication
- ๐ Generation: Creates both human and AI documentation
- ๐ 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
- IDE Native: Feels like a natural extension of your development environment
- Zero Install: Works immediately after cloning for all team members
- AI Agnostic: Supports any AI assistant that can read instruction files
- Version Controlled: All configuration is tracked and shareable
- 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.
๐ Links
- GitHub: denniswebb/documind
- Documentation: Full Docs
- Issues: Bug Reports
Making documentation as natural as having a conversation with your AI assistant# Test change to trigger workflow