create-evlog-map-rule

Adds coverage rules and framework adapters to the evlog map CLI scanner.

1.8k|61|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/HugoRCD/evlog --skill create-evlog-map-rule
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-evlog-map-rule
Source: https://github.com/HugoRCD/evlog/tree/main/.agents/skills/create-map-rule
Command: npx skills add https://github.com/HugoRCD/evlog --skill create-evlog-map-rule

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Extending the evlog map coverage scanner in @evlog/cli requires coordinated edits across rule source, registry, type unions, tests, docs, published skills, and changesets, and missing any touchpoint breaks the build or leaves the public contract inconsistent.

Core Features & Use Cases

  • Rule Creation Workflow: Guides adding a requirement or opportunity rule through eight touchpoints including rule source, REGISTRY, CheckId union, tests, docs, and changesets.
  • Design Decision Framework: Explains the requirement-versus-opportunity distinction, weight assignment, and gating on project features so rules never fire on perfectly good code.
  • Framework Adapter Variant: Covers the heavier path of teaching evlog map a new framework, from route extraction and detection to sandbox smoke tests.
  • Use Case: A maintainer wants a new coverage check that scores entry points on structured error usage; the Skill walks them through creating the rule file, registering it, writing declarative test cases, updating docs tables, and verifying with lint, typecheck, and the CLI sandbox.

Quick Start

Add a new map rule to @evlog/cli that checks whether entry points use structured errors, following the touchpoints checklist.

Frequently Asked Questions about create-evlog-map-rule

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

FAQPage Schema
How do I add a new rule to evlog map?

Create one exported const satisfying MapRule in packages/cli/src/lib/map/rules/, register it in rules/index.ts, add the id to the CheckId union in types.ts, then add tests, docs rows, and a changeset. The AssertIdsMatch type fails the build if the registry and union drift.

What is the difference between a requirement and an opportunity rule?

Requirements cost weight points when they fail and can fail CI gates like --min-score. Opportunities never affect the score, cannot have a weight, and only appear when the project already uses the feature, gated on project.features or project.pairable.

How do I test an evlog map rule?

Use the declarative Case harness in packages/cli/test/map/rules.test.ts with runRuleSet to exercise one rule in isolation. Cover the gap firing, the compliant pass, n/a boundaries, opportunity gating, suggest() output, and suppression via evlog-map-disable.

Which frameworks does evlog map support?

The scanner ships adapters for Nuxt, Nitro, Next.js, and TanStack Start. Adding a new framework requires an adapter for route extraction, detection logic, fixture tests, docs updates, and sandbox coverage in scripts/cli-sandbox.mjs.

Why does my evlog map rule fail the build after registration?

The AssertIdsMatch type in rules/index.ts fails typecheck when the REGISTRY and the CheckId union in types.ts drift. Add the rule id to both sides, then run pnpm --filter @evlog/cli run typecheck to confirm.