---
name: rebuilding-legacy-libraries-against-test-suites
description: "Ports legacy libraries to modern languages by iteratively implementing API modules and running existing test suites until they pass cleanly. Use when rebuilding an outdated dependency or migrating a critical library."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/rebuilding-legacy-libraries-against-test-suites/"
  kind: skill
  hermes:
    tags: ["migration", "testing", "refactoring", "code-generation"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Rebuilding legacy libraries against test suites

Port legacy codebases to modern languages by iteratively running and passing existing test suites

## When to use

When maintaining outdated dependencies or migrating critical libraries to safer languages, an automated coding agent can systematically reimplement components while verifying behavior against existing test suites and conformance benchmarks.

## Inputs

- `target_specification`: Specification for the library being rebuilt, used to identify the API functions and modules to implement
- `existing_test_suites`: Test suites and conformance benchmarks in the local repository that the reimplemented modules must pass
- `local_repository`: Local repository containing the target specification and test suites to inspect and work in

## Steps

1. When you ask: Start library porting task (The person asks the agent in chat to start porting a legacy library against its test suites)
2. Iterate code against test runner
3. Review passing test report

## Instructions

Inspect the target specification and existing test suites in the local repository. Implement missing API functions module by module, executing the test runner in the terminal after each iteration. Refactor and fix failing tests until the entire test suite passes cleanly. Always ask for user approval before pushing branches, committing changes, or deleting legacy files.

## Approvals

- Ask for user approval before pushing branches
- Ask for user approval before committing changes
- Ask for user approval before deleting legacy files

## Output

Report of the test suite run showing passing tests after the library modules were implemented and fixed (format: markdown)

## Source

Summarized in our own words from [Show HN: Xmloxide – an agent-made Rust replacement for libxml2](https://news.ycombinator.com/item?id=47201816) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/rebuilding-legacy-libraries-against-test-suites/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
