CLAUDE.md · davila7/claude-code-templates
CLAUDE.md from davila7/claude-code-templates: 694 lines covering Project Overview, Essential Commands, Security Guidelines, Component System and more.
Template by davila7
Chalk Labs
Need help deploying CLAUDE.md · davila7/claude-code-templates?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code. Read the repository before you give any tool access to your data.
curl -fsSL https://raw.githubusercontent.com/davila7/claude-code-templates/main/CLAUDE.md -o CLAUDE.md
Read it and adapt it to your project before use.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: prompt-engineering
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
What's in it
A CLAUDE.md file: project memory Claude Code loads at the start of every session.
- For
- Claude Code
- Length
- 694 lines
- File
CLAUDE.md
Sections
- Project Overview
- Essential Commands
- Security Guidelines
- Component System
- API Architecture
- Cloudflare Workers
- Error Tracking (Sentry)
- Dashboard (www.aitmpl.com)
- Data Files
- Code Standards
- Testing
- Common Issues
- Important Notes
First lines (shown under the repo's MIT license)
# CLAUDE.md
This file provides guidance to Claude Code when working with this repository.
## Project Overview
Node.js CLI tool (`cli-tool/`) for managing Claude Code components (agents, commands, MCPs, hooks, settings) with a static website for browsing and installing components. The dashboard and its API routes are deployed on Cloudflare Pages, with supporting cron and monitoring tasks running as Cloudflare Workers.
`cli-rust/` is a Rust port of the CLI's install core (preview binary, releases tagged `cli-rust-v*`, CI `rust-ci.yml` / `build-rust-cli.yml`), kept at byte-for-byte install parity with the Node CLI; everything else is delegated to the Node CLI.
## Essential Commands
```bash
# Development
npm install # Install dependencies
npm test # Run tests
npm version X.Y.Z --ignore-scripts=false # Sync, commit, and tag all package versions
npm run version:set -- X.Y.Z # Sync versions without creating a commit or tag
npm publish --ignore-scripts=false # Publish and run the trusted prepublish guard
# Component catalog
python scripts/generate_components_json.py # Update docs/components.json (pulls download counts from Supabase: minutes)
python scripts/generate_components_json.py --skip-downloads # Same, keeping the counts already in the catalog: seconds
# Dashboard + API (Astro on Cloudflare Pages)
cd dashboard && npm test && npm run build # Unit tests + build (dashboard-ci.yml runs both on PRs)
cd dashboard && npx wrangler pages deploy dist --project-name=aitmpl-dashboard # Manual deploy (what deploy.yml runs)
```
> Deploys to production happen automatically via GitHub Actions on push to `main`
> (changes in `dashboard/**`). Manual deploy uses `wrangler pages deploy`, not Vercel.
> The root `npm run deploy` / `deploy:dashboard` still call `scripts/deploy.sh`, which is a stale **Vercel** deploy: do not use them.
## Security Guidelines
### ⛔ CRITICAL: NEVER Hardcode Secrets or IDs
**NEVER write API keys, tokens, passwords, project IDs, org IDs, or any identifier in code.** This includes Cloudflare account/project IDs, Supabase URLs, Discord IDs, database connection strings, and any other infrastructure identifier. ALL must go in `.env` (or Cloudflare secrets via `wrangler secret put`).
```javascript
// ❌ WRONG
const API_KEY = "AIzaSy...";
// ✅ CORRECT
const API_KEY = process.env.GOOGLE_API_KEY;
```
**When creating scripts with API keys:**
1. Use `process.env` (Node.js) or `os.environ.get()` (Python)
2. Load from `.env` file using `dotenv`
3. Add variable to `.env.example` with placeholder
4. Verify `.env` is in `.gitignore`
**If you accidentally commit a secret:**
1. Revoke the key IMMEDIATELY
2. Generate new key
3. Update `.env`
4. Old key is compromised forever (git history)
## Component System
### Component Types
**Agents** (400+) - AI specialists for development tasks
**Commands** (280+) - Custom slash commands for workflows
**MCPs** (100+) - External service integrations
**Settings** (75+) - Claude Code configuration files
**Hooks** (60+) - Automation triggers
**Loops** (18+) - Autonomous agentic workflows (goal + interval + stop condition) that reference other components
**Mods** (45) - Claude Mods: plugins whose behaviour lives in a function-hooks module (`register(on, options)` hooking engine events as `($, e, next)` middleware). Anthropic's reference is [anthropics/claude-code/mods](https://github.com/anthropics/claude-code/tree/main/mods) (three built-in mods + `mods/types/claude-code.d.ts`); discussion in [anthropics/claude-code#91870](https://github.com/anthropics/claude-code/issues/91870). Mods are official and on by default in Claude Code >= 2.1.287 ([docs](https://code.claude.com/docs/en/plugins/mods/overview)); 2.1.287+ ignores `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS`, builds 2.1.259–2.1.286 still need it set to `1`; the `$` API may change between releases. Each mod is a complete plugin directory in Anthropic's `mods/` layout: `cli-tool/components/mods/{category}/{name}/` with `.claude-plugin/plugin.json` (name, description, `userConfig` — options are read from user/managed settings `pluginConfigs[name].options`, never project settings), `hooks/hooks.json` (`modules`), any number of hooks-modules under `hooks/` (relative imports allowed), optional `commands/*.md` (slash commands the plugin ships; a `skill.prompt` hook may rewrite their prompt at run time), `types/`, `tests/`, and a `README.md` the site shows. The generator uses README.md as content and ships every text file in the per-component content file (`files`), so the site explorer and the send-to-repo flow have the whole plugin. `--mod` (alias `--function-hook`) downloads the directory recursively (like a skill) and writes it verbatim to `.claude/skills/{name}/`, which Claude Code auto-loads as `{name}@skills-dir` — **only in a trusted project** (see "Debugging a mod that seems silent" below). Third-party mods are vendored as-is with LICENSE + attribution (e.g. `games/cc-arcade`). **Every module must typecheck against `cli-tool/components/mods/types/claude-code.d.ts`** (`cd cli-tool/components/mods && npx -y -p typescript@5 tsc -p tsconfig.json`; CI runs it in `mods-typecheck.yml`). Rules from the engine: import types only from `'claude-code'`, spell `$` as `$.noun.event(...)` at the call site (never pass `$` to a helper), treat `e` as frozen, deny with `{ deny }` without calling `next` (returning `{}` is fail-open). When Anthropic bumps the API, regenerate the d.ts with `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude -p "/plugin-types <dir>"` on a current Claude Code and re-run tsc (the header's first line names the writing version; currently 2.1.301; 2.1.278 added `prompt.attachment` — the per-attachment hook `jev-skill-suggestion` uses to withhold the `skill_listing` system-reminder — and 2.1.283 changed `$.model.complete` from a string and `$.model.fork` from `result | null` to `{ isAnswered, text, usage } | { isAnswered: false, reason }`). Note `/context`'s "Skills" row is estimated from the roster and does not reflect that hook; a mod can ship `commands/*.md` and rewrite their prompt in `skill.prompt` (that is how `/jev-skill-suggestion:setup` hides every skill as `user-invocable-only` while the mod injects the chosen `SKILL.md` itself). Typechecking against the d.ts does not prove an older engine draws a mod: Claude Code 2.1.287 skips the whole `ui.render` of a Button with Text children instead of a `label` string, and the Claude Desktop app may run an older bundled build than your terminal: `ultra-config` drew in a 2.1.301 terminal and stayed empty in Desktop with exactly that skip. Test a pane on the oldest supported engine too: `npm i @anthropic-ai/claude-code@2.1.287` in a scratch folder, then run its `claude plugin test {category}/{name}` from `cli-tool/components/mods`. The early-access banner and Beta badge were removed 2026-10-04 (mods are official). Old URLs (`/function-hooks`, `/component/function-hook/*`) redirect via `dashboard/public/_redirects`.
**Templates** (14+) - Complete project configurations
**Skills** (890+) - `SKILL.md` directories under `cli-tool/components/skills/{category}/{name}/` (`--skill`); scanned by SkillSpector (see below)
**Sandbox** (11) - Launchers that run Claude Code in E2B, Cloudflare or Docker sandboxes (`cli-tool/components/sandbox/`)
Current per-type counts: `dashboard/public/counts.json`.
#### Debugging a mod that seems silent (verified 2026-09-19 on Claude Code 2.1.278)
A mod that "produces no output" has, in order of likelihood, these causes — none of which is the mod's code. Check them before touching the module:
1. **The project is not trusted.** Claude Code adopts a plugin from a project's `.claude/skills/{name}/` only when `~/.claude.json` has `projects[<path>].hasTrustDialogAccepted: true`; an untrusted folder's `.claude/` is repository content and is not read at all (`plugin.scope==="project"` candidates are dropped and re-discovered "post-trust"). `claude -p` never shows the trust prompt, so a headless run in a fresh folder never loads a project mod. Fix: open `claude` interactively in the folder and accept the prompt, or pass `--plugin-dir .claude/skills/{name}` (explicit, loads as `{name}@inline`). `~/.claude/skills/{name}/` (user-level) always loads.
2. **You are looking in the wrong place.** `$.ui.log` appends a dim transcript line and writes to the debug log; `$.ui.status` pins a line under the prompt. In `claude -p` / the SDK there is no transcript and no status row: the lines are only in `~/.claude/debug/<session-id>.txt` (`.txt`, not `.log`; `latest` symlinks the newest) and reach an SDK host as `ui_log`. The header, statusline and effort box show the *session's* settings and never move: a mod rewrites `model`/`effort` per *request*. The other observable is `"effort":"…"` in the transcript JSONL under `~/.claude/projects/<slug>/`.
3. **Options under the wrong key.** `pluginConfigs` is keyed by the plugin's full id: `"{name}@skills-dir"` when auto-loaded, `"{name}"` with `--plugin-dir`. Under the wrong key every option is its default and the debug log says `plugin {name}: no pluginConfigs["{name}@skills-dir"].options in user, --settings or managed settings`.
4. **Function hooks off.** On Claude Code < 2.1.287 with `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS` unset/`0` the debug log says `installed plugins' hooks modules not loaded: rollout flag (tengu_plugin_hooks_modules) is off`. Built-in mods (`agents-md@builtin`) load regardless, so their presence proves nothing about ours.
The lines that settle each question in `claude --debug`: `Found N plugins`, `Read hooks.json for plugin {name}`, `hooks module {name}@skills-dir loaded (worker, environment N, tier user); events: …`, then `hooks module {name}@… <event> settled in Xms`. Positive control: `pacman@skills-dir` loads from `.claude/skills/` in the trusted `claude-code-templates` checkout. Anthropic documents only `claude --plugin-dir mods/<name>` for its reference mods; the `.claude/skills` auto-load is Claude Code 2.1.157+ (CHANGELOG: "Plugins in `.claude/skills` directories are now automatically loaded").
### Installation Patterns
```bash
# Single component
npx claude-code-templates@latest --agent frontend-developer
npx claude-code-templates@latest --command setup-testing
npx claude-code-templates@latest --hook automation/simple-notifications
npx claude-code-templates@latest --loop engineering/docs-sweep-loop # also installs the loop's referenced components
npx claude-code-templates@latest --mod security/secret-redactor # Claude Mod: plugin at .claude/skills/secret-redactor/
# Batch installation
npx claude-code-templates@latest --agent security-auditor --command security-audit --setting read-only-mode
# Interactive mode
npx claude-code-templates@latest
```
### Component Development
#### Adding New Components
**CRITICAL: Use the component-reviewer agent for ALL component changes**
When adding or modifying components, you MUST use the `component-reviewer` subagent to validate the component before committing:
```
Use the component-reviewer agent to review [component-path]
```
**Component Creation Workflow:**
1. Create component file in `cli-tool/components/{type}/{category}/{name}.md`
2. Use descriptive hyphenated names (kebab-case)
3. Include clear descriptions and usage examples
4. **REVIEW with component-reviewer agent** (validates format, security, naming)
5. Fix any issues identified by the reviewer
6. **TEST before generating/publishing**: ask the human in the session whether
they want to test the newly created/modified component(s) first. Do NOT run
`generate_components_json.py`, commit, or publish until testing is confirmed
or explicitly skipped by the user.
7. Run `python scripts/generate_components_json.py` to update catalog
(**maintainers only** — see below)
#### Generated catalog files: who regenerates them
`scripts/generate_components_json.py` writes `docs/components.json` and the
split `dashboard/public/` artifacts (`components.json`, `counts.json`,
`search-index.json`, `components/*.json`, `component-content/**`, `api/v1/**`). These files
are **generated output, never hand-edited**, and who commits them depends on
the workflow:
| Workflow | Regenerate + commit the catalog? |
|----------|----------------------------------|
| Maintainer working directly on this repo (local branch, sync PRs, agent-driven migrations) | ✅ Yes — run the script (`--skip-downloads` is enough for a content change) and commit the output with the component |
| **External contributor PR (fork)** | ❌ **No** — the PR must only contain files under `cli-tool/components/` (plus supporting files). The catalog is regenerated automatically after merge (`update-json-data.yml` daily cron, or a maintainer). |
Why: the generated JSON files are single-line blobs that change on every
component/download-count update, so two PRs that both commit them always
conflict. `.github/workflows/generated-files-guard.yml` fails any
non-maintainer PR that touches them and posts revert instructions; the
`component-pr-welcome.yml` bot also warns about it up front.
Two workflows regenerate them on `main`: `update-component-content.yml`
runs on every push that touches `cli-tool/components/**` with
`--skip-downloads` (content only, seconds) and then dispatches `deploy.yml`
(its own push uses `GITHUB_TOKEN`, which never triggers other workflows, so
without that the new catalog would not reach aitmpl.com), and `update-json-data.yml`
(daily cron) refreshes the download counts by pulling the whole
`component_downloads` table from Supabase (minutes) — that table has one
row per download, which is what makes a full run slow.
When reviewing a contributor PR that includes these files, ask them to revert
with `git checkout origin/main -- docs/components.json dashboard/public/` ratherSignals
- Stars
- 32,872
- Forks
- 3,789
- Open issues
- 101
- Last commit (this folder)
- Oct 24, 2026 (7 days ago)
- Last release
- Oct 9, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/davila7/claude-code-templates
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from davila7
- 0.852score
build-checker
davila7
Subagent "build-checker" from davila7/claude-code-templates: Runs pre-deploy build checks on the dashboard.
TemplateAFreshness: A★ 32.9KClaude Code - 0.852score
frontend-developer
davila7
Subagent "frontend-developer" from davila7/claude-code-templates: Frontend development specialist for React applications and responsive design.
TemplateAFreshness: A★ 32.9KClaude Code - 0.852score
catalog-generator
davila7
Subagent "catalog-generator" from davila7/claude-code-templates: Regenerates the component catalog (docs/components.json) by running the Python script.
TemplateAFreshness: A★ 32.9KClaude Code - 0.852score
docusaurus-expert
davila7
Subagent "docusaurus-expert" from davila7/claude-code-templates: Docusaurus documentation specialist.
TemplateAFreshness: A★ 32.9KClaude Code - 0.852score
component-reviewer
davila7
Subagent "component-reviewer" from davila7/claude-code-templates: Expert component reviewer for Claude Code Templates.
TemplateAFreshness: A★ 32.9KClaude Code - 0.852score
component-researcher
davila7
Subagent "component-researcher" from davila7/claude-code-templates: Investigates best practices and improvement opportunities for Claude Code components using…
TemplateAFreshness: A★ 32.9KClaude Code
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get CLAUDE.md · davila7/claude-code-templates running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
CLAUDE.md · davila7/claude-code-templates. Agent Mart. https://agentmart.dev/templates/davila7-claude-code-templates-claude-md (last updated 2026-10-24)