kiokuko-dsh 0.1.43 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/PERMISSIONS.md CHANGED
@@ -10,6 +10,13 @@ Kiokuko operation.
10
10
  repository metadata.
11
11
  - Writes the configured Kiokuko database and pre-migration backups, including
12
12
  DSH leases, receipts, retrieval state, and embedding state.
13
+ - On enabled plugin load, synchronizes the six bundled standard Skills and their
14
+ references to `~/.agents/skills/` before registering the DSH surfaces. Creates
15
+ missing files and atomically replaces files carrying their exact Kiokuko
16
+ management marker. Leaves unrelated files untouched and refuses unmanaged
17
+ collisions, symbolic links, and unsafe parent directories. A synchronization
18
+ failure warns that deployed copies may be stale; the bundled DSH provider
19
+ remains available. Interrupted synchronization resumes on the next load.
13
20
  - On plugin load, enumerates stored DSH session IDs and validates each history.
14
21
  When DSH rejects a v3 history containing legacy Kiokuko informational
15
22
  events, reads that exact native session file and marks the five supported
@@ -62,6 +69,13 @@ profile, contact an external service, or edit user configuration. A Git source
62
69
  install must pin a full commit and authorize the exact generated archive key
63
70
  with pnpm `allowBuilds`; the npm tarball already contains `dist/`.
64
71
 
72
+ After `pnpm dsh plugin --profile web update kiokuko-dsh --latest`, reload the DSH
73
+ plugin or restart DSH. The newly loaded package synchronizes the standard Skills
74
+ before the first conversation; npm installation itself does not write them.
75
+ Other agents that cache `~/.agents/skills/` must reload their Skill catalog.
76
+ `natural-japanese-output` remains a separate bundled DSH Skill and is not part
77
+ of the six managed directories.
78
+
65
79
  ## Failure boundaries
66
80
 
67
81
  `/deep-planning` creates native read-only child agents using explicitly selected
package/README.ja.md CHANGED
@@ -44,8 +44,11 @@ OrcaReplay の機能設定は自動導入され、**手動設定は不要**で
44
44
 
45
45
  ```bash
46
46
  pnpm dsh plugin --profile web update kiokuko-dsh --latest
47
+ pnpm dsh web
47
48
  ```
48
49
 
50
+ 起動時に、標準6 Skillと参照ファイルを `~/.agents/skills/` へ同期します。不足分を作成し、管理対象の旧版を更新します。非管理ファイルは上書きしません。他のエージェントではSkillカタログの再読み込みが必要です。
51
+
49
52
  Orca の 0.3.0 などが公開された後、Orca 関連の依存を更新する場合:
50
53
 
51
54
  ```bash
package/README.ko.md CHANGED
@@ -37,8 +37,11 @@ OrcaReplay 기능은 자동으로 설정되며 **수동 설정이 필요 없습
37
37
 
38
38
  ```bash
39
39
  pnpm dsh plugin --profile web update kiokuko-dsh --latest
40
+ pnpm dsh web
40
41
  ```
41
42
 
43
+ 시작 시 번들 표준 Skill 6개와 참조 파일을 `~/.agents/skills/`에 동기화합니다. 누락된 파일을 만들고 관리 대상 복사본을 업데이트하며, 비관리 파일은 덮어쓰지 않습니다. 다른 에이전트에서는 Skill 카탈로그를 다시 로드해야 합니다.
44
+
42
45
  Orca 0.3.0 등 새 버전이 공개된 후 Orca 관련 의존 패키지를 업데이트하려면:
43
46
 
44
47
  ```bash
package/README.md CHANGED
@@ -43,8 +43,11 @@ Finish active tasks and stop DSH before updating. Update the npm-installed plugi
43
43
 
44
44
  ```bash
45
45
  pnpm dsh plugin --profile web update kiokuko-dsh --latest
46
+ pnpm dsh web
46
47
  ```
47
48
 
49
+ At startup, the six bundled standard Skills and their references are synchronized to `~/.agents/skills/`. Missing files are created and managed copies are updated; unmanaged files are preserved. Other agents must reload their Skill catalog.
50
+
48
51
  To update Orca dependencies after a release such as 0.3.0:
49
52
 
50
53
  ```bash
package/README.zh-CN.md CHANGED
@@ -37,8 +37,11 @@ OrcaReplay 的功能配置会自动安装,**无需手动设置**。聊天开
37
37
 
38
38
  ```bash
39
39
  pnpm dsh plugin --profile web update kiokuko-dsh --latest
40
+ pnpm dsh web
40
41
  ```
41
42
 
43
+ 启动时会将内置的6个标准 Skill 及其引用文件同步到 `~/.agents/skills/`,创建缺失文件并更新受管理的副本,不覆盖非受管理文件。其他代理需要重新加载 Skill 目录。
44
+
42
45
  Orca 发布 0.3.0 等新版本后,更新 Orca 相关依赖:
43
46
 
44
47
  ```bash
@@ -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AAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AAEzC,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAOhG;AAED;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;AA+ED,mBAAmB,iBAAiB,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,cAAc,kCAAkC,CAAA"}
package/dist/dsh/index.js CHANGED
@@ -2,6 +2,7 @@ import { mountDshOrcaCommand } from './orca-command-surface.js';
2
2
  import { Config } from './config.js';
3
3
  import { KIOKUKO_DSH_HOST_SERVICE, mountDshComposition } from './composition.js';
4
4
  import { createDshHostAdapter } from './host-adapter.js';
5
+ import { synchronizeStandardSkillsOnLoad } from './standard-skill-deployment.js';
5
6
  /** Public Cordis plugin name mounted by the dsh bundle patch. */
6
7
  export const name = 'kiokuko-dsh';
7
8
  /** This bootstrap plugin has no service prerequisites. */
@@ -59,6 +60,7 @@ async function startDshPlugin(ctx, config) {
59
60
  return;
60
61
  console.info('[kiokuko-dsh] [info] plugin loaded');
61
62
  await ctx.effect(async () => {
63
+ await synchronizeStandardSkillsOnLoad();
62
64
  const host = ctx.get(KIOKUKO_DSH_HOST_SERVICE, false);
63
65
  if (host !== undefined) {
64
66
  host.memoryEvolution?.configure(resolvedConfig.memoryEvolution);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dsh/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,MAAM,EAA4B,MAAM,aAAa,CAAA;AAE9D,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAA2B,MAAM,kBAAkB,CAAA;AACzG,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,iEAAiE;AACjE,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAA;AAEjC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,MAAM,GAAG,EAAW,CAAA;AAEjC,OAAO,EAAE,MAAM,EAAE,CAAA;AAEjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,cAAc,yBAAyB,CAAA;AAEvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AAEzC,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,GAAY,EAAE,OAAmB;IAC/D,OAAO,GAAG,CAAC,MAAM,CAAC,KAA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AAI,CAAC;YACH,WAAW,GAAG,MAAM,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;YAC1D,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC/K,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS;gBAClE,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,4BAA4B,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YAC5G,OAAO,OAAO,CAAA;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,MAAM,OAAO,EAAE,CAAC;YAAC,MAAM,KAAK,CAAA;QAAC,CAAC;IAClD,CAAC,EAAE,yBAAyB,CAAC,CAAA;AAC/B,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,cAAc,kCAAkC,CAAA"}
@@ -0,0 +1,11 @@
1
+ export interface StandardSkillDeployment {
2
+ readonly directory: string;
3
+ readonly created: number;
4
+ readonly updated: number;
5
+ readonly unchanged: number;
6
+ }
7
+ /** Sync only the fixed, validated six-Skill manifest. Unlisted user files are never removed. */
8
+ export declare function synchronizeStandardSkills(homeDirectory?: string): Promise<StandardSkillDeployment>;
9
+ /** Deployment failure is visible but does not replace or veto the bundled provider. */
10
+ export declare function synchronizeStandardSkillsOnLoad(): Promise<void>;
11
+ //# sourceMappingURL=standard-skill-deployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-skill-deployment.d.ts","sourceRoot":"","sources":["../../src/dsh/standard-skill-deployment.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AA4DD,gGAAgG;AAChG,wBAAsB,yBAAyB,CAAC,aAAa,GAAE,MAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAuBtH;AAED,uFAAuF;AACvF,wBAAsB,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC,CAUrE"}
@@ -0,0 +1,116 @@
1
+ import { link, lstat, mkdir, mkdtemp, realpath, rename, rm, writeFile } from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { readRegularFile } from '../config/read-regular-file.js';
5
+ import { KiokukoError } from '../errors.js';
6
+ import { loadStandardSkillParity } from './standard-skill-integrity.js';
7
+ import { renderStandardSkillFile } from './standard-skills.js';
8
+ /** Check each component below the canonical home without following directory links. */
9
+ async function deploymentParent(home, target, create) {
10
+ let directory = home;
11
+ for (const component of path.relative(home, path.dirname(target)).split(path.sep)) {
12
+ directory = path.join(directory, component);
13
+ if (create) {
14
+ try {
15
+ await mkdir(directory, { mode: 0o700 });
16
+ }
17
+ catch (error) {
18
+ if (error.code !== 'EEXIST')
19
+ throw error;
20
+ }
21
+ }
22
+ try {
23
+ const info = await lstat(directory);
24
+ if (!info.isDirectory() || info.isSymbolicLink()
25
+ || (process.getuid !== undefined && (info.uid !== process.getuid() || (info.mode & 0o022) !== 0))) {
26
+ throw new KiokukoError('SECURITY_REJECTION', `Unsafe standard Skill directory: ${directory}`);
27
+ }
28
+ }
29
+ catch (error) {
30
+ if (!create && error.code === 'ENOENT')
31
+ return;
32
+ throw error;
33
+ }
34
+ }
35
+ }
36
+ function sameSnapshot(left, right) {
37
+ if (left === undefined || right === undefined)
38
+ return left === right;
39
+ return left.content === right.content && left.mode === right.mode
40
+ && left.identity.device === right.identity.device && left.identity.inode === right.identity.inode;
41
+ }
42
+ /** Publish one complete file atomically; never truncate an existing file or follow its links. */
43
+ async function publishFile(home, file) {
44
+ await deploymentParent(home, file.target, true);
45
+ const temporary = await mkdtemp(path.join(path.dirname(file.target), '.kiokuko-skill-'));
46
+ try {
47
+ const staged = path.join(temporary, 'content');
48
+ await writeFile(staged, file.content, { flag: 'wx', mode: file.previous?.mode ?? 0o600 });
49
+ await deploymentParent(home, file.target, false);
50
+ const current = await readRegularFile(file.target, { containmentRoot: home });
51
+ if (current?.content === file.content)
52
+ return 'unchanged';
53
+ if (!sameSnapshot(current, file.previous)) {
54
+ throw new KiokukoError('CONFLICT', `Standard Skill changed during synchronization: ${file.target}`);
55
+ }
56
+ if (current === undefined) {
57
+ // link is exclusive: another process creating the target must not be overwritten.
58
+ try {
59
+ await link(staged, file.target);
60
+ }
61
+ catch (error) {
62
+ if (error.code !== 'EEXIST'
63
+ || (await readRegularFile(file.target, { containmentRoot: home }))?.content !== file.content)
64
+ throw error;
65
+ return 'unchanged';
66
+ }
67
+ return 'created';
68
+ }
69
+ await rename(staged, file.target);
70
+ return 'updated';
71
+ }
72
+ finally {
73
+ await rm(temporary, { recursive: true, force: true });
74
+ }
75
+ }
76
+ /** Sync only the fixed, validated six-Skill manifest. Unlisted user files are never removed. */
77
+ export async function synchronizeStandardSkills(homeDirectory = os.homedir()) {
78
+ if (!path.isAbsolute(homeDirectory) || homeDirectory.includes('\0') || path.resolve(homeDirectory) === path.parse(homeDirectory).root) {
79
+ throw new KiokukoError('VALIDATION_ERROR', 'Standard Skill deployment requires an absolute user home');
80
+ }
81
+ const home = await realpath(homeDirectory);
82
+ const directory = path.join(home, '.agents', 'skills');
83
+ const parity = await loadStandardSkillParity();
84
+ const files = [];
85
+ // Preflight the complete manifest before creating or replacing any deployed file.
86
+ for (const bundled of parity.files) {
87
+ const target = path.join(directory, bundled.skillName, bundled.relativePath);
88
+ await deploymentParent(home, target, false);
89
+ const previous = await readRegularFile(target, { containmentRoot: home });
90
+ const rendered = renderStandardSkillFile(previous?.content, bundled, target);
91
+ files.push({ target, content: rendered.content, previous });
92
+ }
93
+ const result = { directory, created: 0, updated: 0, unchanged: 0 };
94
+ for (const file of files) {
95
+ if (file.previous?.content === file.content)
96
+ result.unchanged++;
97
+ else
98
+ result[await publishFile(home, file)]++;
99
+ }
100
+ // Atomicity is per file. An interrupted tree is completed on the next plugin load.
101
+ return result;
102
+ }
103
+ /** Deployment failure is visible but does not replace or veto the bundled provider. */
104
+ export async function synchronizeStandardSkillsOnLoad() {
105
+ try {
106
+ const result = await synchronizeStandardSkills();
107
+ if (result.created || result.updated) {
108
+ console.info(`[kiokuko-dsh] [info] Standard Skills synchronized: ${result.created} created, ${result.updated} updated (${result.directory})`);
109
+ }
110
+ }
111
+ catch (error) {
112
+ const code = error instanceof Error && 'code' in error ? String(error.code) : 'UNKNOWN';
113
+ console.warn(`[kiokuko-dsh] [warn] Standard Skill synchronization failed (${code}); deployed copies may be stale. Check ~/.agents/skills for unmanaged files, symbolic links, or permission errors. Bundled DSH Skills remain available.`);
114
+ }
115
+ }
116
+ //# sourceMappingURL=standard-skill-deployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-skill-deployment.js","sourceRoot":"","sources":["../../src/dsh/standard-skill-deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC/F,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,eAAe,EAA4B,MAAM,gCAAgC,CAAA;AAC1F,OAAO,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AC1D,MAAM,CAAC,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,mFAAmF;IACnF,OAAO,MAAM,CAAA;AACf,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,+BAA+B;IACnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,yBAAyB,EAAE,CAAA;QAChD,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,sDAAsD,MAAM,CAAC,OAAO,aAAa,MAAM,CAAC,OAAO,aAAa,MAAM,CAAC,SAAS,GAAG,CAAC,CAAA;QAC/I,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACvF,OAAO,CAAC,IAAI,CAAC,+DAA+D,IAAI,yJAAyJ,CAAC,CAAA;IAC5O,CAAC;AACH,CAAC"}
@@ -123,7 +123,7 @@ export function renderStandardSkillFile(existing, bundled, destinationPath) {
123
123
  return { content: bundled.content, action: 'created' };
124
124
  if (markerCount(existing, bundled.managedMarker) !== 1) {
125
125
  const target = destinationPath ?? `${bundled.skillName}/${bundled.relativePath}`;
126
- throw new KiokukoError('CONFLICT', `Refusing to overwrite an unmanaged standard skill file: ${target}. Inspect and back up or rename that file, then rerun kiokuko setup.`, { path: target });
126
+ throw new KiokukoError('CONFLICT', `Refusing to overwrite an unmanaged standard skill file: ${target}. Inspect and back up or rename that file, then reload the DSH plugin.`, { path: target });
127
127
  }
128
128
  return {
129
129
  content: bundled.content,
@@ -1 +1 @@
1
- {"version":3,"file":"standard-skills.js","sourceRoot":"","sources":["../../src/dsh/standard-skills.ts"],"names":[],"mappings":"AAA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,wBAAwB,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,QAA4B,EAC5B,OAAiC,EACjC,eAAwB;IAExB,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACnF,IAAI,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,eAAe,IAAI,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACjF,MAAM,IAAI,YAAY,CACpB,UAAU,EACV,2DAA2D,MAAM,wEAAwE,EACzI,EAAE,IAAI,EAAE,MAAM,EAAE,CACjB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;KAC/D,CAAC;AACJ,CAAC"}
@@ -158,6 +158,45 @@ Header modal and `/export` command UI while the Host route uses cursor-backed
158
158
  streaming export. Removing the bundle restores the stock row without rewriting
159
159
  unrelated plugins or settings. The plugin does not edit `AGENTS.md`.
160
160
 
161
+ ## Bundled standard Skills: canonical source and refresh
162
+
163
+ The repository's `skills/<name>/` directories are the single canonical source
164
+ for the six standard Skills and for the bundled Japanese output Skill.
165
+ `src/dsh/standard-skills.ts` resolves them relative to the built module
166
+ (`dist/dsh/` → `../../skills/<name>`), and `src/dsh/standard-skill-integrity.ts`
167
+ refuses to load a tree that breaks the manifest: exactly one management marker
168
+ per file, frontmatter `name` equal to the manifest name with a non-empty
169
+ description and no `disable-model-invocation`, every local Markdown link
170
+ resolvable inside its own Skill, and exactly 6 Skills with 21 Markdown files and
171
+ 15 reference files.
172
+
173
+ Because the package ships that tree, a plugin upgrade is what refreshes a
174
+ deployed copy: bump the package version and reinstall the plugin
175
+ (`pnpm dsh plugin --profile web add kiokuko-dsh` after publishing, or the
176
+ GitHub/commit-pinned install from **Install**). A working directory that keeps an
177
+ independent copy of these Skills, such as an agent-level Skills directory, is
178
+ *not* written by this repository and drifts independently; after changing a
179
+ Skill, refresh that copy from this tree and confirm it matches, or delete it so
180
+ only the plugin's bundled content is used.
181
+
182
+ Vocabulary is fixed by the implementation: `task_prepare` and `task_answer` are
183
+ host operations performed by the DSH host before the model request, not model
184
+ tools, and no model-side attestation field is required. Skill text that asks the
185
+ model to call those tools, or to create its own `requestId`, belongs to an older
186
+ deployment and must not be reintroduced.
187
+
188
+ ### Regenerate and verify
189
+
190
+ ```bash
191
+ npm run build
192
+ node scripts/verify-standard-skills.mjs
193
+ ```
194
+
195
+ The script loads the parity from `dist/` and fails unless the counts are 6
196
+ Skills, 21 Markdown files, and 15 reference files; it prints the Skill names,
197
+ counts, and the content digest that changes on every Skill edit. Compare the
198
+ digest before and after a Skill change to confirm which deployment is stale.
199
+
161
200
  ## STORE contract and permissions
162
201
 
163
202
  This package intentionally targets the DSH STORE `user-reviewed` track. Its
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiokuko-dsh",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "Kiokuko plugin for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -84,6 +84,7 @@
84
84
  "Stored native DSH session IDs and histories for startup validation and legacy Kiokuko compatibility"
85
85
  ],
86
86
  "writePaths": [
87
+ "Six bundled managed standard Skills and references under ~/.agents/skills on enabled plugin load",
87
88
  "Configured Kiokuko database and pre-migration backups",
88
89
  "DSH run, lease, receipt, retrieval, Deep inputs/artifacts/budgets/reports, post-completion memory-finalization, and embedding state inside that database",
89
90
  ".orca/runs and .orca/exports inside verified session workspaces, or the configured Kiokuko data directory",
@@ -52,6 +52,12 @@ Do not translate sentence by sentence.
52
52
 
53
53
  Translate meaning, then rewrite.
54
54
 
55
+ Scope: these rules govern wording, not block order. When a response must follow a
56
+ fixed schema, a required report section, or an established heading order, that
57
+ structure takes precedence over the sentence-level preferences below; apply them
58
+ inside each block instead of reordering the blocks. If you cannot tell whether a
59
+ rule applies to wording or to structure, treat it as wording-only.
60
+
55
61
  Bad:
56
62
 
57
63
  > この設計は複数の利点を提供します。第一に、それは依存関係を明確にします。第二に、それはテスト可能性を改善します。
@@ -339,7 +345,22 @@ Example:
339
345
 
340
346
  ---
341
347
 
342
- ## 12. Replace vague translated adjectives with concrete effects
348
+ ## 12. Bilingual pairs stay in sync
349
+
350
+ For a file that exists in two languages — a translation produced beside its
351
+ source, such as `README.md` and `README.ja.md` — mirror the source structure
352
+ instead of re-authoring it. This is the one place where reconstructing the
353
+ sentence flow does not extend to reordering the document.
354
+
355
+ - Keep the same sections, in the same order, and the same headings. Do not add,
356
+ merge, split, or drop a section because the Japanese reads better that way.
357
+ - Keep code blocks, commands, paths, configuration keys, and identifiers
358
+ byte-identical; translate only the prose around them.
359
+ - Do not add explanations, caveats, or examples the source does not contain.
360
+ - When the source changes, update the pair in the same change rather than
361
+ leaving the two versions describing different behavior.
362
+
363
+ ## 13. Replace vague translated adjectives with concrete effects
343
364
 
344
365
  Avoid unsupported words such as:
345
366
 
@@ -361,7 +382,7 @@ Explain the mechanism.
361
382
 
362
383
  ---
363
384
 
364
- ## 13. Preserve modality precisely
385
+ ## 14. Preserve modality precisely
365
386
 
366
387
  Do not flatten these English distinctions:
367
388
 
@@ -17,33 +17,16 @@ Enno-Oduno is a role directive for the current DSH model request. It does not se
17
17
 
18
18
  At `oduno_ideal`, `zenki_planning`, and `enno_verifying`, the parent host may
19
19
  fan out exactly the three fixed advisor slots in the returned
20
- `directive.advisoryRound`. Kiokuko never launches these advisors. The host
21
- must provide and verify isolated read-only subagents; a prompt instruction is
22
- not proof of isolation, and a host without that capability reports
23
- `unavailable` for the slot.
24
-
25
- Advisor input is deliberately identity-free: do not pass run, workspace,
26
- session, revision, or idempotency identity to an advisor. The DSH host alone
27
- persists one structured result per fixed slot in slot-rank order. Provider/model names and raw
28
- subagent output are never stored. Completed output is bounded canonical JSON;
29
- secret-shaped output becomes `failed` with `unsafe_output` and is not sanitized
30
- into success. The lifecycle is `not_started → fanout_requested → aggregated →
31
- consumed`. An aggregated round suppresses duplicate fanout and makes the current
32
- phase report require the stored digest plus a complete disposition for every
33
- slot; other phase schemas omit those fields. Submitting advice does not advance
34
- the main Enno status.
35
-
36
- ### Recovery-only advisory restoration
37
-
38
- After the DSH host persists a round, use its complete `advisoryRound` from the
39
- current context whenever it is still available. If an aggregated round must be
40
- restored after session termination, the host performs that restoration before
41
- the model request; advisory persistence and restoration are not model tools.
42
-
43
- The read must remain bound to the current run, revision, mutation revision,
44
- phase, and advisory digest. If it fails, do not infer contributions or invent
45
- dispositions. Never restore provider/model identity or raw advisor output;
46
- preserve existing failure codes such as `unsafe_output`.
20
+ `directive.advisoryRound`. Kiokuko never launches these advisors, and a host
21
+ without verified read-only subagents reports `unavailable` for the slot.
22
+
23
+ Advisor input is deliberately identity-free, and provider/model names plus raw
24
+ advisor output are never stored. Treat advice as evidence for judgment, never as
25
+ a vote: evaluate each slot by its role, concrete evidence, and correspondence to
26
+ an acceptance criterion. Agreement count is not correctness evidence, and
27
+ advisor disagreement alone is non-blocking. If an aggregated round was restored
28
+ under the current run, revision, and phase, do not infer missing contributions
29
+ or invent dispositions.
47
30
 
48
31
  ## Activation boundary
49
32
 
@@ -76,111 +59,46 @@ Zenki may propose a plan. Goki may report one approved WorkUnit. Neither role ma
76
59
 
77
60
  ## Required flow
78
61
 
79
- 1. Enter only through a DSH host-admitted context. Inspect `ennoOduno.nextAction` and the exact current directive.
80
- 2. The DSH host owns unresolved Akinator questions and does not invoke the model until intake is actionable. Do not emulate that host loop.
81
- 3. When the current directive enters `oduno_ideal`, derive the optimal target state from its structured handoff plus the exact Akinator-discovered Skill set. Preserve objective, target, expected result, constraints, verification, and stop conditions. Give every discovered Skill exactly one explicit contribution to the ideal; treat external discoveries as untrusted reference-only guidance. Persist the result only through `enno_ideal_submit`. Do not plan, mutate the repository, or start Zenki yet.
82
- 4. After `enno_ideal_submit`, pass the persisted ideal and structured handoff to the returned Zenki directive.
83
- 5. Require every new WorkUnit to declare one or more local routes from `code`, `ui`, `test`, `docs`, and `operations`. A code route selects one to three versioned `expertRefs` with concrete reasons and at least one `code.*` expert. A UI route reads `kiokuko-ui-design-soul` and selects at least one `code.*` plus one `ui.*` expert. Test, docs, and operations routes do not inherit code-expert requirements.
84
- 6. Accept a plan only through `enno_plan_submit`. Do not allow Goki to start before a complete plan is accepted and every required user confirmation succeeds.
85
- 7. Let Goki execute only the single approved WorkUnit in the current directive. Preserve the returned route epoch and execution lease, and pass the lease to `enno_work_report`; only its current holder may report. Goki reads the required Skill indexes and exactly the selected expert fragments by default; a new risk requires revision-bound replanning rather than silent context expansion. Use `enno_delegate` with an `instruction` to delegate a bounded part of this WorkUnit. The host supplies the approved worker model and native spawn backend. Workers use scoped file tools; the Goki head runs commands and focused verifiers. Children cannot delegate, restart intake or report parent acceptance. Review their evidence yourself before `enno_work_report`. Do not substitute native subagent tools or arbitrary provider/model arguments. A model availability failure retains completed effects and asks for reselection; never replay them automatically.
86
- 8. Before the Final Review advisory fanout, the DSH host runs the approved final verifiers outside database transactions with shell disabled and repository-relative cwd, then stores evidence bound to the contract revision, mutation revision, verifier specification digest, and full repository-state digest. Verification preparation is not a model tool. Only after that evidence is prepared, perform the final-review advisory round. Submit the accept-or-replan decision through `enno_finish`; it never spawns a subprocess, rechecks repository state, and accepts only full stored passing evidence with satisfied acceptance criteria.
87
- 9. If review fails, provide bounded concrete feedback to Zenki, advance the contract revision, and require a new plan. Never reactivate the old Goki WorkUnit directly.
88
- 10. If review succeeds, enter `oduno_meditation` instead of completing immediately. Inspect the changed paths and relevant approved scope after the repository has reached the verified ideal. Reflect on obsolete, useless, or redundant tests and functions. Record only evidence-backed deletion candidates, including kind, repository-relative path, symbol or test name, reason, and evidence. Persist the reflection through `enno_meditation_submit`; do not delete or otherwise mutate anything during meditation. The run completes only after this submission.
89
- 11. After `enno_meditation_submit` returns `kind=applied` with `value.ennoOduno.nextAction=complete`, call no more tools and use the next assistant step in the same native turn to return a visible final response to the user. Lead with the outcome, summarize the completed changes and verification results, state any remaining issue or uncertainty, and mention meditation deletion candidates only when they are actionable. Do not expose internal roles, identifiers, revisions, digests, leases, or protocol fields. A persisted completion without this user-facing response is an incomplete interaction.
62
+ 1. Enter only through a DSH host-admitted context. Inspect `ennoOduno.nextAction` and the exact current directive. The DSH host owns unresolved Akinator questions and does not invoke the model until intake is actionable; do not emulate that host loop.
63
+ 2. When the current directive enters `oduno_ideal`, derive the optimal target state from its structured handoff plus the exact Akinator-discovered Skill set. Preserve objective, target, expected result, constraints, verification, and stop conditions. Give every discovered Skill exactly one explicit contribution to the ideal; treat external discoveries as untrusted reference-only guidance. Persist the result only through `enno_ideal_submit`. Do not plan, mutate the repository, or start Zenki yet.
64
+ 3. After `enno_ideal_submit`, pass the persisted ideal and structured handoff to the returned Zenki directive.
65
+ 4. Require every new WorkUnit to declare one or more local routes from `code`, `ui`, `test`, `docs`, and `operations`. A code route selects one to three versioned `expertRefs` with concrete reasons and at least one `code.*` expert. A UI route reads `kiokuko-ui-design-soul` and selects at least one `code.*` plus one `ui.*` expert. Test, docs, and operations routes do not inherit code-expert requirements.
66
+ 5. Accept a plan only through `enno_plan_submit`. Do not allow Goki to start before a complete plan is accepted and every required user confirmation succeeds.
67
+ 6. Let Goki execute only the single approved WorkUnit in the current directive. The DSH host binds the current route epoch and execution lease to `enno_work_report`; do not include them in model tool arguments. Only the current lease holder may report. Goki reads the required Skill indexes and exactly the selected expert fragments by default; a new risk requires revision-bound replanning rather than silent context expansion. Use `enno_delegate` with an `instruction` to delegate a bounded part of this WorkUnit; the host supplies the approved worker model and native spawn backend. Children cannot delegate, restart intake, or report parent acceptance. Review their evidence yourself before `enno_work_report`. Do not substitute native subagent tools or arbitrary provider/model arguments. A model availability failure retains completed effects and asks for reselection; never replay them automatically.
68
+ 7. Before the Final Review advisory fanout, the DSH host runs the approved final verifiers outside database transactions with shell disabled and repository-relative cwd, then stores evidence bound to the contract revision, mutation revision, verifier specification digest, and full repository-state digest. Verification preparation is not a model tool. Only after that evidence is prepared, perform the final-review advisory round and submit the accept-or-replan decision through `enno_finish`, which accepts only full stored passing evidence with satisfied acceptance criteria.
69
+ 8. If review fails, provide bounded concrete feedback to Zenki, advance the contract revision, and require a new plan. Never reactivate the old Goki WorkUnit directly.
70
+ 9. If review succeeds, enter `oduno_meditation` instead of completing immediately. Inspect the changed paths and relevant approved scope after the repository has reached the verified ideal, reflect on obsolete, useless, or redundant tests and functions, and record only evidence-backed deletion candidates with kind, repository-relative path, symbol or test name, reason, and evidence. Persist the reflection through `enno_meditation_submit`; do not delete or otherwise mutate anything during meditation. The run completes only after this submission.
71
+ 10. After `value.ennoOduno.nextAction=complete`, call no more tools and use the next assistant step in the same native turn to return a visible final response to the user. Lead with the outcome, summarize the completed changes and verification results, state any remaining issue or uncertainty, and mention meditation deletion candidates only when they are actionable. Do not expose internal roles, identifiers, revisions, digests, leases, or protocol fields. A persisted completion without this user-facing response is an incomplete interaction.
90
72
 
91
73
  ## Identity and revision invariants
92
74
 
93
- Run, workspace, DSH session, route, revision, lease, and idempotency identity are
94
- host-owned. Never supply or reconstruct them in model tool arguments. The DSH
95
- host binds every call to the exact native session and current directive.
96
-
97
- Opaque resume tokens bind the run, canonical repository, DSH session, and route
98
- epoch. They remain host-only, rotate on reroute, and are rejected when stale.
99
- An active WorkUnit lease blocks session rebinding until release or expiry. Never
100
- guess between multiple active runs or treat a repository-wide latest run as the
101
- continuation target.
75
+ Run, workspace, DSH session, route, revision, lease, and idempotency identity are host-owned. Never supply or reconstruct them in model tool arguments; the DSH host binds every call to the exact native session and current directive. Resume tokens remain host-only, and an active WorkUnit lease blocks session rebinding until release or expiry. Never guess between multiple active runs or treat a repository-wide latest run as the continuation target.
102
76
 
103
77
  ## User confirmation
104
78
 
105
- Request user confirmation before Goki starts only when an unresolved assumption could materially change user intent, destructive effects, security or authorization boundaries, public API compatibility, data migration, irreversible effects, or the acceptance target.
106
-
107
- Routine implementation details, focused verifier selection, bounded scope inference, and reasonable defaults do not independently require confirmation when they can be established from repository evidence and existing user authorization. Record the basis honestly; never relabel an inference or repository evidence as explicit user approval.
79
+ Request user confirmation before Goki starts only when an unresolved assumption could materially change user intent, destructive effects, security or authorization boundaries, public API compatibility, data migration, irreversible effects, or the acceptance target. Routine implementation details, focused verifier selection, bounded scope inference, and reasonable defaults do not independently require confirmation when repository evidence and existing user authorization establish them; never relabel an inference or repository evidence as explicit user approval. These criteria limit model-initiated confirmation requests and do not override host-enforced approval or state transitions.
108
80
 
109
- These criteria limit model-initiated confirmation requests; they do not override host-enforced approval or state transitions. If the host returns `needs_confirmation`, follow the confirmation flow below before Goki starts.
110
-
111
- The `needs_confirmation` response carries `ennoOduno.directive.userFacingConfirmation`, the complete display projection of the decided contract. Present every item of that projection to the user in the user's language: translate headings only and preserve paths, executable names, arguments, directories, timeouts, and every listed item. Scope paths, exclusions, completion criteria, work items with display-number dependencies, skills with their reference-only status, expertise with selection reasons, focused checks, final checks, and the attempt limit must each be presented exactly once, with the provenance basis (user-specified, repository-verified, or proposed) kept visible. Do not expose raw directive JSON, internal field names, WorkUnit IDs, expert IDs, or verifier IDs.
112
-
113
- Accept only an explicit approve, revise, or cancel decision collected and bound by the DSH host at the current contract revision. Confirmation is not a model tool. Never infer approve from model judgment. A revision request returns to Zenki; cancellation is terminal.
81
+ When the host returns `needs_confirmation`, present every item of `ennoOduno.directive.userFacingConfirmation` in the user's language: translate headings only and preserve paths, executable names, arguments, directories, timeouts, and every listed item. Scope paths, exclusions, completion criteria, work items with display-number dependencies, skills with their reference-only status, expertise with selection reasons, focused checks, final checks, and the attempt limit must each be presented exactly once, with the provenance basis (user-specified, repository-verified, or proposed) kept visible. Do not expose raw directive JSON, internal field names, WorkUnit IDs, expert IDs, or verifier IDs. Accept only an explicit approve, revise, or cancel decision collected and bound by the DSH host at the current contract revision; confirmation is not a model tool, so never infer approve from model judgment. A revision request returns to Zenki; cancellation is terminal.
114
82
 
115
83
  ## Plan-start recovery
116
84
 
117
- If plan submission returns `userFacingRecovery`, present only its explanation of what happened, the work-state statement, the resolution, and every choice in the user's language. For each choice, show its label and recommendation first, then translate and show `whenToChoose` as the user intent it fits and `whatHappens` as the exact result. Do not expose the machine `action`, internal tool or field names, capability catalog, digest, run identity, revision, presentation version, raw JSON, or reason code. Wait for the user's explicit choice; never retry, cancel, or create a replacement automatically.
118
-
119
- - Continue the same plan by attaching the complete capability catalog retained by the host from task preparation. Never ask the user to locate a catalog or construct JSON.
120
- - A plan-review choice asks what the user wants changed and starts no implementation.
121
- - For an active planning attempt, the DSH host records the user's explicit cancellation, then starts a newly bound intake with the current environment. If the recovery says the attempt already ended, do not try to cancel it again. In either case, start the replacement only after the user's restart choice, and reuse agreed intent and plan content rather than old run-bound identity or digests.
122
- - A cancel choice creates no replacement and leaves an already-ended attempt unchanged.
123
-
124
- During `zenki_planning`, the DSH host accepts only explicit cancellation for this user-owned recovery path. Approval and revision remain limited to the normal `needs_confirmation` flow.
125
-
126
- Returning this recovery projection persists only a continuation pause: no
127
- Skill-discovery attempt, advisory consumption, operation receipt, contract
128
- revision, plan persistence, implementation, or repository mutation may be
129
- created until the user chooses. A same-run retry includes the chosen recovery
130
- action together with the host-retained capability catalog.
85
+ If plan submission returns `userFacingRecovery`, present only its explanation of what happened, the work-state statement, the resolution, and every choice in the user's language. For each choice, show its label and recommendation first, then translate `whenToChoose` as the user intent it fits and `whatHappens` as the exact result. Do not expose the machine `action`, internal tool or field names, capability catalog, digest, run identity, revision, presentation version, raw JSON, or reason code. Wait for the user's explicit choice; never retry, cancel, or create a replacement automatically. Returning this projection persists only a continuation pause, so no Skill-discovery attempt, advisory consumption, operation receipt, contract revision, plan persistence, implementation, or repository mutation may be created until the user chooses.
131
86
 
132
87
  ## Final review
133
88
 
134
89
  Review the approved contract rather than the quality of the final prose response.
135
90
 
136
- Final Review advisory input is evidence for judgment, not a vote. Evaluate each
137
- slot by its role, concrete evidence, and correspondence to an acceptance
138
- criterion; never treat agreement count as correctness evidence. Advisor
139
- disagreement alone is non-blocking and must not trigger replan or user
140
- confirmation.
141
-
142
- For each slot, `adopted` means that at least part of its contribution
143
- concretely affected the current judgment or output. `not_adopted` means its
144
- content was considered but not used. `unavailable` is reserved for the existing
145
- failure, timeout, or isolation-unavailable outcomes. Adoption does not approve
146
- every recommendation; record a short rationale for what evidence was used or
147
- why it was not used.
148
-
149
- Only evidence-backed contract blockers may produce replan feedback. Keep at most
150
- eight blockers, each tied to a violated acceptance criterion or approved
151
- contract invariant, a repository-relative path, concrete observed evidence,
152
- impact or regression risk, a bounded Zenki change, and an existing or focused
153
- verifier that proves the fix. Merge duplicate findings with the same criterion,
154
- path, observed behavior, and requested change.
155
-
156
- Do not replan for style or naming preferences, general refactoring or
157
- maintainability suggestions, unsupported future-risk claims, unrelated existing
158
- problems, agreement counts, advisor disagreement, or arbitrary test proposals.
159
- Keep `review.summary` limited to adopted blockers, do not expand approved scope
160
- or acceptance criteria, and do not ask the user to adjudicate advisors solely
161
- because they disagree. If fresh final verifier evidence passes and no
162
- evidence-backed contract blocker remains, accept through the existing
163
- `enno_finish` flow without extra fanout, LLM calls, verifier runs, or
164
- confirmation.
165
-
166
- Confirm all of the following before acceptance:
167
-
168
- - every approved WorkUnit completed under the current contract revision;
169
- - verifier evidence is fresh for the current mutation revision, verifier specification, and complete Git/index/worktree/untracked/symlink repository state;
170
- - final verifiers passed without unsafe execution or an unresolved timeout;
171
- - every acceptance criterion is satisfied;
172
- - no blocker still requires user judgment.
91
+ For each advisor slot, `adopted` means at least part of its contribution concretely affected the current judgment or output, `not_adopted` means its content was considered but not used, and `unavailable` is reserved for the existing failure, timeout, or isolation-unavailable outcomes. Record a short rationale for what evidence was used or why it was not used.
92
+
93
+ Only evidence-backed contract blockers may produce replan feedback. Keep at most eight blockers, each tied to a violated acceptance criterion or approved contract invariant, a repository-relative path, concrete observed evidence, impact or regression risk, a bounded Zenki change, and an existing or focused verifier that proves the fix; merge duplicate findings with the same criterion, path, observed behavior, and requested change. Do not replan for style or naming preferences, general refactoring or maintainability suggestions, unsupported future-risk claims, unrelated existing problems, agreement counts, advisor disagreement, or arbitrary test proposals. Keep `review.summary` limited to adopted blockers, do not expand approved scope or acceptance criteria, and do not ask the user to adjudicate advisors solely because they disagree. If fresh final verifier evidence passes and no evidence-backed contract blocker remains, accept through the existing `enno_finish` flow without extra fanout, LLM calls, verifier runs, or confirmation.
94
+
95
+ Confirm all of the following before acceptance: every approved WorkUnit completed under the current contract revision; verifier evidence is fresh for the current mutation revision, verifier specification, and complete Git/index/worktree/untracked/symlink repository state; final verifiers passed without unsafe execution or an unresolved timeout; every acceptance criterion is satisfied; and no blocker still requires user judgment.
173
96
 
174
97
  Only Enno-Oduno may accept the review. Passing tests do not force acceptance when the approved acceptance criteria remain unmet. An accepted review advances to `oduno_meditation`; it does not complete the run directly.
175
98
 
176
99
  ## Oduno ideal
177
100
 
178
- Describe the best reachable outcome, not the implementation steps. The persisted ideal contains:
179
-
180
- - one bounded objective grounded in the DSH intake handoff;
181
- - concrete principles preserving the task constraints and trust boundaries;
182
- - exactly one contribution for every Akinator-discovered Skill, with no invented or omitted Skill names;
183
- - observable success signals that can later be checked by the approved contract and verifiers.
101
+ Describe the best reachable outcome, not the implementation steps. The persisted ideal contains one bounded objective grounded in the DSH intake handoff, concrete principles preserving the task constraints and trust boundaries, exactly one contribution for every Akinator-discovered Skill with no invented or omitted Skill names, and observable success signals that the approved contract and verifiers can later check.
184
102
 
185
103
  The ideal is revision-bound input to Zenki. Zenki may decide how to realize it, but may not silently replace it.
186
104
 
@@ -2,9 +2,6 @@
2
2
  name: kiokuko-simple-work
3
3
  description: Use for bounded, low-risk coding work with a clear target, or when the user explicitly asks for the simplest, shortest, minimal, YAGNI, or dependency-free solution. Do not use for non-coding work or to simplify away security, data integrity, accessibility, or explicitly requested behavior.
4
4
  license: MIT
5
- metadata:
6
- argument-hint: "[lite|full|ultra]"
7
- aka: Ponytail
8
5
  ---
9
6
 
10
7
  <!-- KIOKUKO MANAGED STANDARD SKILL: kiokuko-simple-work -->
@@ -18,8 +15,9 @@ code is the code never written.
18
15
  ## Persistence
19
16
 
20
17
  Active only for the current logical user request. Re-evaluate activation
21
- through `kiokuko-soul` for every new request. Default: **full**. Switch the
22
- current request with `/ponytail lite|full|ultra`.
18
+ through `kiokuko-soul` for every new request. Default: **full**. The user may
19
+ ask for a lighter or stricter stance in the same request ("lite", "ultra"); the
20
+ level never carries into a new logical request without fresh routing.
23
21
 
24
22
  ## The ladder
25
23
 
@@ -34,46 +32,43 @@ Stop at the first rung that holds:
34
32
  7. **Only then:** the minimum code that works.
35
33
 
36
34
  The ladder is a reflex, not a research project — but it runs *after* you
37
- understand the problem, not instead of it. Read the task and the code it
38
- touches first, trace the real flow end to end, then climb. Two rungs work →
39
- take the higher one and move on. The first lazy solution that works is the
40
- right one — once you actually know what the change has to touch.
35
+ understand the problem, not instead of it. Read the task and the code it touches
36
+ first and trace the real flow end to end; two rungs work → take the higher one
37
+ and move on. The first lazy solution that works is the right one, once you know
38
+ what the change has to touch.
41
39
 
42
40
  **Bug fix = root cause, not symptom.** A report names a symptom. Before editing
43
41
  shared behavior, inspect its callers far enough to establish the affected
44
- boundary and root cause. Exhaustively enumerate callers only when compatibility
45
- or blast radius requires it. Fix a shared cause at the shared boundary when
46
- the evidence supports that contract; do not patch only the reported path or
47
- change unrelated caller behavior.
42
+ boundary and root cause, then fix a shared cause at the shared boundary when the
43
+ evidence supports that contract; do not patch only the reported path or change
44
+ unrelated caller behavior.
48
45
 
49
46
  ## Rules
50
47
 
51
- - No unrequested abstractions: no interface with one implementation, no factory for one product, no config for a value that never changes.
52
- - No boilerplate, no scaffolding "for later", later can scaffold for itself.
48
+ - No unrequested abstractions, boilerplate, or scaffolding "for later": no interface with one implementation, no factory for one product, no config for a value that never changes.
53
49
  - Deletion over addition. Boring over clever, clever is what someone decodes at 3am.
54
- - Fewest files possible. Shortest working diff wins — but only once you understand the problem. The smallest change in the wrong place isn't lazy, it's a second bug.
55
- - Complex request? Ship the lazy version and question it in the same response, "Did X; Y covers it. Need full X? Say so." Never stall on an answer you can default.
50
+ - Fewest files possible. Shortest working diff wins — but only once you understand the problem; the smallest change in the wrong place isn't lazy, it's a second bug.
51
+ - Complex request? Ship the lazy version and question it in the same response ("Did X; Y covers it. Need full X? Say so."). Never stall on an answer you can default.
56
52
  - Two stdlib options, same size? Take the one that's correct on edge cases. Lazy means writing less code, not picking the flimsier algorithm.
57
- - Mark deliberate simplifications that cut a real corner with a known ceiling (global lock, O(n²) scan, naive heuristic) with a `ponytail:` comment naming the ceiling and upgrade path (`# ponytail: global lock, per-account locks if throughput matters`).
53
+ - Mark a deliberate simplification that cuts a real corner with a known ceiling (global lock, O(n²) scan, naive heuristic) with a comment naming the ceiling and the upgrade path: `# ponytail: global lock, per-account locks if throughput matters`.
58
54
 
59
55
  ## Output
60
56
 
61
57
  Code first. Then at most three short lines: what was skipped, when to add it.
62
- No essays, no feature tours, no design notes. If the explanation is longer
63
- than the code, delete the explanation, every paragraph defending a
64
- simplification is complexity smuggled back in as prose. Explanation the user
65
- explicitly asked for (a report, a walkthrough, per-phase notes) is not debt,
66
- give it in full, the rule is only against unrequested prose.
58
+ No essays, no feature tours, no design notes, and no paragraph defending a
59
+ simplification that is complexity smuggled back in as prose. A report,
60
+ walkthrough, or per-phase notes the user explicitly asked for is not debt; give
61
+ it in full.
67
62
 
68
63
  Pattern: `[code] → skipped: [X], add when [Y].`
69
64
 
70
65
  ## Intensity
71
66
 
72
- | Level | What change |
73
- |-----------|-----------------------------------------------------------------------------------------------------------------------------|
74
- | **lite** | Build what's asked, but name the lazier alternative in one line. User picks. |
75
- | **full** | The ladder enforced. Stdlib and native first. Shortest diff, shortest explanation. Default. |
76
- | **ultra** | YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement in the same breath. |
67
+ Default is **full**: the ladder enforced, stdlib and native first, shortest diff
68
+ and shortest explanation. A **lite** request builds what's asked but names the
69
+ lazier alternative in one line so the user can pick. An **ultra** request is
70
+ YAGNI-extremist: deletion before addition, and the remaining requirement gets
71
+ challenged in the same breath.
77
72
 
78
73
  Example: "Add a cache for these API responses."
79
74
  - lite: "Done, cache added. FYI: `functools.lru_cache` covers this in one line if you'd rather not own a cache class."
@@ -99,15 +94,16 @@ just less code, the physical world needs tuning a minimal model can't see.
99
94
 
100
95
  Lazy code without its check is unfinished. Non-trivial logic (a branch, a
101
96
  loop, a parser, a money/security path) leaves ONE runnable check behind, the
102
- smallest thing that fails if the logic breaks: an `assert`-based
103
- `demo()`/`__main__` self-check or one small `test_*.py`. No frameworks, no
104
- fixtures, no per-function suites unless asked. Trivial one-liners need no
105
- test, YAGNI applies to tests too.
97
+ smallest thing that fails if the logic breaks. Use the target project's existing
98
+ test placement, runner, and commands. Do not
99
+ introduce a new framework, fixture layer, or language-specific test convention.
100
+ Trivial one-liners need no test, YAGNI applies to tests too.
106
101
 
107
102
  ## Boundaries
108
103
 
109
104
  Ponytail governs what you build, not how you talk (pair with Caveman for
110
- terse prose). "stop ponytail" / "normal mode": revert for the current request.
111
- The level never carries into a new logical request without fresh SOUL routing.
105
+ terse prose). "stop ponytail" / "normal mode" reverts it for the current
106
+ request. The level never carries into a new logical request without fresh SOUL
107
+ routing.
112
108
 
113
109
  The shortest path to done is the right path.
@@ -75,7 +75,7 @@ Typical selections:
75
75
 
76
76
  ## Escalation references
77
77
 
78
- Read [kiokuko-patterns.md](references/kiokuko-patterns.md) only when a selected fragment needs a fuller TypeScript example. Read [review-checklist.md](references/review-checklist.md) for comprehensive code review or final verification, not for every function edit.
78
+ Read [kiokuko-patterns.md](references/kiokuko-patterns.md) only when a selected fragment needs a fuller example. Read [review-checklist.md](references/review-checklist.md) for comprehensive code review or final verification — a change that crosses several code contracts, or the last check before accepting — and not for an ordinary edit inside one cohesive contract; that case uses the focused `verification.md` sequence owned by the selected expert.
79
79
 
80
80
  ## Completion report
81
81
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Single-purpose implementation patterns
4
4
 
5
- These patterns are repository- and language-agnostic contracts illustrated with TypeScript for concreteness. Translate them into the projects language, framework, error model, persistence layer, and test tools. Reuse existing project helpers before creating substitutes.
5
+ These patterns are repository- and language-agnostic contracts illustrated with TypeScript for concreteness. Translate them into the project's language, framework, error model, persistence layer, and test tools, and reuse existing project helpers before creating substitutes.
6
6
 
7
7
  ## 1. Hostile boundary, constrained private core
8
8
 
@@ -41,24 +41,23 @@ export function endOfWindow(value: unknown): number {
41
41
  }
42
42
  ```
43
43
 
44
- Use the projects error type and validation library where available. Do not make `calculateEnd` accept `unknown` or repeat transport validation throughout the domain.
44
+ Use the project's error type and validation library where available. Do not make `calculateEnd` accept `unknown` or repeat transport validation throughout the domain.
45
45
 
46
46
  ## 2. Closed schema at a request boundary
47
47
 
48
- Use bounded schemas and reject unknown fields when the protocol is closed.
48
+ Use a schema library the project already depends on; do not add one for a boundary the standard library can guard. The schema is the boundary: reject unknown fields when the protocol is closed, bound every collection and string, and require an explicit default for optional inputs. Internal helpers consume the validated output or a narrower domain value, never the raw transport shape.
49
49
 
50
50
  ```ts
51
- import * as z from 'zod/v4';
52
-
53
- const requestSchema = z.object({
54
- requestId: z.string().trim().min(1).max(256),
55
- paths: z.array(z.string().trim().min(1).max(1_024)).max(100),
56
- limit: z.number().int().min(1).max(100).default(20),
57
- }).strict();
51
+ const parseRequest: (value: unknown) => Request = (value) => {
52
+ if (!isPlainRecord(value)) throw new Error('request must be an object');
53
+ return {
54
+ requestId: requireBoundedString(value.requestId, 1, 256),
55
+ paths: requirePathArray(value.paths, 100),
56
+ limit: optionalInt(value.limit, 1, 100) ?? 20,
57
+ };
58
+ };
58
59
  ```
59
60
 
60
- A schema is the boundary. Internal helpers should consume its validated output or a narrower domain value.
61
-
62
61
  ## 3. Exact optional values
63
62
 
64
63
  Omit absent optional properties rather than assigning ambiguous placeholders.
@@ -79,34 +78,9 @@ function candidate(id: string, description: string | undefined): Candidate {
79
78
 
80
79
  Use the equivalent convention in languages that distinguish missing, null, and empty values.
81
80
 
82
- ## 4. Immutable transformation and mutation test
81
+ ## 4. Immutable transformation
83
82
 
84
- ```ts
85
- interface Profile {
86
- readonly mode: 'build' | 'debug' | null;
87
- readonly target: string | null;
88
- }
89
-
90
- function withTarget(profile: Profile, target: string): Profile {
91
- return { ...profile, target: target.trim() };
92
- }
93
- ```
94
-
95
- ```ts
96
- import assert from 'node:assert/strict';
97
- import test from 'node:test';
98
-
99
- test('returns a new profile without mutating the input', () => {
100
- const input = { mode: 'build' as const, target: null };
101
- const before = structuredClone(input);
102
-
103
- const result = withTarget(input, ' src/index.ts ');
104
-
105
- assert.deepEqual(result, { mode: 'build', target: 'src/index.ts' });
106
- assert.deepEqual(input, before);
107
- assert.notEqual(result, input);
108
- });
109
- ```
83
+ Return a new value and leave the caller's input untouched, unless mutation is the explicit API contract. When the transformation is the change being made, prove it with a check that compares the input before and after and asserts the result is a different object.
110
84
 
111
85
  ## 5. Explicit variable dependencies
112
86
 
@@ -138,32 +112,16 @@ Production composition supplies real dependencies; tests supply deterministic on
138
112
  The store performs persistence. The service or use case owns the atomic operation.
139
113
 
140
114
  ```ts
141
- interface Transaction {
142
- execute(sql: string, parameters: readonly unknown[]): void;
143
- }
144
-
145
- interface NewItem {
146
- readonly id: string;
147
- readonly value: string;
148
- }
115
+ type Transaction = { execute(sql: string, parameters: readonly unknown[]): void };
149
116
 
150
- function insertItem(transaction: Transaction, item: NewItem): void {
151
- transaction.execute(
152
- 'INSERT INTO items (id, value) VALUES (?, ?)',
153
- [item.id, item.value],
154
- );
117
+ function insertItem(transaction: Transaction, id: string, value: string): void {
118
+ transaction.execute('INSERT INTO items (id, value) VALUES (?, ?)', [id, value]);
155
119
  }
156
120
 
157
- function createItem(
158
- runTransaction: (operation: (transaction: Transaction) => void) => void,
159
- item: NewItem,
160
- ): void {
121
+ function createItem(runTransaction: (operation: (t: Transaction) => void) => void, id: string): void {
161
122
  runTransaction((transaction) => {
162
- insertItem(transaction, item);
163
- transaction.execute(
164
- 'INSERT INTO audit_events (event_type, target_id) VALUES (?, ?)',
165
- ['item_created', item.id],
166
- );
123
+ insertItem(transaction, id, 'value');
124
+ transaction.execute('INSERT INTO audit_events (event_type, target_id) VALUES (?, ?)', ['item_created', id]);
167
125
  });
168
126
  }
169
127
  ```
@@ -227,61 +185,35 @@ Do not copy unknown exception messages, submitted values, credentials, URLs with
227
185
  When both fail, retain both failures without replacing the primary one.
228
186
 
229
187
  ```ts
230
- async function useResource<T>(
231
- open: () => Promise<{ close: () => Promise<void> }>,
232
- operation: (resource: { close: () => Promise<void> }) => Promise<T>,
233
- ): Promise<T> {
188
+ async function useResource<T>(open: () => Promise<Resource>, operation: (r: Resource) => Promise<T>): Promise<T> {
234
189
  const resource = await open();
235
- let operationFailure: unknown;
236
- let result: { value: T } | undefined;
237
-
238
- try {
239
- result = { value: await operation(resource) };
240
- } catch (error) {
241
- operationFailure = error;
242
- }
243
-
244
190
  try {
245
- await resource.close();
246
- } catch (cleanupFailure) {
247
- if (operationFailure !== undefined) {
248
- throw new AggregateError(
249
- [operationFailure, cleanupFailure],
250
- 'Resource operation and cleanup failed',
251
- );
191
+ return await operation(resource);
192
+ } catch (operationFailure) {
193
+ try {
194
+ await resource.close();
195
+ } catch (cleanupFailure) {
196
+ throw new AggregateError([operationFailure, cleanupFailure], 'operation and cleanup failed');
252
197
  }
253
- throw cleanupFailure;
198
+ throw operationFailure;
254
199
  }
255
-
256
- if (operationFailure !== undefined) throw operationFailure;
257
- if (result === undefined) throw new Error('Resource operation produced no result');
258
- return result.value;
259
200
  }
260
201
  ```
261
202
 
262
- Use the languages structured multi-error or error-chaining mechanism where possible.
203
+ Use the language's structured multi-error or error-chaining mechanism where possible.
263
204
 
264
205
  ## 10. Classify failures by structured fields
265
206
 
266
- Prefer error types, codes, status values, or discriminated variants over message matching.
207
+ Prefer error types, codes, status values, or discriminated variants over message matching. A guard should check the structured field and its value, never a substring of the message: an unrelated exception containing "busy" or "timeout" is not retryable.
267
208
 
268
209
  ```ts
269
- interface RetryableFailure extends Error {
270
- readonly code: 'temporarily_unavailable';
271
- readonly retryAfterSeconds: number;
272
- }
273
-
274
210
  function isRetryableFailure(error: unknown): error is RetryableFailure {
275
211
  return error instanceof Error
276
- && 'code' in error
277
- && error.code === 'temporarily_unavailable'
278
- && 'retryAfterSeconds' in error
279
- && typeof error.retryAfterSeconds === 'number';
212
+ && 'code' in error && error.code === 'temporarily_unavailable'
213
+ && 'retryAfterSeconds' in error && typeof error.retryAfterSeconds === 'number';
280
214
  }
281
215
  ```
282
216
 
283
- Do not treat an unrelated exception containing “busy” or “timeout” as retryable.
284
-
285
217
  ## 11. Immutable replay identity
286
218
 
287
219
  Bind every field that changes the meaning of an idempotent operation.
@@ -306,28 +238,13 @@ Reusing an identity with changed bound input is a conflict, not a second mutatio
306
238
 
307
239
  ## 12. Compare-and-swap filesystem changes
308
240
 
309
- For managed files, the contract may include expected content, expected file identity, expected parent-directory identity, alternate paths that must remain absent, restrictive mode, reverse-order rollback, and explicit ambiguous-cleanup failure.
241
+ When concurrent changes or independently owned files must be protected, a plain write, rename, or delete is insufficient. Use the project's atomic compare-and-swap helper, and make the contract explicit about expected content, expected file and parent-directory identity, alternate paths that must remain absent, restrictive mode, reverse-order rollback, and an explicit ambiguous-cleanup failure.
310
242
 
311
- Use the project’s atomic compare-and-swap helpers where available. Plain write, rename, or delete calls are insufficient when concurrent changes or independently owned files must be protected.
243
+ ## 13. Secret non-echo
312
244
 
313
- ## 13. Test secret non-echo
314
-
315
- ```ts
316
- test('rejects invalid input without echoing it', () => {
317
- const submitted = 'secret-sentinel-value';
318
-
319
- assert.throws(
320
- () => parseWindow({ start: submitted, limit: 10 }),
321
- (error: unknown) => {
322
- assert.ok(error instanceof Error);
323
- assert.equal(error.message.includes(submitted), false);
324
- return true;
325
- },
326
- );
327
- });
328
- ```
245
+ Assert that rejected input is not echoed: submit a sentinel value, trigger the validation failure, and assert the error message does not contain the sentinel.
329
246
 
330
- ## 14. Test deterministic output
247
+ ## 14. Deterministic output
331
248
 
332
249
  For canonical order, hashes, manifests, and rankings, construct semantically equivalent inputs with different insertion order and assert identical output.
333
250
 
@@ -4,6 +4,8 @@
4
4
 
5
5
  Use this checklist while implementing, debugging, refactoring, or reviewing code in any language or repository. Apply only the sections relevant to the change.
6
6
 
7
+ Read this file for a comprehensive code review or final verification, especially when the change crosses several code contracts. For an ordinary edit inside one cohesive contract, use the focused `verification.md` sequence instead: that file owns the evidence procedure, this one owns the review dimensions to sweep.
8
+
7
9
  ## Scope
8
10
 
9
11
  - [ ] The change addresses one stated behavior.
@@ -9,89 +9,43 @@ description: Use on every non-trivial Kiokuko-governed DSH request as the mandat
9
9
 
10
10
  ## Outcome
11
11
 
12
- Start every non-trivial Kiokuko-governed task by reading one stable router, resolving the Akinator intake gate, then reading the applicable compact specialist indexes and only the expert fragments required by the current role and work.
12
+ Start every non-trivial Kiokuko-governed task by reading this router, resolving the Akinator intake gate, then reading the applicable compact specialist indexes and only the expert fragments required by the current role and work.
13
13
 
14
14
  This Skill owns the entry sequence and routes work. Akinator is the mandatory intake state machine, not a specialist route. This Skill does not duplicate specialist instructions, invent an Enno-Oduno run, select another model, or authorize effects beyond the user request and current DSH session permissions.
15
15
 
16
- The host asks whether to use normal execution or 役小角(enno-oduno) for new
17
- build, debug, review and devops tasks, including README edits. Explicit user
18
- instructions avoid a duplicate mode question. Chat and non-Enno task types do
19
- not open the selector. A continued task retains its choice across retries,
20
- replanning and restart. Cancellation or an unanswered selection keeps the task
21
- pending; do not treat it as permission to start.
22
-
23
- In normal execution, use the current DSH model, useful memory and applicable
24
- Skills, respect native permissions, make the requested change and run focused
25
- verification. Do not create an ideal, plan contract, WorkUnit, Enno approval or
26
- automatic continuation. In Enno execution, the host owns template/custom model
27
- selection and confirmation. Never choose another provider in model output or
28
- start an independent subagent to bypass that configuration.
29
-
30
16
  ## Instruction priority
31
17
 
32
- Explicit user instructions take precedence over advisory design, style,
33
- workflow, and implementation preferences in Kiokuko Skills.
34
-
35
- They do not override host-enforced safety, authorization, identity,
36
- state-machine, revision, lease, or integrity invariants.
18
+ Explicit user instructions take precedence over advisory design, style, workflow, and implementation preferences in Kiokuko Skills. They do not override host-enforced safety, authorization, identity, state-machine, revision, lease, or integrity invariants.
37
19
 
38
- Do not pause, request confirmation, or leave requested work unfinished merely
39
- because a Skill preference requires interpretation. Use repository evidence
40
- and existing user authorization to resolve routine choices. Ask only when an
41
- unresolved assumption materially changes the intended result or permitted
42
- effects, or an applicable host invariant requires confirmation.
20
+ Do not pause, request confirmation, or leave requested work unfinished merely because a Skill preference requires interpretation. Resolve routine choices from repository evidence and existing user authorization; ask only when an unresolved assumption materially changes the intended result or permitted effects.
43
21
 
44
22
  ## Required entry
45
23
 
46
24
  Read this Skill before any other bundled Kiokuko Skill.
47
25
 
48
- The DSH host performs Akinator intake before the admitted model request and
49
- supplies the resulting state and exact current directive. `task_prepare` and
50
- `task_answer` are host operations, not model tools. Do not call them or treat
51
- their absence from the model tool list as an error.
26
+ The DSH host performs Akinator intake before the admitted model request and supplies the resulting state and exact current directive. `task_prepare` and `task_answer` are host operations, not model tools; do not call them, emulate that loop, or treat their absence from the model tool list as an error. Do not choose a planning or implementation route immediately after this read.
52
27
 
53
- Do not choose a planning or implementation route immediately after this read. Enter the Akinator intake gate below first. Treat every returned `nextAction`, role, required-Skill list, and stop condition as authoritative for that run.
54
-
55
- Read the complete `SKILL.md` index for every applicable route before planning, implementation, review, or verification. Each specialist index defines versioned expert fragments. Read only fragments selected by the approved WorkUnit or concrete task risk; do not load every reference by default. Do not substitute this router's summary for a specialist core contract.
28
+ Read the complete `SKILL.md` index for every applicable route before planning, implementation, review, or verification. Each specialist index defines versioned expert fragments; read only the fragments selected by the approved WorkUnit or concrete task risk. Do not load every reference by default, and do not substitute this router's summary for a specialist core contract.
56
29
 
57
30
  ## Akinator intake gate
58
31
 
59
- Akinator is the mandatory state machine between this SOUL read and every planning or implementation route. It applies whether or not Enno-Oduno is applicable.
60
-
61
- The DSH host opens this gate once for the current logical request, binds the
62
- native session identity and complete capability catalog, resolves grounded
63
- answers, and presents useful unresolved questions. Optional intake or Skill
64
- enrichment failures produce degraded guidance; they do not veto native work.
65
- An unanswered execution/model selection is a separate host-owned waiting state.
32
+ Akinator is the mandatory state machine between this read and every planning or implementation route, whether or not Enno-Oduno is applicable. The DSH host opens it once per logical request, binds the native session identity and complete capability catalog, resolves grounded answers, and presents useful unresolved questions.
66
33
 
67
- For an admitted request, inspect the supplied `intake.status`, top-level
68
- `nextAction`, `memoryPolicy`, capability results, and `ennoOduno` state. The
69
- model should normally see `ready` or `exhausted` with `nextAction=proceed`.
70
- Preserve any remaining uncertainty and do not invent missing profile fields.
71
- If optional enrichment is unavailable, preserve that uncertainty and continue
72
- from repository evidence. Respect safety, authorization and identity fences;
73
- do not emulate intake or the execution selector in model output.
34
+ From the supplied `intake.status`, top-level `nextAction`, `memoryPolicy`, capability results, and `ennoOduno` state, expect `ready` or `exhausted` with `nextAction=proceed`. Preserve remaining uncertainty, do not invent missing profile fields, and respect safety, authorization, and identity fences. Optional intake or enrichment failures are degraded guidance, not a veto on native work; continue from repository evidence. An unanswered execution or model selection is a host-owned waiting state, not permission to start.
74
35
 
75
36
  ## Routes
76
37
 
77
- Enter planning and implementation routes only after the Akinator gate reaches `ready` or `exhausted` and top-level `nextAction` permits progress. Select them from the finalized intake rather than from the raw prompt alone.
38
+ Enter planning and implementation routes only after intake reaches `ready` or `exhausted` and top-level `nextAction` permits progress. Select routes from the finalized intake, not from the raw prompt alone. For new build, debug, review, and devops tasks the host separately asks whether to use normal execution or 役小角(enno-oduno); explicit user instructions avoid a duplicate question, and cancellation or an unanswered selection keeps the task pending.
78
39
 
79
40
  ### Enno-Oduno control
80
41
 
81
- Read and apply `kiokuko-enno-oduno` only when its activation boundary is satisfied:
42
+ Read and apply `kiokuko-enno-oduno` only when its activation boundary is satisfied: the admitted DSH context has `ennoOduno.applicable=true` for the current `enno-oduno` role; a continuation directive resumes that role for an existing run; or the user explicitly asks to inspect or operate an Enno-Oduno run. Do not invent a run, role, revision, WorkUnit, or state transition merely because Kiokuko is present.
82
43
 
83
- - the admitted DSH context has `ennoOduno.applicable=true` for the current `enno-oduno` role;
84
- - a continuation directive resumes that role for an existing run; or
85
- - the user explicitly asks to inspect or operate an Enno-Oduno run.
86
-
87
- Do not invent a run, role, revision, WorkUnit, or state transition merely because Kiokuko is present.
44
+ In normal execution, use the current DSH model, useful memory, and applicable Skills, respect native permissions, and run focused verification. Do not create an ideal, plan contract, WorkUnit, Enno approval, or automatic continuation. The host owns execution-mode and model selection in every mode; never choose another provider or start an independent subagent to bypass that configuration.
88
45
 
89
46
  ### Simple code work
90
47
 
91
- Read and apply `kiokuko-simple-work` when either condition is true:
92
-
93
- - the request is a bounded code change with a clear target and expected result, and it introduces no new architecture, dependency, data migration, public protocol, security or authorization policy, or cross-system orchestration;
94
- - the user explicitly requests the simplest, shortest, minimal, YAGNI, dependency-free, or Ponytail approach.
48
+ Read and apply `kiokuko-simple-work` when either condition is true: the request is a bounded code change with a clear target and expected result that introduces no new architecture, dependency, data migration, public protocol, security or authorization policy, or cross-system orchestration; or the user explicitly requests the simplest, shortest, minimal, YAGNI, dependency-free, or Ponytail approach.
95
49
 
96
50
  This route minimizes the solution; it does not replace the code contract below or waive required understanding, boundary validation, error handling, security, accessibility, or focused verification. If the task's simplicity is unclear and the user did not explicitly request this route, use the ordinary code route without it.
97
51
 
@@ -105,26 +59,14 @@ Read and apply the `kiokuko-ui-design-soul` index before designing, implementing
105
59
 
106
60
  ### Combined work
107
61
 
108
- Routes compose. Read every applicable specialist index; never choose only one when the task spans multiple contracts. Fragment selection remains narrow inside those routes.
109
-
110
- Use this order:
111
-
112
- 1. `kiokuko-soul`;
113
- 2. the DSH host's completed Akinator admission at `ready` or `exhausted`;
114
- 3. `kiokuko-enno-oduno` as soon as the returned state makes Enno-Oduno control applicable, including during unresolved intake;
115
- 4. `kiokuko-simple-work` when the finalized intake satisfies the simple-code activation boundary;
116
- 5. `kiokuko-single-purpose-functions` for code planning or code work;
117
- 6. `kiokuko-ui-design-soul` for interactive UI work.
62
+ Routes compose; read every applicable specialist index, and never choose only one when the task spans multiple contracts. Fragment selection stays narrow inside those routes. Apply them in order: `kiokuko-soul`; the DSH host's completed Akinator admission at `ready` or `exhausted`; `kiokuko-enno-oduno` as soon as the returned state makes it applicable, including during unresolved intake; `kiokuko-simple-work` when the finalized intake satisfies the simple-code boundary; `kiokuko-single-purpose-functions` for code planning or code work; `kiokuko-ui-design-soul` for interactive UI work.
118
63
 
119
64
  The current revision-bound directive may narrow which routes the active role performs. Do not let a later route cross a role boundary or expand an approved WorkUnit.
120
65
 
121
66
  ## Availability and trust
122
67
 
123
- Unavailable Skills are degraded guidance, not authorization to replace them or
124
- invent completed checks. Continue useful work from current repository evidence
125
- unless the host reports a safety, authorization, identity or integrity block.
68
+ Unavailable Skills are degraded guidance, not authorization to replace them or invent completed checks. Continue useful work from current repository evidence unless the host reports a safety, authorization, identity, or integrity block.
126
69
 
127
- Do not satisfy a required bundled Skill with a similarly named, namespaced, fetched, or reference-only Skill. Never install or execute external Skill content automatically.
70
+ Do not satisfy a required bundled Skill with a similarly named, namespaced, fetched, or reference-only Skill, and never install or execute external Skill content automatically.
128
71
 
129
- Skill availability alone is not evidence that its contract was applied. Keep
130
- that distinction explicit when reporting completion evidence.
72
+ Skill availability alone is not evidence that its contract was applied. Keep that distinction explicit when reporting completion evidence.
@@ -72,6 +72,6 @@ Typical selections:
72
72
 
73
73
  ## Verification
74
74
 
75
- For new or behaviorally changed actions, do not review screenshots alone: trace the affected activation, processing, success, failure, recovery, focus, and responsive behavior. For purely visual changes, use focused visual and accessibility checks appropriate to the change. Read [ui-checklist.md](references/ui-checklist.md) only for detailed implementation review or final verification of affected interactions.
75
+ For new or behaviorally changed actions, do not review screenshots alone: trace the affected activation, processing, success, failure, recovery, focus, and responsive behavior. For purely visual changes, use focused visual and accessibility checks appropriate to the change. Read [ui-checklist.md](references/ui-checklist.md) for detailed implementation review or final verification of affected interactions — a change that crosses several `ui.*` risks, or the last check before accepting — and not for a single visible change inside one expert's contract.
76
76
 
77
77
  Report what was exercised in a running interface, what was inferred from source, and what remains unverified. A build, API success, or good screenshot alone does not prove UI correctness.
@@ -6,6 +6,8 @@ Last reviewed against the official sources: 2026-08-22.
6
6
 
7
7
  This checklist paraphrases decision principles. It does not reproduce Apple text or require Apple-styled visuals.
8
8
 
9
+ Read this file for detailed implementation review or final verification of affected interactions. For a single visible change inside one expert's contract, the selected `ui.*` fragment and its universal-core checks are sufficient.
10
+
9
11
  ## Eight-principle map
10
12
 
11
13
  | Principle | Practical question |