9 chapters · 33 min
Skills
Chapter 2 of 9
Create, modify, review, and fix Agent Skills in the contentful/skills repository.
5 minutes · 1,149 words · 25 sections
How to create, modify, and review Agent Skills (opens in a new tab) for the
contentful/skills repository.
For the full conventions document with templates, detailed rules, and examples, see references/conventions.md (opens in a new tab).
An Agent Skill is a directory containing a SKILL.md file with YAML frontmatter
and markdown instructions. It can optionally include scripts, reference documents,
and assets. The format is portable across Claude Code, Cursor, GitHub Copilot,
OpenAI Codex, Gemini CLI, and other agent platforms.
Skills use progressive disclosure — three tiers of context loading:
name and description fields loaded at startup
for all installed skills. This is how the agent decides which skills are relevant.SKILL.md body loaded
when the agent activates the skill.scripts/, references/, and assets/
loaded only when the instructions reference them.The description field is the most important piece — it’s always in context and
determines whether the skill activates. Keep the SKILL.md body concise (under
500 lines). Heavy reference material goes in separate files.
skills/ Distributed to customers (distribution boundary)
contentful-personalization/ A skill — name field is "contentful-personalization"
SKILL.md
package.json
references/
scripts/
bin/
.agents/skills/ Internal contributor skills (never distributed)
skill-authoring/
SKILL.md
package.json
references/skills/ is the distribution boundary. Only its contents are installed via
npx skills add contentful/skills. Internal skills in .agents/skills/ stay
in the repo. .claude/skills is a symlink to .agents/skills/ for Claude Code
discovery.
| Field | Constraints |
|---|---|
name | 1-64 chars. Lowercase letters, numbers, hyphens only. No leading/trailing/consecutive hyphens. Must match parent directory name. |
description | 1-1024 chars. What the skill does AND when to use it. This is the sole activation trigger — make it count. |
| Field | Purpose |
|---|---|
license | License name or reference to bundled file |
compatibility | 1-500 chars. Environment requirements (e.g., “Requires Node.js 18+”) |
metadata | Arbitrary key-value map. Use metadata.author and metadata.version. |
allowed-tools | Space-delimited pre-approved tools (experimental) |
These fields are beyond the base agentskills.io spec — use for skills in this repo:
| Field | Description |
|---|---|
disable-model-invocation | true prevents auto-loading; user invokes via /<name> |
user-invocable | false hides from / menu; Claude can still auto-load |
context | fork runs in an isolated subagent |
agent | Subagent type when context: fork |
model | Model override when skill is active |
effort | Effort level override (low, medium, high, max) |
Markdown after the frontmatter. No format restrictions, but recommended sections:
Reference scripts and docs with relative paths from the skill root:
Run the diagnostic:
${CLAUDE_SKILL_DIR}/scripts/check.sh --env production
For API details, see [references/api.md](references/api.md).The description is the sole activation trigger. The agent scans all installed
skills at startup and loads only name + description (~100 tokens each). The
full SKILL.md body loads only when the agent judges the skill relevant.
Write descriptions that are slightly “pushy” — it’s better to activate too often than to miss a relevant trigger.
Best pattern:
Use this skill when [explicit scenarios]. Triggers on [keyword list].
Does NOT apply to [boundary conditions].Good:
description: >-
Diagnose and fix Contentful optimization and personalization issues.
Validates configuration, SDK versions, API connectivity. Use when
troubleshooting optimization problems, debugging personalization behavior,
or checking why experiments aren't running. Also triggers on "why isn't
personalization working" or "check my config". Not for initial end-to-end
setup from scratch — that is covered by the onboard flow in the same
`contentful-personalization` skill.Bad:
description: Helps with optimization issues.Include:
the contentful-guide skill for general CMS help)my-skill/
SKILL.md Required
package.json Required (even for docs-only)my-skill/
SKILL.md Required
package.json Required
references/ On-demand documentation
api.md
patterns.md
assets/ Templates, data files, static resourcesmy-skill/
SKILL.md Required
package.json Required
scripts/ Stable public interface (SKILL.md references these)
check Executable (chmod +x)
fix Executable (chmod +x)
src/ Optional — implementation behind scripts/
...
references/ On-demand documentationRequired for every skill, even documentation-only. Provides versioning and npm-compatible metadata.
Distributed skills (in skills/):
{
"name": "@contentful/skill-<domain>-<skill-name>",
"version": "1.0.0",
"description": "Same as SKILL.md description (short form)",
"license": "MIT",
"files": ["SKILL.md", "references/**", "scripts/**", "assets/**"]
}Internal skills (in .agents/skills/):
{
"name": "skill-name",
"version": "1.0.0"
}Versioning happens at the package level — metadata.version in SKILL.md
frontmatter should mirror package.json version.
| Context | Pattern | Example |
|---|---|---|
| Directory name | <domain>-<product-or-topic>, lowercase-hyphen | contentful-personalization |
name field | must match directory | contentful-personalization |
| npm package | @contentful/skill-<skill-name> | @contentful/skill-contentful-personalization |
Name validation rules: 1-64 chars, [a-z0-9-] only, no leading/trailing/consecutive
hyphens, must match parent directory name exactly.
Skills live in a flat structure directly under skills/. The name must be globally
unambiguous (not just readiness) — the domain prefix makes this possible while
remaining compatible with the agentskills.io spec.
scripts/ is the skill’s stable public interface. SKILL.md references
only scripts/<name>, never internal paths.
Scripts can be anything executable: bash, Python, compiled binaries, Node.js,
etc. The only requirement is that they are executable (chmod +x) and follow
the design rules below.
Simple skills — executables directly in scripts/:
contentful-personalization/
scripts/
run Entry script (chmod +x) or thin wrapperComplex skills — wrappers in scripts/ delegate to an implementation
directory (e.g., src/, bin/):
my-code-skill/
scripts/
check Thin wrapper → delegates to src/ or bin/
src/ Optional — TypeScript source for skill-kit builds
...
bin/ Optional — compiled outputThe wrapper decouples the skill’s contract from its implementation. You can
refactor src/ freely without updating SKILL.md. SKILL.md never references
src/ paths — only scripts/<name>.
A wrapper is a thin executable that delegates to the real implementation:
#!/usr/bin/env bash
exec node "$(dirname "$0")/../src/check.js" "$@"Make wrappers executable: chmod +x scripts/check
For a complete TypeScript project setup (tsconfig, src/ layout, dependencies, testing), see references/typescript-scripts.md (opens in a new tab).
Scripts are invoked by agents in non-interactive shells. Design them so the agent can read stdout/stderr and decide what to do next.
Hard requirements:
--help / -h: print usage to stderr, exit 0. This is the primary way
an agent learns the script’s interface.Best practices:
--dry-run for destructive operations--long-name flags (no single-letter flags except -h)--limit/--offset for pagination.--confirm or --forceFor output patterns, exit code conventions, and --help templates, see
references/conventions.md (opens in a new tab).
Use explicit phrasing in SKILL.md body to reference related skills:
For personalization, use the contentful-personalization skill. Its onboard
flow covers readiness and SDK install; the doctor flow covers troubleshooting.
For "which API should I use", use the contentful-guide skill.This is a documentation convention for the agent — no runtime enforcement.
skills/ directory is the distribution boundaryChoose the right location:
skills/<skill-name>/ (flat, one directory per skill).agents/skills/<skill-name>/Create the directory with the skill name as directory name
Write SKILL.md:
name (matching directory) and descriptionreferences/Write package.json:
@contentful/skill-<domain>-<name>, version, files arrayAdd supporting files as needed:
references/ for on-demand documentationscripts/ for executable codeassets/ for templates and static resourcesVerify discovery: npx skills add . --list --full-depth
Update README.md if it’s a distributed skill
name field matches parent directory name exactlydescription is 1-1024 chars, specific about triggers and scopedescription includes negative scope (“Not for X”)references/, not inlinepackage.json exists with name and version@contentful/skill-<domain>-<name>--help supportIf a skill isn’t triggering when it should (or triggers when it shouldn’t):
For automated description optimization with evals, see Anthropic’s skill-creator (opens in a new tab).
Install this repository
npx skills add contentful/skills/plugin marketplace add contentful/skillsSkills install per repository, not per chapter — the CLI has no documented per-skill form, so we do not print one.
Create, modify, review, and fix Agent Skills in the contentful/skills repository. Use when creating a new skill from scratch, editing an existing SKILL.md or package.json, reviewing skill structure for correctness, fixing skill formatting or naming issues, or looking up skill conventions. Also triggers on "create a skill", "add a skill", "skill template", "review this skill", "fix skill structure", "SKILL.md format", "naming convention", "how do I make a skill", "how do skills work", "what is an Agent Skill", "skill description", "write a description", "improve description", "skill frontmatter", "skill-kit", "build a skill", "validate skill", "check my skill". Not for general development or non-skill work.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 9 August 2026.SKILL.md, not by matching a directory convention. 3 distinct layouts observed: local-skills/skills/*/SKILL.md, skills/*/SKILL.md, skills/contentful-apps/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Contentful, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree./contentful/skills.md, and each chapter at its own .md URL.4 files · 24 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of chapter 2.
Documentation the agent loads on demand, rather than up front.
Executable code the skill can run.
Everything else published alongside the skill.