Skip to content

Commit 7951e25

Browse files
author
Your Name
committed
refactoring
1 parent a90d1c5 commit 7951e25

1 file changed

Lines changed: 217 additions & 0 deletions

File tree

docs/llx-tools.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ llx-tools ai-tools shell
2929

3030
# Start VS Code
3131
llx-tools vscode start
32+
33+
# --- Plan & Workflow (new) ---
34+
35+
# Run planfile strategy with pre-flight validation
36+
llx plan run .
37+
38+
# Check ticket freshness before running
39+
llx plan validate .
40+
41+
# Clean resolved / canceled tickets
42+
llx plan clean .
43+
44+
# Run a workflow pipeline defined in llx.yaml
45+
llx run
3246
```
3347

3448
## 🛠️ Available Commands
@@ -427,6 +441,209 @@ llx-tools models profile qwen2.5-coder:7b
427441
llx-tools models load-profile coding
428442
```
429443

444+
## 🗂️ Plan & Workflow Management
445+
446+
### `llx plan run` — Execute Strategy Tickets
447+
448+
Runs tickets from a `planfile.yaml` strategy, with optional pre-flight freshness validation and stale-ticket pruning.
449+
450+
```bash
451+
# Default run (markdown output, pre-flight ON, cancel stale ON)
452+
llx plan run .
453+
454+
# Dry-run with YAML output
455+
llx plan run . --dry-run --format yaml
456+
457+
# Skip pre-flight validation
458+
llx plan run . --no-validate
459+
460+
# Mark stale as canceled but do not delete them
461+
llx plan run . --cancel-stale --no-prune-stale
462+
463+
# Physically delete stale tickets before execution
464+
llx plan run . --prune-stale --backup
465+
466+
# Limit tickets processed
467+
llx plan run . --max-tasks 10
468+
```
469+
470+
**Pre-flight behaviour** (default `--validate`):
471+
1. `prefact` scans the codebase.
472+
2. Tickets whose anchored file/line no longer match are flagged `stale`.
473+
3. By default `--cancel-stale` marks them `canceled` in `planfile.yaml`.
474+
4. If `--prune-stale` is passed, they are physically removed (with `.bak.<ts>` backup).
475+
5. Stale tickets are skipped from LLM execution.
476+
477+
**Output formats:**
478+
- `markdown` (default) — human-readable summary + compact YAML payload in fenced code block. Long fields such as `response` are truncated to ~240 chars; use `--format yaml` for full data.
479+
- `yaml` — raw structured payload on STDOUT.
480+
481+
### `llx plan validate` — Ticket Freshness Check
482+
483+
Standalone pre-flight without executing LLM tasks.
484+
485+
```bash
486+
# Markdown report
487+
llx plan validate .
488+
489+
# YAML report, fail if stale tickets found
490+
llx plan validate . --format yaml --fail-on-stale
491+
492+
# Also prune stale and unknown tickets
493+
llx plan validate . --prune-stale --prune-unknown --backup
494+
```
495+
496+
### `llx plan clean` — Remove Resolved Tickets
497+
498+
Physically deletes tickets with selected statuses from `planfile.yaml` and strips corresponding lines from `TODO.md`.
499+
500+
```bash
501+
# Remove canceled tickets (default)
502+
llx plan clean .
503+
504+
# Also remove done tickets
505+
llx plan clean . --include-done
506+
507+
# Dry-run to preview changes
508+
llx plan clean . --dry-run
509+
510+
# Skip TODO.md sync
511+
llx plan clean . --no-todo-sync
512+
```
513+
514+
### `llx plan testql` — TestQL Scenario Bridge
515+
516+
Validates a TestQL scenario, generates tickets for failures, and syncs them to TODO.md and configured integrations.
517+
518+
```bash
519+
llx plan testql testql-scenarios/api-smoke.testql.toon.yaml
520+
```
521+
522+
See [TESTQL_INTEGRATION.md](TESTQL_INTEGRATION.md) for full details.
523+
524+
### `llx run [WORKFLOW]` — Workflow Engine
525+
526+
Executes ordered step pipelines defined in `llx.yaml`.
527+
528+
```bash
529+
# Run default workflow
530+
llx run
531+
532+
# List available workflows
533+
llx run --list
534+
535+
# Run a specific workflow with YAML report
536+
llx run ci-pipeline --format yaml
537+
538+
# Fail fast (stop on first failed step)
539+
llx run deploy --fail-fast
540+
```
541+
542+
**Built-in step kinds:**
543+
- `prefact-scan` — source-code scan.
544+
- `plan-validate` — ticket freshness check (supports `cancel_stale`, `fail_on_stale`).
545+
- `plan-run` — execute strategy (auto-inherits stale IDs from previous validate step).
546+
- `testql` — run TestQL validation and ticket sync.
547+
- `shell` — arbitrary subprocess.
548+
- `python` — dynamic import + function call (`module:function` + kwargs).
549+
550+
**Env substitution:** step parameters support `${VAR}` and `${VAR:-default}`.
551+
552+
---
553+
554+
## 🔄 Status & Integration Mapping
555+
556+
### TaskResult → TicketStatus
557+
558+
When an LLM task finishes, its execution result is mapped to a planfile ticket lifecycle status:
559+
560+
| TaskResult | TicketStatus | Meaning |
561+
|------------|--------------|---------|
562+
| `success` | `done` | Code changes applied and validated |
563+
| `no_changes` | `canceled` | Issue not found or already fixed; ticket obsolete |
564+
| `failed` | `blocked` | LLM or tool error; requires human review |
565+
| `already_fixed` | `done` | Detected pre-existing fix |
566+
| `not_found` | `canceled` | Target file/function missing |
567+
| `invalid` / `dry_run` / `skipped` | `open` | Retained for next iteration |
568+
569+
### Priority Mapping
570+
571+
Generic planfile priorities are translated per backend:
572+
573+
| planfile | GitHub label | GitLab label | Jira |
574+
|----------|--------------|--------------|------|
575+
| `critical` | `priority-critical` | `priority::critical` | `Highest` |
576+
| `high` | `priority-high` | `priority::high` | `High` |
577+
| `normal` | `priority-normal` | `priority::normal` | `Medium` |
578+
| `low` | `priority-low` | `priority::low` | `Low` |
579+
580+
### Ticket Sources
581+
582+
Every ticket carries a `TicketSource` block showing its origin:
583+
584+
| `tool` | Description |
585+
|--------|-------------|
586+
| `code2llm` | Auto-generated from codebase analysis |
587+
| `vallm` | Generated by validation LLM |
588+
| `llx` | Generated by `llx plan` execution or workflows |
589+
| `human` | Manually created |
590+
591+
---
592+
593+
## 🔗 External Integrations
594+
595+
Tickets can be bidirectionally synced with GitHub Issues, GitLab Issues, and Jira.
596+
597+
### GitHub
598+
599+
```bash
600+
# planfile.yaml snippet
601+
integration: ["github"]
602+
sync:
603+
github:
604+
issue: 142
605+
url: "https://github.com/owner/repo/issues/142"
606+
```
607+
608+
- Status `open`/`closed` maps directly to GitHub issue state.
609+
- Intermediate states (`review`, `blocked`, `canceled`) use labels (`status:review`, etc.).
610+
- Priority becomes `priority-{value}` label.
611+
- Auto-created labels: `planfile`, `managed`.
612+
613+
### GitLab
614+
615+
```bash
616+
# planfile.yaml snippet
617+
integration: ["gitlab"]
618+
sync:
619+
gitlab:
620+
iid: 45
621+
url: "https://gitlab.com/owner/project/-/issues/45"
622+
```
623+
624+
- Uses GitLab-native labels; priority mapped to `priority::{value}`.
625+
- Metadata appended as Markdown section in issue description.
626+
627+
### Jira
628+
629+
```bash
630+
# planfile.yaml snippet
631+
integration: ["jira"]
632+
sync:
633+
jira:
634+
key: "PROJ-123"
635+
url: "https://jira.example.com/browse/PROJ-123"
636+
```
637+
638+
- Jira transitions mapped from planfile status.
639+
- Priority mapped to Jira standard levels (`Highest``Lowest`).
640+
641+
### Identity-Aware Sync
642+
643+
When syncing, the system attempts **update-first** by integration reference (`id`, URL, or key) before creating a new remote ticket. Resolved references are written back into `ticket.sync` and `ticket.external_refs` to prevent duplicates.
644+
645+
---
646+
430647
## 🔍 Troubleshooting
431648

432649
### Common Issues

0 commit comments

Comments
 (0)