---
schema_version: "1"
id: 82f31cff863e8a55e4c8eb4a98faf17954039cfa1fdb8f06f1a1b226e4f361e5
title: Sharing Rules and Skills from GitHub with MuleSoft Vibes
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-code-builder/vibes-share-rules-skills-github.md
canonical_url: https://docs.mulesoft.com/anypoint-code-builder/vibes-share-rules-skills-github
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ceb8d1ea8f31247a059eaa13f10e157fad417ea2ac4653bb2a3210cad4586b51
description: MuleSoft Documentation Site
latest: true
---
---
product: Anypoint Code Builder
version: master
---

# Sharing Rules and Skills from GitHub with MuleSoft Vibes

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Use a GitHub repository to centralize the workspace rules and skills that your team applies in
MuleSoft Vibes. When you clone the repository into Anypoint Code Builder and open it as your
workspace, MuleSoft Vibes loads those files as workspace rules and workspace skills. Rules and
skills such as error handling are ready to use, so each developer doesn’t define them again in every
project.

To create rules and workflows in the MuleSoft Vibes panel, see
[Workflows and Rules](https://docs.mulesoft.com/anypoint-code-builder/vibes-workflows-commands). For information about how skills work, see
[Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills).

## Before You Begin

- [Get Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb).

- [Set up MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes#before-you-begin-vibes) and confirm that you have the
  required permissions.

- Install Git on your computer and configure your GitHub username and email. See
  [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm#prereqs).

- Get access to the GitHub repository that stores your team’s rules and skills, or create a
  repository for them.

## Rule and Skill Locations in Your Repository

MuleSoft Vibes reads workspace rules and skills from the `.a4drules` directory at the root of the
folder that you open in Anypoint Code Builder.

<table><colgroup><col> <col></colgroup><thead><tr><th>Asset</th><th>Repository Location</th></tr></thead><tbody><tr><td><div><div><p>Workspace rules</p></div></div></td><td><div><div><p>Markdown (<code>.md</code>) files directly in <code>.a4drules/</code>. Each file is a natural-language rule that MuleSoft Vibes follows in that workspace. Prefix the file names with numbers, such as <code>01-error-handling.md</code>, to control the order in which MuleSoft Vibes applies the rules.</p></div></div></td></tr><tr><td><div><div><p>Workspace skills</p></div></div></td><td><div><div><p>One directory per skill in <code>.a4drules/skills/</code>. The directory name matches the skill name and contains a <code>SKILL.md</code> file with the instructions. Supporting material goes in subfolders such as <code>references/</code>, <code>assets/</code>, or <code>scripts/</code>. See <a href="https://docs.mulesoft.com/anypoint-code-builder/vibes-skills#set-up-skills-in-your-project">Set Up Skills in Your Project</a>.</p></div></div></td></tr></tbody></table>

Global rules and global skills stay on the local machine and aren’t part of the repository. Share
only workspace rules and skills in GitHub.

## Store Rules and Skills in a GitHub Repository

Keep `.a4drules` at the repository root. Use a dedicated repository for your team’s rules and
skills, or add the directory to an existing API or integration project repository.

1.  Open the GitHub repository for your team’s MuleSoft Vibes configuration, or create one.

2.  At the root of the repository, create a `.a4drules` directory.

3.  Add each workspace rule as a Markdown file in `.a4drules/`.

    This rule centralizes error-handling guidance for the whole team:

    `01-error-handling.md`

    ```markdown
    # Error handling

    When you generate or update Mule flows and API specifications:

    - Add explicit error handling for connector and HTTP failures.
    - Use On Error Propagate for errors that callers must see.
    - Use On Error Continue only when the flow can recover and continue.
    - Log the error type and a correlation ID.
    ```

4.  Add each workspace skill in `.a4drules/skills/<skill-name>/SKILL.md`.

    The repository structure looks like this example:

    ```text
    .a4drules/
    ├── 01-error-handling.md
    ├── 02-naming-conventions.md
    └── skills/
        └── error-handling/
            └── SKILL.md
    ```

5.  Commit `.a4drules` and push the changes to GitHub.

    For information about publishing and syncing project files, see
    [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm).

> [!NOTE] To create rules and skills in the MuleSoft Vibes panel instead of writing the files
> yourself, see [Add Workflows or Rules](https://docs.mulesoft.com/anypoint-code-builder/vibes-workflows-commands#add-workflows-or-rules) and
> [Set Up Skills in Your Project](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills#set-up-skills-in-your-project). Anypoint Code Builder
> saves the files in `.a4drules`, and you commit them to the repository.

## Clone the Repository into Anypoint Code Builder

MuleSoft Vibes loads `.a4drules` only from the root of the folder that you open, so open the cloned
repository as your workspace.

1.  Open the Command Palette.

    Show me how

    - Use the keyboard shortcuts:

      - Mac: Cmd+Shift+p

      - Windows: Ctrl+Shift+p

    - Select **View** > **Command Palette**.

2.  Write this command:

    ```command
    Git: Clone
    ```

3.  Write the URL to your repository in GitHub, for example:

    ```command
    https://github.com/_owner_/_yourrepo_.git
    ```

    Replace the URL in the example with the URL to your repository.

4.  Navigate to a directory for your new repo, and click **Select as repo Destination**.

5.  If prompted with the request **Would you like to open the cloned repository?**, click **Open**.

6.  In the **Explorer**, check that `.a4drules` is at the root of the open folder.

> [!IMPORTANT] If your team’s rules and skills are in a dedicated repository and your application
> code is in a different repository, then copy `.a4drules` into the root of the application
> repository. Open the application repository as your workspace so that MuleSoft Vibes finds the
> directory.

## Verify the Shared Rules and Skills

To confirm that MuleSoft Vibes loaded the files from the repository:

1.  Open MuleSoft Vibes.

2.  In the MuleSoft Vibes panel, click the **Rules/Workflows** icon.

3.  Select **Workspace Rules**.

    The Markdown rules from `.a4drules/` are listed and active. There’s no need to add them again in
    **Settings**.

4.  Check that each skill in `.a4drules/skills/` is available as a workspace skill.

MuleSoft Vibes applies the workspace rules to every message that you send in that workspace, and
loads a skill when your message matches the skill description.

## Example: Centralized Error Handling

Teams often keep error-handling rules and skills in GitHub so that every developer gets the same
results:

- A workspace rule states when to use On Error Propagate, when to use On Error Continue, and what to
  log.

- A workspace skill provides the workflow that MuleSoft Vibes follows when you ask it to add or
  review error handling.

After a teammate clones the repository and opens it in Anypoint Code Builder, both the rule and the
skill are active. When that teammate asks MuleSoft Vibes to generate or update a flow, MuleSoft
Vibes applies the shared rule and loads the error-handling skill when the message matches it.

## Troubleshoot Rules and Skills That Don’t Load

If the shared rules don’t appear in **Workspace Rules**, verify the following:

- You opened the cloned repository as your workspace, not a parent or child folder.

- `.a4drules` is at the root of the open folder.

- The rules are Markdown files in `.a4drules/`.

If a shared skill isn’t available in the workspace, you must verify:

- The skill is a directory in `.a4drules/skills/`, and the directory contains a `SKILL.md` file.

- Your local clone includes the latest commits. Pull the changes if a teammate added the skill after
  you cloned the repository.

## See Also

- [Workflows and Rules](https://docs.mulesoft.com/anypoint-code-builder/vibes-workflows-commands)

- [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills)

- [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm)

- [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes)

- [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started)
