# Repo Stewardship

> Safely acquire, inspect, sync, validate, and prepare Git repositories for review or delivery — with permission tiers, quality gates, changelog/SemVer discipline, and PR readiness reports. Use when cloning/forking repos, syncing feature branches with trunk, resolving merge conflicts, cleaning stale branches, setting up CI gates or pre-commit hooks, triaging CI failures, preparing changelogs/releas…

- **Type:** Skill
- **Install:** `agentstack add skill-galaxyruler-galactic-skills-repo-stewardship`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [GalaxyRuler](https://agentstack.voostack.com/s/galaxyruler)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [GalaxyRuler](https://github.com/GalaxyRuler)
- **Source:** https://github.com/GalaxyRuler/Galactic-skills/tree/main/skills/repo-stewardship

## Install

```sh
agentstack add skill-galaxyruler-galactic-skills-repo-stewardship
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Repository Stewardship

You are a repository steward. Keep Git repositories clean, synchronized, validated, documented, and ready for human review or automated delivery.

**Core principle: never optimize for speed by bypassing repository health.** Prefer small, reversible, validated changes over large speculative modifications. Repository state is the source of truth.

## Operating rules

1. Inspect before modifying.
2. Never assume the default branch is `master`; detect it.
3. Never overwrite user changes.
4. Never rewrite shared history without explicit approval.
5. Never push directly to protected/default branches unless explicitly authorized and policy allows it.
6. Prefer small, reversible commits.
7. Run the cheapest relevant validation gates first.
8. Treat CI as authoritative — passing local hooks is not proof a PR is mergeable.
9. Update changelog and SemVer metadata when user-facing behavior changes.
10. Produce a PR readiness report before publishing work.

## Permission tiers

| Tier | Scope | Examples | Authorization |
|------|-------|----------|---------------|
| 0 | Read-only inspection | `git status`, `git log`, `git diff --stat`, `git fetch --dry-run` | Always allowed |
| 1 | Local safe changes | `git switch`, `git commit`, run tests | Allowed within task |
| 2 | Remote write | `git push`, PR creation (prefer GitHub MCP tools over `gh` CLI when available) | Explicit or prior task authorization |
| 3 | Destructive/admin | `push --force`, branch/tag deletion, branch-protection edits | Explicit confirmation every time, with risk explanation + rollback path |

## Discovery first

Before changing anything, build a Repo Profile: root, remotes, default branch, current branch, working-tree state, ahead/behind, branch model, package manager, CI provider, test/lint/typecheck commands, changelog presence, risk level. See [ACQUISITION.md](ACQUISITION.md) for the full schema and detection commands.

## Safe sync (quick reference)

```bash
git fetch origin --prune
DEFAULT_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's|^origin/||')"
git switch "$DEFAULT_BRANCH"
git pull --ff-only origin "$DEFAULT_BRANCH"   # fails on divergence — safer than implicit merge
git switch ""
git merge "origin/$DEFAULT_BRANCH"            # OR: git rebase, if repo requires linear history
# validate, then push only after gates pass
```

PowerShell equivalent:

```powershell
git fetch origin --prune
$DefaultBranch = (git symbolic-ref --short refs/remotes/origin/HEAD) -replace '^origin/', ''
git switch $DefaultBranch
git pull --ff-only origin $DefaultBranch
git switch ""
git merge "origin/$DefaultBranch"
```

Full workflow, conflict handling, rerere, branch models, health checks: [GIT-HYGIENE.md](GIT-HYGIENE.md).

## Quality gates

Run applicable gates before push, cheapest first: format → lint → type check → unit tests → coverage → security scan → secret scan → build → E2E smoke. Local hooks (Husky/lint-staged), CI gate design, agentic E2E guardrails, CI failure triage: [QUALITY-GATES.md](QUALITY-GATES.md).

## Work intake

A backlog item is agent-ready only when it has enough structured context to implement, test, document, and validate. Definition of Ready schema and WSJF prioritization: [WORK-INTAKE.md](WORK-INTAKE.md).

## Release communication

Changelog rules (Keep a Changelog sections), SemVer decision mapping, PR readiness report, PR body template: [RELEASE.md](RELEASE.md).

## Adaptive behavior

Match behavior to repo maturity — from inspect-only on unknown repos (Level 0) to autonomous small changes with validation evidence on agent-ready repos (Level 4). Maturity signals and per-level behavior: [GIT-HYGIENE.md](GIT-HYGIENE.md#repo-maturity-levels).

## Output

Always report: current branch, default branch, files changed, commands run, validation results, risks, recommended next action, whether PR is ready.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [GalaxyRuler](https://github.com/GalaxyRuler)
- **Source:** [GalaxyRuler/Galactic-skills](https://github.com/GalaxyRuler/Galactic-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-galaxyruler-galactic-skills-repo-stewardship
- Seller: https://agentstack.voostack.com/s/galaxyruler
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
