Generate code templates for common patterns: REST API endpoints, React components, database models, authentication, error handling. Use when implementing new features or creating boilerplate code. This skill provides production-ready code templates: - REST API endpoints (Express, FastAPI) - React/Vue components with best practices - Database models (Sequelize, TypeORM, Mongoose) - Authentication middleware (JWT, OAuth) - Error handling patterns Triggers: "create API", "new component", "implement auth", "add model", "generate code", "コードテンプレート", "API作成", "コンポーネント作成"
Generates production-ready code templates for REST APIs, React components, database models, and authentication.
/plugin marketplace add takemi-ohama/ai-agent-marketplace/plugin install ndf@ai-agent-marketplaceThis skill is limited to using the following tools:
templates/rest-api-endpoint.jsこのSkillは、corderエージェントが新機能を実装する際に使用するコードテンプレート集です。REST APIエンドポイント、Reactコンポーネント、データベースモデル、認証ロジック、エラーハンドリングなど、頻出パターンのテンプレートを提供します。
templates/
├── rest-api-endpoint.js # Express REST APIエンドポイント
├── rest-api-endpoint.py # FastAPI エンドポイント
├── react-component.jsx # React関数コンポーネント
├── react-component-ts.tsx # React + TypeScript
├── database-model.js # Sequelize モデル
├── auth-middleware.js # JWT認証ミドルウェア
└── error-handler.js # エラーハンドリング
1. REST APIエンドポイント作成
テンプレートファイル rest-api-endpoint.js をコピーして、プロジェクトに追加します:
// templates/rest-api-endpoint.js をベースに実装
const express = require('express');
const router = express.Router();
/**
* @route GET /api/users
* @desc Get all users
* @access Public
*/
router.get('/', async (req, res) => {
try {
const users = await User.findAll();
res.json({ success: true, data: users });
} catch (error) {
res.status(500).json({ success: false, error: error.message });
}
});
module.exports = router;
2. Reactコンポーネント作成
// templates/react-component.jsx をベースに実装
import React, { useState, useEffect } from 'react';
const UserList = () => {
const [users, setUsers] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
fetchUsers();
}, []);
const fetchUsers = async () => {
try {
const response = await fetch('/api/users');
const data = await response.json();
setUsers(data.data);
} catch (err) {
setError(err.message);
} finally {
setLoading(false);
}
};
if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error}</div>;
return (
<ul>
{users.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
};
export default UserList;
3. データベースモデル作成
// templates/database-model.js をベースに実装
const { DataTypes } = require('sequelize');
module.exports = (sequelize) => {
const User = sequelize.define('User', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
name: {
type: DataTypes.STRING,
allowNull: false,
validate: {
notEmpty: true,
len: [2, 100]
}
},
email: {
type: DataTypes.STRING,
unique: true,
allowNull: false,
validate: {
isEmail: true
}
}
});
return User;
};
ファイル: templates/rest-api-endpoint.js
機能:
ファイル: templates/react-component.jsx
機能:
ファイル: templates/database-model.js
機能:
ファイル: templates/auth-middleware.js
機能:
ファイル: templates/error-handler.js
機能:
[RESOURCE], [MODEL_NAME] 等を実際の名前に変更✅ テンプレートをそのままコピー: 最新のベストプラクティスが適用済み ✅ プロジェクト規約に合わせる: 命名規則、インデント等を統一 ✅ セキュリティを最優先: 認証、バリデーション、エスケープ ✅ テストを作成: corder-test-generation Skillで自動生成
❌ テンプレートの安全機能を削除: エラーハンドリング、バリデーション等 ❌ 古いパターンを使用: async/awaitを使用、Promiseチェーンを避ける ❌ セキュリティを軽視: SQLインジェクション、XSS対策は必須
このSKILL.mdはメインドキュメント(約200行)です。詳細なテンプレートコードは templates/ ディレクトリ内のファイルを参照してください。
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.