From e29616d30f8e5ff39bdb39486dba66e59a6941e6 Mon Sep 17 00:00:00 2001 From: Ansho Rei Date: Fri, 15 May 2026 00:45:19 +0200 Subject: [PATCH] The ls subcommand now shows created_at before uuid --- .opencode/skill/kanban-skill/SKILL.md | 180 ------------------ .../skill/worklane-kanban-skill/SKILL.md | 73 +++++++ src/main.rs | 22 ++- 3 files changed, 91 insertions(+), 184 deletions(-) delete mode 100644 .opencode/skill/kanban-skill/SKILL.md create mode 100644 .opencode/skill/worklane-kanban-skill/SKILL.md diff --git a/.opencode/skill/kanban-skill/SKILL.md b/.opencode/skill/kanban-skill/SKILL.md deleted file mode 100644 index 1de08ba..0000000 --- a/.opencode/skill/kanban-skill/SKILL.md +++ /dev/null @@ -1,180 +0,0 @@ ---- -id: worklane_kanban -name: worklane_kanban -version: 1.0.0 -description: > - Creates Kanban-style tickets in Worklane using the `worklane add` CLI command. - Supports listing tickets with `worklane ls`. Both commands support title, description, - acceptance criteria, implementation plan, tags, due date, owner assignment, and status filtering. -rendering: - strategy: cli_args - join_arrays_with: "," - omit_empty: true ---- - -## Outline of the command: - -```yaml -command: worklane add -parameters: - title: - type: string - required: true - cli_flag: "--title" - description: - type: string - required: false - cli_flag: "--description" - acceptance: - type: array - required: false - description: "List of acceptance criteria" - cli_flag: "--acceptance" - format: csv - plan: - type: array - required: false - description: "Step-by-step implementation plan" - cli_flag: "--plan" - format: csv - tags: - type: array - required: false - cli_flag: "--tags" - format: csv - due: - type: string - required: false - description: "Due date in YYYY-MM-DD format" - cli_flag: "--due" - owner: - type: string - required: false - cli_flag: "--owner" - ---- - -command: worklane ls -parameters: - status: - type: string - required: false - description: "Filter by status (backlog, committed, reviewing, done)" -``` - -Example adding a ticket: -```yaml -input: - title: "Implement login API" - description: "Add JWT-based authentication" - acceptance: - - "User can log in with email/password" - - "JWT is returned on success" - plan: - - "Create auth controller" - - "Add JWT middleware" - - "Write tests" - tags: ["backend", "auth"] - due: "2026-06-01" - owner: "alice" -output: > - worklane add --title "Implement login API" - --description "Add JWT-based authentication" - --acceptance "User can log in with email/password,JWT is returned on success" - --plan "Create auth controller,Add JWT middleware,Write tests" - --tags "backend,auth" - --due "2026-06-01" - --owner "alice" -``` - -Example listing tickets: -```yaml -input: - status: "backlog" -output: > - worklane ls backlog -``` - -Example listing all tickets (no filter): -```yaml -input: {} -output: > - worklane ls -``` - -## Agent Guidance (IMPORTANT — read before generating tickets) - -When creating a Worklane ticket, the agent MUST: - -### 1. Title quality - -* Keep it short, action-oriented, and outcome-focused -* Prefer verbs: “Implement”, “Fix”, “Add”, “Refactor”, “Improve” -* Avoid vague titles like “Update system” or “Fix bug” -* If possible, specify the subsystem (API, UI, backend, auth, etc.) - -### 2. Description quality - -* Explain *what* is being built and *why it matters* -* Include context or user impact (not implementation details) -* Keep it 2–4 sentences max unless complexity requires more -* Avoid duplicating acceptance criteria or implementation steps - -### 3. Acceptance criteria quality - -* Must be **testable and verifiable** -* Each item should describe a *visible or measurable outcome* -* Use “Given / When / Then” style only if helpful—otherwise keep simple -* Avoid implementation details (no file names, no internal architecture) -* Each criterion should represent one atomic expectation - -#### Good example: - -* User can log in with valid credentials -* Invalid credentials return a 401 error -* Session persists across page refresh - -#### Bad example: - -* Implement JWT middleware in auth service ❌ (implementation detail) -* Add login function ❌ (too vague) - -### 4. Implementation plan quality - -* Must be a **step-by-step engineering checklist** -* Ordered logically from setup → implementation → testing → cleanup -* Each step should be actionable (start with a verb) -* Include testing and validation steps explicitly -* Avoid high-level or vague steps like “build feature” - -#### Good example: - -* Create authentication controller -* Add JWT token generation service -* Integrate middleware into protected routes -* Write unit tests for auth flows -* Add integration tests for login endpoint - -### 5. General rules - -* Prefer clarity over completeness -* Do not repeat information across fields -* Ensure consistency between description, acceptance criteria, and plan -* If unsure, choose simpler and more testable phrasing - -## Using `worklane ls` - -The `worklane ls` command lists tickets. Use it to check the state of tickets: - -* `worklane ls` — lists all tickets grouped by status without filtering -* `worklane ls ` — filters tickets by status - -Valid statuses: `backlog`, `committed`, `reviewing`, `done` - -### Usage patterns - -When checking ticket status or filtering work, use `worklane ls` rather than reading from file paths directly. This ensures consistent access to ticket data. - -Example patterns: -* Check backlog items: `worklane ls backlog` -* View all tickets: `worklane ls` diff --git a/.opencode/skill/worklane-kanban-skill/SKILL.md b/.opencode/skill/worklane-kanban-skill/SKILL.md new file mode 100644 index 0000000..621cb9f --- /dev/null +++ b/.opencode/skill/worklane-kanban-skill/SKILL.md @@ -0,0 +1,73 @@ +--- +id: worklane_kanban +name: worklane_kanban +version: 1.0.0 +description: > + Creates Kanban-style tickets in Worklane using the `worklane add` CLI command. + Supports listing tickets with `worklane ls`. Both commands support title, description, + acceptance criteria, implementation plan, tags, due date, owner assignment, and status filtering. +rendering: + strategy: cli_args + join_arrays_with: "," + omit_empty: true +--- + +# Worklane Kanban Skill + +Use this skill when creating, listing, or managing Kanban-style tickets via the `worklane` CLI. + +## Commands + +### `worklane init` + +Initialize worklane in the current project (creates the worklane data file if it doesn't exist). + +``` +worklane init +``` + +### `worklane add` + +Add a new ticket to the backlog. + +**Required:** +- `--title` (or `-t`): Ticket title + +**Optional:** +- `--description` (or `-d`): Ticket description +- `--acceptance` (or `-a`): Acceptance criteria (comma-separated values) +- `--plan` (or `-p`): Implementation plan steps (comma-separated) +- `--tags` (or `-g`): Tags (comma-separated) +- `--due` (or `--due`): Due date in YYYY-MM-DD format +- `--owner` (or `-o`): Owner name + +``` +worklane add -t "Implement login" -d "Add user login page" -t login,auth -p "Design UI" "Build backend" "Write tests" --due 2026-06-01 --owner "ilya" +``` + +### `worklane ls` + +List tickets, optionally filtered by status. + +**Valid statuses:** `backlog`, `committed`, `reviewing`, `done` + +``` +worklane ls # List all tickets +worklane ls backlog # List tickets in backlog +worklane ls done # List completed tickets +``` + +### `worklane show` + +Show the full details of a single ticket by UUID or title. + +``` +worklane show "ticket title or uuid" +``` + +## Workflow + +1. Run `worklane init` before using other commands (if not already done) +2. Use `worklane add` to create tickets with all relevant details +3. Use `worklane ls [status]` to view tickets by status +4. Use `worklane show ` to view full ticket details diff --git a/src/main.rs b/src/main.rs index 5e05c21..cb3f352 100644 --- a/src/main.rs +++ b/src/main.rs @@ -123,7 +123,11 @@ fn cmd_ls(status_filter: &Option, worklane_dir: &Path) -> Result<()> { let owner = parse_ticket_field(&content, "Owner"); let due = parse_ticket_field(&content, "Due"); let filename = e.path().file_stem()?.to_string_lossy().to_string(); - let uuid_short = if filename.len() > 7 { &filename[..7] } else { &filename }; + let uuid_short = if filename.len() > 7 { + &filename[..7] + } else { + &filename + }; let created_at = parse_ticket_field(&content, "Created At"); let short_date = format_created_at(&created_at); @@ -138,7 +142,10 @@ fn cmd_ls(status_filter: &Option, worklane_dir: &Path) -> Result<()> { if ts.is_empty() { println!(" ({}) {} | Owner: {} | Due: {}", uuid, title, owner, due); } else { - println!(" ({}:{}) {} | Owner: {} | Due: {}", uuid, ts, title, owner, due); + println!( + " {} ({}) {} | Owner: {} | Due: {}", + ts, uuid, title, owner, due + ); } } } else { @@ -179,7 +186,11 @@ fn cmd_ls(status_filter: &Option, worklane_dir: &Path) -> Result<()> { let owner = parse_ticket_field(&content, "Owner"); let due = parse_ticket_field(&content, "Due"); let filename = e.path().file_stem()?.to_string_lossy().to_string(); - let uuid_short = if filename.len() > 7 { &filename[..7] } else { &filename }; + let uuid_short = if filename.len() > 7 { + &filename[..7] + } else { + &filename + }; let created_at = parse_ticket_field(&content, "Created At"); let short_date = format_created_at(&created_at); @@ -192,7 +203,10 @@ fn cmd_ls(status_filter: &Option, worklane_dir: &Path) -> Result<()> { if ts.is_empty() { println!(" ({}) {} | Owner: {} | Due: {}", uuid, title, owner, due); } else { - println!(" ({}:{}) {} | Owner: {} | Due: {}", uuid, ts, title, owner, due); + println!( + " {} ({}) {} | Owner: {} | Due: {}", + ts, uuid, title, owner, due + ); } } }