shared-constraints

shared-constraints is an agent for coding agents from oprogramadorreal/optimus-claude. It costs 0 tokens per session (1,171 once invoked), scanned A, original, MIT.

Shared rules for code-review agents. They define review quality standards, issues to exclude, and when a reviewer may examine nearby code.

In plain words
What is it for?
Guiding automated code reviews, especially when deciding whether a finding is new, relevant to changed code, and worth reporting.
Why use it?
They reduce false positives and discourage suggestions that add complexity without addressing a specific bug, security issue, or project rule.

Agent

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the optimus plugin — 19 skills, 15 agents, 3 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/oprogramadorreal/optimus-claude/shared-constraints
Clone the repo
git clone --depth 1 https://github.com/oprogramadorreal/optimus-claude

Or install optimus, the plugin that ships this one along with the rest of its 19 skills, 15 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shared-constraints

README.md
[![agentmods](https://agentmods.dev/badge/agents/oprogramadorreal/optimus-claude/shared-constraints.svg)](https://agentmods.dev/agents/oprogramadorreal/optimus-claude/shared-constraints)
Your own site
<a href="https://agentmods.dev/agents/oprogramadorreal/optimus-claude/shared-constraints"><img src="https://agentmods.dev/badge/agents/oprogramadorreal/optimus-claude/shared-constraints.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01171
Opus 5 $0.00000 $0.00585
Sonnet 5 $0.00000 $0.00234
Haiku 4.5 $0.00000 $0.00117

Measured 4d ago against content hash 83171b5e4e97, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

shared-constraints scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/code-review/agents/shared-constraints.md · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code-Review Shared Constraints

Read $CLAUDE_PLUGIN_ROOT/references/shared-agent-constraints.md for the base agent constraints, quality bar, exclusion rules, scope-expansion procedure, and false-positive guidance that apply to all analysis agents. The following are code-review addendums.

Quality Bar (addition)

  • Not be pre-existing (in unchanged code)

All Agents Exclude (additions)

  • Input-dependent issues
  • Pre-existing issues in unchanged code (unless security/bug directly adjacent to changed lines)
  • Add-complexity suggestions without a specific bug or guideline. Any finding whose suggested fix would add code (new helpers, abstractions, validation, branches, files, or net-add LOC) must cite either (a) a specific bug or security issue it prevents, at any severity, or (b) an explicit project guideline rule it satisfies. Otherwise omit — code that is already simple is a valid outcome. Prefer findings that remove complexity over findings that add it. This blocks "could be more thorough / more abstracted / more defensive" suggestions, not legitimate fixes for real defects.

Scope-expansion carve-out

The base "Structural-Neighbor Scope Expansion" procedure applies, with one carve-out: cross-file consistency findings are allowed even when the related file is outside the original scope — an explicit exception to the pre-existing-code exclusion above. If the consistency fix would add a pattern to the related file rather than remove one, the Add-complexity bar still applies — and verify that the target file's APIs/dependencies actually support the pattern before reporting (never propose "use flag --X on tool Y" without evidence that Y accepts --X).

Output format (all agents)

Report each finding in this exact shape. Every agent uses Current:/Suggested: — never Code:/Fix::

  • File: file:line
  • Category: [agent-specific — see your prompt file]
  • Confidence: High | Medium | Low — Low means you could not confirm the evidence yourself. Use it; do not round up to Medium and do not drop the finding. Step 6 validation promotes or drops it.
  • Guideline: [exact project-doc rule, "General: ", or for Intent Mismatch the literal Intent (see Intent claim)]
  • Intent claim: [Intent Mismatch only — the quoted claim from ## Intent]
  • Issue: [concrete description]
  • Current: [relevant snippet — max 5 lines]
  • Suggested: [fix or recommendation — max 5 lines]

Read the full file on GitHub · 55 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 55 lines · 0 tokens per session scan A 83171b5e4e97

Subscribe to this mod's changes

shared-constraints is an agent published in the GitHub repository oprogramadorreal/optimus-claude (73 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,171 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.