managing-context

Maintains and audits standing context across rules.d fragments, skills, and CLAUDE.md files.

Updated Oct 16, 2025
One-click install
npx skills add https://github.com/jlui17/dotfiles --skill managing-context-jlui17
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: managing-context
Source: https://github.com/jlui17/dotfiles/tree/main/agents/skills/managing-context
Command: npx skills add https://github.com/jlui17/dotfiles --skill managing-context-jlui17

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Standing context for AI coding agents drifts: rules get duplicated across CLAUDE.md, skills, and output styles, stale lessons linger, and new instructions land in the wrong layer. This Skill routes every piece of context to its correct home and keeps the corpus free of conflicting duplicates. ## Core Features & Use Cases - Layer routing: Decides whether a lesson belongs in a global rules.d fragment, a repo CLAUDE.md, a skill, or nowhere, based on scope and audience. - Duplicate detection and consolidation: Classifies overlaps as undeclared duplicates, declared copies, or pointers, and picks the canonical home so each rule legislates in exactly one place. - Writing standards: Encodes the craft rules for skill descriptions, the global CLAUDE.md letter voice, and repo CLAUDE.md files, distilled from Anthropic's skill-creator and Claude context-engineering guidance. - Use Case: After Justin corrects the agent twice about the same behavior, use this Skill to save the generalized lesson as a rules.d fragment, then run the scoped sweep in resources/sweeps.md to confirm no twin exists elsewhere. ## Quick Start Ask the agent to remember a standing rule or audit the existing context files, and it will route the lesson to the right layer and sweep for duplicates before committing.

Frequently Asked Questions about managing-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide where a new rule for Claude Code should live?▼

Route by scope: rules useful in every session go to a global rules.d fragment or skill, project-specific rules go to that repo's CLAUDE.md or skills, and session-only facts are never persisted. Personal facts go to auto-memory while standing rules go to rules.d.

How do I avoid duplicating instructions across CLAUDE.md and skills?▼

Give every rule exactly one canonical home and use pointers elsewhere. A skill never restates an always-on rule since that layer is guaranteed loaded; it cites it instead. After each edit, run the scoped sweep in resources/sweeps.md to grep for twins.

When should a lesson become a skill versus a CLAUDE.md line?▼

Triggers and gates belong in the always-on CLAUDE.md layer because a skill loads too late to gate its own loading. Detail, procedure, and reference material belong in the skill, which only pays its context cost when triggered.

Can I edit ~/CLAUDE.md directly to add a rule?▼

No. ~/CLAUDE.md and ~/.codex/AGENTS.md are generated files that the dotfiles install overwrites. Edit the source fragments in agents/rules.d/ instead, and put machine-only rules in the gitignored agents/rules.d/99-local.md.

What makes a good skill description for triggering?▼

Write it as a pure use-when statement in third person, about 100 words, with one trigger per distinct case front-loaded with the operative word. The description is the only part always in context, so the body carries the how.