Skip to content

Commit 08ed4fd

Browse files
recuu-pfegclaude
andcommitted
feat: auto-tag sprints on completion (opt-in --auto-tag flag)
When CLI detects sprint status = completed and --auto-tag is set, automatically creates sprint-N tag and pushes to remote. Default: off. Enable with `--auto-tag` CLI flag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4b36e9a commit 08ed4fd

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/cli.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function parseArgs(argv: string[]): CliArgs {
9797
wsPort: parseInt(getFlag("--ws-port") ?? "4000", 10),
9898
debug: args.includes("--debug") || process.env.DEBUG === "1",
9999
engine: (getFlag("--engine") ?? "claude") as AgentType,
100+
autoTag: args.includes("--auto-tag"),
100101
};
101102
}
102103

@@ -124,8 +125,21 @@ async function runLoop(cliArgs: CliArgs, runner: AgentRunner): Promise<void> {
124125
continue;
125126
}
126127

127-
// Timebox: auto-transition to review if deadline has passed
128+
// Auto-tag on sprint completion (opt-in via workspace setting or CLI flag)
128129
const sprint = sprintData.sprint as Record<string, unknown> | undefined;
130+
if (sprint?.status === "completed" && cliArgs.autoTag) {
131+
const tagName = `sprint-${sprint.number}`;
132+
try {
133+
const existing = execSync(`git tag -l "${tagName}"`, { stdio: "pipe" }).toString().trim();
134+
if (!existing) {
135+
execSync(`git tag "${tagName}"`, { stdio: "pipe" });
136+
try { execSync(`git push origin "${tagName}"`, { stdio: "pipe" }); } catch { /* push may fail */ }
137+
ui.step(`[sprint] Tagged ${tagName}`);
138+
}
139+
} catch { /* non-fatal */ }
140+
}
141+
142+
// Timebox: auto-transition to review if deadline has passed
129143
if (sprint?.status === "active" && sprint?.deadline) {
130144
const deadline = new Date(sprint.deadline as string).getTime();
131145
if (Date.now() > deadline) {

src/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface CliArgs {
4343
wsPort: number;
4444
debug: boolean;
4545
engine: AgentType;
46+
autoTag: boolean;
4647
}
4748

4849
/** All state produced by the setup phase, consumed by the main loop */

0 commit comments

Comments
 (0)