kotonoha 0.1.4 → 0.1.5-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Add a guarded Japanese prose-optimization handoff to `natural-japanese` or
13
+ an equivalent registered skill, with invariant preservation, bounded
14
+ convergence, structural revalidation, and explicit completion statuses.
15
+
10
16
  ## [0.1.4] - 2026-09-29
11
17
 
12
18
  ### Added
package/README.md CHANGED
@@ -15,11 +15,12 @@ specification, and handoff for a dedicated PPTX creation skill.
15
15
 
16
16
  Technical documents tend to have two separate problems: "is the prose
17
17
  natural" and "does the structure have the right amount of information".
18
- `tech-writer` specializes in the latter, leaving the former (sentence-level
19
- naturalness, removing "AI smell") to a prose-polishing skill such as
18
+ `tech-writer` specializes in the latter and delegates the former
19
+ (sentence-level naturalness, reading load, terminology, and removing
20
+ "AI smell") to a prose-polishing skill such as
20
21
  [natural-japanese](https://github.com/coji/natural-japanese). With both
21
- installed, lock down the structure with `tech-writer` first, then polish
22
- Japanese prose with natural-japanese.
22
+ installed, kotonoha locks the structure and technical invariants, invokes the
23
+ Japanese prose pass, then rechecks the structure before rubber-duck review.
23
24
 
24
25
  ## What it does
25
26
 
@@ -29,6 +30,9 @@ Japanese prose with natural-japanese.
29
30
  operations runbooks, migration plans, security designs, technical proposals,
30
31
  RFI/RFP procurement documents, and Qiita/Zenn articles
31
32
  - Doctype-specific structure and checklists to guide writing
33
+ - Optional `natural-japanese` integration for Japanese phrase lint,
34
+ reading-load review, terminology checks, and iterative prose optimization
35
+ without changing IDs, facts, tables, code, or acceptance criteria
32
36
  - Iterative rubber-duck review after document creation, with fixes and
33
37
  re-review until no actionable findings remain; unavailable reviews are
34
38
  reported as `review not performed`, while unresolved review loops are
@@ -92,6 +96,8 @@ guidance and a review checklist under
92
96
  - GitHub Copilot CLI installed
93
97
  - Python 3.9+ if you want to run the lint script (standard library only,
94
98
  no extra install needed)
99
+ - `uv` when using `natural-japanese` diagnostics such as phrase lint,
100
+ reading-load analysis, outline extraction, and terminology checks
95
101
 
96
102
  ### Install from npm
97
103
 
@@ -103,6 +109,52 @@ npm install --save-dev kotonoha
103
109
  npx kotonoha install
104
110
  ```
105
111
 
112
+ ### Install tech-writer and presentation-planner together
113
+
114
+ `kotonoha install` installs every packaged skill that is not already present.
115
+ The following commands install both `tech-writer` and
116
+ `presentation-planner` into `.github/skills/`:
117
+
118
+ ```bash
119
+ npm install --save-dev kotonoha
120
+ npx kotonoha install --skill all
121
+ ```
122
+
123
+ `--skill all` is the default, so `npx kotonoha install` has the same behavior.
124
+ Confirm that both skills were installed:
125
+
126
+ ```bash
127
+ test -f .github/skills/tech-writer/SKILL.md
128
+ test -f .github/skills/presentation-planner/SKILL.md
129
+ ```
130
+
131
+ If either directory already exists, the default command preserves it and
132
+ installs only the missing skill. To replace and update both installed skills
133
+ at once, review or back up local customizations first, then run:
134
+
135
+ ```bash
136
+ npx kotonoha install --skill all --force
137
+ ```
138
+
139
+ For Japanese sentence-level optimization, also install
140
+ `natural-japanese` using one of its supported installation methods:
141
+
142
+ ```bash
143
+ npx skills add coji/natural-japanese
144
+ ```
145
+
146
+ Ensure the installed skill is visible to Copilot CLI in the same registered
147
+ skill root used by this project, such as
148
+ `.github/skills/natural-japanese` or
149
+ `~/.copilot/skills/natural-japanese`. If the command installs it for a
150
+ different host, follow the upstream alternative installation instructions
151
+ and place or link the skill into a Copilot-visible skill directory.
152
+
153
+ If no compatible Japanese prose-polishing skill is registered, kotonoha
154
+ finishes the structural workflow and reports
155
+ `Japanese prose optimization not performed` instead of claiming that the
156
+ prose was optimized.
157
+
106
158
  The default destinations are `.github/skills/tech-writer` and
107
159
  `.github/skills/presentation-planner` in the current project. To install
108
160
  only one skill, or use another supported skill directory:
@@ -131,6 +183,56 @@ npx kotonoha install
131
183
  # Installed presentation-planner (...)
132
184
  ```
133
185
 
186
+ ### Update kotonoha
187
+
188
+ First review and commit or back up any local changes under the installed skill
189
+ directories. Updating with `--force` replaces the complete selected
190
+ directories, including local customizations.
191
+
192
+ Update to the latest stable package:
193
+
194
+ ```bash
195
+ npm install --save-dev kotonoha@latest
196
+ ```
197
+
198
+ To test the current prerelease instead, install the `next` tag:
199
+
200
+ ```bash
201
+ npm install --save-dev kotonoha@next
202
+ ```
203
+
204
+ Installing the npm package does not automatically replace existing copied
205
+ skills. Reinstall all packaged skills after the package update:
206
+
207
+ ```bash
208
+ npx kotonoha install --force
209
+ ```
210
+
211
+ To update only one skill:
212
+
213
+ ```bash
214
+ npx kotonoha install --skill tech-writer --force
215
+ npx kotonoha install --skill presentation-planner --force
216
+ ```
217
+
218
+ If the original installation used another target, pass the same directory
219
+ again:
220
+
221
+ ```bash
222
+ npx kotonoha install --target ~/.copilot/skills --force
223
+ ```
224
+
225
+ Confirm the installed package version and review the replaced files before
226
+ committing them:
227
+
228
+ ```bash
229
+ npx kotonoha --version
230
+ git diff -- .github/skills
231
+ ```
232
+
233
+ Running `npx kotonoha install` without `--force` is safe but does not update
234
+ existing skill directories; it only installs skills that are missing.
235
+
134
236
  ### Install from a source checkout
135
237
 
136
238
  Inside this repository, the skills are linked under `.github/skills/`, so no
@@ -188,7 +290,8 @@ skills/presentation-planner/ # storyline, design-spec, and PPTX handoff skill
188
290
 
189
291
  - `scripts/lint.py` only detects structural issues (headings, code blocks,
190
292
  placeholders, links); it does not detect prose naturalness, vocabulary,
191
- or rhythm.
293
+ or rhythm by itself. Those checks require a registered prose-polishing
294
+ skill such as `natural-japanese`.
192
295
  - The doctypes are written mainly with Japanese technical-writing
193
296
  conventions in mind; most of the guidance (especially the commit-message
194
297
  imperative-mood rule) applies directly to English documents as well.
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ function publishTagForVersion(version) {
4
+ return version.includes("-") ? "next" : "latest";
5
+ }
6
+
7
+ if (require.main === module) {
8
+ const { version } = require("../package.json");
9
+ process.stdout.write(`${publishTagForVersion(version)}\n`);
10
+ }
11
+
12
+ module.exports = { publishTagForVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kotonoha",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-dev.1",
4
4
  "description": "GitHub Copilot CLI skills for technical writing and PPTX presentation planning.",
5
5
  "license": "MIT",
6
6
  "author": "nahisaho",
@@ -25,13 +25,12 @@ description: >-
25
25
  the request is a bare goal without enough context to start (e.g. "I want
26
26
  to write a README" / "○○を書きたい"), since this skill drives a one
27
27
  question-at-a-time intake before writing. Supports both Japanese and
28
- English documents, with Japanese as the primary target for polished,
29
- natural phrasing (pairing well with https://github.com/coji/natural-japanese
30
- for sentence-level Japanese refinement). Does NOT handle sentence-level
31
- naturalness, word choice, or rhythm ("AI smell" removal) — that is the
32
- domain of natural-japanese and similar prose-polishing skills. This skill
33
- is specific to a document's structure, information completeness, and
34
- reader fit.
28
+ English documents, with Japanese as the primary target. Owns document
29
+ structure, information completeness, and reader fit; for living Japanese
30
+ documents, it orchestrates a registered prose-polishing skill such as
31
+ https://github.com/coji/natural-japanese for sentence-level naturalness,
32
+ word choice, rhythm, and "AI smell" removal without reimplementing that
33
+ skill.
35
34
  license: MIT
36
35
  argument-hint: "[write|review|score] [doctype] <target file or request>"
37
36
  ---
@@ -58,11 +57,13 @@ reference files.
58
57
 
59
58
  Document quality splits into two layers: "is the structure right" and "is
60
59
  the prose natural and readable". This skill owns the first layer (structure,
61
- document type conventions, completeness, reader fit). The second layer
62
- (sentence-level naturalness, removing "AI smell", rhythm) is out of scope and
63
- belongs to a prose-polishing skill such as [natural-japanese](https://github.com/coji/natural-japanese).
64
- When both skills are installed, use this skill to lock down the structure
65
- first, then hand Japanese prose to natural-japanese for polish.
60
+ document type conventions, completeness, reader fit). A prose-polishing skill
61
+ such as [natural-japanese](https://github.com/coji/natural-japanese) owns the
62
+ second layer (sentence-level naturalness, removing "AI smell", rhythm);
63
+ tech-writer orchestrates that skill without duplicating its rules or scripts.
64
+ When both skills are installed, this skill locks down the structure and
65
+ orchestrates the §5 handoff to natural-japanese during `write` mode before
66
+ the final rubber-duck review.
66
67
 
67
68
  - Rule of thumb: "does removing a heading still make sense?" tests structure
68
69
  (this skill's job). "Does rereading a single sentence change its meaning?"
@@ -75,12 +76,14 @@ first, then hand Japanese prose to natural-japanese for polish.
75
76
  Infer the mode from the argument or the request:
76
77
 
77
78
  - `write` (default): new document, or restructuring a draft. Runs the full
78
- §1–§5 workflow, starting with the intake loop in §1 and ending only after
79
+ §1–§6 workflow, starting with the intake loop in §1 and ending only after
79
80
  the rubber-duck review loop has no remaining actionable findings. If an
80
81
  independent review cannot run or cannot converge, returns the explicit
81
- review status required by §5 instead of claiming a clean review.
82
+ review status required by §6 instead of claiming a clean review. For a
83
+ in-scope Japanese living document, also return the §5 Japanese prose
84
+ optimization status.
82
85
  - `review`: structural review of an existing document. Does not rewrite;
83
- reports the gap against the doctype checklist (§6).
86
+ reports the gap against the doctype checklist (§7).
84
87
  - `score`: structure-only quick diagnostic. Runs
85
88
  `scripts/lint.py --json <file>` and summarizes the findings (no rewrite).
86
89
 
@@ -137,7 +140,7 @@ hand the user a checklist to fill in. Instead:
137
140
  one-line note) and move on.
138
141
  6. **Once complete, do not ask the user to compose anything.** Synthesize
139
142
  the gathered answers into the best possible generation approach yourself
140
- and immediately continue into §2–§5 in the same turn to produce the
143
+ and immediately continue into §2–§6 in the same turn to produce the
141
144
  document. Skip further confirmation unless the doctype is release-facing
142
145
  and consequential (e.g. a public release note with breaking changes) or
143
146
  the user explicitly asked to see a plan first.
@@ -229,11 +232,11 @@ or `references/doctypes/release-notes.md` instead — see the scope note in
229
232
  verbatim there.
230
233
 
231
234
  Sentence-level concerns — keeping individual sentences concise, avoiding
232
- double negatives, not dropping the subject, and general naturalness — are
233
- out of this skill's scope regardless of doctype. When natural-japanese (or
234
- an equivalent prose-polishing skill) is available, hand Japanese prose to
235
- it for that pass; otherwise apply ordinary careful-writing judgment, but
236
- don't treat it as this skill's responsibility to enforce.
235
+ double negatives, not dropping the subject, and general naturalness — belong
236
+ to a prose-polishing skill. In `write` mode for a Japanese document, perform
237
+ the explicit handoff in §5 after the structure is complete. If no compatible
238
+ optimizer is available, still apply ordinary careful-writing judgment and
239
+ report the missing optimization pass explicitly.
237
240
 
238
241
 
239
242
  ## 4. Review — structural check
@@ -262,9 +265,60 @@ step 2 as the primary check for those.
262
265
  4. **Reader-goal recheck**: confirm the "what the reader can do after
263
266
  reading" outcome from §1 is actually achievable from this document alone.
264
267
 
265
- ## 5. Rubber-duck review loop — write mode only
266
-
267
- After the structural review in §4, use the host's subagent mechanism to
268
+ ## 5. Optimize Japanese prose without changing the structure — write mode only
269
+
270
+ For a living, multi-section document whose requested final language is
271
+ Japanese, read
272
+ `references/japanese-prose-optimization.md` and hand the completed draft to a
273
+ registered `natural-japanese` or equivalent Japanese prose-polishing skill.
274
+ This pass is mandatory when such a skill is available.
275
+
276
+ Treat the optimizer as available when the host's registered skill list
277
+ contains `natural-japanese` or a compatible Japanese prose-polishing skill.
278
+ Invoke it through the host's skill-loading mechanism; when only installed
279
+ skill files are exposed, check
280
+ `.github/skills/natural-japanese/SKILL.md`,
281
+ `.copilot/skills/natural-japanese/SKILL.md`, and
282
+ `$HOME/.copilot/skills/natural-japanese/SKILL.md`, then load the discovered
283
+ `SKILL.md` and follow that workflow. Treat the pass as unavailable only when
284
+ no compatible registration or readable skill installation exists, or when
285
+ the optimizer cannot start.
286
+
287
+ Freeze heading hierarchy, section order, identifiers, numeric facts,
288
+ citations, normative language, tables, code, commands, acceptance criteria,
289
+ and explicit risks before handoff. Require sentence-level optimization and
290
+ request AI-pattern diagnostics, reading-load review, and terminology checks
291
+ when their scripts are runnable, without changing those invariants. Missing
292
+ optional diagnostics are a reported limitation, not proof that the prose pass
293
+ did not run. After the prose pass, repeat the doctype checklist and structural
294
+ lint from §4.
295
+
296
+ For an in-scope Japanese document in `write` mode, report one explicit status.
297
+ Do not run this pass or report a status for atomic artifacts such as commit
298
+ messages, PR descriptions, issue reports, single release-note entries, or
299
+ code comments/docstrings unless the user explicitly requests prose polishing
300
+ and supplies the prose in a standalone file:
301
+
302
+ - `Japanese prose optimization completed`
303
+ - `Japanese prose optimization not performed`
304
+ - `Japanese prose optimization did not converge`
305
+
306
+ Across the complete write workflow, allow at most 15 optimizer handoffs,
307
+ including reruns after rubber-duck edits. If no compatible optimizer can be
308
+ loaded, use
309
+ `Japanese prose optimization not performed` and state the reason. If the
310
+ optimizer starts but fails, or an edit violates a frozen invariant, revert
311
+ the invalid edit and retry within the three-round limit; unresolved failures
312
+ or invariant violations use
313
+ `Japanese prose optimization did not converge`. Do not claim this
314
+ optimization from kotonoha's structural lint alone. Documents that are not
315
+ within the Japanese final-language scope defined above require no optimization
316
+ status.
317
+
318
+ ## 6. Rubber-duck review loop — write mode only
319
+
320
+ After the structural review in §4 and any Japanese prose optimization in §5,
321
+ use the host's subagent mechanism to
268
322
  launch an independent reviewer in the `rubber-duck` role to challenge the
269
323
  completed document for meaningful problems that the authoring pass may have
270
324
  missed. Prefer a registered `rubber-duck` agent when the host provides one;
@@ -282,9 +336,14 @@ for `write` mode; do not run it for `review` or `score` mode.
282
336
  2. **Resolve every valid finding**: edit the document rather than merely
283
337
  listing proposed fixes. If a finding conflicts with a stated requirement
284
338
  or is factually inapplicable, record a one-line reason for declining it.
285
- 3. **Re-run the relevant checks after each edit round**: repeat the doctype
286
- checklist and structural lint from §4 before asking for another
287
- rubber-duck review. A fix must not introduce a new structural defect.
339
+ 3. **Re-run the relevant checks after each edit round**: if a fix changed
340
+ Japanese prose, repeat the §5 optimization over the changed prose before
341
+ reporting its final status. Then repeat the doctype checklist and
342
+ structural lint from §4 before asking for another rubber-duck review. A
343
+ fix must not introduce a new structural defect or leave the final Japanese
344
+ prose outside the completed optimization pass. If a required rerun cannot
345
+ start because all 15 handoffs were already used, or cannot complete,
346
+ report `Japanese prose optimization did not converge`, not `completed`.
288
347
  4. **Review again with the prior decisions**: reuse the same reviewer context
289
348
  when supported. Otherwise, include the previous findings, applied fixes,
290
349
  and declined findings with their reasons in every new review prompt. Ask
@@ -306,7 +365,7 @@ for `write` mode; do not run it for `review` or `score` mode.
306
365
  contradictory requirements, label it `review did not converge` and
307
366
  include the latest unresolved findings and fixes already attempted.
308
367
 
309
- ## 6. Doctype checklist summary
368
+ ## 7. Doctype checklist summary
310
369
 
311
370
  See each reference file for detail. The items below are for living,
312
371
  multi-section documents (README, design doc, API reference, release notes,
@@ -333,5 +392,6 @@ The idea of separating structure from prose comes from
333
392
  [natural-japanese](https://github.com/coji/natural-japanese) (MIT License)
334
393
  and its design principle "machines detect, humans (or agents) judge" and
335
394
  "prevent at generation time rather than fix afterward". This skill extends
336
- that separation to the structural side of technical documents, deliberately
337
- leaving prose naturalness out of scope.
395
+ that separation by owning technical-document structure while orchestrating,
396
+ but not reimplementing, the registered prose-polishing skill responsible for
397
+ sentence-level naturalness.
@@ -0,0 +1,108 @@
1
+ # Japanese prose optimization handoff
2
+
3
+ Use this pass after a Japanese document's structure and required information
4
+ are complete. The goal is to remove mechanical or translated-sounding prose
5
+ without changing the document's approved meaning, obligations, evidence, or
6
+ traceability.
7
+
8
+ The preferred optimizer is the
9
+ [natural-japanese prose-polishing skill](https://github.com/coji/natural-japanese).
10
+ Kotonoha owns document structure and completeness; `natural-japanese` owns
11
+ sentence-level clarity, rhythm, word choice, reading load, and detection of
12
+ repeated AI-like phrasing.
13
+
14
+ ## Run this pass when
15
+
16
+ - The requested final language is Japanese, including a bilingual document
17
+ whose audience-facing prose is primarily Japanese.
18
+ - The task is `write` mode.
19
+ - The artifact is a living, multi-section document.
20
+ - A registered `natural-japanese` or equivalent Japanese prose-polishing
21
+ skill is available.
22
+
23
+ Skip it for English documents, generated machine-readable files, and source
24
+ code. Also skip atomic artifacts such as commit messages, PR descriptions,
25
+ issue reports, single release-note entries, and code comments/docstrings
26
+ unless the user explicitly requests prose polishing and supplies the prose in
27
+ a standalone file. For in-scope mixed-language documents, optimize only
28
+ Japanese prose.
29
+
30
+ ## Freeze these invariants
31
+
32
+ Give the prose optimizer the target file, doctype, reader, and intended
33
+ outcome. Require it to preserve:
34
+
35
+ - Heading hierarchy, section order, and doctype-required sections
36
+ - Requirement, risk, control, test, interface, and decision IDs
37
+ - Numbers, units, dates, proper nouns, citations, URLs, and source mappings
38
+ - Normative force such as Must / Should / May, approval states, and
39
+ acceptance criteria
40
+ - Tables, code blocks, commands, schemas, frontmatter keys, and placeholders
41
+ - Explicit assumptions, limitations, residual risks, and unresolved items
42
+
43
+ Heading wording may improve only when its meaning and hierarchy stay intact.
44
+ Never trade technical precision for conversational phrasing.
45
+
46
+ ## Optimization loop
47
+
48
+ 1. Inspect the host's registered skill list for `natural-japanese` or a
49
+ compatible Japanese prose-polishing skill. Invoke it through the host's
50
+ skill-loading mechanism. If the host exposes only skill files, check
51
+ `.github/skills/natural-japanese/SKILL.md`,
52
+ `.copilot/skills/natural-japanese/SKILL.md`, and
53
+ `$HOME/.copilot/skills/natural-japanese/SKILL.md`; expand `$HOME`, load the
54
+ discovered skill,
55
+ and follow its workflow.
56
+ 2. Ask the loaded skill to review and rewrite only the Japanese prose under
57
+ the frozen invariants.
58
+ 3. Let `<natural-japanese-dir>` be the directory containing the loaded
59
+ optimizer's `SKILL.md`. When its diagnostics are available, run the
60
+ optimizer's scripts with their qualified paths:
61
+
62
+ ```bash
63
+ uv run <natural-japanese-dir>/scripts/lint.py <target-file> --genre tech
64
+ uv run <natural-japanese-dir>/scripts/lint.py <target-file> --reading-load
65
+ uv run <natural-japanese-dir>/scripts/outline.py <target-file>
66
+ uv run <natural-japanese-dir>/scripts/terms.py <target-file>
67
+ ```
68
+
69
+ Do not substitute `skills/tech-writer/scripts/lint.py`; kotonoha's script
70
+ checks document structure and does not support these prose diagnostics.
71
+ 4. Triage findings in context. Do not perform blind global replacements;
72
+ retain a flagged expression when changing it would weaken precision or
73
+ alter a defined term.
74
+ 5. Re-run the optimizer's rubric and diagnostics after edits. One round is
75
+ one kotonoha-to-optimizer handoff and its returned edits. Allow at most
76
+ three rounds per §5 invocation; stop earlier when no actionable prose
77
+ findings remain. A later rubber-duck edit opens a new invocation limited
78
+ to the changed Japanese prose. Across the complete write workflow, do not
79
+ exceed 15 optimizer handoffs.
80
+ 6. Compare the optimized document against the frozen invariants. Revert any
81
+ violating edit, give the violated invariant back to the optimizer, and
82
+ retry within the round limit. If the violation cannot be resolved, report
83
+ `Japanese prose optimization did not converge`.
84
+ 7. Re-run kotonoha's doctype checklist and structural lint before
85
+ rubber-duck review.
86
+
87
+ ## Required status
88
+
89
+ When this pass is in scope (a living, multi-section document whose requested
90
+ final language is Japanese, in `write` mode), report exactly one status:
91
+
92
+ - `Japanese prose optimization completed`: the registered optimizer ran and
93
+ no actionable prose findings remain. Run diagnostics when available; if
94
+ `uv` or a diagnostic script is unavailable, note that limitation without
95
+ changing this status.
96
+ - `Japanese prose optimization not performed`: no compatible optimizer was
97
+ registered or loaded, so no prose review or rewrite ran; include the
98
+ concrete reason.
99
+ - `Japanese prose optimization did not converge`: three rounds completed with
100
+ unresolved actionable findings or invariant violations, or the optimizer
101
+ started but failed before producing a valid result, a required
102
+ post-rubber-duck rerun failed or could not start because all 15 handoffs
103
+ were already used; list the findings, violations, failure, and attempted
104
+ fixes.
105
+
106
+ Do not claim natural-language optimization based only on kotonoha's
107
+ structural lint. Documents outside the scope of this pass require no Japanese
108
+ optimization status.