[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75SVR5BQFH3MM78FWR8V10V":3,"skill-same:01M75SVR5BQFH3MM78FWR8V10V":84},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M75SVR5BQFH3MM78FWR8V10V","pr-triage-automove",null,"ZyntroAI\u002Ffastapi-python-boilerplate","ZyntroAI","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F312382677?v=4","01M75SQSYX5NMYH6AGGAS67D2B","Zyntro​ Media","01M75SQSZHW30DBXDX3TAYJ92F",1,"MIT","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"# 🧹 Skill: PR Triage Automove\n\n**ย้ายไฟล์ที่อยู่ผิดที่ตอน PR triage — โดยที่แอป FastAPI ต้องบูตได้เสมอ**\n\nA safeguard layer that runs *before* reviewers spend time on a cluttered PR. It\nclassifies root-level files, moves only the ones nothing depends on, and proves\nthe app still imports — or rolls the move back and says so.\n\nThis is the automated, CI-side form of `skills\u002Forganize-misplaced-files\u002F`: same\nthree-condition gate, wrapped in a probe that makes it safe to run unattended.\n\n---\n\n## Why it exists\n\nA repo root collects things. Workflow copies pulled in by mistake, exports,\nfonts, saved HTML, one-off scripts. Reviewers can't tell the real tree from the\nnoise, and a cleanup PR is exactly where a needed config gets moved by accident.\n\nThe failure that motivates the import probe: `app\u002Fservices\u002F__init__.py` importing\na class that did not exist stopped the entire app from booting, and nothing in CI\nnoticed because the tests never got that far. A cleanup tool that cannot detect\nthat is worse than no tool.\n\n---\n\n## The gate — a file moves only when all three hold\n\n| # | Condition | How it is checked |\n| - | --------- | ----------------- |\n| 1 | Not a canonical repo file or entrypoint | allow-list in `config.py` (`README.md`, `requirements.txt`, `main.py`, …) |\n| 2 | No tracked `.py` imports it as a module | **AST parse**, top-level module name — never grep |\n| 3 | Its name appears in no other tracked file | text scan of `.md`, `.yml`, `.yaml`, `.json`, `.toml`, `Makefile`, `Dockerfile*`, … |\n\nCondition 2 is the one that needs parsing. Python 3 uses absolute imports, so\n`import auth` inside `app\u002Fapi\u002Fauth.py` resolves to *top-level* `auth` — root\n`auth.py` — even though a sibling file of the same name exists next to it. Only\nthe import graph tells those apart. A file that fails to parse is reported\n(`unparseable_py`) rather than silently treated as unused.\n\nCondition 3 is what parks a root `deployment.yaml` named by\n`k8s\u002Fkustomization.yaml`, or a `Plan` file named by `ROADMAP.md`. Those look like\nclutter and are not.\n\n---\n\n## The import probe — what makes it safe unattended\n\n```\nclassify  →  probe (before)  →  git mv  →  probe (after)  →  regression?\n                                                              ├─ none  → keep\n                                                              └─ found → roll back everything\n```\n\nThe probe imports each entrypoint in a **child process** and records\n`status:signature` — so a poisoned import cannot kill the triage run itself.\n\nRegression rules, each earned in practice:\n\n- **A FAIL that was already a FAIL is not a regression.** Most repos have\n  something that does not import. Blocking on pre-existing breakage would make\n  the skill unusable exactly where it is most needed. This is how your damage\n  gets told apart from what was already broken.\n- **UNKNOWN is never a regression.** It means the probe could not run — an\n  environment fact, not evidence about the move.\n- **FAIL → OK is a fix, not a regression.** Only a drop in rank blocks.\n\nEntrypoints are discovered from how the repo is actually run — `uvicorn x:app`,\n`gunicorn`, Vercel's `\"module\"`, plus `main` \u002F `app.main` when present.\n\n---\n\n## Usage\n\n```bash\n# dry-run — prints the plan, touches nothing (this is the default)\npython skills\u002Fpr-triage-automove\u002Fautomove.py --repo .\n\n# write the PR comment body\npython skills\u002Fpr-triage-automove\u002Fautomove.py --repo . --comment comment.md\n\n# actually move, with rollback on regression\npython skills\u002Fpr-triage-automove\u002Fautomove.py --repo . --apply\n\n# a back-dated archive folder\npython skills\u002Fpr-triage-automove\u002Fautomove.py --repo . --apply --stamp 2026-09\n```\n\nExit codes: `0` fine · `2` a regression was found and the move rolled back.\n\nProgrammatic:\n\n```python\nfrom pr_triage_automove import automove\nreport = automove.run(repo, apply=False)       # dry-run dict\nprint(automove.render_comment(report))         # the PR body\n```\n\n---\n\n## Configuration\n\nDrop a `.pr-triage-automove.json` at the repo root; it merges over the defaults:\n\n```json\n{\n  \"canonical\": [\"README.md\", \"requirements.txt\", \"main.py\", \"my-custom-config.toml\"],\n  \"probe_targets\": [\"app.main\", \"main\"],\n  \"archive_dir\": \"archive\u002Froot-2026-09\",\n  \"max_move\": 200\n}\n```\n\n| Key | Default | Meaning |\n| --- | ------- | ------- |\n| `canonical` | built-in list | files that are never candidates |\n| `probe_targets` | `[]` → auto-detect | entrypoints to import-check |\n| `archive_dir` | `archive\u002Froot-\u003CYYYY-MM>` | destination root |\n| `max_move` | `500` | refuse to move more than this in one run |\n| `reference_suffixes` | built-in list | file types scanned for references |\n| `archive_layout` | built-in map | suffix → subfolder |\n\nMalformed JSON falls back to defaults rather than erroring — a broken config\nfile must not be able to disable the safety gate.\n\n---\n\n## CI integration\n\nThe workflow lives at `examples\u002Fpr-triage-automove.yml` in this folder, not in\n`.github\u002Fworkflows\u002F`, on purpose: pushing there needs the `workflows` permission,\nwhich automation tokens often lack. Copy it in with elevated rights when you are\nready.\n\nIt is **report-only by default** — the job prints the diff comment and fails\nnothing. Auto-moving in CI (adding `--apply` and committing the result back) is a\ndeliberate opt-in, because a bot that relocates files on every PR is a policy\ndecision, not a lint rule.\n\nTwo safety properties the workflow relies on:\n\n- the job runs with `permissions: contents: read, pull-requests: write` — the\n  move is computed, never pushed by default;\n- `--report` and `--comment` are written as artifacts even when the run fails, so\n  the evidence survives a red job.\n\n---\n\n## Layout\n\n```\nskills\u002Fpr-triage-automove\u002F\n├── SKILL.md                 # this file\n├── __init__.py              # package exports\n├── config.py                # canonical list, layout, overlay loading\n├── classify.py              # AST classification + reference scan\n├── probe.py                 # import-health probe + regression rules\n├── automove.py              # orchestrator + rollback + comment rendering\n├── examples\u002F\n│   └── pr-triage-automove.yml\n└── tests\u002F\n    ├── conftest.py          # imports the hyphenated dir as a package\n    ├── test_automove.py     # end-to-end against throwaway git repos\n    └── test_unit.py         # pure decision logic\n```\n\n```bash\npython -m pytest skills\u002Fpr-triage-automove\u002Ftests -q\n```\n\n---\n\n## Gotchas\n\n- **`git mv`, never `mv`.** History and rename detection in the PR diff depend\n  on it. For a path starting with `-`, terminate options: `git mv -- \"- x.txt\" dest\u002F`.\n- **Nothing is ever deleted.** A bot that deletes files during triage is a worse\n  problem than a cluttered root. Everything lands in `archive\u002F`.\n- **Basename matching must be exact-enough.** A root file named `Plan` is matched\n  as `Plan`; the scan errs toward *holding* a file, which costs a human glance,\n  versus moving something needed, which costs a broken build.\n- **The probe is per-repo-configurable.** If your entrypoint is not in\n  `Dockerfile` \u002F `vercel.json` \u002F `Makefile`, set `probe_targets` — auto-detection\n  cannot guess a custom runner.\n- **Re-verify after writing.** Some environments reset files mid-task; confirm a\n  config or file edit landed before running the tool.\n",{},"main","c68ea5db21e36ef3f01986f87cf40276e64c2e9b","skills\u002Fpr-triage-automove",0,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate","https:\u002F\u002Fzyntroai.github.io\u002Ffastapi-python-boilerplate\u002F","https:\u002F\u002Fgithub.com\u002FZyntroAI","2026-11-02 02:14:54",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add ZyntroAI\u002Ffastapi-python-boilerplate --skill pr-triage-automove",{"tool":36,"command":37},"bunx","bunx skills add ZyntroAI\u002Ffastapi-python-boilerplate --skill pr-triage-automove",{"tool":39,"command":40},"pnpm","pnpm dlx skills add ZyntroAI\u002Ffastapi-python-boilerplate --skill pr-triage-automove","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002FSKILL.md",true,[44,50,54,58,62,68,72,76,80],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"__init__.py","SCRIPT","脚本",488,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002F__init__.py",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"automove.py",7935,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Fautomove.py",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"classify.py",4115,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Fclassify.py",{"path":59,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":60,"sourceHtmlUrl":61},"config.py",2930,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Fconfig.py",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"examples\u002Fpr-triage-automove.yml","REFERENCE","参考文档",5689,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Fexamples\u002Fpr-triage-automove.yml",{"path":69,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":70,"sourceHtmlUrl":71},"probe.py",5871,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Fprobe.py",{"path":73,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":74,"sourceHtmlUrl":75},"tests\u002Fconftest.py",1007,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Ftests\u002Fconftest.py",{"path":77,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":78,"sourceHtmlUrl":79},"tests\u002Ftest_automove.py",14276,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Ftests\u002Ftest_automove.py",{"path":81,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":82,"sourceHtmlUrl":83},"tests\u002Ftest_unit.py",4731,"https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpr-triage-automove\u002Ftests\u002Ftest_unit.py",[85,91,98,104,110,117],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M75SVXD72XFZWSX20BSWW622","workflow_dispatch","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow_dispatch\u002FSkill.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M75SVVF3FBTNHKFWAF8H6ZD2","research","Multi-source research & knowledge synthesis with cross-validation, provenance graph, confidence score","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M75SVPAMK09RRZ56SPVRPJ2K","patch","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fpatch\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M75SVKCB0EMDSY2Q76BGNNH5","git-patch-merge","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fgit-patch-merge\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":18},"01M75SVH67JHCKQ632D6HE5ZHZ","fetching","Low-level async HTTP\u002FGraphQL fetch — SSRF-safe, retry, cache, provenance","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Ffetching\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":18},"01M75SVERZKVWCJG2Q00MJ1GFN","Central Credential Management","https:\u002F\u002Fgithub.com\u002FZyntroAI\u002Ffastapi-python-boilerplate\u002Fblob\u002Fmain\u002Fskills\u002Fcredential-management\u002FSKILL.md",[],[]]