@gobing-ai/knowledge-kit 0.0.13 → 0.0.15

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 (125) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/index.js +20 -0
  3. package/package.json +1 -1
  4. package/plugins/generations/content-gen/dist/index.js +20 -0
  5. package/plugins/generations/core-facts-gen/dist/index.js +20 -0
  6. package/plugins/generations/daily-article-gen/dist/index.js +29 -1
  7. package/plugins/generations/daily-article-gen/src/index.ts +13 -1
  8. package/plugins/generations/dailynews-gen/dist/index.js +20 -0
  9. package/plugins/generations/episode-plan-gen/dist/index.js +24 -0
  10. package/plugins/generations/episode-plan-gen/src/index.ts +11 -0
  11. package/plugins/generations/image-gen/dist/index.js +2296 -53
  12. package/plugins/generations/image-gen/src/providers/agnes.ts +110 -0
  13. package/plugins/generations/image-gen/src/providers/azure.ts +153 -0
  14. package/plugins/generations/image-gen/src/providers/codex-cli.ts +170 -0
  15. package/plugins/generations/image-gen/src/providers/dashscope.ts +485 -0
  16. package/plugins/generations/image-gen/src/providers/google.ts +268 -0
  17. package/plugins/generations/image-gen/src/providers/huggingface.ts +59 -0
  18. package/plugins/generations/image-gen/src/providers/jimeng.ts +259 -0
  19. package/plugins/generations/image-gen/src/providers/minimax.ts +171 -0
  20. package/plugins/generations/image-gen/src/providers/openai.ts +319 -0
  21. package/plugins/generations/image-gen/src/providers/openrouter.ts +257 -0
  22. package/plugins/generations/image-gen/src/providers/refs.ts +24 -0
  23. package/plugins/generations/image-gen/src/providers/replicate.ts +279 -0
  24. package/plugins/generations/image-gen/src/providers/seedream.ts +1 -1
  25. package/plugins/generations/image-gen/src/providers/types.ts +52 -51
  26. package/plugins/generations/image-gen/src/providers/zai.ts +237 -0
  27. package/plugins/generations/news-report-gen/dist/index.js +22193 -0
  28. package/plugins/generations/news-report-gen/package.json +17 -0
  29. package/plugins/generations/news-report-gen/plugin.json +7 -0
  30. package/plugins/generations/news-report-gen/src/index.ts +308 -0
  31. package/plugins/generations/news-report-gen/tsconfig.json +4 -0
  32. package/plugins/generations/omni-voice-gen/Makefile +14 -0
  33. package/plugins/generations/omni-voice-gen/README.md +118 -0
  34. package/plugins/generations/omni-voice-gen/bin/omni-voice-gen +2 -0
  35. package/plugins/generations/omni-voice-gen/dist/omni-voice-gen-prr8skpb. +2 -0
  36. package/plugins/generations/omni-voice-gen/dist/omni-voice-gen.js +6 -0
  37. package/plugins/generations/omni-voice-gen/plugin.json +6 -0
  38. package/plugins/generations/omni-voice-gen/profiles.json +16 -0
  39. package/plugins/generations/omni-voice-gen/pyproject.toml +25 -0
  40. package/plugins/generations/omni-voice-gen/scripts/coverage_gate.py +74 -0
  41. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/__init__.py +1 -0
  42. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/__main__.py +39 -0
  43. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/audio.py +190 -0
  44. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/backend.py +161 -0
  45. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/contract.py +76 -0
  46. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/mp3.py +60 -0
  47. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/pipeline.py +305 -0
  48. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/profiles.py +108 -0
  49. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/qc.py +234 -0
  50. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/voicescript.py +340 -0
  51. package/plugins/generations/omni-voice-gen/uv.lock +3510 -0
  52. package/plugins/generations/omni-voice-gen/voices/robin-news.wav +0 -0
  53. package/plugins/generations/voice-gen/dist/index.js +30 -2
  54. package/plugins/generations/voice-gen/src/index.ts +16 -1
  55. package/plugins/generations/voice-gen/src/voicebox-client.ts +3 -1
  56. package/plugins/ingestions/aihot-ingest/dist/index.js +20 -0
  57. package/plugins/ingestions/horizon-ingest/dist/index.js +20 -0
  58. package/plugins/ingestions/last30days-ingest/dist/index.js +20 -0
  59. package/plugins/ingestions/web-search/dist/index.js +20 -0
  60. package/plugins/kk/commands/image-extract.md +40 -0
  61. package/plugins/kk/commands/image-generate.md +18 -1
  62. package/plugins/kk/commands/workflow-run.md +54 -22
  63. package/plugins/kk/config.example.yaml +5 -0
  64. package/plugins/kk/plugin.json +1 -1
  65. package/plugins/kk/scripts/kk-workflow-stages.ts +1226 -0
  66. package/plugins/kk/{workflows → scripts}/validate-voicescript.ts +4 -4
  67. package/plugins/kk/{workflows → scripts}/wrap-voicescript-doc.ts +7 -6
  68. package/plugins/kk/skills/audio-authoring/SKILL.md +11 -12
  69. package/plugins/kk/skills/image-authoring/SKILL.md +10 -3
  70. package/plugins/kk/skills/image-authoring/references/format-drafting.md +57 -0
  71. package/plugins/kk/skills/image-authoring/references/style-extraction.md +14 -9
  72. package/plugins/kk/skills/itc-generating/SKILL.md +2 -2
  73. package/plugins/kk/skills/itc-generating/references/generic-craft.md +1 -1
  74. package/plugins/kk/skills/itc-generating/references/platform-english.md +1 -1
  75. package/plugins/kk/skills/itc-generating/references/platform-wechat.md +1 -1
  76. package/plugins/kk/skills/storm-research/SKILL.md +5 -5
  77. package/plugins/kk/skills/topic/SKILL.md +7 -7
  78. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +219 -133
  79. package/plugins/kk/workflows/kk-itc.yaml +12 -29
  80. package/plugins/kk/workflows/kk-solo-podcast.yaml +72 -131
  81. package/plugins/kk/workflows/kk-storm-research.yaml +12 -62
  82. package/plugins/publishings/emdash-pub/dist/index.js +20 -0
  83. package/plugins/publishings/podcast-pub/dist/index.js +57 -3
  84. package/plugins/publishings/podcast-pub/src/index.ts +18 -2
  85. package/plugins/publishings/podcast-pub/src/show-notes.ts +56 -9
  86. package/plugins/publishings/qiita-pub/dist/index.js +20 -0
  87. package/plugins/publishings/surfdash-pub/dist/index.js +96 -6
  88. package/plugins/publishings/surfdash-pub/src/index.ts +109 -9
  89. package/plugins/publishings/zenn-pub/dist/index.js +20 -0
  90. package/plugins/sp/scripts/batch-preflight.mjs +346 -0
  91. package/plugins/sp/scripts/batch-preflight.ts +459 -0
  92. package/plugins/sp/scripts/daily-summary/daily-summary.mjs +615 -0
  93. package/plugins/sp/scripts/daily-summary/daily-summary.ts +846 -0
  94. package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
  95. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.mjs +223 -0
  96. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +367 -0
  97. package/plugins/sp/scripts/dogfood-testing/validate-report.mjs +132 -0
  98. package/plugins/sp/scripts/dogfood-testing/validate-report.ts +169 -0
  99. package/plugins/sp/scripts/feature-dev-precheck.mjs +171 -0
  100. package/plugins/sp/scripts/feature-dev-precheck.ts +238 -0
  101. package/plugins/sp/scripts/feature-sync-bounded.mjs +285 -0
  102. package/plugins/sp/scripts/feature-sync-bounded.ts +478 -0
  103. package/plugins/sp/scripts/history-anatomy-cache.mjs +902 -0
  104. package/plugins/sp/scripts/history-anatomy-cache.ts +1028 -0
  105. package/plugins/sp/scripts/idea-handoff.mjs +22 -0
  106. package/plugins/sp/scripts/idea-handoff.ts +44 -0
  107. package/plugins/sp/scripts/inline-pipeline-parity-check.ts +185 -0
  108. package/plugins/sp/scripts/inline-run-setup.ts +198 -0
  109. package/plugins/sp/scripts/pr-reviewing.mjs +769 -0
  110. package/plugins/sp/scripts/pr-reviewing.ts +925 -0
  111. package/plugins/sp/scripts/quality-gate.mjs +179 -0
  112. package/plugins/sp/scripts/quality-gate.ts +217 -0
  113. package/plugins/sp/scripts/script-contract-check.ts +319 -0
  114. package/plugins/sp/scripts/stage-registry-adapter.ts +1533 -0
  115. package/plugins/sp/scripts/surface-drift-inventory.ts +929 -0
  116. package/plugins/sp/scripts/task-evidence-precheck.ts +181 -0
  117. package/plugins/sp/scripts/task-size-precheck.ts +175 -0
  118. package/plugins/sp/scripts/transition-shim-check.ts +238 -0
  119. package/plugins/sp/scripts/validate-commands.ts +689 -0
  120. package/plugins/sp/scripts/validate-flag-contracts.ts +878 -0
  121. package/plugins/sp/scripts/verify-answer-lint.ts +530 -0
  122. package/plugins/sp/scripts/workflow-step-profile.mjs +316 -0
  123. package/plugins/sp/scripts/workflow-step-profile.ts +456 -0
  124. package/plugins/sp/scripts/wrapup-steps.mjs +373 -0
  125. package/plugins/sp/scripts/wrapup-steps.ts +466 -0
@@ -2,10 +2,10 @@
2
2
  /**
3
3
  * Runtime VoiceScript checker for kk-solo-podcast.
4
4
  *
5
- * Copied with the workflow YAML into $KK_WORKFLOWS_DIR (default
6
- * ~/.config/kk/workflows). Node/Bun builtins only — no @gobing-ai/* and no
7
- * relative imports into generations/voice-gen (those paths do not exist next
8
- * to the runtime copy).
5
+ * Resolved from the kk package (`plugins/kk/scripts/`) by `kk-workflow-stages.ts`,
6
+ * or from an explicit runtime override ($KK_WORKFLOWS_DIR / ~/.config/kk/workflows)
7
+ * when one exists. Node/Bun builtins only — no @gobing-ai/* and no relative imports
8
+ * into generations/voice-gen (those paths do not exist outside the package).
9
9
  *
10
10
  * SYNC: plugins/generations/voice-gen/src/voicescript.ts (validateVoiceScript
11
11
  * + engine/language enums + text/instruct/chunk/crossfade caps). Keep error
@@ -2,13 +2,14 @@
2
2
  /**
3
3
  * Runtime VoiceScript→Doc[] wrapper for kk-solo-podcast.
4
4
  *
5
- * Copied with the workflow YAML into $KK_WORKFLOWS_DIR (default
6
- * ~/.config/kk/workflows). Node/Bun builtins only — no @gobing-ai/* and no
7
- * relative imports (those paths do not exist next to the runtime copy).
5
+ * Resolved from the kk package (`plugins/kk/scripts/`) by `kk-workflow-stages.ts`,
6
+ * or from an explicit runtime override ($KK_WORKFLOWS_DIR / ~/.config/kk/workflows)
7
+ * when one exists. Node/Bun builtins only — no @gobing-ai/* and no relative imports
8
+ * (those paths do not exist outside the package).
8
9
  *
9
- * SYNC: plugins/kk/workflows/kk-solo-podcast.yaml (wrap-docs state shells this
10
- * script with scriptPath, outPath, voiceProfile argv). The wrap shape must stay
11
- * a single-Doc array with sha256(file://scriptPath)[0:16] id — voice-gen and
10
+ * SYNC: plugins/kk/scripts/kk-workflow-stages.ts (its `wrap` verb delegates here with the
11
+ * scriptPath, outPath, voiceProfile argv the kk-solo-podcast wrap-docs state passes). The wrap
12
+ * shape must stay a single-Doc array with sha256(file://scriptPath)[0:16] id — voice-gen and
12
13
  * tests depend on it.
13
14
  */
14
15
  import { createHash } from 'node:crypto';
@@ -65,13 +65,12 @@ directly.
65
65
  | Artifact | Path | Written by |
66
66
  | --- | --- | --- |
67
67
  | Brief (input) | `brief.md` | supplied before invocation — topic phrase or Markdown brief |
68
- | Briefing | `1-briefing/briefing.md` | `briefing` — thesis, takeaways, audience, duration, tone |
68
+ | Briefing | `1-briefing-briefing.md` | `briefing` — thesis, takeaways, audience, duration, tone |
69
69
  | Outline options | `2-outline/outline-option-a.md`, `outline-option-b.md`, `outline-option-c.md` | `outline` — always two or three (a and b required; c optional) |
70
70
  | Approved outline | `2-outline/outline-approved.md` | `outline` — after explicit operator selection |
71
- | VoiceScript | `3-script/voicescript.yaml` | `script` — from the approved outline only |
71
+ | VoiceScript | `3-script-voicescript.yaml` | `script` — from the approved outline only |
72
72
 
73
- Each operation creates the directory it writes into (`1-briefing/`, `2-outline/`,
74
- `3-script/`) when absent. No other files are created — no metadata, no JSON
73
+ Each operation creates the directory it writes into (`2-outline/`) when absent; single-file stages write `<step>-<name>` at the workspace root. No other files are created — no metadata, no JSON
75
74
  manifests, no templates, no placeholders.
76
75
 
77
76
  ## Modes
@@ -101,7 +100,7 @@ from any existing approved artifact:
101
100
  2. **Outline** — if `2-outline/outline-approved.md` is missing, run the `outline`
102
101
  semantics (write options, selection gate). If it exists, reuse it — do not
103
102
  regenerate.
104
- 3. **Script** — if `3-script/voicescript.yaml` is missing, run the `script` semantics
103
+ 3. **Script** — if `3-script-voicescript.yaml` is missing, run the `script` semantics
105
104
  (write + review gate). If it exists and is approved, report it as final — do not
106
105
  rewrite.
107
106
  4. **Report** the final artifact paths and stop. Never re-run a completed step; never
@@ -110,15 +109,15 @@ from any existing approved artifact:
110
109
  ### briefing
111
110
 
112
111
  1. **Prerequisite** (fail loud): `brief.md` missing → stop with recovery ("supply a
113
- brief at `<dir>/brief.md` first"). `1-briefing/briefing.md` exists without
112
+ brief at `<dir>/brief.md` first"). `1-briefing-briefing.md` exists without
114
113
  `--force` → stop before replacing.
115
- 2. **Read** `brief.md` and write `1-briefing/briefing.md`: core thesis, key listener
114
+ 2. **Read** `brief.md` and write `1-briefing-briefing.md`: core thesis, key listener
116
115
  takeaways, audience profile, target spoken duration (`--duration` minutes), tone,
117
116
  and what material from the brief to emphasize or cut.
118
117
 
119
118
  ### outline
120
119
 
121
- 1. **Prerequisite** (fail loud): `1-briefing/briefing.md` missing → stop with
120
+ 1. **Prerequisite** (fail loud): `1-briefing-briefing.md` missing → stop with
122
121
  recovery ("run `briefing` or `create` first").
123
122
  2. **Resume**: `2-outline/outline-approved.md` exists → reuse it; without `--force`,
124
123
  stop before replacing.
@@ -135,10 +134,10 @@ from any existing approved artifact:
135
134
  1. **Prerequisite** (fail loud): `2-outline/outline-approved.md` missing → stop with
136
135
  recovery ("run `outline` or `create` first — never script before outline
137
136
  approval").
138
- 2. **Resume**: `3-script/voicescript.yaml` exists → without `--force` or `--revise`,
137
+ 2. **Resume**: `3-script-voicescript.yaml` exists → without `--force` or `--revise`,
139
138
  stop before replacing ("script exists at `<path>`; to revise pass `--revise
140
139
  <feedback>`, to replace pass `--force`").
141
- 3. **Write** `3-script/voicescript.yaml` from the approved outline only, obeying the
140
+ 3. **Write** `3-script-voicescript.yaml` from the approved outline only, obeying the
142
141
  VoiceScript contract and the spoken-budget rule below. Solo mode shape: one
143
142
  speaker, **no** `speakers` map, per-segment `profile` omitted. Emit only valid
144
143
  YAML — no markdown fences, no repo or docs paths in the file body.
@@ -155,9 +154,9 @@ from any existing approved artifact:
155
154
  ## VoiceScript contract
156
155
 
157
156
  The authoring template lives at **`templates/voicescript.solo.yaml`** (relative to
158
- this skill file) — read it first when authoring `3-script/voicescript.yaml`; it is a
157
+ this skill file) — read it first when authoring `3-script-voicescript.yaml`; it is a
159
158
  valid-YAML skeleton with per-field constraint comments. The executable authority is
160
- `plugins/kk/workflows/validate-voicescript.ts` (canonical source
159
+ `plugins/kk/scripts/validate-voicescript.ts` (canonical source
161
160
  `plugins/generations/voice-gen/src/voicescript.ts`); the template is its
162
161
  authoring-time distillation. No other fields are valid authoring targets — do not
163
162
  invent fields (no `default_profile`, no required `title`).
@@ -86,8 +86,10 @@ owns the schema-fill rules, the multi-image merge rules, the cap-5 refusal wordi
86
86
  where the preset is written (user root, shadowing by design), and the validation step:
87
87
  read the images with your own vision, write `~/.config/kk/image-presets/styles/<name>.yaml`
88
88
  filling exactly the `StylePreset` fields, then validate with a `KK_IMAGE_DRY_RUN=1` run
89
- whose `style` is the new preset's name. Extraction never writes a `formats/*.yaml` —
90
- a format is not recoverable from a picture.
89
+ whose `style` is the new preset's name. Extraction writes `styles/*.yaml`; with
90
+ `--emit-format <name> --job <job>` it additionally **drafts** a `formats/*.yaml` from
91
+ the same references — a different act with its own authoritative procedure:
92
+ [references/format-drafting.md](references/format-drafting.md).
91
93
 
92
94
  ### list-presets
93
95
 
@@ -109,6 +111,7 @@ output is also the text an unknown `--format`/`--style` refusal quotes.
109
111
  [prompt] [--format <name>] [--style <name>] [--var KEY=VALUE]... [--content <file>]
110
112
  [--ref <path>]... [--count <n>] [--provider <name>] [--model <id>]
111
113
  [--out <dir|file>] [--dry-run] [--list-presets] [--extract-style <name>]
114
+ [--emit-format <name> --job <job>]
112
115
  ```
113
116
 
114
117
  | Token | Meaning | Default |
@@ -126,11 +129,15 @@ output is also the text an unknown `--format`/`--style` refusal quotes.
126
129
  | `--dry-run` | compose and price, generate nothing | off |
127
130
  | `--list-presets` | → the `list-presets` operation | — |
128
131
  | `--extract-style <name>` | → the `extract-style` operation; **requires `--ref`** | — |
132
+ | `--emit-format <name>` | with `--extract-style`: also draft a format preset from the same refs; **requires `--job`** | — |
133
+ | `--job free\|cover\|illustration` | declared job for the drafted format — never inferred from pixels | — |
129
134
 
130
135
  **Validation is this skill's, before any plugin spawn**, each refusal naming the
131
136
  offending argument: unknown `--format` or `--style` (quote what `list-presets` would
132
137
  show); `--count` on a non-`illustration` job; more than five `--ref` paths;
133
- `--extract-style` without `--ref`; a `--content` file that does not exist. Flags the
138
+ `--extract-style` without `--ref`; `--emit-format` without `--extract-style` or
139
+ without `--job`, or a `--job` outside `free|cover|illustration`; a `--content` file
140
+ that does not exist. Flags the
134
141
  wt plugin retired are **answered, not ignored** — state the replacement and stop; the
135
142
  table lives in
136
143
  [references/migrating-from-wt.md](references/migrating-from-wt.md)
@@ -0,0 +1,57 @@
1
+ # Format drafting from reference images
2
+
3
+ Loaded by the image-authoring skill when `extract-style` runs with
4
+ `--emit-format <name> --job <job>`. Produces a **draft** `FormatPreset` from the same
5
+ reference images, for the operator to confirm and fine-tune. This is drafting, not
6
+ extraction: a picture supplies measurements and visual defaults, never job semantics
7
+ or variable contracts — those are **declared** or **reused**, and the report must say
8
+ which is which.
9
+
10
+ ## Field provenance — three tiers, never blurred
11
+
12
+ | Tier | Fields | Source |
13
+ | ---- | ------ | ------ |
14
+ | **Measured** | `aspectRatio`, `width`, `height` | Observed pixel dimensions of the largest reference; `aspectRatio` is the nearest named ratio from `21:9`, `4:3`, `1:1`, `16:9`, `3:4`, `9:16`. No taste involved. |
15
+ | **Declared** | `name`, `job` | The operator's `--emit-format <name>` and `--job <job>`. `job` is never inferred from pixels — a picture does not know whether it is a cover. |
16
+ | **Drafted** | `description`, `keywords`, visual `variables` defaults, `template` | Agent vision over the same references the style came from. Fine-tuning expected. |
17
+ | **Reused** | `defaultStyle`, `outputFilename`, variable names, template grammar | See skeleton rule below. `defaultStyle` is the `--extract-style <name>` of this same run — the pairing is the point of doing both in one pass. |
18
+
19
+ ## The skeleton rule
20
+
21
+ Start from the shipped format of the **same job** —
22
+ `plugins/generations/image-gen/presets/formats/<job>.yaml` — read it first, then:
23
+
24
+ - **Keep** its variable names, `outputFilename` grammar, and template placeholder
25
+ structure. The variable-to-article mapping (`{{title}}`, `{{topics}}`, …) is a
26
+ contract with the skill's `cover`/`illustration` branches; renaming variables
27
+ silently breaks `--content` derivation.
28
+ - **Re-author** the visual defaults from the image analysis: `description`,
29
+ `keywords`, and the default values of the visual variables (`visual_style`,
30
+ `composition`, `color_palette`, `atmosphere`, `mood`, or their skeleton
31
+ equivalents) so the drafted prompt would reproduce the reference look.
32
+ - A `free` job needs no `--content` variables; keep the skeleton minimal.
33
+
34
+ ## Output rules
35
+
36
+ Emit **YAML only**, filling **exactly** the `FormatPreset` fields of
37
+ `plugins/generations/image-gen/src/presets.ts` (`name`, `description`, `job`,
38
+ `aspectRatio`, optional `width`/`height`, `defaultStyle`, `keywords`,
39
+ `outputFilename`, `variables`, `template`) — inventing a field is a defect, same rule
40
+ as style extraction. Multi-image merge follows the style-extraction rule: visual
41
+ defaults reflect traits present in **every** reference; discarded divergent traits are
42
+ named in the report.
43
+
44
+ ## Where the preset goes
45
+
46
+ Write to the **user root**: `~/.config/kk/image-presets/formats/<name>.yaml`, after
47
+ showing the composed YAML and getting confirmation (interactive; the Confirmation
48
+ policy governs). Same-name shipped formats are shadowed whole-file — intended, as
49
+ with styles. No registration step; the 0102 loader scans the roots.
50
+
51
+ ## Validation
52
+
53
+ Before reporting done, run one `KK_IMAGE_DRY_RUN=1` generation whose `format` is the
54
+ new preset's name (and whose `style` is the run's extracted style), then report the
55
+ composed prompt from that run's `Content.body`. The report must list each field's
56
+ tier — measured / declared / drafted / reused — so the operator knows exactly what to
57
+ fine-tune.
@@ -76,15 +76,20 @@ presets and not an average:
76
76
  - `confidence` — capped at `medium` when the set disagrees on any fidelity axis.
77
77
  - `source.refImages` — all N absolute paths, in the order given.
78
78
 
79
- ## What extraction never writes
80
-
81
- **Style only — no format extraction in v1.** A `FormatPreset` carries
82
- `template`, `variables`, `keywords`, `defaultStyle`, `outputFilename` — none of
83
- which is recoverable from a picture. Never write a `formats/*.yaml` file. What
84
- an image *does* yield is arithmetic, not extraction: the extraction report
85
- **states the observed pixel dimensions and the nearest named aspect ratio** of
86
- each reference, chosen from `21:9`, `4:3`, `1:1`, `16:9`, `3:4`, `9:16`, as a
87
- suggestion for which existing format to pair the style with.
79
+ ## What extraction writes
80
+
81
+ **Style by default; format drafting is opt-in.** A `FormatPreset` carries `template`,
82
+ `variables`, `keywords`, `defaultStyle`, `outputFilename` — none of which is
83
+ *recoverable* from a picture, so extraction alone never writes a `formats/*.yaml`.
84
+ What an image *does* yield is arithmetic: the extraction report **states the observed
85
+ pixel dimensions and the nearest named aspect ratio** of each reference, chosen from
86
+ `21:9`, `4:3`, `1:1`, `16:9`, `3:4`, `9:16`.
87
+
88
+ When the operator passes `--emit-format <name> --job <job>` alongside `--extract-style`,
89
+ that arithmetic plus the same visual analysis feeds a **draft** format preset — measured
90
+ fields taken, visual defaults authored, structural fields reused from the shipped
91
+ skeleton, operator fine-tuning expected. That procedure lives in
92
+ [format-drafting.md](format-drafting.md); this file stays style-only.
88
93
 
89
94
  ## Pass-through degradation (visible, never silent)
90
95
 
@@ -82,7 +82,7 @@ workspace — it delegates to `topic`, which writes exactly these paths:
82
82
  | Brief | `brief.md` | `topic` `init` |
83
83
  | Outline options | `2-outline/outline-option-{a,b,c}.md` | `topic` `outline` |
84
84
  | Approved outline | `2-outline/outline-approved.md` | `topic` `outline` (after selection gate) |
85
- | Draft | `3-draft/draft-article.md` | `topic` `draft` (from approved outline, review gate) |
85
+ | Draft | `3-draft-draft-article.md` | `topic` `draft` (from approved outline, review gate) |
86
86
 
87
87
  ## create sequence
88
88
 
@@ -104,7 +104,7 @@ workspace — it delegates to `topic`, which writes exactly these paths:
104
104
  show-don't-tell with diagrams/examples, accessibility) plus the platform playbook's constraints
105
105
  (e.g. WeChat mobile formatting or English-platform framing). The draft is written by `topic`
106
106
  from the approved outline; the method shapes it.
107
- 6. **Optional judge gate** — if `--judge` and `3-draft/draft-article.md` is approved, invoke
107
+ 6. **Optional judge gate** — if `--judge` and `3-draft-draft-article.md` is approved, invoke
108
108
  `content-judge` with the `tech-accuracy` rubric. A non-`PASS` verdict is reported to the operator; it
109
109
  does **not** auto-publish and does not auto-revise past `topic`'s 3-round bound.
110
110
  7. **Print** the final artifact paths and stop.
@@ -74,7 +74,7 @@ all five disciplines while authoring the draft.
74
74
 
75
75
  ## Applying this in `create`
76
76
 
77
- While drafting `3-draft/draft-article.md` (after `topic`'s outline gate), apply: one goal per
77
+ While drafting `3-draft-draft-article.md` (after `topic`'s outline gate), apply: one goal per
78
78
  document enforced at the draft-review gate; the Value Proposition as a scope firewall; explicit
79
79
  prerequisites and POLA; show-don't-tell with diagrams/examples; and accessibility. The `--judge`
80
80
  gate then verifies technical accuracy against the rubric.
@@ -69,4 +69,4 @@ for the draft — never reimplements publishing.
69
69
 
70
70
  Load this reference when `--playbook english`. It informs the draft's framing (audience, voice,
71
71
  platform-native format) and the distribution plan, but the deliverable stays `topic`'s
72
- `3-draft/draft-article.md` — this playbook never publishes and never writes a parallel artifact.
72
+ `3-draft-draft-article.md` — this playbook never publishes and never writes a parallel artifact.
@@ -56,5 +56,5 @@ compliance constraints — never reimplements registration, publishing, or the A
56
56
 
57
57
  Load this reference when `--playbook wechat`. It informs the draft's structure (mobile-first
58
58
  formatting, Chinese-language expectations, title/abstract limits, review rigor) but the deliverable
59
- stays `topic`'s `3-draft/draft-article.md` — this playbook never registers an account, never
59
+ stays `topic`'s `3-draft-draft-article.md` — this playbook never registers an account, never
60
60
  publishes, and never touches the WeChat API.
@@ -68,7 +68,7 @@ skill is also callable directly as `Skill(skill="storm-research", args="<topic|-
68
68
  A question constrains the search and the report; a noun phrase invites scope creep.
69
69
  2. **Choose input**: topic sentence, or a markdown file via `--in` (XOR). File mode derives the
70
70
  query from the first ATX H1 (`/^#\s+(.+)$/m`), else the basename without extension.
71
- 3. **`work_dir` is the resolved topic directory** `$works_dir/<topic-id>`, computed by the
71
+ 3. **`work_dir` is the resolved topic directory** `$works_dir/kk-storm-research/<topic-id>`, computed by the
72
72
  invoker (the command or the operator) via the 0056 `topicId()` algorithm — never by the
73
73
  workflow. `prepare` only `mkdir` + materializes files into `${vars.work_dir}`.
74
74
  4. **Pick fixture vs live** (see below). Default is live (`fixture: "false"`); pass
@@ -95,7 +95,7 @@ skill is also callable directly as `Skill(skill="storm-research", args="<topic|-
95
95
 
96
96
  ## Works layout (0056, frozen; ADR-013 adds `references/`)
97
97
 
98
- Per-topic workspace at `$works_dir/<topic-id>/`:
98
+ Per-topic workspace at `$works_dir/kk-storm-research/<topic-id>/`:
99
99
 
100
100
  | File | Written by | Contents |
101
101
  | --- | --- | --- |
@@ -108,7 +108,7 @@ Per-topic workspace at `$works_dir/<topic-id>/`:
108
108
  | `references/<doc-id>.md` | ingest (live path only) | normalized full content per source (`/v2/scrape` → markitdown); file name = Doc id; audit trail and the citation-resolution target for the report tail (ADR-013) |
109
109
 
110
110
  Contrast: `topic`'s authoring workspace is `./<kebab-case(topic)>` with `brief.md` /
111
- `2-outline/` / `3-draft/` and explicitly excludes research. C4 works live under `$works_dir`,
111
+ `2-outline/` / `3-draft-draft-article.md` and explicitly excludes research. C4 works live under `$works_dir`,
112
112
  outside any repo.
113
113
 
114
114
  ## Live vs fixture
@@ -130,8 +130,8 @@ outside any repo.
130
130
  | Both `<topic>` and `--in` set, or neither | exit 1, stderr states the XOR rule; no writes | pass exactly one of `topic` / `--in` |
131
131
  | `--in` file unreadable (missing / I/O) | exit 1, stderr names the path | fix the path / permissions |
132
132
  | Derived query / topic-id empty (no H1 and empty basename) | exit 1, stderr shows the derived value | add an H1 or give the file a real name |
133
- | Dest `$workflows_dir/<name>.yaml` exists with different bytes | warning, **no overwrite**; run proceeds with the user's copy | re-run with `--force` to replace from the install source |
134
- | Workflow YAML cannot be resolved from any install source | exit 1, stderr lists the roots searched (`KK_WORKFLOWS_SOURCE`, `plugins/kk/workflows`) | reinstall the package / set `KK_WORKFLOWS_SOURCE` |
133
+ | Resolved YAML is the user override while an installed copy differs | run proceeds with the override (no drift warning) | re-run with `--force` to refresh the override from the install source |
134
+ | Workflow YAML cannot be resolved from any install source | exit 1, stderr lists the roots searched (user override, `KK_WORKFLOWS_SOURCE`, bun/npm global installs, kk package root, `plugins/kk/workflows`) | reinstall the package / set `KK_WORKFLOWS_SOURCE` |
135
135
  | `KK_CONFIG` set but unreadable, or config unparseable / invalid types | exit 1, stderr names the key + expected vs actual type | fix the file, or delete it (recreated with defaults next run) |
136
136
  | Missing config at `KK_CONFIG` | **not a failure** — create-on-first-run with compiled defaults; an existing file is never overwritten | — |
137
137
  | `markitdown` missing from `PATH` (live mode) | ingest exit 1, stderr `web-search failed: markitdown is not on PATH`; probed before any network call, so no `docs.json` write | install markitdown / put it on `PATH`, re-run ingest |
@@ -64,9 +64,9 @@ All paths are relative to the workspace `--dir`. Every operation uses these exac
64
64
  | Brief | `brief.md` | `init` — topic line, or verbatim copy of the supplied brief |
65
65
  | Outline options | `2-outline/outline-option-a.md`, `outline-option-b.md`, `outline-option-c.md` | `outline` — always two or three (a and b required; c optional) |
66
66
  | Approved outline | `2-outline/outline-approved.md` | `outline` — after explicit operator selection |
67
- | Draft | `3-draft/draft-article.md` | `draft` — from the approved outline only |
67
+ | Draft | `3-draft-draft-article.md` | `draft` — from the approved outline only |
68
68
 
69
- `init` creates `brief.md`, `2-outline/`, and `3-draft/`. No other files are created — no
69
+ `init` creates `brief.md` and `2-outline/`; `draft` writes `3-draft-draft-article.md` at the workspace root. No other files are created — no
70
70
  metadata, no JSON manifests, no templates, no placeholders.
71
71
 
72
72
  ## Operations
@@ -79,7 +79,7 @@ existing approved artifact (R3):
79
79
  1. **Resolve the brief** — topic phrase or `--brief` file; run the `init` semantics.
80
80
  2. **Outline** — if `2-outline/outline-approved.md` is missing, run the `outline`
81
81
  semantics (write options, selection gate). If it exists, reuse it — do not regenerate.
82
- 3. **Draft** — if `3-draft/draft-article.md` is missing, run the `draft` semantics (write
82
+ 3. **Draft** — if `3-draft-draft-article.md` is missing, run the `draft` semantics (write
83
83
  + review gate). If it exists and is approved, report it as final — do not rewrite.
84
84
  4. **Report** the final artifact paths and stop. Never re-run a completed step; never
85
85
  overwrite an existing approved artifact without `--force`.
@@ -94,7 +94,7 @@ existing approved artifact (R3):
94
94
  after explicit operator confirmation to replace, or choose a new `--dir`). Never delete
95
95
  or overwrite existing content without `--force`.
96
96
  3. **Create** `brief.md` (the topic line, or a verbatim copy of the supplied brief),
97
- `2-outline/`, and `3-draft/`.
97
+ `2-outline/`, and the flattened `3-draft-draft-article.md`.
98
98
  4. **Print** the workspace layout and the next step (`outline` or `create`).
99
99
 
100
100
  ### outline
@@ -117,16 +117,16 @@ existing approved artifact (R3):
117
117
 
118
118
  1. **Prerequisite** (fail loud, R5): `2-outline/outline-approved.md` missing → stop with
119
119
  recovery ("run `outline` or `create` first — never draft before outline approval").
120
- 2. **Resume** (R3): `3-draft/draft-article.md` exists → without `--force` or `--revise`,
120
+ 2. **Resume** (R3): `3-draft-draft-article.md` exists → without `--force` or `--revise`,
121
121
  stop before replacing ("draft exists at `<path>`; to revise pass `--revise <feedback>`,
122
122
  to replace pass `--force` after explicit operator approval").
123
- 3. **Write** `3-draft/draft-article.md` from the approved outline only.
123
+ 3. **Write** `3-draft-draft-article.md` from the approved outline only.
124
124
  4. **Review gate** (R1): present the draft; offer **approve** or **revision**. Bounded
125
125
  revision: at most **3 revision rounds**; each round takes `--revise <feedback>`,
126
126
  rewrites the draft from the approved outline plus the feedback, and re-presents it.
127
127
  After 3 rounds, stop and require an explicit operator decision (approve, restart from
128
128
  the outline, or abandon) — never loop past the bound.
129
- 5. **On approval**, the existing `3-draft/draft-article.md` is the approved artifact;
129
+ 5. **On approval**, the existing `3-draft-draft-article.md` is the approved artifact;
130
130
  record the approval and stop. Print the final draft path.
131
131
 
132
132
  ## Fail-loud table (R5)