/predicate:engineeringfrom predicate
Enforces core engineering rules for code safety, maintainability, and type safety across all languages. Activates on refactoring, testing, and code review tasks.
Ships in predicate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
These constraints bind every code edit without skill invocation. They are the standing SWE law promoted into the always-on conditioning layer; deviation requires explicit justification and human approval. Detailed elaboration follows in the By-Moment Reference below.
A fix that papers over a symptom — a compatibility shim, a workaround that lets a broken design survive, an exception added to silence a warning — is a defect, not a solution. The cause MUST be fixed. If the fix requires more than local changes, HALT and discuss the scope before proceeding; do not re-architect silently.
Compatibility hacks are forbidden. Additions beyond the stated task are forbidden (the Cutting Imperative: do not add features, abstractions, or cleanup not present in the task). When removing code, cut completely — compatibility scaffolding for removed code is entropy that must later be audited for meaning.
Every error path MUST be handled or propagated, preserving the causal chain.
Error messages MUST state what failed, why, and where — opaque
messages such as "invalid input" are forbidden. Library code MUST NOT panic; it
MUST return Result/Option to the caller. Application entry points convert
errors to exit codes with clear messages. Secrets, tokens, and PII MUST NOT
appear in logs.
All external inputs MUST be validated at system entry points (user input, API responses, file contents, IPC). Internal call sites MUST NOT add defensive guards against conditions the type system or framework invariants already rule out — that is unnecessary error handling that obscures where the real boundaries are. Validate the perimeter; trust what the perimeter enforced.
Use the type system to enforce invariants. any, interface{}, or their
language equivalents MUST NOT be used unless genuinely necessary; when used, the
specific reason MUST be documented inline. Library code MUST NOT panic.
When specification, tests, and code disagree, HALT immediately. Present the discrepancy with evidence from each source and propose a resolution. Do not silently pick a winner; do not proceed until the conflict is resolved.
Stop generating and query for boundary updates whenever:
Generating under unvalidated assumptions is forbidden. Guessing a corrective edit from ambiguous feedback is forbidden. Halting to receive parameters is faster than correcting trajectory drift.
The sections below elaborate how to apply the always-on principles in practice: clarification protocols, uncertainty thresholds, language-specific rules, and conventions. Load this reference when actively writing or reviewing code.
Invoke clarification under these conditions:
| Uncertainty Level | Criteria | Action |
|---|---|---|
| None (0.0) | Clear requirement, established pattern, no ambiguity. | Proceed. If the change is API-breaking, still confirm. |
| Low (0.1-0.3) | Explicit constraints with minor implementation ambiguities. | Present implementation path and query for targeted constraint boundaries before proceeding. |
| High (>0.3) | Multiple valid interpretations, conflicting constraints. | Halt sequence walk and request specific boundary parameter corrections. |
When in doubt, err toward halting. Wasted clarification is cheaper than trajectory drift.
[!NOTE] This table applies to general execution. In C.O.R.E. planning, the ambiguity gate uses a qualitative
OBSTACLESlist: the list must be empty before the sequence may advance from CLARIFY to PLAN. There is no numeric uncertainty field in the C.O.R.E. grammar.
Before writing code, understand the existing landscape:
Pattern Matching: Mimic existing directory structure and coding style strictly. Do not introduce foreign idioms. When uncertain, search for prior art in the repo (e.g., "How are errors handled elsewhere?") and follow established patterns.
Tip: If MCP tools are available, use them first for structural insight before reading individual files.
Never apply band-aid fixes. Analyze root causes; re-architect if the foundation is flawed. If a fix requires more than local changes, stop and discuss the broader implications.
// TODO within the scope of the current task.Check the project version in Cargo.toml, package.json, go.mod, or equivalent manifest:
0.x.x): Stability is secondary. Prefer correct design over backward compatibility.1.0.0+): Breaking changes to public APIs are forbidden without explicit user approval. Present trade-offs and await confirmation.When specification, tests, and code disagree:
This is a collaborative investigation, not a unilateral decision.
Before beginning any non-trivial task:
test_login_fails_with_invalid_credentials).any / interface{} unless necessary.Code goes wrong along two axes, not one. A single-lens review audits half the code.
Structural simplicity (spatial axis): Are independent concerns interleaved? Two ideas braided into one module, one function, or one match arm so that touching one forces you to touch the other = complected. The fix is separation. The dual — one domain concept shattered across multiple locations whose coherence depends on an unenforced rule — is fragmentation. The fix is reunification. See /hickey for the full evaluation procedure.
Volatility alignment (temporal axis): Do boundaries encapsulate axes of change, or do they just group related functionality? Code that works today but places a decision in the wrong layer — where it will rev on a different clock than its neighbors — is a volatility time-bomb. Functional decomposition maximizes the blast radius of change; volatility-based decomposition contains it. See /lowy for the full evaluation procedure.
When reviewing architectural decisions, run both lenses. Findings will predominantly be single-axis. When both lenses converge on the same location, the signal is particularly acute.
Validate external inputs at system boundaries. Never trust user input, API responses, or file contents without validation. Fail fast with clear error messages.
thiserror, fmt.Errorf("%w", ...)).| Context | panic/unwrap Allowed? | Guidance |
|---|---|---|
| Library Code | ❌ No | Return Result/Option. Never panic. |
| Application Entry | ✅ Limited | Convert Result to exit code with clear message. |
| Test Code | ✅ Yes | Panic = test failure; acceptable for brevity. |
| Initialization | ✅ If Unrecoverable | Use expect("clear message"). |
Libraries: No direct output. Return errors/results to the caller.
CLI Applications:
Web/Server Applications:
Update comments and documentation immediately when logic changes. Stale documentation is a bug.
Git hygiene matters to engineering for the same reason type safety does: a
clean, human-reviewable history is the durable interface between the work and
the reviewer who must reconstruct its reasoning from git log alone. The rules
that produce that history are not restated here — they have a single authority:
git push and history rewriting, are the
Commit Gate in rules.md.Engineering's only addition: a diff that compiles and passes tests but smears several logical changes together is still a defect by this skill's standards, not merely a hygiene nit. Atomicity is part of production-grade correctness, not a separable formality.
For multi-step work:
When a mistake is discovered or you find yourself confused:
When modifying an upstream dependency appears to be the correct solution:
When rules appear to conflict, use this hierarchy as a guideline, but remain context-aware:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nrdxp/predicate --plugin predicate35 skills in this plugin
/ai-auditSOP for auditing AI-generated code.
Trigger when:
- Reviewing, refactoring, or cleaning up AI-generated code to prevent regressions or hallucinated APIs.
- Prompt contains: /ai-audit, code audit, AI cleanup, common flaws.
/api-auditProtocol for auditing API surface coherence and type safety.
Trigger when:
- Evaluating API designs, interface type safety, or design elegance.
- Prompt contains: /api-audit, API surface, API coherence, type safety.
/boundaryNormative sufficiency conditions for Initial Boundary Conditions (IBCs)
and the SOP for the cheap-tier boundary refinement loop (/boundary).
Trigger when:
- Crafting, auditing, or refining a prompt/IBC destined for an expensive
(architect-class) model or an autonomous worker dispatch.
- Evaluating whether a task frame is sufficient to bound an agent walk.
- Prompt contains: /boundary, IBC, initial boundary condition, boundary
contract, sufficiency conditions, worker prompt, prompt refinement.
Other plugins' skills for the same job