marketplace/bundles/plan-marshall/skills/task-module-testing/SKILL.md
Domain-agnostic module testing task execution with two-tier skill loading
npx skillsauth add cuioss/plan-marshall task-module-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Role: Domain-agnostic task executor skill for executing module testing tasks (profile=module_testing). Loaded by plan-marshall:phase-5-execute skill when task.profile is module_testing.
Key Pattern: Agent loads this skill via resolve-task-executor --profile module_testing. Skill executes a test-focused workflow: understand context → plan tests → implement tests → verify. Domain-specific testing knowledge comes from task.skills (loaded by agent).
MANDATORY: Follow the execution contract defined in:
| Contract | Location | Purpose |
|----------|----------|---------|
| Task Execution Contract | plan-marshall:manage-tasks/standards/task-execution-contract.md | Skill responsibilities |
| Task Contract | plan-marshall:manage-tasks/standards/task-contract.md | Task structure |
See ref-workflow-architecture:skill-loading for the complete two-tier skill loading pattern with visual diagrams.
Summary: Agent loads Tier 1 (system skills) automatically, then Tier 2 (domain skills from task.skills). This workflow skill defines HOW the agent executes tests.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| plan_id | string | Yes | Plan identifier |
| task_number | number | Yes | Task number to execute |
status: success | error
plan_id: {echo}
task_number: {echo}
execution_summary:
steps_completed: N
steps_total: M
files_modified: [paths]
tests_written: N
coverage_impact: {if available}
verification:
passed: true | false
command: "{cmd}"
tests_passed: N
tests_failed: N
next_action: task_complete | requires_attention
message: {error message if status=error}
Read the task file to understand what tests need to be written:
python3 .plan/execute-script.py plan-marshall:manage-tasks:manage-tasks get \
--plan-id {plan_id} \
--number {task_number}
Extract key fields:
domain: Domain for this taskprofile: Should be module_testingskills: Domain testing skills to apply (already loaded by agent)description: What tests to createsteps: File paths (test files) to work onverification: How to verify tests passdepends_on: Dependencies (implementation tasks should be complete)Before writing tests, understand what is being tested:
Read implementation files:
# Find the implementation being tested
# Test file: src/test/java/com/example/UserServiceTest.java
# Implementation: src/main/java/com/example/UserService.java
# Java pattern
Grep "class UserService" --type java
Read {implementation_file}
# JavaScript pattern
Glob src/**/*.{js,ts}
Read {implementation_file}
Identify testable elements:
For each step (test file path), determine:
Note: Steps are executed sequentially. No explicit "in_progress" marker needed - proceed directly to implementation.
For each step (test file path):
Create new test file:
Write {test_file_path}
# Apply testing patterns from domain skills
# Follow AAA pattern (Arrange-Act-Assert)
# Include setup/teardown if needed
Modify existing test file:
Edit {test_file_path}
# Add new test methods
# Maintain existing test structure
# Follow project test conventions
Apply testing patterns:
Unit Test Pattern:
1. Setup test class/describe block
2. Create setup method (@BeforeEach, beforeEach)
3. Write test methods for each scenario:
- Happy path tests
- Edge case tests
- Error/exception tests
- Boundary tests
4. Add teardown if needed
5. Include clear assertions
Integration Test Pattern:
1. Setup test class with integration annotations
2. Configure test dependencies (database, services)
3. Write tests that verify component interactions
4. Include proper cleanup
5. Mark as integration test (@IT suffix, separate folder)
After each step:
python3 .plan/execute-script.py plan-marshall:manage-tasks:manage-tasks finalize-step \
--plan-id {plan_id} \
--task {task_number} \
--step {N} \
--outcome done
After all test files are written, run verification:
# Execute verification commands from task
{verification.commands[0]}
Verification (module_testing tasks run the full test suite for the module, not targeted test classes):
Execute the verification commands from task.verification.commands. Every task SHOULD have commands populated by the plan phase (copied from the deliverable).
Safety net (should never trigger in normal operation): If verification commands are missing, log a WARN and resolve from architecture:
python3 .plan/execute-script.py plan-marshall:manage-logging:manage-log \
work --plan-id {plan_id} --level WARN --message "[VERIFY] (plan-marshall:task-module-testing) TASK-{N} missing verification — falling back to architecture resolve"
python3 .plan/execute-script.py plan-marshall:manage-architecture:architecture \
resolve --command module-tests --name {module} \
--trace-plan-id {plan_id}
If all tests pass:
python3 .plan/execute-script.py plan-marshall:manage-tasks:manage-tasks update \
--plan-id {plan_id} \
--number {task_number} \
--status done
If tests fail:
If still failing after 3 iterations:
python3 .plan/execute-script.py plan-marshall:manage-tasks:manage-tasks update \
--plan-id {plan_id} \
--number {task_number} \
--status blocked
Note: Record details in work.log using manage-log.
On issues or unexpected patterns:
python3 .plan/execute-script.py plan-marshall:manage-lessons:manage-lesson add \
--component "plan-marshall:task-module-testing" \
--category improvement \
--title "{issue summary}" \
--detail "{context and resolution}"
Valid categories: bug, improvement, anti-pattern
status: success
plan_id: {plan_id}
task_number: {task_number}
execution_summary:
steps_completed: {N}
steps_total: {M}
files_modified:
- {test_path1}
- {test_path2}
tests_written: {count}
verification:
passed: true
command: "{test command}"
tests_passed: {N}
tests_failed: 0
next_action: task_complete
@DisplayName("UserService Tests")
class UserServiceTest {
@BeforeEach
void setUp() {
// Arrange - setup
}
@Test
@DisplayName("should return user when valid ID provided")
void shouldReturnUserWhenValidIdProvided() {
// Arrange
// Act
// Assert
}
@Test
@DisplayName("should throw exception when user not found")
void shouldThrowExceptionWhenUserNotFound() {
// Arrange
// Act & Assert
assertThrows(UserNotFoundException.class, () -> ...);
}
}
describe('UserService', () => {
beforeEach(() => {
// Arrange - setup
});
it('should return user when valid ID provided', () => {
// Arrange
// Act
// Assert
expect(result).toEqual(expectedUser);
});
it('should throw error when user not found', () => {
// Arrange
// Act & Assert
expect(() => service.getUser('invalid')).toThrow();
});
});
When writing tests, consider:
| Coverage Type | Priority | When to Include | |---------------|----------|-----------------| | Happy path | High | Always | | Error handling | High | Always | | Edge cases | Medium | When logic has boundaries | | Null/undefined | Medium | When inputs can be null | | Integration | Low | When testing component interaction |
If implementation to test doesn't exist:
If tests pass/fail inconsistently:
If test requires unavailable dependencies:
Invoked by: plan-marshall:phase-5-execute skill (when task.profile = module_testing)
Skill Loading: Agent resolves this skill via resolve-task-executor --profile module_testing
Script Notations (use EXACTLY as shown):
plan-marshall:manage-tasks:manage-tasks - Task operations (get, update, finalize-step)plan-marshall:manage-lessons:manage-lesson - Record lessons (add)Domain Testing Skills Applied (loaded by agent from task.skills):
pm-dev-java:java-core, pm-dev-java:junit-core, pm-dev-java:junit-integrationpm-dev-frontend:javascriptdevelopment
Domain-owned OpenRewrite log-line finding parser for the java-cui domain — parses the
development
Domain-owned OpenRewrite marker detection for the java-cui domain — scans Java/Kotlin sources for cui-rewrite TODO markers, categorizes them by recipe, and fails the gate on any detected marker
development
Operator control surface for the marshalld build server — enrol/drop a project in the machine-global registry (the opt-in enable signal and anti-laundering wall), manage the daemon lifecycle (start, stop, drain, status, install, upgrade) version-pinned to the verified bundle copy, and inspect the daemon's per-project interaction-audit log (read-only)
tools
The tiny build-consumption client for the marshalld build server — submit a build job, bounded long-poll for its result, ping the daemon identity, and preflight registry-plus-liveness in one call; consumption only, never provisioning or enrolment