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

# Set up Agent Context System with GitHub Copilot as a skill

> Install Agent Context System as a GitHub Copilot skill to get persistent project memory, automatic updates, and cross-session context in every Copilot session.

GitHub Copilot is the recommended way to install the Agent Context System. Installing through the official Copilot skill registry means you receive updates automatically whenever the system improves — no manual file copying required. After setup, Copilot reads your `AGENTS.md` through a `.github/copilot-instructions.md` directive that the init script creates for you.

## Install via skill registry

<Steps>
  <Step title="Add the skill">
    Run the following command in your project root to install the Agent Context System from the Copilot skill registry:

    ```bash theme={null}
    npx skills add AndreaGriffiths11/agent-context-system
    ```

    <Note>
      Installing through `npx skills add` pins you to the official registry entry, so you get updates to the system automatically. This is the only install method that provides automatic updates.
    </Note>
  </Step>

  <Step title="Run the init script">
    After the skill installs, run the init script to wire up your project:

    ```bash theme={null}
    bash .agents/skills/agent-context-system/scripts/init-agent-context.sh
    ```

    The script creates `.agents.local.md` from the template, ensures it is gitignored, and adds a directive to `.github/copilot-instructions.md` telling Copilot to read `AGENTS.md` at session start.
  </Step>

  <Step title="Edit AGENTS.md">
    Open `AGENTS.md` and fill in your project specifics: name, stack, build commands, and the patterns, boundaries, and gotchas that are true of your codebase. The placeholders in the template are starting points — replace them with real knowledge from your project.

    This is the highest-leverage edit you will make. The more accurate your `AGENTS.md`, the more useful every Copilot session becomes.
  </Step>
</Steps>

## Install manually (no package manager)

If you prefer not to use `npx skills`, you can copy the Copilot skill file directly into your repository.

<Steps>
  <Step title="Copy the skill file">
    Copy `github-copilot/SKILL.md` from the Agent Context System repository to your project:

    ```bash theme={null}
    mkdir -p .github/skills/agent-context-system
    cp /path/to/agent-context-system/github-copilot/SKILL.md \
       .github/skills/agent-context-system/SKILL.md
    ```

    If you have not cloned the repository yet, clone it first to a temporary location:

    ```bash theme={null}
    git clone https://github.com/AndreaGriffiths11/agent-context-system.git /tmp/acs
    mkdir -p .github/skills/agent-context-system
    cp /tmp/acs/github-copilot/SKILL.md .github/skills/agent-context-system/SKILL.md
    rm -rf /tmp/acs
    ```
  </Step>

  <Step title="Add the copilot-instructions.md directive">
    Create or update `.github/copilot-instructions.md` with a directive pointing Copilot to `AGENTS.md`:

    ```markdown theme={null}
    Read AGENTS.md before starting
    ```
  </Step>

  <Step title="Edit AGENTS.md">
    Copy `AGENTS.md` to your project root and fill it in with your project specifics. Keep it under 120 lines — that constraint is intentional.
  </Step>
</Steps>

<Warning>
  Manual installation does not receive automatic updates. If the Agent Context System releases improvements to the Copilot skill, you will need to re-copy the file yourself.
</Warning>

## How Copilot reads AGENTS.md

After init, your `.github/copilot-instructions.md` contains a directive that tells Copilot to read `AGENTS.md` before starting any task. Copilot loads `copilot-instructions.md` at the start of every Chat session, so your project knowledge is always in context — no manual retrieval required.

## Session logging

Copilot Chat does not expose session-end hooks, so the Agent Context System cannot log sessions automatically. To save what happened in a session to `.agents.local.md`, tell Copilot at the end of your conversation:

```
log this session
```

Copilot will propose a session log entry covering what changed, what worked, what did not work, and any patterns worth remembering. Review the proposal and approve it before Copilot writes to `.agents.local.md`.

<Tip>
  The session log is where patterns begin their journey into `AGENTS.md`. After enough sessions, Copilot will flag recurring patterns in the scratchpad's "Ready to Promote" section. You decide when to move them. See the [knowledge flow](/concepts/knowledge-flow) guide for how promotion works.
</Tip>
