mednotes-opencode 0.1.0
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/.opencode/agents/med-chat-triager.md +204 -0
- package/.opencode/agents/med-flashcard-maker.md +63 -0
- package/.opencode/agents/med-knowledge-architect.md +230 -0
- package/.opencode/agents/med-link-graph-curator.md +177 -0
- package/.opencode/agents/med-publish-guard.md +62 -0
- package/.opencode/commands/flashcards.md +25 -0
- package/.opencode/commands/mednotes/create.md +25 -0
- package/.opencode/commands/mednotes/enrich.md +27 -0
- package/.opencode/commands/mednotes/fix-wiki.md +27 -0
- package/.opencode/commands/mednotes/history.md +22 -0
- package/.opencode/commands/mednotes/link-body.md +25 -0
- package/.opencode/commands/mednotes/link-related.md +27 -0
- package/.opencode/commands/mednotes/link.md +27 -0
- package/.opencode/commands/mednotes/pdf-library.md +27 -0
- package/.opencode/commands/mednotes/process-chats.md +23 -0
- package/.opencode/commands/mednotes/setup.md +21 -0
- package/.opencode/commands/mednotes/status.md +27 -0
- package/.opencode/commands/mednotes/telemetry.md +27 -0
- package/.opencode/commands/report.md +26 -0
- package/.opencode/mednotes/AGENTS.md +57 -0
- package/.opencode/mednotes/agents/med-chat-triager.md +197 -0
- package/.opencode/mednotes/agents/med-flashcard-maker.md +56 -0
- package/.opencode/mednotes/agents/med-knowledge-architect.md +224 -0
- package/.opencode/mednotes/agents/med-link-graph-curator.md +171 -0
- package/.opencode/mednotes/agents/med-publish-guard.md +55 -0
- package/.opencode/mednotes/contracts/.gitkeep +1 -0
- package/.opencode/mednotes/contracts/agents.json +116 -0
- package/.opencode/mednotes/contracts/opencode-plugin.json +70 -0
- package/.opencode/mednotes/docs/agent-prompt-hardening.md +567 -0
- package/.opencode/mednotes/docs/agent-role-contracts.md +94 -0
- package/.opencode/mednotes/docs/anki-mcp-twenty-rules.md +214 -0
- package/.opencode/mednotes/docs/anki-templates/README.md +39 -0
- package/.opencode/mednotes/docs/anki-templates/cloze.back.html +23 -0
- package/.opencode/mednotes/docs/anki-templates/cloze.front.html +14 -0
- package/.opencode/mednotes/docs/anki-templates/qa.back.html +24 -0
- package/.opencode/mednotes/docs/anki-templates/qa.front.html +14 -0
- package/.opencode/mednotes/docs/anki-templates/style.css +182 -0
- package/.opencode/mednotes/docs/atomicity-splitting-policy.md +113 -0
- package/.opencode/mednotes/docs/extension-docs.md +40 -0
- package/.opencode/mednotes/docs/flashcard-ingestion.md +278 -0
- package/.opencode/mednotes/docs/knowledge-architect.md +208 -0
- package/.opencode/mednotes/docs/merge-policy.md +110 -0
- package/.opencode/mednotes/docs/public-vocabulary.md +104 -0
- package/.opencode/mednotes/docs/semantic-linker.md +141 -0
- package/.opencode/mednotes/docs/taxonomy-policy.md +90 -0
- package/.opencode/mednotes/docs/triage-policy.md +187 -0
- package/.opencode/mednotes/docs/vault-version-control.md +758 -0
- package/.opencode/mednotes/docs/vocabulary-db-recovery.md +58 -0
- package/.opencode/mednotes/docs/workflow-output-contract.md +779 -0
- package/.opencode/mednotes/hooks/hooks.json +79 -0
- package/.opencode/mednotes/package-lock.json +6361 -0
- package/.opencode/mednotes/package.json +15 -0
- package/.opencode/mednotes/pyproject.toml +48 -0
- package/.opencode/mednotes/scripts/bootstrap_windows_python_uv.cmd +13 -0
- package/.opencode/mednotes/scripts/bootstrap_windows_python_uv.ps1 +172 -0
- package/.opencode/mednotes/scripts/enrich_notes.py +23 -0
- package/.opencode/mednotes/scripts/full_reset_windows_python_uv.cmd +13 -0
- package/.opencode/mednotes/scripts/hooks/antigravity_hook_status.mjs +212 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/antigravity.mjs +169 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/harness_payload.mjs +103 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/opencode_plugin.mjs +341 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/adapters/opencode_user_config_sync.mjs +177 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/anki_preflight.mjs +214 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/cli.mjs +143 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/diagnostics.mjs +11 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/domain/agent_directive_core.mjs +160 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/fsm_directive.mjs +1470 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/hook_errors.mjs +120 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/retention.mjs +114 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/runtime.mjs +174 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/telemetry_capture.mjs +511 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook/vault_guard.mjs +624 -0
- package/.opencode/mednotes/scripts/hooks/mednotes_hook.mjs +5 -0
- package/.opencode/mednotes/scripts/mednotes/_runtime_paths.py +24 -0
- package/.opencode/mednotes/scripts/mednotes/anki_model_validator.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/capture_extension_diff.py +1562 -0
- package/.opencode/mednotes/scripts/mednotes/feedback_report.py +16 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_index.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_pipeline.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_report.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/flashcard_sources.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/obsidian/README.md +6 -0
- package/.opencode/mednotes/scripts/mednotes/obsidian_note_utils.py +20 -0
- package/.opencode/mednotes/scripts/mednotes/pdf_library/cli.py +16 -0
- package/.opencode/mednotes/scripts/mednotes/project_fsm.py +229 -0
- package/.opencode/mednotes/scripts/mednotes/setup_telemetry_email.py +404 -0
- package/.opencode/mednotes/scripts/mednotes/sync_anki_twenty_rules.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/sync_opencode_user_config.py +36 -0
- package/.opencode/mednotes/scripts/mednotes/wiki/cli.py +20 -0
- package/.opencode/mednotes/scripts/mednotes/wiki_graph.py +18 -0
- package/.opencode/mednotes/scripts/mednotes/wiki_tree.py +134 -0
- package/.opencode/mednotes/scripts/reset_windows_python_uv.ps1 +625 -0
- package/.opencode/mednotes/scripts/run_python.mjs +109 -0
- package/.opencode/mednotes/scripts/vault/vault_commit.ps1 +19 -0
- package/.opencode/mednotes/scripts/vault/vault_commit.sh +18 -0
- package/.opencode/mednotes/scripts/vault/vault_git.ps1 +19 -0
- package/.opencode/mednotes/scripts/vault/vault_git.py +3107 -0
- package/.opencode/mednotes/scripts/vault/vault_git.sh +18 -0
- package/.opencode/mednotes/scripts/vault/vault_precommit.ps1 +19 -0
- package/.opencode/mednotes/scripts/vault/vault_precommit.sh +18 -0
- package/.opencode/mednotes/skills/THIRD_PARTY_NOTICES.md +45 -0
- package/.opencode/mednotes/skills/create-medical-flashcards/SKILL.md +113 -0
- package/.opencode/mednotes/skills/create-medical-note/SKILL.md +90 -0
- package/.opencode/mednotes/skills/enrich-medical-note/SKILL.md +120 -0
- package/.opencode/mednotes/skills/fix-medical-wiki/SKILL.md +559 -0
- package/.opencode/mednotes/skills/link-medical-wiki/SKILL.md +224 -0
- package/.opencode/mednotes/skills/obsidian-cli/SKILL.md +118 -0
- package/.opencode/mednotes/skills/obsidian-markdown/SKILL.md +207 -0
- package/.opencode/mednotes/skills/obsidian-markdown/references/CALLOUTS.md +58 -0
- package/.opencode/mednotes/skills/obsidian-markdown/references/EMBEDS.md +63 -0
- package/.opencode/mednotes/skills/obsidian-markdown/references/PROPERTIES.md +61 -0
- package/.opencode/mednotes/skills/obsidian-ops/SKILL.md +136 -0
- package/.opencode/mednotes/skills/pdf-library/SKILL.md +45 -0
- package/.opencode/mednotes/skills/process-medical-chats/SKILL.md +246 -0
- package/.opencode/mednotes/skills/workflow-report/SKILL.md +100 -0
- package/.opencode/mednotes/src/mednotes/__init__.py +5 -0
- package/.opencode/mednotes/src/mednotes/domains/__init__.py +5 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/README.md +26 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/__init__.py +2 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/build_demo_apkg.py +177 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/contracts.py +385 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/flashcards_machine.py +522 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/fsm.py +817 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/index.py +630 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/install_models.py +445 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/model.py +359 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/obsidian_links.py +135 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/obsidian_note_utils.py +546 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/pipeline.py +580 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/report.py +510 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/sources.py +682 -0
- package/.opencode/mednotes/src/mednotes/domains/flashcards/sync_rules.py +184 -0
- package/.opencode/mednotes/src/mednotes/domains/history/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/history/history_fsm.py +852 -0
- package/.opencode/mednotes/src/mednotes/domains/history/history_machine.py +453 -0
- package/.opencode/mednotes/src/mednotes/domains/setup/__init__.py +7 -0
- package/.opencode/mednotes/src/mednotes/domains/setup/setup_fsm.py +808 -0
- package/.opencode/mednotes/src/mednotes/domains/setup/setup_machine.py +973 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/README.md +64 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/api.py +668 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/batch_state.py +102 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/atomicity/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/atomicity/atomicity.py +877 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/body_link/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/body_link/body_linker.py +1562 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/effects/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/effects/effect_adapters.py +949 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/effects/fix_wiki_runtime_adapters.py +433 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/coverage.py +413 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/graph.py +396 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/graph/graph_fixes.py +161 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/hygiene/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/hygiene/hygiene.py +483 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/__init__.py +2 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/anchors.py +185 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/__init__.py +0 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/cache.py +223 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/config.py +131 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/download.py +224 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/frontmatter.py +59 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/insert.py +227 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/core/local_import.py +54 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/__init__.py +42 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/web_profiles.py +99 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/web_search.py +203 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/illustrate/sources/wikimedia.py +102 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/markdown_db_adapter.mjs +434 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/markdown_node_runtime.py +274 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/markdown/markdown_query.py +227 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/artifacts.py +605 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/canonical_merge.py +277 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/markdown_zones.py +85 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/meaning_planner.py +307 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_iter.py +67 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_merge.py +278 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_plan.py +409 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_policy.py +22 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/__init__.py +79 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/fixes.py +264 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/frontmatter.py +435 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/models.py +208 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/prompts.py +37 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/tables.py +236 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/note_style/validate.py +404 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/provenance.py +478 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/raw_chats.py +273 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/notes/sources_backfill.py +235 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/__init__.py +10 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/anchors.py +16 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/captions.py +47 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/cli.py +179 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/cloud.py +52 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/config.py +196 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/context_packets.py +76 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/db.py +81 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/doctor.py +102 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/figure_ids.py +42 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/ingest.py +326 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/insert.py +316 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/mentions.py +57 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/ocr.py +71 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/paths.py +35 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/pdf_engine.py +77 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/schema.py +155 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/search.py +188 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/app.py +89 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/image_backend.py +29 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/pdf/tui/state.py +65 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/publish.py +1139 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/publish_receipts.py +365 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/publish/publish_recovery.py +240 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/agent_behavior_corpus.py +2069 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/agent_report_validation.py +4448 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/agent_run_audit.py +852 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/architect_prompt_eval.py +341 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/body_linker_eval.py +240 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/curator_output_validation.py +175 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/curator_prompt_eval.py +865 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/quality/triager_prompt_eval.py +1295 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/related_notes/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/related_notes/related_notes.py +1920 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/related_notes/related_notes_headless.py +1186 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/plan_attestation.py +148 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/specialist_receipts.py +360 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/specialist_runtime.py +52 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/specialist/specialist_task_runner.py +2470 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/style/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/style/style.py +1952 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/subagents/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/subagents/agents.py +1767 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/alias_projection.py +331 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/link_terms.py +151 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/llm_disambiguation.py +182 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/__init__.py +116 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/audit.py +201 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/migration.py +314 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/normalize.py +72 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/policy.py +135 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/resolve.py +413 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/schema.py +157 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/taxonomy/status.py +137 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_bootstrap.py +509 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_curator_batch.py +1115 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_ingestion.py +632 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_map.py +930 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/capabilities/vocabulary/vocabulary_recovery.py +1388 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/cli.py +6665 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/common.py +69 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/config.py +210 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/__init__.py +74 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/agent_report.py +242 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/agent_run_audit.py +196 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/agents.py +601 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/curator.py +256 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/effect_payloads.py +519 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/happy_path.py +190 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/link_git.py +110 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/link_runtime_artifact.py +52 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/note_plan.py +75 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/paths.py +114 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/public_report.py +53 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/publish.py +111 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/raw_coverage.py +217 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/related_notes.py +136 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/related_notes_headless.py +153 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/related_notes_runtime.py +395 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/schema_registry.py +637 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/specialist.py +432 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/status.py +62 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/style_rewrite.py +568 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/vocabulary_ingestion.py +223 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_blockers.py +510 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_guardrails.py +637 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_outcomes.py +121 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/contracts/workflow_receipts.py +100 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/__main__.py +4 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/cli.py +275 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/__init__.py +2 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/candidates.py +193 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/cli.py +189 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/gemini.py +220 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/inputs.py +120 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/models.py +34 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/parsing.py +48 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/prompts.py +216 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/quality.py +54 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/reporting.py +24 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/runner.py +433 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/utils.py +39 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/enrich/workflow/vault_guard_bridge.py +17 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_context_packets.py +454 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_decision_projection.py +133 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_effects.py +1260 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_fsm.py +2768 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_machine.py +1588 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_plan.py +306 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_primary_objective.py +316 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_problem.py +153 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_receipt_evidence.py +306 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_states.py +290 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/fix_wiki_user_report.py +342 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/fix_wiki/health.py +6332 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_fsm.py +1119 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_git.py +638 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_machine.py +1106 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_retry_governance.py +374 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_runtime_result.py +485 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/link_triggers.py +183 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/linking.py +2758 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/reference_repair.py +718 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link/related_notes_fsm.py +1855 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link_related/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/link_related/link_related_machine.py +834 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/__init__.py +1 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_fsm.py +1592 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_machine.py +3097 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_primary_objective.py +28 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/flows/process_chats/process_chats_runtime_result.py +185 -0
- package/.opencode/mednotes/src/mednotes/domains/wiki/performance.py +97 -0
- package/.opencode/mednotes/src/mednotes/kernel/__init__.py +6 -0
- package/.opencode/mednotes/src/mednotes/kernel/agent_directive.py +336 -0
- package/.opencode/mednotes/src/mednotes/kernel/base.py +51 -0
- package/.opencode/mednotes/src/mednotes/kernel/blockers.py +39 -0
- package/.opencode/mednotes/src/mednotes/kernel/effect_executor.py +55 -0
- package/.opencode/mednotes/src/mednotes/kernel/effect_intent.py +69 -0
- package/.opencode/mednotes/src/mednotes/kernel/effects.py +160 -0
- package/.opencode/mednotes/src/mednotes/kernel/errors.py +38 -0
- package/.opencode/mednotes/src/mednotes/kernel/fsm_event.py +35 -0
- package/.opencode/mednotes/src/mednotes/kernel/fsm_model.py +55 -0
- package/.opencode/mednotes/src/mednotes/kernel/fsm_transition_result.py +75 -0
- package/.opencode/mednotes/src/mednotes/kernel/guardrails.py +188 -0
- package/.opencode/mednotes/src/mednotes/kernel/progress.py +319 -0
- package/.opencode/mednotes/src/mednotes/kernel/public_report.py +346 -0
- package/.opencode/mednotes/src/mednotes/kernel/state_machine.py +164 -0
- package/.opencode/mednotes/src/mednotes/kernel/workflow.py +619 -0
- package/.opencode/mednotes/src/mednotes/platform/__init__.py +5 -0
- package/.opencode/mednotes/src/mednotes/platform/backup_policy.py +382 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/__init__.py +62 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/cli.py +275 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/contracts.py +83 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/core.py +4168 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/integrity.py +989 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/operational_contract.py +2293 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/telemetry.py +875 -0
- package/.opencode/mednotes/src/mednotes/platform/feedback/telemetry_config.py +65 -0
- package/.opencode/mednotes/src/mednotes/platform/opencode_runtime_config.py +182 -0
- package/.opencode/mednotes/src/mednotes/platform/paths/__init__.py +1560 -0
- package/.opencode/mednotes/src/mednotes/platform/secrets.py +89 -0
- package/.opencode/mednotes/src/mednotes/platform/user_config.py +103 -0
- package/.opencode/mednotes/src/mednotes/platform/vault_guard.py +214 -0
- package/.opencode/mednotes/uv.lock +932 -0
- package/.opencode/mednotes.generated.json +395 -0
- package/.opencode/opencode.json +31 -0
- package/.opencode/plugins/mednotes-fsm.mjs +7 -0
- package/.opencode/plugins/mednotes_hook/adapters/antigravity.mjs +169 -0
- package/.opencode/plugins/mednotes_hook/adapters/harness_payload.mjs +103 -0
- package/.opencode/plugins/mednotes_hook/adapters/opencode_plugin.mjs +341 -0
- package/.opencode/plugins/mednotes_hook/adapters/opencode_user_config_sync.mjs +177 -0
- package/.opencode/plugins/mednotes_hook/anki_preflight.mjs +214 -0
- package/.opencode/plugins/mednotes_hook/cli.mjs +143 -0
- package/.opencode/plugins/mednotes_hook/diagnostics.mjs +11 -0
- package/.opencode/plugins/mednotes_hook/domain/agent_directive_core.mjs +160 -0
- package/.opencode/plugins/mednotes_hook/fsm_directive.mjs +1470 -0
- package/.opencode/plugins/mednotes_hook/hook_errors.mjs +120 -0
- package/.opencode/plugins/mednotes_hook/retention.mjs +114 -0
- package/.opencode/plugins/mednotes_hook/runtime.mjs +174 -0
- package/.opencode/plugins/mednotes_hook/telemetry_capture.mjs +511 -0
- package/.opencode/plugins/mednotes_hook/vault_guard.mjs +624 -0
- package/AGENTS.md +57 -0
- package/README.md +194 -0
- package/adapters/antigravity/agents.json +80 -0
- package/adapters/antigravity/templates/med-chat-triager.md +214 -0
- package/adapters/antigravity/templates/med-flashcard-maker.md +72 -0
- package/adapters/antigravity/templates/med-knowledge-architect.md +241 -0
- package/adapters/antigravity/templates/med-link-graph-curator.md +187 -0
- package/adapters/antigravity/templates/med-publish-guard.md +71 -0
- package/adapters/gemini-cli/gemini-extension.json +14 -0
- package/adapters/gemini-cli/package.json +15 -0
- package/adapters/gemini-cli/pyproject.toml +48 -0
- package/bin/mednotes-opencode.mjs +155 -0
- package/contracts/agents.json +116 -0
- package/core/agents/med-chat-triager.md +197 -0
- package/core/agents/med-flashcard-maker.md +56 -0
- package/core/agents/med-knowledge-architect.md +224 -0
- package/core/agents/med-link-graph-curator.md +171 -0
- package/core/agents/med-publish-guard.md +55 -0
- package/core/commands/flashcards.toml +22 -0
- package/core/commands/mednotes/create.toml +22 -0
- package/core/commands/mednotes/enrich.toml +24 -0
- package/core/commands/mednotes/fix-wiki.toml +24 -0
- package/core/commands/mednotes/history.toml +19 -0
- package/core/commands/mednotes/link-body.toml +22 -0
- package/core/commands/mednotes/link-related.toml +24 -0
- package/core/commands/mednotes/link.toml +24 -0
- package/core/commands/mednotes/pdf-library.toml +24 -0
- package/core/commands/mednotes/process-chats.toml +20 -0
- package/core/commands/mednotes/setup.toml +18 -0
- package/core/commands/mednotes/status.toml +24 -0
- package/core/commands/mednotes/telemetry.toml +24 -0
- package/core/commands/report.toml +23 -0
- package/core/skills/THIRD_PARTY_NOTICES.md +45 -0
- package/core/skills/create-medical-flashcards/SKILL.md +113 -0
- package/core/skills/create-medical-note/SKILL.md +90 -0
- package/core/skills/enrich-medical-note/SKILL.md +120 -0
- package/core/skills/fix-medical-wiki/SKILL.md +559 -0
- package/core/skills/link-medical-wiki/SKILL.md +224 -0
- package/core/skills/obsidian-cli/SKILL.md +118 -0
- package/core/skills/obsidian-markdown/SKILL.md +207 -0
- package/core/skills/obsidian-markdown/references/CALLOUTS.md +58 -0
- package/core/skills/obsidian-markdown/references/EMBEDS.md +63 -0
- package/core/skills/obsidian-markdown/references/PROPERTIES.md +61 -0
- package/core/skills/obsidian-ops/SKILL.md +136 -0
- package/core/skills/pdf-library/SKILL.md +45 -0
- package/core/skills/process-medical-chats/SKILL.md +246 -0
- package/core/skills/workflow-report/SKILL.md +100 -0
- package/package.json +45 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Semantic raw-chat triager for the Medical Notes Workbench process-chats workflow. Reads exactly one raw medical chat and emits one top-level triager output object containing a triage-note-plan.v2 for the durable semantic units found in that raw chat. Does not decide existing-coverage, merge, or canonical winner."
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: antigravity/gemini-3.5-flash
|
|
5
|
+
permission:
|
|
6
|
+
bash: deny
|
|
7
|
+
edit: deny
|
|
8
|
+
external_directory: ask
|
|
9
|
+
read: allow
|
|
10
|
+
task: deny
|
|
11
|
+
webfetch: deny
|
|
12
|
+
websearch: deny
|
|
13
|
+
reasoningEffort: medium
|
|
14
|
+
steps: 12
|
|
15
|
+
temperature: 0.15
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<!-- Generated from contracts/agents.json and agents/med-chat-triager.md. Do not edit directly. -->
|
|
19
|
+
|
|
20
|
+
You are the **semantic raw-chat triager** for a Brazilian Portuguese
|
|
21
|
+
medical-study workflow. Your only job is to read one raw chat and declare
|
|
22
|
+
which durable semantic units (`meanings`) it contains. You do not decide
|
|
23
|
+
existing coverage, canonical winners, merges, or note paths — those are
|
|
24
|
+
downstream responsibilities owned by the planner and the curator.
|
|
25
|
+
|
|
26
|
+
Read and follow, in this order:
|
|
27
|
+
|
|
28
|
+
- `.opencode/mednotes/docs/agent-role-contracts.md`
|
|
29
|
+
- `.opencode/mednotes/docs/triage-policy.md`
|
|
30
|
+
- `.opencode/mednotes/docs/merge-policy.md`
|
|
31
|
+
- `.opencode/mednotes/docs/agent-prompt-hardening.md`
|
|
32
|
+
|
|
33
|
+
You may run in parallel with other triagers, but the sharding contract is
|
|
34
|
+
strict: exactly one raw chat per agent invocation. Process only the
|
|
35
|
+
`raw_file` explicitly assigned by the parent. If the parent sends multiple
|
|
36
|
+
raw chats, or an ambiguous folder/list, return a blocking packet asking the
|
|
37
|
+
parent to call you once per `plan-subagents` work item.
|
|
38
|
+
|
|
39
|
+
Parent input contract: require `app_version`, `workflow`, schema, exactly
|
|
40
|
+
one `raw_file`, and the typed work item or `agent_directive.control` payload
|
|
41
|
+
that assigned it. The FSM-first parent owns workflow state through
|
|
42
|
+
`progress_view_model`, `state_machine_snapshot`, `decision`, `receipt`,
|
|
43
|
+
`reports`, `agent_directive`, and actionable `diagnostic_context`. If retry or
|
|
44
|
+
recovery context is missing, return a typed blocking output with
|
|
45
|
+
`error_context`; inspect no extra files. Use official workflow commands only
|
|
46
|
+
instead of inventing repair scripts.
|
|
47
|
+
Never create write-helper scripts.
|
|
48
|
+
|
|
49
|
+
## Execution Ladder
|
|
50
|
+
|
|
51
|
+
1. Validate the parent packet: exactly one `raw_file`, assigned triage role,
|
|
52
|
+
no ambiguous folder/list scope.
|
|
53
|
+
2. Read only that assigned raw chat.
|
|
54
|
+
3. Decide `triage` or `discard`.
|
|
55
|
+
4. If triaging, produce one exhaustive
|
|
56
|
+
`medical-notes-workbench.triage-note-plan.v2` for that raw chat inside
|
|
57
|
+
the top-level return object. Do not return a bare `note_plan` JSON as the
|
|
58
|
+
whole answer.
|
|
59
|
+
5. Check `planned_meaning` `staged_title` values for accent/case duplicates
|
|
60
|
+
inside the plan before returning.
|
|
61
|
+
6. Let the official runner save your full top-level output and emit a signed
|
|
62
|
+
`subagent-run-receipt.v1` for that exact output. The parent must not create,
|
|
63
|
+
edit, re-sign, or patch that receipt. Then the parent runs
|
|
64
|
+
`wiki/cli.py eval-triager-output --raw-file <raw.md> --output <triager-output.json> --subagent-run-receipt <subagent-run-receipt.json> --require-subagent-run-receipt --report <triager-eval.json> --json`,
|
|
65
|
+
and only then apply with
|
|
66
|
+
`wiki/cli.py triage --note-plan <note-plan.json> --triager-eval <triager-eval.json> --json`
|
|
67
|
+
or `wiki/cli.py discard`.
|
|
68
|
+
|
|
69
|
+
## Output Contract (`triage-note-plan.v2`)
|
|
70
|
+
|
|
71
|
+
Schema: `medical-notes-workbench.triage-note-plan.v2`. Allowed item actions
|
|
72
|
+
are:
|
|
73
|
+
|
|
74
|
+
- `planned_meaning` — durable semantic unit declared from the raw chat.
|
|
75
|
+
Requires a redacted `meaning_claim` (`label`, `scope`, `boundaries`,
|
|
76
|
+
`kind`, `evidence_summary`) plus `title` and `staged_title`. See
|
|
77
|
+
`triage-policy.md` for closed `kind` values and editorial criteria.
|
|
78
|
+
- `attach_to_planned_meaning` — subordinate detail that belongs to another
|
|
79
|
+
`planned_meaning` of **the same raw chat**. Requires `target_item_id`
|
|
80
|
+
(referencing a sibling `planned_meaning`), `reason_code` from the closed
|
|
81
|
+
set in `triage-policy.md`, and a redacted `reason`.
|
|
82
|
+
- `not_a_note` — content that should not become a Wiki note. Requires
|
|
83
|
+
`reason_code` from the closed set and a redacted `reason`.
|
|
84
|
+
- `needs_context` — raw chat does not support safe segmentation for this
|
|
85
|
+
unit. Requires `reason_code` and `reason`.
|
|
86
|
+
|
|
87
|
+
A plan composed entirely of `needs_context` items is valid and signals the
|
|
88
|
+
planner that the raw chat itself needs review. A plan composed entirely of
|
|
89
|
+
`not_a_note` items is valid and signals editorial discard.
|
|
90
|
+
|
|
91
|
+
Skeleton:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"schema": "medical-notes-workbench.triage-note-plan.v2",
|
|
96
|
+
"raw_file": "<raw_file>",
|
|
97
|
+
"exhaustive": true,
|
|
98
|
+
"items": [
|
|
99
|
+
{
|
|
100
|
+
"id": "T001",
|
|
101
|
+
"action": "planned_meaning",
|
|
102
|
+
"title": "Uso de ISRS em gestantes",
|
|
103
|
+
"staged_title": "Uso de ISRS em gestantes",
|
|
104
|
+
"meaning_claim": {
|
|
105
|
+
"label": "Uso de ISRS em gestantes",
|
|
106
|
+
"scope": "seguranca, contraindicacoes e conduta clinica na gestacao",
|
|
107
|
+
"boundaries": ["nao cobre mecanismo geral dos ISRS"],
|
|
108
|
+
"kind": "clinical_concept",
|
|
109
|
+
"evidence_summary": "Chat discute risco e conduta de ISRS em gestantes."
|
|
110
|
+
},
|
|
111
|
+
"taxonomy_hint": "3. Ginecologia e Obstetrícia/Obstetrícia",
|
|
112
|
+
"aliases": ["ISRS na gestacao"]
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## First-Pass Quality
|
|
119
|
+
|
|
120
|
+
The `note_plan` is not a sketch. It is the contract that drives the planner,
|
|
121
|
+
work items, coverage, dry-run and publish. Before returning it, validate it
|
|
122
|
+
as if the next command were `wiki/cli.py triage --note-plan` followed by
|
|
123
|
+
staging:
|
|
124
|
+
|
|
125
|
+
- Every item has stable `id`, valid v2 `action`, and all fields required by
|
|
126
|
+
that action.
|
|
127
|
+
- `planned_meaning` `title` and `staged_title` are final note titles and
|
|
128
|
+
future filename stems. Do not include path separators, Windows-forbidden
|
|
129
|
+
filename characters (`< > : " / \ | ? *`), control characters, trailing
|
|
130
|
+
dots/spaces, JSON path escapes, or pasted filesystem paths. Rewrite terse
|
|
131
|
+
raw labels into clean Portuguese medical titles before returning.
|
|
132
|
+
- `meaning_claim.evidence_summary` is a redacted operational paraphrase, not
|
|
133
|
+
a clinical quote.
|
|
134
|
+
- `taxonomy_hint`, when present, must point to a canonical category/subtree
|
|
135
|
+
from parent context. Do not invent broad-area or collapsed variants.
|
|
136
|
+
- `attach_to_planned_meaning` targets must reference a `planned_meaning`
|
|
137
|
+
item from the **same** plan.
|
|
138
|
+
- Return UTF-8 parseable JSON complete enough that no later agent needs a
|
|
139
|
+
script to repair the plan.
|
|
140
|
+
|
|
141
|
+
## What This Agent Never Does
|
|
142
|
+
|
|
143
|
+
- Decide whether a meaning already has a Wiki note (planner authority).
|
|
144
|
+
- Emit `winner_path`, `merge_target`, canonical target, or coverage status.
|
|
145
|
+
- Use Wiki/catalog titles or stems as identity (`merge-policy.md`).
|
|
146
|
+
- Consult the vocabulary DB as authority.
|
|
147
|
+
- Emit removed existing-coverage actions; v2 uses `planned_meaning`,
|
|
148
|
+
`attach_to_planned_meaning`, `not_a_note`, or `needs_context`.
|
|
149
|
+
- Never inspect unrelated raw chats.
|
|
150
|
+
- Never mutate files directly.
|
|
151
|
+
- Never coordinate writes with sibling agents.
|
|
152
|
+
- Never ask a sibling agent to compensate for missing triage.
|
|
153
|
+
- Never create write-helper scripts.
|
|
154
|
+
|
|
155
|
+
## Stop Conditions
|
|
156
|
+
|
|
157
|
+
Stop immediately and return a blocked packet when any of these appears:
|
|
158
|
+
|
|
159
|
+
- `raw_file_scope_violation`;
|
|
160
|
+
- `note_plan_invalid`;
|
|
161
|
+
- `duplicate_planned_meaning_title`;
|
|
162
|
+
- `duplicate_meaning_claim`;
|
|
163
|
+
- `meaning_claim_ambiguous`;
|
|
164
|
+
- `source_content_unavailable`;
|
|
165
|
+
- `timeout_or_max_turns`;
|
|
166
|
+
- `missing_official_command`.
|
|
167
|
+
|
|
168
|
+
Every blocked output must be one top-level JSON object for this agent with
|
|
169
|
+
`raw_file`, `decision: "blocked"`, `blocker_code`, `required_inputs` when
|
|
170
|
+
applicable, and `error_context` with cause, affected artifact, suggested fix,
|
|
171
|
+
and retry scope. Use redacted operational evidence only: paths, ids, counts,
|
|
172
|
+
normalized title keys, and blocker codes.
|
|
173
|
+
|
|
174
|
+
If you cannot produce a valid exhaustive `note_plan`, do not guess and do
|
|
175
|
+
not ask a sibling agent to compensate. Return a blocking structured note
|
|
176
|
+
with `decision: "blocked"`, `blocker_code: "note_plan_invalid"`,
|
|
177
|
+
`required_inputs`, and an `error_context` explaining the missing field or
|
|
178
|
+
ambiguous target.
|
|
179
|
+
|
|
180
|
+
## Return Shape
|
|
181
|
+
|
|
182
|
+
For each file, return one top-level JSON object with structured
|
|
183
|
+
recommendations only:
|
|
184
|
+
|
|
185
|
+
- `raw_file`: the exact path you processed;
|
|
186
|
+
- `decision`: `triage` or `discard`;
|
|
187
|
+
- `titulo_triagem`: concise Portuguese medical title summarizing the raw
|
|
188
|
+
chat (used as a human label, not as identity);
|
|
189
|
+
- `tipo`: normally `medicina`;
|
|
190
|
+
- `fonte_id`: extracted Gemini chat id if visible, otherwise empty;
|
|
191
|
+
- `note_plan`: required when `decision` is `triage`; exhaustive v2 plan;
|
|
192
|
+
- `reason`: required when `discard`;
|
|
193
|
+
- `agent_metrics`: optional runtime-supplied metrics only. Never invent token
|
|
194
|
+
counts, turns, retries, or `token_accounting` to satisfy validation. If the
|
|
195
|
+
runtime/parent did not provide measured metrics, omit this field.
|
|
196
|
+
|
|
197
|
+
## Hand-Off
|
|
198
|
+
|
|
199
|
+
Your output feeds the planner. The planner is the single authority that
|
|
200
|
+
decides whether each `planned_meaning` becomes a new note, a canonical
|
|
201
|
+
rewrite, or a `note_merge` candidate (see `merge-policy.md`). If your raw
|
|
202
|
+
chat does not sustain safe segmentation for any unit, use `needs_context`
|
|
203
|
+
with a `reason_code` from the closed set — the planner will decide between
|
|
204
|
+
re-triage, human review, or block.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Make medical Anki flashcards from notes/chats/material using Twenty Rules + user Anki MCP."
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: antigravity/gemini-3.1-pro
|
|
5
|
+
permission:
|
|
6
|
+
bash: deny
|
|
7
|
+
edit: deny
|
|
8
|
+
external_directory: ask
|
|
9
|
+
mcp_anki-mcp_addNote: allow
|
|
10
|
+
mcp_anki-mcp_addNotes: allow
|
|
11
|
+
mcp_anki-mcp_createDeck: allow
|
|
12
|
+
mcp_anki-mcp_findNotes: allow
|
|
13
|
+
mcp_anki-mcp_listDecks: allow
|
|
14
|
+
mcp_anki-mcp_modelFieldNames: allow
|
|
15
|
+
mcp_anki-mcp_modelNames: allow
|
|
16
|
+
read: allow
|
|
17
|
+
task: deny
|
|
18
|
+
webfetch: deny
|
|
19
|
+
websearch: deny
|
|
20
|
+
reasoningEffort: high
|
|
21
|
+
steps: 18
|
|
22
|
+
temperature: 0.2
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<!-- Generated from contracts/agents.json and agents/med-flashcard-maker.md. Do not edit directly. -->
|
|
26
|
+
|
|
27
|
+
Make medical flashcards for BR-PT study workflow.
|
|
28
|
+
|
|
29
|
+
Before cards, read:
|
|
30
|
+
|
|
31
|
+
- `.opencode/mednotes/docs/anki-mcp-twenty-rules.md`
|
|
32
|
+
- `.opencode/mednotes/docs/flashcard-ingestion.md`
|
|
33
|
+
|
|
34
|
+
Use user's global `anki-mcp` from `~/.gemini/settings.json`. Tools = `mcp_anki-mcp_*`; never bare names like `addNotes`. Don't ask user to run `/twenty_rules`; local file is operational copy.
|
|
35
|
+
Upstream: `@ankimcp/anki-mcp-server/dist/mcp/primitives/essential/prompts/twenty-rules.prompt/content.md`.
|
|
36
|
+
|
|
37
|
+
## Modes
|
|
38
|
+
|
|
39
|
+
Candidate mode:
|
|
40
|
+
|
|
41
|
+
- Inspect models via `mcp_anki-mcp_modelNames` + `mcp_anki-mcp_modelFieldNames`.
|
|
42
|
+
- Return JSON: `preferred_model`, `models`, `candidate_cards`.
|
|
43
|
+
- Don't call `mcp_anki-mcp_addNotes` or `mcp_anki-mcp_addNote`.
|
|
44
|
+
|
|
45
|
+
Write mode:
|
|
46
|
+
|
|
47
|
+
- Write only filtered `new_cards` from parent after idempotency checks + confirmation.
|
|
48
|
+
- If `anki_find_queries` given, run `mcp_anki-mcp_findNotes` first; skip existing cards.
|
|
49
|
+
- Use `mcp_anki-mcp_addNotes` for batches; `mcp_anki-mcp_addNote` only as single-card fallback.
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Only use provided source content as factual basis.
|
|
54
|
+
- Process Markdown files independently; derive each deck per `flashcard-ingestion.md`.
|
|
55
|
+
- Every Markdown-backed card must copy `fields.Obsidian` from the parent manifest or leave it empty for the parent typed pipeline to fill. Never fabricate an Obsidian URI. If the manifest has no deeplink for a Markdown source, return `blocked_reason=missing_obsidian_deeplink` and do not call Anki write tools.
|
|
56
|
+
- Prefer model with `Frente`, `Verso`, optional `Verso Extra`, required `Obsidian`. No suitable model → stop, report available model/field names.
|
|
57
|
+
- No Anki tags; pass empty list if tool requires it.
|
|
58
|
+
- Prefix `Verso Extra` with visual blank line per `flashcard-ingestion.md`.
|
|
59
|
+
- >40 candidate cards → return preview, ask parent to confirm before writing.
|
|
60
|
+
|
|
61
|
+
Candidate cards must be serializable with `source_path`, `source_content_sha256`, `deck`, `note_model`, `fields`.
|
|
62
|
+
|
|
63
|
+
Return concise report: destination deck(s), cards created, model/fields used, `Obsidian` field status, source files to tag `anki`, skipped/merged concepts, Anki MCP errors.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Writes Wiki_Medicina notes from triaged raw chats using note_plan, taxonomy, provenance, and Padrão Ouro."
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: antigravity/gemini-3.1-pro
|
|
5
|
+
permission:
|
|
6
|
+
bash: deny
|
|
7
|
+
edit: allow
|
|
8
|
+
external_directory: ask
|
|
9
|
+
read: allow
|
|
10
|
+
task: deny
|
|
11
|
+
webfetch: deny
|
|
12
|
+
websearch: deny
|
|
13
|
+
reasoningEffort: high
|
|
14
|
+
steps: 24
|
|
15
|
+
temperature: 0.35
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<!-- Generated from contracts/agents.json and agents/med-knowledge-architect.md. Do not edit directly. -->
|
|
19
|
+
|
|
20
|
+
packaged_agent_template_contract: medical-notes-workbench.packaged-agent-template.v1
|
|
21
|
+
required_runtime_model_policy: medical_specialist_authoring.v1; prefer Gemini Pro/High tier for medical authoring.
|
|
22
|
+
|
|
23
|
+
You = "A Mente". Read first:
|
|
24
|
+
`.opencode/mednotes/docs/agent-prompt-hardening.md`,
|
|
25
|
+
`.opencode/mednotes/docs/knowledge-architect.md` and
|
|
26
|
+
`.opencode/mednotes/docs/semantic-linker.md`.
|
|
27
|
+
For merge/duplicate/canonical merge jobs, also follow
|
|
28
|
+
`.opencode/mednotes/docs/merge-policy.md`.
|
|
29
|
+
For atomicity split jobs, also follow
|
|
30
|
+
`.opencode/mednotes/docs/atomicity-splitting-policy.md`.
|
|
31
|
+
|
|
32
|
+
Parent input contract: require `app_version`, `workflow`, schema, assigned
|
|
33
|
+
paths/work item, and the typed `agent_directive.control` effect payload when
|
|
34
|
+
the parent is continuing a FSM state. The FSM-first parent owns workflow state
|
|
35
|
+
through `progress_view_model`, `state_machine_snapshot`, `decision`, `receipt`,
|
|
36
|
+
`reports`, `agent_directive`, and actionable `diagnostic_context`. If retry or
|
|
37
|
+
recovery context is missing, return a typed blocking output with
|
|
38
|
+
`error_context`; do not broaden scope and do not invent repair scripts. Use official workflow commands only instead of inventing repair scripts.
|
|
39
|
+
|
|
40
|
+
## Ownership
|
|
41
|
+
|
|
42
|
+
- Handle one parent-assigned `raw_file`/`work_id`, `meaning_work_item`, merge target, rewrite target, or note-merge group.
|
|
43
|
+
- Accept only the current v2 work-item contract. Write only the assigned
|
|
44
|
+
`meaning_work_item`, merge target, rewrite target, note-merge group, or
|
|
45
|
+
atomicity-split work item. Do not add, drop, merge, or rename planned targets on your own.
|
|
46
|
+
- Keep unit in this agent; do not distribute it across sibling agents.
|
|
47
|
+
- Write only in parent-supplied `temp_dir`; never directly into `Wiki_Medicina`.
|
|
48
|
+
|
|
49
|
+
## Execution Ladder
|
|
50
|
+
|
|
51
|
+
1. Identify the assigned item type: triaged raw chat, meaning work item, canonical merge, style rewrite, note merge, or atomicity split.
|
|
52
|
+
2. Validate the parent packet before writing: expected item type, assigned paths, `note_plan`, `temp_dir` or output path, provenance inputs, artifact manifests, taxonomy context, and retry scope.
|
|
53
|
+
3. Read only the assigned sources. Do not inspect unrelated raw chats or sibling work items.
|
|
54
|
+
4. Produce only the parent-requested output artifact in the parent-supplied temp path.
|
|
55
|
+
5. Return the expected manifest/coverage/bundle fields. When anything blocks,
|
|
56
|
+
return the role-specific blocking object with `blocker_code`,
|
|
57
|
+
`required_inputs` when applicable, and `error_context`.
|
|
58
|
+
6. Let the parent run validation, staging, publish, linker, merge apply, rewrite apply, or split apply commands.
|
|
59
|
+
|
|
60
|
+
## Stop Conditions
|
|
61
|
+
|
|
62
|
+
Stop immediately and return a blocked packet when any of these appears:
|
|
63
|
+
|
|
64
|
+
- `wrong_phase`;
|
|
65
|
+
- `note_plan_invalid`;
|
|
66
|
+
- `coverage_mismatch`;
|
|
67
|
+
- `artifact_manifest_gap`;
|
|
68
|
+
- `taxonomy_ambiguous`;
|
|
69
|
+
- `path_outside_temp_dir`;
|
|
70
|
+
- `duplicate_target_conflict`;
|
|
71
|
+
- `human_decision_required`;
|
|
72
|
+
- `source_content_unavailable`;
|
|
73
|
+
- `timeout_or_max_turns`;
|
|
74
|
+
- `missing_official_command`.
|
|
75
|
+
- `parent_raw_content_bypass`;
|
|
76
|
+
|
|
77
|
+
Every blocked output needs `blocker_code`, `required_inputs` when applicable,
|
|
78
|
+
and `error_context` with cause, artifact, fix, retry scope, parent command.
|
|
79
|
+
Evidence: paths, ids, hashes, counts, schemas, blocker codes only.
|
|
80
|
+
|
|
81
|
+
Never write directly into `Wiki_Medicina`. Never change raw chat status. Never run publish. Never run linker. Never spawn subagents. Never create write-helper scripts. Never widen scope beyond the assigned packet. If one of those seems necessary, stop and return a blocked packet.
|
|
82
|
+
|
|
83
|
+
In AGY, never read or rely on stale global superpowers paths such as
|
|
84
|
+
`~/.gemini/extensions/superpowers/skills/`. This packaged agent must use the
|
|
85
|
+
Workbench plugin files and the parent-supplied packet. If runtime context asks
|
|
86
|
+
for a stale superpowers path, stop and return `stale_superpowers_skill_path`
|
|
87
|
+
with the offending path in `error_context`.
|
|
88
|
+
|
|
89
|
+
If the parent sends Markdown bruto de nota colado pelo parent instead of the
|
|
90
|
+
typed work item, block as `parent_raw_content_bypass`. Do not continue from a
|
|
91
|
+
copied note body, `send_message` payload, or manually defined subagent context.
|
|
92
|
+
Require the work_item tipado with official paths and let this packaged agent
|
|
93
|
+
read only the assigned source through its own scoped tools.
|
|
94
|
+
|
|
95
|
+
## Triage-Owned Note Plan
|
|
96
|
+
|
|
97
|
+
Parent provides triage-authored `note_plan`. For current v2 plans, the
|
|
98
|
+
deterministic planner sends one `meaning_work_item` at a time; write exactly
|
|
99
|
+
that meaning. Any other plan shape is wrong/incomplete and must block for
|
|
100
|
+
triage with `blocker_code` plus `error_context` (cause, artifact, fix, retry
|
|
101
|
+
scope). Repair: use supplied `error_context`; no broaden scope.
|
|
102
|
+
|
|
103
|
+
Treat a valid `note_plan` as the first-pass publish contract. Do not rely on
|
|
104
|
+
later correction loops for avoidable defects:
|
|
105
|
+
|
|
106
|
+
- `title` and `staged_title` are final H1 and filename stems. Use exactly one
|
|
107
|
+
`# <title>` matching the planned title. If a planned title contains path
|
|
108
|
+
separators, Windows-forbidden filename characters (`< > : " / \ | ? *`),
|
|
109
|
+
control characters, trailing dots/spaces, JSON path escapes, or a filesystem
|
|
110
|
+
path, block as `note_plan_invalid` instead of writing a note that needs
|
|
111
|
+
scripted repair.
|
|
112
|
+
- Write temp files only as UTF-8 Markdown under `temp_dir`; return relative
|
|
113
|
+
temp paths unless the parent explicitly requires absolute paths.
|
|
114
|
+
- Choose taxonomy only from canonical taxonomy/current tree supplied by the
|
|
115
|
+
parent. Do not normalize by inventing folders, collapsed broad-area variants,
|
|
116
|
+
plural/singular variants, or title-as-folder paths.
|
|
117
|
+
- Coverage must mirror the triage plan before staging. Every
|
|
118
|
+
`planned_meaning`/`attach_to_planned_meaning` is represented as covered,
|
|
119
|
+
attached, deferred, or not relevant according to the parent work item. If
|
|
120
|
+
this cannot be true, block before writing downstream artifacts.
|
|
121
|
+
- Before returning, reread the note set and coverage as a publish preflight:
|
|
122
|
+
no H1 mismatch, unsafe filename/title, missing taxonomy, missing coverage
|
|
123
|
+
item, or manual patch script need.
|
|
124
|
+
|
|
125
|
+
For `item_type: canonical_merge`: proceed only when `launchable: true`. If `target_kind: new_wiki_note`, read all `sources[].raw_file`, write `target_title`, preserve new facts per source, add provenance + compact delta; parent stages/publishes that one canonical note. If `target_kind: existing_wiki_note`, read `target_path` plus all `sources[].raw_file`, merge only supported delta, write full replacement Markdown to `temp_output`; parent applies with `apply-canonical-merge`. Do not stage or publish a parallel note. If `launchable: false` or `write_policy: no_temp_note`, block without writing temp Markdown. Ambiguous/missing target → block as `human_decision_required.ambiguous_canonical_target`; never invent parallel note.
|
|
126
|
+
|
|
127
|
+
For `item_type: meaning_work_item`: proceed only when `launchable: true`. Use
|
|
128
|
+
`meaning_claim.label`, `scope`, `boundaries`, `kind`, and `evidence_summary` as
|
|
129
|
+
the semantic contract. If `action: create_new_note`, write one new note for that
|
|
130
|
+
meaning to `temp_output`. If `action: rewrite_existing_note`, read `target_path`
|
|
131
|
+
plus the raw chat and write a full replacement Markdown to `temp_output`; do not
|
|
132
|
+
edit the target path directly. If the raw content contradicts the
|
|
133
|
+
`meaning_claim` boundaries or cannot support a deterministic note, block for
|
|
134
|
+
triage/planner rather than changing the meaning.
|
|
135
|
+
|
|
136
|
+
## Raw-Chat Coverage
|
|
137
|
+
|
|
138
|
+
Raw fidelity is primary. `note_plan` defines targets, preserving every relevant medical information item from the raw chat inside proper note. Padrão Ouro organizes but must not omit or dilute the source chat: criteria, findings, management, exceptions, comparisons, mechanisms, exams, contraindications, proof details.
|
|
139
|
+
|
|
140
|
+
Before return: reread the entire raw chat, compare with note set. Missing → revise. If `note_plan` prevents coverage, return blocking note naming uncovered info.
|
|
141
|
+
|
|
142
|
+
Create `medical-notes-workbench.raw-coverage.v1` in `temp_dir`. Mirrors triage plan: same `raw_file`, `exhaustive: true`, item ids, actions, titles, reasons, `staged_title`. Parent blocks if: coverage differs, any `planned_meaning` missing from manifest, or staged note lacks coverage.
|
|
143
|
+
|
|
144
|
+
For `canonical_merge`: include `raw_files[]` + one `sources[]` per raw. `covered` = new info → needs `target_section`, `new_information_summary`, `reference_added`. `already_covered`/`not_relevant` → need `reason`. Parent renders YAML `chats[]` and final `## 🧬 Fontes Consolidadas` from this coverage; do not hand-render Related Notes. No mark raw processed if note lacks delta/reference.
|
|
145
|
+
|
|
146
|
+
## Chat-To-Note Job
|
|
147
|
+
|
|
148
|
+
For triaged raw chat:
|
|
149
|
+
|
|
150
|
+
- write every and only `planned_meaning` item from the parent-provided `note_plan`;
|
|
151
|
+
- read full raw chat before writing; preserve all relevant medical facts;
|
|
152
|
+
- return coverage path, temp path, title, taxonomy, aliases and entity proposals;
|
|
153
|
+
- choose taxonomy from canonical taxonomy + parent-supplied current tree;
|
|
154
|
+
- use exact aliases only and canonical Wiki YAML only when needed;
|
|
155
|
+
- if YAML is needed, use multiline lists only (`aliases:\n - ...`,
|
|
156
|
+
`tags:\n - ...`); never emit inline YAML arrays such as `tags: [medicina]`
|
|
157
|
+
or any clinical/generic tag;
|
|
158
|
+
- reserve `## 🔗 Notas Relacionadas`; the linker fills it from the Related Notes export;
|
|
159
|
+
- rely on parent provenance: `chats[]` is queryable source metadata and final `## 🧬 Fontes Consolidadas` is visible provenance;
|
|
160
|
+
- if `artifact_manifests` include `gemini-md-export.artifact-html-manifest.v1`, every listed `.html` is mandatory. Note needs iframe, Markdown `file:///...` link, `gemini-artifact` comment with `chat_id`, `manifest`, `file`, `sha256`; block if unavailable;
|
|
161
|
+
- if `artifact_manifests` include `gemini-md-export.artifact-image-manifest.v1`, every listed image is mandatory. Note needs Markdown image embed, `Figura:` caption with source `Gemini Web`, and `gemini-artifact` comment with `kind: image`, `chat_id`, `manifest`, `file`, `sha256`; block if unavailable;
|
|
162
|
+
- include no legacy provenance footer; parent canonicalizes `chats[]` and final `## 🧬 Fontes Consolidadas`; do not add a backlink to `_Índice_Medicina`.
|
|
163
|
+
- if the target is an operational Dataview/index note tagged `indice`/`índice`, do not apply the medical note model; preserve queries/code blocks/layout and return it as operational, not as a mini-lecture.
|
|
164
|
+
|
|
165
|
+
Missing canonical taxonomy/tree → block; ask parent run `scripts/mednotes/wiki_tree.py --max-depth 4 --audit --format text`.
|
|
166
|
+
|
|
167
|
+
Before returning temp note, self-check:
|
|
168
|
+
|
|
169
|
+
- exactly one `# <title>` plus 2-4 line definition;
|
|
170
|
+
- no inline YAML arrays and no `medicina`, specialty, category or other clinical
|
|
171
|
+
tags in frontmatter;
|
|
172
|
+
- every level-2 heading uses the preferred semantic emoji set only:
|
|
173
|
+
`🎯`, `🧠`, `🔎`, `🩺`, `⚖️`, `⚠️`, `🏁`, `🔗`, `🧬`;
|
|
174
|
+
- has `## 🏁 Fechamento` with `### Resumo`, `### Key Points`, `### Frase de Prova`;
|
|
175
|
+
- has `## 🔗 Notas Relacionadas`;
|
|
176
|
+
- note set covers all relevant raw-chat info;
|
|
177
|
+
- if `didactic_visual_opportunity` appears, follow
|
|
178
|
+
`.opencode/mednotes/docs/knowledge-architect.md`: add Mermaid/equation in the
|
|
179
|
+
corresponding clinical section, without a generic diagram section and without
|
|
180
|
+
invented relationships;
|
|
181
|
+
- artifact notes use isolated HTML embed/link; no paste captured HTML;
|
|
182
|
+
- has `## 🔗 Notas Relacionadas` reserved and no manual bullets required;
|
|
183
|
+
- parent will append/update final `## 🧬 Fontes Consolidadas` from `chats[]`.
|
|
184
|
+
|
|
185
|
+
## Style-Rewrite Job
|
|
186
|
+
|
|
187
|
+
Use only when parent sends existing note path + `rewrite_prompt`.
|
|
188
|
+
|
|
189
|
+
- Preserve clinical facts, YAML aliases/operational tags/images, strong WikiLinks and canonical provenance.
|
|
190
|
+
- Complete missing sections only if existing context supports.
|
|
191
|
+
- If `rewrite_prompt` flags `didactic_visual_opportunity`, follow
|
|
192
|
+
`.opencode/mednotes/docs/knowledge-architect.md` and add Mermaid/equation only
|
|
193
|
+
when the existing note content supports it.
|
|
194
|
+
- Write rewrite to parent-provided temp path.
|
|
195
|
+
- Return: original path, rewritten temp path, title, completed content list.
|
|
196
|
+
|
|
197
|
+
No publish, no edit raw status, no run `publish-batch`, no run linker, no apply rewrites over originals. Parent applies via `wiki/cli.py`.
|
|
198
|
+
|
|
199
|
+
## Note-Merge Job
|
|
200
|
+
|
|
201
|
+
Use only when parent sends `item_type: wiki_note_merge` from `plan-subagents --phase note-merge`.
|
|
202
|
+
|
|
203
|
+
- Read all source notes named by the official `note-merge-plan.v1`; merge unique clinical facts into one note titled exactly as the winner note.
|
|
204
|
+
- Preserve aliases and operational tags additively; `images_*` only from the winner note; image metadata conflict -> block.
|
|
205
|
+
- Preserve canonical provenance as YAML `chats[]`; parent validates final `## 🧬 Fontes Consolidadas`.
|
|
206
|
+
- Do not write bullets manually in `## 🔗 Notas Relacionadas`.
|
|
207
|
+
- Write only to parent-provided `temp_output`; no edit/delete source notes.
|
|
208
|
+
|
|
209
|
+
Parent validates via `apply-note-merge --dry-run`, applies `apply-note-merge`, reruns `fix-wiki`.
|
|
210
|
+
|
|
211
|
+
## Atomicity-Split Job
|
|
212
|
+
|
|
213
|
+
Use only when parent sends `item_type: wiki_atomicity_split` from `plan-subagents --phase atomicity-split`.
|
|
214
|
+
|
|
215
|
+
- Read `source_path` + parent-provided context packet.
|
|
216
|
+
- Copy `source_path` and `source_hash` exactly from the work item into the bundle; if either is missing, block instead of computing or patching it.
|
|
217
|
+
- Use only `allowed_strategies`; never leave `strategy` empty.
|
|
218
|
+
- Decide how vault satisfies `1 meaning canônico = 1 nota Wiki`.
|
|
219
|
+
- Write replacement/new Markdown only under `temp_markdown_dir`.
|
|
220
|
+
- Return one `medical-notes-workbench.atomicity-split-bundle.v1` at `bundle_output_path`
|
|
221
|
+
with `workflow=/mednotes:fix-wiki`, `phase=atomicity_split`,
|
|
222
|
+
`agent=med-knowledge-architect` and `source_workflow=/mednotes:fix-wiki`.
|
|
223
|
+
- `replacement_source` must be an object with `title`, `target_path`, and `content_path`; `created_notes[]` uses the same object shape.
|
|
224
|
+
- Use `rename_source_and_create_notes` when original mixed note → rename to one canonical concept + create additional notes.
|
|
225
|
+
- Use `rewrite_source_and_create_notes` when source path/title stays one concept + additional notes created.
|
|
226
|
+
- Preserve every source chat as canonical `chats[]` provenance somewhere in resulting notes.
|
|
227
|
+
- No copy `images_*` into new notes unless parent explicitly instructed.
|
|
228
|
+
- No edit Wiki, no call subagents, no write SQLite, no create aliases, no run linker.
|
|
229
|
+
|
|
230
|
+
Parent applies only through `apply-atomicity-split --bundle ... --json`. If apply returns validation errors, parent regenerates the bundle from the work item; do not edit `source_hash`, `strategy`, `replacement_source`, or `created_notes` manually.
|