doc-testing
Skill0 starsChanged 8 months agoMITView on GitHub
Agach testing strategy: test contract pattern, mock structure, contract tests, testcontainers with postgres:17, security tests, QA seed data
In this repository10 other files it gives its agents.
- doc-api-routesSkill
- doc-architectureSkill
- doc-business-rulesSkill
- doc-daemonSkill
- doc-databaseSkill
- doc-dependenciesSkill
- doc-frontendSkill
- doc-identitySkill
- doc-notificationsSkill
- doc-shared-packagesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 46
Use testcontainers-go with postgres:17 for all PostgreSQL tests
- Distinctive: line 52
Test auth enforcement, input validation, injection prevention
- Distinctive: line 72
Add unit tests covering the fixed scenario to prevent regressions
- Very specific: line 73
If the bug involves data/state that can be reproduced via seed data, add the use case to internal/server/qaseed/
- Very specific: line 74
If the bug is reproducible through the web UI, add a Playwright test in playwright/
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agach Testing Strategy
Test Contract Pattern
Each repository interface has a companion test package:
/domain/repositories/<name>/<name>.go - Interface definition
/domain/repositories/<name>/<name>test/
contract.go - Mock<Name> + <Name>ContractTestingMock Structure
type Mock<Name> struct {
<Method>Func func(...) ...
}
func (m *Mock<Name>) <Method>(...) ... {
if m.<Method>Func == nil {
panic("called not defined <Method>Func")
}
return m.<Method>Func(...)
}Contract Test Structure
func <Name>ContractTesting(t *testing.T, repo <Name>) {
ctx := context.Background()
t.Run("Contract: <behavior>", func(t *testing.T) {
// Test implementation
require.NoError(t, err)
assert.ErrorIs(t, err, domain.ErrExpected)
})
}Integration Tests
- Use
testcontainers-gowithpostgres:17for all PostgreSQL tests - One shared container per test package — start in
TestMain, never per test function - Pattern:
newTestPool()→setupRepos()→ contract testing
Security Tests
- Located alongside handler tests (
*_security_test.go,deep_security_test.go) - Test auth enforcement, input validation, injection prevention
- Both command and query handlers have security test coverage
Service Mock + Contract
domain/service/servicetest/contract.go - MockCommands + MockQueriesUsed by app layer unit tests and inbound handler tests.
QA Seed Data (internal/server/qaseed/seed.go)
Deterministic seed for E2E/Playwright tests. Wipes and recreates:
- 3 roles: Backend (⚙️), Frontend (🖥️), QA (🧪) with tech stacks
- 2 skills: Go Development, Playwright Testing
- 1 Dockerfile: "go-service" (Go 1.24 template)
- 2 projects: "QA Test Project" (main) + "QA Feature Branch" (feature)
- 8 tasks in various states: todo, in_progress, blocked, done, won't-do, backlog, feature-linked, dependency pair
- 2 comments: one on todo task, one human comment on blocked task
- Outputs JSON with all entity IDs for Playwright test fixtures
Bug Fix Guidelines
- Add unit tests covering the fixed scenario to prevent regressions
- If the bug involves data/state that can be reproduced via seed data, add the use case to
internal/server/qaseed/ - If the bug is reproducible through the web UI, add a Playwright test in
playwright/
Playwright Tests (playwright/)
playwright/tests/
01-home.spec.ts - Login, home, navigation
02-kanban-board.spec.ts - Board display
03-task-management.spec.ts - Task CRUD
04-roles-features.spec.ts - Roles & features
05-backlog-settings.spec.ts - Backlog & settings
06-skills-stats-export.spec.ts - Skills, stats, export
07-theme-comments-ws-health.spec.ts - Theme, comments, WebSocket
helpers.ts - Shared test helpersdata-qa Attributes
Interactive elements use data-qa attributes for Playwright targeting:
create-project-btn, login-email-input, search-input, nav-kanban-btn,
task-open-btn, user-menu-btn, theme-toggle-btn, etc.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

