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.
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifactsWrote 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.
[](https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/refactor-patterns)<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/refactor-patterns"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/refactor-patterns/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.
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/refactor-patterns"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/refactor-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01965 |
| Opus 5.5 | $0.00000 | $0.00786 |
| Sonnet 5.5 | $0.00000 | $0.00393 |
| Haiku 4.5 | $0.00000 | $0.00197 |
Grade A, and why
refactor-patterns 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 358 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Patterns Reference
SOLID principles, code smells catalog, and refactoring decision frameworks for C#/.NET and React/TypeScript.
See also:
clean-code-dotnetskill for comprehensive clean code patterns.
SOLID Principles Examples
Single Responsibility Principle (SRP)
// ❌ BEFORE: Multiple responsibilities
class UserManager
{
public async Task CreateUserAsync(CreateUserDto data)
{
// Validate, save, email, log, cache - all mixed
if (string.IsNullOrEmpty(data.Email)) throw new Exception();
await _dbContext.Users.AddAsync(new User(data));
await _emailService.SendWelcomeEmail(data.Email);
_logger.LogInformation("User created");
}
}
// ✅ AFTER: Separated concerns
class UserValidator : AbstractValidator<CreateUserDto> { }
class UserRepository : IUserRepository { }
class WelcomeEmailSender : IWelcomeEmailSender { }
class UserAppService : ApplicationService
{
private readonly IUserRepository _repository;
private readonly IWelcomeEmailSender _emailSender;
public async Task<UserDto> CreateAsync(CreateUserDto input)
{
var user = await _repository.InsertAsync(new User(input));
await _emailSender.SendAsync(user.Email);
return ObjectMapper.Map<User, UserDto>(user);
}
}
Open/Closed Principle (OCP)
// ❌ BEFORE: Modification required for new types
class DiscountCalculator
{
public decimal Calculate(Order order, string discountType)
{
if (discountType == "percentage") return order.Total * 0.1m;
else if (discountType == "fixed") return 10m;
// Must add more else-if for new discount types!
return 0;
}
}
// ✅ AFTER: Open for extension, closed for modification
interface IDiscountStrategy
{
decimal Calculate(Order order);
}
class PercentageDiscount : IDiscountStrategy
{
private readonly decimal _percentage;
public PercentageDiscount(decimal percentage) => _percentage = percentage;
public decimal Calculate(Order order) => order.Total * _percentage;
}
class FixedDiscount : IDiscountStrategy
{
private readonly decimal _amount;
public FixedDiscount(decimal amount) => _amount = amount;
public decimal Calculate(Order order) => _amount;
}
class DiscountCalculator
{
public decimal Calculate(Order order, IDiscountStrategy strategy)
=> strategy.Calculate(order);
}
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.
- 3mo ago First seen · 358 lines · 0 tokens per session scan A 9220b7b252cb
refactor-patterns is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (25 stars, last pushed 8mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,965 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.
refactor-patterns compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactor-patternsthapaliyabikendra/ai-artifacts | Command | 25 | 8mo ago | Apache-2.0 | A | 0 | Claude Code |
| review-branchdamusix/atomic-claude | Command | 117 | yesterday | MIT | A | 35 | Claude Code |
| diff-reviewcoco-research/coco | Command | 323 | today | Apache-2.0 | A | 11 | Claude Code |
| initazrtydxb/procoder | Command | 212 | yesterday | Apache-2.0 | A | 16 | Claude Code |
| spec-trace-requirementsrjmurillo/ai-agents | Command | 50 | today | Apache-2.0 | A | 0 | GitHub Copilot |
| merge-conflict-analysisrjmurillo/ai-agents | Command | 50 | today | Apache-2.0 | A | 0 | GitHub Copilot |
| refactorRchGrav/claudebox | Command | 1.2k | 2mo ago | MIT | A | 9 | Claude Code |