Skip to content

[pull] main from Tencent:main - #9

Merged
pull[bot] merged 2 commits into
Walternater:mainfrom
Tencent:main
Aug 27, 2026
Merged

pull[bot] merged 2 commits into
Walternater:mainfrom
Tencent:main

Conversation

@pull

@pull pull Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* fix(rules): write Cursor rules as .mdc with derived frontmatter

Cursor project rules must live in .cursor/rules/ as .mdc files with YAML
frontmatter (description/globs/alwaysApply); a plain .md there is silently
ignored, so team rules synced via `teamai pull` never entered a Cursor
session. RulesHandler.pullItem wrote `${name}.md` for every tool.

- pull: for Cursor, write <name>.mdc and derive frontmatter from the team
  rule — a `paths:` list maps to `globs` + alwaysApply:false, and a rule
  with no paths (mandatory) maps to alwaysApply:true. Other tools still
  get a plain .md copy.
- push: scanLocalForPush now also reads .cursor/rules/*.mdc, comparing
  markdown bodies only so a pull→push round-trip is not seen as modified;
  pushItem strips the derived frontmatter when writing an .mdc back to the
  team repo.
- cleanup: stale-file cleanup, removeItem, and pull.ts tombstone cleanup
  handle the .mdc extension for Cursor.

Body extraction is delimiter-based, not YAML-parsed: the Cursor `globs`
value (a leading-star glob) is invalid YAML, so a strict parse would fail
and swallow the frontmatter into the body.

Fixes git.woa.com/teamai/teamai-cli#3

* fix(rules): preserve team frontmatter and cover every Cursor .mdc call site

Follow-up on the Cursor `.mdc` fix. The extension decision lived in a private
helper in rules.ts plus an inline special case in pull.ts, so the other five
writers of the same directories still assumed `.md`, and the push direction
dropped the team rule's frontmatter.

Correctness:
- pushItem now merges the Cursor body into the team file instead of replacing
  it, so a body edit in `.cursor/rules/*.mdc` no longer deletes the team rule's
  `paths:` scope for everyone on the next pull.
- pre-push-sync handles `.mdc`; it previously skipped Cursor entirely, so a
  stale local copy was reported as "modified" and pushed over a newer team rule.
- uninstall collects rules by stem, so Cursor's `.mdc` rules are actually
  removed instead of surviving uninstall.
- `globs` is emitted quoted: a glob starting with `*` is a YAML alias node, so
  the frontmatter we wrote could not be parsed (gray-matter throws on it) and
  Cursor could drop the rule — the exact failure this series fixes.
- Team frontmatter is parsed leniently, so a rule authored `globs: **/*.ts` is
  honoured instead of silently falling back to always-on.
- An unreadable source now fails loudly rather than writing an empty rule over
  the team repo (push) or a stub always-on rule (pull).
- The frontmatter regex accepts an empty `---/---` block instead of leaking the
  delimiters into the body.
- local-agent reports Cursor rules again.

Behavior:
- Built-in rules deploy to Cursor as `.mdc` too; `teamai-recall` was still being
  written as a `.md` Cursor ignores.
- `.cursor/rules/*.mdc` with no matching team rule is no longer offered as a new
  team resource — that is where Cursor's own "New Cursor Rule" writes personal
  rules.
- `.md` copies left by the pre-`.mdc` layout are swept by pull, remove,
  tombstone cleanup, and uninstall.

Altitude: the per-tool extension moves to src/resources/rule-format.ts
(mirroring agentFileExtensionForTool) so all call sites share one decision.

Docs updated in both languages; the old text claimed the body was preserved
verbatim and that a Cursor push sent "just that body change" upstream.
…-up) (#355)

#349 moved Cursor rules from .md to .mdc, but the project-agent
cold-start E2E still asserted .cursor/rules/team-rule.md, so the
GitHub full-surface E2E job failed on that stale assertion.
@pull pull Bot locked and limited conversation to collaborators Aug 27, 2026
@pull pull Bot added the ⤵️ pull label Aug 27, 2026
@pull
pull Bot merged commit 6bb477c into Walternater:main Aug 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant