@globant/coda-windows-x64 1.0.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 (55) hide show
  1. package/assets/agents/coda-help.md +166 -0
  2. package/assets/agents/create-workflow.md +264 -0
  3. package/assets/agents/explore.md +26 -0
  4. package/assets/docs/agents.md +162 -0
  5. package/assets/docs/cli-reference.md +131 -0
  6. package/assets/docs/cli-vs-batch.md +58 -0
  7. package/assets/docs/config-json.md +314 -0
  8. package/assets/docs/config-reference.md +329 -0
  9. package/assets/docs/configuration.md +105 -0
  10. package/assets/docs/connect-provider.md +77 -0
  11. package/assets/docs/extensions.md +260 -0
  12. package/assets/docs/faq.md +152 -0
  13. package/assets/docs/glossary.md +41 -0
  14. package/assets/docs/guide-automate.md +135 -0
  15. package/assets/docs/guide-changes.md +101 -0
  16. package/assets/docs/guide-collaborate.md +119 -0
  17. package/assets/docs/guide-extend.md +120 -0
  18. package/assets/docs/guide-understand.md +95 -0
  19. package/assets/docs/hooks.md +704 -0
  20. package/assets/docs/how-it-works.md +73 -0
  21. package/assets/docs/index.md +62 -0
  22. package/assets/docs/installation.md +71 -0
  23. package/assets/docs/logging.md +123 -0
  24. package/assets/docs/overview.md +91 -0
  25. package/assets/docs/permissions.md +93 -0
  26. package/assets/docs/quickstart.md +104 -0
  27. package/assets/docs/sessions.md +139 -0
  28. package/assets/docs/shortcuts.md +61 -0
  29. package/assets/docs/tools-reference.md +81 -0
  30. package/assets/docs/workflows.md +146 -0
  31. package/assets/skills/create-extension/SKILL.md +293 -0
  32. package/assets/skills/create-hook/SKILL.md +442 -0
  33. package/assets/skills/create-skill/SKILL.md +180 -0
  34. package/assets/skills/plan/SKILL.md +25 -0
  35. package/coda.exe +0 -0
  36. package/lib/keytar/build/Release/keytar.node +0 -0
  37. package/lib/keytar/lib/keytar.js +43 -0
  38. package/lib/opentui/assets/javascript/highlights.scm +205 -0
  39. package/lib/opentui/assets/javascript/tree-sitter-javascript.wasm +0 -0
  40. package/lib/opentui/assets/markdown/highlights.scm +150 -0
  41. package/lib/opentui/assets/markdown/injections.scm +27 -0
  42. package/lib/opentui/assets/markdown/tree-sitter-markdown.wasm +0 -0
  43. package/lib/opentui/assets/markdown_inline/highlights.scm +115 -0
  44. package/lib/opentui/assets/markdown_inline/tree-sitter-markdown_inline.wasm +0 -0
  45. package/lib/opentui/assets/typescript/highlights.scm +604 -0
  46. package/lib/opentui/assets/typescript/tree-sitter-typescript.wasm +0 -0
  47. package/lib/opentui/assets/zig/highlights.scm +284 -0
  48. package/lib/opentui/assets/zig/tree-sitter-zig.wasm +0 -0
  49. package/lib/opentui/parser.worker.js +4244 -0
  50. package/lib/opentui/tree-sitter-3jzf13jk.wasm +0 -0
  51. package/lib/ripgrep/COPYING +3 -0
  52. package/lib/ripgrep/LICENSE-MIT +21 -0
  53. package/lib/ripgrep/UNLICENSE +24 -0
  54. package/lib/ripgrep/rg.exe +0 -0
  55. package/package.json +20 -0
@@ -0,0 +1,442 @@
1
+ ---
2
+ name: create-hook
3
+ description: Explains how to create, configure, and use g-coda lifecycle hooks. Use when the user asks how to create a hook, configure hooks in config.json, write a hook script, or understand hook events and their payloads.
4
+ ---
5
+
6
+ # g-coda Lifecycle Hooks
7
+
8
+ Hooks are user-defined shell commands or HTTP endpoints that run automatically at specific points in g-coda's lifecycle. They let you audit tool calls, enforce policies, inject context, modify prompts, and automate workflows without changing g-coda's source code.
9
+
10
+ ---
11
+
12
+ ## Configuration location
13
+
14
+ Hooks live in the `hooks` key of `config.json`. There are two scopes:
15
+
16
+ | Scope | File |
17
+ |-------|------|
18
+ | **Project** (highest priority) | `.coda/config.json` in the project root |
19
+ | **Global** | `~/.coda/config.json` |
20
+
21
+ Project hooks are merged on top of global hooks. Both files use the same format.
22
+
23
+ ---
24
+
25
+ ## Config structure
26
+
27
+ ```json
28
+ {
29
+ "hooks": {
30
+ "<EventName>": [
31
+ {
32
+ "matcher": "<optional pattern>",
33
+ "hooks": [
34
+ { "type": "command", "command": "<shell command>" }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ ```
41
+
42
+ - **`<EventName>`** — one of the supported lifecycle events (see below).
43
+ - **`matcher`** — optional filter. Omit (or use `"*"`) to match all. For tool events, matched against the tool name. For `SessionStart`, matched against the session source (`"startup"`, `"resume"`, `"clear"`, `"compact"`). Supports exact strings, pipe-separated lists (`"Bash|Edit"`), and JavaScript regexes.
44
+ - **`hooks`** — array of hook handlers to run when the matcher fires.
45
+
46
+ ---
47
+
48
+ ## Hook handler types
49
+
50
+ ### Command hook
51
+
52
+ Spawns a shell command via `sh -c`. g-coda writes a JSON payload to the command's **stdin**. The command can write a JSON response to **stdout** to influence the agent.
53
+
54
+ ```json
55
+ {
56
+ "type": "command",
57
+ "command": "python3 ~/.coda/hooks/my_hook.py",
58
+ "timeout": 30,
59
+ "statusMessage": "Running policy check…"
60
+ }
61
+ ```
62
+
63
+ | Field | Type | Default | Description |
64
+ |-------|------|---------|-------------|
65
+ | `command` | string | required | Shell command to run |
66
+ | `args` | string[] | — | Extra arguments appended to the command |
67
+ | `timeout` | number | 600 | Seconds before the hook is killed |
68
+ | `shell` | `"bash"` \| `"powershell"` | system default | Shell to use |
69
+ | `statusMessage` | string | — | Spinner text shown while the hook runs |
70
+ | `if` | string | — | Conditional expression (tool events only) |
71
+
72
+ ### HTTP hook
73
+
74
+ POSTs the JSON payload to a URL and reads the JSON response from the response body.
75
+
76
+ ```json
77
+ {
78
+ "type": "http",
79
+ "url": "http://localhost:8080/hook",
80
+ "headers": { "Authorization": "Bearer $MY_TOKEN" },
81
+ "allowedEnvVars": ["MY_TOKEN"],
82
+ "timeout": 10
83
+ }
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Supported events
89
+
90
+ > **All events below fire at runtime.** The config schema, the `/hooks` browser,
91
+ > and the g-coda runtime all support every event in the table. A hook you attach
92
+ > to any of them will actually run. Two events have important behavioral notes —
93
+ > see the legend below the table.
94
+
95
+ | Event | When it fires | Matcher query |
96
+ |-------|--------------|---------------|
97
+ | `PreToolUse` | Before a tool executes | tool name |
98
+ | `PostToolUse` | After a tool succeeds | tool name |
99
+ | `PostToolUseFailure` | After a tool throws an error | tool name |
100
+ | `UserPromptSubmit` | When the user submits a message | — |
101
+ | `SessionStart` | When a session is created | source (`startup`/`resume`/`clear`/`compact`) |
102
+ | `SessionEnd` | When a session ends | — |
103
+ | `Stop` | When the agent loop finishes a turn | — |
104
+ | `PreCompact` | Before context compaction runs | — |
105
+ | `PostCompact` | After context compaction completes | — |
106
+ | `StopFailure` | When the agent loop errors out | — |
107
+ | `SubagentStart` | When a subagent run begins | — |
108
+ | `SubagentStop` | When a subagent run concludes | — |
109
+ | `Notification` | When a user-facing notification is sent | — |
110
+ | `PermissionRequest` | When a permission dialog is surfaced (observe-only) | — |
111
+ | `PermissionDenied` | After a tool call is denied | — |
112
+ | `ConfigChange` | After config is reloaded mid-session (`/reload-hooks`) | — |
113
+ | `CwdChanged` | After a `cd` changes the working directory (best-effort) | — |
114
+ | `FileChanged` | After a `write`/`edit` changes a file | — |
115
+ | `InstructionsLoaded` | When an AGENTS.md file is loaded | — |
116
+
117
+ Every event is emitted at runtime. Most are mapped from an extension hook in
118
+ `packages/core/src/extensions/hooks-bridge.ts`; the rest are fired by exported
119
+ `emit*Hook()` helpers in the same file, called from the owning runtime point
120
+ (agent run manager, HITL manager, turn orchestrator, prompt builder, the
121
+ `write`/`edit`/`bash` tools, and the CLI reload path).
122
+
123
+ **Two behavioral notes:**
124
+
125
+ - **`PermissionRequest` is observe-only.** It fires when the approval dialog is
126
+ surfaced, but it **cannot block a tool**. To block a tool before it runs, use
127
+ **`PreToolUse`** with `permissionDecision: "deny"`.
128
+ - **`CwdChanged` is best-effort.** g-coda has no persistent working directory, so
129
+ it fires by detecting a leading `cd <path>` in a `bash` command. Complex shell
130
+ constructs (subshells, pipes, `pushd`) are not tracked.
131
+
132
+ ### Event payload notes
133
+
134
+ The lifecycle events beyond the tool/session set carry event-specific fields on
135
+ their stdin payload (in addition to the base fields):
136
+
137
+ - `StopFailure` → `error`, `recoverable`
138
+ - `SubagentStart` / `SubagentStop` → `run_id`, `agent_name`, `task`, `model`,
139
+ and (Stop only) `status`, `summary`, `error`
140
+ - `Notification` → `notification_type`, `message`
141
+ - `PermissionRequest` / `PermissionDenied` → `tool_name`, `tool_input`,
142
+ `question` (Request), `reason` (Denied)
143
+ - `ConfigChange` → `change_source`
144
+ - `CwdChanged` → `previous_cwd`, `new_cwd`
145
+ - `FileChanged` → `file_path`, `tool_name`
146
+ - `InstructionsLoaded` → `file_path`
147
+
148
+ ---
149
+
150
+ ## Input payload (stdin)
151
+
152
+ Every hook receives a JSON object on stdin. All events include these base fields:
153
+
154
+ ```json
155
+ {
156
+ "session_id": "abc123",
157
+ "transcript_path": "/path/to/transcript.json",
158
+ "cwd": "/path/to/project",
159
+ "hook_event_name": "PreToolUse",
160
+ "permission_mode": "default",
161
+ "agent_id": "...",
162
+ "agent_type": "main"
163
+ }
164
+ ```
165
+
166
+ Additional fields by event:
167
+
168
+ **Tool events** (`PreToolUse`, `PostToolUse`, `PostToolUseFailure`):
169
+ ```json
170
+ {
171
+ "tool_name": "bash",
172
+ "tool_input": { "command": "ls -la" },
173
+ "tool_use_id": "toolu_...",
174
+ "tool_response": "...", // PostToolUse only
175
+ "error": "..." // PostToolUseFailure only
176
+ }
177
+ ```
178
+
179
+ **`UserPromptSubmit`**:
180
+ ```json
181
+ { "prompt": "the user's message text" }
182
+ ```
183
+
184
+ **`SessionStart`**:
185
+ ```json
186
+ { "source": "startup", "model": "claude-sonnet-4-5" }
187
+ ```
188
+
189
+ **`Stop`**:
190
+ ```json
191
+ { "stop_reason": "end_turn" }
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Output (stdout)
197
+
198
+ Return a JSON object from stdout to influence the agent. All fields are optional.
199
+
200
+ ```json
201
+ {
202
+ "continue": true,
203
+ "suppressOutput": false,
204
+ "systemMessage": "Text injected as a system message to the model",
205
+ "decision": "block",
206
+ "reason": "Reason shown to the user when blocking",
207
+ "hookSpecificOutput": {
208
+ "hookEventName": "PreToolUse",
209
+ "permissionDecision": "allow",
210
+ "permissionDecisionReason": "Approved by policy",
211
+ "updatedInput": { "command": "ls -la --color=never" },
212
+ "additionalContext": "Extra context appended to tool result",
213
+ "updatedPrompt": "Rewritten user prompt"
214
+ }
215
+ }
216
+ ```
217
+
218
+ | Field | Effect |
219
+ |-------|--------|
220
+ | `continue: false` | Stop the agent entirely; show `stopReason` to the user |
221
+ | `systemMessage` | Inject a system message visible to the model |
222
+ | `decision: "block"` | Block the current event (tool call, prompt, etc.) |
223
+ | `decision: "approve"` | Approve without showing the permission dialog |
224
+ | `hookSpecificOutput.permissionDecision` | `"allow"` / `"deny"` / `"ask"` for `PreToolUse` |
225
+ | `hookSpecificOutput.updatedInput` | Replace the tool's input before execution (`PreToolUse`) |
226
+ | `hookSpecificOutput.additionalContext` | Append text to the tool result (`PostToolUse`) |
227
+ | `hookSpecificOutput.updatedPrompt` | Replace the user's prompt (`UserPromptSubmit`) |
228
+
229
+ Exit code `0` = success. Any non-zero exit code is treated as an error (hook output is still read).
230
+
231
+ ---
232
+
233
+ ## Examples
234
+
235
+ ### Log every tool call to a file
236
+
237
+ `.coda/config.json`:
238
+ ```json
239
+ {
240
+ "hooks": {
241
+ "PreToolUse": [
242
+ {
243
+ "hooks": [
244
+ { "type": "command", "command": "jq -r '[.hook_event_name, .tool_name] | @tsv' >> ~/.coda/tool-log.tsv" }
245
+ ]
246
+ }
247
+ ]
248
+ }
249
+ }
250
+ ```
251
+
252
+ ### Block `rm -rf` in Bash
253
+
254
+ ```json
255
+ {
256
+ "hooks": {
257
+ "PreToolUse": [
258
+ {
259
+ "matcher": "bash",
260
+ "hooks": [
261
+ {
262
+ "type": "command",
263
+ "command": "python3 -c \"\nimport json, sys\ndata = json.load(sys.stdin)\ncmd = data.get('tool_input', {}).get('command', '')\nif 'rm -rf' in cmd:\n print(json.dumps({'decision': 'block', 'reason': 'rm -rf is not allowed'}))\n\""
264
+ }
265
+ ]
266
+ }
267
+ ]
268
+ }
269
+ }
270
+ ```
271
+
272
+ ### Inject environment variables on session start
273
+
274
+ ```json
275
+ {
276
+ "hooks": {
277
+ "SessionStart": [
278
+ {
279
+ "matcher": "startup",
280
+ "hooks": [
281
+ { "type": "command", "command": "bash ~/.coda/hooks/set-env.sh" }
282
+ ]
283
+ }
284
+ ]
285
+ }
286
+ }
287
+ ```
288
+
289
+ `~/.coda/hooks/set-env.sh`:
290
+ ```bash
291
+ #!/usr/bin/env bash
292
+ # Write env vars to the session env file so they are available in every Bash tool call
293
+ SESSION_ENV_FILE="$HOME/.coda/session-env/$SESSION_ID/env.sh"
294
+ mkdir -p "$(dirname "$SESSION_ENV_FILE")"
295
+ echo "export MY_VAR=hello" >> "$SESSION_ENV_FILE"
296
+ ```
297
+
298
+ ### Rewrite a user prompt
299
+
300
+ ```json
301
+ {
302
+ "hooks": {
303
+ "UserPromptSubmit": [
304
+ {
305
+ "hooks": [
306
+ {
307
+ "type": "command",
308
+ "command": "python3 ~/.coda/hooks/rewrite_prompt.py"
309
+ }
310
+ ]
311
+ }
312
+ ]
313
+ }
314
+ }
315
+ ```
316
+
317
+ `~/.coda/hooks/rewrite_prompt.py`:
318
+ ```python
319
+ import json, sys
320
+
321
+ data = json.load(sys.stdin)
322
+ prompt = data["prompt"]
323
+
324
+ # Prepend a context hint to every prompt
325
+ updated = f"[Project: my-app] {prompt}"
326
+
327
+ print(json.dumps({
328
+ "hookSpecificOutput": {
329
+ "hookEventName": "UserPromptSubmit",
330
+ "updatedPrompt": updated
331
+ }
332
+ }))
333
+ ```
334
+
335
+ ---
336
+
337
+ ## End-to-end walkthroughs
338
+
339
+ ### Example 1 — log every bash command (`PreToolUse`)
340
+
341
+ **User prompt:** *"Create a hook that logs every bash command I run to a file."*
342
+
343
+ This works with config alone. Write the script and wire it via the matcher.
344
+
345
+ `.coda/hooks/bash-audit.py`:
346
+ ```python
347
+ #!/usr/bin/env python3
348
+ import json, sys, time
349
+
350
+ data = json.load(sys.stdin)
351
+ command = data.get("tool_input", {}).get("command", "")
352
+ with open(".coda/hooks-data/bash-audit.log", "a") as log:
353
+ log.write(f"{time.strftime('%Y-%m-%dT%H:%M:%S')}\t{command}\n")
354
+ ```
355
+
356
+ `.coda/config.json`:
357
+ ```json
358
+ {
359
+ "hooks": {
360
+ "PreToolUse": [
361
+ {
362
+ "matcher": "bash",
363
+ "hooks": [
364
+ { "type": "command", "command": "python3 .coda/hooks/bash-audit.py" }
365
+ ]
366
+ }
367
+ ]
368
+ }
369
+ }
370
+ ```
371
+
372
+ Then **remind the user to run `/reload-hooks`**. The next bash tool call appends
373
+ a line to `.coda/hooks-data/bash-audit.log`. (This mirrors the existing
374
+ `.coda/hooks/token_cost.py` convention in this repo.)
375
+
376
+ ### Example 2 — react when a subagent finishes (`SubagentStop`)
377
+
378
+ **User prompt:** *"Create a hook that runs whenever a subagent finishes."*
379
+
380
+ `SubagentStop` fires at runtime, so this works with config alone. The payload
381
+ includes `run_id`, `agent_name`, `task`, `status`, and (when present) `summary`.
382
+
383
+ `.coda/hooks/subagent-log.py`:
384
+ ```python
385
+ #!/usr/bin/env python3
386
+ import json, sys, time
387
+
388
+ data = json.load(sys.stdin)
389
+ line = f"{time.strftime('%Y-%m-%dT%H:%M:%S')}\t{data.get('agent_name', '?')}\t{data.get('status', '?')}\n"
390
+ with open(".coda/hooks-data/subagents.log", "a") as log:
391
+ log.write(line)
392
+ ```
393
+
394
+ `.coda/config.json`:
395
+ ```json
396
+ {
397
+ "hooks": {
398
+ "SubagentStop": [
399
+ {
400
+ "hooks": [
401
+ { "type": "command", "command": "python3 .coda/hooks/subagent-log.py" }
402
+ ]
403
+ }
404
+ ]
405
+ }
406
+ }
407
+ ```
408
+
409
+ > **Reminder about the two special-case events.** `PermissionRequest` is
410
+ > observe-only — to *block* a tool, use `PreToolUse` with
411
+ > `permissionDecision: "deny"` instead. `CwdChanged` is best-effort and only
412
+ > detects a leading `cd <path>` in a bash command.
413
+
414
+ ---
415
+
416
+ ## Disabling all hooks
417
+
418
+ Set `disableAllHooks: true` in `config.json` to skip all hook execution (useful in CI):
419
+
420
+ ```json
421
+ { "disableAllHooks": true }
422
+ ```
423
+
424
+ ---
425
+
426
+ ## Reloading hooks
427
+
428
+ Run `/reload-hooks` in the chat to reload hook configuration from disk without restarting g-coda.
429
+
430
+ ---
431
+
432
+ ## Instructions for the agent
433
+
434
+ When the user asks to create a hook:
435
+
436
+ 1. **Identify the event** — ask which lifecycle event they want to hook into if not specified.
437
+ 2. **Note the two special-case events** — every event fires, but if the user wants to *block* a tool, use `PreToolUse` with `permissionDecision: "deny"` rather than `PermissionRequest` (which is observe-only); and remember `CwdChanged` is best-effort (`cd`-detection only). See the **Supported events** table.
438
+ 3. **Identify the scope** — ask whether the hook should be project-level (`.coda/config.json`) or global (`~/.coda/config.json`). Default to project-level.
439
+ 4. **Write the config** — add or update the `hooks` key in the appropriate `config.json`. If the file doesn't exist, create it with only the `hooks` key.
440
+ 5. **Write the script** (if needed) — for non-trivial logic, create a separate script file (Python or Bash) and reference it from the `command` field. Place scripts in `.coda/hooks/` (project) or `~/.coda/hooks/` (global).
441
+ 6. **Test** — remind the user to run `/reload-hooks` after saving changes.
442
+ 7. **Explain the payload** — show the user what JSON fields their script will receive on stdin for the chosen event.
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: create-skill
3
+ description: Create, modify, and improve skills in coda. Use if users want to create a new skill from scratch, edit an existing skill, decide whether a skill is project-scoped or global, validate skill structure, or understand skill architecture and best practices. e.g create a skill that ...
4
+ ---
5
+
6
+ # TASK
7
+
8
+ Before creating a skill, understand the intent. In an interactive session, use `ask_user` to clarify; in a headless/batch run (where `ask_user` is unavailable), infer from the prompt and proceed with reasonable defaults.
9
+ Aim to settle:
10
+ 1. What the skill is for, and what problem it solves.
11
+ 2. Whether it is **project-specific** (only this repo) or **general/global** (reused across projects). See [Choosing the Skill Location](#choosing-the-skill-location).
12
+ 3. Whether `scripts/`, `references/`, or `assets/` are actually needed, or a single SKILL.md is enough.
13
+
14
+ Default to a **minimal SKILL.md**. Only add bundled resources when the use case clearly demands them.
15
+
16
+ ---
17
+
18
+ ## How Skills Work in Coda
19
+
20
+ A skill is a Markdown file named `SKILL.md` (or `skill.md`) with YAML frontmatter, optionally accompanied by bundled files. Coda uses progressive disclosure:
21
+
22
+ - **Level 1 — Metadata** (`name` + `description`): injected into the system prompt's "Available Skills" list so the model knows the skill exists. The description is truncated to a character limit (`skills.descriptionMaxChars`, default 200). A skill with `disable-model-invocation: true` is **omitted** from this list (the user can still invoke it).
23
+ - **Level 2 — SKILL.md body**: loaded when the skill is invoked. Keep it under ~500 lines.
24
+ - **Level 3 — Bundled files**: references/scripts/assets the model reads or runs **only if it chooses to**, using normal tools.
25
+
26
+ Important: invoking a skill just loads its Markdown body and returns it to the model, which then continues in the normal tool loop. **There is no separate skill runtime** — Coda does not auto-execute bundled scripts and there is no packaging step. Any script a skill ships is just a file on disk that the model may run via a normal tool such as `bash`.
27
+
28
+ ---
29
+
30
+ ## Step 1: Capture Intent
31
+
32
+ Gather enough to write a well-scoped skill. Don't rush — confirm understanding before writing.
33
+
34
+ - **Purpose & scope:** the task, the problem solved, expected inputs/outputs, success criteria.
35
+ - **Triggers:** user phrases, file types, and contexts that should activate it; any competing skills. Skills undertrigger by default, so plan a "pushy" description.
36
+ - **Edge cases:** common failure modes, prerequisites/dependencies, and behavior on missing/invalid input.
37
+
38
+ If the user says "turn this into a skill," extract the workflow, tools, and corrections from the conversation history and confirm the core task.
39
+
40
+ ---
41
+
42
+ ## Step 2: Research
43
+
44
+ Before writing, check what already exists and confirm feasibility.
45
+ You may check in the .coda/skills or ~/.coda/skills folders using grep/glob tools.
46
+
47
+ - Avoid duplication; reuse existing patterns, naming, and shared scripts.
48
+ - Confirm any tools the skill relies on are available to the session.
49
+
50
+ ---
51
+
52
+ ## Choosing the Skill Location
53
+
54
+ Decide **where** the skill lives before writing files. A project skill overrides a global one with the same `name`.
55
+
56
+ | Scope | Use when | Write to |
57
+ |-------|----------|----------|
58
+ | **Project** | Only makes sense in this repo — project conventions, internal APIs/tooling, or shared with the team via version control. | `{projectDir}/.coda/skills/` |
59
+ | **Global** | Broadly useful across projects and personal to the user. | `~/.coda/skills/` |
60
+
61
+ - **Default to project scope** when the request clearly relates to the current codebase (it gets committed and shared with the team).
62
+ - **Choose global scope** for general-purpose helpers reused everywhere.
63
+ - If ambiguous, confirm with the user before creating files.
64
+ - The compat paths `{projectDir}/.agents/skills/` and `~/.agents/skills/` also work; prefer `.coda/skills` unless the user targets `.agents`.
65
+
66
+ Coda discovers a `SKILL.md` at any depth under these directories. The **recommended** layout is one folder per skill (`<chosen-dir>/<name>/SKILL.md`) so bundled files stay grouped, but a bare `SKILL.md` is also found. No config changes are needed — new skills are picked up on the next session start or after `/skills refresh`.
67
+
68
+ ---
69
+
70
+ ## Step 3: Write the SKILL.md
71
+
72
+ ### Frontmatter
73
+
74
+ ```yaml
75
+ ---
76
+ name: skill-identifier
77
+ description: What the skill does AND when to use it. Include trigger contexts and keywords; be explicit and slightly "pushy" to encourage triggering.
78
+ # Optional — defaults shown:
79
+ # disable-model-invocation: false
80
+ # user-invocable: true
81
+ ---
82
+ ```
83
+
84
+ Coda only reads the fields below; any other key has no effect.
85
+
86
+ - **`name`** (required): kebab-case (`^[a-z0-9-]+$`, no leading/trailing or doubled hyphens). Used for the `skills` tool param, the `/skill-name` command, and enable/disable state.
87
+ - **`description`** (required): WHAT + WHEN + triggers. It is injected into the system prompt and **truncated** to a character limit (default 200), so front-load the key triggers.
88
+ - **`disable-model-invocation`** (optional, default `false`): when `true`, the skill is hidden from the "Available Skills" prompt block so the model won't pick it on its own; the user can still invoke it via slash command or explicit tool call.
89
+ - **`user-invocable`** (optional, default `true`): when `false`, the skill is hidden from `/skill-name` registration and Discover Skills listings.
90
+
91
+ > Do **not** add `execution`/`context`/`timeout`/`compatibility`/`allowed-tools`/`license` — Coda ignores them. Any tools a skill needs must already be available to the session.
92
+
93
+ **Description examples:**
94
+
95
+ - ❌ "Helps with PDF tasks"
96
+ - ✅ "Fill PDF forms by extracting field names and populating them with provided data. Use when users mention PDFs, forms, filling documents, or provide .pdf files."
97
+
98
+ Pattern: *[what it does] + [when to use it] + [specific triggers]*.
99
+
100
+ ### Body
101
+
102
+ Keep it imperative, structured, and example-driven. A typical skeleton:
103
+
104
+ ```markdown
105
+ # Skill Name
106
+
107
+ One-paragraph overview of what this accomplishes and why.
108
+
109
+ ## Prerequisites (if any)
110
+ - Tools/dependencies, expected formats.
111
+
112
+ ## Workflow
113
+ ### Step 1: ...
114
+ 1. Imperative step
115
+ 2. Imperative step
116
+ **Why this matters:** brief reasoning.
117
+
118
+ ### Step 2: ...
119
+ **Edge cases:** what to do when input is missing/invalid.
120
+
121
+ ## Output Format (if any)
122
+ Show the exact expected output with a concrete example.
123
+
124
+ ## Examples
125
+ Input → expected output, including one edge case.
126
+
127
+ ## Error Handling
128
+ Common failures and how to recover.
129
+ ```
130
+
131
+ **Style:** imperative voice ("Read the file"), explain the WHY, prefer concrete examples over abstraction, and avoid heavy ALL-CAPS rules. Be instructive, not oppressive.
132
+
133
+ ---
134
+
135
+ ## Step 4: Bundle Resources (Option, consider if it is required)
136
+
137
+ ```
138
+ <name>/
139
+ ├── SKILL.md # Required
140
+ ├── scripts/ # Helper scripts the model may run via bash (not auto-run)
141
+ ├── references/ # Docs the model reads on demand (add a TOC if >300 lines)
142
+ └── assets/ # Templates, configs, static resources
143
+ ```
144
+
145
+ - **scripts/** — for deterministic, repetitive work better in code than prose (transforms, format conversions, API calls). Coda will not run them automatically; the model invokes them with a normal tool. Give each a docstring, usage example, and error handling.
146
+ - **references/** — for large or occasional reference material; SKILL.md points to them (e.g. "If deploying to AWS, read `references/aws.md`").
147
+ - **assets/** — templates, config files, sample data, UI resources.
148
+
149
+ **Testing:** there is no built-in eval runner. If a skill needs tests, the user normally describes the test details and expected outcomes in the prompt at invocation time rather than baking them into the skill, so don't add a test harness unless asked.
150
+
151
+ ---
152
+
153
+ ## Step 5: Validate & Activate
154
+
155
+ There is no validation or packaging command. Check if the skill structure is respected.
156
+
157
+ 1. Starts with `---` and is valid YAML.
158
+ 2. `name` and `description` are present and non-empty.
159
+ 3. `name` is kebab-case; the file is named exactly `SKILL.md`/`skill.md` (others are ignored).
160
+ 4. It lives under the chosen `.coda/skills/` or `~/.coda/skills/`.
161
+ 5. If used, `disable-model-invocation` / `user-invocable` are booleans.
162
+
163
+ ---
164
+
165
+ ## Deliverables
166
+
167
+ When done, give the user:
168
+
169
+ 1. The skill folder path
170
+ 2. An example on how to prompt it or call it with a command.
171
+
172
+ ---
173
+
174
+ ## Quality Checklist
175
+
176
+ - **Progressive disclosure:** SKILL.md under ~500 lines; push detail into references; deterministic work into scripts.
177
+ - **Clear triggering:** description states WHAT + WHEN, slightly pushy.
178
+ - **Actionable & example-driven:** every step executable; concrete input→output pairs; handle edge cases, not just the happy path.
179
+ - **Generalized, not overfit:** patterns over hardcoded values; flexible guidance over rigid MUSTs.
180
+ - **No surprises:** behavior must match the description — no malware, hidden functionality, or data exfiltration.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: plan
3
+ description: analyze the user requirements and create a plan to implement the feature or solve the issue .
4
+ ---
5
+
6
+ ### Persona
7
+ Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before they switch into another mode to implement the solution.
8
+
9
+ Your task is to plan, design, or strategize before implementation. Perfect for breaking down complex problems, creating technical specifications, designing system architecture, or brainstorming solutions before coding.
10
+
11
+ ### Execution comments
12
+ - Headless mode: It's possible the ask-user tool to be disabled. In this case, a headless execution (also called coda-batch) you will have to explore more deeply the codebase and make reasonable assumptions based on best practices.
13
+ - Interactive mode: Follow the instructions below.
14
+
15
+ ### INSTRUCTIONS
16
+ 1. Do some information gathering (using provided tools) to get more context about the task. Use the bash tool grep and find commands to understand the current architecture and implementation. [This step is valid for interactive and headless mode]
17
+ 2. You should also ask the user clarifying questions to get a better understanding of the task with the ask_user tool. [This step is valid for interactive mode only]
18
+ 3. Write a markdown document with the plan for the feature including UML diagrams and flowcharts to clarify the system design.
19
+ Make sure the diagrams render in VSCode preview.
20
+
21
+ Output file:
22
+ .coda/plans/plan-{name-of-feature}.md
23
+
24
+ # Response format
25
+ Provide the user a summary of the plan describing the feature on a high level.
package/coda.exe ADDED
Binary file
@@ -0,0 +1,43 @@
1
+ var keytar = require('../build/Release/keytar.node')
2
+
3
+ function checkRequired(val, name) {
4
+ if (!val || val.length <= 0) {
5
+ throw new Error(name + ' is required.');
6
+ }
7
+ }
8
+
9
+ module.exports = {
10
+ getPassword: function (service, account) {
11
+ checkRequired(service, 'Service')
12
+ checkRequired(account, 'Account')
13
+
14
+ return keytar.getPassword(service, account)
15
+ },
16
+
17
+ setPassword: function (service, account, password) {
18
+ checkRequired(service, 'Service')
19
+ checkRequired(account, 'Account')
20
+ checkRequired(password, 'Password')
21
+
22
+ return keytar.setPassword(service, account, password)
23
+ },
24
+
25
+ deletePassword: function (service, account) {
26
+ checkRequired(service, 'Service')
27
+ checkRequired(account, 'Account')
28
+
29
+ return keytar.deletePassword(service, account)
30
+ },
31
+
32
+ findPassword: function (service) {
33
+ checkRequired(service, 'Service')
34
+
35
+ return keytar.findPassword(service)
36
+ },
37
+
38
+ findCredentials: function (service) {
39
+ checkRequired(service, 'Service')
40
+
41
+ return keytar.findCredentials(service)
42
+ }
43
+ }