Skills component-refactoring
๐Ÿ“ฆ

component-refactoring

Content revision r1 Safe โš™๏ธ External commands

Refactor React Components Safely

Large React components slow review, testing, and maintenance. This skill guides hook extraction, component splitting, and Dify-aligned verification.

Supports: Claude Codex Code(CC)
๐Ÿ“Š 75 Adequate

Install with my Agent

Copy this request to your Agent. It includes the canonical Skill page and manifest.

Agent request
Review the Skillstore skill "component-refactoring" from https://skillstore.io/skills/langgenius-component-refactoring.md and its manifest at https://skillstore.io/api/skills/langgenius-component-refactoring/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.

Your Agent should still show its plan and request any confirmation required by the security policy.

Test it

Using "component-refactoring". A Dify configuration component has 420 lines and many state groups.

Expected outcome:

  • Recommended splitting header, content, debug, and modal areas.
  • Moved model configuration state into a dedicated hook.
  • Added verification steps for complexity, linting, typing, and tests.

Using "component-refactoring". A workflow node component mixes panel UI, interaction state, and service calls.

Expected outcome:

  • Suggested separate panel and node files.
  • Moved interaction handlers into a focused hook.
  • Kept service hooks aligned with Dify conventions.

Using "component-refactoring". A form component repeats validation, submission, and modal logic.

Expected outcome:

The result describes a form hook, a modal manager, and a verification sequence for behavior preservation.

Security Audit

Safe
v6 โ€ข 7/9/2026 Open versioned report

The static alerts are false positives caused by Markdown backticks, TypeScript examples, Object.keys, and ordinary callback names in documentation. I found no prompt injection, data exfiltration intent, or malicious execution behavior in the cited files. The skill documents local Dify pnpm commands, so users should apply normal review before running project scripts.

4
Files scanned
1,774
Lines analyzed
0
Review items
0
False positives ignored
No confirmed security findings were detected by the latest completed static and semantic audit. This does not prove the skill has no side effects.
Audited by: codex View Audit History โ†’
Share & cite this report

Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.

Open versioned report
Security Assessment

Copy report link

https://skillstore.io/skills/langgenius-component-refactoring/audits/6?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report

Markdown badge

[![Skillstore security assessment](https://skillstore.io/badges/skills/langgenius-component-refactoring/security.svg)](https://skillstore.io/skills/langgenius-component-refactoring?utm_source=security_passport_badge)

HTML badge

<a href="https://skillstore.io/skills/langgenius-component-refactoring?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/langgenius-component-refactoring/security.svg" alt="Skillstore security assessment" loading="lazy"></a>

Embed card

<iframe src="https://skillstore.io/embed/skills/langgenius-component-refactoring.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>
Academic citations (APA ยท BibTeX ยท CFF)

APA citation

langgenius. (2026). component-refactoring security audit report (audit version 6) [Author version unspecified]. Skillstore. https://skillstore.io/skills/langgenius-component-refactoring/audits/6

BibTeX citation

@techreport{langgenius-langgenius-component-refactoring-2026, author = {langgenius}, title = {component-refactoring security audit report (audit version 6)}, institution = {Skillstore}, year = {2026}, number = {6}, url = {https://skillstore.io/skills/langgenius-component-refactoring/audits/6}, note = {Author version unspecified} }

CITATION.cff

cff-version: 1.2.0 message: "If you use this Skill, cite its author and this versioned security audit report." title: "component-refactoring security audit report (audit version 6)" version: "unspecified" type: report authors: - name: "langgenius" date-released: "2026-07-09" url: "https://skillstore.io/skills/langgenius-component-refactoring/audits/6" identifiers: - type: other value: "skillstore:langgenius-component-refactoring:audit:6" description: "Skillstore immutable audit report identifier"

Skillstore Score

Why this score Evidence Confidence: High
45
Architecture
85
Maintainability
87
Content
69
Community
83
Spec Compliance

What You Can Build

Prepare Complex Components For Tests

Break down large Dify components before adding tests, so behavior is easier to isolate and verify.

Standardize Dify Refactors

Apply consistent hook, service, modal, form, and workflow node patterns across frontend changes.

Review Refactoring Plans

Check whether a proposed split preserves behavior, follows Dify conventions, and includes verification steps.

Try These Prompts

Assess a Component
Review this Dify React component for complexity. Identify whether it should be refactored before testing and list the first safe extraction steps.
Extract a Custom Hook
Refactor this component by moving related state, effects, and handlers into a custom hook. Preserve behavior and Dify naming conventions.
Split a Large UI
Plan a component split for this large Dify UI. Separate orchestration, header, content, modal, and list responsibilities.
Reduce Complexity Incrementally
Use the component analysis output to create an incremental refactoring plan. Include verification after each extraction and note behavior risks.

Best Practices

  • Run complexity analysis before deciding which extraction pattern to use.
  • Extract one responsibility at a time and verify behavior after each step.
  • Follow existing Dify folder, hook, service, and workflow naming conventions.

Avoid

  • Do not split simple components only to reduce line count.
  • Do not create many tiny hooks that separate tightly related state.
  • Do not change public props or behavior during structural cleanup.

Frequently Asked Questions

Does this skill edit code automatically?
No. It provides refactoring guidance for an agent or developer to apply.
Which codebase is it designed for?
It targets the Dify frontend and its React, TypeScript, and pnpm tooling conventions.
When should I use it?
Use it when component complexity is above 50, line count is above 300, or testing is blocked by structure.
Can it help with custom hooks?
Yes. It describes how to extract related state, effects, data fetching, forms, and modal logic.
Does it replace testing?
No. It recommends linting, type checks, tests, and manual verification after each extraction.
Is it useful outside Dify?
Some React patterns transfer, but commands, paths, and examples are Dify-specific.

Developer Details

Author

langgenius

License

MIT

Skillstore revision

r1

Version notice

The author did not declare a version.

Ref

0519034dad657fb1f7706e0550e962beeda73fdf

Maintenance freshness

7/23/2026

Usage

8 downloads ยท 119 views

File structure

๐Ÿ“ references/

๐Ÿ“„ complexity-patterns.md

๐Ÿ“„ component-splitting.md

๐Ÿ“„ hook-extraction.md

๐Ÿ“„ SKILL.md