用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/miles990/claude-software-skills --skill developer-tools命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | developer-tools |
| description | CLI tools, SDKs, and developer experience patterns |
| domain | domain-applications |
| version | 1.0.0 |
| tags | ["cli","sdk","api-client","devtools","dx"] |
| triggers | {"keywords":{"primary":["cli","sdk","developer tool","api client","dx","developer experience"],"secondary":["commander","chalk","api documentation","developer portal","openapi"]},"context_boost":["tool","library","package","npm","developer"],"context_penalty":["frontend","ui","design","mobile"],"priority":"medium"} |
Building command-line interfaces, SDKs, and tools that enhance developer experience.
#!/usr/bin/env node
import { Command } from 'commander';
import chalk from 'chalk';
import ora from 'ora';
import inquirer from 'inquirer';
const program = new Command();
program
.name('myctl')
.description('CLI tool for managing resources')
.version('1.0.0');
// Simple command
program
.command('init')
.description('Initialize a new project')
.option('-t, --template <name>', 'Template to use', 'default')
.option('-d, --directory <path>', 'Target directory', '.')
.action(async (options) => {
const spinner = ora('Initializing project...').start();
try {
await initProject(options.template, options.directory);
spinner.succeed(chalk.green('Project initialized successfully!'));
} catch (error) {
spinner.fail(chalk.red(`Failed: ${error.message}`));
process.exit(1);
}
});
// Interactive command
program
.command('create <name>')
.description('Create a new resource')
.action(async (name) => {
const answers = await inquirer.prompt([
{
type: 'list',
name: 'type',
message: 'Select resource type:',
choices: ['api', 'worker', 'database'],
},
{
type: 'input',
name: 'description',
message: 'Description:',
},
{
type: 'confirm',
name: 'public',
message: 'Make it public?',
default: false,
},
]);
await createResource(name, answers);
console.log(chalk.green(`Created ${answers.type}: ${name}`));
});
// Subcommands
const configCmd = program.command('config').description('Manage configuration');
configCmd
.command('set <key> <value>')
.description('Set a config value')
.action(async (key, value) => {
await setConfig(key, value);
console.log(`Set ${key}=${value}`);
});
configCmd
.command('get <key>')
.description('Get a config value')
.action(async (key) => {
const value = await getConfig(key);
console.log(value);
});
configCmd
.command('list')
.description('List all config values')
.action(async () => {
const config = await getAllConfig();
console.table(config);
});
// Global options
program
.option('--debug', 'Enable debug mode')
.option('--json', 'Output as JSON')
.hook('preAction', (thisCommand) => {
if (thisCommand.opts().debug) {
process.env.DEBUG = 'true';
}
});
program.parse();
import Table from 'cli-table3';
import boxen from 'boxen';
// Table output
function printTable(data: Array<Record<string, any>>, columns: string[]) {
const table = new Table({
head: columns.map((c) => chalk.bold(c)),
style: { head: ['cyan'] },
});
data.forEach((row) => {
table.push(columns.map((col) => row[col] ?? ''));
});
console.log(table.toString());
}
// JSON output
function printJson(data: any) {
console.log(JSON.stringify(data, null, 2));
}
// Box output
function () {
.(
(message, {
: ,
: ,
: ,
title,
: ,
})
);
}
cliProgress ;
withProgress<T>(
: T[],
: <>,
:
) {
bar = cliProgress.({
: ,
: ,
: ,
});
bar.(items., );
( item items) {
(item);
bar.();
}
bar.();
}
// sdk/index.ts
export class MyServiceClient {
private baseUrl: string;
private apiKey: string;
constructor(options: { apiKey: string; baseUrl?: string }) {
this.apiKey = options.apiKey;
this.baseUrl = options.baseUrl || 'https://api.example.com';
}
private async request<T>(
method: string,
path: string,
data?: any
): Promise<T> {
const response = await fetch(`${this.baseUrl}${path}`, {
method,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.apiKey}`,
},
body: data ? JSON.stringify(data) : undefined,
});
if (!response.ok) {
const error = response.().( ({}));
(response., error. || );
}
response.();
}
users = {
:
.<<>>(, + (params)),
: .<>(, ),
:
.<>(, , data),
:
.<>(, , data),
: .<>(, ),
};
projects = {
: .<[]>(, ),
: .<>(, ),
:
.<>(, , data),
};
}
{
() {
(message);
. = ;
}
}
{
: ;
: ;
: ;
: ;
}
{
: ;
: ;
}
{
?: ;
}
<T> {
: T[];
: {
: ;
: ;
: ;
};
}
client = ({ : });
users = client..({ : , : });
user = client..({ : , : });
import pRetry from 'p-retry';
import pThrottle from 'p-throttle';
class RobustClient {
private throttle = pThrottle({
limit: 100,
interval: 60000, // 100 requests per minute
});
private async requestWithRetry<T>(
fn: () => Promise<T>,
options?: { retries?: number }
): Promise<T> {
return pRetry(
async () => {
try {
return await fn();
} catch (error) {
if (error instanceof ApiError) {
// Don't retry client errors
if (error.status >= 400 && error.status < 500) {
throw new pRetry.AbortError(error);
}
}
throw error;
}
},
{
retries: options?.retries ?? 3,
onFailedAttempt: () => {
.(
);
},
}
);
}
request = .( <T>(
: ,
: ,
?:
): <T> => {
.( () => {
response = (, {
method,
: .(),
: data ? .(data) : ,
});
(response. === ) {
retryAfter = response..();
delay = retryAfter ? (retryAfter) * : ;
(delay);
();
}
(!response.) {
(response., response.());
}
response.();
});
});
}
import { generateOpenApi } from '@ts-rest/open-api';
import { contract } from './contract';
const openApiDocument = generateOpenApi(contract, {
info: {
title: 'My API',
version: '1.0.0',
description: 'API for managing resources',
},
servers: [
{ url: 'https://api.example.com', description: 'Production' },
{ url: 'https://staging-api.example.com', description: 'Staging' },
],
});
// Export for documentation tools
export { openApiDocument };
// Using Swagger UI React
import SwaggerUI from 'swagger-ui-react';
import 'swagger-ui-react/swagger-ui.css';
function ApiDocs() {
return (
<SwaggerUI
url="/api/openapi.json"
docExpansion="list"
defaultModelsExpandDepth={3}
/>
);
}
// Or Redoc
import { RedocStandalone } from 'redoc';
function ApiDocs() {
return <RedocStandalone specUrl="/api/openapi.json" />;
}
// API key management component
function ApiKeyManager() {
const [keys, setKeys] = useState<ApiKey[]>([]);
async function createKey(name: string) {
const key = await api.createApiKey({ name });
// Show the secret only once
showModal({
title: 'API Key Created',
content: (
<div>
<p>Save this key - it won't be shown again:</p>
<code className="bg-gray-100 p-2 block">{key.secret}</code>
</div>
),
});
setKeys([...keys, key]);
}
async function revokeKey(keyId: string) {
await api.revokeApiKey(keyId);
setKeys(keys.filter((k) => k.id !== keyId));
}
return (
<div>
<>API Keys
Name
Created
Last Used
Actions
{keys.map((key) => (
{key.name}
{formatDate(key.createdAt)}
{key.lastUsedAt ? formatDate(key.lastUsedAt) : 'Never'}
revokeKey(key.id)}>Revoke
))}
createKey(prompt('Key name:') || 'Unnamed')}>
Create New Key
);
}