
On this page
Most Claude Code tutorials build a to-do app in an empty folder. This post shows the setup behind a site that is live: builtbyahmad.com, a Next.js 16 portfolio with a JSON-powered blog, case studies, JSON-LD and Lighthouse scores in the 90s and 100s. Everything below is in the repository; nothing is a hypothetical config.
| Piece | In this repo |
|---|---|
| Rules file | AGENTS.md, about 180 lines |
| Skills | 27 in .claude/skills/ |
| Subagents | 10 in .claude/agents/ |
| Slash commands | 2 in .claude/commands/ |
| Build guard | npm run content:check, runs before every build |
1. AGENTS.md: the rules that apply to every task
There is no CLAUDE.md in this repo, only AGENTS.md. Claude Code reads AGENTS.md when no CLAUDE.md exists, and so do Codex, Cursor and Antigravity, so one file covers every tool. Next.js 16 itself writes a block at the top of it that tells the agent to read the docs shipped in node_modules/next/dist/docs/ before writing code, because this version's APIs differ from what the model learned.
The rest is mine. The rule I follow for what belongs there: things that are true on every task and that the agent would get wrong without being told.
- **Cache Components is on.** Never call `new Date()`, `Date.now()`, `Math.random()`
during render. Use a "use cache" server component or move the call into useEffect.
- `error.tsx` props are `{ error: unknown; retry: () => void }` (it is `retry`, not `reset`).
- **framer-motion:** the app is wrapped in LazyMotion. Always use `m.div`, never `motion.*`.
- **No fade-in above the fold.** Chrome does not count an element at opacity: 0 as
painted, so a fade on the hero pushes LCP behind the JavaScript.
- Use theme utilities (`bg-primary`, `text-muted-foreground`). Do not hard-code hex values.Every one of those lines exists because the agent (or I) got it wrong once. The fade-in rule came from a Lighthouse investigation where removing an opacity animation took LCP from about 4.4s to 0.9s; that story is in the Lighthouse post. Writing the lesson into AGENTS.md means it doesn't happen twice.
- Do put in: folder structure and naming, version-specific API changes, performance and accessibility rules, how to add content, commands to verify work.
- Leave out: anything the agent can read from the code in seconds, long checklists for one kind of task (those are skills), and secrets.
2. Skills: 27 playbooks, loaded only when needed
The skills cover the jobs this site actually has. Claude Code only sees their one-line descriptions until a task matches, so 27 of them cost almost nothing per session.
| Area | Skills |
|---|---|
| Performance | performance, core-web-vitals, frontend-performance, web-quality-audit |
| Accessibility | accessibility, accessibility-essentials |
| SEO & content | seo, schema, content-strategy, copywriting, content-research-writer |
| React & Next.js | nextjs-app-router-patterns, react-best-practices, react-state-management, typescript-advanced-types |
| Styling & UI | tailwind-css-patterns, ui-styling, ui-component-patterns, responsive-layouts, design skills |
Two examples of skills changing the result. When I asked for structured data on the blog, the schema skill was loaded and it knew Google stopped showing FAQ rich results, so the posts got BlogPosting and BreadcrumbList markup and no FAQPage. When content is written, the copywriting skill bans patterns that make text read as AI-written and requires every claim to be backed by a fact. How to write your own is in the Agent Skills guide.
3. Subagents: separate context for separate jobs
The 10 subagents in .claude/agents/ are specialists: accessibility-auditor, code-reviewer, component-architect, design-review, frontend-developer, frontend-security-coder, javascript-pro, responsive-design-specialist, tailwind-stylist and ui-ux-designer. Each is a Markdown file:
---
name: accessibility-auditor
description: WCAG 2.2 AA accessibility specialist. Use to audit components/pages for
semantic HTML, keyboard navigation, screen-reader support, color contrast, focus
management, ARIA correctness, and form accessibility.
model: inherit
---
You are an accessibility specialist. You audit code against WCAG 2.2 AA and report
concrete, fixable issues...The benefit is context. An audit reads dozens of files; done in a subagent, only the findings come back to the main conversation, which stays focused on building. Subagents also run in parallel. For the Claude Code vs Codex vs Cursor vs Antigravity comparison, four agents read the four tools' official docs at the same time, each returning only the commands and paths with a source URL.
4. The loop: plan, build, verify
- Plan in a file. Big features start as a plan in
docs/(the blog and case studies came fromdocs/content-plan.md, ten phases). The plan survives between sessions; a chat doesn't. - Build one phase at a time. Each phase is small enough to review: types and validation first, then components, then pages.
- Verify with commands, not vibes.
npx tsc --noEmit,npm run lint,npm run build, then Lighthouse on a production build. The agent runs these and fixes what fails before calling a phase done. - Write the lesson down. Anything that surprised us goes into
AGENTS.md.
One guard is part of the project itself: npm run content:check runs before every build. It fails the build if a blog post's file name doesn't match its slug, a post isn't registered, an image is missing, or an SEO title is longer than 60 characters. The agent can't ship a broken post, and neither can I.
5. What I'd add next: a hook
Rules in AGENTS.md are instructions; the model usually follows them, but nothing forces it. Hooks are enforced: a script that runs on an event and can block the action. This repo doesn't have one yet. The first I'd add stops edits to .env files:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{ "type": "command", "command": "node .claude/hooks/block-env.mjs" }
]
}
]
}
}// Claude Code sends the tool call as JSON on stdin.
let input = "";
for await (const chunk of process.stdin) input += chunk;
const file = JSON.parse(input).tool_input?.file_path ?? "";
if (/(^|[\\/])\.env(\.|$)/.test(file)) {
console.error("Editing .env files is blocked. Ask the developer to change it.");
process.exit(2); // exit code 2 = block the tool call
}
process.exit(0);Writing the hook in Node instead of Bash keeps it working on Windows, where this site is built. A PostToolUse hook that runs the linter after each edit is the next obvious one.
What this setup gets me
- Fewer repeated mistakes. Version-specific traps (Cache Components,
retryvsreset,m.div) are written down once. - Consistent quality checks. Accessibility, SEO and performance are checked the same way every time, by skills and subagents built for it.
- A clean main conversation. Research and audits happen in subagents; the main thread stays on the feature.
- Portability.
AGENTS.mdandSKILL.mdwork in Codex, Cursor and Antigravity too, so the setup isn't tied to one vendor.
Frequently asked questions
Should I use CLAUDE.md or AGENTS.md?
If only Claude Code is used, either works. If your team also uses Codex, Cursor or Antigravity, put the rules in AGENTS.md: all four read it, and Claude Code uses it when there is no CLAUDE.md.
What should go in CLAUDE.md or AGENTS.md?
Facts that are true on every task and that the agent would get wrong without being told: structure and naming, version-specific API changes, project rules, and the commands that verify work. Long task-specific checklists belong in skills.
What's the difference between a hook and a rule in CLAUDE.md?
A rule is an instruction the model usually follows. A hook is a script Claude Code runs on an event, such as before a file edit, and it can block the action, so it is enforced.
Do skills and subagents slow Claude Code down?
Not noticeably. Until a task matches, Claude Code only sees each skill's and subagent's short description, and the full instructions load when they are used.
- Claude Code
- AGENTS.md
- Agent Skills
- Subagents
- Hooks
- Next.js 16
Keep reading

AI Coding Tools7 min read
Agent Skills Explained: Write One SKILL.md for Claude Code, Codex, Cursor and Antigravity
Agent Skills are folders of instructions an AI coding agent loads only when a task needs them. What they are, why they beat a giant rules file, how to write your first SKILL.md, and the GitHub repos worth installing from.

AI Coding Tools8 min read
Claude Code vs Codex vs Cursor vs Antigravity: Skills, Subagents and MCP Compared (2026)
The four big AI coding agents now share the same building blocks: a rules file, Agent Skills, subagents, hooks and MCP servers. Here is how each one installs, where it keeps its config, and which one fits which job.
