Consolidate all four canonical workflow files and router SKILL.md: - review-merge-pr.md (from #334 canonical prompt) - reconcile-landed-pr.md (reconciliation gates + handoff schema) - create-issue.md (canonical issue-creation prompt) - work-issue.md (canonical author/coder prompt) SKILL.md is now a short router with mode isolation and universal rules. Adds final-report schemas for all modes and 13 doc-contract tests. Supersedes partial split work in PR #335; full #333 acceptance in one PR.
6.1 KiB
name, description
| name | description |
|---|---|
| llm-project-workflow | Router skill for safe LLM project work: identify task mode, load the matching canonical workflow file, enforce mode isolation, and emit the correct final report schema. Use at the start of any implementation, review, merge, reconciliation, or issue-filing task. |
LLM Project Workflow Skill
This skill is a router. Do not perform project work from this file alone.
Before any project mutation, identify the task mode and load the matching workflow file.
Workflow modes
| Task mode | Workflow | Final report schema |
|---|---|---|
| PR review / approval / merge | workflows/review-merge-pr.md |
schemas/review-merge-final-report.md |
| Reconcile already-landed open PRs | workflows/reconcile-landed-pr.md |
schemas/reconcile-landed-final-report.md |
| Create or update Gitea issues | workflows/create-issue.md |
schemas/create-issue-final-report.md |
| Work on an assigned issue / author code | workflows/work-issue.md |
schemas/work-issue-final-report.md |
Universal rules
- Prove identity, active profile, runtime context, and exact capability before mutation.
- A nearby capability does not count.
- Do not self-review or self-merge.
- Do not mix modes in one run.
- If the required workflow cannot be loaded, stop and produce a recovery handoff only.
- Final report must use the schema for the loaded workflow.
- If a task requires a different mode, stop and produce a handoff for the correct workflow.
Mode isolation
A run that starts in review-merge-pr mode may not create process issues,
implement fixes, or edit source files.
A run that starts in reconcile-landed-pr mode may not approve, request
changes, merge, implement fixes, or create normal issues.
A run that starts in create-issue mode may not review, approve, request
changes, merge, implement fixes, create branches, commit, push, or create PRs.
A run that starts in work-issue mode may not review, approve, request changes,
merge, close PRs, or act as reviewer.
If the task requires a different mode, stop and produce a handoff for the correct workflow.
Definitions
- Merged: Gitea PR metadata says
merged=true. - Landed: Equivalent content is present on remote
master, but PR metadata may not say merged. - Closed-not-merged: PR state is closed and
merged=false. - Reconciled: Verified whether closed-not-merged or already-landed content is present on the target branch; issue/label/tracker state repaired.
Work Selection Rule for LLMs
Before starting any issue or PR work, acquire or verify a work lease. Do not begin coding, reviewing, fixing, branching, committing, pushing, commenting, or creating a PR until you prove the target is not already being worked.
Required checks:
- List open PRs.
- Search for PRs linked to the target issue.
- Search local and remote branches for the issue number.
- Search registered worktrees for the issue branch.
- Check dirty worktrees.
- Check active leases or recent handoffs.
- Check whether the issue was already completed by a merged PR.
If another active session owns the lease, stop with "work already claimed" or produce a handoff.
For Gitea-Tools: gitea_lock_issue is the fail-closed lease gate before author
mutations; status:in-progress and claim comments are supporting lease signals.
Global LLM Worktree Rule
The main project checkout is a stable control checkout on master, main, or
dev. All LLM task work must happen inside the project's branches/ directory.
If cwd is not inside branches/, stop before any file edit, test write,
commit, merge, rebase, or cleanup. The main checkout is orchestration-only.
Shell Spawn Hard-Stop Rule
exit_code: -1 with empty stdout/stderr means the shell failed to spawn — not a
command failure. After two consecutive spawn failures, hard-stop shell use for
the session and emit a recovery report (#258).
Isolated worktree naming
Implementation: (fix|feat|docs|chore)/issue-<number>-<short-description>
Review: review/pr-<number>-<short-description>
Worktree folder: branch with / replaced by - under branches/.
Helpers: scripts/worktree-start, scripts/worktree-review,
scripts/worktree-clean.
Identity and profile safety
- Author and reviewer identities must be distinct.
- Never place raw tokens in LLM/MCP config.
- Use
gitea_whoamiandgitea_resolve_task_capabilitybefore mutating.
Controller Handoff
Every task must end with a section titled exactly Controller Handoff. Compact
format canonical field set per issue #182; mode-specific schemas in
schemas/*-final-report.md define required fields. Use the final report schema
for the loaded workflow mode — not the legacy compact block alone.
review_proofs.assess_controller_handoff() validates presence.
Prompt templates
Ready-to-copy task prompts live in templates/:
start-issue.md— author work (loadswork-issue.md)review-pr.md— review (loadsreview-merge-pr.md)merge-pr.md— merge (loadsreview-merge-pr.md)recover-bad-state.mdreconcile-closed-not-merged-pr.mdworktree-cleanup.mdrelease-tag.md
Adapting to a project
| Placeholder | Example here |
|---|---|
<remote> |
prgs |
| default branch | master |
| profile env vars | GITEA_MCP_CONFIG, GITEA_MCP_PROFILE |
branches/ |
branches/ |
| helpers | scripts/worktree-start / -review / -clean |
Versioning And Tagging
Releases follow SemVer from remote master only, after full test suite passes.
See templates/release-tag.md and
scripts/release-tag.