CLI-first project workflow for solo builders using GitHub issues + postflight artifacts.
One-liner: vibe-backlog turns issue context, git state, and postflight artifacts into one repeatable development loop.
This project has two usage modes:
- Canonical and reproducible commands (recommended for agents):
pnpm build && node dist/cli.cjs ... - Convenience commands (for shorter typing): global
vibeviapnpm link --global+hash -r
Do not rely only on the global bin path. Always keep the canonical path available.
Fastest path to first success in another repo:
# in vibe-backlog repo
pnpm install
pnpm build
pnpm link --global
hash -r
# in your target repo
cd /path/to/another-repo
vibe init --dry-run
vibe init
vibe preflight
vibe postflight --apply --dry-runinit now skips tracker bootstrap by default. If you want to create tracker taxonomy immediately, run:
vibe init --bootstrap-trackerFor phased sharing (pilot -> beta -> social) and copy/paste launch messages, see SHARE.md.
pnpm -v
gh auth status
git --version# 1) create folder and git
mkdir my-project && cd my-project
git init -b main
# 2) minimal gitignore
cat > .gitignore <<'EOF'
node_modules
dist
.DS_Store
*.log
.vibe/runtime
.vibe/artifacts
EOF
# 3) first commit
git add .
git commit -m "chore: init"
# 4) create private remote and push
git remote -v
# if empty:
gh repo create <NAME> --private --source=. --remote=origin --pushThis is for developing vibe-backlog from source.
# inside vibe-backlog repo
pnpm install
pnpm test
pnpm build
# option A (recommended for agents / reproducible)
node dist/cli.cjs --help
# option B (convenience: global "vibe" command)
pnpm link --global
hash -r
vibe --helpcd /path/to/another-repo
# one-time setup for agent-first workflow
vibe init --dry-run
vibe init
# optional: create tracker labels/milestones immediately
# vibe init --bootstrap-tracker
# compatibility alias (same default behavior):
# vibe init --skip-tracker
# now these commands are valid
vibe preflight
vibe self update --check
vibe update --check
vibe postflight
vibe postflight --apply --dry-runIf you want to avoid global bin drift, run from the vibe-backlog repo path:
node /path/to/vibe-backlog/dist/cli.cjs preflight# 0) one-time setup in this repo
vibe init --dry-run
vibe init
# 1) inspect repo + issue state
vibe preflight
vibe status
vibe review --dry-run
# 2) set the real active issue id before apply
# Edit .vibe/artifacts/postflight.json and replace:
# "issue_id": "1"
# with your real issue number, for example:
# "issue_id": "42"
# 3) validate artifact
vibe postflight
# 4) preview tracker updates first
vibe postflight --apply --dry-run
# 5) apply for real
vibe postflight --apply
# optional: skip automatic local branch cleanup
# vibe postflight --apply --skip-branch-cleanuppreflight now prints a security snapshot (policy, gitleaks availability, last scan), a hint when .vibe exists but tracker bootstrap marker is missing, and read-only semantic milestone suggestions for issues without milestone.
preflight also performs a best-effort, non-blocking tool version check and prints an explicit self update command when a newer vibe-backlog release is available.
update checks/applies .vibe scaffold updates with metadata tracking in .vibe/scaffold.json, dry-run diff preview, and marker-safe preservation of protected sections.
init scaffolds local .vibe files and skips tracker bootstrap by default; use --bootstrap-tracker to opt in tracker GH operations during init.
init/update also scaffold a managed README workflow section (<!-- vibe:workflow-docs:start --> ... <!-- vibe:workflow-docs:end -->) with a Mermaid diagram, preserving non-managed README content.
update --json includes readme_workflow_status with one of: created (workflow block created, including first insertion into an existing README), updated (existing managed block refreshed), unchanged (already up-to-date), repaired (malformed markers were repaired).
status shows active turn, in-progress issues, hygiene warnings, and branch PR snapshot.
ui serve boots a local cockpit shell with workspace project selector + baseline branch/turn/issue cards (node dist/cli.cjs ui serve --workspace <path>). Non-loopback hosts require explicit --allow-remote.
turn start --issue <n> now auto-creates .vibe/reviews/<n>/ templates (implementation, security, quality, ux, ops) when missing.
turn start --issue <n> now enforces a remote-state guard (git fetch origin, git status -sb, git branch -vv, PR state check on current branch) and blocks branch creation on behind/diverged or closed/merged-PR branch states with explicit remediation commands.
postflight --apply now runs automatic local branch cleanup for upstream gone branches (safe delete for merged, force delete for patch-equivalent, non-merged require explicit manual confirmation). Use --skip-branch-cleanup to bypass it.
branch cleanup provides explicit cleanup control, including dry-run planning and guarded force path for non-merged branches.
security scan runs gitleaks in staged, working-tree, or history mode with configurable warn|fail policy (.vibe/contract.yml by default).
review runs the 5 role passes via external agent command, retries up to --max-attempts, publishes one final PR report, and can auto-create/update a single follow-up issue per source issue when unresolved findings remain. In non-dry-run mode, when unresolved findings reach 0, it auto-closes open follow-up issues for that source marker; close failures are reported as warnings and do not fail the run. Summary counters (Findings observed, Unresolved findings, Resolved findings) use lifecycle totals from vibe-managed PR review threads plus current-run findings.
pr open creates/reuses an open PR for the issue, injects deterministic architecture/rationale sections plus Fixes #<issue>, and enforces a review gate by HEAD marker (unless explicitly skipped).
pr ready validates final merge-readiness (OPEN, non-draft, mergeStateStatus=CLEAN, remote head sync, review marker) and prints non-destructive remediation for stale/desync states.
tracker reconcile fills missing module:* labels and milestone metadata using semantic signals (title/body/module history); when no existing milestone matches strongly, it can plan/create a repo-specific delivery milestone.
This repo supports LLM-driven development. The file AGENTS.md is the agent contract:
- Issue-first (one topic = one issue)
- Mandatory preflight -> work -> postflight
- Append-only (never overwrite user notes)
- Multi-pass reviews (Security/Quality/UX/Ops)
LLMs (Codex, Claude, etc.) must read and follow AGENTS.md before making changes.
- Vulnerability reporting policy:
SECURITY.md - CI log/artifact hardening policy:
.github/CI_SECURITY.md
Publish posture (current):
- npm publish is disabled for now; this repository is not released as a package yet.
package.jsonis intentionally set to"private": trueto prevent accidental publish.package.jsonuses"license": "MIT"to matchLICENSE.
Default gitleaks policy for repos using .vibe:
vibe initscaffolds.vibe/contract.ymlwithsecurity.gitleaks.policy: warn.warnkeeps scans visible but non-blocking while setup is still in progress.vibedoes not auto-install gitleaks on user machines; installation is explicit (local toolchain and/or CI).
Manual checklist for sharing this repo with sebas / juli / fer (GitHub Admin):
- Go to
Settings -> Collaborators and teams. - Invite
sebas,juli, andfer. - Set role
Adminfor each collaborator. - Confirm each invite is accepted and access works.
- Record completion in the active issue/postflight comment for audit trail.
Use these for deterministic execution:
pnpm build
node dist/cli.cjs preflight
node dist/cli.cjs self update --check
node dist/cli.cjs self update --dry-run
node dist/cli.cjs update --check
node dist/cli.cjs update --dry-run
node dist/cli.cjs update
node dist/cli.cjs status
node dist/cli.cjs security scan --dry-run
node dist/cli.cjs security scan --mode staged
node dist/cli.cjs security scan --mode history --policy fail
node dist/cli.cjs branch cleanup --dry-run
node dist/cli.cjs branch cleanup
node dist/cli.cjs branch cleanup --force-unmerged --yes
node dist/cli.cjs review --dry-run
node dist/cli.cjs review threads resolve --pr <n> --all-unresolved --dry-run
node dist/cli.cjs review threads resolve --pr <n> --thread-id <id>
node dist/cli.cjs pr open --dry-run --issue <n> --branch <name>
node dist/cli.cjs pr open --force-review --issue <n> --branch <name>
node dist/cli.cjs pr ready --pr <n> --wait-seconds 30
node dist/cli.cjs pr ready --branch <name> --refresh --wait-seconds 30
node dist/cli.cjs init --dry-run
node dist/cli.cjs init
node dist/cli.cjs init --bootstrap-tracker
node dist/cli.cjs tracker bootstrap --dry-run
node dist/cli.cjs tracker bootstrap
node dist/cli.cjs tracker reconcile --dry-run
node dist/cli.cjs tracker reconcile --fallback-module module:core --fallback-milestone "<milestone>"
node dist/cli.cjs ui serve --workspace /path/to/projects
node dist/cli.cjs postflight
node dist/cli.cjs postflight --apply --dry-run
node dist/cli.cjs postflight --apply
node dist/cli.cjs postflight --apply --skip-branch-cleanupvibe branch cleanup [options]Options:
--dry-run: plan cleanup without deleting local branches.--base <name>: override base ref for merged/patch-equivalent checks (default:origin/HEAD, fallbackmain).--force-unmerged: allow deleting non-merged branches (requires confirmation).--yes: confirmation required when using--force-unmerged.--no-fetch-prune: skipgit fetch --prune originbefore branch detection.
Policy:
- Candidate pool: local branches with
upstream gone. - Protected branches: current branch,
main, and resolved base branch. - Deletion mode:
- merged into base ->
git branch -d - patch-equivalent ->
git branch -D - merged PR with matching head SHA ->
git branch -D(safepr-mergedpath)
- merged into base ->
- If multiple merged PR rows exist for the same branch name, cleanup matches any row whose
headRefOidequals local branch HEAD. - GitHub PR lookup is retried with timeout; on persistent lookup failure, cleanup warns and keeps branch in guarded non-merged flow.
- non-merged -> skipped unless
--force-unmerged --yes
vibe security scan [options]Options:
--mode <staged|working-tree|history>: scan scope (defaultstaged).--policy <warn|fail>: override policy for current run.--dry-run: print resolved command/policy without running gitleaks.
Policy resolution:
--policyflag (if provided).vibe/contract.yml->security.gitleaks.policy- default
warn
Behavior:
warn: findings/missing gitleaks are reported but do not fail command.fail: findings/missing gitleaks fail command (exit code1).- Last scan summary is stored at
.vibe/runtime/security-scan.jsonforpreflightvisibility.
Portability note:
- The CLI security scan is intended for any repo using
.vibe+vibe. - This repository includes CI wiring for gitleaks;
vibe initdoes not scaffold that workflow yet.
CI setup/troubleshooting (gitleaks workflow):
- Symptom: GitHub Actions run fails with
startup_failureandNo jobs were run. - Root cause: repository Actions policy blocks non-owner actions, so the workflow is rejected before job startup.
- This workflow requires these external actions:
actions/checkout@v4pnpm/action-setup@v4actions/setup-node@v4
- Safer restricted option (recommended): in GitHub
Settings -> Actions -> General, keep restricted policy and add the exact actions above to the allow list. - Simple fallback: set Actions permissions to allow all actions and reusable workflows.
- Verification: rerun the
gitleaksworkflow and confirm jobsecurity-scanstarts (notNo jobs were run) and reachesRun vibe security scan (fail policy).
vibe tracker reconcile [options]Options:
--dry-run: build and print reconcile plan only.--fallback-module <name>: module label/name to use when module inference is uncertain.--fallback-milestone <title>: milestone title to use when milestone inference is uncertain.
Behavior:
- Default mode applies updates (
gh issue edit) to open issues with missingmodule:*or milestone. - If milestone affinity is low, reconcile generates a delivery-goal milestone title (
<Area>: <Objective>) and creates it before issue assignment. preflightremains read-only; milestone creation happens only in write flows (e.g. reconcile/apply flows).- Reconcile never removes/replaces existing module labels or milestone; it only fills missing metadata.
vibe review [options]Options:
--issue <n>: issue override (highest priority).--agent-provider <auto|codex|claude|gemini|command>: provider selection (defaultauto).--agent-cmd "<cmd>": explicit external command (highest priority). Fallback:VIBE_REVIEW_AGENT_CMD.--dry-run: run planning path without mutating git/GitHub.--no-autofix: disable agent autofix mode.--no-autopush: disable final auto commit/push.--no-publish: skip PR summary/review/inline publication.--max-attempts <n>: max retry attempts (default5).--compute-class <L1-fast|L2-standard|L3-deep|L4-critical>: policy preset for agent invocation retry resilience + conservative pruning.--strict: exit non-zero when unresolved findings remain after final attempt.--followup-label bug|enhancement: override follow-up issue label.--rationale-signals-json: print machine-readable rationale signal extraction details (profile,modules,fallback_reasons).- Output contract: JSON includes
schema_version: 1for compatibility checks.
- Output contract: JSON includes
Compute class notes:
--compute-classdoes not change--max-attempts(findings/autofix loop).- It controls retry resilience for agent invocation failures (timeouts/transient provider errors) inside a single review attempt.
- It can activate conservative
docs-onlypruning; output still includes all 6 passes, and pruned passes are emitted asskipped by policy. - Defaults:
vibe reviewmanual:L3-deepvibe pr openauto-review gate:L2-standard
Issue/base context resolution (without requiring an active turn):
--issue <n>(if provided)- valid active turn
- branch inference:
issue-<n>-...<feat|fix|chore|docs|refactor|test>/<n>-...
- open PR body autoclose references (
Fixes #<n>,Closes #<n>,Resolves #<n>)
If issue resolution still fails, command exits with remediation to provide --issue <n>.
Follow-up issue behavior:
- Unresolved findings after final attempt (
max-attempts) create/update a single follow-up issue. - All issue creation flows in
vibeusegh issue create --body-file(never inline--body) to preserve markdown formatting. - Non-dry-run with unresolved findings
0attempts to auto-close open follow-up issues for the same source marker. - Auto-close failures are emitted in the review summary warnings and do not abort
vibe review. - Review prompt treats
.vibe/reviews/<issue>/*.mdand.vibe/artifacts/postflight.jsonas expected generated artifacts (not unplanned changes by themselves).
Postflight review metrics:
review_metrics.phase_timings_ms: latest per-phase elapsed/status snapshot for the run.review_metrics.phase_timings_delta_ms: delta in milliseconds vs previous persisted snapshot (null when no previous snapshot exists).review_metrics.phase_timings_ms_history: bounded snapshot history (latest 20 entries) to compare trend changes within/after review runs.
Provider resolution (highest priority first):
--agent-cmdVIBE_REVIEW_AGENT_CMD--agent-providerforced mode (codex|claude|gemini|command)--agent-provider auto(default):- persisted provider in
.vibe/runtime/review-agent-provider.json - current host detection
- available provider binaries/env overrides (
codex > claude > gemini)
- persisted provider in
Provider-specific env overrides:
VIBE_REVIEW_CODEX_CMDVIBE_REVIEW_CLAUDE_CMDVIBE_REVIEW_GEMINI_CMD
Codex same-session behavior:
- If
CODEX_THREAD_IDexists,vibe reviewfirst triescodex exec resume <thread_id>. - If resume fails or returns invalid JSON, it falls back to external non-interactive Codex execution.
- This is best-effort only; resume unavailability does not fail the run by itself.
Review policy marker:
- Review summary comments embed a
v2policy marker that includes core review flags pluscompute_classandpass_profile. pr open/pr readypreserve legacy marker compatibility and can ignorepass_profiledifferences for gate dedupe in the MVP.
vibe pr open [options]Options:
--issue <n>: issue override.--branch <name>: branch override.--base <name>: base branch override.--dry-run: print PR payload plan only.--rationale-signals-json: print machine-readable rationale signal extraction details (profile,modules,fallback_reasons).- Output contract: JSON includes
schema_version: 1for compatibility checks.
- Output contract: JSON includes
--skip-review-gate: bypass review gate and publish an auditable PR comment marker.--force-review: force review rerun even when existing gate markers satisfy the current HEAD.
Review gate behavior:
- Default
pr openenforces review execution for the target PR branchHEAD(resolved from--branch/turn/current branch). - Dedupe is marker-based on PR comments:
<!-- vibe:review-summary -->+<!-- vibe:review-head:<sha> -->(+ optional<!-- vibe:review-policy:<key> -->). - Progressive compatibility:
- legacy summary comments without policy marker still satisfy gate for matching HEAD.
- if policy marker exists,
pr openrequiresHEAD + policymatch.
- If marker is missing,
pr openauto-runsvibe review(L2-standard profile, non-strict). - If
--force-reviewis set,pr openrerunsvibe revieweven when gate markers already match. - For non-dry-run gate execution, target branch must be checked out before auto-review can run.
- If
--skip-review-gateis set, no auto-review runs; PR receives<!-- vibe:review-gate-skipped -->. --skip-review-gateand--force-revieware mutually exclusive.- If
pr opencreates a PR and auto-review fails, the PR remains open and command exits with error.
vibe pr ready [options]Options:
--pr <n>: PR number override.--branch <name>: branch override when resolving open PR without--pr.--refresh: rungit fetch originbefore readiness checks.--wait-seconds <n>: wait/poll window formergeStateStatus=UNKNOWN(default0).
Behavior:
- Resolves exactly one open PR target (
--prexplicit or by branch lookup). - Requires:
- PR
state=OPEN - PR
isDraft=false mergeStateStatus=CLEANgit ls-remote --heads origin <headRefName>equals PRheadRefOid- review gate marker exists for current HEAD + policy key
- PR
- On stale/unknown/desync failures, prints deterministic remediation:
node dist/cli.cjs pr ready --pr <n> --refresh --wait-seconds 30
- On success, prints freeze guidance before merge:
- do not run
vibe review,vibe pr open, or push new commits.
- do not run
vibe review threads resolve [options]Options:
--pr <n>: PR number override. If omitted, resolve against the open PR for the current branch.--thread-id <id>: target thread id (repeatable). Single-target mode.--all-unresolved: batch mode for all unresolved threads on the target PR (including outdated threads).--body <text>: optional manual reply body (overrides auto-generated detailed body).--dry-run: show plan without replying/resolving.
Rules:
- Exactly one targeting mode is required:
--thread-id(one or more) or--all-unresolved. - In apply mode, each selected thread gets:
- reply comment (
addPullRequestReviewThreadReply) - resolve mutation (
resolveReviewThread)
- reply comment (
- Auto-body (when
--bodyis not provided) includes: PR, HEAD, thread id, outdated status, location, finding title/severity/pass and fingerprint when available.
This section is managed by vibe init / vibe update.
flowchart LR
A["preflight"] --> B["pick issue"]
B --> C["implement + tests"]
C --> D["postflight"]
D --> E{"apply updates?"}
E -- "dry-run" --> F["postflight --apply --dry-run"]
E -- "yes" --> G["postflight --apply"]
G --> H["tracker synced"]
Workflow steps (text fallback):
- Run
vibe preflight. - Pick one issue and keep scope focused.
- Implement and run tests/build.
- Validate
vibe postflight. - Preview tracker changes with
vibe postflight --apply --dry-run. - Apply tracker updates with
vibe postflight --apply.