---
title: "Adopt an existing project"
description: "Add the agent layer to a repository you already have, shrink its AGENTS.md and bootstrap living specs."
canonical_url: "https://razcue-agent-kit.vercel.app/en/guides/adopt-existing-project"
---
# Adopt an existing project

> Add the agent layer to a repository you already have, shrink its AGENTS.md and bootstrap living specs.

<steps>

### Add the agent layer

```bash [Terminal]
cd my-repo
npx @razcue/agent-kit init --kind existing
```

Your `AGENTS.md` is kept and gets a managed block at the end. Pick a stack skill if one fits (`--stack nuxt-supabase`).

### Measure

```bash [Terminal]
npx @razcue/agent-kit context --sections
```

`agent-kit context` shows the tokens loaded every session; `--sections` ranks each heading of the `CLAUDE.md` / `AGENTS.md` chain.

### Slim it down with the `adopt` skill

Ask Claude: *"Adopt agent-kit: slim our AGENTS.md"*. The skill classifies every section, shows you the table, then moves one section at a time:

<table>
<thead>
  <tr>
    <th>
      The section is…
    </th>
    
    <th>
      Goes to
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      An invariant for almost every task
    </td>
    
    <td>
      stays in <code>
        AGENTS.md
      </code>
      
       (≤ 15 lines)
    </td>
  </tr>
  
  <tr>
    <td>
      A procedure or pattern
    </td>
    
    <td>
      a project skill in <code>
        .claude/skills/
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Rules for one folder
    </td>
    
    <td>
      a <code>
        CLAUDE.md
      </code>
      
       in that folder
    </td>
  </tr>
  
  <tr>
    <td>
      A business fact or decision
    </td>
    
    <td>
      <code>
        .knowledge/
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Derivable or outdated
    </td>
    
    <td>
      deleted, after you confirm
    </td>
  </tr>
</tbody>
</table>

It re-measures after each move and suggests moving durable rules from Claude's auto-memory into `.knowledge/`.

### Bootstrap living specs

The skill proposes a capability list from routes, pages and RPCs; you trim it. Then, one capability at a time, it writes the spec of what the code does today and you confirm. A capability without a spec gets one the first time a change touches it.

</steps>


## Sitemap

See the full [sitemap](https://razcue-agent-kit.vercel.app/sitemap.md) for all pages.
