Repository navigation
feat(content): recommend several assets per opportunity - #940
Merged
Merged
Conversation
An opportunity was one piece of content. Some needs take more: the main page plus a comparison page, a glossary entry, a third-party article or a backlink (#857, Phase 2). - The generation call names the primary content's type and adds up to 3 supporting assets only when the data calls for them, each with its own type, channel, decision and pages. - buildAssets resolves each asset on its own: earned assets are always new and carry no page, and unknown types, repeats of the same work and anything past the cap are dropped. - Assets are kept in source_data.assets with stable keys, and survive merges like the decision does. - The detail page shows a Recommended Assets card when an opportunity has more than its primary asset.
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third PR of Phase 2 in #857. An opportunity was one piece of content. Some needs take more than one: the main page plus a comparison page, a glossary entry, a third-party article or a backlink. Opportunities can now recommend several assets. Sending an opportunity or one of its assets to the Action Center is the next PR.
Generation
blog_post,pillar_guide,landing_page,comparison_page,glossary_page,faq_page,product_page,category_pagethird_party_article,backlinkIt adds up to 3 supporting assets, only when the data calls for them. The prompt gives four examples:
It also says most opportunities need none or one.
Each asset has its own type, channel, decision, short title and target pages.
buildAssets(lib/page-matching.js)resolveDecision.createand carry no page.a1,a2, …). The next PR uses it to send a single asset to the Action Center.Storage and UI
source_data.assets, primary first. The primary asset's decision and pages are still the opportunity'sdecisionandtargetPages, so the brief and the Your Site card are unchanged.Results on the main test brand
Known limitation: candidate pages are chosen per cluster, not per asset. The glossary asset above was linked to the GEO guide rather than the site's "What is AEO / GEO" glossary entries, because those were not among the cluster's 8 candidates. A per-asset candidate search can come later.
Related issue
Part of #857 (Phase 2)
Type of change
feat— New featuretest— Adding or updating testsHow to test
page-matching.test.jscoversbuildAssets: per-asset decisions, earned assets, and dropping unknown types, repeats and anything past the cap.Checklist
yarn lint,yarn typecheck,yarn format:check,yarn test(407) andyarn buildpass (run fromweb/)yarn lint,yarn format:checkandyarn test(978) pass (run fromserver/)🤖 Generated with Claude Code