[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78F7AAZ6JMYM25CC654K70Q":3,"skill-same:01M78F7AAZ6JMYM25CC654K70Q":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M78F7AAZ6JMYM25CC654K70Q","pr-loop-lifecycle",null,"Opens and closes a PR-loop run: the .claude\u002F** permission grant, worktree preflight, and cwd routing at the start; teardown, permission revoke, and final report at the end. Invoked by PR-loop orchestrators (bugteam, pr-converge, autoconverge, qbug); not for general git cleanup outside a PR loop.","jl-cmd-projects\u002Fclaude-dev-env","jl-cmd-projects","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F338158757?v=4","01M78F4M55P4QY5YPN27XBQA9N","01M78F4M65AGEYC88NV6PW4715",7,"MIT","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fpackages\u002Fclaude-dev-env\u002F.agents\u002Fskills-archived\u002Fpr-loop-lifecycle\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pr-loop-lifecycle\ndescription: >-\n  Opens and closes a PR-loop run: the .claude\u002F** permission grant, worktree\n  preflight, and cwd routing at the start; teardown, permission revoke, and\n  final report at the end. Invoked by PR-loop orchestrators (bugteam,\n  pr-converge, autoconverge, qbug); not for general git cleanup outside a PR\n  loop.\n---\n\n# PR Loop Lifecycle\n\n**Core principle:** a PR-loop run opens with an explicit, revocable permission grant and closes the same way every time — teardown, description rewrite, revoke, report — no matter how the run ended.\n\n## How callers invoke this\n\n- **Skill-capable contexts** (a lead session with the `Skill` tool): `Skill({skill: \"pr-loop-lifecycle\", args: \"--skill \u003Ccaller> \u003Copen|close> [parameters]\"})`.\n- **Fallback** (a subagent or teammate without the `Skill` tool): the caller's spawn prompt says \"Read `~\u002F.claude\u002Fskills\u002Fpr-loop-lifecycle\u002FSKILL.md` and apply the `\u003Copen|close>` section with the parameters below.\"\n\nThe caller passes its identity (fills the final-report header and scratch-file prefix), whether it runs an agent team (gates the TeamDelete step), and at close time the run's exit reason, loop count, and SHAs.\n\n## Open\n\n1. **Grant project permissions:**\n   `python \"$HOME\u002F.claude\u002F_shared\u002Fpr-loop\u002Fscripts\u002Fgrant_project_claude_permissions.py\"`\n   The script writes idempotent allow-rules and `additionalDirectories` entries into `~\u002F.claude\u002Fsettings.json` so subagents can edit the project's `.claude\u002F` tree without prompting.\n\n   **Auto-mode escalation:** in an unattended run the permission classifier can block this grant as an unrequested allowlist change. Keep the run alive — surface the exact command to the user through `AskUserQuestion` and ask them to approve it or run it themselves with the `!` prefix. Continue once the grant lands. A user who wants future runs to skip the prompt can add a standing Bash allow-rule for the script in their settings.\n\n2. **Worktree preflight:** confirm the session is isolated (the working directory path includes `.claude\u002Fworktrees\u002F`) before the first tick or round. Classify the working tree against the PR's repo with\n   `python \"$HOME\u002F.claude\u002Fskills\u002F_shared\u002Fpr-loop\u002Fscripts\u002Fpreflight_worktree.py\" --owner \u003CO> --repo \u003CR> --mode \u003Cclassify|strict>`\n   and route per the caller's cwd-routing reference (pr-converge Step 1.5 for the classify route; autoconverge pre-flight for the strict route). Capture the session worktree path before routing away — close-time steps target the session repo.\n\n## Close\n\nRun these in order from the lead session on EVERY exit — converged, cap reached, stuck, or error.\n\n1. **TeamDelete (team callers only).** Callers that created an agent team remove it with `TeamDelete`; single-agent and workflow callers skip this step.\n2. **Worktree teardown:**\n   ```bash\n   python \"$HOME\u002F.claude\u002Fskills\u002F_shared\u002Fpr-loop\u002Fscripts\u002Fteardown_worktrees.py\" \\\n     --run-temp-dir \"\u003Crun_temp_dir>\" \\\n     --all-pr-jsons '\u003Cjson array of {number, owner, repo}>'\n   ```\n   Tolerates already-removed worktrees and missing directories; removal is Windows-safe per `~\u002F.claude\u002Frules\u002Fwindows-filesystem-safe.md`.\n3. **Clean the working tree.** Return to the session worktree, remove run-scoped scratch files, and leave `git status` clean of run artifacts.\n4. **Update the PR description.** Follow [`reference\u002Fteardown-publish-permissions.md` § Publish the final PR description](reference\u002Fteardown-publish-permissions.md): capture the cumulative diff and original body, compose it against the [description guide](..\u002Fdescriptions\u002FSKILL.md#required-content), publish via `update_pull_request`, then remove the scratch files.\n5. **Revoke project permissions (always):**\n   `python \"$HOME\u002F.claude\u002F_shared\u002Fpr-loop\u002Fscripts\u002Frevoke_project_claude_permissions.py\"`\n   Non-negotiable, including on error exits: leaving the grant in place lets future sessions inherit elevated `.claude\u002F**` access without an explicit opt-in. Run revoke even when earlier close steps partially failed; log cleanup errors separately.\n6. **Final report.** Print the caller's report block verbatim — no paraphrase, no extra commentary:\n   ```\n   \u002F\u003Ccaller> exit: \u003Cconverged | cap reached | stuck | error>\n   Loops: \u003Cloop_count>\n   Starting commit: \u003Cstarting_sha7>\n   Final commit: \u003Ccurrent_HEAD_sha7>\n   ```\n   Callers append their own lines (net change, loop log, converged SHAs) per their SKILL.md.\n\n## Gotchas\n\n- **Revoke runs on the error path too.** The single most common lifecycle defect is a run that dies mid-loop and leaves the `.claude\u002F**` grant in settings.\n- **Close targets the session repo.** A cross-repo run that routed its cwd into the PR's worktree returns to the session worktree before steps 3–5; grant and revoke read the current working directory.\n- **TeamDelete fires once, at run end.** Removing the team between audit-fix iterations is a bug.\n\n## Folder map\n\n- `SKILL.md` — this file.\n- `reference\u002Fteardown-publish-permissions.md` — the full close sequence: utility-script homes, teardown, PR-description rewrite brief, revoke, report shape.\n","# PR Loop Lifecycle\n\n**Core principle:** a PR-loop run opens with an explicit, revocable permission grant and closes the same way every time — teardown, description rewrite, revoke, report — no matter how the run ended.\n\n## How callers invoke this\n\n- **Skill-capable contexts** (a lead session with the `Skill` tool): `Skill({skill: \"pr-loop-lifecycle\", args: \"--skill \u003Ccaller> \u003Copen|close> [parameters]\"})`.\n- **Fallback** (a subagent or teammate without the `Skill` tool): the caller's spawn prompt says \"Read `~\u002F.claude\u002Fskills\u002Fpr-loop-lifecycle\u002FSKILL.md` and apply the `\u003Copen|close>` section with the parameters below.\"\n\nThe caller passes its identity (fills the final-report header and scratch-file prefix), whether it runs an agent team (gates the TeamDelete step), and at close time the run's exit reason, loop count, and SHAs.\n\n## Open\n\n1. **Grant project permissions:**\n   `python \"$HOME\u002F.claude\u002F_shared\u002Fpr-loop\u002Fscripts\u002Fgrant_project_claude_permissions.py\"`\n   The script writes idempotent allow-rules and `additionalDirectories` entries into `~\u002F.claude\u002Fsettings.json` so subagents can edit the project's `.claude\u002F` tree without prompting.\n\n   **Auto-mode escalation:** in an unattended run the permission classifier can block this grant as an unrequested allowlist change. Keep the run alive — surface the exact command to the user through `AskUserQuestion` and ask them to approve it or run it themselves with the `!` prefix. Continue once the grant lands. A user who wants future runs to skip the prompt can add a standing Bash allow-rule for the script in their settings.\n\n2. **Worktree preflight:** confirm the session is isolated (the working directory path includes `.claude\u002Fworktrees\u002F`) before the first tick or round. Classify the working tree against the PR's repo with\n   `python \"$HOME\u002F.claude\u002Fskills\u002F_shared\u002Fpr-loop\u002Fscripts\u002Fpreflight_worktree.py\" --owner \u003CO> --repo \u003CR> --mode \u003Cclassify|strict>`\n   and route per the caller's cwd-routing reference (pr-converge Step 1.5 for the classify route; autoconverge pre-flight for the strict route). Capture the session worktree path before routing away — close-time steps target the session repo.\n\n## Close\n\nRun these in order from the lead session on EVERY exit — converged, cap reached, stuck, or error.\n\n1. **TeamDelete (team callers only).** Callers that created an agent team remove it with `TeamDelete`; single-agent and workflow callers skip this step.\n2. **Worktree teardown:**\n   ```bash\n   python \"$HOME\u002F.claude\u002Fskills\u002F_shared\u002Fpr-loop\u002Fscripts\u002Fteardown_worktrees.py\" \\\n     --run-temp-dir \"\u003Crun_temp_dir>\" \\\n     --all-pr-jsons '\u003Cjson array of {number, owner, repo}>'\n   ```\n   Tolerates already-removed worktrees and missing directories; removal is Windows-safe per `~\u002F.claude\u002Frules\u002Fwindows-filesystem-safe.md`.\n3. **Clean the working tree.** Return to the session worktree, remove run-scoped scratch files, and leave `git status` clean of run artifacts.\n4. **Update the PR description.** Follow [`reference\u002Fteardown-publish-permissions.md` § Publish the final PR description](reference\u002Fteardown-publish-permissions.md): capture the cumulative diff and original body, compose it against the [description guide](..\u002Fdescriptions\u002FSKILL.md#required-content), publish via `update_pull_request`, then remove the scratch files.\n5. **Revoke project permissions (always):**\n   `python \"$HOME\u002F.claude\u002F_shared\u002Fpr-loop\u002Fscripts\u002Frevoke_project_claude_permissions.py\"`\n   Non-negotiable, including on error exits: leaving the grant in place lets future sessions inherit elevated `.claude\u002F**` access without an explicit opt-in. Run revoke even when earlier close steps partially failed; log cleanup errors separately.\n6. **Final report.** Print the caller's report block verbatim — no paraphrase, no extra commentary:\n   ```\n   \u002F\u003Ccaller> exit: \u003Cconverged | cap reached | stuck | error>\n   Loops: \u003Cloop_count>\n   Starting commit: \u003Cstarting_sha7>\n   Final commit: \u003Ccurrent_HEAD_sha7>\n   ```\n   Callers append their own lines (net change, loop log, converged SHAs) per their SKILL.md.\n\n## Gotchas\n\n- **Revoke runs on the error path too.** The single most common lifecycle defect is a run that dies mid-loop and leaves the `.claude\u002F**` grant in settings.\n- **Close targets the session repo.** A cross-repo run that routed its cwd into the PR's worktree returns to the session worktree before steps 3–5; grant and revoke read the current working directory.\n- **TeamDelete fires once, at run end.** Removing the team between audit-fix iterations is a bug.\n\n## Folder map\n\n- `SKILL.md` — this file.\n- `reference\u002Fteardown-publish-permissions.md` — the full close sequence: utility-script homes, teardown, PR-description rewrite brief, revoke, report shape.\n",{"name":5,"description":7},"main","974284b42eeb4609e94d4ebc1f6e36df400d54ca","packages\u002Fclaude-dev-env\u002F.agents\u002Fskills-archived\u002Fpr-loop-lifecycle",1,"https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects","2026-11-15 05:02:47",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add jl-cmd-projects\u002Fclaude-dev-env --skill pr-loop-lifecycle",{"tool":36,"command":37},"bunx","bunx skills add jl-cmd-projects\u002Fclaude-dev-env --skill pr-loop-lifecycle",{"tool":39,"command":40},"pnpm","pnpm dlx skills add jl-cmd-projects\u002Fclaude-dev-env --skill pr-loop-lifecycle","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fpackages\u002Fclaude-dev-env\u002F.agents\u002Fskills-archived\u002Fpr-loop-lifecycle\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"reference\u002Fteardown-publish-permissions.md","REFERENCE","参考文档",5570,"https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fpackages\u002Fclaude-dev-env\u002F.agents\u002Fskills-archived\u002Fpr-loop-lifecycle\u002Freference\u002Fteardown-publish-permissions.md",[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M78FER7S09AE87MMJFT1E87E","update","Fast-forwards a local repository's main branch to a remote's main after confirming the repo path and source remote through AskUserQuestion. Use when the user says '\u002Fupdate', 'update main', 'fast-forward main', 'sync main from origin', 'pull latest main into \u003Cpath>', or 'bring main up to date'.","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fskill-archive\u002Fupdate\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M78FENWZS01MB4PMGX6801X6","source-command-sr-loop","Converging cleanup loop: repeat \u002Fsimplify until clean, then repeat \u002Fcode-review --fix until clean","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fskill-archive\u002Fsource-command-sr-loop\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M78FEGZ7JDWEG3RM78M9Y8F8","skill-builder","Skill lifecycle: classify, scaffold, write via the skill-writer-agent, self-audit, compose sub-skills, polish description triggers, enforce deterministic scripts. Triggers: build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, skill composition, description trigger catalog, deterministic skill scripts.","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fskill-archive\u002Fskill-builder\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M78FEDEYHJYKTER9S566DMEZ","session-tidy","Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '\u002Fsession-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fskill-archive\u002Fsession-tidy\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M78FE8QR789SKBF3A78N2T13","session-log","Logs a session report as an HTML page, tracks vault context, extracts decisions, and outputs a \u002Frename command. Use for \u002Fsession-log, 'journal this session', 'log this work', 'session report', 'summarize\u002Flog\u002Frecord this session', 'save session', 'capture session', or 'document what we did'.","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fskill-archive\u002Fsession-log\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M78FE4JDJHKTJPWRWNQEX2HT","run-claude-dev-env","Build, install, run, and test the claude-dev-env installer. Use when asked to run claude-dev-env, install the Claude Code config into ~\u002F.claude, drive the installer, smoke-test it against a sandbox, or run its test suite.","https:\u002F\u002Fgithub.com\u002Fjl-cmd-projects\u002Fclaude-dev-env\u002Fblob\u002Fmain\u002Fskill-archive\u002Frun-claude-dev-env\u002FSKILL.md",[],[]]