Miscellaneous cases and concepts for TypeScript/Node.js refactoring, supplementing the core refactoring guide. Covers additional patterns, edge cases, and specialized refactoring techniques that don't fit into the core refactoring principles. Suitable for: (1) Handling complex refactoring scenarios, (2) Solving code smells not covered by standard guides, (3) Advanced TypeScript patterns, (4) Node.js specific considerations, (5) React/JSX/HTML/DOM specific considerations, and (6) Cross-domain con
SkillScore95Maintained
Automatic
◆Coding pack
Last verified 10/7/2026
What it changes
Passed 21 of 22 test cases with the skill, and 15 of 22 without it.
Without skill68%
With skill95%
Checks it passed that the model alone missed
The element ID enum uses the naming pattern suffix ElemId.
The globalState accessor is implemented as a getter on the abstract class.
The CSS class query helper function accepts an optional string suffix parameter.
and 5 more in the full report
6 fixed15 passed either way1 still failing0 broke
Pass-rate lift
+27 pp
Tokens
+274%
Agent turns
0%
Response time
-36%
Model gemini-3.6-flashMeasured 10/7/2026v221 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 6
Prompt
I have a TypeScript class wrapping VS Code's globalState storage where key strings like 'searchHistory' and 'selectedIDEs' are passed as loose strings returning any. Please refactor this class to eliminate raw string keys, ensure strict return type inference for get/update methods based on the key passed, and adjust property access modifiers on the wrapper class to support future subclassing. Provide the refactored TypeScript class and an example usage snippet.
What was checked, without and with the skill
Checked
Without skill
With skill
The refactored class uses Extract over a mapping union type to resolve return types for keys.
Missed
Passed
The globalState property on the wrapper class uses the protected access modifier.
Passed
Passed
case-01 · gemini-3.6-flash · 10/7/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md989 lines6 files
TypeScript/Node.js Refactoring - Miscellaneous Cases and Concepts
You are an expert in handling complex and specialized refactoring scenarios that go beyond standard patterns.
This guide supplements the core refactoring principles, providing additional cases, edge conditions, and advanced techniques.
Purpose of this guide:
Handle edge cases: Covers refactoring scenarios not addressed by standard patterns
Advanced patterns: Specialized techniques for complex TypeScript/Node.js situations
Cross-domain concerns: Refactoring considerations that span multiple domains
Practical supplements: Real-world complex situations and their solutions
SSOT for numeric/calculation logic: See Guideline B-2: Extract Even "Trivial" Arithmetic in Calculation-Heavy Projects in the core guide — applies the SSoT principle to shared math utilities in number-critical projects, with a concrete percent.ts case.
Async/Await Edge Cases
Parallel vs Sequential Execution
Problem: Unnecessary sequential execution of independent asynchronous operations.
Anti-pattern: Sequential execution of independent calls
防止 AI Agent 在回答或查詢時加入與事實無關的內容,避免在未查核的情況下基於虛假、虛構、錯誤的先入為主觀念而執行後續的錯誤任務。禁止虛構不存在的事實,即使在角色扮演模式下也需融合事實來進行角色扮演,除非架空世界規則不同。Prevents AI agents from adding unfactual content in responses or queries, avoiding execution of erroneous tasks based on unverified false, fictional, or incorrect preconceptions. Prohibits fabricating non-existent facts; even in role-playing mode, facts must be integrated unless the fictional world rules specify otherwise.