add-ynd-commandlisted
Install: claude install-skill eyelock/ynh
# Add a `ynd` command
`ynd` is half the product — 13 commands against `ynh`'s 31 — and it had no
authoring guide while `add-vendor-adapter` covered the other half.
Work the checklist in order. Each step is a place a command has actually been
shipped incomplete.
## Before you start
Read an existing command of the same shape rather than starting from a blank
file. `cmd/ynd/compose.go` is the best model: it parses flags by hand, resolves
its source from flag then env then positional, and supports `--format
text|json` with a split renderer.
## 1. Decide the shape
| Shape | Model to copy | Notes |
|---|---|---|
| Reads a harness, prints a report | `compose.go` | source resolution + `--format` |
| Reads a harness, writes files | `preview.go`, `export.go` | needs `-o` and a destination guard |
| Operates on loose files | `lint.go`, `fmt.go` | takes multiple positional paths |
| Interactive | `inspect.go`, `compress.go` | needs prompt indirection — see step 6 |
**Destructive commands have their own rules.** If the command deletes or
overwrites anything, read `.claude/rules/destructive-operations.md` first. It is
written from an incident and it is not optional.
## 2. Dispatch
`cmd/ynd/main.go` — add a `case` to the switch:
```go
case "mycommand":
err = cmdMyCommand(os.Args[2:])
```
Keep it alphabetical only if the neighbours are; match the file, do not
reorganise it in the same change.
## 3. The command function, in two parts
Split it so the output is testable without