بنقرة واحدة
skill
Guidelines for creating and updating Claude Code skills. TRIGGER when: writing a new SKILL.md, modifying an existing skill, or the user asks about skill conventions.
القائمة
Guidelines for creating and updating Claude Code skills. TRIGGER when: writing a new SKILL.md, modifying an existing skill, or the user asks about skill conventions.
Update stale documentation and comments to match current code
Tag a new version, push to trigger CI, monitor the build, and verify the GitHub release
Extract and persist conversation learnings before context loss. TRIGGER when: user runs /reflect, or before /clear or compaction.
Analyzes changes and generates Conventional Commit messages
Arrange a project's README and GitHub Pages documentation into a consistent user-first layout: short README that links out, just-the-docs Jekyll site with a user-facing index, one page per user-facing feature (split into child pages when long), and a developer guide with technical sub-pages. TRIGGER when: setting up docs/ for a new project, adding a GitHub Pages site, writing or restructuring a README that will link to GH Pages, adding a new user-facing feature page, or asked to align docs with this project or bga-assistant. DO NOT TRIGGER when: editing unrelated docs outside docs/, working on a project that already has an incompatible docs framework (Docusaurus, MkDocs, VitePress, etc.).
Create or update the data flow architecture document (docs/pages/data-flow.md).
| name | skill |
| description | Guidelines for creating and updating Claude Code skills. TRIGGER when: writing a new SKILL.md, modifying an existing skill, or the user asks about skill conventions. |
Read this before creating or modifying any skill. These conventions ensure skills are consistent, minimal, and fast to invoke.
skills/<skill-name>/
├── SKILL.md # Entry point (required)
├── scripts/ # Helper scripts (optional)
└── references/ # Reference docs cited from SKILL.md (optional)
SKILL.md~/.claude/skills/ for global skills, .claude/skills/ for project-local~/.claude/skills/shared/If your skill needs to read or write anything under ~/.claude/projects/<project-id>/ — most commonly a project's memory directory — see ~/.claude/skills/skill/references/claude-project-memory-paths.md. It documents the path mangling rule, the cross-platform CWD recipe, and the common gotchas. Cite that file from your skill rather than re-deriving the algorithm.
Every SKILL.md starts with YAML frontmatter:
---
name: <skill-name> # kebab-case, matches directory name
description: >- # one-line summary for the skill list + trigger rules
What the skill does.
TRIGGER when: <conditions>.
allowed-tools: <tool-list> # optional — restricts which tools the skill can use
---
The description field serves double duty: it appears in the skill list shown to the model, and it controls when the model auto-invokes the skill. Write it so that:
Whitelist the minimum set of tools the skill needs. Use glob patterns for Bash:
allowed-tools: Bash(git diff:*), Bash(git add:*), Read, Glob
Omit allowed-tools only if the skill genuinely needs unrestricted access.
Skills are instructions, not documentation. Write them as numbered steps with exact commands. The model follows them literally — vague guidance produces inconsistent results.
Don't duplicate conventions that exist in shared files. Reference them:
Read `~/.claude/skills/shared/bash-rules.md` for bash command constraints.
Read `~/.claude/skills/shared/commit-message-rules.md` for commit message formatting.
references/SKILL.md should carry only what every invocation needs. Deep, situational, or rarely-touched knowledge belongs in references/<topic>.md with a short pointer from SKILL.md describing when to consult it. The model reads the reference on demand, so the entry point stays lean and the detail loads only when relevant.
Good candidates for extraction:
references/claude-project-memory-paths.md)Pointer style — cite with enough context that the model knows when to follow the link:
If <condition>, see `references/<topic>.md` for <what it covers>.
Keep it a one-liner in SKILL.md; the reference carries the depth.
If the skill performs irreversible operations (commits, pushes, deletes, moves), require explicit user confirmation before executing. Show the plan first, then ask.
State explicitly what the skill does NOT do. An "Out of scope" section prevents scope creep:
## Out of scope
- Do NOT amend existing commits
- Do NOT create or switch branches
! commandsThe !`command`` syntax in SKILL.md runs shell commands automatically as preprocessing before the skill content reaches the model. The command output replaces the placeholder inline — the model never sees the command, only the results. This eliminates the reconnaissance phase entirely.
See ~/.claude/learnings/skill-context-evaluator.md for known limitations, workarounds, and which commands work reliably in context.
When creating or updating a skill, identify every piece of data the skill needs before it can start its real work. For each one, add a labeled ! line. Place the Context section at the top of the skill body (before the first process step).
Format — each line is a labeled command:
## Context
- Uncommitted changes: !`git status --short`
- Diff summary: !`git diff HEAD --stat`
- Recent history: !`git log --oneline -10`
- Build errors: !`npm run build 2>&1 | tail -n 50`
For commands too complex for a single line, use a script:
- Precondition checks: !`bash ~/.claude/skills/<skill-name>/scripts/preflight.sh`
git reset HEAD to unstage) are allowed if they must run before the data-collection commands that follow.$() inside ! commands is blocked by the permission checker. Use simple commands or fallback chains with || (e.g. git log @{upstream}..HEAD 2>/dev/null).gh pr view when no PR exists) must go in the skill body, not in context — the context evaluator treats any non-zero exit as a fatal error.--short, --oneline, --stat, --format), line limits (-n, --limit, head -n), field selectors (--json ... --jq), or filters (grep, tail) to trim noise. Unbounded output wastes context.! commands are replaced by their output during preprocessing, the model never sees the command text — only the label and the output. Process steps must reference context data by its label (e.g. "use Diff summary"), never by the command that produced it (e.g. not "run git diff --stat").~/.claude/skills/<name>/...) can be denied by Claude Code's auto-mode classifier as "scope escalation". The credential-heuristic is especially trigger-happy on .env filenames. See "Cross-CWD safety" below.Since ! commands are preprocessed, the data is always present when the model reads the skill. Process steps should reference the context output directly — no need to re-run commands or check whether data is available. When referring to context data in process steps, use the same label from the Context section (e.g. "Ignore rules from Context above"), not the underlying filename or command — the model sees labels, not filenames.
Every context item must be referenced by at least one process step (by its label). When reviewing or updating a skill, scan the Context section and remove any items that no process step uses — unused context wastes the preprocessing budget and pollutes the model's input with irrelevant data.
A user can invoke any global skill from any project. The skill's own config / reference files live in ~/.claude/skills/<name>/, which is outside the user's CWD whenever the CWD isn't ~/.claude/. Claude Code's auto-mode classifier runs heuristics on every Bash command — when a ! Context command reads outside the CWD, especially from .env-suffixed files, it may deny with: "scope escalation beyond the <repo> repo and may expose credentials".
Mitigations, in order of preference:
! + test -f ~/.claude/skills/<name>/config/<file> && echo PRESENT || echo MISSING and branch on the literal PRESENT/MISSING in process steps. No file content is read; the credential heuristic doesn't fire..env filenames for skill-local config. Use .conf, .ini, .txt, or no extension. The classifier treats .env as credential-bearing regardless of actual contents.:* wildcard in allowed-tools when the compound form cmd && X || Y is needed:
Bash(test -f ~/.claude/skills/<name>/config/<file>:*). The :* allows arguments and shell continuations after the prefix.Read tool, not Bash, when content really is required. Read(~/.claude/skills/<name>/config/<file>) declared in allowed-tools doesn't go through the Bash classifier.If the skill's own script (Bash(python3 ~/.claude/skills/<name>/scripts/<script>)) is also denied when invoked from outside CWD, the user can add a project-local or global permission rule in settings.json allowing scripts under ~/.claude/skills/.
When creating a new global skill, check the global gitignore (~/.gitignore or whatever git config --global core.excludesfile returns) for patterns that would exclude it. If the skill directory would be ignored, add a negation entry (e.g. !claude/skills/<skill-name>/) so it gets tracked.
Skills that configure bash functions (like build and deploy) should reference ~/.claude/learnings/shell-environment.md for the canonical list of expected functions and the verification checklist. When adding a new bash function to a skill, update that file too.
allowed-tools with Bash patterns (see ~/.claude/skills/shared/bash-rules.md)cd — the working directory is the project root