kotonoha 0.4.1 → 0.5.0

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 (33) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/README-ja.md +108 -18
  3. package/README.md +155 -23
  4. package/bin/kotonoha.js +64 -12
  5. package/package.json +7 -3
  6. package/skills/obsidian-bases/SKILL.md +140 -0
  7. package/skills/obsidian-bases/assets/templates/cards.base +8 -0
  8. package/skills/obsidian-bases/assets/templates/kanban.base +7 -0
  9. package/skills/obsidian-bases/assets/templates/list.base +8 -0
  10. package/skills/obsidian-bases/assets/templates/table.base +10 -0
  11. package/skills/obsidian-bases/references/execution-contract.json +246 -0
  12. package/skills/obsidian-bases/references/workflow.md +159 -0
  13. package/skills/obsidian-bases/scripts/check.cjs +690 -0
  14. package/skills/obsidian-bases/scripts/package-lock.json +104 -0
  15. package/skills/obsidian-bases/scripts/package.json +18 -0
  16. package/skills/obsidian-bases/scripts/verify.cjs +454 -0
  17. package/skills/obsidian-canvas/SKILL.md +134 -0
  18. package/skills/obsidian-canvas/assets/templates/comparison.canvas +11 -0
  19. package/skills/obsidian-canvas/assets/templates/mind-map.canvas +11 -0
  20. package/skills/obsidian-canvas/assets/templates/note-map.canvas +10 -0
  21. package/skills/obsidian-canvas/assets/templates/workflow.canvas +11 -0
  22. package/skills/obsidian-canvas/references/execution-contract.json +404 -0
  23. package/skills/obsidian-canvas/references/workflow.md +189 -0
  24. package/skills/obsidian-canvas/scripts/canvas.py +1479 -0
  25. package/skills/obsidian-canvas/scripts/canvas.py.lock +143 -0
  26. package/skills/obsidian-canvas/scripts/test_canvas.py +2047 -0
  27. package/skills/obsidian-canvas/scripts/test_canvas.py.lock +143 -0
  28. package/skills/obsidian-vault/SKILL.md +149 -93
  29. package/skills/obsidian-vault/references/workflow.md +61 -4
  30. package/skills/obsidian-vault/scripts/test_vault.py +76 -0
  31. package/skills/obsidian-vault/scripts/vault.py +118 -71
  32. package/skills/tech-writer/SKILL.md +26 -36
  33. package/skills/tech-writer/references/japanese-prose-optimization.md +3 -1
@@ -0,0 +1,159 @@
1
+ # Bases workflow
2
+
3
+ Use this guide with the Skill's scope, byte-preservation and authority rules.
4
+ Standalone `.base` is YAML configuration over Vault files, not a separate
5
+ database. No Obsidian app, official CLI, MCP, Python or Vault storage API is
6
+ required for ordinary direct editing.
7
+
8
+ ## Setup
9
+
10
+ Install only the requested Skill; existing installations require explicit
11
+ replacement authority. Do not overwrite local customizations without consent.
12
+
13
+ ```text
14
+ npx kotonoha install --skill obsidian-bases
15
+ ```
16
+
17
+ This defaults to Copilot's `.github/skills`. Add `--agent claude` for Claude
18
+ Code's `.claude/skills`, or `--agent all` for both. Resolve `<bases-dir>` from
19
+ the installed Skill in the selected root.
20
+
21
+ Installation copies authored assets and the canonical private lockfile, not
22
+ `node_modules`. Before dependency preparation explain the local installation
23
+ directory and possible package-registry traffic; get separate permission.
24
+ Use Node >=18 and the exact local scripts manifest/lock:
25
+
26
+ ```text
27
+ npm ci --prefix <bases-dir>/scripts --ignore-scripts --no-audit --no-fund
28
+ ```
29
+
30
+ For an explicitly offline preparation use:
31
+
32
+ ```text
33
+ npm ci --prefix <bases-dir>/scripts --offline --ignore-scripts --no-audit --no-fund
34
+ ```
35
+
36
+ These are alternatives, not automatic fallbacks. A cache miss does not authorize
37
+ online installation. The checker never prepares dependencies. Missing or wrong
38
+ local dependencies return exit 4 even if a parent/global module is available.
39
+ `--help` works without them. The fixed versions and supported JSON schema live
40
+ in [execution-contract.json](execution-contract.json), not a second config.
41
+
42
+ ## Examples and paths
43
+
44
+ Example: "In /absolute/Vault, read Tasks.base only. Rename view index 0 from Tasks
45
+ to Active tasks and save; keep everything else unchanged." This can authorize
46
+ the exact ordinary name edit without a mandatory plan or repeated approval.
47
+ "Propose a base" or "show the diff before saving" never authorizes saving.
48
+
49
+ Example: "Use /absolute/Vault/Views as the working directory; create reading.base
50
+ with Cards for Markdown files in Reading. Show the settings before saving."
51
+ Confirm actual folder/property names and application version without assuming
52
+ permission to inspect every matching note. An example filter is a proposed
53
+ display scope, not a host reading permission.
54
+
55
+ User workdir takes precedence; otherwise use cwd at request start. Resolve its
56
+ relative form from that start and relative targets from the selected workdir.
57
+ Preserve absolute and explicitly Vault-relative paths. A directory choice is
58
+ not Vault authority. If the target's existing parent or allowed scope is missing,
59
+ stop instead of creating directories or saving elsewhere. Never substitute
60
+ session-state copies for the target.
61
+
62
+ ## Check exact text
63
+
64
+ Use strict UTF-8 byte access; BOM must not disappear, invalid bytes must not
65
+ become replacement characters. Capture raw SHA-256 independently. Send JSON
66
+ through stdin safely, never interpolate document text into shell commands:
67
+
68
+ ```json
69
+ {
70
+ "schema_version": 1,
71
+ "intent": "inspect",
72
+ "document": "filters: 'file.ext == \"md\"'\nviews:\n - {type: table, name: Notes, order: [file.name]}\n",
73
+ "application_version": "1.14.0"
74
+ }
75
+ ```
76
+
77
+ ```text
78
+ node <bases-dir>/scripts/check.cjs --stdin
79
+ ```
80
+
81
+ Use inspect for existing text and create/edit/proofread for the corresponding
82
+ candidate. The Report hash must match raw original bytes and exact candidate
83
+ write bytes respectively. No path, output-file, save, fix or evaluation flags
84
+ exist. The checker never reads a target or follows a formula's URL.
85
+
86
+ | Exit | Meaning | Action |
87
+ |---|---|---|
88
+ | 0 | Complete static processing; may contain cautions | Check static_checks_passed and every separate host/consent requirement |
89
+ | 1 | Invalid control or runtime failure | Not complete; no save |
90
+ | 2 | Known structure/reference problem or missing candidate views | Explain exact issues; no save |
91
+ | 3 | Unsupported feature, limit or unknown application version | Preserve original; diagnosis only |
92
+ | 4 | Local dependency or declared application capability insufficient | Report missing capability; no auto-install or save |
93
+
94
+ Reports always say read_only=true, authorization=not_assessed and
95
+ write_status=not_requested. They never certify saving, evaluation or rendering.
96
+ Non-parser issues identify a key/index path, not an invented source line;
97
+ YAML parser issues use 1-based line/column. Limit fallbacks explicitly retain
98
+ unprocessed root. A partial report is never all-file success.
99
+
100
+ ## Supported edits and display consequences
101
+
102
+ Use `table.base`, `cards.base`, `list.base` and `kanban.base` from the sibling
103
+ assets/templates directory. They are independently authored proposals. Adapt
104
+ their scope/property names only with authority; do not claim they match real data.
105
+ Every view supports creation and name/display-order/filter edits. Kanban requires
106
+ its group property; group order and ASC/DESC can be intentionally edited.
107
+ Other minimum settings are defined in the contract; unknown extensions cause
108
+ whole-file editing refusal, even when only a known name would change.
109
+
110
+ `order` is display property order, not row sorting. Never infer undocumented
111
+ image, marker, sort or plugin keys. The expression subset is deliberately narrow:
112
+ unknown documented functions can still be unsupported in this checker.
113
+ Defined formula names and known property references are not proof of actual note
114
+ types; accepted ASTs are not executed.
115
+
116
+ Treat every filter/formulas change as potentially widening. Present the actual
117
+ before/after and save authority, without proving arbitrary set containment.
118
+ No filters means all Vault files when opened. Explain that before an unfiltered
119
+ creation or last-filter removal, and obtain authority for that exact content.
120
+ Global/view filters combine with AND. groupOrder can hide groups independently;
121
+ an empty groupOrder hides every group. Do not invent counts or reinterpret these
122
+ conditions as security controls.
123
+
124
+ ## Save through host tools
125
+
126
+ Follow every numbered step in SKILL.md. Do not read forbidden paths to "verify"
127
+ them. Check authorized root-to-target identities, exact spelling, no symlinks,
128
+ no management paths, local regular files and preservable metadata. No xattrs or
129
+ multiple hard links; do not strip SELinux labels or other safety features.
130
+
131
+ Keep untouched bytes exactly, including comments, quoted values, key/view order,
132
+ spaces and CRLF. Do not round-trip YAML through a serializer. Duplicate names
133
+ need user-resolved index/content. A candidate that passes cannot repair an
134
+ unsupported/invalid original without changing the agreed scope.
135
+
136
+ Recheck current bytes and identity just before writing. Exclusive creation must
137
+ not overwrite an equivalent existing name. Edit only if the host can preserve
138
+ exact bytes, owner/group/modes. Re-read after saving; compare to validated bytes
139
+ and hashes. Tools that cannot verify these properties are insufficient.
140
+
141
+ On a possible partial write or readback mismatch, say the result is unknown.
142
+ Do not automatically retry, roll back, switch tools or report a fabricated CLI
143
+ receipt. Confirm the current target before requesting authority for remediation.
144
+ There is no CLI transaction/root lock/replay guard, and a final-check race remains.
145
+
146
+ ## Proofreading and retention
147
+
148
+ Proofread selected name/displayName values only, through `japanese-prose`.
149
+ Obtain copy consent first: specify an external location, purpose, retention until
150
+ user deletion and cleanup of known files only. A workdir inside the Vault cannot
151
+ silently redirect copies to session storage. Ask for a suitable external place.
152
+ Keep immutable source bytes and a real nine-check semantic review for each
153
+ changed string; missing/stale/failed gates prohibit saving. Keep formula text,
154
+ identifiers, operators, numbers and all unselected spans unchanged.
155
+
156
+ Do not send source or diagnostic names to public logs, additional models or web
157
+ services without permission. Do not claim control over host conversation logs.
158
+ The caller's file tools and model must follow these instructions; no arbitrary
159
+ host sandbox or flawless semantic understanding is promised.