Source: https://github.com/aipoch/medical-research-skills
When to Use
- You are preparing an academic paper for journal/conference submission and need a final language + formatting pass.
- You have bilingual (Chinese/English) content and want consistent punctuation, wording, and style across both languages.
- Your manuscript contains domain terminology (e.g., life sciences) and you need consistent Chinese–English term mapping and abbreviation rules.
- You need to validate references, numbers/units, and heading levels against a required style (APA/MLA/GB/T 7714).
- You want a shareable report (HTML or Markdown annotations) with precise error locations and revision suggestions.
Agent Workflow
Follow these steps in order when the user provides text for proofreading:
Step 1: Identify Input Source
- Determine if the user pasted text directly, provided a file path, or attached a
.docx/.md file.
- If a file path is given, read the file content. If a
.docx file, use word_converter.py to extract text first.
- If the user provided only text inline, use that text directly.
Step 2: Determine Language Scope
- Check if the content is English, Chinese, or bilingual (both).
- Set language parameter accordingly:
en, zh, or both.
- If the user did not specify, auto-detect from content.
Step 3: Run English Checks (if applicable)
- If English content is detected, call
EnglishChecker().check(text) to check:
- Spelling (US/UK variants)
- Grammar (agreement, tense, articles)
- Punctuation (US/UK conventions)
- Style (redundancy, passive voice)
- Collect all findings with location, type, and suggested fix.
Step 4: Run Chinese Checks (if applicable)
- If Chinese content is detected, call
ChineseChecker().check(text) to check:
- Typo/misused characters
- Grammar and collocation
- Chinese vs English punctuation normalization
- Academic expression optimization
- Collect all findings.
Step 5: Run Terminology Check
- Call
TerminologyManager(domain="biology").check(text) to verify:
- Bidirectional Chinese–English term correspondence
- Abbreviation rule compliance (full form on first occurrence)
- Synonym unification to preferred standard terms
- Collect all findings.
Step 6: Generate Report
- Feed all findings to
AnnotationGenerator(output_format="html" or "markdown").
- Generate the report showing:
- Each issue with precise location (line/offset)
- Issue type (spelling, grammar, terminology, formatting)
- Suggested fix
- Present the report to the user. If the user requested an HTML file, save and return the file path.
Step 7: Validate Output
- Verify all detected issues have location + type + fix.
- Confirm the output format matches the user's request (HTML/Markdown).
- If partial, label clearly as PARTIAL.
Key Features
English checks
- Spelling (including US/UK variants)
- Grammar (agreement, tense, articles, clause structure)
- Punctuation conventions (US/UK)
- Style suggestions (redundancy detection, passive voice optimization)
Chinese checks
- Typo/misused character detection (dictionary-based)
- Grammar and collocation checks
- Chinese vs. English punctuation normalization
- Academic expression optimization suggestions
Terminology consistency
- Domain terminology database (life sciences by default)
- Bidirectional Chinese–English correspondence checks
- Abbreviation rules (require full form on first occurrence)
- Synonym unification to preferred standard terms
Formatting checks
- Reference style validation (APA/MLA/GB/T 7714, etc.)
- Number and unit normalization
- Heading level consistency
- Abbreviation consistency across the document
Reporting
- HTML interactive report or Markdown annotations
- Precise error localization
- Actionable revision suggestions
Dependencies
Example Usage
1) Install
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
2) Run (basic)
python scripts/init_run.py --input <paper_file_path> --output <output_path>
3) Run (advanced)
python scripts/init_run.py \
--input paper.md \
--output report.html \
--lang en \
--style apa \
--terminology biology \
--format html
4) CLI parameters
| Parameter |
Description |
Default |
--input |
Input file path |
Required |
--output |
Output report path |
Generates an HTML report by default |
--lang |
Language to check (en / zh / both) |
both |
--style |
Reference style (apa / mla / gb) |
apa |
--terminology |
Domain terminology set |
biology |
--format |
Output format (html / markdown) |
html |
--no-pdf |
Skip PDF generation during Word→PDF conversion |
false |
5) Use as a Python module (end-to-end)
from scripts.english_checker import EnglishChecker
from scripts.chinese_checker import ChineseChecker
from scripts.terminology_manager import TerminologyManager
from scripts.annotation_generator import AnnotationGenerator
text = """
Messenger RNA (mRNA) is transcribed in the nucleus.
"""
en_checker = EnglishChecker()
zh_checker = ChineseChecker()
term_manager = TerminologyManager(domain="biology")
results = []
results.extend(en_checker.check(text))
results.extend(zh_checker.check(text))
results.extend(term_manager.check(text))
generator = AnnotationGenerator(output_format="html")
report = generator.generate(results)
with open("report.html", "w", encoding="utf-8") as f:
f.write(report)
Implementation Details
Architecture / Core Modules
english_checker.py
- Core engine for English spelling/grammar/style checks.
- Designed to be rule-extensible (add or register new rule sets).
chinese_checker.py
- Core engine for Chinese typo/grammar/style checks.
- Includes a library of common academic writing error patterns.
terminology_manager.py
- Terminology database management (import/export/query/update).
- Performs term consistency checks, bilingual mapping validation, and abbreviation policy checks.
annotation_generator.py
- Converts detected issues into a visual report (HTML) or annotated Markdown.
- Ensures issues include location, type, and suggested fix.
word_converter.py
- Extracts text from
.docx.
- Optionally converts Word to PDF (can be disabled via
--no-pdf).
Terminology database format (JSON)
Organized by domain; each entry can include bilingual forms and abbreviation metadata:
{
"biology": {
"cell": {
"en": "cell",
"abbrev": null,
"full_form": null
},
"mrna": {
"en": "mRNA",
"abbrev": "mRNA",
"full_form": "messenger RNA"
}
}
}
Checking logic (typical):
- If an abbreviation (e.g.,
mRNA) appears, verify the full form appears at first mention (e.g., messenger RNA (mRNA)).
- If both Chinese and English terms appear, verify they match the configured mapping for the selected domain.
- If synonyms are detected, prefer the standardized term defined in the database.
Rule database format (JSON)
Rules are grouped by language and category:
{
"english": {
"spelling": [],
"grammar": [],
"style": []
},
"format": {
"references": [],
"numbers": [],
"units": []
}
}
How rules are applied (high level):
- Load rule sets by
--lang and --style.
- Run language-specific checks (English/Chinese) and formatting checks.
- Merge results into a unified issue list.
- Render issues into the selected output format (
html / markdown) with location-aware annotations.
Extensibility
Add new rules
- Create a rule file under
assets/rules/.
- Implement rules following the project’s rule template.
- Register the rule set in the rule index.
- Run tests to validate precision/recall and avoid false positives.
Add new terminology sets
- Create a terminology JSON under
assets/terminology/.
- Follow the domain structure shown above.
- Register the new domain in the terminology index so it can be selected via
--terminology.
When Not to Use
- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
Required Inputs
| Field |
Required |
Format/Source |
Example |
If Missing |
| User task description |
Yes |
Text |
Research question, writing goal, analysis objective |
Stop and ask user to provide |
| Primary input material |
Depends on task |
Text, file path, ID, table, or literature |
PMID, PDF, CSV, DOCX, keywords, etc. |
Specify which material type is missing |
| Output preference |
No |
Text |
Language, format, target journal, template |
Use skill default format |
Output Contract
- Primary output: Structured result or target file aligned with this skill's objective.
- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
Failure Handling
- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
User Checkpoints
- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
Input Validation
This skill accepts requests that match the documented purpose of content-proofreading and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
content-proofreading only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Quick Validation
- Check that key scripts, templates, or reference file paths this skill depends on exist.
- Check that the final output contains the core fields, sections, or files specified for this task.
- Check that results clearly mark assumptions, limitations, and incomplete items.
1---2name: content-proofreading3description: An academic proofreading skill for Chinese/English manuscripts, triggered when you need automated checks for spelling, grammar, terminology consistency, and formatting before submission.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8
9## When to Use
10
11- You are preparing an academic paper for journal/conference submission and need a final language + formatting pass.
12- You have bilingual (Chinese/English) content and want consistent punctuation, wording, and style across both languages.
13- Your manuscript contains domain terminology (e.g., life sciences) and you need consistent Chinese–English term mapping and abbreviation rules.
14- You need to validate references, numbers/units, and heading levels against a required style (APA/MLA/GB/T 7714).
15- You want a shareable report (HTML or Markdown annotations) with precise error locations and revision suggestions.
16
17## Agent Workflow
18
19Follow these steps in order when the user provides text for proofreading:
20
21### Step 1: Identify Input Source
22- Determine if the user pasted text directly, provided a file path, or attached a `.docx`/`.md` file.
23- If a file path is given, read the file content. If a `.docx` file, use `word_converter.py` to extract text first.
24- If the user provided only text inline, use that text directly.
25
26### Step 2: Determine Language Scope
27- Check if the content is English, Chinese, or bilingual (both).
28- Set language parameter accordingly: `en`, `zh`, or `both`.
29- If the user did not specify, auto-detect from content.
30
31### Step 3: Run English Checks (if applicable)
32- If English content is detected, call `EnglishChecker().check(text)` to check:
33 - Spelling (US/UK variants)
34 - Grammar (agreement, tense, articles)
35 - Punctuation (US/UK conventions)
36 - Style (redundancy, passive voice)
37- Collect all findings with location, type, and suggested fix.
38
39### Step 4: Run Chinese Checks (if applicable)
40- If Chinese content is detected, call `ChineseChecker().check(text)` to check:
41 - Typo/misused characters
42 - Grammar and collocation
43 - Chinese vs English punctuation normalization
44 - Academic expression optimization
45- Collect all findings.
46
47### Step 5: Run Terminology Check
48- Call `TerminologyManager(domain="biology").check(text)` to verify:
49 - Bidirectional Chinese–English term correspondence
50 - Abbreviation rule compliance (full form on first occurrence)
51 - Synonym unification to preferred standard terms
52- Collect all findings.
53
54### Step 6: Generate Report
55- Feed all findings to `AnnotationGenerator(output_format="html" or "markdown")`.
56- Generate the report showing:
57 - Each issue with precise location (line/offset)
58 - Issue type (spelling, grammar, terminology, formatting)
59 - Suggested fix
60- Present the report to the user. If the user requested an HTML file, save and return the file path.
61
62### Step 7: Validate Output
63- Verify all detected issues have location + type + fix.
64- Confirm the output format matches the user's request (HTML/Markdown).
65- If partial, label clearly as PARTIAL.
66
67## Key Features
68
69- **English checks**
70 - Spelling (including US/UK variants)
71 - Grammar (agreement, tense, articles, clause structure)
72 - Punctuation conventions (US/UK)
73 - Style suggestions (redundancy detection, passive voice optimization)
74
75- **Chinese checks**
76 - Typo/misused character detection (dictionary-based)
77 - Grammar and collocation checks
78 - Chinese vs. English punctuation normalization
79 - Academic expression optimization suggestions
80
81- **Terminology consistency**
82 - Domain terminology database (life sciences by default)
83 - Bidirectional Chinese–English correspondence checks
84 - Abbreviation rules (require full form on first occurrence)
85 - Synonym unification to preferred standard terms
86
87- **Formatting checks**
88 - Reference style validation (APA/MLA/GB/T 7714, etc.)
89 - Number and unit normalization
90 - Heading level consistency
91 - Abbreviation consistency across the document
92
93- **Reporting**
94 - HTML interactive report or Markdown annotations
95 - Precise error localization
96 - Actionable revision suggestions
97
98## Dependencies
99
100- **Python**: `>= 3.8`
101
102- **Python packages** (install via `pip install -r requirements.txt`)
103 - `languagetool-python` (version: see `requirements.txt`) — English grammar checking
104 - `opencc` (version: see `requirements.txt`) — Traditional/Simplified Chinese conversion
105 - `jieba` (version: see `requirements.txt`) — Chinese tokenization
106 - `pyenchant` (version: see `requirements.txt`) — spelling checks
107 - `markdown` (version: see `requirements.txt`) — Markdown rendering
108 - `python-docx` (version: see `requirements.txt`) — `.docx` reading
109 - `docx2pdf` (version: see `requirements.txt`) — Word-to-PDF conversion
110
111## Example Usage
112
113### 1) Install
114
115```bash
116python -m venv .venv
117source .venv/bin/activate # Windows: .venv\Scripts\activate
118
119pip install -r requirements.txt
120```
121
122### 2) Run (basic)
123
124```bash
125python scripts/init_run.py --input <paper_file_path> --output <output_path>
126```
127
128### 3) Run (advanced)
129
130```bash
131python scripts/init_run.py \
132 --input paper.md \
133 --output report.html \
134 --lang en \
135 --style apa \
136 --terminology biology \
137 --format html
138```
139
140### 4) CLI parameters
141
142| Parameter | Description | Default |
143|---|---|---|
144| `--input` | Input file path | Required |
145| `--output` | Output report path | Generates an HTML report by default |
146| `--lang` | Language to check (`en` / `zh` / `both`) | `both` |
147| `--style` | Reference style (`apa` / `mla` / `gb`) | `apa` |
148| `--terminology` | Domain terminology set | `biology` |
149| `--format` | Output format (`html` / `markdown`) | `html` |
150| `--no-pdf` | Skip PDF generation during Word→PDF conversion | `false` |
151
152### 5) Use as a Python module (end-to-end)
153
154```python
155from scripts.english_checker import EnglishChecker
156from scripts.chinese_checker import ChineseChecker
157from scripts.terminology_manager import TerminologyManager
158from scripts.annotation_generator import AnnotationGenerator
159
160text = """
161Messenger RNA (mRNA) is transcribed in the nucleus.
162"""
163
164en_checker = EnglishChecker()
165zh_checker = ChineseChecker()
166term_manager = TerminologyManager(domain="biology")
167
168results = []
169results.extend(en_checker.check(text))
170results.extend(zh_checker.check(text))
171results.extend(term_manager.check(text))
172
173generator = AnnotationGenerator(output_format="html")
174report = generator.generate(results)
175
176with open("report.html", "w", encoding="utf-8") as f:
177 f.write(report)
178```
179
180## Implementation Details
181
182### Architecture / Core Modules
183
184- `english_checker.py`
185 - Core engine for English spelling/grammar/style checks.
186 - Designed to be rule-extensible (add or register new rule sets).
187
188- `chinese_checker.py`
189 - Core engine for Chinese typo/grammar/style checks.
190 - Includes a library of common academic writing error patterns.
191
192- `terminology_manager.py`
193 - Terminology database management (import/export/query/update).
194 - Performs term consistency checks, bilingual mapping validation, and abbreviation policy checks.
195
196- `annotation_generator.py`
197 - Converts detected issues into a visual report (HTML) or annotated Markdown.
198 - Ensures issues include **location**, **type**, and **suggested fix**.
199
200- `word_converter.py`
201 - Extracts text from `.docx`.
202 - Optionally converts Word to PDF (can be disabled via `--no-pdf`).
203
204### Terminology database format (JSON)
205
206Organized by domain; each entry can include bilingual forms and abbreviation metadata:
207
208```json
209{
210 "biology": {
211 "cell": {
212 "en": "cell",
213 "abbrev": null,
214 "full_form": null
215 },
216 "mrna": {
217 "en": "mRNA",
218 "abbrev": "mRNA",
219 "full_form": "messenger RNA"
220 }
221 }
222}
223```
224
225**Checking logic (typical):**
226- If an abbreviation (e.g., `mRNA`) appears, verify the **full form** appears at first mention (e.g., `messenger RNA (mRNA)`).
227- If both Chinese and English terms appear, verify they match the configured mapping for the selected domain.
228- If synonyms are detected, prefer the standardized term defined in the database.
229
230### Rule database format (JSON)
231
232Rules are grouped by language and category:
233
234```json
235{
236 "english": {
237 "spelling": [],
238 "grammar": [],
239 "style": []
240 },
241 "format": {
242 "references": [],
243 "numbers": [],
244 "units": []
245 }
246}
247```
248
249**How rules are applied (high level):**
250- Load rule sets by `--lang` and `--style`.
251- Run language-specific checks (English/Chinese) and formatting checks.
252- Merge results into a unified issue list.
253- Render issues into the selected output format (`html` / `markdown`) with location-aware annotations.
254
255### Extensibility
256
257- **Add new rules**
258 1. Create a rule file under `assets/rules/`.
259 2. Implement rules following the project’s rule template.
260 3. Register the rule set in the rule index.
261 4. Run tests to validate precision/recall and avoid false positives.
262
263- **Add new terminology sets**
264 1. Create a terminology JSON under `assets/terminology/`.
265 2. Follow the domain structure shown above.
266 3. Register the new domain in the terminology index so it can be selected via `--terminology`.
267
268## When Not to Use
269
270- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
271- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
272- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
273
274## Required Inputs
275
276| Field | Required | Format/Source | Example | If Missing |
277|---|---|---|---|---|
278| User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide |
279| Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing |
280| Output preference | No | Text | Language, format, target journal, template | Use skill default format |
281
282## Output Contract
283
284- Primary output: Structured result or target file aligned with this skill's objective.
285- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
286- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
287- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
288
289## Failure Handling
290
291- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
292- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
293- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
294
295## User Checkpoints
296
297- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
298- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
299
300
301## Input Validation
302
303This skill accepts requests that match the documented purpose of `content-proofreading` and include enough context to complete the workflow safely.
304
305Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
306
307> `content-proofreading` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
308
309## Quick Validation
310
311- Check that key scripts, templates, or reference file paths this skill depends on exist.
312- Check that the final output contains the core fields, sections, or files specified for this task.
313- Check that results clearly mark assumptions, limitations, and incomplete items.