agentleFS
smarzbansmarzban/agent-skills/skills/repo-setup/SKILL.md

repo-setup

Skill1 starsChanged 3 days agoMITView on GitHub

Set up or audit a repo's working baseline for people and agents. Public AGENTS.md plus a gitignored AGENTS.local.md, ignore rules, one verify command that CI also runs, and a worktree setup script. Migrates an existing CLAUDE.md without losing a line. Use for "set up this repo for agents", "repo setup", "bootstrap the repo", "add AGENTS.md", "migrate CLAUDE.md to AGENTS.md". Not for installing dependencies or getting a project to run locally.

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pr-review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    pr-review

    Verify the technical accuracy of a vscode-docs pull request against the VS Code source code in microsoft/vscode. Use when reviewing a docs PR for factual correctness: setting names, command IDs, default values, API shapes, keybindings, versioned availability, and described behavior.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run <skill>/scripts/repo-audit and read every file it lists as existing.

    line 16
  2. Very specific:

    Write what was agreed, from reference/templates.md.

    line 19
  3. Distinctive:

    Never replace an existing file.

    line 45
  4. Very specific:

    Use the repo's existing verify entry point if it has one (make check, npm run verify).

    line 47
  5. Very specific:

    Never create AGENTS.override.md.

    line 49
  6. Very specific:

    When the audit finds a CLAUDE.md, a mixed AGENTS.md or another instruction file with real content, migrate it.

    line 68

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

repo-setup

Bring a repo, empty or existing, to a baseline that any agent harness can work in. This skill writes machinery and facts it can check: commands, ignore rules, scripts, CI. It writes no prose. The project overview, the README and the docs belong to writing-readmes and writing-docs.

Work on the current repo unless you are given a path.

Steps

<skill> in a command is this skill's folder, the one that holds this file. Run those scripts by that path, with the target repo as the working directory. A path without <skill>, such as scripts/verify, is in the target repo.

  1. Run <skill>/scripts/repo-audit and read every file it lists as existing. On an empty repo the audit reports everything missing; run it anyway.
  2. Settle the repo type, because it selects the optional files: solo or team (the audit's author count, an existing CODEOWNERS), public or private. Ask when the evidence does not say.
  3. Show the owner the audit and one proposal: each file to create, each edit to an existing file as a diff, and each owner decision. Wait for a yes. If the owner already told you to proceed without asking, print the proposal and continue. The separate yes for making private content public (reference/migration.md) is asked in every case.
  4. Write what was agreed, from reference/templates.md. Stay on the branch you found. If git status shows changes you did not make, another session is working here: leave its files alone, and ask the owner before you edit a file it has changed.
  5. Check the result:
    • The verify command exits 0, and the CI workflow runs that same command.
    • <skill>/scripts/repo-audit now reports both ignore rules as present.
    • git worktree add --detach ../<repo>-probe && (cd ../<repo>-probe && scripts/worktree-setup) succeeds; then run git worktree remove --force ../<repo>-probe. A repo with no commits cannot have a second worktree: report this check as not run. A worktree holds only committed files, so if the new scripts are not committed yet, copy them into the probe and say that you did.
    • AGENTS.md is inside its budget. Over budget is a warning for the report, not a failure.
  6. Report: created, edited (with the diff), left alone, owner decisions still open, and anything a check did not prove.

Files

TierFileWhen
CoreAGENTS.mdalways
CoreAGENTS.local.mdwhen there is private content to put in it; its ignore rule always
Core.gitignorealways: AGENTS.local.md, HANDOFF.md, and the rules for the detected stack
Corea verify command (scripts/verify, or the repo's own)when the repo has at least one real check
CoreCI workflow that runs the verify commandwhen a verify command exists
Corescripts/worktree-setupalways
Optionalissue and pull request templates, CODEOWNERSteam repos
Optional.editorconfig, .gitattributeswhen the owner wants them
Optionalsecret-scanning baselinepublic repos, and any repo that holds credentials locally

HANDOFF.md itself is not created here. The handoff skill writes one per worktree; this skill only makes sure git ignores it.

Rules

  • Never replace an existing file. Add the missing lines, keep the rest, and show the diff first.
  • Write a fact or leave the line out. Take build, test and lint commands from the CI config and the package scripts that the audit prints, and run each one before you write it down. A repo with no checks yet gets no verify command and no CI file. Report them as waiting for a stack; do not write a placeholder.
  • Use the repo's existing verify entry point if it has one (make check, npm run verify); the audit lists candidates under its verify row. Otherwise create scripts/verify. In both cases CI calls the same command a person runs.
  • Owner decisions are flagged and never invented: the licence, the security policy and its reporting channel, the code of conduct, CODEOWNERS entries, and remote settings (visibility, branch protection, hosted secret scanning). For a remote setting, give the exact command and let the owner run it. One exception: when the repo has a single author, propose * @<that-owner> for CODEOWNERS and ask for confirmation.
  • Never create AGENTS.override.md. Codex reads it in place of AGENTS.md.

AGENTS.md

reference/templates.md holds the template. It carries:

  • The commands, including how to prepare a fresh worktree.
  • The pointers: read HANDOFF.md first if it exists, where the docs index is, and "a change to a user-facing surface updates its docs page in the same change", naming the writing-docs update mode.
  • A rule table that pairs each rule with what enforces it: a lint, a test, a type, or "nothing yet". A rule with "nothing yet" is a candidate for a check, and the table makes that visible.
  • Two fixed sections: Fix the cause and Comments.
  • A Needs the owner list: the paths an agent never merges alone.
  • The split: a note a stranger who cloned the repo could use goes in AGENTS.md; local paths, personal workflow and private context go in AGENTS.local.md.

Budget: keep the root AGENTS.md under 150 lines and 8 KB. The three harnesses probed load the whole file at the start of every session (reference/harness-loading.md), so each line is paid for on every task. When an existing file is over budget, report it and propose moves; do not cut content yourself.

In a monorepo, give a package its own AGENTS.md when its commands or rules differ from the root, and list those files in the root AGENTS.md. In the three harnesses probed, a session started in the package folder loads both files, and a session started at the root loads only the root file (reference/harness-loading.md).

An existing instruction file

When the audit finds a CLAUDE.md, a mixed AGENTS.md or another instruction file with real content, migrate it. Do not write a template beside it or over it. Follow reference/migration.md.

Reference

  • reference/templates.md: every file this skill writes.
  • reference/migration.md: moving an existing instruction file into the split, with the privacy scan.
  • reference/harness-loading.md: what each harness was observed to load, with dates and versions, and how to probe again.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.