Skip to content

feat: Implement plugin architecture for init workflow #28

@wtthornton

Description

@wtthornton

Overview

Implement a plugin-based architecture for the initialization workflow to allow extensibility without modifying core code.

Current Limitations

  • Adding new init features requires modifying init_project.py
  • Hard to customize init workflow per project
  • Tight coupling between init phases
  • Users can't add custom init steps

Proposed Architecture

Plugin Interface

class InitPlugin(ABC):
    @property
    def name(self) -> str:
        """Plugin name"""
        pass

    @property
    def phase(self) -> str:
        """Init phase (validate, detect, populate, generate, verify)"""
        pass

    @property
    def dependencies(self) -> List[str]:
        """Required plugins that must run first"""
        pass

    def execute(self, context: InitContext) -> InitResult:
        """Execute plugin logic"""
        pass

Built-in Plugins

  • config-validator - Validate configuration files
  • tech-stack-detector - Detect languages, frameworks, libraries
  • context7-cache-populator - Pre-populate documentation cache
  • expert-generator - Auto-generate experts from knowledge
  • project-structure-validator - Validate directory structure

Plugin Registration

# In init_project.py
orchestrator = InitOrchestrator(project_root)
orchestrator.register_plugin(ConfigValidatorPlugin())
orchestrator.register_plugin(TechStackDetectorPlugin())
orchestrator.register_plugin(ExpertGeneratorPlugin())
result = orchestrator.run()

User Custom Plugins

# In .tapps-agents/plugins/custom_init.py
class CustomInitPlugin(InitPlugin):
    name = "custom-setup"
    phase = "generate"
    dependencies = ["tech-stack-detector"]

    def execute(self, context):
        # Custom init logic
        return InitResult(success=True)

Benefits

  1. Extensibility - Add new features without modifying core
  2. Customization - Users can add project-specific init steps
  3. Testability - Each plugin is independently testable
  4. Dependency Management - Clear plugin dependencies
  5. Reusability - Plugins can be shared across projects

Implementation Plan

  1. Define InitPlugin base class
  2. Define InitContext and InitResult classes
  3. Create InitOrchestrator for plugin execution
  4. Convert existing init steps to plugins
  5. Add plugin discovery mechanism
  6. Support user-defined plugins
  7. Add configuration for enabling/disabling plugins
  8. Add documentation and examples

Configuration Example

# .tapps-agents/init-config.yaml
init:
  plugins:
    - name: config-validator
      enabled: true
    - name: tech-stack-detector
      enabled: true
    - name: expert-generator
      enabled: ${AUTO_EXPERTS}
    - name: custom-setup
      enabled: true
      path: .tapps-agents/plugins/custom_init.py

Success Criteria

  • Plugin interface defined and documented
  • All existing init steps converted to plugins
  • Plugin discovery working
  • User custom plugins supported
  • Tests for plugin system
  • Documentation with examples

Dependencies

Priority

Medium - Valuable for extensibility, implement after basic refactoring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions