A general-purpose agent knows a lot about SQL and nothing about your warehouse. The difference between a useful answer and a plausible one is usually context: which database is production, what the naming conventions are, what must never be touched. InsightWorker keeps that context in your project, in plain files, and loads only what each message needs.
Setting up a project
In a project folder, /init creates .insightworker/ with a playbooks/project.md to edit, and folders
for guards and apps. Everything there is text you can review and commit with the project.
Playbooks: three ways to be loaded
A playbook is markdown with a small front-matter header. Its scope decides when it is loaded:
- always: every conversation. Keep these short: the systems, the rules, the people to ask.
- auto: when the message overlaps the playbook's
description. The match is simple and predictable: at least two words longer than three letters from the description must appear in the message. Write descriptions as lists of the words people actually use. - on-demand: when the message mentions
@name, for long references such as a runbook.
---
name: project
scope: always
---
# Claims data platform
- Warehouse: Oracle ADW, schema CLAIMS_DW. Staging: PostgreSQL.
- Orchestration: Airflow; DAG ids start with etl_.
- Never run DDL in production. Ask before writing to any table.
---
name: database-conventions
scope: auto
description: database schema naming conventions oracle postgres tables columns
---
Tables are singular snake_case. Surrogate keys are <table>_id ...
With these two, "describe the claim table's columns in postgres" loads both (the words columns and postgres match);
"why did etl_claims fail?" loads only the project playbook, and adding @runbook pulls in a runbook playbook as well.
Guards: checks on what the agent writes
Guards are YAML files in .insightworker/guards/. Each has a trigger, an optional file pattern, an action and a severity.
file_create and file_save fire when the agent's file tool writes a file, and
/guard run <name> runs a guard by hand. A command action runs a shell command (stopped after 30 seconds) and
prints its output; a prompt action asks the agent to review the file in the same session. The severity
(info, warn or block) labels the report. /guard init
writes an example and /guards lists them.
name: sql-check
description: Review SQL files for common issues
trigger: file_save
filePattern: "**/*.sql"
severity: warn
enabled: true
action:
type: prompt
value: "Review {filePath} for syntax errors and missing WHERE clauses on UPDATE/DELETE."
Memory
The worker keeps a memory/MEMORY.md in the workspace for facts worth carrying between sessions, and a dated log per day.
/memory shows what is there. Because it is a file, you can read it, correct it or delete it; nothing is remembered that you cannot
see.
Skills
Separately from your project's files, InsightWorker ships domain skills: packaged know-how for tasks such as pipeline
triage, DAG review and run diagnosis, stored-procedure review, document OCR, policy comparison, insurance intake and email drafting.
/skills lists what is installed.
A checklist for a new project
- Run
/initand writeproject.md: systems, environments, rules, owners. Ten lines is plenty. - Add one
autoplaybook per recurring topic, with a description made of the words people use for it. - Put long references (runbooks, mapping tables) in
on-demandplaybooks. - Add a guard for the file types the agent will write most (SQL, DAGs, configs), preferably a
commandguard that runs your existing linter. - Commit
.insightworker/with the project so everyone gets the same context.
Related: the anatomy of an app, whose plan.md plays the same role for one task.

