askill
create-rule

create-ruleSafety 95Repository

Create project rules for persistent AI guidance. Use when the user wants to create a rule, add coding standards, set up project conventions, configure file-specific patterns, create RULE.md files, or asks about the workspace rules directory or AGENTS.md.

0 stars
1.2k downloads
Updated 3/19/2026

Package Files

Loading files...
SKILL.md

Creating Project Rules

Create project rules in the platform-specific rules directory to provide persistent context for the AI agent.

Gather Requirements

Before creating a rule, determine:

  1. Purpose: What should this rule enforce or teach?
  2. Scope: Should it always apply, or only for specific files?
  3. File patterns: If file-specific, which glob patterns?

Inferring from Context

If you have previous conversation context, infer rules from what was discussed. You can create multiple rules if the conversation covers distinct topics or patterns. Don't ask redundant questions if the context already provides the answers.

Required Questions

If the user hasn't specified scope, ask:

  • "Should this rule always apply, or only when working with specific files?"

If they mentioned specific files and haven't provided concrete patterns, ask:

  • "Which file patterns should this rule apply to?" (e.g., **/*.ts, backend/**/*.py)

It's very important that we get clarity on the file patterns.

Use the AskQuestion tool when available to gather this efficiently.


Rule File Format

Rules are markdown files in the rules directory with optional YAML frontmatter. Path and extension are platform-specific; use this platform's rules directory and the extension it expects (e.g. for Claude, rules live under the platform rules directory).

Example layout:

rules/
  typescript-standards.md
  react-patterns.md
  api-conventions.md

File Structure

---
description: Brief description of what this rule does
globs: **/*.ts  # File pattern for file-specific rules
alwaysApply: false  # Set to true if rule should always apply
---

# Rule Title

Your rule content here...

Frontmatter Fields

FieldTypeDescription
descriptionstringWhat the rule does (shown in rule picker)
globsstringFile pattern - rule applies when matching files are open
alwaysApplybooleanIf true, applies to every session

Rule Configurations

Always Apply

For universal standards that should apply to every conversation:

---
description: Core coding standards for the project
alwaysApply: true
---

Apply to Specific Files

For rules that apply when working with certain file types:

---
description: TypeScript conventions for this project
globs: **/*.ts
alwaysApply: false
---

Best Practices

Keep Rules Concise

  • Under 50 lines: Rules should be concise and to the point
  • One concern per rule: Split large rules into focused pieces
  • Actionable: Write like clear internal docs
  • Concrete examples: Ideally provide concrete examples of how to fix issues

Example Rules

TypeScript Standards

---
description: TypeScript coding standards
globs: **/*.ts
alwaysApply: false
---

# Error Handling

\`\`\`typescript
// ❌ BAD
try {
  await fetchData();
} catch (e) {}

// ✅ GOOD
try {
  await fetchData();
} catch (e) {
  logger.error('Failed to fetch', { error: e });
  throw new DataFetchError('Unable to retrieve data', { cause: e });
}
\`\`\`

React Patterns

---
description: React component patterns
globs: **/*.tsx
alwaysApply: false
---

# React Patterns

- Use functional components
- Extract custom hooks for reusable logic
- Colocate styles with components

Checklist

  • File is in the rules directory with correct extension per platform
  • Frontmatter configured correctly
  • Content under 500 lines
  • Includes concrete examples

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

82/100Analyzed 3/29/2026

Well-structured skill with comprehensive documentation for creating project rules. Excellent clarity with structured sections, tables, and concrete examples. Good actionability with clear steps and a checklist. Slightly generic in places but covers all essential configurations (alwaysApply, file-specific patterns). The frontmatter field table and example rules provide strong templates. Located in a proper skills directory structure. No internal-only indicators despite slight path depth.

95
90
78
85
84

Metadata

Licenseunknown
Version-
Updated3/19/2026
Publisherdarthlinuxer

Tags

apillm