一键导入
doc-testing
Agach testing strategy: test contract pattern, mock structure, contract tests, testcontainers with postgres:17, security tests, QA seed data
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Agach testing strategy: test contract pattern, mock structure, contract tests, testcontainers with postgres:17, security tests, QA seed data
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Agach complete HTTP API reference: all REST endpoints, request/response types, WebSocket events, SSE, query parameters
Agach daemon agent: onboarding, WebSocket reconnect, Docker builds, chat sessions (Claude CLI), git worktrees, SQLite persistence
Agach identity system: authentication (JWT, bcrypt), SSO/OIDC, teams, users, nodes, daemon onboarding, token management
Agach shared infrastructure: internal/pkg (controller, middleware, websocket, sse, apierror), pkg (server types, client SDK, daemonws, domainerror), agachconfig
Agach project hexagonal architecture: bounded contexts, source code hierarchy, entry points, layers, and package structure
Agach business rules: blocking workflow, won't-do workflow, GetNextTask logic, resolution auto-append, priority system, comment system, features
| name | doc-testing |
| description | Agach testing strategy: test contract pattern, mock structure, contract tests, testcontainers with postgres:17, security tests, QA seed data |
| user-invocable | true |
| disable-model-invocation | false |
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>ContractTesting
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(...)
}
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)
})
}
testcontainers-go with postgres:17 for all PostgreSQL testsTestMain, never per test functionnewTestPool() → setupRepos() → contract testing*_security_test.go, deep_security_test.go)domain/service/servicetest/contract.go - MockCommands + MockQueries
Used by app layer unit tests and inbound handler tests.
internal/server/qaseed/seed.go)Deterministic seed for E2E/Playwright tests. Wipes and recreates:
internal/server/qaseed/playwright/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 helpers
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.