Skip to content
Back to skills

Migrate Tests

ASecurity

Write the target repo's .agents.json tests section (layout, harness, case markers) from what its tests/ already holds, and commit it.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 25, 2026
ai-agentsgobashnodegit

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add nirecom/agents --skill migrate-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Migrate Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Migrate Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nirecom-migrate-tests/badge)](https://www.skillsdirectory.com/skills/nirecom-migrate-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: migrate-tests
description: Write the target repo's .agents.json tests section (layout, harness, case markers) from what its tests/ already holds, and commit it.
user-invocable: true
---

Records how the target repo's tests are laid out, so the test gates and `tests/run-all.sh` can run there.

## Inputs

- `ROOT`: the target repo's checkout root. `/migrate` passes it; run directly, use `git rev-parse --show-toplevel` of the CWD.
- `--no-push`: forwarded to the commit.
- `--dry-run`: run MTS-1 and MTS-2, show the section MTS-3 would write, and skip MTS-3; nothing is written or committed.

## Procedure

MTS-1. Run `node "$AGENTS_MAIN_ROOT/skills/migrate-tests/scripts/needs.js" --root "<ROOT>"`; exit 0 means the tests section is already valid — report done and end.
MTS-2. Run `node "$AGENTS_MAIN_ROOT/skills/migrate-tests/scripts/detect.js" --root "<ROOT>"`, read its JSON proposal and confirm through AskUserQuestion (`metadata.source=migrate-tests.proposal-confirm`): `categorization` among `candidates` (first one recommended) with its `categories` / `supportDirs` from `sections[<choice>]`, then `testHarness` / `caseMarker` as proposed (off whenever an existing test does not source the agents harness).
   When `uncoveredTests` is non-empty, show each path to the user and say the current tests section cannot cover it.
MTS-3. Run `bash "$AGENTS_MAIN_ROOT/skills/migrate-tests/scripts/apply-section.sh" "<ROOT>" '<json>'` (plus `--no-push`), where `<json>` is `sections[<choice>]` with the confirmed answers applied; then report the written section and the commit to the user.
   Exit 3 means the settings file is not JSON or does not hold an object: confirm through AskUserQuestion (`metadata.source=migrate-tests.reset-malformed`; "Reset, keeping the original as `.agents.json.malformed`" / "Stop"); on reset, run `node "$AGENTS_MAIN_ROOT/bin/repo-settings" --root "<ROOT>" --reset-malformed`, then re-run the same write.
   Any other non-zero exit: show the error and stop.

## Rules

- Never write the section without the MTS-2 confirmation.
- Schema and state meanings: `docs/architecture/claude-code/repo-settings-file.md`.

Files in this skill

  • SKILL.md2.1 KB
  • scripts/apply-section.sh1.4 KB
  • scripts/detect.js5.5 KB
  • scripts/needs.js751 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.