crafting-rules

Create and refine OpenCode rules with globs and keywords.

8|Updated Sep 7, 2021
One-click install
npx skills add https://github.com/frap129/dotfiles --skill crafting-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crafting-rules
Source: https://github.com/frap129/dotfiles/tree/main/.config/opencode/skills/crafting-rules
Command: npx skills add https://github.com/frap129/dotfiles --skill crafting-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when creating or modifying OpenCode rules (.md/.mdc files) that customize agent behavior. Helps extract patterns from conversation history, analyze project conventions (AGENTS.md, linters, package.json), and draft well-formatted rules with appropriate globs/keywords. Trigger when user wants to create a rule, codify repeated instructions, persist guidance across sessions, or customize agent behavior for specific files or topics.

Core Features & Use Cases

  • Extract patterns from conversation history to drive agent behavior.
  • Analyze project conventions (AGENTS.md, linter configurations, package.json) to align rules.
  • Draft well-formatted rules with appropriate globs and keywords.
  • Persist guidance across sessions to maintain consistency.
  • Customize agent behavior for specific files or topics.

Quick Start

Create a rule that codifies your project conventions by specifying globs and keywords, then save it to your OpenCode rules repository.

Frequently Asked Questions about crafting-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create OpenCode rules to customize agent behavior for specific files?

OpenCode rules customize agent behavior by extracting patterns from conversation history and analyzing project conventions like AGENTS.md and linters. You draft well-formatted rule blocks with globs and keywords, then save them to configured directories for persistence and reuse across sessions.

How do I persist instructions across sessions using OpenCode rules?

You persist instructions across sessions by codifying repeated guidance into OpenCode rule files stored in configured repository directories. These rules enforce project conventions and apply automatically to maintain consistency across different sessions and projects.

What are globs and keywords in OpenCode rule frontmatter?

Globs and keywords in OpenCode rule frontmatter are optional configuration fields that scope rule applicability to specific file patterns or topics. They ensure the agent behavior customization targets the correct files within your project structure.

Can I generate OpenCode rules from existing project conventions like linter configs and package.json?

Yes, you can generate OpenCode rules from existing project conventions. The skill analyzes configurations like AGENTS.md, linter setups, and package.json files to extract established patterns and draft rules that align with your current project standards.

When should I use frontmatter-driven rule blocks instead of inline instructions?

Use frontmatter-driven rule blocks when you need to persist guidance across sessions, enforce project conventions, or apply agent behavior to specific file patterns via globs. Inline instructions are temporary, while rule blocks provide reusable, structured configuration.