Agent skill

improve-ut

Analyzes changed files and improves unit test coverage using project-specific testing conventions from .trellis/spec/ unit-test specs. Determines test scope (unit vs integration vs regression), adds or updates tests following existing patterns, and runs validation. Use when code changes need test coverage, after implementing a feature, after fixing a bug, or when test gaps are identified.

Stars 5,124
Forks 287

Install this agent skill to your Project

npx add-skill https://github.com/mindfold-ai/Trellis/tree/main/packages/cli/src/templates/codex/skills/improve-ut

SKILL.md

Improve Unit Tests (UT)

Use this skill to improve test coverage after code changes.

Usage

text
$improve-ut

Source of Truth

Discover and read unit-test specs dynamically:

bash
# Discover available packages and their spec layers
python3 ./.trellis/scripts/get_context.py --mode packages

Look for packages with unit-test spec layer in the output. For each discovered unit-test/ directory, read all relevant spec files inside it (for example index.md, conventions.md, integration-patterns.md, mock-strategies.md).

If this skill conflicts with the unit-test specs, the specs win.


Execution Flow

  1. Inspect changed files:
    • git diff --name-only
  2. Decide test scope using unit-test specs:
    • unit vs integration vs regression
    • mock vs real filesystem flow
  3. Add/update tests using existing project test patterns
  4. Run validation:
bash
pnpm lint
pnpm typecheck
pnpm test
  1. Summarize decisions, updates, and remaining test gaps.

Output Format

markdown
## UT Coverage Plan
- Changed areas: ...
- Test scope (unit/integration/regression): ...

## Test Updates
- Added: ...
- Updated: ...

## Validation
- pnpm lint: pass/fail
- pnpm typecheck: pass/fail
- pnpm test: pass/fail

## Gaps / Follow-ups
- <none or explicit rationale>

Expand your agent's capabilities with these related and highly-rated skills.

mindfold-ai/Trellis

create-command

Scaffolds a new skill file with proper naming conventions and structure. Analyzes requirements to determine skill type and generates appropriate content. Use when adding a new developer workflow skill, creating a custom skill, or extending the Trellis skill set.

5,124 287
Explore
mindfold-ai/Trellis

finish-work

Pre-commit quality checklist covering lint, typecheck, tests, code-spec sync, API changes, database migrations, cross-layer verification, and manual testing. Blocks commit if infra or cross-layer specs lack executable depth. Use when code is written and tested but not yet committed, before submitting changes, or as a final review before git commit.

5,124 287
Explore
mindfold-ai/Trellis

update-spec

Captures executable contracts and coding knowledge into .trellis/spec/ documents after implementation, debugging, or design decisions. Enforces code-spec depth for infra and cross-layer changes with mandatory sections for signatures, contracts, validation matrices, and test points. Use when a feature is implemented, a bug is fixed, a design decision is made, a new pattern is discovered, or cross-layer contracts change.

5,124 287
Explore
mindfold-ai/Trellis

check

Validates recently written code against project-specific development guidelines from .trellis/spec/. Identifies changed files via git diff, discovers applicable spec modules, runs lint and typecheck, and reports guideline violations. Use when code is written and needs quality verification, to catch context drift during long sessions, or before committing changes.

5,124 287
Explore
mindfold-ai/Trellis

check-cross-layer

Post-implementation verification across multiple code dimensions: cross-layer data flow, code reuse analysis, import path validation, and same-layer consistency checks. Identifies missed update sites, type mismatches, and duplicated constants. Use when changes span 3+ architectural layers, after modifying shared constants or configs, after batch file modifications, or when creating new utility functions.

5,124 287
Explore
mindfold-ai/Trellis

start

Initializes an AI development session by reading workflow guides, developer identity, git status, active tasks, and project guidelines from .trellis/. Classifies incoming tasks and routes to brainstorm, direct edit, or task workflow. Use when beginning a new coding session, resuming work, starting a new task, or re-establishing project context.

5,124 287
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results