v0.20 alpha skill-driven python core
This commit is contained in:
@@ -1,25 +1,17 @@
|
||||
# Codex Command: dr-finalize
|
||||
|
||||
You are dr-editor-in-chief. The user requested `/dr-finalize $ARGUMENTS`.
|
||||
Codex is a surface adapter for v0.20. Chinese-native finalization is the default.
|
||||
|
||||
Goal: run Phase 4 in Codex native mode.
|
||||
|
||||
Steps:
|
||||
1. Resolve `$ARGUMENTS` as project slug.
|
||||
2. Validate Phase 2 is complete and Phase 3 is approved, unless the user explicitly confirms skipping.
|
||||
3. Assemble `phase4/final_en.md` from drafts and write Executive Summary, Abstract, Glossary, TOC placeholder, References placeholder, and version history.
|
||||
4. Run deterministic pipeline:
|
||||
Run:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --translate-workers 4 --glossary-workers 4 --polish-workers 4
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS
|
||||
```
|
||||
|
||||
5. If network/API errors occur, rerun with lower workers:
|
||||
Legacy English-to-Chinese pipeline is opt-in only:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug> --translate-workers 1 --glossary-workers 3 --polish-workers 1
|
||||
uv run python scripts/dr.py finalize $ARGUMENTS --legacy-translate
|
||||
```
|
||||
|
||||
6. Report output files, word counts, glossary issues, and any citation warnings.
|
||||
|
||||
Do not translate or polish the full report manually in one LLM response.
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
# Codex Command: dr-frame
|
||||
|
||||
You are dr-plan. The user requested `/dr-frame $ARGUMENTS`.
|
||||
Thin wrapper around the platform-neutral Python core.
|
||||
|
||||
Goal: generate Phase 1 bilingual framework for the target project.
|
||||
Run:
|
||||
|
||||
Steps:
|
||||
1. Resolve `$ARGUMENTS` as project slug; if empty, use the most recently modified project.
|
||||
2. Read `manifest.json` and validate Phase 1 interview is complete.
|
||||
3. Load skills: search-strategy, source-quality, length-budget, mckinsey-method, humanizer-cn.
|
||||
4. Spawn 3-4 `dr-searcher` subagents in parallel for MECE keyword groups. Wait for all results.
|
||||
5. Synthesize `phase1/initial-scan.md`.
|
||||
6. Write `phase1/framework.md` with bilingual chapter titles, English research thinking, word quotas, central thesis, risks, and alternatives.
|
||||
7. Update manifest Phase 1 fields.
|
||||
8. Stop and ask the user to approve the framework before Phase 2.
|
||||
```bash
|
||||
uv run python scripts/dr.py frame $ARGUMENTS
|
||||
```
|
||||
|
||||
Do not do Phase 2 research in this command.
|
||||
Stop after writing `phase1/framework.md`; wait for user approval before Phase 2.
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# Codex Command: dr-init
|
||||
|
||||
You are dr-plan. The user requested `/dr-init $ARGUMENTS`.
|
||||
Thin wrapper around the platform-neutral Python core.
|
||||
|
||||
Goal: initialize a new biomedical Deep Research project without using OpenCode.
|
||||
Run:
|
||||
|
||||
Follow AGENTS.md, then:
|
||||
1. Interview the user with the 8 required questions from AGENTS.md and the existing OpenCode workflow.
|
||||
2. Propose 3 formal report title/subtitle candidates.
|
||||
3. After the user chooses, create `projects/<slug>/manifest.json` and the phase directories.
|
||||
4. Write the interview transcript to `projects/<slug>/phase1/interview.md`.
|
||||
5. Stop after initialization. Do not run `/dr-frame`.
|
||||
```bash
|
||||
uv run python scripts/dr.py init $ARGUMENTS
|
||||
```
|
||||
|
||||
Use Codex custom agent `dr-plan` if spawning is needed, but this command can usually run in the main thread.
|
||||
Stop after initialization. Next step is `dr-frame`.
|
||||
|
||||
@@ -1,18 +1,41 @@
|
||||
# Codex Command: dr-research
|
||||
|
||||
You are dr-pm. The user requested `/dr-research $ARGUMENTS`.
|
||||
Codex is a surface adapter for v0.20. Core Phase 2 orchestration lives in Python.
|
||||
|
||||
Goal: run Phase 2 deep research using Codex custom subagents.
|
||||
Run:
|
||||
|
||||
Steps:
|
||||
1. Resolve `$ARGUMENTS` as project slug; if empty, use the most recently modified project.
|
||||
2. Validate `phase1.approved == true` and framework exists.
|
||||
3. Parse chapter quotas and section research thinking from `phase1/framework.md`.
|
||||
4. Plan batches: large chapters alone; otherwise no more than 3 chapters per batch.
|
||||
5. For each batch, spawn `dr-analyst` subagents in parallel, one per chapter.
|
||||
6. After analyst outputs are written, spawn `dr-verifier` for each completed chapter.
|
||||
7. Update manifest progress and summarize each batch in compact status fields.
|
||||
8. Deduplicate `phase2/sources.jsonl`.
|
||||
9. Report totals and stop before Phase 3.
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6
|
||||
```
|
||||
|
||||
Do not write the final report.
|
||||
Fill packets with model workers:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --execute-packets
|
||||
```
|
||||
|
||||
For low-cost smoke tests where generic fallback is acceptable:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --execute-packets --allow-search-fallback
|
||||
```
|
||||
|
||||
Aggregate packets into chapter briefs:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --build-briefs
|
||||
```
|
||||
|
||||
Assemble Chinese chapter drafts:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --assemble-chapters
|
||||
```
|
||||
|
||||
Preview:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py research $ARGUMENTS --workers 6 --dry-run
|
||||
```
|
||||
|
||||
Do not perform chapter research in the Codex thread. Report the task-card and packet paths created by the CLI.
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# Codex Command: dr-review
|
||||
|
||||
You are dr-chief-editor. The user requested `/dr-review $ARGUMENTS`.
|
||||
Thin wrapper around the platform-neutral Python core.
|
||||
|
||||
Goal: perform Phase 3 whole-report editorial review.
|
||||
Run:
|
||||
|
||||
Steps:
|
||||
1. Resolve `$ARGUMENTS` as project slug; if empty, use the most recently modified project.
|
||||
2. Validate `phase2.status == "completed"`.
|
||||
3. Read framework, all drafts, all evidence files, sources.jsonl, and manifest.
|
||||
4. Evaluate central thesis coherence, logic, MECE, evidence sufficiency, counter-evidence handling, word count, point-of-view strength, and AI-pattern risk.
|
||||
5. Write `projects/<slug>/phase3/critique.md`.
|
||||
6. Report rating A/B/C/D and must-fix items.
|
||||
7. Stop and wait for user decision. Do not enter Phase 4.
|
||||
```bash
|
||||
uv run python scripts/dr.py review $ARGUMENTS
|
||||
```
|
||||
|
||||
Stop after writing `phase3/critique.md`; wait for user decision before Phase 4.
|
||||
|
||||
@@ -1,77 +1,17 @@
|
||||
# Codex Command: dr-run
|
||||
|
||||
You are the Deep Research PM main thread for `/dr-run $ARGUMENTS`.
|
||||
Codex is a surface adapter for v0.20. Do not spawn Codex subagents for the core workflow.
|
||||
|
||||
This command is the Codex equivalent of letting `dr-pm` own orchestration. Do not ask the user to run each phase manually. Inspect the project state, continue from the correct phase, spawn the required Codex custom agents, wait for their results, and only pause at the defined human decision gates.
|
||||
|
||||
## Resolve Target
|
||||
|
||||
1. Treat `$ARGUMENTS` as either a project slug/path or a new research topic.
|
||||
2. If it matches an existing project, load `projects/<slug>/manifest.json` and continue from its current status.
|
||||
3. If it is a new topic, run Phase 1 initialization and create the project structure before planning.
|
||||
4. If `$ARGUMENTS` is empty, use the most recently modified project and confirm the inferred slug in your first status update.
|
||||
|
||||
## Global Rules
|
||||
|
||||
- Follow `AGENTS.md`, all relevant `.agents/skills/*/SKILL.md`, and the project `manifest.json`.
|
||||
- Keep `projects/**` research artifacts out of system commits unless the user explicitly asks to commit research output.
|
||||
- Use Codex subagents deliberately: spawn them when parallel work materially advances the phase, wait for results, and consolidate before moving on.
|
||||
- Do not simulate subagent work in the main thread when the task calls for independent review, chapter research, or counter-evidence.
|
||||
- Respect the required pause gates:
|
||||
- Stop after Phase 1 framework is ready and ask the user to approve or revise it.
|
||||
- Stop after Phase 3 critique is ready and ask whether to fix, rerun Phase 2, or restart.
|
||||
- Ask for approval before expensive broad web searches, long-running external API work, or irreversible file operations.
|
||||
|
||||
## Phase 1: Framework Planning
|
||||
|
||||
Run this phase when there is no approved `phase1/framework.md`.
|
||||
|
||||
1. Spawn `dr-plan` to interview the user if the topic is underspecified.
|
||||
2. Spawn `dr-searcher` workers in parallel for initial source discovery across scientific, regulatory, clinical, commercial, and patent angles.
|
||||
3. Have `dr-plan` synthesize a MECE framework with chapter-level word budgets and source strategy.
|
||||
4. Write `phase1/interview.md`, `phase1/initial-scan.md`, and `phase1/framework.md`.
|
||||
5. Update `manifest.json` and stop for user framework approval.
|
||||
|
||||
## Phase 2: Deep Research
|
||||
|
||||
Run this phase when `phase1.approved == true` and Phase 2 is incomplete.
|
||||
|
||||
1. Act as `dr-pm`: parse `phase1/framework.md`, create chapter batches, and keep the main thread focused on orchestration.
|
||||
2. Spawn `dr-analyst` subagents in parallel, one per chapter or chapter group depending on size.
|
||||
3. Require each analyst to write English chapter drafts plus evidence matrices.
|
||||
4. After analyst outputs are present, spawn independent `dr-verifier` subagents for counter-evidence and source-quality checks.
|
||||
5. Reconcile verifier findings into the relevant evidence files and chapter TODOs.
|
||||
6. Deduplicate and normalize `phase2/sources.jsonl`.
|
||||
7. Update `manifest.json` and continue to Phase 3 unless the evidence base is materially inadequate.
|
||||
|
||||
## Phase 3: Chief Editor Review
|
||||
|
||||
Run this phase when Phase 2 is complete and Phase 3 is incomplete.
|
||||
|
||||
1. Spawn `dr-chief-editor` as a read-only reviewer.
|
||||
2. Have it assess MECE structure, evidence sufficiency, unsupported claims, source quality, chapter balance, and executive-level narrative.
|
||||
3. Write `phase3/critique.md`.
|
||||
4. Stop for user decision: targeted fix, rerun Phase 2 for weak chapters, or restart framework.
|
||||
|
||||
## Phase 4: Finalization
|
||||
|
||||
Run this phase only after the user approves Phase 3.
|
||||
|
||||
1. Spawn `dr-editor-in-chief` to merge English drafts into `phase4/final_en.md`, Executive Summary, Abstract, and glossary seed.
|
||||
2. Run the deterministic pipeline with:
|
||||
Run the project-owned Python core:
|
||||
|
||||
```bash
|
||||
uv run python scripts/dr.py finalize <slug>
|
||||
uv run python scripts/dr.py run $ARGUMENTS --workers 6
|
||||
```
|
||||
|
||||
3. If needed, spawn `dr-reporter` for final PDF/DOCX validation and citation backfill checks.
|
||||
4. Report final artifact paths and remaining risks.
|
||||
For a preview:
|
||||
|
||||
## Status Discipline
|
||||
```bash
|
||||
uv run python scripts/dr.py run $ARGUMENTS --workers 6 --dry-run
|
||||
```
|
||||
|
||||
Give concise progress updates after each phase or batch. Always say:
|
||||
|
||||
- current phase
|
||||
- agents spawned and why
|
||||
- files produced or changed
|
||||
- whether the workflow is continuing or waiting for user decision
|
||||
Report only the CLI phase decision, produced files, and next step.
|
||||
|
||||
Reference in New Issue
Block a user