Skip to main content

lx-tooling

Tag: Org and orchestration · CLI: lx · PyPI: lx-tooling

lx-tooling is the Labinetix engineering workflow CLI for humans and AI agents. It orchestrates the GitHub issue → branch → pull request → release loop and checks repository policy, without owning domain logic or company strategy.

What this repository is

Labinetix's company strategy, durable architecture, and cross-repo design decisions live in ../.VAULT/. This repository implements the engineering workflow toolstack that consumes those rules. The operating model rests on a few ideas:

  • GitHub is the durable coordination layer. Issues are the backlog and the development memory; PRs are the review record; releases are the shipped product.
  • Issues are strictly typed and related natively. Work is classified with GitHub issue types and connected with sub-issues and blocked-by/blocking dependencies (GitHub Issues 2.0), not ad-hoc labels or free text.
  • Local Cursor agents do the implementation, driving git/gh; a cloud coding agent is an optional secondary lane for small chores.
  • CI is the merge gate. Leaf implementation PRs auto-merge on green CI (ADR-0013); humans own product judgment, stable-release authorization (ADR-0014), and deployment.

lx-tooling is the front-end that makes the correct path the easy path. It wraps git, gh, repository metadata, and Labinetix policy so that humans and agents run one consistent, dry-run-first, JSON-emitting command instead of remembering every rule. It does not replace git, gh, CI, GitHub review, or branch protection — those stay authoritative.

Non-goals: model semantics, ABI/schema ownership, runtime algorithms, protocol implementations, build logic (lx-toolchains), deployment (lx-deploy), or hardware validation (lx-testbench).

Strategy boundary: .VAULT owns company strategy and generalized architecture. lx-tooling owns scoped, tested engineering workflow commands. See docs/design/adr-0001-lx-tooling-policy-boundary.md.

How lx relates to gh and git

Think of three layers:

Layer Owns Examples
git Local source history branches, commits, diffs
gh / GitHub API GitHub transport and platform primitives issues, issue types, sub-issues, dependencies, PRs, CI, releases, GraphQL
lx Labinetix policy + orchestration on top readiness checks, branch-prefix-from-type, PR body generation, release preflight, the derived issue graph

Guiding rule: lx consumes native gh primitives and adds Labinetix interpretation. It does not re-implement anything gh already does well. Before a feature is added to lx, we check whether gh ... --json already covers it.

Workflow ↔ command map

Legend: ✅ shipped in lx 1.0 (stability surface) · 🔜 planned post-1.0 · 🟦 use gh/git directly (native command already covers it precisely; lx will not wrap it)

Workflow step lx command Wraps / consumes Status
Orient in a repository lx repo inspect [--json] filesystem + gh repo view
List AFK-ready leaf issues lx issue list --ready gh api graphql (derived readiness)
Filter backlog by label lx issue list --label area:<name> gh issue list --label
Read one issue + readiness hints (label-state + body-section) lx issue view <n> gh issue view
Bundle issue metadata + comments lx issue context <n> [--json] gh issue view + relationships + comments
Read whole backlog as a graph lx issue graph [--include-recent-closed] [--json] gh api graphql (types, sub-issues, deps) + optional closed slice
Create a typed issue from a template lx issue create <type> gh issue create --type ... 🔜
Reconcile stale issues (knowledge-base hygiene) lx issue audit [--json] [--yes] gh api graphql + optional gh issue comment
Set issue type / parent / dependency gh issue edit --type / --add-sub-issue / --add-blocked-by 🟦 native, precise
Comment lifecycle notes on an issue gh issue comment 🟦
Start a branch from an issue (type-aware prefix + git preflight) lx issue start <n> --yes --comment git checkout -b + gh issue comment
Pre-PR policy check lx workflow check reads git/files; supports workflow --repo-root PATH check
Run local checks matching CI lx workflow run-checks configured cmd (just check) 🔜 (run just check now)
Generate a PR body lx pr prepare builds body, infers Closes #n
Create the PR lx pr prepare --yes gh pr create; supports pr --repo-root PATH prepare --yes
Edit PR body before creating lx pr prepare --body-file gh pr create --body-file 🔜
Inspect PR CI checks lx pr checks gh pr checks 🟦 gh pr checks is excellent
Read PR review comments / CI logs lx pr feedback gh pr view --comments, gh run view 🟦 use gh directly
Plan a release lx release plan gh tags + CI status + git
Validate release readiness lx release create <v> validation only
Draft release notes from merged PRs lx release notes draft <v> gh pr list --search
Summarize contract lockfile changes across git refs lx contract changelog <from>..<to> git show + lockfile diff ✅ 1.1.0
Create tag / GitHub Release / publish git tag, gh release create 🟦 intentionally manual + human approval
Delegate a small issue to a cloud agent lx issue delegate <n> assign issue to agent (API) 🔜 (see #83)

In short: lx ships the policy-heavy orchestration (readiness, branch start, PR body, release preflight); gh keeps the precise platform operations (relationship edits, CI inspection, releases); and the 🔜 rows are where lx still adds value on top of gh.

Reading the whole backlog: the issue graph

Both you and an agent need to see the entire issue knowledge base at any moment. GitHub Issues 2.0 stores issue types, sub-issues, and blocked-by/blocking dependencies natively, and a single GraphQL query returns the whole open backlog with those relationships in one round-trip (measured: 63 issues in ~1.5s, no pagination under 100). No background-synced database is needed.

Load the derived graph (recommended — from a clone use uv run lx until lx-tooling is installed globally):

uv run lx issue graph
uv run lx issue graph --json > issue-graph.json
uv run lx issue graph --include-recent-closed --since 90d --json

lx issue graph runs the live GraphQL query and adds the derived view GitHub does not give for free: ready-vs-blocked ordering, dependency-cycle detection, roots/leaves, per-issue created_at/updated_at timestamps, and an agent-friendly denormalized shape. With --include-recent-closed, it also merges a recent closed slice (PR-seeded closures plus a time window) for familiarization — use lx issue context <n> for full comment bodies on specific closed threads.

Inspect native relationship coverage:

jq '.summary | {open: .open_count, typed: .typed_count, parented: .parented_count, deps: .with_dependencies_count, ready: (.ready | length), blocked: (.blocked | length), leaves: (.leaves | length)}' issue-graph.json

The graph is structure only — fetch full comment bodies on candidate issues with lx issue context <n> --json (preferred) or gh issue view <n> --json …,comments. Human gh issue view <n> --comments is a quick preview only; the terminal renderer may truncate long closure comments. For backlog curation, use the lx-backlog-groom skill.

Set relationships natively (these are 🟦 gh, not lx):

gh issue edit <n> --type "Feature"
gh issue edit <epic> --add-sub-issue <child1>,<child2>
gh issue edit <n> --add-blocked-by <blocker>

Keeping the issue knowledge base current

Because issues are the durable memory, they must stay honest. When the workflow or manifests change, some open issues go stale: already shipped, superseded by a native gh feature, duplicate titles for the same scope, or no longer matching the workflow. Stale issues mislead both humans and agents and make the graph meaningless.

Before creating issues: search open titles first (gh issue list --search "in:title …") so maintainer and agent do not open the same scope twice in one session. See AGENTS.md § Backlog and readiness.

The fix is a recurring reconciliation pass. Start with the dry-run audit:

uv run lx issue audit
uv run lx issue audit --json

lx issue audit loads the graph, fetches issue bodies by default, and flags deterministic hygiene findings: closed blockers, deprecated pre-1.0 labels, hold on epics, duplicate titles, and raw/thin bodies. It never closes issues and does not edit labels or native edges. With --yes, it posts the generated Reconciliation comments only:

uv run lx issue audit --yes

For deeper curation, give Cursor an instruction such as:

Load issue-graph.json. For every open issue, judge it against the current repository state, the shipped lx surface (lx --help), latest docs/release-notes/v*.md, and the workflow model in ../.VAULT/MANIFEST.md. Flag issues that are (a) already implemented, (b) superseded by a native gh feature such as issue types / sub-issues / dependencies, or (c) inconsistent with the updated workflow. For each, propose: comment, relabel, set a dependency, or close as superseded. Do not close anything silently — leave a Reconciliation comment first. For a full autonomous pass, use the lx-backlog-groom skill and commit the session report under docs/reports/.

For each stale issue, the agent (or you) leaves a comment and relabels — never a silent close:

# Mark an issue as superseded by a native GitHub feature, with rationale
gh issue comment <n> --body "Re-triage: the relationship modelling planned here is now native (GitHub Issues 2.0 dependencies/sub-issues, exposed via gh + GraphQL). See ../.VAULT/MANIFEST.md. Recommend closing as superseded; remaining policy value tracked in #<m>."

# Opt out of the AFK queue until a human confirms
gh issue edit <n> --add-label "hold:design"

# Only after human confirmation:
gh issue close <n> --reason "not planned" --comment "Superseded by native GitHub issue dependencies. Tracked in #<m>."

lx issue audit automates the load + heuristic flagging (contradictory labels, duplicate titles, raw/thin bodies, stale blockers) and can emit suggested Reconciliation comments with --yes — but closing issues stays a human decision.

Quickstart

Prerequisites:

  • Python 3.11+
  • uv
  • gh v2.94.0+ (native issue types/sub-issues/dependencies), authenticated with gh auth login

Local development:

git clone git@github.com:labinetix/lx-tooling.git
cd lx-tooling
uv sync --all-groups
uv run lx --version

Local checks (same as CI):

just check

Or explicitly:

uv sync --all-groups
uv run ruff check .
uv run ruff format --check .
uv run pytest

Working across repositories

Work-repo commands resolve the git checkout and GitHub repository from the process cwd by default. That breaks when you run lx from a different clone — for example uv run --directory lx-tooling lx issue start 42 while scoped to .VAULT targets lx-tooling#42.

Prefer one of:

# Install lx on PATH, then work from the target repo
cd ../.VAULT && lx issue start 42 --yes --comment

# Or pass the target checkout explicitly (group flags before the subcommand)
cd lx-tooling
uv run lx issue --repo-root ../.VAULT start 42 --yes --comment
uv run lx workflow --repo-root ../.VAULT check
uv run lx pr --repo-root ../.VAULT prepare --yes
uv run lx issue --repo-url https://github.com/labinetix/.VAULT view 42

--repo-root sets the local git root for branch creation, workflow checks, PR preparation, and metadata. --repo-url pins gh -R owner/name (git operations still need a matching local clone or --repo-root). Without override, lx issue view / context / start warn when the fetched issue URL disagrees with the resolved checkout.

Optional .labinetix/repo.toml:

[github]
repository = "labinetix/.VAULT"

Install

uv tool install lx-tooling
lx --version

Upgrade:

uv tool upgrade lx-tooling

Command reference (1.0 stability surface + 1.1 additions)

Frozen 1.0 command/flag contract: docs/design/cli-stability-1.0.md. 1.1.0 adds lx contract changelog (minor release per SemVer policy).

# Orient
lx repo inspect
lx repo inspect --json

# Discover work
lx issue graph
lx issue graph --json
lx issue graph --include-recent-closed --since 90d --json
lx issue audit
lx issue audit --json
lx issue list --ready
lx issue list --label area:workflow
lx issue view 123
lx issue context 123
lx issue context 123 --json

# Start work (dry-run unless --yes; branch prefix inferred from issue type + git preflight)
lx issue start 123
lx issue start 123 --yes --comment
lx issue --repo-root ../other-repo start 123 --yes --comment

# Verify before a PR
just check
lx workflow check
lx workflow --repo-root ../other-repo check

# Open a PR (dry-run unless --yes)
lx pr prepare
lx pr prepare --yes
lx pr --repo-root ../other-repo prepare --yes

# Plan / validate a release (never tags or publishes)
lx release plan
lx release create 0.8.0
lx release create 0.8.0 --yes
lx release notes draft 0.8.0

# Contract changelog (1.1.0+)
lx contract changelog main..HEAD
lx contract --repo-root ../lx-interface changelog v1.0.0..HEAD --json
lx release notes draft 0.8.0 --yes

Examples:

Development loop with lx

The intended day-to-day loop in any Labinetix repository. lx wraps git/gh; risky steps stay behind --yes.

flowchart LR
  graph["lx issue graph"]
  view["lx issue view"]
  start["lx issue start --yes"]
  work["code + tests + docs"]
  check["just check + lx workflow check"]
  pr["lx pr prepare --yes"]
  merge["auto-merge on green CI"]
  release["release plan + human-authorized tag"]
  graph --> view --> start --> work --> check --> pr --> merge --> release
  1. See the backlog. Load the issue graph and pick a ready, scoped issue. Fetch full comment bodies on candidates with lx issue context <n> --json — the graph is structure only; human gh issue view --comments may truncate. Skills (lx-skills catalog): lx-backlog-groom (curation → docs/reports/), lx-release-planning (release horizon), lx-feature-implementation (unbiased pick + implement, incl. release-plan and follow-up lanes), lx-release-prepare (compile notes + tag).

  2. Confirm scope. lx issue context 123 --json (or lx issue context 123). Set/verify native type, parent, and dependencies with gh issue edit; explain the rationale in a Plan comment.

  3. Start the branch. From an up-to-date main:

    git checkout main && git pull
    lx issue start 123 --yes --comment
    # When cwd is not the work repo: lx issue --repo-root <path> start 123 --yes --comment
    
  4. Implement one coherent slice — code, tests, docs, examples together; reference the issue (feat(cli): ... (#123)).

  5. Verify. just check then lx workflow check.

  6. Open the PR.

    git push -u origin HEAD
    lx pr prepare          # preview body
    lx pr prepare --yes    # gh pr create with Closes #123
    
  7. Merge on green CI. Leaf PRs auto-merge once required checks pass (ADR-0013); the issue closes on merge via the closing keyword. The stable release tag/publish stays human-authorized (ADR-0014).

  8. Close the loop on the issue. Post an after-merge comment with what users can do now, verification, release impact, suggested next issues, and any workflow observations. See docs/examples/issue-closure-comment.md.

Kind Issue type Branch prefix Typical release
Feature Feature feat/ minor 0.y.0
Bugfix Bug fix/ patch 0.y.z
Docs only Docs/Task docs/ patch or none
CI/tooling Task ci/ patch

Releases and release notes

  • Latest release: GitHub Releases
  • Artifacts: wheel + sdist built by CI on protected SemVer tags (v*), published to PyPI via trusted publishing (pypi.yml, environment pypi).

Store release notes in the repository (docs/release-notes/vX.Y.Z.md) drafted from merged PRs and the issues they closed. See docs/release-notes/README.md. 1.2.0 improves release-command ergonomics: PEP 440 pre-releases (1.0.0rc1) and cross-repo title resolution in lx release notes draft. Release planning (what should ship): lx-release-planning. Release preparation (compile notes + tag after merge): lx-release-prepare. Maintainer flow:

  1. Merge feature/fix PRs to main; keep CI green.

  2. Bump version in pyproject.toml and src/lx_tooling/__init__.py; add docs/release-notes/vX.Y.Z.md.

  3. Merge to main, then tag and push:

    git tag -a v0.8.0 -m "Release v0.8.0"
    git push origin v0.8.0
    
  4. Confirm the PyPI workflow succeeded; verify uv tool install lx-tooling picks up the new version.

Design and agent rules

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lx_tooling-1.3.0.tar.gz (175.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lx_tooling-1.3.0-py3-none-any.whl (85.2 kB view details)

Uploaded Python 3

File details

Details for the file lx_tooling-1.3.0.tar.gz.

File metadata

  • Download URL: lx_tooling-1.3.0.tar.gz
  • Upload date:
  • Size: 175.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lx_tooling-1.3.0.tar.gz
Algorithm Hash digest
SHA256 a3788bb6f9d9992a568179c7acfc11fcb41a4f5d76bdcb149df9718e86c73255
MD5 c8f5d996cd673ef2c089f9be1cd16fb7
BLAKE2b-256 bf7fa29bf903c4cd3c537c31d827a71581415b2a96b87999780b0e4fec5129b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lx_tooling-1.3.0.tar.gz:

Publisher: pypi.yml on labinetix/lx-tooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lx_tooling-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: lx_tooling-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 85.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lx_tooling-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a69b9ceb0b97027c1ffb5ca75f55dd12fa77026e0b08f8b32d03397a59ec499f
MD5 7e95e556f39169ea66e4f02b064b8501
BLAKE2b-256 c81a6ac5f0e803344dd29a3fda4a925135a321ce3d053286373c65e6096c98aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for lx_tooling-1.3.0-py3-none-any.whl:

Publisher: pypi.yml on labinetix/lx-tooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.8.1

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.1

2 files

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page