Osquery Query Helper logo

Osquery Query Helper

Community
tsale
osquery-query-helper

Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

Overview

Publishertsale
Repositoryawesome-dfir-skills
Skill nameosquery-query-helper
Stars
325
Forks
36
Bundled files
3
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by tsale on GitHub. Read the source before you install it.

Installation

Install the Osquery Query Helper AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/tsale/awesome-dfir-skills/tree/main/skills/hunting/osquery-helper
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tsale/awesome-dfir-skills.git /tmp/awesome-dfir-skills
mkdir -p .claude/skills
cp -r /tmp/awesome-dfir-skills/skills/hunting/osquery-helper .claude/skills/osquery-query-helper
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Osquery Query Helper in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Osquery Query Helper on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Osquery Query Helper is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Osquery Query Helper

What This Skill Does

Help users with all aspects of osquery query work:

  • Write queries from scratch based on investigation goals
  • Validate queries the user has written against the schema
  • Troubleshoot queries that aren't working as expected
  • Suggest improvements for performance and accuracy

All work is grounded in the tables and columns defined in the provided schema files for the specified EDR platform.

When to Use

  • User needs a query written for incident response or threat hunting
  • User wants to validate an existing query against the correct schema
  • User has a query that's failing and needs help troubleshooting
  • User wants suggestions to improve query performance

Schema File Format

Schema files are located in resources/ and named by EDR platform: <platform>_osquery_schema.spec

  • standard_osquery_schema.spec — Baseline vanilla osquery (default when no platform specified)
  • EDR-specific examples: bitdefender_, kolide_, crowdstrike_, sentinelone_, carbonblack_

To discover available platforms:

bash
ls resources/*_osquery_schema.spec 2>/dev/null || ls resources/*.spec

Platform Notation Formats

Schema files use one of two formats to indicate OS compatibility:

Format 1: Explicit platforms([...]) field
table_name("<table_name>")
description("Brief description.")
schema([
    Column("column_name", TYPE, "Column description")
])
implementation("<table_name>@genTable")
platforms(["darwin", "linux", "windows"])
Format 2: #platform marker before table definitions

A platform marker on its own line applies to all tables until the next marker:

#darwin
table_name("<mac_only_table>")
...

#linwin
table_name("<linux_windows_table>")
...

Platform Marker Reference

MarkerPlatforms
#darwinmacOS only
#linuxLinux only
#windowsWindows only
#linwinLinux and Windows
#macwinmacOS and Windows
#posixmacOS, Linux, FreeBSD
#sleuthkitmacOS, Linux (requires The Sleuth Kit)
#utilityCross-platform utility tables
#cross-platformAll supported platforms

Schema Lookup Procedure

The schema files are large. Always follow the workflow below to extract table definitions.

Helper scripts are provided in scripts/ to simplify complex operations:

  • scripts/detect-format.sh - Determines schema format
  • scripts/extract-table.sh - Extracts complete table definitions

1. Search for Relevant Tables

bash
# Search by table name keyword
grep -i 'table_name(".*<keyword>' "$SCHEMA_FILE"

# Search descriptions for concepts
grep -i 'description(".*<concept>' "$SCHEMA_FILE"

2. Extract Full Table Definition

Use the extraction script to get the complete table definition:

bash
bash scripts/extract-table.sh <schema_file> <table_name>

Example:

bash
bash scripts/extract-table.sh resources/standard_osquery_schema.spec processes

The script automatically:

  • Detects the schema format (platforms array vs platform markers)
  • Extracts the complete table definition including all columns and platform info
  • Includes the #platform marker for Format 2 schemas

If you need to check the format manually:

bash
bash scripts/detect-format.sh <schema_file>
# Returns: "platforms_array" or "platform_markers"

3. Verify Before Using

  • Confirm columns exist: Only use columns explicitly listed in the schema([...]) block
  • Check OS compatibility: Via platforms([...]) field or preceding #platform marker
  • If unsupported: Inform the user and suggest alternatives

Guidelines

When Writing Queries

  1. Schema is law: Only use tables/columns confirmed via grep from the correct platform schema
  2. Platform awareness: Verify OS support for each table
  3. Performance first: Always include WHERE clauses, use LIMIT for exploration, avoid SELECT *, minimize JOINs
  4. Use placeholders: '<path_to_file>', '<username>', '<timestamp>', '<ip_address>'
  5. Be upfront about gaps: If a table/column doesn't exist, say so and suggest alternatives

When Validating User Queries

  1. Verify each table exists in the platform schema
  2. Confirm all referenced columns exist
  3. Check OS compatibility
  4. Flag performance issues (missing WHERE, SELECT *, expensive JOINs)
  5. Offer corrected queries, not just problems

When Troubleshooting

  1. Start with schema—most failures are mismatches
  2. Check basics: table exists, columns spelled correctly, OS supported
  3. Consider EDR differences—query may be from a different platform
  4. Explain why something failed, not just how to fix it

Safety and Privacy

  • Redact sensitive data in examples
  • Query only necessary data
  • Prefer hashes over file content dumps
  • Use time constraints to limit data volume

Workflow

0. Identify EDR Platform

Ask user or check context. Default to standard_osquery_schema.spec if unspecified.

1. Understand the Request

Writing new query? Validating? Troubleshooting? What data is needed?

2. Search and Extract Schema

Use grep to find tables, then bash scripts/extract-table.sh to get full definitions. Verify columns and OS compatibility from the extracted output.

3. Write, Validate, or Fix

Use only verified tables/columns. Add WHERE clauses and LIMIT for performance.

4. Deliver Response

Include:

  • EDR platform/schema used
  • Schema lookups performed (show grep commands)
  • The query with syntax highlighting
  • Explanation of what it does or what was wrong
  • Assumptions (platform, OS, environment)
  • Limitations (missing tables/columns, OS restrictions, performance concerns)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Osquery Query Helper AI skill do?

Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

Why use Osquery Query Helper on TypingMind?

Because you install it once and use it with any model. Osquery Query Helper is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Osquery Query Helper in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tsale/awesome-dfir-skills/tree/main/skills/hunting/osquery-helper. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Osquery Query Helper?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Osquery Query Helper?

As many as you like. As long as a model supports skills, you can use Osquery Query Helper with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Osquery Query Helper AI skill free?

Yes. It is published on GitHub by tsale under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇