
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-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add 0xNyk/lacp.
Contents
Discovered from sourceSkills 3
Context Modes
Set LACP_CONTEXT_MODE environment variable to activate a mode:
| Mode | Purpose |
|---|---|
tdd | Strict RED-GREEN-REFACTOR — no code without a failing test |
debugging | 4-phase systematic root cause investigation |
sprint | Pre-agreed completion criteria evaluated at stop |
verification | Evidence-before-claims discipline |
brainstorm | Design exploration — no code until design approved |
think | Pause-and-reflect before every action chain |
orchestrate | Decompose into subtasks before executing |
implementation | Focused implementation partner |
review | Code review mode |
thinking-partner | Challenge assumptions, surface blind spots |
handoff-resume | Continue 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 Var | Default | Purpose |
|---|---|---|
LACP_QUALITY_GATE_THRESHOLD | 2.5 | Minimum weighted score (1-5) |
LACP_QUALITY_GATE_MODEL | llama3.1:8b | Ollama model for scoring |
LACP_BLIND_SPOT_ENABLED | 0 | Enable blind spot reflection |
Session Hardening
This plugin provides three layers of production hardening:
Pretool Guard (PreToolUse)
Blocks dangerous operations before they execute:
rm -rf→ suggeststrashinstead- Co-author injection in commits
npm/cargo/pip publishwithout approvalcurl | python/nodedownload-first patternschmod 777→ suggests specific masksgit 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 Var | Default | Purpose |
|---|---|---|
LACP_EVAL_CHECKPOINT_ENABLED | 0 | Enable continuous QA |
LACP_EVAL_CHECKPOINT_INTERVAL | 10 | Test every N writes |
LACP_CONTEXT_MODE | `` | Active mode (tdd, debugging, sprint, etc.) |
Commands 1
Show the current LACP hardening status by checking:
- Active hooks: Which LACP hooks are installed and firing
- Context mode: What
LACP_CONTEXT_MODEis set (if any) - Eval checkpoint: Whether continuous QA is enabled and its last result
- Quality gate: Recent telemetry decisions (blocks, allows, scores)
- 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