本文へ移動
cccskills
無料GitHub で公開

biome-gritql

Creates and manages Biome GritQL custom lint rules to enforce coding patterns. Use when creating linter rules, enforcing code conventions, preventing anti-patterns, or when the user mentions Biome, GritQL, custom lint rules, or AST-based linting.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Biome GritQL Custom Lint Rules

Create AST-based custom lint rules using Biome's GritQL plugin system.

Quick Start

Create a rule file (rules/no-use-effect-fetch.grit):

`useEffect($callback, $deps)` where {
    $callback <: contains `fetch`,
    register_diagnostic(
        span = $callback,
        message = "Don't fetch inside useEffect. Use TanStack Query instead.",
        severity = "error"
    )
}

Add to biome.json:

{
  "plugins": ["./rules/no-use-effect-fetch.grit"]
}

Run: bunx biome check or any equivalent command to run linter in the codebase

GritQL Syntax

Basic Pattern Matching

`pattern_to_match` where {
    register_diagnostic(
        span = $matched_var,
        message = "Your message here",
        severity = "error"  // hint | info | warn | error
    )
}

make sure to read documentation

Variables

  • $name - captures any single node
  • $args - captures arguments
  • $_ - wildcard (match but don't capture)

Operators

OperatorMeaning
<:matches / contains
<: containsdeep contains
<: r"regex"regex match
notnegation
andboth conditions
oreither condition

Common Rule Patterns

Ban a Function Call

`console.log($args)` where {
    register_diagnostic(
        span = $args,
        message = "Remove console.log before committing",
        severity = "warn"
    )
}

Ban a Hook (React)

`useMemo($args)` where {
    register_diagnostic(
        span = $args,
        message = "useMemo unnecessary with React Compiler. Remove it.",
        severity = "warn"
    )
}

Ban Dynamic Imports

`await import($path)` where {
    register_diagnostic(
        span = $path,
        message = "Use static imports at the top of the file",
        severity = "error"
    )
}

Require Pattern in Context

`useState($initial)` where {
    not $initial <: contains `atom`,
    register_diagnostic(
        span = $initial,
        message = "Prefer Jotai atoms over useState for shared state",
        severity = "info"
    )
}

CSS Rules

language css;

`$selector { $props }` where {
    $props <: contains `color: $color` as $rule,
    not $selector <: r"\.color-.*",
    register_diagnostic(
        span = $rule,
        message = "Use .color-* utility classes instead of explicit colors"
    )
}

Project Structure

project/
├── biome.json
└── rules/
    ├── no-console-log.grit
    ├── no-use-memo.grit
    ├── no-use-callback.grit
    ├── no-dynamic-import.grit
    └── no-fetch-in-effect.grit

biome.json Configuration

{
  "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
  "plugins": [
    "./rules/no-console-log.grit",
    "./rules/no-use-memo.grit",
    "./rules/no-use-callback.grit"
  ],
  "linter": {
    "enabled": true
  }
}

Creating Rules Workflow

  1. Identify the pattern to ban/enforce
  2. Create .grit file in rules/ directory
  3. Write the GritQL pattern with clear error message
  4. Add path to biome.json plugins array
  5. Test with bunx biome check or any equivalent command to run linter in the codebase

Guidelines

  • Keep error messages actionable - tell the user what to do instead
  • Use severity = "error" for hard requirements, "warn" for preferences
  • Put all .grit files in a rules/ directory
  • Name files descriptively: no-X.grit or prefer-Y.grit
  • Test rules against real code before committing

Why This Matters

Instructions in CLAUDE.md degrade as context fills up. Linter rules provide immediate, persistent feedback. When Claude violates a pattern, it sees the error and self-corrects - no context drift.

Resources

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

This skill should be used when the user asks about "parallel agents", "background tasks", "run_in_background", "non-blocking agents", "check agent progress", "TaskOutput", "retrieve agent results", or discusses running multiple agents concurrently. Covers patterns for launching agents in background, monitoring progress, and retrieving results.

日本語の概要は準備中です。原文の説明を表示しています。

SomtoUgeh/somto-dev-toolkit22026年8月26日 更新

Transform brain dumps into polished blog posts in Nick Nisi's voice. Use when the user wants to write a blog post with scattered ideas, talking points, and conclusions that need organization into a cohesive narrative with Nick's conversational, authentic, and thoughtful tone.

日本語の概要は準備中です。原文の説明を表示しています。

SomtoUgeh/somto-dev-toolkit22026年8月26日 更新

This skill should be used when implementing features from a PRD spec, tracking implementation progress, or resuming work across sessions. Covers Dex task management for PRD story execution, daily workflows, and skill auto-loading.

日本語の概要は準備中です。原文の説明を表示しています。

SomtoUgeh/somto-dev-toolkit22026年8月26日 更新

This skill should be used when the user asks for "browser tests", "playwright tests", "end-to-end testing", "test user flows", "E2E coverage", "integration tests for UI", "page object pattern", "/e2e command", or discusses automated browser testing. Covers the E2E test loop workflow, Playwright patterns, page objects, and selector strategies.

日本語の概要は準備中です。原文の説明を表示しています。

SomtoUgeh/somto-dev-toolkit22026年8月26日 更新

gwt

無料

Manage git worktrees using a centralized worktrees folder. Use for parallel development, PR reviews, or isolated work.

日本語の概要は準備中です。原文の説明を表示しています。

SomtoUgeh/somto-dev-toolkit22026年8月26日 更新

This skill should be used when the user asks to "plan a feature", "create PRD", "interview me about requirements", "define stories", "write a spec", "break down feature into tasks", "create implementation plan", "help me scope this feature", "what questions should I answer", or discusses feature planning. Covers the PRD interview process, spec structure, story atomization, and 4-phase workflow from idea to Dex tasks.

日本語の概要は準備中です。原文の説明を表示しています。

SomtoUgeh/somto-dev-toolkit22026年8月26日 更新

SomtoUgeh のスキルをすべて見る

このスキルの問題を報告する