check
The green gate: fixes lint (never suppresses), type-checks, runs affected tests then the full suite, builds like CI, replays CI locally and reads the branch's GitHub CI status read-only. Use when the user says "is it green?", "run the checks", "fix the lint", "will CI pass?", or after /build or /fix finishes and before /review-coach or /ship.
- License 许可
- MIT
- 所属仓库
- varun-singhh/lfg
- 最近更新
- 2026-10-26
- Stars
- ★ 10
- Forks
- 3
01 前言 Front Matter
- name
- check
- lanes
- [ "express", "standard", "full", "hotfix" ]
- phase
- prove
- reads
- [ "diff", "01-brief.md", "02-design.md", "tasks.json", "03-build-*.md" ]
- author
- Varun Singh
- writes
- [ "04-qa.md", "ready.json" ]
- preflight
- graphs
- description
- The green gate: fixes lint (never suppresses), type-checks, runs affected tests then the full suite, builds like CI, replays CI locally and reads the branch's GitHub CI status read-only. Use when the user says "is it green?", "run the checks", "fix the lint", "will CI pass?", or after /build or /fix finishes and before /review-coach or /ship.
- auto-trigger
- false
03 SKILL.md 正文
/check: get to green, honestly
Step 0: preflight
lfg graphs ensure. Non-zero exit: stop and show its output. Continue on a stale graph only if the user typed--allow-stale.lfg run path. Exit 1 (no current run):lfg run new check-<branch-slug>.lfg rule graph-firstand follow it for every lookup below.
Steps
- Scope the change.
detect_changes_toolon the working tree (uncommitted work included) → the changed nodes. Note the lane fromtasks.jsonorlfg lane --json. - Lint, fixed by hand. Run the repo's lint/format autofix command (from
~/.lfg/repos/<repo-id>/commands.json, else the repo's own scripts). Then fix every remaining error and warning in the touched files by editing the code. The fix is always in the code: the lint config, rule list and inline directives stay as they were. - Types. Run the repo's type-check command. Fix every error at its cause.
- Affected tests first. For each changed node:
query_graph_toolwithtests_for. Run just those tests for fast feedback. Changed nodes with no test → record as untested (gate 2) and tell the user; write the missing test if the seam is agreed intasks.json. - The gate.
lfg gate(one line per check, output only for failures; full logs inRUN/gate-logs/<check>.log, read one only if the shown lines aren't enough): lint, types, full suite, build, gitleaks, new-suppression check, from exit codes. It writesready.json. Read the per-check results from its output, never from memory. - Local CI replay.
lfg ci-local(use--listfirst if unsure what it will run). It also runsactionlinton the workflows. - Remote CI, read-only.
gh auth status(not logged in → ask the user to rungh auth loginthemselves; skip this step and say so). Then for the current branch:gh pr checks(if a PR exists),gh run list --branch <branch> --limit 5,gh run view <id> --log-failedfor any failed run. Summarise the failing step; fix it locally if the failure is in code this change touches.
- SonarQube (when
lfg sonar statusexits 0).lfg sonar scanin the worktree or checkout you are checking. Exit 1 means a bug, vulnerability or security hotspot, or a major-or-worse issue, sits on a line this branch changed: fix each at its cause and scan again (fix the code, never the Sonar config). If GitHub's SonarCloud check failed,lfg sonar cloudshows its own verdict; "analysis failed" there is SonarCloud's side, not your code, so say so instead of chasing it. - AI changes only (gate 6): run the eval suite; score ≥ baseline − tolerance and cost per call ≤ budget, from
02-design.md. - Loop. Any red check → fix the cause → re-run that check, then
lfg gateagain. Stop after 3 attempts on the same failure and report it with its output (suggest/fixfor a real bug). - QA matrix. Map every acceptance criterion in
01-brief.md(and each ticket'sverificationintasks.json) to the test(s) that prove it. A criterion with no test fails gate 3 (Express: docs-only criteria are waived, say so).
Done when: lfg gate exits 0 in this run, lfg ci-local exits 0, every criterion maps to a passing test, and 04-qa.md is written. Otherwise: done when the report below says exactly what is still red.
Output
04-qa.md in the run folder:
# QA: <run-id>
Lane: <lane> · Gate: green|red (ready.json) · CI replay: green|red · Remote CI: <state or "not checked: reason">
| # | Acceptance criterion | Test(s) (file::name) | Result |
|---|---|---|---|
## Checks run
| Check | Command | Exit | Notes (fixes made, attempts) |
## Untested changed nodes
## Still red (with output excerpt)
Reply to the user with: gate status per check, what you fixed, anything still red, untested nodes, and the next skill (/secure or /review-coach; /fix if stuck).
Rules
- A run filed under another repo (this repo's tasks live in another repo's run, e.g.
/lfgresumed that repo's handoff): write this repo's results as04-qa-<repo>.mdandready-<repo>.json, with<repo>the repo's folder name (e.g.aegis-compliance-portal), never over the run's own files. The dashboard shows them under this repo, and the owner repo keeps its own. - A failing test is never skipped, deleted or weakened. If a test looks wrong, say so and ask.
- New
eslint-disable,# noqa,@ts-ignore,#[allow],.skip(,xit(or@pytest.mark.skipin the diff fails the gate; remove it and fix the code. ghis read-only here:auth status,pr checks/view,run list/view. Seelfg rule git-guard.- Report only what ran. A skipped step is named with its reason.
- Leave all changes unstaged.
04 同仓库更多 Skills
wizard
Guided start-to-finish run of the whole pipeline on an idea or a Linear issue. Runs every stage (grill, plan, build, check, secure, pentest, review, ship check, ship packet, learn), explains each one in plain words before and after, and loops failures through /fix until all 8 gates are green (max 3 loops per gate). Use when the user types "/wizard <idea>", "/wizard LIN-123", "/wizard resume", "walk me through everything", "do every step and explain it". Explicit only; never auto-triggered.
why
Explains why code looks the way it does: the commits that shaped a file, a function or a few lines, what each one changed and why, and the issues, tickets and pull requests they mention. Use when the user asks "why is this here?", "why was this changed?", "who added this and what for?", "what's the story behind X?", or is about to change code they don't understand.
which
Looks at graph status, the current run folder, git status and Linear, then tells you the single next skill to run and why. Use when the user says "which skill do I use?", "what now?", "what next?", "where was I?", "I'm lost", or starts a session without saying what they want.
suggest-tests
Suggest tests you should write based on your code. Uses AST parsing to find functions and suggests tests based on code patterns. Use when writing new code or modifying existing code.
spike
Builds a throwaway prototype to answer one design question, in a scratch folder inside the run folder, then deletes it and keeps only the conclusion. Use when the user says "try a quick prototype", "would this approach work?", "spike this", "let me feel this state model", "show me a few UI options", or when a plan has an open question that a cheap working artifact would settle.
ship
Proves the change is shippable and hands it to you: re-runs the green gate, runs the ship check (Docker build, scan, run, smoke test, delete, verify cleanup) and the shipping checklist, then writes COMMIT_MSG.md and PR_BODY.md. Never commits, pushes or deploys. Use when the user says "ship it", "ready for a PR", "prep the commit", "is it shippable?".