Agent skill

Context Anchoring

by techygarg in techygarg/lattice

Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development.

MITAuto-check passedDevelopment

Install Context Anchoring

skills CLI
$ npx skills add techygarg/lattice --skill context-anchoring -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install techygarg/lattice context-anchoring --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/techygarg/lattice.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/context-anchoring .claude/skills/context-anchoring && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
context-anchoring
GitHub stars
198
Token cost
~2.9k tokens
SKILL.md length
1,471 words
Files
2 (incl. assets)
Skills in repo
33
Repo updated
First seen
Licence
MIT

At a glance

Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development.

  • Works in 3 steps: Read .lattice/config.yaml in the repo… → If found and paths.context_base is set →… → If there is no config file or no…
  • Starting a new feature
  • SKILL.md covers Scope, Config Resolution, Why Context Anchors Exist and Document Lifecycle, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Context Anchoring is an agent skill from techygarg/lattice. Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development. Scoped to feature-level work — design, implementation, bugfix, refactor — not for codebase-wide assessments or product-wide specifications (those define their own document lifecycles). Handles creating new context documents, loading existing ones, and enriching them with new decisions. Use when starting a new feature, resuming work, making technical decisions, resolving questions…

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including assets (for example `assets/feature-doc-template.md`).

It sits in Development, covering Refactoring. The repository describes itself as: Install engineering discipline into any AI coding assistant. Composable skills for design, implementation, review, and team standards. Better process, not just better prompts. The licence is MIT.

When your agent uses it

  • Starting a new feature
  • Making technical decisions
  • Resolving questions
  • Context needs to persist across sessions

Example prompts

  • “load context”
  • “update context”
  • “context doc”
  • “/context-anchoring”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Read .lattice/config.yaml in the repo root.
  2. If found and paths.context_base is set → use that directory as the context base (the Create behavior creates it on demand).
  3. If there is no config file or no paths.context_base key → use the default .lattice/context/.

What it can do on your machine

Read from SKILL.md and the folder at commit 4d6c35f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context Anchoring loads about 2.9k tokens when it runs. Until then it costs about 192 tokens; SKILL.md has 1,471 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~192
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from techygarg/lattice at commit 4d6c35f, republished under its MIT licence (© techygarg). 1,471 words, ~2,901 tokens.

Download SKILL.mdSave it as .claude/skills/context-anchoring/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
context-anchoring
description
Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development. Scoped to feature-level work — design, implementation, bugfix, refactor — not for codebase-wide assessments or product-wide specifications (those define their own document lifecycles). Handles creating new context documents, loading existing ones, and enriching them with new decisions. Use when starting a new feature, resuming work, making technical decisions, resolving questions, or when context needs to persist across sessions. Use this skill whenever the user mentions 'load context', 'update context', 'context doc', 'decisions', 'continue where we left off', 'what did we decide', or 'capture this decision'.

Context Anchoring

Scope

Feature-level only — anchors decisions as a feature flows from design → implementation → bugfix → refactor.

Config Resolution

This skill manages a directory of per-feature context docs. Resolution order:

  1. Read .lattice/config.yaml in the repo root.
  2. If found and paths.context_base is set → use that directory as the context base (the Create behavior creates it on demand).
  3. If there is no config file or no paths.context_base key → use the default .lattice/context/.

Each feature gets one doc at <context_base>/<feature-name>.md. No default principles, no overlay modes, no override files -- just a thin template and per-feature docs that grow through enrichment.

Why Context Anchors Exist

AI has no persistent memory across sessions. Early decisions get contradicted, naming drifts, and the "why" evaporates -- a forgotten decision becomes a potential contradiction, a lost constraint becomes a violation, an unresolved question becomes a silent assumption.

Context anchor docs prevent this by being:

  • Feature-bound -- one doc per feature, scoped decisions only
  • Decision-focused -- capture what, why, and what-else-was-considered for every choice
  • Append-only -- decisions are never removed or rewritten, only added chronologically
  • Session-spanning -- the doc outlives the conversation and carries context forward
  • Git-native -- lives in the repo, versioned alongside code

Two documents per feature: the requirement doc (static, written upfront, not managed by this skill) defines what to build; the context anchor doc (living, evolving, managed by this skill) captures how and why -- decisions, constraints, reasoning that emerge during development.

The requirement doc may live in this repo or in whatever system the team already tracks requirements in (Jira, Linear, a wiki) -- this atom never writes to it regardless of where it lives.

Document Lifecycle

Three behaviors govern the context anchor doc's lifecycle. Each is triggered reactively (user asks) or proactively (AI suggests). In both cases, the AI always confirms before acting -- propose, user disposes.

BehaviorPurposeReactive TriggerProactive Trigger
CreateStart a new context docUser asks to create oneAI detects feature work beginning without a doc
LoadRestore context from an existing docUser asks to load/resumeAI detects existing docs and suggests loading
EnrichAdd a new decision, constraint, or resolutionUser asks to capture somethingAI detects a decision made in conversation

Status Lifecycle

Every context doc carries a status frontmatter field. Never infer status from body prose.

ValueSet by
draftcontext-anchoring Create — design not yet complete
approveddesign-blueprint Step 3 — L1–L4 complete, design reviewed
completecode-forge Step 5 — implementation done

STOP: Check this field before acting on a context doc. draft ≠ approved. approved ≠ complete. Deviation from an approved design → update the doc and re-approve — no new status values exist.

Create Behavior

Always confirm before creating.

Steps:

  1. Identify the feature name. Derive the kebab-case filename from it (e.g., "User Authentication" → user-authentication.md). Confirm the name with the user.
  2. Ask about the requirement doc. If the user has one, capture it for the requirement_doc frontmatter field -- a local file path, or an external reference (URL, ticket ID, or other identifier resolvable via a connected MCP tool). If neither, leave null.
  3. Create <context_base>/ if it does not already exist.
  4. Generate from template. Read ./assets/feature-doc-template.md and fill in:
    • Frontmatter: feature, requirement_doc, created (today's date), status: draft
    • H1 heading: feature name
    • Summary: one-line description (ask the user or derive from context)
    • If the template file is not found, generate the doc using this minimal structure:
      ---
      feature: <feature-name>
      requirement_doc: <local path, external reference, or null>
      created: <today's date>
      status: draft
      ---
      # <Feature Name>
      <one-line summary>
      ## Decisions Log
      | Date | Decision | Reasoning | Alternatives Considered |
      |------|----------|-----------|------------------------|
      ## Open Questions
      None.
      ## Constraints
      None.
      ## Key Files
  5. Confirm creation. Show the user the proposed path and a content summary.

Load Behavior

Always confirm before loading.

Steps:

  1. Read the context doc. Parse the frontmatter and all sections.
  2. Resolve the linked requirement doc if requirement_doc is not null. Local path → read directly. External reference (URL, ticket ID, or other identifier) and a connected MCP tool can resolve it → attempt the fetch. Neither applies → ask the user to paste the current requirement constraints directly -- expected, not an error. Use whatever is resolved to understand feature goals and scope, but do not modify it.
  3. Present the structured acknowledgment (see Output Formats below):
    • Feature name and summary
    • Status (from the frontmatter status field — surface explicitly)
    • Requirement doc status (linked or not linked)
    • Decision count and latest decision
    • Open questions (if any)
    • Constraints (if any)
  4. Honor all logged decisions. Every decision in the log is an active commitment. Never contradict a logged decision without explicit discussion and a new decision entry explaining the change.
  5. Respect constraints as non-negotiable. Constraints are harder than decisions -- they represent boundaries that cannot be crossed without a deliberate, documented override.
  6. Flag open questions when work touches them. If the current task involves an area with an unresolved question, surface it immediately. Never silently assume an answer.
Show full SKILL.md (671 more words)Show less

Enrich Behavior

Always confirm before writing.

What to capture in the Decisions Log:

  • Date -- when the decision was made
  • Decision -- what was decided, stated clearly and concisely
  • Reasoning -- why this choice was made, key factors
  • Alternatives Considered -- what else was evaluated and why it was rejected

Rules:

  1. Append-only. New entries go at the bottom of the Decisions Log table. Never modify or remove existing entries.
  2. Chronological order. Entries reflect the order decisions were made, not grouped by topic.
  3. Concise but complete. Each entry must be understandable on its own without re-reading the full conversation.
  4. Feature-bound only. Capture only decisions relevant to this specific feature. Cross-cutting concerns, project-wide conventions, and general preferences belong elsewhere.
  5. Resolve open questions explicitly. When an open question gets answered, add the answer as a decision in the log and remove the question from the Open Questions list.
  6. Constraints are non-negotiable. Once recorded, a constraint binds. Changing a constraint requires a new decision entry explaining why it is being revised.
  7. Constraint Override Protocol. If the user explicitly says to override a constraint (e.g., "forget that constraint, we've changed direction"), never silently delete it. Instead: (a) ask the user to confirm the override explicitly, (b) strike through the constraint in the Constraints section (prefix with ~~), and (c) add a decision entry in the Decisions Log recording the override and reasoning. Constraint history preserved; binding status revoked.
  8. Key Files dedup. When adding to the Key Files table, check whether the path already exists in the table. If it does — skip.
  9. Cross-cutting check. After enriching, apply the learning-harvest cross-cutting test: (1) does it name a pattern or approach, not a feature-specific fact? (2) could a developer on a different feature apply it without knowing this feature's context? If both pass — silently add it to the learning-harvest queue. Do not prompt the user here.

Document Discovery

When the user asks to load or resume but does not specify which feature:

  1. Scan the context base directory for .md files.
  2. Match by frontmatter feature field or by filename.
  3. Multiple docs exist → present a numbered list with feature name, creation date, and decision count. Let the user choose.
  4. Only one doc exists → suggest loading it. Confirm before proceeding.
  5. No docs exist → inform the user and suggest creating one.
  6. Fuzzy match: the user's term partially matches multiple docs (e.g., "auth" matching user-authentication.md and oauth-authentication.md) → show all partial matches with full filenames and let the user choose. Never guess.

When the user mentions a feature name in conversation, check whether a matching context doc exists. If it does and has not been loaded this session, suggest loading it.

Output Formats

Load: show feature name, status (from frontmatter), requirement doc status, decision count, open questions, constraints, latest decision. Close with: "All logged decisions are active. Constraints are non-negotiable. I will flag open questions when work touches them."

Enrich: show exactly what will be added (decision, reasoning, alternatives considered). Wait for confirmation before writing.

Create: show proposed path, feature name, requirement doc link. Wait for confirmation before creating.

Integration with Other Skills

This atom is composed by the molecules that orchestrate feature workflows:

  • design-blueprint — invokes Create or Load in Step 1 (Establish Context), then invokes Enrich at each design-level checkpoint to capture decisions as they emerge
  • code-forge — invokes Load in Step 1 (Establish Implementation Context), then invokes Enrich throughout Steps 3–5 to capture implementation decisions, key files, and resolved questions
  • refactor-safely — invokes Document Discovery and Load in Step 1, persists the approved refactor plan via Enrich in Step 3, and captures final decisions in Step 8
  • bug-fix — invokes Document Discovery and Load in Step 1, captures diagnosis and repair decisions via Enrich in Step 7

When a context doc is active (loaded in the current session), Enrich runs continuously -- the AI monitors the conversation for decisions worth capturing and suggests enrichment as they arise. This is not limited to the molecule that loaded the doc; any skill producing decisions can trigger an enrichment suggestion.

© techygarg, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (assets) in skills/context-anchoring of techygarg/lattice.

  • SKILL.md
  • assets/feature-doc-template.md

Open the folder on GitHubat commit 4d6c35f

Compare with similar skills

Context Anchoring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Context Anchoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Anchoring this skilltechygarg/lattice198—~2.9kAutomated safety check: PassMIT
Guidelinesakash-network/node1.1k22 repos~577Automated safety check: PassMIT
Component Refactoringlangflow-ai/langflow156k—~3.5kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman41k—~2.6kAutomated safety check: PassGPL-3.0
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT

Similar skills

  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 22 repos~577 tokens
    DevelopmentAuto-check passed
  • Component Refactoring

    langflow-ai/langflow

    Refactor high-complexity React components in Langflow frontend.

    156k GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    41k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Codex

    skills-directory/skill-codex

    A skill your agent uses when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing

    1.5k GitHub starsUsed in 3 repos~1.8k tokens
    DevelopmentAuto-check passed

More from techygarg/lattice

All 33 skills in this repo
  • Architecture Compass

    techygarg/lattice

    Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a…

    198 GitHub stars~4.4k tokensUpdated 2 days ago
    Auto-check passed
  • Lattice Init

    techygarg/lattice

    Guided setup and upgrade-check experience for Lattice projects -- scans the repository, detects existing configuration and outdated conventions, suggests refiners and available upgrades in priority…

    198 GitHub stars~3.3k tokensUpdated 2 days ago
    Auto-check passed
  • Skill Align

    techygarg/lattice

    Audit and fix all Lattice documentation, README, docs/, PROJECT.md, GitHub issue templates, and CLAUDE.md to ensure they are fully aligned with the current skill inventory.

    198 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Skill Validate

    techygarg/lattice

    Validate any Lattice SKILL.md against all tier conventions — atoms, molecules, and refiners.

    198 GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Architecture Refiner

    techygarg/lattice

    Facilitate a structured conversation to define architecture principles for a repository.

    198 GitHub stars~3.7k tokensUpdated 2 days ago
    Auto-check passed
  • Clean Code Refiner

    techygarg/lattice

    Facilitate a structured conversation to define clean code principles for a repository.

    198 GitHub stars~3k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Context Anchoring

What does Context Anchoring do?

Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development. Context Anchoring is an agent skill from techygarg/lattice. Manage per-feature living documents that capture decisions, constraints, and reasoning across AI sessions during active development.

When should I use Context Anchoring?

Context Anchoring fits situations like: starting a new feature; making technical decisions; resolving questions; context needs to persist across sessions.

How do I install Context Anchoring in Claude Code?

Run `npx skills add techygarg/lattice --skill context-anchoring -a claude-code`. Or copy the skill folder (skills/context-anchoring in techygarg/lattice) into .claude/skills/context-anchoring in your project. Claude Code loads it when a task matches its description.

How do I install Context Anchoring in Codex?

Run `npx skills add techygarg/lattice --skill context-anchoring -a codex`. Or copy the skill folder (skills/context-anchoring in techygarg/lattice) into .agents/skills/context-anchoring in your project. Codex loads it when a task matches its description.

Can I use Context Anchoring in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add techygarg/lattice --skill context-anchoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context-anchoring, .gemini/skills/context-anchoring, .github/skills/context-anchoring and .opencode/skills/context-anchoring in your project.

What does Context Anchoring need to run?

SKILL.md names no scripts, command-line tools or credentials: Context Anchoring is instructions for the agent only.

Does Context Anchoring access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Context Anchoring safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Context Anchoring use?

Context Anchoring is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Context Anchoring use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Context Anchoring?

Skills that share tags, products or a category with Context Anchoring: Guidelines (akash-network/node, 1.1k stars), Component Refactoring (langflow-ai/langflow, 156k stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 41k stars) and ast-grep Structural Search (code-yeongyu/oh-my-openagent, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context Anchoring?

techygarg (a GitHub user) maintains it in techygarg/lattice, which has 198 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 6, 2026.

Source: techygarg/lattice on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.