feat: create and browse rules and memory, not just skills - #36
Merged
Conversation
Rules MVP. Builds on the .mdc scan fix (#35). - src/scaffolds.ts: shared scaffold module for both frontends. Rule files get .mdc frontmatter (description, globs, alwaysApply); memory gets a plain body; skills keep SKILL.md. scaffoldExtension picks .mdc for Cursor rules, .md otherwise. Replaces the near-identical hand-rolled strings the two frontends used to duplicate. - src/types.ts + scanner.ts: SkillItem gains typed globs and alwaysApply, promoted from .mdc frontmatter (array globs normalized to comma string), kept in the frontmatter bag too. - create-skill-modal.ts (Obsidian): drops the exclusion that blocked creating rule/memory files, adds scroll/database type icons, uses the shared scaffold with the correct extension. - parity.ts (VS Code): create flow uses the shared scaffold and extension. - sidebar.ts (Obsidian): adds the Memories filter row (was omitted; only shows when memory items exist). Implemented by Codex (gpt-5.6-sol), reviewed line by line. Verified: build + eslint + vscode tsc all clean. Scaffold outputs checked (rule -> .mdc with globs/alwaysApply, memory -> .md, skill -> SKILL.md). Full round-trip proven: a rule created via the shared scaffold writes ts-strict.mdc, and re-scanning surfaces globs '**/*.ts' and alwaysApply true as typed fields. vsix installed into VS Code and Cursor.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes #26. The Rules MVP, built on the .mdc scan fix (#35).
Per the shaping decisions: rules-first MVP, shared scaffold, AGENTS.md-aware where relevant.
What ships
if (sp.type === "rule" || sp.type === "memory") continue;). Removed. You can now scaffold a Cursor.mdcrule, a Windsurf/Codex memory file, etc..mdcformat on create. Newsrc/scaffolds.tsis the single source of truth for scaffold bodies + extensions, shared by both frontends (they used to duplicate near-identical strings). A rule gets.mdcwithdescription/globs/alwaysApplyfrontmatter; memory gets a plain body; skills keepSKILL.md.scaffoldExtensionpicks.mdcfor Cursor rules,.mdotherwise.SkillItemgainsglobs?: stringandalwaysApply?: boolean, promoted from.mdcfrontmatter in the scanner (array globs normalized to a comma string), kept in the raw bag too.Deliberately deferred (v2, not this PR)
.mdcmetadata editor (glob-list control, alwaysApply toggle) — for now globs/alwaysApply are edited as raw frontmatter in the fileImplementation
Written by Codex (gpt-5.6-sol), reviewed line by line.
Verification
bun run build+bun run lint+ vscodetsc --noEmit: all clean (re-run by me, not just Codex's report).mdcwith the three frontmatter keys, memory →.md, skill →SKILL.md, command →.mdts-strict.mdc; re-scanning surfacesglobs: "**/*.ts"andalwaysApply: trueas typed fields