Asynkron.JsEngine: Command for Claude Code

.claude/commands/pre-pr.md

pre-pr is a command for Claude Code from asynkron/Asynkron.JsEngine. It costs 11 tokens per session (604 once invoked), scanned A, original, MIT.

A command that runs a required checklist before opening a GitHub pull request. It fixes and formats C# code, builds the project, runs unit tests, checks for duplicated code, and checks for allocation regressions.

In plain words
What is it for?
Use it as a pre-pull-request gate for the Asynkron.JsEngine project, including its .NET build, tests, formatting, duplication scan, and allocation baseline check.
Why use it?
It catches build failures, failing tests, new duplication, formatting issues, and performance regressions before code is proposed for review.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is asynkron/Asynkron.JsEngine's own configuration. It tells Claude Code how to work on Asynkron.JsEngine itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Asynkron.JsEngine configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is Bash(roslynator:*), Bash(dotnet:*), Bash(quickdup:*), Bash(gh:*), Bash(./tools/check-allocation-regression:*).

Reuse

Borrowing it

Nothing to install: this file belongs to asynkron/Asynkron.JsEngine. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/asynkron/Asynkron.JsEngine/main/.claude/commands/pre-pr.md
Clone the repo
git clone --depth 1 https://github.com/asynkron/Asynkron.JsEngine

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pre-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/asynkron/asynkron.jsengine/pre-pr/github.svg)](https://agentmods.dev/commands/asynkron/asynkron.jsengine/pre-pr)
Your own site
<a href="https://agentmods.dev/commands/asynkron/asynkron.jsengine/pre-pr"><img src="https://agentmods.dev/badge/commands/asynkron/asynkron.jsengine/pre-pr/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pre-pr

Your own site · 80×15
<a href="https://agentmods.dev/commands/asynkron/asynkron.jsengine/pre-pr"><img src="https://agentmods.dev/badge/commands/asynkron/asynkron.jsengine/pre-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 604 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00604
Opus 5.5 $0.00004 $0.00242
Sonnet 5.5 $0.00002 $0.00121
Haiku 4.5 $0.00001 $0.00060

Measured 14d ago against content hash f4eada1ab517, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pre-pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/pre-pr.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pre-PR Checklist

MANDATORY: Run this before creating any PR to GitHub.

Execute All Steps In Order

Step 1: Roslynator Fix

roslynator fix src/Asynkron.JsEngine

Then verify compilation:

dotnet build src/Asynkron.JsEngine

If build fails: Fix the issues and rerun roslynator before proceeding.

Step 2: Run Full Internal Unit Tests

dotnet test tests/Asynkron.JsEngine.Tests

Handle failures:

  • Flaky tests: Rerun to confirm
  • Broken tests: Fix before proceeding
  • All tests MUST pass before moving to step 3

Step 3: Check for Code Duplication

quickdup --path src/Asynkron.JsEngine --ext .cs --select 0..20 --min 2 --exclude ".g."

If new duplications are found:

  1. Refactor to eliminate duplications
  2. Go back to Step 1 (roslynator fix)
  3. Repeat until no new duplications

Step 4: Format Code

dotnet format src/Asynkron.JsEngine

Step 5: Allocation Regression Gate

Guard the evaluator hot-path allocation wins against silent regression:

./tools/check-allocation-regression

This re-measures Asynkron managed allocations for the benchmark smoke set and compares them to the committed tools/allocation-baseline.txt. It exits non-zero with a per-profile diff if any profile regresses beyond tolerance.

If it reports a regression:

  • Unintended regression → investigate and reduce allocations before proceeding.
  • Intentional change that legitimately moves the numbers → refresh and commit the baseline:
    ./tools/check-allocation-regression --update
    git add tools/allocation-baseline.txt
    

Step 6: Final Verification

Confirm all checks passed:

  • Roslynator fix applied
  • Code compiles cleanly
  • All unit tests pass
  • No new code duplications
  • Code formatted
  • No allocation regression (or baseline intentionally refreshed)

Step 7: Create PR

Only after ALL checks pass:

gh pr create --title "..." --body "..."

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago First seen · 95 lines · 11 tokens per session scan A f4eada1ab517

Subscribe to this mod's changes

pre-pr is a command published in the GitHub repository asynkron/Asynkron.JsEngine (11 stars, last pushed 3mo ago), licensed MIT. It adds 11 tokens to every session and 604 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.