omp packages

pi-mdc-rules1.1.1

MDC rules extension for pi-coding-agent - loads and enforces rules from Markdown files

mlevif Published 9 months ago MIT ~208 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-mdc-rules

Rules extension for pi-coding-agent.

Loads rules from .agents/rules/*.md and applies them based on frontmatter.

Install

npm install pi-mdc-rules

Usage

pi --extension pi-mdc-rules

Rules are re-read from disk on every turn, so changes are picked up immediately.

Commands

/mdc

Create a new rule interactively with AI assistance. Run /mdc inside pi and it will ask:

  1. What the rule should enforce
  2. Which trigger type to use
  3. Which files to match (if glob)
  4. A name for the rule file

The AI then generates and writes the rule to .agents/rules/<name>.md.

Writing rules

Rules are Markdown files in .agents/rules/ with a YAML frontmatter block. The trigger field controls when the rule is applied.

trigger: always_on

Injected into the system prompt on every turn.

---
trigger: always_on
---

Always use TypeScript strict mode. Never use `any`.

trigger: glob

Blocks read/write/edit on matching files until the agent has read the rule. Use globs to specify which files trigger it.

---
trigger: glob
globs: "*.py"
description: Python file conventions
---

Add an author comment at the top of every Python file. If you don't know the author, ask the user.

globs accepts a single pattern, a comma-separated list, or a YAML array:

globs: "*.ts, *.tsx"
globs:
  - "*.ts"
  - "*.tsx"

trigger: model_decision

Listed in the system prompt as available guidance. The agent reads it on demand when relevant.

---
trigger: model_decision
description: Guidelines for writing database migrations
---

All migrations must be reversible. Include both `up` and `down` steps...