diff --git a/AGENTS.md b/AGENTS.md index d711b4214d..448ccd37e9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -379,6 +379,32 @@ Implementation: Extends `YamlIntegration` (parallel to `TomlIntegration`): 4. Uses `yaml.safe_dump()` for header fields to ensure proper escaping 5. Sets `context_file = "AGENTS.md"` so the base setup manages the Spec Kit context section there +## Branch Naming Convention + +All branches **must** follow this pattern: + +``` +/- +``` + +Where `` is either an issue number or a PR number — whichever is created first. + +| Prefix | When to use | Example | +|---|---|---| +| `feat/` | New features | `feat/2342-workflow-cli-alignment` | +| `fix/` | Bug fixes | `fix/2653-paths-only-validation` | +| `docs/` | Documentation changes | `docs/2677-branch-naming-convention` | +| `community/` | Community catalog additions | `community/2492-add-mde-extension` | +| `chore/` | Maintenance, tooling, CI | `chore/2366-editorconfig` | + +**Rules:** + +1. Always include the issue or PR number immediately after the prefix — this is what makes branches traceable +2. Use kebab-case for the slug +3. Keep the slug short — enough to identify the work without looking up the issue + +--- + ## Common Pitfalls 1. **Using shorthand keys for CLI-based integrations**: For CLI-based integrations (`requires_cli: True`), the `key` must match the executable name (e.g., `"cursor-agent"` not `"cursor"`). `shutil.which(key)` is used for CLI tool checks — mismatches require special-case mappings. IDE-based integrations (`requires_cli: False`) are not subject to this constraint. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5188d70a71..12b095f5fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ On [GitHub Codespaces](https://github.com/features/codespaces) it's even simpler 1. Fork and clone the repository 1. Configure and install the dependencies: `uv sync --extra test` 1. Make sure the CLI works on your machine: `uv run specify --help` -1. Create a new branch: `git checkout -b my-branch-name` +1. Create a new branch: `git checkout -b /-` (see [Branch naming](#branch-naming) below) 1. Make your change, add tests, and make sure everything still works 1. Test the CLI functionality with a sample project if relevant 1. Push to your fork and submit a pull request @@ -55,6 +55,20 @@ Here are a few things you can do that will increase the likelihood of your pull - Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). - Test your changes with the Spec-Driven Development workflow to ensure compatibility. +### Branch naming + +We recommend naming branches as `/-`, where `` is the issue or PR number (whichever comes first) and `` is one of: + +| Prefix | When to use | Example | +|---|---|---| +| `feat/` | New features | `feat/2342-workflow-cli-alignment` | +| `fix/` | Bug fixes | `fix/2653-paths-only-validation` | +| `docs/` | Documentation changes | `docs/2677-branch-naming-convention` | +| `community/` | Community catalog additions | `community/2492-add-mde-extension` | +| `chore/` | Maintenance, tooling, CI | `chore/2366-editorconfig` | + +Including the issue or PR number makes branches traceable — especially useful since the project uses squash merges and `git branch --merged` won't detect merged branches. If you start with a PR (no issue), use the PR number once it's assigned. + ## Development workflow When working on spec-kit: