3.3 KiB
3.3 KiB
description, argument-hint, model, allowed-tools
| description | argument-hint | model | allowed-tools | |
|---|---|---|---|---|
| Strip TypeScript from a plugin, converting it to markdown-only |
|
claude-sonnet-4-5-20250929 | Bash, Write, Edit, Read, Glob, AskUserQuestion |
Strip TypeScript from Plugin
Remove TypeScript setup from a plugin, converting it to markdown-only mode with stub scripts.
Instructions
You are a plugin maintenance specialist. Safely strip TypeScript from plugins while preserving markdown content.
Input
The plugin name is provided as $1 (or $ARGUMENTS).
Validation
-
Verify plugin exists:
- Check
plugins/{name}directory exists - If not found, show error and list available plugins
- Check
-
Verify it's a TypeScript plugin:
- Check for
tsconfig.jsonpresence - If already markdown-only, inform user and exit
- Check for
-
Check for MCP server:
- If
mcp-servers/exists, warn user that MCP requires TypeScript - Ask if they want to proceed anyway (will break MCP functionality)
- If
Confirmation Required
CRITICAL: Before making any changes, use AskUserQuestion:
Question: "Are you sure you want to strip TypeScript from '{name}'?"
Show what will be deleted:
tsconfig.jsonsrc/directory (all files)devDependenciesfrom package.json
Show what will be modified:
package.jsonscripts will become stubs
Options:
- Yes, strip TypeScript - Proceed with removal
- No, cancel - Abort operation
Files to Delete
plugins/{name}/
├── tsconfig.json ❌ DELETE
└── src/ ❌ DELETE (entire directory)
├── index.ts ❌
├── index.test.ts ❌
└── ... ❌
Files to Modify
package.json - Replace scripts with stubs:
Before:
{
"scripts": {
"test": "bun test --recursive",
"typecheck": "tsc --noEmit",
"format": "biome format --write .",
"lint": "biome lint .",
"check": "biome check --write ."
},
"devDependencies": {
"@types/bun": "latest"
}
}
After:
{
"scripts": {
"test": "echo 'No tests'",
"typecheck": "echo 'No typecheck'"
}
}
Execution Steps
- Confirm with user (AskUserQuestion)
- Delete tsconfig.json:
rm plugins/{name}/tsconfig.json - Delete src/ directory:
rm -rf plugins/{name}/src - Update package.json:
- Read current package.json
- Replace scripts with stub versions
- Remove devDependencies
- Write updated package.json
Files to Preserve
Do NOT touch these:
.claude-plugin/plugin.jsoncommands/directoryskills/directoryhooks/directorymcp-servers/directory (warn but preserve).mcp.json
Output Summary
After stripping:
Stripped TypeScript from 'my-plugin'
Deleted:
- tsconfig.json
- src/index.ts
- src/index.test.ts
Modified:
- package.json (scripts now use stubs)
Plugin is now markdown-only.
To add TypeScript back later:
/plugin-template:upgrade my-plugin
Error Handling
- If plugin doesn't exist, list available plugins
- If already markdown-only, inform user (no action needed)
- If deletion fails, show error and rollback suggestions
- If package.json update fails, show manual fix steps
Example Usage
User: /plugin-template:strip my-plugin