Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Setup Agent Machine

ASecurity

Set up a directory as an agent-ready machine context by interviewing the user, recording searchable directories in a YAML manifest, building an indexes/ directory of per-directory index files, and writing an AGENTS.md that tells any agent where to look and how to maintain its own indexes. Use when the user says /setup-agent-machine, "set up this machine for agents", "build an AGENTS.md for my directories", "index my directories for agents", or wants an agent to know where to search on this ma...

10 stars
0 votes
0 copies
0 views
Added 10/6/2026
documentationbash

Security Analysis

A100/100

Scanned 10/6/2026

$npx -y skills add tomzx/agents --skill setup-agent-machine --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Setup Agent Machine?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Setup Agent Machine
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tomzx-setup-agent-machine/badge)](https://www.skillsdirectory.com/skills/tomzx-setup-agent-machine)

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

Download with Pro
Files
SKILL.md
---
name: setup-agent-machine
description: Set up a directory as an agent-ready machine context by interviewing the user, recording searchable directories in a YAML manifest, building an indexes/ directory of per-directory index files, and writing an AGENTS.md that tells any agent where to look and how to maintain its own indexes. Use when the user says /setup-agent-machine, "set up this machine for agents", "build an AGENTS.md for my directories", "index my directories for agents", or wants an agent to know where to search on this machine.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir:*, ls:*, date:*)
argument-hint: "[path ...]"
---

# Setup Agent Machine

Prepares the current directory as a standing context for coding agents by producing three artifacts: `agent-machine.yaml` (the manifest of directories worth searching), `indexes/` (one index file per directory, built by delegating to the `index-directory` skill), and `AGENTS.md` (the instructions that tell any future agent how to use and maintain those indexes).

The point is lookup speed and accuracy: given a prompt, an agent should read the indexes, decide which two or three directories are relevant, and search only there instead of guessing or scanning the whole machine.

## Prerequisites

- The current working directory is where the artifacts will be created.
- The user is available to answer interview questions (this skill is interactive; never invent paths).
- Any path given as arguments (`$1`, `$2`, ...) is treated as a pre-confirmed manifest entry.
- If `AGENTS.md` already exists in the directory, ask the user before modifying it.

## Path Semantics

Manifest entries are absolute paths in one of two forms:

- `/some/path`: index that specific directory as a single unit.
- `/some/path/*`: index each directory directly under `/some/path` separately, and index any directory that appears there later.

A path must exist when it is added. A `/*` path itself must also exist; only its children are expanded.

## Steps

### 1. Check existing state

Look for `AGENTS.md`, `agent-machine.yaml`, and `indexes/` in the current directory.

- If none exist, this is a fresh setup.
- If some exist, this is a re-run: load the manifest, treat its entries as confirmed, and plan to add new paths and rebuild only missing or stale indexes (an index is stale if its `Last indexed` date is older than 30 days or the user says the directory changed significantly).
- If `AGENTS.md` exists and was not generated by this skill (it lacks the `Agent machine context` marker), ask whether to append a generated section, overwrite it, or abort.

### 2. Interview the user

Collect the list of directories containing code or documents an agent may need to search.

1. Explain the two path forms from Path Semantics with one example of each.
2. Ask for paths in rounds. Each round accepts one or more paths plus an optional one-line description per path (for example, "blog content repo" or "meeting notes"). Confirm each round before moving on.
3. If arguments were provided, list them as already confirmed and ask only for additions.
4. Offer to suggest candidates only if the user asks; suggest by listing immediate subdirectories of common roots (`~/src`, `~/Documents`, `~/notes`) and let the user pick. Never add a suggested path without confirmation.
5. Verify every path exists (`ls`). Drop and report any that do not, unless the user corrects the path.
6. Stop when the user says they are done. An empty list is a valid outcome only if arguments were provided; otherwise ask once more before aborting.

### 3. Write the manifest

Write `agent-machine.yaml` in the current directory, preserving existing entries on re-run:

```yaml
# Directories agents should be able to search on this machine.
# A path without /* is indexed as one directory.
# A path ending in /* indexes each directory under it separately,
# including directories added later.
paths:
  - /home/tomzx/src/agents
  - /home/tomzx/notes/*
```

Add a `# ` comment line above each entry holding the user's one-line description when one was given.

### 4. Build the indexes

Create `indexes/` if missing. For every manifest entry, expand `/*` entries into concrete child directories.

Index each directory by running `skills/index-directory/SKILL.md`, passing the directory as `$1` and `indexes/<name>.md` as `$2`.
When the user gave a one-line description during the interview, include it in the index's "What it is" line.

On re-run, index a directory only if its index is missing or stale (`Last indexed` older than 30 days or the user says it changed significantly).

### 5. Write AGENTS.md

Write (or update the generated section of) `AGENTS.md` using this template, adjusting the artifact names if the user chose different ones:

```markdown
# Agent machine context

This directory is an agent context for this machine.

## Where things are

- `agent-machine.yaml` lists every directory you may search. A path ending in `/*` means each directory under it is indexed separately, including new ones.
- `indexes/` holds one index file per indexed directory, named after the directory path.

## How to decide where to look

1. Before searching broadly, list `indexes/` and read the index files whose "What it is" line could match the current task.
2. Pick at most three candidate directories, then search inside them (Grep, Glob, file reads) instead of scanning unrelated paths.
3. If no index matches the task, say so rather than searching the whole machine.

## Keeping the indexes current

- If a directory from the manifest has no index file, index it with the index-directory skill when available, otherwise look inside it and write `indexes/<name>.md` matching the format of the existing index files.
- If a new directory appears under a `/*` path, index it the first time a task touches it or you notice it.
- If a directory's content has changed enough that its index is wrong, update that index.
- Running /sync-agent-machine in this directory refreshes stale and missing indexes in one pass.
- Only `agent-machine.yaml` and `indexes/` are yours to edit. Ask before changing anything else, including this file.
```

On re-run, keep the user's customizations to the generated section only if the user explicitly asks; otherwise regenerate it.

### 6. Verify and report

1. Confirm every manifest path (expanded for `/*`) has an index file, and every index file's `Last indexed` line is today's date.
2. Confirm `AGENTS.md` references the real artifact names.
3. Report using the output format below.

## Output Format

```markdown
## Agent machine setup (<date>)

Directory: <cwd>

### Manifest
- agent-machine.yaml: created / updated (N paths: N single, N globbed)

### Indexes
- Created: N
- Refreshed: N
- Still current: N

| Index file | Directory |
|------------|-----------|
| indexes/<name>.md | <path> |

### AGENTS.md
- created / section appended / updated / left untouched (reason)

### Next steps
1. Run /sync-agent-machine in this directory to refresh stale and missing indexes.
2. Re-run /setup-agent-machine here whenever you want to add paths.
3. Copy this directory's setup to other machines by re-running the skill there.
```

## Example Usage

**Scenario 1: Fresh setup**
```
/setup-agent-machine
```
Interviews the user, records 5 paths (3 single, 2 globbed), looks inside each of the 19 resulting directories, writes 19 index files, and generates `AGENTS.md` pointing at the manifest and `indexes/`.

**Scenario 2: Adding directories later**
```
/setup-agent-machine ~/src/new-project
```
Detects the existing setup, confirms `~/src/new-project` as a new single path, appends it to `agent-machine.yaml`, builds only its index, and leaves existing indexes untouched.

**Scenario 3: Re-run to refresh**
```
/setup-agent-machine
```
Finds three indexes older than 30 days and one directory the user says changed. Refreshes those four indexes and regenerates the `AGENTS.md` section, reporting 15 still-current indexes.

Attribution

tomzxtomzx
View sourceSee grades on GitHubMore from tomzx →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Context Fundamentals

Understand the components, mechanics, and constraints of context in agent systems. Use when designing agent architectures, debugging context-related failures, or optimizing context usage.

179001 votes

Architecture Diagram Creator

Create comprehensive HTML architecture diagrams with data flows, business context, and system architecture.

6661 votes

release-notes

Draft release notes and changelog entries from git history or merged PRs between two refs (tags/SHAs/branches), including breaking changes, migrations, and upgrade steps. Use when the user asks for release notes, changelog updates, or a GitHub Release draft.

1301 votes

docs-style-guide

Documentation style guide enforcer by @planetabhi. Applies and reviews the writing style guide when authoring or editing product documentation and tutorials. Use to check prose for voice, tense, word choice, inclusive language, formatting, code block, UI, Markdown, and number/date conventions.

11 votes

Docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in W...

1798860 votes
View all in documentation →