Setup AI Skills in Claude Code, Gemini CLI & Codex [2026]
Command the terminal. Here is exactly how to inject custom agent skills, rules, and system prompts into the most powerful CLI-based coding assistants.
Quick Answer
Unlike visual IDEs that use hidden dotfiles, terminal-based orchestration agents (Claude Code, Gemini CLI, Antigravity) look for an explicit SKILL.md file in your project root. By placing your custom XML-formatted instructions in this file, the CLI agent will automatically consume your rules before executing any git or bash commands.
Why CLI Agents are Different
Visual visual composers (like Cursor) excel at editing individual files. But CLI Agents like Claude Code and Google's Gemini CLI run directly in your bash/zsh shell.
Because they can automatically run npm run test, read the output, and iteratively fix bugs, giving them strict boundaries via a Skill file is critical to prevent runaway loops or destructive bash commands.
$ claude
✓ Detected SKILL.md in project root.
✓ Detected 3 active MCP Servers.
Claude > How can I help you today?
The Universal Setup: SKILL.md
In 2026, the OpenCode standard unified how CLI agents consume context. All major terminal agents now look for the exact same file.
- Create the file: Run
touch SKILL.mdin the root of your repository. - Format with XML: CLI agents are heavily trained on XML tags (especially Claude 3.5 Sonnet+). Do not use markdown headers; use explicit tags.
- Define the limits: Include a strict
<rules>section that defines what bash commands the agent is not allowed to run.
Example CLI Agent Payload:
<context> This is an Express.js internal microservice handling billing. We use PostgreSQL and Stripe. </context> <rules> 1. DO NOT ever run 'npm install' without asking the user first. 2. ALWAYS run 'npm run test:fast' after modifying any controller in /src/controllers. 3. If tests fail, you have permission to fix them iteratively up to 3 times before pausing. </rules>
Agent-Specific Quirks
Claude Code
Native Anthropic integration means Claude Code handles Model Context Protocol (MCP) servers locally without extra config. If your `SKILL.md` requires an MCP server, Claude Code will automatically try to spin it up based on its internal registry.
Antigravity (Google DeepMind)
Antigravity is designed for massive codebases. Alongside `SKILL.md`, it supports injecting deep architectural artifacts generated by user approval. Always specify exact file paths in your rules (e.g., "See \`docs/database.md\`") and Antigravity will pre-fetch them.
Gemini CLI
Gemini thrives on massive context windows (up to 2M+ tokens). You can actually dump entire API documentation PDFs directly into a `.skills/` directory alongside the `SKILL.md` file, and Gemini CLI will cache them for rapid retrieval.
Ready for Terminal Supremacy?
Stop letting your CLI agents hallucinate destructive bash commands. Download strict, battle-tested SKILL.md templates.