> ## 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.

# Plugins

> Extend GitAgent with installable plugins that provide tools, skills, hooks, and memory layers.

## Plugin Manifest

```yaml theme={null}
# plugin.yaml
id: my-plugin
name: My Plugin
version: 1.0.0
description: What this plugin does
author: Your Name
license: MIT
engine: ">=1.0.0"

provides:
  tools: true
  skills: true
  prompt: prompt.md
  hooks:
    pre_tool_use:
      - script: hooks/validate.sh   # any filename — hooks.yaml points to it
```

## Plugin Structure

```
plugins/my-plugin/
  plugin.yaml          # manifest
  prompt.md            # appended to system prompt
  tools/
    my-tool.yaml       # declarative tools
  skills/
    my-skill/
      SKILL.md
  hooks/
    validate.sh        # example — any filename, referenced from hooks.yaml
```

## agent.yaml Plugin Config

```yaml theme={null}
# agent.yaml
plugins:
  my-plugin:
    enabled: true
    config:
      api_key: "your-api-key"
      timeout: 30
```

<Tip>
  Config values can reference environment variables using `${VAR_NAME}` syntax — API keys are never hardcoded.
</Tip>

## Plugin Management CLI

```bash theme={null}
# Install from git URL
gitagent plugin install https://github.com/user/plugin
# Install from local path
gitagent plugin install ./path/to/plugin
# List all plugins
gitagent plugin list
# Enable / disable
gitagent plugin enable my-plugin
gitagent plugin disable my-plugin
# Remove
gitagent plugin remove my-plugin
# Scaffold new plugin
gitagent plugin init my-plugin
```

## Programmatic Plugin (SDK)

```typescript theme={null}
// plugin.ts
import type { GitagentPluginApi } from "@open-gitagent/gitagent";

export function register(api: GitagentPluginApi) {
  api.registerTool(myTool);
  api.registerHook("pre_tool_use", async (ctx) => ({ action: "allow" }));
  api.addPrompt("Additional context for the agent...");
}
```

## What Plugins Can Provide

* **Tools** — Expose new typed tools to the agent
* **Skills** — Add reusable skill definitions
* **System Prompt Injection** — Append context via prompt.md
* **Lifecycle Hooks** — React to tool use and session events
* **Memory Layers** — Add scoped memory files

<CardGroup cols={2}>
  <Card title="Tools" icon="wrench" href="/open-source/gitagent/capabilities/tools">
    Built-in and declarative tools the agent uses to act
  </Card>

  <Card title="Skills" icon="sparkles" href="/open-source/gitagent/capabilities/skills">
    Reusable task modules the agent learns and crystallizes over time
  </Card>

  <Card title="Hooks" icon="webhook" href="/open-source/gitagent/capabilities/hooks">
    Intercept, block, or modify agent behavior at every stage
  </Card>

  <Card title="SDK Reference" icon="code" href="/open-source/gitagent/sdk/overview">
    Embed GitAgent programmatically and register plugins at runtime
  </Card>
</CardGroup>
