Skip to content

Prompt compiler: template system for reducing FEATURE_KNOWLEDGE duplication #194

@dean0x

Description

@dean0x

Summary

FEATURE_KNOWLEDGE content is currently duplicated across all orchestration skills and command files that pass it to agents. This was a deliberate choice for the initial implementation, but a template system would eliminate the duplication.

Proposed Solution

Introduce a compile-time template system:

  • .template.md files with {{snippet:name}} placeholders
  • Shared snippets in a shared/snippets/ directory
  • A compile script that resolves snippets before distribution

Example

<!-- implement:orch/SKILL.template.md -->
## Phase 2: Load Feature Knowledge
{{snippet:feature-kb-loading}}
<!-- shared/snippets/feature-kb-loading.md -->
Load FEATURE_KNOWLEDGE from `.features/` index...

Context

  • Deferred from PR feat: per-feature knowledge bases #193 (per-feature KB review)
  • Current duplication is manageable (~6 files) but will grow as more skills consume FEATURE_KNOWLEDGE
  • The same pattern would benefit KNOWLEDGE_CONTEXT loading

Acceptance Criteria

  • Template files (.template.md) compile to final .md during npm run build
  • Snippets live in shared/snippets/
  • Build validates all {{snippet:*}} references resolve
  • Existing commands and skills produce identical output after migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions