Files
kb/openspec/changes/archive/2026-03-31-structured-add-commands/tasks.md
T
steve afbe270181 Replace implicit note shorthand with explicit addnote command and split README
Two changes:

1. structured-add-commands: The implicit note shorthand (kb "text") caused
   accidental note creation from mistyped commands. Replaced with explicit
   kb addnote <text> command. Root command reverts to standard Cobra
   behaviour. Updated examples, tests, SKILL.md, and specs.

2. split-readme-developer-docs: Moved build-from-source instructions, release
   process, API reference, and ROCm migration notes from README.md into a
   new DEVELOPER.md. README now links to DEVELOPER.md for dev workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:48:22 +01:00

30 lines
1.6 KiB
Markdown

## 1. Create addnote command
- [x] 1.1 Create `client/cmd/addnote.go` with `addnoteCmd` using `ExactArgs(1)`, `--tags` flag, and `RunE` calling `submitNote()`
- [x] 1.2 Move `submitNote()` function from `client/cmd/add.go` to `client/cmd/addnote.go`
## 2. Revert root command to standard Cobra behaviour
- [x] 2.1 Remove `ArbitraryArgs`, custom `RunE` logic, and `--tags` flag from root command in `client/cmd/root.go`
- [x] 2.2 Remove custom usage template and `isRootCmd` template function — let Cobra use its default template
- [x] 2.3 Set root command to show help when called with no args (standard Cobra `RunE` returning `cmd.Help()` or nil)
## 3. Update examples and help text
- [x] 3.1 Update `client/cmd/examples.go` to show `kb addnote` syntax instead of `kb "text"` shorthand
- [x] 3.2 Update root command `Long` description to remove reference to note shorthand
## 4. Update tests
- [x] 4.1 Remove implicit note shorthand tests from `client/cmd/root_test.go` (`TestRootCmd_SingleWordRejected`, `TestRootCmd_MultipleWordsNotRejected`)
- [x] 4.2 Add test for `addnote` command (verify it wires up correctly, takes exactly one arg)
- [x] 4.3 Add test that root command with unknown args returns an error (standard Cobra behaviour)
- [x] 4.4 Verify `addfile` tests still pass (no changes expected)
## 5. Build and verify
- [x] 5.1 Run `go build` and verify all commands appear in `kb --help`
- [x] 5.2 Run `go test ./...` and verify all tests pass
- [x] 5.3 Verify `kb addnote --help` shows correct usage line and flags
- [x] 5.4 Verify `kb addfile --help` is unchanged