bug-report

bug-report is a command for coding agents from cameronfreer/lean4-skills. It costs 13 tokens per session (1,026 once invoked), scanned A, original, MIT.

A command for preparing a bug report as a GitHub issue for the lean4-skills project. GitHub is a service where software projects track code, discussions, and reported problems.

In plain words
What is it for?
Use it to record the expected and actual behavior, reproduction steps, small Lean example, tool versions, and relevant error or build output.
Why use it?
It gathers the details needed to reproduce and investigate a Lean bug, while requiring the user’s permission before collecting information or drafting the report.

Command

Part of the lean4-contribute plugin — 3 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/cameronfreer/lean4-skills/bug-report
Clone the repo
git clone --depth 1 https://github.com/cameronfreer/lean4-skills

Or install lean4-contribute, the plugin that ships this one along with the rest of its 3 commands.

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 bug-report

README.md
[![agentmods](https://agentmods.dev/badge/commands/cameronfreer/lean4-skills/bug-report.svg)](https://agentmods.dev/commands/cameronfreer/lean4-skills/bug-report)
Your own site
<a href="https://agentmods.dev/commands/cameronfreer/lean4-skills/bug-report"><img src="https://agentmods.dev/badge/commands/cameronfreer/lean4-skills/bug-report.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,026 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00013 $0.01026
Opus 5 $0.00006 $0.00513
Sonnet 5 $0.00003 $0.00205
Haiku 4.5 $0.00001 $0.00103

Measured 4d ago against content hash 3fe44008451c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bug-report 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 4d 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.

plugins/lean4-contribute/commands/bug-report.md · 122 lines

How it starts

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

Bug Report

Draft and submit a bug report as a GitHub issue on cameronfreer/lean4-skills.

Precondition

Invoke this command only if the user explicitly ran it or explicitly agreed to draft a bug report. If invoked without prior opt-in, ask:

This looks like a lean4-skills bug. Want me to draft a bug report?

If the user explicitly ran /lean4-contribute:bug-report, treat that as opt-in. Do not proceed unless the user confirms. Do not mine git diff, gather diagnostics, or ask structured questions until consent is given.

Gathering Context

Collect the following from the user and the current session. Ask for anything you cannot infer:

  1. Summary — One-line description of the bug
  2. Expected behavior — What should happen
  3. Actual behavior — What happens instead
  4. Repro steps — Numbered steps to reproduce
  5. Minimal Lean snippet — Smallest code that triggers the bug (strip project-specific details)
  6. Environment / toolchain — Lean version (lean --version), lake version, OS, plugin version, relevant MCP servers
  7. Diagnostics / build output — Compiler errors, lake build output, or LSP messages (redact paths and usernames)
  8. Possible fix (optional) — If you have a local fix, write a short prose summary of what the fix does (1–3 sentences). Do not include a raw diff by default. If the user explicitly asks to include a patch excerpt, include only the minimal relevant hunk (not the whole diff), strip file paths and surrounding context, and require a separate confirmation:

    This draft includes a code patch. Review it for unrelated code or secrets. Include this patch? (yes / remove it / edit)

  9. Privacy / redaction check — Before showing the draft, scan for filesystem paths, usernames, API keys, or other sensitive data and redact them. Flag anything you redacted so the user can verify.

Drafting the Issue

Compose the issue using this template:

Title: [Bug] <summary>
Labels: bug

## Summary
<summary>

## Expected Behavior
<expected behavior>

## Actual Behavior
<actual behavior>

## Steps to Reproduce
<numbered repro steps>

## Minimal Example
```lean
<minimal Lean snippet>

Environment

  • Lean:
  • Lake:
  • OS:
  • Plugin:
  • MCP:

Diagnostics

<build output / compiler errors>

Possible Fix

<prose summary of fix; minimal patch excerpt only if user confirmed>


Drafted via lean4-contribute

Read the full file on GitHub · 122 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. 4d ago First seen · 122 lines · 13 tokens per session scan A 3fe44008451c

Subscribe to this mod's changes

bug-report is a command published in the GitHub repository cameronfreer/lean4-skills (428 stars, last pushed today), licensed MIT. It adds 13 tokens to every session and 1,026 once invoked, about $0.0001 per session on Opus 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-08-30.