calendarcn: Skill for Claude Code

.claude/skills/refactor/SKILL.md

refactor is a skill for Claude Code from vmnog/calendarcn. It costs 0 tokens per session (700 once invoked), scanned A, original, MIT.

A code-restructuring guide for changing how code is organised without changing what it does. It covers extracting components and hooks, updating imports, and checking the result.

In plain words
What is it for?
Use it to plan refactors, find modules that depend on changed code, extract reusable frontend pieces, and run code-quality checks.
Why use it?
It reduces the risk of breaking dependent code while improving structure and maintainability.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is vmnog/calendarcn's own configuration. It tells Claude Code how to work on calendarcn 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 calendarcn configures →

Reuse

Borrowing it

Nothing to install: this file belongs to vmnog/calendarcn. 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/vmnog/calendarcn/main/.claude/skills/refactor/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/vmnog/calendarcn

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/skills/vmnog/calendarcn/refactor/github.svg)](https://agentmods.dev/skills/vmnog/calendarcn/refactor)
Your own site
<a href="https://agentmods.dev/skills/vmnog/calendarcn/refactor"><img src="https://agentmods.dev/badge/skills/vmnog/calendarcn/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/skills/vmnog/calendarcn/refactor"><img src="https://agentmods.dev/badge/skills/vmnog/calendarcn/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 700 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.00000 $0.00700
Opus 5.5 $0.00000 $0.00280
Sonnet 5.5 $0.00000 $0.00140
Haiku 4.5 $0.00000 $0.00070

Measured 28d ago against content hash 69a8aebe8e6b, 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 28d 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/skills/refactor/SKILL.md · 97 lines

How it starts

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

Refactor Skill — CalendarCN

When to Use

Invoke when restructuring code, extracting components/hooks, or improving code quality without changing behavior.

Pre-Refactor Checklist

  1. Verify current state passes: pnpm lint && pnpm typecheck && pnpm format:check
  2. Identify the scope: Which files will change?
  3. Check for dependents: Search for imports of the module being refactored
  4. Plan the changes: Describe what moves where before touching code

Refactor Playbook

Extracting a Component

  1. Identify the JSX block to extract
  2. Create src/components/new-component-name.tsx (kebab-case)
  3. Define interface NewComponentNameProps for all data/callbacks needed
  4. Move JSX into new component function
  5. Add "use client" if it uses hooks or browser APIs
  6. Update imports in the parent component
  7. Run pnpm typecheck to catch missed props

Extracting a Hook

  1. Create src/hooks/use-hook-name.ts
  2. Define interface UseHookNameOptions and interface UseHookNameReturn
  3. Follow the ref-sync pattern for all options:
    const optionRef = useRef(option);
    useEffect(() => {
      optionRef.current = option;
    }, [option]);
    
  4. Store global event handlers in refs
  5. Return typed object matching UseHookNameReturn
  6. Clean up all listeners in useEffect return

Extracting Utility Functions

  1. If the function is pure (no React) → src/lib/
  2. If it's event-related → src/lib/event-utils.ts
  3. Add JSDoc comment describing purpose, params, and return
  4. Export function (no default exports for utils)
  5. Add import type for any type dependencies

Moving Types

  • All shared types must live in src/components/week-view-types.ts
  • Component-local types can stay in the component file
  • Never duplicate types — always import from canonical source

Post-Refactor Checklist

  1. Verify: pnpm lint && pnpm typecheck && pnpm format:check
  2. Visual check: pnpm dev — test the affected UI manually
  3. Check imports: No circular dependencies introduced
  4. Check naming: All new files follow kebab-case convention
  5. Check types: No new any types, all imports use import type where applicable
  6. Format: pnpm format to normalize style

Read the full file on GitHub · 97 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. 28d ago First seen · 97 lines · 0 tokens per session scan A 69a8aebe8e6b

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository vmnog/calendarcn (139 stars, last pushed 27d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 700 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-10-02.

Related

Other skills, from other repositories

ui-beats

Use this skill when users want to add, customize, or troubleshoot UI Beats components in React/Next.js projects. It covers component selection, shadcn registry installation from uibeats.com, the UI Beats MCP server, motion and reduced-motion handling, and integration patterns for animated sections.

nikhils4/ui-beats · 62 tokens

react-doctor

Run after making React changes to catch issues early. Use when reviewing code, finishing a feature, or fixing bugs in a React project.

shipkit-io/bones · 31 tokens

migrate-radix-to-base

Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert radix primitives, or switch a shadcn project's base library. Handles single components ("migrate accordion") and whole projects.

shadcn-ui/ui · 61 tokens

magic-ui

Use this skill when users want to add, customize, or troubleshoot Magic UI components in React/Next.js projects. It covers component selection, shadcn registry installation (@magicui/), integration patterns, and practical quality checks for accessibility and maintainability.

magicuidesign/magicui · 56 tokens

kiranism-shadcn-dashboard

Guide for building features, pages, tables, forms, themes, and navigation in this Next.js 16 shadcn dashboard template. Use this skill whenever the user wants to add a new page, create a feature module, build a data table, add a form, configure navigation items, add a theme, set up RBAC access control, or work with…

Kiranism/next-shadcn-dashboard-starter · 142 tokens

tanstack-form

Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid, Lit, and Svelte.

Kiranism/next-shadcn-dashboard-starter · 34 tokens