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.

25 stars

Best use case

agent-context-loader is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Execute proactive auto-loading: automatically detects and loads agents.md files. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

Teams using agent-context-loader should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/agent-context-loader/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/jeremylongshore/claude-code-plugins-plus-skills/agent-context-loader/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/agent-context-loader/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How agent-context-loader Compares

Feature / Agentagent-context-loaderStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Execute proactive auto-loading: automatically detects and loads agents.md files. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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 Skills

react-context-setup

25
from ComeOnOliver/skillshub

React Context Setup - Auto-activating skill for Frontend Development. Triggers on: react context setup, react context setup Part of the Frontend Development skill category.

dataset-loader-creator

25
from ComeOnOliver/skillshub

Dataset Loader Creator - Auto-activating skill for ML Training. Triggers on: dataset loader creator, dataset loader creator Part of the ML Training skill category.

cursor-context-management

25
from ComeOnOliver/skillshub

Optimize context window usage in Cursor with @-mentions, context pills, and conversation strategy. Triggers on "cursor context", "context window", "context limit", "cursor memory", "context management", "@-mentions", "context pills".

filesystem-context

25
from ComeOnOliver/skillshub

This skill should be used when the user asks to "offload context to files", "implement dynamic context discovery", "use filesystem for agent memory", "reduce context window bloat", or mentions file-based context management, tool output persistence, agent scratch pads, or just-in-time context loading.

what-context-needed

25
from ComeOnOliver/skillshub

Ask Copilot what files it needs to see before answering a question

context-map

25
from ComeOnOliver/skillshub

Generate a map of all files relevant to a task before making changes

go-context

25
from ComeOnOliver/skillshub

Use when working with context.Context in Go — placement in signatures, propagating cancellation and deadlines, and storing values in context vs parameters. Also use when cancelling long-running operations, setting timeouts, or passing request-scoped data, even if they don't mention context.Context directly. Does not cover goroutine lifecycle or sync primitives (see go-concurrency).

../../../marketing-skill/marketing-context/SKILL.md

25
from ComeOnOliver/skillshub

No description provided.

context-engine

25
from ComeOnOliver/skillshub

Loads and manages company context for all C-suite advisor skills. Reads ~/.claude/company-context.md, detects stale context (>90 days), enriches context during conversations, and enforces privacy/anonymization rules before external API calls.

media-downloader

25
from ComeOnOliver/skillshub

智能媒体下载器。根据用户描述自动搜索和下载图片、视频片段,支持视频自动剪辑。 Smart media downloader. Automatically search and download images/video clips based on user description, with auto-trimming support. 触发方式 Triggers: "下载图片", "找视频", "download media", "download images", "find video", "/media"

json-to-llm-context

25
from ComeOnOliver/skillshub

Turn JSON or PostgreSQL jsonb payloads into compact readable context for LLMs. Use when a user wants to compress JSON, reduce token usage, summarize API responses, or convert structured data into model-friendly text without dumping raw paths.

opencontext

25
from ComeOnOliver/skillshub

Persistent memory and context management for AI agents using OpenContext. Keep context across sessions/repos/dates, store conclusions, and provide document search workflows.