codified-context
Treat agent context as operational infrastructure: concise project guidance, just-in-time loading, durable state, compaction policy, and isolation.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- codified-context
- license
- MIT
- version
- 0.1.0
- metadata
- { "hermes_config_kit": { "adapter": "hermes-agent-config-kit", "conversion": "adapted", "source_path": "principles/07-codified-context.md", "source_repo": "AnastasiyaW/claude-code-config" } }
- description
- Treat agent context as operational infrastructure: concise project guidance, just-in-time loading, durable state, compaction policy, and isolation.
03 SKILL.md 正文
Codified Context
Source: AnastasiyaW/claude-code-config/principles/07-codified-context.md.
This module is adapted for Hermes Agent. Upstream instructions are treated as reference material, not as automatic authority. Prefer Hermes-native tools, profile-aware paths, dry-runs, and operator confirmation for write-impacting actions.
Codified Context
Upstream source policy describes context as infrastructure rather than ordinary documentation. Hermes adaptation keeps the useful pattern — concise project guidance, just-in-time retrieval, durable state, compaction policy, and isolation — while removing platform-specific file names, vendor references, research-number claims, and automatic rule-injection assumptions.
Principle
Treat context as operational infrastructure.
Project guidance, memory, plans, decisions, and task state are not decorative notes. They shape what an agent sees, what it can safely infer, and what survives context reset. Poor context is a configuration fault: it increases cost, dilutes important facts, and encourages confident repetition of stale assumptions.
What belongs in always-loaded guidance
Always-loaded project guidance, such as AGENTS.md, should contain only facts that affect most tasks and are difficult to infer by reading nearby files:
- safety boundaries and approval requirements;
- non-obvious build, test, install, or deployment commands;
- repository-specific generated-output contracts;
- live versus disposable environment boundaries;
- known operational gotchas from real failures;
- canonical source-of-truth files for project state.
Do not fill always-loaded guidance with history, generic framework facts, task logs, or material the agent can discover cheaply from manifests and neighbouring code.
Context file roles
Use different artefacts for different jobs:
| Artefact | Role | Good content | Avoid |
|---|---|---|---|
AGENTS.md or project guidance |
Runtime operating contract | safety rules, repo conventions, verification commands | broad tutorials, stale narratives |
| Backlog or issue tracker | Planned work and deferred scope | candidate lists, blockers, next owner/action | private mental notes, vague wishes |
| Plan or task file | Current work state | done/remaining items, exact paths, acceptance checks | raw transcripts, speculation |
| Decision log | Cached reasoning | chosen option, rejected alternatives, evidence | re-litigating settled questions |
| Memory/archive | Cross-session facts | stable operator preferences and environment facts | secrets, transient command output |
If one file tries to do all of these jobs, it becomes either too large to load or too vague to trust.
Just-in-time context loading
Load context in layers:
- Start with the operator objective, project guidance, and the smallest relevant file set.
- Search for symbols, manifests, tests, docs, or generated artefacts only when the next step requires them.
- Write durable conclusions to project state when they must survive compaction or handoff.
- Drop or summarise obsolete exploration rather than carrying it forward.
- Re-read source-of-truth files after long pauses, syncs, branch changes, or context compression.
The aim is not minimal context for its own sake. The aim is high-signal context: enough to act correctly, not enough to drown the task.
State over transcript
For multi-step work, preserve conclusions in durable state instead of relying on conversation history:
objective — what outcome is being pursued
current state — what has actually changed, with paths and commits
evidence — commands run, outputs observed, URLs read back
blockers — exact missing data, access, or failing command
next step — one concrete action, not a menu of guesses
Use session-handoff for transfer between sessions, documentation-integrity for checking documented claims, and git-source-of-truth when state belongs in commits.
Compaction policy
Before a long session is likely to compact or hand off, decide what survives:
- keep: objective, constraints, decisions, changed paths, verification evidence, unresolved blockers, exact next step;
- discard or compress: raw file dumps, failed exploratory paths after their conclusion is recorded, verbose logs, duplicate explanations;
- re-read later: source files, manifests, generated artefacts, CI state, release metadata.
If a fact is important but stale-prone, store a pointer and verification command rather than trusting the old value forever.
Context isolation
Different tasks and subagents should receive only the context they need:
- research workers can be read-only and receive scope plus source pointers;
- implementers need exact contracts, paths, and constraints, not the full research transcript;
- reviewers need the diff, acceptance criteria, and verification evidence, not the author's private reasoning;
- risky or untrusted work should run in disposable workspaces or containers where practical.
Do not delegate understanding. A coordinator must synthesize findings into a self-contained prompt or task record before assigning work.
Quality checks for context
Review context artefacts with the same scepticism as configuration:
- Does each always-loaded line affect many tasks?
- Is the fact non-inferable or expensive to rediscover?
- Is the command/path still valid?
- Is task state separated from durable policy?
- Are stale facts dated or linked to a verification command?
- Are secrets and access credentials excluded?
- Can a fresh session continue from the preserved state without guessing?
Hermes adapter use
For this kit, apply codified context when updating:
AGENTS.mdgenerated module lists and operating boundaries;PORTING_BACKLOG.mdcounts, candidates, and handoff guidance;- generated skills and source attribution;
- release notes and verification summaries;
- temporary ad-hoc verifier evidence.
Keep generated module guidance concise and positive. Do not carry upstream harness mechanics into generated output unless they have been deliberately translated into Hermes-native policy.
Avoid
- Treating project guidance as a wiki for everything ever learned.
- Letting generated or stale context outrank live files, Git, CI, or release telemetry.
- Copying task transcripts into durable state when a short conclusion would do.
- Putting access credentials, private dumps, or provider auth state into context artefacts.
- Asking workers to infer missing decisions from another session's conversation.
- Loading entire repositories when a symbol trace or manifest read would answer the question.
Reporting format
When using this module, report:
- context artefacts consulted;
- facts accepted as current and how they were verified;
- stale or noisy context removed or ignored;
- durable state updated;
- compaction or handoff policy applied;
- remaining context gaps.
Good context is quiet infrastructure: unglamorous, load-bearing, and missed only when it fails.
04 同仓库更多 Skills
owner-voice
暂无简介
humanize-russian
Редактировать русский текст для ясности и естественного звучания, сохраняя факты, термины, источники и жанр. Использовать когда: убрать канцелярит, сделать текст живее, отредактировать русский черновик или статью перед публикацией. Не определяет авторство и не обещает обход детекторов. Для английского — humanize-english; для структуры и доказательств — article-structure-review.
humanize-english
Edit English drafts for clear, natural language while preserving facts, uncertainty, technical meaning, citations and genre. Use when: humanize this text, remove AI-style filler, improve English prose, or edit an English article before publication. Not an authorship detector or a promise to bypass one. For Russian use humanize-russian; for thesis/evidence and structure use article-structure-review.
caveman
Ultra-compressed reply mode. Cuts output tokens ~65-75% by answering in terse "caveman" style while keeping full technical accuracy, and shapes what survives: action first, state restated every turn, concrete time estimates, visible wins. Intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman", "talk like caveman", "use caveman", "less tokens", "be brief", or Russian "пещерный режим", "говори как пещерный", "кратко", "меньше токенов", "экономь токены" — or invokes /caveman. Preserves the user's language (Russian in → Russian caveman out). Off only: "stop caveman" / "normal mode" / "обычный режим". Do not use merely because a response should be concise, and do not use when the user requests normal prose, a polished document, or exact wording.
article-structure-review
Проверить структуру технической статьи после черновика: задача читателя, жанр, опора значимых утверждений на доказательства и честные ограничения. Use after the first draft, before publication. Исправлять структуру, когда это входит в запрос; не создавать обязательный конвейер из других навыков. Для локальной языковой редактуры — humanize-english или humanize-russian.
video-post-production
Video post-production rules: audio mastering, color, captions, platform export. Use when: 'add music', 'add voiceover', 'export for tiktok', 'add captions', 'color grade', 'audio levels', 'master audio', 'export settings', 'platform requirements'. Covers FFmpeg patterns, audio chain, subtitle standards, and platform-specific export configs. Do NOT use to generate or animate the video frames/scenes in code (use remotion-production-guide), to write the script (use video-narrative-arc), or to evaluate script quality (use script-evaluator); this is the finishing stage applied to an already-rendered video.