Agent skill

Moai Ref Testing Pyramid

by modu-ai in modu-ai/moai-adk

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference.

Apache-2.0Auto-check passedTesting & QA

Install Moai Ref Testing Pyramid

skills CLI
$ npx skills add modu-ai/moai-adk --skill moai-ref-testing-pyramid -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install modu-ai/moai-adk moai-ref-testing-pyramid --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/modu-ai/moai-adk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/moai-ref-testing-pyramid .claude/skills/moai-ref-testing-pyramid && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
moai-ref-testing-pyramid
GitHub stars
1.2k
Token cost
~1.8k tokens
SKILL.md length
635 words
Files
1
Skills in repo
48
Repo updated
First seen
Licence
Apache-2.0

At a glance

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference.

  • Tasks that involve Test strategy
  • SKILL.md covers Target Agents, Test Pyramid Ratios, Coverage Targets by Context and Test Pattern: AAA…, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Security review

What it does

Moai Ref Testing Pyramid is an agent skill from modu-ai/moai-adk. Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test strategy, Security review and Test-driven development. The repository describes itself as: Agentic development harness for Claude Code — SPEC-driven plan/run/sync, TRUST 5 quality gates, model+effort routing, and Claude×GLM multi-LLM cost control. Single Go binary, 16… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Test strategy
  • Tasks that involve Security review
  • Tasks that involve Test-driven development

Example prompts

  • “/moai-ref-testing-pyramid”

Requirements

  • Python 3
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit 6c55321. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Moai Ref Testing Pyramid loads about 1.8k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 635 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from modu-ai/moai-adk at commit 6c55321, republished under its Apache-2.0 licence (© modu-ai). 635 words, ~1,786 tokens.

Download SKILL.mdSave it as .claude/skills/moai-ref-testing-pyramid/SKILL.md (or your agent's skills folder).
name
moai-ref-testing-pyramid
description
Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.
when_to_use
Use for test-pyramid strategy reference: coverage targets, unit/integration/e2e test patterns, and quality metrics. Amplifies manager-develop test-creation…
user-invocable
false
metadata.version
1.0.0
metadata.category
domain
metadata.status
active
metadata.updated
2026-03-30
metadata.tags
testing, pyramid, coverage, tdd, patterns, reference
progressive_disclosure.enabled
true
progressive_disclosure.level1_tokens
100
progressive_disclosure.level2_tokens
3000

Testing Pyramid Reference

Target Agents

  • manager-develop - applies patterns during test creation, coverage analysis, and RED-GREEN-REFACTOR cycles

Test Pyramid Ratios

       /  E2E  \        10% — Critical user journeys only
      /----------\
     / Integration \    20% — API endpoints, DB queries, service boundaries
    /----------------\
   /    Unit Tests    \  70% — Functions, hooks, utilities, pure logic
  /--------------------\
LevelSpeedReliabilityMaintenanceCoverage Target
UnitFast (<100ms)HighLow70% of tests
IntegrationMedium (1-5s)MediumMedium20% of tests
E2ESlow (10-60s)LowerHigh10% of tests

Coverage Targets by Context

ContextTargetRationale
Critical business logic95%+Revenue/security impact
API endpoints90%+Contract compliance
Utility functions85%+Reuse reliability
UI components80%+Rendering correctness
Configuration/glue code60%+Low complexity
Generated code0%Don't test generated code

Test Pattern: AAA (Arrange-Act-Assert)

// Arrange: Set up test data and preconditions
input := CreateTestUser("test@example.com")

// Act: Execute the function under test
result, err := service.CreateUser(ctx, input)

// Assert: Verify the outcome
assert.NoError(t, err)
assert.Equal(t, "test@example.com", result.Email)

Unit Test Patterns

PatternWhenExample
Table-DrivenMultiple input/output combinationsGo: tests := []struct{...}
Mock/StubExternal dependencies (DB, API)Interface injection, mock frameworks
SnapshotComplex output comparisonJest snapshots, golden files
Property-BasedMathematical propertiesquickcheck, hypothesis
Boundary ValueEdge cases0, -1, MAX_INT, empty string, nil

Integration Test Patterns

PatternWhenExample
TestcontainersReal DB neededDocker-based PostgreSQL for tests
HTTP Test ServerAPI endpoint testinghttptest.NewServer (Go), supertest (Node)
In-Memory DBFast DB testsSQLite for development
Fixture LoadingConsistent test dataFactory functions, seed files

What to Test vs What NOT to Test

ALWAYS Test
  • Business logic and calculations
  • Input validation and error handling
  • Authentication and authorization flows
  • Data transformations and mappings
  • Edge cases and boundary conditions
  • Race conditions (with -race flag in Go)
NEVER Test
  • Framework internals (React rendering, Express routing)
  • Third-party library behavior
  • Simple getters/setters with no logic
  • Private methods directly (test via public API)
  • Generated code (protobuf, swagger)
  • CSS styling and layout (use visual regression tools instead)

Test Quality Metrics

MetricTargetTool
Line Coverage85%+go test -cover, istanbul, coverage.py
Branch Coverage75%+go test -covermode=count
Mutation Score70%+go-mutesting, Stryker
Test Execution Time<2 min (unit), <10 min (all)CI timer
Flaky Test Rate<1%CI history analysis

Test File Conventions

LanguageTest FileLocation
Go*_test.goSame package
TypeScript*.test.ts / *.spec.ts__tests__/ or co-located
Pythontest_*.pytests/ directory
Java*Test.javasrc/test/ mirror
Rust#[cfg(test)] mod testsSame file or tests/

TDD RED-GREEN-REFACTOR Quick Reference

RED:     Write a failing test that defines expected behavior
GREEN:   Write minimal code to make the test pass
REFACTOR: Clean up while keeping tests green

Rules:

  • Never write production code without a failing test
  • Write the smallest test that fails
  • Write the simplest code that passes
  • Refactor only when all tests are green
  • One assertion per test (when practical)
<!-- moai:evolvable-start id="rationalizations" -->
Show full SKILL.md (274 more words)Show less

Common Rationalizations

RationalizationReality
"E2E tests cover everything, unit tests are redundant"E2E tests are slow and flaky. Unit tests provide fast, precise feedback. The pyramid exists because each level serves a different purpose.
"Integration tests are more realistic than unit tests"Realism comes at the cost of speed and isolation. A balanced pyramid gives both fast feedback and realistic validation.
"100% code coverage means the code is well tested"Coverage measures execution, not correctness. A test that executes code without meaningful assertions provides zero value.
"Mocking is bad, I prefer real dependencies"Real dependencies make tests slow and non-deterministic. Mock at boundaries, test business logic in isolation.
"This test is flaky, but it catches real bugs sometimes"Flaky tests erode trust in the entire suite. Fix the flakiness or quarantine the test with a tracking issue.

DAMP over DRY: Test code should be descriptive and self-contained. A reader should understand the test without reading shared fixtures or helper methods.

<!-- moai:evolvable-end -->
<!-- moai:evolvable-start id="red-flags" -->

Red Flags

  • Test pyramid inverted: more E2E tests than unit tests
  • Unit tests depend on external services (databases, APIs, file systems)
  • Test assertions check implementation details instead of behavior
  • No integration tests between unit and E2E layers
  • Flaky test present without a quarantine label or tracking issue
<!-- moai:evolvable-end -->
<!-- moai:evolvable-start id="verification" -->

Verification

  • Test distribution follows the pyramid: unit > integration > E2E (show test counts per category)
  • Unit tests run in under 30 seconds total
  • Integration tests mock external dependencies at the boundary
  • No flaky tests in the active suite (run 3x to verify stability)
  • Test names describe behavior, not implementation (review naming convention)
  • Coverage report shows meaningful assertions, not just line execution
<!-- moai:evolvable-end -->

© modu-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/moai-ref-testing-pyramid of modu-ai/moai-adk.

Open the folder on GitHubat commit 6c55321

Compare with similar skills

Moai Ref Testing Pyramid next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Moai Ref Testing Pyramid compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Moai Ref Testing Pyramid this skillmodu-ai/moai-adk1.2k—~1.8kAutomated safety check: PassApache-2.0
Designing TestsCloudAI-X/opencode-workflow275—~2.9kAutomated safety check: PassMIT
Perl Testingaffaan-m/ECC274k4 repos~2.8kAutomated safety check: PassMIT
Testingpenpot/penpot61k—~487Automated safety check: PassMPL-2.0
Automated Test Planningtestdouble/han279—~6.7kAutomated safety check: PassMIT
Test Automatoraiskillstore/marketplace4308 repos~2.8kAutomated safety check: PassNone

Similar skills

  • Designing Tests

    CloudAI-X/opencode-workflow

    Guides test strategy, TDD/BDD approaches, test coverage planning, and testing best practices.

    275 GitHub stars~2.9k tokensUpdated 9 mo ago
    Testing & QAAuto-check passed
  • Perl Testing

    affaan-m/ECC

    Perl testing patterns using Test2::V0, Test::More, prove runner, mocking, coverage with Devel::Cover, and TDD methodology.

    274k GitHub starsUsed in 4 repos~2.8k tokens
    Testing & QAAuto-check passed
  • Testing

    penpot/penpot

    Enforce TDD workflow and testing best practices for Penpot. An agent skill from penpot/penpot.

    61k GitHub stars~487 tokensUpdated today
    Testing & QAAuto-check passed
  • Produce a standalone test plan by analyzing code for test coverage gaps and edge cases.

    279 GitHub stars~6.7k tokensUpdated 6 days ago
    Testing & QAAuto-check passed
  • Test Automator

    aiskillstore/marketplace

    Master AI-powered test automation with modern frameworks, self-healing tests, and comprehensive quality engineering.

    430 GitHub starsUsed in 8 repos~2.8k tokens
    Testing & QAAuto-check passed
  • Manual Test Planning

    testdouble/han

    Produce a plain-language manual test plan from the context supplied to it — an executive summary, a high-level list of named tests, and a detail section per test with the steps a person follows by…

    279 GitHub stars~2.9k tokensUpdated 6 days ago
    Testing & QAAuto-check passed

More from modu-ai/moai-adk

All 48 skills in this repo
  • Builds hand-editable SVG diagrams from computed layout coordinates, lints the source and renders a 2x PNG, with rules for when mermaid is the better choice.

    1.2k GitHub stars~5.2k tokensUpdated today
    Auto-check: notes
  • MoAI Foundation Core

    modu-ai/moai-adk

    Reference for MoAI-ADK's core development principles: TRUST 5 quality gates, SPEC-first domain-driven workflow, agent delegation and token budgeting.

    1.2k GitHub stars~5k tokensUpdated today
    Auto-check passed
  • MoAI SPEC Workflow

    modu-ai/moai-adk

    Manages SPEC documents for MoAI-ADK development, with GEARS or EARS requirement notation, acceptance criteria and a link into the Plan-Run-Sync workflow.

    1.2k GitHub stars~5.1k tokensUpdated today
    Auto-check passed
  • MoAI TDD Workflow

    modu-ai/moai-adk

    Drives test-first development through the RED, GREEN, REFACTOR cycle, with a config switch that selects between TDD and a DDD workflow for existing code.

    1.2k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • MoAI Worktree Management

    modu-ai/moai-adk

    Gives each SPEC its own Git worktree with a registry of active workspaces, base-branch sync and cleanup of merged ones, inside the MoAI-ADK workflow.

    1.2k GitHub stars~3.9k tokensUpdated today
    Auto-check passed
  • Watches a pull request's CI checks after creation, separates required from auxiliary failures, applies limited safe fixes and escalates anything semantic to you.

    1.2k GitHub stars~2.4k tokensUpdated today
    Auto-check: notes

Categories

Questions about Moai Ref Testing Pyramid

What does Moai Ref Testing Pyramid do?

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Moai Ref Testing Pyramid is an agent skill from modu-ai/moai-adk. Test pyramid strategy, coverage targets, test patterns, and quality metrics reference.

When should I use Moai Ref Testing Pyramid?

Moai Ref Testing Pyramid fits situations like: tasks that involve Test strategy; tasks that involve Security review; tasks that involve Test-driven development.

How do I install Moai Ref Testing Pyramid in Claude Code?

Run `npx skills add modu-ai/moai-adk --skill moai-ref-testing-pyramid -a claude-code`. Or copy the skill folder (.claude/skills/moai-ref-testing-pyramid in modu-ai/moai-adk) into .claude/skills/moai-ref-testing-pyramid in your project. Claude Code loads it when a task matches its description.

How do I install Moai Ref Testing Pyramid in Codex?

Run `npx skills add modu-ai/moai-adk --skill moai-ref-testing-pyramid -a codex`. Or copy the skill folder (.claude/skills/moai-ref-testing-pyramid in modu-ai/moai-adk) into .agents/skills/moai-ref-testing-pyramid in your project. Codex loads it when a task matches its description.

Can I use Moai Ref Testing Pyramid in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add modu-ai/moai-adk --skill moai-ref-testing-pyramid -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/moai-ref-testing-pyramid, .gemini/skills/moai-ref-testing-pyramid, .github/skills/moai-ref-testing-pyramid and .opencode/skills/moai-ref-testing-pyramid in your project.

What does Moai Ref Testing Pyramid need to run?

SKILL.md names no scripts, command-line tools or credentials: Moai Ref Testing Pyramid is instructions for the agent only. Our summary lists: Python 3; Docker.

Does Moai Ref Testing Pyramid access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Moai Ref Testing Pyramid safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Moai Ref Testing Pyramid use?

Moai Ref Testing Pyramid is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Moai Ref Testing Pyramid use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Moai Ref Testing Pyramid?

Skills that share tags, products or a category with Moai Ref Testing Pyramid: Designing Tests (CloudAI-X/opencode-workflow, 275 stars), Perl Testing (affaan-m/ECC, 274k stars), Testing (penpot/penpot, 61k stars) and Automated Test Planning (testdouble/han, 279 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Moai Ref Testing Pyramid?

modu-ai (a GitHub organization) maintains it in modu-ai/moai-adk, which has 1,230 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 7, 2026.

Source: modu-ai/moai-adk on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.