improve-ut

Analyze changed files and improve unit test coverage in Go monorepos.

3|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/BaSui01/agentflow --skill improve-ut-basui01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-ut
Source: https://github.com/BaSui01/agentflow/tree/main/.agents/skills/improve-ut
Command: npx skills add https://github.com/BaSui01/agentflow --skill improve-ut-basui01

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces the risk of regressions and low test coverage after code changes by analyzing modified files and applying project-specific unit-test conventions located in .trellis/spec. It ensures tests follow existing patterns and that validation steps run consistently so maintainers can trust CI results.

Core Features & Use Cases

  • Spec-driven scope detection: Reads .trellis/spec unit-test layers to decide unit vs integration vs regression scope and whether to use mocks or real filesystem flows.
  • Automated test updates: Adds or updates tests following repository test patterns, mock strategies, and integration patterns to preserve consistency.
  • Validation and reporting: Executes project validation commands and summarizes lint, typecheck, and test outcomes along with remaining test gaps.
  • Use Case: After implementing a new feature or fixing a bug in a Go monorepo, run this Skill to discover affected packages, generate or adjust tests per spec, and validate before merging.

Quick Start

Run the improve-ut skill to analyze changed files, update or add tests per .trellis/spec conventions, and validate changes with pnpm lint, pnpm typecheck, and pnpm test.

Frequently Asked Questions about improve-ut

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve unit test coverage automatically after code changes in a monorepo?

To improve unit test coverage after code changes, you can run a spec-driven automation tool that analyzes modified files and updates tests based on project conventions. This Skill reads .trellis/spec layers to add or adjust tests and validate changes using pnpm.

What is spec-driven testing scope detection for Go projects?

Spec-driven testing scope detection reads .trellis/spec unit-test layers to decide whether to apply unit, integration, or regression tests. It determines if tests should use mocks or real filesystem flows based on your project specifications after code changes.

How do I generate unit tests that follow existing repository patterns?

You can generate unit tests following existing repository patterns by analyzing changed files and applying project-specific conventions. This Skill discovers spec files and updates tests to preserve consistency with your repository's mock strategies and integration patterns.

Can I use pnpm to validate lint, typecheck, and test outcomes for Go projects?

Yes, this Skill executes pnpm lint, pnpm typecheck, and pnpm test to validate changes. It produces a structured summary of lint, typecheck, and test outcomes along with any remaining test gaps for your monorepo or Go project.

Does this automated unit test generation work without existing spec files?

No, this Skill requires existing .trellis/spec unit-test layers to function. It relies on these spec files to discover testing conventions, decide test scope, and determine whether to use mocks or real filesystem flows for your project.

Why does my unit test coverage drop after feature work or bug fixes?

Unit test coverage drops after feature work or bug fixes when modified files lack corresponding test updates. This Skill mitigates regression risks by analyzing changed files and automatically adding or adjusting tests per your .trellis/spec conventions.