agentleFS
stackqlstackql/stackql-skills/skills/notebook/SKILL.md

notebook

Skill0 starsChanged 8 months agoMITView on GitHub

Create a StackQL Jupyter notebook using the pystackql magic commands. Generates a complete notebook with setup, provider pulls, auth, queries, and optional visualizations from a description or provider resource target.

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 9

    Distinctive

    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:

    Follow these steps in order.

    line 16
  2. Distinctive:

    If the input is vague, ask:

    line 25
  3. Distinctive:

    Check if StackQL is installed and the provider is pulled:

    line 32
  4. Distinctive:

    If needed, pull the provider:

    line 39
  5. Distinctive:

    Use this to understand what fields are available and what WHERE clause parameters are required.

    line 54
  6. Distinctive:

    Ask the user where to save the notebook, or use a sensible default based on the topic:

    line 58
  7. Distinctive:

    Create the notebook with cells following this structure.

    line 66
  8. Distinctive:

    Follow these rules for all notebook cells:

    line 70
  9. Very specific:

    No horizontal rules (---, *, ___) or <hr/> tags

    line 72
  10. Distinctive:

    Use spacing and headings to separate sections, not horizontal rules

    line 75
  11. Very specific:

    Use $variable in queries where the value comes from a Python variable:

    line 182
  12. Very specific:

    When the query needs a literal $ (e.g., JSON path expressions), use $$:

    line 188
  13. Very specific:

    Use %%stackql --no-display to run a query without displaying the result

    line 196
  14. Very specific:

    Use %%stackql --csv-download to add a CSV download button

    line 197

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

You are helping the user create a Jupyter notebook that uses StackQL to query cloud and SaaS resources via the pystackql magic commands.

Input: $@

Follow these steps in order.

Step 1 - Understand the requirements

Parse the input to determine:

  • Which provider(s) and resources are involved
  • What the user wants to query or analyze
  • Whether --server flag is present (use server mode instead of local binary)

If the input is vague, ask:

  • Which cloud provider? (google, aws, azure, github, etc.)
  • What resources or data do you want to explore?
  • Any specific analysis or visualization goals?

Step 2 - Discover resource schemas

Check if StackQL is installed and the provider is pulled:

command -v stackql
stackql exec "SHOW PROVIDERS;" --output json

If needed, pull the provider:

stackql exec "REGISTRY PULL <provider>;"

Get the resource schema to inform the notebook queries:

stackql exec "SHOW SERVICES IN <provider>;" --output json
stackql exec "SHOW RESOURCES IN <provider>.<service>;" --output json
stackql exec "DESCRIBE <provider>.<service>.<resource>;" --output json
stackql exec "SHOW METHODS IN <provider>.<service>.<resource>;" --output json

Use this to understand what fields are available and what WHERE clause parameters are required.

Step 3 - Determine the notebook path

Ask the user where to save the notebook, or use a sensible default based on the topic:

<descriptive-name>.ipynb

Step 4 - Build the notebook

Create the notebook with cells following this structure. Use the NotebookEdit tool to create and populate the notebook.

Cell conventions

Follow these rules for all notebook cells:

  • One heading per cell, placed at the top
  • No horizontal rules (---, ***, ___) or <hr/> tags
  • Any cell with <div>, <link>, <script> must use %md-sandbox type
  • Inline styles only in %md-sandbox cells (no classes or <style> elements)
  • Use spacing and headings to separate sections, not horizontal rules

Cell 1 - Title (markdown)

# <Descriptive Notebook Title>

<Brief description of what this notebook does.>

Cell 2 - Setup (code)

For local mode (default):

%load_ext pystackql.magic

For server mode (--server flag):

%load_ext pystackql.magics

Cell 3 - Pull providers (code)

%stackql registry pull <provider>

One line per provider if multiple are needed.

Cell 4 - Variables (code)

Define Python variables for parameterized queries:

project = "your-project-id"
region = "us-central1"

Include all required WHERE clause parameters discovered in Step 2. Use sensible placeholder values and add comments telling the user to update them.

Cell 5+ - Query sections

For each query/analysis, create a pair of cells:

Markdown cell with a section heading:

## <Section Title>

<Brief description of what this query does.>

Code cell with the StackQL query:

For single-line queries:

%stackql SELECT name, status FROM <provider>.<service>.<resource> WHERE <required_params>

For multi-line queries:

%%stackql
SELECT
    name,
    status,
    <other_fields>
FROM <provider>.<service>.<resource>
WHERE <required_param> = '$variable'
ORDER BY name

Visualization cells (optional)

Where results are suitable for visualization, add a code cell after the query:

Simple bar chart:

stackql_df.plot(kind='bar', x='name', y='count', title='<Chart Title>');

Custom matplotlib:

import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(10, 6))
ax.bar(stackql_df['<x_col>'], stackql_df['<y_col>'])
ax.set_xlabel('<X Label>')
ax.set_ylabel('<Y Label>')
ax.set_title('<Chart Title>')
plt.xticks(rotation=45, ha='right')
plt.tight_layout()
plt.show()

Final cell - Summary/next steps (markdown)

## Next Steps

- Modify the queries above to explore different resources
- Use `/stackql-skills:notebook-cell` to add more queries
- Use `/stackql-skills:query` for ad-hoc queries outside the notebook

Step 5 - Key patterns to follow

Variable substitution

Use $variable in queries where the value comes from a Python variable:

WHERE project = '$project' AND zone = '$zone'

Dollar sign escaping

When the query needs a literal $ (e.g., JSON path expressions), use $$:

JSON_EXTRACT(Properties, '$$.BucketName')

Result access

  • The last query result is always stored in stackql_df (pandas DataFrame)
  • The _ variable also references the last cell output (standard IPython)
  • Use %%stackql --no-display to run a query without displaying the result
  • Use %%stackql --csv-download to add a CSV download button

Registry operations

Providers must be pulled before querying. Use line magic:

%stackql registry pull <provider>

Mutations

For INSERT, DELETE, EXEC, and REGISTRY operations, the magic command routes these automatically to the correct execution method.

Step 6 - Report

Tell the user:

  • The notebook path
  • What provider(s) and resources are covered
  • Remind them to update the variable values (project IDs, regions, etc.)
  • How to run the notebook: jupyter notebook <path> or open in VS Code
  • Note that pystackql must be installed: pip install pystackql

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.