← Orieb AlzyuotHire me
By Orieb Alzyuot · 12 October 2026 · 10 min read

Rules, Skills and Guardrails: How I Engineer with Cursor and Claude Code

AI writes code fast. Without structure, it also writes the wrong code fast. This is the system I use across production web and mobile apps to keep AI-assisted work consistent, reviewable and safe.


I use Cursor and Claude Code every day. On real products, the bottleneck is never “can the AI write this component?” It’s whether the AI writes our component: the right folder, the right tokens, Arabic RTL handled, accessibility in place, no secrets, no shortcuts.

So I stopped treating prompts as the unit of work and started treating the repository as the prompt. Over several products I’ve written about 176 rule files (~7,300 lines), a small set of Claude skills, and checker scripts that turn the important rules into build failures.

TL;DR:

1. The architecture at a glance

repo/
├── CLAUDE.md              ← short pointer: where rules live, non-negotiables, "npm run check must pass"
├── AGENTS.md              ← same idea for other agents (versions, commands)
├── .cursor/
│   ├── CLAUDE.md          ← the full guide: stack, folder map, component anatomy, verify steps
│   └── rules/*.mdc        ← 40+ small, scoped rules
├── claude-skills/*/SKILL.md ← repeatable workflows
└── scripts/
    ├── check-rules        ← mechanical rule checks (warn / strict)
    ├── check-inline       ← no inline styles (fatal)
    └── check-parity       ← translation & contract parity (fatal)

The layering matters:

  1. The root CLAUDE.md is tiny (8–27 lines). It points to the real guide and lists the non-negotiables.
  2. .cursor/CLAUDE.md is the guide (around 100–250 lines). It covers the stack, folder map, component anatomy, “verify before you finish” and “before every push”. It lists every rule by name and ends with one sentence that settles every argument: “The rule files win on conflict.”
  3. Rules are small and scoped, typically 8–78 lines each.

A short entry file plus a detailed guide keeps the agent’s context focused. The model reads the map first, and the territory only when it needs it.

2. Anatomy of a rule

Each rule is an .mdc file with three pieces of frontmatter:

---
description: No inline styles — every static style lives in the sibling .scss; TSX only composes classes
globs: ["app/**/*.{ts,tsx}", "src/**/*.{ts,tsx}"]
alwaysApply: true
---
<View style={[styles.card, active && styles.cardActive]} />   // state = class
<View style={[styles.bar, { width: measuredWidth }]} />        // measured size is the only exception

Lessons from writing a lot of these:

3. A taxonomy that scales

Across one mobile app’s 43 rules, the split looked like this:

CategoryRulesExamples
Architecture & parity13feature folders, service folders, API integration, web parity
UI & design system16design tokens, shared form controls, interaction states, loading, feedback
Code hygiene & typing7no any/unknown, enums vs unions, file size, encoding
i18n & RTL2translation keys, RTL layout
Accessibility1labels, focus, contrast, motion
Security2secrets, encrypted routes
Git2secrets in commits, commit trailers

Two patterns paid off most:

4. Skills: workflows, not knowledge

Rules describe how the code should look. Skills describe how to do a job. Each skill is a SKILL.md with a name and a description that says when to use it. The description is what makes the agent reach for the skill at the right moment.

Three skills cover most of my back-end work:

Keep rules, recipes and process in separate skills. When they’re mixed together, the model applies all of them at once and tends to over-engineer.

5. Guardrails: a rule the AI can ignore is a suggestion

This is where most AI setups stop, and where mine starts paying for itself. Every app has a single command:

npm run check   # typecheck && check:scss && check:parity && check:rules && check:inline

What each part does:

Be honest about severity. On one mobile app most mechanical rules are still warnings, and only the parity and inline-style checks block a push. That’s a deliberate ramp: warn first, measure, then promote a rule to an error once the codebase is clean. Promoting everything on day one just teaches people to bypass the checks.

6. Sync scripts: one source of truth

AI is great at copying, and copying is how codebases drift. So the copies are generated:

Generated files are never edited by hand, by humans or by agents, and the rules say so.

7. Safety and authorship rules

A few rules exist purely to protect the team:

8. Reuse across products

The biggest multiplier: rules are portable. Two web + mobile products share most of their rule set. Between the two web apps, 29 of 44 rules are byte-identical. Mobile rules are derived from web rules through a mapping document, and the checkers are ported too.

The lesson from doing this: when you copy a rule set, grep for the old project’s names. Leftovers like an old path in a script header or a rule for a feature that doesn’t exist confuse agents more than they confuse humans.

9. What changed in practice

A starter kit you can copy

  1. A 10–20 line root CLAUDE.md: where the rules are, three to five non-negotiables, and the one command that must pass.
  2. A guide file: stack, folder map, component anatomy, “verify before you finish”.
  3. Five rules to start with: design tokens, folder structure, i18n/RTL, accessibility, secrets.
  4. One skill: “add a feature” in your stack, step by step.
  5. One check that fails the build on your most common review comment.
  6. A habit: every time you correct the AI twice for the same thing, write a rule.

Tools will keep changing. What lasts is a codebase that explains itself clearly enough for any engineer to follow, human or AI.


About the author

Orieb Alzyuot (عريب الزيوت) is a Senior Front-End & Full-Stack Engineer based in Amman, Jordan. She has 6+ years of experience building government, fintech, HR and enterprise products used every day, and her work includes:

Open to senior and lead front-end roles, contracts and freelance work, remote or with relocation.

Find me here:

If this helped, follow me on Medium for more on Angular, React Native, design systems and AI-assisted engineering. 💜

Tags: AI · Cursor · Claude · Software Engineering · Developer Productivity