ContextPillarA VS Code extension that brings structure, hierarchy, and traceability to AI context documents — rules, skills, agent instructions, and specs — used in agentic AI IDEs like Cursor and Windsurf. The ProblemDevelopers using agentic AI IDEs maintain a growing set of markdown-based instruction documents (
The SolutionContextPillar introduces a single source of truth for reusable instructions (called statements) and lets all other documents link to them rather than duplicate them. The plugin indexes all documents, builds a graph of links, detects conflicts, and provides a pre-flight checker before AI tasks. Getting Started1. Create a statements directory
2. Add frontmatter to statement files
3. Link statements from consumer documentsAdd frontmatter to your
Frontmatter SchemaStatement file (
|
| Field | Required | Description |
|---|---|---|
id |
Yes | Unique identifier, kebab-case, must start with stmt- |
type |
Yes | Must be statement |
title |
Yes | Human-readable name |
tags |
No | Array of strings for filtering |
Consumer file (rules, skills, agents, specs)
| Field | Required | Description |
|---|---|---|
type |
Yes | One of: cursor-rule, skill, agent, spec |
title |
No | Human-readable name |
includes |
No | Array of statement IDs this document incorporates |
Document Types
| Type | Location |
|---|---|
| Statement | statements/*.md (local) or .mdlink/statements/*.md (workspace) |
| Cursor Rule | .cursor/rules/*.md |
| Skill | **/SKILL.md |
| Agent | **/AGENTS.md |
| Spec | openspec/**/*.md |
Features
Document Navigator
Opens in the Activity Bar. Shows all indexed documents grouped by type, with includes links and back-references visible as children. Click any item to open the file.
Conflict & Duplication Detection
ContextPillar automatically detects:
- Duplication — body text substantially identical to a statement body (warns to link instead)
- Inline conflict — a consumer's body contradicts one of its linked statements
- Cross-document conflict — two consumers include mutually contradictory statements
- Layer conflict — a local statement contradicts a workspace-level statement
Issues appear in the VS Code Problems panel and as inline diagnostics.
Pre-flight Checker
Run ContextPillar: Open Pre-flight Checker from the Command Palette before starting an AI task. Select the document types that will be active, and ContextPillar shows whether all statements are reachable and flags any active conflicts.
Multi-Root Workspaces
In a workspace with multiple repos, place shared (authoritative) statements in:
workspace/
└── .mdlink/
└── statements/
└── shared-statement.md
Workspace-level statements take precedence over repo-local ones. Conflicts between layers are flagged as errors.
Configuration
Create .mdlink/config.yaml at the workspace root or per-repo root:
statements_dir: statements # default: "statements"
See .mdlink/config.yaml in this repository for a full example.
Commands
| Command | Description |
|---|---|
ContextPillar: Open Pre-flight Checker |
Open the pre-flight context checker |
ContextPillar: Refresh Document Graph |
Manually re-scan all documents |