migrate-struts

migrate-struts is a skill for Claude Code, Codex from Phaedra-Solutions/cursor-rules. It costs 120 tokens per session (1,395 once invoked), scanned A, original, MIT.

A guided plan for moving a Java web application away from Apache Struts, an older framework for handling web pages and requests. It supports upgrading Struts 2 or gradually replacing Struts with Spring MVC on Spring Boot.

In plain words
What is it for?
Use it to inventory Struts actions, forms, validation, views and routes; add tests that capture current behaviour; and migrate URLs incrementally through a gateway.
Why use it?
It helps teams leave unsupported or vulnerable Struts versions without replacing the whole application at once. It maps the old routes and screens, contains the remaining legacy code, and checks that behaviour stays the same.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inventory Struts actions, forms, validation, views and routes; add tests that capture current behaviour; and migrate URLs incrementally through a gateway.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/phaedra-solutions/cursor-rules/migrate-struts
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 Phaedra-Solutions/cursor-rules --skill migrate-struts
Clone the repo
git clone --depth 1 https://github.com/Phaedra-Solutions/cursor-rules

Made for: Claude Code, Codex.

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 migrate-struts

README.md
[![agentmods](https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/migrate-struts/github.svg)](https://agentmods.dev/skills/phaedra-solutions/cursor-rules/migrate-struts)
Your own site
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/migrate-struts"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/migrate-struts/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 migrate-struts

Your own site · 80×15
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/migrate-struts"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/migrate-struts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,395 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.00120 $0.01395
Opus 5.5 $0.00048 $0.00558
Sonnet 5.5 $0.00024 $0.00279
Haiku 4.5 $0.00012 $0.00139

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

Security

Grade A, and why

migrate-struts 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 3d 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/migrate-struts/SKILL.md · 68 lines

How it starts

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

Migrate off Apache Struts

When to use

  • The project uses Struts 1 (EOL 2013) or an EOL Struts 2 line (2.3, 2.5), or the user wants to leave Struts.
  • A Struts 2 security bulletin applies and the fix needs a newer line (7.4.0 or 6.12.0 as of Oct 2026).

Before you start

  • Inventory (write it to docs/struts-inventory.md or the PR):
    • Struts version and plugins; Java version; servlet container;
    • every action mapping (struts.xml / struts-config.xml): URL, action class, form bean, validation, results/forwards, interceptors;
    • views (JSP, Tiles, FreeMarker), custom tags, file uploads, session attributes, filters and authentication.
  • Ask the user:
    • upgrade Struts 2 to a supported line, or replace the web tier (required for Struts 1; default target Spring MVC on Spring Boot 4.1, Java 21);
    • whether a gateway or reverse proxy can route by path (for the strangler approach);
    • whether new dependencies may be installed (core/supply-chain).
  • Contain the old app first if it's internet-facing (see the containment section of legacy/struts): isolation, WAF rules, devMode off.
  • Working tree clean; new branch.

Steps

A. Upgrade Struts 2 (2.5 → 6.x → 7.x)

  1. Bump struts2-core and all struts2-* plugins together to 6.12.0; follow the 2.5 → 6 notes: Action File Upload interceptor for uploads (S2-066/067), @StrutsParameter or acceptParamNames where parameter annotations are required, removed deprecated tags and constants; keep devMode=false and Strict Method Invocation.
  2. Run the tests and the security regression tests; deploy to staging.
  3. Then 7.4.0: Java 17+, Jakarta Servlet 6 container (Tomcat 10.1+), com.opensymphony.xwork2 → org.apache.struts2 package renames, javax.servlet → jakarta.servlet (OpenRewrite org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta helps with the namespace).
  4. Stop after each step for review.

B. Replace the web tier (Struts 1, or leaving Struts 2)

  1. Characterization tests: HTTP-level tests per action (request → status, redirect/forward, key page content, validation messages) that can run against either implementation.
  2. Extract services: move business logic out of Action.execute() and ActionForms into plain service classes with unit tests; the old actions call them.
  3. New app: a Spring Boot 4.1 app with Spring Security; same database and services (shared module or a copied library); views in Thymeleaf or JSP to keep markup close.
  4. Gateway routing: the gateway (or the old app's front controller) routes migrated paths to the new app; everything else stays on Struts. Share authentication through the gateway, an SSO/OIDC provider or a signed token; avoid sharing HTTP sessions between JVMs unless you already use an external session store.
  5. Port route by route: each action becomes a @Controller method; ActionForm → a validated form object (@Valid with Bean Validation); ActionMessages → BindingResult; forwards → view names or redirects; Tiles → Thymeleaf layouts. Run the characterization tests against the new route, then switch it in the gateway.
  6. Uploads and downloads: MultipartFile with size limits, type allowlists and storage outside the web root.
  7. Retire: when no routes remain, remove the Struts app, its WAF exceptions and its deployment.
  8. Show each route's diff and test results; wait for approval before switching traffic. Commit only when asked (git-commit skill).

Read the full file on GitHub · 68 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. 3d ago First seen · 68 lines · 120 tokens per session scan A 6fa3d458716e

Subscribe to this mod's changes

migrate-struts is a skill published in the GitHub repository Phaedra-Solutions/cursor-rules (4 stars, last pushed 2d ago), licensed MIT. It adds 120 tokens to every session and 1,395 once invoked, about $0.0005 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-11-01.