Strips deployment and backend artefacts from the application repo:
- .claude/ assistant tooling (launch config)
- base44/ backend export: 5 Deno HTTP endpoints, agent and
entity definitions, workflows. Unreferenced by the
Vite build, so removing it changes no behaviour.
- Dockerfile,
.dockerignore,
docker/nginx.conf the container image existed only to serve the app
through nginx, so the config and the image that
copies it are removed together rather than leaving
a Dockerfile that cannot build.
src/api/ is deliberately kept. Despite the name it makes no network
calls: entities.ts re-exports the local store and auth.ts is the local
sign-in check. AuthContext, SignIn, CommandPalette and Settings all
import it, so removing it would break sign-in and the app with it.
.gitignore now also covers key material, assistant tooling and release
archives, so none of the above can return by accident.
Typecheck and production build pass after the removals.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
KROWFORCE — frontend
The workforce operating system, rebuilt as a standalone frontend. No Base44, no external backend, no network calls: every record on every screen comes from a local store that is shaped like the API that will replace it.
npm install
npm run dev # http://localhost:5173
npm run build
npm run typecheck
What this is
The reference application (staff-hub) was a Base44 project: ~120 pages, ~90
entity definitions, agents and workflows, all bound to a hosted backend. This
rebuild keeps its flow design — the seven roles, the order → shift →
assignment → invoice spine, the compliance and payroll loops — and drops
everything that depended on the host.
The design language is the one already in use in Krow/krow-demo: the same
tokens, the same components/ds layer, the same Astryx base. That project was
read, not modified.
The seven vantage points
KROWFORCE is one system seen from seven positions, and each gets its own navigation and its own home screen rather than one dashboard with sections switched off:
| Role | Opens the product to ask |
|---|---|
| KROW Admin | What is going wrong across the whole network? |
| Procurement | Who should get the work, and on what terms? |
| Operator | What is going wrong today, in my sectors? |
| Sector Manager | Is my branch covered, and at what margin? |
| Client | Is my event staffed, and what is it costing me? |
| Vendor | Where are my gaps, and how is my score? |
| Staff Member | What am I working, and what did I earn? |
The role switch is in the top bar, not in settings — moving between seats is how the product is reviewed.
Architecture
src/
data/ types.ts, seed.ts, store.ts — the local database
api/ entities.ts, auth.ts — what pages import
lib/ scope, metrics, ai/engine, hooks, i18n, preferences
nav/ routes.ts, navigation.ts — every path, named once
components/
ui/ Radix primitives (ported from krow-demo)
ds/ the KROW design system (ported from krow-demo)
layout/ shell, sidebar, command palette, notifications, switchers
assistant/ the KROW AI panel
shared/ status mapping, list toolbar, URL-backed tabs, chart props
pages/ home · orders · network · workforce · worker · finance ·
intelligence · comms · settings
The store (src/data/store.ts) exposes collections with
list / filter / get / create / update / delete, all returning promises,
persisted to localStorage behind a debounce and wrapped in try/catch.
Writes notify subscribers, so a mutation anywhere refreshes every screen
showing that data — the behaviour a real backend with subscriptions gives,
without each page remembering to invalidate.
The seed (src/data/seed.ts) is deterministic. Fill rates follow from
assignments, invoice ageing follows from dates, a vendor's score follows from
the shifts it actually covered. No screen carries a hard-coded total: change an
assignment and the fill rate, the invoice and the P&L all move.
Metrics (src/lib/metrics.ts) holds every derived figure — fill position,
attendance, ageing, overtime exposure, vendor reliability — so the same number
means the same thing on every screen.
Scope (src/lib/scope.ts) turns the signed-in user into the filter every
list query applies. A client sees its own orders; a vendor sees the work it was
given; a worker sees their own shifts.
Owliver
Owliver is the product, not a widget in it. Home opens on him; the dashboards
sit one click away. He lives in src/lib/owliver/:
| File | What it is |
|---|---|
doctrine.ts |
The operating doctrine — the spec the engine implements and the system prompt a model backend receives verbatim. Also the autonomy levels and the ACTUAL / ESTIMATED / FORECAST value states. |
facts.ts |
The fact pack. Every number Owliver says comes from here, computed once per question and scoped to the asking account. |
actionObjects.ts |
Typed exceptions — no-show, coverage gap, overtime, compliance lapse, invoice blocker — each with impact, cost, the one action, and whether Owliver may take it alone. Ranked by urgency × impact. |
skills.ts |
Ten skills: run my day, coverage outlook, live attendance, financial position, overtime control, find available, vendor review, compliance watch, cash position, order handling. |
engine.ts |
Routing. Informational questions answer directly; operational commands go to the handler that owns the change. |
types.ts |
The answer contract: lead, KPIs, chart, table, action objects, actions. |
The doctrine is not decoration — each rule has a counterpart in the code:
- Exception-only —
composeActionObjectsreturns only what needs a decision, and every brief opens "22 shifts are operating normally, 5 need attention". - Prioritise —
rankActionsscores urgency × impact, money breaking ties. - Financial source of truth — every KPI carries its state, and the UI prints it; an estimate never looks like an actual.
- Orchestrate, don't chat — there is no "how can I help": an unrecognised question still returns the operational position.
- Response design — the
OwliverAnswertype is what / why / what action / what next.
The composer takes typing, speech (the browser's own recogniser, with an
honest message where there is none) and attachments. Answers render as
metrics, evidence tables and action cards; each card's button asks Owliver the
follow-up a human would have had to type, and each answer names the skill that
produced it. /ai-console shows the agent roster, the skill surface, the
doctrine in full, and every run.
Auth
There is no identity provider yet, and the sign-in screen says so: pick a role
and the product reconfigures around the seeded account for it. The choice is
remembered in this browser. Settings → Data shows every collection's row
count and resets the dataset.
What is built
Fully implemented: the Owliver workspace (home, docked panel, composer with voice and attachments, ten skills, action objects, agent console), role dashboards (×5), orders list / detail / three-step creation, Action Center, schedule, live activity with check-in and check-out, availability grid with offer sending, task board, staff directory and detail, teams, onboarding pipeline, document review queue, certifications, compliance, vendors list / detail / performance, clients, sectors, enterprises, invoices list / detail, payroll runs and detail, daily operating report, sales tracker, budget, rate cards, savings engine, reports with CSV export, demand and supply, KROW Command, AI Console, activity log, messages, announcements, settings, users, design system, and the five worker self-service screens.
Routed with an honest "not built yet" page that states the intent and the
records already available: urgent order, smart scheduler, vendor roster,
deployments, client / sector / enterprise / team detail, vendor onboarding and
marketplace, staff market, trust network, predictive, KROW EDGE, recruiting,
training, benefits, employee 360, communications hub, permissions, support,
tutorials, new invoice. See src/pages/Stubs.tsx.
Next: backend, DB, agents, MCP
The frontend was built so these slot in without the pages changing:
- Database —
src/data/types.tsis the schema. Each collection becomes a table;created_date/updated_dateare already stamped on every row. - API — replace the body of
src/data/store.tswith HTTP calls. The collection interface is the contract;src/api/entities.tsis the only import pages use. - Auth — replace
src/api/auth.ts.AuthContextand the scope layer already consume aUserwith role and scope ids. - Agents and MCP —
src/lib/owliver/engine.tsseparates routing from skills. The skills become MCP tools over the same fact pack;route()becomes a model call that selects among them, withOWLIVER_DOCTRINEas the system prompt.OwliverAnsweris the response contract either way. - Skills and autonomy —
SKILLSinsrc/lib/owliver/skills.tsis the registry; the roster inAiConsole.tsxsays which agent owns which skills and at what autonomy. Raising an action object from PROPOSE to ACT is the one decision that needs a human policy behind it.