asciidoc-pubkit 1.3.1 → 1.4.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.
@@ -0,0 +1,317 @@
1
+ # Document-based image commands (v1.4.1)
2
+
3
+ All commands take an AsciiDoc entry document, such as `book.adoc`. They do not
4
+ accept a standalone image file or scan an arbitrary directory. They require Ruby
5
+ 3.2 or later and ImageMagick 7 (`magick identify`) or 6 (`identify`) on PATH.
6
+ No Python, MeCab, AI, network fetch, or pixel modification is involved.
7
+
8
+ ```sh
9
+ asciidoc-pubkit image list book.adoc
10
+ asciidoc-pubkit image list book.adoc --json
11
+ asciidoc-pubkit image stats book.adoc --json
12
+ asciidoc-pubkit image find book.adoc --portrait
13
+ asciidoc-pubkit image scale book.adoc
14
+ asciidoc-pubkit image scale book.adoc --diff
15
+ asciidoc-pubkit image scale book.adoc --in-place
16
+ ```
17
+
18
+ `image scale` replaces the v1.4.0 `image width` command. The old name is no
19
+ longer accepted.
20
+
21
+ ## Discovery and selection
22
+
23
+ Asciidoctor resolves active includes, attributes, conditional directives, and the
24
+ `imagesdir` value at each block image. Paths are relative to the document's base
25
+ directory, as in Asciidoctor, rather than each included file. Only parsed block
26
+ `image::` macros are collected. Inline `image:` macros, image text inside code or
27
+ comments, cover attributes without a block reference, and unreferenced files are
28
+ outside the collection scope. An AsciiDoc table's separate inner documents
29
+ are not traversed in this version.
30
+
31
+ The default boundary is the entry document's directory. `--base-dir DIR` changes
32
+ both the parsing base and the permitted source/image boundary. Includes and
33
+ images outside it, including symlink escapes, are rejected. Direct symlink source
34
+ files are rejected. Image symlinks within the boundary are resolved and deduplicated.
35
+ Remote image references are reported as excluded without fetching; remote
36
+ includes and `allow-uri-read` are rejected. Missing or unsupported selected
37
+ images fail the command with exit 2 before source writes.
38
+
39
+ By default, block images whose basenames match `cover*`, `chapter-*`, `part-*`,
40
+ or `profile*`, and block references to `front-cover-image`, `back-cover-image`,
41
+ or `title-logo-image` assets, are excluded. `--include-artwork` disables these
42
+ built-in artwork exclusions; it does not collect assets that only appear in
43
+ attributes. Use `--exclude` for artwork with other names. Patterns match an image
44
+ basename or its path relative to the base directory. Repeat the flag for multiple
45
+ patterns. Repeat `--include GLOB` to select only images matching any supplied
46
+ pattern (OR). Explicit inclusion overrides built-in artwork exclusions, including
47
+ cover asset references; explicit `--exclude` patterns still win. Matching uses the
48
+ same basename or base-relative path rules as exclusion. Without `--include`, the
49
+ existing default selection remains in effect. The filter applies to list, stats, find
50
+ and scale; an unmatched include selects zero images without modifying sources.
51
+ `--only FILE` selects references from one included source; it does not
52
+ mean one image, and the file must be part of the parsed document.
53
+
54
+ ```sh
55
+ asciidoc-pubkit image list book.adoc --exclude 'special-*.png' --json
56
+ asciidoc-pubkit image scale book.adoc --only chapters/intro.adoc --diff
57
+ asciidoc-pubkit image list book.adoc -a edition-en -a diagrams=1
58
+ ```
59
+
60
+ ## List and stats
61
+
62
+ `image list` reports each selected physical image once, in first-reference order:
63
+ absolute path, pixel width/height, full-precision width/height ratio, byte size,
64
+ and every reference's source file, line, target and current `scaledwidth`.
65
+ Text output rounds aspect ratios for display; JSON preserves the calculation
66
+ value. Source editability and exclusions are included in JSON.
67
+
68
+ `image stats` counts physical images and references separately. It reports the
69
+ sum of unique image bytes and minimum, maximum and arithmetic mean of width,
70
+ height, aspect ratio and bytes. Repeated references are not counted twice in
71
+ image statistics. With no selected images, totals are zero and min/max/mean are
72
+ null. Both commands are read-only; redirect stdout to save their reports.
73
+
74
+ ## Find images (v1.4.1)
75
+
76
+ `image find` is read-only. It applies the shared document selection above first,
77
+ then filters the selected physical images by file size, pixel dimensions, total
78
+ pixels and aspect ratio. It does not measure rendered page size or interpret
79
+ image contents. No condition means all selected images.
80
+
81
+ ```sh
82
+ asciidoc-pubkit image find book.adoc --min-bytes 1MiB
83
+ asciidoc-pubkit image find book.adoc --min-pixels 4000000
84
+ asciidoc-pubkit image find book.adoc --min-pixel-height 2000
85
+ asciidoc-pubkit image find book.adoc --portrait
86
+ asciidoc-pubkit image find book.adoc --landscape
87
+ asciidoc-pubkit image find book.adoc --max-aspect-ratio 0.5
88
+ asciidoc-pubkit image find book.adoc --min-aspect-ratio 2
89
+ asciidoc-pubkit image find book.adoc --min-aspect-ratio 0.5 --max-aspect-ratio 0.8
90
+ asciidoc-pubkit image find book.adoc --min-bytes 1MiB --portrait --sort bytes --order desc --json
91
+ ```
92
+
93
+ | Options | Measurement |
94
+ | --- | --- |
95
+ | `--min-bytes SIZE`, `--max-bytes SIZE` | File size in bytes |
96
+ | `--min-pixels N`, `--max-pixels N` | Pixel width multiplied by pixel height |
97
+ | `--min-pixel-width N`, `--max-pixel-width N` | Pixel width, distinct from scale's display-width percentage |
98
+ | `--min-pixel-height N`, `--max-pixel-height N` | Pixel height |
99
+ | `--min-aspect-ratio R`, `--max-aspect-ratio R` | Pixel width divided by pixel height |
100
+ | `--portrait` | Height strictly greater than width |
101
+ | `--landscape` | Width strictly greater than height |
102
+
103
+ All numeric bounds are inclusive and all conditions combine with AND. A smaller
104
+ aspect ratio means a taller image: `--max-aspect-ratio 0.5` selects images at least
105
+ twice as tall as they are wide. Ratios use unrounded values for filtering.
106
+ Portrait and landscape exclude squares and cannot be supplied together.
107
+ Combining orientation with incompatible numeric bounds simply matches no images.
108
+
109
+ Byte sizes accept nonnegative integers, optionally followed immediately by
110
+ case-sensitive `B`, `KB`, `MB`, `KiB` or `MiB`. KB/MB use powers of 1000;
111
+ KiB/MiB use powers of 1024. Bare integers are bytes. Fractional byte sizes are
112
+ not accepted. Pixel counts and dimensions must be positive integers; aspect
113
+ ratios must be finite positive numbers. A minimum greater than its maximum is
114
+ an argument error.
115
+
116
+ Default output follows first-reference order. `--sort` accepts `bytes`, `pixels`,
117
+ `pixel-width`, `pixel-height` or `aspect-ratio`. With a sort metric, the default
118
+ order is `desc`; `--order asc` selects ascending order. Equal values retain
119
+ first-reference order in either direction. `--order` requires `--sort`.
120
+
121
+ Text output reports each matching physical image once, with dimensions, aspect
122
+ ratio, total pixels, bytes, reference count, and each selected reference's source
123
+ file and line. Unmapped locations are marked as unknown. The summary distinguishes
124
+ matching images from the selected population before numeric/orientation filtering.
125
+
126
+ JSON retains the inventory's `images`, `image_count`, `reference_count`, `excluded`,
127
+ document, boundary and scope fields. Image/reference counts describe matches;
128
+ `selected_image_count` and `selected_reference_count` describe the population
129
+ before numeric/orientation filtering. Each matching image adds `pixels` to the
130
+ normal inventory fields and retains its selected references. `filters` records
131
+ normalized numeric bounds in bytes/pixels/ratios and explicit orientation
132
+ booleans. `sort` and `order` are null in document order, otherwise they record the
133
+ metric and effective direction. Numeric nonmatches are not added to `excluded`,
134
+ which continues to describe shared discovery/selection exclusions.
135
+
136
+ All selected images are inspected before numeric/orientation filtering. Missing
137
+ or unsupported selected images fail with exit 2 even if they might not match;
138
+ inspection failures are never hidden as nonmatches. Successful empty searches
139
+ return 0. No source or pixel writes, AI calls, or network fetches occur.
140
+
141
+ ## Display scaling and source edits
142
+
143
+ Use `--width PERCENT` for a fixed `scaledwidth` (finite, greater than 0 and at most
144
+ 100). Preserve fractional values. It cannot be combined with explicitly supplied
145
+ `--height-width-ratio`, `--min-width`, or `--max-width`. Default automatic bounds
146
+ do not restrict fixed widths. Omit `--width` for automatic aspect-ratio sizing.
147
+
148
+ ```sh
149
+ asciidoc-pubkit image scale book.adoc --include 'part-*' --include 'chapter-*' \
150
+ --width 100 --diff
151
+ ```
152
+
153
+ ### Automatic calculation
154
+
155
+ ```text
156
+ raw width (%) = 100 × height-width-ratio × pixel width / pixel height
157
+ width (%) = clamp(raw width, min-width, max-width), rounded to one decimal
158
+ ```
159
+
160
+ Rounding is clamped again so it never crosses a bound. A fractional bound may
161
+ therefore retain more than one decimal place. Defaults are coefficient 0.8,
162
+ minimum 40%, maximum 100%. A square uses 80%, a 3:4 image 60%, and width/height
163
+ >= 1.25 reaches 100%. Until a bound applies, the displayed image height approaches
164
+ 0.8 times the text area's width. This is not a percentage of screen height.
165
+
166
+ | Option | Default | Behavior |
167
+ | --- | --- | --- |
168
+ | `--width PERCENT` | unset | Fixed width; disables automatic sizing |
169
+ | `--height-width-ratio NUMBER` | `0.8` | Display height / text-area width coefficient |
170
+ | `--min-width PERCENT` | `40` | Smallest permitted display width |
171
+ | `--max-width PERCENT` | `100` | Largest permitted display width |
172
+ | `--dry-run` | default behavior | Report planned changes without writing |
173
+ | `--diff` | off | Print a unified source diff without writing |
174
+ | `--in-place` | off | Explicitly update the source image references |
175
+ | `--json` | off | Structured inventory, settings and before/after changes |
176
+
177
+ Coefficients must be finite and positive, and widths must satisfy
178
+ `0 < min-width <= max-width <= 100`. `--in-place` cannot be combined with
179
+ `--dry-run` or `--diff`; `--diff` cannot be combined with `--json`.
180
+
181
+ ```sh
182
+ asciidoc-pubkit image scale book.adoc --height-width-ratio 0.7 \
183
+ --min-width 50 --max-width 100 --exclude 'manual.png' --diff
184
+ ```
185
+
186
+ The result is written to the physical source macro, including included files:
187
+
188
+ ```adoc
189
+ image::diagram.png[Existing description,align=center,scaledwidth=87.9%]
190
+ ```
191
+
192
+ Existing `scaledwidth` is updated; otherwise it is appended. Alt text, target
193
+ attribute references, other attributes, line endings, surrounding text and image
194
+ bytes are preserved. Explicit pixel width/height attributes are retained.
195
+ Backends that honor `scaledwidth`, including asciidoctor-epub3, consume it during
196
+ conversion; this does not impose a universal CSS width on every backend.
197
+
198
+ Source provenance is attached only in the parser's memory before include
199
+ lookahead can lose its location. No internal metadata is written to source.
200
+ Unsupported or unmapped source forms are not guessed: list/stats can report them,
201
+ but scale refuses an unsafe edit. Duplicate `scaledwidth` declarations are rejected.
202
+ A reused source macro can be edited once when all references request the same
203
+ result; conflicting expansions or an excluded reuse block the edit. Separate
204
+ attributes or macros across multiple lines are not reconstructed.
205
+
206
+ All edits and image inspections complete before writing. Changed files are
207
+ staged in their own directories with their modes preserved. Source snapshots
208
+ are checked for concurrent changes. A failed multi-file replacement rolls back
209
+ already installed changes, without overwriting a later concurrent writer's edits.
210
+ Repeated execution with the same inputs is idempotent. There is no `--output`
211
+ or `--output-dir` mode; a single output file cannot represent updates
212
+ across several included files. Use preview/diff to review changes first.
213
+
214
+ JSON settings report `mode: fixed` with `width`, or `mode: automatic` with the
215
+ coefficient and bounds. A `minimum_limited` image also gets a notice in text
216
+ previews: its minimum display width can make its height exceed the target.
217
+
218
+ Image whitespace is included in the pixel dimensions. The algorithm does not
219
+ infer flow direction, text density or legibility from the pixels. At the minimum width a
220
+ very tall figure can still exceed a page, and text may require a larger width.
221
+ The coefficient and bounds are tuning values, not KDP requirements. Run the
222
+ book build, EPUBCheck and Kindle Previewer after applying source changes.
223
+
224
+ Successful commands, previews and empty collections return 0. Invalid arguments,
225
+ parse errors, missing images and unsafe/unwritable source edits return 2. This
226
+ does not replace manuscript review verification or establish publication readiness.
227
+
228
+ ## Book-wide sizing
229
+
230
+ Opt in with `--mode book`; the default remains `--mode automatic`. Fixed
231
+ `--width` cannot be combined with a mode or automatic-sizing options.
232
+
233
+ ```sh
234
+ asciidoc-pubkit image scale book.adoc --mode book --json
235
+ asciidoc-pubkit image scale book.adoc --mode book --min-width 30 --diff
236
+ asciidoc-pubkit image scale book.adoc --mode book --min-width 30 --in-place
237
+ ```
238
+
239
+ First compute baseline fractions `s` from the automatic formula above for every
240
+ selected unique physical image. For aspect ratio `r = pixel width / pixel height`,
241
+ compute baseline height `s/r` and area `s*s/r`. Use their medians (the arithmetic
242
+ mean of the two middle values for an even count), without weighting repeated
243
+ references. Artwork remains excluded by default, so run fixed artwork scaling
244
+ separately. Explicit selection changes the calibration population. This mode
245
+ rejects `--only` to avoid accidentally calibrating a single included source.
246
+ It measures all selected images from the document, not the filesystem directory.
247
+
248
+ | Option | Default | Meaning |
249
+ | --- | --- | --- |
250
+ | `--scale-factor NUMBER` | 0.9 | Multiply each baseline width |
251
+ | `--height-factor NUMBER` | 1 | Multiply median baseline height for the height cap |
252
+ | `--area-factor NUMBER` | 0.8 | Multiply median baseline area for the area cap |
253
+
254
+ These factors require `--mode book` and must be finite, positive and at most 1.
255
+ The automatic coefficient and bounds still determine the baseline. Each new
256
+ fractional width is:
257
+
258
+ ```text
259
+ height_cap = median(s/r) * height_factor
260
+ area_cap = median(s*s/r) * area_factor
261
+ new_s = min(s * scale_factor, height_cap * r, sqrt(area_cap * r))
262
+ ```
263
+
264
+ Convert to percent and round down to one decimal so rounding never exceeds a
265
+ budget. Recalculate baselines from image dimensions on each run; never shrink
266
+ existing `scaledwidth` values cumulatively. Changing the image population or
267
+ options intentionally changes the result. An empty population has null medians
268
+ and caps and does not edit any source.
269
+
270
+ A candidate below `--min-width` (or zero after rounding) is a conflict. Previews
271
+ return success, print a notice on stderr, and report every conflict in JSON
272
+ (`conflicts`, `requires_review`, `proposed_width_percent`). Conflicted references
273
+ are not included in the proposed source diff; their sources stay unchanged.
274
+ `--in-place` fails with exit 2 before any source write if any conflict exists.
275
+ Lower the minimum width or revise the selection/factors and preview again; no
276
+ minimum is silently forced above the height/area caps. Normal reports show
277
+ candidate widths and review notices; JSON additionally includes calibration
278
+ medians, caps, baseline widths, and predicted display heights/areas.
279
+
280
+ All heights use text-area width as the unit; areas use text-area width squared.
281
+ These are not percentages of viewport height or guarantees of Kindle pagination.
282
+ Image pixels, whitespace, flow direction and text legibility are not interpreted.
283
+
284
+ ## Make integration
285
+
286
+ Call width adjustment before the converter reads the source document:
287
+
288
+ ```make
289
+ ASCIIDOC_PUBKIT ?= asciidoc-pubkit
290
+ IMAGE_HEIGHT_WIDTH_RATIO ?= 0.8
291
+ IMAGE_MIN_WIDTH ?= 40
292
+ IMAGE_MAX_WIDTH ?= 100
293
+ IMAGE_SELECTION_OPTS ?=
294
+ IMAGE_SCALE_OPTS = --height-width-ratio $(IMAGE_HEIGHT_WIDTH_RATIO) --min-width $(IMAGE_MIN_WIDTH) --max-width $(IMAGE_MAX_WIDTH) $(IMAGE_SELECTION_OPTS)
295
+
296
+ .PHONY: image-list image-stats image-scale
297
+ image-list:
298
+ $(ASCIIDOC_PUBKIT) image list book.adoc $(IMAGE_SELECTION_OPTS)
299
+ image-stats:
300
+ $(ASCIIDOC_PUBKIT) image stats book.adoc $(IMAGE_SELECTION_OPTS)
301
+ image-scale:
302
+ $(ASCIIDOC_PUBKIT) image scale book.adoc --include 'part-*' --include 'chapter-*' --width 100 --in-place
303
+ $(ASCIIDOC_PUBKIT) image scale book.adoc $(IMAGE_SCALE_OPTS) --in-place
304
+ ```
305
+
306
+ Use your build's pre-generation prerequisite hook to run `image-scale`. It must
307
+ finish before conversion, rather than running alongside the converter. No EPUB
308
+ postprocessing is needed. The earlier unreleased `epub image-width` prototype is
309
+ replaced by this document-based interface; it was not a released public command.
310
+
311
+ ## Later scope
312
+
313
+ Image-file processing (`resize`, `trim`, `pad`, `quantize`, and possible composite
314
+ preparation) is planned for a later release and tracked in
315
+ [GitHub issue #1](https://github.com/cybergarage/asciidoc-pubkit/issues/1).
316
+ Those commands are not implemented in v1.4.1. Their input will also be the
317
+ AsciiDoc document, rather than a standalone image.
data/docs/installation.md CHANGED
@@ -8,6 +8,10 @@ asciidoc-pubkit --version
8
8
  asciidoc-pubkit --help
9
9
  ```
10
10
 
11
+ The v1.4.1 `image list`, `image stats` and `image scale` commands additionally
12
+ require ImageMagick 7 (`magick`) or 6 (`identify`). They do not require Python or
13
+ MeCab. See [image commands](image-commands.md).
14
+
11
15
  Ruby 3.2 or later is required. RubyGems installs the required Ruby dependencies;
12
16
  no repository clone or Node.js installation is needed. MeCab and IPADIC must be
13
17
  installed separately when using Japanese review or scoring in the default mode.
@@ -41,7 +45,7 @@ Add the gem to your project's `Gemfile` to manage its version with Bundler:
41
45
 
42
46
  ```ruby
43
47
  source 'https://rubygems.org'
44
- gem 'asciidoc-pubkit', '~> 1.2.0'
48
+ gem 'asciidoc-pubkit', '~> 1.4.0'
45
49
  ```
46
50
 
47
51
  Then install dependencies and run the CLI through Bundler:
@@ -26,6 +26,20 @@ limits. This implementation uses pubkit's own selected AsciiDoc scope and
26
26
  preservation contracts; upstream performance and model-evaluation results are
27
27
  not measurements of pubkit.
28
28
 
29
+ <a id="explicit-actor-names-unreleased"></a>
30
+
31
+ ## Explicit actor names (v1.4.0)
32
+
33
+ Ten additional calibration pairs compare explicit role names with the supported
34
+ system, internal component, execution environment or communication peer. They
35
+ include valid defined roles, accurate return verbs, unintended self-handoffs,
36
+ unsupported owners and a rule applier incorrectly made its configuration owner.
37
+ The existing retained-transfer example now defines its actor first; its historical
38
+ ID remains unchanged. Judge actor specificity independently from verb accuracy.
39
+ Tests cover fixture integrity, writing and saved prompts in all three review
40
+ scopes, immutable session criteria and unchanged sources. They do not invoke an
41
+ AI evaluator, measure editing quality or establish semantic correctness.
42
+
29
43
  ## Actor clarity comparisons (v1.2.3)
30
44
 
31
45
  Twelve additional calibration pairs cover conditional actor changes, user refusal
@@ -42,8 +56,8 @@ criteria changes against a project-defined baseline. Keep detection performance,
42
56
  readability, and meaning preservation separate so that a clearer rewrite cannot
43
57
  hide a lost condition or invented fact.
44
58
 
45
- This guide describes the development checkout, including the
46
- `technical-prose-v3` corpus and 155 revision calibration pairs. The sentence-ending
59
+ This guide describes version 1.4.0, including the
60
+ `technical-prose-v3` corpus and 165 revision calibration pairs. The sentence-ending
47
61
  criteria and twelve additional pairs, plus the flow guidance and four further
48
62
  pairs, are included in version 1.2.0.
49
63
  The evaluation runner is not an
@@ -111,7 +125,7 @@ of Japanese writing.
111
125
  | [prose_benchmark.ja.adoc](../test/fixtures/prose_benchmark.ja.adoc) | 26 paragraphs used as the actual AsciiDoc input |
112
126
  | [prose_benchmark.ja.json](../test/fixtures/prose_benchmark.ja.json) | Matching paragraph IDs and text, 11 annotated detector targets, and preservation checklists |
113
127
  | [prose_benchmark.yml](../test/fixtures/prose_benchmark.yml) | Fixed empty configuration that isolates the benchmark from discovered manuscript settings |
114
- | [prose_evaluation.ja.json](../test/fixtures/prose_evaluation.ja.json) | Detection examples and 155 manual revision pairs with expected `accept`, `reject`, or `needs-evidence` dispositions |
128
+ | [prose_evaluation.ja.json](../test/fixtures/prose_evaluation.ja.json) | Detection examples and 165 manual revision pairs with expected `accept`, `reject`, or `needs-evidence` dispositions |
115
129
 
116
130
  The corpus includes framing such as `重要なのは`, metaphorical operations such
117
131
  as `地味に効く`, inflected and negative forms, and repeated endings. Controls
@@ -468,3 +482,17 @@ of criteria to writing and saved review prompts, including historical-session
468
482
  preservation; they do not establish AI judgment accuracy. The updated judge rubric
469
483
  requires a compatible fresh baseline for future AI comparisons. No AI evaluation
470
484
  was run; improvement remains unmeasured and `meaning_verified` remains false.
485
+
486
+
487
+ <a id="retention-and-representation-comparisons-unreleased"></a>
488
+
489
+ ## Retention and representation comparisons (v1.4.0)
490
+
491
+ `test/fixtures/retention_representation_wording.ja.json` contains 24 manually
492
+ labeled comparisons covering input inclusion, storage, recording, assignment,
493
+ retained history/locks/snapshots, result/state indication and valid notation.
494
+ Rejection examples cover invented persistence, lost identity or lifetime,
495
+ capability changes, unknown results treated as failure, and stronger evidence
496
+ or causation claims. The fixture is separate from the evaluation runner's corpus.
497
+ Its tests check data integrity and saved-prompt behavior, not the correctness of
498
+ these language judgments. No model judge or AI-quality measurement is run.
data/docs/writing.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Writing commands
2
2
 
3
+ Version 1.4.0 extends the [actor criteria](../data/writing/ja/criteria.md#compare-explicit-actor-names-with-the-actual-responsibility)
4
+ to explicit but vague role names such as `実行側` and `処理側`. Compare the
5
+ evidenced system, internal component, execution environment or communication
6
+ peer, and judge actor specificity separately from verb accuracy. Recheck the
7
+ whole sentence for self-handoffs and changed modifier or configuration ownership.
8
+ These are contextual instructions, with no new detector or replacement rules;
9
+ saved sessions retain their original criteria.
10
+
3
11
  The v1.2.3 [actor-change criteria](../data/writing/ja/criteria.md#clarify-omitted-subjects-when-actors-change)
4
12
  compare omitted and explicit subjects across clauses, sentences and table roles.
5
13
  They distinguish requesting, approving, executing and investigating, preserve
@@ -241,3 +249,58 @@ their scope. The bundled review skill routes these assignments to the saved
241
249
  criteria. Writing commands and new heading, prose and list sessions include the
242
250
  guidance; existing sessions keep their original criteria. Regression checks cover
243
251
  criteria delivery and source preservation, not measured AI proofreading quality.
252
+
253
+
254
+ <a id="retention-and-representation-wording-unreleased"></a>
255
+
256
+ ## Retention and representation wording (v1.4.0)
257
+
258
+ The shared Japanese criteria now compare `保持` with input inclusion, container
259
+ storage, recording and attribute assignment, and `表す` with state indication,
260
+ evidence and contents. Preserve valid retention of history, original values,
261
+ locks and snapshots, and valid representation by symbols, JSON, code or graphs.
262
+ See [retention](../data/writing/ja/criteria.md#distinguish-retention-from-inclusion-storage-and-assignment)
263
+ and [representation](../data/writing/ja/criteria.md#distinguish-representation-from-evidence-and-state-indication).
264
+
265
+ These are contextual comparisons, not blanket replacements or new detector rules.
266
+ They reach writing commands and new Japanese heading, prose and list sessions;
267
+ existing sessions keep their saved criteria. English guidance, scoring and
268
+ mechanical verification are unchanged. Manual comparison fixtures and delivery
269
+ regressions do not measure AI editing quality or semantic correctness.
270
+
271
+
272
+ <a id="explanation-presentation-and-state-indication-unreleased"></a>
273
+
274
+ ## Explanation, presentation and state indication (v1.4.0)
275
+
276
+ The [shared Japanese criteria](../data/writing/ja/criteria.md#distinguish-explanation-presentation-and-state-indication)
277
+ compare `示す` by its role: announcing an explanation, stating technical behavior,
278
+ displaying or recording information, presenting an actual figure/table/example,
279
+ or indicating a value's meaning. Compare whole paragraphs, including repeated
280
+ `説明し…示します` guidance and method/outcome relationships. Preserve valid
281
+ presentation and state-indication wording; do not replace every use with
282
+ `説明します` or strengthen an inspection into a guarantee.
283
+
284
+ Writing commands and new Japanese heading, prose and list sessions include the
285
+ guidance; existing sessions retain their saved criteria. No detector, automatic
286
+ replacement, score or semantic-verification behavior changes. Delivery tests
287
+ check prompt contents and source preservation, not AI proofreading quality.
288
+
289
+
290
+ <a id="json-identifiers-and-explanatory-strings-unreleased"></a>
291
+
292
+ ## JSON identifiers and explanatory strings (v1.4.0)
293
+
294
+ The [Japanese](../data/writing/ja/criteria.md#preserve-json-identifiers-and-explanatory-strings)
295
+ and [English](../data/writing/en/criteria.md#preserve-json-identifiers-and-explanatory-strings)
296
+ criteria distinguish JSON keys, schema keywords and technical values from
297
+ natural-language descriptions. Compare examples with their explanations,
298
+ including field/value ownership, nesting, required arguments, string/object
299
+ representation and request/result IDs. Follow the book's notation rather than
300
+ requiring emphasis or monospace. JSON/code blocks remain protected in prose
301
+ review; translation of explanatory strings requires its own assigned scope.
302
+
303
+ Writing commands and new review sessions include these comparisons. Existing
304
+ sessions retain their saved criteria. This is prompt guidance, not an automatic
305
+ JSON inventory or rewriting command; parsing and preservation checks do not
306
+ establish semantic correctness or translation fidelity.
@@ -80,6 +80,11 @@ without forcing repetition. Inspect related authorized table/figure roles in the
80
80
  own scopes; report missing actor evidence rather than assigning a plausible role.
81
81
  If the selected CLI lacks the actor-change examples, report that criteria limitation
82
82
  and retain saved sessions; keep the canonical examples in pubkit.
83
+ Review explicit actor names through those criteria too, recording the supported
84
+ responsibility and recipient rather than treating a written subject as sufficient.
85
+ Assess actor specificity and verb accuracy separately and compare the full revised
86
+ sentence before finalizing the decision; preserve defined roles and unresolved
87
+ owners. Do not copy book-specific actor replacements into this shared skill.
83
88
 
84
89
  For an assigned content guide or learning objective, record the whole-paragraph
85
90
  viewpoint and any repeated guidance along with the source, alternative and reason.
@@ -14,6 +14,10 @@ module AsciidocPubkit
14
14
  document info FILE Extract book metadata
15
15
  document check-xrefs FILE Report unresolved local cross-references
16
16
  document index DIRECTORY Generate an English-title AsciiDoc index
17
+ image list FILE List images referenced by an AsciiDoc document
18
+ image find FILE Find document images by size, dimensions or aspect ratio
19
+ image stats FILE Summarize document-referenced image dimensions and sizes
20
+ image scale FILE Preview or explicitly apply display widths to source image macros
17
21
  writing criteria Print the shared Japanese or English prose criteria
18
22
  writing prompt Generate a technical writing prompt
19
23
  review scan FILE Collect Japanese or English prose, headings, or list text and review candidates
@@ -31,7 +35,7 @@ module AsciidocPubkit
31
35
  Use --lang ja (default) or en with writing commands and review commands. Other
32
36
  languages and regional tags are unsupported and return an error.
33
37
  skill install and upgrade write only the selected skill directory.
34
- Only replace apply edits manuscripts. review score --agent explicitly invokes a
38
+ replace apply and image scale --in-place explicitly edit manuscript sources. review score --agent explicitly invokes a
35
39
  local Codex or Claude CLI, which may connect to its configured AI service.
36
40
  TEXT
37
41
 
@@ -46,11 +50,12 @@ module AsciidocPubkit
46
50
  out.puts VERSION
47
51
  return 0
48
52
  end
49
- if args.empty? || args == ['--help'] || args == ['-h'] || %w[review writing replace document skill].any? { |group| args == [group, '--help'] }
53
+ if args.empty? || args == ['--help'] || args == ['-h'] || %w[review writing replace document skill image].any? { |group| args == [group, '--help'] }
50
54
  out.puts HELP
51
55
  return 0
52
56
  end
53
57
  group, command = args.shift(2)
58
+ return ImageCommands.run(command, args, out: out, err: err) if group == 'image'
54
59
  return SkillCommands.run(command, args, out: out, err: err) if group == 'skill'
55
60
  if group == 'document' && %w[toc info check-xrefs index].include?(command)
56
61
  return DocumentCommands.run(command, args, out: out, err: err)
@@ -95,6 +95,7 @@ module AsciidocPubkit
95
95
  owner.check_source(args[1], root) if args[1] && File.file?(args[1])
96
96
  super(*args)
97
97
  end
98
+ yield doc if block_given?
98
99
  doc.parse
99
100
  ensure
100
101
  Asciidoctor::LoggerManager.logger = previous