Prompt: spec-kitty Team
Use this file as the input to /spec-kitty.specify in the spec-kitty repo.
Prompt
Architect and implement the spec-kitty CLI side of the accepted ADR
2026-04-04-1-tracker-binding-context-is-discovered-not-user-supplied.md.
Problem:
The current SaaS-backed tracker bind flow still asks for --project-slug and
stores only provider + project_slug locally. That is the wrong local binding
primitive. For SaaS-backed providers, the CLI should derive local project
identity, ask the host control plane for existing mapping or bind candidates,
and persist a stable binding reference rather than asking the user for raw
tracker-native metadata or relying only on project_slug.
Scope this feature to the spec-kitty repo only.
Required behavior:
spec-kitty tracker bind --provider <saas-provider>should no longer require manual raw tracker metadata in the normal path.- The CLI should derive local project identity from the repo and existing
.kittifyproject data. - The CLI should call new or expanded SaaS APIs to:
- inspect installation-wide tracker state before a local bind exists,
- resolve local project identity to existing mapping candidates or bindable resource candidates,
- persist the binding returned by the host.
- If there is exactly one confident candidate, bind automatically.
- If there are multiple candidates, present human-labeled choices instead of asking for raw keys, prefixes, repo names, or IDs.
- Local tracker config should evolve to store a stable binding reference plus
optional cached display metadata. Backward compatibility with existing
project_slug-based config must be preserved. tracker statusand tracker mapping-inspection flows should support installation-wide introspection where the SaaS API allows it, instead of assuming a pre-existing local bind.
Relevant current code:
src/specify_cli/cli/commands/tracker.pysrc/specify_cli/tracker/saas_client.pysrc/specify_cli/tracker/saas_service.pysrc/specify_cli/tracker/config.pysrc/specify_cli/sync/project_identity.py
Non-goals:
- Do not implement provider discovery logic locally; that belongs in
spec-kitty-trackerandspec-kitty-saas. - Do not design a bespoke bind UX per provider.
- Do not reintroduce direct provider credentials for SaaS-backed providers.
Acceptance criteria:
- A normal SaaS-backed bind can complete without the user typing a tracker prefix, project key, repo path, or numeric external resource ID.
- The config model has a migration or compatibility strategy for older local tracker bindings.
- The CLI can represent zero, one, or many host-returned bind candidates cleanly.
- Tests cover auto-bind, ambiguous selection, no-candidate, and backward compatibility cases.
- The final design remains aligned with the accepted ADR and the existing host-owned tracker persistence boundary.