Get the FREE Ultimate OpenClaw Setup Guide →

scaffold-rules

npx machina-cli add skill plaited/development-skills/scaffold-rules --openclaw
Files (1)
SKILL.md
2.4 KB

Scaffold Rules

Scaffold shared development rules for AI coding agent environments.

When to Use

Use when the user wants to:

  • Set up development rules or coding conventions
  • Configure their AI coding agent environment
  • Add project guidelines for Claude, Cursor, or other agents

Workflow

Step 1: Preview Changes (Optional)

bunx @plaited/development-skills scaffold-rules --dry-run

Review the actions array to see what will be created.

Step 2: Run Scaffold

bunx @plaited/development-skills scaffold-rules

This will:

  1. Write rules into AGENTS.md (creates if missing, updates between markers if present)
  2. Add @AGENTS.md reference to CLAUDE.md if it exists without one

Step 3: Report to User

Tell the user what was created based on the actions output.

CLI Options

FlagDescription
--list, -lList available rules without scaffolding
--dry-run, -nPreview actions without making changes

How It Works

Rules are written directly into AGENTS.md between markers:

<!-- PLAITED-RULES-START -->

## Rules

(rule content inlined here)

<!-- PLAITED-RULES-END -->
  • No AGENTS.md: Creates one with rules section
  • AGENTS.md without markers: Appends rules section with markers
  • AGENTS.md with markers: Replaces content between markers (preserves user content outside)
  • CLAUDE.md exists: Adds @AGENTS.md reference if not already present

Troubleshooting

IssueCauseFix
Rules duplicated in AGENTS.mdMarkers were manually deletedRemove duplicate section, re-run scaffold-rules
Update didn't applyOnly one marker present (start or end)Ensure both <!-- PLAITED-RULES-START --> and <!-- PLAITED-RULES-END --> exist, or delete both to get a fresh append
@AGENTS.md not added to CLAUDE.mdCLAUDE.md doesn't existCreate CLAUDE.md first, then re-run

Do not manually edit content between the PLAITED-RULES-START and PLAITED-RULES-END markers — it will be overwritten on next run.

Related Skills

  • validate-skill - Validate skill directories against AgentSkills spec

Source

git clone https://github.com/plaited/development-skills/blob/main/skills/scaffold-rules/SKILL.mdView on GitHub

Overview

Scaffold shared development rules for AI coding agent environments. It automates creating or updating AGENTS.md with rules, placing them between PLAITED-RULES-START and PLAITED-RULES-END markers, and optionally adding an @AGENTS.md reference to CLAUDE.md. This helps keep project guidelines consistent across Claude, Cursor, and other agents.

How This Skill Works

Rules are written directly into AGENTS.md between the PLAITED-RULES-START and PLAITED-RULES-END markers. If AGENTS.md does not exist, it is created; if markers are missing or incomplete, content is appended or replaced accordingly. When CLAUDE.md exists, the tool adds a reference to AGENTS.md.

When to Use It

  • You want to set up development rules or coding conventions for AI agents.
  • You need to configure or bootstrap your AI coding agent environment.
  • You want to add or update project guidelines for Claude, Cursor, or other agents.
  • You prefer a dry-run preview to see which files will change before applying.
  • You want to ensure future updates automatically reflect in CLAUDE.md.

Quick Start

  1. Step 1: Preview Changes (Optional) — bunx @plaited/development-skills scaffold-rules --dry-run
  2. Step 2: Run Scaffold — bunx @plaited/development-skills scaffold-rules
  3. Step 3: Report Results — Review AGENTS.md for the inserted rules and CLAUDE.md for the reference

Best Practices

  • Preview changes with --dry-run before applying to avoid unintended edits.
  • Ensure both PLAITED-RULES-START and PLAITED-RULES-END markers exist for clean replacement.
  • If CLAUDE.md exists, verify the @AGENTS.md reference is added.
  • Do not edit content between the markers manually; edits will be overwritten on next run.
  • When duplicates appear, remove the extra section and re-run scaffold-rules.

Example Use Cases

  • A team scaffolds a central AGENTS.md with coding conventions for their AI agents.
  • CLAUDE.md is updated to reference AGENTS.md automatically after scaffolding.
  • A dry-run preview shows the exact changes that will be written to AGENTS.md.
  • Markers in AGENTS.md are preserved outside their range while the rules are updated.
  • After cleanup, a user re-runs scaffold-rules to apply a fresh, non-duplicated set of rules.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers