Skip to content

Commit 6303c2c

Browse files
docs: add conventional commits format to AGENTS.md and CONTRIBUTING.md
1 parent 898dd51 commit 6303c2c

2 files changed

Lines changed: 75 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,23 @@ src/
4949
- **Single source of truth for tokens/cost** — token and cost counters are incremented only in `message.updated` (`src/handlers/message.ts`), never in `step-finish`.
5050
- **Shutdown** — OTel providers are flushed via `SIGTERM`/`SIGINT`/`beforeExit`. Do not use `process.on("exit")` for async flushing.
5151
- **`OPENCODE_ENABLE_TELEMETRY`** — all OTel instrumentation is gated on this env var. The plugin always loads regardless; only telemetry is disabled when unset.
52+
53+
## Commit message format
54+
55+
All commits must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/):
56+
57+
```
58+
<type>[optional scope]: <description>
59+
```
60+
61+
Common types: `feat`, `fix`, `perf`, `refactor`, `test`, `docs`, `ci`, `chore`, `build`.
62+
63+
Use `!` or a `BREAKING CHANGE:` footer for breaking changes.
64+
65+
Examples:
66+
67+
```
68+
feat(handlers): add support for file.edited event
69+
fix(probe): handle malformed endpoint URL without throwing
70+
chore(deps): bump @opentelemetry/api to 1.10.0
71+
```

CONTRIBUTING.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,57 @@ docker run --rm -p 4317:4317 \
6262

6363
Then set `OPENCODE_ENABLE_TELEMETRY=1` and start opencode. The collector will print received spans and metrics to stdout.
6464

65+
## Commit messages
66+
67+
This project follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). All commits must be structured as:
68+
69+
```
70+
<type>[optional scope]: <description>
71+
72+
[optional body]
73+
74+
[optional footer(s)]
75+
```
76+
77+
### Types
78+
79+
| Type | When to use |
80+
|------|-------------|
81+
| `feat` | A new feature (triggers a minor version bump) |
82+
| `fix` | A bug fix (triggers a patch version bump) |
83+
| `perf` | A performance improvement |
84+
| `refactor` | Code change that is neither a fix nor a feature |
85+
| `test` | Adding or updating tests |
86+
| `docs` | Documentation only changes |
87+
| `ci` | CI/CD configuration changes |
88+
| `chore` | Maintenance tasks (dependency updates, etc.) |
89+
| `build` | Changes to the build system |
90+
91+
### Breaking changes
92+
93+
Append `!` after the type or add a `BREAKING CHANGE:` footer:
94+
95+
```
96+
feat!: drop support for OTLP HTTP
97+
98+
BREAKING CHANGE: only OTLP/gRPC is supported going forward
99+
```
100+
101+
### Examples
102+
103+
```
104+
feat(handlers): add support for file.edited event
105+
fix(probe): handle malformed endpoint URL without throwing
106+
docs: update Datadog configuration example
107+
chore(deps): bump @opentelemetry/api to 1.10.0
108+
```
109+
65110
## Submitting changes
66111

67-
1. Fork the repo and create a branch: `git checkout -b my-feature`
68-
2. Make your changes and ensure `bun run typecheck` passes
69-
3. Open a pull request with a clear description of what changed and why
112+
1. Fork the repo and create a branch from `main`: `git checkout -b feat/my-feature`
113+
2. Make your changes and ensure `bun run typecheck` and `bun test` pass
114+
3. Commit using Conventional Commits format
115+
4. Open a pull request — the title should also follow Conventional Commits format
70116

71117
## Releasing
72118

@@ -76,3 +122,9 @@ Releases are handled via GitHub Actions. See [the release workflow](.github/work
76122
git tag v1.2.3
77123
git push origin v1.2.3
78124
```
125+
126+
The version bump should follow [SemVer](https://semver.org) based on the commits since the last release:
127+
128+
- `fix` commits → patch (`1.0.x`)
129+
- `feat` commits → minor (`1.x.0`)
130+
- `BREAKING CHANGE` commits → major (`x.0.0`)

0 commit comments

Comments
 (0)