Document the provider generator's provider kit output

JA
5d ago
+199-294

Summary

Provider kit Track B, B6 follow-up: docs/api/rails_provider_generator.md described the pre-kit output of rails g provider:family (models on ApplicationRecord with their own syncer and unlinking, a hand-built single-form panel, a full CRUD controller, a hand-written route block). It now describes what the generator writes after B6a–B6d. Docs only.

Part of jaysbeekay/sure#670 (Track B, step 6). Stacked on B6d (jaysbeekay/sure#757) in fork stack #687.

Upstream draft PR: https://github.com/we-promise/sure/pull/5267 (same branch, same commit), in native stack we-promise/sure#5268 on refactor/provider-kit.

What the guide now says

  • Models: <Key>Item < ProviderItem (syncing through ProviderItem::Syncer, unlinking through ProviderItem::Unlinking), with import_latest_<key>_data(sync_start_date:) and the with_credentials scope; <Key>Account < ProviderAccount, with name_for, currency_for and default_accountable_attributes.
  • Account flow: the six hooks of the generated <Key>Item::AccountFlow, .cache_sensitive_params generated from the declared fields (read on every edit) and the other five each a NotImplementedError stub with a TODO.
  • Adapter: the declares_connection with settings_page / settings_panel lists, and build_provider raising until implemented.
  • Views: a table of the generated views and the kit component each renders; the panel's list shape and setup_steps slot; the _credential_fields hook (secrets rendered with value: nil, the blank-keeps-it placeholder; written even with --skip-view); the <Key>ItemsHelper.
  • Controller and routes: the thin ProviderItemsController subclass with its blank-secret drop on edit; the one resources … concerns: :provider_items line inserted after the concern, or printed when the concern is missing.
  • What the kit replaced: the deleted syncer and unlinking templates, and what a generated provider no longer gets (investment trade/holding stats, the auth-error status flip, unlink_all!'s disposition:).
  • Customization: implement the SDK and build_provider, then the account flow, then model and view tweaks.
  • The MyBank example passes --type=banking, so the snippets (kinds: %w[Bank]) match what the generator writes; --type is documented in one line.

Every snippet and statement was checked against the templates and family_generator.rb at b5f1c11ae, and against ProviderItem, ProviderAccount, ProviderItem::AccountFlow, ProviderItemsController, ProviderItem::PanelComponent and the provider_items route concern.

Left as they were (not kit changes)

  • The migration section already differs from migration.rb.tt (class name, indexes, account columns) before this stack; the kit did not touch the migration.
  • The generator's own header comment still says "Manual panel view", and its summary points at docs/PER_FAMILY_PROVIDER_GUIDE.md, which does not exist. Both are code, outside a docs slice.
  • The provider:global sections.

Screenshots

None: docs only.

Demo data

No demo data needed.

Migration notes

No migration.

Verification

Docs only: no code or test change, so no test run. Size: +182 / -295 in one file.

  • The earlier merge-down commits' subjects ("Merge up/... into up/...") exceed 72 characters. They stay fork-only: Track B is rebased linear when it goes upstream, as Track A was, so they never reach we-promise/sure.
  • Checked against upstream AGENTS.md (blob 1a5dbebd, 2026-11-17): no deviations.