Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kriscard-refactor
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/refactor
What's inside
- Skill name
refactor- Description
- Behavior-preserving code refactoring. Use when the user asks to simplify complex or duplicated code, improve naming, control flow, or module structure, extract code, or clean up an implementation without changing functionality. Preserve public APIs unless the user explicitly authorizes a change.
- License
- MIT
- Instructions
- 63 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Refactor Make the smallest structural change that produces a specific improvement while preserving the code's observable contract. ## Process ### 1. Define the contract and target Read applicable project guidance, the target code, its callers, and nearby tests. Name one structural target, such as duplicated decisions, nested control flow, mixed responsibilities, unclear ownership, or misleading names. Record the behavior that must remain stable: public APIs, outputs, side effects, error behavior, ordering, and any performance-sensitive invariant. Completion: the target improvement is checkable, the preserved contract is explicit, and affected callers are accounted for. ### 2. Establish preservation evidence Run the narrowest existing checks that exercise the contract. When coverage is missing, add or record a focused characterization check for the behavior at risk. Resolve ambiguous behavior with the user before changing it. Treat a discovered bug, API change, dependency change, or architectural choice as separate work requiring approval. Completion: the baseline result is captured, every behavior at risk has a repeatable check or a reported coverage gap, and ambiguities are resolved or excluded from scope. ### 3. Apply one coherent simplification Keep the change centered on the named structural target. Choose only the techniques it needs: - flatten control flow or make the happy path explicit; - remove genuine duplication or dead code; - rename concepts to match their role; - extract a cohesive function, type, or module; - replace an awkward data structure with one that expresses the invariant. Follow local conventions and keep public APIs, dependencies, and architectural boundaries stable. Supporting renames or extractions belong in the same change only when they serve the target. Treat naming difficulty as design evidence: when several candidate names remain broad, conditional, or need implementation narration, inspect for unclear or mixed responsibilities, an ambiguous representation, or the wrong owner rather than choosing a longer generic label. Use `codebase-design` for module responsibility questions within this workflow. Within the authorized behavior-preserving scope, reshape or split only when the diagnosis supports it and a precise concept name becomes possible; otherwise report the unresolved ambiguity and seek permission for any required public API or architectural change. Naming evidence is neither a suffix blacklist nor an automatic split rule. Established domain vocabulary, short obvious locals, and generated or external names remain valid. Completion: the target is measurably improved and every changed line supports that improvement or preserves its contract. ### 4. Verify the contract Repeat the baseline checks and run the repository's relevant typecheck, tests, lint, or build. Inspect the final diff and affected callers for accidental behavior or API changes. Compare the before and after using the target's evidence: fewer branches, less duplication, narrower ownership, clearer names, or a smaller public surface. Completion: relevant checks pass, or unrelated failures are reported with evidence; compatibility is confirmed; and the improvement is demonstrated by a specific before/after comparison. ## Report State: - the structural target and what changed; - the preservation evidence and commands run; - the concrete before/after improvement; - unresolved coverage gaps, assumptions, or separately scoped opportunities.
From kriscard/Skills, MIT.
More from kriscard/Skills
- 0.642score
vault-audit
kriscard
Audit the vault's PARA and Zettelkasten-inspired Atomic Note organization, linked knowledge, journals, metadata, LLM Wiki quality, and bounded statistics.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
react
kriscard
React component architecture and data-flow guidance for composition, state ownership, Effects, Suspense, async UI, rendering behavior, and measured performance.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
react-hook-form-audit
kriscard
Audit existing React Hook Form code for correctness, accessibility, validation, data ownership, submission, dirty-state, field-array, wizard…
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
ingest
kriscard
Discuss and file an article, URL, video, book note, or selected Inbox source, then reuse a matching Atomic Note or create a human-owned scaffold for the user…
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
architect
kriscard
Guides architecture decisions about service/module boundaries, system trade-offs, ADRs, data flow, rendering strategy, scaling strategy, API protocols…
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
pr-review
kriscard
Bug-first, evidence-only review of a pull request or branch-versus-base diff.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
review
kriscard
Bug-first, evidence-only review of selected code, uncommitted changes, or code modified in the current task.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
frontend
kriscard
Frontend engineering for browser-facing applications: TypeScript trust boundaries, semantic accessibility, UI systems, responsive browser behavior, security…
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
tweet-today
kriscard
Draft specific Twitter/X posts from a concrete work receipt, lesson, opinion, code detail, or user draft.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
react-hook-form
kriscard
Build and modify forms that use React Hook Form or whose project conventions require it.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
create-note
kriscard
Create an Obsidian Inbox capture, a human-owned Atomic Note draft, or approved reusable knowledge from a conversation.
SkillAFreshness: A★ 14Claude Code +9 - 0.639score
spec
kriscard
Builds reviewed requirements, technical design, and an executable implementation plan from an issue URL or requirements text, then stops at approval.
SkillAFreshness: A★ 14Claude Code +9
Signals
- Stars
- 14
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 7, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/kriscard/Skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from kriscard
- 0.642score
react-hook-form
kriscard
Build and modify forms that use React Hook Form or whose project conventions require it.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
pr-review
kriscard
Bug-first, evidence-only review of a pull request or branch-versus-base diff.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
review
kriscard
Bug-first, evidence-only review of selected code, uncommitted changes, or code modified in the current task.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
tweet-today
kriscard
Draft specific Twitter/X posts from a concrete work receipt, lesson, opinion, code detail, or user draft.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
create-note
kriscard
Create an Obsidian Inbox capture, a human-owned Atomic Note draft, or approved reusable knowledge from a conversation.
SkillAFreshness: A★ 14Claude Code +9 - 0.642score
architect
kriscard
Guides architecture decisions about service/module boundaries, system trade-offs, ADRs, data flow, rendering strategy, scaling strategy, API protocols…
SkillAFreshness: A★ 14Claude Code +9
Cite this page
refactor skill. Agent Mart. https://agentmart.dev/skills/kriscard-refactor (last updated 2026-10-24)