Feature: Asset Overrides in Collections
Problem
Core collections often define instructions with specific applyTo patterns (e.g., src/**/*.py). However, different teams or projects might use different directory structures (e.g., lib/**/*.py or app/**/*.py). Currently, they have to duplicate the entire asset just to change that one field, which breaks the inheritance model.
Proposed Solution
Allow the collections.yaml schema to support an overrides property for items.
Example Schema
pfe-charms:
includes:
- core
items:
- src: assets/instructions/python/code-commenting.instructions.md
dest: .github/instructions/python-code-commenting.instructions.md
# NEW: Override specific fields in the markdown frontmatter
overrides:
applyTo: "lib/**/*.py"
priority: 100
Implementation Details
- Parser Update: The
scripts/install_collections.sh script needs to detect the overrides block.
- Processing:
- Read the source markdown file.
- Parse the YAML frontmatter.
- Merge the overrides into the frontmatter.
- Write the modified content to the destination.
- Dependencies: This will likely require a more robust YAML/Markdown processor than simple
cat or sed. We might need to rely heavily on yq's frontmatter processing capabilities or introduce a small Python helper script.
Benefits
- Reduces duplication.
- Allows core assets to be more generic.
- Empowers teams to adapt rules to their specific context.
Feature: Asset Overrides in Collections
Problem
Core collections often define instructions with specific
applyTopatterns (e.g.,src/**/*.py). However, different teams or projects might use different directory structures (e.g.,lib/**/*.pyorapp/**/*.py). Currently, they have to duplicate the entire asset just to change that one field, which breaks the inheritance model.Proposed Solution
Allow the
collections.yamlschema to support anoverridesproperty for items.Example Schema
Implementation Details
scripts/install_collections.shscript needs to detect theoverridesblock.catorsed. We might need to rely heavily onyq's frontmatter processing capabilities or introduce a small Python helper script.Benefits