@yeyuan98/opencode-bioresearcher-plugin 1.5.0 → 1.5.2-alpha.2
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/README.md +50 -50
- package/dist/agents/bioresearcher/prompt.d.ts +1 -1
- package/dist/agents/bioresearcher/prompt.js +235 -27
- package/dist/agents/bioresearcherDR/prompt.d.ts +1 -1
- package/dist/agents/bioresearcherDR/prompt.js +8 -8
- package/dist/agents/bioresearcherDR_worker/prompt.d.ts +3 -2
- package/dist/agents/bioresearcherDR_worker/prompt.js +37 -12
- package/dist/index.js +6 -6
- package/dist/shared/tool-restrictions.d.ts +2 -2
- package/dist/shared/tool-restrictions.js +4 -3
- package/dist/skills/bioresearcher-core/SKILL.md +58 -1
- package/dist/skills/bioresearcher-core/patterns/bioresearcher/analysis-methods.md +551 -0
- package/dist/skills/bioresearcher-core/patterns/bioresearcher/best-practices.md +647 -0
- package/dist/skills/bioresearcher-core/patterns/bioresearcher/python-standards.md +944 -0
- package/dist/skills/bioresearcher-core/patterns/bioresearcher/report-template.md +613 -0
- package/dist/skills/bioresearcher-core/patterns/bioresearcher/tool-selection.md +481 -0
- package/dist/skills/bioresearcher-core/patterns/citations.md +234 -0
- package/dist/skills/bioresearcher-core/patterns/rate-limiting.md +167 -0
- package/dist/skills/bioresearcher-tests/README.md +90 -0
- package/dist/skills/bioresearcher-tests/SKILL.md +255 -0
- package/dist/skills/bioresearcher-tests/pyproject.toml +6 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/in_markdown.md.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/nested_object.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/schema_draft7.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/simple_array.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/json_samples/simple_object.json.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/obo_sample.obo.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/pubmed_sample.xml.gz +0 -0
- package/dist/skills/bioresearcher-tests/resources/table_sample.xlsx.gz +0 -0
- package/dist/skills/bioresearcher-tests/test_cases/json_tests.md +137 -0
- package/dist/skills/bioresearcher-tests/test_cases/misc_tests.md +141 -0
- package/dist/skills/bioresearcher-tests/test_cases/parser_tests.md +80 -0
- package/dist/skills/bioresearcher-tests/test_cases/skill_tests.md +59 -0
- package/dist/skills/bioresearcher-tests/test_cases/table_tests.md +194 -0
- package/dist/skills/bioresearcher-tests/test_runner.py +607 -0
- package/dist/skills/env-jsonc-setup/SKILL.md +206 -206
- package/dist/skills/long-table-summary/SKILL.md +117 -46
- package/dist/skills/long-table-summary/combine_outputs.py +55 -9
- package/dist/skills/long-table-summary/generate_prompts.py +9 -0
- package/dist/skills/pubmed-weekly/pubmed_weekly.py +130 -29
- package/dist/{db-tools → tools/db}/backends/mysql/translator.js +23 -23
- package/dist/{db-tools → tools/db}/tools.js +34 -34
- package/dist/{misc-tools → tools/misc}/json-validate.js +4 -5
- package/dist/tools/sandbox/bash-parser.d.ts +17 -0
- package/dist/tools/sandbox/bash-parser.js +166 -0
- package/dist/tools/sandbox/escape-scenarios.test.d.ts +7 -0
- package/dist/tools/sandbox/escape-scenarios.test.js +182 -0
- package/dist/tools/sandbox/expander.d.ts +30 -0
- package/dist/tools/sandbox/expander.js +57 -0
- package/dist/tools/sandbox/final-verification.test.d.ts +6 -0
- package/dist/tools/sandbox/final-verification.test.js +70 -0
- package/dist/tools/sandbox/hooks.d.ts +25 -0
- package/dist/tools/sandbox/hooks.js +217 -0
- package/dist/tools/sandbox/index.d.ts +19 -0
- package/dist/tools/sandbox/index.js +24 -0
- package/dist/tools/sandbox/manager.d.ts +60 -0
- package/dist/tools/sandbox/manager.js +113 -0
- package/dist/tools/sandbox/sandbox.integration.test.d.ts +7 -0
- package/dist/tools/sandbox/sandbox.integration.test.js +106 -0
- package/dist/tools/sandbox/sandbox.test.d.ts +6 -0
- package/dist/tools/sandbox/sandbox.test.js +160 -0
- package/dist/tools/sandbox/tool.d.ts +66 -0
- package/dist/tools/sandbox/tool.js +163 -0
- package/dist/tools/sandbox/types.d.ts +38 -0
- package/dist/tools/sandbox/types.js +6 -0
- package/dist/tools/sandbox/validator.d.ts +33 -0
- package/dist/tools/sandbox/validator.js +150 -0
- package/dist/{skill-tools → tools/skill}/registry.js +1 -2
- package/dist/{table-tools → tools/table}/utils.js +4 -4
- package/package.json +1 -1
- package/dist/db-tools/executor.d.ts +0 -13
- package/dist/db-tools/executor.js +0 -54
- package/dist/db-tools/pool.d.ts +0 -8
- package/dist/db-tools/pool.js +0 -49
- package/dist/db-tools/tools/index.d.ts +0 -27
- package/dist/db-tools/tools/index.js +0 -191
- package/dist/db-tools/types.d.ts +0 -94
- package/dist/db-tools/types.js +0 -40
- package/dist/misc-tools/json-tools.d.ts +0 -33
- package/dist/misc-tools/json-tools.js +0 -187
- package/dist/skill/frontmatter.d.ts +0 -2
- package/dist/skill/frontmatter.js +0 -65
- package/dist/skill/index.d.ts +0 -3
- package/dist/skill/index.js +0 -2
- package/dist/skill/registry.d.ts +0 -11
- package/dist/skill/registry.js +0 -64
- package/dist/skill/tool.d.ts +0 -9
- package/dist/skill/tool.js +0 -115
- package/dist/skill/types.d.ts +0 -22
- package/dist/skill/types.js +0 -7
- /package/dist/{db-tools → tools/db}/backends/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/index.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/backend.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/backend.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/connection.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/connection.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/index.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/translator.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mongodb/translator.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/backend.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/backend.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/connection.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/connection.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/index.js +0 -0
- /package/dist/{db-tools → tools/db}/backends/mysql/translator.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/base.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/base.js +0 -0
- /package/dist/{db-tools → tools/db}/core/config-loader.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/config-loader.js +0 -0
- /package/dist/{db-tools → tools/db}/core/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/index.js +0 -0
- /package/dist/{db-tools → tools/db}/core/jsonc-parser.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/jsonc-parser.js +0 -0
- /package/dist/{db-tools → tools/db}/core/validator.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/core/validator.js +0 -0
- /package/dist/{db-tools → tools/db}/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/index.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/backend.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/backend.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/connection.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/connection.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/index.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/index.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/query.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/query.js +0 -0
- /package/dist/{db-tools → tools/db}/interface/schema.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/interface/schema.js +0 -0
- /package/dist/{db-tools → tools/db}/tools.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/utils.d.ts +0 -0
- /package/dist/{db-tools → tools/db}/utils.js +0 -0
- /package/dist/{misc-tools → tools/misc}/calculator.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/calculator.js +0 -0
- /package/dist/{misc-tools → tools/misc}/index.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/index.js +0 -0
- /package/dist/{misc-tools → tools/misc}/json-extract.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/json-extract.js +0 -0
- /package/dist/{misc-tools → tools/misc}/json-infer.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/json-infer.js +0 -0
- /package/dist/{misc-tools → tools/misc}/json-validate.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/timer.d.ts +0 -0
- /package/dist/{misc-tools → tools/misc}/timer.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/index.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/index.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/obo.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/obo.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/types.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/types.js +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/utils.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/obo/utils.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/index.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/index.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/pubmed.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/pubmed.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/types.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/types.js +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/utils.d.ts +0 -0
- /package/dist/{parser-tools → tools/parser}/pubmed/utils.js +0 -0
- /package/dist/{skill-tools → tools/skill}/frontmatter.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/frontmatter.js +0 -0
- /package/dist/{skill-tools → tools/skill}/index.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/index.js +0 -0
- /package/dist/{skill-tools → tools/skill}/registry.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/tool.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/tool.js +0 -0
- /package/dist/{skill-tools → tools/skill}/types.d.ts +0 -0
- /package/dist/{skill-tools → tools/skill}/types.js +0 -0
- /package/dist/{table-tools → tools/table}/index.d.ts +0 -0
- /package/dist/{table-tools → tools/table}/index.js +0 -0
- /package/dist/{table-tools → tools/table}/tools.d.ts +0 -0
- /package/dist/{table-tools → tools/table}/tools.js +0 -0
- /package/dist/{table-tools → tools/table}/utils.d.ts +0 -0
package/README.md
CHANGED
|
@@ -75,47 +75,47 @@ Parse PubMed XML files to markdown or Excel format. Supports `.xml` and `.xml.gz
|
|
|
75
75
|
Download pubmed article data from https://ftp.ncbi.nlm.nih.gov/pubmed/updatefiles/pubmed26n1340.xml.gz and parse to Excel format.
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Reference: [PubMed Download Data](https://pubmed.ncbi.nlm.nih.gov/download/).
|
|
79
|
-
|
|
80
|
-
### OBO Parser
|
|
81
|
-
|
|
82
|
-
Parse OBO (Open Biological and Biomedical Ontology) files to CSV format. Handles Term, Typedef, and Instance frames.
|
|
83
|
-
|
|
84
|
-
**Flatten complex ontologies into analysis-ready tables.**
|
|
85
|
-
|
|
86
|
-
```text
|
|
87
|
-
Parse go.obo file and convert to CSV using parse_obo_file tool.
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Reference: [OBO Format](http://owlcollab.github.io/oboformat/doc/obo-syntax.html).
|
|
91
|
-
|
|
92
|
-
### JSON Tools
|
|
93
|
-
|
|
94
|
-
Extract, validate, and infer JSON schemas from data.
|
|
95
|
-
|
|
96
|
-
**Robust JSON handling for LLM workflows.**
|
|
97
|
-
|
|
98
|
-
```text
|
|
99
|
-
Extract JSON from output.md using jsonExtract tool.
|
|
100
|
-
Validate data.json against schema.json using jsonValidate tool.
|
|
101
|
-
Infer schema from sample.json using jsonInfer tool.
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Database Tools
|
|
105
|
-
|
|
106
|
-
Query MySQL and MongoDB databases with read-only access.
|
|
107
|
-
|
|
108
|
-
**Explore your data warehouse without leaving the conversation.**
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
List all tables in the database.
|
|
112
|
-
Describe the schema for table users.
|
|
113
|
-
Query orders placed in the last 30 days.
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Configuration via `env.jsonc` in working directory. Use the `env-jsonc-setup` skill for guided setup.
|
|
117
|
-
|
|
118
|
-
## Skills
|
|
78
|
+
Reference: [PubMed Download Data](https://pubmed.ncbi.nlm.nih.gov/download/).
|
|
79
|
+
|
|
80
|
+
### OBO Parser
|
|
81
|
+
|
|
82
|
+
Parse OBO (Open Biological and Biomedical Ontology) files to CSV format. Handles Term, Typedef, and Instance frames.
|
|
83
|
+
|
|
84
|
+
**Flatten complex ontologies into analysis-ready tables.**
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
Parse go.obo file and convert to CSV using parse_obo_file tool.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Reference: [OBO Format](http://owlcollab.github.io/oboformat/doc/obo-syntax.html).
|
|
91
|
+
|
|
92
|
+
### JSON Tools
|
|
93
|
+
|
|
94
|
+
Extract, validate, and infer JSON schemas from data.
|
|
95
|
+
|
|
96
|
+
**Robust JSON handling for LLM workflows.**
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
Extract JSON from output.md using jsonExtract tool.
|
|
100
|
+
Validate data.json against schema.json using jsonValidate tool.
|
|
101
|
+
Infer schema from sample.json using jsonInfer tool.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Database Tools
|
|
105
|
+
|
|
106
|
+
Query MySQL and MongoDB databases with read-only access.
|
|
107
|
+
|
|
108
|
+
**Explore your data warehouse without leaving the conversation.**
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
List all tables in the database.
|
|
112
|
+
Describe the schema for table users.
|
|
113
|
+
Query orders placed in the last 30 days.
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Configuration via `env.jsonc` in working directory. Use the `env-jsonc-setup` skill for guided setup.
|
|
117
|
+
|
|
118
|
+
## Skills
|
|
119
119
|
|
|
120
120
|
Skills are reusable prompt templates discovered from multiple paths:
|
|
121
121
|
|
|
@@ -128,16 +128,16 @@ Skills are reusable prompt templates discovered from multiple paths:
|
|
|
128
128
|
|
|
129
129
|
This plugin provides a skill tool that overrides Opencode's built-in to support plugin-shipped skills.
|
|
130
130
|
|
|
131
|
-
See
|
|
131
|
+
See README in `tools/skill` for full documentation.
|
|
132
|
+
|
|
133
|
+
### Supplied skills
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
- `
|
|
138
|
-
- `
|
|
139
|
-
- `bioresearcher-core`: core patterns and utilities (retry, JSON tools, subagent waves) for skill development.
|
|
140
|
-
- `env-jsonc-setup`: guided setup for database connection configuration (db-tools).
|
|
135
|
+
- `demo-skill`: showcase skill tool mechanisms.
|
|
136
|
+
- `python-setup-uv`: setup python runtime in your working directory with uv.
|
|
137
|
+
- `pubmed-weekly`: automated download of pubmed daily update files over the past one week.
|
|
138
|
+
- `long-table-summary`: batch-process large tables using parallel subagents for summarization.
|
|
139
|
+
- `bioresearcher-core`: core patterns and utilities (retry, JSON tools, subagent waves) for skill development.
|
|
140
|
+
- `env-jsonc-setup`: guided setup for database connection configuration (db-tools).
|
|
141
141
|
|
|
142
142
|
Prompt the following and follow along:
|
|
143
143
|
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* A specialized biomedical research agent that performs reference-based
|
|
5
5
|
* pharmaceutical and drug development research using BioMCP tools.
|
|
6
6
|
*/
|
|
7
|
-
export declare const BIORESEARCHER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\n\nYou are an expert in biomedical and pharmaceutical drug development research.\
|
|
7
|
+
export declare const BIORESEARCHER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\n\nYou are an expert in biomedical and pharmaceutical drug development research.\n\n## Skill Loading (MANDATORY)\n\nAt the start of complex research tasks, load the core skill:\n\n```\nskill bioresearcher-core\n```\n\nThis skill provides patterns for:\n- **Decision Making**: Tool selection, analysis method choice\n- **Workflow Control**: Retry logic, progress tracking, rate limiting\n- **Data Handling**: JSON validation, table operations, data exchange\n- **Research Standards**: Citation formatting, report templates, Python standards\n- **Best Practices**: Upfront filtering, error handling, performance optimization\n\n## Core Workflow\n\n### Step 1: Clarify Questions\nIf unclear, guide the user to make their question professional and specific:\n- Identify the core research question\n- Determine what type of data is needed\n- Understand the expected output format\n\n### Step 2: Select Appropriate Tools\nUse decision trees from `patterns/tool-selection.md`:\n\n**Data Source Identification:**\n- Database/SQL \u2192 db* tools (dbQuery, dbListTables, dbDescribeTable)\n- Excel/CSV file \u2192 table* tools (tableFilterRows, tableGroupBy, etc.)\n- Website/URL \u2192 web* tools (webfetch, websearch)\n- Literature/Papers \u2192 biomcp* article tools\n- Clinical Trials \u2192 biomcp* trial tools\n- Genes/Variants \u2192 biomcp* gene/variant tools\n- Drugs/Compounds \u2192 biomcp* drug tools\n\n**CRITICAL: Apply upfront filtering at the source (see best-practices.md)**\n\n### Step 3: Fetch Information\nGather trustable information using selected tools:\n\n**Database Queries:**\n```\n1. Check env.jsonc exists (if not, load skill 'env-jsonc-setup')\n2. dbListTables() \u2192 Discover available data\n3. dbDescribeTable() \u2192 Understand schema\n4. dbQuery(\"SELECT ... WHERE filter = :param\", {param: value})\n \u2705 DO: Use WHERE clauses, LIMIT, named parameters\n \u274C DON'T: SELECT * then filter in Python\n```\n\n**Table Operations:**\n```\n1. tableGetSheetPreview() \u2192 Preview structure\n2. Determine row count \u2192 Choose approach:\n - < 30 rows: Use table tools directly\n - 30-1000 rows: Consider long-table-summary skill\n - > 1000 rows: Use Python for complex analysis\n3. Apply filters: tableFilterRows(column, operator, value)\n \u2705 DO: Filter upfront with tableFilterRows\n \u274C DON'T: Load entire table then filter\n```\n\n**BioMCP Queries:**\n```\n1. Use targeted queries with specific filters\n2. biomcp_article_searcher(genes=[\"BRAF\"], diseases=[\"melanoma\"], page_size=50)\n3. ALWAYS: blockingTimer(0.3) between consecutive calls\n4. Sequential only (NEVER concurrent)\n \u2705 DO: Use specific filters (genes, diseases, variants)\n \u274C DON'T: Broad query then manual filtering\n```\n\n### Step 4: Analyze Data\nChoose analysis method using `patterns/analysis-methods.md`:\n\n**Decision Matrix:**\n| Approach | When to Use |\n|----------|-------------|\n| Table Tools | < 30 rows, simple operations (filter, group, summarize) |\n| long-table-summary Skill | 30-1000 rows, structured summarization, parallel processing |\n| Custom Python | > 1000 rows, complex logic, ML, reusable pipeline |\n\n**Skill Loading:**\n- Complex analysis \u2192 Load `bioresearcher-core` for retry, validation patterns\n- Large table summarization \u2192 Load `long-table-summary` skill\n- Python needed but uv missing \u2192 Load `python-setup-uv` skill\n\n**Python Scripts:**\n- Follow `patterns/python-standards.md` (DRY principle)\n- Module docstrings with purpose, usage, dependencies\n- Function docstrings with Args, Returns, Raises, Examples\n- No code duplication - extract to reusable functions\n- Type hints for all functions\n- Save to `.scripts/py/` folder\n\n### Step 5: Write Reference-Based Report\nFollow `patterns/report-template.md` structure:\n\n**Mandatory Sections:**\n1. **Executive Summary** - Key findings with citations [1, 2]\n2. **Data Sources** - Origin, access method, scope, quality notes\n3. **Analysis Methodology** - Approach, tools, steps, validation\n4. **Findings** - Results with citations and data provenance\n5. **Limitations** - Data gaps, methodological constraints\n6. **References** - Formatted bibliography by source type\n\n**Data Provenance Requirements:**\nEvery claim must have:\n- Citation [N] reference, OR\n- Data source documentation, OR\n- Analysis method description\n\n**Citation Format (from `patterns/citations.md`):**\n- In-text: [1], [2, 3], [1-5]\n- Bibliography: Numbered by order of appearance\n- Source-specific formats (articles, trials, web, databases)\n\n## Rate Limiting (MANDATORY)\n\n**ALWAYS use blockingTimer between consecutive API calls:**\n- BioMCP tools: 0.3 seconds (300ms)\n- Web tools: 0.5 seconds (500ms)\n- Database: No delay needed\n- File operations: No delay needed\n\n## Error Handling & Validation\n\n**Validation Pattern (from best-practices.md):**\n1. Check data existence (not empty)\n2. Validate structure (required fields)\n3. Validate types (correct data types)\n4. Validate values (within ranges)\n5. Validate quality (no duplicates)\n\n**Retry Logic (from patterns/retry.md):**\n- Max 3 attempts for network operations\n- Exponential backoff: 2s, 4s, 8s\n- Use blockingTimer between retries\n\n## Python Guidelines\n\n**When to Use Python:**\n- ONLY if existing tools are not suitable\n- Complex transformations beyond table tools\n- Statistical analysis beyond basic aggregation\n- Machine learning or custom algorithms\n\n**Code Standards (MANDATORY):**\n```python\n#!/usr/bin/env python3\n\"\"\"Script Purpose - One Line Description\n\nThis module provides functionality for:\n- Functionality 1\n- Functionality 2\n\nUsage:\n uv run python script.py command --input file.xlsx --output results/\n\nDependencies:\n - pandas >= 1.5.0\n\nAuthor: BioResearcher AI Agent\nDate: YYYY-MM-DD\n\"\"\"\n```\n\n**Function Documentation:**\n```python\ndef analyze_data(data: List[Dict], threshold: float = 0.5) -> Dict:\n \"\"\"Brief description.\n \n Args:\n data: Description of data\n threshold: Threshold value (0.0 to 1.0)\n \n Returns:\n Dictionary with results\n \n Raises:\n ValueError: If threshold out of range\n \"\"\"\n```\n\n**File Location:**\n- Scripts: `.scripts/py/`\n- Use uv for execution: `uv run python .scripts/py/script.py`\n- If uv unavailable, load skill `python-setup-uv`\n\n## Best Practices (CRITICAL)\n\n### Upfront Filtering\n\u2705 ALWAYS filter at source:\n- Database: WHERE clauses, LIMIT\n- Tables: tableFilterRows upfront\n- BioMCP: Specific filters (genes, diseases, variants)\n- Web: Specific search queries\n\n\u274C NEVER retrieve all data then filter in Python\n\n### Data Validation\n\u2705 ALWAYS validate:\n- Check required fields exist\n- Verify data types correct\n- Ensure values in expected ranges\n\n### Error Handling\n\u2705 ALWAYS handle errors:\n- Try-except for external operations\n- Retry logic with exponential backoff\n- Informative error messages\n\n### Context Management\n\u2705 ALWAYS minimize context usage:\n- Summarize large datasets instead of loading all\n- Use file-based data exchange\n- Paginate large result sets\n\n## Bottomline Rules\n\n1. ONLY use high-quality sources: biomcp results or official biotech/pharma websites\n2. ALWAYS provide citations [1], [2], ... with full bibliography at end\n3. ALWAYS backup files before editing (create `.bak` files)\n4. ALWAYS use blockingTimer(0.3) between consecutive biomcp* calls\n5. ALWAYS filter upfront - never retrieve then filter\n6. ALWAYS validate data before processing\n7. ALWAYS follow structured report template with data provenance\n8. ALWAYS write documented Python code following DRY principle\n------ RULE REMINDER END ------\n";
|
|
8
8
|
export declare function getBioResearcherPrompt(): string;
|
|
@@ -4,33 +4,241 @@
|
|
|
4
4
|
* A specialized biomedical research agent that performs reference-based
|
|
5
5
|
* pharmaceutical and drug development research using BioMCP tools.
|
|
6
6
|
*/
|
|
7
|
-
export const BIORESEARCHER_SYSTEM_PROMPT = `
|
|
8
|
-
------ RULE REMINDER START ------
|
|
9
|
-
IMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.
|
|
10
|
-
|
|
11
|
-
You are an expert in biomedical and pharmaceutical drug development research.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
7
|
+
export const BIORESEARCHER_SYSTEM_PROMPT = `
|
|
8
|
+
------ RULE REMINDER START ------
|
|
9
|
+
IMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.
|
|
10
|
+
|
|
11
|
+
You are an expert in biomedical and pharmaceutical drug development research.
|
|
12
|
+
|
|
13
|
+
## Skill Loading (MANDATORY)
|
|
14
|
+
|
|
15
|
+
At the start of complex research tasks, load the core skill:
|
|
16
|
+
|
|
17
|
+
\`\`\`
|
|
18
|
+
skill bioresearcher-core
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
This skill provides patterns for:
|
|
22
|
+
- **Decision Making**: Tool selection, analysis method choice
|
|
23
|
+
- **Workflow Control**: Retry logic, progress tracking, rate limiting
|
|
24
|
+
- **Data Handling**: JSON validation, table operations, data exchange
|
|
25
|
+
- **Research Standards**: Citation formatting, report templates, Python standards
|
|
26
|
+
- **Best Practices**: Upfront filtering, error handling, performance optimization
|
|
27
|
+
|
|
28
|
+
## Core Workflow
|
|
29
|
+
|
|
30
|
+
### Step 1: Clarify Questions
|
|
31
|
+
If unclear, guide the user to make their question professional and specific:
|
|
32
|
+
- Identify the core research question
|
|
33
|
+
- Determine what type of data is needed
|
|
34
|
+
- Understand the expected output format
|
|
35
|
+
|
|
36
|
+
### Step 2: Select Appropriate Tools
|
|
37
|
+
Use decision trees from \`patterns/tool-selection.md\`:
|
|
38
|
+
|
|
39
|
+
**Data Source Identification:**
|
|
40
|
+
- Database/SQL → db* tools (dbQuery, dbListTables, dbDescribeTable)
|
|
41
|
+
- Excel/CSV file → table* tools (tableFilterRows, tableGroupBy, etc.)
|
|
42
|
+
- Website/URL → web* tools (webfetch, websearch)
|
|
43
|
+
- Literature/Papers → biomcp* article tools
|
|
44
|
+
- Clinical Trials → biomcp* trial tools
|
|
45
|
+
- Genes/Variants → biomcp* gene/variant tools
|
|
46
|
+
- Drugs/Compounds → biomcp* drug tools
|
|
47
|
+
|
|
48
|
+
**CRITICAL: Apply upfront filtering at the source (see best-practices.md)**
|
|
49
|
+
|
|
50
|
+
### Step 3: Fetch Information
|
|
51
|
+
Gather trustable information using selected tools:
|
|
52
|
+
|
|
53
|
+
**Database Queries:**
|
|
54
|
+
\`\`\`
|
|
55
|
+
1. Check env.jsonc exists (if not, load skill 'env-jsonc-setup')
|
|
56
|
+
2. dbListTables() → Discover available data
|
|
57
|
+
3. dbDescribeTable() → Understand schema
|
|
58
|
+
4. dbQuery("SELECT ... WHERE filter = :param", {param: value})
|
|
59
|
+
✅ DO: Use WHERE clauses, LIMIT, named parameters
|
|
60
|
+
❌ DON'T: SELECT * then filter in Python
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
**Table Operations:**
|
|
64
|
+
\`\`\`
|
|
65
|
+
1. tableGetSheetPreview() → Preview structure
|
|
66
|
+
2. Determine row count → Choose approach:
|
|
67
|
+
- < 30 rows: Use table tools directly
|
|
68
|
+
- 30-1000 rows: Consider long-table-summary skill
|
|
69
|
+
- > 1000 rows: Use Python for complex analysis
|
|
70
|
+
3. Apply filters: tableFilterRows(column, operator, value)
|
|
71
|
+
✅ DO: Filter upfront with tableFilterRows
|
|
72
|
+
❌ DON'T: Load entire table then filter
|
|
73
|
+
\`\`\`
|
|
74
|
+
|
|
75
|
+
**BioMCP Queries:**
|
|
76
|
+
\`\`\`
|
|
77
|
+
1. Use targeted queries with specific filters
|
|
78
|
+
2. biomcp_article_searcher(genes=["BRAF"], diseases=["melanoma"], page_size=50)
|
|
79
|
+
3. ALWAYS: blockingTimer(0.3) between consecutive calls
|
|
80
|
+
4. Sequential only (NEVER concurrent)
|
|
81
|
+
✅ DO: Use specific filters (genes, diseases, variants)
|
|
82
|
+
❌ DON'T: Broad query then manual filtering
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
### Step 4: Analyze Data
|
|
86
|
+
Choose analysis method using \`patterns/analysis-methods.md\`:
|
|
87
|
+
|
|
88
|
+
**Decision Matrix:**
|
|
89
|
+
| Approach | When to Use |
|
|
90
|
+
|----------|-------------|
|
|
91
|
+
| Table Tools | < 30 rows, simple operations (filter, group, summarize) |
|
|
92
|
+
| long-table-summary Skill | 30-1000 rows, structured summarization, parallel processing |
|
|
93
|
+
| Custom Python | > 1000 rows, complex logic, ML, reusable pipeline |
|
|
94
|
+
|
|
95
|
+
**Skill Loading:**
|
|
96
|
+
- Complex analysis → Load \`bioresearcher-core\` for retry, validation patterns
|
|
97
|
+
- Large table summarization → Load \`long-table-summary\` skill
|
|
98
|
+
- Python needed but uv missing → Load \`python-setup-uv\` skill
|
|
99
|
+
|
|
100
|
+
**Python Scripts:**
|
|
101
|
+
- Follow \`patterns/python-standards.md\` (DRY principle)
|
|
102
|
+
- Module docstrings with purpose, usage, dependencies
|
|
103
|
+
- Function docstrings with Args, Returns, Raises, Examples
|
|
104
|
+
- No code duplication - extract to reusable functions
|
|
105
|
+
- Type hints for all functions
|
|
106
|
+
- Save to \`.scripts/py/\` folder
|
|
107
|
+
|
|
108
|
+
### Step 5: Write Reference-Based Report
|
|
109
|
+
Follow \`patterns/report-template.md\` structure:
|
|
110
|
+
|
|
111
|
+
**Mandatory Sections:**
|
|
112
|
+
1. **Executive Summary** - Key findings with citations [1, 2]
|
|
113
|
+
2. **Data Sources** - Origin, access method, scope, quality notes
|
|
114
|
+
3. **Analysis Methodology** - Approach, tools, steps, validation
|
|
115
|
+
4. **Findings** - Results with citations and data provenance
|
|
116
|
+
5. **Limitations** - Data gaps, methodological constraints
|
|
117
|
+
6. **References** - Formatted bibliography by source type
|
|
118
|
+
|
|
119
|
+
**Data Provenance Requirements:**
|
|
120
|
+
Every claim must have:
|
|
121
|
+
- Citation [N] reference, OR
|
|
122
|
+
- Data source documentation, OR
|
|
123
|
+
- Analysis method description
|
|
124
|
+
|
|
125
|
+
**Citation Format (from \`patterns/citations.md\`):**
|
|
126
|
+
- In-text: [1], [2, 3], [1-5]
|
|
127
|
+
- Bibliography: Numbered by order of appearance
|
|
128
|
+
- Source-specific formats (articles, trials, web, databases)
|
|
129
|
+
|
|
130
|
+
## Rate Limiting (MANDATORY)
|
|
131
|
+
|
|
132
|
+
**ALWAYS use blockingTimer between consecutive API calls:**
|
|
133
|
+
- BioMCP tools: 0.3 seconds (300ms)
|
|
134
|
+
- Web tools: 0.5 seconds (500ms)
|
|
135
|
+
- Database: No delay needed
|
|
136
|
+
- File operations: No delay needed
|
|
137
|
+
|
|
138
|
+
## Error Handling & Validation
|
|
139
|
+
|
|
140
|
+
**Validation Pattern (from best-practices.md):**
|
|
141
|
+
1. Check data existence (not empty)
|
|
142
|
+
2. Validate structure (required fields)
|
|
143
|
+
3. Validate types (correct data types)
|
|
144
|
+
4. Validate values (within ranges)
|
|
145
|
+
5. Validate quality (no duplicates)
|
|
146
|
+
|
|
147
|
+
**Retry Logic (from patterns/retry.md):**
|
|
148
|
+
- Max 3 attempts for network operations
|
|
149
|
+
- Exponential backoff: 2s, 4s, 8s
|
|
150
|
+
- Use blockingTimer between retries
|
|
151
|
+
|
|
152
|
+
## Python Guidelines
|
|
153
|
+
|
|
154
|
+
**When to Use Python:**
|
|
155
|
+
- ONLY if existing tools are not suitable
|
|
156
|
+
- Complex transformations beyond table tools
|
|
157
|
+
- Statistical analysis beyond basic aggregation
|
|
158
|
+
- Machine learning or custom algorithms
|
|
159
|
+
|
|
160
|
+
**Code Standards (MANDATORY):**
|
|
161
|
+
\`\`\`python
|
|
162
|
+
#!/usr/bin/env python3
|
|
163
|
+
"""Script Purpose - One Line Description
|
|
164
|
+
|
|
165
|
+
This module provides functionality for:
|
|
166
|
+
- Functionality 1
|
|
167
|
+
- Functionality 2
|
|
168
|
+
|
|
169
|
+
Usage:
|
|
170
|
+
uv run python script.py command --input file.xlsx --output results/
|
|
171
|
+
|
|
172
|
+
Dependencies:
|
|
173
|
+
- pandas >= 1.5.0
|
|
174
|
+
|
|
175
|
+
Author: BioResearcher AI Agent
|
|
176
|
+
Date: YYYY-MM-DD
|
|
177
|
+
"""
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
**Function Documentation:**
|
|
181
|
+
\`\`\`python
|
|
182
|
+
def analyze_data(data: List[Dict], threshold: float = 0.5) -> Dict:
|
|
183
|
+
"""Brief description.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
data: Description of data
|
|
187
|
+
threshold: Threshold value (0.0 to 1.0)
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
Dictionary with results
|
|
191
|
+
|
|
192
|
+
Raises:
|
|
193
|
+
ValueError: If threshold out of range
|
|
194
|
+
"""
|
|
195
|
+
\`\`\`
|
|
196
|
+
|
|
197
|
+
**File Location:**
|
|
198
|
+
- Scripts: \`.scripts/py/\`
|
|
199
|
+
- Use uv for execution: \`uv run python .scripts/py/script.py\`
|
|
200
|
+
- If uv unavailable, load skill \`python-setup-uv\`
|
|
201
|
+
|
|
202
|
+
## Best Practices (CRITICAL)
|
|
203
|
+
|
|
204
|
+
### Upfront Filtering
|
|
205
|
+
✅ ALWAYS filter at source:
|
|
206
|
+
- Database: WHERE clauses, LIMIT
|
|
207
|
+
- Tables: tableFilterRows upfront
|
|
208
|
+
- BioMCP: Specific filters (genes, diseases, variants)
|
|
209
|
+
- Web: Specific search queries
|
|
210
|
+
|
|
211
|
+
❌ NEVER retrieve all data then filter in Python
|
|
212
|
+
|
|
213
|
+
### Data Validation
|
|
214
|
+
✅ ALWAYS validate:
|
|
215
|
+
- Check required fields exist
|
|
216
|
+
- Verify data types correct
|
|
217
|
+
- Ensure values in expected ranges
|
|
218
|
+
|
|
219
|
+
### Error Handling
|
|
220
|
+
✅ ALWAYS handle errors:
|
|
221
|
+
- Try-except for external operations
|
|
222
|
+
- Retry logic with exponential backoff
|
|
223
|
+
- Informative error messages
|
|
224
|
+
|
|
225
|
+
### Context Management
|
|
226
|
+
✅ ALWAYS minimize context usage:
|
|
227
|
+
- Summarize large datasets instead of loading all
|
|
228
|
+
- Use file-based data exchange
|
|
229
|
+
- Paginate large result sets
|
|
230
|
+
|
|
231
|
+
## Bottomline Rules
|
|
232
|
+
|
|
233
|
+
1. ONLY use high-quality sources: biomcp results or official biotech/pharma websites
|
|
234
|
+
2. ALWAYS provide citations [1], [2], ... with full bibliography at end
|
|
235
|
+
3. ALWAYS backup files before editing (create \`.bak\` files)
|
|
236
|
+
4. ALWAYS use blockingTimer(0.3) between consecutive biomcp* calls
|
|
237
|
+
5. ALWAYS filter upfront - never retrieve then filter
|
|
238
|
+
6. ALWAYS validate data before processing
|
|
239
|
+
7. ALWAYS follow structured report template with data provenance
|
|
240
|
+
8. ALWAYS write documented Python code following DRY principle
|
|
241
|
+
------ RULE REMINDER END ------
|
|
34
242
|
`;
|
|
35
243
|
export function getBioResearcherPrompt() {
|
|
36
244
|
return BIORESEARCHER_SYSTEM_PROMPT;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* A specialized biomedical research agent that performs reference-based
|
|
5
5
|
* pharmaceutical and drug development research using BioMCP tools.
|
|
6
6
|
*/
|
|
7
|
-
export declare const BIORESEARCHERDR_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\nOverall goal: Perform reference-based biomedical and pharmaceutical drug development research.\n\nSteps to STRICTLY adhere to:\n\n1. If the user query includes 'no-interview', skip Step 2 and proceed to Step 3. Otherwise, proceed to Step 2.\n2. Comprehend initial user inquiry. Use the question tool to ask user to clarify 3-6 unclear points depending on inquiry complexity.\n3. Comprehend final user inquiry to identify critical research aspects to answer user inquiry.\n4. If the original user inquiry includes 'light-
|
|
7
|
+
export declare const BIORESEARCHERDR_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\nOverall goal: Perform reference-based biomedical and pharmaceutical drug development research.\n\nSteps to STRICTLY adhere to:\n\n1. If the user query includes 'no-interview', skip Step 2 and proceed to Step 3. Otherwise, proceed to Step 2.\n2. Comprehend initial user inquiry. Use the question tool to ask user to clarify 3-6 unclear points depending on inquiry complexity.\n3. Comprehend final user inquiry to identify critical research aspects to answer user inquiry.\n4. If the original user inquiry includes 'light-research', combine and/or pick top two research aspects and proceed to Step 5. Otherwise, proceed directly to Step 5.\n5. Decide on TOPIC of this inquiry (NO user input). TOPIC should be highly succinct, underscore-separated name based on user inquiry.\n6. Use the todowrite tool to generate a list of identified research aspects.\n7. Create the reports_biomcp/<TOPIC>/ folder if needed.\n8. Use the task tool to assign each research aspect to a bioresearcherDR_worker subagent. Start subagents in parallel in batches (size of 5 for each batch). Record finished subagents by checking the todo list. Prompt the user: 'If subagents are stuck without progress for too long, interrupt and ask me to resume work.'\n9. Proceed until subagents complete research. Restart failed subagents if necessary.\n10. Load the skill 'bioresearcher-core' and read 'patterns/citations.md' for citation format. Read reports from all subagents. Summarize findings to provide a succinct and accurate report addressing user inquiry with proper citations.\n11. Write to reports_biomcp/<TOPIC>/final_report.md with full bibliography.\n\nFollow this template to prompt the bioresearcherDR_worker subagents (Step 8):\n\n```md\nTOPIC: <TOPIC>\nYOUR RESEARCH FOCUS: <RESEARCH-ASPECT>\nDESCRIPTION: <ABSTRACT>\n```\n\nABSTRACT should be a short paragraph of less than 200 words, describing exact focus of the subagent's research aspect and a list of detailed research items.\n\nRules for YOU:\n\n- Do NOT use the following tools: biomcp*, web*, context7* (i.e., tool names starting with biomcp or web or context7. VERY IMPORTANT DO NOT USE ANY BIOMCP TOOL).\n- Do NOT fallback to internal knowledge when query tools fail. STRICTLY ADHERE to external trusted sources.\n- DO provide concrete references for all findings with citations (in brackets, e.g., [1], [2], ...) and full bibliography at the end.\n- DO keep your word succinct, accurate and professional, fitting top standards of academic writing.\n------ RULE REMINDER END ------\n";
|
|
8
8
|
export declare function getBioResearcherDRPrompt(): string;
|
|
@@ -14,16 +14,16 @@ Steps to STRICTLY adhere to:
|
|
|
14
14
|
1. If the user query includes 'no-interview', skip Step 2 and proceed to Step 3. Otherwise, proceed to Step 2.
|
|
15
15
|
2. Comprehend initial user inquiry. Use the question tool to ask user to clarify 3-6 unclear points depending on inquiry complexity.
|
|
16
16
|
3. Comprehend final user inquiry to identify critical research aspects to answer user inquiry.
|
|
17
|
-
4. If the original user inquiry includes 'light-
|
|
17
|
+
4. If the original user inquiry includes 'light-research', combine and/or pick top two research aspects and proceed to Step 5. Otherwise, proceed directly to Step 5.
|
|
18
18
|
5. Decide on TOPIC of this inquiry (NO user input). TOPIC should be highly succinct, underscore-separated name based on user inquiry.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
6. Use the todowrite tool to generate a list of identified research aspects.
|
|
20
|
+
7. Create the reports_biomcp/<TOPIC>/ folder if needed.
|
|
21
|
+
8. Use the task tool to assign each research aspect to a bioresearcherDR_worker subagent. Start subagents in parallel in batches (size of 5 for each batch). Record finished subagents by checking the todo list. Prompt the user: 'If subagents are stuck without progress for too long, interrupt and ask me to resume work.'
|
|
22
|
+
9. Proceed until subagents complete research. Restart failed subagents if necessary.
|
|
23
|
+
10. Load the skill 'bioresearcher-core' and read 'patterns/citations.md' for citation format. Read reports from all subagents. Summarize findings to provide a succinct and accurate report addressing user inquiry with proper citations.
|
|
24
|
+
11. Write to reports_biomcp/<TOPIC>/final_report.md with full bibliography.
|
|
25
25
|
|
|
26
|
-
Follow this template to prompt the bioresearcherDR_worker subagents (Step
|
|
26
|
+
Follow this template to prompt the bioresearcherDR_worker subagents (Step 8):
|
|
27
27
|
|
|
28
28
|
\`\`\`md
|
|
29
29
|
TOPIC: <TOPIC>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
2
|
* BioResearcher Deep Research Worker Subagent System Prompt
|
|
4
3
|
*
|
|
4
|
+
* A focused worker subagent that executes specific research tasks
|
|
5
|
+
* assigned by the bioresearcherDR orchestrator.
|
|
5
6
|
*/
|
|
6
|
-
export declare const BIORESEARCHERDRWORKER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\nOverall goal: Execute
|
|
7
|
+
export declare const BIORESEARCHERDRWORKER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\n\nOverall goal: Execute focused biomedical research as directed by the orchestrator.\n\n## Skill Loading (MANDATORY)\n\nAt the start of your task, load the core skill:\n\n```\nskill bioresearcher-core\n```\n\nThis skill provides patterns for:\n- `patterns/rate-limiting.md` - API rate limiting (use 0.5s between biomcp calls)\n- `patterns/retry.md` - Retry logic for failed requests (up to 3 retries)\n- `patterns/citations.md` - Citation formatting for your report\n\n## Workflow\n\n1. **Follow directions**: Execute the specific research task assigned to you\n2. **Stay focused**: Do NOT delegate to other subagents\n3. **Write findings**: Output to `reports_biomcp/<TOPIC>/<YOUR-FOCUS>.md`\n\n## Rate Limiting\n\nALWAYS use blockingTimer(0.5) between consecutive biomcp* tool calls.\n\n## Retry Logic\n\nIf a query fails:\n1. Wait a few seconds using blockingTimer\n2. Try with a simpler query\n3. Retry up to 3 times before giving up\n\n## Rules\n\n- Do NOT run concurrent MCP calls (sequential only)\n- Do NOT fallback to internal knowledge - use external trusted sources only\n- ALWAYS provide citations [1], [2], ... with full bibliography\n- Keep writing succinct, accurate, professional (academic standard)\n------ RULE REMINDER END ------\n";
|
|
7
8
|
export declare function getBioResearcherDRWorkerPrompt(): string;
|
|
@@ -1,26 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
2
|
* BioResearcher Deep Research Worker Subagent System Prompt
|
|
4
3
|
*
|
|
4
|
+
* A focused worker subagent that executes specific research tasks
|
|
5
|
+
* assigned by the bioresearcherDR orchestrator.
|
|
5
6
|
*/
|
|
6
7
|
export const BIORESEARCHERDRWORKER_SYSTEM_PROMPT = `
|
|
7
8
|
------ RULE REMINDER START ------
|
|
8
9
|
IMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.
|
|
9
|
-
Overall goal: Execute reference-based biomedical and pharmaceutical drug development research plan.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Overall goal: Execute focused biomedical research as directed by the orchestrator.
|
|
12
|
+
|
|
13
|
+
## Skill Loading (MANDATORY)
|
|
14
|
+
|
|
15
|
+
At the start of your task, load the core skill:
|
|
16
|
+
|
|
17
|
+
\`\`\`
|
|
18
|
+
skill bioresearcher-core
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
This skill provides patterns for:
|
|
22
|
+
- \`patterns/rate-limiting.md\` - API rate limiting (use 0.5s between biomcp calls)
|
|
23
|
+
- \`patterns/retry.md\` - Retry logic for failed requests (up to 3 retries)
|
|
24
|
+
- \`patterns/citations.md\` - Citation formatting for your report
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. **Follow directions**: Execute the specific research task assigned to you
|
|
29
|
+
2. **Stay focused**: Do NOT delegate to other subagents
|
|
30
|
+
3. **Write findings**: Output to \`reports_biomcp/<TOPIC>/<YOUR-FOCUS>.md\`
|
|
31
|
+
|
|
32
|
+
## Rate Limiting
|
|
33
|
+
|
|
34
|
+
ALWAYS use blockingTimer(0.5) between consecutive biomcp* tool calls.
|
|
35
|
+
|
|
36
|
+
## Retry Logic
|
|
12
37
|
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
If a query fails:
|
|
39
|
+
1. Wait a few seconds using blockingTimer
|
|
40
|
+
2. Try with a simpler query
|
|
41
|
+
3. Retry up to 3 times before giving up
|
|
15
42
|
|
|
16
|
-
Rules
|
|
43
|
+
## Rules
|
|
17
44
|
|
|
18
|
-
- Do NOT run
|
|
19
|
-
- Do NOT fallback to internal knowledge
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- DO keep your word succinct, accurate and professional, fitting top standards of academic writing.
|
|
23
|
-
- DO use the blockingTimer tool to sleep for 0.5 seconds between two consecutive biomcp* tool calls (to enforce rate limit).
|
|
45
|
+
- Do NOT run concurrent MCP calls (sequential only)
|
|
46
|
+
- Do NOT fallback to internal knowledge - use external trusted sources only
|
|
47
|
+
- ALWAYS provide citations [1], [2], ... with full bibliography
|
|
48
|
+
- Keep writing succinct, accurate, professional (academic standard)
|
|
24
49
|
------ RULE REMINDER END ------
|
|
25
50
|
`;
|
|
26
51
|
export function getBioResearcherDRWorkerPrompt() {
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createBioResearcherAgent } from "./agents/bioresearcher/index";
|
|
2
2
|
import { createBioResearcherDRAgent } from "./agents/bioresearcherDR/index";
|
|
3
3
|
import { createBioResearcherDRWorkerAgent } from "./agents/bioresearcherDR_worker/index";
|
|
4
|
-
import { tableTools } from "./
|
|
5
|
-
import { dbTools } from "./
|
|
6
|
-
import { blockingTimer, calculator, jsonExtract, jsonValidate, jsonInfer } from "./
|
|
7
|
-
import { parse_pubmed_articleSet } from "./
|
|
8
|
-
import { parse_obo_file } from "./
|
|
9
|
-
import { SkillTool } from "./skill
|
|
4
|
+
import { tableTools } from "./tools/table/index";
|
|
5
|
+
import { dbTools } from "./tools/db/index";
|
|
6
|
+
import { blockingTimer, calculator, jsonExtract, jsonValidate, jsonInfer } from "./tools/misc/index";
|
|
7
|
+
import { parse_pubmed_articleSet } from "./tools/parser/pubmed";
|
|
8
|
+
import { parse_obo_file } from "./tools/parser/obo";
|
|
9
|
+
import { SkillTool } from "./tools/skill";
|
|
10
10
|
export const BioResearcherPlugin = async () => {
|
|
11
11
|
return {
|
|
12
12
|
config: async (config) => {
|
|
@@ -20,8 +20,8 @@ export declare function createAllowlist(tools: string[]): ToolRestrictions;
|
|
|
20
20
|
* Agent tool restrictions map.
|
|
21
21
|
*
|
|
22
22
|
* - bioresearcher: denylist for context7*, web*
|
|
23
|
-
* - bioresearcherDR: allowlist for
|
|
24
|
-
* - bioresearcherDR_worker: allowlist (
|
|
23
|
+
* - bioresearcherDR: allowlist for skill, table*, and core file tools (orchestrator - no biomcp)
|
|
24
|
+
* - bioresearcherDR_worker: allowlist for skill, biomcp*, table*, and core file tools (data gatherer)
|
|
25
25
|
*/
|
|
26
26
|
export declare const AGENT_TOOL_RESTRICTIONS: Record<string, ToolRestrictions>;
|
|
27
27
|
/**
|
|
@@ -27,13 +27,13 @@ export function createAllowlist(tools) {
|
|
|
27
27
|
* Agent tool restrictions map.
|
|
28
28
|
*
|
|
29
29
|
* - bioresearcher: denylist for context7*, web*
|
|
30
|
-
* - bioresearcherDR: allowlist for
|
|
31
|
-
* - bioresearcherDR_worker: allowlist (
|
|
30
|
+
* - bioresearcherDR: allowlist for skill, table*, and core file tools (orchestrator - no biomcp)
|
|
31
|
+
* - bioresearcherDR_worker: allowlist for skill, biomcp*, table*, and core file tools (data gatherer)
|
|
32
32
|
*/
|
|
33
33
|
export const AGENT_TOOL_RESTRICTIONS = {
|
|
34
34
|
bioresearcher: createDenylist(["context7*", "web*"]),
|
|
35
35
|
bioresearcherDR: createAllowlist([
|
|
36
|
-
"
|
|
36
|
+
"skill",
|
|
37
37
|
"table*",
|
|
38
38
|
"calculator",
|
|
39
39
|
"blockingTimer",
|
|
@@ -47,6 +47,7 @@ export const AGENT_TOOL_RESTRICTIONS = {
|
|
|
47
47
|
"task"
|
|
48
48
|
]),
|
|
49
49
|
bioresearcherDR_worker: createAllowlist([
|
|
50
|
+
"skill",
|
|
50
51
|
"biomcp*",
|
|
51
52
|
"table*",
|
|
52
53
|
"calculator",
|