---
name: migrating-legacy-web-templates-into-modern-components
description: "Converts legacy server-rendered templates and scripts into modular front-end components, drafting a structural plan before generating files. Use when modernizing a codebase and needing reusable components with clean semantics and consistent styling."
license: CC-BY-4.0
compatibility: "Needs access to: Chat, GitHub, Terminal."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/migrating-legacy-web-templates-into-modern-components/"
  kind: workflow
  hermes:
    tags: ["refactoring", "frontend", "migration", "templates"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Migrating legacy web templates into modern components

Convert server-rendered markup into modular front-end components following strict architectural rules

## When to use

Accelerate codebase modernization by translating legacy templates and scripts into clean, reusable component hierarchies. The bot outlines component architecture, cleans redundant nesting, updates styling conventions, and drafts matching component definitions for manual engineering review.

## Inputs

- `legacy_template`: The server-rendered template or script markup to be converted into modern components.
- `style_guidelines`: Target styling and architectural conventions the new components must follow.

## Steps

1. When you ask: Submit template and style guidelines (A person submits a legacy template and target styling guidelines in chat.)
2. Draft component breakdown plan
3. Display refactored component files

## Instructions

Analyze the submitted legacy template and the provided target styling guidelines. Before generating any component files, provide a structural plan breaking the markup into semantic, reusable components. Wait for user confirmation on the plan. Once approved, write the refactored component definitions, applying semantic tags and modular styles. Run local formatting checks via terminal if configured. Do not commit or push changes to the repository without explicit approval.

## Approvals

- Confirm the structural component breakdown plan before any component files are generated.
- Approve committing or pushing changes to the repository before any such action.

## Output

Refactored component files with semantic tags and modular styles, displayed for review before any repository changes. (format: file)

## Source

Summarized in our own words from [Ask HN: How can I get better at using AI for programming?](https://news.ycombinator.com/item?id=46255285) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/migrating-legacy-web-templates-into-modern-components/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
