sgroy10 avatar

Speclock

sgroy10/speclock

If you've ever told an AI "don't touch the auth system" only to watch it refactor your auth logic three sessions later, this is the fix. SpecLock enforces constraints from CLAUDE.md and .cursorrules files as hard rules, not suggestions. It exposes 51 MCP tools that semantically analyze proposed changes and block violations before they happen. The engine catches euphemisms like "clean up old data" when you've locked deletion, and understands "streamline checkout" conflicts with "never touch payment flow". Ships with a pre-commit hook, auto-installer for Claude Code, Cursor, Windsurf, and a doctor command to verify everything is wired correctly. Default mode warns loudly without blocking, but strict mode stops the AI cold.

GitHub stars
25
tools
44
transport
STDIO
last updated
Apr 9, 2026

Tools

44 tools

Public tool metadata for what this MCP can expose to an agent.

speclock_initInitialize SpecLock in the current project directory.

Initialize SpecLock in the current project directory.

No parameter schema in public metadata yet.

speclock_get_contextTHE KEY TOOL. Returns the full structured context pack.1 params

THE KEY TOOL. Returns the full structured context pack.

Parameters* required
formatstring
one of markdown · jsondefault: markdown
speclock_set_goalSet or update the project goal.1 params

Set or update the project goal.

Parameters* required
textstring
speclock_add_lockAdd a non-negotiable constraint (SpecLock).3 params

Add a non-negotiable constraint (SpecLock).

Parameters* required
sourcestring
one of user · agentdefault: agent
tagsarray
textstring
speclock_remove_lockRemove (deactivate) a SpecLock by its ID.1 params

Remove (deactivate) a SpecLock by its ID.

Parameters* required
lockIdstring
speclock_add_decisionRecord an architectural or design decision.3 params

Record an architectural or design decision.

Parameters* required
sourcestring
one of user · agentdefault: agent
tagsarray
textstring
speclock_add_noteAdd a pinned note for reference.2 params

Add a pinned note for reference.

Parameters* required
pinnedboolean
default: true
textstring
speclock_set_deploy_factsRecord deployment configuration facts.5 params

Record deployment configuration facts.

Parameters* required
autoDeployboolean
branchstring
notesstring
providerstring
urlstring
speclock_log_changeManually log a significant change.2 params

Manually log a significant change.

Parameters* required
filesarray
summarystring
speclock_get_changesGet recent file changes tracked by SpecLock.1 params

Get recent file changes tracked by SpecLock.

Parameters* required
limitinteger
default: 20
speclock_get_eventsGet the event log, optionally filtered by type.3 params

Get the event log, optionally filtered by type.

Parameters* required
limitinteger
default: 50
sincestring
typestring
speclock_check_conflictCheck if a proposed action conflicts with any active SpecLock. In hard mode, blocks above threshold.1 params

Check if a proposed action conflicts with any active SpecLock. In hard mode, blocks above threshold.

Parameters* required
proposedActionstring
speclock_session_briefingStart a new session and get a full briefing.1 params

Start a new session and get a full briefing.

Parameters* required
toolNamestring
one of claude-code · cursor · codex · windsurf · cline · unknowndefault: unknown
speclock_session_summaryEnd the current session and record what was accomplished.1 params

End the current session and record what was accomplished.

Parameters* required
summarystring
speclock_checkpointCreate a named git tag checkpoint for easy rollback.1 params

Create a named git tag checkpoint for easy rollback.

Parameters* required
namestring
speclock_repo_statusGet current git repository status.

Get current git repository status.

No parameter schema in public metadata yet.

speclock_suggest_locksAI-powered lock suggestions based on project patterns.

AI-powered lock suggestions based on project patterns.

No parameter schema in public metadata yet.

speclock_detect_driftScan recent changes for constraint violations.

Scan recent changes for constraint violations.

No parameter schema in public metadata yet.

speclock_healthHealth check with completeness score and multi-agent timeline.

Health check with completeness score and multi-agent timeline.

No parameter schema in public metadata yet.

speclock_apply_templateApply a pre-built constraint template (nextjs, react, express, supabase, stripe, security-hardened).1 params

Apply a pre-built constraint template (nextjs, react, express, supabase, stripe, security-hardened).

Parameters* required
namestring
speclock_reportViolation report — how many times SpecLock blocked changes.

Violation report — how many times SpecLock blocked changes.

No parameter schema in public metadata yet.

speclock_auditAudit staged files against active locks.

Audit staged files against active locks.

No parameter schema in public metadata yet.

speclock_verify_auditVerify the integrity of the HMAC audit chain.

Verify the integrity of the HMAC audit chain.

No parameter schema in public metadata yet.

speclock_export_complianceGenerate compliance reports (SOC 2, HIPAA, CSV).1 params

Generate compliance reports (SOC 2, HIPAA, CSV).

Parameters* required
formatstring
one of soc2 · hipaa · csv
speclock_set_enforcementSet enforcement mode: advisory (warn) or hard (block).2 params

Set enforcement mode: advisory (warn) or hard (block).

Parameters* required
blockThresholdinteger
default: 70
modestring
one of advisory · hard
speclock_override_lockOverride a lock with justification. Logged to audit trail.3 params

Override a lock with justification. Logged to audit trail.

Parameters* required
actionstring
lockIdstring
reasonstring
speclock_semantic_auditSemantic pre-commit: analyzes code changes vs locks.

Semantic pre-commit: analyzes code changes vs locks.

No parameter schema in public metadata yet.

speclock_override_historyShow lock override history.1 params

Show lock override history.

Parameters* required
lockIdstring
speclock_policy_evaluateEvaluate policy-as-code rules against proposed actions.2 params

Evaluate policy-as-code rules against proposed actions.

Parameters* required
actionTypestring
filesarray
speclock_policy_managePolicy CRUD: list, add, remove policy rules.1 params

Policy CRUD: list, add, remove policy rules.

Parameters* required
actionstring
one of list · add · remove
speclock_telemetryOpt-in usage analytics summary.1 params

Opt-in usage analytics summary.

Parameters* required
actionstring
one of status · enable · disable · report
speclock_guard_fileAdd SPECLOCK-GUARD header to lock specific files.2 params

Add SPECLOCK-GUARD header to lock specific files.

Parameters* required
filestring
lockIdstring
speclock_auto_guardAuto-guard files related to lock keywords.

Auto-guard files related to lock keywords.

No parameter schema in public metadata yet.

speclock_add_typed_lockAdd typed constraint (numerical/range/state/temporal).6 params

Add typed constraint (numerical/range/state/temporal).

Parameters* required
constraintTypestring
one of numerical · range · state · temporal
descriptionstring
metricstring
operatorstring
unitstring
valuevalue
speclock_check_typedCheck proposed values against typed constraints.2 params

Check proposed values against typed constraints.

Parameters* required
metricstring
valuevalue
speclock_list_typed_locksList all typed constraints with current thresholds.

List all typed constraints with current thresholds.

No parameter schema in public metadata yet.

speclock_update_thresholdUpdate typed lock thresholds dynamically.3 params

Update typed lock thresholds dynamically.

Parameters* required
lockIdstring
operatorstring
valuevalue
speclock_compile_specCompile natural language (PRDs, READMEs) into structured constraints via Gemini Flash.2 params

Compile natural language (PRDs, READMEs) into structured constraints via Gemini Flash.

Parameters* required
autoApplyboolean
default: false
textstring
speclock_build_graphBuild/refresh code dependency graph from imports (JS/TS/Python).

Build/refresh code dependency graph from imports (JS/TS/Python).

No parameter schema in public metadata yet.

speclock_blast_radiusCalculate blast radius — transitive dependents, impact %, depth.1 params

Calculate blast radius — transitive dependents, impact %, depth.

Parameters* required
filestring
speclock_map_locksMap active locks to actual code files via the dependency graph.

Map active locks to actual code files via the dependency graph.

No parameter schema in public metadata yet.

speclock_review_patchALLOW/WARN/BLOCK verdict — combines semantic conflict + lock-file mapping + blast radius.2 params

ALLOW/WARN/BLOCK verdict — combines semantic conflict + lock-file mapping + blast radius.

Parameters* required
descriptionstring
filesarray
speclock_review_patch_diffDiff-native review — parses actual diffs for interface breaks, protected symbols, dependency drift, schema changes.2 params

Diff-native review — parses actual diffs for interface breaks, protected symbols, dependency drift, schema changes.

Parameters* required
descriptionstring
diffstring
speclock_parse_diffParse unified diff into structured changes — imports, exports, symbols, routes, schema detection.1 params

Parse unified diff into structured changes — imports, exports, symbols, routes, schema detection.

Parameters* required
diffstring

Sponsors

Readme

SpecLock

Rules files tell AI what not to change.
SpecLock enforces them.

Stop Claude Code, Cursor, Codex, Windsurf, and other AI coding tools from crossing project constraints you already wrote in CLAUDE.md, AGENTS.md, and .cursorrules.


View the full README on GitHub

Details

Repository
github.com/sgroy10/speclock
Package
speclock
Transport
STDIO
Registry
MCP registry, active