{"id":"fd83c589-a580-4734-9396-ccd8a41c654e","shortId":"fxeTRa","kind":"skill","title":"sync-submission","tagline":"Audit SSOT-to-submission drift and create journal submission manifests from canonical manuscript artifacts.","description":"# Sync Submission\n\nYou help keep the canonical manuscript and journal-specific submission packages\nfrom drifting apart. The skill treats `submission/{journal}/` as derived output\nand records whether it is current, stale, or frozen.\n\n## When to Use\n\n- Before submitting a journal package.\n- After a journal portal or Word editor changed a submission manuscript.\n- After rejection, before retargeting to another journal.\n- Before `/orchestrate --e2e` marks a project as submission-ready.\n\n## Inputs\n\n1. Project root containing `project.yaml`, or a direct canonical manuscript path.\n2. Journal short name, e.g. `chest`, `ryai`, `academic_radiology`.\n3. Optional mode:\n   - `audit`: compare existing submission against canonical source.\n   - `build`: copy canonical source into `submission/{journal}/manuscript/` and write metadata.\n   - `freeze`: mark a package as submitted/frozen.\n\n## Deterministic Script\n\n```bash\npython \"${CLAUDE_SKILL_DIR}/scripts/sync_submission.py\" audit --project-root . --journal chest\npython \"${CLAUDE_SKILL_DIR}/scripts/sync_submission.py\" build --project-root . --journal chest\npython \"${CLAUDE_SKILL_DIR}/scripts/sync_submission.py\" freeze --project-root . --journal chest --status submitted\n```\n\nFor double-blind journals, sweep author identifiers across all upload artifacts:\n\n```bash\npython \"${CLAUDE_SKILL_DIR}/scripts/blind_sweep.py\" \\\n  --registry _shared/authors/author_registry.yaml \\\n  --files submission/{journal}/supplementary/*.md submission/{journal}/cover_letter.md \\\n  --backup-dir .cache/blind_sweep_backup\n```\n\nThe registry is a project-local YAML mapping author identifiers (full names, native scripts, initials with/without periods, email, ORCID) to role labels (e.g., \"Reviewer 1\"). See `scripts/author_registry_example.yaml` for schema. Never commit a populated registry to a public repository — keep it next to the manuscript.\n\n## Output Contract\n\n| Artifact | Path | Purpose |\n|---|---|---|\n| Submission metadata | `submission/{journal}/.journal_meta.json` | Source hash, status, canonical path |\n| Sync audit | `qc/submission_sync_{journal}.json` | Drift result consumed by orchestrator |\n| Manifest update | `artifact_manifest.json` | Submission package registry |\n\n## Workflow\n\n1. Resolve canonical manuscript from `project.yaml` or explicit input.\n2. Run the script in the requested mode.\n3. If `audit` reports `DRIFT`, do not retarget or freeze until the user either\n   patches the canonical manuscript or records the difference as journal-only.\n4. If `build` succeeds, run `/verify-refs` before final submission.\n\n## Quality Gates\n\n- Gate 1: block freezing when canonical manuscript is missing.\n- Gate 2: block retargeting when the previous submission has unresolved drift.\n- Gate 3: require `/verify-refs` audit before marking a package submission-safe.\n- Gate 4: docx audits must use a recursive walk (paragraphs + tables + nested-table cells); a flat `document.paragraphs` scan is insufficient.\n- Gate 5: before freeze, confirm portal free-text fields (cover letter, data availability, acknowledgements, abstract, author contributions) match the manuscript body.\n- Gate 6 (double-blind journals): before freeze, export the portal's blinded review PDF and grep for all author identifiers across the entire upload set — manuscript, supplementary, cover letter, registry record PDFs (PROSPERO/ClinicalTrials), portal Letter-field text. A clean manuscript blind does not imply a clean portal blind.\n- Gate 7 (text-only docx rebuilds): never use `pandoc --reference-doc=manuscript.docx` for response/cover/supplementary text-only docx — the reference docx ships its embedded media (figure files) into the new docx, bloating size 50–100×. Use plain `pandoc input.md -o output.docx` for text-only artifacts.\n\n## Verification Blind Spots\n\nPost-submission learnings (npj Digital Medicine R1, 2026-05): a clean docx-level audit still missed several stale artifacts that surfaced only at the portal review stage. Apply these whenever auditing a submission package.\n\n### B1. docx scanning must be recursive\n\n`python-docx` `paragraph.runs` does not expose runs inside `<w:hyperlink>`; `document.paragraphs` skips table cells; `document.tables` does not recurse into nested tables. Figures, captions, and reporting checklists are routinely wrapped in 1×1 or nested tables, so flat scans silently miss them.\n\n- Walk `paragraphs + tables + nested-table cells` recursively for every stale-string scan.\n- For run-level edits near hyperlinks or fields, inspect the paragraph XML, not just `.runs` — a missing inline element can be misread as an empty `()` artifact and \"fixed\" into a real defect.\n\n### B2. Portal input fields are a separate SSOT\n\nCover letter, Data Availability, Acknowledgements, Abstract, and Author Contributions are often typed directly into the journal portal, outside any docx this skill audits. A clean docx audit does not imply a clean portal.\n\n- Before final submission, diff the portal's final review page against the manuscript body 1:1.\n- Treat each portal free-text field as its own drift target.\n\n### B3a. Double-blind compliance must cover ALL upload artifacts\n\nA clean manuscript-level blind sweep does not imply a clean portal-level blind. Author identifiers commonly leak through:\n\n- Supplementary materials (per-material `.md`/`.docx` files, especially methodology logs, agreement metrics, amendment logs)\n- Cover letter (separately-uploaded file is portal-default visible to reviewers unless explicitly toggled \"Don't show in review PDF\")\n- Registry record PDFs (PROSPERO, ClinicalTrials.gov, IRB approval PDFs)\n- Portal free-text Letter field if cover-letter signature was pasted\n- Response-to-reviewers (revision rounds)\n\nBlind sweep regex coverage must include both period and no-period initial forms (e.g., `Y.N.` and `YN`), full names in roman + native scripts, institution names, ORCID IDs, and submission email domains. The first blind PDF export from the portal is the authoritative drift detector — always export and grep before final submit.\n\n### B3b. PROSPERO public-record PDF shows only current amendment\n\nPROSPERO's \"Print/PDF\" export from the public record renders only the current amendment narrative. Previous versions are accessible only by selecting older versions in the public-record version-history dropdown. When citing PROSPERO version state, never rely on a single PDF export to verify cross-version consistency — record each published version's PDF independently and clarify in cover/supplementary which version anchors the methodology vs. which version reflects documentation-only erratum.\n\nFor documentation-only PROSPERO errata (correcting a narrative fact without changing methods/eligibility/synthesis), prefer a single Revision-Note append over a new structured amendment entry. Preserves historical audit trail and minimizes portal edit surface.\n\n### B3c. Text-only docx rebuilds must not inherit manuscript media\n\nIf `response_to_reviewers.docx` / `cover_letter.docx` / supplementary text-only docx grow to >100 KB after a rebuild, suspect `--reference-doc` pulling manuscript figure media. Verify with `unzip -l output.docx | grep word/media/` — should be empty for text-only artifacts.\n\n### B3. Verify change propagation across the whole SSOT tree\n\nA tone, wording, or number change applied to one file (e.g. the abstract) must propagate to every file that repeats it — discussion, response-to-reviewers quotes, reporting checklists, supplementary captions, title page.\n\n- grep the OLD string across the entire SSOT tree, never a subset of files.\n- Watch for substring near-misses (`expertise-dependent patterns` vs `expertise-dependent evaluation patterns`) — an exact-match grep on the short form passes while the long form remains stale.\n\n## What This Skill Does NOT Do\n\n- Does not invent journal formatting rules.\n- Does not silently merge submission edits back into the SSOT.\n- Does not replace `/write-paper`; it packages already canonical content.\n\n## Anti-Hallucination\n\n- Never claim a submission package is current without matching source hashes.\n- Never mark a package as submitted without writing `.journal_meta.json`.\n- Never hide journal-only differences; record them as drift or explicit exceptions.","tags":["sync","submission","medsci","skills","aperivue","agent-skills","biostatistics","claude-code","claude-skills","clinical-research","diagnostic-accuracy","irb-protocol"],"capabilities":["skill","source-aperivue","skill-sync-submission","topic-agent-skills","topic-biostatistics","topic-claude-code","topic-claude-skills","topic-clinical-research","topic-diagnostic-accuracy","topic-irb-protocol","topic-literature-review","topic-manuscript","topic-medical-ai","topic-medical-research","topic-meta-analysis"],"categories":["medsci-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/Aperivue/medsci-skills/sync-submission","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add Aperivue/medsci-skills","source_repo":"https://github.com/Aperivue/medsci-skills","install_from":"skills.sh"}},"qualityScore":"0.499","qualityRationale":"deterministic score 0.50 from registry signals: · indexed on github topic:agent-skills · 98 github stars · SKILL.md body (8,227 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:56:31.877Z","embedding":null,"createdAt":"2026-05-13T12:57:46.875Z","updatedAt":"2026-05-18T18:56:31.877Z","lastSeenAt":"2026-05-18T18:56:31.877Z","tsv":"'-05':523 '/.journal_meta.json':261 '/cover_letter.md':202 '/manuscript':127 '/orchestrate':80 '/scripts/blind_sweep.py':192 '/scripts/sync_submission.py':144,155,166 '/supplementary':198 '/verify-refs':332,361 '/write-paper':1140 '1':90,232,284,339,585,586,698,699 '100':499,999 '2':101,293,348 '2026':522 '3':110,301,359 '4':327,371 '5':392 '50':498 '6':414 '7':464 'abstract':406,656,1048 'academ':108 'access':886 'acknowledg':405,655 'across':183,434,1031,1073 'agreement':754 'alreadi':1143 'alway':852 'amend':756,868,881,967 'anchor':932 'anoth':77 'anti':1147 'anti-hallucin':1146 'apart':35 'append':962 'appli':543,1042 'approv':786 'artifact':18,186,254,510,534,636,721,1026 'artifact_manifest.json':279 'audit':4,113,145,268,303,362,373,529,546,673,677,971 'author':181,216,407,432,658,738 'authorit':849 'avail':404,654 'b1':550 'b2':643 'b3':1027 'b3a':712 'b3b':859 'b3c':978 'back':1133 'backup':204 'backup-dir':203 'bash':139,187 'blind':178,417,425,455,462,512,715,727,737,807,841 'bloat':496 'block':340,349 'bodi':412,697 'build':120,156,329 'cache/blind_sweep_backup':206 'canon':16,25,98,118,122,265,286,317,343,1144 'caption':577,1066 'cell':384,568,602 'chang':68,954,1029,1041 'checklist':580,1064 'chest':106,150,161,172 'cite':902 'claim':1150 'clarifi':927 'claud':141,152,163,189 'clean':453,460,525,675,682,723,733 'clinicaltrials.gov':784 'commit':238 'common':740 'compar':114 'complianc':716 'confirm':395 'consist':918 'consum':274 'contain':93 'content':1145 'contract':253 'contribut':408,659 'copi':121 'correct':949 'cover':401,441,651,718,758,796 'cover-lett':795 'cover/supplementary':929 'cover_letter.docx':991 'coverag':810 'creat':11 'cross':916 'cross-vers':915 'current':49,867,880,1155 'data':403,653 'default':767 'defect':642 'depend':1091,1096 'deriv':42 'detector':851 'determinist':137 'diff':687 'differ':322,1174 'digit':519 'dir':143,154,165,191,205 'direct':97,663 'discuss':1057 'doc':475,1007 'document':940,945 'document.paragraphs':387,565 'document.tables':569 'documentation-on':939,944 'docx':372,468,482,485,495,527,551,558,670,676,749,982,996 'docx-level':526 'domain':838 'doubl':177,416,714 'double-blind':176,415,713 'drift':9,34,272,305,357,710,850,1178 'dropdown':900 'e.g':105,230,821,1046 'e2e':81 'edit':614,976,1132 'editor':67 'either':314 'element':629 'email':225,837 'embed':488 'empti':635,1021 'entir':436,1075 'entri':968 'errata':948 'erratum':942 'especi':751 'evalu':1097 'everi':605,1052 'exact':1101 'exact-match':1100 'except':1181 'exist':115 'expertis':1090,1095 'expertise-depend':1089,1094 'explicit':291,772,1180 'export':421,843,853,872,912 'expos':562 'fact':952 'field':400,450,618,646,706,793 'figur':490,576,1010 'file':195,491,750,763,1045,1053,1082 'final':334,685,691,857 'first':840 'fix':638 'flat':386,591 'form':820,1107,1112 'format':1125 'free':398,704,790 'free-text':397,703,789 'freez':131,167,310,341,394,420 'frozen':52 'full':218,825 'gate':337,338,347,358,370,391,413,463 'grep':429,855,1017,1069,1103 'grow':997 'hallucin':1148 'hash':263,1159 'help':22 'hide':1170 'histor':970 'histori':899 'hyperlink':616 'id':834 'identifi':182,217,433,739 'impli':458,680,731 'includ':812 'independ':925 'inherit':986 'initi':222,819 'inlin':628 'input':89,292,645 'input.md':503 'insid':564 'inspect':619 'institut':831 'insuffici':390 'invent':1123 'irb':785 'journal':12,29,40,59,63,78,102,126,149,160,171,179,197,201,260,270,325,418,666,1124,1172 'journal-on':324,1171 'journal-specif':28 'journal_meta.json':1168 'json':271 'kb':1000 'keep':23,246 'l':1015 'label':229 'leak':741 'learn':517 'letter':402,442,449,652,759,792,797 'letter-field':448 'level':528,613,726,736 'local':213 'log':753,757 'long':1111 'manifest':14,277 'manuscript':17,26,71,99,251,287,318,344,411,439,454,696,725,987,1009 'manuscript-level':724 'manuscript.docx':476 'map':215 'mark':82,132,364,1161 'match':409,1102,1157 'materi':744,747 'md':199,748 'media':489,988,1011 'medicin':520 'merg':1130 'metadata':130,258 'methodolog':752,934 'methods/eligibility/synthesis':955 'metric':755 'minim':974 'misread':632 'miss':346,531,594,627,1088 'mode':112,300 'must':374,553,717,811,984,1049 'name':104,219,826,832 'narrat':882,951 'nativ':220,829 'near':615,1087 'near-miss':1086 'nest':382,574,588,600 'nested-t':381,599 'never':237,470,906,1078,1149,1160,1169 'new':494,965 'next':248 'no-period':816 'note':961 'npj':518 'number':1040 'o':504 'often':661 'old':1071 'older':890 'one':1044 'option':111 'orchestr':276 'orcid':226,833 'output':43,252 'output.docx':505,1016 'outsid':668 'packag':32,60,134,281,366,549,1142,1153,1163 'page':693,1068 'pandoc':472,502 'paragraph':379,597,621 'paragraph.runs':559 'pass':1108 'past':800 'patch':315 'path':100,255,266 'pattern':1092,1098 'pdf':427,779,842,864,911,924 'pdfs':445,782,787 'per':746 'per-materi':745 'period':224,814,818 'plain':501 'popul':240 'portal':64,396,423,447,461,540,644,667,683,689,702,735,766,788,846,975 'portal-default':765 'portal-level':734 'post':515 'post-submiss':514 'prefer':956 'preserv':969 'previous':353,883 'print/pdf':871 'project':84,91,147,158,169,212 'project-loc':211 'project-root':146,157,168 'project.yaml':94,289 'propag':1030,1050 'prospero':783,860,869,903,947 'prospero/clinicaltrials':446 'public':244,862,875,895 'public-record':861,894 'publish':921 'pull':1008 'purpos':256 'python':140,151,162,188,557 'python-docx':556 'qc/submission_sync_':269 'qualiti':336 'quot':1062 'r1':521 'radiolog':109 'readi':88 'real':641 'rebuild':469,983,1003 'record':45,320,444,781,863,876,896,919,1175 'recurs':377,555,572,603 'refer':474,484,1006 'reference-doc':473,1005 'reflect':938 'regex':809 'registri':193,208,241,282,443,780 'reject':73 'reli':907 'remain':1113 'render':877 'repeat':1055 'replac':1139 'report':304,579,1063 'repositori':245 'request':299 'requir':360 'resolv':285 'respons':802,1059 'response-to-review':801,1058 'response/cover/supplementary':478 'response_to_reviewers.docx':990 'result':273 'retarget':75,308,350 'review':231,426,541,692,770,778,804,1061 'revis':805,960 'revision-not':959 'role':228 'roman':828 'root':92,148,159,170 'round':806 'routin':582 'rule':1126 'run':294,331,563,612,625 'run-level':611 'ryai':107 'safe':369 'scan':388,552,592,609 'schema':236 'script':138,221,296,830 'scripts/author_registry_example.yaml':234 'see':233 'select':889 'separ':649,761 'separately-upload':760 'set':438 'sever':532 'shared/authors/author_registry.yaml':194 'ship':486 'short':103,1106 'show':776,865 'signatur':798 'silent':593,1129 'singl':910,958 'size':497 'skill':37,142,153,164,190,672,1117 'skill-sync-submission' 'skip':566 'sourc':119,123,262,1158 'source-aperivue' 'specif':30 'spot':513 'ssot':6,650,1034,1076,1136 'ssot-to-submiss':5 'stage':542 'stale':50,533,607,1114 'stale-str':606 'state':905 'status':173,264 'still':530 'string':608,1072 'structur':966 'submiss':3,8,13,20,31,39,70,87,116,125,196,200,257,259,280,335,354,368,516,548,686,836,1131,1152 'submission-readi':86 'submission-saf':367 'submit':57,174,858,1165 'submitted/frozen':136 'subset':1080 'substr':1085 'succeed':330 'supplementari':440,743,992,1065 'surfac':536,977 'suspect':1004 'sweep':180,728,808 'sync':2,19,267 'sync-submiss':1 'tabl':380,383,567,575,589,598,601 'target':711 'text':399,451,466,480,508,705,791,980,994,1024 'text-on':465,479,507,979,993,1023 'titl':1067 'toggl':773 'tone':1037 'topic-agent-skills' 'topic-biostatistics' 'topic-claude-code' 'topic-claude-skills' 'topic-clinical-research' 'topic-diagnostic-accuracy' 'topic-irb-protocol' 'topic-literature-review' 'topic-manuscript' 'topic-medical-ai' 'topic-medical-research' 'topic-meta-analysis' 'trail':972 'treat':38,700 'tree':1035,1077 'type':662 'unless':771 'unresolv':356 'unzip':1014 'updat':278 'upload':185,437,720,762 'use':55,375,471,500 'user':313 'verif':511 'verifi':914,1012,1028 'version':884,891,898,904,917,922,931,937 'version-histori':897 'visibl':768 'vs':935,1093 'walk':378,596 'watch':1083 'whenev':545 'whether':46 'whole':1033 'with/without':223 'without':953,1156,1166 'word':66,1038 'word/media':1018 'workflow':283 'wrap':583 'write':129,1167 'xml':622 'y.n':822 'yaml':214 'yn':824","prices":[{"id":"8e9eb8a5-3c1e-4636-90f4-edbe13382604","listingId":"fd83c589-a580-4734-9396-ccd8a41c654e","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"Aperivue","category":"medsci-skills","install_from":"skills.sh"},"createdAt":"2026-05-13T12:57:46.875Z"}],"sources":[{"listingId":"fd83c589-a580-4734-9396-ccd8a41c654e","source":"github","sourceId":"Aperivue/medsci-skills/sync-submission","sourceUrl":"https://github.com/Aperivue/medsci-skills/tree/main/skills/sync-submission","isPrimary":false,"firstSeenAt":"2026-05-13T12:57:46.875Z","lastSeenAt":"2026-05-18T18:56:31.877Z"}],"details":{"listingId":"fd83c589-a580-4734-9396-ccd8a41c654e","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"Aperivue","slug":"sync-submission","github":{"repo":"Aperivue/medsci-skills","stars":98,"topics":["agent-skills","biostatistics","claude-code","claude-skills","clinical-research","diagnostic-accuracy","irb-protocol","literature-review","manuscript","medical-ai","medical-research","meta-analysis","physician-researcher","prisma","pubmed","radiology","reporting-guidelines","strobe","systematic-review","tripod-ai"],"license":"other","html_url":"https://github.com/Aperivue/medsci-skills","pushed_at":"2026-05-17T20:50:52Z","description":"Claude Code skills for medical research — literature search, reporting guidelines, statistical analysis, publication figures. Built by a physician-researcher, tested on real publications. MIT licensed.","skill_md_sha":"5e379ca247b4875ca167658278ca12111999fc4b","skill_md_path":"skills/sync-submission/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/Aperivue/medsci-skills/tree/main/skills/sync-submission"},"layout":"multi","source":"github","category":"medsci-skills","frontmatter":{"name":"sync-submission","description":"Audit SSOT-to-submission drift and create journal submission manifests from canonical manuscript artifacts."},"skills_sh_url":"https://skills.sh/Aperivue/medsci-skills/sync-submission"},"updatedAt":"2026-05-18T18:56:31.877Z"}}