Agent skill
moodle-external-api-development
Create custom external web service APIs for Moodle LMS. Use when implementing web services for course management, user tracking, quiz operations, or custom plugin functionality. Covers parameter validation, database operations, error handling, service registration, and Moodle coding standards.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/moodle-external-api-development
SKILL.md
Moodle External API Development
This skill guides you through creating custom external web service APIs for Moodle LMS, following Moodle's external API framework and coding standards.
When to Use This Skill
- Creating custom web services for Moodle plugins
- Implementing REST/AJAX endpoints for course management
- Building APIs for quiz operations, user tracking, or reporting
- Exposing Moodle functionality to external applications
- Developing mobile app backends using Moodle
Core Architecture Pattern
Moodle external APIs follow a strict three-method pattern:
execute_parameters()- Defines input parameter structureexecute()- Contains business logicexecute_returns()- Defines return structure
Step-by-Step Implementation
🧠 Knowledge Modules (Fractal Skills)
1. Step 1: Create the External API Class File
2. Step 2: Define Input Parameters
3. Step 3: Implement Business Logic
4. Step 4: Define Return Structure
5. Step 5: Register the Service
6. Step 6: Implement Error Handling & Logging
7. Complex Database Operations
8. Working with Course Modules
9. Access Restrictions (Groups/Availability)
10. Random Question Selection with Tags
11. 1. Via Moodle Web Services Test Client
12. 2. Via curl
13. 3. Via JavaScript (AJAX)
14. 1. "Function not found" Error
15. 2. "Invalid parameter value detected"
16. 3. SQL Injection Vulnerabilities
17. 4. Permission Denied Errors
18. 5. Transaction Deadlocks
19. Simple Read API (Get Quiz Attempts)
20. Complex Write API (Create Quiz from Categories)
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?