finalize-task
Commit, squash, push, and create a PR for the current branch.
Skill by TJaenichen
Chalk Labs
Need help deploying finalize-task?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/tjaenichen-finalize-task
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/finalize-task
Tools it pre-approves 2
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(git:*),Bash(powershell:*)
What's inside
- Skill name
finalize-task- Description
- Commit, squash, push, and create a PR for the current branch.
- License
- MIT
- Allowed tools
- Bash(git:*),, Bash(powershell:*)
- Instructions
- 100 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (1)
- SKILL.md
SKILL.md (first lines)
# Finalize Task
Optional arguments: $ARGUMENTS
## Your task
Complete the current branch by committing all changes, squashing into a single commit, pushing, and creating a pull request.
## Steps
### 1. Gather context (run in parallel)
- `git status` — check for uncommitted changes
- `git log --oneline main..HEAD` — see all commits on this branch
- `git diff --stat main..HEAD` — see all changed files vs main
- `git rev-parse --abbrev-ref HEAD` — get current branch name
### 2. Commit any uncommitted changes
If there are staged or unstaged changes:
1. Stage all relevant changes (be specific with file paths, avoid secrets like `.env`)
2. Generate a concise commit message describing the changes
3. Commit
If the working tree is clean, skip this step.
### 3. Squash commits
If there are **multiple commits** on this branch (vs main):
1. Find the merge base: `git merge-base main HEAD`
2. Soft-reset to the merge base: `git reset --soft <merge-base>`
3. Create a single commit with a message that summarizes ALL the changes across all commits
4. Use a clear, descriptive commit message
If there is only **one commit**, skip this step.
### 4. Push
```bash
git push -u origin <branch> --force-with-lease
```
Use `--force-with-lease` since we may have squashed (safe force push that won't overwrite others' work).
### 5. Create Pull Request
Extract the work item ID from the branch name (format: `feature/<ID>_<ShortName>`).
Use PowerShell to create the PR via Azure DevOps REST API:
```powershell
$repoId = "<REPO_ID>"
$baseUrl = "https://devops.example.com/DefaultCollection/MyProject/_apis/git/repositories/$repoId"
$body = @{
sourceRefName = "refs/heads/<branch>"
targetRefName = "refs/heads/main"
title = "<title>"
description = "<description>"
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri "$baseUrl/pullrequests?api-version=6.0" -Method Post -Body $body -ContentType "application/json" -UseDefaultCredentials
```
**PR title**: Use `$ARGUMENTS` if provided, otherwise generate from the commit message. Include the work item ID as `(#<ID>)` at the end.
**PR description**: Generate a summary with:
```
## Summary
- bullet points describing the changes
## Test plan
- [ ] relevant test steps
```
### 6. Report success
Display:
- Commit hash and message
- Number of commits squashed (if any)
- PR URL: `https://devops.example.com/DefaultCollection/MyProject/_git/Payments/pullrequest/{id}`
## Edge cases
- **No changes and no commits**: Report that there's nothing to finalize
- **PR already exists for this branch**: Report the existing PR URL instead of creating a duplicate. Find it via:
```powershell
Invoke-RestMethod -Uri "$baseUrl/pullrequests?searchCriteria.sourceRefName=refs/heads/<branch>&api-version=6.0" -UseDefaultCredentials
```
- **Branch is `main`**: Refuse and tell the user to work on a feature branch
- **Push fails**: Report the error, do not retry blindly
## Important
- Always use `-UseDefaultCredentials` for Windows auth
- Always use `--force-with-lease` (not `--force`) when pushing after squash
- Use PowerShell `Invoke-RestMethod` for API calls (not curl) — it handles Windows auth natively
- Save PowerShell scripts to temp files if commands get complex, to avoid escaping issuesFrom TJaenichen/claude-code-harness, MIT.
More from TJaenichen/claude-code-harness
- 0.524score
panel-review
TJaenichen
Multi-agent panel review of any code target (a PR by id, a branch, the current branch, or specific paths) against project standards, with confidence-scored…
SkillBFreshness: BClaude Code - 0.524score
db-search
TJaenichen
Search for database objects (tables, stored procedures, views, functions) in the scripted-out DB sources.
SkillBFreshness: BClaude Code +9 - 0.524score
panel-review-fix
TJaenichen
Multi-agent review of the current branch's diff vs main, with optional in-place fix application.
SkillBFreshness: BClaude Code - 0.523score
build
TJaenichen
Build the solutions with warnings suppressed.
SkillBFreshness: BClaude Code +9 - 0.521score
rebase-main
TJaenichen
Fetch and rebase the current branch onto origin/main (or origin/master) for a clean linear history.
SkillBFreshness: BClaude Code +9 - 0.521score
ask-codex
TJaenichen
Consult OpenAI's Codex (ChatGPT) for a second opinion during planning, architecture decisions, code review, or any situation where a diverse AI perspective…
SkillBFreshness: BClaude Code +9 - 0.521score
ask-gemini
TJaenichen
Consult Google's Gemini LLM for a second opinion during planning, architecture decisions, code review, or any situation where a diverse AI perspective adds…
SkillBFreshness: BClaude Code +9 - 0.518score
starttask
TJaenichen
Start a new task - pull main, create worktree and feature branch from DevOps work item
SkillBFreshness: BClaude Code +9 - 0.518score
cleanup-worktree
TJaenichen
Remove a git worktree after a feature branch has been merged.
SkillBFreshness: BClaude Code +9 - 0.518score
db-query
TJaenichen
Execute SQL queries against the staging or dev database using sqlcmd with Windows integrated authentication.
SkillBFreshness: BClaude Code +9 - 0.518score
pr
TJaenichen
Manage Pull Requests - create, update description, add wiki links.
SkillBFreshness: BClaude Code +9 - 0.518score
devops-wiki-update
TJaenichen
Update Azure DevOps wiki page (handles ETag, Mermaid syntax)
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 16, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from TJaenichen
- 0.524score
db-search
TJaenichen
Search for database objects (tables, stored procedures, views, functions) in the scripted-out DB sources.
SkillBFreshness: BClaude Code +9 - 0.524score
panel-review-fix
TJaenichen
Multi-agent review of the current branch's diff vs main, with optional in-place fix application.
SkillBFreshness: BClaude Code - 0.524score
panel-review
TJaenichen
Multi-agent panel review of any code target (a PR by id, a branch, the current branch, or specific paths) against project standards, with confidence-scored…
SkillBFreshness: BClaude Code - 0.523score
build
TJaenichen
Build the solutions with warnings suppressed.
SkillBFreshness: BClaude Code +9 - 0.521score
rebase-main
TJaenichen
Fetch and rebase the current branch onto origin/main (or origin/master) for a clean linear history.
SkillBFreshness: BClaude Code +9 - 0.521score
ask-codex
TJaenichen
Consult OpenAI's Codex (ChatGPT) for a second opinion during planning, architecture decisions, code review, or any situation where a diverse AI perspective…
SkillBFreshness: BClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get finalize-task running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
finalize-task skill. Agent Mart. https://agentmart.dev/skills/tjaenichen-finalize-task (last updated 2026-10-24)