Import - commands and agent skill

Draft
RO
4mo ago
+10102-135

Summary

This PR adds a CSV import workflow to the Basecamp CLI for bringing external task data into Basecamp as todos or cards.

The workflow is built around a durable, deterministic import artifact. Users inspect a source CSV, confirm a mapping and destination, compile those inputs into a validated artifact, review the plan, run preflight checks, and then explicitly approve execution. The same artifact can also report status, support repair review, and produce follow-up artifacts after partial failures.

This gives reviewers and operators a safer import path than a one-shot CSV command: every Basecamp write is planned, validated, approved, and recorded.

Details

Core workflow

Adds the basecamp import command group with:

  • inspect <csv-path> — profiles CSV columns, value shapes, mapping candidates, warnings, and questions
  • compile — validates inspection, mapping, destination, source fingerprint, and writes the import artifact
  • plan — summarizes what the artifact will create without touching Basecamp
  • preflight — checks Basecamp readiness before execution
  • execute --approved — performs the planned writes after explicit approval
  • status — reports local execution state from the artifact
  • repair — summarizes completed, failed, and pending operations after a failed run
  • followup --reviewed — creates a fresh artifact for reviewed pending rows

Core concepts

Deterministic artifact as the source of truth

The import process compiles CSV data into a stable basecamp-import-csv-v1 artifact containing:

  • import.json
  • todos.csv or cards.csv
  • execution.json after execution starts

The artifact records the source CSV fingerprint, destination, normalized rows, counts, and preserved source metadata. Later commands read the artifact instead of reinterpreting the original CSV.

Separation of planning and writing

Inspection, compilation, planning, status, repair, and follow-up are local artifact operations. Basecamp writes only happen during execute --approved, and execution first runs preflight checks.

Safer execution and recovery

Execution writes a ledger before creating records and records each completed or failed operation with source-row provenance and created Basecamp IDs. Artifacts are one-shot: an artifact with an execution ledger will not execute again. Failed imports can be reviewed with repair and continued through a fresh follow-up artifact.

Todo and card support

The importer supports:

  • todo imports into existing projects, new projects, existing todolists, single todolists, or todolists created from a source column
  • card imports into card tables, with cards created into existing columns, a single column, or columns created from a source column

Metadata preservation

Source fields that do not map directly to Basecamp native fields can be preserved as metadata, including assignee names/emails, status, attachment URLs, comments, and custom fields.

Supporting changes

  • Adds import artifact documentation
  • Adds import demo files and a demo script
  • Adds a dedicated basecamp-import skill bundle
  • Updates skill drift validation for the new skill
  • Adds canonical and synthetic CSV fixtures for Asana, ClickUp, Jira, Linear, Trello, and randomized CSV shapes
  • Adds unit, smoke, and e2e coverage for the import lifecycle

Tests

  • GOWORK=off bin/ci

Summary by cubic

Adds a deterministic CSV import workflow to the Basecamp CLI to safely bring external tasks in as todos or cards. Imports compile into a repeatable basecamp-import-csv-v1 artifact, are planned and preflighted, and only write on explicit approval with clear recovery paths.

  • Refactors

    • basecamp skill install now installs both embedded skills (basecamp and basecamp-import); scripts/check-skill-drift.sh validates all skills by default.
    • basecamp import followup enforces --reviewed and improves guidance/error messages for safer recovery.
    • Adds a realistic card demo (Trello-shaped) and strengthens e2e/smoke tests for cards and todos.
    • Adds adversarial CSV fixtures and regression tests to stress inspect → compile → plan (wide rows, ragged/alt delimiters, duplicate headers, multiline, cards).
  • Bug Fixes

    • Enforces restrictive permissions on artifact files (import.json, todos.csv/cards.csv, execution.json) to protect source data and ledgers.
    • Prevents follow-up artifacts from writing into non-empty directories to avoid accidental overwrites.