-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] Add tnmsc compile command for syncing front matter per file #24
Copy link
Copy link
Open
Description
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, orfastCommandsrc 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. frommdxToMdexport 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
tnmscsync 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
compileregistered inPluginPipeline(e.g. inSubcommandtype andVALID_SUBCOMMANDS). - A new command implementation (e.g.
CompileCommand) that:- Uses existing config (e.g.
skill,rule,fastCommandsrc 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).
- Uses existing config (e.g.
- 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 viabuildMarkdownWithFrontMatterfrom@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-runfor compile to preview front matter changes without writing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels