repo-context-card
New: --check detects stale cards without rewriting files. Usage and examples.
Generate a compact repository context card for AI coding agents.
repo-context-card is a dependency-free Python CLI that scans a repository and emits a deterministic Markdown or JSON summary: important files, language mix, likely validation commands, a compact file map, and largest scanned files.
Why
AI coding agents work better when they get the right context early. Recent high-growth developer tools are converging on context engineering, token reduction, agent skills, and repo memory. Many solutions are powerful but heavy.
This project is intentionally small: create a readable CONTEXT_CARD.md that any agent or human can inspect before editing a codebase.
Install
From this repository:
python -m pip install -e .
Or run without installing:
python -m repo_context_card .
Usage
Print Markdown to stdout:
repo-context-card .
Write a context card:
repo-context-card . --output CONTEXT_CARD.md
Write JSON:
repo-context-card . --format json --output context-card.json
Limit scanning:
repo-context-card . --max-files 150 --max-tree-entries 60
What It Detects
- Important files such as
README.md,AGENTS.md,CLAUDE.md,package.json,pyproject.toml,Cargo.toml,go.mod, and GitHub workflows - Language counts by file extension
- Suggested commands for Python, Node, Rust, and Go projects
- Compact file map
- Largest scanned files
- Total scanned bytes
Example
# Context Card: my-project
## Summary
- Root: `/path/to/my-project`
- Files scanned: `42`
- Total scanned bytes: `118420`
## Languages
- Python: 12 file(s)
- Markdown: 4 file(s)
## Suggested Commands
- `python -m pip install -e .`
- `python -m unittest discover -s tests`
CI Example
name: Context card
on:
pull_request:
push:
branches:
- main
jobs:
context-card:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -m pip install -e .
- run: repo-context-card . --output CONTEXT_CARD.md
- run: test -s CONTEXT_CARD.md
Design Principles
- No dependencies
- No model calls
- No network calls
- Deterministic output
- Safe for CI
- Useful to humans and agents
Development
python -m pip install -e .
python -m unittest discover -s tests
python -m repo_context_card . --output CONTEXT_CARD.md
Agent OSS Toolkit
This project is part of a small toolkit for building and launching agent-ready open-source repositories:
- agent-repo-kit: scaffold launch-ready, AI-agent-friendly repositories
- oss-launch-check: audit whether a repository is ready to launch as open source
- repo-context-card: generate compact repository context cards for coding agents
- agent-rules-lint: lint AGENTS.md, CLAUDE.md, Cursor rules, and Copilot instructions
- awesome-ai-agents-zh: Chinese AI Agents / MCP / AI DevTools directory
Contributing
See CONTRIBUTING.md.
License
MIT
Metadata
Release files for repo-context-card 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| repo_context_card-0.2.0.tar.gz | 62.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repo_context_card-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.4 kB
Release files / repo_context_card-0.2.0.tar.gz
| Download URL | repo_context_card-0.2.0.tar.gz |
|---|---|
| Size | 62.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd1b9d02dbdd49c470cb33bda0ad4f033acf0574bf4d60026252d0d06a28f16b
|
|
BLAKE2b-256 checksum How to use checksums |
beb9bc4f294709a9d4040240f9b526f13aa90f67d3e78b60e3a93ce50fe63a31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / repo_context_card-0.2.0-py3-none-any.whl
| Download URL | repo_context_card-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a6e40ebfefba839e86db4e43dc052cb08b71b79db099ec9525fb932e1008857
|
|
BLAKE2b-256 checksum How to use checksums |
c9a73f7ef2dd5e34318f62c5fb0a1db1b0cb128aec8faa5f44afc8437f17ef57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logSecurity for repo-context-card 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for repo_context_card-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.