Skip to content
finish-task logo

Finish Task

finish-task

Finish current task. Use when user says "dokonči task", "task hotový", "mergni do main", or runs /finish-task.

SKILL.md

Full skill instructions

Finish Task

Complete the current task. Behavior depends on detected mode (MAIN, FEATURE_BRANCH, WORKTREE).

Usage

/​finish-task              # Complete current task (auto-detects mode)
/​finish-task --no-test    # Complete without running tests

Current State

Current branch: !git branch --show-current

Uncommitted changes: !git status --porcelain

Is worktree: !test -f "$(git rev-parse --show-toplevel)/​.git" && echo "YES - WORKTREE" || echo "NO - main repo"

Process

Step 1: Detect Mode

BRANCH=$(git branch --show-current)
IS_WORKTREE=false
if [[ -f "$(git rev-parse --show-toplevel)/​.git" ]]; then
  IS_WORKTREE=true
fi

if [[ "$IS_WORKTREE" == "true" ]]; then
  MODE="WORKTREE"
elif [[ "$BRANCH" != "main" && "$BRANCH" != "master" ]]; then
  MODE="FEATURE_BRANCH"
else
  MODE="MAIN"
fi

Step 2: Detect Current Task

MAIN mode: Find task from in_progress status in task files FEATURE_BRANCH/​WORKTREE: Extract from branch name phase-XX/​task-YY-description

Step 3: Check Prerequisites

Before finishing:

  1. No uncommitted changes (or use --force to override)
  2. Task file exists and is readable

Step 4: Run Tests (optional)

Unless --no-test is specified:

dotnet test EShopDemo.sln --filter "Category!=Integration"

If tests fail, the script stops and reports the error.

Step 5: Check Code Formatting

dotnet csharpier check .

If formatting check fails, suggest running dotnet csharpier format . to fix.

Step 6: Mode-Specific Actions

MAIN Mode

Just update task status - no merge needed:

# Update task file: 🔵 in_progress → ✅ completed
# Commit the status change
git add <task-file>
git commit -m "[XX-YY] docs: mark task as completed"
FEATURE_BRANCH Mode

Squash merge all commits to main:

# Switch to main
git checkout main

# Squash merge (combines all branch commits into one)
git merge --squash <feature-branch>

# Commit with task prefix
git commit -m "[XX-YY] feat: <summary of all changes>"

# Delete feature branch
git branch -d <feature-branch>
WORKTREE Mode

Squash merge to main in the main repository:

# Get main repo path
MAIN_REPO=$(cat "$(git rev-parse --show-toplevel)/​.git" | sed 's/​gitdir: //' | xargs dirname | xargs dirname)

# In main repo: squash merge
cd "$MAIN_REPO"
git merge --squash <worktree-branch>
git commit -m "[XX-YY] feat: <summary of all changes>"

# Offer to remove worktree
# Ask user: "Remove worktree directory?"

Arguments

  • --no-test - Skip running tests
  • --force - Continue even with uncommitted changes

Output

On success (MAIN mode):

Finishing task: task-02 - Shared Kernel
Mode: MAIN

Running unit tests... ✓
Checking code formatting... ✓
Task status updated to ✅ completed

Task task-02 completed successfully!

On success (FEATURE_BRANCH mode):

Finishing task: task-02 - Shared Kernel
Mode: FEATURE_BRANCH
Branch: phase-01/​task-02-shared-kernel

Running unit tests... ✓
Checking code formatting... ✓
Squash merging to main...
Committed: [01-02] feat: implement shared kernel with Entity and ValueObject base classes
Deleted branch: phase-01/​task-02-shared-kernel

Task task-02 completed successfully!

On success (WORKTREE mode):

Finishing task: task-02 - Shared Kernel
Mode: WORKTREE
Branch: phase-01/​task-02-shared-kernel

Running unit tests... ✓
Checking code formatting... ✓
Squash merging to main (in main repo)...
Committed: [01-02] feat: implement shared kernel with Entity and ValueObject base classes

Remove worktree directory? [y/​N]

On failure:

Error: Unit tests failed
Fix the failing tests before completing the task.

Safety Rules

  1. NEVER merge with uncommitted changes (unless --force)
  2. ALWAYS run tests before marking complete (unless --no-test)
  3. ALWAYS check formatting before merge
  4. For squash merge, generate meaningful commit message summarizing all changes
  5. ALWAYS ask before removing worktree directory

Integration

This skill is part of the task lifecycle:

  1. /​task-status - see what's available
  2. /​start-task XX - begin working
  3. /​commit - commit changes
  4. /​finish-task - complete (behavior depends on mode)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View