agentsclimarketplace

Context anchor

Skill onfire7777/universal-ai-skills-library/skills/context-anchor

Set and maintain a persistent core topic or purpose for the entire AI session. Use when the user sets a core topic, anchors context, says "let's focus on X", "today we're building Y", "we're working on Z", or asks the assistant to stay on track across a long task.From its SKILL.md

Install
npx -y skills add onfire7777/universal-ai-skills-library --skill context-anchor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.6 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Context Anchor

Persistent attention anchoring for long AI sessions. Externalizes the core session purpose to ~/.context_anchor.md and enforces periodic recitation to maintain focus across many tool calls, preventing drift from tangential requests.

Activation

Detect explicit triggers: user says "set anchor", "anchor this", "core topic is", "focus on". Detect implicit triggers: user frames session purpose with "today we're building X", "let's work on Y", "this project is about Z". Summarize the detected intent and confirm with the user before setting.

On session start, check if ~/.context_anchor.md exists. If it does, run anchor.py show immediately and recite the anchor to orient yourself.

Quick Start

# Set anchor with full context
python3 /home/ubuntu/skills/context-anchor/scripts/anchor.py set "Building a SaaS analytics dashboard" \
  -o "Design database schema" "Build REST API" "Create React frontend" \
  -b "No mobile app" "No payment processing" \
  -s "All CRUD endpoints work" "Dashboard renders real-time metrics"

# View current anchor
python3 /home/ubuntu/skills/context-anchor/scripts/anchor.py show

# Check if a sub-task aligns with the anchor (AI-powered relevance scoring)
python3 /home/ubuntu/skills/context-anchor/scripts/anchor.py check "Should I add Stripe integration?"

Recitation Discipline

This is the most critical behavior. You MUST enforce periodic recitation to keep the anchor in your active attention window.

Every 5-10 tool calls (aim for ~7), run anchor.py show and mentally reaffirm: "My core focus is [anchor topic]." If a todo.md also exists, recite both together - anchor first (WHY), then todo (WHAT). If 10 tool calls elapse without recitation, force an immediate refresh.

On recitation failure (file missing or inaccessible), fall back to your last known anchor from memory. Log the failure silently and retry next interval. Notify the user only if the anchor file is persistently unavailable.

Handling Tangential Requests

When the user sends a request that diverges from the anchor:

  1. Run anchor.py check "user's request" if relevance is unclear.
  2. If the score is below 5/10 (divergent), acknowledge: "I notice this diverges from our core focus on [anchor topic]. I'll handle this, then return to the main thread."
  3. Fulfill the request completely - the user always has final authority over the anchor.
  4. After completing the tangent, explicitly restate the anchor: "Returning to our core focus: [anchor topic]."

Never refuse a user request because of the anchor. The anchor is a guide, not a constraint.

Evolving the Anchor

As projects progress, refine the anchor rather than clearing it:

# Add a new objective
python3 /home/ubuntu/skills/context-anchor/scripts/anchor.py update --add-objective "Implement WebSocket for real-time updates"

# Add a boundary
python3 /home/ubuntu/skills/context-anchor/scripts/anchor.py update --add-boundary "Skip authentication for MVP"

# Narrow focus to current phase
python3 /home/ubuntu/skills/context-anchor/scripts/anchor.py update --refine "Phase 2: Backend API development for the analytics dashboard"

Confirm with the user before making anchor changes. Do not update more than once per 3 tool calls to prevent instability.

Integration with todo.md

The anchor and todo.md are complementary:

FilePurposeContains
~/.context_anchor.mdWHY - the overarching purposeCore topic, objectives, boundaries, success criteria
todo.mdWHAT - the specific tasksCurrent tasks, progress, next steps

When both exist, recite them together during periodic recitation. On anchor changes, review todo.md to ensure task alignment with the updated purpose.

Commands Reference

CommandUsage
setanchor.py set "topic" [-o objectives...] [-b boundaries...] [-s success...]
showanchor.py show
checkanchor.py check "message to evaluate"
updateanchor.py update [--add-objective text] [--add-boundary text] [--refine text]
historyanchor.py history
clearanchor.py clear

Advanced Patterns

For deep insights into why anchoring works, recitation schedules by session length, drift detection patterns, multi-layer anchoring, and anchor conflict resolution, read: /home/ubuntu/skills/context-anchor/references/attention_patterns.md

What ships with it: 2 files

21.9 KB alongside SKILL.md, 1 of them executable

references/

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.