Aller au contenu
Skillpedia
Prompts et LLM31k · #9252

context-audit

Ce qu’il fait

Cette skill guide l'agent IA dans la revue des fichiers de contexte chargés en permanence, comme CLAUDE.md et les fichiers de mémoire. Elle s'adresse aux personnes qui veulent que leur agent soit plus rapide et suive mieux les instructions.

Quand l’utiliser

  • ✓Quand les fichiers d'instructions de votre agent sont devenus longs et que vous voulez les réduire.
  • ✓Quand vous soupçonnez que deux fichiers d'instructions se contredisent.
  • ✓Quand vous voulez une liste classée de coupes avec un niveau de risque pour chacune.

Lien du skill

https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Mon CLAUDE.md et mon fichier de mémoire deviennent longs. Peux-tu les auditer et me dire quoi réduire en premier ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent liste chaque fichier chargé à chaque tour, repère la redondance, les contradictions et le contenu périmé, puis produit une liste d'actions classée avec des preuves.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

context-audit — Token Hygiene for the Always-Loaded Context Stack

Convention: see conventions/brain-first.md — before running a fresh audit, check the brain for prior audit reports (gbrain recall "context audit report") so you can compute token DRIFT since the last run and avoid re-flagging findings the user already declined.

Convention: see conventions/quality.md — every finding cites its file and evidence; no unsourced claims.

What this is

Every file that loads on every turn is a per-turn tax: tokens, latency, and — past a point — instruction-following quality. Always-loaded files accrete (append-only release notes, promoted memory blocks nobody re-reads, rules restated in three files that drift into contradiction). This skill audits the whole always-loaded stack at once and returns a ranked, evidence-cited action list sorted by token savings.

It is an auditor, not a surgeon. It measures, finds, ranks, and recommends. The user (or a skill the user explicitly invokes afterward) applies changes.

Scope: what counts as "always-loaded"

Enumerate what THIS harness actually loads every turn — do not assume a fixed list. Typical stack:

File Role Fix belongs in
project CLAUDE.md / AGENTS.md orientation, routing, invariants the file itself (source-editable)
user-global CLAUDE.md cross-project instructions the file itself (source-editable)
auto-memory MEMORY.md promoted memory blocks the memory store (demote/expire)
SOUL.md, USER.md, ACCESS_POLICY.md, HEARTBEAT.md, rendered AGENTS.md bootstrap-rendered identity files the interview answer bank / templates — NEVER the rendered file
harness system-prompt fragments (identity/tools files) per-harness wherever that harness sources them

Skills, reference docs, and anything loaded on demand are OUT of scope as audit subjects — but they are the DESTINATION for skill-extraction findings (content that only matters for one workflow should move out of the always-loaded stack into a skill).

Contract

This skill guarantees:

  • Report-only. No audited file is edited, no page is written, nothing is auto-fixed — including 🟢 zero-risk findings. The output is a recommendation list the user applies deliberately.
  • Rendered-file safety. Any recommendation touching a bootstrap-rendered file is expressed as an answer-bank or template change (gbrain bootstrap interview --set KEY "..." then gbrain bootstrap render --only <FILE> --force), never as a direct edit. See skills/soul-audit/SKILL.md for the mechanics.
  • Estimated with a stated basis, never invented. Token figures come from the deterministic pre-pass (wc -c bytes/2.8 — Claude-family tokenizers run ~2.6-3.5 bytes/token on markdown dense with paths and code spans; 2.8 is the calibrated midpoint of measured always-loaded markdown, see #4988). The report prints the divisor so a reader can re-derive every number. If the host client reports an exact per-category context breakdown (e.g. Claude Code /context), that figure outranks the estimate — quote it and use it for the stack total.
  • Native judging. The draft report is quality-gated through gbrain eval cross-modal — no raw model API calls, no hardcoded model IDs.
  • Cost line. Default judging is ONE cheap model (the user's utility-tier model, all three slots, --cycles 1 — a few cents). The full three-provider frontier panel runs only when the user explicitly asks for a "full" or "multi-model" audit (~3x+ the cost per cycle).

Procedure

1. Enumerate the stack (deterministic)

List the always-loaded files for this harness and measure each:

# bytes/2.8 (calibrated for Claude-family tokenizers on markdown, #4988); integer ceil: (n*10+27)/28
for f in CLAUDE.md AGENTS.md SOUL.md USER.md ACCESS_POLICY.md HEARTBEAT.md MEMORY.md; do
  [ -f "$f" ] && echo "$f: $(wc -c < "$f") bytes (~$(( ( $(wc -c < "$f") * 10 + 27 ) / 28 )) tokens)"
done

Record the total. If a prior audit report exists in the brain, compute drift (net tokens grown/shrunk since last run, which files moved).

2. Read and analyze (the agent does this — no model calls yet)

Read every file in the stack in full. Evaluate against six dimensions:

  1. Token efficiency — tokens spent per unit of behavioral value
  2. Redundancy — the same rule/
Questions fréquentes

Modifie-t-elle mes fichiers ?

Non. La skill est un auditeur qui mesure et recommande, et c'est vous ou une skill choisie qui appliquez les changements.

Pourquoi est-ce important ?

La skill explique que chaque fichier chargé en permanence coûte des jetons à chaque tour et peut nuire au suivi des instructions.

Compare-t-elle avec les rapports précédents ?

Oui. Elle peut consulter le cerveau pour trouver des rapports d'audit antérieurs et mesurer la dérive depuis la dernière exécution.

Détails

Description originale de l’auteur

Token-hygiene audit of the always-loaded context stack — CLAUDE.md, AGENTS.md, auto-memory MEMORY.md, and the bootstrap-rendered identity files (SOUL.md, USER.md, ACCESS_POLICY.md, HEARTBEAT.md) or their harness equivalents. Finds redundancy, contradictions, stale content, compression candidates, and skill-extraction candidates; produces a ranked action list sorted by token savings with a risk class per finding. REPORT-ONLY: this skill never edits any audited file. Recommendations for bootstrap-rendered files target the interview answer bank / templates, never the rendered output. Judging rout

repo: garrytan/gbrain

Popularité

Étoiles GitHub
31k
Position au classement
#9252
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires