agentleFS
20030419zhanghongyi20030419zhanghongyi/AI-Software-Engineering-Workflow-Template/.cursor/rules/ai-coding-rules.mdc

AI-Software-Engineering-Workflow-Template / rules

Cursor rule0 starsChanged 6 months agoMITView on GitHub

AI coding execution rules

The file

Show its rules and text

We split this ai-coding-rules.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read AI_WORKFLOW.md and TOOLCHAIN.md

    line 12
  2. Distinctive:

    Read required project documents (see Required Reading in AGENTS.md)

    line 13
  3. Distinctive:

    WAIT for human confirmation before modifying code

    line 17
  4. Distinctive:

    Only modify files within the task's Allowed Files scope.

    line 22
  5. Distinctive:

    Do NOT modify Forbidden Files.

    line 23
  6. Distinctive:

    Do NOT expand task scope.

    line 24
  7. Distinctive:

    Do NOT refactor unrelated code.

    line 25
  8. Distinctive:

    Do NOT introduce new dependencies without justification.

    line 26
  9. Distinctive:

    Do NOT bypass or skip tests.

    line 27
  10. Distinctive:

    Do NOT bypass Human Gate — every Stage Gate requires human approval to proceed.

    line 28
  11. Distinctive:

    Do NOT skip Plan Artifact — always generate and get approval before coding.

    line 29
  12. Distinctive:

    STOP immediately and report if:

    line 33
  13. Distinctive:

    When receiving feedback from the supervisor agent or user, translate it into concrete engineering constraints.

    line 65
  14. Distinctive:

    Do not interpret vague feedback loosely — ask for clarification if needed.

    line 66
  15. Distinctive:

    Update your task understanding after receiving feedback.

    line 67

≈ “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
ai-coding-rules.mdc
---
description: AI coding execution rules
globs:
alwaysApply: true
---

# AI Coding Rules

## Before Writing Code

1. Read AGENTS.md
2. Read AI_WORKFLOW.md and TOOLCHAIN.md
3. Read required project documents (see Required Reading in AGENTS.md)
4. Identify which Stage Gate the current task belongs to (see docs/11_stage_gates.md)
5. Understand the current Issue or task's scope, boundaries, and acceptance criteria
6. Generate a Plan Artifact before implementing
7. WAIT for human confirmation before modifying code

## Execution Rules

- Work in small steps. Do not make large, sweeping changes.
- Only modify files within the task's Allowed Files scope.
- Do NOT modify Forbidden Files.
- Do NOT expand task scope.
- Do NOT refactor unrelated code.
- Do NOT introduce new dependencies without justification.
- Do NOT bypass or skip tests.
- Do NOT bypass Human Gate — every Stage Gate requires human approval to proceed.
- Do NOT skip Plan Artifact — always generate and get approval before coding.

## Stop Conditions

STOP immediately and report if:

1. You are about to modify a forbidden file.
2. The task scope is creeping.
3. You would change core architecture.
4. You want to introduce a new dependency.
5. Tests are failing but you want to continue adding features.
6. The UI/interaction result deviates from expectation.
7. Multiple agents would modify the same core file.
8. You cannot determine the risk of a change.
9. You are unsure about the correct approach.
10. You are implementing without Idea Gate validation.
11. MVP scope is expanding beyond what was agreed.
12. You want to skip Plan Artifact or Human Review.
13. CI is failing but you want to merge.
14. Launch metrics are undefined but release is requested.
15. You want to automate a process that requires human judgment.

Stopping is not failure — it prevents errors from compounding.

## After Completing Changes

You MUST output:

1. **Modified files**: List all changed file paths and reasons.
2. **Test results**: What tests you ran and whether they passed.
3. **Risk assessment**: Possible side effects, TODO items, documentation updates needed.
4. **Review suggestions**: Which files need human review and why.
5. **Artifact status**: Which Artifact was generated and its review status.

## Feedback Handling

- When receiving feedback from the supervisor agent or user, translate it into concrete engineering constraints.
- Do not interpret vague feedback loosely — ask for clarification if needed.
- Update your task understanding after receiving feedback.
- Direction-level feedback may trigger a Stage Gate decision (refine, narrow, redesign, etc.).

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.