Skip to content

Extract mechanical git/gh sequences from skill markdown into scripts or Make targets #159

Description

@sebastientaggart

Problem to Fix

The agent-facing skill files (skills/start.md, skills/submit-for-review.md, skills/deploy.md, and related files) embed multi-step git and gh plumbing inline — dirty-tree guards, fetch + hard-reset sequences, --body-file plumbing, label/milestone resolution tiers, follow-up-issue creation loops.

Asking the agent to execute each mechanical step in turn costs tokens, increases the surface area for mistakes (skipped guards, misquoted flags, forgotten temp files before gh ... --body-file), and forces every adapter (Claude/Cursor/Codex/Gemini) to re-derive the same shell sequence at runtime.

Why it Matters

General Approach (tracer bullet)

This ticket is intentionally scoped to a single tracer-bullet extraction — the dirty-tree guard + git fetch + git reset --hard origin/<base> sequence currently inlined in /start (Case A Step 4 and Case B Step 4) and /deploy Step 1.

Concrete changes:

  1. Move skills/* to skills/cc/* so per-skill-group scripts/ directories have a natural home.
  2. Add skills/cc/scripts/sync-base-branch.py implementing the dirty-tree-guard + fetch + hard-reset sequence. Python over bash for arg handling, structured errors, and clear exit codes.
  3. Wire the script into the three existing call-sites in skills/cc/start.md and skills/cc/deploy.md, replacing the inlined shell with a single invocation.

Everything else — extracting --body-file plumbing, follow-up-issue loops, label/milestone resolution, sync.py awareness of the new layout, broader skill-group support — is out of scope and tracked under #157.

Blocked on #157

This ticket is blocked on #157 (skill groupings). The skills/cc/ move requires sync.py to know where to find skills, which is #157's responsibility. Landing this PR before #157 would leave the project in a broken state. Resume work here once #157 has merged.

Complexity

Verification / QA effort: moderate

The change touches three skill call-sites across all four adapters and must be re-validated end-to-end (start → submit → deploy). Gate on ./sync.py --validate + a manual workflow run after #157's layout is in place.

Acceptance Criteria

  • skills/ contents relocated under skills/cc/ (consistent with the layout Organize skills into opt-in groups so projects can curate which skill sets are active #157 establishes).
  • skills/cc/scripts/sync-base-branch.py exists and implements the dirty-tree guard + git fetch + git reset --hard origin/<base> sequence with clear exit codes.
  • /start (both Case A Step 4 and Case B Step 4) and /deploy Step 1 invoke the script as a single command instead of enumerating the individual shell steps.
  • Behavior is identical end-to-end: dirty-tree guards still abort, hard-reset still runs against origin/<base>.
  • ./sync.py --validate passes and all four adapter outputs continue to render correctly.

Metadata

Metadata

Labels

choreRoutine maintenanceready-for-qaIssue is ready to be QA tested

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions