K

knitwork-x

by @hairyfv1.0.0
0.0(0)

Utilities to generate JavaScript and TypeScript code programmatically. Use when building code generators, AST-to-code output, or dynamic source generation.

Custom FrameworkBackend DevelopmentAPI DesignSystem ArchitectureScalabilityGitHub
安装方式
npx skills add hairyf/knitwork-x --skill knitwork-x
compare_arrows

Before / After 效果对比

0

description 文档


name: knitwork-x description: Utilities to generate JavaScript and TypeScript code programmatically. Use when building code generators, AST-to-code output, or dynamic source generation. metadata: author: hairyf version: "0.2.0" source: docs/ (current project)

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).

Core References

| 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 |

Features

| 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 | 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 |

Key Points

  • Return type: Every gen* function returns a string (code fragment).
  • Options: Most accept an optional options object (e.g. export, singleQuotes, indent); default to {}.
  • Indent: When supported, pass indent as the last parameter; use indent + " " for nested blocks.
  • Strings: Use genString(input, options) for quoted/escaped output so singleQuotes is respected.
  • Composing: Combine gen* outputs (e.g. genClass(..., [genConstructor(...)])) to build larger snippets.

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量0
评分0.0 / 5.0
版本1.0.0
更新日期2026年3月16日
对比案例0 组

用户评分

0.0(0)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月16日
最后更新2026年3月16日