context-anchoring

Manage function-scoped dynamic documents to record decisions, constraints, and reasoning made during AI sessions; supports creating, loading, and appending documents. Intended for feature development (design, implementation, bug fixes, refactoring) and not for whole-repo assessments or product-level specifications. Use when users mention loading/updating context, decision records, or continuing prior work.

Last repository push
GitHub Stars
218
Forks
18
Issues / PRs
3

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "context-anchoring" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-146b39ecf54cddebdb6e98b517f79bc5de8844268754b468c7697a9e8b7727b0. Verify the upstream source and version against https://github.com/techygarg/lattice before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Manage function-scoped dynamic documents to record decisions, constraints, and reasoning made during AI sessions; supports creating, loading, and appending documents. Intended for feature development (design, implementation, bug fixes, refactoring) and not for whole-repo assessments or product-level specifications. Use when users mention loading/updating context, decision records, or continuing prior work.

0 Downloads

Introduction source: third_party · techygarg · 0.0.1 Reference

SkillPi interpretation

Tasks
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'.
Inputs and outputs
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.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
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.

Behavior Purpose Reactive Trigger Proactive Trigger
Create Start a new context doc User asks to create one AI detects feature work beginning without a doc
Load Restore context from an existing doc User asks to load/resume AI detects existing docs and suggests loading
Enrich Add a new decision, constraint, or resolution User asks to capture something AI detects a decision made in conversation

Status Lifecycle

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

Value Set by
draft context-anchoring Create — design not yet complete
approved design-blueprint Step 3 — L1–L4 complete, design reviewed
complete code-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.

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.

Version history

  1. v2.2.0 GitHub ↗
    Original release notes

    ## What's Changed * Standardize the multi-host plugin structure around a shared skills/ folder by @techygarg in https://github.com/techygarg/lattice/pull/41 * Add Docusaurus site scaffold + GitHub Pages deploy by @techygarg in https://github.com/techygarg/lattice/pull/44 * fix(molecules): take Level 1 from a linked requirement doc in design-blueprint by @ShuratCode in https://github.com/techygarg/lattice/pull/49 * feat(molecules): per-molecule additional_instructions in config (#50) by @techygarg in https://github.com/techygarg/lattice/pull/51 * fix(atoms): keep learning-harvest entries short when the file has drifted by @IdoGvili in https://github.com/techygarg/lattice/pull/54 ## New Contributors * @IdoGvili made their first contribution in https://github.com/techygarg/lattice/pull/54 **Full Changelog**: https://github.com/techygarg/lattice/compare/v2.1.0...v2.2.0

  2. v2.1.0 GitHub ↗
    Original release notes

    ## What's Changed * Skills: wording clarity, skill-enhance pipeline, corpus-wide precision-hygiene pass by @techygarg in https://github.com/techygarg/lattice/pull/38 * Add verifier subagent and deterministic verification runner by @techygarg in https://github.com/techygarg/lattice/pull/39 **Full Changelog**: https://github.com/techygarg/lattice/compare/v2.0.0...v2.1.0

  3. v2.0.0 GitHub ↗
    Original release notes

    ## What's Changed * Shard requirements by epic, strip rollup state, make requirement storage pluggable by @techygarg in https://github.com/techygarg/lattice/pull/34 * feat(molecules): add refiners-update molecule by @ShuratCode in https://github.com/techygarg/lattice/pull/33 ## New Contributors * @ShuratCode made their first contribution in https://github.com/techygarg/lattice/pull/33 **Full Changelog**: https://github.com/techygarg/lattice/compare/v1.5.0...v2.0.0

  4. v1.5.0 GitHub ↗
    Original release notes

    ## What's Changed * Add security workflow and CODEOWNERS by @techygarg in https://github.com/techygarg/lattice/pull/25 * Add Codex plugin by @techygarg in https://github.com/techygarg/lattice/pull/26 * Skills tuning: pipeline integrity, language compliance, and simplicity principles by @techygarg in https://github.com/techygarg/lattice/pull/29 **Full Changelog**: https://github.com/techygarg/lattice/compare/v1.4.0...v1.5.0

  5. v1.4.0 GitHub ↗
    Original release notes

    ## What's Changed * Initial atom, molecules and refiners set up by @techygarg in https://github.com/techygarg/lattice/pull/1 * Multiple enhancements over base set up by @techygarg in https://github.com/techygarg/lattice/pull/2 * Add collaborative-judgment atom by @techygarg in https://github.com/techygarg/lattice/pull/3 * Optimization - Reduce prompt size by @techygarg in https://github.com/techygarg/lattice/pull/4 * Add icon for lattice by @techygarg in https://github.com/techygarg/lattice/pull/5 * add bug fix molecule by @techygarg in https://github.com/techygarg/lattice/pull/6 * Add refactor molecule and enhanced bug-fix module by @techygarg in https://github.com/techygarg/lattice/pull/7 * Add alternative architecture patterns support by @techygarg in https://github.com/techygarg/lattice/pull/9 * Skills Compression by @techygarg in https://github.com/techygarg/lattice/pull/10 * Atom and their default doc Improvements and optimization by @techygarg in https://github.com/techygarg/lattice/pull/11 * Enhance language support and documentation across Lattice framework by @techygarg in https://github.com/techygarg/lattice/pull/12 * Update claude code plugin installation intructions by @techygarg in https://github.com/techygarg/lattice/pull/13 * Enhance docs by @techygarg in https://github.com/techygarg/lattice/pull/14 * Add open source repository standards by @techygarg in https://github.com/techygarg/lattice/pull/15 * Add requirement-forge molecule by @techygarg in https://github.com/techygarg/lattice/pull/19 * Add transform molecule by @techygarg in https://github.com/techygarg/lattice/pull/20 * Enhancements by @techygarg in https://github.com/techygarg/lattice/pull/21 * Add learning-harvest atom: experiential knowledge flywheel across all lifecycle molecules by @techygarg in https://github.com/techygarg/lattice/pull/22 **Full Changelog**: https://github.com/techygarg/lattice/commits/v1.4.0

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value88/100

Highlights

  • 解决 AI 会话间决策丢失的核心痛点
  • 提供完整的功能级上下文生命周期管理
  • 与多个开发技能深度集成,提升开发连贯性
Trigger Precision92/100

Highlights

  • 触发词覆盖全面,包含多种自然语言变体
  • 边界清晰,明确限定功能级范围
  • 使用场景描述具体明确
Structure and Standards85/100

Areas to improve

  • 缺少显式 When to Use 章节 Reported severity: Minor

    文档中已包含使用场景描述,但缺少显式的 "When to Use" 章节标题

    Recommendation: 建议增加显式的 "When to Use" 章节以提升文档规范性

  • 文档结构可进一步标准化 Reported severity: Minor

    整体结构良好,但可考虑增加目录或更标准化的章节划分

    Recommendation: 建议增加文档目录或采用更标准的技能文档结构模板

Highlights

  • 三大行为(Create/Load/Enrich)步骤清晰完整
  • 包含详细的文档模板和决策日志格式示例
  • 状态生命周期管理明确
Execution Reliability90/100

Highlights

  • 所有操作均需用户确认,确保安全性
  • 完善的异常处理机制(模板缺失降级、requirement_doc 解析失败处理)
  • 约束覆盖协议严谨,保留历史记录
  • 跨切面集成机制(learning-harvest)设计合理
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 144

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.