-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] Add tnmsc check command: front matter validation, language detection, path existence, AI-friendly fix prompts #25
Copy link
Copy link
Open
Description
Feature Description
Add tnmsc check as a full pipeline that runs validation and existence checks before or instead of sync, with AI-friendly, copyable prompt output for fixing issues.
Scope of the check command:
- Simple front matter format check — Validate YAML front matter syntax and required/shape of fields per prompt type (skill, rule, fast command, sub-agent, etc.).
- Simple front matter field language detection — Detect language of text fields (e.g.
description,name) to spot mismatches (e.g. config expects Chinese but field is in English) and report for consistency or i18n. - Existence checks for configured paths — Verify that
src/distand key paths exist: e.g.skill.src,rule.src,fastCommand.src,globalMemory.src,workspaceMemory.src,project.src/app,rules, and that expected files or directories are present under shadow source project and workspace. - Friendly, copyable, AI-friendly output — Emit errors and suggestions in a format that is easy to copy and paste into an AI chat (e.g. structured bullet list or a single block of prompt text) so users can get “fix this” prompts and apply fixes with minimal editing.
Problem Statement
- Current behaviour: tnmsc has no dedicated
checksubcommand. Config validation happens at load time (e.g. inConfigLoader); front matter is parsed during the sync pipeline. There is no single command to “only validate” the repo and get a clear, actionable report. - Problem: Users cannot quickly validate front matter format, field language, or path existence without running a full sync or inspecting code. When something fails, getting an AI-friendly, copy-pasteable description of what’s wrong and how to fix it is cumbersome.
Proposed Solution (Optional)
- Introduce a
checksubcommand that:- Loads the same config as sync (including
shadowSourceProjectand path pairs). - Runs: (1) front matter format validation per file type, (2) optional language detection on front matter text fields, (3) existence checks for all configured
src/distand key dirs (e.g.src/skills,src/rules,app,app/global.cn.mdx). - Outputs a report (CLI + optional JSON) and, for each error or warning, a short “prompt snippet” that the user can copy into an AI to request a fix (e.g. “Fix the following: …” with file path, current content snippet, and expected shape).
- Loads the same config as sync (including
- Reuse existing types and config (e.g.
ShadowSourceProjectConfig,ConfigLoader) socheckstays aligned with sync behaviour.
User Scenario
- User runs
tnmsc checkin a workspace (or with--config). - CLI validates front matter format and optional language of fields, then checks existence of
src,app,rules, and other configured paths. - For each issue, CLI prints a clear message and a copyable, AI-friendly prompt block (e.g. “Copy the following to your AI assistant to fix: …”).
- User copies the block into Cursor/Claude/etc., gets a suggested fix, and re-runs
tnmsc checkuntil clean (then runstnmscsync as needed).
Expected Outcome
- New subcommand
check(e.g. inSubcommandandVALID_SUBCOMMANDSinPluginPipeline.ts). - A CheckCommand (or equivalent) that runs the validation pipeline and prints:
- Front matter format errors (and optionally warnings) per file.
- Optional language-detection results for front matter text fields.
- Existence check results for configured paths (e.g.
skill.src,rule.src,app,rules,globalMemory.src, etc.). - For each finding: a short, copyable, AI-friendly prompt snippet for error fixing.
- Output format: human-readable by default, with optional machine-readable (e.g.
--json) for tooling. - Scope: CLI only; affected areas:
cli/src/PluginPipeline.ts,cli/src/commands/, config loading and path resolution, plus optional use of@truenine/md-compilerfor front matter parsing.
Context Information
- Branch: dev
- Latest commit: 83fe32b chore: update version number in package.json to 2026.10219.10518
- OS: Windows (win32)
- Relevant config:
ShadowSourceProjectConfigdefinesskill,fastCommand,subAgent,rule,globalMemory,workspaceMemory,projectwithsrc/distpairs (e.g.src/skills,src/rules,app,app/global.cn.mdx). Nochecksubcommand exists today.
Additional Notes
- Consider
--fixor a separate “suggest” mode that outputs suggested edits without writing (e.g. for AI to consume). - Language detection can be best-effort (e.g. script/locale hints) to avoid heavy dependencies; focus on “likely wrong language” hints for key fields.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels