acceptance-test-generation
Use when acceptance criteria need unit, integration, or end-to-end tests generated from implementation context
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when acceptance criteria need unit, integration, or end-to-end tests generated from implementation context
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when Codex is asked to colonize, plan, build, continue, swarm, or seal an Aether colony and must mirror wrapper orchestration safely
Use when Codex is asked to initialize or set up an Aether colony and should refine intent before running init
Use when Codex is asked to run Aether Oracle or discuss flows and should refine scope before research or clarification
Use when delivered functionality needs acceptance-criteria verification before a phase advances
Use when a phase involves LLMs, AI agents, RAG, ML inference, or prompt/tool integration design
Use when stale or completed colony artifacts need safe archival, cleanup, or retrieval without losing evidence
| source | shipped |
| name | acceptance-test-generation |
| description | Use when acceptance criteria need unit, integration, or end-to-end tests generated from implementation context |
| type | colony |
| domains | ["testing","quality-assurance","verification"] |
| agent_roles | ["watcher","probe","builder"] |
| workflow_triggers | ["build","continue"] |
| task_keywords | ["test","acceptance","criteria","coverage","e2e","unit"] |
| priority | normal |
| version | 1.0 |
Generate unit and end-to-end tests from acceptance criteria found in phase specifications. Follows the RED-GREEN verification cycle: write failing tests first, then confirm they pass against the implementation. Auto-detects the project's test framework and conventions so generated tests blend seamlessly with existing ones.
Collect these inputs before generating any tests:
Scan the project for test framework indicators:
| Indicator | Framework | Language |
|---|---|---|
jest, vitest, @testing-library in package.json | Jest / Vitest | TypeScript/JS |
pytest, unittest imports | pytest / unittest | Python |
#[cfg(test)], #[test] | built-in | Rust |
_test.go files | built-in | Go |
junit, mockito in build.gradle/pom.xml | JUnit | Java |
RSpec.describe patterns | RSpec | Ruby |
cypress, playwright in package.json | Cypress / Playwright | E2E (JS) |
selenium imports | Selenium | E2E (multi) |
If multiple frameworks exist (e.g., Jest for unit + Playwright for E2E), use each for its appropriate test type.
For each acceptance criterion, create one or more test cases:
Write test files following project conventions:
__tests__/, tests/, *_test.go)src/auth/login.ts becomes src/auth/__tests__/login.test.tsStructure each test as:
describe/context block naming the feature or criterion
-> it/test block describing the specific scenario
-> arrange: set up preconditions and test data
-> act: call the function or simulate the user action
-> assert: verify the expected outcome
For E2E tests:
Execute the generated tests and confirm they fail with the expected assertion errors (not syntax errors or import failures). This proves the tests are valid and will catch regressions.
If a test passes immediately, either:
If the implementation is already complete, run all tests again to confirm they pass. If any fail:
Output a summary:
Test Generation Report
======================
Framework detected: Jest (unit) + Playwright (E2E)
Acceptance criteria mapped: 8
Test files created: 4
- src/auth/__tests__/login.test.ts (3 tests)
- src/auth/__tests__/password-reset.test.ts (2 tests)
- e2e/auth-flow.spec.ts (2 tests)
- src/api/__tests__/users.test.ts (4 tests)
RED verification: All tests fail as expected
GREEN verification: 10/11 pass (1 pending fix in password-reset)
Coverage estimate: auth module 78% -> 94%
Translate acceptance criteria into test structure:
| Criterion Language | Test Structure |
|---|---|
| "Given X, when Y, then Z" | describe('X') -> it('should Z when Y') |
| "The system shall..." | it('shall ...') with assertions on system output |
| "If A then B, else C" | Two tests: it('returns B when A') and it('returns C when not A') |
When generating tests, identify external dependencies and mock them at natural boundaries:
Create reusable factory functions for test data rather than duplicating setup:
function createTestUser(overrides = {}) {
return { id: '1', email: 'test@example.com', role: 'user', ...overrides };
}
Produces test files in the project's test directory structure and prints a generation report to stdout. Does not modify source implementation files.
Generate tests for phase 4 -- the user authentication phase
Reads phase 4's acceptance criteria, scans src/auth/ for implementation, detects Jest as the framework, generates unit tests for login, registration, password reset, and an E2E test for the full sign-up flow.
Generate tests for these criteria:
- User can create an account with email and password
- User cannot create an account with duplicate email
- User receives confirmation email after registration
Maps each criterion to one or more test cases. The duplicate email check gets both a unit test (service layer) and an integration test (API response).
import { describe, it, expect, beforeEach } from 'vitest';
import { UserService } from '../user-service';
import { createTestUser } from './helpers/factories';
describe('UserService', () => {
let service: UserService;
beforeEach(() => {
service = new UserService(mockRepository, mockEmailSender);
});
it('creates an account with valid email and password', async () => {
const user = await service.create('new@example.com', 'SecureP@ss1');
expect(user.id).toBeDefined();
expect(user.email).toBe('new@example.com');
});
it('rejects duplicate email registration', async () => {
await service.create('dup@example.com', 'pass123');
await expect(
service.create('dup@example.com', 'pass456')
).rejects.toThrow('Email already registered');
});
it('sends confirmation email after registration', async () => {
await service.create('new@example.com', 'SecureP@ss1');
expect(mockEmailSender.send).toHaveBeenCalledWith(
expect.objectContaining({ to: 'new@example.com', type: 'confirmation' })
);
});
});