← スキル一覧に戻る

moodle-standards
by astoeffer
⭐ 0🍴 1📅 2026年1月24日
SKILL.md
name: moodle-standards description: Apply Moodle coding standards (PSR-12 with exceptions) to PHP code. Validates style, naming conventions, PHPDoc, and type hints.
Moodle Standards Skill
Apply Moodle coding standards (PSR-12 + exceptions) to PHP code.
Trigger
- PHP files in Moodle plugin directories
- User requests code review or formatting
- New file creation in Moodle context
Actions
1. Validate Code Style
Check code against Moodle standards:
- Line length (132 ideal, 180 max)
- Array syntax (
[]only) else ifnotelseif- No closing
?>tag - 4-space indentation
2. Fix Naming
Ensure proper naming:
- Variables:
$lowercase(no underscores between words) - Functions:
component_function_name()(Frankenstyle) - Classes:
lowercase_with_underscores - Constants:
COMPONENT_CONSTANT_NAME
3. Add PHPDoc
Generate required documentation:
- File header with GPL
@packagetag (MANDATORY)@paramwith types@returndescription
4. Type Hints
Add mandatory type declarations:
- Parameter types
- Return types
- Nullable types (
?type)
Validation Command
vendor/bin/phpcs --standard=moodle path/to/file.php
Quick Fixes
Missing Package Tag
/**
* @package mod_myplugin
*/
Wrong Array Syntax
// Before
$arr = array('a', 'b');
// After
$arr = ['a', 'b'];
Wrong Else If
// Before
} elseif ($x) {
// After
} else if ($x) {
スコア
総合スコア
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
レビュー
💬
レビュー機能は近日公開予定です