plugins/harness-powers/skills/harness-finish/SKILL.md
Use when Harness implementation work is complete and the agent must verify, archive the plan, update docs/PLANS.md, and offer exactly four finish options: local merge, push and PR, keep branch, or discard work. Requires `harness-verify` before presenting finish options and requires discard confirmation before any destructive cleanup.
npx skillsauth add Refinex-Space/Refinex-Skills harness-finishInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete a Harness implementation branch with evidence, plan bookkeeping, and a clear integration choice.
This is a low-freedom skill. Verification and user choice are mandatory.
Announce at start: I'm using harness-finish to verify the work and present finish options.
Before presenting finish options, run harness-verify.
The verification evidence must include:
If verification fails or does not prove the completion claim, stop and report the actual status. Do not offer merge, PR, keep, or discard options as a "finished" workflow until the verification gap is resolved.
Before merge or PR handoff, update Harness plan bookkeeping:
docs/exec-plans/active/ to the repository's completed/archive plan location used by that project.docs/PLANS.md so the plan status, archived path, branch, and verification evidence are current.If no active plan exists, record that explicitly in the finish summary and PR body instead of inventing one.
Collect branch and base information:
git branch --show-current
git status --short
git worktree list
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
If the working tree has unrelated user changes, do not stage, revert, or discard them. Report the scope and ask before any operation that would affect them.
After harness-verify passes and plan bookkeeping is ready, present exactly:
Implementation verified. What would you like to do?
1. Merge back to <base-branch> locally
2. Push branch and create a Pull Request
3. Keep the branch/worktree as-is
4. Discard this work
Which option?
Do not add hidden defaults. Wait for the user's choice.
Use when the user chooses local merge. First identify where the base branch can be safely checked out:
git worktree list
git branch --show-current
If <base-branch> is already checked out in another worktree, run the merge from that base worktree instead of trying to check it out inside the feature worktree. Git normally rejects the same branch being checked out in two worktrees, and forcing around that guard risks operating in the wrong directory.
From the base worktree:
git pull --ff-only
git merge <feature-branch>
If no base worktree exists, create or switch to a clean base worktree first, then run the merge there. After merge, run the verification command again on the merged result. If it passes, remove only the completed feature branch and feature worktree when safe:
git worktree remove <worktree-path>
git branch -d <feature-branch>
If merged verification fails, stop and report the failure. Do not delete the branch or worktree.
Use when the user chooses PR handoff.
git push -u origin <feature-branch>
The PR body must reference the plan and verification evidence:
## Summary
- <what changed>
## Plan
- Active/archived plan: <plan path or "No active plan">
- docs/PLANS.md updated: <yes/no plus reason>
## Verification
- `<command>`: <result>
- Residual risk: <risk or none known>
Keep the branch and worktree unless the user explicitly asks for cleanup after PR creation.
Use when the user wants to continue later.
Report:
Keeping branch <feature-branch>.
Worktree preserved at <worktree-path>.
Latest verification: <command and result>.
Plan status: <active or archived path>.
Do not remove the worktree or delete the branch.
Discard is destructive and requires confirmation.
Before deleting anything, show:
This will permanently discard:
- Branch: <feature-branch>
- Worktree: <worktree-path>
- Commits not on <base-branch>: <short commit list>
- Plan/archive changes: <what will remain or be reverted>
Type "discard" to confirm.
Only proceed after the user types exactly discard.
Then remove the worktree and branch with the least destructive commands that work:
git worktree remove <worktree-path>
git branch -D <feature-branch>
Do not discard unrelated user changes.
Stop if you are about to:
harness-verifydocs/PLANS.md status updates when a plan existsdevelopment
Deep initialization of project AGENTS.md hierarchy and control plane for AI coding agents. Use this skill whenever the user wants to set up, initialize, bootstrap, or create AGENTS.md / CLAUDE.md files for their project, or when they mention "init-deep", "harness setup", "control plane", "agent context", "project initialization for agents", or want to make their codebase agent-ready. Also trigger when a user says things like "set up my repo for Claude Code", "make this project work better with agents", "create agent instructions", "bootstrap harness", or "initialize agent docs". This skill handles both existing large codebases (where hierarchical, module-scoped AGENTS.md files are needed) and new/small projects (where brainstorming with the user comes first). Do NOT use this skill for routine code changes, bug fixes, or general documentation — it is specifically for creating the structured agent control plane.
development
Detect and fix drift in project AGENTS.md files and agent control plane. Use this skill whenever the user wants to audit, recalibrate, refresh, update, or fix their existing AGENTS.md files, or when they mention "drift", "stale AGENTS.md", "outdated agent instructions", "recalibrate", "sync agents", "audit control plane", "AGENTS.md is wrong/old/broken", or when they suspect their agent harness has fallen out of sync with the codebase. Also trigger when a user says things like "my agents keep making wrong assumptions", "Claude doesn't understand the new structure", "we refactored but the AGENTS.md is old", "check if my AGENTS.md is still accurate", or "update my agent docs". This skill is the companion to init-deep — init-deep creates the control plane from scratch, drift-doctor maintains it over time. Do NOT use for initial creation of AGENTS.md (use init-deep instead). Do NOT use for general code review or documentation updates unrelated to agent context.
development
Use when adding, fixing, reviewing, or generating code comments, docstrings, Javadoc, JSDoc/TSDoc, rustdoc, SQL comments, or documentation comments for source, markup, configuration, or database files.
development
Enforce production-grade Java development standards when writing, reviewing, or architecting Java code. Covers commenting, core Java idioms (Stream, collections, concurrency, generics), 23 GoF design patterns, SonarQube/Alibaba p3c/Lombok rules, Spring Boot MVC structure, Spring Cloud DDD microservices, MyBatis/JPA/transaction management, exception handling, logging, REST API design, testing, and security. Trigger whenever the user writes Java code, reviews Java code, designs a Spring Boot or Spring Cloud project, implements a design pattern, fixes code smells, discusses architecture, or asks about Java best practices. Also trigger when Java code is pasted for feedback or the user asks about package structure, DTO/VO/PO conventions, or coding standards.