# Claude Code Infrastructure Showcase: auto-activating skills, hooks, agents (diet103/claude-code-infrastructure-showcase) — skill card for AI agents

> AgentGid skill card. Checked on 2026-11-13 against commit 07f75ce (version 2.0.0).
> Every fact comes from the pack's own files at that commit. Numbers marked "as reported" are the author's.
> Human page: https://agentgid.com/skills/diet103/claude-code-infrastructure-showcase/

## Explain it to a non-programmer
A ready-made Claude Code setup you copy into your own project. Small scripts watch what you type and what the assistant edits, and tell it which coding guide to read first. It also brings four coding guides, eight helper agents and commands that keep a written plan of your task between sessions.

## Who it is for
- You build a TypeScript app with Claude Code and its skills rarely switch on by themselves
- Your stack is close to the author's - Node.js with Express and Prisma on the back, React with MUI on the front, Sentry for errors
- You lose track of a long task when the chat runs out of room and want a plan saved in files
- You want an example to learn from when you write your own skills and hooks
- Not for: You want a finished product: the author calls it a reference library to copy from, not a working app
- Not for: You work on plain Windows without WSL2: the scripts need bash

## What it is
- Kind: always-on, command, knowledge, scripts
- License: MIT
- Repository: https://github.com/diet103/claude-code-infrastructure-showcase

## What it does
- Every prompt: a script checks your words against skill-rules.json and prints which skills the assistant must or should load first
- Before every edit: a guard stops the first edit once if a required skill was not loaded, then lets the retry through
- After every edit: the edited file and the build and type-check commands for its folder are written to a small cache
- When the assistant stops: old state files are cleaned up, and plan files can be indexed for later search (only if you set that up)
- Four guides: backend (Express, Prisma, Zod, Sentry), frontend (React, MUI v7, TanStack), Sentry error tracking, and how to write skills
- Eight helper agents (review, refactor, docs, error fixing, plan review, web research) and four slash commands
- Dev docs: a plan, context and task list per task in dev/active/, so work survives a context reset
- Level disabled: Default. Keyword and pattern matching only, no AI calls for matching
- Level fallback: An AI provider sorts your prompt first; keyword matching if it fails
- Level ai-only: AI sorting only, nothing on failure

## Skills
| Skill | Call | Changes code? | In plain words |
|---|---|---|---|
| backend-dev-guidelines | suggested by the prompt script, or the Skill tool | yes | Rules for back-end code in layers: routes, controllers, services, data access |
| frontend-dev-guidelines | marked as required by the prompt script (it blocks the first edit), or the Skill tool | yes | Rules for React screens: loading states, data fetching, file layout and MUI v7 styling |
| error-tracking | suggested by the prompt script, or the Skill tool | yes | Adds Sentry error and speed tracking to your services |
| skill-developer | suggested by the prompt script, or the Skill tool | yes | Explains how to write your own skills and the rules that make them switch on |
| /dev-docs | /dev-docs <what you need planned> | no | Writes a plan for a big task into three files in your project |
| /dev-docs-update | /dev-docs-update | no | Updates those plan files before the chat runs out of room |
| /verify-setup | /verify-setup | yes | Runs the health check of the setup and fixes what fails |
| /route-research-for-testing | /route-research-for-testing [extra paths] | no | Lists the server routes you edited and tests them against your local server |

### backend-dev-guidelines
- Asks for: The route, endpoint or service you want to build or change
- Gives: Code that follows the checklist: route, controller extending BaseController, service, repository, Zod check, Sentry, tests, unifiedConfig
- Say: "Add an Express route that creates a blog post"

### frontend-dev-guidelines
- Asks for: The component, page or feature you want
- Gives: A component that follows the checklist: lazy loading, SuspenseLoader, useSuspenseQuery, import aliases, default export
- Say: "Create a React component that lists blog posts"

### error-tracking
- Asks for: The controller, job or database call that needs tracking
- Gives: Sentry v8 error capture and performance spans in the author's patterns
- Say: "Add Sentry error tracking to this cron job"

### skill-developer
- Asks for: The skill you want, and the words or files that should trigger it
- Gives: A skill folder under 500 lines plus resource files, and its entry in skill-rules.json
- Say: "Create a new skill for our database migrations and add its triggers"

### /dev-docs
- Asks for: What you need planned
- Gives: dev/active/<task>/<task>-plan.md
- Gives: <task>-context.md with key files and decisions
- Gives: <task>-tasks.md as a checklist
- Say: "/dev-docs refactor the authentication system"

## Know before installing
- It switches on by itself: once the hooks are registered, a script runs on every prompt, before and after every edit, and when the assistant stops.
- Code you write can be sent to an AI provider even in the default mode: the edit guard sends the first 1,000 characters of an edit to Gemini, OpenAI or Anthropic whenever one of their keys is set, unless SKIP_PRETOOLUSE_AI=true.
- The scripts read your ~/.bashrc and .claude/hooks/.env to find AI keys, so a key you set for something else is picked up too.
- The guides are written for one stack (Express, Prisma, React, MUI v7, Sentry) and a blog example; on another stack you adapt them.
- Turn everything off at once by removing the hooks block from .claude/settings.json.
- The setup wizard can also overwrite your ~/.vimrc and ~/.config/nvim/init.lua, but only with the --editor option or a yes in its prompt.

## Install (official commands)
- Claude Code (setup wizard): `git clone https://github.com/diet103/claude-code-infrastructure-showcase.git` && `cd claude-code-infrastructure-showcase` && `npx tsx setup.ts ~/my-project` — Copies .claude/ into your project, asks for the mode and provider, runs npm install in .claude/hooks and a health check. Add --yes when an agent runs it. Remove: `Remove the hooks block from .claude/settings.json, then delete the copied .claude/ folders`.
- Claude Code (manual): `git clone https://github.com/diet103/claude-code-infrastructure-showcase.git` && `cp -r claude-code-infrastructure-showcase/.claude ~/my-project/.claude` && `cd ~/my-project/.claude/hooks && npm install && chmod +x *.sh` — If your project already has .claude/settings.json, merge the hook entries instead of copying the file. Remove: `Remove the hooks block from .claude/settings.json`.
- Codex: The repo ships .codex/hooks.json, an adapter script and a copy of the skills in .agents/skills/. Launch codex from the repo root and accept the prompt to trust the project's hooks.

## What runs on the user's machine
- Code on the machine: yes (installs that register the hooks (.claude/settings.json or .codex/hooks.json))
- Network: optional
- Every prompt: A bash wrapper sources ~/.bashrc and .claude/hooks/.env, then runs a TypeScript script with tsx. It matches the prompt against skill-rules.json and prints the skill banner into the assistant's context. Writes session state to .claude/hooks/state/, metrics to .claude/hooks/state/metrics.jsonl and a log to .claude/hooks/data/session-intel.log.
- Every prompt, AI modes only: In fallback or ai-only mode the prompt is sent to Gemini, OpenAI, Anthropic or a local Ollama (first key found) for sorting.
- Every prompt, if a sessions.db exists: With GEMINI_API_KEY and a plan index you built, the prompt is turned into a vector by Gemini and matched against your saved plans.
- Before every Edit/Write: The guard blocks the first edit (exit code 2) while a required skill is pending. For edits with imports or definitions it sends the file path and the first 1,000 characters of the change to an AI provider if any key is set, in every mode, unless SKIP_PRETOOLUSE_AI=true. Logs to .claude/hooks/skill-guard.log.
- After every Edit/Write: Records the edited file, its folder and the build and tsc commands for it in .claude/tsc-cache/<session>/. Needs jq.
- After the Skill tool: Clears the loaded skill from the pending list.
- When the assistant stops: Deletes state files and tsc caches older than 7 days. If a sessions.db exists and dev/active/ has a task, starts a background npx tsx worker that sends the plan and context files to Gemini for embedding.
- Setup wizard: Copies .claude/ into the target project, runs npm install in .claude/hooks, and with --editor copies init.lua and vimrc into your home folder.
- Not wired by default: Optional Stop hooks for type checks and builds (tsc-check, stop-build-check-enhanced, trigger-build-resolver, error-handling-reminder) run only if you add them.

## Settings
- `skill_activation_mode`: In .claude/skills/skill-rules.json: disabled (default) | fallback | ai-only
- `SKILL_AI_PROVIDER`: gemini | openai | anthropic | ollama
- `SKILL_CONSERVATIVENESS`: strict | balanced | aggressive
- `SKIP_MANDATORY_SKILLS`: true turns off edit blocking
- `SKIP_PRETOOLUSE_AI`: true stops the edit guard's AI analysis
- `PRETOOLUSE_SOFT_BLOCK`: true blocks the first edit on AI suggestions too
- `SESSION_DOCS_ENABLED`: false turns off dev-doc reminders and indexing
- `SESSION_SEARCH_ENABLED`: false turns off search over saved plans
- `DEBUG_SKILLS`: 1 for verbose logs

## Examples (from the pack's own files)
- The banner the prompt script prints: output format defined in README.md
- The three files /dev-docs writes: output format defined in .claude/commands/dev-docs.md

## Author's numbers (as reported, not run by AgentGid)
- Built over 6 months of use on a project with 6 microservices and 50,000+ lines of TypeScript (The author's own project; no measurement shown). Source: diet103/claude-code-infrastructure-showcase/README.md
- 15-30 minutes to integrate into a project. Source: diet103/claude-code-infrastructure-showcase/README.md

## Steps only the person can do
- In Codex, accept the prompt to trust the project's hooks on first run (README.md (Works with Codex Too)) Then: The four hooks run under Codex
- Optional: create a Gemini, OpenAI or Anthropic key and put it in .claude/hooks/.env, then set skill_activation_mode to fallback (https://aistudio.google.com/apikey) Then: The prompt script sorts prompts with AI and falls back to keywords on failure
- Decide whether the wizard may write your editor config into your home folder (--editor) (setup.ts) Then: The wizard copies init.lua and vimrc, or skips them (default)

## Mistakes to avoid
- Not: Copy the showcase settings.json over your own. Instead: Merge the hook entries into your existing .claude/settings.json. Why: The integration guide warns against copying it directly
- Not: Skip jq because the README says it is only for the optional Stop hooks. Instead: Install jq; the wired edit tracker and the Codex adapter use it too. Why: Without jq the edit tracker exits and records nothing
- Not: Assume the default mode never calls an AI provider. Instead: Set SKIP_PRETOOLUSE_AI=true if keys are in your shell and you want no calls. Why: The edit guard creates a provider from any key it finds, independent of skill_activation_mode
- Not: Copy the skills unchanged into a project on another stack. Instead: Adapt the guides and the path patterns in skill-rules.json to your folders. Why: The guides are written for Express, Prisma, React and MUI v7, and the triggers match folders like frontend/src/
- Not: Edit only .claude/skills and expect Codex to see the change. Instead: Run .claude/scripts/sync-agent-skills.sh to refresh .agents/skills/. Why: Codex reads the mirror copy

## What leaves the machine
- The file path and the first 1,000 characters of an edit with imports or definitions → Gemini, OpenAI or Anthropic API (the first key found), or your Ollama URL, Before an edit, in any mode, when a key is in the environment, ~/.bashrc or .claude/hooks/.env. Opt out: SKIP_PRETOOLUSE_AI=true, or no AI keys in the environment
- Your prompt text → The chosen AI provider, Every prompt, only in fallback or ai-only mode. Opt out: Keep skill_activation_mode at disabled (default)
- Your prompt and the plan and context files of the active task (up to 8,000 characters each) → Gemini API (embeddings and relevance check), Only if GEMINI_API_KEY is set and you built .claude/hooks/data/sessions.db. Opt out: SESSION_SEARCH_ENABLED=false and SESSION_DOCS_ENABLED=false, or do not build the index

## Lines in the pack aimed at agents (ask the person first)
- "ALWAYS pass `--yes` with an explicit absolute target path:" (CLAUDE_INTEGRATION_GUIDE.md): --yes accepts every default without the person seeing the choices. Show the person what the wizard will copy and install, and get their go-ahead first.
- "Note: the first `npx tsx` run may ask to install tsx - say yes." (README.md): Installing tsx downloads a package from npm; ask the person before saying yes.
- "Your FIRST action must be: Skill tool calls." (.claude/hooks/skill-activation-prompt.ts): This text is injected into the agent's context on every matching prompt. It is the pack's own enforcement banner, not an instruction from the person.
- "**ALL ERRORS MUST BE CAPTURED TO SENTRY** - No exceptions. Never use console.error alone." (.claude/skills/error-tracking/SKILL.md): Only fits projects that use Sentry; check with the person before adding it.
- "Install Codex natively in your shell environment (`npm i -g @openai/codex`)." (README.md): A global install; leave it to the person.

## May I use it like this?
- commercial-app: yes (MIT: keep the license notice)
- redistribute-files: yes (MIT: keep the copyright and permission notice in copies)
- client-work: yes (MIT allows use in work for others)

## Which one to pick
- If You want skills that load themselves through hooks, plus TypeScript stack guides and a dev-docs routine to copy: skill:diet103/claude-code-infrastructure-showcase
- If You want a full workflow that plans, writes tests first and reviews before finishing: skill:obra/superpowers
- If You want a catalog and installer for many ready Claude Code agents, commands, hooks and settings: skill:davila7/claude-code-templates

## Works well with
- agent:claude-code: The hooks, agents and slash commands are built for Claude Code
- agent:openai-codex: The repo ships Codex hook settings and a skills mirror
- tool:sentry-node: The error-tracking skill adds Sentry v8 to Node services

## Works in and needs
- Works in Claude Code: project .claude folder (skills, hooks in settings.json, agents, commands)
- Works in Codex: hooks in .codex/hooks.json and skills folder .agents/skills
- Needs Node.js 18+ and npm: The hooks are TypeScript run with tsx; npm install in .claude/hooks
- Needs bash (macOS, Linux or WSL2): The hook wrappers are bash scripts
- Needs jq: The edit tracker and the Codex adapter parse hook input with jq
- Needs Gemini, OpenAI or Anthropic API key, or Ollama: Optional: AI matching and plan search

## How to tell it works
After setup, type "create a React component" in Claude Code. A banner above the answer names frontend-dev-guidelines as required, and the assistant loads that skill before it edits. Run bash .claude/scripts/verify-setup.sh to see the health check.

## Safety
The hooks run bash and TypeScript on every prompt and edit and read your ~/.bashrc. Read .claude/hooks/ before installing, and set SKIP_PRETOOLUSE_AI=true if AI keys live in your shell but you do not want edits sent to a provider.
