Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .claude/commands/project-prerelease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
description: Audit changelog and draft entries for upcoming release
allowed-tools: Bash(git:*), Bash(jq:*), Bash(bd:*), Read, Edit, Grep, AskUserQuestion, Skill(beads)
model: haiku
---

Audit the changelog for missing entries since the last release and draft updates.

## Instructions

Follow these steps exactly in order.

### Step 1: Get the last release tag

```bash
git describe --tags --abbrev=0 2>/dev/null || echo "no tags yet"
```

### Step 2: Get commits and bead IDs since the tag

Replace `<TAG>` with actual tag from Step 1:

```bash
git log <TAG>..HEAD --oneline --no-merges
git log <TAG>..HEAD --format="%B" --no-merges | grep -oE "(commando|forge)-[a-z0-9]+" | sort -u
```

Also read CHANGELOG.md `[Unreleased]` section.

### Step 3: Categorize each commit

**INCLUDE if:**

- Commit type is `feat:` or `fix:`
- Change affects CLI users (commands, output, behavior)

**SKIP if:**

- Type is: `docs:`, `ci:`, `test:`, `chore:`, `bd:`, `bd sync:`, `refactor:`
- Change is in: `.claude/`, `.github/`, `scripts/`, `docs/`, `.beads/`
- Bead ID already in CHANGELOG.md

### Step 4: Get bead details

```bash
bd list --status=closed --limit=20
```

For each bead ID from commits:

```bash
bd show <bead-id>
```

### Step 5: Check for gaps

Compare closed beads vs beads in commits. Flag user-facing beads missing from commits.

### Step 6: Draft changelog entries

Format:

- One line per entry, max 80 chars
- Start with verb: "Add", "Fix", "Change", "Remove"
- Include bead ID: `(\`commando-xxx\`)`
- Group by: Added, Changed, Fixed, Removed

### Step 7: Present report

Show:

1. **Commits analyzed** - hash, type, INCLUDE/SKIP, reason
2. **Beads referenced** - ID, title, type
3. **Gaps** - missing beads or "None"
4. **Draft entries** - grouped by section

### Step 8: Ask for confirmation

Use `AskUserQuestion`:

- Question: "Update CHANGELOG.md with these entries?"
- Header: "Changelog"
- Options: "Yes, update" / "No, skip"

### Step 9: Update CHANGELOG.md (if yes)

1. Find `## [Unreleased]`
2. Insert entries after it, before next version section
3. Merge with existing entries (no duplicates)
4. Do NOT commit
5. Tell user: "CHANGELOG.md updated. Review with `git diff CHANGELOG.md`"
72 changes: 72 additions & 0 deletions .claude/commands/project-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
description: Prepare and tag a new release
argument-hint: [version]
allowed-tools: Bash(git:*), Bash(jq:*), Read, Edit, AskUserQuestion
model: sonnet
---

Prepare a release for commando.

## Instructions

### Step 1: Gather release context

```bash
git branch --show-current
jq -r .version package.json
git describe --tags --abbrev=0 2>/dev/null || echo "no tags yet"
git log $(git describe --tags --abbrev=0 2>/dev/null || echo "HEAD~20")..HEAD --oneline --no-merges
```

### Step 2: Validate branch

Releases MUST be from `main` branch.

If on ANY OTHER branch: **STOP** and tell user to merge to main first.

### Step 3: Compute version

Default: bump patch (e.g., 0.1.3 → 0.1.4)

If user provided version ($ARGUMENTS), use that instead.

Use `AskUserQuestion` to confirm version.

### Step 4: Audit changelog

Read CHANGELOG.md `[Unreleased]` section. Compare commits since last tag.

**Only flag user-facing changes:**
- `feat:` that add/change CLI commands or behavior
- `fix:` that fix bugs users encounter

**Skip:**
- `docs:`, `ci:`, `test:`, `bd:`, `chore:` commits
- Changes in `.claude/`, `.github/`, `scripts/`, `docs/`
- Commits already in changelog (matching bead ID)

If user-facing changes missing from changelog: **STOP** and ask user to update.

### Step 5: Execute release

Only after version confirmed AND changelog complete:

1. Validate `[Unreleased]` has content

2. Update CHANGELOG.md:
- Add empty `## [Unreleased]` at top
- Change old `## [Unreleased]` to `## [X.Y.Z] - YYYY-MM-DD`

3. Update package.json version

4. Commit: `chore: release vX.Y.Z`

5. Create tag: `vX.Y.Z`

6. Push:
```bash
git push origin main
git push origin vX.Y.Z
```

7. Report success: "Release tagged. Run the Release workflow manually at https://github.com/jdillon/commando/actions/workflows/release.yml"
30 changes: 12 additions & 18 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async function buildCLI(config: CommandoConfig): Promise<Command> {

program
.name("cmdo")
.description("Modern CLI framework for deployments")
.description("CommanDO CLI Framework")
.version(pkg.version);

addTopLevelOptions(program);
Expand Down
2 changes: 1 addition & 1 deletion lib/logging/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function parseLogLevel(): string {
}

// Fallback to environment variable
if (process.env.FORGE_DEBUG) {
if (process.env.COMMANDO_DEBUG) {
return 'debug';
}

Expand Down
Loading