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

1.6 KiB

1. Create addnote command

  • 1.1 Create client/cmd/addnote.go with addnoteCmd using ExactArgs(1), --tags flag, and RunE calling submitNote()
  • 1.2 Move submitNote() function from client/cmd/add.go to client/cmd/addnote.go

2. Revert root command to standard Cobra behaviour

  • 2.1 Remove ArbitraryArgs, custom RunE logic, and --tags flag from root command in client/cmd/root.go
  • 2.2 Remove custom usage template and isRootCmd template function — let Cobra use its default template
  • 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

  • 3.1 Update client/cmd/examples.go to show kb addnote syntax instead of kb "text" shorthand
  • 3.2 Update root command Long description to remove reference to note shorthand

4. Update tests

  • 4.1 Remove implicit note shorthand tests from client/cmd/root_test.go (TestRootCmd_SingleWordRejected, TestRootCmd_MultipleWordsNotRejected)
  • 4.2 Add test for addnote command (verify it wires up correctly, takes exactly one arg)
  • 4.3 Add test that root command with unknown args returns an error (standard Cobra behaviour)
  • 4.4 Verify addfile tests still pass (no changes expected)

5. Build and verify

  • 5.1 Run go build and verify all commands appear in kb --help
  • 5.2 Run go test ./... and verify all tests pass
  • 5.3 Verify kb addnote --help shows correct usage line and flags
  • 5.4 Verify kb addfile --help is unchanged