Files

1.7 KiB

1. Permission Error Helper

  • 1.1 Create cmd/errors.go with friendlyAPIError(err error, operation string, permissionHint string) error function
  • 1.2 Handle 401 (auth failed), 403 (permission denied with optional hint), 404 (not found / no access), and passthrough for non-API errors and unknown status codes

2. Client Methods

  • 2.1 Add CreateProject(ctx, fields) (*model.Project, error) to client/projects.go — POST /api/projects
  • 2.2 Add DeleteProject(ctx, id) error to client/projects.go — DELETE /api/projects/{id}
  • 2.3 Add CreateBoard(ctx, projectId, fields) (*model.Board, error) to client/boards.go — POST /api/projects/{projectId}/boards
  • 2.4 Add DeleteBoard(ctx, id) error to client/boards.go — DELETE /api/boards/{id}

3. Project Commands

  • 3.1 Add projectCreateCmd to cmd/project.go with --name (required), --type (required, values: public/private), and --description (optional) flags
  • 3.2 Add projectDeleteCmd to cmd/project.go accepting a positional project ID argument
  • 3.3 Wire both commands with friendlyAPIError — create uses empty hint, delete uses "requires project manager role"

4. Board Commands

  • 4.1 Add boardCreateCmd to cmd/board.go with --project (required), --name (required), and --position (optional, default 65536) flags
  • 4.2 Add boardDeleteCmd to cmd/board.go accepting a positional board ID argument
  • 4.3 Wire both commands with friendlyAPIError using "requires project manager role" hint

5. Verification

  • 5.1 Run go build to verify compilation
  • 5.2 Run existing test suite (test.sh) to verify no regressions