agentleFS
tatashbartatashbar/Economic-Modeling-Studio/.cursor/rules/code-translation.mdc

Economic-Modeling-Studio / rules

Cursor rule4 starsChanged 6 days agoMITView on GitHub

Code Translation standards

The file

We split this code-translation.mdc into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every target file starts with a header naming its source file (and line range where a file is split)

    line 12
  2. Very specific:

    Every construct that does not translate one-to-one gets a row in construct-log.md with its effect on results

    line 15
  3. Very specific:

    Write outputs at full precision under the source's file names.

    line 17

≈ “Common” is an estimate: at least 1 in 5 of the 6,809 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
code-translation.mdc
---
description: Code Translation standards
globs: translations/**
alwaysApply: false
---
<!-- Generated from .claude/rules/code-translation.md by tools/sync_agents.py. Edit the source, then run the script. -->
# Rules: Code Translation

- The source code is read-only. Never edit, move, reformat or delete files in the source folder; `source-manifest.json` holds their fingerprints and `python tools/translate.py verify-source <workspace>` must pass at sign-off
- Uploaded source folders go to `translations/incoming/<name>/`, which git ignores; do not commit third-party or confidential code
- Work from an approved `plan.md`; translated code goes to `target/` only, and agents write only to the paths the plan gives them
- Every target file starts with a header naming its source file (and line range where a file is split)
- First pass is faithful: same behavior, same outputs and file names, bugs kept and logged; refactoring and fixes come after equivalence, as separate approved changes re-tested against the same reference outputs
- Make every default explicit where languages differ: missing values, sorting, rounding, indexing, storage order, standard-error type, degrees of freedom, quantile definition, base category, solver, tolerances
- Every construct that does not translate one-to-one gets a row in `construct-log.md` with its effect on results
- Reference outputs come from the source (run here or supplied by the user, with provenance); never from the translation and never invented. Without them, equivalence is `NOT ASSESSED — NO REFERENCE OUTPUTS`
- Write outputs at full precision under the source's file names; compare with `python tools/translate.py compare` using tolerances fixed before the comparison
- Random draws: read the source's exported draws or compare distributions; never claim equal draws from equal seeds across software
- Target code follows the studio rules for its language and folder (`r-code.md`, `stata-code.md`, `eviews-code.md`, `gempack-code.md`, `model-code.md`, and the others) and runs from a clean start with one command
- The equivalence verdict comes from `translation-equivalence-auditor`, who did not translate the code

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.