Skip to content

chore: add AGENTS.md and Cursor rules for AI-assisted development - #1115

Open
MaartenUreel wants to merge 2 commits into
Mephiles:masterfrom
MaartenUreel:chore/agent-rules
Open

MaartenUreel wants to merge 2 commits into
Mephiles:masterfrom
MaartenUreel:chore/agent-rules

Conversation

@MaartenUreel

Copy link
Copy Markdown

Torn username and ID: Murfy [420016]

  • Read CONTRIBUTING.md.
  • Added your name in src/common/utils/team.ts file.
  • Update the unreleased version of src/extension/assets/changelog.json file
  • Bump the versions of all related userscripts (n/a - no feature code changed)

Is this PR:

  • for a new feature ?
  • an issue fix ?
  • a developer QoL PR ?

Purpose of PR:

The repo had no machine-readable conventions, so every AI coding agent re-derived them from scratch and got the
wiring wrong. This adds AGENTS.md plus seven glob-scoped Cursor rules that document what the code already does.

AGENTS.md is deliberately short since it loads on every request: Bun-only toolchain, repo layout, path aliases,
code style, the PR gates, and the cross-cutting requirements (changelog entry, userscript version bumps, docs page).

The rules under .cursor/rules/ attach only when the relevant files are touched:

Rule Covers
torntools-features The Feature contract, lifecycle order, manual registration in script-manager.ts, the fact there is no cleanup hook
torntools-userscripts Entry metadata, context tiers, and that a shared feature change requires a metadata.ts version bump to publish
torntools-svelte-ui Svelte 5 runes, ui/ being vendored shadcn, and the four files a new setting touches
torntools-torn-page-dom findElement over querySelector, requireElement over polling, containers/filters, Torn's hashed class names
torntools-data-storage-api ttStorage vs the sync globals, DefaultSetting, relay: true, apiUsage gating, migrations, opt-in external services
torntools-extension-shell WXT entrypoint naming, the --inject main-world pattern, background proxy services
torntools-docs The __placeholder.mdx template and its mandatory sections

Also adds a verify script (lint && types && types:svelte && test) so contributors have one command matching the
PR gates, and *.mdc text eol=lf in .gitattributes for consistency with the existing *.md rule.

No runtime code is touched.

Linked issues:
None

MaartenUreel and others added 2 commits September 16, 2026 21:10
Documents the conventions that were previously only discoverable by reading code, so AI coding agents follow the existing patterns instead of inventing their own.

AGENTS.md covers the Bun toolchain, repo layout, path aliases, code style, the PR gates and the cross-cutting requirements (changelog entry, userscript version bumps, docs page).

Seven glob-scoped rules under .cursor/rules/ auto-attach per area: features and registration, userscripts, Svelte/options UI, Torn page DOM helpers, storage/API/external services, the WXT shell, and documentation.

Also adds a 'verify' script chaining the four PR gates into one command, and normalises .mdc line endings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds Murfy to team.ts and records the AGENTS.md/Cursor rules and the new verify script under the unreleased technical section, per CONTRIBUTING.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant