diff --git a/skills/gitea-pr/SKILL.md b/skills/gitea-pr/SKILL.md new file mode 100644 index 0000000..c991728 --- /dev/null +++ b/skills/gitea-pr/SKILL.md @@ -0,0 +1,61 @@ +--- +name: gitea-pr +description: >- + Manage pull request lifecycle on Gitea: verify branch readiness, synthesize structured PR + descriptions from code-review and verify-slice evidence packets, link issues, digest review + feedback, and report merge readiness. Not for code inspection: use code-review. Not for + runtime QA: use verify-slice. Not for Git branch or merge mechanics: use git-workspace. +--- + +# Gitea PR + +## Use when +- Opening or updating a pull request on Gitea after implementing an issue or feature. +- Synthesizing static code review and runtime verification evidence into a reviewable PR. +- Tracking review comments, requested changes, and CI checks toward merge readiness. +- Not for static code inspection: use `code-review`. +- Not for runtime behavioral verification: use `verify-slice`. +- Not for branch creation, rebasing, or local history integration: use `git-workspace`. + +## Steps +1. **Verify branch readiness.** Confirm the local working tree is clean (`git status --short`), + the branch tracks an upstream remote (`git rev-parse @{u}`), unpushed commits are pushed, + and the target base branch exists on the remote. +2. **Collect review and verification evidence.** Inspect outputs from preceding skills: + - `code-review`: Static provenance, covered commits/diff fingerprint, findings disposition, + and overall recommendation (`Ready`). + - `verify-slice`: Runtime evidence ledger across behavioral, security, and state checks, + confirming zero unhandled `FAIL` outcomes. + If either packet is missing or stale relative to current `HEAD`, stop and run that skill first. +3. **Draft structured PR description.** Compose the PR body following + [references/pr-lifecycle.md](references/pr-lifecycle.md): + - Issue Linkage: `Closes #`. + - Summary of Changes: Problem, solution, and scope boundary. + - Static Review Provenance: Base/head SHAs, diff SHA256, and 4-axis disposition. + - Runtime Verification Ledger: Markdown table of executed checks and outcomes. + - Residual Risks and Rollback: Operational considerations and reversibility. +4. **Present for human approval.** Present the proposed title, target base branch, milestone, + and description body to the user per `profile/AGENTS.md`. Stop for confirmation before + creating or editing the pull request. +5. **Create or update pull request via `tea`.** Run verified commands from + [references/tea-pulls.md](references/tea-pulls.md) (`tea pulls create --description-file -`). + Pass `--draft` if work remains in progress. +6. **Track review feedback and merge readiness.** Inspect incoming review comments + (`tea pulls review-comments `) and mergeability status. Synthesize actionable + feedback. When all checks pass and review feedback is resolved, report `Ready for Merge`. + Release and merge authority belongs exclusively to the human owner: never merge automatically. + +## Your call +- **PR title and description approval**: review and approve the draft PR content and issue linkage. +- **Review feedback triage**: decide how to address review comments (rework, clarification, deferral). +- **Merge and release authorization**: decide when to merge the PR into the target base branch. + +## Done when +- Pull request is created or updated in Gitea with complete evidence provenance, and its current + review and mergeability status is reported to the user. + +## Hands off to +- `code-review`: if the diff changes and needs renewed static inspection. +- `verify-slice`: if new code requires runtime verification. +- `git-commit`: to package review fixes into atomic commits. +- `git-workspace`: to rebase or update the branch against upstream base. diff --git a/skills/gitea-pr/references/pr-lifecycle.md b/skills/gitea-pr/references/pr-lifecycle.md new file mode 100644 index 0000000..47c8655 --- /dev/null +++ b/skills/gitea-pr/references/pr-lifecycle.md @@ -0,0 +1,89 @@ +# Pull Request Lifecycle and Evidence Synthesis + +Reference for `gitea-pr`. Defines PR states, evidence synthesis template, and feedback triage workflow. + +## 1. Pull Request Lifecycle States + +```text +Draft (WIP) -> Review -> Changes Requested -> Ready for Merge -> Merged + | | + +-- [Rework/Fix] ----+ +``` + +1. **Draft (WIP)**: PR opened early for visibility. In Gitea, prefixed with `WIP:` or flagged `--draft`. CI may run; reviews are informal. +2. **Review**: Feature complete, working tree clean, static `code-review` and runtime `verify-slice` evidence packets attached. Ready for formal audit. +3. **Changes Requested**: Reviewer identified defects, missing tests, or security concerns. Agent addresses feedback via `git-commit` and refreshes evidence. +4. **Ready for Merge**: All review threads resolved, static review confirms `Ready`, runtime checks pass, and mergeability is green. +5. **Merged**: Merged into target base branch by the human owner. Associated issues are closed automatically by Gitea. + +--- + +## 2. Standard PR Description Template + +Every PR description synthesizes static provenance and runtime evidence into a transparent record: + +```markdown +Closes # + +## Summary of Changes + + +## Scope & Non-Goals +- **In Scope**: +- **Out of Scope**: + +## Static Review Provenance (`code-review`) +- **Base Commit**: `` -> **Head Commit**: `` +- **Committed Diff Fingerprint**: `sha256:` +- **Axes Breakdown**: + - Spec & Scope: Pass + - Standards & Smells: Pass + - Seam & Test Integrity: Pass + - Defensive Invariants: Pass +- **Review Status**: `Ready` + +## Runtime Verification Ledger (`verify-slice`) +| Check ID | Perspective | Scope | Description | Outcome | +| :--- | :--- | :--- | :--- | :--- | +| RV-01 | Behavioral / Seam | local | Unit & integration suite execution | PASS | +| RV-02 | State & Concurrency | local | Race condition & lock invariant check | PASS | +| RV-03 | Security / Host Boundary | local | Host socket validation boundary | PASS | + +## Residual Risks & Operational Considerations +- **Environment Prerequisites**: +- **Reversibility**: +``` + +--- + +## 3. Review Feedback Triage Workflow + +When comments or change requests arrive on a PR: + +1. **Extract review comments**: + ```sh + tea pulls review-comments + ``` +2. **Categorize comments**: + - *Defects & Invariants*: Logic errors, broken tests, edge-case crashes (require code fix). + - *Spec & Scope Clarifications*: Questions about intent or architectural fit (require response or doc update). + - *Nits / Polish*: Minor style preferences that do not violate repo standards (human owner decides priority). +3. **Implement fixes on the feature branch**: + - Use `tdd` or direct edits. + - Commit fixes using `git-commit` with conventional commit scope (e.g. `fix(gitea-pr): address review feedback`). +4. **Re-verify after changes**: + - Run `code-review` to confirm the updated diff fingerprint is clean. + - Run `verify-slice` to substantiate runtime assertions. +5. **Reply and resolve threads via `tea`**: + - Reply to comment: `tea pulls reply "Fixed in "` + - Resolve thread: `tea pulls resolve ` +6. **Push updates to remote**: + - `git push origin ` + +--- + +## 4. Release Authority Guardrail + +Automated skills and checks inform the human owner; they never make the merge decision independently: +- Neither passing unit tests nor a `Ready` code review implies permission to execute `tea pulls merge`. +- The human owner reviews the consolidated ledger, assesses residual risks, and explicitly authorizes merge execution. diff --git a/skills/gitea-pr/references/tea-pulls.md b/skills/gitea-pr/references/tea-pulls.md new file mode 100644 index 0000000..409074f --- /dev/null +++ b/skills/gitea-pr/references/tea-pulls.md @@ -0,0 +1,111 @@ +# Verified Tea CLI Pull Request Subroutines + +Reference for `gitea-pr`. Canonical, verified syntax for managing pull requests and review threads via `tea`. + +## 1. Inspecting Pull Requests + +### List Pull Requests +- List open PRs: + ```sh + tea pulls list + ``` +- List all PRs including closed: + ```sh + tea pulls list --state all + ``` + +### View Pull Request Details +- View basic PR details: + ```sh + tea pulls + ``` +- Inspect mergeability and CI status: + ```sh + tea pulls --fields index,title,state,mergeable,ci,base,head + ``` + +--- + +## 2. Creating and Updating Pull Requests + +### Create a Pull Request +- Create standard PR with multi-line description via heredoc: + ```sh + tea pulls create --title "" --base "<base-branch>" --head "<feature-branch>" --description-file - <<'EOF' + Closes #<issue-index> + + ## Summary of Changes + ... + EOF + ``` +- Create as a Draft / WIP PR: + ```sh + tea pulls create --title "WIP: <title>" --draft --base "<base-branch>" --head "<feature-branch>" --description-file - <<'EOF' + ... + EOF + ``` +- Assign milestone or labels: + ```sh + tea pulls create --title "<title>" --base "<base>" --milestone "<milestone-name>" --labels "<label1,label2>" --description-file - + ``` + +### Edit a Pull Request +- Update title or milestone: + ```sh + tea pulls edit <index> --title "<new-title>" --milestone "<milestone-name>" + ``` + +--- + +## 3. Review Comments and Discussions + +### List Review Comments +- View all inline review comments: + ```sh + tea pulls review-comments <index> + ``` +- View general PR comments: + ```sh + tea comments list <index> + ``` + +### Reply to Review Comments +- Reply to an inline review comment: + ```sh + tea pulls reply <index> <comment-id> "<reply-text>" + ``` +- Add a top-level comment to the PR: + ```sh + tea comment <index> "<comment-text>" + ``` + +### Resolve Review Comments +- Mark an inline review comment as resolved: + ```sh + tea pulls resolve <comment-id> + ``` +- Unresolve a comment if follow-up is needed: + ```sh + tea pulls unresolve <comment-id> + ``` + +--- + +## 4. Closing and Merging Pull Requests + +### Close or Reopen PR +- Close without merging: + ```sh + tea pulls close <index> + ``` +- Reopen closed PR: + ```sh + tea pulls reopen <index> + ``` + +### Merge Pull Request (Human Release Authorization Required) +- Merge using specified merge style (`merge`, `rebase`, `squash`, `rebase-merge`): + ```sh + tea pulls merge <index> --style rebase --title "<commit-title>" --message "<commit-body>" + ``` +- **Operator Safety Rule**: Skills report merge readiness. Only execute `tea pulls merge` when the human owner has explicitly authorized merging.