Development workflow

From kid-sid/codex-spellbook · View interactive version

Development workflow is an AI agent skill from the GitHub repository kid-sid/codex-spellbook. Use when choosing a branching strategy, writing a commit message, opening or reviewing a pull request, setting up commit linting, or tagging a versioned release.

How to use this skill

Skill file

Development Workflow

A complete reference for Git branching, commit conventions, pull request workflow, code review practices, and release management — covering everything from first branch to published release.

When to Activate

Branching Strategies

Comparison Table

| Strategy | Branches Used | Release Cadence | Team Size Fit | Pros | Cons |

|---|---|---|---|---|---|

| GitHub Flow | main + feature branches | Continuous (deploy on merge) | Small–medium | Simple, fast feedback, CD-friendly | No built-in release staging |

| Git Flow | main, develop, feature/*, release/*, hotfix/* | Scheduled / versioned | Medium–large | Clear release lifecycle, hotfix path | Complex, slow merging, overhead |

| Trunk-Based Development | main (+ very short-lived branches) | Continuous | Any (with CI maturity) | Maximum integration speed, minimal merge conflicts | Requires feature flags, strong CI discipline |

GitHub Flow

Developers branch from main, open a pull request, and merge back to main on approval. Merging to main triggers deployment. Suitable when every merged commit should ship.

git checkout -b feat/PROJ-42-add-oauth main
# ... commit work ...
git push -u origin feat/PROJ-42-add-oauth
# Open PR → review → merge → auto-deploy

Git Flow

Use when releases are batched on a schedule (e.g., sprint releases, versioned libraries).

# New feature
git checkout -b feature/PROJ-99-dark-mode develop

# Prepare a release
git checkout -b release/1.4.0 develop
# bump version, final fixes, then merge to main AND develop
git checkout main && git merge release/1.4.0
git tag -a v1.4.0 -m "Release v1.4.0"

# Emergency hotfix
git checkout -b hotfix/fix-login-crash main
# fix, then merge to main AND develop

Trunk-Based Development

All engineers commit to main (or merge very short-lived branches within a day or two). Unfinished work is hidden behind feature flags.

# Short-lived branch — merged same day or next
git checkout -b fix/null-check-cart
git commit -m "fix(cart): guard against null item list"
git push && gh pr create --fill

Decision Guide

Branch Naming

Pattern: <type>/<ticket>-<short-description>

| Type | Example |

|---|---|

| feat | feat/PROJ-123-user-auth |

| fix | fix/login-null-pointer |

| chore | chore/update-deps |

| docs | docs/api-readme |

| refactor | refactor/PROJ-200-extract-service |

Rules:

Conventional Commits

Commit Type Reference

| Type | Meaning | Changelog / Version Effect |

|---|---|---|

| feat | New feature | Minor version bump |

| fix | Bug fix | Patch version bump |

| docs | Documentation only | No bump |

| style | Formatting, whitespace — no logic change | No bump |

| refactor | Code restructure, no feature or fix | No bump |

| perf | Performance improvement | Patch version bump |

| test | Tests only | No bump |

| chore | Build scripts, tooling, dependencies | No bump |

| ci | CI/CD configuration changes | No bump |

| build | Build system or external dependency changes | No bump |

| revert | Reverts a prior commit | Depends on reverted commit |

Breaking Changes

Add ! after the type to signal a breaking change, or add a BREAKING CHANGE: footer in the commit body.

feat!: remove legacy v1 authentication endpoint

BREAKING CHANGE: The /api/v1/auth endpoint has been removed.
Clients must migrate to /api/v2/auth before upgrading.

Scope

Optional. Place in parentheses between type and colon.

feat(auth): add refresh token rotation
fix(cart): prevent duplicate item insertion
chore(deps): upgrade eslint to v9

BAD / GOOD Example

# BAD — vague, no type, no scope, doesn't explain impact
git commit -m "fix stuff"

# GOOD — type, scope, imperative mood, explains what changed
git commit -m "fix(auth): resolve null pointer when session token is missing"

Pull Request Workflow

PR Description Template

## What
[one paragraph: what changed — be specific about files, components, or APIs affected]

## Why
[one paragraph: why this change is needed; link to ticket or issue]

## How
[optional: explain non-obvious implementation decisions or trade-offs]

## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Tested manually: [describe steps and environment]

## Screenshots / Demo
[if UI change — include before/after screenshots or a short screen recording]

Draft PRs

Open as a draft (gh pr create --draft) when the branch is in progress and early feedback is wanted. Convert to ready-for-review once CI is green and the description is complete.

gh pr create --draft --title "feat(auth): add OAuth2 PKCE flow" --body "$(cat pr-body.md)"
gh pr ready <PR-number>   # convert to ready

Linking Issues

Closes #123      # closes the issue on merge
Fixes #456       # alias for Closes
Relates to #789  # reference without auto-closing

PR Size

Target under 400 LOC of production code per PR. Large changes should be split into stacked PRs where each PR builds on the previous and can be reviewed independently.

Merge Strategies

| Strategy | History Shape | When to Use |

|---|---|---|

| Squash merge | One commit per feature branch | Clean main history; preferred for most feature branches |

| Merge commit | Full branch history preserved | When branch history is meaningful (e.g., a spike or investigation) |

| Rebase merge | Linear, no merge commits | When team values perfectly linear history and all commits are high quality |

Pick one strategy per repository and enforce it consistently. GitHub allows disabling unwanted strategies under repository settings.

Code Review Practice

Reviewer Responsibilities

Reviewers check for: correctness, test coverage, security implications, performance concerns, naming clarity, and API design consistency. Checking formatting is the job of the linter, not the reviewer.

Feedback Labels

Prefix review comments to signal urgency and type:

| Prefix | Meaning | Blocking? |

|---|---|---|

| nit: | Style or preference, minor polish | No |

| suggestion: | A better approach exists; author's call | No |

| question: | Seeking clarification or understanding | No |

| request: | Must be addressed before approval | Yes |

Giving Feedback

# BAD
This is wrong.

# GOOD
request: `userId` can be null here if the session has expired.
Suggest adding a null guard before the lookup:
`if (!userId) return res.status(401).json({ error: 'Unauthorized' });`

Receiving Feedback

Author Checklist Before Requesting Review

Release Tagging and Semantic Versioning

SemVer Rules

Format: MAJOR.MINOR.PATCH

| Segment | Increment When |

|---|---|

| MAJOR | Breaking change — existing callers must update |

| MINOR | New backward-compatible feature added |

| PATCH | Backward-compatible bug fix |

Pre-release labels: 1.0.0-alpha.1, 2.3.0-rc.2

Build metadata (ignored in precedence): 1.0.0+20240102

Creating Annotated Tags

# Annotated tag — preferred for releases (stores tagger, date, message)
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin v1.2.3

# List tags
git tag -l "v*"

# Delete a mistaken tag (locally and remotely)
git tag -d v1.2.3
git push origin --delete v1.2.3

CHANGELOG

Maintain a CHANGELOG.md in Keep a Changelog format with sections Added, Changed, Deprecated, Removed, Fixed, Security.

## [1.2.3] - 2026-04-02
### Fixed
- Resolve null pointer in session validation (#456)

## [1.2.0] - 2026-03-15
### Added
- OAuth2 PKCE authentication flow (#399)

Automation Tools

| Tool | Approach | Notes |

|---|---|---|

| semantic-release | Fully automated — reads commits, bumps version, publishes, creates GitHub release | Zero-touch; requires strict Conventional Commits discipline |

| release-please (Google) | Creates a "Release PR" with changelog and version bump; engineer merges to ship | Semi-automated; good for teams that want a human gate before release |

| standard-version (deprecated) | Local CLI, generates changelog and tag | Superseded by release-please / semantic-release |

Red Flags

Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.