0xNyk avatar

lacp-hardening

5 lifecycle hooks (Stop quality gate, SessionStart context injection, PreToolUse security guards, PostToolUse continuous QA, UserPromptSubmit thinking nudge) + 11 context modes + 3 skills. Battle-tested across 3,000+ sessions.

version
1.0.0
GitHub stars
311

Install

/plugin install lacp-hardening@lacp-plugins

Run it inside Claude Code after adding the marketplace with /plugin marketplace add 0xNyk/lacp.

Contents

Discovered from source

Skills 3

Context Modes

Set LACP_CONTEXT_MODE environment variable to activate a mode:

ModePurpose
tddStrict RED-GREEN-REFACTOR — no code without a failing test
debugging4-phase systematic root cause investigation
sprintPre-agreed completion criteria evaluated at stop
verificationEvidence-before-claims discipline
brainstormDesign exploration — no code until design approved
thinkPause-and-reflect before every action chain
orchestrateDecompose into subtasks before executing
implementationFocused implementation partner
reviewCode review mode
thinking-partnerChallenge assumptions, surface blind spots
handoff-resumeContinue from previous session handoff

Each mode is a markdown file that gets injected as system context at session start.

Quality Gate

This plugin evaluates your work at session end using criteria-based scoring:

  • Completeness (35%): Did you finish what you committed to?
  • Honesty (30%): Are claims about tests/status verified?
  • Deferral ratio (20%): How much was pushed to "later"?
  • Work evidence (15%): Files changed relative to scope claimed

Sprint Contracts

Before implementing, state your sprint contract:

  • What files will be modified
  • What tests will pass
  • What the acceptance criteria are

The quality gate evaluates against these criteria at session end.

Handoff Artifacts

On every non-trivial stop, a handoff artifact is generated with:

  • Task summary, files modified, test status
  • Git branch and diff summary
  • Next steps for the following session

The next session automatically receives the handoff.

Configuration

Env VarDefaultPurpose
LACP_QUALITY_GATE_THRESHOLD2.5Minimum weighted score (1-5)
LACP_QUALITY_GATE_MODELllama3.1:8bOllama model for scoring
LACP_BLIND_SPOT_ENABLED0Enable blind spot reflection

Session Hardening

This plugin provides three layers of production hardening:

Pretool Guard (PreToolUse)

Blocks dangerous operations before they execute:

  • rm -rf → suggests trash instead
  • Co-author injection in commits
  • npm/cargo/pip publish without approval
  • curl | python/node download-first patterns
  • chmod 777 → suggests specific masks
  • git reset --hard, git clean -f
  • Data exfiltration via curl --data @.env
  • Push to main on public repos

Continuous QA (PostToolUse)

Runs your project's test command at configurable intervals during work:

  • Detects test command from package.json, Makefile, Cargo.toml, pyproject.toml
  • Fires every N file writes (default: 10)
  • Injects failure feedback without blocking
  • Includes thinking prompt on failure (think mode)

Session Context (SessionStart)

Injects at every session start:

  • Git branch, recent commits, modified files
  • Focus brief (current problem, beliefs, decisions)
  • Handoff artifact from previous session
  • System health score
  • Self-Memory System context

Configuration

Env VarDefaultPurpose
LACP_EVAL_CHECKPOINT_ENABLED0Enable continuous QA
LACP_EVAL_CHECKPOINT_INTERVAL10Test every N writes
LACP_CONTEXT_MODE``Active mode (tdd, debugging, sprint, etc.)

Commands 1

Show the current LACP hardening status by checking:

  1. Active hooks: Which LACP hooks are installed and firing
  2. Context mode: What LACP_CONTEXT_MODE is set (if any)
  3. Eval checkpoint: Whether continuous QA is enabled and its last result
  4. Quality gate: Recent telemetry decisions (blocks, allows, scores)
  5. Handoff: Whether a handoff artifact exists for this directory

Run these commands to gather the data:

# Check hook telemetry (last 5 entries)
tail -5 ~/.local/share/claude-hooks/telemetry.jsonl 2>/dev/null | python3 -c "
import json, sys
for line in sys.stdin:
    try:
        e = json.loads(line.strip())
        print(f\"  {e.get('ts','?')[:19]} {e.get('hook','?'):10s} {e.get('decision','?'):6s} {e.get('reason','')[:60]}\")
    except: pass
" || echo "  No telemetry data"

# Check eval checkpoint
cat ~/.lacp/hooks/contracts/*/eval_checkpoint.json 2>/dev/null | python3 -c "
import json, sys
try:
    d = json.load(sys.stdin)
    print(f\"  Writes: {d.get('write_count',0)}, Last: {d.get('last_result','?')}, Fails: {d.get('fail_count',0)}\")
except: print('  No checkpoint data')
"

# Check context mode
echo "  Mode: ${LACP_CONTEXT_MODE:-none}"
echo "  Eval checkpoint: ${LACP_EVAL_CHECKPOINT_ENABLED:-disabled}"

Present the results as a clear status report.

Sponsors

Details

Marketplace
0xNyk/lacp
Source
plugin
Author
Nyk
Category
Productivity
License
MIT
Keywords
quality-gate, security, hardening, memory, hooks, production, testing, guardrails, tdd, debugging