agentleFS
yanggujunyanggujun/open-axle/skills/db-accessor/SKILL.md

db-accessor

Skill0 starsChanged 2 months agoMITView on GitHub

This skill enables the LLM to execute SQL queries against a SAP HANA database by understanding the user's intent and producing a strictly-formatted JSON output that describes the query to run. The JSON output is then parsed by the db_accessor skill to connect to the database and return the result set. Invoke this skill whenever the user's request implies querying a database, running SQL, fetching data, or executing a stored procedure. Look for phrases such as: Do NOT use this…

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT use this skill when the user wants to:

    line 22
  2. Very specific:

    Read a file → use file-reader.

    line 23
  3. Very specific:

    Create a file → use file-creator.

    line 24
  4. Distinctive:

    When the skill is triggered, the LLM must:

    line 29
  5. Very specific:

    All string values must properly escape special characters (", \, newline as \n, tab as \t).

    line 81
  6. Very specific:

    Do NOT emit multiple access_db payloads in a single response.

    line 82
  7. Very specific:

    Never allow destructive SQL statements (DROP, TRUNCATE, DELETE, ALTER, UPDATE, INSERT) by default unless allowModification is explicitly …

    line 196
  8. Distinctive:

    Always echo the JSON payload so the user can review before execution.

    line 200
  9. Distinctive:

    Do not expose the password in logs or error messages.

    line 202

≈ “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

🗄️ Database Query Skill (db_accessor)

Overview

This skill enables the LLM to execute SQL queries against a SAP HANA database by understanding the user's intent and producing a strictly-formatted JSON output that describes the query to run. The JSON output is then parsed by the db_accessor skill to connect to the database and return the result set.

Skill Name

db_accessor

When to Use This Skill

Invoke this skill whenever the user's request implies querying a database, running SQL, fetching data, or executing a stored procedure. Look for phrases such as:

  • "run a query ..."
  • "execute SQL ..."
  • "select from ..."
  • "fetch data from database ..."
  • "get records ..."
  • "query the database ..."

Do NOT use this skill when the user wants to:

  • Read a file → use file-reader.
  • Create a file → use file-creator.
  • Make HTTP requests → use curl.

What the LLM Must Do

When the skill is triggered, the LLM must:

  1. Extract the following from the user's request (asking clarifying questions only if truly ambiguous):
    • sql (required): The SQL statement to execute.
    • timeout (optional): Maximum execution time in seconds. Defaults to 30.
    • allowModification (optional): Whether to allow INSERT/UPDATE/DELETE/ALTER/DROP/TRUNCATE. Defaults to false.
    • max_rows (optional): Maximun rows shown to user. Defaults to 100.
    • description (optional): One-line summary of the query.
    • database (required): Database name described in the local configuration.
    • sequential (optional): If the result set is needed as input for a follow-up AI task.
    • prompt (optional): Follow-up prompt for all following tasks when sequential is set.
  2. Produce a response containing a single pure JSON object that STRICTLY follows the schema below. No code fences, no extra prose.

Required JSON Output Schema

The LLM's response MUST be a pure JSON string with no code blocks.

{
  "action": "access_db",
  "thinking": "<ai-thinking-trace>",
  "sequential": {
    "prompt": ""
  },
  "properties": [
    {"name": "database", "value": "mysqllocall"},
    { "name": "sql",                "value": "SELECT * FROM TABLE" },
    { "name": "timeout",            "value": "30" },
    { "name": "allowModification",  "value": "false" }
  ]
}

Field Rules

FieldTypeRequiredNotes
actionstringYesMust be exactly "access_db".
sqlstringYesThe SQL statement to execute. Must be non-empty.
timeoutstringNoTimeout in seconds as string. Default "30".
driverstringYesDatabase driver identifier (e.g., hdbcli).
allowModificationstringNo"true" or "false". Default "false".
max_rowsstringNodefault to 100
descriptionstringNoHuman-readable purpose of the query.
databasestringYesDatabase name in the local configuration.
sequentialobjectNoIf the result should feed a follow-up AI task.
promptstringNoFollow-up prompt when sequential is present.

Formatting Requirements

  • The JSON output must be valid JSON (parseable by json.loads).
  • All string values must properly escape special characters (", \, newline as \n, tab as \t).
  • Do NOT emit multiple access_db payloads in a single response.

Database Connection Configuration

The database configuration should always be in .axle in the working directory Sample configuration:

{
  {
    "skill_configs": [
        {
            "skill": "access_db",
            "config_items": [
                {
                    "name": "database name",
                    "value": {
                        "db_name": "database name",
                        "port": "50000",
                        "host": "db address",
                        "user_name": "user",
                        "pass": "password",
                        "type": "mysql",
                        "driver": "db_driver"
                      }
                },
                {
                    "name": "database name2",
                    "value": {
                        "port": "40000",
                        "address": "db address",
                        "user_name": "user",
                        "pass": "password",
                        "type": "mysql",
                        "driver": "db_driver"
                      }
                }
            ]
        }
    ]
  }
}

Response Pattern for the LLM

A typical assistant reply should look like the following. No other output is needed. Output must be in pure JSON format.

{ "action": "access_db", "thinking": "User wants to fetch all customers.", "properties": [ { "name": "sql", "value": "SELECT * FROM CUSTOMERS" }, { "name": "timeout", "value": "30" }, { "name": "database", "value": "mysqllocal" }, { "name": "driver", "value": "hdbcli" }, { "name": "allowModification", "value": "false" }, { "name": "max_rows", "value": "100" }, { "name": "description", "value": "Fetch all customers" } ] }

Decision Logic

User Prompt
    |
    +-- Does the request imply executing a database query?
    |     |
    |     +-- YES --> Extract sql/params/flags --> Emit ONE `access_db` JSON payload
    |     |
    |     +-- NO  --> Do not use this skill

Examples

Example 1: Simple SELECT query

User: "Run SELECT * FROM USERS on the HANA database."

LLM emits:

{
  "action": "access_db",
  "thinking": "User wants to select all users from the database.",
  "properties": [
    { "name": "database", "value": "mysql.local" },
    { "name": "driver", "value": "mysql.driver" },
    { "name": "sql", "value": "SELECT * FROM USERS" },
    { "name": "timeout", "value": "30" },
    { "name": "allowModification", "value": "false" }
    { "name": "max_rows", "value": "100" }
  ]
}

Example 2: Query with explicit allowModification

User: "Insert a record into the LOG table. It's safe to modify."

LLM emits:

{
  "action": "access_db",
  "thinking": "User explicitly allows modification, so allowModification is true.",
  "properties": [
    { "name": "database", "value": "mysql.local" },
    { "name": "driver", "value": "mysql.driver" },
    { "name": "sql", "value": "INSERT INTO LOG VALUES ('test')" },
    { "name": "timeout", "value": "30" },
    { "name": "allowModification", "value": "true" }
  ]
}

Safety Guidelines

  1. Never allow destructive SQL statements (DROP, TRUNCATE, DELETE, ALTER, UPDATE, INSERT) by default unless allowModification is explicitly set to true.
  2. Refuse SQL that attempts to access system tables (e.g., SYS.*, _SYS_*) or sensitive data.
  3. Enforce a reasonable timeout (default 30s, max 120s).
  4. Limit the result set size to prevent excessive output (e.g., 10,000 rows max).
  5. Always echo the JSON payload so the user can review before execution.
  6. The connection details (host, port, user, password, database) must be provided in the properties; do not read them from external files without explicit user consent.
  7. Do not expose the password in logs or error messages; mask it if shown.

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.