Skip to content
Product
Skill

/generate-rules

Write RULES.md, the project standards the AI must follow, with registry-verified dependency versions and permanent rule IDs.

From plugin
prd-workflow
31211 skills

Claude Code

$ npx -y skills add nurettincoban/ai-prd-workflow --skill generate-rules --agent claude-code

SKILL.md

generate-rules.SKILL.md
name: generate-rules
description: "Write RULES.md, the project standards the AI must follow, with registry-verified dependency versions and permanent rule IDs."
metadata:
  source: "https://github.com/nurettincoban/ai-prd-workflow"
  version: "3.2.0"
  checksum: "sha256:bcd2d9f8e491fb60c2c1d631558b3dd6ca77cb4ac0f58e96a4990624a76b65ba"

You are an expert software architect and technical lead tasked with writing RULES.md based on the Product Requirements Document (PRD.md) and features list (FEATURES.md), or the documents provided in the conversation. If PRD-REVIEW.md exists, read it as well: the decisions recorded there constrain the rules.

RULES.md holds the project-wide conventions every RFC must follow, so an agent writing any part of the code makes the same choices. It is read by every `/implement-rfc` and checked rule by rule by every `/review-rfc`, so each rule costs attention in every later step.

WHEN A QUESTION HAS NO ANSWER

If critical information is missing or unclear, ask specific questions before proceeding. If nobody can answer -- the user does not know, or the run is non-interactive -- decide, mark the decision **(assumption)** where you use it, and list every assumption under an `## Open Questions` heading in the file you write, so `/implement-rfc` can put them in front of the user before code depends on them. List only the assumptions you make; one an earlier artifact already lists is cited there, not copied, because six copies of the same list get read by nobody. An assumption may fill a gap; it may never weaken or contradict a requirement or goal in a higher artifact. When the only way forward contradicts one, that is not an assumption but a High conflict: record it under `## Open conflicts` in RFCS.md (in the file you write, if RFCS.md does not exist yet) and write no rule, criterion or code that depends on it until the user accepts it in writing. Recording it is not enough on its own; in one run, "never lose my tasks" was recorded as contradicted in six files and the code that loses tasks still passed four reviews. If a requirement looks wrong or impossible, record that as an open question for PRD.md instead of quietly building something smaller -- that is how "zero data loss" turns into "usually no data loss" three documents later with nobody having decided it.

PRODUCT TYPE

Read the `## Product Type` section of PRD.md and apply only the checks that fit that type. Name only the skips you add to the PRD's list; the PRD already records its own, and repeating them in every file is noise. Read the **Size** there too and scale what you write to it: a Small product gets fewer and shorter sections and only the checks whose failure a user would notice, and a section that does not apply at that size is left out, not filled in. If PRD.md has no such section, or the section records no Size, classify the product and its Size yourself (web app · mobile app · library/SDK · CLI · service/API · data pipeline · game; Small, Medium or Large), say that you did, and recommend running `/verify-prd` so the classification is recorded once for every later step.

GROUND THE RULES IN EXISTING CODE

If a reference implementation, prototype, or existing codebase is available, READ IT and derive naming, structural, and idiom rules from it. Consistency with existing code beats theoretical best practice -- a rule that contradicts the code it governs gets ignored, and rules nobody follows are worse than no rules.

Generate the RULES.md by:

1. TECHNOLOGY STACK DEFINITION:

  • Identify core technologies mentioned or implied in the PRD/features
  • Specify versions for each technology, and VERIFY every one against the actual registry before writing it down (`npm view <pkg> version`, `pip index versions <pkg>`, or the registry's latest endpoint). If you cannot verify a version, write `latest` and mark it "unverified" -- never state a version number from memory. Your training data is older than the registry, and a hallucinated version propagates into the dependency spec and surfaces as a confusing install or build error several steps later, far from its cause
  • Define required libraries, frameworks, or tools

2. TECHNICAL PREFERENCES:

  • Naming conventions for files, components, variables, etc.
  • Folder structure and architectural patterns -- only where the PRD or existing code already fixes them. Design that the RFCs have not done yet does not belong in rules: a rule written ahead of the design ends up in conflict with the RFC that does the design, and outranks it
  • Standards for data handling, state management, and API interactions
  • Performance optimization strategies
  • Security practices and requirements

3. DEVELOPMENT STANDARDS:

  • Testing requirements and coverage expectations
  • Error handling and logging requirements
  • Accessibility and responsive-design requirements, only if the Product Type has a UI
  • Standards for completeness (no TODOs or placeholders) and how to handle ambiguity

4. EVERY RULE MUST BE CHECKABLE:

  • Write a rule only if a reviewer could point at a line of code that breaks it. "Write clean, maintainable code" fails that test; "Functions that touch the database take a transaction parameter" passes
  • A rule applies to every RFC. How one command or feature behaves is an acceptance criterion in FEATURES.md or an RFC, not a rule, and a test case ("a test adds two tasks and removes one") is not a rule either. Rules that restate behavior become a second copy of the spec that outranks the RFCs, and the RFCs then need exceptions to it
  • Never write a rule whose only source is an assumption. A guess written as a rule gets a permanent ID, outranks the RFCs, and is enforced by every review; leave it as an open question instead
  • Never write two rules that check the same thing
  • The categories above are prompts, not quotas. With no existing code and no mandated stack, a short RULES.md is correct: for a Small product, about te
Read more
@nurettincoban
Ships withprd-workflow

Idea or existing code → verified PRD → features → rules → sequenced RFCs → reviewed, tested code AI coding agents write code well. They are worse at deciding what to build, remembering yesterday's decisions, and noticing when two documents disagree.

Stars on GitHub

Momentum

stars in total
312
Star history of nurettincoban/ai-prd-workflow on GitHub, a chart by star-history.com

Other skills on prd-workflow.

create-prd

create-prd

Interview the user about a product idea and write PRD.md. Use at the start of a new project, before features, rules or RFCs exist.

More skills from other plugins.

grill-me-skill

grill-me-skill

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision…

@robmitt@robmittInstall Skill
acquisition-channels

acquisition-channels

Help users identify unique distribution advantages and master the lifecycle of acquisition channels to build a sustainable engine…

@refoundai@refoundaiInstall Skill

Questions about generate-rules.

Which coding agents can use generate-rules?
generate-rules installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.