Create a compact frontmatter rule from verbose markdown
Compacts verbose markdown rules into token-efficient frontmatter with critical markers
/plugin marketplace add flexion/claude-domestique/plugin install mantra@claude-domestique<source-file.md>Convert a verbose, human-readable markdown file into a token-efficient frontmatter-only rule file.
If no argument provided, ask the user:
What is the path to the verbose markdown file you want to compact?
Read the source file to understand its content.
Transform the verbose markdown into compact YAML frontmatter:
Conversion Rules:
→ (flow), > (priority), | (alternatives)pattern (example: value)no:, skip:, never:Output Format:
---
# {Title} - Compact Reference
companion: {source-filename}
## {Section Header}
key: value, value, value
another-key: flow → sequence → result
---
After creating the compact version, ask the user:
Are any of these rules CRITICAL - meaning Claude must absolutely follow them without exception?
If yes, describe which rules are critical and why.
When the user identifies critical rules, apply emphasis markers:
Emphasis Levels (use sparingly):
| Marker | Use When | Example |
|---|---|---|
MANDATORY-REREAD: | Must re-read before specific actions | MANDATORY-REREAD: before-commit (use-thinking-block) |
## SECTION (BLOCKING REQUIREMENT) | Entire section is non-negotiable | ## ASSESSMENT (BLOCKING REQUIREMENT) |
required-before: | Must happen before an action | required-before: git-operations, implementation |
must-verify: | Must explicitly check | must-verify: format-requirements |
enforcement: | Trigger conditions | enforcement: if user says X → do Y |
never: | Absolute prohibitions | never: skip-tests, guess-values |
Guidelines for CRITICAL markers:
MANDATORY-REREAD: for top-level blocking behaviors(BLOCKING REQUIREMENT) for section headers onlyenforcement: for if→then trigger rules(use-thinking-block) for verification requirementsPresent the final compact rule file to the user:
.claude/rules/{name}.md/mantra:init --force if updating existing ruleBefore (verbose):
# Code Review Guidelines
When reviewing code, always check for security vulnerabilities first.
This is extremely important and should never be skipped.
## Style Checks
- Check for consistent naming
- Verify imports are organized
- Look for unused variables
After (compact with critical marker):
---
# Code Review - Compact Reference
companion: code-review.md
MANDATORY-REREAD: before-code-review (use-thinking-block)
## SECURITY (BLOCKING REQUIREMENT)
check-first: vulnerabilities (never-skip)
verify: injection, auth, data-exposure
## Style
check: naming-consistency, import-organization, unused-variables
---