47 lines
2.5 KiB
Markdown
47 lines
2.5 KiB
Markdown
# AGENTS.md
|
|
|
|
## Project Structure
|
|
- `src/main.rs` - All application logic (init, add, ls, show, mv commands)
|
|
- `src/command.rs` - CLI argument definitions using clap derive
|
|
- `tests/` - Integration tests using `assert_cmd` and `assert_fs`
|
|
- Ticket files stored as `.md` in `.worklane/<status>/` directories
|
|
|
|
## Commands
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `worklane init` | Creates `.worklane/` with backlog, committed, reviewing, done directories |
|
|
| `worklane add` | Creates a ticket in backlog with `--title`, `--description`, `--acceptance`, `--plan`, `--tags`, `--due`, `--owner` flags |
|
|
| `worklane ls` | Lists tickets, optionally filtered by `--status` |
|
|
| `worklane show <id>` | Shows ticket by UUID prefix or title |
|
|
| `worklane mv <id> --status <target> [-f]` | Moves ticket between statuses. Default: forward only, one stage at a time. `-f` bypasses both restrictions |
|
|
| `worklane comment <ticket> <body>` | Adds a comment to a ticket by UUID or title |
|
|
|
|
## Ticket File Format
|
|
Filenames: `<uuid_v4>_<slug>.md`
|
|
Metadata fields parsed: `ID`, `Tags`, `Due`, `Owner`, `Created At`, `Status`
|
|
|
|
## Status Workflow
|
|
`backlog` -> `committed` -> `reviewing` -> `done`
|
|
|
|
## Testing
|
|
Run: `cargo test`
|
|
|
|
Tests create temporary `.worklane` directories with all four status folders pre-created via `setup_worklane()`. Ticket helper `create_ticket()` writes fully-formed markdown files directly.
|
|
|
|
## Key Implementation Notes
|
|
- No database or index - tickets resolved by scanning all status directories
|
|
- `resolve_ticket()` matches by UUID prefix (8+ chars), title substring, or filename substring
|
|
- Ambiguous searches (multiple matches) exit with list of options
|
|
- Ticket metadata uses `**Field**:` format for parsing
|
|
- Color output uses ANSI escape codes in `content_trim_colored()`
|
|
|
|
## Agent workflow
|
|
|
|
- When working on a ticket use `worklane show [ticketID]` to read the ticket.
|
|
- If the ticket status says backlog, move it to committed using `worklane mv --status committed [ticketID]`.
|
|
- Use `worklane comment [ticketID] "[body]"` to leave notes on tickets (e.g. "LGTM", "needs fixes", "blocked on X")
|
|
- Use git to commit your changes. The commit message should follow the format: `([ticketID]) [short description of changes]`
|
|
- If further changes are made later, use --fixup to commit them
|
|
- When your changes meet the acceptance criteria and the code compiles, move the ticket to reviewing using `worklane mv --status reviewing [ticketID]`
|
|
- When the ticket is approved, move it to done using `worklane mv --status done [ticketID]`
|