Poketo Headless Auth Migration Brief

Date: 2026-04-03 (original), 2026-05-11 (reconciled with implementation) Status: Partially completed — skills migrated to CLI gateway; Work tool stubs and API-key-to-session bridge remain open

Decision Summary

The recommended agent auth path is a scoped Poketo API key (pk_...) presented to the agent gateway, not direct database access and not the current session-file-plus-DB-URL workflow.

This recommendation is grounded in the existing Poketo monorepo:

Inference from code:

Current Local Assumptions To Remove

Direct database requirements

These files explicitly require direct Neon database access for standard kanban usage:

File Current assumption
packs/poketowork-kanban/claude/poketo-kanban/SKILL.mdMigrated: now says "All operations go through the poketo CLI gateway." Direct DB is fallback only.
packs/poketowork-kanban/codex/poketo-kanban/SKILL.mdMigrated: uses poketo kanban <command> CLI, not direct DB.
packs/poketowork-kanban/claude/poketo-kanban/scripts/kanban.mjsLegacy fallback: still connects to Neon directly. Marked DEPRECATED.
packs/poketowork-kanban/claude/poketo-kanban/scripts/bootstrap-session.mjsBootstraps local auth; requires AUTH_DATABASE_URL and POKEAPPS_DATABASE_URL only (not POKETOWORK_DATABASE_URL).

Session-file-only local auth

These files assume ~/.poketo/config.json is the auth source for standard kanban operations:

File Current assumption
packs/poketowork-kanban/claude/poketo-kanban/SKILL.mdMigrated: uses CLI gateway path; config file is secondary.
packs/poketowork-kanban/codex/poketo-kanban/SKILL.mdMigrated: uses poketo kanban CLI; no config file dependency.
/Users/georgele/projects/tools/agentic-skills/packs/poketowork-kanban/claude/poketo-kanban/scripts/kanban.mjsLoads ~/.poketo/config.json and uses it as the session model.
/Users/georgele/projects/tools/agentic-skills/packs/poketowork-kanban/claude/poketo-kanban/scripts/bootstrap-session.mjsCreates ~/.poketo/config.json locally via direct DB queries.

Important constraint:

Claude-install-path coupling in Codex skills

These files still hardcode Claude install paths for Codex behavior:

File Current assumption
packs/poketowork-kanban/codex/brainstorm-kanban/SKILL.mdMigrated: uses poketo kanban <command> CLI.
packs/poketowork-kanban/codex/spec-interview-kanban/SKILL.mdMigrated: uses poketo kanban CLI.
packs/poketowork-kanban/codex/roadmap-kanban/SKILL.mdMigrated: uses poketo kanban CLI.
packs/poketowork-kanban/codex/run-kanban/SKILL.mdMigrated: uses poketo kanban CLI.
packs/poketowork-kanban/codex/ship-kanban/SKILL.mdMigrated: uses poketo kanban CLI.
packs/poketowork-kanban/codex/ship-end-kanban/SKILL.mdMigrated: uses poketo kanban CLI.
packs/poketowork-kanban/codex/kanban-archive/Removed: merged into poketo-kanban --archive flag.
packs/poketowork-kanban/codex/sync-roadmap-kanban/SKILL.mdMigrated: uses poketo kanban CLI.

Shared setup docs tied to the standalone script

These files document the legacy script as the normal workflow:

File Current assumption
packs/poketowork-kanban/claude/poketo-kanban/KANBAN-SETUP.mdBoard resolution docs may still reference legacy paths.
packs/poketowork-kanban/claude/poketo-kanban/SKILL.mdMigrated: now says "All operations go through the poketo CLI gateway."
packs/poketowork-kanban/codex/poketo-kanban/SKILL.mdMigrated: uses poketo kanban CLI.

Canonical Poketo Headless Path

The intended target path is:

  1. Agent presents a scoped API key to the gateway.
  2. Gateway validates the key and app scopes.
  3. Gateway resolves or constructs an authenticated server-side session for the owning user.
  4. Gateway invokes the Work adapter.
  5. Work adapter executes the canonical Work tools.
  6. Work tools call the tRPC routers through a server-side caller.
  7. tRPC routers enforce board permissions and write board_actions.

Relevant implementation files:

Supported auth mechanism

Primary mechanism:

Required scope model:

Reasoning:

Required env/config inputs

The codebase does not yet define the final skill-facing variable names. The following are recommended contract names for the migration:

Session resolution requirement behind the gateway

The missing server-side piece is not API-key validation itself. The missing piece is the bridge from:

to:

Step 2 or Step 3 must provide one of:

Fallback Policy For Existing ~/.poketo/config.json Setups

Fallback policy:

  1. Preferred path:
  1. Transitional path:
  1. Legacy fallback while migration is incomplete:
  1. End-state:

Practical implication:

Minimum Operation Surface Required Before Skill Migration

Before Claude or Codex kanban skills can migrate safely, the shared headless Work surface must support all of these operations with stable machine-readable results:

Required read operations

Required mutation operations

Response-shape guarantees needed by skills

The shared surface should guarantee at least:

What Already Exists Versus What Is Missing

Already present in the Poketo monorepo

Missing or incomplete for the migration

The current Work headless tool layer is not yet sufficient for kanban skill migration:

Recommendation For Phase 10 Sequencing

Step 2 should do

Step 3 should do

Step 4 and Step 5 should only start after that

Anything earlier would swap documented behavior before the shared headless surface is actually complete.

Final Recommendation

Recommended target:

Recommended fallback during rollout:

Definition of success for the migration: