Agent Builder
shareAI-lab/learn-claude-code
Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.
How to write Claude Code agents: example blocks, model choice, least-privilege tools.
$ npx skills add xiaolai/nlpm --skill writing-agents -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install xiaolai/nlpm writing-agents --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nlpm/writing-agents .claude/skills/writing-agents && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "writing-agents" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agents into .claude/skills/writing-agents/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-agents", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agentsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add xiaolai/nlpm --skill writing-agents -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install xiaolai/nlpm writing-agents --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/nlpm/writing-agents .agents/skills/writing-agents && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "writing-agents" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agents into .agents/skills/writing-agents/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-agents", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xiaolai/nlpm --skill writing-agents -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install xiaolai/nlpm writing-agents --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/nlpm/writing-agents .cursor/skills/writing-agents && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "writing-agents" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agents into .cursor/skills/writing-agents/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-agents", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/xiaolai/nlpm.git --path skills/nlpm/writing-agents--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add xiaolai/nlpm --skill writing-agents -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install xiaolai/nlpm writing-agents --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/nlpm/writing-agents .gemini/skills/writing-agents && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "writing-agents" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agents into .gemini/skills/writing-agents/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-agents", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install xiaolai/nlpm writing-agentsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add xiaolai/nlpm --skill writing-agents -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/nlpm/writing-agents .github/skills/writing-agents && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "writing-agents" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agents into .github/skills/writing-agents/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-agents", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xiaolai/nlpm --skill writing-agents -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install xiaolai/nlpm writing-agents --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/nlpm/writing-agents .opencode/skills/writing-agents && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "writing-agents" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-agents into .opencode/skills/writing-agents/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-agents", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
writing-agentsHow to write Claude Code agents: example blocks, model choice, least-privilege tools.
Writing Agents is an agent skill from xiaolai/nlpm. How to write Claude Code agents: example blocks, model choice, least-privilege tools.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering. The repository describes itself as: Natural-Language Programming Manager — scan, lint, and score NL artifacts with Claude-native quality scoring. The licence is ISC.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 307328b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown, xml and yaml).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Writing Agents loads about 3k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 984 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from xiaolai/nlpm at commit 307328b, republished under its ISC licence (© xiaolai). 984 words, ~3,012 tokens.
.claude/skills/writing-agents/SKILL.md (or your agent's skills folder).Scope: covers Claude Code agent
.mdfile authoring (Markdown + frontmatter at.claude/agents/). Codex CLI defines agents differently — as[agents.<name>]TOML tables in.codex/config.toml; see [[nlpm:conventions-codex]]. Antigravity subagents are under-documented at this writing; see [[nlpm:conventions-antigravity]]. For multi-agent orchestration, see [[orchestration]]. For plugin architecture, see [[writing-plugins]].
Without <example> blocks, Claude guesses when to dispatch your agent. With them, it pattern-matches against real scenarios.
Target: 1 well-chosen example + 1 "Not for …" sentence, whole description ≤1,200 characters.
The description sits in the Agent tool's text on every turn and is the only thing Claude sees when choosing an agent. Examples therefore stay in the description -- moved into the body, they are invisible to routing -- but every extra example is always-on context. One example that shows the main positive trigger, trigger phrases in the prose, and an explicit exclusion carry the routing signal at a fraction of the tokens.
<example>
Context: [what the user is doing -- not just "user needs help"]
user: "[realistic user message that should trigger this agent]"
assistant: "[what Claude says when dispatching -- shows the decision logic]"
</example><example>
Context: User needs code review
user: "review my code"
assistant: "I'll use the reviewer agent."
</example>Problems: generic context, generic query, no decision logic shown.
<example>
Context: User just pushed changes to the authentication module and wants feedback before merging
user: "Can you check if the auth changes look good before I create the PR?"
assistant: "I'll dispatch the security-reviewer agent to check the auth changes for vulnerabilities, token handling, and session management best practices."
</example>Why it works: specific context (auth module, pre-PR), realistic query (how users actually talk), decision logic visible (what the agent will check).
| Part | Purpose | What it carries |
|---|---|---|
| Prose trigger phrases | Breadth | Obvious, edge-case and non-obvious triggers, one short phrase each |
1 <example> | Anchor | The main positive trigger: user asks, assistant dispatches |
| "Not for …" sentence | Boundary | The adjacent request that belongs to a sibling agent or to no agent |
Example for a "performance-profiler" agent:
description: |
Profiles slow endpoints, memory growth and query plans. Use when a request is
slow, memory climbs over time (possible leak), or the user is choosing between
two implementations on speed. Not for fixing the code it measures; it reports
hot spots only.
<example>
Context: User wants to profile their API
user: "Profile the /api/users endpoint, it's slow"
assistant: "I'll dispatch the performance-profiler to trace the /api/users endpoint..."
</example>A second example is allowed when a distinct trigger cannot be said in prose, but it costs context on every turn; nlpm's R09 gives full credit for one.
| Task type | Model | Signal words in body | Examples |
|---|---|---|---|
| Mechanical / parsing / formatting / counting | haiku | count, list, extract, format, parse, scan | scanner, parser, formatter, counter, lister |
| Analysis / reasoning / moderate judgment | sonnet | analyze, review, evaluate, summarize, compare | linter, reviewer, extractor, summarizer |
| Complex judgment / orchestration / multi-agent | opus | coordinate, decide, assess, synthesize, architect | QC coordinator, architect, strategy planner |
Count the instruction lines in your agent body. Then check for judgment words.
< 20 instruction lines AND no judgment words → haiku
20-50 instruction lines OR judgment words → sonnet
> 50 instruction lines OR coordination logic → opusJudgment words: evaluate, decide, assess, determine, weigh, prioritize, recommend, judge, infer, synthesize.
| Model | Relative cost | When to upgrade |
|---|---|---|
| haiku | 1x | Agent produces wrong output on edge cases |
| sonnet | 10x | Agent produces wrong output on easy cases |
| opus | 30x | Agent coordinates other agents or makes architectural decisions |
Rule: start with haiku, upgrade only when output quality requires it.
Only list tools the agent body actually references. Every extra tool is a potential misuse vector.
| Agent type | Common over-grant | Correct tools |
|---|---|---|
| Audit/review agent | Write, Edit, Bash | Read, Glob, Grep |
| Code generator | Read, Grep (unused) | Write, Edit, Bash |
| Orchestrator | Read, Write (does no IO) | Task |
| Scanner | Bash (uses grep) | Grep, Glob, Read |
| Tool | When to include |
|---|---|
| Read | Agent reads file contents |
| Write | Agent creates new files |
| Edit | Agent modifies existing files |
| Glob | Agent searches for files by pattern |
| Grep | Agent searches file contents |
| Bash | Agent runs shell commands (linters, tests, builds) |
| Task | Agent dispatches sub-agents |
| WebFetch | Agent fetches a URL |
Every agent MUST define its output format in the body. Without it, output varies between invocations -- making results unparseable by parent agents.
## Output Format
### {Section Title}
| Column1 | Column2 | Column3 |
|---------|---------|---------|
| ... | ... | ... |
### Summary
- Total items: {N}
- Issues found: {N}
- Pass/Fail: {verdict}## Output Format
For each finding, output:
**[SEVERITY] Finding title**
- File: `path/to/file`
- Line: {N}
- Finding: {description}
- Fix: {concrete suggestion}
Severity levels: CRITICAL > HIGH > MEDIUM > LOW > INFO## Output Format
Final line must be exactly one of:
- `PASS: All checks passed`
- `WARN: {N} warnings found (see above)`
- `FAIL: {N} errors found (see above)`Order matters. Claude reads top-to-bottom and front-loads early instructions.
## Mission
[1-2 sentences: what this agent does and WHY it exists]
## Instructions
1. [First step]
2. [Second step]
3. [Third step]
...
## Boundaries
- Do NOT [thing that would be harmful]
- Do NOT [thing that's out of scope]
- If [ambiguous situation], then [explicit resolution]
## Output Format
[Exact template -- see section 4 above]
## Error Handling
- If no files found: report "No matching files" and exit
- If tool fails: report the error and continue with remaining work
- If scope is unclear: analyze the narrower interpretation| Section | Target lines | Over-budget signal |
|---|---|---|
| Mission | 2-3 | More than one paragraph |
| Instructions | 5-15 | More than 20 numbered steps |
| Boundaries | 3-7 | More than 10 "Do NOT" items |
| Output Format | 5-15 | Defining more than 3 output sections |
| Error Handling | 3-5 | More than 5 error cases |
Total agent body: aim for 25-45 lines. Over 60 lines means the agent is doing too much -- split it.
---
name: code-checker
description: Check code
model: opus
tools: [Read, Write, Edit, Bash, Grep, Glob, Task]
---You are a code checker. Check the user's code for issues.
Look at the files and find problems. Report what you find.Problems (each scored line is a row in the nlpm:scoring Agents table):
<example> blocks in the description: unreliable triggering (-15)Total: -57, so 100 - 57 = 43.
---
name: code-checker
description: |
Static analysis agent — checks code for bugs, type errors, and anti-patterns.
Use when reviewing code quality, running pre-commit checks, validating changes
before PR, or scanning a module suspected of a production defect. Not for style
issues (defer to the linter) or for fixing code; it reports only.
<example>
Context: User just finished implementing a new feature and wants a quality check
user: "Check the auth module for any bugs before I push"
assistant: "I'll dispatch the code-checker agent to analyze src/auth/ for bugs, type errors, and anti-patterns."
</example>
model: sonnet
tools: [Read, Glob, Grep]
---## Mission
Analyze source code files for bugs, type errors, and anti-patterns.
Produce a structured report with severity-tagged findings.
## Instructions
1. Use Glob to discover files matching the target pattern
2. Use Read to examine each file
3. Use Grep to cross-reference imports and usage patterns
4. For each finding, classify severity and provide a concrete fix
5. Produce the output report
## Boundaries
- Do NOT modify any files (read-only analysis)
- Do NOT run shell commands
- Do NOT report style issues (defer to linter)
- If no target pattern specified, analyze all files in src/
## Output Format
For each finding:
**[SEVERITY] Finding title**
- File: `path/to/file`
- Line: {N}
- Finding: {description}
- Fix: {concrete fix}
Final line:
- `PASS: No issues found`
- `WARN: {N} warnings found`
- `FAIL: {N} errors found`
## Error Handling
- If no files match the pattern: report "No matching files for pattern: {X}"
- If a file cannot be read: skip it and note in the reportChanges made (one per problem above):
<example> block in the description (+15)Total: +57, so 43 + 57 = 100.
| Mistake | Impact | Fix |
|---|---|---|
| No examples | 40% trigger accuracy | Add 1 specific scenario example + a "Not for" sentence |
| 3-4 examples in the description | Always-on context on every turn | Keep the best one; move trigger phrases into the prose |
| Opus for mechanical work | 30x cost for same result | Use haiku for parsing, sonnet for analysis |
| All tools granted | Agent writes when it should only read | List only tools the body references |
| No output format | Different format each run | Define exact output template |
| Body over 60 lines | Agent is doing too much | Split into focused sub-agents |
| "Be thorough" in body | Meaningless filler | Replace with specific instructions |
| No error handling | Silent failures | Add 3-5 error cases with resolution |
© xiaolai, ISC. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/nlpm/writing-agents of xiaolai/nlpm.
Open the folder on GitHubat commit 307328b
Writing Agents next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Writing Agents this skillxiaolai/nlpm | 148 | — | ~3k | Automated safety check: Pass | ISC | |
| Agent BuildershareAI-lab/learn-claude-code | 78k | 5 repos | ~1.2k | Automated safety check: Pass | MIT | |
| Add Uint Supportpytorch/pytorch | 104k | 2 repos | ~2.3k | Automated safety check: Pass | Custom licence | |
| LLM Benchmarking with lm-evaluation-harnessOrchestra-Research/AI-Research-SKILLs | 13k | 8 repos | ~3k | Automated safety check: Pass | MIT | |
| Segment Anything Model GuideOrchestra-Research/AI-Research-SKILLs | 13k | 8 repos | ~3.3k | Automated safety check: Pass | MIT | |
| 1passwordtrpc-group/trpc-agent-go | 1.9k | 14 repos | ~656 | Automated safety check: Pass | Apache-2.0 |
shareAI-lab/learn-claude-code
Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.
pytorch/pytorch
Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.
Orchestra-Research/AI-Research-SKILLs
Runs lm-evaluation-harness to benchmark language models on academic suites such as MMLU, GSM8K and HumanEval, compare models and track training checkpoints.
Orchestra-Research/AI-Research-SKILLs
Guide to using Meta's Segment Anything Model for zero-shot image segmentation with point, box or mask prompts, or automatic mask generation.
trpc-group/trpc-agent-go
Set up and use 1Password CLI (op). An agent skill from trpc-group/trpc-agent-go.
jarrodwatts/claude-code-config
Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage.
xiaolai/nlpm
Universal NL conventions: SKILL.md open spec, AGENTS.md, vague quantifiers, naming.
xiaolai/nlpm
Antigravity and Gemini CLI artifact schemas: .gemini/ paths, extensions, hooks.
xiaolai/nlpm
Codex CLI artifact schemas: config.toml, .codex-plugin, skills, hooks, AGENTS.md.
xiaolai/nlpm
Multi-agent workflow patterns: parallel dispatch, pipelines, QC gates, retries.
xiaolai/nlpm
NL artifact anti-patterns: vague quantifiers, bare prohibitions, oversized skills.
xiaolai/nlpm
100-point NL artifact rubric: penalty tables per artifact type, calibration cases.
Categories
How to write Claude Code agents: example blocks, model choice, least-privilege tools. Writing Agents is an agent skill from xiaolai/nlpm. How to write Claude Code agents: example blocks, model choice, least-privilege tools.
Writing Agents fits situations like: AI & LLM Engineering work in your project.
Run `npx skills add xiaolai/nlpm --skill writing-agents -a claude-code`. Or copy the skill folder (skills/nlpm/writing-agents in xiaolai/nlpm) into .claude/skills/writing-agents in your project. Claude Code loads it when a task matches its description.
Run `npx skills add xiaolai/nlpm --skill writing-agents -a codex`. Or copy the skill folder (skills/nlpm/writing-agents in xiaolai/nlpm) into .agents/skills/writing-agents in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xiaolai/nlpm --skill writing-agents -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-agents, .gemini/skills/writing-agents, .github/skills/writing-agents and .opencode/skills/writing-agents in your project.
SKILL.md names no scripts, command-line tools or credentials: Writing Agents is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Writing Agents is published under the ISC licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Writing Agents: Agent Builder (shareAI-lab/learn-claude-code, 78k stars), Add Uint Support (pytorch/pytorch, 104k stars), LLM Benchmarking with lm-evaluation-harness (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Segment Anything Model Guide (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
xiaolai (a GitHub user) maintains it in xiaolai/nlpm, which has 148 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 9, 2026.
Source: xiaolai/nlpm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.