Back to Articles

dotai: Teaching AI Assistants Your Team's Workflow Through Plugin-Based Context Injection

[ View on GitHub ]

dotai: Teaching AI Assistants Your Team's Workflow Through Plugin-Based Context Injection

Hook

Your AI coding assistant doesn't know your team runs tests before every commit, follows specific security review patterns, or prefers Rails conventions over generic Ruby. dotai fixes this by injecting structured context at precise moments in the AI's lifecycle.

Context

AI coding assistants like Claude Code and Cursor have become surprisingly capable at writing code, but they suffer from a fundamental problem: they're generic. Every interaction starts from scratch, with the AI having no memory of your team's workflows, testing patterns, or architectural decisions. You end up repeating the same context in every prompt: "make sure to write tests," "follow our Rails conventions," "check for security issues before suggesting changes."

The standard solution has been simple configuration files—.cursorrules, .aidigestignore, and similar text files that provide static context. But these are blunt instruments. They can't inject different instructions at different points in the AI's workflow, can't auto-invoke based on detected context, and can't be easily shared as installable packages across teams. dotai emerged as a more sophisticated approach: a plugin-based context management system that treats AI assistants as extensible platforms rather than configured tools.

Technical Insight

dotai's architecture revolves around three key concepts: lifecycle hooks, installable components, and auto-invoked skills. The system lives in a .claude/settings.json file at your project root, defining how and when to modify the AI's behavior.

The lifecycle hooks are where dotai differentiates itself. Instead of dumping all context into a single prompt, you can inject different instructions at three specific points: beforeStart (initial context setting), beforeComplete (right before the AI generates a response), and afterCompact (after context pruning when token limits are hit). Here's what a basic configuration looks like:

# .claude/settings.json
{
  "beforeStart": [
    "You are working in a Rails 7 application.",
    "Always use Hotwire over JavaScript frameworks.",
    "Follow our security review checklist before suggesting auth changes."
  ],
  "beforeComplete": [
    "Before responding, verify that any database queries use proper indexes.",
    "Check that all user inputs are sanitized."
  ],
  "afterCompact": [
    "Maintain awareness of our Redis caching strategy even as context is pruned."
  ]
}

The plugin marketplace system allows you to package these configurations as installable units. Instead of copying YAML between projects, you can install plugins with:

npx @dotai/cli install @compound/rails-best-practices

This extends your .claude/settings.json with pre-built prompts and commands. Plugins can define slash commands (manually invoked), skills (auto-invoked based on context), and MCP server integrations. The Compound Engineering plugin, for example, adds 27 specialized agents for tasks like security reviews, performance analysis, and documentation generation.

Auto-invoked skills are particularly powerful. Unlike commands that require manual triggering, skills detect context and activate automatically. The built-in tdd skill monitors your workflow and automatically reminds the AI to write tests when it detects new function implementations:

{
  "skills": {
    "tdd": {
      "triggers": ["new_function", "new_class"],
      "action": "Automatically generate comprehensive tests for the new code, following our Jest conventions with describe blocks and meaningful test names."
    }
  }
}

The MCP (Model Context Protocol) integration extends context beyond local files. You can connect to external documentation sources, API references, or internal wikis:

{
  "mcpServers": {
    "rails-docs": {
      "command": "npx",
      "args": ["-y", "@dotai/mcp-server-rails-guides"]
    }
  }
}

Now when the AI encounters Rails-specific questions, it can query your MCP server for current documentation rather than relying on potentially outdated training data.

The real architectural insight here is treating prompt engineering as infrastructure-as-code. Just as you version control Terraform configs or Kubernetes manifests, dotai lets you version control how your AI assistant behaves. A new team member clones the repo and immediately gets an AI that knows your testing patterns, security requirements, and architectural preferences. No onboarding documents needed—the AI assistant itself is onboarded through the plugin configuration.

Gotcha

dotai's biggest limitation is ecosystem lock-in. This is fundamentally a Claude Code/Cursor tool, and the plugin system won't work with GitHub Copilot, Aider, or most other AI coding assistants. If your team isn't standardized on Cursor or Claude Code, or if you're evaluating multiple AI tools, dotai creates vendor dependency that may hurt more than it helps.

The plugin marketplace is also a double-edged sword. While the Compound Engineering plugin offers 27 pre-built agents, there's no clear governance or quality control. Third-party plugins can become outdated as AI models evolve, and there's no obvious mechanism for reporting issues or verifying plugin maintenance status. You're trusting plugin authors to keep their prompt engineering current with rapidly changing AI capabilities. Documentation is sparse on troubleshooting plugin conflicts or debugging why a particular skill isn't auto-invoking as expected—you're largely on your own when things don't work.

Verdict

Use if: You've standardized on Claude Code or Cursor across your team and need repeatable, shareable AI workflows. Particularly valuable if you're encoding domain-specific practices (Rails conventions, security review checklists, performance testing patterns) that juniors need to follow and AI assistants should enforce. The infrastructure-as-code approach to prompt engineering pays dividends when onboarding new developers or maintaining consistency across multiple projects. Skip if: You're working solo, using multiple AI assistants, or prefer portability over power. Simple .cursorrules files offer 80% of the value with none of the vendor lock-in. Also skip if you're in a fast-moving startup where codifying workflows might slow down experimentation—dotai works best when you have established patterns worth encoding.

// ADD TO YOUR README
[![Featured on Starlog](https://starlog.is/api/badge/ai-dev-tools/udecode-dotai.svg)](https://starlog.is/api/badge-click/ai-dev-tools/udecode-dotai)