minimal-vibe-coding-kit 0.4.2 → 0.5.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.
Files changed (163) hide show
  1. package/.agents/skills/claim/SKILL.md +82 -0
  2. package/.agents/skills/tutien/SKILL.md +97 -0
  3. package/.agents/skills/tutien/references/adaptive-response.md +68 -0
  4. package/.agents/skills/tutien/references/classification.md +64 -0
  5. package/.agents/skills/tutien/references/lore-sources.md +43 -0
  6. package/.agents/skills/tutien/references/privacy.md +45 -0
  7. package/.agents/skills/tutien/references/schema.md +106 -0
  8. package/.agents/skills/tutien/references/scoring-and-realms.md +37 -0
  9. package/.agents/skills/tutien/references/story-system.md +176 -0
  10. package/.agents/skills/tutien/references/vi-style-guide.md +89 -0
  11. package/.agents/skills/tutien/references/voice-and-mode.md +59 -0
  12. package/.agents/skills/tutien/scripts/adapters/generic-jsonl.mjs +82 -0
  13. package/.agents/skills/tutien/scripts/adapters/git.mjs +48 -0
  14. package/.agents/skills/tutien/scripts/adapters/plain-transcript.mjs +37 -0
  15. package/.agents/skills/tutien/scripts/analyze-history.mjs +84 -0
  16. package/.agents/skills/tutien/scripts/catalog.mjs +130 -0
  17. package/.agents/skills/tutien/scripts/classify.mjs +338 -0
  18. package/.agents/skills/tutien/scripts/command.mjs +126 -0
  19. package/.agents/skills/tutien/scripts/compare.mjs +41 -0
  20. package/.agents/skills/tutien/scripts/metrics.mjs +306 -0
  21. package/.agents/skills/tutien/scripts/normalize-events.mjs +68 -0
  22. package/.agents/skills/tutien/scripts/project-profile.mjs +202 -0
  23. package/.agents/skills/tutien/scripts/redact.mjs +30 -0
  24. package/.agents/skills/tutien/scripts/render-report.mjs +479 -0
  25. package/.agents/skills/tutien/scripts/response-brief.mjs +103 -0
  26. package/.agents/skills/tutien/scripts/run-tutien.mjs +350 -0
  27. package/.agents/skills/tutien/scripts/score.mjs +97 -0
  28. package/.agents/skills/tutien/scripts/snapshot.mjs +76 -0
  29. package/.agents/skills/tutien/scripts/story-ledger.mjs +241 -0
  30. package/.agents/skills/tutien/scripts/villains.mjs +196 -0
  31. package/.claude/skills/claim/SKILL.md +82 -0
  32. package/.claude/skills/tutien/SKILL.md +97 -0
  33. package/.claude/skills/tutien/references/adaptive-response.md +68 -0
  34. package/.claude/skills/tutien/references/classification.md +64 -0
  35. package/.claude/skills/tutien/references/lore-sources.md +43 -0
  36. package/.claude/skills/tutien/references/privacy.md +45 -0
  37. package/.claude/skills/tutien/references/schema.md +106 -0
  38. package/.claude/skills/tutien/references/scoring-and-realms.md +37 -0
  39. package/.claude/skills/tutien/references/story-system.md +176 -0
  40. package/.claude/skills/tutien/references/vi-style-guide.md +89 -0
  41. package/.claude/skills/tutien/references/voice-and-mode.md +59 -0
  42. package/.claude/skills/tutien/scripts/adapters/generic-jsonl.mjs +82 -0
  43. package/.claude/skills/tutien/scripts/adapters/git.mjs +48 -0
  44. package/.claude/skills/tutien/scripts/adapters/plain-transcript.mjs +37 -0
  45. package/.claude/skills/tutien/scripts/analyze-history.mjs +84 -0
  46. package/.claude/skills/tutien/scripts/catalog.mjs +130 -0
  47. package/.claude/skills/tutien/scripts/classify.mjs +338 -0
  48. package/.claude/skills/tutien/scripts/command.mjs +126 -0
  49. package/.claude/skills/tutien/scripts/compare.mjs +41 -0
  50. package/.claude/skills/tutien/scripts/metrics.mjs +306 -0
  51. package/.claude/skills/tutien/scripts/normalize-events.mjs +68 -0
  52. package/.claude/skills/tutien/scripts/project-profile.mjs +202 -0
  53. package/.claude/skills/tutien/scripts/redact.mjs +30 -0
  54. package/.claude/skills/tutien/scripts/render-report.mjs +479 -0
  55. package/.claude/skills/tutien/scripts/response-brief.mjs +103 -0
  56. package/.claude/skills/tutien/scripts/run-tutien.mjs +350 -0
  57. package/.claude/skills/tutien/scripts/score.mjs +97 -0
  58. package/.claude/skills/tutien/scripts/snapshot.mjs +76 -0
  59. package/.claude/skills/tutien/scripts/story-ledger.mjs +241 -0
  60. package/.claude/skills/tutien/scripts/villains.mjs +196 -0
  61. package/.codex-plugin/plugin.json +1 -1
  62. package/.cursor/skills/claim/SKILL.md +82 -0
  63. package/.cursor/skills/tutien/SKILL.md +97 -0
  64. package/.cursor/skills/tutien/references/adaptive-response.md +68 -0
  65. package/.cursor/skills/tutien/references/classification.md +64 -0
  66. package/.cursor/skills/tutien/references/lore-sources.md +43 -0
  67. package/.cursor/skills/tutien/references/privacy.md +45 -0
  68. package/.cursor/skills/tutien/references/schema.md +106 -0
  69. package/.cursor/skills/tutien/references/scoring-and-realms.md +37 -0
  70. package/.cursor/skills/tutien/references/story-system.md +176 -0
  71. package/.cursor/skills/tutien/references/vi-style-guide.md +89 -0
  72. package/.cursor/skills/tutien/references/voice-and-mode.md +59 -0
  73. package/.cursor/skills/tutien/scripts/adapters/generic-jsonl.mjs +82 -0
  74. package/.cursor/skills/tutien/scripts/adapters/git.mjs +48 -0
  75. package/.cursor/skills/tutien/scripts/adapters/plain-transcript.mjs +37 -0
  76. package/.cursor/skills/tutien/scripts/analyze-history.mjs +84 -0
  77. package/.cursor/skills/tutien/scripts/catalog.mjs +130 -0
  78. package/.cursor/skills/tutien/scripts/classify.mjs +338 -0
  79. package/.cursor/skills/tutien/scripts/command.mjs +126 -0
  80. package/.cursor/skills/tutien/scripts/compare.mjs +41 -0
  81. package/.cursor/skills/tutien/scripts/metrics.mjs +306 -0
  82. package/.cursor/skills/tutien/scripts/normalize-events.mjs +68 -0
  83. package/.cursor/skills/tutien/scripts/project-profile.mjs +202 -0
  84. package/.cursor/skills/tutien/scripts/redact.mjs +30 -0
  85. package/.cursor/skills/tutien/scripts/render-report.mjs +479 -0
  86. package/.cursor/skills/tutien/scripts/response-brief.mjs +103 -0
  87. package/.cursor/skills/tutien/scripts/run-tutien.mjs +350 -0
  88. package/.cursor/skills/tutien/scripts/score.mjs +97 -0
  89. package/.cursor/skills/tutien/scripts/snapshot.mjs +76 -0
  90. package/.cursor/skills/tutien/scripts/story-ledger.mjs +241 -0
  91. package/.cursor/skills/tutien/scripts/villains.mjs +196 -0
  92. package/.grok/skills/claim/SKILL.md +82 -0
  93. package/.grok/skills/tutien/SKILL.md +97 -0
  94. package/.grok/skills/tutien/references/adaptive-response.md +68 -0
  95. package/.grok/skills/tutien/references/classification.md +64 -0
  96. package/.grok/skills/tutien/references/lore-sources.md +43 -0
  97. package/.grok/skills/tutien/references/privacy.md +45 -0
  98. package/.grok/skills/tutien/references/schema.md +106 -0
  99. package/.grok/skills/tutien/references/scoring-and-realms.md +37 -0
  100. package/.grok/skills/tutien/references/story-system.md +176 -0
  101. package/.grok/skills/tutien/references/vi-style-guide.md +89 -0
  102. package/.grok/skills/tutien/references/voice-and-mode.md +59 -0
  103. package/.grok/skills/tutien/scripts/adapters/generic-jsonl.mjs +82 -0
  104. package/.grok/skills/tutien/scripts/adapters/git.mjs +48 -0
  105. package/.grok/skills/tutien/scripts/adapters/plain-transcript.mjs +37 -0
  106. package/.grok/skills/tutien/scripts/analyze-history.mjs +84 -0
  107. package/.grok/skills/tutien/scripts/catalog.mjs +130 -0
  108. package/.grok/skills/tutien/scripts/classify.mjs +338 -0
  109. package/.grok/skills/tutien/scripts/command.mjs +126 -0
  110. package/.grok/skills/tutien/scripts/compare.mjs +41 -0
  111. package/.grok/skills/tutien/scripts/metrics.mjs +306 -0
  112. package/.grok/skills/tutien/scripts/normalize-events.mjs +68 -0
  113. package/.grok/skills/tutien/scripts/project-profile.mjs +202 -0
  114. package/.grok/skills/tutien/scripts/redact.mjs +30 -0
  115. package/.grok/skills/tutien/scripts/render-report.mjs +479 -0
  116. package/.grok/skills/tutien/scripts/response-brief.mjs +103 -0
  117. package/.grok/skills/tutien/scripts/run-tutien.mjs +350 -0
  118. package/.grok/skills/tutien/scripts/score.mjs +97 -0
  119. package/.grok/skills/tutien/scripts/snapshot.mjs +76 -0
  120. package/.grok/skills/tutien/scripts/story-ledger.mjs +241 -0
  121. package/.grok/skills/tutien/scripts/villains.mjs +196 -0
  122. package/.vibekit/docs/BACKBONE_REFERENCE.md +2 -0
  123. package/.vibekit/docs/INSTALL.md +3 -1
  124. package/.vibekit/init/CLAUDE-template.md +2 -0
  125. package/.vibekit/scripts/mvck.mjs +5 -5
  126. package/.vibekit/scripts/pack-dry-run.mjs +38 -3
  127. package/.vibekit/scripts/validate-kit.mjs +34 -24
  128. package/.vibekit/skills/claim/SKILL.md +82 -0
  129. package/.vibekit/skills/skills-manifest.json +27 -0
  130. package/.vibekit/skills/tutien/SKILL.md +97 -0
  131. package/.vibekit/skills/tutien/references/adaptive-response.md +68 -0
  132. package/.vibekit/skills/tutien/references/classification.md +64 -0
  133. package/.vibekit/skills/tutien/references/lore-sources.md +43 -0
  134. package/.vibekit/skills/tutien/references/privacy.md +45 -0
  135. package/.vibekit/skills/tutien/references/schema.md +106 -0
  136. package/.vibekit/skills/tutien/references/scoring-and-realms.md +37 -0
  137. package/.vibekit/skills/tutien/references/story-system.md +176 -0
  138. package/.vibekit/skills/tutien/references/vi-style-guide.md +89 -0
  139. package/.vibekit/skills/tutien/references/voice-and-mode.md +59 -0
  140. package/.vibekit/skills/tutien/scripts/adapters/generic-jsonl.mjs +82 -0
  141. package/.vibekit/skills/tutien/scripts/adapters/git.mjs +48 -0
  142. package/.vibekit/skills/tutien/scripts/adapters/plain-transcript.mjs +37 -0
  143. package/.vibekit/skills/tutien/scripts/analyze-history.mjs +84 -0
  144. package/.vibekit/skills/tutien/scripts/catalog.mjs +130 -0
  145. package/.vibekit/skills/tutien/scripts/classify.mjs +338 -0
  146. package/.vibekit/skills/tutien/scripts/command.mjs +126 -0
  147. package/.vibekit/skills/tutien/scripts/compare.mjs +41 -0
  148. package/.vibekit/skills/tutien/scripts/metrics.mjs +306 -0
  149. package/.vibekit/skills/tutien/scripts/normalize-events.mjs +68 -0
  150. package/.vibekit/skills/tutien/scripts/project-profile.mjs +202 -0
  151. package/.vibekit/skills/tutien/scripts/redact.mjs +30 -0
  152. package/.vibekit/skills/tutien/scripts/render-report.mjs +479 -0
  153. package/.vibekit/skills/tutien/scripts/response-brief.mjs +103 -0
  154. package/.vibekit/skills/tutien/scripts/run-tutien.mjs +350 -0
  155. package/.vibekit/skills/tutien/scripts/score.mjs +97 -0
  156. package/.vibekit/skills/tutien/scripts/snapshot.mjs +76 -0
  157. package/.vibekit/skills/tutien/scripts/story-ledger.mjs +241 -0
  158. package/.vibekit/skills/tutien/scripts/villains.mjs +196 -0
  159. package/CHANGELOG.md +51 -0
  160. package/README.md +53 -47
  161. package/docs/README.vi.md +14 -8
  162. package/docs/README.zh-CN.md +279 -0
  163. package/package.json +9 -3
@@ -0,0 +1,68 @@
1
+ # Adaptive response composition
2
+
3
+ Use this reference for every user-facing `/tutien` answer. After `analyze`, read `latest-brief.json` first; consult `latest.md` only when more audit detail is needed. The deterministic renderer is an evidence ledger and fallback inspection view. It is not a response template, a required section order, or prose to paste unchanged.
4
+
5
+ ## Invariants and freedom
6
+
7
+ Preserve these invariants:
8
+
9
+ - exact counts, confidence, policy state, classifications, risks, and recommended action;
10
+ - privacy, authorization, redaction, and neutral safety behavior;
11
+ - established names, relationships, world laws, unresolved threads, and consumed evidence keys;
12
+ - a clear distinction between project truth, cultivation interpretation, and fictional invention.
13
+
14
+ Everything else is compositional freedom. Choose length, headings, order, narrative distance, scene, dialogue, humor, imagery, and amount of technical detail from the current context. A valid answer may be a terse field note, an in-scene exchange, a tribunal, a breakthrough scene, a technical diagnosis wrapped in lore, or a full chapter. These are possibilities, not named templates to cycle through.
15
+
16
+ ## Context-driven composition
17
+
18
+ Before writing, privately identify four things:
19
+
20
+ 1. What the current user request is asking for, including desired depth, focus, and mood.
21
+ 2. What is distinctive about this repository, its current work, and the strongest approved evidence.
22
+ 3. What the living chronicle has already established and which open thread can move naturally.
23
+ 4. What shape, opening device, metaphor, and closing cadence were used recently and therefore should not be repeated without a reason.
24
+
25
+ Let those answers determine the response. Do not expose this private planning as headings or a checklist.
26
+
27
+ Treat the brief as a fact boundary, not a fill-in form. Its keys do not prescribe paragraph order. Project stack, package manager, and validation commands are anchors to make advice concrete; do not invent a missing tool or recommend a kit-only command when `kitInstalled` is false.
28
+
29
+ - For a narrow question, answer narrowly and keep the role-play concentrated.
30
+ - For a data-heavy analysis, make the decisive evidence easy to find, but do not dump every renderer section when a compact synthesis is clearer.
31
+ - For new approved evidence with `story=on`, continue the chronicle and let the project change cause a fictional consequence.
32
+ - With no new evidence, deepen interpretation or character tension without inventing project progress or consuming another evidence key.
33
+ - Follow an explicit user request for scene focus, character focus, technical depth, brevity, or story emphasis when it does not conflict with safety or evidence.
34
+ - Use the active user request only as ephemeral creative direction. Do not persist raw prompt text in story files.
35
+
36
+ ## Anti-template rule
37
+
38
+ Never require all stock headings. Never preserve the renderer's section order merely because it is available. Never begin every answer with weather at the mountain gate, introduce every problem as a heart demon, or close every answer with the same encouragement.
39
+
40
+ Across adjacent responses, vary at least two suitable dimensions when the context permits: opening position, point of view, scene location, amount of dialogue, technical density, antagonist presence, paragraph rhythm, heading use, or closing image. Do not force variation that harms clarity.
41
+
42
+ Examples in this skill demonstrate constraints only. Do not copy their sentences, fill their slots, or treat them as canonical output.
43
+
44
+ When mode is off, do not read this brief or continue its fiction. Return to the normal project voice until the user explicitly reactivates `/tutien`.
45
+
46
+ ## Vietnamese ending contract
47
+
48
+ For ordinary Vietnamese role-play, preserve this exact editorial intent:
49
+
50
+ > Kết cà khịa, luôn giáo huấn, không tâng bốc và kéo dài dư âm vai diễn.
51
+
52
+ Interpret it dynamically:
53
+
54
+ - `cà khịa`: tease the evidenced flaw, evasive plan, brittle array, or antagonist strategy; never attack the user or a real person;
55
+ - `giáo huấn`: leave a direct lesson or next discipline grounded in the evidence, not a generic motivational slogan;
56
+ - `không tâng bốc`: do not praise intelligence, talent, destiny, rank, or worth;
57
+ - `kéo dài dư âm vai diễn`: end inside the world through an image, consequence, warning, unfinished gesture, or character voice instead of stepping outside the role to summarize.
58
+
59
+ This is an effect contract, not a four-line formula. The ending may be one sentence or several and should grow from the current scene. Neutral safety mode overrides sarcasm and role-play, but it still avoids flattery and states the required corrective action plainly.
60
+
61
+ ## Final check
62
+
63
+ Before sending, ask:
64
+
65
+ - Could this answer belong to a different repository after changing only a few nouns? If yes, make it more project-specific.
66
+ - Does its shape repeat the previous answer? If yes, vary the form where useful.
67
+ - Did any fictional claim overwrite or exaggerate project truth? If yes, repair it.
68
+ - Does the ending satisfy the active language contract without becoming a stock catchphrase?
@@ -0,0 +1,64 @@
1
+ # Tu Tiên classification and progression
2
+
3
+ `scripts/classify.mjs` assigns a project's cultivation identity along three **orthogonal** axes, recommends knowledge, and derives seven progression metrics. It is deterministic and evidence-bound; classification comes from explicit declarations plus repo-profile keywords, each with a confidence and a rationale.
4
+
5
+ Invoke it standalone with `/tutien classify` (or it is appended to a full `analyze` report when a project profile is available).
6
+
7
+ ```
8
+ classify [faction=<id>] [affiliation=<id>] [paths=<id,id>] [domains=<kw,kw>] [authorization=<slug>] [language=vi|en]
9
+ ```
10
+
11
+ ## Policy state — the single fail-closed gate
12
+
13
+ One `policy.state` governs the whole report, consumed identically by the renderer and the snapshot. **Only `clear` enables realm, score, villains, knowledge recommendations, and positive progression.** Under any other state those are set to **null (absent, not merely hidden)** and only Nghiệp Lực (risk) accrues.
14
+
15
+ | state | trigger | effect |
16
+ |---|---|---|
17
+ | `clear` | lawful constructive work | full report |
18
+ | `needs-review` | intent-to-harm signals in the description | faction **undetermined** (never Chính Đạo), no gamification, asks for human review |
19
+ | `authorization-required` | Ma Đạo with no valid `authorization` slug | withholds gamification until a scope is recorded |
20
+ | `declared-stop` | user declared Tà Đạo or the `ta` path | stop notice; no realm/score/knowledge; only Nghiệp Lực |
21
+
22
+ ## The safety rules (non-negotiable)
23
+
24
+ 1. **Tà Đạo and Tà Tu are never auto-assigned.** Intent to harm cannot be judged from keywords, and technical difficulty is not evil. They exist only as an explicit user declaration; `ta` cannot be combined with any other path (fails closed).
25
+ 2. **Harmful intent is never rewarded.** A harmful description does not become Chính Đạo — it becomes `needs-review` with an undetermined faction and no gamification. This is a refusal to classify, not an automatic Tà label.
26
+ 3. **A declared Tà Đạo suppresses all gamification.** No realm, score, villains, knowledge, Tu Vi, or Công Đức — only Nghiệp Lực and a stop-and-seek-review notice. Never a progression path.
27
+ 4. **Affiliation is orthogonal to ethics.** Tán Tu (independent) is an organizational status, not the opposite of Tà Tu. A solo red-teamer is Tán Tu + Ma Đạo.
28
+ 5. **Security/investigation/crypto/RE is legitimate.** Defensive work is Chính Đạo + Ảnh Tu; authorized adversarial engagement is Ma Đạo. Authorization is a **user-asserted reference slug** (`[A-Za-z0-9][A-Za-z0-9_-]{0,63}`), never verified; secret-shaped, markup, URL, or `key=value` values are rejected and never rendered. The Ảnh Tu / Huyền Cơ Tu paths always print a dual-use note.
29
+ 6. **Progression is idempotent.** Contributions are per-event with a salted seen-ledger; replaying the same evidence (e.g. `range=all` twice) adds zero Tu Vi/Công Đức/Đạo Hạnh. A window with one new validated event adds only that event's contribution; overlap is reported.
30
+
31
+ ## Axis 1 — Dao faction (project ethics/risk)
32
+
33
+ | id | Faction | Meaning | Assignment |
34
+ |---|---|---|---|
35
+ | `chinh-dao` | Chính Đạo | lawful, transparent, constructive | default; no adversarial/experimental signals |
36
+ | `bang-mon` | Bàng Môn / Kỳ Đạo | experimental, creative, specialized; not harmful | experimental/creative keywords |
37
+ | `ma-dao` | Ma Đạo | high-risk/adversarial; needs authorization | adversarial-engagement keywords; records `authorization` |
38
+ | `ta-dao` | Tà Đạo | intentionally harmful | **declaration only**; suppresses gamification |
39
+
40
+ ## Axis 2 — Cultivator affiliation (organizational)
41
+
42
+ `tong-mon` (team/process) · `tan-tu` (independent) · `khach-khanh` (external/temporary) · `an-tu` (private long-term research). Author identifiers are read **transiently** (mailmap-collapsed `git log --use-mailmap`) and reduced immediately to a distinct **count**; no name or email is retained or emitted. The count is only a **low-confidence hint** (aliases, bots, and external contributors can inflate it) — declare `affiliation=` to set it authoritatively.
43
+
44
+ ## Axis 3 — Cultivation paths (technical, multi-select)
45
+
46
+ `kiem` implementation · `tran` architecture/DevOps · `phu` prompts/automation · `khi` tools/libraries · `dan` data/optimization · `y` debugging/maintenance · `huyen` UI/UX/visual · `ngu-thu` AI-agent orchestration · `huyen-co` crypto/hard algorithms · `anh` authorized security/forensics/OSINT/RE · `ta` intentionally harmful methods (**declaration only**, never auto-assigned).
47
+
48
+ ## Knowledge taxonomy
49
+
50
+ Recommended per the **primary path** (the first declared path, else the strongest detected one — never an alphabetical tie-break): **Tâm Pháp** (core mindset), **Công Pháp** (repeatable methods), **Thuật Pháp** (individual techniques — surfaced in the report's per-problem counter-techniques), **Bí Thuật** (rare/advanced), **Thần Thông** (mastered reusable abilities — rendered per path), **Pháp Bảo** (kit capabilities — existing skills *and* commands), **Bí Tịch / Đạo Điển** (playbooks/docs — this repo's `SKILL.md` files and `backbone.yml`).
51
+
52
+ `classify` is a **metadata-only** action: it reads `backbone.yml` fields plus the transient author count, prints that exact data scope, and derives no progression (progression requires analyzed history via `analyze`). It is not gated behind the `analyze` preview/approval boundary because it reads no history content.
53
+
54
+ ## Progression metrics (deterministic; token-independent)
55
+
56
+ Derived from analysis evidence plus prior-snapshot accumulators — token usage feeds none of them:
57
+
58
+ - **Tu Vi** (per-window + lifetime): passes + recoveries + capped commits.
59
+ - **Đạo Hạnh**: count of reporting windows (long-term practice).
60
+ - **Ngộ Tính** [0–1]: recovery ratio minus avoidable-repeat rate.
61
+ - **Độ Thuần Thục** [0–1]: overall mastery (per-path mastery needs path-tagged evidence — a V2 item).
62
+ - **Tâm Cảnh** [0–1]: effectiveness under failure (recovery ÷ failure).
63
+ - **Công Đức** (per-window + lifetime): verified positive output.
64
+ - **Nghiệp Lực** (per-window + lifetime): unresolved failures ×2 + conflicts + loops. Under a suppressed (Tà Đạo) report, only Nghiệp Lực accrues; Tu Vi and Công Đức stay zero.
@@ -0,0 +1,43 @@
1
+ # tutien cultural source notes
2
+
3
+ The report borrows xianxia/xiuxian genre vocabulary as a creative theme. It distinguishes historical/philosophical ideas from modern fictional/game progression, and does **not** present a fictional realm ladder as religious or historical fact.
4
+
5
+ - Daoism's "the Way/path", learning, change, and self-correcting practice inform the broad framing — not a software achievement ladder: Stanford Encyclopedia of Philosophy, *Daoism* (`https://plato.stanford.edu/entries/daoism/`).
6
+ - The distinction between `xiuzhen`, `xiuxian`, and `xianxia`, and how cultivation is translated into game systems and levels: "Cultivation games and cosmotechnics" (`https://journals.sagepub.com/doi/pdf/10.1177/20594364251364733`).
7
+ - Xianxia as fiction grounded in Daoist cultivation philosophy and mythology, centered on growth and struggle: Wuxiaworld genre introduction (`https://www.wuxiaworld.com/page/introduction-to-chinese-webnovel-genres-xianxia`) and general glossary (`https://www.wuxiaworld.com/page/general-glossary-of-terms`).
8
+ - Vietnamese reader register and community terminology: Tàng Thư Viện (`https://truyen.tangthuvien.vn/`). Treat it as a varied reader corpus containing translated, edited, and converted text, not as a single authoritative style or a source to copy.
9
+ - Sino-Vietnamese name and term verification: Từ điển Hán–Việt (`https://hanviet.asia/`). Use it to check readings and meanings, not to manufacture dense archaic prose.
10
+
11
+ These sources justify the theme and terminology only. The realm names, score bands, achievement mappings, villain archetypes, and jokes in tutien are an original project design and are documented as such.
12
+
13
+ ## Source-backed story palette
14
+
15
+ Use sources at the level of cultural concepts and genre craft. Never copy passages, continue a copyrighted work, or imitate the distinctive voice of a named living author.
16
+
17
+ | Source family | Safe craft to borrow | Tutien application |
18
+ | --- | --- | --- |
19
+ | Daoist path and learning metaphors | A path offers changing possibilities; practice develops know-how through observation and correction. | Let the project encounter choices, feedback, and revised techniques instead of treating progression as a rigid moral ladder. |
20
+ | Classical divine-and-demonic journey traditions, including *Journey to the West* and *Investiture of the Gods* as historical genre ancestors | Expansive worlds, trials, artifacts, rival powers, comic reversals, and travel between domains. | Turn new modules, releases, and architectural boundaries into newly opened regions without copying characters or plots. |
21
+ | Modern cultivation-path serials | Sects and factions, long arcs, widening maps, breakthroughs, bottlenecks, and accumulated consequences. | Expand the world only when project scope expands; keep several future arcs possible. |
22
+ | Daily-life cultivation | Craft work, maintenance, sect customs, relationships, lighter stakes, and humorous anti-tropes. | Give tests, refactors, documentation, and ordinary maintenance narrative weight instead of forcing every commit into combat. |
23
+ | Clan or sect-centered cultivation | The organization persists while individual roles change; inheritance and institutions matter. | Treat the repository, team, or agent ecosystem as the long-lived protagonist when that fits the project. |
24
+ | Cultivation-game procedural structure | Technical activity, progression rules, resources, and cosmology reinforce one another. | Make project architecture shape world laws and cultivation techniques, while real evidence remains authoritative. |
25
+
26
+ The Wuxiaworld genre introduction identifies Daoist cultivation and mythology, growth and struggle, sect-rich worlds, map expansion, daily-life comedy, and clan-centered narratives as recurring xianxia patterns. Its glossary supports terminology for sect hierarchy, cultivation methods, breakthroughs, bottlenecks, and tribulations. The SAGE paper supports treating cultivation systems as procedural structures connected to technical activity. Stanford's Daoism entry supports the broader path, learning, change, and self-correction framing without turning fictional realm scores into philosophy or religion.
27
+
28
+ ## Reference verification ledger
29
+
30
+ Verified on 2026-07-22:
31
+
32
+ - `https://plato.stanford.edu/entries/daoism/` — official Stanford Encyclopedia of Philosophy entry; verified for path, practice, learning, change, and self-correction framing.
33
+ - `https://www.wuxiaworld.com/page/introduction-to-chinese-webnovel-genres-xianxia` — Wuxiaworld's own editorial genre guide; verified for xianxia foundations and style families.
34
+ - `https://www.wuxiaworld.com/page/general-glossary-of-terms` — Wuxiaworld's own glossary; verified for common genre terminology and sect/cultivation organization.
35
+ - `https://journals.sagepub.com/doi/pdf/10.1177/20594364251364733` — SAGE-hosted academic paper; verified for cultivation narrative structures expressed through technical game systems.
36
+ - `https://truyen.tangthuvien.vn/` — Tàng Thư Viện reader platform; verified as a varied Vietnamese cultivation-fiction corpus and terminology reference, not a unified style guide.
37
+ - `https://hanviet.asia/` — structured Hán–Việt lookup with cited character sources; verified for name and term checking.
38
+
39
+ ## Tone contract
40
+
41
+ - The villain is always the failure mode, never the person.
42
+ - Banned in every mode (including `spicy`): attacks involving identity, intelligence, mental health, disability, religion, gender, race, finances; threats, profanity, humiliation. `tẩu hỏa nhập ma` is not used as a label for a person.
43
+ - Sensitive or emergency contexts force neutral, villain-free output.
@@ -0,0 +1,45 @@
1
+ # tutien privacy model
2
+
3
+ ## What is read
4
+
5
+ - **Git metadata** in the current repo (read-only `git log`): commit hashes, subjects, timestamps, revert flags. No working-tree contents.
6
+ - **Explicitly supplied export files** the user passes by exact path (`sources=…`): `tutien-generic-v1` JSONL or plain transcripts.
7
+ - **Known root manifests** advertised during preview: `backbone.yml`, package/runtime manifests, lockfiles, and language config files from the fixed allowlist in `project-profile.mjs`. Symlinks and files above 1 MiB are ignored. Script bodies are never returned, persisted, or executed.
8
+
9
+ Never read: the home directory, global tool history, other repos, arbitrary source files, or unadvertised paths. `preview` shows supplied evidence files, known manifest inventory, sizes, and date window before content is read; the approval token includes manifest size and modification time.
10
+
11
+ ## What is redacted (before anything else sees it)
12
+
13
+ `scripts/redact.mjs` is the single choke point. On ingest it:
14
+
15
+ - strips URL user-info (`user:pass@host`);
16
+ - replaces sensitive query values (`token`, `key`, `secret`, `password`, `auth`, `signature`, `code`, and case/encoding variants) with `[REDACTED]`;
17
+ - drops URL fragments;
18
+ - masks bearer/authorization tokens and AWS-key-shaped strings in free text.
19
+
20
+ Normalized events keep redacted text in memory for the run only. The analysis JSON references content solely through `eventId`, `textDigest`, and `phraseDigest` (16-hex SHA-256 prefixes).
21
+
22
+ ## What is persisted (only with approval)
23
+
24
+ Aggregate snapshots under the git-ignored `.vibekit/reports/tutien/`:
25
+
26
+ - coverage, disjoint reported/estimated/unknown token totals, metric counts, dimension scores, realm, thresholds, adapter versions, villain cooldown state, and **salted** evidence-id digests.
27
+
28
+ Never persisted: raw prompts, URLs, secrets, file contents, or unsalted event IDs. `aggregate-only` is the default; excerpts are off by default and, if ever enabled, are redacted and capped to one line.
29
+
30
+ `latest-brief.json` contains only aggregate evidence, safe project slugs, allowlisted stack names, generated validation commands based on script names, story pointers, and composition constraints. It never contains package script bodies, arbitrary manifest values, raw event IDs, or stock response prose.
31
+
32
+ The optional living chronicle uses `.vibekit/reports/tutien/story/`:
33
+
34
+ - `latest-context.json` contains only project slugs, aggregate coverage, disjoint token totals, realm/classification slugs, problem types, progression aggregates, and a 16-hex evidence key.
35
+ - `plot.md` and `chapters/*.md` contain agent-authored fiction derived from approved aggregates and non-secret repository metadata already in task scope.
36
+ - `story-state.json` contains the selected language/style, last chapter number, and consumed evidence keys.
37
+
38
+ Story files must never contain raw prompts, conversation excerpts, commit subjects, author names/emails, raw event IDs, URLs, secret values, or source-file contents. Do not turn a real contributor into a character without explicit user permission. Fictional character names are locally generated and are not identity mappings.
39
+
40
+ ## Deletion, retention, reset, export
41
+
42
+ - **Retention:** keep the newest N snapshots; `snapshotsToPrune()` returns the rest as a list to remove.
43
+ - **Delete/reset:** use the repo safe-delete policy — prefer `trash <path>`; never a silent `rm`. Deleting `.vibekit/reports/tutien/` resets all trend history.
44
+ - **Export:** a snapshot is plain JSON; copy the file. It already contains no raw content.
45
+ - **Story export:** copy `story/` only after reviewing the fictional prose for project-sensitive metaphors. The deterministic context remains aggregate-only, but the user's chosen plot may itself be private.
@@ -0,0 +1,106 @@
1
+ # `/tutien` normalized event and analysis schema (v1)
2
+
3
+ ## Generic input format `tutien-generic-v1`
4
+
5
+ One JSON object per line (JSONL). An optional first line `{"schema":"tutien-generic-v1"}` pins the version; any other `schema` value fails closed. Comment lines start with `#`.
6
+
7
+ The whole declared schema is validated on ingest and fails closed on: unknown `type`; invalid `role`, `outcome`, `usage.accuracy`; unparseable `ts`; non-string `session`/`task`/`label`/`text`/`usage.requestId`; negative, non-finite, or non-numeric usage numbers; non-boolean `usage.cumulative`; malformed `commit`; and the reserved fields `source`/`__source` (the event source is owned by the adapter, never by export content).
8
+
9
+ Event object:
10
+
11
+ | Field | Type | Notes |
12
+ | --- | --- | --- |
13
+ | `type` | string | `message` \| `tool_call` \| `tool_result` \| `test` \| `approval` \| `commit`. Unknown types fail closed. |
14
+ | `session` | string | Session/thread identifier. |
15
+ | `task` | string? | Explicit task ID when the export has one (strongest grouping signal). |
16
+ | `ts` | ISO-8601? | Timestamp; null allowed. |
17
+ | `role` | string? | `user` \| `assistant` \| `tool` \| `git`. |
18
+ | `text` | string? | Redacted on ingest; retained in memory only. |
19
+ | `usage` | object? | `input`, `cachedInput`, `output`, `reasoning`, `total`, `accuracy` (`reported`\|`estimated`\|`unknown`), `requestId`, `cumulative`. |
20
+ | `outcome` | string? | `pass` \| `fail` for `test`/`tool_result`. |
21
+ | `label` | string? | Stable name used to pair a failure with its recovery. |
22
+ | `commit` | object? | `{ hash, subject, isRevert }` for git events. |
23
+
24
+ ## Analysis output (schemaVersion 1)
25
+
26
+ ```jsonc
27
+ {
28
+ "schemaVersion": 1,
29
+ "eventsAnalyzed": 0,
30
+ "coverage": {
31
+ "sessions": 0, "userPrompts": 0, "commits": 0,
32
+ "window": { "start": null, "end": null },
33
+ "tokenCoverage": { "reportedTurnsPct": 0, "estimatedTurnsPct": 0, "unknownTurns": 0 },
34
+ "confidence": "low|medium|high"
35
+ },
36
+ "tokens": {
37
+ "reportedTotal": 0, "estimatedTotal": 0, "unknownTurns": 0,
38
+ "countedRequests": 0, "dedupedStreamUpdates": 0
39
+ },
40
+ "tasks": [ { "taskId": "", "sessionId": "", "grouping": "explicit|derived", "confidence": "high|medium", "eventCount": 0 } ],
41
+ "repetition": {
42
+ "exactRepeats": [ { "taskId": "", "count": 2, "eventIds": [], "textDigest": "" } ],
43
+ "nearRepeats": [ { "taskId": "", "eventIds": [], "similarity": 0.9 } ],
44
+ "retryLoopCandidates": [ { "taskId": "", "count": 3, "eventIds": [], "confidence": 0.6 } ]
45
+ },
46
+ "conflicts": [ { "category": "user-user", "taskId": "", "eventIds": [], "phraseDigest": "", "confidence": 0.6 } ],
47
+ "issues": {
48
+ "passes": 0,
49
+ "failures": [ { "eventId": "", "label": "" } ],
50
+ "recoveries": [ { "issueEventId": "", "recoveryEventId": "" } ],
51
+ "revertCandidates": [ { "eventId": "", "hash": "", "confidence": 0.5 } ]
52
+ },
53
+ "notes": []
54
+ }
55
+ ```
56
+
57
+ ## Phase 2 render model
58
+
59
+ `render-report.mjs` builds a language-neutral model from the analysis (realm, dimension scores, disjoint token totals, evidence-bound problems, one if-then practice, one lesson) and renders it in `vi` or `en` — the same model feeds both, so counts are identical across languages by construction. `score.mjs` returns `Chưa đủ thiên cơ` (no realm) when known-token coverage is below 60%. `catalog.mjs` emits at most three problems, ranked by `impact × recurrence × confidence × fixability`, each carrying `evidence` (event IDs / counts), a counter-technique, a project-skill pointer, and a micro-quest. Lore never alters a count.
60
+
61
+ ## Privacy invariant
62
+
63
+ `text` is redacted inside `normalize-events.mjs` and never emitted. **Metadata is digested too**: `session`, `task`, and `label` values become 16-hex SHA-256 prefixes before they reach normalized events, so task/session identifiers in analysis output (`tasks[].taskId`, `tasks[].sessionId`, `issues.failures[].label`) can never carry raw content. Timestamps are canonicalized to UTC ISO or dropped; commit subjects are dropped from the commit object (their redacted form travels only as event text). Analysis output references content solely through `eventId`, `textDigest`, and `phraseDigest`. No field carries raw prompt text, URL user-info, secret query values, or URL fragments.
64
+
65
+ ## Token-evidence invariant
66
+
67
+ A usage record contributes to reported/estimated totals and coverage only when a **usable total** exists: a finite, positive `total`, or a positive sum of `input + output + reasoning`. A record claiming `accuracy=reported` with no numbers (or zero) is counted as `unknown` and cannot unlock a realm score. Only records marked `cumulative` are streaming counters (last value wins); independent chunks sharing a `requestId` are summed.
68
+
69
+ ## Runner state
70
+
71
+ `scripts/run-tutien.mjs` executes the actions end-to-end. It stores the session mode and pending single-use approval token in `.vibekit/reports/tutien/state.json`, snapshots under `snapshots/`, the audit ledger as `latest.md`, and the agent handoff as `latest-brief.json`. Preview inspects existence, size, and modification time only; analysis runs only with the matching token for the identical evidence and manifest inventory. The runner never deletes files.
72
+
73
+ `latest-brief.json` uses `tutien-response-brief-v1`. It carries policy state, safe project identity/stack/validation commands, aggregate evidence, classification/progression slugs, bounded findings without event IDs, an optional story pointer, and composition constraints. Its object shape is not a response layout.
74
+
75
+ When `story=on`, runner state also stores the selected `storyLanguage`, `storyStyle`, and `storyFocus` for the current repository. A successful approved analysis writes `.vibekit/reports/tutien/story/latest-context.json`; it does not write creative prose.
76
+
77
+ ## Living chronicle schemas
78
+
79
+ `latest-context.json` uses `tutien-story-context-v1` and contains:
80
+
81
+ - a deterministic 16-hex `evidenceKey` derived from aggregate facts;
82
+ - `language`, `style`, `focus`, `policyState`, and `canWriteChapter`;
83
+ - safe project, stack, metadata-source, and generated validation-command slugs plus an aggregate author count;
84
+ - coverage, reported/estimated/unknown token totals, realm/score, problem types, classification slugs, and progression aggregates.
85
+
86
+ It never contains `text`, prompts, commit subjects, event IDs, author identities, file contents, URLs, or classification rationale.
87
+
88
+ `story-state.json` uses `tutien-story-state-v1` with `language`, `style`, contiguous `lastChapter`, and unique `consumedEvidenceKeys`.
89
+
90
+ Each `chapters/NNNN-<localized-xianxia-title>.md` uses YAML frontmatter:
91
+
92
+ ```yaml
93
+ ---
94
+ schema: tutien-story-chapter-v1
95
+ chapter: 1
96
+ title: "Localized title"
97
+ language: vi
98
+ evidence_key: 0123456789abcdef
99
+ ---
100
+ ```
101
+
102
+ Chapter numbers are contiguous and one evidence key may appear in at most one chapter. `scripts/story-ledger.mjs validate` checks these invariants plus the presence of `plot.md` and agreement with `story-state.json`.
103
+
104
+ ## Determinism invariant
105
+
106
+ Given the same inputs and options, `analyze()` returns byte-identical JSON. No randomness, no wall-clock reads, no ordering that depends on object insertion beyond the input order.
@@ -0,0 +1,37 @@
1
+ # tutien scoring and realms
2
+
3
+ Scoring is deterministic (`scripts/score.mjs`): the same analysis JSON always yields the same score. High token usage never raises the score; necessary iteration is not punished; penalties are capped so one hard task cannot erase a long history.
4
+
5
+ ## Coverage gate
6
+
7
+ A realm is computed only when known-token coverage (reported + estimated turns) is at least **60%**. Below that the report shows `Cảnh giới: Chưa đủ thiên cơ` (not enough evidence) and lists what is missing — it never guesses a realm from thin data.
8
+
9
+ ## Dimensions (weights)
10
+
11
+ | Dimension | Weight | Signal |
12
+ |---|---:|---|
13
+ | delivery | 30% | verified completions and recoveries vs failed attempts, plus committed output |
14
+ | validation | 25% | presence and density of validation events |
15
+ | clarity | 15% | 1 − avoidable-repeat rate (capped) |
16
+ | recovery | 15% | recoveries ÷ failures |
17
+ | safety | 10% | high baseline, capped penalty per conflict candidate |
18
+ | automation | 5% | reusable automation (neutral in V1; refined once commit-subject signals are wired) |
19
+
20
+ Score = round(Σ dimension × weight × 100).
21
+
22
+ ## Realm ladder (project-authored, humorous)
23
+
24
+ | Band | Realm | Gloss |
25
+ |---|---|---|
26
+ | 0–14 | Phàm Nhân Nhập Môn | Mortal Initiate |
27
+ | 15–29 | Luyện Khí | Qi Refining |
28
+ | 30–44 | Trúc Cơ | Foundation Establishment |
29
+ | 45–59 | Kết Đan | Core Formation |
30
+ | 60–69 | Nguyên Anh | Nascent Soul |
31
+ | 70–79 | Hóa Thần | Spirit Transformation |
32
+ | 80–87 | Luyện Hư | Void Refinement |
33
+ | 88–93 | Hợp Thể | Body Integration |
34
+ | 94–97 | Đại Thừa | Great Vehicle |
35
+ | 98–100 | Độ Kiếp / Phi Thăng | Tribulation / Ascension |
36
+
37
+ The realm names, thresholds, dimension weights, and jokes are an original project design — a creative theme, not a claim that one authentic cultivation ladder exists. See `lore-sources.md`.
@@ -0,0 +1,176 @@
1
+ # Living chronicle system
2
+
3
+ Read this reference whenever `/tutien` creates, continues, repairs, or discusses the repository-specific story.
4
+
5
+ ## Core contract
6
+
7
+ The chronicle is an open-ended xianxia serial whose world grows from the current repository. Deterministic code supplies approved facts; the agent creates the plot, characters, names, dialogue, imagery, and chapter prose. Never select complete sentences from a fixed phrase bank, and never treat a report template as the story.
8
+
9
+ Keep these layers separate:
10
+
11
+ 1. **Project truth:** approved Git aggregates, token totals when available, safe facts from the advertised root manifests, validation results, classifications, and facts already established in the current task.
12
+ 2. **Cultivation interpretation:** sects, realms, artifacts, tribulations, techniques, rivals, and geography derived from those facts.
13
+ 3. **Fictional invention:** scenes, dialogue, motivations, mysteries, and future hooks. These may dramatize project truth but may not change it.
14
+
15
+ If evidence is missing, write uncertainty into the world as fog, an unopened seal, an unknown realm, or an unresolved rumor. Do not invent project events.
16
+
17
+ ## First activation in a repository
18
+
19
+ After the first successful, approved `analyze` with `story=on`:
20
+
21
+ 1. Read `latest-context.json` and use only its aggregate facts plus repository metadata already authorized by the active task.
22
+ 2. Detect `vi`, `en`, or `zh` from `story-language`, then the invocation language. Ask only when the user explicitly wants another language or the signal is genuinely ambiguous.
23
+ 3. Choose a flexible style profile from `story-style`; `auto` selects from project shape:
24
+ - `classic-quest`: focused protagonist, trials, discoveries, and gradual realm advancement.
25
+ - `web-serial`: strong chapter hooks, layered sect politics, widening maps, and long arcs.
26
+ - `daily-life`: craft, maintenance, customs, relationships, and light comic reversals.
27
+ - `clan-epic`: the repository or team is the enduring protagonist across generations.
28
+ - `comic-adventure`: lively misunderstandings and reversals without turning evidence into a joke.
29
+ - Blend at most two profiles and record the blend in `plot.md`.
30
+ 4. Transform the project into a world using semantic relationships, not word substitution:
31
+ - project/repository → sect, clan, wandering pavilion, or hidden domain;
32
+ - architecture/modules → territories, peaks, halls, arrays, or lineages;
33
+ - tools/dependencies → artifacts, spirit beasts, manuals, or allied workshops;
34
+ - validation/tests → trials, sword arrays, alchemical inspections, or heavenly seals;
35
+ - bugs/retry loops/conflicts → tribulations, curses, enemy schemes, or heart-demon manifestations;
36
+ - commits/releases → completed techniques, expeditions, treaties, or breakthroughs;
37
+ - tokens → spent spiritual stones or divine-sense expenditure, always retaining the exact reported/estimated/unknown distinction.
38
+ 5. Create `plot.md`, `story-state.json`, and chapter 1 as one continuity transaction.
39
+
40
+ ## Local story layout
41
+
42
+ Store all chronicle files under the git-ignored runtime directory:
43
+
44
+ ```text
45
+ .vibekit/reports/tutien/story/
46
+ ├── plot.md
47
+ ├── story-state.json
48
+ ├── latest-context.json
49
+ └── chapters/
50
+ ├── 0001-<cultivation-title>.md
51
+ └── 0002-<cultivation-title>.md
52
+ ```
53
+
54
+ `plot.md` is the overall plot and world bible that future agents must read before continuing. Keep these sections current:
55
+
56
+ - Story constitution: language, style blend, narrative distance, humor level.
57
+ - Project truth map: real project facts and their stable cultivation counterparts.
58
+ - World: sects/clans, regions, laws, resources, history, factions, and power balance.
59
+ - Cultivation system: realms, paths, techniques, artifacts, costs, limits, and breakthrough rules.
60
+ - Cast registry: stable names, localized display names, role, motivation, voice, relationships, and name meaning.
61
+ - Overall plot: central conflict, current arc, planned horizons, and an explicitly open ending.
62
+ - Open threads: mysteries, promises, rival plans, technical risks, and possible payoffs.
63
+ - Chapter ledger: chapter number, title, evidence key, project change, fictional consequence, unresolved hook.
64
+
65
+ `story-state.json` is machine-readable continuity only:
66
+
67
+ ```json
68
+ {
69
+ "schema": "tutien-story-state-v1",
70
+ "language": "vi",
71
+ "style": "web-serial+daily-life",
72
+ "lastChapter": 1,
73
+ "consumedEvidenceKeys": ["0123456789abcdef"]
74
+ }
75
+ ```
76
+
77
+ Do not persist raw prompts, commit subjects, author identities, secrets, URLs, source-file contents, or conversation excerpts in any story file.
78
+
79
+ ## Chapter contract
80
+
81
+ One save equals exactly one chapter file. Use the next contiguous four-digit number and a title that sounds like a real xianxia chapter, not a ticket name or generic label:
82
+
83
+ ```text
84
+ 0007-kiem-y-khai-tran.md
85
+ 0007-sword-intent-opens-the-array.md
86
+ 0007-剑意开阵.md
87
+ ```
88
+
89
+ Every chapter begins with:
90
+
91
+ ```yaml
92
+ ---
93
+ schema: tutien-story-chapter-v1
94
+ chapter: 7
95
+ title: "Localized xianxia chapter title"
96
+ language: vi
97
+ evidence_key: 0123456789abcdef
98
+ ---
99
+ ```
100
+
101
+ The following are content obligations, not a scene order or six-slot template. Arrange, merge, imply, or foreground them according to the user's current request, the repository's distinctive evidence, and the open plot:
102
+
103
+ 1. a scene rooted in the previous hook;
104
+ 2. one or more meaningful project-derived developments;
105
+ 3. character choice and consequence, not a metrics dump;
106
+ 4. dialogue in the active language's xianxia register;
107
+ 5. an earned change in relationships, knowledge, risk, or cultivation posture;
108
+ 6. a forward hook that offers several plausible future paths.
109
+
110
+ Do not force every chapter to open with scenery, introduce evidence at the same beat, stage an antagonist, or end with the same hook mechanism. Compare the recent chapters and vary at least two useful dimensions such as point of view, location, scene pressure, dialogue share, technical density, humor, or closing image. Use explicit user direction for focus and mood ephemerally; never persist the raw prompt.
111
+
112
+ Never advance a realm solely because tokens increased. Never create a second chapter for an already consumed `evidence_key`. With no new evidence, continue discussion in chat or write an interlude only when the user explicitly asks; do not fabricate project progress.
113
+
114
+ ## Language, names, and voice parity
115
+
116
+ Vietnamese, English, and Simplified Chinese use identical facts, continuity, and character intent, but each version must read naturally in its own literary register. Do not translate mechanically.
117
+
118
+ ### Vietnamese (`vi`)
119
+
120
+ - Use fluent modern Vietnamese narration enriched with controlled Hán–Việt cultivation vocabulary.
121
+ - Prefer meaningful two-to-four-syllable personal names and titles whose semantics fit origin, path, and temperament. Record the meaning in the cast registry.
122
+ - Use natural address such as `đạo hữu`, `sư huynh`, `sư tỷ`, `tiền bối`, `bản tọa`, or role-specific titles only when relationships justify them.
123
+ - Keep sentences smooth and readable; avoid piling archaic particles or mechanically converting English metaphors.
124
+ - Follow `vi-style-guide.md` for every heading, title, sentence, and line of dialogue.
125
+ - Use sentence case: `Chương thứ nhất: Kiếm ý khai trận`, not `Chương Thứ Nhất: Kiếm Ý Khai Trận`. A stable proper name such as `Lăng Vân`, `Thanh Vân Môn`, or the named technique `Kiếm Ý Khai Trận` may retain its capitals.
126
+ - Never use spaced ASCII ` - ` as prose punctuation. Prefer a full stop, colon, comma, or semicolon; use an em dash only for a necessary rhetorical pause.
127
+ - Prefer Vietnamese workflow terms. Preserve exact code, paths, commands, and identifiers in backticks.
128
+
129
+ ### English (`en`)
130
+
131
+ - Use clear fantasy prose with measured xianxia terminology and gloss an unfamiliar localized term on first use.
132
+ - Give characters a stable cultivation-style romanized name plus a meaningful English epithet when useful.
133
+ - Use hierarchy and titles consistently; avoid faux-Elizabethan speech unless explicitly selected.
134
+
135
+ ### Simplified Chinese (`zh`)
136
+
137
+ - Use concise, idiomatic modern Chinese web-serial narration with controlled classical cadence.
138
+ - Use meaningful Chinese surnames, given names, Daoist titles, sect names, and technique names; avoid random character combinations.
139
+ - Dialogue should respect seniority and relationship through address, rhythm, and omission rather than explanatory translation.
140
+
141
+ For other user languages, keep narration and dialogue in that language while retaining one stable xianxia name and a localized epithet. Once a name is recorded, never silently rename or retranslate it.
142
+
143
+ ## Character and dialogue generation
144
+
145
+ Use meaningful cultivation-style names. Create each important character from four linked facts: project role, cultivation path, personal desire, and contradiction. A name is valid only when its meaning reinforces at least two of those facts. Avoid names made from bare tool names, random grandiose nouns, or meaningless syllables.
146
+
147
+ Every spoken line must do at least one job: reveal motive, change leverage, interpret evidence, sharpen conflict, set up a technique, or deliver a relevant joke. Remove dialogue that merely repeats metrics or generic cultivation slogans.
148
+
149
+ Humor comes from character logic, hierarchy, technical irony, and timing. Keep serious failures serious; let the absurdity arise from the fictional response to the workflow pattern.
150
+
151
+ Examples and mappings in this reference define possibilities and invariants only. They are not phrase banks, mandatory beats, or response templates.
152
+
153
+ ## Villains: sarcastic and maliciously teasing
154
+
155
+ Villains may be genuinely malicious **inside the fiction**: they exploit the sect's demonstrated weakness, savor the inconvenience, mislead rivals, and tease with sharp sarcasm. Their dialogue should:
156
+
157
+ 1. point at the exact workflow weakness supported by evidence;
158
+ 2. reveal how the villain benefits from it;
159
+ 3. deliver a cutting but meaningful tease;
160
+ 4. leave room for the heroes to answer with the real counter-technique.
161
+
162
+ Aim hostility at the failure mode, plan, array, artifact, or sect strategy—never at the user's identity, intelligence, health, worth, protected traits, or finances. No threats toward the user, humiliation, slurs, or abusive degradation. Safety-sensitive contexts remain neutral and villain-free.
163
+
164
+ Generate antagonist names, titles, schemes, and lines from the current project, language, prior chapters, and evidence. Do not reuse the renderer's fixed villain sentence bank as chapter dialogue.
165
+
166
+ ## Save transaction
167
+
168
+ For every new approved evidence key:
169
+
170
+ 1. Run `node .vibekit/skills/tutien/scripts/story-ledger.mjs status`.
171
+ 2. Read `plot.md`, `story-state.json`, `latest-context.json`, and only the last one to three chapters needed for continuity.
172
+ 3. Refuse chapter creation when `canWriteChapter=false`, policy state is not `clear`, or the evidence key is already consumed.
173
+ 4. Draft the chapter and update `plot.md` without closing the whole saga.
174
+ 5. Write exactly one numbered chapter and update `story-state.json` in the same task.
175
+ 6. Run `node .vibekit/skills/tutien/scripts/story-ledger.mjs validate`.
176
+ 7. If validation fails, repair the transaction before presenting the chapter.