agentleFS
harshanandakharshanandak/forge-legacy/skills/verify/SKILL.md

verify

Skill4 starsChanged 48 days agoMITView on GitHub

Runs the Forge verify stage — the post-merge health check performed AFTER a PR is merged: switch to master and pull, confirm the merge landed, check CI is green on master, confirm deployments are up, remove the merged worktree, safe-delete the branch, and close the kernel issues the PR resolved. Use when asked to verify a merge went cleanly, confirm post-merge CI health on master, check deployments after merging, clean up a merged branch or worktree, or close the issue now that its PR is merged — and whenever `/verify` is invoked. Strictly the POST-merge stage: use shepherd instead to monitor a still-open PR toward merge, review to fix and resolve PR feedback before merge, ship to push the branch and open the PR, rollback to undo an already-shipped change, status to merely report the current stage without acting, and issue-basics to close an issue unrelated to a just-merged PR.

189 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use instinct-export, instinct-import and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • TheKREATORSSkill

    instinct-export

    Export instincts from project/global scope to a file

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-import

    Import instincts from file or URL into project/global scope

    Also in 3 projects that use this

  • AviadPSkill

    risk-assess

    Assess the risk and blast radius of a proposed code change before implementing it. Evaluates CI impact, framework-wide vs localized scope, rollback path, and identifies blindspots. Use when user says "what's the risk", "is this safe", "assess the impact", "risk assess", "blast radius", or before applying framework-wide or CI-affecting changes. Do NOT use for code quality review (use code-quality) or plan validation (use design-validator).

    Also in 3 projects that use this

  • diego-tobalinaSkill

    build-fix

    Fix build and compilation errors systematically. Run when build fails.

    Also in 6 projects that use this

  • AaravChadhaSkill

    secure

    Security review with a confidence gate - a finding exists only with a concrete exploit scenario and a high/medium/low confidence rating; everything else goes to a worth-hardening list, never inflated. Sweeps five surfaces: auth gates, secrets hygiene, injection and unsafe sinks, unsafe deserialization/crypto/transport, and LLM tool-use trust boundaries. Reports only, never fixes. Use when the user asks for a security review or to check vulnerabilities, secrets, or auth.

    Also in 3 projects that use this

  • ArvorCoSkill

    specify

    Create feature specification from natural language description. Use when starting a new feature or creating a spec. Triggers on: create spec, specify feature, new feature spec.

    Also in 10 projects that use this

  • +1 more from TheKREATORS

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify that the merge landed correctly and everything is running properly after merge.

    line 19
  2. Distinctive:

    If no PR found: the merge may not have landed yet — stop and tell the user to merge first

    line 54
  3. Very specific:

    If the wrong PR appears: user can specify the number directly with gh pr view <number> --json state,mergedAt,mergedBy

    line 55
  4. Distinctive:

    Check the most recent workflow runs on master:

    line 63
  5. Distinctive:

    All should be passing or in progress

    line 64
  6. Distinctive:

    If any failed: identify which workflow and what failed

    line 65
  7. Distinctive:

    Check if the project has a deployment target:

    line 70
  8. Distinctive:

    Only run this step after CI is confirmed healthy (Step 3 passed).

    line 113
  9. Distinctive:

    If the branch name cannot be determined (empty output or error), skip cleanup and tell the user to run git worktree list and clean up …

    line 121
  10. Distinctive:

    If no worktree is found for that branch, skip gracefully with a note: "Worktree: not found (already removed or never created)".

    line 141
  11. Distinctive:

    Delete the local branch (safe delete only):

    line 143
  12. Distinctive:

    Never commit inline: If something is wrong, create a tracking issue:

    line 159
  13. Distinctive:

    If everything is clean, close all issues referenced in the merged PR.

    line 167

“Common” is measured: kept by at least 6 in 10 of the 168 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Verify that the merge landed correctly and everything is running properly after merge.

Verify

Chain (HARD-GATE): the successor depends on the change classification (source of truth: lib/workflow/stages.js) — in the post-merge flow (Critical/Standard/Refactor/Simple/Hotfix) NOTHING follows verify; the docs flow alone reuses verify → ship as a pre-ship content check. verify is therefore not universally terminal — a chain-aware harness MUST gate on classification, not blindly follow next.

This skill runs AFTER the user has merged the PR. It checks system health — not documentation (that was handled by the pre-merge gate embedded in /ship and /review).

Usage

/verify

What This Skill Does

Step 1: Switch to Master and Pull

git checkout master
git pull

Confirm the merge actually landed on master. If the PR isn't merged yet, stop and tell the user to merge first.

Step 2: Confirm PR Is Merged

Detect the PR that produced the current HEAD commit — scope the lookup to that commit's SHA so you don't pick up an unrelated newer merge:

gh pr list --state merged --base master --search "$(git rev-parse HEAD)" --limit 1 --json number,state,mergedAt,mergedBy
  • state should be MERGED
  • If no PR found: the merge may not have landed yet — stop and tell the user to merge first
  • If the wrong PR appears: user can specify the number directly with gh pr view <number> --json state,mergedAt,mergedBy

Step 3: Check CI on Master After Merge

gh run list --branch master --limit 5

Check the most recent workflow runs on master:

  • All should be passing or in progress
  • If any failed: identify which workflow and what failed
  • Failed CI on master after merge may need a hotfix PR

Step 4: Check Deployments (if applicable)

Check if the project has a deployment target:

# Check deployment status from latest run
gh run list --branch master --limit 1

# Check Vercel deployments for the merged PR (use number from Step 2)
gh pr view <number> --json statusCheckRollup

If deployments exist:

  • Are they showing as successful?
  • Is the production/preview URL responding?

Step 5: Report Status

If everything is clean:

✅ Merge verified — everything is healthy

  PR: #<number> merged by <user> at <time>
  CI on master: ✓ All passing
  Deployments: ✓ Up (if applicable)

  Ready for next feature → run /status

If issues found:

⚠️  Post-merge issues detected

  PR: #<number> merged ✓
  CI on master: ✗ <workflow-name> failing
    - Error: <description>
    - Action needed: <hotfix or investigation>

  Deployments: ✗ <deployment> not responding

  Next: Create hotfix branch or investigate root cause

Step 6: Clean Up Worktree and Branch

Only run this step after CI is confirmed healthy (Step 3 passed).

Get the merged branch name:

gh pr view <number> --json headRefName --jq '.headRefName'

If the branch name cannot be determined (empty output or error), skip cleanup and tell the user to run git worktree list and clean up manually.

Find and remove the matching worktree (if it exists):

# Get the worktree path for this exact branch
WORKTREE_PATH=$(git worktree list --porcelain \
  | awk -v branch="refs/heads/<branch>" '
      /^worktree / { path=substr($0, 10) }
      $0 == "branch " branch { print path }
    ')

if [ -n "$WORKTREE_PATH" ]; then
  git worktree remove "$WORKTREE_PATH" --force
  echo "Worktree: removed ✓ ($WORKTREE_PATH)"
else
  echo "Worktree: not found (already removed or never created) — skipping"
fi

If no worktree is found for that branch, skip gracefully with a note: "Worktree: not found (already removed or never created)".

Delete the local branch (safe delete only):

git branch -d <branch> 2>/dev/null || echo "Branch: already deleted — skipping"

The || echo fallback handles the case where the branch is already gone (e.g., deleted by a previous run or the remote), so the command never fails the verify step.

Report cleanup in output:

Worktree: removed ✓
Branch: <branch-name> deleted ✓

Step 7: If Issues Found — Create Issue

Never commit inline. If something is wrong, create a tracking issue:

forge create --title="Post-merge: <description of issue>" --type=bug --priority=1

Step 8: Close resolved issues (if healthy)

If everything is clean, close all issues referenced in the merged PR.

Auto-detect issues from PR body and branch name:

# Get PR body and branch name
PR_BODY=$(gh pr view <number> --json body --jq '.body')
PR_BRANCH=$(gh pr view <number> --json headRefName --jq '.headRefName')

# Extract issue IDs from PR body
# Matches short form (e.g. "Closes forge-abc") and kernel UUIDs (e.g. "Closes d71a824b-b0a2-...")
# Patterns: "Closes <id>", "Fixes <id>", "Resolves <id>"
SHORT_IDS=$(echo "$PR_BODY" | grep -oiE '(closes|fixes|resolves):?\s+[a-z]+-[a-z0-9]+' | grep -oiE '[a-z]+-[a-z0-9]{3,6}$')
UUID_IDS=$(echo "$PR_BODY" | grep -oiE '(closes|fixes|resolves):?\s+[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' | grep -oiE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$')
ISSUE_IDS="$SHORT_IDS $UUID_IDS"

# Validate each ID exists in the kernel
VALID_IDS=""
for id in $ISSUE_IDS; do
  if forge show "$id" >/dev/null 2>&1; then
    VALID_IDS="$VALID_IDS $id"
  fi
done
ISSUE_IDS="$VALID_IDS"

# Also check branch name for an issue ID — extract segment after last /
# then validate with forge show to avoid false matches like "pr-templa"
BRANCH_SLUG=$(echo "$PR_BRANCH" | sed 's|.*/||')
BRANCH_ID=$(echo "$BRANCH_SLUG" | grep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[a-z]+-[a-z0-9]{3,6}' | head -1)
if [ -n "$BRANCH_ID" ] && ! forge show "$BRANCH_ID" >/dev/null 2>&1; then
  BRANCH_ID=""  # Not a valid issue ID — discard
fi

Close each matched issue:

# Close issues found in PR body. Track failures — a close that fails must
# block /verify completion, not be downgraded to a warning.
close_failed=0
for id in $ISSUE_IDS; do
  if ! forge close "$id" --reason="Merged and verified on master (PR #<number>)"; then
    echo "Warning: could not close $id"
    close_failed=1
  fi
done

# If no issues found in body, try branch name match (skip if already closed above)
if [ -z "$ISSUE_IDS" ] && [ -n "$BRANCH_ID" ]; then
  forge close "$BRANCH_ID" --reason="Merged and verified on master (PR #<number>)" || { echo "Warning: could not close $BRANCH_ID"; close_failed=1; }
elif [ -n "$BRANCH_ID" ] && ! echo "$ISSUE_IDS" | grep -qw "$BRANCH_ID"; then
  forge close "$BRANCH_ID" --reason="Merged and verified on master (PR #<number>)" || { echo "Warning: could not close $BRANCH_ID"; close_failed=1; }
fi

# Any intended close that failed → /verify is NOT complete.
if [ "$close_failed" -ne 0 ]; then
  echo "✗ One or more issues failed to close — /verify is NOT complete."
  exit 1
fi

If no issues detected at all, prompt the user:

⚠ No issue ID found in PR body or branch name.
  If this PR closes an issue, run: forge close <id> --reason="Merged and verified on master (PR #<number>)"
<HARD-GATE: /verify exit>
Do NOT declare /verify complete until:
1. gh run list --branch master --limit 3 shows actual CI output (not "should be fine")
2. If healthy: issues extracted from PR body/branch and closed (`forge close` run and confirmed)
   - If no issue ID found: user was warned and given manual close command
3. If issues found: tracking issue created for every problem
4. Worktree removed (or confirmed already gone) — OR Step 6 was intentionally skipped because CI was unhealthy; if skipped, state explicitly: "cleanup deferred, CI was not healthy"
"It should be fine" is not evidence. Run the command. Show the output.
</HARD-GATE>

Rules

  • Never commits code — this skill may update issue state after post-merge health is verified
  • Never creates PRs — if fixes are needed, that's a new /dev cycle
  • Runs after user confirms merge — not before
  • Reports honestly — if CI is broken on master, say so clearly

Example Output (Healthy)

✅ Merge verified — everything is healthy

  PR: #89 merged by harshanandak at 2026-02-24T14:30:00Z
  Branch: feat/auth-refresh deleted ✓
  CI on master:
    ✓ Test Suite (ubuntu, node 24): passing
    ✓ Test Suite (windows, node 26): passing
    ✓ ESLint: passing
    ✓ SonarCloud: passing
    ✓ CodeQL: passing
  Deployments: N/A (no deployment configured)

  Ready for next feature → run /status

Example Output (Issues Found)

⚠️  Post-merge issues detected

  PR: #89 merged ✓
  CI on master:
    ✓ Test Suite: passing
    ✗ SonarCloud: quality gate failing
      - 2 new code smells introduced
      - Action: investigate or create hotfix

  Created issue: forge-xyz
  "Post-merge: SonarCloud quality gate failing on master after PR #89"

  Run /status to assess next steps

Integration with Workflow

Utility: /status  -> Understand current context before starting

Default template:
  /plan      -> Optional default planner; external planners may satisfy /dev entry
  /dev       -> Implement each task with subagent-driven TDD
  /validate  -> Type check, lint, tests, security
  /ship      -> Push + create PR
  /review    -> Address PR feedback
  /verify    -> Post-merge health check

Pre-merge gate: doc updates + CI-green checkpoint embedded in /ship and /review (not a separate stage).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.