@daitasu/aicontextr
v0.0.2
Published
AI context file generator for MDC and CLAUDE.md files
Downloads
983
Readme
@daitasu/aicontextr
AI context file generator for MDC and CLAUDE.md files
Installation
npm install -g @daitasu/aicontextrUsage
Basic Usage
aicontextr --config ./scripts/config.yamlUsing with npx
npx @daitasu/aicontextr --config ./scripts/config.yamlTry it out
To see the tool in action, check out the working example in the examples/ directory:
cd examples
npx @daitasu/aicontextr --config ./scripts/config.yamlThis will generate sample *.mdc and CLAUDE.md files so you can see exactly how the tool works.
Options
-c, --config <path>: Path to config file (default:scripts/config.yaml)-h, --help: Display help information-V, --version: Display version number
Configuration
Create a YAML configuration file with the following structure:
mdcConfigurations:
- output: ".cursor/rules/frontend.mdc"
sourceDir: "docs/frontend/"
header:
description: "Frontend development rules and architecture guidelines"
globs: "src/**/*.ts,src/**/*.tsx,components/**/*.js"
alwaysApply: false
filePattern: "*.md"
subDirectories:
- "apps/frontend/"
claudeConfigurations:
- output: "CLAUDE.md"
sections:
- title: "Project-wide Common Rules"
sourceDir: "docs/common/"
filePattern: "*.md"
- title: "Database Design"
sourceDir: "docs/data/"
filePattern: "*.md"Configuration Fields
mdcConfigurations
output: Output path for the MDC filesourceDir: Source directory containing markdown filesheader: YAML front matter for the MDC filedescription: Description of the rulesglobs: File patterns to apply rules toalwaysApply: Whether to always apply the rules
filePattern: Pattern to match source files (e.g., "*.md")subDirectories: Optional list of subdirectories to copy the MDC file to
claudeConfigurations
output: Output path for the CLAUDE.md filesections: Array of sections to includetitle: Section titlesourceDir: Source directory for this sectionfilePattern: Pattern to match files in this sectiondescription: Optional description for the section
Features
- Modular Configuration: Separate configurations for MDC and CLAUDE files
- Automatic File Sorting: Files are sorted by numeric prefix (e.g.,
01_,02_) - Sub-directory Support: Automatically copy MDC files to specified subdirectories
- YAML Front Matter: Automatic generation of YAML headers for MDC files
- File Cleaning: Clears existing files before regeneration
File Structure
The tool expects your project to have a structure like:
your-project/
├── scripts/
│ └── config.yaml
├── docs/
│ ├── frontend/
│ │ ├── 01_architecture.md
│ │ └── 02_components.md
│ └── backend/
│ ├── 01_api.md
│ └── 02_database.md
└── .cursor/
└── rules/
├── frontend.mdc
└── backend.mdcRequirements
- Node.js >= 18.0.0
- TypeScript support (for development)
License
MIT
