Initial commit
This commit is contained in:
12
.claude-plugin/plugin.json
Normal file
12
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "typescript-skills",
|
||||
"description": "Collection of TypeScript coding skills for generating, explaining, refactoring, and testing TypeScript code",
|
||||
"version": "0.0.0-2025.11.28",
|
||||
"author": {
|
||||
"name": "Nick Nance",
|
||||
"email": "nnance@gmail.com"
|
||||
},
|
||||
"skills": [
|
||||
"./skills/node-ts-cli"
|
||||
]
|
||||
}
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# typescript-skills
|
||||
|
||||
Collection of TypeScript coding skills for generating, explaining, refactoring, and testing TypeScript code
|
||||
44
plugin.lock.json
Normal file
44
plugin.lock.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||
"pluginId": "gh:nnance/claude-agent-skills:typescript-skills",
|
||||
"normalized": {
|
||||
"repo": null,
|
||||
"ref": "refs/tags/v20251128.0",
|
||||
"commit": "b34c6fb3a90165581a63e94628c9b68bea12ff89",
|
||||
"treeHash": "4d65960ec4f8a5723e25bb72326ab9bf033b78ea9da9a1ae2d587ac247fe0ff0",
|
||||
"generatedAt": "2025-11-28T10:27:23.542029Z",
|
||||
"toolVersion": "publish_plugins.py@0.2.0"
|
||||
},
|
||||
"origin": {
|
||||
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||
"branch": "master",
|
||||
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||
},
|
||||
"manifest": {
|
||||
"name": "typescript-skills",
|
||||
"description": "Collection of TypeScript coding skills for generating, explaining, refactoring, and testing TypeScript code"
|
||||
},
|
||||
"content": {
|
||||
"files": [
|
||||
{
|
||||
"path": "README.md",
|
||||
"sha256": "5cae934c245390af9dd75e9358387b73b96b2beae10d1e472b6fa8d881db1c47"
|
||||
},
|
||||
{
|
||||
"path": ".claude-plugin/plugin.json",
|
||||
"sha256": "311598d59df5e5f910ed6681a48e54b982227cb777355ed06f14cbea0b5522c0"
|
||||
},
|
||||
{
|
||||
"path": "skills/node-ts-cli/SKILL.md",
|
||||
"sha256": "65b28c4c0d7723bd0fe7034f623238b4369ae41f6dfbada594fd6d26009b0354"
|
||||
}
|
||||
],
|
||||
"dirSha256": "4d65960ec4f8a5723e25bb72326ab9bf033b78ea9da9a1ae2d587ac247fe0ff0"
|
||||
},
|
||||
"security": {
|
||||
"scannedAt": null,
|
||||
"scannerVersion": null,
|
||||
"flags": []
|
||||
}
|
||||
}
|
||||
117
skills/node-ts-cli/SKILL.md
Normal file
117
skills/node-ts-cli/SKILL.md
Normal file
@@ -0,0 +1,117 @@
|
||||
---
|
||||
name: node-ts-cli
|
||||
description: Generate new Node.js CLI tool projects using TypeScript with ESM modules, tsc for building, tsx for development, Biome for linting/formatting, and Node's built-in test runner. Use this skill when the user requests to create a new Node TypeScript CLI project or CLI tool.
|
||||
---
|
||||
|
||||
# Node TypeScript CLI Generator
|
||||
|
||||
## Overview
|
||||
|
||||
Generate production-ready Node.js CLI tool projects configured with TypeScript, ESM modules, and modern tooling. Each generated project includes a complete setup with build scripts, development workflow, testing, and linting.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Use this skill when the user requests:
|
||||
- "Create a new Node TypeScript CLI tool"
|
||||
- "Generate a CLI project in TypeScript"
|
||||
- "Set up a new TypeScript CLI"
|
||||
- "Make me a Node.js command-line tool"
|
||||
|
||||
## Project Setup
|
||||
|
||||
### Quick Start
|
||||
|
||||
To generate a new CLI project:
|
||||
|
||||
1. Specify the project name and desired CLI command name.
|
||||
2. The skill will create a new directory unless specified otherwise.
|
||||
3. Inside the directory, the skill will perform the following steps:
|
||||
4. Initialize a new Git repository.
|
||||
5. Run `npm init -y` to initialize a new npm project.
|
||||
6. Run `npm i -D typescript @types/node @biomejs/biome` to install dev dependencies.
|
||||
7. Run `npm i @clack/prompts` to install runtime dependencies.
|
||||
8. Run `npx tsc --init` to create a `tsconfig.json` file.
|
||||
9. Run `npx biome init` to create a `biome.json` file.
|
||||
10. Set up the `package.json`, `tsconfig.json`, and `biome.json` files with the appropriate configurations.
|
||||
11. Create the necessary source files in `src/` including `index.ts` with a basic CLI structure using the `@clack/prompts` library.
|
||||
12. Create example test files in `src/` to demonstrate testing with Node's built-in test runner.
|
||||
13. Add npm scripts for building, developing, testing, linting, and formatting.
|
||||
14. Inform the user about the available npm scripts
|
||||
|
||||
### Technology Stack
|
||||
|
||||
The generated project uses:
|
||||
- **TypeScript** with strict mode enabled
|
||||
- **ESM modules** (type: "module")
|
||||
- **tsc** for building production builds to `./dist`
|
||||
- **tsx** for running TypeScript directly in development
|
||||
- **Biome** for fast linting and formatting
|
||||
- **Node's built-in test runner** with TypeScript support via `--experimental-strip-types`
|
||||
|
||||
### Available NPM Scripts
|
||||
|
||||
Each generated project includes these scripts:
|
||||
|
||||
- `npm run build` - Compile TypeScript to JavaScript in `./dist`
|
||||
- `npm run dev` - Run the CLI in development mode with tsx
|
||||
- `npm run test` - Run tests with Node's built-in test runner
|
||||
- `npm run lint` - Check code with Biome
|
||||
- `npm run lint:fix` - Fix linting issues automatically
|
||||
- `npm run format` - Format code with Biome
|
||||
|
||||
### Project Configuration
|
||||
|
||||
**package.json**
|
||||
- Configured as ESM with `"type": "module"`
|
||||
- Includes `bin` field for CLI installation
|
||||
- Main entry points to `./dist/index.js`
|
||||
|
||||
**tsconfig.json**
|
||||
- Target: ES2022
|
||||
- Module: ESNext with bundler resolution
|
||||
- Outputs to `./dist`, sources from `./src`
|
||||
- Strict mode enabled
|
||||
- Generates declaration files and source maps
|
||||
|
||||
**biome.json**
|
||||
- Enables linting with recommended rules
|
||||
- Configured to format code on save
|
||||
|
||||
### CLI Entry Point Structure
|
||||
|
||||
The template `src/index.ts` includes:
|
||||
- Shebang for executable scripts (`#!/usr/bin/env node`)
|
||||
- Argument parsing with help and version flags for non-interactive use
|
||||
- Interactive prompts using `@clack/prompts`
|
||||
- Async main function with error handling
|
||||
- Process exit codes for proper CLI behavior
|
||||
|
||||
### Customization After Generation
|
||||
|
||||
After generating a project, users should:
|
||||
1. Update `name` and `description` in `package.json`
|
||||
2. Update the `bin` command name in `package.json`
|
||||
3. Set the `author` and `license` fields
|
||||
4. Update version number in both `package.json` and `src/index.ts` showVersion()
|
||||
5. Modify `src/index.ts` with their CLI logic
|
||||
6. Update the README with specific usage instructions
|
||||
|
||||
### Installation for Users
|
||||
|
||||
After building the project, users can:
|
||||
- Run locally: `node dist/index.js`
|
||||
- Install globally: `npm install -g .` then use the bin command
|
||||
- Publish to npm and install: `npm install -g package-name`
|
||||
|
||||
## Example Usage
|
||||
|
||||
When a user says: "Create a new TypeScript CLI tool called todo-manager"
|
||||
|
||||
1. Run the project generation steps outlined above
|
||||
2. Update `package.json`:
|
||||
- Change `"name"` to `"todo-manager"`
|
||||
- Update `"description"` appropriately
|
||||
- Change `bin` to `"todo-manager": "./dist/index.js"`
|
||||
3. Update README.md with the project name
|
||||
4. Run `npm install` in the project directory
|
||||
5. Inform the user: "Project created! Run `npm run dev` to start developing, or `npm run build` to compile."
|
||||
Reference in New Issue
Block a user