Agent skill
moodle-standards
Apply Moodle coding standards (PSR-12 with exceptions) to PHP code. Validates style, naming conventions, PHPDoc, and type hints.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/moodle-standards-astoeffer-plugin-marketplace
SKILL.md
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) {
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?