Website Style Analyzer
Run preflight first, then initialize the output directory from invocation parameters (directory setup and artifact reset only, no template copying), and finally execute the analysis workflow with built-in templates.
Required Capabilities
- Browser MCP capability (page navigation, snapshots, DOM/CSS inspection)
- Network access to the target website
- File write permission for the output directory
- Node.js runtime
Invocation Contract (Required)
When the user uses this skill, you need to extract the corresponding parameters based on the information provided by the user. The format requirements for the corresponding parameters are as follows:
Accept only the following format:
Use $website-style-analyzer with:
target_url: <https://example.com>
max_pages: <30>
include_subdomains: <true>
theme: <light>
overwrite: <false>
report_mode: <final_only>
Optional parameter (provide only when overriding the default):
output_dir: <./custom-output-dir>
Rules:
- Read only these keys:
target_url, output_dir, max_pages, include_subdomains, theme, overwrite, report_mode
- Required key:
target_url
- Optional key defaults:
output_dir: ./style-guide
max_pages: 30
include_subdomains: true
theme: light
overwrite: false
report_mode: final_only
- Ignore unknown keys
- Do not start analysis if parameters are invalid
Parameter Validation Rules
target_url: must be an absolute http/https URL
output_dir: if provided, must be a non-empty path string
max_pages: must be an integer greater than 0
include_subdomains: true or false
theme: light, dark, or both
overwrite: true or false
report_mode: final_only or incremental
- When
output_dir already exists and is non-empty, overwrite must be true
If validation fails:
- Stop immediately
- Return exactly:
Invalid invocation parameters:
- <field>: <reason>
Please resend using the invocation template.
Preflight Checks
All checks below must pass before analysis:
- Browser MCP is available
- Target URL is reachable
- Output directory is writable (default
./style-guide; if missing, it must be creatable)
If any check fails, stop and report failed checks with reasons.
Input Parameters
target_url (required): root URL of the target site
output_dir (optional, default ./style-guide): output directory
max_pages (optional, default 30): max pages to analyze
include_subdomains (optional, default true): whether to include official subdomains
theme (optional, default light): light / dark / both
Initialization Command
node scripts/init-output.mjs --target-url "<target_url>" [--output-dir "<output_dir>"] --max-pages <max_pages> --include-subdomains <include_subdomains> --theme <theme>
If overwrite is true, append --overwrite.
Initialization behavior:
- If
output_dir does not exist: create output_dir and components/.
- If
output_dir exists and is non-empty with overwrite=false: fail initialization and ask for retry.
- If
output_dir exists with overwrite=true: reset known analysis artifacts (brand-tokens.md, tokens.json, page-inventory.md, components/), then recreate components/.
- Never copy template files from
assets into the output directory.
Output Strategy
Control chat output using report_mode:
final_only (default):
- Run silently while writing files
- Output one final summary at completion
incremental:
- Output concise progress only at milestones
- Format:
Progress <done_pages>/<max_pages> | updated files: <paths> | new findings: <1-3 bullets>
Always enforce:
- Do not dump full template files or full result files in chat
- Do not echo large placeholder-heavy boilerplate blocks
- Unless explicitly requested, return only paths and brief change summaries
Execution Workflow
- Parse invocation parameters and apply defaults
- Validate all parameters; stop on failure
- Configure output behavior based on
report_mode
- Run preflight checks
- Initialize with validated parameters
- Read
assets/task.md and use it as the execution baseline
- Analyze page by page and continuously update
<output_dir>/page-inventory.md
- Keep global tokens as
draft during collection, then switch to final after consolidation
- Use
assets/component.md as the component template spec and write each component to <output_dir>/components/{component}.md
- Complete final consolidation and consistency checks
Mandatory Constraints
- Incrementally update only designated result files; do not create parallel duplicates
- Do not finalize tokens before component consolidation is complete
- Do not start formal analysis before preflight passes
- Do not guess missing parameters from ambiguous context
- Do not fabricate components, states, or style values to satisfy coverage; mark non-applicable items as
N/A with rationale
- Do not output full template body unless explicitly requested
- Do not copy
assets or any template file verbatim into output
- Component files must follow the common structure defined in
assets/component.md
1---2name: website-style-analyzer3description: Analyze public website visual styles, primary color systems, and reusable components, then output structured style artifacts in a target directory. Use for competitor style analysis, design token extraction, component style documentation, and AI coding style references.4---56# Website Style Analyzer78Run preflight first, then initialize the output directory from invocation parameters (directory setup and artifact reset only, no template copying), and finally execute the analysis workflow with built-in templates.910## Required Capabilities1112- Browser MCP capability (page navigation, snapshots, DOM/CSS inspection)13- Network access to the target website14- File write permission for the output directory15- Node.js runtime1617## Invocation Contract (Required)1819When the user uses this skill, you need to extract the corresponding parameters based on the information provided by the user. The format requirements for the corresponding parameters are as follows:2021Accept only the following format:2223```text24Use $website-style-analyzer with:25target_url: <https://example.com>26max_pages: <30>27include_subdomains: <true>28theme: <light>29overwrite: <false>30report_mode: <final_only>31```3233Optional parameter (provide only when overriding the default):3435```text36output_dir: <./custom-output-dir>37```3839Rules:4041- Read only these keys: `target_url`, `output_dir`, `max_pages`, `include_subdomains`, `theme`, `overwrite`, `report_mode`42- Required key: `target_url`43- Optional key defaults:44 - `output_dir`: `./style-guide`45 - `max_pages`: `30`46 - `include_subdomains`: `true`47 - `theme`: `light`48 - `overwrite`: `false`49 - `report_mode`: `final_only`50- Ignore unknown keys51- Do not start analysis if parameters are invalid5253## Parameter Validation Rules5455- `target_url`: must be an absolute `http`/`https` URL56- `output_dir`: if provided, must be a non-empty path string57- `max_pages`: must be an integer greater than `0`58- `include_subdomains`: `true` or `false`59- `theme`: `light`, `dark`, or `both`60- `overwrite`: `true` or `false`61- `report_mode`: `final_only` or `incremental`62- When `output_dir` already exists and is non-empty, `overwrite` must be `true`6364If validation fails:65661. Stop immediately672. Return exactly:6869```text70Invalid invocation parameters:71- <field>: <reason>72Please resend using the invocation template.73```7475## Preflight Checks7677All checks below must pass before analysis:78791. Browser MCP is available802. Target URL is reachable813. Output directory is writable (default `./style-guide`; if missing, it must be creatable)8283If any check fails, stop and report failed checks with reasons.8485## Input Parameters8687- `target_url` (required): root URL of the target site88- `output_dir` (optional, default `./style-guide`): output directory89- `max_pages` (optional, default `30`): max pages to analyze90- `include_subdomains` (optional, default `true`): whether to include official subdomains91- `theme` (optional, default `light`): `light` / `dark` / `both`9293## Initialization Command9495```bash96node scripts/init-output.mjs --target-url "<target_url>" [--output-dir "<output_dir>"] --max-pages <max_pages> --include-subdomains <include_subdomains> --theme <theme>97```9899If `overwrite` is `true`, append `--overwrite`.100101Initialization behavior:102103- If `output_dir` does not exist: create `output_dir` and `components/`.104- If `output_dir` exists and is non-empty with `overwrite=false`: fail initialization and ask for retry.105- If `output_dir` exists with `overwrite=true`: reset known analysis artifacts (`brand-tokens.md`, `tokens.json`, `page-inventory.md`, `components/`), then recreate `components/`.106- Never copy template files from `assets` into the output directory.107108## Output Strategy109110Control chat output using `report_mode`:111112- `final_only` (default):113 - Run silently while writing files114 - Output one final summary at completion115- `incremental`:116 - Output concise progress only at milestones117 - Format: `Progress <done_pages>/<max_pages> | updated files: <paths> | new findings: <1-3 bullets>`118119Always enforce:120121- Do not dump full template files or full result files in chat122- Do not echo large placeholder-heavy boilerplate blocks123- Unless explicitly requested, return only paths and brief change summaries124125## Execution Workflow1261271. Parse invocation parameters and apply defaults1282. Validate all parameters; stop on failure1293. Configure output behavior based on `report_mode`1304. Run preflight checks1315. Initialize with validated parameters1326. Read `assets/task.md` and use it as the execution baseline1337. Analyze page by page and continuously update `<output_dir>/page-inventory.md`1348. Keep global tokens as `draft` during collection, then switch to `final` after consolidation1359. Use `assets/component.md` as the component template spec and write each component to `<output_dir>/components/{component}.md`13610. Complete final consolidation and consistency checks137138## Mandatory Constraints139140- Incrementally update only designated result files; do not create parallel duplicates141- Do not finalize tokens before component consolidation is complete142- Do not start formal analysis before preflight passes143- Do not guess missing parameters from ambiguous context144- Do not fabricate components, states, or style values to satisfy coverage; mark non-applicable items as `N/A` with rationale145- Do not output full template body unless explicitly requested146- Do not copy `assets` or any template file verbatim into output147- Component files must follow the common structure defined in `assets/component.md`