agent-context-loader
Execute proactive auto-loading: automatically detects and loads agents.md files. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.
What this skill does
# Agent Context Loader ## Overview Automatic discovery and loading of `AGENTS.md` files across project hierarchies for AI coding agents. This skill scans the current workspace and its parent directories to locate agent instruction files, then surfaces their contents so the active agent session has full operational context. ## Prerequisites - A project workspace containing one or more `AGENTS.md` files at any directory depth - Read and Glob permissions to traverse the directory tree - Grep access for searching file contents when multiple candidates exist ## Instructions 1. Scan the current working directory and all ancestor directories (up to the filesystem root or repository root) for files named `AGENTS.md` or `agents.md`. 2. Search subdirectories of the current workspace for additional `AGENTS.md` files that may apply to sub-projects or modules. 3. Determine load order: files closer to the repository root load first (global context), files in deeper directories load later (override or supplement). 4. Read each discovered `AGENTS.md` file and extract its instruction blocks, workflow definitions, and constraint declarations. 5. Merge instructions into a unified context, noting any conflicts between levels (e.g., a subdirectory agent overriding a root-level rule). 6. Present the loaded context as a structured summary: source file path, instruction count, and any detected conflicts. 7. Cache the discovery results for the current session to avoid redundant filesystem scans on subsequent activations. ## Output - Ordered list of discovered `AGENTS.md` file paths with their directory depth - Merged instruction set combining all discovered agent contexts - Conflict report highlighting any contradictory directives between levels - Session cache status indicating whether results are fresh or reused ## Error Handling | Error | Cause | Solution | |-------|-------|----------| | No `AGENTS.md` found | Workspace has no agent instruction files | Confirm the correct working directory; create an `AGENTS.md` at the project root if needed | | Permission denied on directory traversal | Restricted parent directories above the workspace | Limit scan depth to the repository root (detected via `.git/` presence) | | Circular symlink detected | Symlinked directories create an infinite traversal loop | Skip symlinked directories during the scan; log a warning with the symlink path | | Conflicting instructions across levels | A subdirectory `AGENTS.md` contradicts the root-level file | Flag the conflict in the output; apply the more specific (deeper) instruction by default | | File encoding error | `AGENTS.md` uses a non-UTF-8 encoding | Attempt latin-1 fallback; report the file path and encoding issue | ## Examples **Example 1: Monorepo with per-package agent instructions** - Structure: Root `AGENTS.md` sets global conventions; `packages/api/AGENTS.md` adds API-specific tooling rules. - Result: Both files loaded in order. The API-specific rules supplement the global context without conflict. **Example 2: Nested workspace with conflicting commit policies** - Structure: Root `AGENTS.md` says "always sign commits"; `services/legacy/AGENTS.md` says "skip commit signing." - Result: Conflict detected and reported. The deeper (legacy) directive is applied with a warning noting the override. **Example 3: First-time setup with no agent files** - Structure: A freshly cloned repository with no `AGENTS.md` anywhere. - Result: Scan completes with zero files found. Output includes a suggestion to create `AGENTS.md` at the repository root with a minimal template. ## Resources - Claude Code AGENTS.md specification: https://docs.anthropic.com/en/docs/agents - Monorepo workspace patterns for agent configuration: https://docs.anthropic.com/en/docs/claude-code - File discovery best practices for hierarchical configuration loading
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.