← スキル一覧に戻る

code-style-and-formatting
by joseaplwork
⭐ 0🍴 0📅 2026年1月18日
SKILL.md
name: Code Style and Formatting description: Code formatting guidelines following Prettier and project conventions for consistent code style.
Code Style and Formatting
This skill enforces consistent code formatting and style across the Junta project.
When to Use
- When writing or editing any TypeScript/JavaScript code
- When organizing imports in files
- When naming variables, functions, or interfaces
- When structuring code blocks and methods
Formatting Rules
General Formatting
- Use 2 spaces for indentation (no tabs)
- Maximum line length of 80 characters
- Use single quotes for strings
- Use trailing commas in multiline constructs
- Omit semicolons
- Use arrow functions with implicit return when possible
- Arrow functions should omit parentheses for single parameters
Code Structure
- Always add blank lines between class fields and methods
- Always add blank lines between different methods
- Add blank lines after variable declarations (unless followed by another variable)
Import Organization
Group imports in this specific order with blank lines between groups:
- Third-party modules (Angular, NestJS, RxJS, etc.)
- @junta modules (shared libraries from
libs/) - @/admin or @/api modules (app-level path aliases)
- Relative parent imports (
../) - Local imports (
./)
Sort import specifiers alphabetically within each import statement.
Example
// 1. Third-party modules
import { Component, inject } from '@angular/core'
import { FormBuilder } from '@angular/forms'
import { firstValueFrom } from 'rxjs'
// 2. @junta modules (shared libs)
import { Role } from '@junta/enums'
// 3. @/admin or @/api modules (app-level aliases)
import { Config } from '@/admin/shared/services/config'
// 4. Relative parent imports
import { ParticipantState } from '../participant-page-state'
// 5. Local imports
import { ParticipantUpdate } from './services/participant-update'
Naming Conventions
- Use descriptive, self-documenting names
- Prefer
payloadoverdatafor API request bodies - Use consistent naming across similar patterns:
CreatePayloadfor creation payloadsUpdatePayloadfor update payloads- Avoid repeating context in names (e.g., prefer
UpdatePayloadoverParticipantListUpdatePayloadwhen context is clear from file location)
Instructions
- Format code: Follow Prettier configuration at project root (
.prettierrc) - Organize imports: Always group and order imports as specified above
- Name consistently: Use the established naming patterns for payloads and interfaces
- Structure code: Add blank lines between logical sections (fields, methods, etc.)
- Line length: Break long lines at 80 characters, respecting readability
スコア
総合スコア
50/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
レビュー
💬
レビュー機能は近日公開予定です