From 9376154cb59c9b0adaee66a0ab28046bb1e05ef5 Mon Sep 17 00:00:00 2001 From: Hampton Lintorn-Catlin Date: Mon, 18 May 2026 15:30:34 -0500 Subject: [PATCH] Extract landing-page agents section into a swappable partial (COPLAN-3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Built for any AI agent" section on the landing page is the one piece hosts most often want to customize: generic CoPlan tells users to read /agent-instructions, but a deployment like coplan-square wants to tell its users to run `sq agents skills add coplan` instead. Rather than make hosts fork the entire landing page just to change that paragraph (which is what `landing_page_partial` would force them to do), expose a single config knob for just this section. - Extract the agents section into _default_agents.html.erb - Add CoPlan.configuration.landing_agents_partial, defaulting to it - _default_landing.html.erb renders via the configured partial - Add request specs for the default and the override path, asserting the rest of the landing page stays unchanged when only this section is swapped Behavior is unchanged by default — the engine renders the same agents paragraph it did before. Host-side change to actually use this hook will ship in coplan-square in a follow-up. Stacked on top of #113 (which introduced the landing page). Amp-Thread-ID: https://ampcode.com/threads/T-019e22e9-1c86-71bc-a076-f5e6d06b03d0 Co-authored-by: Amp --- .../coplan/welcome/_default_agents.html.erb | 9 ++++ .../coplan/welcome/_default_landing.html.erb | 16 +++---- engine/lib/coplan/configuration.rb | 14 ++++++ spec/requests/welcome_spec.rb | 46 +++++++++++++++++++ 4 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 engine/app/views/coplan/welcome/_default_agents.html.erb diff --git a/engine/app/views/coplan/welcome/_default_agents.html.erb b/engine/app/views/coplan/welcome/_default_agents.html.erb new file mode 100644 index 0000000..6cb4be2 --- /dev/null +++ b/engine/app/views/coplan/welcome/_default_agents.html.erb @@ -0,0 +1,9 @@ +
+

Built for any AI agent

+

+ CoPlan exposes a self-describing REST API at + <%= link_to "/agent-instructions", agent_instructions_path, class: "landing__inline-link" %>. + Point any AI agent — Amp, Claude Code, Cursor, your own — at it and it can create plans, + apply edits, and leave review comments on your behalf. +

+
diff --git a/engine/app/views/coplan/welcome/_default_landing.html.erb b/engine/app/views/coplan/welcome/_default_landing.html.erb index 6e9dd36..c0a1619 100644 --- a/engine/app/views/coplan/welcome/_default_landing.html.erb +++ b/engine/app/views/coplan/welcome/_default_landing.html.erb @@ -51,15 +51,13 @@ -
-

Built for any AI agent

-

- CoPlan exposes a self-describing REST API at - <%= link_to "/agent-instructions", agent_instructions_path, class: "landing__inline-link" %>. - Point any AI agent — Amp, Claude Code, Cursor, your own — at it and it can create plans, - apply edits, and leave review comments on your behalf. -

-
+ <%# The agents section is the one piece of the landing page hosts most often + need to customize — generic CoPlan points at /agent-instructions, while + a deployment like coplan-square wants to tell its users to run + `sq agents skills add coplan` instead. Renders via configuration so a + host can swap this single section without forking the whole landing + page. See `CoPlan.configuration.landing_agents_partial`. %> + <%= render CoPlan.configuration.landing_agents_partial %> <% if signed_in? %>