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.
npx agentmods add rules/ofershap/ai-context-kit/projectgit clone --depth 1 https://github.com/ofershap/ai-context-kitWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00648 | $0.00648 |
| Opus 5 | $0.00324 | $0.00324 |
| Sonnet 5 | $0.00130 | $0.00130 |
| Haiku 4.5 | $0.00065 | $0.00065 |
Grade A, and why
project 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.
How it starts
The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ai-context-kit
TypeScript library + CLI that loads, lints, measures, and selects AI agent context files (CLAUDE.md, .cursor/rules/, AGENTS.md, Copilot instructions, etc.).
npm package: ai-context-kit. GitHub: ofershap/ai-context-kit.
Architecture
Source is in src/, tests mirror in tests/. Each module is a single concern:
types.ts- all interfaces and types.RuleFileis the core data structureparse.ts- YAML frontmatter parsing, format detection from file pathtokens.ts- token estimation (4 chars per token approximation)load.ts-loadRules()- finds and loads rule files from diskmeasure.ts-measure()- token cost per rule with budget checklint.ts-lint()- conflict detection, duplicates, vague instructions, scores 0-100select.ts-select()- task-relevant rule selection within token budgetsync.ts-sync()- write rules to multiple target formatsinit.ts-init()- scaffold starter rule files from templatescli.ts- CLI entry point, parses args and calls the above functionsindex.ts- public API re-exports
Key Constraints
- Zero runtime dependencies. Do not add any.
exactOptionalPropertyTypes: truein tsconfig. Optional props need explicit| undefined- ESM primary, CJS secondary via tsup dual build
- CLI binary name in package.json is
ai-context-kit - Format detection is path-based (no config).
.cursor/rulesdir = cursor-rules format,CLAUDE.md= claude-md, etc. - Token estimation is intentionally approximate (4 chars/token). Don't replace with tiktoken or similar
Adding a Lint Rule
- Add detection logic in
src/lint.tsinside thelint()function - Add test cases in
tests/lint.test.ts - Update the lint rule table in
README.md - Issue severity must be
error,warning, orinfo
Adding a Format
- Add format string to
RuleFormatunion insrc/types.ts - Add path detection in
detectFormat()insrc/parse.ts - Add file patterns in
loadRules()insrc/load.ts - Add template in
TEMPLATESmap insrc/init.ts(optional) - Add test in
tests/load.test.ts
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.
- yesterday First seen · 60 lines · 648 tokens per session scan A 9fbc22e51d74
project is a cursor rule published in the GitHub repository ofershap/ai-context-kit (8 stars, last pushed 6d ago), licensed MIT. It adds 648 tokens to every session, about $0.0032 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-31.
Other cursor rules, from other repositories
cursorrules
Cursor rule "cursorrules" from googlarz/agents-sync, covering .cursorrules — managed by agents-sync v1.0.0, language: typescript / next.js 14 and run tests: npm test.
cursor-project-rule
Project Spine operating contract for "Ledger API".
project-spine-apps-web
Project Spine scoped guidance for "apps/web".
project-spine-packages-ui
Project Spine scoped guidance for "packages/ui".
style
Code style and API rules for acme-orders.
cursorrules
You are working on acme-orders, an Express order intake service.