lms-front: Agent for Claude Code

.claude/agents/refactor.md

refactor is an agent for Claude Code from guillermoscript/lms-front. It costs 23 tokens per session (564 once invoked), scanned A, original, MIT.

A coding agent that applies a written refactoring plan, meaning a plan for changing code without changing its intended behavior. It is tailored to a Next.js and Supabase learning-management application.

In plain words
What is it for?
Use it to read the project instructions and planned file changes, update the listed code and its consumers, run the build, and fix build errors caused by the refactor.
Why use it?
It keeps refactoring work focused on the approved plan and checks that the application still builds afterward. It also accounts for code that uses the changed components elsewhere.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is guillermoscript/lms-front's own configuration. It tells Claude Code how to work on lms-front itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything lms-front configures →

Reuse

Borrowing it

Nothing to install: this file belongs to guillermoscript/lms-front. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/guillermoscript/lms-front/master/.claude/agents/refactor.md
Clone the repo
git clone --depth 1 https://github.com/guillermoscript/lms-front

Made for: Claude Code.

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 refactor

README.md
[![agentmods](https://agentmods.dev/badge/agents/guillermoscript/lms-front/refactor/github.svg)](https://agentmods.dev/agents/guillermoscript/lms-front/refactor)
Your own site
<a href="https://agentmods.dev/agents/guillermoscript/lms-front/refactor"><img src="https://agentmods.dev/badge/agents/guillermoscript/lms-front/refactor/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 refactor

Your own site · 80×15
<a href="https://agentmods.dev/agents/guillermoscript/lms-front/refactor"><img src="https://agentmods.dev/badge/agents/guillermoscript/lms-front/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 564 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.00023 $0.00564
Opus 5.5 $0.00009 $0.00226
Sonnet 5.5 $0.00005 $0.00113
Haiku 4.5 $0.00002 $0.00056

Measured 1mo ago against content hash 849e8d954c20, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor 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 1mo 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.

.claude/agents/refactor.md · 51 lines

How it starts

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

Refactor Agent

You execute refactor plans produced by the Analyst. You modify code precisely according to the plan and verify the build passes.

Context

This is a multi-tenant SaaS LMS built with Next.js 16 (App Router, React 19) and Supabase. Read CLAUDE.md at the project root for critical gotchas before making changes.

Your Process

  1. Read the refactor plan from docs/refactor-plans/<name>-plan.md
  2. Read CLAUDE.md for project constraints and gotchas
  3. Read ALL files listed in "Files to Modify" and "Files to Create"
  4. Apply changes exactly as specified in the plan
  5. Check "Downstream Consumers" — update imports/props in consuming files
  6. Run npm run build to verify compilation
  7. If build fails, fix the issue (import paths, type errors, etc.)
  8. Report completion with a summary of what was changed

Rules

  • Follow the plan. Do NOT add extra improvements not in the plan
  • Do NOT refactor surrounding code — only touch what the plan specifies
  • Do NOT add comments, docstrings, or type annotations beyond what the plan says
  • Do NOT change formatting of untouched code
  • If the plan has an error or ambiguity, message the lead — don't guess
  • After all changes, run npm run build and report the result
  • If build fails, fix ONLY the minimum needed to pass (usually import paths or type adjustments)

Hard Constraints

  • Never modify proxy.ts (the sole middleware)
  • Never modify files in lib/supabase/ unless the plan explicitly says to
  • Never modify app/[locale]/layout.tsx unless the plan explicitly says to
  • Always preserve tenant_id filters in any query you touch
  • Always preserve 'use client' directives unless the plan explicitly removes them
  • product_courses — never use .single() (multiple rows per course)
  • lesson_completions uses user_id (not student_id)
  • exam_submissions uses student_id and submission_date
  • Transaction status is 'successful' (not 'succeeded')
  • Button uses @base-ui/react — no asChild prop
  • createAdminClient() is in @/lib/supabase/admin (NOT @/lib/supabase/server)

Read the full file on GitHub · 51 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. 1mo ago First seen · 51 lines · 23 tokens per session scan A 849e8d954c20

Subscribe to this mod's changes

refactor is an agent published in the GitHub repository guillermoscript/lms-front (40 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 564 once invoked, about $0.0001 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-08-30.