From c85c423b8a461348fae0997ce9261284389d31b8 Mon Sep 17 00:00:00 2001 From: Ken Okamoto Date: Wed, 12 Aug 2026 23:23:59 +0900 Subject: [PATCH] feat: Week 1 landing, star-magnet README, case study, and launch kit Add GitHub Pages intro site, MIT license, SECURITY note, public case study, and LAUNCH copy so the skill can ship like the consulting visualization sibling. --- LAUNCH.md | 110 +++++ LICENSE | 21 + README.ja.md | 432 ++++--------------- README.md | 438 +++++--------------- SECURITY.md | 56 +++ docs/.nojekyll | 0 docs/index.html | 326 +++++++++++++++ docs/ja/index.html | 195 +++++++++ docs/site/css/style.css | 282 +++++++++++++ docs/site/css/tokens.css | 38 ++ docs/site/js/main.js | 117 ++++++ examples/case-studies/discovery-to-draft.md | 103 +++++ 12 files changed, 1426 insertions(+), 692 deletions(-) create mode 100644 LAUNCH.md create mode 100644 LICENSE create mode 100644 SECURITY.md create mode 100644 docs/.nojekyll create mode 100644 docs/index.html create mode 100644 docs/ja/index.html create mode 100644 docs/site/css/style.css create mode 100644 docs/site/css/tokens.css create mode 100644 docs/site/js/main.js create mode 100644 examples/case-studies/discovery-to-draft.md diff --git a/LAUNCH.md b/LAUNCH.md new file mode 100644 index 0000000..bb10016 --- /dev/null +++ b/LAUNCH.md @@ -0,0 +1,110 @@ +# Launch Kit — paper-writer-skill + +Use this file to announce the GitHub Pages landing and Week 1 packaging without rewriting copy from scratch. + +## Launch Goal + +Put the skill in front of clinicians, clinician-scientists, and agent users who write medical/scientific manuscripts — and who care that IDEA/DATA stay human. + +Primary outcomes: GitHub stars, installs via `npx skills add`, forks, saves, thoughtful replies, inbound case-study requests. + +**Do not invent metrics** (user counts, acceptance rates, journal names of "wins"). + +## Links to include everywhere + +- Live landing: https://kgraph57.github.io/paper-writer-skill/ +- Case study (2-minute read): https://github.com/kgraph57/paper-writer-skill/blob/main/examples/case-studies/discovery-to-draft.md +- Repo: https://github.com/kgraph57/paper-writer-skill +- Install: `npx skills add kgraph57/paper-writer-skill` + +## Release Copy (Week 1 / v3.2 packaging) + +Lead with: research engine ≠ manuscript factory → Discovery gates → humanizer → adversarial review → install + star. + +### X / Twitter (JP) — primary + +```text +原稿工場じゃなく、研究エンジン。 + +paper-writer-skill(Claude Code / エージェント用): +- Phase −1 Discoveryで質問を鍛え、💡IDEA と 📊DATA は人間がロック +- ステージゲート付きIMRAD(FAILなら自動修正ループ) +- 日英ヒューマナイズ(学術AIパターン除去) +- 敵対的レビューが弱い主張をKILLできる + +紹介サイト: https://kgraph57.github.io/paper-writer-skill/ +ケース(2分): https://github.com/kgraph57/paper-writer-skill/blob/main/examples/case-studies/discovery-to-draft.md +Install: npx skills add kgraph57/paper-writer-skill +★ Starもらえると助かります +``` + +### X / Twitter (EN) + +```text +Not a manuscript factory. A research engine. + +paper-writer-skill for Claude Code / agents: +- Phase −1 Discovery forges questions; humans lock 💡 IDEA and 📊 DATA +- Stage-gated IMRAD with auto-fix loops on FAIL +- EN+JP academic humanizer (AI-tell patterns) +- Adversarial review that can KILL a weak claim before submission + +Landing: https://kgraph57.github.io/paper-writer-skill/ +Case study (2 min): https://github.com/kgraph57/paper-writer-skill/blob/main/examples/case-studies/discovery-to-draft.md +Install: npx skills add kgraph57/paper-writer-skill +★ Star if this is the manuscript workflow you wanted +``` + +### Show HN (Hacker News) + +```text +Title: Show HN: Agent skill for medical manuscripts – discovery gates, humanizer, adversarial review + +I packaged my Claude Code / agent skill for medical and scientific +writing with a public landing page and a 2-minute case study. + +It is intentionally not a "paste notes → camera-ready PDF" factory. +Phase −1 Discovery forges and ranks research questions, checks novelty +against live literature, and stops until a human locks the 💡 IDEA and +confirms 📊 DATA (real, never model-invented). Drafting then runs through +stage-gates with auto-fix loops, an EN+JP academic humanizer, citation +checks, and an adversarial review that can KILL a weak central claim +before any journal sees it. + +Six paper types (original, case report, review, SR, letter, protocol), +20+ reporting guidelines, team mode with parallel agents, and tested +Python utilities (table1, SR helpers). Network is used for literature +APIs — not telemetry. Raw clinical data stays local / gitignored. + +Landing: https://kgraph57.github.io/paper-writer-skill/ +Case study: https://github.com/kgraph57/paper-writer-skill/blob/main/examples/case-studies/discovery-to-draft.md +Install: npx skills add kgraph57/paper-writer-skill +Repo: https://github.com/kgraph57/paper-writer-skill +``` + +### LinkedIn (short, optional) + +```text +Shipping a public intro site for paper-writer-skill — an agent skill for medical/scientific manuscripts. + +Thesis: research engine ≠ manuscript factory. Humans stay sovereign on IDEA and DATA; the agent runs discovery, stage-gated IMRAD, EN+JP humanizing, and adversarial review. + +Landing: https://kgraph57.github.io/paper-writer-skill/ +Install: npx skills add kgraph57/paper-writer-skill +``` + +### Reddit (optional — tone check before posting) + +Good fits when the community allows tool shares: r/ClaudeAI, r/LocalLLaMA (agent workflows), academic writing communities that accept OSS tool posts. Lead with the case study + sovereignty gates; avoid hype and medical advice. Do not spam. + +```text +I open-sourced an agent skill (SKILL.md) for medical manuscript workflows: discovery gates before drafting, stage-gates, EN+JP humanizer, adversarial review. Humans lock IDEA/DATA. Landing + 2-min case study in the links. Not affiliated with any journal. Feedback welcome on the discovery → kill-path design. +``` + +## Checklist before posting + +- [ ] GitHub Pages live at `/docs` on `main` (see `POST_MERGE.md`) +- [ ] Repo `homepage` set to the Pages URL +- [ ] Case study link returns 200 +- [ ] LICENSE is MIT (not "Private repository" in README) +- [ ] Topics include `claude-skills`, `claude-code-skill`, `agent-skills` diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..efd9648 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 KEN + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.ja.md b/README.ja.md index 28df097..562eef1 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,378 +1,101 @@ -# Paper Writer Skill(日本語ドキュメント) +
-[![Tests](https://github.com/kgraph57/paper-writer-skill/actions/workflows/tests.yml/badge.svg)](https://github.com/kgraph57/paper-writer-skill/actions/workflows/tests.yml) - -Claude Code用の医学論文執筆スキル。文献検索から投稿・リジェクト対応まで、論文執筆の全工程をカバーする。 +# Paper Writer Skill -> **English version → [README.md](README.md)** +**原稿工場ではない。研究エンジン。** -## 概要 +医学・科学論文のための Claude Code / エージェントスキル。Discoveryゲート、ステージゲート付きIMRAD、日英ヒューマナイズ、敵対的レビュー、投稿・査読対応まで。人間が主権を持つのは **💡 IDEA** と **📊 DATA**。 -**10フェーズ**の完全なパイプラインで、IMRAD形式の論文プロジェクトディレクトリを自動生成・管理する。 - -```mermaid -graph LR - P1[1. 文献検索] --> P2[2. アウトライン] - P2 --> P25[2.5 表・図] - P25 --> P3[3. 執筆] - P3 --> P4[4. ヒューマナイズ] - P4 --> P5[5. 参考文献] - P5 --> P6[6. 品質チェック] - P6 --> P7[7. 投稿準備] - P7 --> P8["8. 査読対応 ①"] - P8 --> P9["9. 受理後"] - P7 -.-> P10["10. リジェクト → 再投稿"] - P10 -.-> P1 -``` +[![Tests](https://github.com/kgraph57/paper-writer-skill/actions/workflows/tests.yml/badge.svg)](https://github.com/kgraph57/paper-writer-skill/actions/workflows/tests.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) +[![Skill Format](https://img.shields.io/badge/SKILL.md-ready-blue.svg)](SKILL.md) +[![Release](https://img.shields.io/badge/Release-v3.2.0-15296B.svg)](CHANGELOG.md) -## アーキテクチャ: 自律ステージゲートシステム (v3.1) +[English](README.md) | 日本語 -全フェーズに品質ゲートを配置。ゲートが**FAIL**を返すと、構造化フィードバックを自動生成し、修正エージェントを`revision_mode`で起動、再チェック。最大3イテレーションでユーザーにエスカレーション。**PASSするまで次のフェーズに進めない**。 +**紹介サイト:** https://kgraph57.github.io/paper-writer-skill/ja/ -```mermaid -flowchart TD - subgraph "フェーズごとのループ(最大3回)" - A["Phase N 完了"] --> B{"品質ゲート"} - B -->|PASS| C["→ Phase N+1"] - B -->|"FAIL (iter < 3)"| D["feedback.md 生成"] - D --> E["修正エージェント\n(revision_mode)"] - E --> B - B -->|"FAIL (iter ≥ 3)"| F["⚠ ユーザーに\nエスカレーション"] - end - - style B fill:#f9a825,stroke:#f57f17,color:#000 - style C fill:#66bb6a,stroke:#388e3c,color:#fff - style F fill:#ef5350,stroke:#c62828,color:#fff -``` +
-### 8つの品質ゲート +## なぜスターされるか -```mermaid -flowchart LR - subgraph "Phase 1" - G1["📚 文献品質\n≥10論文\n全DOI有効"] - end - subgraph "Phase 2" - G2["📋 アウトライン\n全IMRAD存在\n≥2引用マッピング"] - end - subgraph "Phase 2.5" - G25["📊 表・図\n全設計完備\nジャーナル制限内"] - end - subgraph "Phase 3" - G3["✍️ セクション\nスコア≥80%\nMust Fix=0"] - end - subgraph "Phase 4" - G4["🔍 ヒューマナイズ\n高優先AIパターン\n残存=0"] - end - subgraph "Phase 5" - G5["📖 参考文献\n捏造=0\n孤立引用=0"] - end - subgraph "Phase 6" - G6["🔗 横断整合\nPASS or\nCONDITIONAL_PASS"] - end - subgraph "Phase 7" - G7["📦 投稿準備\n全書類揃い\n語数OK"] - end - - G1 --> G2 --> G25 --> G3 --> G4 --> G5 --> G6 --> G7 -``` +- **書く前のDiscovery。** Phase −1で質問を鍛え、ライブ文献で新規性を見て、人間が💡 IDEAをロックし📊 DATAを確認するまで本文に進まない。 +- **自動修正付きステージゲート。** 8ゲート。FAIL → フィードバック → 修正エージェント → 再チェック(最大3回)。 +- **敵対的レビューがKILLできる。** 投稿前に中心主張をレッドチーム。致命傷ならDiscoveryへ戻す。 +- **日英ヒューマナイズ。** 英語18・日本語13の学術AIパターン(`references/humanizer-academic.md`)。 +- **6タイプ / 20+ガイドライン。** 原著・症例・総説・SR・レター・プロトコル。 +- **チームモード + テスト済みスクリプト。** 並列エージェントと `table1.py` 等をCIで検証。 -### チームモード: 7並列エージェント (v3.0) +## 60秒スタート -各フェーズで専門エージェントが並列実行: - -```mermaid -flowchart TB - subgraph P1["Phase 1 — 文献検索(3並列)"] - L1[PubMed検索] - L2[Google Scholar検索] - L3[専門DB検索] - end - - subgraph P3["Phase 3 — 執筆(グループ並列)"] - direction LR - D1[Methods] --> D3[Intro] - D2[Results] --> D4[Conclusion] - end - - subgraph P4["Phase 4 — ヒューマナイズ(最大6並列)"] - H1[Humanizer × Nセクション] - end - - subgraph P6["Phase 6 — 品質レビュー"] - R1[セクションレビュー ×N] - R2[品質ゲート — opus] - end - - L1 & L2 & L3 --> MERGE["マトリクス統合"] - MERGE --> D1 & D2 - D3 & D4 --> H1 - H1 --> R1 - R1 --> R2 +```bash +npx skills add kgraph57/paper-writer-skill ``` -| エージェント | 役割 | モデル | -|-------------|------|--------| -| `paper-lit-searcher` | DB別文献検索 | sonnet | -| `paper-table-figure-planner` | 表・図設計 | sonnet | -| `paper-section-drafter` | セクション執筆(パラメータ化) | sonnet | -| `paper-humanizer` | AI文体パターン除去 | haiku | -| `paper-ref-builder` | 引用収集・検証 | sonnet | -| `paper-section-reviewer` | セクション品質チェック | sonnet | -| `paper-quality-gate` | 横断整合検証・最終判定 | opus | - -## 対応論文タイプ(6種) - -| タイプ | 構成 | 報告ガイドライン | -|--------|------|------------------| -| **Original Article** | Full IMRAD | STROBE / CONSORT | -| **Case Report** | Intro / Case / Discussion | CARE | -| **Review Article** | テーマ別セクション | — | -| **Systematic Review** | PRISMA準拠 | PRISMA 2020 | -| **Letter / Short Communication** | 短縮IMRAD | 同上 | -| **Study Protocol** | SPIRIT準拠 | SPIRIT 2025 | - -## 使い方 - -### Claude Codeから呼び出す +または: +```bash +git clone https://github.com/kgraph57/paper-writer-skill.git ~/.claude/skills/paper-writer ``` -/paper-writer -``` - -または自然言語で: -- `論文を書く` / `論文執筆` / `原稿作成` -- `write paper` / `start manuscript` - -### 初回セットアップ - -呼び出すと以下を聞かれる: - -1. **仮タイトル** -2. **論文タイプ**(上記6種から選択) -3. **対象ジャーナル**(任意、推奨) -4. **言語**(English / Japanese / Both) -5. **リサーチクエスチョン**(1文) -6. **利用可能なデータ**(表・図の有無) -ジャーナルを指定すると、word limit・citation style・abstract形式などを自動調査してREADME.mdに記録する。 +呼び出し例: `論文を書く` / `論文執筆` / `原稿作成` / `write paper` / `/paper-writer` -## 生成されるプロジェクト構造 (v3.2) +## パイプライン -各論文プロジェクトは、研究の立ち上げから完成までを包括的に管理するディレクトリを生成します: - -``` -{project-dir}/ -├── README.md # プロジェクトダッシュボード(状態・タイムライン・リンク) -├── 00_literature/ # 文献検索・マトリクス -├── 01_outline.md # 論文骨格 -├── sections/ # 原稿セクション(執筆順) -│ ├── 02_methods.md ... 08_title.md -├── tables/ # 表(番号付き) -├── figures/ # 図・キャプション -├── supplements/ # 補足資料 -│ ├── supplementary-tables/ -│ ├── supplementary-figures/ -│ └── appendices/ -├── data/ # 研究データ(raw → processed → analysis) -│ ├── raw/ # 元データ(読み取り専用、gitignore) -│ ├── processed/ # クリーニング・匿名化済み -│ ├── analysis/ # 統計出力 -│ └── data-dictionary.md -├── ethics/ # 倫理審査・同意書・プロトコル・登録 -├── submissions/ # 投稿履歴(v1_bmj/, v2_lancet/, ...) -│ └── v1_{journal}/ # コンパイル原稿・カバーレター・宣言書 -├── revisions/ # 修正ラウンド(r1/, r2/, ...) -│ └── r1/ # 査読コメント・回答書・差分 -├── coauthor-review/ # 共著者フィードバック管理 -├── correspondence/ # 編集者・査読者との通信記録 -├── references/ # フォーマット済み参考文献リスト -├── checklists/ # 品質ゲート・報告ガイドライン追跡 -└── log/ # 意思決定・会議メモ・タイムライン -``` - -## ファイル構成 - -``` -paper-writer/ -├── SKILL.md # メインワークフロー定義 -├── CHANGELOG.md # 変更履歴 -├── README.md # 英語ドキュメント -├── README.ja.md # このファイル(日本語) -├── requirements.txt # ユーティリティスクリプト用Python依存関係 -│ -├── templates/ # 37ファイル — セクション別テンプレート -│ ├── project-init.md # プロジェクト初期化(Original Article) -│ ├── project-init-case.md # プロジェクト初期化(Case Report) -│ ├── research-question.md # 研究疑問の生成・FINER評価 -│ ├── study-design.md # 研究デザイン・変数・パワー・実現性 -│ ├── preregistration.md # 事前登録ロックテンプレート -│ ├── human-loop-ledger.md # 人間/AIの関与記録台帳 -│ ├── literature-matrix.md # 文献比較マトリクス -│ ├── methods.md # Methods執筆ガイド -│ ├── results.md # Results執筆ガイド -│ ├── introduction.md # Introduction執筆ガイド -│ ├── discussion.md # Discussion執筆ガイド -│ ├── conclusion.md # Conclusion執筆ガイド -│ ├── abstract.md # Abstract執筆ガイド(Original Article) -│ ├── cover-letter.md # カバーレターテンプレート -│ ├── submission-ready.md # 投稿前チェックリスト -│ ├── case-report.md # Case Presentation(CARE準拠) -│ ├── case-introduction.md # Case Report Introduction -│ ├── case-abstract.md # Case Report Abstract(CARE形式) -│ ├── review-article.md # Review Article構成ガイド -│ ├── sr-outline.md # Systematic Reviewアウトライン -│ ├── sr-data-extraction.md # SRデータ抽出テンプレート -│ ├── sr-prisma-flow.md # PRISMAフローダイアグラム -│ ├── sr-grade.md # GRADEエビデンス評価 -│ ├── sr-rob.md # Risk of Bias評価 -│ ├── sr-prospero.md # PROSPERO登録テンプレート -│ ├── sr-screening-pipeline.md # 二重スクリーニング実行パイプライン -│ ├── response-to-reviewers.md # 査読者への回答テンプレート -│ ├── revision-cover-letter.md # 改訂時カバーレター -│ ├── declarations.md # 宣言テンプレート(倫理・COI・資金・AI開示) -│ ├── graphical-abstract.md # グラフィカルアブストラクトガイド -│ ├── title-page.md # タイトルページテンプレート -│ ├── highlights.md # Key Points / Highlights(JAMA, BMJ等) -│ ├── limitations-guide.md # Limitations記載ガイド -│ ├── acknowledgments.md # 謝辞テンプレート -│ ├── proof-correction.md # 受理後の校正ガイド -│ ├── data-management.md # データ管理(raw/processed/analysis) -│ └── analysis-workflow.md # データ解析ワークフローガイド -│ -├── references/ # 30ファイル — リファレンス資料 -│ ├── ai-for-science-model.md # research engineとしての運用モデル -│ ├── novelty-check.md # ライブ文献による新規性確認 -│ ├── adversarial-review.md # 研究デザイン/原稿のレッドチームレビュー -│ ├── imrad-guide.md # IMRAD構造と執筆原則 -│ ├── section-checklist.md # セクション別品質チェックリスト -│ ├── citation-guide.md # 引用形式と管理 -│ ├── citation-verification.md # 引用検証ガイド -│ ├── reporting-guidelines.md # 報告ガイドラインサマリー -│ ├── reporting-guidelines-full.md # 20+報告ガイドライン詳細 -│ ├── humanizer-academic.md # AI文体検出(EN 18 + JP 13パターン) -│ ├── statistical-reporting.md # 統計報告ガイド -│ ├── statistical-reporting-full.md # 拡張SAMPLガイド -│ ├── journal-selection.md # ジャーナル選択戦略 -│ ├── pubmed-query-builder.md # PubMed検索クエリ構築 -│ ├── multilingual-guide.md # 多言語対応ガイド -│ ├── coauthor-review.md # 共著者レビュープロセス -│ ├── ai-disclosure.md # ICMJE 2023 AI開示ガイド -│ ├── tables-figures-guide.md # 表・図作成ガイド -│ ├── keywords-guide.md # キーワード・MeSH選択戦略 -│ ├── supplementary-materials.md # 補足資料戦略 -│ ├── hook-compatibility.md # Claude Codeフック互換性 -│ ├── submission-portals.md # 投稿ポータルガイド -│ ├── open-access-guide.md # OAモデル・APC・ライセンス -│ ├── clinical-trial-registration.md # 臨床試験登録ガイド -│ ├── abstract-formats.md # ジャーナル別抄録形式 -│ ├── word-count-limits.md # ジャーナル別語数制限 -│ ├── coi-detailed.md # COI詳細・CRediT・ORCID -│ ├── desk-rejection-prevention.md # デスクリジェクト防止 -│ ├── journal-reformatting.md # ジャーナル再フォーマット -│ └── master-reference-list.md # マスターURL一覧(100+リンク) -│ -├── scripts/ # 8ファイル — ユーティリティ・解析 -│ ├── compile-manuscript.sh # セクション統合スクリプト -│ ├── word-count.sh # 語数カウント -│ ├── forest-plot.py # フォレストプロット生成 -│ ├── sr-dedup.py # SR文献レコードの読み込み・重複除去 -│ ├── sr-pdf-link.py # DOIでフルテキストPDFとレコードを対応付け -│ ├── sr-prisma-count.py # PRISMAフロー数値と整合性チェック -│ ├── table1.py # Table 1生成(ベースライン特性) -│ └── analysis-template.py # 統計解析テンプレート(t検定、ロジスティック、生存分析) -│ -├── tests/ -│ └── test_scripts.py # ユーティリティスクリプトの回帰テスト -│ -└── .github/workflows/ - └── tests.yml # CI: 構文チェック + 回帰テスト +```mermaid +graph LR + P0["−1. Discovery"] --> P1[1. 文献検索] + P1 --> P2[2. アウトライン] + P2 --> P25[2.5 表・図] + P25 --> P3[3. 執筆] + P3 --> P4[4. ヒューマナイズ] + P4 --> P5[5. 参考文献] + P5 --> P6[6. 品質] + P6 --> P65["6.5 敵対的レビュー"] + P65 --> P7[7. 投稿準備] + P65 -.->|KILL| P0 + P7 --> P8[8. 査読対応] + P8 --> P9[9. 受理後] + P7 -.-> P10[10. リジェクト再投稿] ``` -**合計: 83 tracked files**(テンプレート37 + リファレンス30 + スクリプト8 + tests + CI + ルート文書/設定) - -## ワークフロー(10フェーズ) - -| Phase | 内容 | 主な操作 | -|-------|------|----------| -| **0** | プロジェクト初期化 | ジャーナル要件調査、報告ガイドライン選択、ディレクトリ生成、データ管理・解析 | -| **1** | 文献検索・整理 | PubMed/Google Scholar検索、文献マトリクス作成 | -| **2** | アウトライン | 論文骨格の設計(ユーザー承認必須) | -| **2.5** | 表・図 | 執筆前に表・図を設計 | -| **3** | 執筆 | Methods→Results→Intro P3+Conclusion→Discussion→Intro P1-2→Abstract→Title | -| **4** | ヒューマナイズ | AI文体パターン除去(EN 18 + JP 13パターン) | -| **5** | 参考文献 | 引用整理、形式統一、存在確認 | -| **6** | 品質チェック | セクション横断検証、報告ガイドラインチェック | -| **7** | 投稿準備 | カバーレター、タイトルページ、宣言、最終チェック | -| **8** | 査読対応 | コメント整理、回答レター、改訂実施 | -| **9** | 受理後 | 校正(24-72時間)、校正提出、出版後タスク | -| **10** | リジェクト対応 | 評価、再フォーマット、カスケード投稿戦略 | +文献検索にはネットワークを使います(設計どおり)。テレメトリはありません。生の臨床データはローカルのまま(`SECURITY.md`)。 -## 報告ガイドライン(20+) +## ケーススタディ(2分) -CONSORT 2025, STROBE, PRISMA 2020, CARE, STARD 2015, SQUIRE 2.0, SPIRIT 2025, TRIPOD+AI 2024, ARRIVE 2.0, CHEERS 2022, MOOSE, TREND, SRQR, COREQ, AGREE II, RECORD, STREGA, ENTREQ, PRISMA-ScR, GRADE +**[Discovery → 草稿 → ヒューマナイズ → 敵対的レビュー](examples/case-studies/discovery-to-draft.md)** -## 言語対応 +## 対応論文タイプ -| 言語 | 対応内容 | -|------|----------| -| **English** | 全テンプレート・ガイド対応、AI文体検出18パターン | -| **日本語** | 全テンプレートEN/JP併記、AI文体検出13パターン、「である」調 | +| タイプ | 構造 | ガイドライン | +|------|-----------|---------------------| +| **原著** | フルIMRAD | STROBE / CONSORT | +| **症例報告** | Intro / Case / Discussion | CARE | +| **総説** | テーマ別 | — | +| **システマティックレビュー** | PRISMA | PRISMA 2020 | +| **レター / Short** | 圧縮IMRAD | 原著に準ずる | +| **研究プロトコル** | SPIRIT | SPIRIT 2025 | -## AI文体除去(Humanizer) +## アーキテクチャ要約 -学術論文からAI生成っぽさを除去する専用フェーズ(Phase 4)。 +- **ステージゲート (v3.1):** PASSするまで次フェーズに進まない。FAILは最大3回の自動修正。 +- **チームモード (v3.0):** 文献・表図・執筆・ヒューマナイズ・査読を並列化。 +- **詳細:** [`SKILL.md`](SKILL.md)、[`templates/`](templates/)、[`references/`](references/) -- **英語**: 18パターン(significance inflation, AI vocabulary, filler phrases等) -- **日本語**: 13パターン(記号・リズム・学術文特有の問題) -- セクション別の重点パターン指定 -- 修正前後の具体例付き +## リポジトリ地図 -## マスターリファレンス - -`references/master-reference-list.md` に100+のURLを13カテゴリで整理: - -1. Author Guidelines(ICMJE, EQUATOR等) -2. Reporting Guidelines(CONSORT, STROBE等) -3. Ethics & Registration(ClinicalTrials.gov, UMIN等) -4. Statistics(SAMPL, Cochrane等) -5. Literature Databases(PubMed, Google Scholar等) -6. Reference Managers(Zotero, Mendeley等) -7. Submission Portals(ScholarOne等) -8. AI Disclosure(ICMJE, Nature等のポリシー) -9. Open Access(DOAJ, Sherpa Romeo等) -10. Writing Support(英文校正サービス等) -11. Figure/Table Tools(BioRender, GraphPad等) -12. Journal Author Instructions(主要ジャーナル) -13. Japanese Resources(医中誌, CiNii等) - -## インストール - -このリポジトリを `~/.claude/skills/paper-writer/` に配置する: - -```bash -git clone https://github.com/kgraph57/paper-writer-skill.git ~/.claude/skills/paper-writer -``` - -Claude Codeの設定に登録: - -```json -// ~/.claude/settings.json の "skills" に追加 -{ - "skills": { - "paper-writer": { - "path": "~/.claude/skills/paper-writer" - } - } -} -``` +| パス | 内容 | +|------|------| +| [`docs/`](docs/) | GitHub Pages 紹介サイト | +| [`examples/case-studies/`](examples/case-studies/) | 公開ケース | +| [`LAUNCH.md`](LAUNCH.md) | 投稿キット(X JP/EN、Show HN) | +| [`SECURITY.md`](SECURITY.md) | PHI / ネットワーク方針 | ## 要件 -- [Claude Code](https://claude.ai/code) CLI -- WebSearch / WebFetch(文献検索に使用) -- ユーティリティスクリプト用のPython 3 -- 解析/PDFユーティリティ用Pythonパッケージ: `python -m pip install -r requirements.txt` +- Claude Code など `SKILL.md` を読むエージェント +- WebSearch / WebFetch(文献) +- ユーティリティ用に Python 3(任意で `requirements.txt`) ## 開発 @@ -384,15 +107,20 @@ python -m unittest discover -s tests -v ## ライセンス -Private repository. +[MIT](LICENSE) — Copyright (c) 2026 KEN. ## バージョン -- **v3.2.0** (2026-03-05) — 研究プロジェクトフォルダ管理: 包括的ディレクトリ再構築 -- **v3.1.0** (2026-03-05) — 自律ステージゲートシステム: 8品質ゲート + 自動修正ループ -- **v3.0.0** (2026-03-05) — チームモード: 7並列エージェントによる同時実行 -- **v2.1.0** (2026-02-17) — データ管理・解析統合、4ファイル追加 -- **v2.0.0** (2026-02-17) — 完全ライフサイクル対応、16ファイル追加、10フェーズ化 -- **v1.0.0** (2026-02-17) — 構造改善、6ファイル追加、5論文タイプ対応 +- **v3.2.0** — 研究プロジェクトフォルダ管理 +- **v3.1.0** — 自律ステージゲート +- **v3.0.0** — チームモード + +詳細は [CHANGELOG.md](CHANGELOG.md)。 + +--- + +
+ +査読に耐える原稿と、データについて嘘をつかない姿勢が大事なら — **[★ Star](https://github.com/kgraph57/paper-writer-skill)** してエージェントに載せてください。 -詳細は [CHANGELOG.md](CHANGELOG.md) を参照。 +
diff --git a/README.md b/README.md index 7a12f46..02d8dcd 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,58 @@ +
+ # Paper Writer Skill +**Not a manuscript factory. A research engine.** + +A Claude Code / agent skill for medical and scientific manuscripts: Discovery gates, stage-gated IMRAD drafting, EN+JP humanizing, adversarial review, and submission/revision loops. Humans stay sovereign on the **💡 IDEA** and the **📊 DATA**. + [![Tests](https://github.com/kgraph57/paper-writer-skill/actions/workflows/tests.yml/badge.svg)](https://github.com/kgraph57/paper-writer-skill/actions/workflows/tests.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) +[![Skill Format](https://img.shields.io/badge/SKILL.md-ready-blue.svg)](SKILL.md) +[![Release](https://img.shields.io/badge/Release-v3.2.0-15296B.svg)](CHANGELOG.md) + +English | [日本語](README.ja.md) + +**Live intro:** https://kgraph57.github.io/paper-writer-skill/ + +
+ +## Why This Gets Starred + +- **Discovery before drafting.** Phase −1 forges and ranks research questions, checks novelty against live literature, and designs/powers the study — then stops until a human locks the 💡 IDEA and confirms 📊 DATA (real, IRB-aware, never model-invented). +- **Stage-gates that auto-fix.** Eight quality gates. FAIL → structured feedback → fixer agent → re-check (up to 3 loops). No silent proceed to the next phase. +- **Adversarial review can KILL.** Before submission, the skill red-teams its own central claim. Fatal problems return to Discovery instead of polishing a bad paper. +- **EN + JP humanizer.** Phase 4 removes academic AI-tell patterns (18 English + 13 Japanese) with before/after examples and section priorities — see `references/humanizer-academic.md`. +- **Six paper types, 20+ guidelines.** Original, Case Report, Review, Systematic Review, Letter/Short, Study Protocol — CARE / CONSORT / STROBE / PRISMA / SPIRIT and more wired into templates. +- **Team mode.** Seven parallel specialist agents for literature, drafting, humanize, and review (v3.0+). +- **Tested utilities.** `table1.py`, SR helpers, compile/word-count scripts — CI runs `unittest` + shell syntax checks. + +## 60-Second Start -A Claude Code skill for medical/scientific paper writing. Covers the entire manuscript lifecycle from literature search to submission, peer review response, and rejection handling. +```bash +# 1. Install as an agent skill (Claude Code, Cursor, Codex, and other skills hosts) +npx skills add kgraph57/paper-writer-skill +``` -> **日本語版はこちら → [README.ja.md](README.ja.md)** +Or clone into Claude Code’s skills directory: -## Overview +```bash +git clone https://github.com/kgraph57/paper-writer-skill.git ~/.claude/skills/paper-writer +``` -Not just a *manuscript factory* (write → format → submit) but a *research engine*: -a discovery loop that generates and ranks research questions, checks their novelty -against the live literature, designs and powers the study, locks a pre-registered -plan, and — after the manuscript is drafted — red-teams its own central claim before -any journal sees it. Two things stay human and protected at every gate: the **💡 IDEA** -(what is worth asking, what it means, what is ethical) and the **📊 DATA** (real, -IRB-approved, never machine-originated). See -[`references/ai-for-science-model.md`](references/ai-for-science-model.md). +Then ask in plain language: + +```text +Use the paper-writer skill to start a CARE case report from these de-identified notes… +``` + +```text +論文を書く。症例報告。CARE。データは匿名化済み。 +``` -A pipeline that generates and manages IMRAD-format project directories with -structured Markdown files, a literature matrix, and quality checklists. +Triggers: `write paper` / `start manuscript` / `research paper` / `論文を書く` / `論文執筆` / `原稿作成` — or `/paper-writer` in Claude Code. + +## The Pipeline ```mermaid graph LR @@ -32,107 +66,17 @@ graph LR P6 --> P65["6.5 Adversarial Review"] P65 --> P7[7. Pre-Submission] P65 -.->|KILL| P0 - P7 --> P8["8. Revision ①"] + P7 --> P8["8. Revision"] P8 --> P9["9. Post-Acceptance"] P7 -.-> P10["10. Rejection → Resubmit"] P10 -.-> P1 ``` -## Architecture: Autonomous Stage-Gate System (v3.1) +Optional Python packages for analysis/PDF utilities: `python -m pip install -r requirements.txt`. Literature work uses WebSearch/WebFetch and public literature APIs — **not** a zero-network skill (by design). -Every phase is guarded by a quality gate. If the gate returns **FAIL**, the system automatically generates structured feedback, dispatches a fixer agent in `revision_mode`, and re-checks — up to 3 iterations before escalating to the user. No phase proceeds until its gate returns **PASS**. +## Case Study (2-minute read) -```mermaid -flowchart TD - subgraph "Per-Phase Loop (max 3 iterations)" - A["Phase N Complete"] --> B{"Quality Gate"} - B -->|PASS| C["→ Phase N+1"] - B -->|FAIL iter < 3| D["Generate feedback.md"] - D --> E["Fixer Agent\n(revision_mode)"] - E --> B - B -->|FAIL iter ≥ 3| F["⚠ Escalate to User"] - end - - style B fill:#f9a825,stroke:#f57f17,color:#000 - style C fill:#66bb6a,stroke:#388e3c,color:#fff - style F fill:#ef5350,stroke:#c62828,color:#fff -``` - -### 8 Quality Gates - -```mermaid -flowchart LR - subgraph "Phase 1" - G1["📚 Literature\n≥10 papers\nAll DOIs valid"] - end - subgraph "Phase 2" - G2["📋 Outline\nAll IMRAD sections\n≥2 citations mapped"] - end - subgraph "Phase 2.5" - G25["📊 Tables/Figures\nAll designs complete\nJournal limits OK"] - end - subgraph "Phase 3" - G3["✍️ Section Draft\nScore ≥80%\nMust Fix = 0"] - end - subgraph "Phase 4" - G4["🔍 Humanize\nHigh-priority\nAI patterns = 0"] - end - subgraph "Phase 5" - G5["📖 References\nFabrication = 0\nOrphan cites = 0"] - end - subgraph "Phase 6" - G6["🔗 Cross-Section\nPASS or\nCONDITIONAL_PASS"] - end - subgraph "Phase 7" - G7["📦 Submission\nAll docs ready\nWord count OK"] - end - - G1 --> G2 --> G25 --> G3 --> G4 --> G5 --> G6 --> G7 -``` - -### Team Mode: 7 Parallel Agents (v3.0) - -Phases are parallelized with specialized agents running concurrently: - -```mermaid -flowchart TB - subgraph P1["Phase 1 — Literature Search (3 parallel)"] - L1[PubMed Searcher] - L2[Google Scholar Searcher] - L3[Domain DB Searcher] - end - - subgraph P3["Phase 3 — Drafting (grouped parallel)"] - direction LR - D1[Methods] --> D3[Intro] - D2[Results] --> D4[Conclusion] - end - - subgraph P4["Phase 4 — Humanize (up to 6 parallel)"] - H1[Humanizer × N sections] - end - - subgraph P6["Phase 6 — Quality Review"] - R1[Section Reviewer ×N] - R2[Quality Gate — opus] - end - - L1 & L2 & L3 --> MERGE["Merge Matrix"] - MERGE --> D1 & D2 - D3 & D4 --> H1 - H1 --> R1 - R1 --> R2 -``` - -| Agent | Role | Model | -|-------|------|-------| -| `paper-lit-searcher` | Database-specific literature search | sonnet | -| `paper-table-figure-planner` | Table and figure design | sonnet | -| `paper-section-drafter` | Section drafting (parameterized) | sonnet | -| `paper-humanizer` | AI writing pattern removal | haiku | -| `paper-ref-builder` | Citation collection and verification | sonnet | -| `paper-section-reviewer` | Per-section quality check | sonnet | -| `paper-quality-gate` | Cross-section consistency + final verdict | opus | +**[Discovery → draft → humanize → adversarial catch](examples/case-studies/discovery-to-draft.md)** — an illustrative CARE spark (PHI-free) showing why gates beat “just write the abstract.” ## Supported Paper Types @@ -145,247 +89,56 @@ flowchart TB | **Letter / Short Communication** | Condensed IMRAD | Same as original | | **Study Protocol** | SPIRIT-compliant | SPIRIT 2025 | -## Usage - -### Invoke from Claude Code - -``` -/paper-writer -``` - -Or use natural language triggers: -- `write paper` / `start manuscript` / `research paper` -- `論文を書く` / `論文執筆` / `原稿作成` - -### Project Setup - -The skill prompts you for: - -1. **Working title** -2. **Paper type** (one of the 6 types above) -3. **Target journal** (optional, recommended) -4. **Language** (English / Japanese / Both) -5. **Research question** (one sentence) -6. **Available data** (existing tables/figures) - -When a target journal is specified, the skill automatically looks up word limits, citation style, abstract format, and other requirements. - -## Generated Project Structure (v3.2) - -Each paper project generates a comprehensive directory for managing the entire research lifecycle: +## Architecture (deep dive) -``` -{project-dir}/ -├── README.md # Project dashboard (status, timeline, links) -├── 00_literature/ # Literature search & matrix -├── 01_outline.md # Paper skeleton -├── sections/ # Manuscript sections (writing order) -│ ├── 02_methods.md ... 08_title.md -├── tables/ # Tables (numbered) -├── figures/ # Figures + captions -├── supplements/ # Supplementary materials -│ ├── supplementary-tables/ -│ ├── supplementary-figures/ -│ └── appendices/ -├── data/ # Research data (raw → processed → analysis) -│ ├── raw/ # Original data (READ-ONLY, gitignored) -│ ├── processed/ # Cleaned, de-identified -│ ├── analysis/ # Statistical output -│ └── data-dictionary.md -├── ethics/ # IRB, consent, protocol, registration -├── submissions/ # Submission history (v1_bmj/, v2_lancet/, ...) -│ └── v1_{journal}/ # Compiled manuscript + cover letter + declarations -├── revisions/ # Revision rounds (r1/, r2/, ...) -│ └── r1/ # Reviewer comments + response + diff -├── coauthor-review/ # Co-author feedback tracking -├── correspondence/ # Editor & reviewer communication log -├── references/ # Formatted reference list -├── checklists/ # Quality gates, reporting guideline tracking -└── log/ # Decisions, meetings, timeline -``` - -## File Structure +### Autonomous Stage-Gate System (v3.1) -``` -paper-writer/ -├── SKILL.md # Main workflow definition -├── CHANGELOG.md # Version history -├── README.md # This file -├── README.ja.md # Japanese documentation -├── requirements.txt # Python dependencies for utility scripts -│ -├── templates/ # 37 files — Section templates -│ ├── project-init.md # Project initialization (Original Article) -│ ├── project-init-case.md # Project initialization (Case Report) -│ ├── research-question.md # Question forge and FINER scoring -│ ├── study-design.md # Study design, variables, power, feasibility -│ ├── preregistration.md # Pre-registration lock template -│ ├── human-loop-ledger.md # Human/AI accountability ledger -│ ├── literature-matrix.md # Literature comparison matrix -│ ├── methods.md # Methods writing guide -│ ├── results.md # Results writing guide -│ ├── introduction.md # Introduction writing guide -│ ├── discussion.md # Discussion writing guide -│ ├── conclusion.md # Conclusion writing guide -│ ├── abstract.md # Abstract writing guide (Original Article) -│ ├── cover-letter.md # Cover letter template -│ ├── submission-ready.md # Pre-submission checklist -│ ├── case-report.md # Case presentation (CARE-compliant) -│ ├── case-introduction.md # Case report introduction -│ ├── case-abstract.md # Case report abstract (CARE format) -│ ├── review-article.md # Review article structure guide -│ ├── sr-outline.md # Systematic review outline -│ ├── sr-data-extraction.md # SR data extraction template -│ ├── sr-prisma-flow.md # PRISMA flow diagram -│ ├── sr-grade.md # GRADE evidence assessment -│ ├── sr-rob.md # Risk of bias assessment -│ ├── sr-prospero.md # PROSPERO registration template -│ ├── sr-screening-pipeline.md # Dual-screening execution pipeline -│ ├── response-to-reviewers.md # Response to reviewers template -│ ├── revision-cover-letter.md # Revision cover letter -│ ├── declarations.md # Declarations (ethics, COI, funding, AI disclosure) -│ ├── graphical-abstract.md # Graphical abstract guide -│ ├── title-page.md # Title page template -│ ├── highlights.md # Key points / highlights (JAMA, BMJ, etc.) -│ ├── limitations-guide.md # Limitations section guide -│ ├── acknowledgments.md # Acknowledgments template -│ ├── proof-correction.md # Post-acceptance proof correction guide -│ ├── data-management.md # Data management (raw/processed/analysis) -│ └── analysis-workflow.md # Data analysis workflow guide -│ -├── references/ # 30 files — Reference materials -│ ├── ai-for-science-model.md # Research-engine operating model -│ ├── novelty-check.md # Live-literature novelty check -│ ├── adversarial-review.md # Design/manuscript red-team review -│ ├── imrad-guide.md # IMRAD structure and writing principles -│ ├── section-checklist.md # Per-section quality checklist -│ ├── citation-guide.md # Citation formatting and management -│ ├── citation-verification.md # Citation verification guide -│ ├── reporting-guidelines.md # Reporting guidelines summary -│ ├── reporting-guidelines-full.md # 20+ reporting guidelines with checklists -│ ├── humanizer-academic.md # AI writing detection (EN 18 + JP 13 patterns) -│ ├── statistical-reporting.md # Statistical reporting guide -│ ├── statistical-reporting-full.md # Extended SAMPL guide -│ ├── journal-selection.md # Journal selection strategy -│ ├── pubmed-query-builder.md # PubMed search query builder -│ ├── multilingual-guide.md # Multilingual support guide -│ ├── coauthor-review.md # Co-author review process -│ ├── ai-disclosure.md # ICMJE 2023 AI disclosure guide -│ ├── tables-figures-guide.md # Tables and figures creation guide -│ ├── keywords-guide.md # Keywords and MeSH selection strategy -│ ├── supplementary-materials.md # Supplementary materials strategy -│ ├── hook-compatibility.md # Claude Code hook compatibility -│ ├── submission-portals.md # Submission portal guide -│ ├── open-access-guide.md # OA models, APCs, CC licenses -│ ├── clinical-trial-registration.md # Clinical trial registration guide -│ ├── abstract-formats.md # Journal-specific abstract formats -│ ├── word-count-limits.md # Word count limits by journal -│ ├── coi-detailed.md # COI categories, CRediT taxonomy, ORCID -│ ├── desk-rejection-prevention.md # Desk rejection prevention -│ ├── journal-reformatting.md # Journal reformatting and cascading strategy -│ └── master-reference-list.md # Master URL list (100+ links, 13 categories) -│ -├── scripts/ # 8 files — Utilities & Analysis -│ ├── compile-manuscript.sh # Compile sections into single manuscript -│ ├── word-count.sh # Word count utility -│ ├── forest-plot.py # Forest plot generator -│ ├── sr-dedup.py # SR record parsing and de-duplication -│ ├── sr-pdf-link.py # Link full-text PDFs to records by DOI -│ ├── sr-prisma-count.py # PRISMA flow counts and consistency checks -│ ├── table1.py # Table 1 generator (baseline characteristics) -│ └── analysis-template.py # Statistical analysis template (t-test, logistic, survival) -│ -├── tests/ -│ └── test_scripts.py # Regression tests for utility scripts -│ -└── .github/workflows/ - └── tests.yml # CI: syntax checks + regression tests -``` +Every phase is guarded by a quality gate. If the gate returns **FAIL**, the system generates structured feedback, dispatches a fixer agent in `revision_mode`, and re-checks — up to 3 iterations before escalating to the user. -**Total: 83 tracked files** (37 templates + 30 references + 8 scripts + tests + CI + root docs/config) - -## Workflow (10 Phases) +### 8 Quality Gates -| Phase | Description | Key Operations | -|-------|-------------|----------------| -| **0** | Project Initialization | Journal requirements lookup, reporting guideline selection, directory generation, data management & analysis | -| **1** | Literature Search | PubMed/Google Scholar search, literature matrix creation | -| **2** | Outline | Paper skeleton design (user approval required) | -| **2.5** | Tables & Figures | Design tables/figures before writing prose | -| **3** | Drafting | Methods → Results → Intro P3 + Conclusion → Discussion → Intro P1-2 → Abstract → Title | -| **4** | Humanize | AI writing pattern removal (EN 18 + JP 13 patterns) | -| **5** | References | Citation formatting, deduplication, existence verification | -| **6** | Quality Review | Cross-section verification, reporting guideline compliance | -| **7** | Pre-Submission | Cover letter, title page, declarations, final checklist | -| **8** | Revision | Reviewer comment organization, response letter, revision implementation | -| **9** | Post-Acceptance | Proof review (24-72 hr), correction submission, post-publication tasks | -| **10** | Rejection & Resubmission | Assessment, quick reformat, cascading submission strategy | +Literature (≥10 papers, valid DOIs) → Outline (IMRAD + citations mapped) → Tables/Figures → Section draft score → Humanize (high-priority AI patterns = 0) → References (no fabrication / orphans) → Cross-section consistency → Submission package. -## Reporting Guidelines (20+) +### Team Mode: 7 Parallel Agents (v3.0) -CONSORT 2025, STROBE, PRISMA 2020, CARE, STARD 2015, SQUIRE 2.0, SPIRIT 2025, TRIPOD+AI 2024, ARRIVE 2.0, CHEERS 2022, MOOSE, TREND, SRQR, COREQ, AGREE II, RECORD, STREGA, ENTREQ, PRISMA-ScR, GRADE +| Agent | Role | +|-------|------| +| `paper-lit-searcher` | Database-specific literature search | +| `paper-table-figure-planner` | Table and figure design | +| `paper-section-drafter` | Section drafting | +| `paper-humanizer` | AI writing pattern removal | +| `paper-ref-builder` | Citation collection and verification | +| `paper-section-reviewer` | Per-section quality check | +| `paper-quality-gate` | Cross-section consistency + final verdict | + +## Repository Map + +| Path | What | +|------|------| +| [`SKILL.md`](SKILL.md) | Main workflow definition | +| [`docs/`](docs/) | GitHub Pages landing | +| [`examples/case-studies/`](examples/case-studies/) | Public case study | +| [`templates/`](templates/) | Section / project / CARE / SR templates | +| [`references/`](references/) | Humanizer, adversarial, guidelines, journals… | +| [`scripts/`](scripts/) | Compile, word-count, table1, SR utilities | +| [`LAUNCH.md`](LAUNCH.md) | Posting kit (X JP/EN, Show HN) | +| [`SECURITY.md`](SECURITY.md) | PHI / network / permissions | + +Full file tree and phase tables remain in [`SKILL.md`](SKILL.md) and the templates/references trees (37 templates · 30 reference docs · 8 scripts). ## Language Support | Language | Coverage | |----------|----------| | **English** | All templates and guides, 18 AI writing detection patterns | -| **Japanese** | All templates bilingual (EN/JP), 13 AI writing detection patterns, である-style | - -## AI Writing Detection (Humanizer) - -A dedicated phase (Phase 4) to remove AI-generated writing patterns from academic manuscripts. - -- **English**: 18 patterns (significance inflation, AI vocabulary, filler phrases, etc.) -- **Japanese**: 13 patterns (symbol overuse, rhythm monotony, academic-specific issues) -- Section-specific priority patterns -- Before/after examples included - -## Master Reference List - -`references/master-reference-list.md` contains 100+ URLs organized in 13 categories: - -1. Author Guidelines (ICMJE, EQUATOR, etc.) -2. Reporting Guidelines (CONSORT, STROBE, etc.) -3. Ethics & Registration (ClinicalTrials.gov, UMIN, etc.) -4. Statistics (SAMPL, Cochrane, etc.) -5. Literature Databases (PubMed, Google Scholar, etc.) -6. Reference Managers (Zotero, Mendeley, etc.) -7. Submission Portals (ScholarOne, etc.) -8. AI Disclosure (ICMJE, Nature policies, etc.) -9. Open Access (DOAJ, Sherpa Romeo, etc.) -10. Writing Support (editing services, etc.) -11. Figure/Table Tools (BioRender, GraphPad, etc.) -12. Journal Author Instructions (major journals) -13. Japanese Resources (Ichushi, CiNii, etc.) - -## Installation - -Clone this repository into the Claude Code skills directory: - -```bash -git clone https://github.com/kgraph57/paper-writer-skill.git ~/.claude/skills/paper-writer -``` - -Register the skill in Claude Code settings: - -```json -// Add to "skills" in ~/.claude/settings.json -{ - "skills": { - "paper-writer": { - "path": "~/.claude/skills/paper-writer" - } - } -} -``` +| **Japanese** | Bilingual templates, 13 AI writing detection patterns, である-style | ## Requirements -- [Claude Code](https://claude.ai/code) CLI -- WebSearch / WebFetch (used for literature search) -- Python 3 for utility scripts -- Python packages for analysis/PDF utilities: `python -m pip install -r requirements.txt` +- [Claude Code](https://claude.ai/code) CLI or another agent that loads `SKILL.md` +- WebSearch / WebFetch (literature) +- Python 3 for optional utility scripts +- `python -m pip install -r requirements.txt` for analysis/PDF helpers ## Development @@ -397,15 +150,20 @@ python -m unittest discover -s tests -v ## License -Private repository. +[MIT](LICENSE) — Copyright (c) 2026 KEN. ## Versions -- **v3.2.0** (2026-03-05) — Research project folder management: comprehensive directory restructuring -- **v3.1.0** (2026-03-05) — Autonomous Stage-Gate System: 8 quality gates with auto-fix loops -- **v3.0.0** (2026-03-05) — Team Mode: 7 parallel agents for concurrent execution -- **v2.1.0** (2026-02-17) — Data management & analysis integration, 4 new files -- **v2.0.0** (2026-02-17) — Full lifecycle coverage, 16 new files, 10 phases -- **v1.0.0** (2026-02-17) — Structural improvements, 6 new files, 5 paper types +- **v3.2.0** — Research project folder management +- **v3.1.0** — Autonomous Stage-Gate System +- **v3.0.0** — Team Mode (7 parallel agents) See [CHANGELOG.md](CHANGELOG.md) for details. + +--- + +
+ +If you want manuscripts that survive review — and refuse to lie about data — **[★ Star the repo](https://github.com/kgraph57/paper-writer-skill)** and install it on your agent. + +
diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..c897d5e --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,56 @@ +# Security Policy + +## Normal Skill Behavior + +This package is a documentation-first Agent Skill for medical/scientific +manuscript writing. Unlike zero-network skills, it **intentionally uses network +access** for literature work: WebSearch/WebFetch and literature APIs (PubMed, +OpenAlex, Europe PMC, Semantic Scholar) during Phase −1 novelty checks, Phase 1 +literature search, and Phase 5 citation verification. No credentials are +required for any of these. + +The utility scripts under `scripts/` are optional. They read local files, write +local Markdown/plot outputs, and make no network calls. Analysis and PDF +utilities use the Python packages listed in `requirements.txt`. + +## Clinical Data Handling — the hard rules + +This skill is built for clinicians working with real patient data. The data +rules below mirror `templates/data-management.md` and the AI-for-Science model +(`references/ai-for-science-model.md`): + +- **Raw clinical data stays local. Always.** Generated project directories keep + original data under `data/raw/`, which is treated as read-only and is + **gitignored** — it must never be committed or pushed anywhere. +- **Never commit PHI.** Only de-identified, processed data belongs in + `data/processed/`. De-identification happens before anything leaves the raw + folder. +- **Never paste identifiable patient information into any AI chat**, including + the agent running this skill. Work from de-identified extracts. +- **AI never originates data.** The skill must never fabricate a data point, + participant, or result (📊 DATA sovereignty). Any output that appears to + contain invented data is a bug — report it. + +## Permissions + +| Capability | Used | Notes | +| --- | --- | --- | +| Network access | Yes | Literature APIs and web search only; no telemetry | +| Filesystem write | Yes | Manuscript project directories and script outputs | +| External tools | Optional | Python packages from `requirements.txt`; pandoc for docx/pdf compile | +| Credentials | No | No API keys required | +| Background execution | No | | + +## Safety Rules + +- Do not add hidden scripts or install-time automation. +- Do not add new network destinations without documenting them here. +- Do not embed real patient data — even "harmless" fragments — in examples, + tests, or case studies. All repo examples are illustrative and PHI-free. +- Do not weaken the 💡 IDEA / 📊 DATA human-sovereignty gates in SKILL.md. + +## Reporting + +Open a GitHub issue for suspected vulnerabilities, unsafe instructions, or +hidden behavior. Do not include patient data or other confidential material in +public reports. diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..d65f7f9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,326 @@ + + + + + + Paper Writer Skill — Not a manuscript factory. A research engine. + + + + + + + + + + + + + +
+
+
+
+

Claude Code · Agent Skill · v3.2

+

Not a manuscript factory.
A research engine.

+

+ From clinical spark to submission-ready IMRAD — with Discovery + gates, stage-gated drafting, EN+JP humanizing, and an adversarial + review that can KILL a weak claim before any + journal sees it. Two things stay human: the 💡 IDEA and the 📊 DATA. +

+

+ Install in 60 seconds + ★ Star on GitHub +

+

+ Works with Claude Code and other agents that load + SKILL.md. Network used for literature — not for + telemetry. +

+
+ +
+
+
+ + + + agent · paper-writer +
+
+
+ You +
Write a case report from this spark: unexplained hypoglycemia after GLP-1 start in a non-diabetic adult. Data is de-identified and IRB-cleared.
+
+
+ Paper Writer +
Phase −1 Discovery +Forging FINER questions… novelty check against live literature… + +GATE · IDEA — three candidate questions ranked. +Human must pick the 💡 IDEA before any prose is drafted. + +GATE · DATA — confirming 📊 DATA is human-origin, +de-identified, and never invented by the model.
+
+
+ You +
Lock Q2. CARE case report. Target: BMJ Case Reports. EN.
+
+
+ Paper Writer +
Plan locked · CARE checklist armed +Project scaffold ready: 00_literature/ · 01_outline.md · sections/ · ethics/ + +Next: literature matrix → outline approval → tables before prose. +No manuscript factory mode — gates stay on.
+
+
+ +
+

Illustrative demo — no patient data. Gates are real.

+
+
+
+ +
+
+ Non-negotiable +

Human stays sovereign on two things

+

+ Everything else can be drafted, checked, and red-teamed by the agent. + These two cannot be delegated away. +

+
+
+

💡 IDEA

+

+ What is worth asking, what it means, and what is ethical. + Discovery forges candidates; the human locks the question. +

+
+
+

📊 DATA

+

+ Real, IRB-approved, never machine-originated. Raw clinical data + stays local and gitignored. The skill never invents numbers. +

+
+
+
+
+ +
+
+ Lifecycle +

From Discovery to revision — with gates

+

+ Ten phases. Eight quality gates with auto-fix loops. Adversarial + review can send a claim back to Discovery with a KILL. +

+
    +
  1. + −1 + DiscoveryQuestion forge · novelty · design · pre-registration +
  2. +
  3. + 1–2.5 + Literature → Outline → Tables/FiguresMatrix first; design exhibits before prose +
  4. +
  5. + 3–5 + Draft → Humanize → ReferencesIMRAD writing order · EN 18 + JP 13 AI patterns · DOI checks +
  6. +
  7. + 6–6.5 + Quality + Adversarial reviewCross-section gates, then red-team the central claim +
  8. +
  9. + 7–10 + Submit · Revise · Accept · Reject/resubmitCover letter, response letters, cascading strategy +
  10. +
+

+ Six paper types: Original · Case Report · Review · Systematic Review · Letter · Protocol. + 20+ reporting guidelines (CARE, CONSORT, STROBE, PRISMA…). +

+
+
+ +
+
+ Phase 4 +

Kill the AI tell — before reviewers do

+

+ Real patterns from references/humanizer-academic.md. + English and Japanese. Section-priority checklists. +

+
+
+
+ Before +
represents a pivotal challenge in the evolving landscape
+ Significance inflation +
+
+ After +
is highly prevalent in patients with diabetes
+ State the concrete claim +
+
+
+
+ Before +
HR 0.65, P = 0.002), highlighting the cardioprotective effects
+ Superficial -ing analysis +
+
+ After +
HR 0.65; 95% CI 0.50–0.85; P = 0.002.
+ Numbers over vibes +
+
+
+
+
+ +
+
+ Why this gets starred +

Concrete differentiators — not vibes

+
+
+

Discovery before drafting

+

Phase −1 forges and ranks questions, checks novelty against live literature, and locks a plan — only after the human picks the IDEA.

+
+
+

Stage-gates that auto-fix

+

Eight quality gates. FAIL → structured feedback → fixer agent → re-check (up to 3 loops). No silent proceed.

+
+
+

Adversarial review

+

Red-teams the central claim. A KILL path returns to Discovery instead of polishing a bad paper.

+
+
+

EN + JP humanizer

+

18 English and 13 Japanese academic AI patterns with before/after examples and section priorities.

+
+
+

Six types, 20+ guidelines

+

Original, Case Report, Review, SR, Letter, Protocol — CARE / CONSORT / STROBE / PRISMA and more wired in.

+
+
+

Team mode + tested scripts

+

Seven parallel agents for search/draft/humanize/review. Utilities like table1.py and SR helpers with CI tests.

+
+
+
+
+ +
+
+ 60-second start +

Install it. Ask in plain language.

+
+ +
# Claude Code, Cursor, Codex, and other agents that load skills
+$ npx skills add kgraph57/paper-writer-skill
+
+

+ Or clone into Claude Code’s skills directory: + git clone https://github.com/kgraph57/paper-writer-skill.git ~/.claude/skills/paper-writer +

+
+

Natural-language triggers

+
+ “write paper” · “start manuscript” · 「論文を書く」 · 「論文執筆」 +
+
+
+
+ +
+
+ Proof +

One public case study — two minutes

+
+

Discovery → draft → humanize → adversarial catch

+

+ An illustrative CARE case-report spark (PHI-free) walks through + question forge, a naive “just write it” abstract vs. the gated path, + two humanizer fixes, and an overclaim the adversarial review kills. +

+

+ Input → Discovery → Weak path → Gated path → Humanize → Adversarial → Proof +

+ Read the case study +
+
+
+
+ + + + + + diff --git a/docs/ja/index.html b/docs/ja/index.html new file mode 100644 index 0000000..9ba0eea --- /dev/null +++ b/docs/ja/index.html @@ -0,0 +1,195 @@ + + + + + + Paper Writer Skill — 原稿工場ではない。研究エンジン。 + + + + + + + + + +
+
+
+
+

Claude Code · Agent Skill · v3.2

+

原稿工場ではない。
研究エンジン。

+

+ 臨床のひらめきから投稿可能なIMRADまで。Discoveryゲート、ステージゲート執筆、日英ヒューマナイズ、そしてジャーナルの前に弱い主張を + KILL できる敵対的レビュー。人間が主権を持つのは二つだけ:💡 IDEA と 📊 DATA。 +

+

+ 60秒でインストール + ★ GitHubでStar +

+

+ SKILL.md を読むエージェントで動作。ネットワークは文献検索用(テレメトリなし)。 +

+
+
+
+
+ + agent · paper-writer +
+
+
+ あなた +
症例報告を書きたい。非糖尿病成人でGLP-1開始後の原因不明低血糖。データは匿名化済み・IRB承認済み。
+
+
+ Paper Writer +
Phase −1 Discovery +FINER質問を生成… ライブ文献で新規性チェック… + +GATE · IDEA — 候補を3つ提示。 +本文を書く前に、人間が 💡 IDEA を選ぶ必要があります。 + +GATE · DATA — 📊 DATA が人間由来・匿名化済みで、モデルが捏造していないことを確認。
+
+
+ あなた +
Q2でロック。CARE症例報告。投稿先はBMJ Case Reports。英語。
+
+
+ Paper Writer +
計画ロック · CAREチェックリスト起動 +スキャフォールド準備完了。次は文献マトリクス → アウトライン承認 → 本文より先に表・図。
+
+
+ +
+

デモは架空・PHIなし。ゲートは本番と同じ考え方です。

+
+
+
+ +
+
+ 譲れないルール +

人間が主権を持つのは二つ

+
+
+

💡 IDEA

+

何を問う価値があるか、意味は何か、倫理的か。候補はエージェントが鍛造し、ロックは人間がする。

+
+
+

📊 DATA

+

実在・IRB承認・機械起源ではない。生の臨床データはローカルのまま gitignore。数値の捏造はしない。

+
+
+
+
+ +
+
+ ライフサイクル +

Discoveryから査読対応まで、ゲート付き

+
    +
  1. −1Discovery質問鍛造 · 新規性 · デザイン · 事前登録
  2. +
  3. 1–2.5文献 → アウトライン → 表・図本文より先に展示物を設計
  4. +
  5. 3–5執筆 → ヒューマナイズ → 文献日英AIパターン除去 · DOI検証
  6. +
  7. 6–6.5品質 + 敵対的レビュー中心主張をレッドチーム
  8. +
  9. 7–10投稿 · 改訂 · 受理 · リジェクト再投稿
  10. +
+
+
+ +
+
+ Why this gets starred +

具体的な差分

+
+

書く前のDiscovery

質問を鍛え、ライブ文献で新規性を見て、人間がIDEAを選んでから本文へ。

+

自動修正付きステージゲート

8ゲート。FAILならフィードバック→修正→再チェック(最大3回)。

+

敵対的レビュー

中心主張を潰しにいく。KILLならDiscoveryへ戻す。

+

日英ヒューマナイズ

英語18・日本語13の学術AIパターン。

+

6タイプ / 20+ガイドライン

CARE / CONSORT / STROBE / PRISMA など。

+

チームモード + テスト済みスクリプト

table1.py やSR補助をCIで検証。

+
+
+
+ +
+
+ 60秒スタート +

入れて、自然言語で呼ぶ

+
+ +
$ npx skills add kgraph57/paper-writer-skill
+
+
+

呼び出し例

+
「論文を書く」 · 「論文執筆」 · “write paper” · “start manuscript”
+
+
+
+ +
+
+ Proof +

公開ケーススタディ(2分)

+
+

Discovery → 草稿 → ヒューマナイズ → 敵対的レビュー

+

PHIなしのCARE症例スパークで、ナイーブな「とりあえず書く」経路とゲート付き経路の差を見せます。

+ ケースを読む +
+
+
+
+ + + + + diff --git a/docs/site/css/style.css b/docs/site/css/style.css new file mode 100644 index 0000000..dbfb3c8 --- /dev/null +++ b/docs/site/css/style.css @@ -0,0 +1,282 @@ +/* paper-writer landing — self-contained, system fonts only */ + +* { box-sizing: border-box; } + +html { scroll-behavior: smooth; } + +body { + margin: 0; + background: var(--paper); + color: var(--ink); + font-family: var(--sans); + font-size: 17px; + line-height: 1.65; + -webkit-font-smoothing: antialiased; +} + +.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; } + +a { color: var(--navy); } + +code, pre { font-family: var(--mono); } + +.skip-link { + position: absolute; left: -9999px; top: 0; + background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; +} +.skip-link:focus { left: 0; } + +/* ---------- header ---------- */ + +.site-header { + position: sticky; top: 0; z-index: 50; + background: rgba(250, 248, 244, 0.92); + backdrop-filter: blur(6px); + border-bottom: 1px solid var(--line); +} +.site-header-inner { + display: flex; align-items: center; gap: 20px; + padding-top: 12px; padding-bottom: 12px; +} +.wordmark { + font-family: var(--serif); font-weight: 700; font-size: 18px; + color: var(--ink); text-decoration: none; white-space: nowrap; +} +.wordmark .tld { color: var(--navy); } +.site-nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; } +.site-nav a { + color: var(--ink-soft); text-decoration: none; font-size: 14.5px; +} +.site-nav a:hover { color: var(--navy); } + +/* ---------- buttons ---------- */ + +.btn { + display: inline-block; padding: 10px 20px; border-radius: 8px; + font-size: 15px; font-weight: 600; text-decoration: none; + border: 1.5px solid transparent; cursor: pointer; +} +.btn-primary { background: var(--navy); color: #fff; } +.btn-primary:hover { background: #0f1f52; } +.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; } +.btn-ghost:hover { background: var(--ink); color: var(--paper); } +.star-btn { white-space: nowrap; } + +/* ---------- hero ---------- */ + +#hero { padding: 64px 0 48px; } +.hero-grid { + display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start; +} +@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } } + +.hero-kicker { + font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; + color: var(--navy); font-weight: 700; margin: 0 0 14px; +} +h1 { + font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); + line-height: 1.12; margin: 0 0 20px; letter-spacing: -0.01em; +} +h1 em { font-style: normal; color: var(--navy); } +.lede { font-size: 18.5px; color: var(--ink-soft); margin: 0 0 26px; max-width: 34em; } +.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; } +.hero-sub { font-size: 14px; color: var(--ink-faint); margin: 0; } +.hero-sub code { + background: var(--tint); padding: 2px 7px; border-radius: 5px; + color: var(--navy); font-size: 13px; +} + +/* ---------- terminal / chat demo ---------- */ + +.term { + background: var(--term-bg); color: var(--term-ink); + border-radius: 12px; padding: 16px 16px 14px; + box-shadow: var(--shadow-card); +} +.term-bar { + display: flex; gap: 6px; margin-bottom: 14px; align-items: center; +} +.term-dot { + width: 10px; height: 10px; border-radius: 50%; + background: rgba(255,255,255,0.18); +} +.term-title { + margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--term-dim); +} +.chat { display: flex; flex-direction: column; gap: 12px; min-height: 280px; } +.chat-msg { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s ease; } +.js .chat-msg { opacity: 0; transform: translateY(6px); } +.js .chat-msg.is-on { opacity: 1; transform: none; } +.chat-who { + display: block; font-family: var(--mono); font-size: 11px; + letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px; +} +.chat-msg-user .chat-who { color: var(--term-amber); } +.chat-msg-agent .chat-who { color: var(--term-green); } +.chat-bubble { + background: rgba(255, 255, 255, 0.055); border-radius: 8px; + padding: 11px 14px; line-height: 1.55; white-space: pre-wrap; + font-size: 13.5px; +} +.chat-msg-user .chat-bubble { border-left: 2px solid var(--term-amber); } +.chat-msg-agent .chat-bubble { border-left: 2px solid var(--term-green); } +.chat-bubble .g { color: var(--term-green); } +.chat-bubble .a { color: var(--term-amber); } +.chat-bubble .d { color: var(--term-dim); } +.chat-caret { + display: inline-block; width: 8px; height: 15px; vertical-align: -2px; + background: var(--term-amber); animation: blink 0.9s steps(1) infinite; +} +@keyframes blink { 50% { opacity: 0; } } +.chat-replay { + background: none; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--term-dim); + font-family: var(--mono); font-size: 12px; border-radius: 6px; + padding: 5px 12px; cursor: pointer; margin-top: 4px; +} +.chat-replay:hover { color: var(--term-ink); border-color: var(--term-dim); } +.term-caption { text-align: center; font-size: 13px; color: var(--ink-faint); margin: 12px 0 0; } + +/* ---------- sections ---------- */ + +section { padding: 64px 0; } +section.band { + background: var(--paper-raised); + border-top: 1px solid var(--line); + border-bottom: 1px solid var(--line); +} +.kicker { + display: block; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; + color: var(--navy); font-weight: 700; margin-bottom: 10px; +} +h2 { + font-family: var(--serif); font-size: clamp(26px, 3.4vw, 36px); + line-height: 1.2; margin: 0 0 14px; +} +.section-lede { color: var(--ink-soft); max-width: 44em; margin: 0 0 34px; } + +/* ---------- sovereignty cards ---------- */ + +.sov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 8px; } +@media (max-width: 720px) { .sov-grid { grid-template-columns: 1fr; } } +.sov-card { + background: var(--paper-raised); border: 1px solid var(--line); + border-top: 3px solid var(--gate); border-radius: var(--radius); padding: 22px 24px; + box-shadow: var(--shadow-card); +} +.sov-card h3 { margin: 0 0 8px; font-size: 19px; } +.sov-card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; } + +/* ---------- pipeline ---------- */ + +.pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } +.pipe-step { + display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: baseline; + background: var(--paper-raised); border: 1px solid var(--line); + border-radius: 8px; padding: 13px 18px; +} +.pipe-step.is-gate { border-left: 3px solid var(--gate); background: var(--gate-soft); } +.pipe-step.is-new { border-left: 3px solid var(--navy); } +.pipe-num { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); white-space: nowrap; } +.pipe-label { font-weight: 600; font-size: 15.5px; } +.pipe-label small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; } +.pipe-note { font-size: 14px; color: var(--ink-faint); margin-top: 18px; } +.pipe-note .kill { color: var(--risk); font-weight: 600; } + +/* ---------- humanizer before/after ---------- */ + +.hum-grid { display: grid; gap: 16px; margin-top: 8px; } +.hum-row { + display: grid; grid-template-columns: 1fr 1fr; gap: 0; + border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; + background: var(--paper-raised); +} +@media (max-width: 720px) { .hum-row { grid-template-columns: 1fr; } } +.hum-cell { padding: 16px 20px; font-size: 14.5px; line-height: 1.6; } +.hum-before { background: #fbf3f2; } +.hum-after { background: var(--tint); border-left: 1px solid var(--line); } +@media (max-width: 720px) { .hum-after { border-left: 0; border-top: 1px solid var(--line); } } +.hum-tag { + display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; + text-transform: uppercase; padding: 2px 8px; border-radius: 20px; margin-bottom: 8px; +} +.hum-before .hum-tag { background: #f3d9d6; color: var(--risk); } +.hum-after .hum-tag { background: #d9e4f7; color: var(--navy); } +.hum-cell del { color: var(--risk); text-decoration-color: rgba(185, 28, 28, 0.55); } +.hum-cell ins { color: var(--navy); text-decoration: none; font-weight: 600; } +.hum-pattern { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; } + +/* ---------- why starred ---------- */ + +.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } +@media (max-width: 720px) { .why-grid { grid-template-columns: 1fr; } } +.why-card { + background: var(--paper-raised); border: 1px solid var(--line); + border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-card); +} +.why-card h3 { margin: 0 0 6px; font-size: 17px; } +.why-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); } +.why-card p code { + font-size: 13px; background: var(--tint); padding: 1px 6px; border-radius: 4px; +} + +/* ---------- install ---------- */ + +.install-shell { position: relative; margin: 0 0 22px; } +.install-term { + background: var(--term-bg); color: var(--term-ink); + border-radius: var(--radius); padding: 20px 22px; overflow-x: auto; + font-size: 14px; line-height: 1.8; margin: 0; +} +.install-term .c { color: var(--term-dim); } +.install-term .p { color: var(--term-green); user-select: none; } +.copy-btn { + position: absolute; top: 10px; right: 10px; + background: rgba(255, 255, 255, 0.1); color: var(--term-ink); + border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; + font-family: var(--mono); font-size: 12px; padding: 5px 12px; cursor: pointer; +} +.copy-btn:hover { background: rgba(255, 255, 255, 0.18); } +.trigger-box { + border: 1px dashed var(--line); border-radius: var(--radius); + background: var(--paper-raised); padding: 18px 22px; +} +.trigger-box p { margin: 0 0 6px; font-size: 14px; color: var(--ink-faint); } +.trigger-box blockquote { + margin: 0; font-family: var(--serif); font-size: 17px; font-style: italic; +} + +/* ---------- case study ---------- */ + +.case-card { + background: var(--paper-raised); border: 1px solid var(--line); + border-left: 4px solid var(--navy); border-radius: var(--radius); + padding: 28px 30px; box-shadow: var(--shadow-card); +} +.case-card h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; } +.case-card p { color: var(--ink-soft); margin: 0 0 18px; max-width: 44em; } +.case-flow { + font-family: var(--mono); font-size: 13px; color: var(--ink-faint); + margin: 0 0 20px; word-break: break-word; +} +.case-flow b { color: var(--navy); font-weight: 600; } + +/* ---------- footer ---------- */ + +.site-footer { background: var(--term-bg); color: var(--term-ink); padding: 56px 0 40px; } +.ft-cta { font-family: var(--serif); font-size: clamp(20px, 2.6vw, 27px); line-height: 1.4; margin: 0 0 22px; max-width: 30em; } +.ft-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 34px; } +.ft-actions .btn-ghost { border-color: var(--term-dim); color: var(--term-ink); } +.ft-actions .btn-ghost:hover { background: var(--term-ink); color: var(--term-bg); } +.ft-divider { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 0 0 22px; } +.ft-small { font-size: 13.5px; color: var(--term-dim); } +.ft-small p { margin: 0 0 8px; } +.ft-links { list-style: none; display: flex; gap: 18px; flex-wrap: wrap; padding: 0; margin: 14px 0 0; } +.ft-links a { color: var(--term-dim); } +.ft-links a:hover { color: var(--term-ink); } + +@media (prefers-reduced-motion: reduce) { + html { scroll-behavior: auto; } + .chat-msg { transition: none; } + .chat-caret { animation: none; } +} diff --git a/docs/site/css/tokens.css b/docs/site/css/tokens.css new file mode 100644 index 0000000..6b1971d --- /dev/null +++ b/docs/site/css/tokens.css @@ -0,0 +1,38 @@ +:root { + --navy: #15296b; + --blue: #2563eb; + --ink: #1c2430; + --ink-soft: #4b5563; + --ink-faint: #8a93a1; + --grey-700: #374151; + --grey-500: #6b7280; + --grey-300: #d1d5db; + --fill: #f3f4f6; + --tint: #eff3fb; + --risk: #b91c1c; + --gate: #b45309; + --gate-soft: #fdf1e2; + --paper: #faf8f4; + --paper-raised: #ffffff; + --line: #e4e0d8; + --term-bg: #131a22; + --term-ink: #d7dee8; + --term-dim: #7d8899; + --term-green: #7fd1b9; + --term-amber: #e8b05c; + --accent: var(--navy); + --accent-soft: var(--tint); + --radius: 10px; + + --serif: + Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif; + --sans: + -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, + "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; + --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; + + --u: 8px; + --measure: 72rem; + --shadow-card: + 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(21, 41, 107, 0.08); +} diff --git a/docs/site/js/main.js b/docs/site/js/main.js new file mode 100644 index 0000000..4113f42 --- /dev/null +++ b/docs/site/js/main.js @@ -0,0 +1,117 @@ +/* paper-writer landing — chat demo player + copy buttons. No dependencies. */ +(function () { + "use strict"; + + document.documentElement.classList.add("js"); + + var reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches; + + document.querySelectorAll("[data-copy]").forEach(function (btn) { + btn.addEventListener("click", function () { + var target = document.querySelector(btn.getAttribute("data-copy")); + if (!target) return; + var text = target.innerText.replace(/^\$ /gm, ""); + navigator.clipboard.writeText(text).then(function () { + var old = btn.textContent; + btn.textContent = btn.getAttribute("data-copied-label") || "Copied"; + setTimeout(function () { btn.textContent = old; }, 1400); + }); + }); + }); + + var chat = document.querySelector("[data-chat]"); + if (!chat) return; + + var msgs = Array.prototype.slice.call(chat.querySelectorAll(".chat-msg")); + var replayBtn = chat.parentElement.querySelector(".chat-replay"); + var timers = []; + var started = false; + + function clearTimers() { + timers.forEach(function (t) { clearTimeout(t); }); + timers = []; + } + + function later(fn, ms) { timers.push(setTimeout(fn, ms)); } + + function showAll() { + msgs.forEach(function (m) { + m.classList.add("is-on"); + var b = m.querySelector(".chat-bubble"); + if (b && b.__fullHTML) b.innerHTML = b.__fullHTML; + }); + } + + function typeInto(bubble, done) { + var full = bubble.__fullText; + bubble.textContent = ""; + var caret = document.createElement("span"); + caret.className = "chat-caret"; + bubble.appendChild(caret); + var i = 0; + (function tick() { + if (i <= full.length) { + if (bubble.firstChild && bubble.firstChild !== caret) { + bubble.removeChild(bubble.firstChild); + } + bubble.insertBefore(document.createTextNode(full.slice(0, i)), caret); + i += 1; + later(tick, 26 + Math.random() * 34); + } else { + caret.remove(); + done(); + } + })(); + } + + function play() { + clearTimers(); + msgs.forEach(function (m) { + m.classList.remove("is-on"); + var b = m.querySelector(".chat-bubble"); + if (b) { + if (!b.__fullHTML) { + b.__fullHTML = b.innerHTML; + b.__fullText = b.textContent; + } + b.innerHTML = ""; + } + }); + if (reduceMotion) { showAll(); return; } + + var idx = 0; + (function next() { + if (idx >= msgs.length) return; + var m = msgs[idx]; + var bubble = m.querySelector(".chat-bubble"); + var isUser = m.classList.contains("chat-msg-user"); + idx += 1; + m.classList.add("is-on"); + if (isUser) { + typeInto(bubble, function () { later(next, 500); }); + } else { + later(function () { + bubble.innerHTML = bubble.__fullHTML; + later(next, 900 + Math.min(bubble.__fullText.length * 6, 2200)); + }, 550); + } + })(); + } + + if (replayBtn) replayBtn.addEventListener("click", play); + + if ("IntersectionObserver" in window) { + var io = new IntersectionObserver(function (entries) { + entries.forEach(function (e) { + if (e.isIntersecting && !started) { + started = true; + play(); + io.disconnect(); + } + }); + }, { threshold: 0.3 }); + io.observe(chat); + } else { + play(); + } +})(); diff --git a/examples/case-studies/discovery-to-draft.md b/examples/case-studies/discovery-to-draft.md new file mode 100644 index 0000000..9a2a994 --- /dev/null +++ b/examples/case-studies/discovery-to-draft.md @@ -0,0 +1,103 @@ +# Case Study: Discovery → Draft → Humanize → Adversarial Catch + +A two-minute read of one illustrative pass through the skill's pipeline. The clinical spark is **PHI-free and fictional** — built to show the product shape, not a real patient. Every template and checklist named below already exists in this repository. + +> **The loop:** Input → Discovery → Weak path → Gated path → Humanize → Adversarial → Proof + +## 1. Input — the spark a clinician actually has + +Illustrative, de-identified notes (entire input; no cleanup): + +```text +Want a CARE case report. +Non-diabetic adult started a GLP-1 agonist for weight management. +Within 3 weeks: recurrent symptomatic hypoglycemia, workup otherwise unrevealing. +Stopped the drug; events resolved. +Have labs timeline + meds list (de-identified). IRB waiver for single case on file. +Target journal leaning BMJ Case Reports. Language: English. +``` + +## 2. Discovery — forge questions, then lock the IDEA + +Phase −1 does not open a blank Methods section. It forges FINER-scored candidates, runs a novelty skim against live literature, and stops at the human gates: + +| Candidate | FINER sketch | Novelty skim (illustrative) | +| --- | --- | --- | +| Q1. Mechanism review of GLP-1 and glucose in non-diabetics | Broad; weak "case" fit | Crowded review space | +| **Q2. CARE report: temporal association + negative workup + dechallenge** | Feasible with on-hand data | Room for a well-documented single case | +| Q3. Series protocol for prospective capture | Needs resources not available | Wrong product for this spark | + +**Human locks Q2** (💡 IDEA). **Human confirms** the lab/meds extract is real and de-identified (📊 DATA). The skill does not invent glucose values or a patient. + +Artifacts used: `templates/research-question.md`, `templates/project-init-case.md`, `references/novelty-check.md`, `references/ai-for-science-model.md`. + +## 3. Weak path — "just write the paper" + +If you skip gates and ask a generic model for an abstract, you often get significance inflation and promotional language (patterns the repo's humanizer is built to kill): + +```text +This landmark case underscores a pivotal challenge in the evolving +therapeutic landscape of GLP-1 agonists, highlighting the crucial need +for heightened clinical vigilance in non-diabetic populations. +``` + +Accurate vibe, useless science writing. No timeline. No CARE structure. No limits stated. + +## 4. Gated path — outline, exhibits, then prose + +With gates on: + +1. **Literature matrix** (≥10 sources, DOIs checked) before outline approval. +2. **Outline** mapped to CARE sections; human approval required. +3. **Tables/figures before prose** — e.g. Table 1 timeline of glucose / meds; Figure 1 clinical course. +4. **Draft in writing order** (Case presentation → Discussion → … → Abstract → Title). +5. Stage-gates refuse to proceed on FAIL (feedback → fixer → re-check, max 3). + +Relevant templates: `templates/case-report.md`, `templates/case-abstract.md`, `templates/literature-matrix.md`, `references/reporting-guidelines.md` (CARE). + +## 5. Humanize — two real pattern fixes + +From `references/humanizer-academic.md`: + +| Pattern | Before | After | +| --- | --- | --- | +| Significance inflation | "represents a pivotal challenge in the evolving landscape" | "is uncommon but clinically important when hypoglycemia appears after GLP-1 initiation in a non-diabetic adult" | +| Superficial -ing analysis | "glucose normalized after cessation, highlighting the drug's role" | "glucose normalized after cessation (dechallenge); rechallenge was not performed." | + +Phase 4's gate requires high-priority AI patterns = 0 before references/quality review. + +## 6. Adversarial review — catch the overclaim + +`references/adversarial-review.md` red-teams the central claim. Illustrative finding: + +> **Overclaim:** Abstract implies causality ("GLP-1 caused hypoglycemia") from a single uncontrolled case. +> **Fix:** Frame as temporal association + dechallenge; state that causality cannot be proven; list alternative explanations considered and why they were less likely. +> **Verdict:** Revise (not KILL) — the IDEA is intact; the wording overreached. + +A true **KILL** (fatal design/ethics/data problem) would return to Phase −1 instead of polishing a bad paper. + +## 7. Proof — what already ships in-repo + +You do not need to trust a staged "accepted paper." Reproduce the workflow pieces that exist today: + +| Piece | Where | +| --- | --- | +| Operating model (IDEA/DATA sovereignty) | `references/ai-for-science-model.md` | +| Novelty + adversarial guides | `references/novelty-check.md`, `references/adversarial-review.md` | +| CARE / case templates | `templates/case-report.md`, `templates/case-abstract.md`, `templates/case-introduction.md` | +| Humanizer patterns | `references/humanizer-academic.md` | +| Data rules (raw gitignored, no PHI in chat) | `templates/data-management.md`, `SECURITY.md` | +| Compile / word-count utilities | `scripts/compile-manuscript.sh`, `scripts/word-count.sh` | + +```bash +# after install / clone +npx skills add kgraph57/paper-writer-skill +# then in Claude Code / your agent: +# "Start a CARE case report from these de-identified notes…" +``` + +## What this case study deliberately does *not* claim + +- No journal acceptance, impact factor, or "N doctors use this." +- No real patient identifiers or real lab dumps. +- No promise that the skill replaces IRB review or auto-submits to journals.