SkillAtlasSkill 详情

implx

The firewall between AI coding agents and your codebase.

审核状态:已审核Quality 80Security 88

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月4日

VibeGuard

CI

The firewall between AI coding agents and your codebase.

Native rules + real-time hooks + static guards that stop Claude Code and Codex CLI from shipping hallucinated, duplicated, or unverified changes — before they land.

VibeGuard demo

git clone https://github.com/majiayu000/vibeguard.git ~/vibeguard
bash ~/vibeguard/setup.sh --yes
bash ~/vibeguard/setup.sh verify-install

Open a new Claude Code or Codex session after install — protection is active from the first prompt. On supported macOS/Linux targets the production install/check/clean path is Python-free and uses a checksum-verified prebuilt runtime binary. Python still supports evals, docs generation, developer tools, and optional language-specific guard packs. Full install details live in Installation and Quickstart.

What it intercepts:

  • Duplicate files and reinvented modules
  • Invented APIs, fake libraries, and hardcoded placeholder values
  • Dangerous shell/git operations (rm -rf dangerous paths, git clean -f, non-fast-forward pushes)
  • Audited cleanup for intentional local discards, with exact path plans and confirmation gates
  • Analysis paralysis and unverified "I'm done" claims
  • Silent exception swallowing and Any-type abuse
  • AI-slop patterns flagged on every commit

Every interception returns a fix instruction, not just a failure — so the agent can self-correct.

Chinese Docs · Quickstart · Team Rollout · Troubleshooting · Rule Reference · Contributing

Start Here

PathUse it whenStart with
QuickstartYou want one local install, one health check, and one real intercepted demodocs/how/quickstart.md
Team rolloutYou need profiles, CI policy, rollout expectations, or project bootstrap guidancedocs/how/team-rollout.md
TroubleshootingSetup/check/status output is stale, degraded, broken, or confusingdocs/how/troubleshooting.md

First 5 minutes

These commands prove the install is active before changing another project; expected outputs are documented in Quickstart:

bash ~/vibeguard/setup.sh doctor
bash ~/vibeguard/setup.sh verify-install
bash ~/vibeguard/scripts/doctors/codex-doctor.sh
bash ~/vibeguard/setup.sh demo safe-bash
bash ~/vibeguard/scripts/hook-health.sh 24

To protect another repository after VibeGuard is installed:

bash ~/vibeguard/scripts/project-init.sh /path/to/project

Current status

The current mainline is install-verified on macOS, full-CI verified on Ubuntu and macOS, and smoke-contract verified on Windows.

  • Latest release train: v1.1.x; unreleased main may pin the next runtime version before its release tag exists
  • Health checks: bash setup.sh doctor (interactive, alias --check) and bash setup.sh verify-install (CI gate); expected verdict is HEALTHY
  • Hook latency is a product contract: CI tracks a Hook Latency (P95) report against per-hook budgets — see Hook Latency Contract

What you actually get

LayerWhat it does
Native RulesBias the model away from bad decisions before it acts
HooksBlock dangerous or low-quality actions in real time
Static GuardsScan projects for AI-slop, duplicates, and structural issues
Slash Commands/vibeguard:* workflows for preflight / review / check / learn
Learning SystemTurn repeated AI mistakes into reusable defenses
ObservabilityMetrics and health for every interception

Coverage boundary: hooks and guards provide mechanical enforcement for the covered surfaces below. The full rule set is broader; severity labels and workflow rules also guide review, planning, and verification, and do not imply that every rule is hook-blocked.

Product Boundaries

VibeGuard has two layers:

SurfaceScopeCanonical Source
VibeGuard CoreRules, hooks, static guards, install/runtime contract, observabilityrules/claude-rules/, schemas/install-modules.json, hooks/, guards/
VibeGuard WorkflowsSlash commands, agent prompts, planning/execution presetsskills/, workflows/, agents/

If these surfaces disagree, treat the Core contract as authoritative first, then update workflow/docs surfaces to match it.

For repository layout ownership, see Directory Map.

What it looks like in practice

Real Codex hook output:

Codex L1 duplicate path interception

You:  "Add a login endpoint"

AI:   → tries to create auth_service.py
      ⚠ VibeGuard warns or blocks — new source files require search first

      → tries to import `flask-auth-magic`
      ⚠ VibeGuard rules/review contract — verify external libraries before adding

      → hardcodes JWT secret as "your-secret-key"
      ⚠ VibeGuard security rule — use env var or secret manager

      → runs `git push --force`
      ✗ VibeGuard git pre-push hook denies — history rewrites require explicit human approval

      → runs `git clean -fd`
      ✗ VibeGuard denies — points to an authorized discard workflow with an exact deletion plan

      → keeps reading files without acting
      ⚠ VibeGuard escalates — force a concrete next step or report blocker

      → claims done without verifying
      ⚠ VibeGuard gates — run build/test before finishing

Re-record your own demo: see docs/assets/README.md (one command via asciinema + agg).

Who this is for

Use VibeGuard if you:

  • Use Claude Code or Codex regularly
  • Have seen duplicate files, fake APIs, over-engineering, or unverified "done" claims
  • Want mechanical enforcement for high-risk hook/guard surfaces, plus explicit rule and workflow contracts for cases that are not mechanically covered yet

It may be overkill if you only use AI occasionally or don't want hook-level interception.

Inspired by OpenAI Harness Engineering and Stripe Minions. VibeGuard maps the 5 Harness Golden Principles into repo-level rules, hooks, workflows, and observability; not every principle is a hook-level block.

How It Works

Rule Injection (active from session start)

The native rule set in rules/claude-rules/ is installed to Claude Code's native rules system (~/.claude/rules/vibeguard/), directly influencing AI reasoning. Plus a 7-layer constraint index injected into ~/.claude/CLAUDE.md:

LayerConstraintEffect
L1Search before createMust search for existing implementations before creating new files
L2Naming conventionssnake_case internally, camelCase at API boundaries, no aliases
L3Quality baselineNo silent exception swallowing, no Any types in public methods
L4Data integrityNo data = show blank, no hardcoding, no inventing APIs
L5Minimal changesOnly do what was asked, no unsolicited "improvements"
L6Process gatesLarge changes require preflight, structured planning, and verification
L7Commit disciplineNo AI markers, no force push, no secrets

Rules use negative constraints ("X does not exist") to implicitly guide AI, which is often more effective than positive descriptions.

Canonical references for this contract:

  • Install/runtime contract: schemas/install-modules.json
  • Native rule source: rules/claude-rules/
  • Public summary of current rule surface: docs/rule-reference.md

Hooks — Real-Time Interception

Most hooks trigger automatically during AI operations. skills-loader remains an optional manual hook. Codex deploys native Bash/apply_patch/PermissionRequest/PostToolUse/Stop hooks; read-only exploration hooks remain Claude Code or app-server-wrapper only:

ScenarioHookResult
AI creates new .py/.ts/.rs/.go/.js filepre-write-guardWarn by default — search-first reminder; set VIBEGUARD_WRITE_MODE=block or write_mode=block in ~/.vibeguard/config.json to hard-block
AI creates or edits production source above 400 linespre-write-guard, pre-edit-guard, post-write-guard, post-edit-guardWarn — typical-size advisory; keep the current change localized and plan a later split if growth continues
AI creates or edits production source above 800 linespre-write-guard, pre-edit-guardBlock — split the file before writing or patching
AI runs destructive local cleanup (rm -rf dangerous paths, git clean -f, git checkout/restore .)pre-bash-guardBlock — suggests safe alternatives and audited discard flow
AI pushes a non-fast-forward update or branch deletiongit pre-pushBlock — protects remote history; rewrites and deletions require explicit human approval plus the repository bypass policy
AI edits non-existent filepre-edit-guardBlock — must Read file first
AI adds unwrap(), hardcoded pathspost-edit-guardWarn — with fix instructions
AI adds console.log / print() debug statementspost-edit-guardWarn — use logger instead
AI creates duplicate definitions after a new file writepost-write-guardWarn — detect duplicate symbols and same-name files
AI keeps reading/searching without actinganalysis-paralysis-guardEscalate — force a concrete next step or blocker report
AI edits code in full / strict profilepost-build-checkWarn — run language-appropriate build check
git commitpre-commit-guardBlock — quality + build checks (staged files only), 10s timeout
AI tries to finish with unverified changesstop-guardSignal — logs a Stop reminder; the Stop hook exits 0 to avoid feedback loops
Session endslearn-evaluatorEvaluate — collect metrics and detect correction signals

U-16 file-size enforcement applies to non-test source files with .rs, .ts, .tsx, .js, .jsx, .py, or .go extensions. The default typical-size advisory starts above 400 lines (u16.warn_limit in ~/.vibeguard/config.json / VG_U16_WARN_LIMIT), while the hard limit remains 800 lines (u16.limit in ~/.vibeguard/config.json / VG_U16_LIMIT). For Codex, apply_patch Add File and apply_patch Update File are both normalized before the file hook runs. U-16 is baseline-aware: new oversized files, files crossing the hard limit, and legacy oversized files that grow are blocked; legacy oversized files that stay the same size or shrink are allowed with a U16_LEGACY_DEBT advisory until they fall below the hard limit. The git pre-commit guard and CI changed-file check call the same runtime decision so oversized imports outside AI tool hooks are caught before submission.

Static Guards — Run Anytime

Representative standalone checks you can run on any project. The complete inventory lives in docs/rule-reference.md.

# Universal
bash ~/vibeguard/guards/universal/check_code_slop.sh /path/to/project     # AI code slop
python3 ~/vibeguard/guards/universal/check_dependency_layers.py /path      # dependency direction
python3 ~/vibeguard/guards/universal/check_circular_deps.py /path          # circular deps
bash ~/vibeguard/guards/universal/check_test_integrity.sh /path            # test shadowing / integrity issues
bash ~/vibeguard/guards/universal/check_dependency_changes.sh --base origin/main --head HEAD  # SEC-11 dependency review
bash ~/vibeguard/guards/universal/check_test_weakening.sh --base origin/main --head HEAD      # SEC-11/W-12 test weakening

# Rust
bash ~/vibeguard/guards/rust/check_unwrap_in_prod.sh /path                 # unwrap/expect in prod
bash ~/vibeguard/guards/rust/check_nested_locks.sh /path                   # deadlock risk
bash ~/vibeguard/guards/rust/check_declaration_execution_gap.sh /path      # declared but not wired
bash ~/vibeguard/guards/rust/check_duplicate_types.sh /path                # duplicate type definitions
bash ~/vibeguard/guards/rust/check_semantic_effect.sh /path                # semantic side effects
bash ~/vibeguard/guards/rust/check_single_source_of_truth.sh /path         # single source of truth
bash ~/vibeguard/guards/rust/check_taste_invariants.sh /path               # taste/style invariants
bash ~/vibeguard/guards/rust/check_workspace_consistency.sh /path          # workspace dep consistency

# Go
bash ~/vibeguard/guards/go/check_error_handling.sh /path                   # unchecked errors
bash ~/vibeguard/guards/go/check_goroutine_leak.sh /path                   # goroutine leaks
bash ~/vibeguard/guards/go/check_defer_in_loop.sh /path                    # defer in loop

# TypeScript
bash ~/vibeguard/guards/typescript/check_any_abuse.sh /path                # any type abuse
bash ~/vibeguard/guards/typescript/check_console_residual.sh /path         # console.log residue
bash ~/vibeguard/guards/typescript/check_component_duplication.sh /path    # duplicated component files
bash ~/vibeguard/guards/typescript/check_duplicate_constants.sh /path      # repeated constant definitions

# Python
python3 ~/vibeguard/guards/python/check_duplicates.py /path                # duplicate functions/classes/protocols
python3 ~/vibeguard/guards/python/check_naming_convention.py /path         # camelCase mix
python3 ~/vibeguard/guards/python/check_dead_shims.py /path                # dead re-export shims

Slash Commands

12 custom commands covering the full development lifecycle. Shortcuts: /vg:pf /vg:gc /vg:ck /vg:lrn.

CommandPurpose
/vibeguard:preflightGenerate constraint set before changes
/vibeguard:checkFull guard scan + compliance report
/vibeguard:reviewStructured code review (security → logic → quality → perf)
/vibeguard:cross-reviewDual-model adversarial review (Claude + Codex)
/vibeguard:build-fixBuild error resolution
/vibeguard:learnGenerate guard rules from errors / extract Skills from discoveries
/vibeguard:skill-validateGate proposed skills with required format sections and repair/regression evidence before acceptance
/vibeguard:interviewDeep requirements interview → SPEC.md
/vibeguard:exec-planLong-running task execution plan, cross-session resume
/vibeguard:live-truthFresh evidence gates for latest, PR-ready, merged, running, deployed, and published claims
/vibeguard:gcGarbage collection (logs + worktrees + rule budget + code slop scan)
/vibeguard:statsHook trigger statistics

Routing Contract

Workflow routing is defined once in workflows/references/routing-contract.md.

  • Precedence: user_override → risk/destructive gate → ambiguity gate → readiness classifier → execution/delegation lane
  • Readiness outputs: execute_direct, plan_first, clarify_first
  • Planning surfaces emit the shared handoff fields: mode, artifacts, runtime_pinning_snapshot, verification_owner, stop_conditions, lane_map
  • Delegated multi-agent work uses workflows/references/delegation-contract.md for child-agent assignments, parallelism limits, and single-owner reintegration

Use workflow prompts and dispatcher guidance as consumers of that contract, not as independent routing sources.

Multi-Agent Dispatch

14 built-in agent prompts (13 specialists + 1 dispatcher) with automatic routing:

AgentPurpose
dispatcherAuto-route — analyzes task type and routes to the best agent
planner / architectRequirements analysis and system design
tdd-guideRED → GREEN → IMPROVE test-driven development
code-reviewer / security-reviewerLayered code review and OWASP Top 10
build-error-resolverBuild error diagnosis and fix
go-build-resolverGo-specific build error diagnosis
go-reviewer / python-reviewer / database-reviewerLanguage-specific review
refactor-cleaner / doc-updater / e2e-runnerRefactoring, docs, and E2E tests

Observability

bash ~/vibeguard/scripts/quality-grader.sh              # Quality grade (A/B/C/D)
bash ~/vibeguard/scripts/stats.sh                       # Project hook trigger stats (7 days)
bash ~/vibeguard/scripts/hook-health.sh 24              # Project hook health snapshot
bash ~/vibeguard/scripts/stats.sh --scope global        # Global hook trigger stats
bash ~/vibeguard/scripts/doctors/codex-doctor.sh        # Codex install + hook capability diagnosis
bash ~/vibeguard/scripts/metrics/metrics-exporter.sh    # Prometheus metrics export
bash ~/vibeguard/scripts/verify/doc-freshness-check.sh  # Rule-guard coverage check

Doctors are read-only diagnosis wrappers over the existing defense system. They summarize installation state, capability gaps, noisy hooks, recent events, and repair commands; hooks and guards remain the enforcement layer that blocks or warns during real tool execution.

Hook latency is also a product contract. See Hook Latency Contract for per-hook P95 budgets, hotspot attribution, and the static gates that block expensive hook patterns.

The local observability contract is documented in Observability Harness Contract, including project/global scope, metric labels, and the external-stack roadmap.

Tested and Evaluated

VibeGuard guards its own behavior — the test suite and eval harness ship in the repo, not as an afterthought.

  • Behavior eval (CI-blocking): a zero-cost gate that runs the real guard hooks end-to-end and asserts the actual block/deny decision on both the Claude Code hook and the Codex wrapper. Enforced in CI at a 100% pass / 100% coverage threshold — removing a required platform slice fails the build (eval/run_behavior_eval.py).
  • Rule-detection benchmark: a 40-sample, schema-validated, digest-pinned dataset (planted rule violations across SEC / Python / TypeScript / Go / Rust / universal rules, plus clean controls) scored on detection rate, a severity-weighted score, and per-severity Expected Calibration Error (ECE) — calibration, not just accuracy. Run manually with python3 eval/run_eval.py (uses the Claude API; not a merge gate).
  • Test suite: hook/guard test scripts under tests/ and 100+ unit tests in the Rust vibeguard-runtime crate. Full CI runs on Linux and macOS; Windows runs cross-platform contract smoke tests.

Learning System

Closed-loop learning evolves defenses from mistakes:

Mode A — Defensive

/vibeguard:learn <error description>

Analyzes root cause (5-Why) → generates a new guard/hook/rule → verifies detection → the same class of error should not recur.

Mode B — Accumulative

/vibeguard:learn extract

Extracts non-obvious solutions as structured Skill files for future reuse.

Installation

Runtime prerequisites

Default setup downloads and verifies the pinned vibeguard-runtime release for supported platforms when the pinned runtime version has published release assets. Source builds remain available for unsupported/offline installs, for unreleased main checkouts whose pinned runtime version has not been tagged yet, and for users who explicitly request them.

PlatformDefault runtime pathRust/Cargo needed?
macOS arm64 (aarch64-apple-darwin)Prebuilt release binaryNo
macOS x86_64 (x86_64-apple-darwin)Prebuilt release binaryNo
Linux x86_64 (x86_64-unknown-linux-musl)Prebuilt release binaryNo
Linux arm64 (aarch64-unknown-linux-musl)Prebuilt release binaryNo
Other targets, offline installs, unreleased runtime pins without assets, or --build-from-sourceLocal source buildYes

setup.sh uses gh release download when gh is available, otherwise curl. If a supported-target download fails, it falls back to cargo build when Cargo is available. Checksum mismatch, a missing checksum entry, or a failed available attestation verification is fatal and does not fall back to source. When the attestation verifier is unavailable, setup prints checksum-only after SHA-256 verification.

Profiles and languages

# Profiles
bash ~/vibeguard/setup.sh                              # Install (default: core profile)
bash ~/vibeguard/setup.sh --profile minimal           # Minimal: pre-hooks only (lightweight)
bash ~/vibeguard/setup.sh --profile full              # Full: adds Stop signal + Build Check + learning
bash ~/vibeguard/setup.sh --profile strict            # Strict: full hooks + Claude Code U-32 SessionStart constraint budget

# Language selection (only install rules/guards for specified languages)
bash ~/vibeguard/setup.sh --languages rust,python
bash ~/vibeguard/setup.sh --profile full --languages rust,typescript

# Runtime / scheduler
bash ~/vibeguard/setup.sh --build-from-source          # Force local Cargo build
bash ~/vibeguard/setup.sh --with-scheduler             # Opt in to launchd/systemd scheduled GC
bash ~/vibeguard/scripts/install-health-report-scheduler.sh --dry-run
bash ~/vibeguard/scripts/install-health-report-scheduler.sh --install  # Opt in to weekly health reports

# Verify / Uninstall
bash ~/vibeguard/setup.sh doctor                      # Human-friendly report, exits 0 for compatibility
bash ~/vibeguard/setup.sh --check                     # Compatibility alias for doctor
bash ~/vibeguard/setup.sh verify-install              # CI/post-install check, exits 2 on broken required state
bash ~/vibeguard/setup.sh verify-project              # Strict project check, exits 1/2 on degraded/broken
bash ~/vibeguard/setup.sh verify-dev-repo             # Strict VibeGuard repo check
bash ~/vibeguard/setup.sh verify-project --json       # Machine-readable JSON for CI
bash ~/vibeguard/setup.sh --clean                     # Uninstall

doctor / --check reports a structured rollup (OK / INFO / WARN / FAIL / BROKEN / MISSING) plus a final Verdict line of HEALTHY, DEGRADED, or BROKEN. It always exits 0 for backwards compatibility unless the checker itself cannot run. CI should use verify-install for post-install health gates or verify-project --json when it needs machine-readable strict project output.

Migration: --check --strict remains supported and maps to verify-project; --check --json remains supported and maps to verify-project --json; --check --install remains supported and maps to verify-install.

ProfileHooks InstalledUse Case
minimalpre-write, pre-edit, pre-bashLightweight — only critical interception
core (default)minimal + post-edit, post-write, analysis-paralysisStandard development
fullcore + stop-guard, learn-evaluator, post-build-checkFull defense + learning
strictfull + Claude Code count-active-constraints (SessionStart/U-32); Codex native hooks remain fullMaximum enforcement

setup.sh also prepares the shared pre-commit wrapper at ~/.vibeguard/pre-commit and installs this repository's git pre-commit and pre-push hooks during setup. The git pre-push hook owns force-push / branch-deletion protection; pre-bash-guard does not regex-match git push --force. To attach the wrapper to another repository, use scripts/project-init.sh or that repository's own install step.

Codex Integration

VibeGuard deploys hooks and skills to both Claude Code and Codex CLI.

Codex App can also discover VibeGuard as a local plugin from this repository:

codex plugin marketplace add /path/to/vibeguard
codex plugin add vibeguard@vibeguard-local

The plugin is an observability-first operator entrypoint. Installing the plugin does not silently rewrite ~/.codex; use the plugin observe/setup skills, or run one of these commands from this checkout:

bash plugins/vibeguard/scripts/vibeguard-plugin.sh dashboard
bash plugins/vibeguard/scripts/vibeguard-plugin.sh health 24
bash plugins/vibeguard/scripts/vibeguard-plugin.sh stats all
bash plugins/vibeguard/scripts/vibeguard-plugin.sh install --yes

The dashboard is generated as a local HTML artifact from the existing VibeGuard diagnostic commands. It is not remote telemetry and does not replace behavior eval gates.

Hooks live in ~/.codex/hooks.json (requires [features].hooks = true in config.toml):

EventHookFunction
PreToolUse(Bash)pre-bash-guard.shDestructive local cleanup interception + package manager correction
PermissionRequest(Bash)pre-bash-guard.shFail-closed approval gate for dangerous commands
PreToolUse(Edit/Write via apply_patch)pre-edit-guard.sh, pre-write-guard.shFile existence and search-first gates before patching
PermissionRequest(Edit/Write via apply_patch)pre-edit-guard.sh, pre-write-guard.shFail-closed approval gate before privileged patching
PostToolUse(Bash/apply_patch)post-build-check.shBuild failure detection after commands or patches
PostToolUse(Edit/Write via apply_patch)post-edit-guard.sh, post-write-guard.shPost-patch quality and duplicate checks
Stopstop-guard.shUncommitted changes signal (logs a gate event, non-blocking Stop)
Stoplearn-evaluator.shSession metrics collection

This is the default enforcement layer. It talks to Codex through native hooks and does not wrap or replace the Codex server. Codex has no native Read, Glob, or Grep hook surface, so analysis-paralysis is not available on the native Codex path. Use Claude Code when read-only exploration gating is required; the optional app-server wrapper is only for external orchestrators that already require codex app-server.

Codex hook command names are namespaced as vibeguard-*.sh to avoid collisions with other toolchains sharing ~/.codex/hooks.json. Output format differences are handled by the run-hook-codex.sh wrapper (Claude Code decision:block -> Codex deny payloads). Codex sends apply_patch as a patch command, so the wrapper normalizes that payload into Edit/Write-shaped inputs before calling the existing VibeGuard file hooks. For Update File patches, the wrapper also passes the line delta so pre-edit-guard.sh can enforce U-16 before Codex mutates the file. When a hook suggests updatedInput, the Codex CLI wrapper cannot apply it automatically, so VibeGuard emits an explicit note with the suggested replacement command instead of silently dropping it.

Hook status is a separate human diagnostics surface. Use vibeguard-runtime hook-status --mode focused inside a git repository to inspect the matching project log, or add --scope global for ~/.vibeguard/events.jsonl. --log-file PATH always wins for explicit fixtures or one-off diagnosis. The command reports recent pass, skipped, slow, timeout, and adapter-error states without adding successful hook summaries to the model context. Only actionable warn / block results should continue through hookSpecificOutput.additionalContext. See docs/reference/codex-hook-status.md.

MCP server status: the legacy mcp-server/ prototype is not installed by setup.sh and is not part of the supported runtime surface. Supported integrations are the Claude Code hooks, native Codex hooks, and the optional app-server wrapper below; any future MCP reintroduction must go through an explicit install path and hash/audit baseline.

Optional app-server wrapper (advanced orchestrators only):

Most local Codex setups do not need this path. It is not the default protection layer; use native Codex hooks in ~/.codex/hooks.json for local protection.

~/.vibeguard/installed/bin/vibeguard-runtime codex-app-server-wrapper --repo-dir ~/vibeguard --codex-command "codex app-server"
  • --strategy vibeguard (default): applies strategy-based command, file-change, analysis-loop, and post-turn gates externally
  • --strategy noop: pure pass-through for debugging
  • Runtime: Rust-only via vibeguard-runtime; there is no Python app-server wrapper fallback.
  • App-server wrapper is optional and mainly for external orchestrators that already speak codex app-server
  • App-server wrapper scope today: Bash approval interception; applyPatchApproval / item/fileChange/requestApproval file-change guards mapped to pre-edit, pre-write, post-edit, and post-write; proxy-native analysis-paralysis warnings for read-only command streaks; post-turn stop/build feedback with explicit thread/session/turn propagation.
  • Guard mode: VIBEGUARD_CODEX_GUARD_MODE=guarded by default. decline / denied tells Codex to continue the turn with a warning; strict upgrades file changes to cancel / abort; advisory emits warnings without blocking.
  • Default local protection should use native Codex hooks in ~/.codex/hooks.json
  • Still unsupported on native Codex path: Read/Glob/Grep hooks such as analysis-paralysis

Use with any project

ToolHow
OpenAI Codexcp ~/vibeguard/templates/AGENTS.md ./AGENTS.md + bash ~/vibeguard/setup.sh (installs skills + Codex hooks)
Any project (rules only)cp ~/vibeguard/docs/CLAUDE.md.example ./CLAUDE.md

Project Bootstrap

Bootstrap another repository with project-specific guidance and the pre-commit wrapper:

bash ~/vibeguard/scripts/project-init.sh /path/to/project

Local Contract Gate (contributors)

Run stable contract checks locally before pushing, or wire them as a pre-commit hook:

bash scripts/local-contract-check.sh          # run the full local gate
bash scripts/install-pre-commit-hook.sh       # install as git pre-commit hook

See CONTRIBUTING.md for the local-vs-CI split and the --quick flag.

Custom Rules

Add your own rules to ~/.vibeguard/user-rules/. Any .md files placed there are automatically installed to ~/.claude/rules/vibeguard/custom/ on the next setup run. Format: standard Claude Code rule files with YAML frontmatter.

Design Principles

PrincipleFromImplementation
Automation over documentationHarness #3Mechanized checks complement rules, workflows, and review
Error messages = fix instructionsHarness #3Every interception tells AI how to fix, not just what's wrong
Maps not manualsHarness #57-layer index + negative constraints + lazy loading
Failure → capabilityHarness #2Mistake → learn → new guard → never again
If agent can't see it, it doesn't existHarness #1All decisions written to repo (CLAUDE.md / ExecPlan / logs)
Give agent eyesHarness #4Observability stack (logs + metrics + alerts)

Known Issues

Guard scripts rely heavily on pattern matching (grep/awk or lightweight AST helpers), which means false positives can still happen in some scenarios.

Key lessons:

  • grep is not an AST parser — nested scopes and multi-block structures need language-aware tools
  • Guard fix messages are consumed by AI agents — an imprecise fix hint can itself trigger unnecessary edits
  • Project type awareness matters — CLI/Web/MCP/Library codebases may need different acceptable patterns for the same language rule

Documentation

DocPurpose
docs/README_CN.mdChinese overview and setup guide
docs/how/quickstart.mdMinimal install, verification, project bootstrap, and intercepted demo path
docs/how/team-rollout.mdProfiles, CI policy, scheduler rollout, and team verification expectations
docs/how/troubleshooting.mdInstall, runtime, Codex hook, and hook-status diagnosis
docs/rule-reference.mdRule layers, guard coverage, and language-specific checks
docs/CLAUDE.md.exampleProject-level CLAUDE template without installing hooks
docs/linux-setup.mdLinux-specific setup notes
docs/known-issues/false-positives.mdKnown guard false positives and mitigation notes
docs/assets/README.mdDemo recording script and assets
CONTRIBUTING.mdContributor workflow, validation commands, and commit protocol

The Agent Infra Stack

This project is one layer of an open-source stack for running coding agents (Claude Code, Codex) as serious infrastructure. Every piece works standalone; together they close the loop:

vibeguard is the Trust layer at runtime — rules, hooks, and guards while the agent works. Its install-time counterpart is argus.

LayerProjectWhat it does
Extendclaude-skill-registryDiscover and search community Claude Code skills
ExtendspellbookCross-runtime skills for Claude Code, Codex, and multi-agent workflows
TrustargusStatic install-time scanner for supply-chain attacks (npm / PyPI / crates.io)
Trustvibeguard ◀ you are hereRules, hooks, and guards against hallucinated or unverified agent changes
RememberrememLocal-first persistent memory for Claude Code and Codex sessions
OrchestrateharnessRust agent orchestration platform — rules, skills, GC, observability
Routelitellm-rsHigh-performance Rust AI gateway — 100+ LLM APIs via OpenAI format
KeepkeeplineSession command center — monitor, recover, never lose agent work

References


Chinese Documentation →

其他

中风险

  • 来源需自行核对维护者身份。
  • 未检测到明显脚本安装指令。
  • 未检测到明显外部权限要求。
  • 未检测到高风险命令。
  • 扫描发现:1 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/majiayu000/vibeguard.git
  3. 将 "skills/implx" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/majiayu000/vibeguard.git
  3. 将 "skills/implx" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/majiayu000/vibeguard.git
  3. 将 "skills/implx" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/majiayu000/vibeguard.git
  3. 将 "skills/implx" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/majiayu000/vibeguard.git
  3. 将 "skills/implx" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: implx
description: "Use when the user says \"implx\", \"use implx\", \"用 implx\", or asks for the one-line SpecRail queue shortcut. Plain implx means drain the full actionable issue/PR queue in review mode: run SpecRail preflight, create missing spec/task PR work before implementation, use threads for reviewer/merge-reviewer lanes when available, create per-issue implementation PRs, require CI/reviewThreads/pr_gate evidence, preserve per-PR human merge authorization, and perform closure audit. Say \"implx auto\" / \"implx 自动\" for the explicit auto mode that treats the invocation as standing merge authorization for this run."

Implx

Use this skill as a short operational entrypoint. It only recognizes the implx shorthand, records the queue mode, performs the minimum startup checks, and delegates execution policy to the focused SpecRail skills.

Do not duplicate the implementation-queue contract here. The authoritative queue planning, spec coverage gate, context budget, runtime checkpoint, threads orchestration, PR gate, and closure-audit rules live in skills/specrail-implement-queue/SKILL.md.

Startup

  1. Run the normal SpecRail startup before remote writes:
    • read the repository AGENTS.md
    • read AGENT_USAGE.md, workflow.yaml, states.yaml, labels.yaml, and skills/specrail-workflow/SKILL.md when present
    • select the human-facing locale
    • identify human gates and route-gate requirements
  2. Fetch current remote state before mapping a GitHub queue.
  3. List open issues, open PRs, current branch, dirty files, and worktrees.
  4. Map existing PRs before creating replacement PRs.
  5. Record queue scope. Plain implx, use implx, or 用 implx means full actionable queue drain unless the prompt explicitly narrows the scope.

Queue Mode

Use queue_mode: full_queue_drain for the plain shorthand:

  • implx
  • use implx
  • 用 implx

These explicit forms are equivalent:

  • implx drain full queue
  • implx resume full queue
  • 用 implx 完成所有 actionable issues 和 PRs
  • 用 implx 做完整队列

Use queue_mode: bounded_tranche only when the prompt explicitly limits scope, for example one issue, one PR, the current tranche, plan-only, status-only, or review-only work.

Authorization Mode

Two modes. Record the selected mode at startup and pass it downstream. The repository's persisted automation_policy.auth_mode is a review safety baseline; it never selects or authorizes auto mode.

auth_mode: review — the DEFAULT for plain implx, use implx, 用 implx, implx review, implx 审核, and implx 人工:

  • Preserve per-PR explicit human merge authorization in the current conversation before any merge.
  • Route needs_spec / needs_tasks to spec-writing skills but wait for human confirmation before implementing from a freshly drafted spec.

auth_mode: auto — selected only by a current user message that explicitly says implx auto or implx 自动:

  • The explicit implx auto invocation itself IS the standing merge authorization for this run. Do not ask per-PR "can I merge" questions.
  • Merge a PR when ALL evidence is current and green per skills/specrail-implement-queue/SKILL.md (CI rollup, PR gate, resolved review threads, clean merge state, reviewer-lane evidence).
  • Use closing keywords for final slices so merged PRs close their issues; close merged-but-open issues during closure audit.
  • needs_spec / needs_tasks issues are actionable: auto-draft the spec or task packet via the focused SpecRail skills, then implement. Do not park them waiting for human spec approval.
  • Items that genuinely need a human decision (duplicate-ownership conflicts, maintainer waivers, probe or time-window gates, destructive or irreversible actions, conflicting review feedback, architecture-level rewrites) never block the queue: skip them, keep draining, and report them once in a final human_decisions list with a recommended action each.

In both modes, never force-push, delete unmerged branches, replace a maintainer-writable PR without cause, publish releases, or act outside the repository without explicit instruction. Auto mode does not weaken the Bounded Tranche Hard Stop, reviewer-lane, or self-review authorization rules.

full_queue_drain means the objective spans the whole actionable queue, not that one session runs unbounded. Execution is a sequence of bounded tranches: each session declares a hard budget (compaction count and/or item cap) in the runtime checkpoint at tranche start, stops when the budget is exhausted, and hands off to a fresh session via the checkpoint. See the Bounded Tranche Hard Stop rules in skills/specrail-implement-queue/SKILL.md.

Pass the selected modes to skills/specrail-implement-queue/SKILL.md:

implx_context:
  overall_objective:
  queue_mode: bounded_tranche | full_queue_drain
  auth_mode: auto | review
  user_authorization:
  current_branch:
  dirty_files:
  open_issues:
  open_prs:

Delegate

After startup, load skills/specrail-implement-queue/SKILL.md for any issue or PR queue. That skill owns:

  • spec coverage classification
  • implementation candidate selection
  • one-issue-per-PR planning
  • partial versus final closing semantics
  • context-budget and runtime-checkpoint behavior
  • optional threads orchestration
  • verification, PR-gate evidence, and closure audit

For one small scoped issue, follow that skill's instruction to route to skills/specrail-implement/SKILL.md.

Threads

If the queue needs native parallel lanes, reviewer lanes, CI waits, review-thread checks, merge gates, or closure audit, load skills/specrail-implement-queue/SKILL.md and then follow the orchestration rules in skills/specrail-implement-queue/SKILL.md.

For GitHub issue or PR queues, reviewer lanes, merge gates, and closure audit make native thread dispatch required whenever native subagent capability is available. Record thread_dispatch_gate before implementation, review, or merge work. A coordinator self-review is not a native thread and does not satisfy merge review.

If no native threads capability is available, continue with the single-agent SpecRail flow only after recording the fallback and reporting that no native threads were launched.

Boundaries

  • In auto mode, merge only on complete current evidence (CI, review threads, merge state, PR gate, reviewer lane); evidence gaps mean skip and report, not ask.
  • In review mode, do not merge without explicit human authorization in the current conversation.
  • Do not treat green CI as merge readiness without review-thread and merge-state truth.
  • Do not close an issue from a partial implementation.
  • Do not replace an existing maintainer-writable PR unless it is stale, unsafe, unwritable, or a human approves replacement.
  • Do not use old Codex session logs as queue state.

Handoff

Report the compact handoff produced by the focused queue skill. Include this implx wrapper context when useful:

implx_handoff:
  route: implement_queue
  overall_objective:
  queue_mode:
  auth_mode:
  delegated_skill: skills/specrail-implement-queue/SKILL.md
  queue_truth:
    open_issues:
    open_prs:
    current_branch:
    dirty_files:
  human_decisions:
  focused_handoff:
  thread_dispatch_gate:
    native_subagents:
    spawn_requirement:
    native_thread_evidence:

When to Activate

  • Activate this route only when the request matches the skill description and the SpecRail router selected it.
  • Use it after loading repository instructions, workflow policy, and the current user-authorized scope.

Red Flags

  • Required issue, spec, PR, runtime, or review evidence is missing or stale.
  • A proposed action would bypass an offline gate, CI, review, or human authorization.
  • The route would ignore configured paths, duplicate an artifact, or cross the requested scope.

Checklist

  • Confirm the route, configured paths, locale, and authorization mode before writes.
  • Search first and record missing evidence or human gates without inventing state.
  • Run the focused validator and report its exact decision or blocker.

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!