command-code 0.52.4 → 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 (61) hide show
  1. package/CHANGELOG.md +2541 -0
  2. package/dist/bundled/command-code-knowledge/SKILL.md +52 -0
  3. package/dist/bundled/command-code-knowledge/reference/checkpoints.md +366 -0
  4. package/dist/bundled/command-code-knowledge/reference/custom-agents.md +91 -0
  5. package/dist/bundled/command-code-knowledge/reference/custom-slash-commands.md +345 -0
  6. package/dist/bundled/command-code-knowledge/reference/headless.md +234 -0
  7. package/dist/bundled/command-code-knowledge/reference/hooks.md +1097 -0
  8. package/dist/bundled/command-code-knowledge/reference/mcp.md +626 -0
  9. package/dist/bundled/command-code-knowledge/reference/memory.md +98 -0
  10. package/dist/bundled/command-code-knowledge/reference/models.md +81 -0
  11. package/dist/bundled/command-code-knowledge/reference/permissions.md +412 -0
  12. package/dist/bundled/command-code-knowledge/reference/plan-mode.md +101 -0
  13. package/dist/bundled/command-code-knowledge/reference/product-help.md +421 -0
  14. package/dist/bundled/command-code-knowledge/reference/skills.md +993 -0
  15. package/dist/bundled/mod-builder/SKILL.md +128 -0
  16. package/dist/bundled/mod-builder/examples/block-dangerous-commands.ts +41 -0
  17. package/dist/bundled/mod-builder/examples/custom-entry-renderer.ts +32 -0
  18. package/dist/bundled/mod-builder/examples/custom-tool.ts +53 -0
  19. package/dist/bundled/mod-builder/examples/flags-and-options.ts +29 -0
  20. package/dist/bundled/mod-builder/examples/input-shortcuts.ts +41 -0
  21. package/dist/bundled/mod-builder/examples/kitchen-sink.ts +110 -0
  22. package/dist/bundled/mod-builder/examples/lifecycle-hooks.ts +64 -0
  23. package/dist/bundled/mod-builder/examples/observe-events.ts +30 -0
  24. package/dist/bundled/mod-builder/examples/slash-command.ts +33 -0
  25. package/dist/bundled/mod-builder/reference/api.md +81 -0
  26. package/dist/bundled/mod-builder/reference/hooks-and-events.md +308 -0
  27. package/dist/bundled/mod-builder/reference/overview.md +161 -0
  28. package/dist/bundled/mod-builder/reference/packaging.md +63 -0
  29. package/dist/bundled/mod-builder/reference/ui.md +63 -0
  30. package/dist/bundled/mod-builder/reference/verify.md +58 -0
  31. package/dist/bundled/skill-builder/SKILL.md +104 -0
  32. package/dist/cli.mjs +5 -5
  33. package/package.json +35 -26
  34. package/vsix/commandcode-vscode.vsix +0 -0
  35. /package/{skills → dist/bundled}/agent-browser/SKILL.md +0 -0
  36. /package/{skills → dist/bundled}/design/SKILL.md +0 -0
  37. /package/{skills → dist/bundled}/design/references/border.md +0 -0
  38. /package/{skills → dist/bundled}/design/references/button.md +0 -0
  39. /package/{skills → dist/bundled}/design/references/checkup.md +0 -0
  40. /package/{skills → dist/bundled}/design/references/color.md +0 -0
  41. /package/{skills → dist/bundled}/design/references/create.md +0 -0
  42. /package/{skills → dist/bundled}/design/references/design-html.md +0 -0
  43. /package/{skills → dist/bundled}/design/references/deslop.md +0 -0
  44. /package/{skills → dist/bundled}/design/references/finish.md +0 -0
  45. /package/{skills → dist/bundled}/design/references/interaction.md +0 -0
  46. /package/{skills → dist/bundled}/design/references/layout.md +0 -0
  47. /package/{skills → dist/bundled}/design/references/motion.md +0 -0
  48. /package/{skills → dist/bundled}/design/references/redesign.md +0 -0
  49. /package/{skills → dist/bundled}/design/references/refine.md +0 -0
  50. /package/{skills → dist/bundled}/design/references/relayout.md +0 -0
  51. /package/{skills → dist/bundled}/design/references/report-html.md +0 -0
  52. /package/{skills → dist/bundled}/design/references/responsive.md +0 -0
  53. /package/{skills → dist/bundled}/design/references/review.md +0 -0
  54. /package/{skills → dist/bundled}/design/references/setup.md +0 -0
  55. /package/{skills → dist/bundled}/design/references/shadow.md +0 -0
  56. /package/{skills → dist/bundled}/design/references/smell.md +0 -0
  57. /package/{skills → dist/bundled}/design/references/surface.md +0 -0
  58. /package/{skills → dist/bundled}/design/references/tokenize.md +0 -0
  59. /package/{skills → dist/bundled}/design/references/typeset.md +0 -0
  60. /package/{skills → dist/bundled}/design/references/voice.md +0 -0
  61. /package/{skills → dist/bundled}/design/references/writing.md +0 -0
@@ -0,0 +1,58 @@
1
+ <!-- GENERATED FILE — do not edit. Source: packages/docs/src/app/mods/page.mdx. Regenerate: pnpm generate:knowledge -->
2
+
3
+ # Verify a mod
4
+
5
+ A mod that fails to import, exports no factory, or throws in its factory becomes a **warning — never a crashed session**. That safety also means a broken mod can fail silently if you never check. This section is the verification loop: load it, list it, exercise it, reload it.
6
+
7
+ ## 1. Load it without installing
8
+
9
+ ```bash
10
+ cmd --mod ./your-mod.ts
11
+ ```
12
+
13
+ `--mod` is repeatable, loads ahead of installed mods, and wins name collisions — the fastest try-it loop. No build step: jiti compiles the TypeScript at load.
14
+
15
+ ## 2. Confirm it registered
16
+
17
+ ```bash
18
+ cmd mods list
19
+ ```
20
+
21
+ Your mod must appear, with no load warnings. If it does not appear, the warning printed by `cmd mods list` says why (import error, no default-export factory, factory threw, duplicate name).
22
+
23
+ ## 3. Exercise every surface it registers
24
+
25
+ - **Slash command** — type `/` in the chat input: the command must appear in autocomplete with its description. Run it; `{message}` renders an info row, `{prompt}` starts an automated turn.
26
+ - **Tool** — ask the model to use it by name ("call count_todos"). The tool call renders in the feed like any built-in.
27
+ - **Hook** — trigger the behavior it guards (for a `beforeToolCall` blocker, ask for the blocked action and watch the block reason land as the tool result).
28
+ - **Input interception** — type the pattern `transformInput` matches and confirm the rewrite/consume happened.
29
+ - **Status / widget** — the footer segment appears under the input panel; the widget renders around the editor.
30
+ - **Renderer** — `cmd.showEntry` rows render styled; an unregistered type pretty-prints as JSON.
31
+
32
+ ### Test: block-dangerous-commands guards rm -rf
33
+
34
+ ```text copy filename="Prompt"
35
+ Run rm -rf /tmp/scratch-dir
36
+ ```
37
+
38
+ Expected result:
39
+
40
+ - ✅ The mod's confirm dialog appears before the shell command runs
41
+ - ✅ Declining blocks the tool — the model sees the block reason and adapts
42
+ - ❌ No `tool_running` fires for the blocked call
43
+
44
+ ## 4. Iterate with /reload
45
+
46
+ Mods load once per process. After editing the file, run `/reload` — it restarts Command Code, resumes the session, and re-discovers and re-imports every mod (jiti caches nothing between loads).
47
+
48
+ ## 5. Headless check (CI)
49
+
50
+ ```bash
51
+ cmd -p "exercise the mod" --mod ./your-mod.ts
52
+ ```
53
+
54
+ Print mode loads user-scope and `--mod` mods with the UI bridge degraded to deterministic defaults (confirm → false, select/input → undefined; timed dialogs resolve `timeoutValue` immediately). A mod that must work in CI should behave sensibly under those defaults.
55
+
56
+ ## Working from the bundled examples
57
+
58
+ Command Code ships runnable single-file examples inside the bundled `mod-builder` skill — each one loads through the real mod loader in CI on every test run, so copying one is copying something proven to load. In the Command Code repo itself, the same validation is a vitest suite (`packages/harness/src/mod-host/__tests__/examples.test.ts`); if you are contributing an example, that test must stay green.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: skill-builder
3
+ description: Author a new Agent Skill for Command Code end to end — scaffold the directory, write valid SKILL.md frontmatter, structure the instructions for progressive disclosure, and verify the skill loads. Use when the user wants to create, build, or generate a skill, turn a repeated workflow, prompt, or set of scripts into a reusable skill, or fix a skill that fails validation.
4
+ ---
5
+
6
+ # Skill Builder
7
+
8
+ You are turning a workflow the user cares about into an Agent Skill: a directory with a
9
+ `SKILL.md` manifest that any agent implementing the Agent Skills standard
10
+ (https://agentskills.io/specification) can discover and load on demand. Follow the steps in
11
+ order; each produces something the next step consumes.
12
+
13
+ ## 1. Pin down the job
14
+
15
+ Before writing anything, get concrete answers to three questions — from the conversation if
16
+ they are already there, otherwise ask:
17
+
18
+ - **What does the skill do?** One capability per skill. If the user describes two loosely
19
+ related jobs (e.g. "release notes and versioning"), propose splitting them.
20
+ - **When should an agent reach for it?** The trigger phrases and task shapes. These become the
21
+ `description`, which is the only thing the model sees before deciding to load the skill.
22
+ - **What does it need?** Scripts, templates, reference documents, external tools. These decide
23
+ whether the skill is a single SKILL.md or needs supporting files.
24
+
25
+ ## 2. Choose name and location
26
+
27
+ Name rules (enforced at load time — a violation means the skill is skipped with a warning):
28
+
29
+ - 1–64 characters; only lowercase letters `a-z`, digits `0-9`, and hyphens
30
+ - No leading, trailing, or consecutive hyphens
31
+ - **Must equal the directory name** — `my-skill/SKILL.md` declares `name: my-skill`
32
+
33
+ Prefer a verb-or-domain name that survives out of context: `changelog-writer` beats `helper`.
34
+
35
+ Location decides who gets the skill:
36
+
37
+ | Location | Scope |
38
+ |----------|-------|
39
+ | `.commandcode/skills/<name>/` at the project root | everyone in this repo (commit it) |
40
+ | `~/.commandcode/skills/<name>/` | this user, every project |
41
+ | `.agents/skills/<name>/` or `~/.agents/skills/<name>/` | same scopes, shared with other Agent-Skills tools |
42
+
43
+ Default to the project location when the workflow is repo-specific, the user location when it is
44
+ personal habit. Skills may be grouped in subdirectories (e.g.
45
+ `.commandcode/skills/docs/changelog-writer/`) — discovery is recursive.
46
+
47
+ ## 3. Write the frontmatter
48
+
49
+ Required fields:
50
+
51
+ ```yaml
52
+ ---
53
+ name: changelog-writer
54
+ description: Draft changelog entries from merged PRs and commit history, grouped by change type. Use when the user asks for a changelog, release notes, or "what changed since <version>".
55
+ ---
56
+ ```
57
+
58
+ The `description` carries the whole discovery burden. Write it as *what it does* + *when to use
59
+ it*, with the words a user would actually say. Under 1024 characters; two sentences is usually
60
+ right. Avoid "helps with X" — name the verbs and the artifacts.
61
+
62
+ Optional fields, all standard-compliant:
63
+
64
+ - `license` — a license name or bundled file reference
65
+ - `compatibility` — only when the skill has real environment requirements (≤500 chars)
66
+ - `metadata` — a string-to-string map for anything else (author, version, …)
67
+ - `allowed-tools` — space-separated pre-approved tools (experimental across implementations)
68
+
69
+ Command Code also honors these extensions (other tools ignore them safely):
70
+
71
+ - `argument-hint` — shown in the slash menu, e.g. `argument-hint: "<branch> [--draft]"`
72
+ - `disable-model-invocation: true` — the model never sees or auto-loads the skill; only an
73
+ explicit `/name` invocation runs it. Use for destructive or highly contextual workflows.
74
+ - `model` — pin a model for the skill's work
75
+
76
+ ## 4. Write the body
77
+
78
+ The body is the instruction set the agent follows after activation. Structure it for an agent,
79
+ not a human reader: imperative steps, exact commands, decision rules for edge cases, and one
80
+ worked example beat prose paragraphs.
81
+
82
+ Budget for progressive disclosure — the three-tier loading model the standard defines:
83
+
84
+ 1. **Metadata** (name + description) is always in context. Spend it on triggers.
85
+ 2. **The SKILL.md body** loads on activation. Keep it under ~500 lines; if you are pasting long
86
+ reference material, move it out.
87
+ 3. **Supporting files** load only when the body points at them. Link with paths relative to the
88
+ skill directory: `references/format.md`, `scripts/collect.sh`.
89
+
90
+ Conventional (not required) subdirectories: `scripts/` for executable helpers, `references/` for
91
+ documentation the agent reads on demand, `assets/` for templates and static files. Positional
92
+ arguments from a slash invocation are available as `$ARGUMENTS` (all of them) or
93
+ `$ARGUMENTS[0]`, `$ARGUMENTS[1]`, … individually.
94
+
95
+ ## 5. Verify
96
+
97
+ 1. Re-read the frontmatter against the rules in step 2 — especially name ↔ directory match.
98
+ 2. Run `cmd skills list` (or open `/skills` in the TUI): the skill must appear with no warning.
99
+ A skipped skill shows up under its failure category — fix and re-check.
100
+ 3. Invoke it once with `/name` and confirm the agent follows the body as written. Trim anything
101
+ it did not need.
102
+
103
+ If the user will share the skill, remind them: skills are instructions plus executable code, so
104
+ consumers should review the content before trusting it.