agentleFS
ClickHouseClickHouse/agent-skills/AGENTS.md

agent-skills

AGENTS.md563 starsChanged 9 months agoApache-2.0View on GitHub

A collection of skills for AI agents working with ClickHouse databases and chdb (in-process ClickHouse for Python). Skills are packaged instructions and guidelines that extend agent capabilities for database design, query optimization, operational best practices, and in-process data analytics.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    SKILL.md: Always uppercase, always this exact filename

    line 83
  2. Very specific:

    Use the template in rules/_template.md.

    line 130
  3. Very specific:

    Add a rule: Create a new .md file in rules/ following the template

    line 176
  4. Very specific:

    Validate: Run bun run validate to check structure

    line 177
  5. Very specific:

    Validate code: Run skill-specific validators (e.g., bun run validate-sql)

    line 178
  6. Very specific:

    Check links: Run bun run check-links

    line 179
  7. Very specific:

    Build: Run bun run build to generate AGENTS.md

    line 180
  8. Distinctive:

    Test: Verify the generated documentation is correct

    line 181
  9. Distinctive:

    Run all validation scripts

    line 187
  10. Distinctive:

    Keep rules focused and actionable

    line 195
  11. Distinctive:

    Use real code that can be executed (avoid pseudo-code)

    line 196
  12. Distinctive:

    Test code examples before committing

    line 199
  13. Distinctive:

    Follow the existing style and structure

    line 200

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
AGENTS.md

AGENTS.md

This file provides guidance to AI coding agents (Claude Code, Cursor, Copilot, etc.) when working with code in this repository.

Repository Overview

A collection of skills for AI agents working with ClickHouse databases and chdb (in-process ClickHouse for Python). Skills are packaged instructions and guidelines that extend agent capabilities for database design, query optimization, operational best practices, and in-process data analytics.

Repository Structure

agent-skills/
├── skills/
│   ├── clickhouse-best-practices/   # ClickHouse optimization guidelines
│   │   ├── SKILL.md                 # Skill definition (overview)
│   │   ├── AGENTS.md                # Full compiled guide (generated)
│   │   ├── metadata.json            # Version, organization, abstract
│   │   ├── README.md                # Maintainer guide
│   │   └── rules/                   # Individual rule files
│   │       ├── _sections.md         # Section metadata
│   │       ├── _template.md         # Template for new rules
│   │       └── *.md                 # Rule files (e.g., query-use-prewhere.md)
│   ├── chdb-datastore/              # chdb pandas-compatible DataStore API
│   │   ├── SKILL.md                 # Skill definition and quick-start
│   │   ├── metadata.json            # Version, organization, abstract
│   │   ├── README.md                # Maintainer guide
│   │   ├── references/              # API reference docs
│   │   │   ├── api-reference.md     # DataStore method signatures
│   │   │   └── connectors.md        # All data source connection methods
│   │   ├── examples/
│   │   │   └── examples.md          # Runnable examples
│   │   └── scripts/
│   │       └── verify_install.py    # Environment verification
│   └── chdb-sql/                    # chdb SQL API
│       ├── SKILL.md                 # Skill definition and quick-start
│       ├── metadata.json            # Version, organization, abstract
│       ├── README.md                # Maintainer guide
│       ├── references/              # SQL reference docs
│       │   ├── api-reference.md     # query/Session/connect signatures
│       │   ├── table-functions.md   # ClickHouse table functions
│       │   └── sql-functions.md     # Commonly used SQL functions
│       ├── examples/
│       │   └── examples.md          # Runnable examples
│       └── scripts/
│           └── verify_install.py    # Environment verification
├── packages/
│   └── clickhouse-best-practices-build/  # Build tooling
│       ├── package.json             # Bun scripts
│       ├── tsconfig.json            # TypeScript config
│       └── src/
│           ├── config.ts            # Path configuration
│           ├── types.ts             # Type definitions
│           ├── parser.ts            # Markdown parser
│           ├── build.ts             # Build script
│           ├── validate.ts          # Rule validator
│           ├── validate-sql.ts      # SQL syntax validator
│           └── check-links.ts       # Internal link checker
└── .github/
    └── workflows/
        └── clickhouse-best-practices-ci.yml  # CI workflow

Creating a New Skill

Directory Structure

skills/
  {skill-name}/           # kebab-case directory name
    SKILL.md              # Required: skill definition
    AGENTS.md             # Generated: full compiled guide
    metadata.json         # Required: version, organization, abstract
    README.md             # Required: maintainer guide
    rules/                # Required: rule files
      _sections.md        # Section metadata
      _template.md        # Template for new rules
      *.md                # Individual rules

Naming Conventions

  • Skill directory: kebab-case (e.g., clickhouse-best-practices)
  • SKILL.md: Always uppercase, always this exact filename
  • Rule files: {section-prefix}-{descriptive-name}.md (e.g., query-use-prewhere.md)
  • Section prefixes: Match the section IDs defined in _sections.md

SKILL.md Format

---
name: {skill-name}
description: {One sentence describing when to use this skill. Include trigger phrases.}
license: MIT
metadata:
  author: {organization}
  version: "{version}"
---

# {Skill Title}

{Brief description of what the skill does.}

## When to Apply

Reference these guidelines when:
- {Use case 1}
- {Use case 2}

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | {Category} | {Impact} | `{prefix}-` |

## Quick Reference

{Brief overview of each category and key rules}

## How to Use

{Instructions on reading individual rule files}

## Full Compiled Document

For the complete guide with all rules expanded: `AGENTS.md`

Rule File Format

Use the template in rules/_template.md. Each rule file must have:

  1. YAML frontmatter:
    ---
    title: Rule Title
    impact: CRITICAL | HIGH | MEDIUM-HIGH | MEDIUM | LOW-MEDIUM | LOW
    impactDescription: Optional (e.g., "10-100× query speedup")
    tags: skill, category, specific-tags
    ---
  2. Rule structure:
    • Brief explanation of why it matters
    • Incorrect: code example showing the anti-pattern
    • Correct: code example showing the best practice
    • Additional context, trade-offs, or when to apply
    • Reference links (optional)

Best Practices for Context Efficiency

Skills are loaded on-demand — only the skill name and description are loaded at startup. The full SKILL.md loads into context only when the agent decides the skill is relevant. To minimize context usage:

  • Keep SKILL.md under 500 lines — put detailed reference material in separate files
  • Write specific descriptions — helps the agent know exactly when to activate the skill
  • Use progressive disclosure — reference supporting files that get read only when needed
  • Individual rule files — allows agents to read only relevant rules on-demand
  • File references work one level deep — link directly from SKILL.md to supporting files

Build System Requirements

Each skill should have a build package that:

  • Validates rule structure and content
  • Validates code examples (e.g., SQL syntax for database skills)
  • Checks internal links
  • Generates the compiled AGENTS.md file

For ClickHouse Best Practices, the build system:

  • Uses Bun for fast execution
  • Downloads ClickHouse binary for real SQL validation
  • Parses markdown with YAML frontmatter
  • Generates table of contents and numbered sections
  • Supports version management

Development Workflow

  1. Add a rule: Create a new .md file in rules/ following the template
  2. Validate: Run bun run validate to check structure
  3. Validate code: Run skill-specific validators (e.g., bun run validate-sql)
  4. Check links: Run bun run check-links
  5. Build: Run bun run build to generate AGENTS.md
  6. Test: Verify the generated documentation is correct

CI/CD Integration

Set up GitHub Actions (or similar) to:

  1. Install dependencies
  2. Run all validation scripts
  3. Build documentation
  4. Upload artifacts

See .github/workflows/clickhouse-best-practices-ci.yml for an example.

Contributing Guidelines

  • Keep rules focused and actionable
  • Use real code that can be executed (avoid pseudo-code)
  • Include performance metrics when possible
  • Reference official documentation where relevant
  • Test code examples before committing
  • Follow the existing style and structure

Impact Levels

Choose the appropriate impact level for rules:

  • CRITICAL: 10× or more improvement, or prevents serious issues
  • HIGH: 2-10× improvement, or significantly impacts scalability
  • MEDIUM-HIGH: 25-100% improvement, or important for specific workloads
  • MEDIUM: 10-25% improvement, or helpful for maintainability
  • LOW-MEDIUM: 5-10% improvement, or nice-to-have optimizations
  • LOW: Minor improvements or edge cases

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.