Skip to content

Commit 1eef238

Browse files
author
Matthew
committed
Merge branch 'feat/13-1-plugin-architecture-design' into 'main'
docs(standards): plugin architecture design (Story 13.1) See merge request orgdocs/development-standards!36
2 parents 75a3dd5 + a760353 commit 1eef238

3 files changed

Lines changed: 678 additions & 44 deletions

File tree

‎_bmad-output/implementation-artifacts/13-1-design-plugin-architecture.md‎

Lines changed: 67 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Story 13.1: Design Plugin Architecture for Community Extensions
22

3-
Status: ready-for-dev
3+
Status: review
44

55
<!-- Note: Validation is optional. Run validate-create-story for quality check before dev-story. -->
66

@@ -22,48 +22,48 @@ so that I can contribute language support or tool integrations without modifying
2222

2323
## Tasks / Subtasks
2424

25-
- [ ] Task 1: Research extension patterns in comparable tools (AC: 1, 5)
26-
- [ ] 1.1 Analyze how **pre-commit** handles third-party hooks: repo-based discovery, hook manifest (`hooks.yaml`), isolation model, version pinning
27-
- [ ] 1.2 Analyze how **ESLint** handles plugins: npm package convention (`eslint-plugin-*`), rule registration, shared configs, flat config composition
28-
- [ ] 1.3 Analyze how **Terraform providers** handle plugins: registry-based discovery, versioned binaries, provider manifest, required_providers block
29-
- [ ] 1.4 Analyze how **GitHub Actions** handle reusable components: `action.yml` manifest, composite actions, marketplace distribution
30-
- [ ] 1.5 Summarize patterns: discovery mechanisms, manifest formats, isolation strategies, version management, backwards compatibility approaches
31-
32-
- [ ] Task 2: Identify extension points in current DevRail architecture (AC: 1, 4, 5)
33-
- [ ] 2.1 Map Makefile extension points: how `_lint`, `_format`, `_test`, `_security`, `_fix` iterate over languages; where a plugin could register a new language block
34-
- [ ] 2.2 Map Dockerfile extension points: how tools are installed; options for extending (multi-stage COPY, sidecar containers, volume mounts, runtime install)
35-
- [ ] 2.3 Map `.devrail.yml` extension points: how the schema could accept plugin-defined languages; per-language override mechanism
36-
- [ ] 2.4 Map pre-commit extension points: how `.pre-commit-config.yaml` includes external repos; how plugins could register hooks
37-
- [ ] 2.5 Map CI pipeline extension points: how GitHub Actions/GitLab CI could include plugin-defined jobs
38-
- [ ] 2.6 Map `devrail init` extension points: how the init script could discover and scaffold plugin config
39-
40-
- [ ] Task 3: Design the plugin interface (AC: 1, 2, 3, 4)
41-
- [ ] 3.1 Define **plugin manifest format** (`plugin.devrail.yml` or similar) specifying: language name, tool binaries, Makefile target commands, pre-commit hooks, config file templates, gating conditions
42-
- [ ] 3.2 Define **Makefile integration pattern**: how plugins register language blocks in `_lint`/`_format`/`_test`/`_security` without modifying the core Makefile (options: include files, dynamic target generation, plugin directory scanning)
43-
- [ ] 3.3 Define **container integration pattern**: how plugins add tools to the image (options: extending base image, sidecar container, volume-mounted binaries, runtime install via plugin script)
44-
- [ ] 3.4 Define **`.devrail.yml` extension mechanism**: how `languages:` accepts plugin-defined entries; how per-language overrides work for plugin languages
45-
- [ ] 3.5 Define **`make check` aggregation**: how plugin check results are collected and included in the composite pass/fail decision
46-
- [ ] 3.6 Define **plugin versioning and distribution**: how plugins are versioned, discovered, and installed (options: git repos, registry, directory convention)
47-
48-
- [ ] Task 4: Evaluate container integration strategies (AC: 5)
49-
- [ ] 4.1 **Option A: Extended image** -- Dockerfile `FROM ghcr.io/devrail-dev/dev-toolchain:v1` + plugin install. Pros: simple, single container. Cons: rebuild per-project, no standard distribution.
50-
- [ ] 4.2 **Option B: Sidecar containers** -- Plugin tools run in separate containers alongside dev-toolchain. Pros: isolation, independent versioning. Cons: complex orchestration, shared filesystem issues.
51-
- [ ] 4.3 **Option C: Volume-mounted plugins** -- Plugin binaries mounted into dev-toolchain container at runtime. Pros: no image rebuild. Cons: host dependency, platform compatibility.
52-
- [ ] 4.4 **Option D: Runtime install** -- `make check` runs plugin install script inside container before execution. Pros: zero build step. Cons: slow first run, network dependency.
53-
- [ ] 4.5 **Recommendation**: Evaluate each against DevRail's core constraints (single container, reproducible, CI-compatible, fast) and recommend the winning approach with rationale
54-
55-
- [ ] Task 5: Write the design document (AC: 6, 7)
56-
- [ ] 5.1 Create `_bmad-output/planning-artifacts/plugin-architecture-design.md`
57-
- [ ] 5.2 Include sections: Overview, Extension Points, Plugin Manifest, Makefile Integration, Container Integration, Distribution & Versioning, Example Walkthrough, Migration Path, Open Questions
58-
- [ ] 5.3 Include architecture diagrams (ASCII or mermaid) showing plugin discovery and execution flow
59-
- [ ] 5.4 Include complete example: a hypothetical "Elixir plugin" showing manifest, Makefile snippet, Dockerfile extension, and `.devrail.yml` usage
60-
- [ ] 5.5 Include migration path from current monolithic approach to plugin-capable architecture (backwards compatible)
61-
- [ ] 5.6 Document trade-offs and rationale for each design decision
62-
63-
- [ ] Task 6: Review and finalize (AC: 7)
64-
- [ ] 6.1 Self-review against acceptance criteria
65-
- [ ] 6.2 Verify design preserves all current DevRail guarantees (make check gates everything, container is authoritative, conventional commits enforced)
66-
- [ ] 6.3 Mark story as review
25+
- [x] Task 1: Research extension patterns in comparable tools (AC: 1, 5)
26+
- [x] 1.1 Analyze how **pre-commit** handles third-party hooks
27+
- [x] 1.2 Analyze how **ESLint** handles plugins
28+
- [x] 1.3 Analyze how **Terraform providers** handle plugins
29+
- [x] 1.4 Analyze how **GitHub Actions** handle reusable components
30+
- [x] 1.5 Summarize patterns into a comparison table
31+
32+
- [x] Task 2: Identify extension points in current DevRail architecture (AC: 1, 4, 5)
33+
- [x] 2.1 Map Makefile extension points (`HAS_<LANG>` blocks across `_lint`/`_format`/`_fix`/`_test`/`_security`/`_init`)
34+
- [x] 2.2 Map Dockerfile extension points (multi-stage `<lang>-builder`, runtime APT, install scripts)
35+
- [x] 2.3 Map `.devrail.yml` extension points (`languages:` list + per-language overrides + new `plugins:` section)
36+
- [x] 2.4 Map pre-commit extension points (per-language hook entries in templates)
37+
- [x] 2.5 Map CI pipeline extension points (per-language extras like Rails Postgres rspec job)
38+
- [x] 2.6 Map `devrail init` extension points (`ALL_LANGUAGES` constant, scaffolding via `_init`)
39+
40+
- [x] Task 3: Design the plugin interface (AC: 1, 2, 3, 4)
41+
- [x] 3.1 Define **plugin manifest format** (`plugin.devrail.yml`) — schema_version, name, version, devrail_min_version, container, targets, gates, pre_commit, init_scaffolds, tool_versions
42+
- [x] 3.2 Define **Makefile integration pattern** — embedded execution loop in core Makefile that iterates plugin manifests
43+
- [x] 3.3 Define **container integration pattern** — extended-image with auto-generated `Dockerfile.devrail`
44+
- [x] 3.4 Define **`.devrail.yml` extension mechanism** — `plugins:` section with `source`/`rev`/`languages` + lockfile
45+
- [x] 3.5 Define **`make check` aggregation** — plugin results enter existing `ran_languages` / `failed_languages` / JSON summary path
46+
- [x] 3.6 Define **plugin versioning and distribution** — git-only v1, source-address triple, immutable refs, lockfile
47+
48+
- [x] Task 4: Evaluate container integration strategies (AC: 5)
49+
- [x] 4.1 **Option A: Extended image** — evaluated
50+
- [x] 4.2 **Option B: Sidecar containers** — evaluated
51+
- [x] 4.3 **Option C: Volume-mounted plugins** — evaluated
52+
- [x] 4.4 **Option D: Runtime install** — evaluated
53+
- [x] 4.5 **Recommendation: Option A (Extended image)** — rationale documented
54+
55+
- [x] Task 5: Write the design document (AC: 6, 7)
56+
- [x] 5.1 Created `_bmad-output/planning-artifacts/plugin-architecture-design.md`
57+
- [x] 5.2 All required sections included (Overview, Research Summary, Extension Surface, Plugin Manifest, Project Configuration, Plugin Lifecycle, Make-Check Aggregation, Per-Language Tool Override, Container Integration, Distribution & Versioning, Security Model, Example Walkthrough, Migration Path, Open Questions)
58+
- [x] 5.3 ASCII architecture diagram included for plugin lifecycle
59+
- [x] 5.4 Complete Elixir plugin example walkthrough (manifest, install script, consumer adoption, first run, override, upgrade)
60+
- [x] 5.5 Three-phase migration path from monolith to plugin-first (`v1.10.0` → `v1.11.0` → `v2.0.0`)
61+
- [x] 5.6 Trade-offs documented for each container option, manifest field, and versioning axis
62+
63+
- [x] Task 6: Review and finalize (AC: 7)
64+
- [x] 6.1 Self-review against all 7 acceptance criteria — see Completion Notes
65+
- [x] 6.2 Design preserves DevRail guarantees: `make check` is the single gate, container is authoritative, immutable refs, JSON summary unchanged
66+
- [x] 6.3 Story marked as review
6767

6868
## Dev Notes
6969

@@ -165,4 +165,28 @@ Claude Opus 4.6
165165
- Research sources identified for each comparable tool
166166
- Plugin manifest strawman provides concrete starting point for design discussions
167167

168+
**Story 13.1 design output (2026-04-27):**
169+
170+
- Design document created: `_bmad-output/planning-artifacts/plugin-architecture-design.md`
171+
- All 7 acceptance criteria addressed:
172+
- **AC1** (extension points, interfaces, lifecycle) — covered in *Plugin Lifecycle*, *Plugin Manifest*, and *Current DevRail Extension Surface*
173+
- **AC2** (custom language without forking dev-toolchain) — covered end-to-end in *Example Walkthrough — An Elixir Plugin*
174+
- **AC3** (override default tools) — covered in *Per-Language Tool Override*
175+
- **AC4** (`make check` still aggregates) — covered in *Make-Check Aggregation* (plugin results join existing `ran_languages`/`failed_languages`/JSON summary)
176+
- **AC5** (compatible with container toolchain) — covered in *Container Integration* with four strategies evaluated; Option A (extended image) recommended
177+
- **AC6** (example walkthrough) — covered in *Example Walkthrough — An Elixir Plugin* (5 steps from authoring to upgrade)
178+
- **AC7** (design merged to planning-artifacts) — file lives in `_bmad-output/planning-artifacts/plugin-architecture-design.md`; story moved to `review` status pending acceptance
179+
- Research sources used: pre-commit, ESLint plugins, Terraform providers, GitHub Actions custom actions
180+
- Key design decisions:
181+
- Plugin distribution: git repos with source-address triple (`host/namespace/name`), immutable `rev:` refs, content-hashed lockfile
182+
- Container integration: extended image (`FROM ghcr.io/devrail-dev/dev-toolchain:v1` + plugin layers) — preserves "one container, one make check"
183+
- Manifest: single `plugin.devrail.yml` with `schema_version: 1`, `devrail_min_version`, `targets`, `gates`, `container`, `pre_commit`, `init_scaffolds`, `tool_versions`
184+
- Migration: three-phase rollout (`v1.10.0` adds loader, `v1.11.0` extracts Kotlin as reference plugin, `v2.0.0` removes monolithic `HAS_<LANG>` blocks)
185+
- Open questions explicitly enumerated for follow-up stories (registry, signing, parallel execution, plugin-to-plugin deps, standards-doc auto-generation, CI services, devrail-init integration)
186+
- No code changes in this story; implementation stories will follow from the migration phasing
187+
168188
### File List
189+
190+
- `_bmad-output/planning-artifacts/plugin-architecture-design.md` — created
191+
- `_bmad-output/implementation-artifacts/13-1-design-plugin-architecture.md` — updated (status, task checkboxes, completion notes)
192+
- `_bmad-output/implementation-artifacts/sprint-status.yaml` — updated (`13-1` → `review`)

‎_bmad-output/implementation-artifacts/sprint-status.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ development_status:
130130
epic-12-retrospective: optional
131131

132132
epic-13: in-progress
133-
13-1-design-plugin-architecture: ready-for-dev
133+
13-1-design-plugin-architecture: review
134134
epic-13-retrospective: optional
135135

136136
epic-14: done

0 commit comments

Comments
 (0)