Skip to content

feat(augmentcode): import .mdc rules and .txt commands - #3998

Merged
dyoshikawa merged 4 commits into
mainfrom
resolve-issue-3729-augmentcode-import-mdc-txt
Nov 26, 2026
Merged

dyoshikawa merged 4 commits into
mainfrom
resolve-issue-3729-augmentcode-import-mdc-txt

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follow-up for the remaining AugmentCode / Auggie 1.x items in #3729: import now reads .mdc rules and .txt commands, which Auggie loads but rulesync skipped silently.

Primary sources: rules docs ("Recursively searches .md and .mdc files" for .augment/rules/ and ~/.augment/rules/) and custom commands docs ("Name derived from the filename (.md or .txt)").

Changes

  • Rules: the augmentcode factory sets nonRootImportGlob: "**/*.{md,mdc}". AugmentcodeRule.toRulesyncRule maps .mdc to .md, the same way OmpRule does. Works in project and global scope.
  • Commands: AugmentcodeCommand.loadAdditionalImportFiles (an import-only hook) also scans .augment/commands/**/*.txt (~/.augment/commands with --global). Each file becomes a .md rulesync command, with frontmatter parsed the same way as for .md files. If the frontmatter is invalid, the file is skipped with a warning. The augmentcode-plugin command class still overrides the hook to return nothing.
  • Same-name handling in the rules processor: a file matched by nonRootImportGlob with an extension rulesync does not write (foo.mdc) is skipped with a warning when its .md twin exists. Before this change both files imported to the same rulesync rule, and whichever came last won. The order was unspecified. This also applies to omp, so its test now expects the .md file to win.
  • Leftover warning: import warns that generate writes only .md files and never deletes the .mdc / .txt originals. Users have to delete them by hand, or the tool loads the rule or command twice.
  • Docs: a new AugmentCode rules note, an extended AugmentCode commands note and an oh-my-pi note in docs/reference/file-formats.md. docs-content.ts is regenerated.

Design decisions

  • Import-only, deletion untouched. The deletion globs are unchanged: **/*.md for rules, and the command processor's own .md glob. Hand-written .mdc / .txt files therefore stay safe from --delete. This was the blocker for .txt noted in docs(augmentcode): note recommendedMarketplaces is read by Auggie 0.x only #3815. Tests check that these files never show up in loadToolFiles({ forDeletion: true }).
  • .md wins over a same-named .mdc / .txt file. .md is the format rulesync generates, so keeping it makes import and then generate stable.
  • .txt commands 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.
  • No widening. This only adds import sources for rules and commands. Permissions and other generated output are unchanged.
  • Plugin rules/ and recommendedMarketplaces are kept. Auggie 0.x is still published on v0-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.
  • Generating APPEND_SYSTEM.md / SYSTEM.md: the root rule is already written as an always_apply rule in .augment/rules/. Writing it again would duplicate the instructions.
  • 1.x positional placeholders ($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

dyoshikawa and others added 4 commits November 26, 2026 17:30
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
@dyoshikawa
dyoshikawa merged commit ce2e4ca into main Nov 26, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-3729-augmentcode-import-mdc-txt branch November 26, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow up AugmentCode upstream updates: Auggie 1.x tool names, nameless agents, plugin rules

1 participant