返回 Skill 列表
extension
分类: 效率与办公无需 API Key

revman-studio

Study-centric data management for systematic reviews. Add, edit, view, import, and remove studies with arm-level and outcome-level data. Use when the user types `revman studio`.

person作者: TashanworldhubOpenAPI

RevMan Study Studio

Context

Manages the study-centric data model under reviews/<short_name>/.revman/studies/. Read references/study-schema.md before reading or writing any study files.

Active review is already resolved by the orchestrator. The REVIEW_DIR path is passed as context.


Commands

revman studio

List all studies in the active review.

Procedure:

  1. Read {REVIEW_DIR}/.revman/studies/index.json.

  2. If no studies exist, show:

    No studies yet. Add one with `revman studio add`.
    
  3. For each study in the index, read the study file and display a table:

    Studies in "{title}"  (total: N)
    
    ID     Citation                    Year  Design  Arms  Outcomes
    ────   ───────                     ────  ──────  ────  ────────
    s001   Author et al. 2020          2020  RCT     2     3
    s002   Researcher et al. 2021      2021  cohort  2     1
    
    Commands:
      revman studio add              Add a new study
      revman studio show <id>        Show study details
      revman studio edit <id>        Edit a study
      revman studio rm <id>          Remove a study
      revman studio import <file>    Import studies from JSON/CSV
    

revman studio add

Add a new study interactively.

Procedure:

  1. Read index.json to get next_id. Generate study_id = s{next_id} padded to 3 digits (e.g., s001, s010, s100).

  2. Collect required fields one by one:

    | Prompt | Field | Default | |--------|-------|---------| | "Citation:" | citation | — | | "Title:" | title | — | | "Year:" | year | — | | "Design (RCT/cohort/case-control/etc):" | design | RCT | | "Setting:" | setting | — | | "Country:" | country | — | | "Population:" | population | — | | "Total sample size:" | sample_size | — |

  3. Add arms. For each arm:

    • "Arm label (e.g., Intervention):" → label
    • "Description:" → description
    • "Number of participants (n):" → n
    • "Add another arm? (y/n):" → loop or stop
    • Auto-generate arm_ids: a1, a2, a3...
  4. Ask: "Add outcomes now? (y/n):" If yes, for each outcome:

    • "Outcome label:" → label
    • "Timepoint:" → timepoint
    • "Data type (dichotomous/continuous):" → data_type
    • For each arm, collect data:
      • Dichotomous: "Events in {arm_label}:" + "Total in {arm_label}:"
      • Continuous: "Mean in {arm_label}:" + "SD in {arm_label}:" + "N in {arm_label}:"
    • "Add another outcome? (y/n):" → loop or stop
    • Auto-generate outcome_ids: o1, o2, o3...
  5. Write study file to {REVIEW_DIR}/.revman/studies/{study_id}.json.

  6. Update index.json: append study_id, increment next_id.

  7. Confirm: "Added study {study_id}: {citation}"

revman studio show <study_id>

Display full study details.

Procedure:

  1. Read {REVIEW_DIR}/.revman/studies/{study_id}.json.

  2. If not found, error: "Study {study_id} not found."

  3. Display:

    Study: {study_id}
    Citation: {citation}
    Title: {title} ({year})
    Design: {design}  |  Setting: {setting}  |  Country: {country}
    Population: {population}
    Sample size: {sample_size}
    
    Arms:
      {arm_id}  {label:20}  n={n}
    
    Outcomes:
      {outcome_id}  {label:30}  {data_type:15}  {timepoint}
      Arm data: {arm_id}={events}/{total} ...
    

revman studio edit <study_id>

Edit a study's fields.

Procedure:

  1. Read the study file. Display current values.
  2. Ask: "Field to edit (citation/title/year/design/setting/country/population/sample_size/arms/outcomes/notes):"
  3. Update the specified field. For arms/outcomes, re-enter the full array.
  4. Save file and confirm.

revman studio rm <study_id>

Remove a study and all its data.

Procedure:

  1. Confirm: "Remove study {study_id} ({citation})? This cannot be undone. Type yes to confirm."
  2. If confirmed, delete the study file.
  3. Update index.json: remove from list.
  4. Confirm: "Removed study {study_id}."

revman studio import <file>

Import studies from a JSON or CSV file.

Procedure:

  1. Check file exists. Error if not.
  2. Detect format from extension (.json or .csv).
  3. For JSON: expect an array of study objects matching the study schema.
  4. For CSV: expect columns matching study fields. Parse accordingly.
  5. For each study in the import:
    • Generate new study_id (don't keep imported IDs to avoid collisions).
    • Write study file.
    • Update index.
  6. Report: "Imported {N} studies."

Files

| File | Location | Purpose | |------|----------|---------| | Study files | {REVIEW_DIR}/.revman/studies/s*.json | Per-study data | | Index | {REVIEW_DIR}/.revman/studies/index.json | Study registry + next_id |


Error Handling

| Situation | Response | |-----------|----------| | No index.json | Initialize it: {"studies":[],"next_id":1} | | Study file missing but in index | Remove from index, warn: "Study {id} missing. Removed from index." | | Invalid data_type | "Data type must be dichotomous or continuous." | | Empty arms list | "Each study needs at least one arm." | | Import file not found | "File {path} not found." | | Unknown import format | "Supported formats: .json, .csv" |