scaffold-rules
Scaffold development rules for AI coding agents. Auto-invoked when user asks about setting up rules, coding conventions, or configuring their AI agent environment.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Scaffold Rules
Scaffold and merge development rules adapted to different AI coding agent environments.
Purpose
Use this skill when the user wants to:
- Set up development rules or coding conventions
- Configure their AI coding agent (Claude Code, Cursor, Copilot, etc.)
- Add or update project guidelines
- Standardize conventions across a team
Supported Agents
| Agent | Config Location | Format |
|---|---|---|
| Claude Code | .claude/rules/*.md |
Separate markdown files |
| Cursor | .cursorrules or .cursor/rules/*.md |
Single or multi-file |
| GitHub Copilot | .github/copilot-instructions.md |
Single file |
| Windsurf | .windsurfrules |
Single file |
| Cline/Roo | .clinerules |
Single file |
| Aider | .aider.conf.yml |
YAML config |
Rule Categories
Bun APIs
Prefer Bun's native APIs over Node.js equivalents:
-
Bun.file()overfsAPIs -
Bun.$for shell commands -
Bun.write()for file writes -
import.meta.dirfor current directory
Git Workflow
Commit conventions and version control:
- Conventional commit prefixes:
feat:,fix:,refactor:,docs:,chore:,test: - Multi-line commit message formatting
- Agent-specific sandbox workarounds
GitHub CLI
Prefer gh CLI for GitHub operations:
- PR review and creation patterns
- Issue management
- JSON output field references
- Authentication benefits over WebFetch
TypeScript Conventions
Code style standards:
- Prefer
typeoverinterface - No
anytypes (useunknownwith type guards) - Arrow functions preferred
- Object parameter pattern for 2+ parameters
- PascalCase for types,
PascalCaseSchemasuffix for Zod schemas
Testing Patterns
Bun test runner conventions:
- Use
test()instead ofit() -
*.spec.tsfile naming - No conditionals around assertions
- Assert existence before checking values
Merge Behavior
Always scans existing rules first. When existing rules are found:
- Analyze overlap - Identify sections covering same topics
- Propose merge - Show what would be added/changed
-
User approval - Ask before modifying:
- Keep existing (skip new content)
- Merge (add missing sections)
- Replace entirely
This ensures the command never overwrites user customizations without consent.
Agent Adaptations
Content is adapted based on agent capabilities:
- Sandbox awareness: Include/exclude sandbox workarounds based on agent
- Tool references: Adjust tool names (e.g., "Bash tool" → "terminal")
- Format: Single file vs multi-file based on agent convention
- Length: Condense for agents with size limits
Usage
Run the /scaffold-rules command to interactively scaffold rules, or invoke when user asks about:
- "Set up coding conventions"
- "Configure my AI agent"
- "Add development rules"
- "What rules should I have?"
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!