sg-employment-law.md | Singapore employment law | KB content, provision accuracy, regulatory domains |
advisory-safety-chain.md | 13-step safety chain | Advisory query pipeline, guardrails, response generation |
platform-architecture.md | Platform structure | Router setup, middleware, auth, Nexus integration, production deployment (GCP/Docker), live E2E testing, test accounts |
trust-governance.md | EATP/CARE/learning | Trust chains, citation validation, expert review |
calculators.md | HR calculators | CPF, leave, salary, quota, overtime calculations |
kb-management.md | Knowledge base pipeline | Content loading, search, regulatory updates |
auth-security.md | Authentication & security | JWT tokens, tenant isolation, rate limiting, PDPA, RBAC role-page matrix, frontend guard patterns, allow-list enforcement |
security-patterns.md | Reusable patterns | 53 codified patterns P1-P53 (rounds 12/13/14 + obayashi 1/2/polish + rounds 3-7 + engagement post-walk polish): saga compensation, hash-chained audit log, cache invalidation, per-tenant locks, idempotency window, soft-delete, cost cap, prompt-injection sanitization, OAuth user_id binding, syncToken protocol, cron-via-docker-exec, cache-bypass-on-recalc, defensive route guard, chronological-ordering, unique-name helper, live-vs-snapshot drift, per-resource scope, self-action guard, activity-feed dedup, MCP curated fallback, copy hygiene, cross-stage hooks, case-insensitive enum filter, independent seed guards, DataFlow false-bool mismatch, scripts-not-in-image, anonymity collapse, no-PII derived views, humanize IDs and enums (P35), tokenized-public-link preflight (P36), fix-up branch in idempotent seeds (P37), frontend disclosure banner (P38), PATCH allowed-fields whitelist + UI lock (P39), multi-table fields must be split before update (P40), UTC vs local-time wall-clock comparisons (P41), frontend type ↔ backend response shape mismatch causes /undefined fetches (P42), silent-disabled submit button is a UX failure (P43), empty-state quality: nothing-yet vs all-done vs ineligible (P44), hidden-detail anti-pattern (P45 — see enrichment-and-detail-patterns.md), role-aware UX gating beyond AdminGuard (P46 — see role-aware-ux.md), default-deny on owner-less in-memory caches (P47), LLM provider transient-failure UX (P48), permission predicate vs role proxy — role and capability are sometimes orthogonal (P49), privacy asymmetry: data subjects can re-identify their own pseudonymous data (P50), aggregate stats are necessary but not sufficient — manager view needs per-question + trend (P51), demo seed realism: probability-weighted draws beat categorical buckets (P52), conditional explanatory copy must match rendered controls (P53). Post-audit closure forms — implement the matching shape. |
enrichment-and-detail-patterns.md | ID enrichment + JSON-detail rendering | Two interlocking anti-patterns from rounds 3-6: (1) raw-ID leakage (Employee #N, Candidate #N) — backend lists return employee_id/candidate_id but frontend has no name to render, (2) hidden-detail — backend stores rich JSON columns (responses, scores, sections, payload) but frontend renders only summary numbers. Includes the _resolve_employee_names / _resolve_user_names shared helpers, the parseJsonObject / ScoreBar frontend templates, the static-grep audit method, and the live-Playwright verification protocol. Use when adding any new list endpoint, expanding a card, or auditing for either anti-pattern. |
role-aware-ux.md | Role-gated surfaces inventory | Catalog of which dashboard surfaces must check user?.role (ShadowMargin compliance rail, alerts unread-count fetch, advisory chat suggestions, /help getting-started, /my-timesheets eligibility). Includes 5 canonical gating patterns (shell widget, fetch effect, content list, backend response, button + helper copy), the get_current_user_optional middleware, and the inventory of currently-gated surfaces. Use when adding any shell-level component, employee-facing page, or shared content list. |
lifecycle-dashboard.md | Cox 8-stage architecture | /strategy/lifecycle aggregator + 8 stage panels + D&I tile + activity feed. Stage→module map, _safe_list resilience seam, health-pill thresholds (locked + parametrized-tested), checklist for adding a new stage data source, gate ship discipline (one bundled commit + one ship script per gate). Use when adding a Phase 2/3 module that the lifecycle hooks into, modifying the aggregator, or building a new Strategy hub sibling page. |
document-generation.md | Document templates | Template CRUD, generation, preview, download, history |
company-user-management.md | Company & user profiles | Company onboarding, user CRUD, roles, workforce data |
hris-engine.md | Full HRIS engine | Payroll (pay items, schemes, adhoc, simulation, variance), leave (encashment, off-in-lieu, hourly), claims (groups, co-payment, BIK), attendance (lateness brackets, today dashboard), shifts (hourly rates, multipliers, publish), appraisals (templates, periods, reviews, sign-off), projects (assignments, timesheets, allocations, costs), inventory (locations, categories, items, lifecycle state machine, requests), recruitment (job listings, candidates, interviews, hiring), reports (11 types with charts), approval workflows, rate limiting, demo seed data |
mcp-integrations.md | MCP integration layer | 5 MCP servers, 38 connectors, circuit breakers, idempotency, sagas, PII filter, webhooks, tool selector |
third-party-integration-patterns.md | Production-readiness playbook for OAuth integrations | The 12 hardening patterns codified from the Xero workstream — multi-org picker, HMAC-signed state, persisted token store, refresh-token cliff, advisory-lock TOCTOU fix, Idempotency-Key + force counter, PDPA disconnect, audit log + payload hash, scope evolution, mapping health, decimal-arithmetic boundary, bulk skip-not-abort. Plus the M0..M4 milestone framework. Use when wiring up any new accounting/HR/banking OAuth integration or hardening an existing one. |
shadow-agent.md | Shadow agent intelligence | Intent classification, PACE execution loop, tool registry (100+ tools), trust tiers, entity resolution, workflow composition, observation/memory, briefing/nudges, 13 API endpoints, 9 frontend components |
engagement-surveys.md | Engagement survey product | Pulse surveys, three-tier anonymity (identified / pseudonymous / anonymous), HMAC pseudonyms with versioned secrets (Z02), action loop closing back to employees, manager team aggregate with self-exclusion (Z26) + per-question + 6-pulse trend, Q12 / monthly_pulse templates, cohort builder, saga launch with partial-delivery state (Z09), in-app respond form, loop-closing card narrative, the Z01-Z44 numbered amendments catalogue, DataFlow stale-cache workaround (cache_ttl=0 direct-SQL bypass). Use for any engagement-survey work. |