@qvac/skills 0.0.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/LICENSE.md +198 -0
  2. package/README.md +40 -0
  3. package/index.d.ts +4 -0
  4. package/index.js +9 -0
  5. package/package.json +87 -1
  6. package/skills/apple-notes/SKILL.md +92 -0
  7. package/skills/apple-notes/append-note.applescript +9 -0
  8. package/skills/apple-notes/cli.schema.json +32 -0
  9. package/skills/apple-notes/create-note.applescript +15 -0
  10. package/skills/apple-notes/delete-note.applescript +10 -0
  11. package/skills/apple-notes/edit-note.applescript +10 -0
  12. package/skills/apple-notes/read-note.applescript +28 -0
  13. package/skills/apple-notes/references/read.md +65 -0
  14. package/skills/apple-notes/references/write.md +105 -0
  15. package/skills/apple-notes/search-notes.applescript +21 -0
  16. package/skills/apple-reminders/SKILL.md +129 -0
  17. package/skills/apple-reminders/cli.schema.json +201 -0
  18. package/skills/apple-reminders/references/edit.md +69 -0
  19. package/skills/apple-reminders/references/view.md +58 -0
  20. package/skills/asana/SKILL.md +59 -0
  21. package/skills/diagrams/SKILL.md +107 -0
  22. package/skills/diagrams/references/class.md +29 -0
  23. package/skills/diagrams/references/er.md +27 -0
  24. package/skills/diagrams/references/flowchart.md +33 -0
  25. package/skills/diagrams/references/gantt.md +38 -0
  26. package/skills/diagrams/references/mindmap.md +35 -0
  27. package/skills/diagrams/references/pie.md +27 -0
  28. package/skills/diagrams/references/sequence.md +32 -0
  29. package/skills/diagrams/references/state.md +30 -0
  30. package/skills/diagrams/references/timeline.md +28 -0
  31. package/skills/excel/SKILL.md +120 -0
  32. package/skills/excel/references/create.md +374 -0
  33. package/skills/excel/references/edit.md +353 -0
  34. package/skills/excel/references/read.md +99 -0
  35. package/skills/github/SKILL.md +42 -0
  36. package/skills/gmail/SKILL.md +142 -0
  37. package/skills/gmail/operations.json +71 -0
  38. package/skills/google-calendar/SKILL.md +139 -0
  39. package/skills/google-calendar/operations.json +62 -0
  40. package/skills/google-docs/SKILL.md +74 -0
  41. package/skills/google-docs/operations.json +61 -0
  42. package/skills/google-docs/references/create.md +97 -0
  43. package/skills/google-docs/references/edit.md +146 -0
  44. package/skills/google-docs/references/read.md +49 -0
  45. package/skills/google-drive/SKILL.md +118 -0
  46. package/skills/google-drive/operations.json +40 -0
  47. package/skills/google-sheets/SKILL.md +71 -0
  48. package/skills/google-sheets/operations.json +85 -0
  49. package/skills/google-sheets/references/create.md +54 -0
  50. package/skills/google-sheets/references/edit.md +124 -0
  51. package/skills/google-sheets/references/read.md +74 -0
  52. package/skills/image-generation/SKILL.md +48 -0
  53. package/skills/music-generation/SKILL.md +76 -0
  54. package/skills/notion/SKILL.md +61 -0
  55. package/skills/notion/operations.json +53 -0
  56. package/skills/notion/references/comments.md +65 -0
  57. package/skills/notion/references/databases.md +68 -0
  58. package/skills/notion/references/pages.md +119 -0
  59. package/skills/notion/references/tasks.md +28 -0
  60. package/skills/obsidian/SKILL.md +122 -0
  61. package/skills/obsidian/cli.schema.json +392 -0
  62. package/skills/obsidian/references/read.md +79 -0
  63. package/skills/obsidian/references/write.md +67 -0
  64. package/skills/pdf/SKILL.md +110 -0
  65. package/skills/pdf/references/create.md +169 -0
  66. package/skills/pdf/references/transform.md +270 -0
  67. package/skills/pdf/scripts/decrypt.py +26 -0
  68. package/skills/pdf/scripts/encrypt.py +25 -0
  69. package/skills/pdf/scripts/extract_text.py +25 -0
  70. package/skills/pdf/scripts/merge.py +21 -0
  71. package/skills/pdf/scripts/rotate.py +27 -0
  72. package/skills/presentations/SKILL.md +118 -0
  73. package/skills/presentations/references/create.md +399 -0
  74. package/skills/presentations/references/edit.md +314 -0
  75. package/skills/presentations/references/read.md +127 -0
  76. package/skills/spotify/SKILL.md +86 -0
  77. package/skills/weather/SKILL.md +33 -0
  78. package/skills/word/SKILL.md +141 -0
  79. package/skills/word/references/create.md +368 -0
  80. package/skills/word/references/edit.md +704 -0
  81. package/skills/word/references/read.md +141 -0
  82. package/skills/word/references/replace.md +86 -0
  83. package/skills/word/scripts/list_paragraphs.py +19 -0
  84. package/skills/word/scripts/replace_paragraphs.py +58 -0
package/LICENSE.md ADDED
@@ -0,0 +1,198 @@
1
+ # License
2
+
3
+ This project is licensed under the Apache License, Version 2.0.
4
+ See below for the full license text.
5
+
6
+ ## Apache License
7
+
8
+ _Version 2.0, January 2004_
9
+ _&lt;<http://www.apache.org/licenses/>&gt;_
10
+
11
+ ### Terms and Conditions for use, reproduction, and distribution
12
+
13
+ #### 1. Definitions
14
+
15
+ “License” shall mean the terms and conditions for use, reproduction, and
16
+ distribution as defined by Sections 1 through 9 of this document.
17
+
18
+ “Licensor” shall mean the copyright owner or entity authorized by the copyright
19
+ owner that is granting the License.
20
+
21
+ “Legal Entity” shall mean the union of the acting entity and all other entities
22
+ that control, are controlled by, or are under common control with that entity.
23
+ For the purposes of this definition, “control” means **(i)** the power, direct or
24
+ indirect, to cause the direction or management of such entity, whether by
25
+ contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or **(iii)** beneficial ownership of such entity.
27
+
28
+ “You” (or “Your”) shall mean an individual or Legal Entity exercising
29
+ permissions granted by this License.
30
+
31
+ “Source” form shall mean the preferred form for making modifications, including
32
+ but not limited to software source code, documentation source, and configuration
33
+ files.
34
+
35
+ “Object” form shall mean any form resulting from mechanical transformation or
36
+ translation of a Source form, including but not limited to compiled object code,
37
+ generated documentation, and conversions to other media types.
38
+
39
+ “Work” shall mean the work of authorship, whether in Source or Object form, made
40
+ available under the License, as indicated by a copyright notice that is included
41
+ in or attached to the work (an example is provided in the Appendix below).
42
+
43
+ “Derivative Works” shall mean any work, whether in Source or Object form, that
44
+ is based on (or derived from) the Work and for which the editorial revisions,
45
+ annotations, elaborations, or other modifications represent, as a whole, an
46
+ original work of authorship. For the purposes of this License, Derivative Works
47
+ shall not include works that remain separable from, or merely link (or bind by
48
+ name) to the interfaces of, the Work and Derivative Works thereof.
49
+
50
+ “Contribution” shall mean any work of authorship, including the original version
51
+ of the Work and any modifications or additions to that Work or Derivative Works
52
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
53
+ by the copyright owner or by an individual or Legal Entity authorized to submit
54
+ on behalf of the copyright owner. For the purposes of this definition,
55
+ “submitted” means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems, and
58
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
59
+ the purpose of discussing and improving the Work, but excluding communication
60
+ that is conspicuously marked or otherwise designated in writing by the copyright
61
+ owner as “Not a Contribution.”
62
+
63
+ “Contributor” shall mean Licensor and any individual or Legal Entity on behalf
64
+ of whom a Contribution has been received by Licensor and subsequently
65
+ incorporated within the Work.
66
+
67
+ #### 2. Grant of Copyright License
68
+
69
+ Subject to the terms and conditions of this License, each Contributor hereby
70
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
71
+ irrevocable copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the Work and such
73
+ Derivative Works in Source or Object form.
74
+
75
+ #### 3. Grant of Patent License
76
+
77
+ Subject to the terms and conditions of this License, each Contributor hereby
78
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
79
+ irrevocable (except as stated in this section) patent license to make, have
80
+ made, use, offer to sell, sell, import, and otherwise transfer the Work, where
81
+ such license applies only to those patent claims licensable by such Contributor
82
+ that are necessarily infringed by their Contribution(s) alone or by combination
83
+ of their Contribution(s) with the Work to which such Contribution(s) was
84
+ submitted. If You institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
86
+ Contribution incorporated within the Work constitutes direct or contributory
87
+ patent infringement, then any patent licenses granted to You under this License
88
+ for that Work shall terminate as of the date such litigation is filed.
89
+
90
+ #### 4. Redistribution
91
+
92
+ You may reproduce and distribute copies of the Work or Derivative Works thereof
93
+ in any medium, with or without modifications, and in Source or Object form,
94
+ provided that You meet the following conditions:
95
+
96
+ - **(a)** You must give any other recipients of the Work or Derivative Works a copy of
97
+ this License; and
98
+ - **(b)** You must cause any modified files to carry prominent notices stating that You
99
+ changed the files; and
100
+ - **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
101
+ all copyright, patent, trademark, and attribution notices from the Source form
102
+ of the Work, excluding those notices that do not pertain to any part of the
103
+ Derivative Works; and
104
+ - **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
105
+ Derivative Works that You distribute must include a readable copy of the
106
+ attribution notices contained within such NOTICE file, excluding those notices
107
+ that do not pertain to any part of the Derivative Works, in at least one of the
108
+ following places: within a NOTICE text file distributed as part of the
109
+ Derivative Works; within the Source form or documentation, if provided along
110
+ with the Derivative Works; or, within a display generated by the Derivative
111
+ Works, if and wherever such third-party notices normally appear. The contents of
112
+ the NOTICE file are for informational purposes only and do not modify the
113
+ License. You may add Your own attribution notices within Derivative Works that
114
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
115
+ provided that such additional attribution notices cannot be construed as
116
+ modifying the License.
117
+
118
+ You may add Your own copyright statement to Your modifications and may provide
119
+ additional or different license terms and conditions for use, reproduction, or
120
+ distribution of Your modifications, or for any such Derivative Works as a whole,
121
+ provided Your use, reproduction, and distribution of the Work otherwise complies
122
+ with the conditions stated in this License.
123
+
124
+ #### 5. Submission of Contributions
125
+
126
+ Unless You explicitly state otherwise, any Contribution intentionally submitted
127
+ for inclusion in the Work by You to the Licensor shall be under the terms and
128
+ conditions of this License, without any additional terms or conditions.
129
+ Notwithstanding the above, nothing herein shall supersede or modify the terms of
130
+ any separate license agreement you may have executed with Licensor regarding
131
+ such Contributions.
132
+
133
+ #### 6. Trademarks
134
+
135
+ This License does not grant permission to use the trade names, trademarks,
136
+ service marks, or product names of the Licensor, except as required for
137
+ reasonable and customary use in describing the origin of the Work and
138
+ reproducing the content of the NOTICE file.
139
+
140
+ #### 7. Disclaimer of Warranty
141
+
142
+ Unless required by applicable law or agreed to in writing, Licensor provides the
143
+ Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
144
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
145
+ including, without limitation, any warranties or conditions of TITLE,
146
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
147
+ solely responsible for determining the appropriateness of using or
148
+ redistributing the Work and assume any risks associated with Your exercise of
149
+ permissions under this License.
150
+
151
+ #### 8. Limitation of Liability
152
+
153
+ In no event and under no legal theory, whether in tort (including negligence),
154
+ contract, or otherwise, unless required by applicable law (such as deliberate
155
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
156
+ liable to You for damages, including any direct, indirect, special, incidental,
157
+ or consequential damages of any character arising as a result of this License or
158
+ out of the use or inability to use the Work (including but not limited to
159
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
160
+ any and all other commercial damages or losses), even if such Contributor has
161
+ been advised of the possibility of such damages.
162
+
163
+ #### 9. Accepting Warranty or Additional Liability
164
+
165
+ While redistributing the Work or Derivative Works thereof, You may choose to
166
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
167
+ other liability obligations and/or rights consistent with this License. However,
168
+ in accepting such obligations, You may act only on Your own behalf and on Your
169
+ sole responsibility, not on behalf of any other Contributor, and only if You
170
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
171
+ incurred by, or claims asserted against, such Contributor by reason of your
172
+ accepting any such warranty or additional liability.
173
+
174
+ _END OF TERMS AND CONDITIONS_
175
+
176
+ ### APPENDIX: How to apply the Apache License to your work
177
+
178
+ To apply the Apache License to your work, attach the following boilerplate
179
+ notice, with the fields enclosed by brackets `[]` replaced with your own
180
+ identifying information. (Don't include the brackets!) The text should be
181
+ enclosed in the appropriate comment syntax for the file format. We also
182
+ recommend that a file or class name and description of purpose be included on
183
+ the same “printed page” as the copyright notice for easier identification within
184
+ third-party archives.
185
+
186
+ Copyright [yyyy] [name of copyright owner]
187
+
188
+ Licensed under the Apache License, Version 2.0 (the "License");
189
+ you may not use this file except in compliance with the License.
190
+ You may obtain a copy of the License at
191
+
192
+ http://www.apache.org/licenses/LICENSE-2.0
193
+
194
+ Unless required by applicable law or agreed to in writing, software
195
+ distributed under the License is distributed on an "AS IS" BASIS,
196
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197
+ See the License for the specific language governing permissions and
198
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @qvac/skills
2
+
3
+ Skills for QV.AC.
4
+
5
+ A skill is a directory under `skills/` with a `SKILL.md` in it, plus whatever
6
+ else it needs alongside — reference notes, scripts, a schema. The `SKILL.md`
7
+ front matter is what the harness reads to build its catalog.
8
+
9
+ The package ships the tree itself and a bundled copy of it, so consumers that
10
+ can't read a filesystem still get the same bytes.
11
+
12
+ ## Entry points
13
+
14
+ | Import | Contents | Needs a filesystem |
15
+ | ----------------------- | ---------------------------------------- | ------------------ |
16
+ | `@qvac/skills` | `skillsDir`, `skillsUrl`, `SKILLS_HASH` | yes |
17
+ | `@qvac/skills/bundled` | `SKILLS` (path → content), `SKILLS_HASH` | no |
18
+ | `@qvac/skills/hash` | `SKILLS_HASH` alone | no |
19
+ | `@qvac/skills/skills/*` | a single file by path | no |
20
+
21
+ All of them work on Node and Bare. `skillsDir` only points at anything real
22
+ where the package was installed to disk, though — a Bare worklet ships no
23
+ `node_modules`, so it imports `./bundled` and writes the tree out itself.
24
+
25
+ `SKILLS_HASH` is a sha256 over the sorted `path\0content\0` stream, truncated
26
+ to 16 hex chars. Consumers key a materialized directory on it, so it has to
27
+ match `hashBundledSkills` in the harness byte for byte.
28
+
29
+ ## Development
30
+
31
+ ```sh
32
+ npm test # node + bare
33
+ npm run lint
34
+ ```
35
+
36
+ `bundled.js` and `hash.js` are generated from `skills/` by `scripts/build.mjs`
37
+
38
+ ## License
39
+
40
+ Apache-2.0
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { SKILLS_HASH } from './hash.js'
2
+
3
+ export declare const skillsUrl: URL
4
+ export declare const skillsDir: string
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ // Resolves the on-disk tree, for consumers that can read node_modules —
2
+ // desktop main, build steps, tests. A Bare worklet has no such tree on disk,
3
+ // so it imports './bundled' and materializes one instead.
4
+ import { fileURLToPath } from 'url'
5
+
6
+ export { SKILLS_HASH } from './hash.js'
7
+
8
+ export const skillsUrl = new URL('./skills/', import.meta.url)
9
+ export const skillsDir = fileURLToPath(new URL('./skills', import.meta.url))
package/package.json CHANGED
@@ -1 +1,87 @@
1
- {"name":"@qvac/skills","version":"0.0.0"}
1
+ {
2
+ "name": "@qvac/skills",
3
+ "version": "0.1.1",
4
+ "description": "Skills for the QV.AC app — the SKILL.md tree plus a content-addressed bundle of it.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "exports": {
8
+ "./package": "./package.json",
9
+ ".": {
10
+ "types": "./index.d.ts",
11
+ "default": "./index.js"
12
+ },
13
+ "./bundled": {
14
+ "types": "./bundled.d.ts",
15
+ "default": "./bundled.js"
16
+ },
17
+ "./hash": {
18
+ "types": "./hash.d.ts",
19
+ "default": "./hash.js"
20
+ },
21
+ "./skills/*": "./skills/*"
22
+ },
23
+ "files": [
24
+ "package.json",
25
+ "skills",
26
+ "index.js",
27
+ "index.d.ts",
28
+ "bundled.js",
29
+ "bundled.d.ts",
30
+ "hash.js",
31
+ "hash.d.ts"
32
+ ],
33
+ "imports": {
34
+ "fs": {
35
+ "bare": "bare-fs",
36
+ "default": "fs"
37
+ },
38
+ "path": {
39
+ "bare": "bare-path",
40
+ "default": "path"
41
+ },
42
+ "crypto": {
43
+ "bare": "bare-crypto",
44
+ "default": "crypto"
45
+ },
46
+ "url": {
47
+ "bare": "bare-url",
48
+ "default": "url"
49
+ }
50
+ },
51
+ "scripts": {
52
+ "build": "node scripts/build.mjs",
53
+ "prepack": "npm run build",
54
+ "pretest": "npm run build",
55
+ "test": "npm run test:node && npm run test:bare",
56
+ "test:node": "brittle-node test/all.mjs",
57
+ "test:bare": "brittle-bare test/all.mjs",
58
+ "test:generate": "brittle-make-test test/all.mjs test/*.js",
59
+ "format": "prettier . --write",
60
+ "lint": "prettier . --check && lunte"
61
+ },
62
+ "dependencies": {
63
+ "bare-url": "^2.4.5"
64
+ },
65
+ "devDependencies": {
66
+ "bare-crypto": "^1.15.3",
67
+ "bare-fs": "^4.7.2",
68
+ "bare-path": "^3.0.1",
69
+ "brittle": "^4.1.0",
70
+ "lunte": "^1.8.4",
71
+ "prettier": "^3.9.6",
72
+ "prettier-config-holepunch": "^2.0.0"
73
+ },
74
+ "repository": {
75
+ "type": "git",
76
+ "url": "https://github.com/tetherto/qvac-skills.git"
77
+ },
78
+ "author": "Tether Inc",
79
+ "license": "Apache-2.0",
80
+ "bugs": {
81
+ "url": "https://github.com/tetherto/qvac-skills/issues"
82
+ },
83
+ "homepage": "https://github.com/tetherto/qvac-skills",
84
+ "publishConfig": {
85
+ "access": "public"
86
+ }
87
+ }
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: apple-notes
3
+ description: Read, search, create, edit, append to, and delete notes in the macOS Notes app through bundled AppleScript operations.
4
+ tools: [exec(osascript)]
5
+ platform: [darwin]
6
+ metadata:
7
+ {
8
+ 'openclaw':
9
+ {
10
+ 'requires': { 'bins': ['osascript'] },
11
+ 'setup':
12
+ {
13
+ 'summary': 'Apple Notes works through macOS automation (osascript), which ships with macOS — nothing to install. The first command triggers a one-time permission prompt to let this app control Notes.',
14
+ 'routes':
15
+ [
16
+ {
17
+ 'kind': 'instructions',
18
+ 'label': 'Allow Notes automation',
19
+ 'description': "macOS asks once for permission to control Notes. Commands fail until it's granted.",
20
+ 'steps':
21
+ [
22
+ 'Use the skill once — macOS shows a permission prompt to allow control of Notes.',
23
+ 'Click Allow.',
24
+ 'If it was denied, enable it under System Settings → Privacy & Security → Automation.'
25
+ ]
26
+ }
27
+ ]
28
+ }
29
+ }
30
+ }
31
+ ---
32
+
33
+ # Apple Notes (osascript)
34
+
35
+ Drive the macOS Notes app through the bundled AppleScript operations, one per
36
+ `exec` call: `osascript {{SKILL_DIR}}/<file>.applescript <args...>`.
37
+ `{{SKILL_DIR}}` resolves to this skill's absolute directory. Never use
38
+ `osascript -e` or any other AppleScript file: the exec grant permits only the
39
+ bundled Notes operations.
40
+
41
+ ## Load the Recipe File First
42
+
43
+ This file carries no commands. The working recipes live in two reference files —
44
+ load the one for the job with the `skill` tool BEFORE calling `exec`, then copy
45
+ its command and change only the arguments:
46
+
47
+ Each load is a real `skill` tool call — printing the call as JSON or text in
48
+ your reply loads nothing.
49
+
50
+ - **Finding or reading notes** — "list my notes", "what notes do I have",
51
+ "find / search notes about X", "read / open / summarize note X": call the
52
+ `skill` tool with `name: "apple-notes"` and `file: "references/read.md"`.
53
+ - **Changing notes** — "add a note", "add to note X", "rewrite / replace note
54
+ X", "delete note X": call the `skill` tool with `name: "apple-notes"` and
55
+ `file: "references/write.md"`. It also covers how to get the note id that
56
+ edit and delete need.
57
+
58
+ Most requests are ONE command. Run that single command, read its output, then
59
+ answer — do not chain extra searches to "double-check" or enumerate. An
60
+ empty-query search already lists every note; never enumerate notes by trying
61
+ several queries.
62
+
63
+ ## When to Use
64
+
65
+ - User explicitly mentions "Notes" (capital N), "Notes app", or "Apple Notes".
66
+ - User wants a personal note that syncs to iCloud and shows up on their iPhone/iPad.
67
+ - Note creation needs rich content (formatting, attachments) that Reminders cannot hold.
68
+
69
+ ## When NOT to Use
70
+
71
+ - User wants a to-do or reminder (use the `apple-reminders` skill).
72
+ - User wants a markdown vault, backlinks, or knowledge graph (use the `obsidian` skill).
73
+ - User wants project tracking or shared docs (use Notion or another tool).
74
+ - User just wants to dump text to a file (use the filesystem tools).
75
+
76
+ ## Setup
77
+
78
+ - No install required. `osascript` ships with macOS.
79
+ - Grant automation permission the first time: macOS prompts the user to allow
80
+ the parent terminal/app to control Notes. If denied, tell the user to enable it
81
+ under System Settings → Privacy & Security → Automation.
82
+
83
+ ## Output Policy
84
+
85
+ - Note bodies are HTML: strip tags or convert to plain text before answering
86
+ unless the user asked for the raw markup. If the note is empty, say so.
87
+ - Present search results as note names; keep the raw ids for follow-up
88
+ edit/delete calls rather than showing them to the user.
89
+ - `execution error: Not authorized to send Apple events` → tell the user to
90
+ grant Automation permission in System Settings.
91
+ - If the Notes app is not open and the operation fails, tell the user to open
92
+ Notes once (it usually auto-launches on first call).
@@ -0,0 +1,9 @@
1
+ -- Append an HTML fragment to a note found by name. argv: noteName, htmlFragment
2
+ on run argv
3
+ set noteName to item 1 of argv
4
+ set extra to item 2 of argv
5
+ tell application "Notes"
6
+ set targetNote to first note whose name is noteName
7
+ set body of targetNote to (body of targetNote) & extra
8
+ end tell
9
+ end run
@@ -0,0 +1,32 @@
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "x-positionals": ["script"],
5
+ "x-rest": "args",
6
+ "x-resource-files": [
7
+ "create-note.applescript",
8
+ "edit-note.applescript",
9
+ "append-note.applescript",
10
+ "read-note.applescript",
11
+ "search-notes.applescript",
12
+ "delete-note.applescript"
13
+ ],
14
+ "x-resource-effects": {
15
+ "read-note.applescript": "read",
16
+ "search-notes.applescript": "read"
17
+ },
18
+ "required": ["script", "args"],
19
+ "properties": {
20
+ "script": {
21
+ "type": "string",
22
+ "description": "absolute path to a bundled Apple Notes operation"
23
+ },
24
+ "args": {
25
+ "type": "array",
26
+ "items": { "type": "string" },
27
+ "minItems": 1,
28
+ "maxItems": 3,
29
+ "description": "argv passed to the bundled script"
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,15 @@
1
+ -- Create a Notes note. argv: name, htmlBody, [folder]
2
+ -- Notes writes the `name` property as the body's first line, so creating with
3
+ -- both name and body renders the title twice. Create from body, then rename.
4
+ on run argv
5
+ set noteName to item 1 of argv
6
+ set noteBody to item 2 of argv
7
+ tell application "Notes"
8
+ if (count of argv) > 2 then
9
+ set newNote to make new note at folder (item 3 of argv) with properties {body:noteBody}
10
+ else
11
+ set newNote to make new note with properties {body:noteBody}
12
+ end if
13
+ set name of newNote to noteName
14
+ end tell
15
+ end run
@@ -0,0 +1,10 @@
1
+ -- Delete a note by its stable CoreData id. argv: noteId
2
+ -- Id-based, not name-based: names collide, and delete is destructive. The note
3
+ -- moves to Recently Deleted (restorable for 30 days). Get the id from
4
+ -- search-notes.applescript.
5
+ on run argv
6
+ set noteId to item 1 of argv
7
+ tell application "Notes"
8
+ delete note id noteId
9
+ end tell
10
+ end run
@@ -0,0 +1,10 @@
1
+ -- Replace a note's body by CoreData id. argv: noteId, replacementHtmlBody
2
+ -- The replacement body must include the title as its first heading; replacing
3
+ -- body without it also replaces the note's visible title.
4
+ on run argv
5
+ set noteId to item 1 of argv
6
+ set replacementBody to item 2 of argv
7
+ tell application "Notes"
8
+ set body of note id noteId to replacementBody
9
+ end tell
10
+ end run
@@ -0,0 +1,28 @@
1
+ -- Read a note's HTML body. argv: noteRef — a CoreData id (from search-notes,
2
+ -- exact and preferred) or a note name. Name matching tries an exact title, then
3
+ -- a contains match (Notes derives the title from rich text, so it can carry
4
+ -- stray whitespace). Both paths — an id that no longer resolves and a name
5
+ -- that matches nothing — report cleanly instead of raising an AppleScript
6
+ -- error (-1728 / -1719) on a missing note or an empty selection.
7
+ on run argv
8
+ set noteRef to item 1 of argv
9
+ tell application "Notes"
10
+ if noteRef starts with "x-coredata://" then
11
+ -- An id copied from a truncated search line, or one whose note was
12
+ -- deleted, no longer resolves; report cleanly rather than raising -1728.
13
+ try
14
+ return body of note id noteRef
15
+ on error
16
+ return "No note found matching: " & noteRef
17
+ end try
18
+ end if
19
+ set matches to notes whose name is noteRef
20
+ if (count of matches) is 0 then
21
+ set matches to notes whose name contains noteRef
22
+ end if
23
+ if (count of matches) is 0 then
24
+ return "No note found matching: " & noteRef
25
+ end if
26
+ return body of item 1 of matches
27
+ end tell
28
+ end run
@@ -0,0 +1,65 @@
1
+ # Finding and Reading Notes
2
+
3
+ Two bundled operations cover every read request. Run one per `exec` call as
4
+ `osascript {{SKILL_DIR}}/<file>.applescript <args...>`.
5
+
6
+ | Request | Command |
7
+ | ----------------------------------------- | --------------------------------------------------- |
8
+ | "list my notes" / "what notes do I have" | `search-notes.applescript ""` — run it exactly ONCE |
9
+ | "find / search notes about X" | `search-notes.applescript "X"` |
10
+ | "read / open / summarize note X" | search first, then `read-note.applescript "<id>"` |
11
+
12
+ ## Search Notes
13
+
14
+ Pass a search term to `search-notes.applescript` (argv: query). It returns one
15
+ match per line as `<id>\t<name>` for every note whose name OR body contains the
16
+ term. Use the `name` to read a note, or the `id` to edit or delete it — this is
17
+ the only bundled way to obtain a note's stable id.
18
+
19
+ ```bash
20
+ osascript {{SKILL_DIR}}/search-notes.applescript "deadline"
21
+ osascript {{SKILL_DIR}}/search-notes.applescript ""
22
+ ```
23
+
24
+ An empty query (`""`) matches every note, so it doubles as "list all notes" — a
25
+ single call returns the complete list. Run search ONCE per request; do not fire
26
+ several searches (`""`, then `"meeting"`, then `""` again) to enumerate or
27
+ re-confirm. A large library can exceed the default output cap: pass
28
+ `maxOutputChars` (up to 65536) on the exec call, and if the output still ends in
29
+ `… [truncated]`, tell the user the list is partial rather than presenting it as
30
+ the whole library.
31
+
32
+ ## Read a Note
33
+
34
+ Pass a note reference to `read-note.applescript` (argv: noteRef). It returns the
35
+ note's HTML body. The reference is either a CoreData id or a note name:
36
+
37
+ - **Prefer the id** from `search-notes.applescript` — it is exact. To read a
38
+ specific note, search first, then read by the id from that result.
39
+ - A **name** works too, but is a fallback: Notes derives titles from rich text,
40
+ so exact-match can miss. Do not invent a name; use one search returned.
41
+
42
+ ```bash
43
+ osascript {{SKILL_DIR}}/read-note.applescript "x-coredata://.../ICNote/p67"
44
+ osascript {{SKILL_DIR}}/read-note.applescript "Meeting Notes"
45
+ ```
46
+
47
+ When the user names one note, read exactly ONE note — the single best match
48
+ from search — then answer and STOP. Do not read other notes to "explore" or
49
+ compare, and never walk a previous list of notes reading them one by one. Only
50
+ read more than one note when the user explicitly asked about several.
51
+
52
+ A reference that matches nothing — a name with no match, or an id that no
53
+ longer resolves (deleted, or copied from a truncated search line) — returns
54
+ `No note found matching: ...` (not an error); search again and retry with the id
55
+ from that result. The body is HTML; strip tags or convert to plain text before
56
+ answering unless the user asked for the raw markup. A long note can exceed the
57
+ default output cap: pass `maxOutputChars` (up to 65536) on the exec call, and if
58
+ the body still ends in `… [truncated]`, tell the user it is partial rather than
59
+ summarizing it as complete.
60
+
61
+ ## Common Mistakes
62
+
63
+ - Using `title of note` — Notes has no `title` property. Read or search `name`.
64
+ - Running several searches for one request — one `search-notes ""` is the whole list.
65
+ - Reading every note from a list when the user asked about one.