Repository navigation
feat(augmentcode): import .mdc rules and .txt commands - #3998
Merged
Merged
Conversation
Auggie loads `.md` and `.mdc` files from `.augment/rules/` and `~/.augment/rules/`, and 1.x also loads `.txt` commands from `.augment/commands/`. Import now reads both and turns them into `.md` rulesync files. Generation and the `--delete` sweep stay on `.md`, so these import-only files are never written or removed; import warns that the originals must be deleted by hand after the next generate. A same-named `.md` file wins over an `.mdc` rule or `.txt` command, with a warning. For rules this applies to every target with a `nonRootImportGlob` (also oh-my-pi), replacing the unspecified last-one-wins order. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
- Skip an import-only command whose frontmatter is not valid YAML instead of aborting the import (shared helper for .txt and .agents/commands). - Match the .md twin of an alternate-extension rule case-insensitively, like the rulesync-name collision check. - Make the leftover-original warning tool-neutral. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…gmentcode-import-mdc-txt # Conflicts: # src/generated/docs-content.ts
…gmentcode-import-mdc-txt # Conflicts: # src/generated/docs-content.ts
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
Follow-up for the remaining AugmentCode / Auggie 1.x items in #3729: import now reads
.mdcrules and.txtcommands, which Auggie loads but rulesync skipped silently.Primary sources: rules docs ("Recursively searches
.mdand.mdcfiles" for.augment/rules/and~/.augment/rules/) and custom commands docs ("Name derived from the filename (.mdor.txt)").Changes
augmentcodefactory setsnonRootImportGlob: "**/*.{md,mdc}".AugmentcodeRule.toRulesyncRulemaps.mdcto.md, the same wayOmpRuledoes. Works in project and global scope.AugmentcodeCommand.loadAdditionalImportFiles(an import-only hook) also scans.augment/commands/**/*.txt(~/.augment/commandswith--global). Each file becomes a.mdrulesync command, with frontmatter parsed the same way as for.mdfiles. If the frontmatter is invalid, the file is skipped with a warning. Theaugmentcode-plugincommand class still overrides the hook to return nothing.nonRootImportGlobwith an extension rulesync does not write (foo.mdc) is skipped with a warning when its.mdtwin exists. Before this change both files imported to the same rulesync rule, and whichever came last won. The order was unspecified. This also applies toomp, so its test now expects the.mdfile to win..mdfiles and never deletes the.mdc/.txtoriginals. Users have to delete them by hand, or the tool loads the rule or command twice.docs/reference/file-formats.md.docs-content.tsis regenerated.Design decisions
**/*.mdfor rules, and the command processor's own.mdglob. Hand-written.mdc/.txtfiles therefore stay safe from--delete. This was the blocker for.txtnoted in docs(augmentcode): note recommendedMarketplaces is read by Auggie 0.x only #3815. Tests check that these files never show up inloadToolFiles({ forDeletion: true })..mdwins over a same-named.mdc/.txtfile..mdis the format rulesync generates, so keeping it makes import and then generate stable..txtcommands are listed before the.agents/commands/commands. They live in the primary.augment/commands/root, so they take priority over a shared-root copy in the processor's duplicate check.rules/andrecommendedMarketplacesare kept. Auggie 0.x is still published onv0-release(0.37.1). docs(augmentcode): reflect Auggie 1.x becoming the stable CLI #3908 already added warnings saying that only users pinned to 0.x get this output.Skipped items
.augment/prompts/import: it is not in the docs and was only seen in a string diff of the bundle.APPEND_SYSTEM.md/SYSTEM.md: the root rule is already written as analways_applyrule in.augment/rules/. Writing it again would duplicate the instructions.$1,$@,${@:N}): they are body text and pass through unchanged, so there is nothing to convert.Closes #3729
🤖 Generated with Claude Code
https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4