You're using Kiro, Claude Code, and Codex. Tomorrow you might add Gemini CLI or open a file in Cursor. The three-layer architecture (Hooks → Commands → Skills) doesn't belong to any single tool — it's a pattern that maps across all of them.
This lesson shows how the SAW harness implements the same workflow patterns for four different AI coding tools — and how you can make your own harness portable.
Every AI coding agent has the same three concepts:
But they all use different config formats, different directory conventions, and different invocation syntax. If you build your workflow for one tool, switching costs you a rewrite — unless you design for portability from the start.
The SAW harness solves this by maintaining parallel provider directories with the same logical content adapted to each tool's native format. Your workflows stay the same; only the encoding changes.
hooks-config.jsoncommands/*.mdskills/*/SKILL.mdagents/*.mdsettings.json hooks sectioncommands/*.tomlskills/*/SKILL.mdGEMINI.mdconfig.toml approval policy.agents/skills/*.mdAGENTS.md@rule-name invocation.mdc files w/ YAML frontmatter30-*.mdc| Aspect | Claude Code | Gemini CLI | Codex CLI | Cursor IDE |
|---|---|---|---|---|
| Config Format | JSON + Markdown | JSON + TOML | TOML | YAML frontmatter + Markdown (.mdc) |
| Hooks | hooks-config.json |
settings.json → hooks key |
config.toml → approval policy |
Glob-matched rules (always-apply) |
| Commands | /start-work |
/workflow:start-work |
Natural language prompt | @rule-name |
| Skills Location | .claude/skills/*/SKILL.md |
.gemini/skills/*/SKILL.md |
.agents/skills/*.md |
.cursor/rules/10-*.mdc |
| Skill Activation | Skills 2.0 frontmatter triggers | Frontmatter triggers | Agent discovers on context | Glob pattern in YAML frontmatter |
| Hook Migration | N/A (primary format) | gemini hooks migrate --from-claude |
Manual translation | Manual translation |
The same workflow action has different invocation syntax per provider:
| Action | Claude Code | Gemini CLI | Codex CLI |
|---|---|---|---|
| Start work on ticket | /start-work PROJ-123 |
/workflow:start-work PROJ-123 |
"Start work on PROJ-123" |
| Pre-PR validation | /pre-pr |
/workflow:pre-pr |
"Run pre-PR checks" |
| Local sync | /local-sync |
/local:sync |
"Sync local environment" |
| Remote deploy | /remote-deploy |
/remote:deploy |
"Deploy to remote" |
Gemini CLI uses namespaced commands (/namespace:command) while Claude Code uses flat names (/command). Codex doesn't have slash commands at all — you describe what you want in natural language and it discovers the right skill.
.agents/skills/ DirectoryThe directory contains 18 skills covering patterns like:
api-patterns/ — API design conventionssafe-workflow/ — SAFe methodology gates and exit statespattern-discovery/ — "Search first, reuse always, create only when necessary"orchestration-patterns/ — multi-agent coordinationEach provider-specific directory (.claude/skills/, .gemini/skills/) adapts these for its native format. The shared directory is the source of truth.
hooks-config.jsonDeclarative JSON. Hooks fire on lifecycle events (PreToolUse, PostToolUse, etc.) and can block actions.
{
"hooks": {
"PreCommit": [
{
"command": "bash scripts/pre-commit-check.sh",
"blocking": true
}
]
}
}
settings.json hooks sectionSimilar lifecycle model but lives inside the broader settings file alongside model config and MCP servers.
{
"hooks": {
"pre_commit": {
"command": "bash scripts/pre-commit-check.sh",
"blocking": true
}
},
"model": "gemini-3-flash",
"mcpServers": { ... }
}
Gemini also offers a dedicated migration command: gemini hooks migrate --from-claude to translate Claude's hooks-config.json into its own format.
config.toml approval policyCodex takes a different approach. Instead of event-based hooks, it uses an approval policy that controls what the agent can do without asking:
[approval]
# "suggest" = always ask, "auto-edit" = allow file edits, "full-auto" = allow everything
mode = "auto-edit"
[sandbox]
enabled = true
network = false
The sandbox and approval modes serve the same purpose as hooks — constraining agent behavior — but expressed as a policy rather than event listeners.
Cursor uses .mdc files with YAML frontmatter that activates rules based on file patterns:
---
description: Enforce commit message format
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: true
---
# Git Commit Rules
All commits must reference a ticket number...
Rules numbered 00-02 are "always apply" (equivalent to hooks). Higher numbers activate contextually.
Your ~/Developer/agent-workflow/ is currently Kiro-only. Adding Claude Code support means creating a .claude/ directory alongside your existing .kiro/. Here's what that looks like:
The migration steps:
hooks-config.json. Any constraints in your Kiro setup that should be enforced (not just suggested) become hooks..claude/commands/*.md file..agents/skills/. Skills that aren't provider-specific go in the shared directory so Codex (and future tools) can discover them too.You don't need to port everything at once. Start with your most-used workflow (probably /start-work) and one skill. Expand as you use Claude Code more.
.claude/, .gemini/, .codex/, .cursor/) with equivalent content in each tool's native format..agents/skills/ directory is the cross-provider source of truth for domain expertise./workflow:start-work), Claude uses flat names (/start-work), Codex uses natural language, and Cursor uses @rule invocations..gemini/commands/. The settings.json handles hooks and model config, while GEMINI.md is the system prompt..gemini/commands/*.toml. They use TOML format (unlike Claude Code's Markdown commands). The settings.json holds hooks and config, not commands..agents/skills/ directory for?.agents/skills/ is the canonical cross-provider source of truth for domain expertise. Codex reads it directly; other providers maintain adapted copies in their own directories..agents/skills/ directory is the shared, cross-provider skills source. It holds domain expertise in a format any tool can consume. Codex reads it natively; Claude Code has its own copy in .claude/skills/..mdc files with YAML frontmatter for its rules and skills?.mdc files in .cursor/rules/ with YAML frontmatter that specifies glob patterns for activation. It's a unique format not shared by the other providers..mdc files (Markdown with YAML frontmatter) in .cursor/rules/. Claude uses plain Markdown, Gemini uses TOML for commands and JSON for settings, and Codex uses TOML config.You now understand how to structure your agent harness for portability across providers. The next lesson covers harness sync and versioning — how to keep your local harness up-to-date with upstream changes without losing your customizations.
SAW — SAFe Agentic Workflow (GitHub) — the multi-provider reference implementation. Pay attention to the Repository Structure section and the parallel .claude/, .gemini/, .codex/, .cursor/ directories.