> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Repository Structure

> An OpenGAP agent is a git repository. These files define its identity, skills, tools, memory, and compliance.

An OpenGAP agent is your git repository as an agent: complete with version control, branching, pull requests, and collaboration built in.

## Full Structure

```
my-agent-repository/
├── agent.yaml          # config
├── SOUL.md             # core identity
├── RULES.md
├── AGENTS.md
├── skills/             # capability
│   └── code-review/
│       └── SKILL.md
├── tools/              # capability
│   └── search.yaml
├── knowledge/
│   └── index.yaml
├── memory/
│   ├── MEMORY.md
│   └── runtime/        # live
│       ├── dailylog.md
│       ├── key-decisions.md
│       └── context.md
├── hooks/
│   ├── hooks.yaml
│   ├── bootstrap.md
│   └── teardown.md
├── workflows/          # automation
│   └── code-review-flow.yaml
└── compliance/         # governance
    └── regulatory-map.yaml
```

## Identity Files

| File        | Purpose                                                           |
| ----------- | ----------------------------------------------------------------- |
| `SOUL.md`   | Core identity, personality, communication style, domain expertise |
| `RULES.md`  | Behavioral constraints and rules                                  |
| `AGENTS.md` | Sub-agent relationships and delegation rules                      |

## SOUL.md Example

```markdown theme={null}
# Soul

## Core Identity
I am a code review specialist. I analyze code changes for correctness,
security vulnerabilities, performance issues, and adherence to best practices.

## Communication Style
Direct and constructive. I provide specific, actionable feedback with code examples.

## Values & Principles
- Security first — always flag vulnerabilities
- Clarity over cleverness
- Constructive feedback — explain *why*

## Domain Expertise
- Software engineering best practices
- OWASP Top 10 security vulnerabilities
- Performance optimization patterns
```

## Memory Layout

The `memory/` folder has two layers:

* `MEMORY.md`: persistent, git-committed agent memory
* `runtime/`: live execution state across sessions (`dailylog.md`, `key-decisions.md`, `context.md`)

## Hooks

`hooks/bootstrap.md` and `hooks/teardown.md` define what the agent does on startup and shutdown. `hooks/hooks.yaml` maps lifecycle events to scripts.

## Shared Context in Monorepos

Anything placed at the root: `context.md`, `skills/`, `tools/`: is automatically shared across every agent in the monorepo. No duplication, one source of truth.

<CardGroup cols={2}>
  <Card title="agent.yaml Reference" icon="file-code" href="/open-source/opengap/agent-structure/agent-yaml">
    All manifest fields: model, tools, compliance, MCP, A2A
  </Card>

  <Card title="Skills" icon="sparkles" href="/open-source/opengap/skills/overview">
    SKILL.md format and the skills discovery system
  </Card>

  <Card title="SkillsFlow" icon="diagram-project" href="/open-source/opengap/skills/skillsflow">
    Chain skills into deterministic multi-step workflows
  </Card>

  <Card title="Design Patterns" icon="lightbulb" href="/open-source/opengap/design-patterns">
    16 architectural patterns built on git-native agents
  </Card>
</CardGroup>
