CLI tool for generating codebase documentation and AI agent prompts
npm install @ai-coders/context


The Ultimate MCP for AI Agent Orchestration, Context Engineering, and Spec-Driven Development.
Context engineering for AI now is stupidly simple.
Stop letting LLMs run on autopilot. PREVC is a universal process that improves AI output through 5 simple steps: Planning, Review, Execution, Validation, and Confirmation. Context-oriented. Spec-driven. No guesswork.
Every AI coding tool invented its own way to organize context:
```
.cursor/rules/ # Cursor
.claude/ # Claude Code
.windsurf/rules/ # Windsurf
.github/agents/ # Copilot
.cline/ # Cline
.agent/rules/ # Google Antigravity
.trae/rules/ # Trae AI
AGENTS.md # Codex
Using multiple tools? Enjoy duplicating your rules, agents, and documentation across 8 different formats. Context fragmentation is real.
One .context/ directory. Works everywhere.
``
.context/
├── docs/ # Your documentation (architecture, patterns, decisions)
├── agents/ # Agent playbooks (code-reviewer, feature-developer, etc.)
├── plans/ # Work plans linked to PREVC workflow
└── skills/ # On-demand expertise (commit-message, pr-review, etc.)
Export to any tool.
Write once. Use anywhere. No boilerplate.
Built by AI Coders Academy — Learn AI-assisted development and become a more productive developer.
- AI Coders Academy — Courses and resources for AI-powered coding
- YouTube Channel — Tutorials, demos, and best practices
- Connect with Vini — Creator of @ai-coders/context
LLMs produce better results when they follow a structured process instead of generating code blindly. PREVC ensures:
- Specifications before code — AI understands what to build before building it
- Context awareness — Each phase has the right documentation and agent
- Human checkpoints — Review and validate at each step, not just at the end
- Reproducible quality — Same process, consistent results across projects
`bash`
npx @ai-coders/context
That's it. The wizard detects what needs to be done.
PT-BR Tutorial
https://www.youtube.com/watch?v=5BPrfZAModk
1. Creates documentation — Structured docs from your codebase (architecture, data flow, decisions)
2. Generates agent playbooks — 14 specialized AI agents (code-reviewer, bug-fixer, architect, etc.)
3. Manages workflows — PREVC process with scale detection, gates, and execution history
4. Provides skills — On-demand expertise (commit messages, PR reviews, security audits)
5. Syncs everywhere — Export to Cursor, Claude, Copilot, Windsurf, Cline, Codex, Antigravity, Trae, and more
6. Tracks execution — Step-level tracking with git integration for workflow phases
7. Keeps it updated — Detects code changes and suggests documentation updates
1. Install the MCP
2. Prompt to the agent:
`bash`
init the context`
3. This will setup the context and fill it according the the codebase
4. With the context ready promptbash`
plan [YOUR TASK HERE] using ai-context`
5. After planned, promptbash`
start the workflow
6. That's it!
A universal 5-phase process designed to improve LLM output quality through structured, spec-driven development:
| Phase | Name | Purpose |
|-------|------|---------|
| P | Planning | Define what to build. Gather requirements, write specs, identify scope. No code yet. |
| R | Review | Validate the approach. Architecture decisions, technical design, risk assessment. |
| E | Execution | Build it. Implementation follows the approved specs and design. |
| V | Validation | Verify it works. Tests, QA, code review against original specs. |
| C | Confirmation | Ship it. Documentation, deployment, stakeholder handoff. |
Most AI coding workflows look like this:
``
User: "Add authentication"
AI: generates 500 lines of code
User: "That's not what I wanted..."
PREVC fixes this:
``
P: What type of auth? OAuth, JWT, session? What providers?
R: Here's the architecture. Dependencies: X, Y. Risks: Z. Approve?
E: Implementing approved design...
V: All 15 tests pass. Security audit complete.
C: Deployed. Docs updated. Ready for review.
- User Guide — Complete usage guide
The system automatically detects project scale and adjusts the workflow:
| Scale | Phases | Use Case |
|-------|--------|----------|
| QUICK | E → V | Bug fixes, small tweaks |
| SMALL | P → E → V | Simple features |
| MEDIUM | P → R → E → V | Regular features |
| LARGE | P → R → E → V → C | Complex systems, compliance |
- Node.js 20+
- API key from a supported provider (for AI features)
If you are using throught MCP you don't need to setup an API key from a supported provider, your AI agent will use it's own LLM.
| Provider | Environment Variable |
|----------|---------------------|
| OpenRouter | OPENROUTER_API_KEY |OPENAI_API_KEY
| OpenAI | |ANTHROPIC_API_KEY
| Anthropic | |GOOGLE_API_KEY
| Google | |
This package includes an MCP (Model Context Protocol) server that provides AI coding assistants with powerful tools to analyze and document your codebase.
Use the new MCP Install command to automatically configure the MCP server:
`bash`
npx @ai-coders/context mcp:install
This interactive command:
- Detects installed AI tools on your system
- Configures ai-context MCP server in each tool
- Supports global (home directory) and local (project directory) installation
- Merges with existing MCP configurations without overwriting
- Includes dry-run mode to preview changes
- Works with Claude Code, Cursor, Windsurf, Cline, Continue.dev, and more
Alternatively, manually configure for your preferred tool.
#### 1. Access Raw Config
The visual interface only shows official partners, but the manual editing mode allows any local or remote executable.
1. Open the Agent panel (usually in the sidebar or Ctrl+L)....
2. Click the options menu (three dots ) or the settings icon.
3. Select Manage MCP Servers.
4. At the top of this screen, look for a discreet button or link named "View raw config" or "Edit JSON".
> Note: If you cannot find the button in the UI, you can navigate directly through the file explorer and look for .idx/mcp.json or mcp_config.json in your workspace root.
#### 2. Add Custom Server
You will see a JSON file. You must add a new entry inside the "mcpServers" object.
Here is the template to add a server (example using npx for a Node.js server or a local executable):
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
#### 3. Restart the Connection
After saving the mcp.json file:
1. Return to the "Manage MCP Servers" panel.
2. Click the Refresh button or restart the Antigravity environment (Reload Window).
3. The new server should appear in the list with a status indicator (usually a green light if connected successfully).
Add the MCP server using the Claude CLI:
`bash`
claude mcp add ai-context -- npx @ai-coders/context mcp
Or configure manually in ~/.claude.json:
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows):
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
Create .cursor/mcp.json in your project root:
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
Add to your Windsurf MCP config (~/.codeium/windsurf/mcp_config.json):
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
Add to your Zed settings (~/.config/zed/settings.json):
`json`
{
"context_servers": {
"ai-context": {
"command": {
"path": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
}
Configure in Cline settings (VS Code → Settings → Cline → MCP Servers):
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
Add to your Codex CLI config (~/.codex/config.toml):
`toml`
[mcp_servers.ai-context]
command = "npx"
args = ["--yes", "@ai-coders/context@latest", "mcp"]
Add to your Antigravity MCP config (~/.gemini/mcp_config.json):
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
Add to your Trae AI MCP config (Settings > MCP Servers):
`json`
{
"mcpServers": {
"ai-context": {
"command": "npx",
"args": ["@ai-coders/context", "mcp"]
}
}
}
For local development, point directly to the built distribution:
`json`
{
"mcpServers": {
"ai-context-dev": {
"command": "node",
"args": ["/path/to/ai-coders-context/dist/index.js", "mcp"]
}
}
}
Once configured, your AI assistant will have access to 9 gateway tools with action-based dispatching:
#### Gateway Tools (Primary Interface)
| Gateway | Description | Actions |
|---------|-------------|---------|
| explore | File and code exploration | read, list, analyze, search, getStructure |check
| context | Context scaffolding and semantic context | , init, fill, fillSingle, listToFill, getMap, buildSemantic, scaffoldPlan |link
| plan | Plan management and execution tracking | , getLinked, getDetails, getForPhase, updatePhase, recordDecision, updateStep, getStatus, syncMarkdown, commitPhase |discover
| agent | Agent orchestration and discovery | , getInfo, orchestrate, getSequence, getDocs, getPhaseDocs, listTypes |list
| skill | Skill management for on-demand expertise | , getContent, getForPhase, scaffold, export, fill |exportRules
| sync | Import/export synchronization with AI tools | , exportDocs, exportAgents, exportContext, exportSkills, reverseSync, importDocs, importAgents, importSkills |
#### Dedicated Workflow Tools
| Tool | Description |
|------|-------------|
| workflow-init | Initialize a PREVC workflow with scale detection, gates, and autonomous mode |
| workflow-status | Get current workflow status, phases, and execution history |
| workflow-advance | Advance to the next PREVC phase with gate checking |
| workflow-manage | Manage handoffs, collaboration, documents, gates, and approvals |
#### Key Features in v0.7.0
- Gateway Pattern: Simplified, action-based tools reduce cognitive load
- Plan Execution Tracking: Step-level tracking with updateStep, getStatus, syncMarkdown actionscommitPhase
- Git Integration: action for creating commits on phase completion.context/workflow/actions.jsonl
- Q&A & Pattern Detection: Automatic Q&A generation and functional pattern analysis
- Execution History: Comprehensive logging of all workflow actions to
- Workflow Gates: Phase transition gates based on project scale with approval requirements
- Export/Import Tools: Granular control over docs, agents, and skills sync with merge strategies
Skills are task-specific procedures that AI agents activate when needed:
| Skill | Description | Phases |
|-------|-------------|--------|
| commit-message | Generate conventional commits | E, C |pr-review
| | Review PRs against standards | R, V |code-review
| | Code quality review | R, V |test-generation
| | Generate test cases | E, V |documentation
| | Generate/update docs | P, C |refactoring
| | Safe refactoring steps | E |bug-investigation
| | Bug investigation flow | E, V |feature-breakdown
| | Break features into tasks | P |api-design
| | Design RESTful APIs | P, R |security-audit
| | Security review checklist | R, V |
`bash`
npx @ai-coders/context skill init # Initialize skills
npx @ai-coders/context skill fill # Fill skills with AI (project-specific content)
npx @ai-coders/context skill list # List available skills
npx @ai-coders/context skill export # Export to AI tools
npx @ai-coders/context skill create my-skill # Create custom skill
The orchestration system maps tasks to specialized agents:
| Agent | Focus |
|-------|-------|
| architect-specialist | System architecture and patterns |feature-developer
| | New feature implementation |bug-fixer
| | Bug identification and fixes |test-writer
| | Test suites and coverage |code-reviewer
| | Code quality and best practices |security-auditor
| | Security vulnerabilities |performance-optimizer
| | Performance bottlenecks |documentation-writer
| | Technical documentation |backend-specialist
| | Server-side logic and APIs |frontend-specialist
| | User interfaces |database-specialist
| | Database solutions |devops-specialist
| | CI/CD and deployment |mobile-specialist
| | Mobile applications |refactoring-specialist` | Code structure improvements |
|
MIT © Vinícius Lana