Feature Description
Add a tnmsc compile subcommand that performs a simple sync of front matter per file—i.e. update or normalize the YAML front matter in each source file without running the full Input → Transform → Output pipeline. This supports workflows where users only want to refresh front matter (e.g. from export metadata or a canonical schema) without writing to Cursor/Kiro/Warp/etc.
- Current behavior: tnmsc has subcommands like
help, version, config, dry-run, clean, plugins; the default (no subcommand) runs the full sync pipeline (ExecuteCommand). There is no dedicated command that only compiles/syncs front matter in place per file.
- Problem: Users who only need to sync front matter definitions (e.g. merge export metadata into YAML, or normalize keys) must either run the full pipeline or use external tooling.
Use Case
- User has skill/rule/command markdown under
skill, rule, or fastCommand src dirs with existing front matter.
- User runs
tnmsc compile (optionally with scope/glob or config).
- CLI compiles each file (e.g. MDX → metadata + content via
@truenine/md-compiler), merges or normalizes front matter (e.g. from mdxToMd export metadata), and writes back the same files with updated front matter only (or minimal content change), without invoking any output plugin.
- Result: source files have consistent, up-to-date front matter for use in the next full
tnmsc sync or by other tools.
Typical workflow: edit content or exports → tnmsc compile to refresh front matter → commit or run full sync.
Expected Outcome
- New subcommand
compile registered in PluginPipeline (e.g. in Subcommand type and VALID_SUBCOMMANDS).
- A new command implementation (e.g.
CompileCommand) that:
- Uses existing config (e.g.
skill, rule, fastCommand src paths from shadow/global config).
- For each relevant file: parse front matter + optional MDX compile, compute merged/normalized front matter, write back to the same file (or optional dry-run).
- No change to existing sync/output plugins; compile is a separate, lightweight path.
- Scope: CLI only; affected modules:
cli/src/PluginPipeline.ts, cli/src/commands/, config for src dirs.
Context Information
- Branch: dev
- Latest Commit: 83fe32b chore: update version number in package.json to 2026.10219.10518
- Working Tree: clean
- OS: Windows (win32 10.0.26200)
- Relevant code: Front matter is already parsed/built in
RuleInputPlugin (parseMarkdown, mdxToMd, mergedFrontMatter), and in output plugins via buildMarkdownWithFrontMatter from @truenine/md-compiler/markdown. The new command would reuse these utilities to read → merge/normalize → write per file.
Additional Notes
- Preserve read-only constraint where possible: "compile" updates only the front matter (and possibly normalized content) of source files that are under the user's config; it does not modify arbitrary files.
- Consider
--dry-run for compile to preview front matter changes without writing.
Feature Description
Add a
tnmsc compilesubcommand that performs a simple sync of front matter per file—i.e. update or normalize the YAML front matter in each source file without running the full Input → Transform → Output pipeline. This supports workflows where users only want to refresh front matter (e.g. from export metadata or a canonical schema) without writing to Cursor/Kiro/Warp/etc.help,version,config,dry-run,clean,plugins; the default (no subcommand) runs the full sync pipeline (ExecuteCommand). There is no dedicated command that only compiles/syncs front matter in place per file.Use Case
skill,rule, orfastCommandsrc dirs with existing front matter.tnmsc compile(optionally with scope/glob or config).@truenine/md-compiler), merges or normalizes front matter (e.g. frommdxToMdexport metadata), and writes back the same files with updated front matter only (or minimal content change), without invoking any output plugin.tnmscsync or by other tools.Typical workflow: edit content or exports →
tnmsc compileto refresh front matter → commit or run full sync.Expected Outcome
compileregistered inPluginPipeline(e.g. inSubcommandtype andVALID_SUBCOMMANDS).CompileCommand) that:skill,rule,fastCommandsrc paths from shadow/global config).cli/src/PluginPipeline.ts,cli/src/commands/, config for src dirs.Context Information
RuleInputPlugin(parseMarkdown,mdxToMd, mergedFrontMatter), and in output plugins viabuildMarkdownWithFrontMatterfrom@truenine/md-compiler/markdown. The new command would reuse these utilities to read → merge/normalize → write per file.Additional Notes
--dry-runfor compile to preview front matter changes without writing.