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.
- package/LICENSE +21 -0
- package/README.md +20 -0
- package/bin/qiongli.mjs +4 -0
- package/lib/args.mjs +67 -0
- package/lib/cli.mjs +112 -0
- package/lib/installer.mjs +228 -0
- package/lib/package-root.mjs +6 -0
- package/lib/python-runtime.mjs +77 -0
- package/package.json +33 -0
- package/payload/qiongli-workflow/SKILL.md +156 -0
- package/payload/qiongli-workflow/VERSION +1 -0
- package/payload/qiongli-workflow/agents/openai.yaml +4 -0
- package/payload/qiongli-workflow/references/academic-output-rubric.md +34 -0
- package/payload/qiongli-workflow/references/citation-risk-policy.md +27 -0
- package/payload/qiongli-workflow/references/coverage-matrix.md +97 -0
- package/payload/qiongli-workflow/references/evidence-ledger-contract.md +40 -0
- package/payload/qiongli-workflow/references/literature-search-quality-contract.md +51 -0
- package/payload/qiongli-workflow/references/method-diagnostic-contract.md +26 -0
- package/payload/qiongli-workflow/references/platform-routing.md +44 -0
- package/payload/qiongli-workflow/references/stage-A-framing.md +270 -0
- package/payload/qiongli-workflow/references/stage-B-literature.md +249 -0
- package/payload/qiongli-workflow/references/stage-C-design.md +210 -0
- package/payload/qiongli-workflow/references/stage-D-ethics.md +91 -0
- package/payload/qiongli-workflow/references/stage-E-synthesis.md +154 -0
- package/payload/qiongli-workflow/references/stage-F-writing.md +124 -0
- package/payload/qiongli-workflow/references/stage-G-compliance.md +68 -0
- package/payload/qiongli-workflow/references/stage-H-submission.md +99 -0
- package/payload/qiongli-workflow/references/stage-I-code.md +69 -0
- package/payload/qiongli-workflow/references/stage-J-proofread.md +120 -0
- package/payload/qiongli-workflow/references/stage-K-presentation.md +99 -0
- package/payload/qiongli-workflow/references/stage-handoff-contract.md +24 -0
- package/payload/qiongli-workflow/references/workflow-contract.md +161 -0
- package/payload/qiongli-workflow/roles/academic-code-reviewer.yaml +33 -0
- package/payload/qiongli-workflow/roles/compliance-officer.yaml +30 -0
- package/payload/qiongli-workflow/roles/data-agent.yaml +35 -0
- package/payload/qiongli-workflow/roles/literature-ra.yaml +34 -0
- package/payload/qiongli-workflow/roles/methods-lead.yaml +34 -0
- package/payload/qiongli-workflow/roles/pi.yaml +33 -0
- package/payload/qiongli-workflow/roles/research-orchestrator.yaml +32 -0
- package/payload/qiongli-workflow/roles/science-writer.yaml +40 -0
- package/payload/qiongli-workflow/roles/statistician.yaml +34 -0
- package/payload/qiongli-workflow/roles/theory-agent.yaml +32 -0
- package/payload/qiongli-workflow/skills/A_framing/contribution-crafter.md +99 -0
- package/payload/qiongli-workflow/skills/A_framing/gap-analyzer.md +293 -0
- package/payload/qiongli-workflow/skills/A_framing/hypothesis-generator.md +237 -0
- package/payload/qiongli-workflow/skills/A_framing/question-refiner.md +212 -0
- package/payload/qiongli-workflow/skills/A_framing/theory-mapper.md +292 -0
- package/payload/qiongli-workflow/skills/A_framing/venue-analyzer.md +209 -0
- package/payload/qiongli-workflow/skills/B_literature/academic-searcher.md +454 -0
- package/payload/qiongli-workflow/skills/B_literature/citation-formatter.md +300 -0
- package/payload/qiongli-workflow/skills/B_literature/citation-snowballer.md +326 -0
- package/payload/qiongli-workflow/skills/B_literature/concept-extractor.md +225 -0
- package/payload/qiongli-workflow/skills/B_literature/fulltext-fetcher.md +312 -0
- package/payload/qiongli-workflow/skills/B_literature/literature-mapper.md +226 -0
- package/payload/qiongli-workflow/skills/B_literature/paper-extractor.md +304 -0
- package/payload/qiongli-workflow/skills/B_literature/paper-screener.md +292 -0
- package/payload/qiongli-workflow/skills/B_literature/reference-manager-bridge.md +349 -0
- package/payload/qiongli-workflow/skills/C_design/data-dictionary-builder.md +207 -0
- package/payload/qiongli-workflow/skills/C_design/data-management-plan.md +137 -0
- package/payload/qiongli-workflow/skills/C_design/dataset-finder.md +216 -0
- package/payload/qiongli-workflow/skills/C_design/prereg-writer.md +289 -0
- package/payload/qiongli-workflow/skills/C_design/rival-hypothesis-designer.md +208 -0
- package/payload/qiongli-workflow/skills/C_design/robustness-planner.md +203 -0
- package/payload/qiongli-workflow/skills/C_design/study-designer.md +312 -0
- package/payload/qiongli-workflow/skills/C_design/variable-constructor.md +206 -0
- package/payload/qiongli-workflow/skills/C_design/variable-operationalizer.md +232 -0
- package/payload/qiongli-workflow/skills/D_ethics/deidentification-planner.md +211 -0
- package/payload/qiongli-workflow/skills/D_ethics/ethics-irb-helper.md +233 -0
- package/payload/qiongli-workflow/skills/D_ethics/statement-generator.md +96 -0
- package/payload/qiongli-workflow/skills/E_synthesis/effect-size-calculator.md +111 -0
- package/payload/qiongli-workflow/skills/E_synthesis/evidence-synthesizer.md +235 -0
- package/payload/qiongli-workflow/skills/E_synthesis/publication-bias-checker.md +211 -0
- package/payload/qiongli-workflow/skills/E_synthesis/qualitative-coding.md +107 -0
- package/payload/qiongli-workflow/skills/E_synthesis/quality-assessor.md +366 -0
- package/payload/qiongli-workflow/skills/F_writing/analysis-interpreter.md +311 -0
- package/payload/qiongli-workflow/skills/F_writing/discussion-writer.md +107 -0
- package/payload/qiongli-workflow/skills/F_writing/effect-size-interpreter.md +193 -0
- package/payload/qiongli-workflow/skills/F_writing/figure-specifier.md +260 -0
- package/payload/qiongli-workflow/skills/F_writing/manuscript-architect.md +314 -0
- package/payload/qiongli-workflow/skills/F_writing/meta-optimizer.md +203 -0
- package/payload/qiongli-workflow/skills/F_writing/table-generator.md +230 -0
- package/payload/qiongli-workflow/skills/G_compliance/prisma-checker.md +322 -0
- package/payload/qiongli-workflow/skills/G_compliance/reporting-checker.md +319 -0
- package/payload/qiongli-workflow/skills/G_compliance/tone-normalizer.md +202 -0
- package/payload/qiongli-workflow/skills/H_submission/credit-taxonomy-helper.md +193 -0
- package/payload/qiongli-workflow/skills/H_submission/fatal-flaw-detector.md +211 -0
- package/payload/qiongli-workflow/skills/H_submission/limitation-auditor.md +103 -0
- package/payload/qiongli-workflow/skills/H_submission/peer-review-simulation.md +258 -0
- package/payload/qiongli-workflow/skills/H_submission/rebuttal-assistant.md +235 -0
- package/payload/qiongli-workflow/skills/H_submission/reviewer-empathy-checker.md +195 -0
- package/payload/qiongli-workflow/skills/H_submission/submission-packager.md +316 -0
- package/payload/qiongli-workflow/skills/I_code/code-builder.md +156 -0
- package/payload/qiongli-workflow/skills/I_code/code-execution.md +158 -0
- package/payload/qiongli-workflow/skills/I_code/code-planning.md +147 -0
- package/payload/qiongli-workflow/skills/I_code/code-review.md +239 -0
- package/payload/qiongli-workflow/skills/I_code/code-specification.md +170 -0
- package/payload/qiongli-workflow/skills/I_code/data-cleaning-planner.md +240 -0
- package/payload/qiongli-workflow/skills/I_code/data-merge-planner.md +231 -0
- package/payload/qiongli-workflow/skills/I_code/release-packager.md +286 -0
- package/payload/qiongli-workflow/skills/I_code/reproducibility-auditor.md +139 -0
- package/payload/qiongli-workflow/skills/I_code/stats-engine.md +226 -0
- package/payload/qiongli-workflow/skills/J_proofread/ai-fingerprint-scanner.md +150 -0
- package/payload/qiongli-workflow/skills/J_proofread/final-proofreader.md +193 -0
- package/payload/qiongli-workflow/skills/J_proofread/human-voice-rewriter.md +156 -0
- package/payload/qiongli-workflow/skills/J_proofread/similarity-checker.md +171 -0
- package/payload/qiongli-workflow/skills/K_presentation/beamer-builder.md +426 -0
- package/payload/qiongli-workflow/skills/K_presentation/presentation-planner.md +230 -0
- package/payload/qiongli-workflow/skills/K_presentation/slide-architect.md +246 -0
- package/payload/qiongli-workflow/skills/K_presentation/slidev-scholarly-builder.md +493 -0
- package/payload/qiongli-workflow/skills/Z_cross_cutting/academic-context-maintainer.md +279 -0
- package/payload/qiongli-workflow/skills/Z_cross_cutting/metadata-enricher.md +252 -0
- package/payload/qiongli-workflow/skills/Z_cross_cutting/model-collaborator.md +212 -0
- package/payload/qiongli-workflow/skills/Z_cross_cutting/self-critique.md +170 -0
- package/payload/qiongli-workflow/skills/domain-profiles/biomedical.yaml +166 -0
- package/payload/qiongli-workflow/skills/domain-profiles/business-management.yaml +132 -0
- package/payload/qiongli-workflow/skills/domain-profiles/cs-ai.yaml +149 -0
- package/payload/qiongli-workflow/skills/domain-profiles/custom-template.yaml +47 -0
- package/payload/qiongli-workflow/skills/domain-profiles/ecology-environmental.yaml +154 -0
- package/payload/qiongli-workflow/skills/domain-profiles/economics.yaml +146 -0
- package/payload/qiongli-workflow/skills/domain-profiles/education.yaml +150 -0
- package/payload/qiongli-workflow/skills/domain-profiles/epidemiology.yaml +157 -0
- package/payload/qiongli-workflow/skills/domain-profiles/finance.yaml +136 -0
- package/payload/qiongli-workflow/skills/domain-profiles/political-science.yaml +150 -0
- package/payload/qiongli-workflow/skills/domain-profiles/psychology.yaml +161 -0
- package/payload/qiongli-workflow/skills/registry.yaml +1391 -0
- package/payload/qiongli-workflow/skills-core.md +629 -0
- package/payload/qiongli-workflow/skills-summary.md +133 -0
- package/payload/qiongli-workflow/standards/agent-profiles.example.json +195 -0
- package/payload/qiongli-workflow/standards/agent-routing-policy.yaml +36 -0
- package/payload/qiongli-workflow/standards/agent-run-contract.yaml +50 -0
- package/payload/qiongli-workflow/standards/mcp-agent-capability-map.yaml +1889 -0
- package/payload/qiongli-workflow/standards/research-workflow-contract.yaml +1283 -0
- package/payload/qiongli-workflow/standards/solo-role-policy.yaml +35 -0
- package/payload/qiongli-workflow/templates/agent-handoff.md +37 -0
- package/payload/qiongli-workflow/templates/agent-review-packet.md +24 -0
- package/payload/qiongli-workflow/templates/agent-run-packet.json +17 -0
- package/payload/qiongli-workflow/templates/ai-disclosure.md +32 -0
- package/payload/qiongli-workflow/templates/analysis-plan.md +91 -0
- package/payload/qiongli-workflow/templates/author-contributions-credit.md +36 -0
- package/payload/qiongli-workflow/templates/citation-risk-report.md +26 -0
- package/payload/qiongli-workflow/templates/claim-evidence-ledger.csv +2 -0
- package/payload/qiongli-workflow/templates/claim-evidence-map.md +28 -0
- package/payload/qiongli-workflow/templates/code/advanced/jax_mle_template.py +85 -0
- package/payload/qiongli-workflow/templates/code/advanced/pytorch_custom_template.py +61 -0
- package/payload/qiongli-workflow/templates/code/economics/causal_did.py +45 -0
- package/payload/qiongli-workflow/templates/code/finance/portfolio_opt.py +47 -0
- package/payload/qiongli-workflow/templates/code/statistics/meta_analysis_metafor.R +98 -0
- package/payload/qiongli-workflow/templates/code/statistics/meta_analysis_random_effects.py +171 -0
- package/payload/qiongli-workflow/templates/coi-statement.md +18 -0
- package/payload/qiongli-workflow/templates/context-manifest.json +8 -0
- package/payload/qiongli-workflow/templates/cover-letter.md +34 -0
- package/payload/qiongli-workflow/templates/data-availability.md +27 -0
- package/payload/qiongli-workflow/templates/data-management-plan.md +42 -0
- package/payload/qiongli-workflow/templates/decision-log.md +18 -0
- package/payload/qiongli-workflow/templates/dedup-log.csv +1 -0
- package/payload/qiongli-workflow/templates/disagreement-matrix.md +11 -0
- package/payload/qiongli-workflow/templates/duo-review-report.md +17 -0
- package/payload/qiongli-workflow/templates/effect-size-extraction-table.md +59 -0
- package/payload/qiongli-workflow/templates/ethics-irb-pack.md +63 -0
- package/payload/qiongli-workflow/templates/ethics-statement.md +30 -0
- package/payload/qiongli-workflow/templates/evidence-ledger.md +28 -0
- package/payload/qiongli-workflow/templates/extraction-table.md +201 -0
- package/payload/qiongli-workflow/templates/figures-tables-plan.md +35 -0
- package/payload/qiongli-workflow/templates/funding-statement.md +24 -0
- package/payload/qiongli-workflow/templates/grade-summary-of-findings.md +170 -0
- package/payload/qiongli-workflow/templates/highlights.md +20 -0
- package/payload/qiongli-workflow/templates/implementation-intent.md +20 -0
- package/payload/qiongli-workflow/templates/interview-guide.md +39 -0
- package/payload/qiongli-workflow/templates/manuscript-outline.md +105 -0
- package/payload/qiongli-workflow/templates/manuscript-skeleton.md +42 -0
- package/payload/qiongli-workflow/templates/meta-analysis-plan.md +122 -0
- package/payload/qiongli-workflow/templates/meta-analysis-report.md +91 -0
- package/payload/qiongli-workflow/templates/method-diagnostic-report.md +17 -0
- package/payload/qiongli-workflow/templates/paper-note.md +207 -0
- package/payload/qiongli-workflow/templates/preregistration-template.md +38 -0
- package/payload/qiongli-workflow/templates/prisma-checklist.md +122 -0
- package/payload/qiongli-workflow/templates/prisma-flowchart.md +158 -0
- package/payload/qiongli-workflow/templates/protocol-template.md +300 -0
- package/payload/qiongli-workflow/templates/quality-gate-report.md +24 -0
- package/payload/qiongli-workflow/templates/quality-table.md +154 -0
- package/payload/qiongli-workflow/templates/rebuttal-letter.md +43 -0
- package/payload/qiongli-workflow/templates/rebuttal-response-matrix.md +26 -0
- package/payload/qiongli-workflow/templates/reporting-checklist.md +45 -0
- package/payload/qiongli-workflow/templates/research-state.md +64 -0
- package/payload/qiongli-workflow/templates/retrieval-manifest.csv +1 -0
- package/payload/qiongli-workflow/templates/rob2-table.md +157 -0
- package/payload/qiongli-workflow/templates/search-diagnostics.md +85 -0
- package/payload/qiongli-workflow/templates/search-log.md +234 -0
- package/payload/qiongli-workflow/templates/search-strategy.md +90 -0
- package/payload/qiongli-workflow/templates/solo-self-review.md +23 -0
- package/payload/qiongli-workflow/templates/solo-task-packet.md +22 -0
- package/payload/qiongli-workflow/templates/stage-handoff.md +29 -0
- package/payload/qiongli-workflow/templates/study-design.md +111 -0
- package/payload/qiongli-workflow/templates/submission-checklist.md +54 -0
- package/payload/qiongli-workflow/templates/suggested-reviewers.md +38 -0
- package/payload/qiongli-workflow/templates/supplementary-inventory.md +25 -0
- package/payload/qiongli-workflow/templates/survey-instrument.md +36 -0
- package/payload/qiongli-workflow/templates/synthesis-matrix.md +162 -0
- package/payload/qiongli-workflow/templates/title-page.md +57 -0
- package/payload/qiongli-workflow/templates/validity-threat-matrix.md +13 -0
- package/payload/qiongli-workflow/templates/writing-claim-map.md +22 -0
- package/payload/qiongli-workflow/venue-profiles/acl.yaml +26 -0
- package/payload/qiongli-workflow/venue-profiles/aom.yaml +27 -0
- package/payload/qiongli-workflow/venue-profiles/chi.yaml +26 -0
- package/payload/qiongli-workflow/venue-profiles/jama.yaml +29 -0
- package/payload/qiongli-workflow/venue-profiles/nature.yaml +28 -0
- package/payload/qiongli-workflow/venue-profiles/neurips.yaml +26 -0
- package/payload/qiongli-workflow/workflows/academic-present.md +100 -0
- package/payload/qiongli-workflow/workflows/academic-write.md +294 -0
- package/payload/qiongli-workflow/workflows/build-framework.md +181 -0
- package/payload/qiongli-workflow/workflows/code-build.md +114 -0
- package/payload/qiongli-workflow/workflows/compliance-check.md +55 -0
- package/payload/qiongli-workflow/workflows/ethics-check.md +41 -0
- package/payload/qiongli-workflow/workflows/find-gap.md +162 -0
- package/payload/qiongli-workflow/workflows/lit-review.md +244 -0
- package/payload/qiongli-workflow/workflows/paper-read.md +185 -0
- package/payload/qiongli-workflow/workflows/paper-write.md +88 -0
- package/payload/qiongli-workflow/workflows/paper.md +231 -0
- package/payload/qiongli-workflow/workflows/proofread.md +64 -0
- package/payload/qiongli-workflow/workflows/rebuttal.md +45 -0
- package/payload/qiongli-workflow/workflows/study-design.md +73 -0
- package/payload/qiongli-workflow/workflows/submission-prep.md +77 -0
- package/payload/qiongli-workflow/workflows/synthesize.md +71 -0
- package/python-runtime/LICENSE +21 -0
- package/python-runtime/bridges/__init__.py +4 -0
- package/python-runtime/bridges/base_bridge.py +314 -0
- package/python-runtime/bridges/claude_bridge.py +181 -0
- package/python-runtime/bridges/codex_bridge.py +144 -0
- package/python-runtime/bridges/command_runtime.py +37 -0
- package/python-runtime/bridges/context_package.py +116 -0
- package/python-runtime/bridges/critique_questions.py +99 -0
- package/python-runtime/bridges/errors.py +83 -0
- package/python-runtime/bridges/gemini_bridge.py +121 -0
- package/python-runtime/bridges/i18n.py +119 -0
- package/python-runtime/bridges/mcp_connectors.py +234 -0
- package/python-runtime/bridges/orchestrator.py +6132 -0
- package/python-runtime/bridges/providers/citation_graph.py +564 -0
- package/python-runtime/bridges/providers/fulltext_retrieval.py +843 -0
- package/python-runtime/bridges/providers/literature_artifacts.py +310 -0
- package/python-runtime/bridges/providers/literature_diagnostics.py +724 -0
- package/python-runtime/bridges/providers/literature_query.py +615 -0
- package/python-runtime/bridges/providers/literature_schema.py +41 -0
- package/python-runtime/bridges/providers/literature_search.py +654 -0
- package/python-runtime/bridges/providers/metadata_registry.py +1027 -0
- package/python-runtime/bridges/providers/overlay_runtime.py +78 -0
- package/python-runtime/bridges/providers/research_collab.py +1530 -0
- package/python-runtime/bridges/providers/s2_client.py +177 -0
- package/python-runtime/bridges/providers/screening_tracker.py +343 -0
- package/python-runtime/evals/academic_quality/README.md +3 -0
- package/python-runtime/evals/academic_quality/cases/code-first-methods.yaml +10 -0
- package/python-runtime/evals/academic_quality/cases/empirical-causal-design.yaml +10 -0
- package/python-runtime/evals/academic_quality/cases/qualitative-coding.yaml +10 -0
- package/python-runtime/evals/academic_quality/cases/reviewer-rebuttal.yaml +10 -0
- package/python-runtime/evals/academic_quality/cases/systematic-review.yaml +10 -0
- package/python-runtime/evals/academic_quality/cases/theory-contribution.yaml +10 -0
- package/python-runtime/evals/controller_modes/claude_primary_codex_review.json +36 -0
- package/python-runtime/evals/controller_modes/codex_primary_claude_review.json +36 -0
- package/python-runtime/evals/controller_modes/duo_disagreement.json +47 -0
- package/python-runtime/evals/controller_modes/solo_claude_code.json +34 -0
- package/python-runtime/evals/controller_modes/solo_codex_writing.json +34 -0
- package/python-runtime/evals/controller_modes/verification_blocked.json +37 -0
- package/python-runtime/pipelines/code-first-methods.yaml +92 -0
- package/python-runtime/pipelines/empirical-study.yaml +180 -0
- package/python-runtime/pipelines/qualitative-study.yaml +162 -0
- package/python-runtime/pipelines/rct-prereg.yaml +85 -0
- package/python-runtime/pipelines/systematic-review-prisma.yaml +114 -0
- package/python-runtime/pipelines/theory-paper.yaml +71 -0
- package/python-runtime/qiongli/__init__.py +5 -0
- package/python-runtime/qiongli/cli.py +890 -0
- package/python-runtime/qiongli/install_manifest.tsv +6 -0
- package/python-runtime/qiongli/multi_agent_smoke.py +642 -0
- package/python-runtime/qiongli/project.toml +14 -0
- package/python-runtime/qiongli/skill_docs.py +566 -0
- package/python-runtime/qiongli/team_run_acceptance.py +147 -0
- package/python-runtime/qiongli/universal_installer.py +839 -0
- package/python-runtime/qiongli/workflow_contract_doc.py +282 -0
- package/python-runtime/roles/academic-code-reviewer.yaml +33 -0
- package/python-runtime/roles/compliance-officer.yaml +30 -0
- package/python-runtime/roles/data-agent.yaml +35 -0
- package/python-runtime/roles/literature-ra.yaml +34 -0
- package/python-runtime/roles/methods-lead.yaml +34 -0
- package/python-runtime/roles/pi.yaml +33 -0
- package/python-runtime/roles/research-orchestrator.yaml +32 -0
- package/python-runtime/roles/science-writer.yaml +40 -0
- package/python-runtime/roles/statistician.yaml +34 -0
- package/python-runtime/roles/theory-agent.yaml +32 -0
- package/python-runtime/schemas/artifact-types.yaml +598 -0
- package/python-runtime/schemas/domain-profile.schema.json +256 -0
- package/python-runtime/schemas/skill.schema.json +155 -0
- package/python-runtime/scripts/add_missing_sections.py +303 -0
- package/python-runtime/scripts/audit_agent_handoffs.py +102 -0
- package/python-runtime/scripts/audit_citation_risk.py +72 -0
- package/python-runtime/scripts/audit_evidence_contract.py +110 -0
- package/python-runtime/scripts/audit_literature_search_quality.py +326 -0
- package/python-runtime/scripts/audit_method_diagnostics.py +57 -0
- package/python-runtime/scripts/audit_skill_resource_links.py +67 -0
- package/python-runtime/scripts/audit_skill_sections.py +283 -0
- package/python-runtime/scripts/audit_solo_role_gates.py +247 -0
- package/python-runtime/scripts/audit_stage_handoffs.py +60 -0
- package/python-runtime/scripts/audit_venue_profiles.py +67 -0
- package/python-runtime/scripts/bootstrap_qiongli.ps1 +804 -0
- package/python-runtime/scripts/bootstrap_qiongli.py +88 -0
- package/python-runtime/scripts/bootstrap_qiongli.sh +752 -0
- package/python-runtime/scripts/build_marketplace_artifacts.py +162 -0
- package/python-runtime/scripts/bump-version.sh +31 -0
- package/python-runtime/scripts/capture_team_run_acceptance.py +102 -0
- package/python-runtime/scripts/changelog_section.py +72 -0
- package/python-runtime/scripts/gemini_session_broker.py +99 -0
- package/python-runtime/scripts/generate_release_notes.sh +251 -0
- package/python-runtime/scripts/generate_skill_docs.py +25 -0
- package/python-runtime/scripts/generate_workflow_contract_doc.py +22 -0
- package/python-runtime/scripts/inject_project_toml.sh +45 -0
- package/python-runtime/scripts/install_qiongli.sh +1032 -0
- package/python-runtime/scripts/materialize_literature_search_bundle.py +39 -0
- package/python-runtime/scripts/mcp_citation_graph.py +42 -0
- package/python-runtime/scripts/mcp_fulltext_retrieval.py +42 -0
- package/python-runtime/scripts/mcp_metadata_registry.py +131 -0
- package/python-runtime/scripts/mcp_research_collab.py +99 -0
- package/python-runtime/scripts/mcp_scholarly_search.py +36 -0
- package/python-runtime/scripts/mcp_screening_tracker.py +39 -0
- package/python-runtime/scripts/npm_preflight.sh +37 -0
- package/python-runtime/scripts/pypi_preflight.sh +138 -0
- package/python-runtime/scripts/qiongli_cli.sh +519 -0
- package/python-runtime/scripts/qiongli_update.py +11 -0
- package/python-runtime/scripts/release_automation.sh +283 -0
- package/python-runtime/scripts/release_postflight.sh +533 -0
- package/python-runtime/scripts/release_preflight.sh +302 -0
- package/python-runtime/scripts/release_ready.sh +199 -0
- package/python-runtime/scripts/run_academic_quality_evals.py +72 -0
- package/python-runtime/scripts/run_beta_smoke.sh +157 -0
- package/python-runtime/scripts/run_controller_mode_evals.py +300 -0
- package/python-runtime/scripts/run_literature_smoke.sh +10 -0
- package/python-runtime/scripts/smoke_multi_agent.py +15 -0
- package/python-runtime/scripts/sync_npm_package_payload.py +82 -0
- package/python-runtime/scripts/sync_skill_package.sh +159 -0
- package/python-runtime/scripts/sync_versions.py +212 -0
- package/python-runtime/scripts/upgrade_skill_contract_sections.py +169 -0
- package/python-runtime/scripts/validate_project_artifacts.py +634 -0
- package/python-runtime/scripts/validate_research_standard.py +2730 -0
- package/python-runtime/scripts/verify_release_tag_version.sh +267 -0
- package/python-runtime/skills/A_framing/contribution-crafter.md +99 -0
- package/python-runtime/skills/A_framing/gap-analyzer.md +293 -0
- package/python-runtime/skills/A_framing/hypothesis-generator.md +237 -0
- package/python-runtime/skills/A_framing/question-refiner.md +212 -0
- package/python-runtime/skills/A_framing/theory-mapper.md +292 -0
- package/python-runtime/skills/A_framing/venue-analyzer.md +209 -0
- package/python-runtime/skills/B_literature/academic-searcher.md +454 -0
- package/python-runtime/skills/B_literature/citation-formatter.md +300 -0
- package/python-runtime/skills/B_literature/citation-snowballer.md +326 -0
- package/python-runtime/skills/B_literature/concept-extractor.md +225 -0
- package/python-runtime/skills/B_literature/fulltext-fetcher.md +312 -0
- package/python-runtime/skills/B_literature/literature-mapper.md +226 -0
- package/python-runtime/skills/B_literature/paper-extractor.md +304 -0
- package/python-runtime/skills/B_literature/paper-screener.md +292 -0
- package/python-runtime/skills/B_literature/reference-manager-bridge.md +349 -0
- package/python-runtime/skills/C_design/data-dictionary-builder.md +207 -0
- package/python-runtime/skills/C_design/data-management-plan.md +137 -0
- package/python-runtime/skills/C_design/dataset-finder.md +216 -0
- package/python-runtime/skills/C_design/prereg-writer.md +289 -0
- package/python-runtime/skills/C_design/rival-hypothesis-designer.md +208 -0
- package/python-runtime/skills/C_design/robustness-planner.md +203 -0
- package/python-runtime/skills/C_design/study-designer.md +312 -0
- package/python-runtime/skills/C_design/variable-constructor.md +206 -0
- package/python-runtime/skills/C_design/variable-operationalizer.md +232 -0
- package/python-runtime/skills/D_ethics/deidentification-planner.md +211 -0
- package/python-runtime/skills/D_ethics/ethics-irb-helper.md +233 -0
- package/python-runtime/skills/D_ethics/statement-generator.md +96 -0
- package/python-runtime/skills/E_synthesis/effect-size-calculator.md +111 -0
- package/python-runtime/skills/E_synthesis/evidence-synthesizer.md +235 -0
- package/python-runtime/skills/E_synthesis/publication-bias-checker.md +211 -0
- package/python-runtime/skills/E_synthesis/qualitative-coding.md +107 -0
- package/python-runtime/skills/E_synthesis/quality-assessor.md +366 -0
- package/python-runtime/skills/F_writing/analysis-interpreter.md +311 -0
- package/python-runtime/skills/F_writing/discussion-writer.md +107 -0
- package/python-runtime/skills/F_writing/effect-size-interpreter.md +193 -0
- package/python-runtime/skills/F_writing/figure-specifier.md +260 -0
- package/python-runtime/skills/F_writing/manuscript-architect.md +314 -0
- package/python-runtime/skills/F_writing/meta-optimizer.md +203 -0
- package/python-runtime/skills/F_writing/table-generator.md +230 -0
- package/python-runtime/skills/G_compliance/prisma-checker.md +322 -0
- package/python-runtime/skills/G_compliance/reporting-checker.md +319 -0
- package/python-runtime/skills/G_compliance/tone-normalizer.md +202 -0
- package/python-runtime/skills/H_submission/credit-taxonomy-helper.md +193 -0
- package/python-runtime/skills/H_submission/fatal-flaw-detector.md +211 -0
- package/python-runtime/skills/H_submission/limitation-auditor.md +103 -0
- package/python-runtime/skills/H_submission/peer-review-simulation.md +258 -0
- package/python-runtime/skills/H_submission/rebuttal-assistant.md +235 -0
- package/python-runtime/skills/H_submission/reviewer-empathy-checker.md +195 -0
- package/python-runtime/skills/H_submission/submission-packager.md +316 -0
- package/python-runtime/skills/I_code/code-builder.md +156 -0
- package/python-runtime/skills/I_code/code-execution.md +158 -0
- package/python-runtime/skills/I_code/code-planning.md +147 -0
- package/python-runtime/skills/I_code/code-review.md +239 -0
- package/python-runtime/skills/I_code/code-specification.md +170 -0
- package/python-runtime/skills/I_code/data-cleaning-planner.md +240 -0
- package/python-runtime/skills/I_code/data-merge-planner.md +231 -0
- package/python-runtime/skills/I_code/release-packager.md +286 -0
- package/python-runtime/skills/I_code/reproducibility-auditor.md +139 -0
- package/python-runtime/skills/I_code/stats-engine.md +226 -0
- package/python-runtime/skills/J_proofread/ai-fingerprint-scanner.md +150 -0
- package/python-runtime/skills/J_proofread/final-proofreader.md +193 -0
- package/python-runtime/skills/J_proofread/human-voice-rewriter.md +156 -0
- package/python-runtime/skills/J_proofread/similarity-checker.md +171 -0
- package/python-runtime/skills/K_presentation/beamer-builder.md +426 -0
- package/python-runtime/skills/K_presentation/presentation-planner.md +230 -0
- package/python-runtime/skills/K_presentation/slide-architect.md +246 -0
- package/python-runtime/skills/K_presentation/slidev-scholarly-builder.md +493 -0
- package/python-runtime/skills/Z_cross_cutting/academic-context-maintainer.md +279 -0
- package/python-runtime/skills/Z_cross_cutting/metadata-enricher.md +252 -0
- package/python-runtime/skills/Z_cross_cutting/model-collaborator.md +212 -0
- package/python-runtime/skills/Z_cross_cutting/self-critique.md +170 -0
- package/python-runtime/skills/domain-profiles/biomedical.yaml +166 -0
- package/python-runtime/skills/domain-profiles/business-management.yaml +132 -0
- package/python-runtime/skills/domain-profiles/cs-ai.yaml +149 -0
- package/python-runtime/skills/domain-profiles/custom-template.yaml +47 -0
- package/python-runtime/skills/domain-profiles/ecology-environmental.yaml +154 -0
- package/python-runtime/skills/domain-profiles/economics.yaml +146 -0
- package/python-runtime/skills/domain-profiles/education.yaml +150 -0
- package/python-runtime/skills/domain-profiles/epidemiology.yaml +157 -0
- package/python-runtime/skills/domain-profiles/finance.yaml +136 -0
- package/python-runtime/skills/domain-profiles/political-science.yaml +150 -0
- package/python-runtime/skills/domain-profiles/psychology.yaml +161 -0
- package/python-runtime/skills/registry.yaml +1391 -0
- package/python-runtime/skills-core.md +629 -0
- package/python-runtime/skills-summary.md +133 -0
- package/python-runtime/standards/agent-profiles.example.json +195 -0
- package/python-runtime/standards/agent-routing-policy.yaml +36 -0
- package/python-runtime/standards/agent-run-contract.yaml +50 -0
- package/python-runtime/standards/mcp-agent-capability-map.yaml +1889 -0
- package/python-runtime/standards/research-workflow-contract.yaml +1283 -0
- package/python-runtime/standards/solo-role-policy.yaml +35 -0
- package/python-runtime/templates/CLAUDE.project.md +50 -0
- package/python-runtime/templates/agent-handoff.md +37 -0
- package/python-runtime/templates/agent-review-packet.md +24 -0
- package/python-runtime/templates/agent-run-packet.json +17 -0
- package/python-runtime/templates/ai-disclosure.md +32 -0
- package/python-runtime/templates/analysis-plan.md +91 -0
- package/python-runtime/templates/author-contributions-credit.md +36 -0
- package/python-runtime/templates/citation-risk-report.md +26 -0
- package/python-runtime/templates/claim-evidence-ledger.csv +2 -0
- package/python-runtime/templates/claim-evidence-map.md +28 -0
- package/python-runtime/templates/code/advanced/jax_mle_template.py +85 -0
- package/python-runtime/templates/code/advanced/pytorch_custom_template.py +61 -0
- package/python-runtime/templates/code/economics/causal_did.py +45 -0
- package/python-runtime/templates/code/finance/portfolio_opt.py +47 -0
- package/python-runtime/templates/code/statistics/meta_analysis_metafor.R +98 -0
- package/python-runtime/templates/code/statistics/meta_analysis_random_effects.py +171 -0
- package/python-runtime/templates/coi-statement.md +18 -0
- package/python-runtime/templates/context-manifest.json +8 -0
- package/python-runtime/templates/cover-letter.md +34 -0
- package/python-runtime/templates/data-availability.md +27 -0
- package/python-runtime/templates/data-management-plan.md +42 -0
- package/python-runtime/templates/decision-log.md +18 -0
- package/python-runtime/templates/dedup-log.csv +1 -0
- package/python-runtime/templates/disagreement-matrix.md +11 -0
- package/python-runtime/templates/duo-review-report.md +17 -0
- package/python-runtime/templates/effect-size-extraction-table.md +59 -0
- package/python-runtime/templates/ethics-irb-pack.md +63 -0
- package/python-runtime/templates/ethics-statement.md +30 -0
- package/python-runtime/templates/evidence-ledger.md +28 -0
- package/python-runtime/templates/extraction-table.md +201 -0
- package/python-runtime/templates/figures-tables-plan.md +35 -0
- package/python-runtime/templates/funding-statement.md +24 -0
- package/python-runtime/templates/grade-summary-of-findings.md +170 -0
- package/python-runtime/templates/highlights.md +20 -0
- package/python-runtime/templates/implementation-intent.md +20 -0
- package/python-runtime/templates/interview-guide.md +39 -0
- package/python-runtime/templates/manuscript-outline.md +105 -0
- package/python-runtime/templates/manuscript-skeleton.md +42 -0
- package/python-runtime/templates/meta-analysis-plan.md +122 -0
- package/python-runtime/templates/meta-analysis-report.md +91 -0
- package/python-runtime/templates/method-diagnostic-report.md +17 -0
- package/python-runtime/templates/paper-note.md +207 -0
- package/python-runtime/templates/preregistration-template.md +38 -0
- package/python-runtime/templates/prisma-checklist.md +122 -0
- package/python-runtime/templates/prisma-flowchart.md +158 -0
- package/python-runtime/templates/protocol-template.md +300 -0
- package/python-runtime/templates/quality-gate-report.md +24 -0
- package/python-runtime/templates/quality-table.md +154 -0
- package/python-runtime/templates/rebuttal-letter.md +43 -0
- package/python-runtime/templates/rebuttal-response-matrix.md +26 -0
- package/python-runtime/templates/reporting-checklist.md +45 -0
- package/python-runtime/templates/research-state.md +64 -0
- package/python-runtime/templates/retrieval-manifest.csv +1 -0
- package/python-runtime/templates/rob2-table.md +157 -0
- package/python-runtime/templates/search-diagnostics.md +85 -0
- package/python-runtime/templates/search-log.md +234 -0
- package/python-runtime/templates/search-strategy.md +90 -0
- package/python-runtime/templates/solo-self-review.md +23 -0
- package/python-runtime/templates/solo-task-packet.md +22 -0
- package/python-runtime/templates/stage-handoff.md +29 -0
- package/python-runtime/templates/study-design.md +111 -0
- package/python-runtime/templates/submission-checklist.md +54 -0
- package/python-runtime/templates/suggested-reviewers.md +38 -0
- package/python-runtime/templates/supplementary-inventory.md +25 -0
- package/python-runtime/templates/survey-instrument.md +36 -0
- package/python-runtime/templates/synthesis-matrix.md +162 -0
- package/python-runtime/templates/title-page.md +57 -0
- package/python-runtime/templates/validity-threat-matrix.md +13 -0
- package/python-runtime/templates/writing-claim-map.md +22 -0
- package/python-runtime/venue-profiles/acl.yaml +26 -0
- package/python-runtime/venue-profiles/aom.yaml +27 -0
- package/python-runtime/venue-profiles/chi.yaml +26 -0
- package/python-runtime/venue-profiles/jama.yaml +29 -0
- package/python-runtime/venue-profiles/nature.yaml +28 -0
- 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`.
|
package/bin/qiongli.mjs
ADDED
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,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
|
+
}
|