learn-codex-with-phoebe / Session 3 of 6
Learn Codex with Phoebe · Session 3 of 6

AGENTS.md and skills: your taste, encoded

You've been re-explaining your standards to Codex every session. Today that stops. AGENTS.md at three levels holds your standing facts; skills - an open, cross-agent standard - hold your reusable procedures. Encode them once, benefit forever.

🟡 Medium Builders 45 min
0-3 · Welcome 3-17 · AGENTS.md & skills 17-40 · Build two skills 40-45 · Q&A
Part 0

Stop repeating yourself

By now you've typed "editorial minimal, one accent color, no frameworks" enough times to dream about it. Every instruction you repeat is a tax on every future session - and Codex ships two mechanisms to abolish the tax. AGENTS.md carries your standing facts and rules; skills carry your named, reusable procedures. Today you finish the first properly and build two of the second for your site. This is the session where Codex stops being a tool you configure and starts being a teammate you've trained.

Live - presented in session Self-study - read after class ★ Build-along demo The project: YOUR website
★ What you walk out with today A three-level mental model of AGENTS.md, two working skills in your repo - a design-system skill and a content-voice skill - and the judgment to know which mechanism any future rule belongs in.
Part 1 · covers the personalization docs, fully

AGENTS.md, properly 6 min live

Session 2 gave you a repo-root AGENTS.md. There are actually three levels, read in cascade - and knowing what belongs at each level is the difference between a file Codex uses and a novel it skims.

1 · Global ~/.codex/AGENTS.md you, everywhere: universal preferences 2 · Repo root my-site/AGENTS.md this project: rules, taste, layout 3 · Subdirectory my-site/ideas/AGENTS.md this section only: scoped rules Read in cascade, top to bottom. All levels apply at once; where they conflict, the most specific level wins. Same files work across CLI, desktop app, and IDE - write once, applies at every door.
🔍 Click to zoom - the AGENTS.md cascade: global → repo → subdirectory, most specific wins
LiveWhat belongs at each level3 min
LevelBelongs thereFor our project
Global (~/.codex/AGENTS.md)Your universal preferences - true on every project you'll ever touch"I'm learning - explain non-obvious changes", "always summarize diffs"
Repo rootThis project's rules: purpose, boundaries, taste, file layoutThe v1 you built in Session 2 - plain code, editorial minimal, file map
SubdirectoryRules for one section that differ from the restAn ideas/ folder rule: "posts here are 200 words max, first person"
The placement test Ask "how far does this rule travel?" Every project → global. This project → repo root. One corner of this project → subdirectory. Misplaced rules either leak everywhere or vanish when you need them.
LiveAnti-patterns: novels and misfiled procedures3 min

Two failure modes eat most AGENTS.md files in the wild:

  • The novel nobody reads. Forty rules, essays on philosophy, three contradictions. Every line spends context on every conversation, relevant or not - and important rules drown in filler. Keep it terse. If a rule hasn't mattered in a month, cut it.
  • Rules that belong in a skill. A step-by-step procedure with its own reference material - "here's exactly how we produce X" - doesn't belong in AGENTS.md. AGENTS.md is always loaded; skills load only when their moment comes. Misfiling procedures as rules bloats every session with instructions for tasks you're not doing.
Smell - a procedure squatting in AGENTS.md## Writing ideas posts Step 1: start with a hook question. Step 2: state the one takeaway. Step 3: 200 words max, first person. Step 4: end with the takeaway line repeated. Step 5: check reading level. Step 6: ...

That's a skill wearing an AGENTS.md costume - it has steps, a format, and a trigger moment ("when writing an ideas post"). We'll rehome it in Part 3.

Part 2 · covers the build-skills docs

Skills: the open standard 8 min live

A skill is a folder that teaches your agent a repeatable procedure. It's an open, cross-agent standard - the same skill folder works in Codex, Claude Code, and anything else that speaks it. One SKILL.md file is required; everything else is optional.

📁 content-voice/ SKILL.md ← required scripts/ · optional references/ · optional agents/openai.yaml · opt. Frontmatter = the doorbell 🔔 name + description - the agent reads ONLY this to decide whether the skill fits the current task. The description IS the trigger: name the task, name the moment. Body = the manual 📖 Loaded only after the doorbell rings. The full procedure: steps, format rules, examples - as long as it needs to be, because it costs nothing until it's actually used. Doorbell small and sharp, manual as thick as you like - that split is why skills scale and AGENTS.md novels don't.
🔍 Click to zoom - skill anatomy: the doorbell (frontmatter) decides, the manual (body) instructs
LiveWhere skills live and how they fire3 min
LocationScopeUse for
.agents/skills/ in the repoThis project - travels with the repo, teammates get it tooOur two site skills today
~/.agents/skills/ in your home folderYou, on every project on this machinePersonal procedures you reuse everywhere
Admin-managedEveryone in an organizationTeam SOPs, rolled out centrally

Three ways a skill fires:

  • Implicitly: your task matches the description, the doorbell rings, the skill loads. This is the goal state - you just work, and the right procedure shows up.
  • Explicitly by mention: $content-voice in a prompt forces that skill in.
  • Via /skills: lists what's installed - your first stop when a skill isn't firing.
LiveCross-agent portability: write once, use in every agent2 min
Real world

This is the quiet superpower of the standard. Skills are the SAME format Claude Code uses - a Claude Code skill folder copies into .agents/skills/ and works in Codex unchanged, and vice versa. Real teams run exactly this way: ONE skills folder in the repo, colleagues on Codex and colleagues on Claude Code both drawing from it. Your procedures outlive any single tool subscription - that's what "open standard" buys you.

  • agents/openai.yaml is the optional per-agent tuning file - Codex-specific settings live there without breaking the skill for other agents.
  • Plugins bundle multiple skills into one installable package - the distribution format when your skills are worth sharing beyond one repo.
Self-study$skill-creator: the skill that builds skills2 min read

Codex ships a built-in $skill-creator skill that scaffolds new skills interactively - it interviews you about the task, the trigger moment, and the rules, then writes the folder, the frontmatter, and the body for you. It's also opinionated about descriptions, which matters because the description controls triggering: vague description, skill never fires; sharp description ("use when..."), skill fires exactly when it should. Demo 1 uses it end to end. Hand-writing a SKILL.md (Demo 2) is worth doing once anyway - a skill is just a markdown file, and knowing that removes all the mystery.

Part 3 · applying it to the project

Encode the site's standards 4 min live

You now have two boxes to sort every standard into. The sorting rule is simple: a standing fact goes in AGENTS.md; a procedure with a format goes in a skill.

LiveThe sorting rule, and today's two skills4 min
StandardMechanismWhy
"No frameworks, plain code"AGENTS.mdStanding fact - always true, no steps
"Files live at the project root"AGENTS.mdStanding fact about layout
How to style any new component (palette, spacing, type)Skill: site-design-systemProcedure with a format, fires when building UI
How an ideas post gets written (length, voice, structure)Skill: content-voiceProcedure with a format, fires when writing posts

Those two skills are what we build in the demos - and they pay off immediately: Session 4 builds the about, showcase, and ideas pages, and both skills will fire on their own while we do.

Still unsure which box? Ask "does it have steps and an output format?" Yes → skill. It's just true → AGENTS.md. And if it only applies in one folder, remember the third option: a subdirectory AGENTS.md.
Demo 1 of 2 · the main event

Build site-design-system with $skill-creator ★ 12 min · everyone builds

In your my-site folder, kick it off: "$skill-creator - I want a skill called site-design-system that encodes this site's visual rules so every new component follows them." It starts interviewing you.

Feed the interview your real answers - here's the shape (swap in YOUR taste):

★ Interview answers to give $skill-creatorTrigger moment: whenever building or restyling any visual component on this site. Accent color: deep teal #0F766E - the ONLY accent. Everything else is near-black text on off-white. Spacing: multiples of 8px only. Sections get 64px vertical padding; cards get 24px. Typography: system font stack. Body 18px/1.6. Headings tight, max two sizes per page. Banned patterns: drop shadows, gradients, more than one accent color, decorative icons, anything that smells like a template.

Review what it scaffolds in .agents/skills/site-design-system/ - open SKILL.md, read the description it wrote. Sharpen it if the trigger moment isn't crisp.

Test A - explicit: "Using $site-design-system, add a small 'currently reading' card to the homepage." Verify the result obeys your palette and spacing.

Test B - implicit, the real test: new conversation, NO mention of the skill: "Add a footer with contact links to the homepage." Watch whether the skill fires on its own. If it doesn't, the description is too vague - sharpen it and re-test. That's the whole debugging loop for skills.

★ What just happened Your design taste became executable. From now on "add a component" means "add a component that looks like mine" - without you saying so.
Demo 2 of 2

Hand-write content-voice ★ 8 min · everyone writes

No scaffolder this time - create .agents/skills/content-voice/SKILL.md yourself (ask Codex to create the file with your content, or use any editor):

★ Complete SKILL.md for content-voice--- name: content-voice description: Use when writing or editing a post for the ideas section of this site. Applies the site owner's writing voice and the ideas-post format. --- # Content voice - ideas posts Every ideas post follows this shape: 1. Open with the idea itself in one plain sentence. No throat- clearing, no "In today's world...". 2. 200 words maximum. If it needs more, it's two posts. 3. First person, concrete, warm. Short sentences. No jargon without a plain-language gloss. 4. Exactly one takeaway line at the end, on its own line, starting with "The takeaway:". 5. Titles are lowercase, five words or fewer. When editing an existing post, preserve the author's phrasing wherever it already meets these rules - tighten, don't rewrite.

Notice what you just did: frontmatter doorbell (when to fire), body manual (how to write). That's the entire standard - no tooling required.

Test it on a real sample: "Write an ideas post about why I think every team needs a data dictionary." Check the output against the five rules - length, first person, the takeaway line.

One correction lap if needed - and if the skill didn't fire implicitly, you know exactly which line to fix: the description.

After the session

This week ◐ 30 min total

Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · Your skill never fires unless you type $its-name. What do you fix first?

The agent reads only name + description to decide whether a skill fits the task. Vague description, silent doorbell. Sharpen "use when..." and re-test.

2 · "Ideas posts: 200 words, first person, one takeaway line, five formatting steps." AGENTS.md or skill?

Standing facts go in AGENTS.md; procedures with steps and an output format go in skills, loading only when their moment comes. This one has both steps and a format.

3 · Where do skills live so they travel WITH this repo (and reach teammates too)?

Repo skills live in .agents/skills/ and ship with the project; ~/.agents/skills/ is personal, machine-wide. AGENTS.md is for rules, not skill folders.

Source material

Official sources covered

This session teaches the working content of OpenAI's official materials - docs at learn.chatgpt.com and free courses at OpenAI Academy.

Build skills (official docs)anatomy, locations, triggering, $skill-creator, plugins, portability - Part 2 + both demos
Personalization / AGENTS.md (official docs)full hierarchy, level placement, anti-patterns - Part 1, completes Session 2's basics
Codex for Builders (OpenAI Academy)the skills portion here; the rest lands in Sessions 4 and 6

Session 3 cheat sheet · pin this

AGENTS.md cascade~/.codex/AGENTS.md (you, everywhere) → repo root (this project) → subdirectory (this section). Most specific wins.
The sorting ruleStanding fact → AGENTS.md. Procedure with steps + format → skill. One-folder rule → subdirectory AGENTS.md.
Skill anatomyFolder + SKILL.md. Frontmatter (name + description) = doorbell, decides triggering. Body = manual, loads on demand. Optional: scripts/, references/, agents/openai.yaml.
Where & how they fire.agents/skills (repo) · ~/.agents/skills (you). Implicit by task match · $name mention · /skills to list.
Not firing?Fix the description, not the body. Test implicitly: fresh conversation, matching task, no $mention.
PortabilityOpen standard, shared with Claude Code - skills copy between agents unchanged. Bundle several as a plugin to distribute. Read any SKILL.md before installing it.