> For the complete documentation index, see [llms.txt](https://docs.budgielang.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.budgielang.org/syntax/files.md).

# Files

All the samples thus far have been isolated snippets of code. Some languages, particularly class-based ones, will have some scaffolding at the beginning and end of files. These lines are often dependent upon both the file name and/or path within a project.

The first line of every `.bg` file should be a `file start`, which takes any number of PascalCase folder names representing the file's path in its project, followed by the PascalCase file name.

The last line of every `.bg` file should be a `file end`.

```
file start : Models Speech Word
    class start : Word
        comment line : ...
    class end
file end
```

In C#:

```csharp
namespace Models.Speech
{
    class Word
    {
        // ...
    }
}
```

In Python:

```python
class Word:
    # ...
```

Note that because of [Java](https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.6), each file must export a construct with the same file's name. You can use any of:

* `class start : export` to export a [class](/syntax/classes.md)
* `enum start : export` to export an [enum](/syntax/enums.md)
* `interface start : export` to export an [interface](https://github.com/budgielang/budgie/tree/efcab6c84224e6e5b13b971784c6fa3bd61d44ed/docs/syntax/interfaces.md)
* `standalone functions declare start : export` to export a [standalone function group](/syntax/standalone-functions.md)


---

# 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 dynamically by asking a question.

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

```
GET https://docs.budgielang.org/syntax/files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
