[{"data":1,"prerenderedAt":1604,"buildId":1605},["ShallowReactive",2],{"docs:\u002Fguide\u002Fsync":3},{"page":4,"section":16,"document":17,"credits":10,"prev":1598,"next":1600},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"sync","\u002Fguide\u002Fsync","guide\u002Fsync.md","Sync","Run the sync engine with a plan and a SyncHost, preview it with a dry run, and read the report and the state it keeps.",null,[],"i-lucide-refresh-cw","article",true,6,"guide",{"nodes":18,"toc":1585},[19,27,120,127,135,142,371,385,391,504,523,538,613,626,633,639,650,684,699,705,711,842,872,878,1075,1081,1142,1145,1151,1214,1223,1229,1266,1272,1279,1285,1296,1436,1444,1450,1456,1505,1518,1521,1575],[20,21,22,26],"p",{},[23,24,25],"code",{},"sync(places, host, options?)"," runs one sync. It fetches every source in the plan, links their skills and files into each agent's folders, merges their MCP servers and hooks into each agent's config, runs the plan's hooks, and returns a report.",[28,29,32],"pre",{"language":30,"class":31,"wrap":14},"ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[23,33,35,58,59,58,61,58,83],{"class":34},"language-ts",[36,37,40,44,48,51,55],"span",{"class":38,"style":39},"line","display: inline",[36,41,43],{"style":42},"color:#CF222E;--shiki-dark:#FF7B72","import",[36,45,47],{"style":46},"color:#1F2328;--shiki-dark:#E6EDF3"," { sync } ",[36,49,50],{"style":42},"from",[36,52,54],{"style":53},"color:#0A3069;--shiki-dark:#A5D6FF"," \"skillrc\u002Fsync\"",[36,56,57],{"style":46},";","\n",[36,60],{"class":38,"style":39},[36,62,63,66,70,73,76,80],{"class":38,"style":39},[36,64,65],{"style":42},"const",[36,67,69],{"style":68},"color:#0550AE;--shiki-dark:#79C0FF"," report",[36,71,72],{"style":42}," =",[36,74,75],{"style":42}," await",[36,77,79],{"style":78},"color:#8250DF;--shiki-dark:#D2A8FF"," sync",[36,81,82],{"style":46},"(places, host);",[36,84,85,88,91,94,97,100,103,106,109,112,115,117],{"class":38,"style":39},[36,86,87],{"style":42},"if",[36,89,90],{"style":46}," (",[36,92,93],{"style":42},"!",[36,95,96],{"style":46},"report.ok) console.",[36,98,99],{"style":78},"error",[36,101,102],{"style":46},"(report.errors.",[36,104,105],{"style":78},"join",[36,107,108],{"style":46},"(",[36,110,111],{"style":53},"\"",[36,113,114],{"style":42},"\\n",[36,116,111],{"style":53},[36,118,119],{"style":46},"));",[20,121,122,123,126],{},"skillrc doesn't read your program's config. ",[23,124,125],{},"host"," does: it loads the plan, says where each agent keeps its skills, and names the command your users run. The engine does the rest.",[128,129,134],"h2",{"id":130,"anchor":131},"the-plan",{"label":132,"icon":133},"Section titled \"The plan\"","#","The plan",[20,136,137,138,141],{},"A ",[23,139,140],{},"Plan"," is the list of sources to sync, read from your program's config. Your program parses its own format and builds one.",[28,143,144],{"language":30,"class":31,"wrap":14},[23,145,146,58,162,58,164,58,178,58,197,58,208,58,218,58,228,58,238,58,248,58,253,58,258,58,274,58,283,58,292,58,302,58,312,58,320,58,324,58,328,58,330,58,346,58,357,58,362,58,367],{"class":34},[36,147,148,150,153,156,158,160],{"class":38,"style":39},[36,149,43],{"style":42},[36,151,152],{"style":42}," type",[36,154,155],{"style":46}," { GitSource, LocalSource, Plan } ",[36,157,50],{"style":42},[36,159,54],{"style":53},[36,161,57],{"style":46},[36,163],{"class":38,"style":39},[36,165,166,168,171,173,176],{"class":38,"style":39},[36,167,65],{"style":42},[36,169,170],{"style":68}," file",[36,172,72],{"style":42},[36,174,175],{"style":53}," \"\u002Fhome\u002Fme\u002F.config\u002Fmytool\u002Fmytool.json\"",[36,177,57],{"style":46},[36,179,180,182,185,188,192,194],{"class":38,"style":39},[36,181,65],{"style":42},[36,183,184],{"style":68}," team",[36,186,187],{"style":42},":",[36,189,191],{"style":190},"color:#953800;--shiki-dark:#FFA657"," GitSource",[36,193,72],{"style":42},[36,195,196],{"style":46}," {",[36,198,199,202,205],{"class":38,"style":39},[36,200,201],{"style":46},"  kind: ",[36,203,204],{"style":53},"\"git\"",[36,206,207],{"style":46},",",[36,209,210,213,216],{"class":38,"style":39},[36,211,212],{"style":46},"  id: ",[36,214,215],{"style":53},"\"team\"",[36,217,207],{"style":46},[36,219,220,223,226],{"class":38,"style":39},[36,221,222],{"style":46},"  git: ",[36,224,225],{"style":53},"\"https:\u002F\u002Fgithub.com\u002Facme\u002Fskills.git\"",[36,227,207],{"style":46},[36,229,230,233,236],{"class":38,"style":39},[36,231,232],{"style":46},"  skills: ",[36,234,235],{"style":53},"\"skills\u002F*\"",[36,237,207],{"style":46},[36,239,240,243,246],{"class":38,"style":39},[36,241,242],{"style":46},"  update: ",[36,244,245],{"style":53},"\"auto\"",[36,247,207],{"style":46},[36,249,250],{"class":38,"style":39},[36,251,252],{"style":46},"  origin: file,",[36,254,255],{"class":38,"style":39},[36,256,257],{"style":46},"};",[36,259,260,262,265,267,270,272],{"class":38,"style":39},[36,261,65],{"style":42},[36,263,264],{"style":68}," mine",[36,266,187],{"style":42},[36,268,269],{"style":190}," LocalSource",[36,271,72],{"style":42},[36,273,196],{"style":46},[36,275,276,278,281],{"class":38,"style":39},[36,277,201],{"style":46},[36,279,280],{"style":53},"\"local\"",[36,282,207],{"style":46},[36,284,285,287,290],{"class":38,"style":39},[36,286,212],{"style":46},[36,288,289],{"style":53},"\"mine\"",[36,291,207],{"style":46},[36,293,294,297,300],{"class":38,"style":39},[36,295,296],{"style":46},"  local: ",[36,298,299],{"style":53},"\"\u002Fhome\u002Fme\u002Fskills\"",[36,301,207],{"style":46},[36,303,304,307,310],{"class":38,"style":39},[36,305,306],{"style":46},"  adopt: ",[36,308,309],{"style":68},"false",[36,311,207],{"style":46},[36,313,314,316,318],{"class":38,"style":39},[36,315,242],{"style":46},[36,317,245],{"style":53},[36,319,207],{"style":46},[36,321,322],{"class":38,"style":39},[36,323,252],{"style":46},[36,325,326],{"class":38,"style":39},[36,327,257],{"style":46},[36,329],{"class":38,"style":39},[36,331,332,334,337,339,342,344],{"class":38,"style":39},[36,333,65],{"style":42},[36,335,336],{"style":68}," plan",[36,338,187],{"style":42},[36,340,341],{"style":190}," Plan",[36,343,72],{"style":42},[36,345,196],{"style":46},[36,347,348,351,354],{"class":38,"style":39},[36,349,350],{"style":46},"  root: { file, agents: ",[36,352,353],{"style":53},"\"all\"",[36,355,356],{"style":46},", sources: [team, mine], forks: {}, hooks: [] },",[36,358,359],{"class":38,"style":39},[36,360,361],{"style":46},"  sources: [team, mine],",[36,363,364],{"class":38,"style":39},[36,365,366],{"style":46},"  warnings: [],",[36,368,369],{"class":38,"style":39},[36,370,257],{"style":46},[20,372,373,376,377,380,381,384],{},[23,374,375],{},"root"," is what the user's own file says. ",[23,378,379],{},"sources"," is every source the sync runs: the root's first, then those of any file the root extends. ",[23,382,383],{},"failed"," lists extended files that didn't load; while it is set, sources missing from the plan keep what they last linked instead of being removed.",[386,387,390],"h3",{"id":379,"anchor":388},{"label":389,"icon":133},"Section titled \"Sources\"","Sources",[392,393,394,410],"table",{},[395,396,397],"thead",{},[398,399,400,404,407],"tr",{},[401,402,403],"th",{},"Kind",[401,405,406],{},"Field",[401,408,409],{},"What it is",[411,412,413,437,454,471,490],"tbody",{},[398,414,415,421,429],{},[416,417,418],"td",{},[23,419,420],{},"git",[416,422,423,425,426],{},[23,424,420],{},", ",[23,427,428],{},"ref?",[416,430,431,432],{},"A repository skillrc keeps a copy of, fetched through the ",[433,434,436],"a",{"href":435},"\u002Fguide\u002Ffetching#the-git-cache","git cache",[398,438,439,444,451],{},[416,440,441],{},[23,442,443],{},"npm",[416,445,446,425,448],{},[23,447,443],{},[23,449,450],{},"registry?",[416,452,453],{},"A package from a registry, unpacked into the store",[398,455,456,461,465],{},[416,457,458],{},[23,459,460],{},"index",[416,462,463],{},[23,464,460],{},[416,466,467,468],{},"A site that serves ",[23,469,470],{},"\u002F.well-known\u002Fagent-skills\u002Findex.json",[398,472,473,478,487],{},[416,474,475],{},[23,476,477],{},"clone",[416,479,480,425,482,425,484],{},[23,481,420],{},[23,483,428],{},[23,485,486],{},"path",[416,488,489],{},"A repository you work in, updated by fetch and fast-forward and linked in place",[398,491,492,497,501],{},[416,493,494],{},[23,495,496],{},"local",[416,498,499],{},[23,500,496],{},[416,502,503],{},"A folder on this machine, linked in place",[20,505,506,425,508,510,511,513,514,517,518,510,520,522],{},[23,507,420],{},[23,509,443],{}," and ",[23,512,460],{}," sources are vendored: their skills are copied into ",[23,515,516],{},"\u003Cstate>\u002Fstore\u002F\u003Cid>"," and linked from there. ",[23,519,477],{},[23,521,496],{}," sources are linked where they are, so an edit shows in every agent at once.",[20,524,525,526,529,530,533,534,537],{},"Every source has an ",[23,527,528],{},"id",", an ",[23,531,532],{},"update"," mode and the ",[23,535,536],{},"origin"," file that declared it. The rest is optional:",[392,539,540,549],{},[395,541,542],{},[398,543,544,546],{},[401,545,406],{},[401,547,548],{},"What it does",[411,550,551,564,577,594],{},[398,552,553,558],{},[416,554,555],{},[23,556,557],{},"skills",[416,559,560,561],{},"A glob of skill folders inside the source, such as ",[23,562,563],{},"skills\u002F*",[398,565,566,574],{},[416,567,568,425,571],{},[23,569,570],{},"include",[23,572,573],{},"exclude",[416,575,576],{},"Skill names to keep or drop",[398,578,579,584],{},[416,580,581],{},[23,582,583],{},"files",[416,585,586,587,510,590,593],{},"Instructions, subagents, commands, ",[23,588,589],{},"mcp",[23,591,592],{},"agentHooks"," files the source gives agents, as a glob per agent id",[398,595,596,600],{},[416,597,598],{},[23,599,532],{},[416,601,602,604,605,608,609,612],{},[23,603,245],{}," applies upstream changes; ",[23,606,607],{},"\"review\""," holds them until a sync passes ",[23,610,611],{},"apply"," with this source's id",[20,614,615,616,510,618,620,621,625],{},"Only the root plan's sources may give ",[23,617,589],{},[23,619,592],{}," files, since an MCP server or a hook runs a command. See ",[433,622,624],{"href":623},"\u002Fguide\u002Fdefinitions","Definitions",".",[20,627,628,629,632],{},"Two sources with a skill of the same name: the first one wins, and the report lists the other under ",[23,630,631],{},"shadowed",". Names that differ only in case or Unicode form count as one, since macOS and Windows keep them in one folder.",[386,634,638],{"id":635,"anchor":636},"hooks-in-the-plan",{"label":637,"icon":133},"Section titled \"Hooks in the plan\"","Hooks in the plan",[20,640,641,642,645,646,649],{},"A plan hook runs a shell command after a sync changed files that match its patterns. Each pattern is ",[23,643,644],{},"\u003Csource id>:\u003Cglob>",", or ",[23,647,648],{},"*:\u003Cglob>"," for any source.",[28,651,652],{"language":30,"class":31,"wrap":14},[23,653,654],{"class":34},[36,655,656,658,661,663,666,669,672,675,678,681],{"class":38,"style":39},[36,657,65],{"style":42},[36,659,660],{"style":68}," hooks",[36,662,72],{"style":42},[36,664,665],{"style":46}," [{ name: ",[36,667,668],{"style":53},"\"reindex\"",[36,670,671],{"style":46},", run: ",[36,673,674],{"style":53},"\"mytool-index\"",[36,676,677],{"style":46},", on: [",[36,679,680],{"style":53},"\"team:skills\u002F**\"",[36,682,683],{"style":46},"] }];",[20,685,686,687,690,691,694,695,698],{},"The command gets the report as JSON on stdin, ",[23,688,689],{},"\u003CPROGRAM>_HOOK"," with the hook's name and ",[23,692,693],{},"\u003CPROGRAM>_CHANGED"," with the matched ",[23,696,697],{},"\u003Csource>:\u003Cfile>"," lines. It is stopped after 5 minutes, and a non-zero exit is an error in the report. A sync stopped before its hooks ran leaves them due, and the next sync runs them.",[128,700,704],{"id":701,"anchor":702},"the-host",{"label":703,"icon":133},"Section titled \"The host\"","The host",[20,706,707,710],{},[23,708,709],{},"SyncHost"," is everything the engine asks of your program.",[392,712,713,722],{},[395,714,715],{},[398,716,717,720],{},[401,718,719],{},"Member",[401,721,548],{},[411,723,724,746,759,769,779,789,799,809,819,832],{},[398,725,726,731],{},[416,727,728],{},[23,729,730],{},"load(ctx)",[416,732,733,734,737,738,741,742,745],{},"Reads the plan and returns ",[23,735,736],{},"{ plan, name }",". It runs inside the lock. ",[23,739,740],{},"name"," is what the report's ",[23,743,744],{},"manifest"," says. Throw to stop the sync.",[398,747,748,753],{},[416,749,750],{},[23,751,752],{},"targets(agents, signal)",[416,754,755,756],{},"The global skills folders the plan's agents read, as ",[23,757,758],{},"{ dir, agents, aliases? }",[398,760,761,766],{},[416,762,763],{},[23,764,765],{},"formerTargets(targets)",[416,767,768],{},"Folders that are no longer targets, where links made earlier may remain",[398,770,771,776],{},[416,772,773],{},[23,774,775],{},"replacementTargets?(targets)",[416,777,778],{},"For each former folder, the targets that took its place",[398,780,781,786],{},[416,782,783],{},[23,784,785],{},"kinds",[416,787,788],{},"Where each agent reads instructions, subagents, commands, MCP servers and hooks, by agent id",[398,790,791,796],{},[416,792,793],{},[23,794,795],{},"notes?(plan, state)",[416,797,798],{},"Warnings a real sync adds, such as a timer whose schedule drifted",[398,800,801,806],{},[416,802,803],{},[23,804,805],{},"hookEnv?(hook, changed)",[416,807,808],{},"More variables for a plan hook's command",[398,810,811,816],{},[416,812,813],{},[23,814,815],{},"beforeReport?(plan, signal)",[416,817,818],{},"Runs under the lock, after the hooks and before the report is saved and sent",[398,820,821,826],{},[416,822,823],{},[23,824,825],{},"command",[416,827,828,829],{},"The command messages tell the user to run, such as ",[23,830,831],{},"mytool",[398,833,834,839],{},[416,835,836],{},[23,837,838],{},"version",[416,840,841],{},"Your program's version, written into the report",[20,843,844,847,848,425,851,425,854,425,857,860,861,864,865,868,869,871],{},[23,845,846],{},"load"," gets ",[23,849,850],{},"offline",[23,852,853],{},"dryRun",[23,855,856],{},"signal",[23,858,859],{},"warnings"," to push to, ",[23,862,863],{},"only"," when one source was asked for, and ",[23,866,867],{},"cacheRoot"," in a dry run. Fetch any remote file the plan extends into ",[23,870,867],{}," then, so the real cache doesn't move.",[20,873,874,875,877],{},"Skills folders are found by the agents. An agent with no entry in ",[23,876,785],{}," still gets its skills, but no files, servers or hooks.",[28,879,880],{"language":30,"class":31,"wrap":14},[23,881,882,58,898,58,918,58,934,58,951,58,970,58,975,58,988,58,993,58,998,58,1012,58,1041,58,1046,58,1051,58,1061,58,1071],{"class":34},[36,883,884,886,889,891,894,896],{"class":38,"style":39},[36,885,65],{"style":42},[36,887,888],{"style":68}," host",[36,890,187],{"style":42},[36,892,893],{"style":190}," SyncHost",[36,895,72],{"style":42},[36,897,196],{"style":46},[36,899,900,903,906,909,912,915],{"class":38,"style":39},[36,901,902],{"style":78},"  load",[36,904,905],{"style":46},": ",[36,907,908],{"style":42},"async",[36,910,911],{"style":46}," () ",[36,913,914],{"style":42},"=>",[36,916,917],{"style":46}," ({ plan, name: file }),",[36,919,920,923,925,927,929,931],{"class":38,"style":39},[36,921,922],{"style":78},"  targets",[36,924,905],{"style":46},[36,926,908],{"style":42},[36,928,911],{"style":46},[36,930,914],{"style":42},[36,932,933],{"style":46}," [",[36,935,936,939,942,945,948],{"class":38,"style":39},[36,937,938],{"style":46},"    { dir: ",[36,940,941],{"style":53},"\"\u002Fhome\u002Fme\u002F.claude\u002Fskills\"",[36,943,944],{"style":46},", agents: [",[36,946,947],{"style":53},"\"claude-code\"",[36,949,950],{"style":46},"] },",[36,952,953,955,958,960,963,965,968],{"class":38,"style":39},[36,954,938],{"style":46},[36,956,957],{"style":53},"\"\u002Fhome\u002Fme\u002F.agents\u002Fskills\"",[36,959,944],{"style":46},[36,961,962],{"style":53},"\"codex\"",[36,964,425],{"style":46},[36,966,967],{"style":53},"\"opencode\"",[36,969,950],{"style":46},[36,971,972],{"class":38,"style":39},[36,973,974],{"style":46},"  ],",[36,976,977,980,983,985],{"class":38,"style":39},[36,978,979],{"style":78},"  formerTargets",[36,981,982],{"style":46},": () ",[36,984,914],{"style":42},[36,986,987],{"style":46}," [],",[36,989,990],{"class":38,"style":39},[36,991,992],{"style":46},"  kinds: {",[36,994,995],{"class":38,"style":39},[36,996,997],{"style":46},"    codex: {",[36,999,1000,1003,1005,1007,1010],{"class":38,"style":39},[36,1001,1002],{"style":78},"      home",[36,1004,982],{"style":46},[36,1006,914],{"style":42},[36,1008,1009],{"style":53}," \"\u002Fhome\u002Fme\u002F.codex\"",[36,1011,207],{"style":46},[36,1013,1014,1017,1020,1022,1024,1027,1030,1033,1036,1039],{"class":38,"style":39},[36,1015,1016],{"style":46},"      mcp: { ",[36,1018,1019],{"style":78},"file",[36,1021,982],{"style":46},[36,1023,914],{"style":42},[36,1025,1026],{"style":53}," \"\u002Fhome\u002Fme\u002F.codex\u002Fconfig.toml\"",[36,1028,1029],{"style":46},", format: ",[36,1031,1032],{"style":53},"\"toml\"",[36,1034,1035],{"style":46},", key: [",[36,1037,1038],{"style":53},"\"mcp_servers\"",[36,1040,950],{"style":46},[36,1042,1043],{"class":38,"style":39},[36,1044,1045],{"style":46},"    },",[36,1047,1048],{"class":38,"style":39},[36,1049,1050],{"style":46},"  },",[36,1052,1053,1056,1059],{"class":38,"style":39},[36,1054,1055],{"style":46},"  command: ",[36,1057,1058],{"style":53},"\"mytool\"",[36,1060,207],{"style":46},[36,1062,1063,1066,1069],{"class":38,"style":39},[36,1064,1065],{"style":46},"  version: ",[36,1067,1068],{"style":53},"\"1.0.0\"",[36,1070,207],{"style":46},[36,1072,1073],{"class":38,"style":39},[36,1074,257],{"style":46},[128,1076,1080],{"id":1077,"anchor":1078},"what-a-sync-does",{"label":1079,"icon":133},"Section titled \"What a sync does\"","What a sync does",[1082,1083,1084,1096,1106,1112,1115,1118,1121,1131],"ol",{},[1085,1086,1087,1088,1091,1092,1095],"li",{},"Takes the sync lock, ",[23,1089,1090],{},"\u003Cstate>\u002Fsync.lock",". Another live sync makes it throw ",[23,1093,1094],{},"LockHeldError","; a stale lock is broken and the report says why.",[1085,1097,1098,1099,1102,1103,625],{},"Calls ",[23,1100,1101],{},"host.load"," and reads ",[23,1104,1105],{},"state.json",[1085,1107,1108,1109,1111],{},"Fetches each source in order, and saves the state after each one. A sync stopped later leaves nothing in the store that ",[23,1110,1105],{}," doesn't record.",[1085,1113,1114],{},"Links each winning skill into every target folder. A folder that can't be written doesn't stop the others.",[1085,1116,1117],{},"Removes links it made in former folders, and keeps a skill there while a folder that replaced it has no usable copy.",[1085,1119,1120],{},"Links instructions, subagents and commands, then merges MCP servers and hooks into each agent's config.",[1085,1122,1123,1124,1127,1128,625],{},"Saves the state, runs the plan's hooks, calls ",[23,1125,1126],{},"beforeReport",", and writes ",[23,1129,1130],{},"\u003Cstate>\u002Flast-run.json",[1085,1132,1133,1134,1137,1138,1141],{},"Runs the plan's ",[23,1135,1136],{},"report.run"," command with the report on stdin, and posts the report to ",[23,1139,1140],{},"hub"," when the plan names one.",[20,1143,1144],{},"A whole sync is stopped after 60 minutes. The error names the step it was on.",[128,1146,1150],{"id":1147,"anchor":1148},"options",{"label":1149,"icon":133},"Section titled \"Options\"","Options",[392,1152,1153,1162],{},[395,1154,1155],{},[398,1156,1157,1160],{},[401,1158,1159],{},"Option",[401,1161,548],{},[411,1163,1164,1173,1182,1191,1204],{},[398,1165,1166,1170],{},[416,1167,1168],{},[23,1169,853],{},[416,1171,1172],{},"Reports what the sync would do and writes nothing",[398,1174,1175,1179],{},[416,1176,1177],{},[23,1178,850],{},[416,1180,1181],{},"Fetches nothing and syncs from what is on disk",[398,1183,1184,1188],{},[416,1185,1186],{},[23,1187,863],{},[416,1189,1190],{},"Fetches only this source; the others link from disk",[398,1192,1193,1197],{},[416,1194,1195],{},[23,1196,611],{},[416,1198,1199,1200,1203],{},"Applies the held updates of this ",[23,1201,1202],{},"review"," source",[398,1205,1206,1211],{},[416,1207,1208],{},[23,1209,1210],{},"copy",[416,1212,1213],{},"Copies skills into agents' folders instead of linking them",[20,1215,1216,1218,1219,1222],{},[23,1217,1210],{}," is for agents that skip a skill whose ",[23,1220,1221],{},"SKILL.md"," is a symlink. Codex and Cursor do. A copy that someone edits counts as an edit of the skill: the next sync moves the change back to where the skill came from.",[128,1224,1228],{"id":1225,"anchor":1226},"dry-run",{"label":1227,"icon":133},"Section titled \"Dry run\"","Dry run",[28,1230,1231],{"language":30,"class":31,"wrap":14},[23,1232,1233,58,1255],{"class":34},[36,1234,1235,1237,1240,1242,1244,1246,1249,1252],{"class":38,"style":39},[36,1236,65],{"style":42},[36,1238,1239],{"style":68}," preview",[36,1241,72],{"style":42},[36,1243,75],{"style":42},[36,1245,79],{"style":78},[36,1247,1248],{"style":46},"(places, host, { dryRun: ",[36,1250,1251],{"style":68},"true",[36,1253,1254],{"style":46}," });",[36,1256,1257,1260,1263],{"class":38,"style":39},[36,1258,1259],{"style":46},"console.",[36,1261,1262],{"style":78},"log",[36,1264,1265],{"style":46},"(preview.skills.added, preview.skills.removed);",[20,1267,1268,1269,1271],{},"A dry run takes no lock and writes nothing outside a scratch folder. It fetches into a temporary cache, so the real cache never moves past what was synced. With ",[23,1270,850],{}," too, it reads the real cache instead, since a scratch one would be empty.",[20,1273,1274,1275,1278],{},"It fails where the real run would. A source that can't be fetched is an error in both. Where the preview can't model a change in full, such as an edited copy that a real sync would move back first, ",[23,1276,1277],{},"previewLimitations"," in the report says so.",[128,1280,1284],{"id":1281,"anchor":1282},"the-report",{"label":1283,"icon":133},"Section titled \"The report\"","The report",[20,1286,1287,1289,1290,1293,1294,625],{},[23,1288,5],{}," returns a ",[23,1291,1292],{},"Report",", and a real sync also writes it to ",[23,1295,1130],{},[392,1297,1298,1307],{},[395,1299,1300],{},[398,1301,1302,1304],{},[401,1303,406],{},[401,1305,1306],{},"What it holds",[411,1308,1309,1319,1350,1373,1382,1392,1402,1414,1424],{},[398,1310,1311,1316],{},[416,1312,1313],{},[23,1314,1315],{},"ok",[416,1317,1318],{},"No errors",[398,1320,1321,1325],{},[416,1322,1323],{},[23,1324,379],{},[416,1326,1327,1328,905,1331,425,1334,425,1337,425,1340,425,1343,425,1345,1347,1348],{},"Each source's ",[23,1329,1330],{},"status",[23,1332,1333],{},"installed",[23,1335,1336],{},"updated",[23,1338,1339],{},"unchanged",[23,1341,1342],{},"held",[23,1344,1202],{},[23,1346,99],{}," or ",[23,1349,850],{},[398,1351,1352,1356],{},[416,1353,1354],{},[23,1355,557],{},[416,1357,1358,425,1361,1364,1365,425,1368,510,1371],{},[23,1359,1360],{},"total",[23,1362,1363],{},"names",", and what was ",[23,1366,1367],{},"added",[23,1369,1370],{},"removed",[23,1372,1336],{},[398,1374,1375,1379],{},[416,1376,1377],{},[23,1378,583],{},[416,1380,1381],{},"Files linked into agents' folders, and those left alone because a person made them",[398,1383,1384,1389],{},[416,1385,1386],{},[23,1387,1388],{},"entries",[416,1390,1391],{},"MCP servers and hooks merged, held because someone edited them, or skipped because the file was locked",[398,1393,1394,1399],{},[416,1395,1396],{},[23,1397,1398],{},"pending",[416,1400,1401],{},"Updates not applied: waiting for review, held for a local edit, or made to a skill you forked",[398,1403,1404,1411],{},[416,1405,1406,425,1408],{},[23,1407,631],{},[23,1409,1410],{},"renamed",[416,1412,1413],{},"Skills a former source still had, and skills renamed upstream in case only",[398,1415,1416,1421],{},[416,1417,1418],{},[23,1419,1420],{},"hooks",[416,1422,1423],{},"Each plan hook that ran, its exit code and the end of its output",[398,1425,1426,1433],{},[416,1427,1428,425,1430],{},[23,1429,859],{},[23,1431,1432],{},"errors",[416,1434,1435],{},"What to tell the user",[20,1437,1438,1440,1441,1443],{},[23,1439,1432],{}," means something was not synced. ",[23,1442,859],{}," means it was, with something to know.",[128,1445,1449],{"id":1446,"anchor":1447},"state",{"label":1448,"icon":133},"Section titled \"State\"","State",[20,1451,1452,1455],{},[23,1453,1454],{},"\u003Cstate>\u002Fstate.json"," records what each source last installed: its commit or version, each skill's hashes, the links and the config entries skillrc owns. It is how a sync tells an upstream change from a local edit, and which config entries are its own to change.",[28,1457,1458],{"language":30,"class":31,"wrap":14},[23,1459,1460,58,1473,58,1475,58,1490],{"class":34},[36,1461,1462,1464,1467,1469,1471],{"class":38,"style":39},[36,1463,43],{"style":42},[36,1465,1466],{"style":46}," { loadState, saveState } ",[36,1468,50],{"style":42},[36,1470,54],{"style":53},[36,1472,57],{"style":46},[36,1474],{"class":38,"style":39},[36,1476,1477,1479,1482,1484,1487],{"class":38,"style":39},[36,1478,65],{"style":42},[36,1480,1481],{"style":68}," state",[36,1483,72],{"style":42},[36,1485,1486],{"style":78}," loadState",[36,1488,1489],{"style":46},"(places);",[36,1491,1492,1494,1496,1499,1502],{"class":38,"style":39},[36,1493,1259],{"style":46},[36,1495,1262],{"style":78},[36,1497,1498],{"style":46},"(Object.",[36,1500,1501],{"style":78},"keys",[36,1503,1504],{"style":46},"(state.skills));",[20,1506,137,1507,1509,1510,1513,1514,1517],{},[23,1508,1105],{}," that doesn't parse, or that another version wrote, reads as empty. A sync then rebuilds what it can from the store, and treats vendored copies it can't vouch for as edited, so nothing local is overwritten. With ",[23,1511,1512],{},"backupInvalid",", the old file is copied to ",[23,1515,1516],{},"\u003Cstate>\u002Fbackup"," first.",[20,1519,1520],{},"Commands that change the state between syncs, such as a fork or a merge, run under the same lock:",[28,1522,1523],{"language":30,"class":31,"wrap":14},[23,1524,1525,58,1538,58,1540,58,1564,58,1570],{"class":34},[36,1526,1527,1529,1532,1534,1536],{"class":38,"style":39},[36,1528,43],{"style":42},[36,1530,1531],{"style":46}," { withSyncLock } ",[36,1533,50],{"style":42},[36,1535,54],{"style":53},[36,1537,57],{"style":46},[36,1539],{"class":38,"style":39},[36,1541,1542,1545,1548,1551,1554,1556,1558,1560,1562],{"class":38,"style":39},[36,1543,1544],{"style":42},"await",[36,1546,1547],{"style":78}," withSyncLock",[36,1549,1550],{"style":46},"(places, ",[36,1552,1553],{"style":53},"\"merge\"",[36,1555,425],{"style":46},[36,1557,908],{"style":42},[36,1559,911],{"style":46},[36,1561,914],{"style":42},[36,1563,196],{"style":46},[36,1565,1566],{"class":38,"style":39},[36,1567,1569],{"style":1568},"color:#6E7781;--shiki-dark:#8B949E","  \u002F\u002F read state.json, change it, save it",[36,1571,1572],{"class":38,"style":39},[36,1573,1574],{"style":46},"});",[20,1576,1577,1580,1581,1584],{},[23,1578,1579],{},"withSyncLock"," waits up to 10 seconds for a running sync, then throws a ",[23,1582,1583],{},"UserError"," that says to try again. A sync that the command runs inside it shares the lock.",[1586,1592,1593,1594,1595,1596,1597],{"id":130,"depth":1587,"text":134,"children":1588},2,[1589,1591],{"id":379,"depth":1590,"text":390},3,{"id":635,"depth":1590,"text":638},{"id":701,"depth":1587,"text":704},{"id":1077,"depth":1587,"text":1080},{"id":1147,"depth":1587,"text":1150},{"id":1225,"depth":1587,"text":1228},{"id":1281,"depth":1587,"text":1284},{"id":1446,"depth":1587,"text":1449},{"path":623,"title":624,"description":1599},"Write MCP servers once and get each agent's own config entry, and check hook files against the format each agent reads.",{"path":1601,"title":1602,"description":1603},"\u002Fguide\u002Fagents","Coding agents","Tell coding agents how your program syncs, and let them test a sync without touching the machine's agents.",1796390516663,"74c0e290-bf28-4a8a-b311-db0be1c3af18"]