rlm-context-management
This skill activates when: - Context exceeds complexity threshold (cross-file reasoning, debugging with large output,…
This skill activates when: - Verifying proposed code changes won't break invariants - Analyzing dependencies between components - Checking resource constraints or scheduling feasibility - Generating test inputs satisfying path constraints
$ npx -y skills add rand/rlm-claude-code --skill constraint-verification --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/constraint-verificationContext preview
The summary Claude sees to decide when to auto-load this skill.
This skill activates when: - Verifying proposed code changes won't break invariants - Analyzing dependencies between components - Checking resource constraints or scheduling feasibility - Generating test inputs satisfying path constraints
This skill activates when:
import cpmpy as cp
# Integer variables
x = cp.intvar(lb=0, ub=100, name="x")
xs = cp.intvar(0, 100, shape=10, name="xs") # Array
# Boolean variables
b = cp.boolvar(name="b")
bs = cp.boolvar(shape=5, name="bs")
# Model and constraints
model = cp.Model()
model += x + y == 10 # Arithmetic
model += x < y # Comparison
model += b.implies(x > 5) # Implication
model += cp.AllDifferent(xs) # Global constraint
# Solve
if model.solve():
print(x.value(), y.value())# Verify no circular dependencies
n_modules = len(modules)
order = cp.intvar(0, n_modules-1, shape=n_modules, name="order")
model = cp.Model()
model += cp.AllDifferent(order)
for (a, b) in dependencies: # a depends on b
model += order[a] > order[b] # a must come after b
if model.solve():
print("Valid ordering exists")
else:
print("Circular dependency detected")# Verify tasks fit within resource capacity
starts = cp.intvar(0, horizon, shape=n_tasks, name="start")
model = cp.Model()
model += cp.Cumulative(starts, durations, ends, demands, capacity=max_capacity)
if model.solve():
print("Schedule feasible")# Model subtype relationships as constraints
# type_of[i] == j means variable i has type j
type_of = cp.intvar(0, n_types-1, shape=n_vars, name="type")
model = cp.Model()
# Assignment x = y requires type_of[x] >= type_of[y] (subtype)
for (x, y) in assignments:
model += type_of[x] >= type_of[y]
model.solve()# Verify state transitions are valid
states = cp.intvar(0, n_states-1, shape=n_steps, name="state")
model = cp.Model()
for t in range(n_steps - 1):
# Encode valid transitions
valid_transitions = []
for (s1, s2) in allowed_transitions:
valid_transitions.append((states[t] == s1) & (states[t+1] == s2))
model += cp.any(valid_transitions)
model.solve()At depth=2, use constraint verification to check proposed changes:
async def verify_with_constraints(change, context):
"""
Verify a proposed change using constraint modeling.
Called at depth=2 for safety verification.
"""
import cpmpy as cp
# Extract invariants from docstrings/comments
invariants = extract_invariants(context)
# Build constraint model
model = cp.Model()
for inv in invariants:
model += encode_invariant(inv)
# Add change effects
model += encode_change(change)
# Check satisfiability
if model.solve():
return {"safe": True, "witness": get_solution(model)}
else:
return {"safe": False, "conflicts": analyze_unsat(model)}Transform Claude Code into a Recursive Language Model (RLM) agent with intelligent orchestration, unbounded context handling, persistent memory, and REPL-based decomposition.
This skill activates when: - Context exceeds complexity threshold (cross-file reasoning, debugging with large output,…