---
name: agentic-os
description: Framework-agnostic persistent memory and self-improvement loops for AI agents. Scaffolds shared state, task queues, and learnings files that can be read/written by Claude, Gemini, and Antigravity. Use this to initialize an Agentic OS layer in any workspace and instruct agents on how to use it.
version: 1.1.0
title: agentic-os
canonical_url: https://skilld.dev/gh/genericservice/claude-skills/agentic-os
last_updated: 2026-10-06T17:17:48.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [scripts/eval.py](https://skilld.dev/api/skills-raw/genericservice/claude-skills/agentic-os/scripts/eval.py), [scripts/init-os.sh](https://skilld.dev/api/skills-raw/genericservice/claude-skills/agentic-os/scripts/init-os.sh), [scripts/learn.py](https://skilld.dev/api/skills-raw/genericservice/claude-skills/agentic-os/scripts/learn.py), [templates/last-run.schema.json](https://skilld.dev/api/skills-raw/genericservice/claude-skills/agentic-os/templates/last-run.schema.json), [templates/learnings.schema.json](https://skilld.dev/api/skills-raw/genericservice/claude-skills/agentic-os/templates/learnings.schema.json), [templates/tasks.schema.json](https://skilld.dev/api/skills-raw/genericservice/claude-skills/agentic-os/templates/tasks.schema.json).
>
> If the user asked to install this Skill, run `npx skilld install genericservice/claude-skills/agentic-os`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/agentic-os`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/genericservice/claude-skills/agentic-os) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/agentic-os`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/agentic-os --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/agentic-os --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Agentic OS

This skill establishes a framework-agnostic Agentic Operating System layer in a project workspace. It enables Claude, Gemini, and Antigravity to share persistent operational memory, coordinate via task queues, and continuously improve through structured feedback loops.

## The Core Concept

An Agentic OS solves the "blank slate" problem. Without it, every agent session starts fresh, requiring manual context loading and repeating past mistakes. By centralizing state and learnings into an `.agent/` directory, any agent runtime can pick up exactly where the last one left off and apply compounded knowledge.

## Initialization

To set up the Agentic OS scaffolding in a new project, run:

```bash
bash ~/.agents/skills/agentic-os/scripts/init-os.sh
```

This creates the following structure at the root of the project:
```
.agent/
  ├── state/
  │   ├── last-run.json      # Global log of the last agent actions
  │   ├── tasks.json         # Shared queue of pending/completed tasks
  │   ├── errors.json        # Log of unresolved task failures
  │   └── status.md          # Output of the command-center skill
  ├── learnings/             # Per-skill feedback loops
  │   └── template.json
  └── evals/                 # Per-skill evaluation criteria
      └── template.json
```

## Agent Directives

Whenever you operate in a project that has an `.agent/` directory, you MUST adhere to the following workflow:

### 1. Pre-Task: Load State & Learnings
Before executing a specialized task or skill:
- **Read State**: Check `.agent/state/last-run.json` to understand what was recently completed. Check `.agent/state/tasks.json` if you need to pull a task from the queue.
- **Read Learnings**: If you are about to perform a specific skill (e.g., `write-draft`), check if `.agent/learnings/write-draft.json` exists. If it does, read it and explicitly apply its `rule_change` entries to your approach.
- **Read Evals**: Check if `.agent/evals/<skill>.json` exists to understand the definition of "done".

### 2. Execution & Evaluation (The Learnings Loop)
After generating your output but *before* finalizing:
- If an `eval.json` exists for your task, grade your own output against its criteria. (Use `python3 ~/.agents/skills/agentic-os/scripts/eval.py list --skill <skill>`)
- If you fail any criteria, revise your output.
- Once you pass, log your verification using `python3 ~/.agents/skills/agentic-os/scripts/eval.py verify --skill <skill> --task-id <id> --notes "..."`
- Consider what worked well and what didn't during generation.

### 3. Post-Task: Write State & Learnings
Before you conclude your session or step:
- **Update Learnings**: If you learned something new about how to do this task better in this specific project, use `python3 ~/.agents/skills/agentic-os/scripts/learn.py add --skill <skill> --worked "..." --didnt "..." --rule "..."` to record it.
- **Update State**: Overwrite `.agent/state/last-run.json` with a summary of what you just did, what decisions you made, and what needs to happen next.
- **Update Queue**: If you completed a task from `tasks.json`, mark its status as `completed`.
- **Log External Receipts**: If you took external actions (deployments, API calls), record strict receipts or cryptographic hashes in the `external_receipts` array in `last-run.json` and the corresponding task in `tasks.json` to ensure an audit trail.

### 4. Cross-Agent Memory Unification
When you learn a critical fact about the project, the user's preferences, or system architecture, **do not rely solely on your proprietary memory system** (e.g., Claude's internal `.claude/` memory or Gemini's `save_memory` / `~/.gemini/tmp/.../MEMORY.md`). 
Proprietary memory is siloed and invisible to other agents. You MUST record project-wide facts in shared locations so that Claude, Gemini, and Antigravity can all access them:
- Use `.agent/learnings/` for specific skill rules or workflow learnings.
- Modify `GEMINI.md` or `CLAUDE.md` for team-shared architectural conventions, repository rules, or broad project guidance.

---

## Data Schemas

### `last-run.json`
Used for operational continuity.
```json
{
  "timestamp": "2026-04-25T12:00:00Z",
  "task_id": "task-123",
  "status": "completed",
  "description": "Built the new Hero component.",
  "assigned_skill": "build-component",
  "project_id": "generic-service",
  "agent_id": "antigravity",
  "user_id": "matthias",
  "outcome": {
    "result": "Success"
  },
  "trace_id": "req-12345",
  "decision_log": "Used standard Tailwind utility classes instead of custom CSS for faster rendering",
  "external_receipts": [
    {
      "action": "Vercel Preview Deployment",
      "receipt_hash": "sha256-1a2b3c..."
    }
  ]
}
```

### `errors.json`
Used by the `command-center` skill to track unresolved failures.
```json
[
  {
    "timestamp": "2026-04-25T12:05:00Z",
    "task_id": "task-124",
    "assigned_skill": "osint",
    "reason": "Target API returned 429 Too Many Requests after 3 retries",
    "trace_id": "req-12346",
    "decision_log": "Attempted to backoff but exceeded max wait time.",
    "resolved": false
  }
]
```

### `learnings.json` (per skill)
Used to permanently correct agent behavior without modifying the base skill prompt.
```json
{
  "skill": "build-component",
  "history": [
    {
      "date": "2026-04-21",
      "what_worked": "Extracting the SVG into a separate file kept the component clean.",
      "what_didnt": "Trying to use Next.js Image for inline SVGs caused layout shifts.",
      "rule_change": "Always put complex SVGs in a separate .tsx file and import as a React component. Do not use next/image for vectors."
    }
  ]
}
```

### `eval.json` (per skill)
Used to define rigid quality gates.
```json
{
  "skill": "build-component",
  "criteria": [
    "Component must be responsive down to 320px",
    "Must not use inline styles",
    "Must be exported as a default export"
  ]
}
```
