Agent skill

evlog Map Rule Creator

by evloghq in evloghq/evlog

Walks through adding a new rule or framework adapter to `evlog map` in @evlog/cli, from the rule source and registry to types, tests, docs and the published skill.

MITAuto-check passedDevelopment

Install evlog Map Rule Creator

skills CLI
$ npx skills add evloghq/evlog --skill create-evlog-map-rule -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install evloghq/evlog create-evlog-map-rule --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/evloghq/evlog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/create-map-rule .claude/skills/create-evlog-map-rule && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
create-evlog-map-rule
GitHub stars
1.9k
Token cost
~2.9k tokens
SKILL.md length
1,173 words
Files
1
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

Walks through adding a new rule or framework adapter to `evlog map` in @evlog/cli, from the rule source and registry to types, tests, docs and the published skill.

  • Works in 5 steps: Rule Source → Tests → and 6: Docs → …
  • Adding a coverage check to evlog map
  • SKILL.md covers PR Title, Requirement or opportunity?…, Touchpoints Checklist (rule) and Step 1: Rule Source, plus 7 more sections
  • Calls pnpm

What it does

The skill covers two extensions to the coverage scanner in @evlog/cli: a rule, which asks a new question of every entry point, and a framework adapter, which teaches the scanner to find entry points in another framework. It starts with a design decision. A requirement costs score points and can fail a CI gate, while an opportunity never affects the score and appears only when the project already uses the related feature.

A touchpoints checklist lists the files to change: the rule file under `packages/cli/src/lib/map/rules/`, the registry in `index.ts`, the `CheckId` union in `types.ts`, test cases in `rules.test.ts` and the rules page in the docs. It also gives the PR title convention using the `cli` scope. Existing requirements such as wide-event, audit and structured-errors are named as reference points.

When your agent uses it

  • Adding a coverage check to evlog map
  • Deciding whether a new check should be a requirement or an opportunity
  • Extending evlog map to find entry points in a new framework

Example prompts

  • “Add an evlog map rule that flags API routes still throwing plain errors.”
  • “Should my new check be an evlog map requirement or an opportunity?”
  • “Write an adapter so evlog map can scan entry points in a Hono app.”

Requirements

  • A checkout of the evlog monorepo

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Rule Source
  2. Tests
  3. and 6: Docs
  4. Published Skill
  5. Changeset

What it can do on your machine

Read from SKILL.md and the folder at commit 59a105f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

evlog Map Rule Creator loads about 2.9k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 1,173 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from evloghq/evlog at commit 59a105f, republished under its MIT licence (© evloghq). 1,173 words, ~2,935 tokens.

Download SKILL.mdSave it as .claude/skills/create-evlog-map-rule/SKILL.md (or your agent's skills folder).
name
create-evlog-map-rule
description
Add a new rule or a new framework adapter to `evlog map` in @evlog/cli. Use when adding a coverage check (requirement or opportunity) that scores entry points, or when extending the map scanner to a new framework. Covers rule source, registry, types, tests, docs, and the published skill.
metadata.internal
true

Create an evlog map Rule (or Framework Adapter)

Extend the coverage scanner in @evlog/cli. Two kinds of extension:

  • A rule: a new question asked of every entry point (packages/cli/src/lib/map/rules/). This is the common case.
  • A framework adapter: teach evlog map to find entry points in a new framework (packages/cli/src/lib/map/adapters/). Rarer and heavier; see the last section.

PR Title

feat(cli): add the {id} map rule

The cli scope already exists, so no scope registration is needed.

Requirement or opportunity? Decide first

This is the design decision everything else follows from (see apps/docs/content/3.cli/3.rules.md for the published contract):

RequirementOpportunity
Effect on the scoreCosts weight points when it failsNone, ever. The type forbids a weight
When it appearsWhenever it appliesOnly when the project already uses the feature (appliesTo.when gated on project.features / project.pairable)
In the reportFIX FIRST / THENGOING FURTHER
Can fail a CI gate (--min-score, --baseline)YesNo

Guiding principle (from error-catalog.ts): a rule that fires on perfectly good code is policing, not helping. Opportunities must be gated on a signal that makes the case on its own (duplication, an installed package used without its evlog integration), never on "you could adopt a feature you don't use".

Current requirements: wide-event (40), audit (25), structured-errors (20), page-error-handling (20), context (15), error-handling (15). Current opportunities: error-catalog, audit-coverage, ai-logging, auth-identity.

Touchpoints Checklist (rule)

#FileAction
1packages/cli/src/lib/map/rules/{id}.tsCreate the rule (one exported const)
2packages/cli/src/lib/map/rules/index.tsImport + one line in REGISTRY
3packages/cli/src/lib/map/types.tsAdd the id to the CheckId union (a type assert in index.ts fails the build if the registry and union drift)
4packages/cli/test/map/rules.test.tsAdd cases (the file has an ESLint-RuleTester-style Case harness (runRuleSet exercises one rule in isolation))
5apps/docs/content/3.cli/3.rules.mdAdd a row to the Requirements or Opportunities table + a ### {title} section
6apps/docs/content/3.cli/4.scoring.mdRequirements only: reflect the new weight in the scoring explanation
7skills/review-logging-patterns/references/code-review.mdAdd a row to the matching rules table
8.changeset/{id}-map-rule.mdChangeset for "@evlog/cli": minor

Important: Do NOT consider the task complete until all applicable touchpoints have been addressed.

Step 1: Rule Source

One file, one exported const satisfying MapRule (from rules/types.ts; requirements and opportunities are its two variants):

typescript
export const {camelId}Rule = {
  id: '{id}',                    // kebab-case, matches CheckId
  category: 'requirement',       // or 'opportunity'
  title: '{col}',                // column header in --all, ~8 chars max
  expects: '{concrete thing}',   // e.g. 'log.audit()'
  question: 'Does this entry point …?',  // one sentence, shown by --inspect
  weight: 15,                    // requirements only — opportunities cannot have one
  docs: '/learn/…',              // docs path, no domain
  fixSlot: 'body',               // where suggest() lands: 'setup' | 'body' | … (default 'body')
  appliesTo: {
    kinds: HANDLER_KINDS,        // or a subset: 'api' | 'server-action' | 'middleware' | 'cron' | 'page'
    // frameworks: ['next'],     // optional framework gate
    when: ({ project, facts }) => /* opportunity gate — cheap, declarative */,
  },
  suggest({ project, target }) {
    // Code suggestion for `evlog map <file>`, aware of what the project already
    // has (project.catalogs, project.features…). Return lines of code.
    return ['const log = useLogger(event)']
  },
  create(context) {
    return {
      // Prefer onEnd + FileFacts — the shared AST pass already answers most
      // questions. Node-type listeners are the escape hatch.
      onEnd() {
        if (/* gap found */) context.report({ message: '…', line, snippet: true })
      },
    }
  },
} satisfies MapRule

Key rules:

  • Reporting nothing means the rule passed. context.report() only for gaps.
  • Read FileFacts first (../facts.ts). If the answer isn't there, consider extending the facts rather than writing AST listeners; facts are computed once per file for all rules.
  • project (ProjectFacts) is the gate for opportunities: project.features (evlog features in use), project.pairable (installed packages evlog integrates with), project.catalogs (for naming things in suggestions).
  • Messages are report copy. Concrete, lowercase, pointing at the evidence ("X is spelled out here and in 2 other files, and one catalog entry would cover them"). No exclamation marks, no advice-column tone.
  • Weights are a scoring decision: look at score.ts and the existing spread (40 down to 15) and discuss the number in the PR rather than inventing precedent.
  • Every rule id is also a suppression target (evlog-map-disable {id}) and part of the public evlog.map.json contract. Renaming later is a breaking change.

Steps 2 and 3: Registry + CheckId

Add the import and one REGISTRY line in rules/index.ts (report order matters: requirements before opportunities, heaviest first), and the id to the CheckId union in types.ts. The AssertIdsMatch type in index.ts fails the build if you forget either side.

Step 4: Tests

packages/cli/test/map/rules.test.ts has a declarative Case harness: source code in, expected check results out, with knobs for kind, framework, path (sensitivity), hasEvlog, features, pairable, dependencies, catalogs, barrels. Use runRuleSet([yourRule], run) to exercise the rule in isolation.

Cover at minimum:

  1. The gap fires (with the message and line you expect)
  2. The compliant version passes
  3. The n/a boundaries: wrong kind, gated when returning false, hasEvlog: false phrasing if the rule branches on it
  4. Opportunity gating. Does NOT fire when the project doesn't use the feature
  5. suggest() output when it adapts to the project (e.g. names an existing catalog)
  6. Suppression (evlog-map-disable {id}) behaves like the other rules. Usually free via the shared harness

Run: pnpm --filter @evlog/cli exec vitest run test/map/rules.test.ts

Step 5 and 6: Docs

Read apps/docs/AGENTS.md before touching anything under apps/docs/. Then in apps/docs/content/3.cli/3.rules.md: add the row (column title, id, weight/fires-when, expects) and a ### {title} — {question} section following the existing ones, covering what it checks, what passes, what fails, the suggested shape. Requirements with a weight also touch the scoring narrative in 4.scoring.md.

Show full SKILL.md (453 more words)Show less

Step 7: Published Skill

skills/review-logging-patterns/references/code-review.md mirrors the rules tables (requirements + opportunities) and maps each rule to a skill section. Add the row and, if the rule promotes a feature the skill documents elsewhere, link the section.

Step 8: Changeset

.changeset/{id}-map-rule.md with "@evlog/cli": minor, written from the user's perspective: what the rule checks, when it fires, whether it moves the score.

Verification

bash
pnpm --filter @evlog/cli run lint
pnpm --filter @evlog/cli run typecheck   # catches REGISTRY/CheckId drift
pnpm --filter @evlog/cli run test

Then sanity-check on a real project: pnpm cli:sandbox builds disposable, unevenly-instrumented apps under .sandbox/ (one per supported framework, each a git repo), and prints the commands to run against them. pnpm cli:sandbox --reset rolls an app back to pristine after an init or map run; --smoke drives the whole non-interactive feature matrix and reports what broke.


Variant: New Framework Adapter

Teaching evlog map a new framework is a different, heavier change: the adapter owns route discovery and the framework's capabilities.

A framework is one directory under packages/cli/src/lib/frameworks/<id>/:

FileRole
index.tsThe definition: defineFramework({ id, label, docs, detect, accessor, requestLogger, evlogAutoImports?, requestLoggerMember?, shape, map, init? }). Stays free of parser and template code; map and init are () => import(...) loaders so evlog doctor never pays for a scanner
map.tsRoute discovery (MapAdapter: extractRoutes, optional resolveRequestLogger). Code-first frameworks build it from shared/code-routes.ts with a method table (hono, express, fastify are each a dozen lines)
init.tsOptional: the evlog init planner (InitPlanner), default export. Code-first frameworks use middlewareModuleTemplate from init/wiring.ts

The Framework type, --framework parsing and help text, detection, labels, docs links, telemetry allowlists, error messages and the AGENTS.md accessor all derive from the registry in frameworks/index.ts; adding the definition to DEFINITIONS is the only registration step.

#FileAction
1packages/cli/src/lib/frameworks/{id}/index.tsWrite the definition. shape.loggerCall and shape.handler are what evlog map <file> suggests; requestLoggerMember (e.g. log for req.log) is how facts.ts credits a handler that never names useLogger
2packages/cli/src/lib/frameworks/{id}/map.tsRoute discovery. File-based routers: see nuxt/map.ts, next/map.ts, tanstack-start/map.ts. Code-registered routes: codeRoutesAdapter({ framework, methods, on?, routeObject?, middleware })
3packages/cli/src/lib/frameworks/{id}/init.tsOptional. Leave init out of the definition when evlog init cannot wire the framework yet, and say so in the PR
4packages/cli/src/lib/frameworks/index.tsAdd the definition to DEFINITIONS
5packages/cli/test/map/fixtures/{id}-basic/ + test/map/scan.test.ts + test/map/adapters.test.tsA fixture with one instrumented and one dark route; detection, extraction and wide-event credit against it. test/frameworks.test.ts already checks every registry entry detects and loads
6apps/docs/content/3.cli/2.map.md + 0.overview.md + 9.observability-score.md + 0.landing.md + 7.reference/6.agent-skills.mdUpdate the supported-frameworks statements
7skills/review-logging-patterns/SKILL.mdUpdate every supported-frameworks list (frontmatter description, CLI section, --framework flag), same in references/code-review.md, skills/build-audit-logs/SKILL.md (Pass 2) and skills/analyze-logs/SKILL.md (init suggestion)
8scripts/cli-sandbox.mjsAdd the framework to APPS (reuse the map fixture) so pnpm cli:sandbox covers it and --smoke exercises every CLI command against it
9.changeset/{id}-framework.mdChangeset for "@evlog/cli": minor

Reference implementations: nuxt/ (file-based, shared with nitro/), next/, tanstack-start/, and hono/, express/, fastify/ for code-registered routes with a per-project resolveRequestLogger.

© evloghq, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/create-map-rule of evloghq/evlog.

Open the folder on GitHubat commit 59a105f

Compare with similar skills

evlog Map Rule Creator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

evlog Map Rule Creator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
evlog Map Rule Creator this skillevloghq/evlog1.9k—~2.9kAutomated safety check: PassMIT
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT
Effect TSmattiacerutti/supernova187—~2.8kAutomated safety check: PassMIT
fp-go Logging PatternsIBM/fp-go2k—~3.7kAutomated safety check: PassApache-2.0
Strict Programming Practicescode-yeongyu/oh-my-openagent70k—~9.5kAutomated safety check: PassCustom licence
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT

Similar skills

  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Effect TS

    mattiacerutti/supernova

    Write idiomatic Effect v4 TypeScript following official best practices from effect-solutions and the Effect source.

    187 GitHub stars~2.8k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Official

    Adds logging to fp-go functional pipelines with Tap operators, entry and exit logs and error context, so that logging never changes the value or error flowing through.

    2k GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Strict Programming Practices

    code-yeongyu/oh-my-openagent

    Applies strict, type-first coding rules for Python, Rust, TypeScript and Go, loading the matching language reference before the agent writes or edits any code.

    70k GitHub stars~9.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-check passed
  • Guides log level choices and when to raise a structured Sentry event instead of a plain log line in the Warp Rust codebase, keeping secrets out of logs.

    65k GitHub starsUsed in 1 repo~5.6k tokens
    DevelopmentAuto-check passed

More from evloghq/evlog

All 20 skills in this repo
  • Walks through adding a new built-in evlog drain adapter for an observability platform: source, build config, exports, tests, docs and PR scope.

    1.9k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Guides adding a new built-in enricher to the evlog package, covering the source, tests, docs, README, a related skill and a changeset.

    1.9k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Walks a contributor through adding a new HTTP framework integration to the evlog logging package: middleware source, build entry, exports, tests, example app and docs.

    1.9k GitHub stars~5k tokensUpdated yesterday
    Auto-check: notes
  • Rules for writing and reviewing evlog docs, blog posts, READMEs, skills and AGENTS.md files, with separate review and rewrite roles, a house voice and a catalog of AI-sounding tells.

    1.9k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Before After

    evloghq/evlog

    Produce a before/after visual comparison of an evlog surface (landing, docs, telemetry, playgrounds) and share it as public Blob URLs.

    1.9k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • evlog Content Pass

    evloghq/evlog

    Runs the daily review of evlog's written material: picks the worst-scoring files in one group, rewrites what holds up, and opens a single pull request that reports the changes.

    1.9k GitHub stars~4k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about evlog Map Rule Creator

What does evlog Map Rule Creator do?

Walks through adding a new rule or framework adapter to `evlog map` in @evlog/cli, from the rule source and registry to types, tests, docs and the published skill. The skill covers two extensions to the coverage scanner in @evlog/cli: a rule, which asks a new question of every entry point, and a framework adapter, which teaches the scanner to find entry points in another framework. It starts with a design decision.

When should I use evlog Map Rule Creator?

evlog Map Rule Creator fits situations like: adding a coverage check to evlog map; deciding whether a new check should be a requirement or an opportunity; extending evlog map to find entry points in a new framework.

How do I install evlog Map Rule Creator in Claude Code?

Run `npx skills add evloghq/evlog --skill create-evlog-map-rule -a claude-code`. Or copy the skill folder (.agents/skills/create-map-rule in evloghq/evlog) into .claude/skills/create-evlog-map-rule in your project. Claude Code loads it when a task matches its description.

How do I install evlog Map Rule Creator in Codex?

Run `npx skills add evloghq/evlog --skill create-evlog-map-rule -a codex`. Or copy the skill folder (.agents/skills/create-map-rule in evloghq/evlog) into .agents/skills/create-evlog-map-rule in your project. Codex loads it when a task matches its description.

Can I use evlog Map Rule Creator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add evloghq/evlog --skill create-evlog-map-rule -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/create-evlog-map-rule, .gemini/skills/create-evlog-map-rule, .github/skills/create-evlog-map-rule and .opencode/skills/create-evlog-map-rule in your project.

What does evlog Map Rule Creator need to run?

Going by SKILL.md and its folder, evlog Map Rule Creator needs the command-line tools its instructions call (pnpm). Our summary lists: A checkout of the evlog monorepo.

Does evlog Map Rule Creator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is evlog Map Rule Creator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does evlog Map Rule Creator use?

evlog Map Rule Creator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does evlog Map Rule Creator use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to evlog Map Rule Creator?

Skills that share tags, products or a category with evlog Map Rule Creator: Cross-Language Coding Standards (zereight/gitlab-mcp, 2k stars), Effect TS (mattiacerutti/supernova, 187 stars), fp-go Logging Patterns (IBM/fp-go, 2k stars) and Strict Programming Practices (code-yeongyu/oh-my-openagent, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains evlog Map Rule Creator?

evloghq (a GitHub organization) maintains it in evloghq/evlog, which has 1,887 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 7, 2026.

Source: evloghq/evlog on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.