skills/FORGE-lsp-pre-edit-gate/SKILL.md
MANDATORY LSP grounding gate BEFORE any code mutation on .ts, .py, .js, .tsx, .jsx files. Forces the agent to read real-time compiler diagnostics and structural project context before editing — eliminating blind guesses and anchoring every mutation in F2 (TRUTH). Routes through arifOS kernel (:8088) for centralized gate logic.
npx skillsauth add ariffazil/openclaw-workspace FORGE-lsp-pre-edit-gateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"You are the hooded engineer. The LSP is your only window into the compiler's truth." No LSP probe = no mutation. No exceptions. No shortcuts. This is F2 TRUTH operationalized. LSP is the witness — not agent memory, not training data, not guesses.
BEFORE any write/edit/mutation on *.ts, *.py, *.js, *.tsx, *.jsx files:
1. lsp(documentSymbol, filePath) → know the structure
2. lsp(hover, filePath, line, char) → know the contract (type, signature)
3. lsp(findReferences, filePath, line, char) → know the blast radius
CACHE: LSP results cached per file per session (TTL: session lifetime).
Do NOT re-probe the same file/symbol more than once per session.
Do NOT probe if the file hasn't changed since last probe.
GATE: If any step fails → HOLD. Fix diagnostics first. Then edit.
Zero LSP errors tolerated before mutation. Warnings ≤ 5.
| Probe | What You Learn | Without It |
|-------|---------------|------------|
| documentSymbol | All functions, classes, variables, their hierarchy | You don't know what's in the file |
| hover | Type signature, docstring, contract of the symbol | You're guessing the interface |
| findReferences | Every caller, every dependency, full blast radius | You don't know what will break |
Agent wants to edit file.ts
↓
Agent calls lsp(documentSymbol/hover/findReferences) on target
↓ (LSP results go into agent context — the hooded engineer now SEES)
↓
Agent checks: lspDiagnostics == 0? references understood?
↓ YES → proceed with edit
↓ NO → HOLD. Fix diagnostics first.
↓
After edit: re-run lsp(documentSymbol) on modified file
↓ diagnostics == 0? → proceed
↓ diagnostics > 0? → fix, re-verify
The logic is centralized: the agent follows this skill. The lsp tool is called directly (it's a native OpenCode tool). The kernel's role is constitutional oversight — arif_judge can HOLD if LSP grounding is skipped.
We do NOT reimplement LSP at the shell layer. The lsp tool is the canonical interface. This skill is the gatekeeper — the pattern, not a new tool.
| Extension | LSP Required? | Server |
|-----------|---------------|--------|
| .ts, .tsx | YES — full 3-probe gate | TypeScript |
| .py | YES — full 3-probe gate | Pyright/Pylance |
| .js, .jsx | YES — full 3-probe gate | TypeScript (JS mode) |
| .json, .yaml, .yml | documentSymbol only | JSON/YAML |
| .md, .txt, .sh | NO gate (but read first) | — |
| .env, .secret | NO gate (never mutate without 888_HOLD) | — |
Cache key: sha256(filePath + fileContent hash)
TTL: session lifetime
Store: agent working memory (not persisted — fresh cache per session)
Rule: If you already probed this file THIS session and it hasn't changed
since your last probe → use cached results. Don't re-probe.
If file has changed (different content hash) → re-probe is MANDATORY.
After every mutation on a gated file:
1. lsp(documentSymbol, editedFile) → check for new errors
2. If lspDiagnostics > 0 → the edit introduced errors → fix immediately
3. If lspDiagnostics == 0 → gate passed → continue
This is the inner loop of the temporal causal oracle:
OBSERVE (LSP probes) → EDIT → VERIFY (LSP re-probe) → COMMIT (git anchor)
# Step 1: Understand structure
lsp(operation="documentSymbol", filePath="/root/path/to/file.ts", line=1, character=1)
# Step 2: Hover on the symbol you're about to change
lsp(operation="hover", filePath="/root/path/to/file.ts", line=145, character=12)
# Step 3: Find all references to understand blast radius
lsp(operation="findReferences", filePath="/root/path/to/file.ts", line=145, character=12)
# Step 4: Only after ALL THREE → proceed with edit
# Step 5: After edit → documentSymbol again → verify diagnostics == 0
This gate feeds directly into the COMPLETION_CONTRACT verification criterion:
{
"id": "lsp_diagnostics_zero",
"threshold": { "max_errors": 0, "max_warnings": 5 },
"weight": "HARD"
}
The scheduled completion-promise-verifier.sh will REJECT any task where LSP diagnostics > 0 on modified files.
Forged: 2026-08-06 by 333-AGI Δ MIND under F13 SOVEREIGN directive "temporal causal oracle for AGI substrate." This is the witness observability layer. No blind edits. No guesses. LSP is the compiler's truth. DITEMPA BUKAN DIBERI ⚒️
testing
OpenClaw edge agent bridge — operational triage, doctor, restart, and A2A bridge routing for the federation edge (Telegram surface). USE WHEN: "openclaw unhealthy", "gateway down", "edge bot not responding", "a2a bridge disconnected", "watchdog tripped", "openclaw doctor", "openclaw restart". NOT for token/security audit — use FORGE-telegram-audit.
tools
Generate images, videos, TTS, voice clone, and music via MiniMax MCP server. Use when user asks to "draw", "generate image", "create picture", "make a photo", "text to image", "image generation".
testing
Single load-bearing constitutional-judgment skill. Routes all F1–F13, verdict, hold, seal, scope, authority and floor-check calls through the live arif_judge surface. Replaces 7 overlapping predecessors (arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge).
tools
When no permanent tool exists for a task, spawn a temporary tool via forge_ephemeral. The capability metabolism engine — generate, test, use, then dissolve. Prevents tool accumulation. Adapts without accumulating permanent state. Wolf Cabinet Ψ Survival — "I need to do X but no tool exists."