> For the complete documentation index, see [llms.txt](https://docs.aeternity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aeternity.com/developer-documentation/aesophia/contributing.md).

# Contributing to Sophia

## Checklist For Creating New Pull Requests

The following points should be considered before creating a new PR to the Sophia compiler.

### Documentation

* The [Changelog](/developer-documentation/aesophia/changelog.md) file should be updated for all PRs.
* If a PR introduces a new feature that is relevant to the users of the language, the [Sophia Features Documentation](/developer-documentation/aesophia/docs/sophia_features.md) should be updated to describe the new feature.
* If a PR introduces new syntax (e.g. changes in [aeso\_syntax.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_syntax.erl), [aeso\_scan.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_scan.erl), or [aeso\_parser.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_parser.erl)), the [Sophia Syntax Documentation](/developer-documentation/aesophia/docs/sophia_syntax.md) should be updated to include the new syntax.
* If a PR introduces a new library, the public interface of the new library should be fully documented in the [Sophia Standard Library Documentation](/developer-documentation/aesophia/docs/sophia_stdlib.md).
* If a PR introduces a new compiler option, the new option should be documented in the file[aeso\_compiler.md](/developer-documentation/aesophia/docs/aeso_compiler.md).

### Tests

* If a PR introduces new syntax (e.g. changes in [aeso\_syntax.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_syntax.erl), [aeso\_scan.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_scan.erl), or [aeso\_parser.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_parser.erl)), the contract [all\_syntax.aes](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/test/contracts/all_syntax.aes) should be updated to include the new syntax.
* If a PR fixes a bug, the code that replicates the bug should be added as a new passing test contract.
* If a PR introduces a new feature, add tests for both successful and failing usage of that feature. In order to run the entire compilation pipeline and to avoid erroring during intermediate steps, failing tests should not be mixed with the successful ones.

### Source Code

* If a PR introduces new syntax (e.g. changes in [aeso\_syntax.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_syntax.erl), [aeso\_scan.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_scan.erl), or [aeso\_parser.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_parser.erl)), the following code should be updated to handle the new syntax:
  * The function `aeso_syntax_utils:fold/4` in the file [aeso\_syntax\_utils.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_syntax_utils.erl).
  * Any related pretty printing function in the file [aeso\_pretty.erl](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aeso_pretty.erl), depending on the type of the newly added syntax.

## Checklist For Creating a Release

* Update the version in the file [aesophia.app.src](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/src/aesophia.app.src).
* Update the version in the file [rebar.config](https://github.com/aeternity/docs/blob/master/Developer%20Documentation/aesophia/rebar.config).
* In the [Changelog](/developer-documentation/aesophia/changelog.md):
  * Update the `Unreleased` changes to be under the new version.
  * Update the version at the bottom of the file.
* Commit and the changes and create a new PR (check the commit of [v6.1.0](https://github.com/aeternity/aesophia/commit/5ad5270e381f6e810d7b8b5cdc168d283e7a90bb) for reference).
* Create a release after merging the new PR to `master` branch.
* After releasing `aesophia`, refer to each of the following repositories and create new releases as well, using the new `aesophia` release:
  * [aesophia\_cli](https://github.com/aeternity/aesophia_cli)
  * [aesophia\_http](https://github.com/aeternity/aesophia_http)
  * [aerepl](https://github.com/aeternity/aerepl)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aeternity.com/developer-documentation/aesophia/contributing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
