Skip to content

doc(design): plan the website template deep-link flow#5422

Draft
mmabrouk wants to merge 1 commit into
mainfrom
plan/website-templates-deeplink
Draft

doc(design): plan the website template deep-link flow#5422
mmabrouk wants to merge 1 commit into
mainfrom
plan/website-templates-deeplink

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

What this is

This is a design-only pull request. It adds a planning document and nothing else. No product code changes, no backend, no API. It is waiting for Mahmoud's review and a decision on four questions before anyone builds it.

The problem it plans for

The marketing website (the new website/ Astro project) shows agent template cards. Every "Use this template" button links to the bare address https://cloud.agenta.ai/, so when a visitor clicks one, the app opens on its normal home page and has no idea which template the visitor picked. We want the click to carry the choice into the app, survive signup if the visitor has no account, and end with the app creating an agent from that template's prompt. Later this grows into a template marketplace.

What the plan proposes

Version 1 is frontend only. The website adds a template key to each card's link (?template=<key>). The app captures that key on arrival into local storage, reusing the exact technique the existing workspace-invite flow uses to survive a full signup, and then creates the agent once the user has a workspace and a project. It deliberately does not use the app's redirectToPath parameter, which looks built for this but is captured and then discarded.

One repo fact shapes the whole design. A brand-new user who just signed up does not land on the agent home page. By default the app sends first-time users to a native onboarding playground instead. So the plan consumes the template at whichever first-run surface the user actually reaches, not on a single page.

The decisions it asks for

  1. Which list of templates is the source of truth for keys. The plan recommends the app's existing 28-template registry for version 1, with the backend catalog as the version 2 home.
  2. After signup, run the prompt on arrival or show it behind a Start button. The plan recommends showing it behind a Start button for website arrivals, matching what most in-app paths already do.
  3. Cloud only, or self-hosted too, in version 1. The plan recommends cloud only, with an optional copy-the-prompt action for self-hosters.
  4. Where the app consumes the template. The plan recommends a shared consume read by each first-run surface, gated on a confirmed workspace and project and claimed so it fires at most once, kept out of the post-login routing.

How to read it

  • docs/design/website-templates-deeplink/README.md is the index and glossary. Start here.
  • docs/design/website-templates-deeplink/plan.md is the full plan: current state, work in flight next to it, the four decisions with a reason for each, a tightly scoped version 1, an out-of-scope version 2 direction, a step-by-step build outline with file paths, the edge cases the consume step must handle, and a test plan.

Notes

The plan was reviewed independently by Codex at high reasoning before this pull request. That review corrected the landing-surface behavior for new users and added the readiness, idempotency, region-redirect, and continuous-integration requirements now in the plan.

This is design only. Please do not merge to ship code. Merge only signals the plan is approved.

https://claude.ai/code/session_013Qe1Vf2yvj33BVd5W1q7HB

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 20, 2026 7:09pm

Request Review

@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fe470c31-f292-4adf-8e74-9f1b1ec9c8a9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

A new design proposal documents a frontend-only v1 flow for preserving website template selections through authentication and consuming them in the appropriate cloud app first-run surface. It defines scope, edge cases, implementation steps, analytics, and test coverage.

Changes

Website template deep-link

Layer / File(s) Summary
Proposal scope and terminology
docs/design/website-templates-deeplink/README.md, docs/design/website-templates-deeplink/plan.md
Defines the proposed deep-link concept, terminology, current website behavior, onboarding routes, related work, and the rejected redirectToPath approach.
Capture, consumption, and validation plan
docs/design/website-templates-deeplink/plan.md
Specifies URL/localStorage capture, first-run consumption, workspace and project gating, at-most-once claiming, scope boundaries, implementation steps, analytics, and unit/e2e tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: planning the website template deep-link flow.
Description check ✅ Passed The description matches the changeset and accurately explains the new design-only documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plan/website-templates-deeplink

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c98fb80f-8ac7-43cb-90d4-c3c8277b3e42

📥 Commits

Reviewing files that changed from the base of the PR and between 3588f13 and 9ff3a72.

📒 Files selected for processing (2)
  • docs/design/website-templates-deeplink/README.md
  • docs/design/website-templates-deeplink/plan.md

Comment thread docs/design/website-templates-deeplink/plan.md
Comment thread docs/design/website-templates-deeplink/plan.md Outdated
Comment thread docs/design/website-templates-deeplink/plan.md Outdated
Comment thread docs/design/website-templates-deeplink/plan.md Outdated
Each decision lists the options and the reason for the recommendation. These are the only real
choices in version 1; the rest is careful wiring.

### Decision 1: which list of templates is the source of truth for keys

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's simply go with the one that exists right now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Recorded as decided in Decision 1: the existing app registry (templates.ts) is the source of truth for keys in version 1, with no backend catalog work. See the "Decided:" line at the top of Decision 1.

run before it runs, and a brand-new account does not spend model tokens before the person has
done anything.

Recommendation: for visitors arriving from the website, show the prompt behind a Start button and

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Recorded as decided in Decision 2: website arrivals show the prompt behind a Start button, staged through the non-auto-send first-run seed state, which is what most in-app template paths already do.

backend work this version is not doing.

Recommendation: cloud only for version 1. If we want to help self-hosters, the honest option today
is a visible "copy the prompt" action on the website card, because the website currently only

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All right, let's do it in the cloud only for the moment, since this is not the marketplace yet. Let's just make sure we think about how we would do it outside of the cloud, right? Self-housing in the future, so that the architecture would allow that at some point, but let's not add copy, the promoter, or anything. Just get started, recall how today

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Recorded as decided in Decision 3: cloud only, and I removed the copy-the-prompt affordance entirely. I added a "How self-hosted would slot in later" note: the design keeps the key as the only value crossing the boundary and keeps the consume path reading a template source by key, so the version 2 backend "get template by key" endpoint lets a self-hosted path slot in without undoing any version 1 decision.

screen that creates the agent from the template and then lands them in the playground, skipping
the normal onboarding for that one case.

Recommendation: the shared-consume approach, because it reuses each surface's existing

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm honestly alright with both solutions. Just make sure it's something that the staff engineer won't criticize. It's kind of built using best practices, and obviously also take into account reusing stuff if there is something already there. Reusing it also makes sense, and finally take into account the fact that you have U.S. and E.U. clouds, so that should work in both cases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Recorded as decided in Decision 4: shared-consume. The section now spells out the staff-engineer rationale (maximal reuse of each surface existing useCreateAgent path, and it keeps template logic out of the post-login routing) and the United States and European cloud reasoning: the pending key lives in localStorage and the region redirect preserves the query string, so capture re-runs on the regional host and the consume happens where the user actually lands. It reuses the existing invite-flow technique rather than inventing a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant