← Back to journal

AI Coding Workflow, Rules & Skills Explained (With Examples)

AI coding & workflows · 2026.08.07 · ~16 min read

AI coding Workflow, Rules, and Skills layered architecture

For the same feature request, one developer re-explains “we don’t use an ORM” and “commits must include a ticket” every session; another simply says “follow the project workflow.” The gap is rarely model IQ—it is whether Workflow, Rules, and Skills are layered and versioned. In 2026, mainstream AI coding tools all support “always-on constraints + on-demand runbooks + orchestratable flows,” yet many teams still mash everything into one giant system prompt. Context balloons, triggers drift, and the model spends tokens re-reading policies instead of reading diffs. This article tests a practical split: what each layer owns, how they combine, and copy-paste examples you can ship today. The asymmetric takeaway: the watershed is entry points and execution boundaries—not whether Claude beats GPT on a benchmark.

Written for Cursor, Claude Code, GitHub Copilot, and similar AI coding users. We cover Workflow (commands, automation, Agent modes), Rules (.cursor/rules, AGENTS.md, user rules), and Skills (SKILL.md, load-on-demand). You get a unified comparison table, scenario matrix, recommended stacks, a pitfalls list, and a seven-step rollout—plus why Workflows that touch Xcode or CI belong on a macOS execution node.

1. Why AI coding needs Workflow, Rules, and Skills as separate layers

AI coding assistants are Agents with tool access: they read repos, edit files, and run terminals. Their weakness is equally obvious—every new chat starts from amnesia unless you re-inject team norms into the prompt. Worse, some teams dump code style, Git policy, release checklists, and incident runbooks into a single User Rule. Each message then carries thousands of tokens of policy, crowding out the diff, logs, and stack traces that actually matter for the task at hand.

Best practice in 2026 is to split constraints and procedures into three layers:

  • Workflow: How you start an AI task—slash commands, Plan/Agent mode switches, CI triggers, remote Agent orchestration.
  • Rules: What always holds—language style, forbidden directories, test requirements, security red lines.
  • Skills: What runs on demand—code review checklists, Xcode release steps, migration runbooks, usually in SKILL.md.

This mirrors the logic in our Agent development modes guide: entry points define behavior boundaries, not model parameter tables. The open standard for Skills is the Agent Skills Specification; Cursor documents Rules at cursor.com/docs/context/rules.

Think of it like airport security versus a flight manual. Rules are the metal detector—always on, same for everyone. Skills are the pilot’s checklist for a specific aircraft type—pulled out only when that plane is on the ramp. Workflow is air-traffic control—who gets clearance, in what order, and on which runway. Mixing all three into one blob is how teams end up with 8,000-token system prompts that the model partially ignores because half the content is irrelevant to the current edit.

Layering also improves reviewability. When a junior developer changes a Rule, every future conversation shifts—that deserves a careful PR. When someone updates a Skill, only users who invoke that Skill pay the context cost. When a Workflow changes, you update a command doc or CI job without touching global behavior. Governance teams can audit Rules quarterly; platform teams can version Skills like internal libraries; DevOps owns Workflows. Without separation, “who approved this prompt change?” has no answer.

Finally, layered design makes onboarding measurable. New hires clone the repo and inherit the same Rules and project Skills on day one. They learn Workflows from .cursor/commands/ READMEs instead of tribal knowledge in Slack. That is how AI-assisted development scales past a handful of power users.

2. How to classify Workflow, Rules, and Skills

2.1 Workflow — how tasks are started and orchestrated

Workflow answers who pulls the Agent, and when. Typical forms include Cursor custom commands like /generate-blog, switching between Plan Mode and Agent Mode, Claude Code /loop and batch jobs, GitHub Actions that call AI to fix CI, and gateways such as OpenClaw that connect Telegram or cron to a remote Mac. Workflow cares about triggers, state machines, and artifact paths—not single-line formatting preferences.

A mature Workflow documents gates: “brief approved → generate zh → human OK → i18n.” It names outputs (articles.json, staging images) and failure behavior (retry, notify, halt). Without explicit gates, Agents improvise—and improvisation is where production incidents come from.

2.2 Rules — the always-on constraint layer

Rules are resident context. In Cursor, common locations are .cursor/rules/*.mdc (project), Rules in user Settings, and root AGENTS.md. Good Rule content: minimize diff scope, directories the Agent must not touch, commit conventions, reply language, when tests are mandatory. Rules should be short, hard, and executable. Do not embed a 30-step release procedure in a Rule—that belongs in a Skill.

Rules also set tone and risk appetite: “prefer asking over guessing,” “never delete files without confirmation,” “use TypeScript strict mode.” Keep each file scannable in one screen. If you need conditional logic (“only for *.tsx in frontend/”), use glob-scoped .mdc files instead of one mega-rule.

2.3 Skills — on-demand runbooks

Skills are load-on-demand workflow packages. Claude Code uses .claude/skills/<name>/SKILL.md; Cursor uses .cursor/skills/<name>/SKILL.md (or a user-level Skills directory). The Agent reads description in frontmatter first and loads the body only when matched—saving context versus Rules. For deep Skill design, see our Claude Code Skills: 10-skill framework guide.

Skills can ship supporting files: references/checklist.md, scripts, or templates. High-risk Skills (security review, production deploy) should set disable-model-invocation: true so only explicit /skill-name invocation runs them—never accidental semantic triggers during unrelated edits.

One-line memory aid
Workflow = how to start; Rules = what must never / always happen; Skills = how to do a class of tasks.

3. Core comparison table

Workflow vs Rules vs Skills — unified fields
Type Entry Execution Context cost Best for
Workflow Commands, mode switches, CI/webhooks Orchestrate multi-step Agents, batch jobs, remote nodes Injected only at trigger time Tech leads, DevOps, automation builders
Rules Loaded when project opens Constrain edits, format, forbidden zones Always resident—keep lean All developers, code reviewers
Skills /skill-name or description match Run concrete runbooks (review, release, migration) On demand; can reference references/ Teams needing versioned SOPs
Commands (related) Explicit /command Single prompt template Only when invoked Personal shortcuts
Hooks (related) Save file, pre-commit events Auto-run lint/audit scripts Bypasses or minimally uses the model Quality gates, compliance

3.1 Rules vs Skills — quick division of labor

Do not put runbooks inside Rules
Dimension Rules Always on Skills On demand
Typical contentNo force push, minimal diff, test requirements7-step release, security audit checklist
Versioning.cursor/rules in GitSKILL.md in-repo or ~/.cursor/skills
TriggerAutomaticManual slash or semantic match
LengthShorter is better (hundreds of words)Can be longer; details in references/

4. Scenario decision matrix

Your scenario Configure first (in order) Notes
Personal side project 3 User Rules → 2 Commands → 1 commit Skill Constrain behavior first; skill-ify anything you typed three times last week
10-person full-stack team Project Rules (tests / forbidden dirs) → PR Skill → CI Workflow Rules in code review; Skills hold release runbooks
iOS / macOS team xcode-release Skill → Rules (no signing changes) → Cloud Mac Workflow Archive requires macOS—see Cloud Mac dev scenarios
Open-source maintainer CONTRIBUTING Rules → docs-sync Skill → security-review Skill High-risk Skills: disable-model-invocation: true
Startup full-stack Agent Mode Workflow → ci-fix Skill → lean Rules Small teams need automation; Rules hold only red lines

5. Recommended stacks

Stack A — minimum viable (half a day)

  • Three User Rules: minimal diff, no unsolicited commits, run lint after edits
  • Project .cursor/rules/blog-writing.mdc for repo-specific constraints only
  • Personal commit Skill: generate Conventional Commits from staged diff

Stack B — team standards

  • Rules: testing.mdc + security.mdc (each < 80 lines)
  • Skills: code-review, security-review (manual trigger)
  • Workflow: PR template says “run /security-review before merge”

Stack C — iOS delivery

  • Skill xcode-release (disable-model-invocation: true)
  • Rules: do not edit *.xcodeproj unless explicitly asked
  • Execution node: local M4 or Hashvps Cloud Mac; pair with GitHub Actions macOS build trends—heavy compiles on remote

Stack D — content / docs engineering

  • Workflow: /generate-blog-style command (brief → zh → i18n gate)
  • Rules: blog-standard-spec-v1.mdc structure constraints
  • Skills: translate-to, seo-optimize loaded on demand

6. Common mistakes

  • “Put everything in User Rules—it’s easiest” → Resident prompts swell and crowd out code context; move runbooks into Skills.
  • “More Skills is always better” → Overlapping description fields fight for triggers; stay under ~10 with clear boundaries.
  • “Workflow replaces CI” → AI assists development; gates still belong in GitHub Actions / Xcode Cloud as hard checks.
  • “Rules and Skills can live in one file” → Different review and load mechanics; a one-line Rule change affects every chat.
  • xcode-release Skill works without a Mac”codesign needs macOS—local or Cloud Mac node required.
  • “Plan Mode equals Workflow” → Plan is an interaction mode; Workflow is repeatable, scriptable triggers and artifact contracts.

7. Seven-step rollout with copy-paste examples

  1. Audit repeated prompts: Did you type the same review checklist three times last week? Candidate Skill.
  2. Write 3 Rules: Keep only “always true” red lines—each readable on one screen.
  3. Create Skill directories: mkdir -p .cursor/skills/code-review (Cursor) or .claude/skills/code-review (Claude Code).
  4. Write SKILL.md frontmatter: description uses verb + scenario; high-risk adds disable-model-invocation: true.
  5. Define Workflow: Encode gates like “brief OK → then i18n” in .cursor/commands/*.md or team runbooks.
  6. Commit to Git: Project Rules and Skills in the same PR as code—avoid “only seniors have the config locally.”
  7. Bind execution nodes: Workflows with shell/Xcode point at a macOS host (local or Cloud Mac) for consistent SSH environments.
Example 1: project-level Cursor Rule (lean)
# .cursor/rules/core.mdc
---
description: Core engineering constraints for this repo
globs: "**/*"
---
- Minimize diff scope; do not refactor unrelated code.
- Never commit unless the user explicitly asks.
- Run tests for touched packages before claiming done.
Example 2: on-demand Skill (code-review)
# .cursor/skills/code-review/SKILL.md
---
name: code-review
description: Review staged git diff for bugs, security, and test gaps. Use when user asks for review or before PR.
---
1. Run `git diff --staged` (or compare branch to main).
2. Output: Critical / Warning / Suggestion in three sections.
3. Do not auto-fix unless user asks.
Example 3: Workflow gate (command doc excerpt)
# .cursor/commands/release-ios.md
## Workflow
1. User confirms brief / scope on main branch.
2. Agent runs /test-runner Skill on changed targets.
3. Manual /xcode-release only after CI green.
4. Post changelog; never skip codesign on shared runner.

8. Summary

In 2026, AI coding competitiveness depends increasingly on workflow engineering, not a single model score. Workflow defines how tasks start; Rules guard what always holds; Skills turn senior checklists into versioned, shareable, permission-bounded runbooks. Layer first—then consider a pricier subscription.

Remember the asymmetric conclusion: model capability is not the watershed; entry points and execution boundaries are. Further reading: Cursor Rules · Claude Code Skills · Agent Skills open standard

FAQ

What is the biggest difference between Workflow, Rules, and Skills?
Workflow controls how tasks start and orchestrate. Rules hold always-on constraints. Skills are SOPs for specific task types. Workflow is the pipeline button, Rules are house rules, Skills are the standard operating manual.
Can I mix Cursor Rules with Claude Code Skills?
Concepts align, but paths differ: Cursor uses .cursor/rules and .cursor/skills; Claude Code uses .claude/skills. Cross-tool teams can sync SKILL.md bodies to both locations and tweak frontmatter per vendor docs.
How long should Rules be?
Aim for a few hundred words per file—readable on one screen. Procedures longer than five steps belong in a Skill or Workflow doc, not in always-on context.
When to use Plan Mode vs writing a Workflow?
Plan Mode suits one-off complex exploration and alignment. Workflows suit team repetition with gates and artifact paths—releases, blog i18n, CI fixes.
Should project-level config be committed to Git?
Yes. .cursor/rules, .cursor/skills, .claude/skills, and .cursor/commands should live in-repo so new clones inherit the same AI engineering setup.
Why recommend Cloud Mac for Xcode Workflows?
Archive, codesign, and xcodebuild require native macOS. Cloud Mac gives a 7×24 node where Workflows and Skills run reliably over SSH without leaving a laptop on overnight.

Workflows need a stable execution node

AI workflows that touch Xcode builds, Fastlane, or launchd daemons require native macOS. Hashvps Cloud Mac mini M4 offers SSH/VNC, dedicated IPv4, and a clean Homebrew-ready environment—the same .cursor/skills/ and Rules behave identically locally and in the cloud, so your Agent is not hostage to laptop hardware.

If you are wiring Skills into iOS release pipelines or CI, Hashvps Cloud Mac is a cost-effective execution nodeview plans and let your Workflow run 7×24 on a remote host.

Hashvps · Mac Cloud

Stable Mac nodes for your workflows

Cloud Mac mini M4 with native macOS and SSH—built for Xcode-heavy AI agent workflows.

Go to homepage
Limited offer