feat(docs,rules): ship default content as editable markdown templates#9
Merged
Conversation
Move the autogenerated doc-rules.md from a full-rewrite template to a user-editable file whose only managed region is a ```frontmatter fenced block injected from agnos.json#docs.metadata. The default content (and the index/content templates) now ship as real .md asset files under each domain's templates/ directory. The rules domain follows the same pattern: AGENTS.md starter content moves to packages/domain-rules/templates/agents.md, exposed via a new @luxia/domain-rules/template subpath export so core can load it without pulling the plugin's @luxia/core import path (avoids a runtime cycle).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doc-rules.mdis no longer fully rewritten on everyagnos docs generate. It's now a user-editable file whose only managed region is a```frontmatterfenced code block, re-injected fromagnos.json#docs.metadata. Everything around the block is preserved.doc-rules.md,index.md, andcontent.mdmoves out of in-code template strings into real.mdasset files underpackages/domain-docs/templates/, so they can be edited as markdown.AGENTS.mdcontent moves topackages/domain-rules/templates/agents.md, exposed via a new@luxia/domain-rules/templatesubpath export.core/init.tsnow reads from it instead of an inlineSTARTER_RULESconst — single source of truth.How
doc-rules.mdregeneration works nowtemplates/doc-rules.md, then inject current metadata into its```frontmatterblockgeneratewriteIfChangedno-opsMetadata serialization runs through
js-yamlso descriptions containing colons or quotes round-trip safely.Architecture notes
corenow has a direct workspace dep on@luxia/domain-rules. To avoid a runtime cycle (the plugin'sindex.tsimports@luxia/core), the template loader lives in a separatesrc/template.tsmodule with no@luxia/coreimport, exported under the./templatesubpath. pnpm reports the workspace cycle as a warning; it's inert at runtime.@luxia/coremust build before@luxia/domain-rulesfor DTS resolution.pnpm -r buildhandles this in topological order; in a clean clone, build core first if running packages in isolation.