qiongli 0.9.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (506) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/bin/qiongli.mjs +4 -0
  4. package/lib/args.mjs +67 -0
  5. package/lib/cli.mjs +112 -0
  6. package/lib/installer.mjs +228 -0
  7. package/lib/package-root.mjs +6 -0
  8. package/lib/python-runtime.mjs +77 -0
  9. package/package.json +33 -0
  10. package/payload/qiongli-workflow/SKILL.md +156 -0
  11. package/payload/qiongli-workflow/VERSION +1 -0
  12. package/payload/qiongli-workflow/agents/openai.yaml +4 -0
  13. package/payload/qiongli-workflow/references/academic-output-rubric.md +34 -0
  14. package/payload/qiongli-workflow/references/citation-risk-policy.md +27 -0
  15. package/payload/qiongli-workflow/references/coverage-matrix.md +97 -0
  16. package/payload/qiongli-workflow/references/evidence-ledger-contract.md +40 -0
  17. package/payload/qiongli-workflow/references/literature-search-quality-contract.md +51 -0
  18. package/payload/qiongli-workflow/references/method-diagnostic-contract.md +26 -0
  19. package/payload/qiongli-workflow/references/platform-routing.md +44 -0
  20. package/payload/qiongli-workflow/references/stage-A-framing.md +270 -0
  21. package/payload/qiongli-workflow/references/stage-B-literature.md +249 -0
  22. package/payload/qiongli-workflow/references/stage-C-design.md +210 -0
  23. package/payload/qiongli-workflow/references/stage-D-ethics.md +91 -0
  24. package/payload/qiongli-workflow/references/stage-E-synthesis.md +154 -0
  25. package/payload/qiongli-workflow/references/stage-F-writing.md +124 -0
  26. package/payload/qiongli-workflow/references/stage-G-compliance.md +68 -0
  27. package/payload/qiongli-workflow/references/stage-H-submission.md +99 -0
  28. package/payload/qiongli-workflow/references/stage-I-code.md +69 -0
  29. package/payload/qiongli-workflow/references/stage-J-proofread.md +120 -0
  30. package/payload/qiongli-workflow/references/stage-K-presentation.md +99 -0
  31. package/payload/qiongli-workflow/references/stage-handoff-contract.md +24 -0
  32. package/payload/qiongli-workflow/references/workflow-contract.md +161 -0
  33. package/payload/qiongli-workflow/roles/academic-code-reviewer.yaml +33 -0
  34. package/payload/qiongli-workflow/roles/compliance-officer.yaml +30 -0
  35. package/payload/qiongli-workflow/roles/data-agent.yaml +35 -0
  36. package/payload/qiongli-workflow/roles/literature-ra.yaml +34 -0
  37. package/payload/qiongli-workflow/roles/methods-lead.yaml +34 -0
  38. package/payload/qiongli-workflow/roles/pi.yaml +33 -0
  39. package/payload/qiongli-workflow/roles/research-orchestrator.yaml +32 -0
  40. package/payload/qiongli-workflow/roles/science-writer.yaml +40 -0
  41. package/payload/qiongli-workflow/roles/statistician.yaml +34 -0
  42. package/payload/qiongli-workflow/roles/theory-agent.yaml +32 -0
  43. package/payload/qiongli-workflow/skills/A_framing/contribution-crafter.md +99 -0
  44. package/payload/qiongli-workflow/skills/A_framing/gap-analyzer.md +293 -0
  45. package/payload/qiongli-workflow/skills/A_framing/hypothesis-generator.md +237 -0
  46. package/payload/qiongli-workflow/skills/A_framing/question-refiner.md +212 -0
  47. package/payload/qiongli-workflow/skills/A_framing/theory-mapper.md +292 -0
  48. package/payload/qiongli-workflow/skills/A_framing/venue-analyzer.md +209 -0
  49. package/payload/qiongli-workflow/skills/B_literature/academic-searcher.md +454 -0
  50. package/payload/qiongli-workflow/skills/B_literature/citation-formatter.md +300 -0
  51. package/payload/qiongli-workflow/skills/B_literature/citation-snowballer.md +326 -0
  52. package/payload/qiongli-workflow/skills/B_literature/concept-extractor.md +225 -0
  53. package/payload/qiongli-workflow/skills/B_literature/fulltext-fetcher.md +312 -0
  54. package/payload/qiongli-workflow/skills/B_literature/literature-mapper.md +226 -0
  55. package/payload/qiongli-workflow/skills/B_literature/paper-extractor.md +304 -0
  56. package/payload/qiongli-workflow/skills/B_literature/paper-screener.md +292 -0
  57. package/payload/qiongli-workflow/skills/B_literature/reference-manager-bridge.md +349 -0
  58. package/payload/qiongli-workflow/skills/C_design/data-dictionary-builder.md +207 -0
  59. package/payload/qiongli-workflow/skills/C_design/data-management-plan.md +137 -0
  60. package/payload/qiongli-workflow/skills/C_design/dataset-finder.md +216 -0
  61. package/payload/qiongli-workflow/skills/C_design/prereg-writer.md +289 -0
  62. package/payload/qiongli-workflow/skills/C_design/rival-hypothesis-designer.md +208 -0
  63. package/payload/qiongli-workflow/skills/C_design/robustness-planner.md +203 -0
  64. package/payload/qiongli-workflow/skills/C_design/study-designer.md +312 -0
  65. package/payload/qiongli-workflow/skills/C_design/variable-constructor.md +206 -0
  66. package/payload/qiongli-workflow/skills/C_design/variable-operationalizer.md +232 -0
  67. package/payload/qiongli-workflow/skills/D_ethics/deidentification-planner.md +211 -0
  68. package/payload/qiongli-workflow/skills/D_ethics/ethics-irb-helper.md +233 -0
  69. package/payload/qiongli-workflow/skills/D_ethics/statement-generator.md +96 -0
  70. package/payload/qiongli-workflow/skills/E_synthesis/effect-size-calculator.md +111 -0
  71. package/payload/qiongli-workflow/skills/E_synthesis/evidence-synthesizer.md +235 -0
  72. package/payload/qiongli-workflow/skills/E_synthesis/publication-bias-checker.md +211 -0
  73. package/payload/qiongli-workflow/skills/E_synthesis/qualitative-coding.md +107 -0
  74. package/payload/qiongli-workflow/skills/E_synthesis/quality-assessor.md +366 -0
  75. package/payload/qiongli-workflow/skills/F_writing/analysis-interpreter.md +311 -0
  76. package/payload/qiongli-workflow/skills/F_writing/discussion-writer.md +107 -0
  77. package/payload/qiongli-workflow/skills/F_writing/effect-size-interpreter.md +193 -0
  78. package/payload/qiongli-workflow/skills/F_writing/figure-specifier.md +260 -0
  79. package/payload/qiongli-workflow/skills/F_writing/manuscript-architect.md +314 -0
  80. package/payload/qiongli-workflow/skills/F_writing/meta-optimizer.md +203 -0
  81. package/payload/qiongli-workflow/skills/F_writing/table-generator.md +230 -0
  82. package/payload/qiongli-workflow/skills/G_compliance/prisma-checker.md +322 -0
  83. package/payload/qiongli-workflow/skills/G_compliance/reporting-checker.md +319 -0
  84. package/payload/qiongli-workflow/skills/G_compliance/tone-normalizer.md +202 -0
  85. package/payload/qiongli-workflow/skills/H_submission/credit-taxonomy-helper.md +193 -0
  86. package/payload/qiongli-workflow/skills/H_submission/fatal-flaw-detector.md +211 -0
  87. package/payload/qiongli-workflow/skills/H_submission/limitation-auditor.md +103 -0
  88. package/payload/qiongli-workflow/skills/H_submission/peer-review-simulation.md +258 -0
  89. package/payload/qiongli-workflow/skills/H_submission/rebuttal-assistant.md +235 -0
  90. package/payload/qiongli-workflow/skills/H_submission/reviewer-empathy-checker.md +195 -0
  91. package/payload/qiongli-workflow/skills/H_submission/submission-packager.md +316 -0
  92. package/payload/qiongli-workflow/skills/I_code/code-builder.md +156 -0
  93. package/payload/qiongli-workflow/skills/I_code/code-execution.md +158 -0
  94. package/payload/qiongli-workflow/skills/I_code/code-planning.md +147 -0
  95. package/payload/qiongli-workflow/skills/I_code/code-review.md +239 -0
  96. package/payload/qiongli-workflow/skills/I_code/code-specification.md +170 -0
  97. package/payload/qiongli-workflow/skills/I_code/data-cleaning-planner.md +240 -0
  98. package/payload/qiongli-workflow/skills/I_code/data-merge-planner.md +231 -0
  99. package/payload/qiongli-workflow/skills/I_code/release-packager.md +286 -0
  100. package/payload/qiongli-workflow/skills/I_code/reproducibility-auditor.md +139 -0
  101. package/payload/qiongli-workflow/skills/I_code/stats-engine.md +226 -0
  102. package/payload/qiongli-workflow/skills/J_proofread/ai-fingerprint-scanner.md +150 -0
  103. package/payload/qiongli-workflow/skills/J_proofread/final-proofreader.md +193 -0
  104. package/payload/qiongli-workflow/skills/J_proofread/human-voice-rewriter.md +156 -0
  105. package/payload/qiongli-workflow/skills/J_proofread/similarity-checker.md +171 -0
  106. package/payload/qiongli-workflow/skills/K_presentation/beamer-builder.md +426 -0
  107. package/payload/qiongli-workflow/skills/K_presentation/presentation-planner.md +230 -0
  108. package/payload/qiongli-workflow/skills/K_presentation/slide-architect.md +246 -0
  109. package/payload/qiongli-workflow/skills/K_presentation/slidev-scholarly-builder.md +493 -0
  110. package/payload/qiongli-workflow/skills/Z_cross_cutting/academic-context-maintainer.md +279 -0
  111. package/payload/qiongli-workflow/skills/Z_cross_cutting/metadata-enricher.md +252 -0
  112. package/payload/qiongli-workflow/skills/Z_cross_cutting/model-collaborator.md +212 -0
  113. package/payload/qiongli-workflow/skills/Z_cross_cutting/self-critique.md +170 -0
  114. package/payload/qiongli-workflow/skills/domain-profiles/biomedical.yaml +166 -0
  115. package/payload/qiongli-workflow/skills/domain-profiles/business-management.yaml +132 -0
  116. package/payload/qiongli-workflow/skills/domain-profiles/cs-ai.yaml +149 -0
  117. package/payload/qiongli-workflow/skills/domain-profiles/custom-template.yaml +47 -0
  118. package/payload/qiongli-workflow/skills/domain-profiles/ecology-environmental.yaml +154 -0
  119. package/payload/qiongli-workflow/skills/domain-profiles/economics.yaml +146 -0
  120. package/payload/qiongli-workflow/skills/domain-profiles/education.yaml +150 -0
  121. package/payload/qiongli-workflow/skills/domain-profiles/epidemiology.yaml +157 -0
  122. package/payload/qiongli-workflow/skills/domain-profiles/finance.yaml +136 -0
  123. package/payload/qiongli-workflow/skills/domain-profiles/political-science.yaml +150 -0
  124. package/payload/qiongli-workflow/skills/domain-profiles/psychology.yaml +161 -0
  125. package/payload/qiongli-workflow/skills/registry.yaml +1391 -0
  126. package/payload/qiongli-workflow/skills-core.md +629 -0
  127. package/payload/qiongli-workflow/skills-summary.md +133 -0
  128. package/payload/qiongli-workflow/standards/agent-profiles.example.json +195 -0
  129. package/payload/qiongli-workflow/standards/agent-routing-policy.yaml +36 -0
  130. package/payload/qiongli-workflow/standards/agent-run-contract.yaml +50 -0
  131. package/payload/qiongli-workflow/standards/mcp-agent-capability-map.yaml +1889 -0
  132. package/payload/qiongli-workflow/standards/research-workflow-contract.yaml +1283 -0
  133. package/payload/qiongli-workflow/standards/solo-role-policy.yaml +35 -0
  134. package/payload/qiongli-workflow/templates/agent-handoff.md +37 -0
  135. package/payload/qiongli-workflow/templates/agent-review-packet.md +24 -0
  136. package/payload/qiongli-workflow/templates/agent-run-packet.json +17 -0
  137. package/payload/qiongli-workflow/templates/ai-disclosure.md +32 -0
  138. package/payload/qiongli-workflow/templates/analysis-plan.md +91 -0
  139. package/payload/qiongli-workflow/templates/author-contributions-credit.md +36 -0
  140. package/payload/qiongli-workflow/templates/citation-risk-report.md +26 -0
  141. package/payload/qiongli-workflow/templates/claim-evidence-ledger.csv +2 -0
  142. package/payload/qiongli-workflow/templates/claim-evidence-map.md +28 -0
  143. package/payload/qiongli-workflow/templates/code/advanced/jax_mle_template.py +85 -0
  144. package/payload/qiongli-workflow/templates/code/advanced/pytorch_custom_template.py +61 -0
  145. package/payload/qiongli-workflow/templates/code/economics/causal_did.py +45 -0
  146. package/payload/qiongli-workflow/templates/code/finance/portfolio_opt.py +47 -0
  147. package/payload/qiongli-workflow/templates/code/statistics/meta_analysis_metafor.R +98 -0
  148. package/payload/qiongli-workflow/templates/code/statistics/meta_analysis_random_effects.py +171 -0
  149. package/payload/qiongli-workflow/templates/coi-statement.md +18 -0
  150. package/payload/qiongli-workflow/templates/context-manifest.json +8 -0
  151. package/payload/qiongli-workflow/templates/cover-letter.md +34 -0
  152. package/payload/qiongli-workflow/templates/data-availability.md +27 -0
  153. package/payload/qiongli-workflow/templates/data-management-plan.md +42 -0
  154. package/payload/qiongli-workflow/templates/decision-log.md +18 -0
  155. package/payload/qiongli-workflow/templates/dedup-log.csv +1 -0
  156. package/payload/qiongli-workflow/templates/disagreement-matrix.md +11 -0
  157. package/payload/qiongli-workflow/templates/duo-review-report.md +17 -0
  158. package/payload/qiongli-workflow/templates/effect-size-extraction-table.md +59 -0
  159. package/payload/qiongli-workflow/templates/ethics-irb-pack.md +63 -0
  160. package/payload/qiongli-workflow/templates/ethics-statement.md +30 -0
  161. package/payload/qiongli-workflow/templates/evidence-ledger.md +28 -0
  162. package/payload/qiongli-workflow/templates/extraction-table.md +201 -0
  163. package/payload/qiongli-workflow/templates/figures-tables-plan.md +35 -0
  164. package/payload/qiongli-workflow/templates/funding-statement.md +24 -0
  165. package/payload/qiongli-workflow/templates/grade-summary-of-findings.md +170 -0
  166. package/payload/qiongli-workflow/templates/highlights.md +20 -0
  167. package/payload/qiongli-workflow/templates/implementation-intent.md +20 -0
  168. package/payload/qiongli-workflow/templates/interview-guide.md +39 -0
  169. package/payload/qiongli-workflow/templates/manuscript-outline.md +105 -0
  170. package/payload/qiongli-workflow/templates/manuscript-skeleton.md +42 -0
  171. package/payload/qiongli-workflow/templates/meta-analysis-plan.md +122 -0
  172. package/payload/qiongli-workflow/templates/meta-analysis-report.md +91 -0
  173. package/payload/qiongli-workflow/templates/method-diagnostic-report.md +17 -0
  174. package/payload/qiongli-workflow/templates/paper-note.md +207 -0
  175. package/payload/qiongli-workflow/templates/preregistration-template.md +38 -0
  176. package/payload/qiongli-workflow/templates/prisma-checklist.md +122 -0
  177. package/payload/qiongli-workflow/templates/prisma-flowchart.md +158 -0
  178. package/payload/qiongli-workflow/templates/protocol-template.md +300 -0
  179. package/payload/qiongli-workflow/templates/quality-gate-report.md +24 -0
  180. package/payload/qiongli-workflow/templates/quality-table.md +154 -0
  181. package/payload/qiongli-workflow/templates/rebuttal-letter.md +43 -0
  182. package/payload/qiongli-workflow/templates/rebuttal-response-matrix.md +26 -0
  183. package/payload/qiongli-workflow/templates/reporting-checklist.md +45 -0
  184. package/payload/qiongli-workflow/templates/research-state.md +64 -0
  185. package/payload/qiongli-workflow/templates/retrieval-manifest.csv +1 -0
  186. package/payload/qiongli-workflow/templates/rob2-table.md +157 -0
  187. package/payload/qiongli-workflow/templates/search-diagnostics.md +85 -0
  188. package/payload/qiongli-workflow/templates/search-log.md +234 -0
  189. package/payload/qiongli-workflow/templates/search-strategy.md +90 -0
  190. package/payload/qiongli-workflow/templates/solo-self-review.md +23 -0
  191. package/payload/qiongli-workflow/templates/solo-task-packet.md +22 -0
  192. package/payload/qiongli-workflow/templates/stage-handoff.md +29 -0
  193. package/payload/qiongli-workflow/templates/study-design.md +111 -0
  194. package/payload/qiongli-workflow/templates/submission-checklist.md +54 -0
  195. package/payload/qiongli-workflow/templates/suggested-reviewers.md +38 -0
  196. package/payload/qiongli-workflow/templates/supplementary-inventory.md +25 -0
  197. package/payload/qiongli-workflow/templates/survey-instrument.md +36 -0
  198. package/payload/qiongli-workflow/templates/synthesis-matrix.md +162 -0
  199. package/payload/qiongli-workflow/templates/title-page.md +57 -0
  200. package/payload/qiongli-workflow/templates/validity-threat-matrix.md +13 -0
  201. package/payload/qiongli-workflow/templates/writing-claim-map.md +22 -0
  202. package/payload/qiongli-workflow/venue-profiles/acl.yaml +26 -0
  203. package/payload/qiongli-workflow/venue-profiles/aom.yaml +27 -0
  204. package/payload/qiongli-workflow/venue-profiles/chi.yaml +26 -0
  205. package/payload/qiongli-workflow/venue-profiles/jama.yaml +29 -0
  206. package/payload/qiongli-workflow/venue-profiles/nature.yaml +28 -0
  207. package/payload/qiongli-workflow/venue-profiles/neurips.yaml +26 -0
  208. package/payload/qiongli-workflow/workflows/academic-present.md +100 -0
  209. package/payload/qiongli-workflow/workflows/academic-write.md +294 -0
  210. package/payload/qiongli-workflow/workflows/build-framework.md +181 -0
  211. package/payload/qiongli-workflow/workflows/code-build.md +114 -0
  212. package/payload/qiongli-workflow/workflows/compliance-check.md +55 -0
  213. package/payload/qiongli-workflow/workflows/ethics-check.md +41 -0
  214. package/payload/qiongli-workflow/workflows/find-gap.md +162 -0
  215. package/payload/qiongli-workflow/workflows/lit-review.md +244 -0
  216. package/payload/qiongli-workflow/workflows/paper-read.md +185 -0
  217. package/payload/qiongli-workflow/workflows/paper-write.md +88 -0
  218. package/payload/qiongli-workflow/workflows/paper.md +231 -0
  219. package/payload/qiongli-workflow/workflows/proofread.md +64 -0
  220. package/payload/qiongli-workflow/workflows/rebuttal.md +45 -0
  221. package/payload/qiongli-workflow/workflows/study-design.md +73 -0
  222. package/payload/qiongli-workflow/workflows/submission-prep.md +77 -0
  223. package/payload/qiongli-workflow/workflows/synthesize.md +71 -0
  224. package/python-runtime/LICENSE +21 -0
  225. package/python-runtime/bridges/__init__.py +4 -0
  226. package/python-runtime/bridges/base_bridge.py +314 -0
  227. package/python-runtime/bridges/claude_bridge.py +181 -0
  228. package/python-runtime/bridges/codex_bridge.py +144 -0
  229. package/python-runtime/bridges/command_runtime.py +37 -0
  230. package/python-runtime/bridges/context_package.py +116 -0
  231. package/python-runtime/bridges/critique_questions.py +99 -0
  232. package/python-runtime/bridges/errors.py +83 -0
  233. package/python-runtime/bridges/gemini_bridge.py +121 -0
  234. package/python-runtime/bridges/i18n.py +119 -0
  235. package/python-runtime/bridges/mcp_connectors.py +234 -0
  236. package/python-runtime/bridges/orchestrator.py +6132 -0
  237. package/python-runtime/bridges/providers/citation_graph.py +564 -0
  238. package/python-runtime/bridges/providers/fulltext_retrieval.py +843 -0
  239. package/python-runtime/bridges/providers/literature_artifacts.py +310 -0
  240. package/python-runtime/bridges/providers/literature_diagnostics.py +724 -0
  241. package/python-runtime/bridges/providers/literature_query.py +615 -0
  242. package/python-runtime/bridges/providers/literature_schema.py +41 -0
  243. package/python-runtime/bridges/providers/literature_search.py +654 -0
  244. package/python-runtime/bridges/providers/metadata_registry.py +1027 -0
  245. package/python-runtime/bridges/providers/overlay_runtime.py +78 -0
  246. package/python-runtime/bridges/providers/research_collab.py +1530 -0
  247. package/python-runtime/bridges/providers/s2_client.py +177 -0
  248. package/python-runtime/bridges/providers/screening_tracker.py +343 -0
  249. package/python-runtime/evals/academic_quality/README.md +3 -0
  250. package/python-runtime/evals/academic_quality/cases/code-first-methods.yaml +10 -0
  251. package/python-runtime/evals/academic_quality/cases/empirical-causal-design.yaml +10 -0
  252. package/python-runtime/evals/academic_quality/cases/qualitative-coding.yaml +10 -0
  253. package/python-runtime/evals/academic_quality/cases/reviewer-rebuttal.yaml +10 -0
  254. package/python-runtime/evals/academic_quality/cases/systematic-review.yaml +10 -0
  255. package/python-runtime/evals/academic_quality/cases/theory-contribution.yaml +10 -0
  256. package/python-runtime/evals/controller_modes/claude_primary_codex_review.json +36 -0
  257. package/python-runtime/evals/controller_modes/codex_primary_claude_review.json +36 -0
  258. package/python-runtime/evals/controller_modes/duo_disagreement.json +47 -0
  259. package/python-runtime/evals/controller_modes/solo_claude_code.json +34 -0
  260. package/python-runtime/evals/controller_modes/solo_codex_writing.json +34 -0
  261. package/python-runtime/evals/controller_modes/verification_blocked.json +37 -0
  262. package/python-runtime/pipelines/code-first-methods.yaml +92 -0
  263. package/python-runtime/pipelines/empirical-study.yaml +180 -0
  264. package/python-runtime/pipelines/qualitative-study.yaml +162 -0
  265. package/python-runtime/pipelines/rct-prereg.yaml +85 -0
  266. package/python-runtime/pipelines/systematic-review-prisma.yaml +114 -0
  267. package/python-runtime/pipelines/theory-paper.yaml +71 -0
  268. package/python-runtime/qiongli/__init__.py +5 -0
  269. package/python-runtime/qiongli/cli.py +890 -0
  270. package/python-runtime/qiongli/install_manifest.tsv +6 -0
  271. package/python-runtime/qiongli/multi_agent_smoke.py +642 -0
  272. package/python-runtime/qiongli/project.toml +14 -0
  273. package/python-runtime/qiongli/skill_docs.py +566 -0
  274. package/python-runtime/qiongli/team_run_acceptance.py +147 -0
  275. package/python-runtime/qiongli/universal_installer.py +839 -0
  276. package/python-runtime/qiongli/workflow_contract_doc.py +282 -0
  277. package/python-runtime/roles/academic-code-reviewer.yaml +33 -0
  278. package/python-runtime/roles/compliance-officer.yaml +30 -0
  279. package/python-runtime/roles/data-agent.yaml +35 -0
  280. package/python-runtime/roles/literature-ra.yaml +34 -0
  281. package/python-runtime/roles/methods-lead.yaml +34 -0
  282. package/python-runtime/roles/pi.yaml +33 -0
  283. package/python-runtime/roles/research-orchestrator.yaml +32 -0
  284. package/python-runtime/roles/science-writer.yaml +40 -0
  285. package/python-runtime/roles/statistician.yaml +34 -0
  286. package/python-runtime/roles/theory-agent.yaml +32 -0
  287. package/python-runtime/schemas/artifact-types.yaml +598 -0
  288. package/python-runtime/schemas/domain-profile.schema.json +256 -0
  289. package/python-runtime/schemas/skill.schema.json +155 -0
  290. package/python-runtime/scripts/add_missing_sections.py +303 -0
  291. package/python-runtime/scripts/audit_agent_handoffs.py +102 -0
  292. package/python-runtime/scripts/audit_citation_risk.py +72 -0
  293. package/python-runtime/scripts/audit_evidence_contract.py +110 -0
  294. package/python-runtime/scripts/audit_literature_search_quality.py +326 -0
  295. package/python-runtime/scripts/audit_method_diagnostics.py +57 -0
  296. package/python-runtime/scripts/audit_skill_resource_links.py +67 -0
  297. package/python-runtime/scripts/audit_skill_sections.py +283 -0
  298. package/python-runtime/scripts/audit_solo_role_gates.py +247 -0
  299. package/python-runtime/scripts/audit_stage_handoffs.py +60 -0
  300. package/python-runtime/scripts/audit_venue_profiles.py +67 -0
  301. package/python-runtime/scripts/bootstrap_qiongli.ps1 +804 -0
  302. package/python-runtime/scripts/bootstrap_qiongli.py +88 -0
  303. package/python-runtime/scripts/bootstrap_qiongli.sh +752 -0
  304. package/python-runtime/scripts/build_marketplace_artifacts.py +162 -0
  305. package/python-runtime/scripts/bump-version.sh +31 -0
  306. package/python-runtime/scripts/capture_team_run_acceptance.py +102 -0
  307. package/python-runtime/scripts/changelog_section.py +72 -0
  308. package/python-runtime/scripts/gemini_session_broker.py +99 -0
  309. package/python-runtime/scripts/generate_release_notes.sh +251 -0
  310. package/python-runtime/scripts/generate_skill_docs.py +25 -0
  311. package/python-runtime/scripts/generate_workflow_contract_doc.py +22 -0
  312. package/python-runtime/scripts/inject_project_toml.sh +45 -0
  313. package/python-runtime/scripts/install_qiongli.sh +1032 -0
  314. package/python-runtime/scripts/materialize_literature_search_bundle.py +39 -0
  315. package/python-runtime/scripts/mcp_citation_graph.py +42 -0
  316. package/python-runtime/scripts/mcp_fulltext_retrieval.py +42 -0
  317. package/python-runtime/scripts/mcp_metadata_registry.py +131 -0
  318. package/python-runtime/scripts/mcp_research_collab.py +99 -0
  319. package/python-runtime/scripts/mcp_scholarly_search.py +36 -0
  320. package/python-runtime/scripts/mcp_screening_tracker.py +39 -0
  321. package/python-runtime/scripts/npm_preflight.sh +37 -0
  322. package/python-runtime/scripts/pypi_preflight.sh +138 -0
  323. package/python-runtime/scripts/qiongli_cli.sh +519 -0
  324. package/python-runtime/scripts/qiongli_update.py +11 -0
  325. package/python-runtime/scripts/release_automation.sh +283 -0
  326. package/python-runtime/scripts/release_postflight.sh +533 -0
  327. package/python-runtime/scripts/release_preflight.sh +302 -0
  328. package/python-runtime/scripts/release_ready.sh +199 -0
  329. package/python-runtime/scripts/run_academic_quality_evals.py +72 -0
  330. package/python-runtime/scripts/run_beta_smoke.sh +157 -0
  331. package/python-runtime/scripts/run_controller_mode_evals.py +300 -0
  332. package/python-runtime/scripts/run_literature_smoke.sh +10 -0
  333. package/python-runtime/scripts/smoke_multi_agent.py +15 -0
  334. package/python-runtime/scripts/sync_npm_package_payload.py +82 -0
  335. package/python-runtime/scripts/sync_skill_package.sh +159 -0
  336. package/python-runtime/scripts/sync_versions.py +212 -0
  337. package/python-runtime/scripts/upgrade_skill_contract_sections.py +169 -0
  338. package/python-runtime/scripts/validate_project_artifacts.py +634 -0
  339. package/python-runtime/scripts/validate_research_standard.py +2730 -0
  340. package/python-runtime/scripts/verify_release_tag_version.sh +267 -0
  341. package/python-runtime/skills/A_framing/contribution-crafter.md +99 -0
  342. package/python-runtime/skills/A_framing/gap-analyzer.md +293 -0
  343. package/python-runtime/skills/A_framing/hypothesis-generator.md +237 -0
  344. package/python-runtime/skills/A_framing/question-refiner.md +212 -0
  345. package/python-runtime/skills/A_framing/theory-mapper.md +292 -0
  346. package/python-runtime/skills/A_framing/venue-analyzer.md +209 -0
  347. package/python-runtime/skills/B_literature/academic-searcher.md +454 -0
  348. package/python-runtime/skills/B_literature/citation-formatter.md +300 -0
  349. package/python-runtime/skills/B_literature/citation-snowballer.md +326 -0
  350. package/python-runtime/skills/B_literature/concept-extractor.md +225 -0
  351. package/python-runtime/skills/B_literature/fulltext-fetcher.md +312 -0
  352. package/python-runtime/skills/B_literature/literature-mapper.md +226 -0
  353. package/python-runtime/skills/B_literature/paper-extractor.md +304 -0
  354. package/python-runtime/skills/B_literature/paper-screener.md +292 -0
  355. package/python-runtime/skills/B_literature/reference-manager-bridge.md +349 -0
  356. package/python-runtime/skills/C_design/data-dictionary-builder.md +207 -0
  357. package/python-runtime/skills/C_design/data-management-plan.md +137 -0
  358. package/python-runtime/skills/C_design/dataset-finder.md +216 -0
  359. package/python-runtime/skills/C_design/prereg-writer.md +289 -0
  360. package/python-runtime/skills/C_design/rival-hypothesis-designer.md +208 -0
  361. package/python-runtime/skills/C_design/robustness-planner.md +203 -0
  362. package/python-runtime/skills/C_design/study-designer.md +312 -0
  363. package/python-runtime/skills/C_design/variable-constructor.md +206 -0
  364. package/python-runtime/skills/C_design/variable-operationalizer.md +232 -0
  365. package/python-runtime/skills/D_ethics/deidentification-planner.md +211 -0
  366. package/python-runtime/skills/D_ethics/ethics-irb-helper.md +233 -0
  367. package/python-runtime/skills/D_ethics/statement-generator.md +96 -0
  368. package/python-runtime/skills/E_synthesis/effect-size-calculator.md +111 -0
  369. package/python-runtime/skills/E_synthesis/evidence-synthesizer.md +235 -0
  370. package/python-runtime/skills/E_synthesis/publication-bias-checker.md +211 -0
  371. package/python-runtime/skills/E_synthesis/qualitative-coding.md +107 -0
  372. package/python-runtime/skills/E_synthesis/quality-assessor.md +366 -0
  373. package/python-runtime/skills/F_writing/analysis-interpreter.md +311 -0
  374. package/python-runtime/skills/F_writing/discussion-writer.md +107 -0
  375. package/python-runtime/skills/F_writing/effect-size-interpreter.md +193 -0
  376. package/python-runtime/skills/F_writing/figure-specifier.md +260 -0
  377. package/python-runtime/skills/F_writing/manuscript-architect.md +314 -0
  378. package/python-runtime/skills/F_writing/meta-optimizer.md +203 -0
  379. package/python-runtime/skills/F_writing/table-generator.md +230 -0
  380. package/python-runtime/skills/G_compliance/prisma-checker.md +322 -0
  381. package/python-runtime/skills/G_compliance/reporting-checker.md +319 -0
  382. package/python-runtime/skills/G_compliance/tone-normalizer.md +202 -0
  383. package/python-runtime/skills/H_submission/credit-taxonomy-helper.md +193 -0
  384. package/python-runtime/skills/H_submission/fatal-flaw-detector.md +211 -0
  385. package/python-runtime/skills/H_submission/limitation-auditor.md +103 -0
  386. package/python-runtime/skills/H_submission/peer-review-simulation.md +258 -0
  387. package/python-runtime/skills/H_submission/rebuttal-assistant.md +235 -0
  388. package/python-runtime/skills/H_submission/reviewer-empathy-checker.md +195 -0
  389. package/python-runtime/skills/H_submission/submission-packager.md +316 -0
  390. package/python-runtime/skills/I_code/code-builder.md +156 -0
  391. package/python-runtime/skills/I_code/code-execution.md +158 -0
  392. package/python-runtime/skills/I_code/code-planning.md +147 -0
  393. package/python-runtime/skills/I_code/code-review.md +239 -0
  394. package/python-runtime/skills/I_code/code-specification.md +170 -0
  395. package/python-runtime/skills/I_code/data-cleaning-planner.md +240 -0
  396. package/python-runtime/skills/I_code/data-merge-planner.md +231 -0
  397. package/python-runtime/skills/I_code/release-packager.md +286 -0
  398. package/python-runtime/skills/I_code/reproducibility-auditor.md +139 -0
  399. package/python-runtime/skills/I_code/stats-engine.md +226 -0
  400. package/python-runtime/skills/J_proofread/ai-fingerprint-scanner.md +150 -0
  401. package/python-runtime/skills/J_proofread/final-proofreader.md +193 -0
  402. package/python-runtime/skills/J_proofread/human-voice-rewriter.md +156 -0
  403. package/python-runtime/skills/J_proofread/similarity-checker.md +171 -0
  404. package/python-runtime/skills/K_presentation/beamer-builder.md +426 -0
  405. package/python-runtime/skills/K_presentation/presentation-planner.md +230 -0
  406. package/python-runtime/skills/K_presentation/slide-architect.md +246 -0
  407. package/python-runtime/skills/K_presentation/slidev-scholarly-builder.md +493 -0
  408. package/python-runtime/skills/Z_cross_cutting/academic-context-maintainer.md +279 -0
  409. package/python-runtime/skills/Z_cross_cutting/metadata-enricher.md +252 -0
  410. package/python-runtime/skills/Z_cross_cutting/model-collaborator.md +212 -0
  411. package/python-runtime/skills/Z_cross_cutting/self-critique.md +170 -0
  412. package/python-runtime/skills/domain-profiles/biomedical.yaml +166 -0
  413. package/python-runtime/skills/domain-profiles/business-management.yaml +132 -0
  414. package/python-runtime/skills/domain-profiles/cs-ai.yaml +149 -0
  415. package/python-runtime/skills/domain-profiles/custom-template.yaml +47 -0
  416. package/python-runtime/skills/domain-profiles/ecology-environmental.yaml +154 -0
  417. package/python-runtime/skills/domain-profiles/economics.yaml +146 -0
  418. package/python-runtime/skills/domain-profiles/education.yaml +150 -0
  419. package/python-runtime/skills/domain-profiles/epidemiology.yaml +157 -0
  420. package/python-runtime/skills/domain-profiles/finance.yaml +136 -0
  421. package/python-runtime/skills/domain-profiles/political-science.yaml +150 -0
  422. package/python-runtime/skills/domain-profiles/psychology.yaml +161 -0
  423. package/python-runtime/skills/registry.yaml +1391 -0
  424. package/python-runtime/skills-core.md +629 -0
  425. package/python-runtime/skills-summary.md +133 -0
  426. package/python-runtime/standards/agent-profiles.example.json +195 -0
  427. package/python-runtime/standards/agent-routing-policy.yaml +36 -0
  428. package/python-runtime/standards/agent-run-contract.yaml +50 -0
  429. package/python-runtime/standards/mcp-agent-capability-map.yaml +1889 -0
  430. package/python-runtime/standards/research-workflow-contract.yaml +1283 -0
  431. package/python-runtime/standards/solo-role-policy.yaml +35 -0
  432. package/python-runtime/templates/CLAUDE.project.md +50 -0
  433. package/python-runtime/templates/agent-handoff.md +37 -0
  434. package/python-runtime/templates/agent-review-packet.md +24 -0
  435. package/python-runtime/templates/agent-run-packet.json +17 -0
  436. package/python-runtime/templates/ai-disclosure.md +32 -0
  437. package/python-runtime/templates/analysis-plan.md +91 -0
  438. package/python-runtime/templates/author-contributions-credit.md +36 -0
  439. package/python-runtime/templates/citation-risk-report.md +26 -0
  440. package/python-runtime/templates/claim-evidence-ledger.csv +2 -0
  441. package/python-runtime/templates/claim-evidence-map.md +28 -0
  442. package/python-runtime/templates/code/advanced/jax_mle_template.py +85 -0
  443. package/python-runtime/templates/code/advanced/pytorch_custom_template.py +61 -0
  444. package/python-runtime/templates/code/economics/causal_did.py +45 -0
  445. package/python-runtime/templates/code/finance/portfolio_opt.py +47 -0
  446. package/python-runtime/templates/code/statistics/meta_analysis_metafor.R +98 -0
  447. package/python-runtime/templates/code/statistics/meta_analysis_random_effects.py +171 -0
  448. package/python-runtime/templates/coi-statement.md +18 -0
  449. package/python-runtime/templates/context-manifest.json +8 -0
  450. package/python-runtime/templates/cover-letter.md +34 -0
  451. package/python-runtime/templates/data-availability.md +27 -0
  452. package/python-runtime/templates/data-management-plan.md +42 -0
  453. package/python-runtime/templates/decision-log.md +18 -0
  454. package/python-runtime/templates/dedup-log.csv +1 -0
  455. package/python-runtime/templates/disagreement-matrix.md +11 -0
  456. package/python-runtime/templates/duo-review-report.md +17 -0
  457. package/python-runtime/templates/effect-size-extraction-table.md +59 -0
  458. package/python-runtime/templates/ethics-irb-pack.md +63 -0
  459. package/python-runtime/templates/ethics-statement.md +30 -0
  460. package/python-runtime/templates/evidence-ledger.md +28 -0
  461. package/python-runtime/templates/extraction-table.md +201 -0
  462. package/python-runtime/templates/figures-tables-plan.md +35 -0
  463. package/python-runtime/templates/funding-statement.md +24 -0
  464. package/python-runtime/templates/grade-summary-of-findings.md +170 -0
  465. package/python-runtime/templates/highlights.md +20 -0
  466. package/python-runtime/templates/implementation-intent.md +20 -0
  467. package/python-runtime/templates/interview-guide.md +39 -0
  468. package/python-runtime/templates/manuscript-outline.md +105 -0
  469. package/python-runtime/templates/manuscript-skeleton.md +42 -0
  470. package/python-runtime/templates/meta-analysis-plan.md +122 -0
  471. package/python-runtime/templates/meta-analysis-report.md +91 -0
  472. package/python-runtime/templates/method-diagnostic-report.md +17 -0
  473. package/python-runtime/templates/paper-note.md +207 -0
  474. package/python-runtime/templates/preregistration-template.md +38 -0
  475. package/python-runtime/templates/prisma-checklist.md +122 -0
  476. package/python-runtime/templates/prisma-flowchart.md +158 -0
  477. package/python-runtime/templates/protocol-template.md +300 -0
  478. package/python-runtime/templates/quality-gate-report.md +24 -0
  479. package/python-runtime/templates/quality-table.md +154 -0
  480. package/python-runtime/templates/rebuttal-letter.md +43 -0
  481. package/python-runtime/templates/rebuttal-response-matrix.md +26 -0
  482. package/python-runtime/templates/reporting-checklist.md +45 -0
  483. package/python-runtime/templates/research-state.md +64 -0
  484. package/python-runtime/templates/retrieval-manifest.csv +1 -0
  485. package/python-runtime/templates/rob2-table.md +157 -0
  486. package/python-runtime/templates/search-diagnostics.md +85 -0
  487. package/python-runtime/templates/search-log.md +234 -0
  488. package/python-runtime/templates/search-strategy.md +90 -0
  489. package/python-runtime/templates/solo-self-review.md +23 -0
  490. package/python-runtime/templates/solo-task-packet.md +22 -0
  491. package/python-runtime/templates/stage-handoff.md +29 -0
  492. package/python-runtime/templates/study-design.md +111 -0
  493. package/python-runtime/templates/submission-checklist.md +54 -0
  494. package/python-runtime/templates/suggested-reviewers.md +38 -0
  495. package/python-runtime/templates/supplementary-inventory.md +25 -0
  496. package/python-runtime/templates/survey-instrument.md +36 -0
  497. package/python-runtime/templates/synthesis-matrix.md +162 -0
  498. package/python-runtime/templates/title-page.md +57 -0
  499. package/python-runtime/templates/validity-threat-matrix.md +13 -0
  500. package/python-runtime/templates/writing-claim-map.md +22 -0
  501. package/python-runtime/venue-profiles/acl.yaml +26 -0
  502. package/python-runtime/venue-profiles/aom.yaml +27 -0
  503. package/python-runtime/venue-profiles/chi.yaml +26 -0
  504. package/python-runtime/venue-profiles/jama.yaml +29 -0
  505. package/python-runtime/venue-profiles/nature.yaml +28 -0
  506. package/python-runtime/venue-profiles/neurips.yaml +26 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jiaxin Peng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # qiongli
2
+
3
+ `qiongli` is the npm/npx installer for the Qiongli academic workflow skills.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g qiongli
9
+ qiongli install --target all
10
+ ```
11
+
12
+ Or run without a global install:
13
+
14
+ ```bash
15
+ npx qiongli@next install --target all
16
+ ```
17
+
18
+ The npm package contains the complete `qiongli-workflow` skill payload and does not depend on PyPI for skill installation.
19
+
20
+ Advanced bridge commands such as `doctor`, `task-run`, and `team-run` use the Python runtime bundled in the npm package and require Python 3.12+ with `PyYAML`.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../lib/cli.mjs';
3
+
4
+ process.exitCode = await main(process.argv.slice(2));
package/lib/args.mjs ADDED
@@ -0,0 +1,67 @@
1
+ const TARGETS = new Set(['codex', 'claude', 'gemini', 'antigravity', 'all']);
2
+ const MODES = new Set(['copy', 'link']);
3
+ const BRIDGE_COMMANDS = new Set(['doctor', 'task-run', 'team-run', 'parallel', 'chain', 'role', 'single', 'code-build', 'task-plan']);
4
+
5
+ export function parseArgv(argv) {
6
+ const [rawCommand = 'help', ...restArgs] = argv;
7
+ if (BRIDGE_COMMANDS.has(rawCommand)) {
8
+ return { command: rawCommand, options: {}, rest: restArgs };
9
+ }
10
+
11
+ const command = rawCommand === 'upgrade' ? 'install' : rawCommand;
12
+ const options = {
13
+ target: 'all',
14
+ mode: 'copy',
15
+ projectDir: '.',
16
+ overwrite: rawCommand === 'upgrade',
17
+ dryRun: false,
18
+ json: false,
19
+ globals: false,
20
+ };
21
+ const rest = [];
22
+
23
+ for (let i = 0; i < restArgs.length; i += 1) {
24
+ const arg = restArgs[i];
25
+ if (arg === '--target') {
26
+ options.target = requireValue(restArgs, i, arg);
27
+ i += 1;
28
+ } else if (arg === '--mode') {
29
+ options.mode = requireValue(restArgs, i, arg);
30
+ i += 1;
31
+ } else if (arg === '--project-dir') {
32
+ options.projectDir = requireValue(restArgs, i, arg);
33
+ i += 1;
34
+ } else if (arg === '--cwd') {
35
+ options.cwd = requireValue(restArgs, i, arg);
36
+ i += 1;
37
+ } else if (arg === '--overwrite') {
38
+ options.overwrite = true;
39
+ } else if (arg === '--dry-run') {
40
+ options.dryRun = true;
41
+ } else if (arg === '--json') {
42
+ options.json = true;
43
+ } else if (arg === '--globals') {
44
+ options.globals = true;
45
+ } else if (arg === '-h' || arg === '--help') {
46
+ options.help = true;
47
+ } else {
48
+ rest.push(arg);
49
+ }
50
+ }
51
+
52
+ if (options.target && !TARGETS.has(options.target)) {
53
+ throw new Error(`Unsupported target: ${options.target}`);
54
+ }
55
+ if (options.mode && !MODES.has(options.mode)) {
56
+ throw new Error(`Unsupported mode: ${options.mode}`);
57
+ }
58
+ return { command, options, rest };
59
+ }
60
+
61
+ function requireValue(args, index, flag) {
62
+ const value = args[index + 1];
63
+ if (!value || value.startsWith('--')) {
64
+ throw new Error(`Missing value for ${flag}`);
65
+ }
66
+ return value;
67
+ }
package/lib/cli.mjs ADDED
@@ -0,0 +1,112 @@
1
+ import { parseArgv } from './args.mjs';
2
+ import { packageRoot } from './package-root.mjs';
3
+ import { buildCheck, cleanAssets, installSkills } from './installer.mjs';
4
+ import { checkPythonRuntime, runBridgeCommand } from './python-runtime.mjs';
5
+
6
+ const BRIDGE_COMMANDS = new Set(['doctor', 'task-run', 'team-run', 'parallel', 'chain', 'role', 'single', 'code-build', 'task-plan']);
7
+
8
+ export async function main(argv, { stdout = process.stdout, stderr = process.stderr } = {}) {
9
+ const root = packageRoot();
10
+ let parsed;
11
+ try {
12
+ parsed = parseArgv(argv);
13
+ } catch (error) {
14
+ stderr.write(`[qiongli] ${error.message}\n`);
15
+ return 2;
16
+ }
17
+
18
+ if (parsed.options.help || parsed.command === 'help') {
19
+ stdout.write(helpText());
20
+ return 0;
21
+ }
22
+
23
+ if (parsed.command === 'install') {
24
+ const result = installSkills({
25
+ packageRoot: root,
26
+ target: parsed.options.target,
27
+ mode: parsed.options.mode,
28
+ overwrite: parsed.options.overwrite,
29
+ dryRun: parsed.options.dryRun,
30
+ });
31
+ printInstallResult(result, stdout);
32
+ return 0;
33
+ }
34
+
35
+ if (parsed.command === 'check') {
36
+ const payload = { ...buildCheck({ packageRoot: root }), python_bridge: checkPythonRuntime() };
37
+ if (parsed.options.json) {
38
+ stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
39
+ } else {
40
+ stdout.write(`Qiongli npm package: ${payload.npm_package.version}\n`);
41
+ stdout.write(`Payload version: ${payload.payload.version || '<unknown>'}\n`);
42
+ stdout.write(`Python bridge: ${payload.python_bridge.ok ? 'ok' : 'warn'} - ${payload.python_bridge.message}\n`);
43
+ }
44
+ return 0;
45
+ }
46
+
47
+ if (parsed.command === 'clean') {
48
+ const result = cleanAssets({
49
+ projectDir: parsed.options.projectDir,
50
+ globals: parsed.options.globals,
51
+ dryRun: parsed.options.dryRun,
52
+ });
53
+ stdout.write(`[qiongli] removed ${result.removed.length} stale asset(s)\n`);
54
+ return 0;
55
+ }
56
+
57
+ if (parsed.command === 'runtime') {
58
+ if (parsed.rest[0] !== 'doctor') {
59
+ stderr.write('[qiongli] runtime supports only: doctor\n');
60
+ return 2;
61
+ }
62
+ const result = checkPythonRuntime();
63
+ stdout.write(`${result.ok ? '[ok]' : '[warn]'} ${result.message}\n`);
64
+ if (result.hint) {
65
+ stdout.write(`Hint: ${result.hint}\n`);
66
+ }
67
+ return result.ok ? 0 : 1;
68
+ }
69
+
70
+ if (BRIDGE_COMMANDS.has(parsed.command)) {
71
+ const args = parsed.command === 'doctor' && !parsed.rest.includes('--cwd')
72
+ ? ['--cwd', parsed.options.cwd || '.', ...parsed.rest]
73
+ : parsed.rest;
74
+ return runBridgeCommand({ packageRoot: root, command: parsed.command, args });
75
+ }
76
+
77
+ stderr.write(`[qiongli] unknown command: ${parsed.command}\n`);
78
+ return 2;
79
+ }
80
+
81
+ function printInstallResult(result, stdout) {
82
+ stdout.write('Qiongli npm installer\n');
83
+ stdout.write(`source version: ${result.sourceVersion || '<unknown>'}\n`);
84
+ for (const residue of result.legacyResidues) {
85
+ stdout.write(`[legacy] ${residue.target}: ${residue.legacyName} -> ${residue.path}\n`);
86
+ }
87
+ for (const action of result.actions) {
88
+ stdout.write(`[${action.status}] ${action.label} -> ${action.path} (${action.detail})\n`);
89
+ }
90
+ stdout.write('Restart Codex / Claude Code / Gemini CLI to activate changes.\n');
91
+ }
92
+
93
+ function helpText() {
94
+ return `Qiongli npm installer
95
+
96
+ Usage:
97
+ qiongli install --target all
98
+ qiongli upgrade --target all
99
+ qiongli check [--json]
100
+ qiongli clean --project-dir . [--globals]
101
+ qiongli runtime doctor
102
+ qiongli doctor --cwd .
103
+ qiongli task-run ...
104
+ qiongli team-run ...
105
+
106
+ Options:
107
+ --target codex|claude|gemini|antigravity|all
108
+ --mode copy|link
109
+ --overwrite
110
+ --dry-run
111
+ `;
112
+ }
@@ -0,0 +1,228 @@
1
+ import fs from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+
5
+ const TARGETS = ['codex', 'claude', 'gemini', 'antigravity'];
6
+ const LEGACY_SKILL_NAME = 'research-paper-workflow';
7
+
8
+ export function resolveTargetPaths({ env = process.env } = {}) {
9
+ const home = env.HOME || env.USERPROFILE || os.homedir();
10
+ const codexHome = env.CODEX_HOME || path.join(home, '.codex');
11
+ const claudeHome = env.CLAUDE_CODE_HOME || path.join(home, '.claude');
12
+ const geminiHome = env.GEMINI_HOME || path.join(home, '.gemini');
13
+ const antigravityHome = env.ANTIGRAVITY_HOME || path.join(home, '.gemini', 'antigravity');
14
+ return {
15
+ codex: path.join(codexHome, 'skills', 'qiongli-workflow'),
16
+ claude: path.join(claudeHome, 'skills', 'qiongli-workflow'),
17
+ gemini: path.join(geminiHome, 'skills', 'qiongli-workflow'),
18
+ antigravity: path.join(antigravityHome, 'skills', 'qiongli-workflow'),
19
+ };
20
+ }
21
+
22
+ export function readSkillVersion(skillDir) {
23
+ if (!isQiongliSkillDir(skillDir)) {
24
+ return '';
25
+ }
26
+ try {
27
+ return fs.readFileSync(path.join(skillDir, 'VERSION'), 'utf-8').trim();
28
+ } catch {
29
+ return '';
30
+ }
31
+ }
32
+
33
+ export function installSkills({
34
+ packageRoot,
35
+ target = 'all',
36
+ mode = 'copy',
37
+ overwrite = false,
38
+ dryRun = false,
39
+ env = process.env,
40
+ platform = process.platform,
41
+ } = {}) {
42
+ const workflowSrc = path.join(packageRoot, 'payload', 'qiongli-workflow');
43
+ if (!fs.existsSync(path.join(workflowSrc, 'SKILL.md'))) {
44
+ throw new Error(`Missing qiongli-workflow payload: ${workflowSrc}`);
45
+ }
46
+
47
+ const targetPaths = resolveTargetPaths({ env });
48
+ const selectedTargets = target === 'all' ? TARGETS : [target];
49
+ const sourceVersion = readSkillVersion(workflowSrc);
50
+ const actions = [];
51
+ const legacyResidues = [];
52
+
53
+ for (const item of selectedTargets) {
54
+ const dest = targetPaths[item];
55
+ const legacyPath = path.join(path.dirname(dest), LEGACY_SKILL_NAME);
56
+ if (fs.existsSync(legacyPath)) {
57
+ legacyResidues.push({ target: item, legacyName: LEGACY_SKILL_NAME, path: legacyPath });
58
+ }
59
+
60
+ actions.push(copySkill({ src: workflowSrc, dest, mode, overwrite, dryRun, sourceVersion }));
61
+
62
+ if ((item === 'claude' || item === 'gemini') && actions.at(-1).status !== 'skip') {
63
+ actions.push(...installWorkflowDiscovery({ target: item, skillDest: dest, dryRun, platform }));
64
+ }
65
+ }
66
+
67
+ return { sourceVersion, actions, legacyResidues, targetPaths };
68
+ }
69
+
70
+ export function cleanAssets({ projectDir = '.', globals = false, dryRun = false, env = process.env } = {}) {
71
+ const removed = [];
72
+ const projectRoot = path.resolve(projectDir);
73
+ const projectPatterns = [
74
+ ['.agent', 'workflows'],
75
+ ['.agent', 'skills', 'qiongli-workflow'],
76
+ ['.agent', 'skills', LEGACY_SKILL_NAME],
77
+ ['.agents', 'skills', 'qiongli-workflow'],
78
+ ['.agents', 'skills', LEGACY_SKILL_NAME],
79
+ ['.gemini', 'qiongli.md'],
80
+ ['.gemini', 'agent-profiles.example.json'],
81
+ ['CLAUDE.qiongli.md'],
82
+ ];
83
+
84
+ for (const parts of projectPatterns) {
85
+ const candidate = path.join(projectRoot, ...parts);
86
+ if (!fs.existsSync(candidate)) {
87
+ continue;
88
+ }
89
+ removePath(candidate, dryRun);
90
+ removed.push(candidate);
91
+ }
92
+
93
+ if (globals) {
94
+ const targetPaths = resolveTargetPaths({ env });
95
+ for (const [target, skillDest] of Object.entries(targetPaths)) {
96
+ if (target !== 'claude' && target !== 'gemini') {
97
+ continue;
98
+ }
99
+ const discoveryDir = discoveryDirectory(target, skillDest);
100
+ if (!fs.existsSync(discoveryDir)) {
101
+ continue;
102
+ }
103
+ for (const name of fs.readdirSync(discoveryDir)) {
104
+ const item = path.join(discoveryDir, name);
105
+ if (isManagedDiscoveryFile(item)) {
106
+ removePath(item, dryRun);
107
+ removed.push(item);
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ return { removed };
114
+ }
115
+
116
+ export function buildCheck({ packageRoot, env = process.env } = {}) {
117
+ const packageJson = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf-8'));
118
+ const payload = path.join(packageRoot, 'payload', 'qiongli-workflow');
119
+ const targetPaths = resolveTargetPaths({ env });
120
+ const installed = {};
121
+ for (const [target, skillDir] of Object.entries(targetPaths)) {
122
+ installed[target] = {
123
+ path: skillDir,
124
+ installed: isQiongliSkillDir(skillDir),
125
+ version: readSkillVersion(skillDir) || null,
126
+ };
127
+ }
128
+ return {
129
+ npm_package: {
130
+ name: packageJson.name,
131
+ version: packageJson.version,
132
+ },
133
+ payload: {
134
+ path: payload,
135
+ version: readSkillVersion(payload),
136
+ },
137
+ installed,
138
+ };
139
+ }
140
+
141
+ function copySkill({ src, dest, mode, overwrite, dryRun, sourceVersion }) {
142
+ if (fs.existsSync(dest)) {
143
+ if (!overwrite) {
144
+ if (isQiongliSkillDir(dest)) {
145
+ const destVersion = readSkillVersion(dest);
146
+ if (destVersion === sourceVersion) {
147
+ return { label: 'Skill', status: 'skip', path: dest, detail: `already current ${sourceVersion}` };
148
+ }
149
+ } else {
150
+ return { label: 'Skill', status: 'skip', path: dest, detail: 'use --overwrite for unmanaged directory' };
151
+ }
152
+ }
153
+ removePath(dest, dryRun);
154
+ }
155
+
156
+ if (!dryRun) {
157
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
158
+ if (mode === 'link') {
159
+ fs.symlinkSync(src, dest, process.platform === 'win32' ? 'junction' : 'dir');
160
+ } else {
161
+ fs.cpSync(src, dest, { recursive: true, force: true });
162
+ }
163
+ }
164
+
165
+ return { label: 'Skill', status: 'ok', path: dest, detail: `installed ${sourceVersion}` };
166
+ }
167
+
168
+ function installWorkflowDiscovery({ target, skillDest, dryRun, platform }) {
169
+ const workflowsDir = path.join(skillDest, 'workflows');
170
+ if (!fs.existsSync(workflowsDir)) {
171
+ return [];
172
+ }
173
+ const actions = [];
174
+ const discoveryDir = discoveryDirectory(target, skillDest);
175
+ if (!dryRun) {
176
+ fs.mkdirSync(discoveryDir, { recursive: true });
177
+ }
178
+
179
+ for (const file of fs.readdirSync(workflowsDir).filter((name) => name.endsWith('.md'))) {
180
+ const src = path.join(workflowsDir, file);
181
+ const dest = path.join(discoveryDir, file);
182
+ if (!dryRun && fs.existsSync(dest)) {
183
+ fs.rmSync(dest, { force: true, recursive: true });
184
+ }
185
+ if (!dryRun) {
186
+ if (platform === 'win32') {
187
+ fs.copyFileSync(src, dest);
188
+ } else {
189
+ fs.symlinkSync(src, dest);
190
+ }
191
+ }
192
+ actions.push({ label: 'Workflow', status: 'ok', path: dest, detail: platform === 'win32' ? 'copied' : 'linked' });
193
+ }
194
+ return actions;
195
+ }
196
+
197
+ function discoveryDirectory(target, skillDest) {
198
+ const clientHome = path.dirname(path.dirname(skillDest));
199
+ return path.join(clientHome, target === 'claude' ? 'commands' : 'workflows');
200
+ }
201
+
202
+ function isQiongliSkillDir(skillDir) {
203
+ try {
204
+ return fs.readFileSync(path.join(skillDir, 'SKILL.md'), 'utf-8').includes('name: qiongli-workflow');
205
+ } catch {
206
+ return false;
207
+ }
208
+ }
209
+
210
+ function isManagedDiscoveryFile(item) {
211
+ try {
212
+ if (fs.lstatSync(item).isSymbolicLink()) {
213
+ const target = fs.realpathSync(item);
214
+ return target.includes('qiongli-workflow') || target.includes(LEGACY_SKILL_NAME);
215
+ }
216
+ const content = fs.readFileSync(item, 'utf-8');
217
+ return content.includes('qiongli-workflow') || content.includes('Qiongli');
218
+ } catch {
219
+ return false;
220
+ }
221
+ }
222
+
223
+ function removePath(target, dryRun) {
224
+ if (dryRun) {
225
+ return;
226
+ }
227
+ fs.rmSync(target, { recursive: true, force: true });
228
+ }
@@ -0,0 +1,6 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import path from 'node:path';
3
+
4
+ export function packageRoot() {
5
+ return path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
6
+ }
@@ -0,0 +1,77 @@
1
+ import { spawnSync as nodeSpawnSync } from 'node:child_process';
2
+ import path from 'node:path';
3
+
4
+ export function checkPythonRuntime({
5
+ candidates = ['python3', 'python'],
6
+ spawnSync = nodeSpawnSync,
7
+ } = {}) {
8
+ for (const candidate of candidates) {
9
+ const version = spawnSync(candidate, [
10
+ '-c',
11
+ 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")',
12
+ ], { encoding: 'utf-8' });
13
+ if (version.status !== 0) {
14
+ continue;
15
+ }
16
+
17
+ const rawVersion = String(version.stdout || '').trim();
18
+ const [major, minor] = rawVersion.split('.').map((item) => Number.parseInt(item, 10));
19
+ if (major < 3 || (major === 3 && minor < 12)) {
20
+ return {
21
+ ok: false,
22
+ python: candidate,
23
+ version: rawVersion,
24
+ message: `Python bridge requires Python 3.12+, found ${rawVersion}.`,
25
+ hint: 'Install Python 3.12+ or use `pipx install qiongli`.',
26
+ };
27
+ }
28
+
29
+ const yaml = spawnSync(candidate, ['-c', 'import yaml'], { encoding: 'utf-8' });
30
+ if (yaml.status !== 0) {
31
+ return {
32
+ ok: false,
33
+ python: candidate,
34
+ version: rawVersion,
35
+ message: 'Python bridge requires PyYAML.',
36
+ hint: `${candidate} -m pip install PyYAML, or use \`pipx install qiongli\`.`,
37
+ };
38
+ }
39
+
40
+ return {
41
+ ok: true,
42
+ python: candidate,
43
+ version: rawVersion,
44
+ message: `Python bridge ready (${candidate} ${rawVersion}).`,
45
+ hint: '',
46
+ };
47
+ }
48
+
49
+ return {
50
+ ok: false,
51
+ python: '',
52
+ version: '',
53
+ message: 'Python runtime not found.',
54
+ hint: 'Install Python 3.12+ and PyYAML, or use `pipx install qiongli`.',
55
+ };
56
+ }
57
+
58
+ export function runBridgeCommand({ packageRoot, command, args, cwd = process.cwd(), env = process.env, stdio = 'inherit' }) {
59
+ const runtime = checkPythonRuntime();
60
+ if (!runtime.ok) {
61
+ console.error(`[qiongli] ${runtime.message}`);
62
+ console.error(`Hint: ${runtime.hint}`);
63
+ return 1;
64
+ }
65
+
66
+ const pythonPath = path.join(packageRoot, 'python-runtime');
67
+ const childEnv = {
68
+ ...env,
69
+ PYTHONPATH: env.PYTHONPATH ? `${pythonPath}${path.delimiter}${env.PYTHONPATH}` : pythonPath,
70
+ };
71
+ const result = nodeSpawnSync(runtime.python, ['-m', 'bridges.orchestrator', command, ...args], {
72
+ cwd,
73
+ env: childEnv,
74
+ stdio,
75
+ });
76
+ return typeof result.status === 'number' ? result.status : 1;
77
+ }
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "qiongli",
3
+ "version": "0.9.0-beta.4",
4
+ "description": "npm/npx installer and optional Python bridge runtime for Qiongli academic workflow skills.",
5
+ "type": "module",
6
+ "bin": {
7
+ "qiongli": "bin/qiongli.mjs"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "lib/",
12
+ "payload/",
13
+ "python-runtime/",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "test": "node --test test/*.test.mjs"
19
+ },
20
+ "engines": {
21
+ "node": ">=18"
22
+ },
23
+ "license": "MIT",
24
+ "homepage": "https://github.com/jxpeng98/qiongli",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/jxpeng98/qiongli.git",
28
+ "directory": "packages/npm-qiongli"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/jxpeng98/qiongli/issues"
32
+ }
33
+ }