oh-my-patent 0.3.1 → 0.3.3

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 (170) hide show
  1. package/README.md +75 -352
  2. package/README.zh-CN.md +69 -459
  3. package/assets/brand/README.md +79 -26
  4. package/assets/brand/png/logo-on-dark.png +0 -0
  5. package/dist/adapters/claude/index.d.ts +26 -9
  6. package/dist/adapters/claude/index.js +119 -38
  7. package/dist/adapters/claude/index.js.map +1 -1
  8. package/dist/adapters/claude/mcp-config.d.ts +2 -0
  9. package/dist/adapters/claude/mcp-config.js +15 -0
  10. package/dist/adapters/claude/mcp-config.js.map +1 -0
  11. package/dist/adapters/codex/index.d.ts +29 -7
  12. package/dist/adapters/codex/index.js +94 -23
  13. package/dist/adapters/codex/index.js.map +1 -1
  14. package/dist/adapters/codex/marketplace.d.ts +4 -0
  15. package/dist/adapters/codex/marketplace.js +34 -0
  16. package/dist/adapters/codex/marketplace.js.map +1 -0
  17. package/dist/adapters/generate.js +19 -3
  18. package/dist/adapters/generate.js.map +1 -1
  19. package/dist/adapters/generated-marker.d.ts +30 -0
  20. package/dist/adapters/generated-marker.js +44 -0
  21. package/dist/adapters/generated-marker.js.map +1 -0
  22. package/dist/adapters/loader.d.ts +21 -0
  23. package/dist/adapters/loader.js +185 -92
  24. package/dist/adapters/loader.js.map +1 -1
  25. package/dist/adapters/opencode/index.d.ts +15 -7
  26. package/dist/adapters/opencode/index.js +34 -6
  27. package/dist/adapters/opencode/index.js.map +1 -1
  28. package/dist/adapters/prune.d.ts +45 -0
  29. package/dist/adapters/prune.js +145 -0
  30. package/dist/adapters/prune.js.map +1 -0
  31. package/dist/adapters/run-generate.d.ts +38 -0
  32. package/dist/adapters/run-generate.js +73 -0
  33. package/dist/adapters/run-generate.js.map +1 -0
  34. package/dist/adapters/types.d.ts +27 -7
  35. package/dist/cli.js +235 -121
  36. package/dist/cli.js.map +1 -1
  37. package/dist/commands/path-branch.d.ts +2 -0
  38. package/dist/commands/path-branch.js +135 -35
  39. package/dist/commands/path-branch.js.map +1 -1
  40. package/dist/commands/path-query.js +5 -1
  41. package/dist/commands/path-query.js.map +1 -1
  42. package/dist/commands/path-restore.js +7 -0
  43. package/dist/commands/path-restore.js.map +1 -1
  44. package/dist/commands/path-visualization.js +5 -4
  45. package/dist/commands/path-visualization.js.map +1 -1
  46. package/dist/commands/render.d.ts +8 -0
  47. package/dist/commands/render.js +79 -3
  48. package/dist/commands/render.js.map +1 -1
  49. package/dist/commands/shared.d.ts +6 -1
  50. package/dist/commands/shared.js +14 -2
  51. package/dist/commands/shared.js.map +1 -1
  52. package/dist/core/atomic-write.d.ts +46 -0
  53. package/dist/core/atomic-write.js +63 -0
  54. package/dist/core/atomic-write.js.map +1 -0
  55. package/dist/core/brainstorm-path.d.ts +27 -0
  56. package/dist/core/brainstorm-path.js +80 -3
  57. package/dist/core/brainstorm-path.js.map +1 -1
  58. package/dist/core/cli-args.d.ts +5 -0
  59. package/dist/core/cli-args.js +27 -0
  60. package/dist/core/cli-args.js.map +1 -0
  61. package/dist/core/diagram-inserter.js +3 -1
  62. package/dist/core/diagram-inserter.js.map +1 -1
  63. package/dist/core/diagram-renderer.d.ts +29 -0
  64. package/dist/core/diagram-renderer.js +255 -67
  65. package/dist/core/diagram-renderer.js.map +1 -1
  66. package/dist/core/diagram-types.d.ts +32 -1
  67. package/dist/core/diagram-types.js +36 -1
  68. package/dist/core/diagram-types.js.map +1 -1
  69. package/dist/core/init-checker.d.ts +10 -2
  70. package/dist/core/init-checker.js +92 -57
  71. package/dist/core/init-checker.js.map +1 -1
  72. package/dist/core/jsonc.d.ts +18 -0
  73. package/dist/core/jsonc.js +64 -0
  74. package/dist/core/jsonc.js.map +1 -0
  75. package/dist/core/landscape-schema.js +43 -4
  76. package/dist/core/landscape-schema.js.map +1 -1
  77. package/dist/core/path-constants.d.ts +35 -0
  78. package/dist/core/path-constants.js +36 -0
  79. package/dist/core/path-constants.js.map +1 -0
  80. package/dist/core/path-graph.d.ts +10 -0
  81. package/dist/core/path-graph.js +68 -21
  82. package/dist/core/path-graph.js.map +1 -1
  83. package/dist/core/path-persistence.js +11 -8
  84. package/dist/core/path-persistence.js.map +1 -1
  85. package/dist/core/path-safety.d.ts +40 -0
  86. package/dist/core/path-safety.js +103 -0
  87. package/dist/core/path-safety.js.map +1 -0
  88. package/dist/core/router.d.ts +1 -0
  89. package/dist/core/router.js +20 -12
  90. package/dist/core/router.js.map +1 -1
  91. package/dist/core/state-manager.d.ts +1 -0
  92. package/dist/core/state-manager.js +28 -22
  93. package/dist/core/state-manager.js.map +1 -1
  94. package/dist/core/state.d.ts +15 -3
  95. package/dist/core/state.js +25 -18
  96. package/dist/core/state.js.map +1 -1
  97. package/dist/core/threshold-config.d.ts +7 -1
  98. package/dist/core/threshold-config.js +14 -6
  99. package/dist/core/threshold-config.js.map +1 -1
  100. package/dist/core/validator.js +4 -1
  101. package/dist/core/validator.js.map +1 -1
  102. package/dist/core/workflow-stages.d.ts +61 -0
  103. package/dist/core/workflow-stages.js +60 -0
  104. package/dist/core/workflow-stages.js.map +1 -0
  105. package/dist/core/workflow.d.ts +4 -13
  106. package/dist/core/workflow.js +15 -32
  107. package/dist/core/workflow.js.map +1 -1
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.js +1 -1
  110. package/dist/index.js.map +1 -1
  111. package/dist/skills/jurisdiction.d.ts +14 -0
  112. package/dist/skills/jurisdiction.js +16 -0
  113. package/dist/skills/jurisdiction.js.map +1 -1
  114. package/dist/tui/app.d.ts +8 -0
  115. package/dist/tui/app.js +136 -93
  116. package/dist/tui/app.js.map +1 -1
  117. package/opencode.jsonc.example +116 -0
  118. package/package.json +18 -6
  119. package/plugin.jsonc +1 -1
  120. package/src/adapters/claude/index.ts +119 -37
  121. package/src/adapters/claude/mcp-config.ts +14 -0
  122. package/src/adapters/codex/index.ts +98 -25
  123. package/src/adapters/codex/marketplace.ts +37 -0
  124. package/src/adapters/generate.ts +17 -3
  125. package/src/adapters/generated-marker.ts +48 -0
  126. package/src/adapters/loader.ts +186 -94
  127. package/src/adapters/opencode/index.ts +36 -7
  128. package/src/adapters/prune.ts +162 -0
  129. package/src/adapters/run-generate.ts +111 -0
  130. package/src/adapters/types.ts +29 -2
  131. package/src/agents/archimedes.md +43 -24
  132. package/src/agents/patent-diagram-generator.md +7 -5
  133. package/src/agents/patent-init-sentinel.md +10 -1
  134. package/src/agents/patent-path-recorder.md +14 -5
  135. package/src/agents/patent-product-compliance-analyst.md +7 -0
  136. package/src/agents/patent-security-engineer.md +7 -0
  137. package/src/cli.ts +229 -123
  138. package/src/commands/archimedes.md +4 -1
  139. package/src/commands/path-branch.ts +150 -38
  140. package/src/commands/path-query.ts +5 -1
  141. package/src/commands/path-restore.ts +9 -0
  142. package/src/commands/path-visualization.ts +5 -4
  143. package/src/commands/render.ts +81 -3
  144. package/src/commands/shared.ts +14 -2
  145. package/src/core/atomic-write.ts +85 -0
  146. package/src/core/brainstorm-path.ts +114 -8
  147. package/src/core/cli-args.ts +27 -0
  148. package/src/core/diagram-inserter.ts +3 -1
  149. package/src/core/diagram-renderer.ts +292 -68
  150. package/src/core/diagram-types.ts +51 -2
  151. package/src/core/init-checker.ts +119 -54
  152. package/src/core/jsonc.ts +60 -0
  153. package/src/core/landscape-schema.ts +50 -4
  154. package/src/core/path-constants.ts +41 -0
  155. package/src/core/path-graph.ts +68 -24
  156. package/src/core/path-persistence.ts +15 -8
  157. package/src/core/path-safety.ts +107 -0
  158. package/src/core/router.ts +22 -7
  159. package/src/core/state-manager.ts +30 -24
  160. package/src/core/state.ts +54 -22
  161. package/src/core/threshold-config.ts +21 -7
  162. package/src/core/validator.ts +5 -1
  163. package/src/core/workflow-stages.ts +71 -0
  164. package/src/core/workflow.ts +23 -34
  165. package/src/index.ts +1 -1
  166. package/src/skills/jurisdiction/SKILL.md +131 -52
  167. package/src/skills/jurisdiction.ts +19 -0
  168. package/src/skills/prior-art-search/SKILL.md +4 -1
  169. package/src/tui/app.tsx +60 -14
  170. package/assets/brand/README-snippet.md +0 -5
package/README.md CHANGED
@@ -1,396 +1,119 @@
1
+ # oh-my-patent
2
+
1
3
  [![npm version](https://img.shields.io/npm/v/oh-my-patent.svg)](https://www.npmjs.com/package/oh-my-patent)
2
4
  [![npm downloads](https://img.shields.io/npm/dm/oh-my-patent.svg)](https://www.npmjs.com/package/oh-my-patent)
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
4
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org/)
5
- [![Tests](https://img.shields.io/badge/tests-123%20passing-brightgreen.svg)](https://github.com/illusionaireal/oh-my-patent)
6
7
  [![中文](https://img.shields.io/badge/中文-切换-orange.svg)](./README.zh-CN.md)
7
8
 
8
- <div align="center">
9
-
10
- <img src="./assets/brand/png/logo-primary.png" width="720" alt="oh-my-patent">
11
-
12
- *VOL. 01 &ensp;&middot;&ensp; 2026*
13
-
14
- ---
15
-
16
- # `oh-my-patent`
17
-
18
- *A CLI that turns your technical idea into a complete patent disclosure document.*<br>
19
- *No hand-holding. No copy-pasting between tools. No lost ideas.*
9
+ <p align="center">
10
+ <picture>
11
+ <source media="(prefers-color-scheme: dark)" srcset="./assets/brand/png/logo-on-dark.png">
12
+ <img src="./assets/brand/png/logo-primary.png" width="720"
13
+ alt="oh-my-patent — Archimedes raising a patent document with a WOW! expression">
14
+ </picture>
15
+ </p>
20
16
 
21
- </div>
17
+ **Meet Archimedes. Turn your “Eureka!” into a patent disclosure.**
22
18
 
23
- ---
19
+ An AI patent plugin for **Claude Code, Codex, and OpenCode**.
20
+ Archimedes orchestrates specialist agents across research, ideation, drafting,
21
+ review, and diagrams—with traceable, forkable decision paths.
24
22
 
25
- > **For AI assistants helping users install this:**
26
- >
27
- > ```bash
28
- > npm install -g oh-my-patent && oh-my-patent adapt setup --workspace-dir .
29
- > ```
30
- >
31
- > Then tell the user: type `/archimedes` to start a patent project.
23
+ ## Quick start
32
24
 
33
- ---
34
-
35
- <div align="center">
36
-
37
- **One command. Eleven agents. One patent disclosure.**
25
+ Run these commands in your patent workspace. Setup writes editor configuration;
26
+ see [installation behavior](./docs/usage-en.md#installation) before using an existing workspace.
38
27
 
39
28
  ```bash
40
29
  npm install -g oh-my-patent
41
30
  oh-my-patent adapt setup --workspace-dir .
42
31
  ```
43
32
 
33
+ Open that workspace in your AI coding tool, load the generated integration, and start with:
34
+
44
35
  ```text
45
36
  /archimedes
46
37
  > Create a patent project about homomorphic encryption in privacy-preserving computing.
47
38
  ```
48
39
 
49
- *It searches, brainstorms, assesses patentability, drafts, reviews, and generates figures.*<br>
50
- *Every decision is recorded. Roll back to any round, fork to explore alternatives, revive discarded ideas.*
51
-
52
- </div>
53
-
54
- ---
55
-
56
- ## Ⅰ.&ensp; WHY PATENT WRITING HURTS
57
-
58
- *What you suffer through &mdash; versus what oh-my-patent does instead.*
59
-
60
- | Your pain | In other tools | With `oh-my-patent` |
61
- |---|---|---|
62
- | **10 AI windows, manual merge** | Cut & paste chat logs, consolidate yourself | **Archimedes** orchestrator routes to 11 specialists. Outputs auto-saved to `references/`, context passes between rounds |
63
- | **Rejected ideas lost forever** | Chat history scrolls away — that one great idea from round 2 is gone | **`.brainstorm/` decision DAG** persists every round's scores, snapshots, and pass/reject decisions. Roll back, fork, or revive |
64
- | **Visio → screenshot → Word** | Draw by hand, export, reformat, lose the source file | **Mermaid/PlantUML rendering** extracts architecture from `MAIN.md`, renders SVG+PNG, and auto-rewrites figure references |
65
- | **Per-editor, per-teammate config** | Claude Code settings. Codex settings. OpenCode settings. Separate. Manual. Every time. | **`oh-my-patent adapt setup`** — one command generates configs for all supported editors. Uninstall is one command, removing *only* what we generated |
66
- | **Crash mid-project = start over** | Scramble through screenshots, guess where you left off | **Workflow state machine** — all stages written to `state.json`, decision tree in `path.json`. Resume from the exact point of failure |
67
- | **6 rounds in, no idea what "done" is** | A mess of loose documents | **Quantitative threshold model** auto-decides if brainstorming is mature. QA loop exits on 2 consecutive rounds with zero new issues |
68
-
69
- ---
70
-
71
- ## Ⅱ.&ensp; CORE CAPABILITIES
72
-
73
- *Eight things it does so you don't have to.*
74
-
75
- | | |
76
- |---|---|
77
- | 🧠 **Decision-path tracking**<br>`.brainstorm/` records every round's scores, innovations, and decisions as an auditable DAG. Roll back to any node, fork alternatives, revive abandoned ideas. | 🤖 **11-agent end-to-end pipeline**<br>Search → ideation → patentability → draft → review → diagrams. The full patent lifecycle, zero hand-holding between stages. |
78
- | ⚡ **`/archimedes` one-liner**<br>Start every task with Archimedes. He reads your state, routes to specialists, waits for output, and advances to the next stage. | 🔗 **Zero-config adapters**<br>`oh-my-patent adapt setup` generates configs for Claude Code, Codex, and OpenCode simultaneously. One command, all editors. |
79
- | 🛡️ **Safe uninstall**<br>Exact-file removal — only deletes what we auto-generated. No `readdir + unlink` traversing your workspace. Your custom edits are safe. | 📊 **Auto figure rendering**<br>Parses `MAIN.md` for technical architecture, renders Mermaid/PlantUML to SVG+PNG, and auto-rewrites figure references in-place. |
80
- | 🎯 **Scoring thresholds & QA loops**<br>Quantitative model judges if brainstorming is mature. Up to 6 QA rounds, exiting when 2 consecutive rounds produce zero new issues. | 🔄 **Resumable state machine**<br>`INIT → RESEARCH → BRAINSTORM → DRAFT → QA_LOOP → FINAL_REVIEW → DIAGRAM → DONE`. Crashes are non-destructive. Resume from `state.json`. |
81
-
82
- ---
83
-
84
- ## Ⅲ.&ensp; THE WORKFLOW
85
-
86
- *From idea to disclosure &mdash; 10 stages, 1 state machine.*
87
-
88
- ![End-to-End Workflow](docs/images/ai-gen/00-workflow.png)
89
-
90
- ```
91
- User proposes a topic
92
- │
93
- 01 │ INIT Generate projects/{NN}-{topic_slug}/
94
- │ Initialize .patent/state.json + .brainstorm/path.json
95
- │
96
- 02 │ RESEARCH Patent search by landscape-analyst
97
- │ → references/landscape.md, feature-matrix.md, problem-map.md
98
- │
99
- 03 │ BRAINSTORM_R1 Head-to-head debate
100
- │ innovation-architect generates candidates (TRIZ)
101
- │ adversarial-examiner attacks them (examiner perspective)
102
- │ brainstorm-moderator arbitrates & scores
103
- │
104
- 04 │ BRAINSTORM_R2 Parallel multi-dimensional evaluation
105
- │ security-engineer + compliance-analyst + patentability-evaluator
106
- │ Weighted score: S = 0.3·S_sec + 0.3·S_comp + 0.4·S_pat
107
- │ Threshold: S ≥ 8.5 and every dimension ≥ 6.0
108
- │ ←── threshold fail loops back to BRAINSTORM_R1
109
- 05 │ DRAFT Generate initial disclosure
110
- │ → MAIN.md (by disclosure-writer)
111
- │
112
- 06 │ DIAGRAM_DRAFT Render draft figures
113
- │ diagram-generator: Mermaid/PlantUML → SVG+PNG
114
- │
115
- 07 │ QA_LOOP Bounded argue-loop
116
- │ Reviewer raises issues → technical-responder writes patches
117
- │ Exit: 2 consecutive rounds with zero new issues
118
- │ ←── issues found loops back to DRAFT
119
- 08 │ FINAL_REVIEW Final pass
120
- │ ←── can loop back to QA_LOOP if needed
121
- 09 │ DIAGRAM_FINAL Re-render figures after final revisions
122
- │ Auto-updates figure references in MAIN.md
123
- │
124
- 10 │ DONE Quality gate check → finished
125
- ```
126
-
127
- > **Crash recovery**: reads `state.json` → resumes from the exact stage.<br>
128
- > **Regret a round?** `path branch --from-node round-{N}` → explore an alternative.<br>
129
- > **Long-forgotten idea was actually good?** `path restore` → bring it back.
130
-
131
- ---
132
-
133
- ## Ⅳ.&ensp; THE AGENTS
134
-
135
- *11 specialists, 5 collaboration patterns.*
136
-
137
- ### The agents at a glance
138
-
139
- | Agent | Role | Invoked in |
140
- |---|---|---|
141
- | `archimedes` | Primary orchestrator, state-machine dispatcher | Every stage |
142
- | `landscape-analyst` | Prior-art search, technology landscape | RESEARCH |
143
- | `innovation-architect` | TRIZ-based candidate generation | BRAINSTORM_R1 |
144
- | `adversarial-examiner` | Examiner-perspective invalidation attacks | R1, QA_LOOP |
145
- | `patentability-evaluator` | Novelty / creativity / utility scoring | BRAINSTORM_R2 |
146
- | `security-engineer` | Vulnerability & side-channel analysis | R2, QA_LOOP |
147
- | `compliance-analyst` | Regulatory & privacy compliance | R2 |
148
- | `brainstorm-moderator` | Aggregation, scoring, threshold decisions | R1, R2 |
149
- | `path-recorder` | Persist rounds, branches, snapshots | Every round end |
150
- | `disclosure-writer` | Generate `MAIN.md` disclosure | DRAFT |
151
- | `disclosure-reviewer` | Writing & legal compliance review | QA_LOOP, FINAL_REVIEW |
152
- | `technical-responder` | Issue-by-issue rebuttal + MAIN.md patches | QA_LOOP |
153
- | `diagram-generator` | Mermaid/PlantUML → SVG+PNG, MAIN.md rewrites | DIAGRAM_DRAFT, DIAGRAM_FINAL |
154
-
155
- ### How they collaborate
156
-
157
- The agents are wired into five distinct patterns, not a flat queue.
158
-
159
- #### Pattern 1 — Orchestration Routing
160
-
161
- `archimedes` reads `state.json`, dispatches to the right specialist based on `current_stage`, persists the result, advances the stage. The state machine is the source of truth &mdash; Archimedes is just the dispatcher.
162
-
163
- - **Threshold gate**: `passToDraft ≥ 8.5`, `novelty ≥ 6.0`, `creativity ≥ 6.0`. Fail → loop back to `BRAINSTORM_R1`. Force-iterate after `maxRounds: 3` with `minImprovement: 0.3`.
164
- - **Persistence**: every transition is atomic (temp file + rename). `state.json` for workflow, `path.json` for decisions, `references/` for agent outputs.
165
-
166
- #### Pattern 2 — Adversarial Brainstorming (R1)
167
-
168
- ![Adversarial brainstorming](docs/images/ai-gen/图2.png)
169
-
170
- `innovation-architect` generates candidates (TRIZ). `adversarial-examiner` attacks from an examiner's perspective. `brainstorm-moderator` arbitrates and scores. `path-recorder` snapshots the round. Output: innovation IDs + scores + `ACCEPT` / `ITERATE` / `REJECT`.
171
-
172
- #### Pattern 3 — Parallel Multi-Dimensional Evaluation (R2)
173
-
174
- ![Parallel evaluation](docs/images/ai-gen/图3.png)
175
-
176
- Fan-out / fan-in. Archimedes dispatches survivors to three evaluators in parallel:
177
-
178
- | Evaluator | Dimension | Score |
179
- |---|---|---|
180
- | `security-engineer` | Vulnerabilities, side-channel risks | `S_sec` |
181
- | `compliance-analyst` | Regulatory, privacy | `S_comp` |
182
- | `patentability-evaluator` | Novelty, creativity, utility | `S_pat` |
183
-
184
- `brainstorm-moderator` aggregates: `S = 0.3·S_sec + 0.3·S_comp + 0.4·S_pat`. Passes only if `S ≥ 8.5` and every dimension clears its red-line (`≥ 6.0`).
185
-
186
- #### Pattern 4 — QA Argue Loop
187
-
188
- ![QA argue loop](docs/images/ai-gen/图4.png)
189
-
190
- Bounded loop with quantitative exit. Three reviewers raise issues; `technical-responder` writes revisions with explicit MAIN.md patch locations. Exit requires **2 consecutive rounds with 0 new issues**.
40
+ Use `--tool claude-code`, `--tool codex`, or `--tool opencode` to configure one
41
+ platform. Without `--tool`, setup targets all three. See the
42
+ [platform notes](./docs/usage-en.md#platform-notes) if the entry point is unavailable.
191
43
 
192
- #### Pattern 5 — Decision Path DAG
44
+ <details>
45
+ <summary>For AI assistants helping users install this</summary>
193
46
 
194
- ![Decision path DAG](docs/images/ai-gen/图5.png)
195
-
196
- Every round is a node in a DAG under `.brainstorm/`. Two operations on top of the linear path:
197
-
198
- - **`path branch --from-node <id>`** &mdash; fork from any historical node
199
- - **`path restore --node <id> --innovation <id>`** &mdash; revive an abandoned innovation
200
-
201
- ---
202
-
203
- ## Ⅴ.&ensp; INSTALL & UNINSTALL
204
-
205
- ### Install
47
+ Choose the user's patent workspace, review the installation behavior above, and run:
206
48
 
207
49
  ```bash
208
- # Step 1 — install the CLI globally
209
50
  npm install -g oh-my-patent
210
-
211
- # Step 2 — generate editor configs
212
- cd your-patent-projects
213
51
  oh-my-patent adapt setup --workspace-dir .
52
+ oh-my-patent check --workspace-dir .
214
53
  ```
215
54
 
216
- This generates configs for **Claude Code** (`.claude/` + `CLAUDE.md`), **Codex** (`.codex/` + `AGENTS.md` + `codex.json`), and **OpenCode** (`.opencode/agent/`, `.opencode/command/`, and `.opencode/skills/`). After this, use `/archimedes` in your editor.
217
-
218
- ```bash
219
- # Options: generate for one editor only
220
- oh-my-patent adapt setup --tool claude-code --workspace-dir .
221
- oh-my-patent adapt setup --tool codex --workspace-dir .
222
- oh-my-patent adapt setup --tool opencode --workspace-dir .
223
-
224
- # Aliases
225
- oh-my-patent adapt install # same as setup
226
- oh-my-patent adapt generate # write to plugins/<tool>/ only, don't touch workspace
227
- ```
228
-
229
- ### Uninstall
230
-
231
- ```bash
232
- # Remove editor configs, keep the CLI
233
- cd your-patent-projects
234
- oh-my-patent adapt uninstall --workspace-dir .
235
- ```
55
+ Then help the user load the integration and start a project with `/archimedes`.
236
56
 
237
- **Safety guarantees:**
238
- - Exact-file removal only &mdash; precise paths, never traverses directories
239
- - Your custom edits to configs are safe &mdash; we only delete what we generated
240
- - Empty directory cleanup after removing all generated files
57
+ </details>
241
58
 
242
- ```bash
243
- # Complete removal (editor configs + CLI)
244
- oh-my-patent adapt uninstall --workspace-dir .
245
- npm uninstall -g oh-my-patent
246
- ```
59
+ ## What you can do
247
60
 
248
- > *Post-uninstall: your patent project data (`projects/`, `.brainstorm/`, `references/`, `figures/`, `MAIN.md`) is **not** deleted automatically. Run `git status` before manually removing anything.*
61
+ | Capability | What it gives you |
62
+ |---|---|
63
+ | Coordinate specialist agents | Research, ideation, patentability assessment, drafting, review, and technical responses under one orchestrator |
64
+ | Keep decisions traceable | Saved rounds, scores, innovation snapshots, and reasons in `.brainstorm/`; branch from a recorded node or restore an idea |
65
+ | Resume recorded work | Workflow state in `.patent/state.json` and agent outputs in `references/` provide context for continuing a project |
66
+ | Generate patent figures | Mermaid or PlantUML sources rendered to SVG and PNG, with figure references inserted into `MAIN.md` |
67
+ | Inspect progress | CLI queries, Markdown reports, a terminal UI, and environment checks |
249
68
 
250
- ---
69
+ The project brings the disclosure, its supporting material, and its decision history
70
+ together in one project directory. Rendering engines and retrieval services have
71
+ their own setup requirements; see the [usage guide](./docs/usage-en.md).
251
72
 
252
- ## Ⅵ.&ensp; FULL USAGE
73
+ ## From idea to disclosure
253
74
 
254
- ```
255
- oh-my-patent <domain> <subcommand> [options]
256
- ```
75
+ ![Archimedes workflow overview: prepare and research, develop and assess ideas, draft disclosure and figures, review and revise, finalize disclosure and figures; with research and drafting feedback loops](./docs/images/workflow-overview-brand-v1.png)
257
76
 
258
- ### Brainstorm path (`path`)
77
+ *Overview of the ten stages, grouped by purpose. Arrows back to research and
78
+ drafting show where further work may be needed.*
259
79
 
260
- | Subcommand | What it does |
80
+ | Step | Workflow stages |
261
81
  |---|---|
262
- | `path init <project>` | Initialize `.brainstorm/` and `state.json` |
263
- | `path record <project> --round <N> --data <json\|@file>` | Record round N with scores, decisions, snapshots |
264
- | `path overview <project>` | Summary: from start to finish, current position, done? |
265
- | `path node <project> <round-N>` | Details of a specific round |
266
- | `path innovation(s) <project> [ID]` | Full history of one innovation |
267
- | `path branch <project> --from-node <id> --reason <text>` | Fork from any historical node |
268
- | `path branches <project>` | List all branches |
269
- | `path restore <project> --node <id> --innovation <id>` | Revive an abandoned innovation |
270
- | `path threshold <project> --round <N>` | Evaluate if scores pass threshold |
271
- | `path visualize <project> [--mode ...] --target <id>` | Terminal box-drawing visualization |
272
- | `path markdown <project> [--mode ...] --target <id>` | Export a Markdown report |
273
-
274
- ### Patent diagrams (`diagram`)
82
+ | Prepare and research | `INIT` → `RESEARCH` |
83
+ | Develop and assess ideas | `BRAINSTORM_R1` → `BRAINSTORM_R2` |
84
+ | Write and illustrate | `DRAFT` → `DIAGRAM_DRAFT` |
85
+ | Review and revise | `QA_LOOP` → `FINAL_REVIEW` |
86
+ | Refresh figures and finish | `DIAGRAM_FINAL` → `DONE` |
275
87
 
276
- | Subcommand | What it does |
277
- |---|---|
278
- | `diagram render <project> --specs <json\|@file> --phase draft\|final` | Batch render SVG+PNG, auto-update MAIN.md references |
279
- | `diagram status <project>` | List rendered figures (number, phase, paths) |
280
- | `diagram rerender <project> --figure <ID> --source <mmd\|@file> --engine mermaid\|plantuml` | Update a single figure |
88
+ Review can return to earlier stages. The [workflow reference](./docs/workflow-diagram-en.md)
89
+ shows the supported transitions and explains scoring decisions separately from stage changes.
281
90
 
282
- ### Adapters (`adapt`)
91
+ ## How the team works
283
92
 
284
- | Subcommand | What it does |
93
+ | Pattern | Purpose |
285
94
  |---|---|
286
- | `adapt setup [--tool ...] [--workspace-dir .]` | Install editor configs (recommended entry) |
287
- | `adapt install` | Same as `setup` |
288
- | `adapt uninstall [--tool ...] [--workspace-dir .]` | Exact-file removal only |
289
- | `adapt generate` | Write to `plugins/<tool>/` only |
290
-
291
- ### Interactive TUI (`tui`)
292
-
293
- ```bash
294
- oh-my-patent tui [project-path]
295
- ```
296
-
297
- Ink+React terminal UI. Navigate the decision path, view scores, switch branches, revive innovations &mdash; all locally, no internet needed.
298
-
299
- ---
300
-
301
- ## Ⅶ.&ensp; ARCHITECTURE
302
-
303
- Four layers, one data flow.
304
-
305
- | Layer | What it governs | Key files |
306
- |---|---|---|
307
- | **Orchestration** | Agent / skill / command definitions | `plugin.jsonc`, `plugins/` |
308
- | **Engine** | Path tracking, state machine, diagrams, thresholds | `src/core/` |
309
- | **Command** | Unified CLI wrapping engine capabilities | `src/cli.ts`, `src/commands/` |
310
- | **Adapter** | Converts orchestration → Claude Code / Codex / OpenCode configs | `src/adapters/claude/`, `src/adapters/codex/`, `src/adapters/opencode/` |
311
-
312
- ```
313
- plugin.jsonc (orchestration definition)
314
- │
315
- [Adapters] generate
316
- │
317
- .claude/ (Claude Code) .codex/ (Codex) .opencode/ (OpenCode)
318
- CLAUDE.md AGENTS.md, codex.json agents, commands, skills
319
- │
320
- AI in your editor invokes 11 specialist agents
321
- │
322
- Output → .brainstorm/ decision-path records
323
- Output → state.json workflow state machine
324
- Output → references/ with standardized filenames
325
- Output → MAIN.md + figures/
326
- │
327
- CLI commands = automated operations on .brainstorm/ + .patent/ + references/
328
- TUI = visualized browsing of .brainstorm/
329
- ```
330
-
331
- ---
332
-
333
- ## Ⅷ.&ensp; DIRECTORY
334
-
335
- ```
336
- oh-my-patent/ # Core repo: configs and engine
337
- ├── src/
338
- │ ├── cli.ts # CLI entry
339
- │ ├── core/
340
- │ │ ├── brainstorm-path.ts # Decision-path data model + thresholds
341
- │ │ ├── path-persistence.ts # Atomic writes + rollback
342
- │ │ ├── path-graph.ts # Graph structure + fork algorithms
343
- │ │ ├── diagram-renderer.ts # Mermaid/PlantUML → SVG/PNG
344
- │ │ └── threshold-config.ts # Quantitative threshold model
345
- │ ├── commands/ # path init/record/overview/branch/restore...
346
- │ ├── adapters/
347
- │ │ ├── claude/ # → .claude/ + CLAUDE.md
348
- │ │ ├── codex/ # → .codex/ + AGENTS.md + codex.json
349
- │ │ └── opencode/ # → .opencode/ agents, commands, and skills
350
- │ └── tui/ # Ink+React interactive UI
351
- ├── plugin.jsonc
352
- └── dist/ # Compiled output
353
-
354
- projects/{NN}-{topic_slug}/ # One Git repo per patent
355
- ├── .brainstorm/
356
- │ ├── path.json # Metadata + edges + current node + final decision
357
- │ ├── nodes/
358
- │ │ └── round-{n}.json # Scores, innovations, decisions, timestamps
359
- │ ├── snapshots/ # Innovation history snapshots
360
- │ └── branches/ # Forked explorations
361
- ├── .patent/
362
- │ └── state.json # Workflow state: at DRAFT? QA round 3?
363
- ├── references/
364
- │ ├── landscape.md # Search results
365
- │ ├── brainstorm_round1_*.md # Agent outputs follow strict naming
366
- │ └── argue_round2_*.md
367
- ├── figures/
368
- │ ├── 001-system-overview.svg
369
- │ ├── 001-system-overview.png
370
- │ └── figures-manifest.json
371
- ├── MAIN.md # Final disclosure (auto-updated by diagram inserter)
372
- └── conversation.md # Chronological conversation log
373
- ```
374
-
375
- ### Scripts
376
-
377
- ```bash
378
- npm run build # Compile TypeScript → dist/
379
- npm test # Run vitest test suite (123 passing)
380
- npm run lint # tsc --noEmit type checking
381
- ```
382
-
383
- ---
384
-
385
- <div align="center">
95
+ | Orchestration | Archimedes coordinates specialists and carries project context between stages |
96
+ | Adversarial brainstorming | Candidate ideas receive examiner-style challenges before selection |
97
+ | Parallel evaluation | Security, compliance, and patentability specialists assess different dimensions |
98
+ | Review and response | Reviewers raise issues; the technical responder proposes document changes |
99
+ | Decision recording | The path recorder preserves rounds for comparison, branching, and recovery |
386
100
 
387
- ---
101
+ The [agent reference](./docs/agents-en.md) lists the 14 registered agents, 6 skills,
102
+ 9 commands, and their roles. Actual dispatch uses the capabilities of the selected host.
388
103
 
389
- *MIT Licensed &ensp;&middot;&ensp; Crafted by [illusionaireal](https://github.com/illusionaireal)*<br>
390
- *With thanks to the [LINUX DO Community](https://linux.do/)*
104
+ ## Documentation
391
105
 
392
- Brand assets and usage: [assets/brand/README.md](./assets/brand/README.md).
393
-
394
- &mdash; 1 &mdash;
395
-
396
- </div>
106
+ | Read next | Contents |
107
+ |---|---|
108
+ | [Usage and CLI](./docs/usage-en.md) | Installation, platform differences, all CLI domains, and uninstall behavior |
109
+ | [Workflow](./docs/workflow-diagram-en.md) | Ten stages, review loops, and threshold behavior |
110
+ | [Agents and collaboration](./docs/agents-en.md) | Registered IDs, skills, commands, and collaboration patterns |
111
+ | [Architecture and development](./docs/architecture-en.md) | Four layers, repository layout, project files, and development commands |
112
+ | [Documentation index](./docs/README-en.md) | Bilingual guides and design references |
113
+ | [Brand guide](./assets/brand/README.md) | Archimedes artwork and usage rules |
114
+
115
+ Contributions are welcome. Read [CONTRIBUTING.md](./CONTRIBUTING.md) or
116
+ [report an issue](https://github.com/illusionaireal/oh-my-patent/issues).
117
+ Licensed under [MIT](./LICENSE).
118
+
119
+ *With thanks to the* [*LINUX DO Community*](https://linux.do/)