Skip to main content

Drupal Contrib Consolidation Plan

Drupal Contrib Consolidation Plan

Purpose: Transition custom code to industry-standard Drupal contrib. Single source of truth for the task list. No new custom logic where contrib exists.

Scope: Custom modules in TESTING_DEMOS/DEMO_SITE_drupal_testing and WORKING_DEMOs Drupal sites; all API integration, AI, workflows, registries.


Current Custom Patterns (Audit Summary)

DomainCustom patternContrib target
API / HTTPRaw Guzzle, @http_client, one-off clientshttp_client_manager, api_normalization
Executable actionsCustom service methods, RPC-styledrupal/tool (Tool plugins)
AI / LLMCustom provider bridges, mesh scrapersdrupal/ai, drupal/ai_agents, ai_agents_ossa
Workflows / stateServiceIntegrationOrchestrator, FleetOrchestratorService, PHP loopsdrupal/eca, drupal/maestro, drupal/orchestration
Discovery / registryMcpServerProject entities, custom discoveryai_agents, ai_agents_ossa (OSSA → Tool)
ObservabilityCustom metric tables, token logsdrupal/audit_export, tracer.bluefly.internal
Config / secrets$settings, hardcoded URLsdrupal/key, config/schema, admin UI

Phase A: Fix Broken Custom Code & Bootstrap (Completed)

  • Fix PHP parse errors and missing methods in mcp_registry
  • Fix variable shadowing/syntax in ai_agents_client, ai_agents_claude, ai_agents_cursor
  • Fix routing (non-existent controllers) in ai_agents_kagent, mcp_registry
  • Fix Git conflict markers in DragonflySettingsForm
  • Confirm ddev drush cr completes

Phase B: Seven Pillars (Explicit Task List)

Pillar 1: Tool API (drupal/tool)

#TaskOwner moduleDone
1.1Audit: list all custom PHP/Guzzle acting as executable functions (mcp_registry, ai_agents_client, code_executor, dragonfly_client, recipe_onboarding, etc.)
1.2Adopt tool_belt: if standard tools exist for fetch/read/strings, delete custom equivalentsper module
1.3Migrate each remaining executable to a Tool plugin under src/Plugin/Tool/per module
1.4Enforcement: no callable logic without a Tool plugin; register with tool_ai_connector/orchestrationCI / review

Pillar 2: State Execution (ECA, Maestro, Orchestration)

#TaskDone
2.1Deprecate ServiceIntegrationOrchestrator, FleetOrchestratorService, hook-based sync loops
2.2Install drupal/eca, drupal/maestro (and maestro_activepieces if needed)
2.3Install drupal/orchestration; proxy workflows to n8n/Activepieces via orchestration
2.4Replace custom fleet/rollout PHP with ECA actions + Tool plugins or maestro workflows

Pillar 3: AI Ecosystem (drupal/ai)

#TaskDone
3.1Use drupal/ai only for LLM routing and Key; remove custom provider bridges
3.2Replace custom discovery (McpServerProject, mesh scrapers) with ai_agents + ai_agents_ossa
3.3Install ai_agents_ossa; parse OSSA capabilities into Tool plugins; disable custom scrapers

Pillar 4: API Normalization (drupal/api_normalization)

#TaskDone
4.1Ban raw @http_client in custom: add CI rule or grep gate
4.2Locate OpenAPI specs for Mesh, MCP, workflow-engine, compliance, dragonfly
4.3Import specs into api_normalization; generate Tool plugins and gateway routes
4.4Remove custom Guzzle wrappers in mcp_registry, ai_agents_client, cedar_policy, recipe_onboarding_fleet_extension, code_executor, dragonfly_client

Pillar 5: FlowDrop Ecosystem

#TaskDone
5.1Install drupal/flowdrop, drupal/flowdrop_ui
5.2Install flowdrop_tool_provider (expose Tool plugins on canvas)
5.3Install flowdrop_ai, flowdrop_ai_provider
5.4Implement flowdrop_ui_agents, flowdrop_field_widget_actions where needed

Pillar 6: Observability (drupal/audit_export)

#TaskDone
6.1Purge custom DB tables for time-series, token counts, agent execution logs
6.2Install drupal/audit_export (and audit_export_tool if present)
6.3Pipe tool/maestro execution through audit_export to tracer.bluefly.internal

Pillar 7: Architecture via Config

#TaskDone
7.1Zero hardcoded endpoints: purge *.blueflyagents.com and private IPs from custom code
7.2Migrate secrets/API keys to drupal/key
7.3Add config/schema/*.schema.yml for all custom settings
7.4All parameters editable via admin UI (no $settings for module logic)

Module-to-Pillar Mapping (Where to Change What)

ModulePillarsPriority
mcp_registry1, 4, 3High
ai_agents_client1, 4, 3High
recipe_onboarding, recipe_onboarding_fleet_extension1, 2, 4, 7High
dragonfly_client1, 4, 7High
code_executor1, 4High
cedar_policy4, 7Medium
alternative_services1, 4, 7Medium
ai_agents_ossa (custom parts)1, 3, 5Medium
ai_agents_dashboard / monitoring1, 4, 6Medium

References