compile-rules

Compiles an NDJSON error journal into scored, deduplicated project rules and a routing manifest.

1|Updated Aug 6, 2026
One-click install
npx skills add https://github.com/YoLaub/JohnAI --skill compile-rules-yolaub
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compile-rules
Source: https://github.com/YoLaub/JohnAI/tree/main/.claude/skills/compile-rules
Command: npx skills add https://github.com/YoLaub/JohnAI --skill compile-rules-yolaub

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams log recurring incidents in an error journal but never convert them into actionable project rules, so the same mistakes keep happening. This Skill transforms a raw bag.ndjson incident log into a curated set of routing-ready rules with explicit triggers, plus a regenerated routing manifest. ## Core Features & Use Cases - Grouping and scoring: Groups journal entries by exact trigger, merges near-duplicates, and scores groups by severity to decide promotion candidates. - Rule lifecycle management: Promotes qualifying incidents into rules, demotes rules with zero routing hits, archives dormant groups, and elevates rules to global scope only when confirmed in at least two projects. - Manifest regeneration and reporting: Rebuilds the routing MANIFEST from rule frontmatter and reports the recurrence rate as the primary quality metric. - Use Case: After accumulating 20+ entries in your project's error journal, ask for a compilation pass to receive a proposed diff of new rules, demotions, and an updated manifest for review before anything is written. ## Quick Start Ask the assistant to run the compile-rules pass on the project's bag.ndjson error journal and propose updated rules and manifest.

Frequently Asked Questions about compile-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert an error log into reusable project rules?▼

Run a compilation pass over the bag.ndjson journal: entries are grouped by exact trigger, scored by summed severity, and groups scoring 5 or more (or any severity-3 occurrence) become rule candidates. Each promoted rule gets an explicit trigger condition and an action statement of at most six lines.

What format does the error journal need to be in?▼

The journal must be an append-only NDJSON file named bag.ndjson with one JSON object per line containing trigger, symptom, root_cause, fix, severity (1-3), and date fields. The trigger holds the exact technical terms used as the grouping key.

Does the compilation pass modify my rules files automatically?▼

No, the skill only produces a proposed diff. All changes to the rules directory or MANIFEST.md require explicit user validation before being applied, and the pass never triggers automatically without an explicit request.

When does a project rule get promoted to global scope?▼

A rule moves to the global folder only when it has been confirmed independently in at least two different projects. Everything starts local by default, because an incorrect global rule affects every project that routes to it.

Why does the compilation pass stop with too few journal entries?▼

The pass requires at least 20 entries in bag.ndjson before grouping, because smaller volumes do not provide enough signal to distinguish real patterns from noise. Below that threshold it stops and reports the insufficient volume.

How is rule quality measured after compilation?▼

The primary metric is the recurrence rate: the share of logged errors whose trigger was already covered by an existing rule. A recurrence means the rule exists but its trigger does not match the real context, which is more informative than counting rules.