knitwork-x by hairyf/knitwork-x
npx skills add https://github.com/hairyf/knitwork-x --skill knitwork-xknitwork-x 为 JavaScript 和 TypeScript 提供编程式代码生成。它派生自 knitwork 并添加了全面的 TypeScript 辅助功能:ESM(导入/导出)、字符串、变量、类、接口、函数、类型、控制流(if/try/loop/switch)和序列化(对象/数组/映射/集合)。所有 gen* 函数都返回适合拼接进源代码的字符串;它们是纯函数,不会改变输入。
当智能体需要生成代码字符串时(例如用于代码生成工具、插件或动态模块输出),请使用此技能。
| 主题 | 描述 | 参考 |
|---|---|---|
| 概述 | 目的、安装、何时使用 | core-overview |
| ESM | 导入、导出、默认导出、动态导入 | core-esm |
| 字符串 | genString, escapeString, genTemplateLiteral | core-string |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 变量 |
| genVariable, genVariableName |
| core-variable |
| 设计指南 | 命名、参数、选项(供贡献者参考) | core-design-guidelines |
| 主题 | 描述 | 参考 |
|---|---|---|
| 类 | genClass, genConstructor, genProperty, genMethod, getter/setter | features-class |
| 接口 | genInterface, genIndexSignature | features-interface |
| 枚举 | genEnum, genConstEnum | features-enum |
| 函数 | genFunction, genArrowFunction, genBlock, genParam | features-function |
| 类型 | genTypeAlias, genUnion, genIntersection, genMappedType 等 | features-type |
| 条件 | genConditionalType, genTernary | features-conditional |
| 装饰器 | genDecorator | features-decorator |
| 模块与命名空间 | genModule, genNamespace, genDeclareNamespace | features-module-namespace |
| 条件语句 | genIf, genElse, genElseIf | features-condition |
| Try 语句 | genTry, genCatch, genFinally | features-try |
| 循环 | genFor, genForOf, genWhile, genDoWhile | features-loop |
| Switch 语句 | genSwitch, genCase, genDefault | features-switch |
| 语句 | genReturn, genThrow, genPrefixedBlock | features-statement |
| 对象与序列化 | genObject, genArray, genMap, genSet, genTypeObject | features-object |
| 工具函数 | genComment, genKey, genLiteral, genRegExp, wrapInDelimiters | features-utils |
gen* 函数都返回一个 string(代码片段)。options 对象(例如 export、singleQuotes、indent);默认为 {}。indent 作为最后一个参数传递;对于嵌套块,使用 indent + " "。genString(input, options) 来生成带引号/转义的输出,以便遵循 singleQuotes 设置。gen* 的输出(例如 genClass(..., [genConstructor(...)]))以构建更大的代码片段。每周安装量
281
代码仓库
GitHub 星标数
3
首次出现
2026年2月2日
安全审计
安装于
cursor280
claude-code274
opencode10
gemini-cli10
github-copilot10
codex10
knitwork-x provides programmatic code generation for JavaScript and TypeScript. It is forked from knitwork and adds comprehensive TypeScript helpers: ESM (import/export), strings, variables, classes, interfaces, functions, types, control flow (if/try/loop/switch), and serialization (object/array/map/set). All gen* functions return strings suitable for splicing into source; they are pure and do not mutate inputs.
Use this skill when an agent needs to generate code strings (e.g. for codegen tools, plugins, or dynamic module output).
| Topic | Description | Reference |
|---|---|---|
| Overview | Purpose, install, when to use | core-overview |
| ESM | Import, export, default export, dynamic import | core-esm |
| String | genString, escapeString, genTemplateLiteral | core-string |
| Variable | genVariable, genVariableName | core-variable |
| Design Guidelines | Naming, params, options (for contributors) | core-design-guidelines |
| Topic | Description | Reference |
|---|---|---|
| Class | genClass, genConstructor, genProperty, genMethod, getter/setter | features-class |
| Interface | genInterface, genIndexSignature | features-interface |
| Enum | genEnum, genConstEnum | features-enum |
| Function | genFunction, genArrowFunction, genBlock, genParam | features-function |
| Type | genTypeAlias, genUnion, genIntersection, genMappedType, etc. | features-type |
| Conditional | genConditionalType, genTernary |
gen* function returns a string (code fragment).options object (e.g. export, singleQuotes, indent); default to {}.indent as the last parameter; use indent + " " for nested blocks.genString(input, options) for quoted/escaped output so is respected.Weekly Installs
281
Repository
GitHub Stars
3
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor280
claude-code274
opencode10
gemini-cli10
github-copilot10
codex10
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装
| features-conditional |
| Decorator | genDecorator | features-decorator |
| Module & Namespace | genModule, genNamespace, genDeclareNamespace | features-module-namespace |
| Condition | genIf, genElse, genElseIf | features-condition |
| Try | genTry, genCatch, genFinally | features-try |
| Loop | genFor, genForOf, genWhile, genDoWhile | features-loop |
| Switch | genSwitch, genCase, genDefault | features-switch |
| Statement | genReturn, genThrow, genPrefixedBlock | features-statement |
| Object & Serialization | genObject, genArray, genMap, genSet, genTypeObject | features-object |
| Utils | genComment, genKey, genLiteral, genRegExp, wrapInDelimiters | features-utils |
singleQuotesgen* outputs (e.g. genClass(..., [genConstructor(...)])) to build larger snippets.