一键导入
issue-finish
After explicit user approval, merge a reviewed HoP PR into main and clean up the issue branch, worktree, and agent labels.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
After explicit user approval, merge a reviewed HoP PR into main and clean up the issue branch, worktree, and agent labels.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | issue-finish |
| description | After explicit user approval, merge a reviewed HoP PR into main and clean up the issue branch, worktree, and agent labels. |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"all-agents","workflow":"github","priority":"high"} |
I handle the final merge and cleanup after the user says "ship it": verify PR state, confirm required checks and approvals, merge into main, close the issue with a summary, remove the issue worktree/branch, and release agent:working.
Load this skill only when:
issue-review has runYou need:
Nissue/<N>-<slug>.worktrees/<N>-<slug>gh pr view "$BRANCH" --json number,state,isDraft,mergeStateStatus,statusCheckRollup,reviewDecision,url,baseRefName,headRefName
If the PR is not open, check whether it was already merged. If not merged, stop and report.
Run /compact before merge and cleanup. The finish sequence is mechanical and should not carry noisy implementation context.
Check:
main.Recommended commands:
gh pr view "$BRANCH" --json number,title,isDraft,baseRefName,reviewDecision,statusCheckRollup,files,url
git -C "$WORKTREE" diff --name-only origin/main...HEAD
If checks are red, approvals are missing, or blocking review findings remain, stop and report.
Inspect changed files against HoP rules:
| If PR touches... | Verify... |
|---|---|
.runtime/ or artifacts/ paths | Tenant isolation via HOP_TENANT_ID or path helpers |
| Crossroad files | PR has crossroad impact, migration/consumer notes, regression proof, code-owner path |
.env.example or config | README/docs explain env behavior when needed |
| Supabase persistence | Mock parity and relevant migration/check command |
| Dashboard/UI | DESIGN.md constraints are respected |
| Canonical behavior or architecture | Relevant canonical doc, guide, evidence, or ADR impact is addressed |
| GitHub workflows or branch protection | CI gate docs and branch protection drift are considered |
Surface missing documentation or unresolved risk before merging. Block only when it affects acceptance criteria, required review, CI, security, tenant isolation, or crossroad policy.
BRANCH="issue/N-slug"
PR_URL=$(gh pr view "$BRANCH" --json url --jq '.url')
PR_NUMBER=$(gh pr view "$BRANCH" --json number --jq '.number')
PR_TITLE=$(gh pr view "$BRANCH" --json title --jq '.title')
gh pr ready "$BRANCH" 2>/dev/null || true
gh pr merge "$BRANCH" \
--squash \
--subject "${PR_TITLE} (#${PR_NUMBER})" \
--delete-branch
If merge fails due to conflicts or failing checks, stop. Fix in the worktree and rerun issue-review.
gh issue close N --comment "Completed by ${PR_URL}
Merged into main via squash."
If the issue is already closed, treat it as success and continue cleanup.
Clean only the current issue branch/worktree unless the user explicitly asked for broader pruning.
WORKTREE=".worktrees/N-slug"
BRANCH="issue/N-slug"
if [ -d "$WORKTREE" ]; then
if [ -n "$(git -C "$WORKTREE" status --porcelain)" ]; then
echo "Worktree has uncommitted changes; cleanup skipped: $WORKTREE"
exit 1
fi
git worktree remove "$WORKTREE"
fi
if git show-ref --verify --quiet "refs/heads/$BRANCH"; then
git branch -D "$BRANCH"
fi
if [ -d "$WORKTREE" ]; then
echo "Worktree still exists after cleanup: $WORKTREE"
exit 1
fi
if git show-ref --verify --quiet "refs/heads/$BRANCH"; then
echo "Local branch still exists after cleanup: $BRANCH"
exit 1
fi
git remote prune origin
gh issue edit N --remove-label "agent:working" 2>/dev/null || true
If cleanup fails mid-way, release agent:working first and comment with the remaining manual cleanup.
Report only what actually completed. If cleanup was partial, report the remaining manual steps instead of marking them done.
## Done - Issue #N
PR merged: <PR_URL>
Issue closed: #N
Remote branch deleted: issue/N-slug
Worktree removed: .worktrees/N-slug
Label released: agent:working
Pull main to get the merged changes:
git pull origin main
| Problem | What to do |
|---|---|
| PR has conflicts | Stop, report, fix in worktree, rerun issue-review |
| CI/checks are red | Stop, report, fix, rerun issue-review |
| Approval missing | Stop and request review/approval |
| PR already merged | Continue issue/worktree/label cleanup |
| Issue already closed | Continue worktree/label cleanup |
| Worktree already removed | Skip worktree removal and continue |
main only.agent:working, even after partial cleanup failures.gh pr ready issue/N-slug 2>/dev/null || true
gh pr merge issue/N-slug --squash --delete-branch
gh issue close N --comment "Completed by <PR_URL>"
git worktree remove .worktrees/N-slug
git branch -D issue/N-slug
gh issue edit N --remove-label "agent:working"
Pipeline simplificado: documento fonte → extração de conhecimento → padrões reutilizáveis → classificação contra repositório → canonical docs. Focado em gerar docs canônicos a partir de um único documento (currículo, análise, transcript). NÃO gera skills, exercícios ou integração profunda de currículo — apenas canonical docs + atualização de tags/aliases + system-of-record. Dispara com: 'canonicalize this document', 'extract canonical from', 'doc to canonical', 'create canonical docs from', 'documento para canonical', 'extrair canônicos de'.
Implementa uma camada de selecao de contexto model-agnostic e vendor-independent. Define um formato padronizado de contexto que qualquer modelo pode consumir, um Context Router que resolve queries de qualquer agente contra o grafo relacional e storage em tiers, e Vendor Adapters que traduzem o formato agnostico para o formato nativo de cada modelo. Transforma contexto no ativo mais duravel da organizacao — portavel entre modelos, sessoes, e provedores. Dispara com: 'neutral selection', 'model-agnostic context', 'vendor-independent context', 'context format standard', 'context router', 'multi-model context', 'portable context', 'cross-model context', 'camada neutra', 'contexto agnostico', 'formato de contexto', 'vendor adapter', 'neutral context layer', 'context portability', 'model migration context'.
Torna o retrieval de contexto budget-aware: cada candidato a retrieval e ranqueado por razao valor/custo antes de ser injetado no contexto. Implementa um Information Value Predictor que estima reducao de incerteza por candidato, um Token Cost Estimator que computa custo em tokens, e um Utility Feedback Loop que aprende com uso real — quais itens recuperados foram efetivamente referenciados pelo modelo. Previne o memory feedback loop onde o sistema construido para resolver o problema de memoria se torna o motor da degradacao. Contrapoe diretamente o Link 4 (inert memory feedback) do Agent Degradation Loop. Dispara com: 'selection-budgeted retrieval', 'budgeted retrieval', 'retrieval budget', 'cost-benefit retrieval', 'information value predictor', 'utility feedback retrieval', 'retrieval ranking', 'orcamento de retrieval', 'busca budgetada', 'recuperacao com orcamento', 'value-cost retrieval', 'retrieval utility feedback'.
Implementa armazenamento de contexto em tres tiers (hot/warm/cold) com promocao e democao baseadas em relevancia. Mantem o conjunto de trabalho ativo deliberadamente pequeno na hot tier (cache in-memory), move contexto recentemente relevante para warm tier (NVMe, baixa latencia), e arquiva historico completo na cold tier (object storage, alta latencia). O Tier Orchestrator executa transicoes baseadas em scores de relevancia e prefetch preditivo antes de cada passo de raciocinio. Previne context rot (cada token acumulado degrada qualidade do passo seguinte) e separa preocupacao de armazenamento de preocupacao de selecao. Dispara com: 'tiered context', 'tier storage', 'context tiers', 'hot warm cold', 'tiered storage', 'context promotion', 'context demotion', 'tier orchestrator', 'promocao de contexto', 'democao de contexto', 'armazenamento em tiers', 'tiered context storage', 'context tier management'.
Operacionaliza um curriculo de autonomia para agentes: controla a proporcao entre rollouts supervisionados (professor/humano) e rollouts auto-gerados (agente) com um parametro lambda, gates de prontidao por classe de tarefa, e uma progressao explicita observe→assist→own. Aplica importance sampling para corrigir a distribuicao mista. Previne cold-start collapse (rollouts puros do agente antes de aprender recuperacao) e autonomy stagnation (agente nunca pratica recuperacao autonoma). Usar ao implantar um novo agente em producao, ao fazer transition de fluxo manual para agentico, ao calibrar o grau de supervisao de um agente existente, ou quando o agente apresenta comportamento fragil em cenarios nao-supervisionados. Dispara com: 'autonomy curriculum', 'curriculo de autonomia', 'lambda schedule', 'teacher mixing', 'rollout sampling', 'autonomy dial', 'autonomy progression', 'observe assist own', 'readiness gate', 'student rollout', 'teacher-student mix', 'gradual autonomy', 'agente semi-supervisionado', 'autonom
Separa o sinal de melhoria do agente em dois componentes independentes: magnitude (o quanto o modelo acredita que uma mudanca importa, extraida de self-distillation delta, log-ratio, atencao, ou confianca interna) e direcao (para onde a mudanca deve ir, determinada por verificador externo, testes, ou revisao humana). Combina magnitude × direcao em um plano de correcao ponderado: gaste esforco de correcao onde o agente tem conviccao FORTE e o verificador confirma a direcao; reduza ou escale quando a direcao e incerta. Previne information leakage (agente aprende a imitar formato sem substancia) e overconfidence collapse (self-distillation puro sem verificacao externa). Usar ao projetar loops de melhoria de agente, ao implementar self-distillation com verificacao, ao calibrar feedback de producao, ou quando o agente produz outputs com formato correto mas conteudo errado. Dispara com: 'magnitude direction', 'verifier split', 'trust but verify', 'confidence direction', 'correction weight', 'self-distillation verif