/agent-kernel:agent-kernelfrom Agent Kernel
Local-first governance layer for AI coding agents providing shared memory, failure evidence, project isolation, architecture conformance, and release safety across multiple agent platforms.
Ships in Agent Kernel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Agent Kernel is a local-first governance layer for coding agents. It does not replace the agent. It gives multiple agents one reviewed source of truth for durable memory, failure evidence, project boundaries, architecture policy, and release discipline.
Use this skill when the task requires one or more of these capabilities:
Do not activate it for a generic coding task when the user does not need persistent governance, memory, runtime evidence, project connection, or architecture conformance.
user intent
-> agent reads approved guidance and bounded context
-> agent works inside project and architecture scope
-> failures and useful evidence are captured locally
-> durable changes become pending proposals
-> user reviews and approves
-> Agent Kernel publishes generated guidance
-> future agents inherit the reviewed result
AGENTS.md, CLAUDE.md, Cursor rules, Gemini guidance, and other compiled files are delivery outputs.npm install -g @mamdouh-aboammar/agent-kernel
agent-kernel --version
agent-kernel init --sync
agent-kernel doctor
For an existing repository:
cd /path/to/project
agent-kernel compile
agent-kernel-safe-link . --dry-run
agent-kernel-safe-link .
agent-kernel-safe-git-hook . --dry-run
agent-kernel-safe-git-hook .
agent-kernel doctor
Use agent-kernel link . --hooks only when the main linker is intentionally preferred over managed-block preservation.
agent-kernel doctor
agent-kernel status
agent-kernel search "<task or error>" --explain
agent-kernel context "<task>" --files src/example.mjs --budget 1200
For a connected project:
agent-kernel project status --json
agent-kernel context current --json
agent-kernel session start --agent codex --project . --json
agent-kernel session observe <session-id> \
--type command \
--command "npm test" \
--exit-code 0 \
--text "Focused tests passed" \
--file test/example.mjs
agent-kernel session timeline <session-id> --compact
agent-kernel session end <session-id>
Do not construct session paths manually. Pass only the ID returned by Agent Kernel.
agent-kernel failure search "ERR_MODULE_NOT_FOUND"
Capture reusable failure evidence:
agent-kernel failure capture \
--from codex \
--type test-failure \
--command "npm test" \
--exit-code 1 \
--text "<redacted error output>" \
--root-cause "<supported root cause>" \
--fix "<smallest verified fix>"
Promote only after the pattern is reusable:
agent-kernel failure propose <failure-id> --as rule
agent-kernel inbox
agent-kernel propose \
--from codex \
--text "Use pnpm in this repository." \
--reason "The user corrected the package manager during setup."
The normal user review path is:
agent-kernel inbox
agent-kernel approve <proposal-id> --publish
# or
agent-kernel reject <proposal-id>
When the user explicitly states a durable rule and asks to save it, direct approved memory is appropriate:
agent-kernel remember "Never commit provider credentials." \
--type policy \
--level critical \
--publish
Load the dedicated Architecture Guardian skill before a non-trivial feature, refactor, cross-module fix, new service, new dependency, schema change, or public API change.
agent-kernel architecture doctor .
agent-kernel architecture discover . --json
agent-kernel architecture reuse "<capability>" . --json
agent-kernel architecture contract init . \
--task "<reviewed task>" \
--owner "<domain or team>" \
--allow "src/area/**,test/area/**" \
--expect "src/area/file.ts,test/area/file.test.ts" \
--tests "<observable behavior>"
agent-kernel architecture check . --json
Use --strict only when the project policy, baseline, contract, and active exceptions are reviewed.
agent-kernel commit link \
--sha <commit-sha> \
--session <session-id> \
--failure <failure-id> \
--files src/example.mjs,test/example.mjs
agent-kernel commit context <commit-sha> --json
Environment Vault stores selected project .env files locally under the configured Agent Kernel home. It uses a full SHA256 project fingerprint so fresh clones, SSH and HTTPS remotes, and Monorepos all resolve to one identity.
Safety rules before any vault command:
docs/ENVIRONMENT_VAULT.md before a forced overwrite or purge--force unless the user understands a differing local file will be replacedQuick workflow:
# Link project and discover eligible .env files
agent-kernel env link [project] [--include path] [--exclude pattern]
# Check identity, health, and file states
agent-kernel env status [project] --json
# Store changed local files
agent-kernel env push [project] [--file path] [--dry-run]
# Restore missing files (never overwrites existing without --force)
agent-kernel env pull [project] [--file path] [--force]
# Watch for changes in the background
agent-kernel env watch [project]
# Inspect revision history (no secret content)
agent-kernel env history [project] --file .env
# Restore a specific revision
agent-kernel env restore [project] --file .env --revision <id>
# Run health checks and repair permissions
agent-kernel env doctor [project] [--repair-permissions] [--migrate]
# List all local vault identities
agent-kernel env list --json
# Detach project path while keeping stored files
agent-kernel env unlink [project]
# Delete stored data (requires explicit --yes)
agent-kernel env purge [project] --yes
Vault directories use 0700 and stored files use 0600 on POSIX systems.
See docs/ENVIRONMENT_VAULT.md for discovery rules, monorepo support, migration, conflict handling, and threat boundaries.
Use project connection when a repository needs shared global memory but isolated local configuration and provider targets.
agent-kernel project connect --dry-run
agent-kernel project connect --yes
agent-kernel project status --json
agent-kernel project doctor
Validated project/environment context:
agent-kernel context enter <project-id> development --json
agent-kernel context current --json
Production provider operations require a matching short-lived approval:
agent-kernel approvals request \
--provider gcloud \
--operation deploy \
--reason "Reviewed deployment window"
agent-kernel approvals approve <approval-id> --ttl-minutes 15
agent-kernel provider gcloud exec -- run deploy <service>
Do not add credentials to project manifests. Persistent credentials use the supported secure platform backend. Process environment credentials remain process-scoped and must not be logged.
Local mode:
agent-kernel daemon start
agent-kernel daemon status --json
agent-kernel daemon stop
Remote mode is a separate security decision:
export AGENT_KERNEL_DAEMON_HOST=0.0.0.0
export AGENT_KERNEL_DAEMON_ALLOW_REMOTE=1
export AGENT_KERNEL_DAEMON_TOKEN="$(openssl rand -hex 32)"
agent-kernel daemon start
Remote requests require Authorization: Bearer <token>. Use a private network or authenticated tunnel. Never expose the port directly to the public internet.
Inspect the default surface:
agent-kernel mcp test
Core mode exposes ten tools for status, memory search, bounded context, proposals, guard checks, Failure Lessons, and episode search.
Extended mode is explicit:
AGENT_KERNEL_MCP_TOOLS=extended agent-kernel mcp test
Approval requires both extended mode and AGENT_KERNEL_MCP_ALLOW_APPROVE=1. Prefer terminal review even when explicit MCP approval is available.
These are separate controls.
Global write mode:
agent-kernel-mode show
agent-kernel-mode set approval
agent-kernel-mode set trusted
agent-kernel-mode set bypass
Agent identity trust:
agent-kernel agent list --json
agent-kernel agent add codex --trust propose-only --surface cli
agent-kernel agent set codex --trust capture-only
agent-kernel agent show codex --json
Default to approval mode. Use trusted or bypass only when the user deliberately accepts the broader write behavior.
agent-kernel retention status --json
agent-kernel export ./agent-kernel-backup.json --redact --include-observations
agent-kernel import ./agent-kernel-backup.json --inspect --json
agent-kernel dashboard --no-open --json
agent-kernel report ./agent-kernel-report.html --json
Inspect before import. Do not commit raw exports or reports that may contain project evidence.
User-side update flow:
agent-kernel update status --json
agent-kernel update check --force --json
agent-kernel update apply --agent <trusted-agent-id> --json
Repository release flow:
npm ci
npm run verify:release
npm run publish:dry
Before tagging, verify:
package.jsonAfter tagging, verify npm registry visibility, package integrity, GitHub Release assets, and SHA256SUMS.
Use the canonical reference for the complete surface:
.env storage, versioned revisions, conflict-safe restoreSee docs/COMMAND_REFERENCE.md.
| Agent | Primary integration |
|---|---|
| Claude Code | CLAUDE.md, AGENTS.md, local MCP, narrow hooks, Claude skills |
| Codex | AGENTS.md, .codex/AGENTS.md, .codex/config.toml, .agents/skills/ |
| Cursor | .cursor/rules/00-agent-kernel.mdc, local MCP |
| OpenCode | AGENTS.md, local MCP |
| Antigravity | .agents/agents.md, .agents/skills/ |
| Gemini CLI | GEMINI.md, local MCP configuration |
| AGENTS.md-compatible tools | AGENTS.md and the AGENTS-compatible skill |
Do not claim native blocking hooks for an agent unless Agent Kernel ships and tests that adapter.
.env values, provider tokens, service-account files, or auth material in memory or project manifests.npx skills add imMamdouhaboammar/agent-kernel -a claude-code -g -y
npm install -g @mamdouh-aboammar/agent-kernel
Discovery surfaces:
SKILL.md
skills.sh.json
skills/architecture-guardian/SKILL.md
.claude/skills/agent-kernel/SKILL.md
.claude/skills/architecture-guardian/SKILL.md
.agents/skills/agent-kernel/SKILL.md
.agents/skills/architecture-guardian/SKILL.md
.claude-plugin/marketplace.json
.claude-plugin/plugin.json
MIT © Mamdouh Aboammar
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (immamdouhaboammar/agent-kernel) — no native marketplace selected
npx claudepluginhub p/immamdouhaboammar-agent-kernel4 skills in this plugin
/agent-kernel-evolveUniversal Self-Evolve & Self-Learning guide for AI agents. Enables any agent (Claude, Antigravity, Cursor, Codex, Gemini, OpenCode) to automatically capture learning moments, synthesize repeatable Playbooks, and evolve workflows./agent-kernel-opsOperational guide for agents working with Agent Kernel v1.20.0+ — environment vault, memory proposals, policies, installation, and diagnostics/architecture-guardianPrevent AI coding agents from introducing architecture drift. Use before non-trivial features,
refactors, cross-module fixes, new services, repositories, validators, state stores, dependencies,
schema changes, public API changes, or edits governed by a change contract. Architecture Guardian
provides bounded discovery, reuse-first search, dependency rules, reviewed baselines, short-lived
change contracts, scoped expiring exceptions, deterministic reports, and optional strict gates.