Your course progress0 of 14 chapters

Chapter 14

Template Library: Ready-Made Agents, Commands and Skills

In chapters 11 and 12 we learned to build skills and agents ourselves. But you don't always need to start from scratch: the community has already written hundreds of them. This chapter is a curated library, with the most useful items from aitmpl.com, the catalog of the open-source project Claude Code Templates (MIT license).

Each item has an explanation of what it does and when to use it, an install command to copy, a ready-made prompt to run it, and a sample result.

Before you start

What you need

  • Node.js (chapter 6), since the install runs with npx.
  • A project with Git, so you can see exactly which files the install added, and undo easily.
  • Run the install commands from inside the project folder.

How the install works

Each kind of component has its own flag:

The general structure
npx claude-code-templates@latest --agent   <category>/<name>  --yes
npx claude-code-templates@latest --command <category>/<name>  --yes

--yes skips the confirmation questions. And with no flag at all, you get an interactive selection screen:

Interactive selection screen
npx claude-code-templates@latest

I just installed components from claude-code-templates. Run git status, read every new file in the .claude folder, and explain to me what each one does, which tools it gets access to, and whether there's anything suspicious or unnecessary in it. Don't run any of them

The library

Agentdevelopment-tools/code-reviewer

Code Reviewer

When to use: Before every pull request, after a big change, or when you want a second pair of eyes on code Claude wrote. The agent checks quality, security and maintainability, and returns a list of findings.

Install
npx claude-code-templates@latest --agent development-tools/code-reviewer --yes

Use the code-reviewer agent to review all the changes in the current branch against main. Report by severity, with file and line for each finding, and don't fix anything

Sample result (illustration)
Review: 4 files, 3 findings
 
High severity
  app/add/actions.ts:31  Form input is saved without validation. An empty recipe name gets through.
 
Medium severity
  components/RecipeCard.tsx:12  The image has no alt text.
 
Low severity
  lib/recipes.ts:88  Unused function: formatOldDate.
 
Bottom line: fix the high-severity finding before merging.
Agentdevelopment-tools/debugger

Debugger

When to use: When something breaks and it's not clear why: an error in the terminal, a failing test or odd behavior. The agent specializes in finding the root cause, not just silencing the error. There's also a close sibling, development-tools/error-detective, which focuses on decoding error messages and logs.

Install
npx claude-code-templates@latest --agent development-tools/debugger --yes

Use the debugger agent to investigate this error: [paste the whole error]. I want the root cause, the evidence, and a proposed minimal fix. Don't fix it yet

Sample result (illustration)
Root cause: app/add/actions.ts saves the ingredients in the field ingredientsList,
and the recipe page reads the field ingredients. For recipes from the form it's undefined.
 
Evidence:
  - data/recipes.json: 3 recipes with ingredientsList, 0 with ingredients
  - app/recipes/[slug]/page.tsx:24 reads recipe.ingredients.map
 
Proposed fix: rename the field when saving, and convert the 3 existing recipes.
Agentdevelopment-tools/refactoring-specialist

Refactoring Specialist

When to use: When the code works but is hard to read or change: a huge file, repeated code, long functions. Refactoring improves the code's structure without changing what it does. For cleaning dead code there's also development-tools/unused-code-cleaner.

Install
npx claude-code-templates@latest --agent development-tools/refactoring-specialist --yes

Use the refactoring-specialist agent to propose a refactor of app/recipes/[slug]/page.tsx. Without changing any behavior on the site. First show a plan in small steps, and only after I approve, carry out one step at a time and run the build after each step

Sample result (illustration)
Refactoring plan: page.tsx (180 lines)
  1. Extract the ingredients list into an IngredientList component
  2. Extract the servings calculator into a hook called useServings
  3. Merge three nearly identical rounding functions into one
Risk: low. No change to the interface or the data.
Waiting for approval before step 1.
Agentdocumentation/documentation-engineer

Documentation Engineer

When to use: When documentation is missing or outdated: a README, install instructions, an explanation of the project structure. The documentation category also has technical-writer, api-documenter and changelog-generator.

Install
npx claude-code-templates@latest --agent documentation/documentation-engineer --yes

Use the documentation-engineer agent to update README.md according to the current code. Every sentence should be based on the code and package.json, without inventing features. Before saving, show me what changed

Sample result (illustration)
Proposed changes to README.md:
  + Added: an "Available commands" section (dev, build, start, lint from package.json)
  ~ Updated: the folder structure. Added components/mdx and content/docs
  - Removed: a yarn instruction. The project uses npm
  ? TODO: the live site URL wasn't found in the code. Left a placeholder
Agentdevelopment-tools/test-automator

Test Automator

When to use: When there's important code without tests, for example a calculator, forms or calculations, and you want a safety net before big changes.

Install
npx claude-code-templates@latest --agent development-tools/test-automator --yes

Use the test-automator agent to write tests for the servings calculator. Include edge cases: zero, large numbers, fractions, and ingredients with no quantity. Run the tests and report what passed and what failed. If a test fails, don't weaken it: tell me whether the problem is in the code or the test

Sample result (illustration)
Created: lib/servings.test.ts (9 tests)
  ✓ 7 passed
  ✗ 2 failed:
    - scaleAmount(1.5, 3, 0): division by zero returns Infinity  ← bug in the code
    - "salt to taste" with an empty quantity displays as NaN     ← bug in the code
Agentdevelopment-tools/accessibility-tester

Accessibility Tester

When to use: For sites used by older people, or anyone who needs large text, good contrast and keyboard navigation. Especially suitable for a family site.

Install
npx claude-code-templates@latest --agent development-tools/accessibility-tester --yes

Use the accessibility-tester agent to check every page on the site: alt text for images, color contrast, text size, labeled buttons, and keyboard-only navigation. Report by page and by severity

Sample result (illustration)
Home page: 2 findings
  - Low contrast: gray text (#9CA3AF) on a white background, ratio 2.5:1 (4.5:1 required)
  - The search button is an icon with no accessible label
Recipe page: 1 finding
  - The servings calculator's +/- buttons are smaller than 44 pixels
Commandgit-workflow/create-pr

Automatic Pull Request Creator

When to use: When you've finished work in a branch and want a tidy PR in one step: commit messages, push, and a full description. Requires gh signed in (chapter 8).

Install
npx claude-code-templates@latest --command git-workflow/create-pr --yes

The command is added to Claude Code's / menu, usually named /create-pr. Type / to confirm the exact name.

Usage, inside Claude Code
/create-pr
Sample result (illustration)
Branch: feature/print-recipe (3 commits)
Pushed to origin/feature/print-recipe
Opened pull request #12: Add clean print view for recipes
  https://github.com/your-username/grandma-recipes/pull/12
Description: what changed, how to test, a screenshot of the print view
Commandgit-workflow/pr-review

Pull Request Review

When to use: When you want a review of an existing PR, yours or someone else's, before merging. Complements the built-in /code-review.

Install
npx claude-code-templates@latest --command git-workflow/pr-review --yes
Usage, inside Claude Code
/pr-review

Review PR number 12 with the pr-review command, and summarize for me in three lines: whether to merge, what must be fixed first, and what can wait

Sample result (illustration)
PR #12: Add clean print view for recipes
Recommendation: merge after one fix
  Must fix: in the print view, long recipe names get cut off
  Can wait: also show the date added in the view
Commandgit-workflow/commit

Tidy Commit Messages

When to use: When you want every Git commit to get a clear, consistent message, and unrelated changes to be split into separate commits.

Install
npx claude-code-templates@latest --command git-workflow/commit --yes
Usage, inside Claude Code
/commit
Sample result (illustration)
Two different topics detected, and two commits created:
  a1b2c3d  feat: add print button to recipe page
  d4e5f6a  fix: round servings to one decimal place
Commandtesting/generate-tests

Generate Tests for a File

When to use: Like the test-automator agent, but as a quick command for a single file: run it, get tests.

Install
npx claude-code-templates@latest --command testing/generate-tests --yes
Usage, inside Claude Code
/generate-tests lib/servings.ts
Commanddocumentation/update-docs

Update Docs After Changes

When to use: After a significant code change, so the documentation doesn't fall behind.

Install
npx claude-code-templates@latest --command documentation/update-docs --yes
Usage, inside Claude Code
/update-docs
Sample result (illustration)
Checked 2 documentation files against 6 files changed since the last commit
  README.md: updated the "Running locally" section (added npm run test)
  docs/recipes.md: no change
Skill.claude/skills/refactor-safely

Safe Refactoring (a skill you write yourself)

When to use: When you want every refactor in the project to go through the same safe process: tests first, small steps, a build after every step, and no behavior changes. This is a skill in the structure from chapter 11, ready to copy.

.claude/skills/refactor-safely/SKILL.md
---
name: refactor-safely
description: Safely refactor a file or module without changing behavior. Use when the user asks to clean up, simplify, split, or restructure existing code.
argument-hint: [file-path]
---
 
Refactor $0 without changing any user-visible behavior.
 
1. Read $0 and list the problems (long functions, duplication, unclear names).
2. If there are no tests covering $0, write minimal tests that lock in
   current behavior FIRST, and run them.
3. Propose a plan of small steps. WAIT for approval.
4. Apply one step at a time. After each step run the tests and `npm run build`.
   If anything fails, revert that step and explain why.
5. Finish with a summary: what changed, what did not, and why it is safer.
Usage, inside Claude Code
/refactor-safely components/RecipeCard.tsx
Sample result (illustration)
Found 3 problems in RecipeCard.tsx. There were no tests, so 4 tests were written that lock in
the current behavior (4/4 passed). Plan: 3 steps. Waiting for approval.
Skillskills/development/code-review-checklist

A Catalog Skill: Code Review Checklist

When to use: When you want to add a ready-made skill from the catalog. Browse aitmpl.com/skills, pick one, and copy its folder into .claude/skills. Here's how to do it manually.

Windows PowerShell
git clone --depth 1 https://github.com/davila7/claude-code-templates.git $env:TEMP\cct
Copy-Item -Recurse $env:TEMP\cct\cli-tool\components\skills\development\code-review-checklist .claude\skills\

Read .claude/skills/code-review-checklist/SKILL.md and explain to me when it will trigger and what it does. If it has injected commands or scripts, explain what they run

Sample result (illustration)
The skill loads when you ask for a code review. It adds a checklist (readability, error
handling, security, tests). It has no injected commands and no scripts.
Utility--agent ... --command ... --yes

Starter Kit: Several Components in One Command

When to use: When you want to set up a new project with the recommended toolkit from this chapter, without running a command for each component.

Installing a full kit
npx claude-code-templates@latest \
  --agent development-tools/code-reviewer \
  --agent development-tools/debugger \
  --agent documentation/documentation-engineer \
  --command git-workflow/create-pr \
  --command git-workflow/commit \
  --yes
Utility--health-check

Settings Health Check

When to use: When something in your Claude Code settings isn't working as it should, or just every once in a while, to get recommendations for improvement.

Run
npx claude-code-templates@latest --health-check
Sample result (illustration)
✓ Claude Code is installed and up to date
✓ .claude/settings.json is valid
⚠ CLAUDE.md is longer than 200 lines. Consider shortening it
⚠ Found an agent with no description field
Utility--analytics

Usage Dashboard (Analytics)

When to use: When you want to see at a glance what's happening in your sessions: status, performance and token usage. Complements /usage and /context from chapters 10 and 12.

Run
npx claude-code-templates@latest --analytics

A local dashboard opens in your browser, with data from the sessions on your computer.

Using installed components well

An installed component is only a starting point. Your prompt still determines the quality of the result:

Weak prompt

Do a review

Strong prompt

Use the code-reviewer agent on the changes in this branch against main. Focus on accessibility and mobile layout, since this is a family site for older users. Report by severity, with file and line, and without fixing.

The strong prompt picks the agent explicitly, defines what to review and what to focus on, and sets the report format. The agent's general instructions connect to your specific context.

Checklist

My library

0 of 7

Summary

  • aitmpl.com is a catalog of agents, commands, skills and more, based on an MIT-licensed open-source project.
  • Installing: npx claude-code-templates@latest --agent ... or --command ..., and with no flags you get a selection screen.
  • The recommended items: code-reviewer, debugger, refactoring-specialist, documentation-engineer, test-automator and accessibility-tester, the commands create-pr, pr-review and commit, and a refactoring skill of your own.
  • Safety: after every install, git status, read the files and check tools.
  • Adapting: a community base, with your rules on top.

Check yourself

1. You installed an agent from the catalog. What do you do first?

2. Why is it worth adapting a community component to your project?

Answering every quiz question marks the chapter as done automatically.