Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .claude/agents/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: onboarding
description: Orchestrates the full dataset onboarding workflow for Data Basis — from raw data → clean data → BigQuery → metadata in the backend. Spawn this agent when the user asks to onboard a dataset.
---

# Data Basis Pipeline Agent
# Data Basis Onboarding Agent

This agent orchestrates the full dataset onboarding workflow for Data Basis: from raw data → clean data → BigQuery → metadata in the backend.

Expand Down Expand Up @@ -51,9 +51,14 @@ After step 8 succeeds, output a verification checklist and wait for explicit app
✓ Cloud tables: OK
✓ Verify at: https://development.basedosdados.org/dataset/<slug>

Table order set: <list in order, or "default">
OL order set per table: <summary, or "default">

Reply "approved" to promote to prod, or describe what needs fixing.
```

Note: ordering steps are handled inside `onboarding-metadata` (steps 7–8 of that command). If the human did not specify an order during step 8, you may ask here whether they want to adjust ordering before promoting to prod.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix inaccurate step reference to ordering logic.

This line says ordering is handled in onboarding-metadata steps 7–8, but OL ordering is documented in that command right after step 2. Please update this reference to avoid operator confusion during the checkpoint flow.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/agents/onboarding.md at line 60, The note incorrectly refers to
ordering being handled in onboarding-metadata steps 7–8; update the text that
mentions `onboarding-metadata` so it points to the correct location where
ordering logic is documented (the section right after step 2 in
`onboarding-metadata`) and rephrase to say ordering is handled in
onboarding-metadata immediately after step 2 (and that you should prompt the
human to adjust ordering here only if they didn’t specify order in that
section).


Do not proceed to step 9 or step 10 without the user replying "approved" (or equivalent).

## Environment
Expand Down
20 changes: 20 additions & 0 deletions .claude/commands/onboarding-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ For each entity in the table's observation level list (from architecture design

Track returned OL IDs — needed for column updates.

**Ordering checkpoint:** After all OLs for this table are created, ask the human:

```text
OLs created for <table_slug>: <entity_slug_1>, <entity_slug_2>, ...
Should I set a specific display order for these observation levels? If yes, reply with the desired order (e.g. "year, municipality, financing_account"). Otherwise reply "default" to skip.
```

Wait for the reply before proceeding. If the human specifies an order, call `reorder_observation_levels` with the corresponding OL IDs in the requested order.

### 3. Upload columns from architecture table

Call `upload_columns_from_sheet` with:
Expand Down Expand Up @@ -141,6 +150,17 @@ Call `create_update_table` again with the same `id` and `slug`, passing only:

All other fields must be re-passed as well (the API requires them). This deferred call ensures the table record is fully persisted before the relationship is written.

## Table ordering checkpoint

After all tables are created/updated, ask the human:

```text
All tables registered for <dataset_slug>: <table_slug_1>, <table_slug_2>, ...
Should I set a specific display order for these tables? If yes, reply with the desired order (one slug per line or comma-separated). Otherwise reply "default" to skip.
```

Wait for the reply. If the human specifies an order, call `reorder_tables` with the requested slug order.

## Summary output

After processing all tables, output:
Expand Down