Repository: kairos-mcp — Node 24 LTS minimum, TypeScript, Qdrant, Redis, optional Keycloak.
Agent contract: AGENTS.md. Adapter execution (shipped skill):
skills/kairos/SKILL.md. Skill index:
.agents/skills/README.md (kmcp-dev-*).
Use this skill whenever you need to build, deploy, or test this repository.
Derived from CONTRIBUTING.md; this file is the authoritative
execution path for agents in this worktree.
Core rules (source of truth)
- In a git worktree, ensure
.env*exists or will be copied from main, and thatPORT/METRICS_PORTdo not clash with another checkout on the same host; seekmcp-dev-worktree-env(firstnpm run dev:*that usesdeploy-run-env.shcopies.envwhen missing). - Always install dependencies with
npm cibefore first build/test. - Always deploy before tests: integration tests expect a running dev stack.
- Use npm scripts as the only default interface for build, deploy, test, lint.
- Prefer one integration file while iterating, then broaden.
- Deep policy:
CONTRIBUTING.md—## Developer commands,## Setup from clone to passing tests,## PR requirements.
Hard stop
- Do not use direct Jest invocations (
npx jest,jest …,node …/jest.js) as the default path. - Do use
npm run dev:test(with optional file filter).
Canonical sequence
npm cinpm run dev:deploy(imports Qdrant test snapshot ifCI=true)npm run dev:test -- tests/integration/<file>.test.ts(iterate)npm run dev:test(pre-PR / handoff)npm run handoffwhen full maintainer validation is requested
Qdrant test snapshot infrastructure
Purpose: Pre-seed Qdrant with trained adapters to avoid redundant train calls during tests.
How it works:
deploy-run-env.shtriggersimport-test-snapshot.shwhenCI=true- Import script restores both
kairos_ciandkairos_ci_tracescollections from.local/qdrant-snapshot/ - Snapshot contains 76+ adapters (system + test fixtures)
- Tests benefit from pre-seeded data; no need to re-train common adapters
Snapshot management:
- Create/update:
npm run test:seed-snapshot(dev mode with auth) or auto-seeded indev_simplemode - Location:
.local/qdrant-snapshot/kairos_ci.snapshot+kairos_ci_traces.snapshot - Scripts:
scripts/seed-test-snapshot.sh(export),scripts/import-test-snapshot.sh(restore) - Both collections use multi-vector schema (vs1536, activation_pattern_vs1536, adapter_title_vs1536)
Agent guidance:
- Snapshot import happens automatically during
dev:deploywhenCI=true - Do NOT manually call seed/import scripts unless updating snapshot content
- Track snapshot changes via git diff of import/seed scripts
Auth variants
Without Keycloak:
AUTH_ENABLED=false npm run dev:test
With Keycloak (example):
npm run dev:deploy
KEYCLOAK_URL= AUTH_ENABLED=true npm run dev:test -- \
tests/integration/auth-keycloak.test.ts
Agent policy
- User asks to run tests → run
npm run dev:deployfirst unless they explicitly skip deploy. - On conflict with ad hoc commands → follow this skill and state why.
- On failure → report suites and likely causes; do not "green" by switching to bare Jest.
Fork portability
Same policy for forks: deploy-before-test, npm scripts. If script names differ, map equivalents and document before running.
Related maintainer skills
kmcp-dev-worktree-env—.env*in worktrees; sync from main.kmcp-dev-mcp-qa-e2e— MCP-first QA against KAIROS-DEVELOPMENT.kmcp-dev-bugfix-ship— bug report → fix → PR → CI.kmcp-dev-release-semver— semver release branch flow.