Skip to content

Build-time template injection for repeated command snippets #183

@dean0x

Description

@dean0x

Problem

Command markdown files (resolve.md, plan.md, code-review.md, etc.) contain repeated boilerplate sections that must stay in sync manually. The most prominent example is the knowledge-loading phase (~3 lines repeated across 10 surfaces), but the pattern applies to any shared orchestration step.

These files must be self-contained at runtime (Claude reads each in isolation — no import mechanism), so the duplication is currently unavoidable.

Proposed Solution

Extend the build system (npm run build / devflow init) to support template expansion in command files:

  1. Define shared snippets in shared/snippets/ (e.g., knowledge-loading-phase.md)
  2. Command source files use a marker like <!-- inject:knowledge-loading-phase -->
  3. Build step expands markers into full content before copying to install paths

This mirrors how shared/skills/ and shared/agents/ already work — single source of truth in shared/, distributed at build time.

Context

Scope

Post-v2 release. Low priority — current duplication is manageable and the command set is stable.

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