Skip to content

Commit ef2abb5

Browse files
update add command skill
1 parent 536017d commit ef2abb5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

.claude/skills/add-command/SKILL.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Create `internal/<package>/<name>.go` (use an existing package if it fits, or cr
6161

6262
In `cmd/root.go`, add the new command to `root.AddCommand(...)`.
6363

64-
If the command constructor needs dependencies (like `*env.Env` or `*telemetry.Client`), add them as parameters matching the existing pattern.
64+
If the command constructor needs dependencies (like `*env.Env`), add them as parameters matching the existing pattern.
6565

6666
## Step 4: Add new event types (if needed)
6767

@@ -96,9 +96,7 @@ Create `test/integration/<name>_test.go` with:
9696

9797
## Telemetry
9898

99-
Every new command must emit an `lstk_command` telemetry event. Wrap the command's `RunE` with `commandWithTelemetry(name, tel, fn)` — this handles timing, exit code, and error message automatically.
100-
101-
Start and stop are exceptions: they emit `lstk_lifecycle` events in addition to `lstk_command`, so they manage their own telemetry manually instead of using `commandWithTelemetry`.
99+
`lstk_command` telemetry is emitted automatically for every command via `instrumentCommands` in `cmd/root.go` — no per-command wiring needed. Do NOT pass `*telemetry.Client` to a new command constructor unless the command emits additional lifecycle events (like `lstk_lifecycle` for start/stop/restart) or needs to update the auth token (like login).
102100

103101
In the corresponding integration test, add an assertion that the `lstk_command` event was emitted.
104102

0 commit comments

Comments
 (0)