Drupal Development Documentation
Drupal Development Documentation
Separation of Duties: See Separation of Duties - Drupal modules are responsible for Drupal-specific functionality. They do NOT own agent manifests, execution, or OSSA spec.
Complete developer guides for Drupal module development in the LLM Platform ecosystem.
Overview
This documentation provides comprehensive guides for developing Drupal modules, recipes, and OSSA-compliant AI agents for the LLM Platform.
Epic 73: Drupal Canvas Automation Platform
Epic 73 — Contrib-first migration + page-building automation. Use Drupal AI and Tool API only (ai, tool, tool_ai_connector, ai_automators); no custom LLM or migration engine code. Contract: migration.graph.v1. All modules follow Drupal coding standards, security best practices, and OSSA compliance requirements.
Core Development Guides
1. [object Object]
Complete guide for developing custom Drupal modules:
- Module structure and organization
- Development workflow
- OSSA compliance requirements
- Service definitions and dependency injection
- Entity definitions and plugin system
- API endpoints (REST, GraphQL, JSON:API)
- Testing with PHPUnit
- Deployment procedures
Source Location: $LLM_ROOT/all_drupal_custom/modules/MODULE_NAME/
2. [object Object]
Guide for creating and managing Drupal recipes:
- Recipe structure and YAML format
- Sub-recipe system for modular components
- Recipe validation and testing
- Deployment workflows
- Recipe onboarding module integration
- LLM Platform and Secure Drupal recipes
Source Location: $LLM_ROOT/all_drupal_custom/recipes/recipe_name/
3. [object Object]
Drupal-OSSA integration guide:
- OSSA specification and manifest structure
- Agent types (Worker, Coordinator, Observer, Specialist)
- Tool system and definitions
- Security model and isolation levels
- Deployment to Kagent, LibreChat, and other platforms
- Multi-platform agent deployment
4. [object Object]
Coding standards and quality tools:
- PHPCS configuration and usage
- PHPStan static analysis
- Design taste validation
- Common violations and fixes
- Auto-fixing with BuildKit
- Pre-commit hooks and CI/CD integration
Quick Reference
Essential Commands
# Module development buildkit drupal module:create MODULE_NAME buildkit drupal sync --modules buildkit drupal phpcs MODULE_PATH --fix buildkit drupal taste MODULE_PATH # Recipe management drush recipe recipes/RECIPE_NAME drush recipe-onboarding:validate recipes/RECIPE_NAME # OSSA validation ossa validate .agents/AGENT_NAME/manifest.json buildkit agents list # Code quality buildkit golden test buildkit golden audit buildkit golden optimize
Module Documentation
AI & Agent Orchestration
- AI Agentic Workflows - Government-compliant agentic workflow system with FedRAMP/FISMA security
- AI Agent Orchestra - Multi-agent orchestration with vector memory and cross-framework coordination
- AI Agents Client - Lightweight client for distributed agent orchestration across 10,000+ sites
- AI Agents OSSA - Core OSSA compliance and validation support
- AI Agents Kagent - Deploy OSSA agents to Kubernetes via Kagent
- AI Agents Claude - Claude Agent SDK integration with subagent coordination
- AI Agents Cursor - Cursor Cloud Agent API integration
- AI Agents Marketplace - Agent discovery and installation marketplace
Core Platform Services
- Alternative Services - Service management and monitoring dashboard
- API Normalizer - API normalization and transformation with AI/MCP compatibility
- Code Executor - Secure Docker-based code execution with ecosystem integration
- MCP Registry - Model Context Protocol ecosystem manager with 76+ services
- Recipe Onboarding - Comprehensive recipe management system
JSON:API & REST Integration
- JSON:API Extras AI Integration Guide - Customize Drupal JSON:API for AI agents with field aliasing, resource customization, and response transformation
Security & Compliance
- Gov Compliance - FedRAMP, HIPAA, GDPR, FISMA, and NIST compliance framework
Analytics & Monitoring
- Charts AI Analytics - Enterprise analytics with dashboards and token tracking
AI Providers (Backlog)
- AI Provider Apple - Apple Intelligence and Foundation Models integration
- AI Provider LangChain - LangChain/LangGraph integration for agent chains
Content Management (Backlog)
- DITA CCMS - Enterprise DITA XML authoring and publishing framework
Module Status
Active Modules (Production)
Located in $LLM_ROOT/all_drupal_custom/modules/:
- ai_agentic_workflows
- ai_agents_orchestra
- ai_agents_client
- ai_agents_ossa
- ai_agents_kagent
- ai_agents_claude
- ai_agents_cursor
- ai_agents_marketplace
- alternative_services
- api_normalization
- code_executor
- gov_compliance
- mcp_registry
- recipe_onboarding
- charts_ai_analytics
Backlog Modules (In Development)
Located in $LLM_ROOT/all_drupal_custom/modules/_Backlog/:
- ai_provider_apple
- ai_provider_langchain
- dita_ccms
Development Workflow
1. Edit Source Files
Edit modules in source location:
$LLM_ROOT/all_drupal_custom/modules/MODULE_NAME/
DO NOT EDIT deployment location (Composer-managed):
$LLM_ROOT/llm-platform/web/modules/custom/MODULE_NAME/
2. Sync to Deployment
# Preview changes buildkit drupal sync --modules --dry-run # Apply changes buildkit drupal sync --modules
3. Quality Checks
# PHPCS validation buildkit drupal phpcs modules/custom/MODULE_NAME --fix # Design taste buildkit drupal taste modules/custom/MODULE_NAME # Run tests buildkit golden test # Security audit buildkit golden audit
4. Deployment
# Sync modules buildkit drupal sync --modules # Export config buildkit drupal config:export # Deploy buildkit golden deploy --env dev
Employment Protection
All modules include .claude/CLAUDE.md with employment protection:
## EMPLOYMENT PROTECTION ACTIVE - Claude Code BLOCKED from development branch - AI attribution BLOCKED in commits - Feature branch workflow ENFORCED ## TOKEN OPTIMIZATION MANDATORY Before writing ANY code > 500 tokens: - Check: buildkit agents list - Use: buildkit agents spawn --type worker
Best Practices
1. OSSA Compliance
All AI agent modules must include:
.agents/AGENT_NAME/manifest.json- OSSA manifest- Validation with
ossa validate - Security isolation and permissions
- Tool definitions following OSSA spec
2. Code Quality
- Follow Drupal coding standards
- Use PHPCS and PHPStan
- Write PHPUnit tests for critical functionality
- Document all public APIs
- Use dependency injection
3. Security
- Validate all inputs
- Sanitize all outputs
- Use permissions properly
- Implement audit logging
- Follow government compliance requirements
4. Performance
- Enable caching where appropriate
- Use queues for long-running tasks
- Lazy-load services
- Optimize database queries
- Monitor resource usage
Resources
Official Documentation
Drupal Resources
Community
Contributing
When contributing to any module:
- Create GitLab issue first
- Use git worktrees for feature branches
- Follow coding standards
- Write tests
- Update documentation
- Create MR via GitLab issue page
Support
For questions or issues:
- Check module-specific documentation
- Review GitLab Wiki
- Create GitLab issue
- Contact: security@bluefly.io
Last Updated: 2025-01-22 Drupal Compatibility: 10.3+, 11.0+ OSSA Compliant: Yes