スキル一覧に戻る
iamyojimbo

javascript-code-style

by iamyojimbo

0🍴 0📅 2026年1月20日
GitHubで見るManusで実行

SKILL.md


name: javascript-code-style description: This skill should be used when writing, editing, or reviewing any JavaScript code in the ECP codebase. It provides coding standards for error handling in Express API routes. Always apply these guidelines when working with JavaScript files (.js) in the api/ directory.

JavaScript Code Style

This skill provides JavaScript coding standards for the ECP codebase. After writing code, note the code rules applied, e.g. "Applied: 1.1 - Always wrap async route handlers in try-catch".

Rules

  1. Error Handling
    1. Always wrap async Express route handlers in try-catch blocks. The ECP API has no global error middleware, so unhandled promise rejections cause requests to hang indefinitely until timeout. Note: This does NOT apply to database migrations (api/migrations/) - migrate-mongo handles errors at the framework level.
    2. Use setErrorResponse(res, title, detail, status) from ../lib/http.js for error responses.
    3. Log errors with console.error() before returning error response.
    4. Return 400 for client errors (validation, bad input), 500 for server errors (database failures, unexpected exceptions).
    5. Example:
      router.post('/endpoint', async (req, res) => {
        try {
          // ... route logic
          res.json(result);
        } catch (error) {
          console.error('Error in /endpoint:', error);
          return setErrorResponse(res, 'Operation failed', error.message, 500);
        }
      });
      

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です