@gobing-ai/knowledge-kit 0.0.6 → 0.0.8

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 (50) hide show
  1. package/dist/index.js +21643 -11933
  2. package/package.json +4 -1
  3. package/plugins/generations/content-gen/package.json +2 -1
  4. package/plugins/generations/content-gen/src/index.ts +9 -8
  5. package/plugins/generations/content-gen/src/storm.ts +12 -4
  6. package/plugins/generations/voice-gen/package.json +17 -0
  7. package/plugins/generations/voice-gen/plugin.json +6 -0
  8. package/plugins/generations/voice-gen/src/concat.ts +218 -0
  9. package/plugins/generations/voice-gen/src/index.ts +213 -0
  10. package/plugins/generations/voice-gen/src/voicebox-client.ts +223 -0
  11. package/plugins/generations/voice-gen/src/voicescript.ts +365 -0
  12. package/plugins/generations/voice-gen/tsconfig.json +8 -0
  13. package/plugins/ingestions/karakeep-local/package.json +17 -0
  14. package/plugins/ingestions/karakeep-local/src/index.ts +31 -26
  15. package/plugins/ingestions/karakeep-local/tsconfig.json +4 -0
  16. package/plugins/ingestions/web-search/package.json +4 -1
  17. package/plugins/ingestions/web-search/src/index.ts +299 -17
  18. package/plugins/kk/README.md +12 -1
  19. package/plugins/kk/commands/workflow-run.md +202 -0
  20. package/plugins/kk/config.example.yaml +34 -0
  21. package/plugins/kk/scripts/render-md.ts +150 -0
  22. package/plugins/kk/skills/{kk-judge → content-judge}/SKILL.md +13 -14
  23. package/plugins/kk/skills/{kk-judge → content-judge}/references/rubrics.md +2 -2
  24. package/plugins/kk/skills/{kk-judge → content-judge}/references/workflow-integration.md +17 -15
  25. package/plugins/kk/skills/itc-generating/SKILL.md +147 -0
  26. package/plugins/kk/skills/itc-generating/references/generic-craft.md +80 -0
  27. package/plugins/kk/skills/itc-generating/references/platform-english.md +72 -0
  28. package/plugins/kk/skills/itc-generating/references/platform-wechat.md +60 -0
  29. package/plugins/kk/skills/itc-generating/references/skill-authoring.md +62 -0
  30. package/plugins/kk/skills/storm-research/SKILL.md +173 -0
  31. package/plugins/kk/skills/{kk-topic → topic}/SKILL.md +4 -4
  32. package/plugins/kk/workflows/judge-gated-publish-example.yaml +101 -0
  33. package/plugins/kk/workflows/kk-ingest-generate-publish.yaml +72 -0
  34. package/plugins/kk/workflows/kk-itc.yaml +285 -0
  35. package/plugins/kk/workflows/kk-solo-podcast.yaml +374 -0
  36. package/plugins/kk/workflows/kk-storm-research.yaml +184 -0
  37. package/plugins/kk/workflows/validate-voicescript.ts +226 -0
  38. package/plugins/publishings/emdash-pub/package.json +17 -0
  39. package/plugins/publishings/emdash-pub/plugin.json +7 -0
  40. package/plugins/publishings/emdash-pub/src/index.ts +450 -0
  41. package/plugins/publishings/emdash-pub/tsconfig.json +4 -0
  42. package/plugins/publishings/qiita-pub/package.json +2 -1
  43. package/plugins/publishings/qiita-pub/src/index.ts +9 -9
  44. package/plugins/publishings/surfdash-pub/package.json +2 -1
  45. package/plugins/publishings/surfdash-pub/src/index.ts +16 -11
  46. package/plugins/publishings/zenn-pub/package.json +2 -1
  47. package/plugins/publishings/zenn-pub/src/index.ts +11 -11
  48. package/plugins/kk/agents/kk-judge-compliance.md +0 -37
  49. package/plugins/kk/agents/kk-judge-tech.md +0 -35
  50. package/plugins/kk/agents/kk-judge-tone.md +0 -37
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: itc-generating
3
+ description: >-
4
+ Use the itc-generating skill to produce an approved IT technical draft from a
5
+ topic or Markdown brief, applying the distilled generic IT-writing method and
6
+ an optional platform playbook — "write an article about X applying the IT
7
+ writing method", "generate an IT technical draft on X", "create a technical
8
+ article for WeChat/English platforms". Orchestrates topic (outline + draft),
9
+ optional storm-research, and optional content-judge without enlarging those skills.
10
+ ---
11
+
12
+ # itc-generating — IT technical draft generation (method + orchestration)
13
+
14
+ ## Purpose
15
+
16
+ Turn a topic or Markdown brief into an **approved IT technical draft** by applying the distilled
17
+ IT-writing craft and orchestrating the existing `kk` skills — `topic` (outline + draft), optional
18
+ `storm-research` (evidence), optional `content-judge` (technical-accuracy gate). One fat skill with one
19
+ operation, `create`, whose default is the distilled generic-craft method; it delegates outline
20
+ selection and draft review to `topic` and writes the **same topic artifact paths**. This skill owns
21
+ *which* method and *when* to research/judge — it never reimplements topic-core, research, or
22
+ evaluation (D6).
23
+
24
+ ## When to use
25
+
26
+ - A user asks to write an IT technical article from a topic or brief and wants the distilled
27
+ IT-writing method applied ("write an IT article about X", "produce a technical draft on X").
28
+ - A user wants a specific platform playbook applied to the draft (`--playbook english` / `wechat`).
29
+ - A user wants the same topic artifact contract but with the writing method and optional
30
+ research/judging orchestrated around it.
31
+
32
+ Do **not** use this skill for: a single topic-core step without the method (call `topic` directly);
33
+ research alone (call `storm-research`); evaluating content alone (call `content-judge`); publishing,
34
+ platform adaptation, or image generation (all out of scope); anything requiring a runtime plugin
35
+ (`kk executor run`, `plugin.json`, `GeneratorInput → Content`).
36
+
37
+ ## Invocation contract
38
+
39
+ `$ARGUMENTS` (or the Skill call args) parse as:
40
+
41
+ ```
42
+ [create] <topic-or-brief> [--dir <target>] [--brief <path>]
43
+ [--playbook generic|english|wechat]
44
+ [--research] [--judge]
45
+ [--outline <a|b|c>] [--revise <feedback>] [--force]
46
+ ```
47
+
48
+ | Token | Meaning | Default |
49
+ | --- | --- | --- |
50
+ | `create` | the only operation; may be omitted | `create` |
51
+ | `<topic-or-brief>` | quoted topic phrase, or `--brief <path>` naming a Markdown brief file | required — empty fails loud |
52
+ | `--dir <target>` | workspace directory | `./<kebab-case(topic)>` (same default as `topic`) |
53
+ | `--playbook <p>` | which reference to load as the writing method | `generic` |
54
+ | `--research` | if the workspace has no evidence, run `storm-research` first | off |
55
+ | `--judge` | after an approved draft, run `content-judge` with the `tech-accuracy` rubric | off |
56
+ | `--outline <a\|b\|c>` | explicit outline selection (passed through to `topic`) | operator selects at the gate |
57
+ | `--revise <feedback>` | revision feedback for the draft review gate (passed through to `topic`) | none (approve path) |
58
+ | `--force` | explicit operator approval to replace an existing artifact (passed through to `topic`) | off — never overwrite without it |
59
+
60
+ Flags may appear in any order; the first bare positional token is the topic phrase. An unknown
61
+ operation (anything other than `create`) fails loud and lists `create` as the only valid operation.
62
+
63
+ ## References (loaded on demand, R2)
64
+
65
+ | File | When to load |
66
+ | --- | --- |
67
+ | `references/generic-craft.md` | **always** on every `create` run — the five IT-writing disciplines |
68
+ | `references/platform-english.md` | `--playbook english` — X / Medium / Substack playbook |
69
+ | `references/platform-wechat.md` | `--playbook wechat` — WeChat Official Account playbook |
70
+ | `references/skill-authoring.md` | when reviewing or editing this skill — why it stays lean |
71
+
72
+ The four STORM studies remain in the works dirs (`~/.config/kk/works/`) as provenance; the skill
73
+ body and references do **not** vendor the full reports (D4).
74
+
75
+ ## Artifact contract (reuses topic, D5)
76
+
77
+ All paths are relative to the workspace `--dir`. This skill does **not** invent a parallel
78
+ workspace — it delegates to `topic`, which writes exactly these paths:
79
+
80
+ | Artifact | Path | Written by |
81
+ | --- | --- | --- |
82
+ | Brief | `brief.md` | `topic` `init` |
83
+ | Outline options | `2-outline/outline-option-{a,b,c}.md` | `topic` `outline` |
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) |
86
+
87
+ ## create sequence
88
+
89
+ 1. **Input check** (fail loud, R5): empty topic and no `--brief` → stop with recovery. A `--brief`
90
+ path that does not exist → stop with recovery.
91
+ 2. **Target check** (fail loud, R5): if `--dir` exists with a `brief.md` and no `--force` → stop
92
+ with recovery ("initialization target already exists at `<dir>`; pass `--force` after explicit
93
+ operator confirmation to replace, or choose a new `--dir`"). Never overwrite without `--force`.
94
+ 3. **Load the method** — read `references/generic-craft.md` (always) plus the selected playbook if
95
+ `--playbook` is not `generic` (R2). If `--research` and the workspace has no reusable evidence,
96
+ invoke `storm-research` on the topic (XOR: a topic phrase or `--in <file>`); re-run research
97
+ only when the query or sources must change — reuse existing `docs.json` otherwise.
98
+ 4. **Delegate to `topic`** — run `topic create` against `--dir` with the same artifact contract and
99
+ gates: outline options → explicit selection gate (`--outline <a|b|c>` or interactive) → approved
100
+ outline → draft → review gate (approve or bounded `--revise`). This skill never reimplements
101
+ those gates (R1, R3).
102
+ 5. **Apply the method while drafting** — using the loaded references, apply the five disciplines
103
+ (one goal per document, value proposition as scope firewall, explicit prerequisites and POLA,
104
+ show-don't-tell with diagrams/examples, accessibility) plus the platform playbook's constraints
105
+ (e.g. WeChat mobile formatting or English-platform framing). The draft is written by `topic`
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
108
+ `content-judge` with the `tech-accuracy` rubric. A non-`PASS` verdict is reported to the operator; it
109
+ does **not** auto-publish and does not auto-revise past `topic`'s 3-round bound.
110
+ 7. **Print** the final artifact paths and stop.
111
+
112
+ ## Fail-loud table (R5)
113
+
114
+ | Condition | Behavior | Recovery instruction |
115
+ | --- | --- | --- |
116
+ | Empty topic and no `--brief` | Stop; no files created | Provide a topic phrase or `--brief <path>` |
117
+ | `--brief` path does not exist | Stop; no files created | Check the path; supply a real Markdown brief |
118
+ | `--research` with neither topic nor `--in` | Stop; nothing written | Pass exactly one of the topic / `--in <file>` to `storm-research` |
119
+ | Missing prerequisite artifact (e.g. outline before draft) | Stop; nothing written | The recovery comes from `topic` — run the prerequisite step first (see `topic` fail-loud table) |
120
+ | Existing initialization target without `--force` | Stop; no overwrite | Confirm with the operator and pass `--force`, or choose a new `--dir` |
121
+ | Unknown operation | Stop; nothing written | Use `create` (the only operation) or call `topic` / `storm-research` / `content-judge` directly |
122
+
123
+ Every stop names the exact missing or existing path and the exact next command. Never silently
124
+ skip, never auto-replace, never delete.
125
+
126
+ ## Invariants
127
+
128
+ - `create` is the **only** operation. Research, illustration, adaptation, and publish operations
129
+ are **not** added to `topic` — this skill delegates to `storm-research` / `content-judge` (R3).
130
+ - Reuse `topic` artifact paths; never invent a parallel workspace (D5).
131
+ - `topic` / `storm-research` / `content-judge` contracts are unchanged (D6) — this skill only orchestrates.
132
+ - No `plugins/kk/commands/itc*.md`, no `kk` CLI noun/verb, no generator `plugin.json` (R4).
133
+ - Never overwrite an existing artifact without `--force`; bound draft revision at `topic`'s 3
134
+ rounds.
135
+ - No live publish, no external side effects beyond the delegated research call, no image generation.
136
+
137
+ ## Prompt template (Skill() / agent.run)
138
+
139
+ ```
140
+ Skill(skill="itc-generating",
141
+ args="<topic-or-brief> [--dir <target>] [--brief <path>] [--playbook generic|english|wechat] [--research] [--judge] [--outline <a|b|c>] [--revise <feedback>] [--force]")
142
+ ```
143
+
144
+ When invoked, follow the `create` sequence above. Load the references the flags select, delegate
145
+ outline selection and draft review to `topic`, and pause for the operator at `topic`'s gates. On
146
+ any stop, output the fail-loud recovery line. The artifact paths under the workspace `--dir` are
147
+ the handoff.
@@ -0,0 +1,80 @@
1
+ # Generic IT-writing craft — five disciplines
2
+
3
+ Distilled from the STORM study "How to Write the Best Generic IT Technical Documentation"
4
+ (works dir `how-to-write-the-best-generic-it-technical-docum-0a71c5a7`, provenance only — this
5
+ reference replaces vendoring the full report). Load this reference on every `create` run; apply
6
+ all five disciplines while authoring the draft.
7
+
8
+ ## 1. Structure and scope (the document architect)
9
+
10
+ - Pick the document types you actually need — and **stop**. There is no universal list; add a
11
+ document only when no existing one's goal absorbs the content.
12
+ - **One document, one goal**, enforced at review: reread after writing and remove or move
13
+ anything that does not serve that goal. Write everything first, then cut.
14
+ - **Write the Value Proposition (VP) first**: a one-page list of what the doc will do for its
15
+ reader (save time, reduce errors, cut training…). It says nothing about format or fonts. Use it
16
+ as a scope-creep firewall — keep content that supports a VP item, remove the rest.
17
+ - **Plan before writing**: research first (history → latest literature → what existing docs
18
+ already cover), then a documentation plan (scope, objectives, estimates, workflows, resources).
19
+ Do not over-invest in placement up front — move a document after it exists.
20
+ - **One goal per section** too: link out to other documents for prerequisites and detail instead
21
+ of inlining everything.
22
+
23
+ ## 2. Write for the reader (the reader advocate)
24
+
25
+ - **Profile the readership** enough to structure and customize for them. Do not assume background,
26
+ environment, context, or that they have read your other docs — link prerequisites instead of
27
+ inlining them.
28
+ - **Show, don't tell**: lead with diagrams (process flows, C4 views), then explain in prose.
29
+ Text-based diagrams (Mermaid, PlantUML) stay easy to update. Use at least one concrete example
30
+ early — a simple example beats an abstract description.
31
+ - **Principle of Least Astonishment (POLA)**: cover the gotchas and non-typical usage up front —
32
+ undocumented prerequisites, surprising defaults, implicit ordering. Name assumptions, defaults,
33
+ and prerequisites explicitly.
34
+ - **Long-form craft**: a succinct, jargon-free title; structure against the five Ws + H; write the
35
+ introduction last, once the content has settled.
36
+ - **Accessibility and inclusive writing** are concrete requirements: follow accessibility
37
+ guidelines for structure/language; use inclusive example names and bias-free language.
38
+
39
+ ## 3. Make it a team discipline (the engineering manager)
40
+
41
+ - **Budget for docs time**: measure how long SME review of writer output takes and factor it into
42
+ each release. Good docs are written once, read hundreds of times.
43
+ - **Close the specialized-skill gap**: technical writing is its own discipline (audience
44
+ understanding + logical presentation); bring in a technical writer or build review processes
45
+ that treat writing with the same rigor as code.
46
+ - **Embed docs in the engineering workflow**: docs reviews inside normal PR review, preview builds
47
+ on each check-in, docs as part of shipping every release — not a post-release afterthought.
48
+ - **Docs are coordination infrastructure** at team scale: they improve knowledge retention and
49
+ underpin quality, consistency, and compliance.
50
+ - **Build documentation mindshare**: state the problem, start in engineering, gather input
51
+ broadly, build a taxonomy, make contribution easy, meet regularly.
52
+
53
+ ## 4. Keep it fresh (the maintenance owner)
54
+
55
+ - **Docs go stale by default**; the countermeasure is procedural — assess doc impact of changes
56
+ each sprint and allocate update time in the release.
57
+ - **Make updates cheap**: prefer simple human-readable formats (Markdown — diffable in Git) and
58
+ text-based diagrams so edits stay cheap.
59
+ - **Institutionalize the lifecycle**: plan → write → review → publish, with research up front and
60
+ maintenance at the end; take occasional content inventories and use reader feedback to fill gaps.
61
+
62
+ ## 5. Tooling and publishing (the pipeline engineer)
63
+
64
+ - **Match tools to doc types and languages**; when in doubt, defer to Markdown and tooling with
65
+ simple human-readable formats. A convenient editor matters — you won't write docs you hate
66
+ editing.
67
+ - **Bake publishing into CI/CD**: build docs from sources and publish on every release; generate
68
+ docs from code artifacts where possible (OpenAPI is the canonical example).
69
+ - **Plan reuse**: write content once and reuse it (CCMS for cross-product scale); audit for
70
+ overlap before duplication spreads.
71
+ - **Adopt (or author) style guides**: shared style guides keep output consistent — don't write
72
+ them from scratch (Write the Docs maintains a living one). During review, get the right experts
73
+ on the right documents and use preview runs to catch errors before publication.
74
+
75
+ ## Applying this in `create`
76
+
77
+ While drafting `3-draft/draft-article.md` (after `topic`'s outline gate), apply: one goal per
78
+ document enforced at the draft-review gate; the Value Proposition as a scope firewall; explicit
79
+ prerequisites and POLA; show-don't-tell with diagrams/examples; and accessibility. The `--judge`
80
+ gate then verifies technical accuracy against the rubric.
@@ -0,0 +1,72 @@
1
+ # English-platform playbook (X / Medium / Substack)
2
+
3
+ Distilled from the STORM study "How to Write and Distribute IT Technical Documents on English
4
+ Platforms" (works dir `how-to-write-it-technical-documents-for-english-a6a76477`, provenance only).
5
+ Load this reference when `--playbook english`; it shapes platform choice, format, and distribution
6
+ for the draft — never reimplements publishing.
7
+
8
+ ## Choose the platform before you write
9
+
10
+ - The writer's-first-question fallacy: pick a platform *after* deciding what you actually want as
11
+ a writer. Technical content is expensive to produce; making it for the wrong audience on the
12
+ wrong surface wastes your scarcest resource.
13
+ - Compare platforms on three axes:
14
+ - **Growth/discoverability** — Medium: internal distribution, but the algorithm decides reach.
15
+ X: reach with high volatility. Substack: slow to start, compounds (Notes, recommendations,
16
+ direct email) into an asset you keep.
17
+ - **Audience/culture** — X is fast and combative; Medium skews essay readers; Substack readers
18
+ opt in deliberately (roughly 85% email / 10% app on a typical post).
19
+ - **Business model** — Medium pays per member read; X monetization is thin for most; Substack is
20
+ free, you own your subscriber list, paid subs optional (10% cut only when someone pays).
21
+ - For IT writers the email list is the difference between building equity and renting attention.
22
+ Cross-posting to Medium is a fine low-effort hedge — just understand its mechanics first.
23
+
24
+ ## Launch and grow (Substack)
25
+
26
+ - Substack is three layers: email newsletter, publication (archive/about/navigation), and
27
+ social/discovery (Notes, recommendations, search). Most writers only use layer one — that is why
28
+ they struggle to grow.
29
+ - Setup order: name the publication (clear topic promise or memorable brand — not your personal
30
+ name unless known); write an attention-grabbing bio (what you write, who it's for, credentials);
31
+ import any existing subscriber list; publish a first post before promoting.
32
+ - Cadence: a sustainable frequency — one good post per week beats one "perfect" post per month;
33
+ shipping gets you feedback to iterate. Open each issue with a clear thesis and keep it readable
34
+ in an email client.
35
+ - **Growth levers combine**: from zero, Notes daily + connecting with writers gets the first
36
+ 50–100 subs; 100–500 layers in guest posts, collaborations, and recommendations (one publication
37
+ gained ~7,000 subs through recommendations alone).
38
+ - **Notes** is the "new Twitter for writers": short valuable insights, questions, daily presence,
39
+ genuine engagement (comments, restacks). Not random hot takes or growth-hacking. A 3-2-1 weekly
40
+ rhythm: three value notes, two engagement posts, one soft promotion.
41
+ - **Own the channel, rent the algorithm**: the email list is the asset that survives platform
42
+ changes; Notes/X/LinkedIn are top-of-funnel discovery — valuable, volatile, never the foundation.
43
+
44
+ ## Position and voice
45
+
46
+ - **Author-first** (the newsletter builds an audience for *you*; topics range widely) vs
47
+ **topic-first** (the publication is the draw; the niche is the promise — "production Kubernetes
48
+ war stories"). IT content tends to capture niche intent faster topic-first; author-first builds a
49
+ brand that travels.
50
+ - **Voice is the durable moat**: people want the person behind the publication. When automation
51
+ repurposes content, preserve conversational voice and framework thinking — never "AI rewrites my
52
+ stuff," which yields generic output.
53
+
54
+ ## Repurposing (one long-form → many assets)
55
+
56
+ - One newsletter becomes 5 LinkedIn posts + 10 Substack Notes + 3 X threads via a webhook →
57
+ extract → generate → deliver pipeline (Make.com + Firecrawl + OpenAI + Google Docs), cutting
58
+ hours of manual reformatting to ~30 minutes of polish.
59
+ - **Adapt per platform, never copy-paste**: LinkedIn wants declarative hooks + strategic line
60
+ breaks; Substack Notes wants ~200-character insights with bold + mic-drop endings; X threads
61
+ need conversational hooks with curiosity gaps between tweets.
62
+ - Dense IT material (architecture tradeoffs, debugging walkthroughs, benchmarks) must be re-cut
63
+ per surface. Long-form Substack/Medium carries the full technical depth and is the canonical
64
+ source everything links back to.
65
+ - **The 10–20% human polish pass is mandatory and non-delegable** — for technical material this
66
+ is where accuracy lives: verify every code snippet, command, flag, and version-specific claim.
67
+
68
+ ## Applying this in `create`
69
+
70
+ Load this reference when `--playbook english`. It informs the draft's framing (audience, voice,
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.
@@ -0,0 +1,60 @@
1
+ # WeChat Official Account playbook (specific-platform study)
2
+
3
+ Distilled from the STORM study "How to Write and Publish Technical Documents on WeChat Official
4
+ Accounts" (works dir `how-to-write-it-technical-documents-for-specific-d158f7c2`, provenance only).
5
+ Load this reference when `--playbook wechat`; it shapes the draft for WeChat's reading context and
6
+ compliance constraints — never reimplements registration, publishing, or the API.
7
+
8
+ ## Why WeChat
9
+
10
+ - For Chinese academics, engineers, and technical decision-makers, WeChat Official Accounts
11
+ (微信公众号) are the primary delivery channel — researchers check it almost every waking hour.
12
+ - Authority bar: an expert should be able to name at least five public accounts on the topic they
13
+ follow. If your account would not make that list, you are not reaching the expert audience.
14
+
15
+ ## Account type and constraints (the drafting context)
16
+
17
+ - **Subscription account (订阅号)**: up to 1 push/day, but folded into a "Subscriptions" folder —
18
+ best for high-cadence technical publishing. **Service account (服务号)**: 4 messages/month but
19
+ appears in the main chat list with push — best for low-cadence, high-importance announcements.
20
+ - **Enterprise accounts (企业号)** are for internal newsletters (mutual approval, no public reach).
21
+ - **Hard limits that shape content**: each message carries up to 8 articles; **published articles
22
+ cannot be deleted** — only modified with a correction notice. Errors are permanent, so
23
+ review-before-publish is mandatory.
24
+ - Registration is a Chinese-identity-bound process (QR-scan binding, Chinese ID/phone for admins,
25
+ ICP / Mini Program filings for hosted infrastructure). Foreign entities must work through a
26
+ Chinese partner. API access needs AppID/AppSecret (QR-verified) and an IP whitelist.
27
+
28
+ ## Authoring for the WeChat reader
29
+
30
+ - **Markdown-first pipeline**: WeChat's rich-text editor cannot interpret Markdown. Write in
31
+ Markdown, convert to WeChat-compatible rich text (MD2WeChat / `lyricat/wechat-format`, or the
32
+ Obsidian `wechat-public-platform` plugin for one-command draft upload), then paste/upload.
33
+ Converters turn external links into footnotes (external links are not allowed in articles).
34
+ - **Format for mobile consumption** (articles are read on phones — commuting, mid-meeting):
35
+ short paragraphs, images/GIFs/audio/video (text-only underperforms), text-light images, abstract
36
+ (摘要) under 120 characters, 900×500px cover, Simplified Chinese, short self-explanatory titles
37
+ (truncated after ~26 Chinese characters), h2–h4 headings (leave h1 for larger embedding), 15px
38
+ body text, PingFang on iOS.
39
+ - **Language**: Chinese-language articles outperform English even for Chinese academics who read
40
+ English; some international accounts publish multilingual content.
41
+ - **What engages**: novelty (new findings/new resources), originality and authenticity, and
42
+ structural rigor — this audience is trained to be critical of a WeChat post.
43
+
44
+ ## Editorial standards for authority
45
+
46
+ - **Bilingual/translated material**: the CAICT model — long-form Chinese analyses of international
47
+ technical reports, crediting Chinese-institution contributors — is the reference pattern.
48
+ - **Worth a "top five" slot**: recurring high-signal formats (standards announcements, seminar
49
+ notices, joint research, translated analyses) plus originality, authenticity, and rigor.
50
+ - **Review-before-publish checklist** (forced by the no-deletion rule): preview to your own WeChat
51
+ first; verify title length, abstract, cover, and footnote-converted links; confirm originality
52
+ declaration, tags, and comment settings manually in the draft box; route the broadcast through
53
+ the admin QR-code verification step.
54
+
55
+ ## Applying this in `create`
56
+
57
+ Load this reference when `--playbook wechat`. It informs the draft's structure (mobile-first
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
60
+ publishes, and never touches the WeChat API.
@@ -0,0 +1,62 @@
1
+ # Skill-authoring self-discipline (why this skill stays lean)
2
+
3
+ Distilled from the STORM study "How to Write the Best Technical Documentation with Agent Skills"
4
+ (works dir `how-to-write-the-best-technical-document-with-ex-2c52b35c`, provenance only). This
5
+ reference is the meta-discipline for *this skill*: it exists so `itc-generating` stays a thin
6
+ method+orchestration layer instead of re-vendoring craft or reimplementing sibling skills.
7
+
8
+ ## The SKILL.md contract (hard limits)
9
+
10
+ - **Frontmatter**: `name` ≤64 chars, lowercase letters/numbers/hyphens only, no XML tags or
11
+ reserved words, and must exactly match the parent directory name. `description` is non-empty,
12
+ ≤1,024 chars, no XML tags.
13
+ - **Body budget**: keep SKILL.md under ~500 lines / ~5,000 tokens — just the core instructions the
14
+ agent needs every run; split the rest into `references/`.
15
+ - **Context economics**: only `name` + `description` are pre-loaded; the rest enters context only
16
+ when needed. The description is the *only* routing signal — write it as a third-person capability
17
+ statement with explicit negative triggers so near-miss tasks are excluded.
18
+ - **Folder grammar**: SKILL.md + `references/` + `scripts/` + `assets/`, kept **exactly one level
19
+ deep** (`references/schema.md`, not `references/db/v1/schema.md`). Avoid nested reference chains —
20
+ when references point at references, the agent previews instead of reading fully.
21
+
22
+ ## Progressive disclosure (the load-on-demand rule)
23
+
24
+ - Keep the always-loaded core minimal; push detail into `references/` with **just-in-time
25
+ pointers**: "Read `references/api-errors.md` if the API returns a non-200" beats "see
26
+ references/ for details".
27
+ - Three patterns: high-level guide + references; domain-specific organization; conditional details
28
+ (branch to a section only when a condition holds).
29
+ - Prefer **deterministic scripts** for fragile/repetitive operations (link checks, format
30
+ validation) — not for judgment-heavy authoring. Design their failure modes deliberately.
31
+
32
+ ## Instruction design
33
+
34
+ - **Degree of freedom**: prescriptive exact-sequence instructions for fragile operations; goal-plus-
35
+ philosophy for judgment-heavy work (authoring). Vague skills fail — "handle errors appropriately"
36
+ carries no information.
37
+ - **Defaults, not menus**: pick one default and a one-line escape hatch, rather than listing
38
+ options and hoping the agent chooses well.
39
+ - **Add what the agent lacks; omit what it knows**: the filter is "would the agent get this wrong
40
+ without this instruction?" If no, cut it.
41
+ - Highest-value blocks: gotchas sections (environment facts that defy assumptions), output-format
42
+ templates, checklists and self-check loops.
43
+
44
+ ## Evaluation and review (how to keep improving the skill)
45
+
46
+ - Four validation passes: discovery (description in isolation — does it route correctly?),
47
+ logic (deterministic steps, no hallucinated gaps), adversarial edge-case QA ("try to break this
48
+ skill"), architecture refinement (enforce progressive disclosure).
49
+ - **Execute-then-refine** beats endless pre-polish: run the skill on real tasks and iterate;
50
+ read execution traces, not just outputs (instructions retried many times, instructions followed
51
+ that don't apply, too many options without a default).
52
+ - Add a **self-reflection step**: after a run, examine the friction log and improve the skill so
53
+ the next run does not struggle the same way.
54
+
55
+ ## How this skill applies it
56
+
57
+ `itc-generating` is one-level-deep by construction: SKILL.md points at the four `references/*.md`
58
+ files below it and loads them on demand (generic-craft always; playbook only when `--playbook` is
59
+ not `generic`). It reuses `topic`'s artifact contract rather than inventing a parallel workspace
60
+ (D5), delegates research/judging to `storm-research`/`content-judge` rather than reimplementing them (D6),
61
+ and stays under the body budget because the four STORM reports live in the works dirs as
62
+ provenance — never vendored here (D4).
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: storm-research
3
+ description: >-
4
+ Use the storm-research skill to run daily STORM research — turn a research topic
5
+ sentence or a markdown source file into a grounded STORM Content report with a content.md
6
+ sidecar ("research X", "produce a research report on X", "run today's STORM research",
7
+ "turn this brief into a researched report"). The machine is the 0059 workflow
8
+ (prepare → ingest → generate → render) over the 0056 works layout. Research is separate from
9
+ authoring: topic owns init→outline→draft and this skill never merges into topic.
10
+ version: 0.1.0
11
+ ---
12
+
13
+ # storm-research — STORM daily research (topic sentence XOR markdown file → content.md)
14
+
15
+ ## Purpose
16
+
17
+ Turn one research topic (a sentence) or one markdown source file into a **grounded STORM
18
+ `Content` report** plus a `content.md` sidecar by composing the `web-search` ingestion plugin,
19
+ the `content-gen` generator, and the `render-md` helper. The machine is the 0059 workflow
20
+ (`prepare → ingest → generate → render → done|failed`); this skill owns the **craft** — framing
21
+ the query, deciding when to re-run ingest, and verifying the report against the evidence.
22
+
23
+ Research is **not** authoring. `topic` owns `init → outline → draft` from an approved
24
+ outline; this skill owns evidence gathering. **Do not merge this into `topic`.**
25
+
26
+ ## When to use / not to use
27
+
28
+ Use when:
29
+
30
+ - A user asks to research a topic: "research X", "produce a research report on X", "run today's
31
+ STORM research", "what does the evidence say about X".
32
+ - A user supplies a markdown source (brief, notes, outline) that should ground the report —
33
+ pass it with `--in <file>`.
34
+
35
+ Do **not** use for:
36
+
37
+ - Authoring an article from a topic with no research need — that is `topic`.
38
+ - Quality gating / judging generated content — that is `content-judge`.
39
+ - Publishing, platform adaptation, or illustration — out of C4 scope.
40
+ - Anything requiring a raw `kk executor run` chain when the workflow already composes it.
41
+
42
+ ## Invocation contract
43
+
44
+ Same arguments as `/workflow-run` (the thin command delegates here for craft):
45
+
46
+ ```
47
+ [workflow-name] <topic | --in <file>> [--fixture] [--force]
48
+ ```
49
+
50
+ | Token | Meaning | Default |
51
+ | --- | --- | --- |
52
+ | `workflow-name` | installed workflow YAML name; must match `^[a-z0-9][a-z0-9-]*$` and not be `--in` | `kk-storm-research` |
53
+ | `<topic>` | a **specific research question** (better-report a — prefer a question over a noun phrase) | required unless `--in` |
54
+ | `--in <file>` | markdown file mode (XOR with `<topic>`) | — |
55
+ | `--fixture` | force `fixture: "true"` (offline stub ingest) | config default (`false` for real runs) |
56
+ | `--force` | overwrite an existing dest workflow YAML | off |
57
+
58
+ **XOR rule:** exactly one of `<topic>` / `--in <file>` must be set. Both set or both empty →
59
+ fail loud, no writes. `--in` and a bare topic token are mutually exclusive.
60
+
61
+ The operator invocation in practice is `/workflow-run <topic>` or `/workflow-run --in <file>`; the
62
+ skill is also callable directly as `Skill(skill="storm-research", args="<topic|--in file> ...")`.
63
+
64
+ ## How to run
65
+
66
+ 1. **Frame the query** (better-report a): prefer a specific question over a noun phrase.
67
+ "What are the known failure modes of vector databases at 1B rows?" beats "vector databases".
68
+ A question constrains the search and the report; a noun phrase invites scope creep.
69
+ 2. **Choose input**: topic sentence, or a markdown file via `--in` (XOR). File mode derives the
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
72
+ invoker (the command or the operator) via the 0056 `topicId()` algorithm — never by the
73
+ workflow. `prepare` only `mkdir` + materializes files into `${vars.work_dir}`.
74
+ 4. **Pick fixture vs live** (see below). Default is live (`fixture: "false"`); pass
75
+ `fixture: "true"` for offline/dry-run/CI.
76
+ 5. **Run** the workflow and collect the outputs: `content.md` (report sidecar), `content.json`
77
+ (machine contract), `docs.json` (evidence). Read the report against the evidence before
78
+ presenting it (better-report d).
79
+
80
+ ## topicId algorithm (0056, frozen)
81
+
82
+ `topicId(raw: string)` — computed by the **invoker**, never by the workflow YAML:
83
+
84
+ 1. `normalized` = trim, collapse whitespace, lowercase.
85
+ 2. `slug` = replace `[^a-z0-9]+` with `-`, squeeze dashes, trim dashes, slice to **48 chars**,
86
+ trim dashes again. If empty → `topic`.
87
+ 3. `hash` = `sha256(normalized).digest('hex').slice(0, 8)`.
88
+ 4. Return `slug + '-' + hash`.
89
+
90
+ - Sentence mode: `raw` = the topic string. File mode: `raw` = first ATX H1 else basename
91
+ without extension.
92
+ - Same `raw` → same id → same workspace. **Last write wins**; do not fail on an existing
93
+ works dir (re-running a topic is legal — no `--force` needed).
94
+ - If `raw` derives empty (no H1 and an empty basename, e.g. a file named `.md`) → fail loud.
95
+
96
+ ## Works layout (0056, frozen; ADR-013 adds `references/`)
97
+
98
+ Per-topic workspace at `$works_dir/<topic-id>/`:
99
+
100
+ | File | Written by | Contents |
101
+ | --- | --- | --- |
102
+ | `topic.json` | prepare | ingest `--in` (`topic`, `maxResults`, `fixture`) |
103
+ | `input.md` | prepare (file mode only) | verbatim copy of the operator file |
104
+ | `local-doc.json` | prepare (file mode only) | one-element `Doc[]` (id = `sha256('file://'+absPath).hex.slice(0,16)`, rank `-1`, position `0`) |
105
+ | `docs.json` | ingest | `web-search` output `Doc[]` |
106
+ | `content.json` | generate | STORM `Content` (machine contract) |
107
+ | `content.md` | render | markdown sidecar report |
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
+
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`,
112
+ outside any repo.
113
+
114
+ ## Live vs fixture
115
+
116
+ | Mode | `fixture` | Behavior | Requires |
117
+ | --- | --- | --- | --- |
118
+ | Live | `"false"` (default) | `web-search` calls the Firecrawl search API (`POST https://api.firecrawl.dev/v2/search`, `scrapeOptions.formats: ["markdown"]`), maps `data.web[]` to `Doc[]` | `FIRECRAWL_API_KEY` env var; unset → the ingest exits 1 ("FIRECRAWL_API_KEY is unset") |
119
+ | Fixture | `"true"` | `web-search` emits canned `Doc[]` (stable `sha256(sourceUri)` ids); no network, no key | none — offline/dry-run/CI |
120
+
121
+ - `FIRECRAWL_API_KEY` is **env-only** — never a config key, never a workflow var, never in the
122
+ report.
123
+ - Real daily research defaults to live. **`fixture: true` is not research** (better-report b) —
124
+ the canned docs are for machine checks, not for evidence a reader should trust.
125
+
126
+ ## Fail-loud table (0056 rows the agent must execute)
127
+
128
+ | Condition | Behavior | Recovery |
129
+ | --- | --- | --- |
130
+ | Both `<topic>` and `--in` set, or neither | exit 1, stderr states the XOR rule; no writes | pass exactly one of `topic` / `--in` |
131
+ | `--in` file unreadable (missing / I/O) | exit 1, stderr names the path | fix the path / permissions |
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` |
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
+ | Missing config at `KK_CONFIG` | **not a failure** — create-on-first-run with compiled defaults; an existing file is never overwritten | — |
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 |
138
+
139
+ Every failure names the exact path and the exact next command. Never silently skip, never
140
+ auto-replace, never hash topic-id in the YAML.
141
+
142
+ ## Better-report practices (R1)
143
+
144
+ 1. **(a) Prefer a specific question over a noun phrase.** A question ("How does X behave under
145
+ Y?") pins the search and the report's thesis; a noun ("X") leaves scope open.
146
+ 2. **(b) Do not treat `fixture: true` as research.** Fixture output is canned — fine for
147
+ pipeline checks, never a source of claims to present to a reader.
148
+ 3. **(c) Re-run ingest only when the query or sources must change.** If the question is
149
+ unchanged and the sources are the same, **reuse `docs.json`** — do not re-fetch. Only a new
150
+ query, new sources, or stale evidence justifies a fresh ingest.
151
+ 4. **(d) Read `content.md` citations against `docs.json` ids.** Every citation in the report
152
+ must resolve to a Doc id present in `docs.json`; verify the claim against that Doc's body
153
+ before trusting it. A citation to a missing id is a defect — fix the report, not the id list.
154
+ 5. **Cap `maxResults` before widening.** Start at the default (`8`); only widen when the first
155
+ pass demonstrably misses coverage. More results is not better grounding — it is more noise.
156
+ 6. **Prefer primary sources in the markdown input file.** When a source file is supplied via
157
+ `--in`, favor the primary material in it (first-party specs, owned notes, authoritative
158
+ extracts) as the spine of the report; web results fill gaps, not the reverse.
159
+ 7. **Digest, don't index.** References are evidence, not the deliverable: the report synthesizes
160
+ findings across the supplied documents, compares them, and states conclusions — it never
161
+ lists sources one per line. The render drops the `## Outline` replay (ADR-013 D7); the
162
+ references tail plus `references/<doc-id>.md` files are the audit trail behind each cite id.
163
+
164
+ ## Invariants
165
+
166
+ - The invoker computes `topicId` and passes `work_dir` resolved; the workflow never hashes.
167
+ - XOR input always — exactly one of `topic` / `input_file`.
168
+ - Never promise a judge gate or query expansion in this skill (C4 scope: neither exists).
169
+ - No new `kk` first-layer noun (ADR-011) — this skill runs through the workflow, not through a
170
+ `kk` CLI verb.
171
+ - `FIRECRAWL_API_KEY` stays env-only.
172
+ - Works layout file names are frozen (0056) — do not rename or add sidecars in this skill.
173
+ ADR-013 exception: the ingest live path writes `references/<doc-id>.md` per cached source.
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: kk-topic
2
+ name: topic
3
3
  description: >-
4
- Use the kk-topic skill to author technical content from a topic or Markdown
4
+ Use the topic skill to author technical content from a topic or Markdown
5
5
  brief — "create an article from this topic", "turn this brief into a draft",
6
6
  "generate outline options", "initialize a topic workspace", "resume my draft".
7
7
  Runs the topic-core authoring loop (init → outline → draft) through four
@@ -9,7 +9,7 @@ description: >-
9
9
  cohesive topic-authoring core, harvested from the WT 7-stage wrappers.
10
10
  ---
11
11
 
12
- # kk-topic — topic-core authoring (create | init | outline | draft)
12
+ # topic — topic-core authoring (create | init | outline | draft)
13
13
 
14
14
  ## Purpose
15
15
 
@@ -159,7 +159,7 @@ silently skip, never auto-replace, never delete.
159
159
  ## Prompt template (Skill() / agent.run)
160
160
 
161
161
  ```
162
- Skill(skill="kk-topic",
162
+ Skill(skill="topic",
163
163
  args="<operation> <topic-or-brief> [--dir <target>] [--outline <a|b|c>] [--revise <feedback>] [--force]")
164
164
  ```
165
165