architecture
Project architecture and file structure conventions for all process types. Use when: (1) Creating new files or modules, (2) Deciding where code should go, (3)…
Testing workflow and quality standards for writing and running tests. Use when: (1) Writing new tests, (2) Adding a new feature that needs tests, (3) Modifying logic that has existing tests, (4) Before claiming a task is complete.
$ npx -y skills add iOfficeAI/AionUi --skill testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Testing workflow and quality standards for writing and running tests. Use when: (1) Writing new tests, (2) Adding a new feature that needs tests, (3) Modifying logic that has existing tests, (4) Before claiming a task is complete.
name: testing description: | Testing workflow and quality standards for writing and running tests. Use when: (1) Writing new tests, (2) Adding a new feature that needs tests, (3) Modifying logic that has existing tests, (4) Before claiming a task is complete.
Standards and workflow for writing and running tests. Every feature must be tested.
**Announce at start:** "I'm using testing skill to ensure proper test coverage."
**Vitest 4** — configured in `vitest.config.ts`.
tests/ ├── unit/ # Individual functions, utilities, components ├── integration/ # IPC, database, service interactions ├── regression/ # Regression test cases └── e2e/ # End-to-end tests (Playwright, playwright.config.ts)
| Environment | When | File naming | | ---------------- | --------------------------------- | --------------- | | `node` (default) | Main process, utilities, services | `*.test.ts` | | `jsdom` | DOM/browser-dependent code | `*.dom.test.ts` |
Before writing tests, list the **riskiest scenarios** first:
Follow these quality rules:
**1. Describe behavior, not code structure**
// Wrong — describes implementation
it('should call repo.getConversation', ...)
// Correct — describes behavior
it('should return cached task without hitting repo on second call', ...)
it('should reject with error when conversation does not exist', ...)**2. Every describe block must cover at least one failure path**
Happy-path-only tests leave the most dangerous code untested.
**3. One behavior per test**
Keep each `it()` focused. More than 3 `expect()` calls in one test is a signal it is testing too much at once.
**4. Self-check**
After writing a test, mentally delete the core logic it targets. If the test would still pass, rewrite it — it is not guarding anything.
**5. Start from risk, not from coverage gaps**
List scenarios most likely to produce bugs. Write those first. Coverage is the outcome, not the starting point.
bun run test # Run all tests (REQUIRED before every commit) bun run test:coverage # Check coverage (before opening a PR)
**Coverage target**: ≥ 80% for all source files matched by `vitest.config.ts` → `coverage.include` (currently `src/**/*.{ts,tsx}` plus a few scripts).
New source files are automatically included in coverage — no manual config changes needed. If a new file is accidentally excluded by a rule in `coverage.exclude`, remove it from the exclude list.
When modifying logic, check if existing tests need updating:
bun run test -- --reporter=verbose # See which tests pass/fail with names
If a test fails because the behavior changed intentionally, update the test. If it fails unexpectedly, investigate.
When testing a module, verify:
Before submitting code:
| Mistake | Correct | | --------------------------------- | --------------------------------------------- | | Testing implementation details | Test observable behavior | | Only testing happy path | Must include at least one failure path | | 5+ expects in one `it()` | Split into separate tests | | Skipping tests for "simple" code | Simple code breaks too — test the risky parts | | Writing tests after saying "done" | Tests are part of "done", not an afterthought |
Open-source 24/7 Cowork app for OpenClaw, Hermes, Claude Code, Codex, OpenCode and 20+ more CLI Agent | Customize your assistants | Team them up|Star if you like it!
Repo: iOfficeAI/AionUi
Project architecture and file structure conventions for all process types. Use when: (1) Creating new files or modules, (2) Deciding where code should go, (3)…
Use when bumping the AionUi version: query AionCore release, verify artifacts, update package.json, generate CHANGELOG, branch, commit, push, create PR,…
Internationalization (i18n) workflow and standards for managing translations. Use when: (1) Adding new user-facing text, (2) Creating new components with…