Skip to content

Consolidate frontmatter metadata files #8

@vegastyle

Description

@vegastyle

Issue

Currently openpackage requires that you manually create multiple frontmatter files to support different platforms, (my-command.opencode.yml for example). 

This creates ALOT of clutter if you are supporting multiple files and have multiple platforms to support and duplicate information in the yaml files for shared key value pairs.

Proposed solution

It would be easier manage frontmatter data by consolidating all the frontmatter metadata files for an individual md file into a single file yaml file.

Support for new commands would need to be added

  • decompose command

    • This command takes an md file, copies frontmatter yaml content it into its own yaml file and reformats the yaml file to the openpackage agnostic format so it can be recomposed back into a format that is supported by the different ai platforms.
    • By default the decompose command tries to find matching md files in their respective platform's directory to build a more complete frontmatter yaml file.
  • compose command

    • This command takes an md file and its frontmatter yaml file and creates the various variations of the md file for the different platforms it supports. By default the compose command attempts to create the new files in their respective platform's directory.

Changes to existing commands would be as follows:

  • Pack/Save

    • During the pack/save step the decompose command should be used to only save the decomposed files to the local registry.
  • Install command

    • During the install step, openpackage uses the compose command to build the different md files properly for all the supported ai platforms.

Example of the new decomposed structure

example.yml

# This can also be called default, this is the common frontmatter content that is shared between all or most applications
[global]
name: code-explorer
description: Deeply analyzes existing codebase features by tracing execution paths, mapping architecture layers, understanding patterns and abstractions, and documenting dependencies to inform new development

# Here you can include some specific metadata for openpackage to know how to build the frontmatter. 
# In this example you have model and model provider so that for platforms that support multiple model providers they can dynamically build the full path to the name of the model. 
# This information is different from platforms such as gemini, claude code, codex that use non-standard names as you wouldn't use the model-provider name but the model name itself may be the same. 

[openpackage]
model-provider: anthropic
model: claude-sonnet-4-5

#application specific frontmatter 
[opencode]
mode: primary
model: anthropic/claude-sonnet-4-5
temperature: 0.1
tools:  write: false  edit: false  bash: true

[claude]
tools: Glob, Grep, LS, Read, NotebookRead, WebFetch, TodoWrite, WebSearch, KillShell, BashOutput
model: sonnet
color: yellow

example.md

I am a code explorer agent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions