code2prompt: Skill for Claude Code

.agents/skills/code2prompt-conventions/SKILL.md

code2prompt-conventions is a skill for Claude Code, Codex from mufeedvh/code2prompt. It costs 20 tokens per session (343 once invoked), scanned A, original, MIT.

A set of development rules for the code2prompt project. It explains where different kinds of code belong, how to preserve existing behavior, and how to handle output, errors, tests, and optional features.

In plain words
What is it for?
Implementing or reviewing changes across the core library, command-line tool, terminal interface, and Python adapter.
Why use it?
It helps contributors change unfamiliar code without putting logic in the wrong layer or accidentally changing public behavior. It also encourages consistent, predictable results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is mufeedvh/code2prompt's own configuration. It tells Claude Code and Codex how to work on code2prompt 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 code2prompt configures →

About the project

Code2Prompt is a command-line tool that collects a codebase and formats it as one prompt containing source context, templates, and token information for a language model. Developers use it to prepare focused repository context for ChatGPT, Claude, coding agents, or programs that call an MCP server. The catalogue entries provide skills and an instruction for installing and using Code2Prompt to navigate repositories and gather scoped context.

mufeedvh/code2prompt · 7,634 stars · on GitHub · code2prompt.dev

Reuse

Borrowing it

Nothing to install: this file belongs to mufeedvh/code2prompt. 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/mufeedvh/code2prompt/main/.agents/skills/code2prompt-conventions/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mufeedvh/code2prompt

Made for: Claude Code, Codex.

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 code2prompt-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/mufeedvh/code2prompt/code2prompt-conventions/github.svg)](https://agentmods.dev/skills/mufeedvh/code2prompt/code2prompt-conventions)
Your own site
<a href="https://agentmods.dev/skills/mufeedvh/code2prompt/code2prompt-conventions"><img src="https://agentmods.dev/badge/skills/mufeedvh/code2prompt/code2prompt-conventions/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 code2prompt-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/mufeedvh/code2prompt/code2prompt-conventions"><img src="https://agentmods.dev/badge/skills/mufeedvh/code2prompt/code2prompt-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 343 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.00020 $0.00343
Opus 5 $0.00010 $0.00171
Sonnet 5 $0.00004 $0.00069
Haiku 4.5 $0.00002 $0.00034

Measured yesterday against content hash 0835d03c5fe9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

code2prompt-conventions 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 yesterday.

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.

.agents/skills/code2prompt-conventions/SKILL.md · 41 lines

What it actually says

code2prompt conventions

Before changing an unfamiliar area, read the target code, a nearby example, and relevant tests.

Ownership

  • code2prompt-core: reusable logic, configuration, files, Git, templates, tokenization, analysis, and sessions.
  • code2prompt: CLI, config precedence, stdout/stderr, clipboard, and TUI model/views/widgets.
  • code2prompt-python: thin PyO3 adapter over code2prompt-core.
  • website: site and product documentation, not product semantics.

Implement behavior once, in the lowest appropriate layer.

Code2PromptSession coordinates configuration, selection state, and loaded data. SessionData is the source of truth for loaded codebase and Git results, not for all session state.

Preserve

  • deterministic output where order is visible;
  • optional-feature behavior with and without the feature;
  • intended fallbacks and useful error context;
  • stdout for prompt/data output and stderr for human diagnostics;
  • existing public names, defaults, serialized values, CLI behavior, and Python API unless intentionally changed.

Style

  • Prefer existing abstractions and dependencies.
  • Avoid unrelated refactors.
  • Use Result/?; add context at filesystem, Git, parsing, and rendering boundaries.
  • Avoid runtime panics for recoverable failures.
  • Comments explain why, invariants, compatibility, or non-obvious algorithms.
  • Put focused private Rust tests in local #[cfg(test)] mod tests; use integration tests for public behavior.
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. yesterday First seen · 41 lines · 20 tokens per session scan A 0835d03c5fe9

Subscribe to this mod's changes

code2prompt-conventions is a skill published in the GitHub repository mufeedvh/code2prompt (7,634 stars, last pushed yesterday), licensed MIT. It adds 20 tokens to every session and 343 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-09-07.