--- name: rainforest-icon-generator description: Create or replace RainForest Navigator website icons as standardized 64×64 SVGs from a domain, URL, official SVG, or bitmap reference. Use for finding official brand symbols, fitting them into the RainForest template, and optionally applying them through RainForest MCP. --- # RainForest Icon Generator Produce a faithful, editable SVG icon for RainForest Navigator. Preserve the official brand mark; this workflow normalizes assets rather than redesigning brands. ## Required template Every result starts from this exact template: ```svg ``` The `64×64` canvas and base rectangle geometry are immutable. Keep the base `` as the first visual element. Its `fill` may change only when an official brand-color background or complete app-icon treatment clearly calls for it; otherwise keep `#E8EAED`. ## Non-negotiable rules - Prefer an official symbol, favicon, or app icon over a wordmark. - Use official-site assets before GitHub mirrors, icon libraries, search-result copies, or hand reconstruction. - When an official vector exists, preserve its paths and proportions. Remove only metadata, text/wordmark elements the user does not want, and presentation attributes that do not define the mark. - Do not redraw a logo from memory or substitute a generic related icon. - Do not embed PNG, JPEG, or WebP data in the final SVG. If only a bitmap exists, vectorize it faithfully when the artwork is suitable. If faithful vectorization is not possible, stop and request a better official asset or user guidance. - Never claim an icon was applied unless a write tool succeeded and a read-back confirms the target entry changed. ## Workflow ### 1. Resolve the target and capability Identify the canonical domain, exact product, and matching RainForest entry. Check whether the current environment can browse raw page assets, read SVG text, render/inspect files, and write through RainForest MCP. When using RainForest MCP, begin with `extension_get_icon_generation_guide` and retain the returned `skillDigest`. Every generated-icon write must pass that exact digest; if it is rejected as stale, read the guide again before continuing. If the user asked only to generate, do not mutate navigation data. If the user asked to apply the icon, resolve the exact entry UUID before writing; ask only when multiple entries remain ambiguous. ### 2. Acquire the official mark Inspect sources in this order: 1. inline SVG in the official site's rendered header/navigation; 2. official SVG favicon or Web App Manifest icon; 3. official brand, press, download, or design-system page; 4. official external SVG URL referenced by the site; 5. highest-resolution official bitmap, only after vector sources are exhausted. With RainForest MCP, use the built-in acquisition tools in this order: 1. call `inspect_website_icon_assets` on the official page; 2. call `fetch_public_resource_text` for a discovered SVG, manifest, XML, JSON, or HTML URL so `image/svg+xml` is returned as source text; 3. when the logo exists only after client rendering, call `extension_extract_rendered_page_assets` to inspect the browser's final DOM; 4. use the exact official asset URL returned by those tools as `sourceUrl`. A semantic webpage reader may omit DOM attributes, inline SVG paths, client-rendered content, or the body of an `image/svg+xml` response. An empty extraction does **not** prove that no SVG exists. Use raw-resource, rendered-DOM, browser-development, or HTTP-text capabilities when available. If an official SVG URL is confirmed but the available tools cannot read its XML: 1. provide that exact official URL; 2. explain that the tool cannot retrieve the SVG source; 3. ask the user to open it and paste the complete `...` source; 4. do not replace it with a PNG or approximate redraw. For source discovery, inspect the rendered official page near its home link, header, navigation, logo, and brand mark. When a URL ends in `.svg` or responds as `image/svg+xml`, retrieve its body as text rather than treating it as a raster image. Use an official organization repository only when the official site points to it or no first-party site asset exists. Record the source URL and whether it was inline SVG, linked SVG, or bitmap. ### 3. Prepare the mark For official SVG: - retain the original `path`, `circle`, `rect`, `polygon`, `polyline`, and gradient geometry; - remove framework-only attributes such as `class`, `aria-hidden`, and `data-*`; - remove wordmark/text portions only when the target is the standalone symbol; - replace `currentColor` only after choosing a contrast-safe official color treatment; - fit using a wrapper transform rather than editing path coordinates. For bitmap-only artwork: - use the largest official source; - trim blank margins and upscale only for inspection/tracing; - trace simple, flat artwork and compare it against the source; - never invent hidden detail; - do not output a bitmap embedded inside SVG. ### 4. Fit into RainForest Start with an approximately `40×40` visual area at `x=12`, `y=12`. Preserve aspect ratio and use optical centering. - square/full marks: about 38–40 px; - round or tall marks: about 40–42 px; - wide or triangular marks: about 42–44 px; - thin marks: up to about 44 px. Keep artwork inside the base region `3..61`. Do not stretch, add arbitrary shadows or outlines, or round the brand artwork itself. Color priority: 1. preserve a complete official app-icon treatment; 2. use an official brand-color base with a white mark when an official monochrome/inverse mark supports it; 3. retain multicolor artwork on the neutral `#E8EAED` base. ### 5. Validate before applying Confirm all of the following: - exact 64×64 root canvas; - base rectangle `x=3 y=3 width=58 height=58 rx=20` exists; - correct official source and product identity; - no wordmark remains when a symbol-only icon was requested; - proportions and original path geometry are preserved; - no clipping, external URLs, scripts, event handlers, or embedded bitmap data; - the icon remains legible at 64×64 and visually centered. Generate a 512×512 preview when the environment supports rendering. Do not claim visual verification if only structural validation was possible. ### 6. Apply and verify When authorized to update navigation: 1. for a new browser-extension entry, default to `extension_add_navigation_entry_with_icon` so the entry and compliant SVG are committed together; use bare `extension_add_navigation_entry` only when the user explicitly requests no generated icon; 2. for an existing entry, call `set_navigation_icon` for the online site or `extension_generate_navigation_icon` for browser-extension data; 3. send the exact UUID when applicable, complete SVG, stable filename, official `sourceUrl`, truthful `sourceRoute`, and current `skillDigest`; 4. read the entry again; 5. report success only if the write succeeded and `iconUrl` changed. If no compatible write tool is present, return the final SVG and exact target UUID without saying it was installed. ## Batch requests Process entries one at a time. For each entry, finish source verification, template fitting, validation, and optional write/read-back before moving to the next. Do not silently apply one guessed treatment across the whole batch. ## Reference SVGs Use these only as composition references. Do not copy their brand paths for a different website. Neutral-base example: ```svg ``` Official-brand-background example: ```svg ``` ## Response Keep the user-facing response concise. State: - which official source route was used; - whether the result was generated only or actually applied and verified; - any source limitation requiring user-supplied SVG code. Use one truthful route label: `官方矢量直接适配`, `官方位图矢量化`, or `等待官方 SVG 源码`.