Skip to content

DevDiff Plugin Architecture & Extension SDK

The DevDiff Plugin System allows developers and enterprise teams to extend DevDiff's functionality without modifying the core engine. Using @eldrex/plugin-sdk, you can register custom lifecycle hooks, intercept diffs before AI processing, post-process generated changelogs, dispatch webhooks to Slack/Teams/Jira, and enforce security policies.


🎯 Plugin Architecture & Execution Lifecycle


🔌 Lifecycle Hooks

DevDiff plugins can register for 6 core execution hooks:

Hook NameInvocation TimingPrimary Use Case
beforeAnalysisExecuted before diff payload is sent to LLMInspect diffs, inject metadata, block dangerous changes
afterAnalysisExecuted after changelog is generatedPost-process summaries, dispatch webhooks (Slack/Jira)
onErrorExecuted on any DevDiff errorCentralized error logging, alerting
onFileChangeExecuted when workspace files modifyTrigger external linters, background build checks
onCommitExecuted when a git commit occursCI/CD pipeline triggers
onAICompleteExecuted when LLM completes inferenceToken tracking, cost monitoring

🛠️ Plugin SDK Capabilities (PluginContext)

Inside the activate(context) method, plugins receive a PluginContext object with access to:

  • context.logger: Structured logging (debug, info, warn, error).
  • context.storage: Key-value persistence (get, set, delete, clear).
  • context.config: Read & write plugin-specific configuration settings.
  • context.notifications: Dispatch notifications to user-defined channels.
  • context.engine: Read-only workspace inspection (getStatus(), getProjectContext(), getRecentChanges()).

🚀 Official Workspace Plugin Examples

DevDiff includes 4 production-ready, fully working plugin implementations inside the repository:


🔒 Security & Supply Chain Protection

For details on how DevDiff scans transitive dependencies, detects obfuscated code, and reviews permissions before plugin installation, visit the Plugin Security & Supply Chain Protection Documentation.