component-refactor

Audits, repairs, and migrates Semorphe component capsules across five implementation paths.

9|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/timcsy/semorphe --skill component-refactor-timcsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-refactor
Source: https://github.com/timcsy/semorphe/tree/main/knowledge/skills/component-refactor
Command: npx skills add https://github.com/timcsy/semorphe --skill component-refactor-timcsy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Component capsules in the Semorphe codebase can drift out of completeness: missing lift/render/extract/generate/execute paths, confidence-level violations, duplicate registrations, dead concepts, and inconsistent i18n block labels. This Skill detects those gaps and repairs them without breaking existing tests. ## Core Features & Use Cases - Audit mode: Runs the existing vitest guardrail suites first, then manually scans the two areas guardrails do not cover (confidence-level compliance and i18n label style), producing a completeness matrix and prioritized report. - Fix mode: Diagnoses a single component, an STD module, or an entire language, then generates missing lifters, BlockSpecs, generators, executors, and tests, verifying each fix with npx tsc --noEmit and npm test. - Migrate & purge modes: Migrates hand-written lifters to declarative JSON patterns via a decision tree (L1/L2/L3/unmovable), removes duplicate registrations, and purges dead concepts with zero implementations. - Use Case: Run cpp full to execute the complete pipeline—audit, fix all, dedup, migrate, render-fix, i18n-fix, purge—ending with a final type-check and test validation. ## Quick Start Ask the AI to run a full audit and repair pass on the C++ components, for example by saying: audit and fix all C++ component capsules and report the completeness improvement.

Frequently Asked Questions about component-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit component completeness in the Semorphe codebase?

Run the audit mode with a language argument, such as `cpp audit`. It first executes the vitest integration guardrails (audit-completeness, audit-component-locality, audit-orphan-implementations), then manually scans confidence-level compliance and i18n label style, which the guardrails do not cover.

How do I fix a component missing lift or generate paths?

Use fix mode with the component or module name, such as `cpp fix vector`. The Skill diagnoses missing paths, derives lifters from existing generators or vice versa, generates the artifacts, and verifies each fix with `npx tsc --noEmit` and `npm test` before moving on.

When should a hand-written lifter be migrated to a JSON pattern?

Migrate when the lifter is pure field mapping (L1), needs a simple transform or operator dispatch (L2), or has multi-condition logic under 20 lines (L3 composite). Lifters with cross-node state or deep nested logic are classified unmovable and stay hand-written.

Does the audit mode scan everything itself?

No. Most checks—five-path completeness, dual registration, dead concepts, encapsulation, naming—are already covered by mechanized vitest guardrails with baselines. The Skill only manually scans confidence-level compliance and i18n label style, which require judgment rather than counting.

What happens to components with zero implemented paths?

Dead concepts (0/6 completeness) are evaluated for retention value: exploration reports, dependency references, or topic tree membership mean they get fixed instead. Only concepts with no value and no references are purged by deleting the entire capsule folder.

Can the refactor break existing tests?

The Skill is designed to never break tests: it repairs one component at a time, runs `npx tsc --noEmit` and `npm test` after every change, and stops immediately if any step in the full pipeline fails, reporting the failure instead of continuing.