Skip to content
Back to skills

Scoped Agents

ASecurity

Scaffold a per-folder AGENTS.md and wire it into the repo-root AGENTS.md scoped table. Use when adding folder-specific agent rules, splitting a monolithic root AGENTS.md into per-folder files, or when asked to create or scope an AGENTS.md for a subdirectory. Enforces that AGENTS.md is the source of truth and CLAUDE.md stays a thin @-import.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 16, 2026
ai-agentsgo

Works with

  • claude code

Security analysis

A100/100

Scanned October 16, 2026

npx -y skills add chipi/agentic-ai-homelab --skill scoped-agents --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scoped Agents?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Scoped Agents
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/chipi-scoped-agents/badge)](https://www.skillsdirectory.com/skills/chipi-scoped-agents)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: scoped-agents
description: Scaffold a per-folder AGENTS.md and wire it into the repo-root AGENTS.md scoped table. Use when adding folder-specific agent rules, splitting a monolithic root AGENTS.md into per-folder files, or when asked to create or scope an AGENTS.md for a subdirectory. Enforces that AGENTS.md is the source of truth and CLAUDE.md stays a thin @-import.
---

# scoped-agents

Create a folder-scoped `AGENTS.md` and register it in the repo-root `AGENTS.md`,
following the layering rules below. Use it to add new scoped rules, or to split
an overgrown root `AGENTS.md` into per-folder files.

## Load-bearing rules (do not violate)

- **`AGENTS.md` is the source of truth** — harness-agnostic, carries the real
  rules. `CLAUDE.md` is a THIN layer that `@AGENTS.md`-imports and adds only
  Claude-specific notes. Never invert this. If a repo has a fat `CLAUDE.md` and
  no `AGENTS.md`, fix that first (move the rules into `AGENTS.md`, reduce
  `CLAUDE.md` to the import + Claude-only notes).
- **Scoped files never duplicate the root or the global rules.** A folder
  `AGENTS.md` holds only what is specific to that folder. Repo-wide rules stay at
  the root; cross-repo operator rules stay in the global `~/.config/AGENTS.md`.
- **More-specific wins.** Precedence: direct chat > memory > deeper scoped
  (`a/b/AGENTS.md`) > shallower scoped (`a/AGENTS.md`) > root > global.

## Steps

1. **Confirm the pattern.** Repo root has `AGENTS.md`; if Claude Code is used,
   `CLAUDE.md` is thin and imports it (`@AGENTS.md`). Establish that before scoping.
2. **Create `<folder>/AGENTS.md`** from the template below — only rules that truly
   belong to that folder. If those rules currently live in the root, MOVE them
   (don't leave a duplicate).
3. **Register it** in the root `AGENTS.md` under `## Scoped AGENTS.md` (create the
   section + table if missing). One row: linked path + one-line scope.
4. **If splitting the root:** verify every moved rule lands in exactly one scoped
   file and the root still links to it. The root shrinks; nothing is lost. Grep
   for stale references to any rule you moved (e.g. "rule #N").
5. **Validate.** If the scoped file sits inside a docs tree built by mkdocs/etc.,
   make sure it doesn't publish as an orphan page (exclude it) — then run the
   `docs-preflight` skill.

## Template — `<folder>/AGENTS.md`

```markdown
# AGENTS.md — <folder>/ (scoped rules)

Loaded when working under `<folder>/`. Layers on top of the repo-root
[`AGENTS.md`](<relative-path-to-root>AGENTS.md); never duplicates or contradicts it.

<one sentence: what this folder is and what the rules here govern>

## <Rule heading>

<the folder-specific rule; include the WHY when it is non-obvious>
```

## Root registration — add under `## Scoped AGENTS.md`

```markdown
## Scoped AGENTS.md in this repo

Folder-specific rules live next to the code they govern. More-specific folder
wins (e.g. `a/b/` over `a/` over root).

| Path | Scope |
|---|---|
| [`<folder>/AGENTS.md`](<folder>/AGENTS.md) | <one-line scope> |
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.