notebook-cell
Skill0 starsChanged 8 months agoMITView on GitHub
Generate and insert StackQL query cells into an existing Jupyter notebook. Creates a markdown heading cell and a %%stackql query cell, with optional visualization. Works with the pystackql magic extension.
In this repository10 other files it gives its agents.
- auth-setupSkill
- exploreSkill
- install-stackqlSkill
- notebookSkill
- pull-providerSkill
- querySkill
- read-memoriesSkill
- scaffold-stackSkill
- setup-ciSkill
- stackql-docsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 10 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
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
- Distinctive: line 15
Follow these steps in order.
- Very specific: line 19
Look for open or recently modified .ipynb files:
- Distinctive: line 25
If multiple notebooks exist, check which ones already use pystackql:
- Distinctive: line 31
If there are multiple candidates, ask the user which notebook to add cells to.
- Very specific: line 33
If no notebook exists, suggest using /stackql-skills:notebook to create one first.
- Distinctive: line 37
Read the notebook to understand:
- Distinctive: line 52
If the input is natural language, use the existing notebook context (pulled providers, variables) to generate the appropriate query.
- Distinctive: line 62
Follow these rules for all notebook cells:
- Very specific: line 64
No horizontal rules (---, *, ___) or <hr/> tags
- Distinctive: line 65
Use spacing and headings to separate sections, not horizontal rules
- Distinctive: line 67
Create 2-3 cells to insert:
- Very specific: line 94
Add --no-display to the %%stackql line if the flag was passed
- Very specific: line 95
Add --csv-download if the user wants export capability
- Very specific: line 97
Use $variable substitution for any values that match Python variables already defined in the notebook.
- Very specific: line 99
Use $$ to escape literal dollar signs in JSON path expressions.
- Distinctive: line 118
Auto-detect: If the result likely has a categorical column and a numeric column, suggest a bar chart.
- Distinctive: line 122
Use the NotebookEdit tool to insert the cells at the end of the notebook (or at a user-specified position).
≈ “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.
Files
You are helping the user add StackQL query cells to an existing Jupyter notebook that uses the pystackql magic extension.
Input: $@
Follow these steps in order.
Step 1 - Find the target notebook
Look for open or recently modified .ipynb files:
find . -name "*.ipynb" -not -path '*/.git/*' -not -path '*/.ipynb_checkpoints/*' 2>/dev/nullIf multiple notebooks exist, check which ones already use pystackql:
grep -l "pystackql" *.ipynb 2>/dev/nullIf there are multiple candidates, ask the user which notebook to add cells to.
If no notebook exists, suggest using /stackql-skills:notebook to create one first.
Step 2 - Read the existing notebook
Read the notebook to understand:
- Which magic extension is loaded (
pystackql.magicorpystackql.magics) - What providers have been pulled
- What Python variables are defined (these can be used in queries via
$variable) - How many cells exist (to determine insert position)
- What queries already exist (to avoid duplication)
Step 3 - Parse the request
Determine what the user wants:
- Raw SQL: the user provided a StackQL query directly
- Natural language: the user described what they want to query - generate the SQL
--vizflag: what visualization to add (bar,line,table, or auto-detect)--no-display: suppress query output display
If the input is natural language, use the existing notebook context (pulled providers, variables) to generate the appropriate query. If needed, discover the schema:
stackql exec "DESCRIBE <provider>.<service>.<resource>;" --output jsonStep 4 - Generate the cells
Cell conventions
Follow these rules for all notebook cells:
- One heading per cell, placed at the top
- No horizontal rules (
---,***,___) or<hr/>tags - Use spacing and headings to separate sections, not horizontal rules
Create 2-3 cells to insert:
Markdown cell
## <Section Title>
<Brief description of what this query does.>Query cell
For single-line queries:
%stackql <QUERY>For multi-line queries:
%%stackql
SELECT
<fields>
FROM <provider>.<service>.<resource>
WHERE <params>Options:
- Add
--no-displayto the%%stackqlline if the flag was passed - Add
--csv-downloadif the user wants export capability
Use $variable substitution for any values that match Python variables already defined in the notebook.
Use $$ to escape literal dollar signs in JSON path expressions.
Visualization cell (if --viz or auto-detected)
Bar chart (--viz bar):
stackql_df.plot(kind='bar', x='<x_col>', y='<y_col>', title='<Title>');Line chart (--viz line):
stackql_df.plot(kind='line', x='<x_col>', y='<y_col>', title='<Title>');Table (--viz table):
stackql_dfAuto-detect: If the result likely has a categorical column and a numeric column, suggest a bar chart. If it has a date/time column and a numeric column, suggest a line chart. Otherwise, just display as a table.
Step 5 - Insert the cells
Use the NotebookEdit tool to insert the cells at the end of the notebook (or at a user-specified position).
Step 6 - Report
Briefly confirm what was added:
- The query that was inserted
- The visualization type (if any)
- Remind the user to run the cells in order
- Note that
stackql_dfwill contain the query results as a pandas DataFrame
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
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.

