revert-modify-from-main-base

Resets the dev branch to the origin/main baseline with force push and revert receipts.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/lechao365/AndroidSystemEnhance --skill revert-modify-from-main-base-lechao365
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: revert-modify-from-main-base
Source: https://github.com/lechao365/AndroidSystemEnhance/tree/main/harness/skills/revert-modify-from-main-base
Command: npx skills add https://github.com/lechao365/AndroidSystemEnhance --skill revert-modify-from-main-base-lechao365

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When the dev branch keeps failing verification and repeated repair attempts by the emit-side model cannot fix it, this Skill provides a controlled, human-confirmed way to discard the broken dev commits, hard-reset dev to the origin/main baseline, and restore the development board to a working state. ## Core Features & Use Cases - Preview confirmation gate: Lists the commits that would be discarded (origin/main..dev) without changing any state, requiring explicit user confirmation with a 12-character dev HEAD token before execution. - Safe reset and force push: Performs git reset --hard origin/main plus force-with-lease push, with prechecks for a dirty working tree and confirm-token mismatch. - Revert receipt and recovery verification: Writes a revert receipt via ws_report.py (committed and pushed with dev), then syncs code back to the workspace and triggers a mode-B recovery verification to confirm the board boots on the main baseline. - Use Case: After several failed fix rounds on dev, run the preview to review the discard list, confirm with the token, and let the Skill reset dev, record the receipt, and restore the board. ## Quick Start Ask the AI to preview the revert of dev to the main baseline, then confirm execution with the dev HEAD token and run the recovery verification.

Frequently Asked Questions about revert-modify-from-main-base

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I revert a dev branch to the main baseline in git?

Run the preview mode first to list commits in origin/main..dev, then execute with --execute --confirm followed by the first 12 characters of the dev HEAD. The script performs git reset --hard origin/main and a force-with-lease push, then writes a revert receipt.

When should I use revert-modify-from-main-base instead of fixing commits?

Use it only when dev verification keeps failing and the emit-side model cannot repair the branch after multiple rounds. It is never triggered automatically; the user must explicitly decide the divergence from main has no salvage value.

What safety checks prevent accidental dev branch resets?

The script requires a confirm token equal to the current dev HEAD's first 12 characters and refuses to run if the working tree has uncommitted changes. Without --execute it only previews the discard list and changes nothing.

What happens if the force push fails during the revert?

A force push failure exits with code 2 and hands control to a human. If the push succeeded but receipt writing failed, a state file preserves the original commit and count so a rerun can correctly backfill the receipt.

Does the revert verify the development board still boots?

Yes. After the reset, the workflow syncs code back to the workspace at main and runs workspace-verify in mode B with the revert prefix, which includes boot acceptance by default. A failed recovery means the main baseline itself is broken and needs manual intervention.