inkbone 0.0.0-stage → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +318 -0
  3. package/README.md +333 -2
  4. package/bin/inkbone.mjs +941 -0
  5. package/configs/genres.json +570 -0
  6. package/configs/messages.json +302 -0
  7. package/configs/platforms.json +62 -0
  8. package/configs/presets.json +265 -0
  9. package/configs/severity.json +52 -0
  10. package/configs/zh-linguistics.json +986 -0
  11. package/configs/zh-traditional.json +97 -0
  12. package/examples/claude-code-hooks.json +15 -0
  13. package/examples/mcp-config.json +12 -0
  14. package/package.json +61 -4
  15. package/prompts/00-style-architect.md +42 -0
  16. package/prompts/01-beat-planner.md +54 -0
  17. package/prompts/02-paratactic-renderer.md +60 -0
  18. package/prompts/03-targeted-rewriter.md +39 -0
  19. package/prompts/04-evidence-reviewer.md +39 -0
  20. package/prompts/05-reader-simulator.md +54 -0
  21. package/prompts/06-ledger-importer.md +41 -0
  22. package/prompts/07-chapter-settler.md +66 -0
  23. package/resources/bad_vs_good_cases.md +98 -0
  24. package/resources/eval/blind-read-instructions.md +18 -0
  25. package/resources/genre_playbooks/classical-xianxia.md +22 -0
  26. package/resources/genre_playbooks/general-clean.md +19 -0
  27. package/resources/genre_playbooks/historical-court.md +21 -0
  28. package/resources/genre_playbooks/light-fantasy.md +21 -0
  29. package/resources/genre_playbooks/mystery-thriller.md +22 -0
  30. package/resources/genre_playbooks/romance-emotional.md +20 -0
  31. package/resources/genre_playbooks/scifi-wasteland.md +21 -0
  32. package/resources/genre_playbooks/urban-realism.md +22 -0
  33. package/resources/genre_playbooks/wuxia-jianghu.md +21 -0
  34. package/resources/micro_techniques.md +77 -0
  35. package/skills/inkbone/LICENSE +21 -0
  36. package/skills/inkbone/README.md +334 -0
  37. package/skills/inkbone/SKILL.md +155 -0
  38. package/skills/inkbone/benchmarks/eval-set/README.md +49 -0
  39. package/skills/inkbone/benchmarks/eval-set/public-pairs.json +42 -0
  40. package/skills/inkbone/benchmarks/eval-set/seeds.json +42 -0
  41. package/skills/inkbone/bin/inkbone.mjs +941 -0
  42. package/skills/inkbone/configs/genres.json +570 -0
  43. package/skills/inkbone/configs/messages.json +302 -0
  44. package/skills/inkbone/configs/platforms.json +62 -0
  45. package/skills/inkbone/configs/presets.json +265 -0
  46. package/skills/inkbone/configs/severity.json +52 -0
  47. package/skills/inkbone/configs/zh-linguistics.json +986 -0
  48. package/skills/inkbone/configs/zh-traditional.json +97 -0
  49. package/skills/inkbone/package.json +63 -0
  50. package/skills/inkbone/prompts/00-style-architect.md +42 -0
  51. package/skills/inkbone/prompts/01-beat-planner.md +54 -0
  52. package/skills/inkbone/prompts/02-paratactic-renderer.md +60 -0
  53. package/skills/inkbone/prompts/03-targeted-rewriter.md +39 -0
  54. package/skills/inkbone/prompts/04-evidence-reviewer.md +39 -0
  55. package/skills/inkbone/prompts/05-reader-simulator.md +54 -0
  56. package/skills/inkbone/prompts/06-ledger-importer.md +41 -0
  57. package/skills/inkbone/prompts/07-chapter-settler.md +66 -0
  58. package/skills/inkbone/resources/bad_vs_good_cases.md +98 -0
  59. package/skills/inkbone/resources/eval/blind-read-instructions.md +18 -0
  60. package/skills/inkbone/resources/genre_playbooks/classical-xianxia.md +22 -0
  61. package/skills/inkbone/resources/genre_playbooks/general-clean.md +19 -0
  62. package/skills/inkbone/resources/genre_playbooks/historical-court.md +21 -0
  63. package/skills/inkbone/resources/genre_playbooks/light-fantasy.md +21 -0
  64. package/skills/inkbone/resources/genre_playbooks/mystery-thriller.md +22 -0
  65. package/skills/inkbone/resources/genre_playbooks/romance-emotional.md +20 -0
  66. package/skills/inkbone/resources/genre_playbooks/scifi-wasteland.md +21 -0
  67. package/skills/inkbone/resources/genre_playbooks/urban-realism.md +22 -0
  68. package/skills/inkbone/resources/genre_playbooks/wuxia-jianghu.md +21 -0
  69. package/skills/inkbone/resources/micro_techniques.md +77 -0
  70. package/skills/inkbone/src/auditor.mjs +24 -0
  71. package/skills/inkbone/src/benchmark-runner.mjs +71 -0
  72. package/skills/inkbone/src/boundary-compiler.mjs +54 -0
  73. package/skills/inkbone/src/browser-doctor.mjs +30 -0
  74. package/skills/inkbone/src/calibrator.mjs +175 -0
  75. package/skills/inkbone/src/config-loader.mjs +233 -0
  76. package/skills/inkbone/src/continuity.mjs +5 -0
  77. package/skills/inkbone/src/core/auditor.mjs +914 -0
  78. package/skills/inkbone/src/core/boundary-compiler.mjs +423 -0
  79. package/skills/inkbone/src/core/browser-doctor.mjs +318 -0
  80. package/skills/inkbone/src/core/config-compiler.mjs +434 -0
  81. package/skills/inkbone/src/core/continuity.mjs +158 -0
  82. package/skills/inkbone/src/core/evidence-validator.mjs +77 -0
  83. package/skills/inkbone/src/core/exporter.mjs +128 -0
  84. package/skills/inkbone/src/core/formatter.mjs +241 -0
  85. package/skills/inkbone/src/core/ledger-manager.mjs +576 -0
  86. package/skills/inkbone/src/core/normalizer.mjs +517 -0
  87. package/skills/inkbone/src/core/profiler.mjs +686 -0
  88. package/skills/inkbone/src/core/rule-engine.mjs +1536 -0
  89. package/skills/inkbone/src/core/style-profiler.mjs +229 -0
  90. package/skills/inkbone/src/detector.mjs +270 -0
  91. package/skills/inkbone/src/doctor.mjs +428 -0
  92. package/skills/inkbone/src/evaluation.mjs +311 -0
  93. package/skills/inkbone/src/evidence-validator.mjs +15 -0
  94. package/skills/inkbone/src/exporter.mjs +106 -0
  95. package/skills/inkbone/src/formatter.mjs +34 -0
  96. package/skills/inkbone/src/importer.mjs +230 -0
  97. package/skills/inkbone/src/index.mjs +116 -0
  98. package/skills/inkbone/src/ledger-manager.mjs +15 -0
  99. package/skills/inkbone/src/mcp-server.mjs +861 -0
  100. package/skills/inkbone/src/normalizer.mjs +73 -0
  101. package/skills/inkbone/src/profiler.mjs +17 -0
  102. package/skills/inkbone/src/rule-engine.mjs +73 -0
  103. package/skills/inkbone/src/rule-stats.mjs +142 -0
  104. package/skills/inkbone/src/style-profiler.mjs +25 -0
  105. package/src/auditor.mjs +24 -0
  106. package/src/benchmark-runner.mjs +71 -0
  107. package/src/boundary-compiler.mjs +54 -0
  108. package/src/browser-doctor.mjs +30 -0
  109. package/src/calibrator.mjs +175 -0
  110. package/src/config-loader.mjs +233 -0
  111. package/src/continuity.mjs +5 -0
  112. package/src/core/auditor.mjs +914 -0
  113. package/src/core/boundary-compiler.mjs +423 -0
  114. package/src/core/browser-doctor.mjs +318 -0
  115. package/src/core/config-compiler.mjs +434 -0
  116. package/src/core/continuity.mjs +158 -0
  117. package/src/core/evidence-validator.mjs +77 -0
  118. package/src/core/exporter.mjs +128 -0
  119. package/src/core/formatter.mjs +241 -0
  120. package/src/core/ledger-manager.mjs +576 -0
  121. package/src/core/normalizer.mjs +517 -0
  122. package/src/core/profiler.mjs +686 -0
  123. package/src/core/rule-engine.mjs +1536 -0
  124. package/src/core/style-profiler.mjs +229 -0
  125. package/src/detector.mjs +270 -0
  126. package/src/doctor.mjs +428 -0
  127. package/src/evaluation.mjs +311 -0
  128. package/src/evidence-validator.mjs +15 -0
  129. package/src/exporter.mjs +106 -0
  130. package/src/formatter.mjs +34 -0
  131. package/src/importer.mjs +230 -0
  132. package/src/index.mjs +116 -0
  133. package/src/ledger-manager.mjs +15 -0
  134. package/src/mcp-server.mjs +861 -0
  135. package/src/normalizer.mjs +73 -0
  136. package/src/profiler.mjs +17 -0
  137. package/src/rule-engine.mjs +73 -0
  138. package/src/rule-stats.mjs +142 -0
  139. package/src/style-profiler.mjs +25 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 InkBone Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,318 @@
1
+ # InkBone
2
+
3
+ **A persistent ledger, style contract, and zero-dependency local QA CLI for writing Chinese long-form fiction with LLMs.**
4
+
5
+ [![test](https://github.com/blankym/inkbone/actions/workflows/test.yml/badge.svg)](https://github.com/blankym/inkbone/actions/workflows/test.yml)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+ [![Node.js ≥ 18](https://img.shields.io/badge/Node.js-%E2%89%A518-brightgreen.svg)](https://nodejs.org)
8
+ [![Dependencies: 0](https://img.shields.io/badge/dependencies-0-orange.svg)](package.json)
9
+ [![Version: 2.0](https://img.shields.io/badge/version-2.0-lightgrey.svg)](package.json)
10
+
11
+ [中文](README.md) · **[Live Playground & Browser Doctor (client-side)](https://blankym.github.io/inkbone/)** · 9 genre packs · Simplified + Traditional Chinese · 25 commands · Full MCP Server · VS Code Extension · 66 tests · zero dependencies
12
+
13
+ > **Language note:** Prompts, rule patterns, and CLI findings target **Chinese fiction**. This README documents the design and workflow in English.
14
+
15
+ Long-form LLM fiction usually breaks down around chapter 15:
16
+
17
+ - A setup planted in chapter 3 gets forgotten or spoiled in narration forty chapters later.
18
+ - Classical xianxia prose starts slipping in corporate jargon, impossible traditional time counts, or repetitive stock reactions.
19
+ - Subject-dropped Chinese action sentences silently switch actors right after another character's line.
20
+ - Ask a model to review its own draft and it often invents quotes that never appeared in the chapter while telling you to "add more sensory adjectives."
21
+
22
+ Prompting alone stops working once earlier rules fall out of context. InkBone separates drafting guidance (staged prompts) from deterministic checks (local Node scripts running regexes, lexicons, ledger boundaries, and continuity rules).
23
+
24
+ ---
25
+
26
+ ## See it work in 30 seconds
27
+
28
+ > **Want to try without cloning, or check a whole novel in your browser?** Open the **[Live Playground & Browser Doctor](https://blankym.github.io/inkbone/)** — pure client-side ES Modules with zero server uploads, supporting single-chapter inline `<mark>` highlights, auto Simplified/Traditional Chinese detection, one-click targeted rewrite prompts, **multi-chapter Browser Doctor (drop an entire `chapters/` folder for cross-chapter echo checks, Top 10 cliché rankings, auto-mined `ledger.json`, and platform `.txt` export)**, plus live `packet` / `check-ledger` / `verify-review` demos.
29
+
30
+ ![InkBone Browser Playground: inline word-level highlights, rhythm strip, and one-click targeted rewrite prompt](docs/assets/playground-audit.png)
31
+
32
+ <details>
33
+ <summary>Expand Tab 4 screenshot: Browser Doctor multi-chapter checkup & platform exporter</summary>
34
+
35
+ ![InkBone Browser Doctor: multi-chapter sorting, cross-chapter echo detection, Top 10 clichés, and auto-mined ledger](docs/assets/playground-book-doctor.png)
36
+
37
+ </details>
38
+
39
+ Save a 9-line sample chapter (`ch01.md`):
40
+
41
+ ```markdown
42
+ 子时三刻,药园的木门被人拍响。
43
+
44
+ 陆青瞳孔骤缩,起身去开门。
45
+
46
+ 门外站着执事孙岳,雨水落到他身上就散成白雾。孙岳没进门,把一块铁牌丢在桌上:
47
+
48
+ “寅时十刻之前,把渠里的符拔干净。”
49
+
50
+ 孙岳转身靠在门柱上,合上了眼。从袖子里摸出一把小刀,挑开了渠边的泥。
51
+ ```
52
+
53
+ Add a character roster (`ledger.json`):
54
+
55
+ ```json
56
+ { "characterNames": ["陆青", "孙岳"] }
57
+ ```
58
+
59
+ Run `doctor` locally (no API key or `npm install` needed):
60
+
61
+ ```bash
62
+ node bin/inkbone.mjs doctor ch01.md --genre classical-xianxia --ledger ledger.json --skip-length
63
+ ```
64
+
65
+ Output:
66
+
67
+ ```markdown
68
+ ## ch01.md
69
+ - **L3**: `cliche_pupil_shrink` (瞳孔骤缩)
70
+ - **L7**: `reg_impossible_ke_count` (寅时十刻)
71
+ - **L9**: `subject_ambiguity` (previous actor 孙岳: 从袖子里摸出一把小刀,挑开了渠边的泥。)
72
+ ```
73
+
74
+ - **Line 3**: flags a stock AI cliché in narration while leaving quoted dialogue alone.
75
+ - **Line 7**: catches a calendar error (a traditional *shichen* only has 8 *ke*, never 10).
76
+ - **Line 9**: tracks that the previous sentence opened with Sun Yue (`孙岳`), sees a subjectless action right after it, and warns that readers will read it as Sun Yue pulling the knife.
77
+
78
+ ### Before / After in Practice
79
+
80
+ ```markdown
81
+ Before (typical AI draft):
82
+ Forty-three-year-old veteran Zhou Jianmin ran the old-town delivery station and worried about cutting complaints before month-end. Taking a deep breath with a bitter smile, he pushed open the glass door so no one would see his unease.
83
+
84
+ After (cut resume dump, stock tics, and explanatory tail):
85
+ The complaint rate sat at 0.62%, well above the district cutoff. Zhou flattened the appeal sheets, pulled his yellow raincoat off the hook. Outside under the awning, Hu Fei tapped "decline" two rings into a dispatch alert.
86
+ ```
87
+
88
+ ### Reproducible Public Benchmark (4 Original Seeds)
89
+
90
+ Run `node scripts/run-public-eval.mjs` to reproduce [benchmarks/public-report.md](benchmarks/public-report.md) on the 4 original zero-copyright pairs in [benchmarks/eval-set/public-pairs.json](benchmarks/eval-set/public-pairs.json):
91
+
92
+ | Seed | Genre | Baseline (Errors / Warnings / Line Hits) | InkBone Revised (Errors / Warnings / Line Hits) |
93
+ | :--- | :--- | :---: | :---: |
94
+ | Herb Ditch (`xianxia-herb-ditch`) | `classical-xianxia` | 0 / 5 / 13 | 0 / 0 / 0 |
95
+ | Fog Harbor (`mystery-harbor-coroner`) | `mystery-thriller` | 1 / 5 / 12 | 0 / 0 / 0 |
96
+ | Delivery Station (`urban-delivery-station`) | `urban-realism` | 0 / 4 / 8 | 0 / 0 / 0 |
97
+ | Cooling-Off Day (`romance-cooling-off`) | `romance-emotional` | 0 / 3 / 14 | 0 / 0 / 0 |
98
+ | **Total (4 genres)** | — | **1 / 17 / 47** | **0 / 0 / 0** |
99
+
100
+ ---
101
+
102
+ ## Installation & Quickstart
103
+
104
+ Requires **Node.js 18+**. No `npm install` needed.
105
+
106
+ ### Option 1: One-Line Agent Skill Install (Recommended)
107
+
108
+ `skills/inkbone/` follows the open `agentskills` layout and bundles `SKILL.md`, the CLI, configs, 8 stage prompts, and craft resources. Install directly into Claude Code, Codex, Cursor, or Antigravity:
109
+
110
+ ```bash
111
+ npx skills add blankym/inkbone
112
+ ```
113
+
114
+ Or copy manually offline:
115
+
116
+ ```bash
117
+ git clone https://github.com/blankym/inkbone.git
118
+ cp -R inkbone/skills/inkbone <your-skills-dir>/inkbone
119
+ ```
120
+
121
+ Once loaded, you can ask your agent directly:
122
+ - "Set up a mystery novel project with InkBone and generate `novel.json` and `ledger.json`."
123
+ - "Compile the chapter 12 packet from `ledger.json`, outline the scene beats, and settle the ledger once drafted."
124
+ - "Import `chapters/` into a ledger with auto-mined character names and run `doctor` across all volumes."
125
+
126
+ *(If your agent runtime blocks shell execution, the prompt stages in `prompts/` and `resources/` still work standalone; local checks simply won't run automatically.)*
127
+
128
+ ### Option 2: Full Zero-Dependency MCP Server (Tools + Prompts + Resources) & Editor Integration
129
+
130
+ InkBone ships a **zero-dependency stdio MCP Server** exposing **9 structured tools** (including `inkbone_style_profile` & `inkbone_export`), **8 stage prompts** (`inkbone/beat-planner`, etc. — passing `genre` auto-attaches the matching playbook), and **11 read-only craft resources** (`inkbone://playbooks/<genre>`, micro-techniques, before/after cases). See [examples/mcp-config.json](examples/mcp-config.json):
131
+
132
+ ```json
133
+ {
134
+ "mcpServers": {
135
+ "inkbone": {
136
+ "command": "npx",
137
+ "args": ["-y", "inkbone", "mcp"]
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ - For automatic post-edit chapter auditing in Claude Code, see [examples/claude-code-hooks.json](examples/claude-code-hooks.json).
144
+ - For real-time squiggly diagnostics and Quick Fixes inside **VS Code / Cursor**, see the standalone zero-dependency extension in [editors/vscode-inkbone/](editors/vscode-inkbone/).
145
+
146
+ ### Option 3: Standalone CLI
147
+
148
+ ```bash
149
+ # Run directly via npx (once published to npm) or install globally:
150
+ npx inkbone audit ch01.md --genre classical-xianxia --format md --skip-length
151
+
152
+ # Or run offline from git clone (no npm install required):
153
+ git clone https://github.com/blankym/inkbone.git
154
+ cd inkbone
155
+ node bin/inkbone.mjs --help # Daily writing, revision & publishing commands
156
+ node bin/inkbone.mjs --help-all # All 25 commands
157
+ ```
158
+
159
+ Four common starting points:
160
+
161
+ 1. **30-second chapter check & rewrite prompt (Simplified + Traditional Chinese auto-detected)**
162
+ ```bash
163
+ node bin/inkbone.mjs audit ch01.md --genre urban-realism --format md --lang en --no-project --no-ledger --skip-length
164
+ node bin/inkbone.mjs rewrite-prompt ch01.md --genre urban-realism --lang en --no-project --no-ledger --skip-length
165
+ ```
166
+ 2. **Copyright-safe style profiling + living ledger loop**
167
+ ```bash
168
+ node bin/inkbone.mjs style-profile ./ref-samples --out ./my-novel/style.json
169
+ node bin/inkbone.mjs init ./my-novel --genre classical-xianxia --title "BookTitle"
170
+ node bin/inkbone.mjs packet --ledger ./my-novel/ledger.json --chapter 4 --prev ./my-novel/ch03.md
171
+ node bin/inkbone.mjs settle --ledger ./my-novel/ledger.json --patch ./my-novel/ch04-settlement.json
172
+ node bin/inkbone.mjs check-ledger ./my-novel/ledger.json --current 4
173
+ ```
174
+ 3. **Incremental long-form checkup (`--chapters` / `--changed`)**
175
+ ```bash
176
+ node bin/inkbone.mjs import-ledger ./my-novel/chapters --auto-characters --out ./my-novel/ledger.json --title "BookTitle"
177
+ node bin/inkbone.mjs doctor ./my-novel/chapters --chapters 40-45 --lang en
178
+ node bin/inkbone.mjs doctor ./my-novel/chapters --changed --lang en
179
+ ```
180
+ 4. **Export clean chapters for Chinese web-fiction platforms (`qidian`, `fanqie`, `qimao`, `jjwxc`)**
181
+ ```bash
182
+ node bin/inkbone.mjs export ./my-novel/chapters --platform qidian --out ./dist/qidian --merge-out ./dist/vol1.txt
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Workflow & Core Checks
188
+
189
+ The `prompts/` directory defines seven stages (`00`–`06`), with the CLI checking between stages:
190
+
191
+ 1. **Register contract (`00-style-architect.md`)**: derives the book's genre pack, three-tier character voice matrix, and banned terms into `novel.json`.
192
+ 2. **Beat plan (`01-beat-planner.md`)**: pulls context via `packet`, lays out information placement and scene beats, and pauses for author sign-off before drafting. `check-outline` verifies beat sheets against `[待补充]` placeholders and required dramatic elements.
193
+ 3. **Drafting (`02-paratactic-renderer.md`)**: continues directly from the end of the prior chapter without copying beat-sheet prose verbatim.
194
+ 4. **Local audit (`audit` / `doctor`)**: reports blocking errors and line-level warnings.
195
+ 5. **Grounded review (`04`, `05` + `verify-review` / `review-save`)**:
196
+ - `04-evidence-reviewer.md` checks plot continuity, timelines, physical logic, and character motivation.
197
+ - `05-reader-simulator.md` runs two passes: a cold reader with zero lore background, and a genre veteran scanning for drag or register slips.
198
+ - `verify-review` rejects any review item whose quote cannot be found verbatim in the chapter or whose feedback tries to meddle with prose aesthetics ("add sensory adjectives").
199
+ 6. **Targeted revision (`03-targeted-rewriter.md`)**: edits only verified review items and flagged lines, then re-audits.
200
+ 7. **Post-freeze scan (`detect`, optional)**: records one Zhuque AIGC scan after the chapter is locked.
201
+
202
+ ### What it checks
203
+
204
+ | Area | Examples | Default level |
205
+ | :--- | :--- | :--- |
206
+ | Ledger continuity | Missing required anchors, premature spoilers before `revealChapter`, deprecated terms, opening echoing the prior ending | `error` (fails check) |
207
+ | Format & length claims | Markdown asterisks, inline ledger notes like `(余13滴)`, mismatched quote-length claims | `error` (fails check) |
208
+ | Model degeneration | Verbatim line/sentence loops, truncated endings, garbled characters, AI refusal/meta-leakage | `error` / `warning` |
209
+ | Subject continuity | Subjectless action right after another character's action; three consecutive paragraphs opening the same way | `warning` |
210
+ | Genre register | Modern slang in period settings, invalid traditional time counts, archaic phrasing in urban fiction | `warning` (escalates on high density) |
211
+ | Clichés & density | Stock micro-acting phrases, symmetric skeletons, excessive similes/exclamation marks/ellipses, telegraphic over-compression guard | `warning` (escalates on high density) |
212
+ | Statistical fingerprint | 20+ metrics (MATTR-50, sentence-length CV, `的`-modifier density) compared against human reference ranges | `info` (diagnostic only) |
213
+
214
+ Warnings exit `0` so authors review them in context; hard errors and high-frequency blocking violations exit non-zero for CI. Pass `--strict` to fail on all gates.
215
+
216
+ ### Three-layer rules
217
+
218
+ `audit` and `doctor` walk upward from chapter files to find `novel.json` and merge three rule layers:
219
+
220
+ 1. **Universal (`configs/`)**: clichés, filler phrases, dialogue punctuation, and syntax checks that apply across genres.
221
+ 2. **Genre (`configs/genres.json`)**: 9 built-in genre packs catching cross-genre leakage.
222
+ 3. **Project (`novel.json` + `.inkbone-whitelist`)**: book-specific vocabulary, banned patterns, literal whitelists, and `disabledRuleIds` to turn off any inherited rule you intentionally break.
223
+
224
+ Before promoting a rule above the project layer, run `rule-stats --human <human-corpus> --ai <ai-drafts>` to check how often human authors write the same pattern. Patterns common in human prose are stylistic choices and stay in project rules.
225
+
226
+ ---
227
+
228
+ ## Built-in Fiction Craft & Revision Library (`resources/`)
229
+
230
+ Beyond mechanical linting, InkBone ships practical plotting and editing handbooks distilled from classic fiction breakdowns and web-novel editorial standards (loaded on demand per stage so prompts stay lean):
231
+
232
+ - **[Micro-Techniques & Revision Lookup (`resources/micro_techniques.md`)](resources/micro_techniques.md)**: concrete execution formulas covering action-reaction "two-press, one-lift" beats, 80/20 climax framing (80% physical fallout and bystander benchmarks, 20% lethal strike), multi-purpose foreshadowing and pre-map-switch anchoring, post-climax three-part loot settlements, anti-bloat pacing rules, and a 9-symptom troubleshooting table.
233
+ - **[8 Before/After Case Studies (`resources/bad_vs_good_cases.md`)](resources/bad_vs_good_cases.md)**: side-by-side rewrites showing how to cut multi-step micro-action bloat, apply late-in/early-out dialogue, weave worldbuilding stakes into concrete characters, and avoid over-trimming into telegraphic prose.
234
+ - **[9 Genre Playbooks (`resources/genre_playbooks/`)](resources/genre_playbooks/)**: dedicated playbooks for xianxia, historical court, wuxia, mystery/thriller, urban realism, sci-fi wasteland, light fantasy, romance, and clean general fiction covering core tension drivers, stale trope traps, physical props, and chapter hooks.
235
+
236
+ ---
237
+
238
+ ## Genre Packs & Command Reference
239
+
240
+ <details>
241
+ <summary>9 built-in genre packs (run <code>node bin/inkbone.mjs genres</code> to inspect)</summary>
242
+
243
+ - `classical-xianxia`: classical cultivation and xianxia
244
+ - `historical-court`: historical intrigue and period drama
245
+ - `wuxia-jianghu`: traditional martial-arts fiction
246
+ - `mystery-thriller`: crime, folklore horror, and rule-based suspense
247
+ - `urban-realism`: contemporary urban, workplace, and realistic drama
248
+ - `scifi-wasteland`: sci-fi, cyberpunk, and post-apocalyptic survival
249
+ - `light-fantasy`: brisk light-novel / system comedy
250
+ - `romance-emotional`: historical and contemporary romance
251
+ - `general-clean`: neutral cross-genre baseline
252
+
253
+ </details>
254
+
255
+ | Group | Command | Purpose |
256
+ | :--- | :--- | :--- |
257
+ | Living ledger | `genres` | List all 9 built-in genre packs and default presets |
258
+ | | `init` | Scaffold `novel.json` and `ledger.json` in a project directory |
259
+ | | `import-ledger` | Scan existing chapters, heuristically mine candidate character names, and merge ledger non-destructively |
260
+ | | `packet` | Compile next-chapter context with un-revealed `fullTruth` hidden, closed foreshadowing filtered, and optional snapshot pruning |
261
+ | | `check-ledger` | Validate ledger health (duplicate/missing chapters, invalid reveal order, empty roster, overdue foreshadowing) |
262
+ | | `settle` | Non-destructively merge post-chapter settlement JSON into `ledger.json` with diff and health check |
263
+ | Format & QA | `normalize` | Deterministically clean bold/italic asterisks, dividers, and malformed ellipses/dashes |
264
+ | | `check-outline` | Check Stage 1 beat outlines for `[待补充]` placeholders and missing dramatic facets |
265
+ | | `audit` | Audit a single chapter (supports `--format md`, `--variant auto\|zh-hans\|zh-hant`, deceased-character guard) |
266
+ | | `doctor` | Full or incremental directory checkup (`--chapters 40-45` / `--changed`, preserving boundary echo checks) |
267
+ | | `rewrite-prompt` | Audit a chapter and emit a copy-ready targeted rewrite prompt for web LLMs |
268
+ | Style & publish | `style-profile` | Copyright-safe statistical style profile, nearest preset match & `customGates` generator |
269
+ | | `export` | Clean Markdown & format chapters for `qidian`, `fanqie`, `qimao`, or `jjwxc` (single files or merged volume) |
270
+ | Protocol | `mcp` | Start the zero-dependency stdio MCP server (9 tools, 8 prompts, 11 resources) |
271
+ | Review & blind eval | `verify-review` | Verify that review quotes exist verbatim in the chapter and reject style meddling |
272
+ | | `review-save` | Verify and archive a review JSON with chapter SHA-256 and reviewer/writer model metadata |
273
+ | | `review-stats` | Compare issue counts and skip points across saved review revisions |
274
+ | | `eval-pack` | Build an anonymized X/Y blind reading packet alongside a private `key.json` |
275
+ | | `eval-score` | Tally blind reader ballots with win rates, sign-test p-values, and skip-quote verification |
276
+ | Calibration & logs | `profile` | Compute 20+ linguistic fingerprint metrics for a chapter |
277
+ | | `calibrate` | Generate statistics-only p10/median/p90 reference ranges from a human corpus |
278
+ | | `rule-stats` | Measure per-rule hit rates per 10k characters across human vs. AI texts |
279
+ | | `mine` | Extract 3/4-gram phrases overused in AI drafts compared to human prose |
280
+ | | `detect` | Run a single cached Zhuque AIGC scan (requires `.env` API key), record-only |
281
+ | | `benchmark` | Compare corpus metrics against manifest entries |
282
+
283
+ Run `node bin/inkbone.mjs --help` for daily commands, or `--help-all` for all 25 commands.
284
+
285
+ ---
286
+
287
+ ## Layout & Development
288
+
289
+ ```text
290
+ bin/ src/ CLI, zero-dependency core engine (style profiler, exporter, Browser Doctor) & full MCP server
291
+ configs/ Universal rules, 9 genre packs, Traditional Chinese layer, 4 platform presets, gates & zh/en catalog
292
+ docs/ Browser-only static playground & multi-chapter Browser Doctor
293
+ editors/ Standalone zero-dependency VS Code / Cursor real-time linter extension
294
+ examples/ MCP client config & Claude Code PostToolUse Hook templates
295
+ prompts/ 8 staged drafting, review & settlement prompts (00–07)
296
+ resources/ Before/after examples, micro-techniques, 9 genre playbooks, eval guide
297
+ benchmarks/ 4 original eval seeds, public eval pairs & reproducible comparison report (no private drafts)
298
+ evals/ Runtime-agnostic skill trigger eval set
299
+ skills/inkbone/ Generated self-contained skill package (do not edit directly)
300
+ tests/ 66 unit tests
301
+ ```
302
+
303
+ ```bash
304
+ npm test # Run all 66 tests (zero-Han-literal, full MCP, zh-hant, VS Code core, docs & skill sync)
305
+ npm run build:skill # Repackage skills/inkbone after editing bin/src/configs/prompts/resources
306
+ npm run check:skill # Verify skills/inkbone matches sources (enforced in CI)
307
+ npm run build:docs # Sync browser playground docs/vendor after editing src/core or configs
308
+ npm run check:docs # Verify docs/vendor matches sources (enforced in CI)
309
+ ```
310
+
311
+ ## Acknowledgments & License
312
+
313
+ - Chapter boundary isolation and verbatim-quote review checks inspired by [EthanYoQ/Pagekin](https://github.com/EthanYoQ/Pagekin)
314
+ - Chinese clause-trunk and symmetric-frame checks inspired by [LifelongLazyLearner/qu-ai-wei](https://github.com/LifelongLazyLearner/qu-ai-wei)
315
+ - Rhetorical density grading, degeneration detection, and meta-leak checks inspired by [zenstory-ai/oh-story-claudecode](https://github.com/zenstory-ai/oh-story-claudecode)
316
+ - Community & feedback: [GitHub Discussions](https://github.com/blankym/inkbone/discussions) · [Report False Positive / Propose Rule](https://github.com/blankym/inkbone/issues/new/choose) · [LINUX DO](https://linux.do/)
317
+
318
+ Released under the [MIT License](LICENSE), including all rule configurations.