agentleFS
bazel-contribbazel-contrib/rules_python/.agents/skills/rule-creator/SKILL.md

rule-creator

Skill692 starsChanged 6 days agoApache-2.0View on GitHub

Create and format agent rules with proper front matter in the

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when you need to create a new rule for the agent in the workspace.

    line 7
  2. Very specific:

    All workspace-specific rules must be created as individual Markdown files under the .agents/rules/ directory:

    line 12
  3. Distinctive:

    Every rule file must start with a YAML front matter block defining the trigger condition, followed by the rule content in Markdown.

    line 20
  4. Very specific:

    Use for syntax/formatting rules tied to specific file types.

    line 39
  5. Very specific:

    Keep language and tool rule files (starlark.md, bzl.md, python.md, docs.md) general to those domains.

    line 44
  6. Very specific:

    Place rules_python-specific Bzlmod, PyPI, and rule API invariants in .agents/rules/rules_python.md.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Use this skill when you need to create a new rule for the agent in the workspace.

Rule File Location

All workspace-specific rules must be created as individual Markdown files under the .agents/rules/ directory:

.agents/rules/<rule-name>.md

Rule Format

Every rule file must start with a YAML front matter block defining the trigger condition, followed by the rule content in Markdown.

---
trigger: <trigger-condition>
---

# <Rule Title>

<Rule description and directives...>

Trigger Conditions

  • always_on: The rule is always active and must be followed for all tasks.
  • model_decision: The agent loads the rule based on its description when relevant. Prefer model_decision for conceptual, architectural, or cross-cutting rules (e.g., pr.md, rules_python.md).
  • glob: The rule activates when matching files (globs:) are accessed. Use for syntax/formatting rules tied to specific file types. globs must be a quoted, comma-separated string (e.g., globs: "*.bzl,BUILD.bazel"), never a YAML list/sequence.

Domain Separation

  • Keep language and tool rule files (starlark.md, bzl.md, python.md, docs.md) general to those domains.
  • Place rules_python-specific Bzlmod, PyPI, and rule API invariants in .agents/rules/rules_python.md.

Formatting Guidelines

  • Line Wrapping: Wrap all text to 80 columns.
  • Prose Style (Strunk & White): Omit needless words. Do not use mannered prose or verbose phrasing; state directives directly in active voice.

Example

To create a rule that prevents adding copyrights:

---
trigger: always_on
---

# No Copyrights Rule

Unless directed by the user otherwise, do not add Bazel copyright to new or
existing files.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.