add-rule

add-rule is a skill for Claude Code from a-pavithraa/springboot-skills-marketplace. It costs 105 tokens per session (1,083 once invoked), scanned A, original, MIT.

A method for turning an architectural rule into an ArchUnit test that the build enforces. ArchUnit is a testing library that checks whether code follows structural rules, such as which packages or modules may access a database.

In plain words
What is it for?
Use it to enforce rules about package dependencies, permitted callers, service responsibilities, and other code structure. Use a property test instead for value-based rules such as preventing a balance from becoming negative.
Why use it?
It records project-specific design decisions in an automated check instead of relying only on reviewers to remember them. The build can then flag a later change that breaks the agreed structure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions AGENTS.md.

Part of the springboot-architecture plugin — 9 skills, 3 hooks shipped together

Good fit Use it to enforce rules about package dependencies, permitted callers, service responsibilities, and other code structure. Use a property test instead for value-based rules such as preventing a balance from becoming negative.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/a-pavithraa/springboot-skills-marketplace/add-rule
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.

Any agent
npx skills add a-pavithraa/springboot-skills-marketplace --skill add-rule
Clone the repo
git clone --depth 1 https://github.com/a-pavithraa/springboot-skills-marketplace

Made for: Claude Code.

Or install springboot-architecture, the plugin that ships this one along with the rest of its 9 skills, 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 add-rule

README.md
[![agentmods](https://agentmods.dev/badge/skills/a-pavithraa/springboot-skills-marketplace/add-rule/github.svg)](https://agentmods.dev/skills/a-pavithraa/springboot-skills-marketplace/add-rule)
Your own site
<a href="https://agentmods.dev/skills/a-pavithraa/springboot-skills-marketplace/add-rule"><img src="https://agentmods.dev/badge/skills/a-pavithraa/springboot-skills-marketplace/add-rule/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-rule

Your own site · 80×15
<a href="https://agentmods.dev/skills/a-pavithraa/springboot-skills-marketplace/add-rule"><img src="https://agentmods.dev/badge/skills/a-pavithraa/springboot-skills-marketplace/add-rule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,083 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00105 $0.01083
Opus 5.5 $0.00042 $0.00433
Sonnet 5.5 $0.00021 $0.00217
Haiku 4.5 $0.00011 $0.00108

Measured 4d ago against content hash 6b750b3c3e75, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-rule 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.

plugins/springboot-architecture/skills/spring-boot-team-harness/assets/project-skills/add-rule/SKILL.md · 23 lines

How it starts

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

Add a rule

The harness's CodeRulesTests holds rules every Spring Boot project shares. A rule that belongs to this project, such as "only caller reads the patient database" or "only AccessDecisions makes an AccessGrant", goes in its own test, so the build fails on the next break instead of a reviewer having to remember it.

When asked to find rules nobody wrote down, list candidates before writing any test. A candidate is a pattern every current caller follows: one package builds a type, one module asks for a bean, no controller touches a lookup. Give each one its evidence (the callers that follow it, a fix in git log that restored it, a decision record that implies it) and any code that already breaks it, which may be a bug. The user picks which ones become rules; take each through the steps below. A rule about values rather than structure, such as "a balance never goes negative", is a property test, not an ArchUnit rule: use writing-springboot-tests.

  1. Write the rule in one sentence, with its reason, and agree it with the user. Add that sentence to the Failures list in REVIEW.md, since a reviewer must still catch what the test can't see.
  2. Pick the shape that fits. Each is one ArchUnit rule on the production classes:
    • Only package P may construct type T. For an access proof, a grant, a scope, or a token that other modules receive but must never make. noClasses().that().resideOutsideOfPackage("{{BASE_PACKAGE}}.access..").should().callConstructor(Grant.class, ...). Spring Modulith lets any module use a type a published method returns, so this is the only thing that stops a module building its own proof. Also cover static factories: .orShould().callMethod(Grant.class, "of", ...).
    • Only package P may ask for bean B. For a datasource, a client or a connection picked by bean name. Check every way Spring injects it: @Qualifier("name") on a parameter, field, constructor or method; an annotation that carries @Qualifier itself; @Resource(name = ...); a setter @Resource named after the bean; and a bare parameter or field named after the bean, which Spring matches when no candidate is @Primary. ArchUnit doesn't read parameter names; parameter.getOwner().reflect() does, since Boot compiles with -parameters.
    • No class of kind K may depend on type or package X. For a lookup that trusts its input, a vendor type that must stay in one module, or a module's named interface meant for background jobs only. noClasses().that().areMetaAnnotatedWith(Controller.class).should().dependOnClassesThat(...).
  3. Create src/test/java/{{BASE_PATH}}/<Rule>ArchRuleTests.java. The name ends in ArchRuleTests, which no domain test takes by accident: the harness's guard refuses edits to such a file, CI fails a pull request that changes it without the harness-rule-change label, and the Stop hook runs it with the other fast gates. Import the classes once, with ImportOption.Predefined.DO_NOT_INCLUDE_TESTS, and give the rule a because that says what to do instead.
  4. Prove the rule fires. A rule that matches nothing passes forever. Put a class that breaks it under src/test/java/{{BASE_PATH}}/archfixture/, one per way of breaking it, and add a second test that imports only those fixtures with new ClassFileImporter().importClasses(...) and asserts rule.evaluate(fixtures).getFailureReport().getDetails() names each one. For the bean-name shape, that is seven fixtures: constructor qualifier, field qualifier, @Bean method parameter, name only, @Resource, composed qualifier, setter.
  5. Run {{VERIFY}}. If existing code breaks the rule, don't weaken it: list the breaks for the user, who decides between fixing them in this change and recording them in docs/ as known drift, with a test that passes while the break exists and a comment saying to turn it around once fixed.
  6. If the rule guards a decision, add the test's name to that decision's record, so a reader of the decision finds its guard.

Read the full file on GitHub · 23 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 · 23 lines · 105 tokens per session scan A 6b750b3c3e75

Subscribe to this mod's changes

add-rule is a skill published in the GitHub repository a-pavithraa/springboot-skills-marketplace (82 stars, last pushed 4d ago), licensed MIT. It adds 105 tokens to every session and 1,083 once invoked, about $0.0004 per session on Opus 5.5. 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-12-01.

Related

add-rule compared with skills from other repositories

add-rule next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
add-rulea-pavithraa/springboot-skills-marketplaceSkill824d agoMITA105Claude Code
understand-diffEgonex-AI/Understand-AnythingSkill95k10d agoMITA27Claude Code
auto-test-codehuangwb8/skillsSkill515d agoMITA56Claude Code, Codex
git-pr-reviewhuangwb8/skillsSkill515d agoMITA76Claude Code, Codex
reviewdatit309/supergraphSkill2310d agoMITA24Claude Code
code-reviewerhuangwb8/skillsSkill515d agoMITA40Claude Code, Codex
flutter-dart-code-reviewdatit309/supergraphSkill2310d agoMITA56Claude Code