# How to create a registry group

## File Naming Conventions

* `{{registry_group_name}}.go`: This file defines the registry group, including key components like structs, interfaces, constants, and variables.
* `{{registry_group_name}}_test.go`: Includes tests for the registry group to ensure it functions as expected.

{% hint style="info" %}
This structure ensures consistency and maintainability across different registries, making it easier for developers to contribute and collaborate effectively.\
\
For the rest of conventions please read [Templating Conventions](/sprout/introduction/templating-conventions.md).
{% endhint %}

## Creating a Registry Group

1. **New Repository**: You can start by creating a new repository on your GitHub account or organization. This will house your registry group functions.
2. **Contributing to Official Registry**: To add a new registry group to the official registry, submit a pull request (PR) after a discussion inside an issue. The official registry groups are organized under the `group/` folder.

To start, in your `{{registry_group_name}}.go` file, create a function called `RegistryGroup` respecting the following signature:

```go
func RegistryGroup() *sprout.RegistryGroup {
  return sprout.NewRegistryGroup(
    // Add your registries here
    // registry.NewRegistry(),
  )
}
```

You can also create a group directly in your codebase without the need to create a new package. This is useful when you want to group registries that are specific to a project or a use case.

```go
group := sprout.NewRegistryGroup(registry.NewRegistry())

handler.AddGroups(group)
```

Once your group is defined, you can start using it in your projects. 🎉


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atom.codes/sprout/advanced/how-to-create-a-registry-group.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
