agentleFS
jiayi-ThE-CREATORjiayi-ThE-CREATOR/macos-llm-agents/.claude/skills/new-agent/SKILL.md

new-agent

Skill0 starsChanged 5 months agoMITView on GitHub

Scaffold a new agent under agents/<name>/ following this repo's run.sh + (launchd | CLI) pattern. Use when the user says "新加一个 agent" or "/new-agent <name>".

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After scaffolding, print the next steps to the user:

    line 55
  2. Very specific:

    Add dependencies to requirements.txt

    line 57

“Common” is measured: kept by at least 6 in 10 of the 6 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

new-agent

Scaffold a new agent directory matching this repo's conventions.

Usage

/new-agent <name> [--type=scheduled|cli]
  • scheduled (default): launchd-driven with .stamps/<slot> dedupe and one-shot retry. Pattern from agents/financial_news/.
  • cli: manual CLI invocation, run.sh passes "$@" through. Pattern from agents/paper_reader/.

Procedure

  1. Validate <name> is snake_case and agents/<name>/ does not exist. If exists, abort with error.
  2. Resolve --type (default scheduled).
  3. Create agents/<name>/ and inside it:
    • CLAUDE.md — agent-local instructions. Use template templates/agent.CLAUDE.md, replace <NAME> with <name>.
    • requirements.txt — empty by default; add deps if user specified them in the request.
    • <name>.py — main script from templates/skeleton.py, replace <NAME> token.
    • run.sh — copy from templates/scheduled.run.sh or templates/cli.run.sh, replace <NAME> and <AGENT_DIR>. Then chmod +x.
  4. For scheduled only: emit (do NOT write) a ~/Library/LaunchAgents/com.<name>.<slot>.plist template snippet inline in the chat. Ask the user for the slot name and schedule first; do not pre-fill. Tell the user the reload commands after they write the plist.
  5. Update root CLAUDE.md agents table — append a new row. Use the same column structure as existing rows.
  6. Do NOT auto-load any launchd job — that's the user's call.

Conventions to respect

  • Python interpreter: /Library/Frameworks/Python.framework/Versions/3.14/bin/python3 (overridable via $PYTHON)
  • All run.sh are self-locating (no hardcoded absolute paths) and inject only the keys they need:
    SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
    REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
    eval "$("$REPO_ROOT/tools/load_env.sh" KEY1 KEY2 ...)"
  • Logs: agents/<name>/<name>.log. run.sh is responsible for tail-truncating to 500 lines (scheduled template does this).
  • Stamps: .stamps/<slot> at repo root (NOT ~/.stamps/).
  • Scheduled run.sh first arg is the slot name, written to .stamps/ only on success.
  • CLI run.sh takes no slot — pure passthrough.

Templates

See .claude/skills/new-agent/templates/:

  • scheduled.run.sh
  • cli.run.sh
  • skeleton.py
  • agent.CLAUDE.md

After scaffolding, print the next steps to the user:

  1. Fill in business logic in <name>.py
  2. Add dependencies to requirements.txt
  3. (scheduled) Write the plist, then launchctl load
  4. (scheduled) Test manually: agents/<name>/run.sh <slot>

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.