[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DAMKY7J8EW72T6CVZKY1TE":3,"skill-same:01M7DAMKY7J8EW72T6CVZKY1TE":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7DAMKY7J8EW72T6CVZKY1TE","code-sync",null,"Classify open pull requests as up to date, behind, conflicting or base moved, and bring the ones that are behind main up to date with a signed rebase, the gates and a leased push, marking each PR draft meanwhile. Use when main advanced and open PRs may need a rebase, or before merging one. Not for restacking a stack of parts (see \u002Fcode-restack), for applying a Writer's patches (see \u002Fcode-integrate), or for creating or editing PRs.","LNSD\u002Florecraft","LNSD","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3949095?v=4","01M7DAK7ETP75C8S8PT783SWSP","Lorenzo Delgado","01M7DAK7FBVXE30743ZG437MTN",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-sync\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: code-sync\ndescription: Classify open pull requests as up to date, behind, conflicting or base moved, and bring the ones that are behind main up to date with a signed rebase, the gates and a leased push, marking each PR draft meanwhile. Use when main advanced and open PRs may need a rebase, or before merging one. Not for restacking a stack of parts (see \u002Fcode-restack), for applying a Writer's patches (see \u002Fcode-integrate), or for creating or editing PRs.\ncompatibility: Requires python3, git with commit signing configured, gh authenticated for the repository, and just with the repository's gate recipes. Imports gitflow.py from the code-integrate skill, so that skill must sit next to this one. Pushing needs a remote named origin.\nallowed-tools: Bash(python3 .agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py *) Bash(python3 *\u002F.agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py *)\n---\n\n# Code Sync\n\nOne command that tells which open pull requests are behind their base, and with `--apply` brings them up to date.\nIt prints ONE compact JSON result and writes the raw git, `gh` and gate output to a log file, named in the result\nas `log`; read the log only when the result says something failed.\n\n## When to Use\n\n- `main` advanced and open pull requests may be behind it.\n- A pull request is about to be merged and must sit on the current `main`.\n\nThe script never resolves a conflict, never pushes an unsigned commit, never uses plain `--force`, never merges or\ncloses a pull request and never runs `gh pr update-branch`. Creating and editing pull requests stays with the Lead;\nthe only change it makes to one is the draft\u002Fready toggle.\n\n## Command\n\nRun on a clean working tree. `--repo` names the repository and defaults to the current directory, so the call\nneeds no `cd`.\n\n```bash\npython3 \u003Crepo>\u002F.agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py --repo \u003Crepo> [--apply] \u003Cpr> [\u003Cpr> ...]\n```\n\n| Argument | Meaning |\n|---|---|\n| `--repo` | The repository to work in; default the current directory |\n| `\u003Cpr>...` | The pull request numbers |\n| `--apply` | Run the fast lane on each pull request that is `behind`; without it the script only classifies |\n\nIt fetches, then classifies each pull request from its `origin\u002F\u003Chead>` and `origin\u002F\u003Cbase>`:\n\n| Status | Meaning |\n|---|---|\n| `up_to_date` | The base is already in the branch |\n| `behind` | The base is `main`, moved, and the branch rebases onto it cleanly |\n| `conflicting` | The base is `main`, moved, and the rebase would conflict |\n| `base_moved` | The base is another branch of a stack; use \u002Fcode-restack |\n\nThe fast lane for a `behind` pull request: mark it draft, `git rebase -S origin\u002Fmain` on a detached HEAD, run the\ngates `fmt-check`, `check`, `typecheck`, `test` and `check-docs` (stopping at the first failure), check that every\ncommit is signed (`%G?` is `G`), push the rebased commit with a lease pinned to the branch's remote SHA from before\nthe rebase, move the local branch, and mark the pull request ready. A pull request that was already a draft is not\ntouched and stays one; only one this run drafted is marked ready again. A failure leaves the remote branch\nuntouched, and the pull request a draft. A rejected push is such a failure: the entry is `refused` with the\n`reason`, and carries `\"drafted\":true` when this run drafted the pull request and did not mark it ready again. A\nlocal branch that another worktree has checked out is not moved, since git refuses to, and its entry carries\n`\"local_not_moved\":true`; the sync is still `synced`. When `gh pr ready` fails after the push, the entry stays\n`synced` and carries `\"ready\":false`; when `--undo` fails the run refuses before the rebase. The caller's branch is\nrestored at the end.\n\nIt refuses when `--repo` is not a git repository, when the tree is not clean, when a pull request is not open or its\nbranches do not exist, when a commit is unsigned and when a push is rejected.\n\n## Result\n\n```json\n{\"status\":\"ok\",\"prs\":[{\"pr\":7,\"branch\":\"lnsd\u002Fx\",\"draft\":false,\"old_sha\":\"…\",\"new_sha\":\"…\",\"gates\":{\"fmt-check\":\"pass\"},\"push\":\"lease\",\"status\":\"synced\"}],\"log\":\"…\"}\n```\n\n- The top-level `status` is `ok`, `needs_rebase` (a pull request is `conflicting` or `base_moved`), `gates_failed`\n  or `refused`; `refused` carries a `reason`.\n- Each entry's `status` is one of the classifications above, or `synced` after `--apply`.\n\n## Exit codes\n\n| Code | Meaning | What the caller does |\n|---|---|---|\n| 0 | Every pull request is up to date or synced | Continue |\n| 1 | A gate failed after the rebase | Read the log, send the failure back as a FIX |\n| 2 | A pull request is `conflicting` or `base_moved` | Ask the Writer for a `REBASE`, or run \u002Fcode-restack |\n| 3 | Refused or a command failed | Read `reason`; fix the setup, do not work around it |\n","# Code Sync\n\nOne command that tells which open pull requests are behind their base, and with `--apply` brings them up to date.\nIt prints ONE compact JSON result and writes the raw git, `gh` and gate output to a log file, named in the result\nas `log`; read the log only when the result says something failed.\n\n## When to Use\n\n- `main` advanced and open pull requests may be behind it.\n- A pull request is about to be merged and must sit on the current `main`.\n\nThe script never resolves a conflict, never pushes an unsigned commit, never uses plain `--force`, never merges or\ncloses a pull request and never runs `gh pr update-branch`. Creating and editing pull requests stays with the Lead;\nthe only change it makes to one is the draft\u002Fready toggle.\n\n## Command\n\nRun on a clean working tree. `--repo` names the repository and defaults to the current directory, so the call\nneeds no `cd`.\n\n```bash\npython3 \u003Crepo>\u002F.agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py --repo \u003Crepo> [--apply] \u003Cpr> [\u003Cpr> ...]\n```\n\n| Argument | Meaning |\n|---|---|\n| `--repo` | The repository to work in; default the current directory |\n| `\u003Cpr>...` | The pull request numbers |\n| `--apply` | Run the fast lane on each pull request that is `behind`; without it the script only classifies |\n\nIt fetches, then classifies each pull request from its `origin\u002F\u003Chead>` and `origin\u002F\u003Cbase>`:\n\n| Status | Meaning |\n|---|---|\n| `up_to_date` | The base is already in the branch |\n| `behind` | The base is `main`, moved, and the branch rebases onto it cleanly |\n| `conflicting` | The base is `main`, moved, and the rebase would conflict |\n| `base_moved` | The base is another branch of a stack; use \u002Fcode-restack |\n\nThe fast lane for a `behind` pull request: mark it draft, `git rebase -S origin\u002Fmain` on a detached HEAD, run the\ngates `fmt-check`, `check`, `typecheck`, `test` and `check-docs` (stopping at the first failure), check that every\ncommit is signed (`%G?` is `G`), push the rebased commit with a lease pinned to the branch's remote SHA from before\nthe rebase, move the local branch, and mark the pull request ready. A pull request that was already a draft is not\ntouched and stays one; only one this run drafted is marked ready again. A failure leaves the remote branch\nuntouched, and the pull request a draft. A rejected push is such a failure: the entry is `refused` with the\n`reason`, and carries `\"drafted\":true` when this run drafted the pull request and did not mark it ready again. A\nlocal branch that another worktree has checked out is not moved, since git refuses to, and its entry carries\n`\"local_not_moved\":true`; the sync is still `synced`. When `gh pr ready` fails after the push, the entry stays\n`synced` and carries `\"ready\":false`; when `--undo` fails the run refuses before the rebase. The caller's branch is\nrestored at the end.\n\nIt refuses when `--repo` is not a git repository, when the tree is not clean, when a pull request is not open or its\nbranches do not exist, when a commit is unsigned and when a push is rejected.\n\n## Result\n\n```json\n{\"status\":\"ok\",\"prs\":[{\"pr\":7,\"branch\":\"lnsd\u002Fx\",\"draft\":false,\"old_sha\":\"…\",\"new_sha\":\"…\",\"gates\":{\"fmt-check\":\"pass\"},\"push\":\"lease\",\"status\":\"synced\"}],\"log\":\"…\"}\n```\n\n- The top-level `status` is `ok`, `needs_rebase` (a pull request is `conflicting` or `base_moved`), `gates_failed`\n  or `refused`; `refused` carries a `reason`.\n- Each entry's `status` is one of the classifications above, or `synced` after `--apply`.\n\n## Exit codes\n\n| Code | Meaning | What the caller does |\n|---|---|---|\n| 0 | Every pull request is up to date or synced | Continue |\n| 1 | A gate failed after the rebase | Read the log, send the failure back as a FIX |\n| 2 | A pull request is `conflicting` or `base_moved` | Ask the Writer for a `REBASE`, or run \u002Fcode-restack |\n| 3 | Refused or a command failed | Read `reason`; fix the setup, do not work around it |\n",{"name":5,"description":7,"allowed-tools":24,"compatibility":25},"Bash(python3 .agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py *) Bash(python3 *\u002F.agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py *)","Requires python3, git with commit signing configured, gh authenticated for the repository, and just with the repository's gate recipes. Imports gitflow.py from the code-integrate skill, so that skill must sit next to this one. Pushing needs a remote named origin.","main","d2f3a5835a8673ccf134ae62f0a5e84104ff7098",".agents\u002Fskills\u002Fcode-sync",1,"https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft","https:\u002F\u002Fgithub.com\u002FLNSD","2026-11-10 04:14:00",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add LNSD\u002Florecraft --skill code-sync",{"tool":39,"command":40},"bunx","bunx skills add LNSD\u002Florecraft --skill code-sync",{"tool":42,"command":43},"pnpm","pnpm dlx skills add LNSD\u002Florecraft --skill code-sync","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-sync\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Fsync.py","SCRIPT","脚本",11920,"https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-sync\u002Fscripts\u002Fsync.py",[54,61,66,71,76,81],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7DASA0R4R68AVTZJFJJBYDB","review","Review a change. Use when asked to review.","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC504\u002Ftrigger\u002Freference-link-to-parent-skill-file\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":62,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7DAS1YXJQ8FGABR8BGX9FAT","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC504\u002Fnear_miss\u002Fclimb-that-stays-inside-and-document-climb\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":67,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7DAS0TCKQFF2YJ5VY9SWHV2","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC503\u002Ftrigger\u002Fskill-reference-link-read-from-skill-root\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":72,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7DARZNA9QGXHAY17142R8YT","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC503\u002Fnear_miss\u002Fskill-link-climbing-above-skill-root\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":77,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7DARYHB7WBR44AJXFJSZQ7X","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC502\u002Ftrigger\u002Fskill-fragment-in-file-without-headings\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":82,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DARXCTFKMH92FHVV8H30MM","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC501\u002Ftrigger\u002Fskill-link-starting-with-slash\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[]]