@njeybe/nativ 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -1
- package/README.md +17 -0
- package/dist/server/studio-ui/document.d.ts +3 -0
- package/dist/server/studio-ui/document.js +22 -0
- package/dist/server/studio-ui/pages/benchmarks/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/benchmarks/index.js +11 -0
- package/dist/server/studio-ui/pages/benchmarks/script.d.ts +1 -0
- package/dist/server/studio-ui/pages/benchmarks/script.js +104 -0
- package/dist/server/studio-ui/pages/benchmarks/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/benchmarks/styles.js +30 -0
- package/dist/server/studio-ui/pages/database/browser.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/browser.js +326 -0
- package/dist/server/studio-ui/pages/database/connection.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/connection.js +158 -0
- package/dist/server/studio-ui/pages/database/data-shell.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/data-shell.js +165 -0
- package/dist/server/studio-ui/pages/database/drift.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/drift.js +301 -0
- package/dist/server/studio-ui/pages/database/events.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/events.js +231 -0
- package/dist/server/studio-ui/pages/database/explorer.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/explorer.js +183 -0
- package/dist/server/studio-ui/pages/database/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/database/index.js +28 -0
- package/dist/server/studio-ui/pages/database/markup.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/markup.js +32 -0
- package/dist/server/studio-ui/pages/database/state.d.ts +2 -0
- package/dist/server/studio-ui/pages/database/state.js +57 -0
- package/dist/server/studio-ui/pages/database/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/database/styles.js +118 -0
- package/dist/server/studio-ui/pages/flow/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/flow/index.js +11 -0
- package/dist/server/studio-ui/pages/flow/layout.d.ts +1 -0
- package/dist/server/studio-ui/pages/flow/layout.js +105 -0
- package/dist/server/studio-ui/pages/flow/plan-view.d.ts +1 -0
- package/dist/server/studio-ui/pages/flow/plan-view.js +67 -0
- package/dist/server/studio-ui/pages/flow/script.d.ts +1 -0
- package/dist/server/studio-ui/pages/flow/script.js +61 -0
- package/dist/server/studio-ui/pages/flow/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/flow/styles.js +59 -0
- package/dist/server/studio-ui/pages/flow/timeline-model.d.ts +1 -0
- package/dist/server/studio-ui/pages/flow/timeline-model.js +95 -0
- package/dist/server/studio-ui/pages/flow/timeline-view.d.ts +1 -0
- package/dist/server/studio-ui/pages/flow/timeline-view.js +92 -0
- package/dist/server/studio-ui/pages/home/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/home/index.js +11 -0
- package/dist/server/studio-ui/pages/home/script.d.ts +1 -0
- package/dist/server/studio-ui/pages/home/script.js +160 -0
- package/dist/server/studio-ui/pages/home/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/home/styles.js +48 -0
- package/dist/server/studio-ui/pages/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/index.js +17 -0
- package/dist/server/studio-ui/pages/tasks/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/tasks/index.js +11 -0
- package/dist/server/studio-ui/pages/tasks/script.d.ts +1 -0
- package/dist/server/studio-ui/pages/tasks/script.js +96 -0
- package/dist/server/studio-ui/pages/tasks/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/tasks/styles.js +37 -0
- package/dist/server/studio-ui/pages/team/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/team/index.js +11 -0
- package/dist/server/studio-ui/pages/team/script.d.ts +1 -0
- package/dist/server/studio-ui/pages/team/script.js +112 -0
- package/dist/server/studio-ui/pages/team/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/team/styles.js +22 -0
- package/dist/server/studio-ui/pages/types.d.ts +13 -0
- package/dist/server/studio-ui/pages/types.js +1 -0
- package/dist/server/studio-ui/pages/worktrees/index.d.ts +2 -0
- package/dist/server/studio-ui/pages/worktrees/index.js +11 -0
- package/dist/server/studio-ui/pages/worktrees/script.d.ts +1 -0
- package/dist/server/studio-ui/pages/worktrees/script.js +104 -0
- package/dist/server/studio-ui/pages/worktrees/styles.d.ts +1 -0
- package/dist/server/studio-ui/pages/worktrees/styles.js +15 -0
- package/dist/server/studio-ui/shell/actions.d.ts +1 -0
- package/dist/server/studio-ui/shell/actions.js +49 -0
- package/dist/server/studio-ui/shell/boot.d.ts +2 -0
- package/dist/server/studio-ui/shell/boot.js +13 -0
- package/dist/server/studio-ui/shell/console.d.ts +1 -0
- package/dist/server/studio-ui/shell/console.js +194 -0
- package/dist/server/studio-ui/shell/core.d.ts +1 -0
- package/dist/server/studio-ui/shell/core.js +50 -0
- package/dist/server/studio-ui/shell/detail-view.d.ts +1 -0
- package/dist/server/studio-ui/shell/detail-view.js +80 -0
- package/dist/server/studio-ui/shell/detail.d.ts +1 -0
- package/dist/server/studio-ui/shell/detail.js +83 -0
- package/dist/server/studio-ui/shell/dispatch.d.ts +1 -0
- package/dist/server/studio-ui/shell/dispatch.js +156 -0
- package/dist/server/studio-ui/shell/events-tools.d.ts +1 -0
- package/dist/server/studio-ui/shell/events-tools.js +94 -0
- package/dist/server/studio-ui/shell/format.d.ts +1 -0
- package/dist/server/studio-ui/shell/format.js +151 -0
- package/dist/server/studio-ui/shell/icons.d.ts +2 -0
- package/dist/server/studio-ui/shell/icons.js +20 -0
- package/dist/server/studio-ui/shell/markup-head.d.ts +1 -0
- package/dist/server/studio-ui/shell/markup-head.js +43 -0
- package/dist/server/studio-ui/shell/markup-panels.d.ts +2 -0
- package/dist/server/studio-ui/shell/markup-panels.js +7 -0
- package/dist/server/studio-ui/shell/markup-tools.d.ts +1 -0
- package/dist/server/studio-ui/shell/markup-tools.js +222 -0
- package/dist/server/studio-ui/shell/model.d.ts +1 -0
- package/dist/server/studio-ui/shell/model.js +192 -0
- package/dist/server/studio-ui/shell/paint.d.ts +1 -0
- package/dist/server/studio-ui/shell/paint.js +154 -0
- package/dist/server/studio-ui/shell/palette-view.d.ts +1 -0
- package/dist/server/studio-ui/shell/palette-view.js +60 -0
- package/dist/server/studio-ui/shell/palette.d.ts +1 -0
- package/dist/server/studio-ui/shell/palette.js +80 -0
- package/dist/server/studio-ui/shell/pipeline-state.d.ts +1 -0
- package/dist/server/studio-ui/shell/pipeline-state.js +152 -0
- package/dist/server/studio-ui/shell/proposals.d.ts +1 -0
- package/dist/server/studio-ui/shell/proposals.js +197 -0
- package/dist/server/studio-ui/shell/pure.d.ts +3 -0
- package/dist/server/studio-ui/shell/pure.js +9 -0
- package/dist/server/studio-ui/shell/router.d.ts +1 -0
- package/dist/server/studio-ui/shell/router.js +95 -0
- package/dist/server/studio-ui/shell/sidebar-view.d.ts +1 -0
- package/dist/server/studio-ui/shell/sidebar-view.js +38 -0
- package/dist/server/studio-ui/shell/sync.d.ts +1 -0
- package/dist/server/studio-ui/shell/sync.js +120 -0
- package/dist/server/studio-ui/shell/toasts-format.d.ts +1 -0
- package/dist/server/studio-ui/shell/toasts-format.js +89 -0
- package/dist/server/studio-ui/shell/triage.d.ts +1 -0
- package/dist/server/studio-ui/shell/triage.js +210 -0
- package/dist/server/studio-ui/styles/console.d.ts +1 -0
- package/dist/server/studio-ui/styles/console.js +83 -0
- package/dist/server/studio-ui/styles/dialogs.d.ts +1 -0
- package/dist/server/studio-ui/styles/dialogs.js +118 -0
- package/dist/server/studio-ui/styles/responsive.d.ts +1 -0
- package/dist/server/studio-ui/styles/responsive.js +28 -0
- package/dist/server/studio-ui/styles/shell.d.ts +1 -0
- package/dist/server/studio-ui/styles/shell.js +117 -0
- package/dist/server/studio-ui/styles/strategist.d.ts +1 -0
- package/dist/server/studio-ui/styles/strategist.js +77 -0
- package/dist/server/studio-ui/styles/tokens-base.d.ts +1 -0
- package/dist/server/studio-ui/styles/tokens-base.js +131 -0
- package/dist/server/studio-ui.d.ts +1 -10
- package/dist/server/studio-ui.js +63 -5314
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/agents/architect.md +9 -5
- package/templates/GEMINI.md +12 -8
- package/templates/claude-agents/architect.md +9 -5
- package/templates/dot-ai/subagents/flutter-developer.md +10 -0
- package/templates/dot-ai/subagents/frontend.md +10 -0
- package/templates/dot-ai/ui_specs.md +36 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@njeybe/nativ",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Role-based multi-agent workflow harness: Claude Code by default, other AI agents pluggable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepare": "npm run build",
|
|
23
23
|
"prepublishOnly": "npm run build && node scripts/sync-plugin.mjs --check",
|
|
24
24
|
"start": "node bin/cli.js",
|
|
25
|
-
"test": "node tests/test-task-router.mjs && node tests/test-task-fields.mjs && node tests/test-design-templates.mjs && node tests/test-spec-slices.mjs && node tests/test-contract-generator.mjs && node tests/test-verify-gatekeeper.mjs && node tests/test-mcp-server.mjs && node tests/test-data-studio.mjs && node tests/test-fragmented-env.mjs && node tests/test-env-example-detection.mjs && node tests/test-contract-governor.mjs && node tests/test-worktree-lifecycle.mjs && node tests/test-agent-supervisor.mjs && node tests/test-concurrency-locks.mjs && node tests/test-telemetry-engine.mjs && node tests/test-benchmark-suite.mjs && node tests/test-providers.mjs && node tests/test-tier1-liaison.mjs && node tests/test-enforcement.mjs && node tests/test-setup-doctor.mjs && node tests/test-update.mjs && node tests/test-validate.mjs && node tests/test-plugin-manifest.mjs && node tests/test-code-shape.mjs && node tests/test-model-routing.mjs && node tests/test-v2-e2e.mjs && npx tsx tests/test-studio-pipeline-api.mjs && npx tsx tests/test-studio-light-ui.mjs"
|
|
25
|
+
"test": "node tests/test-task-router.mjs && node tests/test-task-fields.mjs && node tests/test-design-templates.mjs && node tests/test-spec-slices.mjs && node tests/test-contract-generator.mjs && node tests/test-verify-gatekeeper.mjs && node tests/test-mcp-server.mjs && node tests/test-data-studio.mjs && node tests/test-fragmented-env.mjs && node tests/test-env-example-detection.mjs && node tests/test-contract-governor.mjs && node tests/test-worktree-lifecycle.mjs && node tests/test-agent-supervisor.mjs && node tests/test-concurrency-locks.mjs && node tests/test-telemetry-engine.mjs && node tests/test-benchmark-suite.mjs && node tests/test-providers.mjs && node tests/test-tier1-liaison.mjs && node tests/test-enforcement.mjs && node tests/test-setup-doctor.mjs && node tests/test-update.mjs && node tests/test-validate.mjs && node tests/test-plugin-manifest.mjs && node tests/test-code-shape.mjs && node tests/test-model-routing.mjs && node tests/test-v2-e2e.mjs && npx tsx tests/test-studio-pipeline-api.mjs && npx tsx tests/test-studio-light-ui.mjs && npx tsx tests/test-studio-shell.mjs && npx tsx tests/test-studio-home.mjs && npx tsx tests/test-studio-tasks-view.mjs && npx tsx tests/test-studio-flow.mjs && npx tsx tests/test-studio-team.mjs && npx tsx tests/test-studio-redesign-e2e.mjs"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"ai",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nativ",
|
|
3
3
|
"displayName": "nativ",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"description": "Role-based multi-agent workflow for Claude Code: architect, worker and verifier agents, task-scope enforcement, and the nativ MCP server.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "JB Natividad"
|
|
@@ -14,7 +14,11 @@ Your job is design, not implementation. You turn a feature request or an escalat
|
|
|
14
14
|
## How you work
|
|
15
15
|
|
|
16
16
|
1. Orient: read `.ai/context.md`, then only the contract you are changing. For an escalation, read `nativ://escalation` and the blocked task (`nativ task list --status blocked --json`).
|
|
17
|
-
2.
|
|
17
|
+
2. **Pick the design track first** and record it in `.ai/ui_specs.md` under Planning Level. STOP and ask the owner to confirm it:
|
|
18
|
+
- **Experience-First (Outside-In):** UI flows and screen data needs drive the API contracts and the database schema. Order: UI specs, then API contracts, then database schema.
|
|
19
|
+
- **Data-First (Inside-Out):** the core database schema or pipeline models drive the API contracts and the UI views. Order: database schema, then API contracts, then UI specs.
|
|
20
|
+
|
|
21
|
+
Recommend Experience-First for user-facing products and Data-First for data pipelines or when the schema already exists. Design in the chosen order and **stop for the human's explicit approval after each step**. Do not start the next until the previous is approved.
|
|
18
22
|
3. Present each step in plain language: what changes for the user, why, what stays safe, and two or three options with the best marked `(Recommended)`. No raw stack traces.
|
|
19
23
|
4. After approval, write the contract. Claude Code will ask the human to confirm every write under `.ai/`; that prompt is the approval gate, so never try to route around it.
|
|
20
24
|
5. Prefer `nativ task propose-patch` for small additive changes: the Contract Governor checks them. Any `[DROPPED]` or `[DESTRUCTIVE]` change needs the human's explicit yes first.
|
|
@@ -23,7 +27,7 @@ Your job is design, not implementation. You turn a feature request or an escalat
|
|
|
23
27
|
|
|
24
28
|
## UI and UX design procedure
|
|
25
29
|
|
|
26
|
-
Use this for step
|
|
30
|
+
Use this for the UI step of the chosen track. Keep every message compact. Write the result into `.ai/ui_specs.md` under its existing headings.
|
|
27
31
|
|
|
28
32
|
1. **Planning level.** Pick one and say why: Quick (small change, reuse the existing look), Standard (new screens, one direction), Full (new product or a new look, two directions). The owner can override it.
|
|
29
33
|
2. **Start from the scan.** Use the deterministic scan in `.ai/context.md`. Do not read files one by one to learn the stack.
|
|
@@ -32,9 +36,9 @@ Use this for step 2's UI part. Keep every message compact. Write the result into
|
|
|
32
36
|
5. **Content first.** Write the top 3 to 5 user tasks with how often each happens, then real sample data for every screen, including extremes (empty, very long, very many).
|
|
33
37
|
6. **User flows.** One line per flow, with the tap or click count.
|
|
34
38
|
7. **Design brief (Standard and Full).** Before any direction, fill the Design Brief section of `.ai/ui_specs.md`: who uses it, the job they are doing, tone in three words, things to avoid. Also record the primary platform (web, mobile or both) there.
|
|
35
|
-
8. **Two directions (Full only).** Exactly two distinct design directions. Each gets a style tile: one small self-contained HTML page (about 2-3K tokens) at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Each tile shows a named palette, heading, body and number fonts, primary, secondary and danger buttons, one input, one card or list row with real content, the icon style, and corners, shadows and spacing. For mobile, render at phone width with a bottom nav, a list tile and a bottom sheet. Critique both against the design brief, the Anti-Generic Checklist and the platform rules, mark one `(Recommended)`, then STOP for the owner to pick. Keep the chosen tile as `.ai/design/style-tile.html` and delete the other.
|
|
36
|
-
9. **Wireframes.** ASCII
|
|
37
|
-
10. **Then** the component map, copy and wording,
|
|
39
|
+
8. **Two directions (Full only).** Exactly two distinct design directions. Each gets a style tile: one small self-contained HTML page (about 2-3K tokens) at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Each tile shows a named palette, heading, body and number fonts, primary, secondary and danger buttons, one input, one card or list row with real content, the icon style, and corners, shadows and spacing. For mobile, render at phone width with a bottom nav, a list tile and a bottom sheet. Make the type stack-aware (Contextual Typography): a consumer or brand product gets a distinct curated typeface; a data-dense B2B or utility product may use Inter, Roboto or native system type; Flutter maps to `textTheme`, and the tile should show that mapping. Style the tile with the project's own styling: for Tailwind or shadcn, its CSS variables (`--primary`, `--ring`, `--radius`); for Flutter, `ColorScheme` roles plus `ThemeExtension` tokens. Critique both against the design brief, the Anti-Generic Checklist and the platform rules, mark one `(Recommended)`, then STOP for the owner to pick. Keep the chosen tile as `.ai/design/style-tile.html` and delete the other.
|
|
40
|
+
9. **Wireframes.** Pick the format that fits: ASCII box art (at most 80 columns) for mobile screens and simple lists, or a Semantic Component Tree (indented hierarchy with layout notes such as split-view, v-stack, h-stack) for dense dashboards, data tables and responsive web views. Regions labeled by component, real content. One per key screen on desktop, plus mobile for the primary screen. Primary platform first. STOP for approval.
|
|
41
|
+
10. **Then** the component map, copy and wording, one or two signature moments, and the Mutation States (loading, optimistic update, rollback on failure) for each component that creates, updates or deletes.
|
|
38
42
|
|
|
39
43
|
Token limits: exactly two directions, style tiles only in Full, compact wireframes, questions batched.
|
|
40
44
|
|
package/templates/GEMINI.md
CHANGED
|
@@ -11,11 +11,15 @@ You design; you do not build. Turn a feature request into approved contracts in
|
|
|
11
11
|
### Phase 1: Discovery and design, with stops
|
|
12
12
|
|
|
13
13
|
1. Scan the repository and read `.ai/context.md`. If it is empty or stale, refresh it with the detected stack and guardrails.
|
|
14
|
-
2. **
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
2. **Pick the design track** and record it in `.ai/ui_specs.md` under Planning Level.
|
|
15
|
+
- **Experience-First (Outside-In):** UI flows and screen data needs drive the API and the schema. Order: UI, API, schema.
|
|
16
|
+
- **Data-First (Inside-Out):** the core schema or pipeline models drive the API and the UI views. Order: schema, API, UI.
|
|
17
|
+
|
|
18
|
+
Recommend Experience-First for user-facing products and Data-First for data pipelines or an existing schema.
|
|
19
|
+
STOP. Wait for the owner to confirm the track. Then design in that order and STOP for explicit approval after each step. Do not start the next until the previous is approved.
|
|
20
|
+
3. **Database schema.** Propose tables, columns, relations, types and indexes. Present them in plain language.
|
|
21
|
+
4. **API contracts.** Propose endpoints, methods, parameters, request and response shapes, and auth.
|
|
22
|
+
5. **UI and UX.** Keep messages compact and work in this order:
|
|
19
23
|
- Pick the planning level: Quick, Standard or Full. The owner can override it.
|
|
20
24
|
- Start from the deterministic scan in `.ai/context.md`, not from reading files.
|
|
21
25
|
- Ask one batch of at most 5 discovery questions, only ones that change the design.
|
|
@@ -23,10 +27,10 @@ You design; you do not build. Turn a feature request into approved contracts in
|
|
|
23
27
|
- Content first: the top 3 to 5 user tasks with frequency, and real sample data per screen, including extremes.
|
|
24
28
|
- User flows with tap or click counts.
|
|
25
29
|
- Standard and Full: before any direction, fill the Design Brief section of `.ai/ui_specs.md` (who uses it, the job, tone in three words, things to avoid) and record the primary platform (web, mobile or both).
|
|
26
|
-
- Full only: exactly two distinct directions, each a style tile (one small self-contained HTML page) at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Show a named palette, fonts, buttons, one input, one real card or row, icon style and corners, shadows and spacing; for mobile, phone width with bottom nav, list tile and bottom sheet. Critique both against the brief, the Anti-Generic Checklist and the platform rules, mark one `(Recommended)`, then STOP for the owner to pick. Keep the pick as `.ai/design/style-tile.html`, delete the other.
|
|
27
|
-
- ASCII
|
|
30
|
+
- Full only: exactly two distinct directions, each a style tile (one small self-contained HTML page) at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Make the type stack-aware (Contextual Typography): consumer or brand products get a distinct curated typeface, data-dense B2B or utility products may use Inter, Roboto or native system type, and Flutter maps to `textTheme`. Style the tile with the project's own styling: for Tailwind or shadcn, its CSS variables (`--primary`, `--ring`, `--radius`); for Flutter, `ColorScheme` roles plus `ThemeExtension` tokens. Show a named palette, fonts, buttons, one input, one real card or row, icon style and corners, shadows and spacing; for mobile, phone width with bottom nav, list tile and bottom sheet. Critique both against the brief, the Anti-Generic Checklist and the platform rules, mark one `(Recommended)`, then STOP for the owner to pick. Keep the pick as `.ai/design/style-tile.html`, delete the other.
|
|
31
|
+
- Wireframes, as ASCII box art (at most 80 columns, for mobile and simple lists) or a Semantic Component Tree (indented hierarchy with layout notes, for dense dashboards, tables and responsive web). Regions labeled by component, real content: desktop per key screen plus mobile for the primary screen, primary platform first.
|
|
28
32
|
STOP. Wait for explicit approval.
|
|
29
|
-
- Then the component map, copy and wording,
|
|
33
|
+
- Then the component map, copy and wording, one or two signature moments, and the Mutation States (loading, optimistic update, rollback on failure) for components that change data.
|
|
30
34
|
- Task breakdown: about one component or endpoint per task, at most 5 files, `acceptanceCriteria` in plain words (including which states apply), `specRefs` to exact `ui_specs.md` or `api_contracts.json` sections, `complexity` of `simple`, `standard` or `complex`, and dependencies that make parallel-safe work explicit. Use `nativ task add "<title>" --spec-refs <refs> --complexity <level> --accept "<done when>"`.
|
|
31
35
|
|
|
32
36
|
### Phase 2: Export
|
|
@@ -14,7 +14,11 @@ Your job is design, not implementation. You turn a feature request or an escalat
|
|
|
14
14
|
## How you work
|
|
15
15
|
|
|
16
16
|
1. Orient: read `.ai/context.md`, then only the contract you are changing. For an escalation, read `nativ://escalation` and the blocked task (`nativ task list --status blocked --json`).
|
|
17
|
-
2.
|
|
17
|
+
2. **Pick the design track first** and record it in `.ai/ui_specs.md` under Planning Level. STOP and ask the owner to confirm it:
|
|
18
|
+
- **Experience-First (Outside-In):** UI flows and screen data needs drive the API contracts and the database schema. Order: UI specs, then API contracts, then database schema.
|
|
19
|
+
- **Data-First (Inside-Out):** the core database schema or pipeline models drive the API contracts and the UI views. Order: database schema, then API contracts, then UI specs.
|
|
20
|
+
|
|
21
|
+
Recommend Experience-First for user-facing products and Data-First for data pipelines or when the schema already exists. Design in the chosen order and **stop for the human's explicit approval after each step**. Do not start the next until the previous is approved.
|
|
18
22
|
3. Present each step in plain language: what changes for the user, why, what stays safe, and two or three options with the best marked `(Recommended)`. No raw stack traces.
|
|
19
23
|
4. After approval, write the contract. Claude Code will ask the human to confirm every write under `.ai/`; that prompt is the approval gate, so never try to route around it.
|
|
20
24
|
5. Prefer `nativ task propose-patch` for small additive changes: the Contract Governor checks them. Any `[DROPPED]` or `[DESTRUCTIVE]` change needs the human's explicit yes first.
|
|
@@ -23,7 +27,7 @@ Your job is design, not implementation. You turn a feature request or an escalat
|
|
|
23
27
|
|
|
24
28
|
## UI and UX design procedure
|
|
25
29
|
|
|
26
|
-
Use this for step
|
|
30
|
+
Use this for the UI step of the chosen track. Keep every message compact. Write the result into `.ai/ui_specs.md` under its existing headings.
|
|
27
31
|
|
|
28
32
|
1. **Planning level.** Pick one and say why: Quick (small change, reuse the existing look), Standard (new screens, one direction), Full (new product or a new look, two directions). The owner can override it.
|
|
29
33
|
2. **Start from the scan.** Use the deterministic scan in `.ai/context.md`. Do not read files one by one to learn the stack.
|
|
@@ -32,9 +36,9 @@ Use this for step 2's UI part. Keep every message compact. Write the result into
|
|
|
32
36
|
5. **Content first.** Write the top 3 to 5 user tasks with how often each happens, then real sample data for every screen, including extremes (empty, very long, very many).
|
|
33
37
|
6. **User flows.** One line per flow, with the tap or click count.
|
|
34
38
|
7. **Design brief (Standard and Full).** Before any direction, fill the Design Brief section of `.ai/ui_specs.md`: who uses it, the job they are doing, tone in three words, things to avoid. Also record the primary platform (web, mobile or both) there.
|
|
35
|
-
8. **Two directions (Full only).** Exactly two distinct design directions. Each gets a style tile: one small self-contained HTML page (about 2-3K tokens) at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Each tile shows a named palette, heading, body and number fonts, primary, secondary and danger buttons, one input, one card or list row with real content, the icon style, and corners, shadows and spacing. For mobile, render at phone width with a bottom nav, a list tile and a bottom sheet. Critique both against the design brief, the Anti-Generic Checklist and the platform rules, mark one `(Recommended)`, then STOP for the owner to pick. Keep the chosen tile as `.ai/design/style-tile.html` and delete the other.
|
|
36
|
-
9. **Wireframes.** ASCII
|
|
37
|
-
10. **Then** the component map, copy and wording,
|
|
39
|
+
8. **Two directions (Full only).** Exactly two distinct design directions. Each gets a style tile: one small self-contained HTML page (about 2-3K tokens) at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Each tile shows a named palette, heading, body and number fonts, primary, secondary and danger buttons, one input, one card or list row with real content, the icon style, and corners, shadows and spacing. For mobile, render at phone width with a bottom nav, a list tile and a bottom sheet. Make the type stack-aware (Contextual Typography): a consumer or brand product gets a distinct curated typeface; a data-dense B2B or utility product may use Inter, Roboto or native system type; Flutter maps to `textTheme`, and the tile should show that mapping. Style the tile with the project's own styling: for Tailwind or shadcn, its CSS variables (`--primary`, `--ring`, `--radius`); for Flutter, `ColorScheme` roles plus `ThemeExtension` tokens. Critique both against the design brief, the Anti-Generic Checklist and the platform rules, mark one `(Recommended)`, then STOP for the owner to pick. Keep the chosen tile as `.ai/design/style-tile.html` and delete the other.
|
|
40
|
+
9. **Wireframes.** Pick the format that fits: ASCII box art (at most 80 columns) for mobile screens and simple lists, or a Semantic Component Tree (indented hierarchy with layout notes such as split-view, v-stack, h-stack) for dense dashboards, data tables and responsive web views. Regions labeled by component, real content. One per key screen on desktop, plus mobile for the primary screen. Primary platform first. STOP for approval.
|
|
41
|
+
10. **Then** the component map, copy and wording, one or two signature moments, and the Mutation States (loading, optimistic update, rollback on failure) for each component that creates, updates or deletes.
|
|
38
42
|
|
|
39
43
|
Token limits: exactly two directions, style tiles only in Full, compact wireframes, questions batched.
|
|
40
44
|
|
|
@@ -15,10 +15,17 @@ from the design, you do not redesign it. You do not make generic default-looking
|
|
|
15
15
|
`.ai/ui_specs.md` is the source of truth. Use these parts of it:
|
|
16
16
|
- **Design brief and chosen direction:** who uses it, the tone, what to avoid.
|
|
17
17
|
- **Wireframes:** the layout of each screen. Every labeled region is a widget.
|
|
18
|
+
It may be ASCII box art or a Semantic Component Tree. Build from either.
|
|
18
19
|
- **Component map:** the file path for each widget and which states it needs.
|
|
19
20
|
- **Copy and wording:** use the exact labels, button verbs and messages given there.
|
|
20
21
|
- **Real content samples:** test with long names, empty values and big numbers.
|
|
21
22
|
|
|
23
|
+
- **Semantic Component Trees:** when a screen uses one, build the same nesting and layout
|
|
24
|
+
notes (stacks, grids, split views). Each node is a widget.
|
|
25
|
+
- **Mutation States:** for every create, update or delete, build the behavior the spec gives
|
|
26
|
+
(optimistic or inline spinner, disabled submit, rollback on failure).
|
|
27
|
+
- **Contextual Typography:** use the `textTheme` role the spec names for each place.
|
|
28
|
+
|
|
22
29
|
If the wireframes or the component map do not cover what the task needs, escalate.
|
|
23
30
|
Do not invent the layout.
|
|
24
31
|
|
|
@@ -67,6 +74,9 @@ These match the Anti-Generic Checklist in `.ai/ui_specs.md`:
|
|
|
67
74
|
- Every icon-only button has a `Semantics` label. Text contrast is at least 4.5:1.
|
|
68
75
|
- Text follows the system font scale without clipping.
|
|
69
76
|
|
|
77
|
+
- Mutations: disable the submit while it runs and show progress next to it.
|
|
78
|
+
On failure, roll back and show the error message from the spec with a Retry.
|
|
79
|
+
|
|
70
80
|
## 9. Before you finish
|
|
71
81
|
1. Run the task's `verificationCommand`, plus `flutter analyze` and `flutter test`.
|
|
72
82
|
2. Check the source for emojis. There must be none.
|
|
@@ -14,10 +14,17 @@ from the design, you do not redesign it. You do not make generic AI-looking page
|
|
|
14
14
|
`.ai/ui_specs.md` is the source of truth. Use these parts of it:
|
|
15
15
|
- **Design brief and chosen direction:** who uses it, the tone, what to avoid.
|
|
16
16
|
- **Wireframes:** the layout of each screen. Every labeled region is a component.
|
|
17
|
+
It may be ASCII box art or a Semantic Component Tree. Build from either.
|
|
17
18
|
- **Component map:** the file path for each component and which states it needs.
|
|
18
19
|
- **Copy and wording:** use the exact labels, button verbs and messages given there.
|
|
19
20
|
- **Real content samples:** test with long names, empty values and big numbers.
|
|
20
21
|
|
|
22
|
+
- **Semantic Component Trees:** when a screen uses one, build the same nesting and layout
|
|
23
|
+
notes (grid, split-view, stacks). Each node is a component.
|
|
24
|
+
- **Mutation States:** for every create, update or delete, build the behavior the spec gives
|
|
25
|
+
(optimistic or inline spinner, disabled submit, rollback on failure).
|
|
26
|
+
- **Contextual Typography:** use the type role the spec names for each place, not one size.
|
|
27
|
+
|
|
21
28
|
If the wireframes or the component map do not cover what the task needs, escalate.
|
|
22
29
|
Do not invent the layout.
|
|
23
30
|
|
|
@@ -66,6 +73,9 @@ These match the Anti-Generic Checklist in `.ai/ui_specs.md`:
|
|
|
66
73
|
- Every icon-only button has an `aria-label`. Text contrast is at least 4.5:1.
|
|
67
74
|
- Use semantic tags: `header`, `nav`, `main`, `aside`, `section`.
|
|
68
75
|
|
|
76
|
+
- Mutations: disable the submit while it runs and show progress next to it.
|
|
77
|
+
On failure, roll back and show the error message from the spec with a Retry.
|
|
78
|
+
|
|
69
79
|
## 9. Before you finish
|
|
70
80
|
1. Run the task's `verificationCommand` (or `nativ verify <taskId>`).
|
|
71
81
|
2. Check the source for emojis. There must be none.
|
|
@@ -5,11 +5,16 @@ Plain language, concise. The Architect fills this in; workers follow it. Tasks p
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Planning Level
|
|
8
|
-
Pick one and write
|
|
8
|
+
Pick one level and design track and write them here:
|
|
9
|
+
- **Level:** Quick | Standard | Full
|
|
10
|
+
- **Track:** Experience-First (Outside-In) | Data-First (Inside-Out)
|
|
9
11
|
|
|
10
12
|
- **Quick:** small fix, fast-path task, no design phase.
|
|
11
|
-
- **Standard:** new screen in an existing design. Flow + wireframe + component map. Reuse existing tokens.
|
|
12
|
-
- **Full:** new app, new platform or redesign. Discovery questions, brief, flows, two directions with style tiles, wireframes, component map.
|
|
13
|
+
- **Standard:** new screen in an existing design. Flow + wireframe or component tree + component map. Reuse existing tokens.
|
|
14
|
+
- **Full:** new app, new platform or redesign. Discovery questions, brief, flows, two directions with style tiles, wireframes or component trees, component map.
|
|
15
|
+
|
|
16
|
+
- **Experience-First (Outside-In):** UI flows and screen data needs drive API contracts and DB schema.
|
|
17
|
+
- **Data-First (Inside-Out):** Core database schema or pipeline models drive API contracts and UI views.
|
|
13
18
|
|
|
14
19
|
---
|
|
15
20
|
|
|
@@ -106,7 +111,11 @@ Placeholders the Architect fills, each with a one-line rationale. Do not copy a
|
|
|
106
111
|
---
|
|
107
112
|
|
|
108
113
|
## Wireframes
|
|
109
|
-
|
|
114
|
+
Choose the format that best communicates the layout:
|
|
115
|
+
1. **ASCII Box Art:** Max 80 columns. Best for mobile screens, simple CRUD lists, and master-detail views.
|
|
116
|
+
2. **Semantic Component Tree:** Indented hierarchy with layout annotations (e.g. grid, split-view, v-stack, h-stack). Best for dense dashboards, data tables, and responsive multi-column web views.
|
|
117
|
+
|
|
118
|
+
Label each region `<ComponentName>`. One desktop wireframe per key screen, plus mobile for the primary screen. Use real content. No HTML mockups.
|
|
110
119
|
|
|
111
120
|
```
|
|
112
121
|
+--------------------------------------------------+
|
|
@@ -118,6 +127,20 @@ ASCII box-drawing, max 80 columns. Label each region `<ComponentName>`. One desk
|
|
|
118
127
|
+----------+---------------------------------------+
|
|
119
128
|
```
|
|
120
129
|
|
|
130
|
+
Or Semantic Component Tree:
|
|
131
|
+
```yaml
|
|
132
|
+
Screen: AppointmentDashboard (Desktop 1280px+)
|
|
133
|
+
Layout: SplitView (sidebar: 240px, content: 1fr)
|
|
134
|
+
Tree:
|
|
135
|
+
- <AppSidebar (sticky, h-full)>:
|
|
136
|
+
- <ClinicBrandHeader title="Clinic Dela Cruz">
|
|
137
|
+
- <NavMenu active="today" items=["Today", "Patients"]>
|
|
138
|
+
- <MainContainer (v-stack, gap-6, p-6)>:
|
|
139
|
+
- <AppointmentFilterBar (h-stack, justify-between)>
|
|
140
|
+
- <AppointmentList (v-stack, gap-3)>:
|
|
141
|
+
- Columns: [Time, PatientName, StatusBadge, ActionButtons]
|
|
142
|
+
```
|
|
143
|
+
|
|
121
144
|
---
|
|
122
145
|
|
|
123
146
|
## Component Map
|
|
@@ -127,7 +150,13 @@ ASCII box-drawing, max 80 columns. Label each region `<ComponentName>`. One desk
|
|
|
127
150
|
| | | | | [appointment-list](#appointment-list) |
|
|
128
151
|
|
|
129
152
|
### appointment-list
|
|
130
|
-
Example component section. One per component: purpose, data, states, behavior. Keep the heading anchor stable.
|
|
153
|
+
Example component section. One per component: purpose, data, states, mutations, behavior. Keep the heading anchor stable.
|
|
154
|
+
- **Purpose:** Display upcoming patient appointments with instant check-in.
|
|
155
|
+
- **Data:** `Appointment[]` from `api_contracts.json#GET /appointments`.
|
|
156
|
+
- **States:** Loading skeleton (3 rows), Empty (prompt to book), Error (inline retry).
|
|
157
|
+
- **Mutations:**
|
|
158
|
+
- *Check in:* Inline button spinner -> optimistic status badge change to Checked In.
|
|
159
|
+
- *Cancel:* Confirm dialog -> optimistic remove. On error: rollback item with error toast.
|
|
131
160
|
|
|
132
161
|
---
|
|
133
162
|
|
|
@@ -147,7 +176,7 @@ One or two. Everything else stays restrained.
|
|
|
147
176
|
|
|
148
177
|
## Anti-Generic Checklist
|
|
149
178
|
**Web**
|
|
150
|
-
- [ ] No
|
|
179
|
+
- [ ] No unconsidered font defaults. Consumer/brand: distinct curated typeface (e.g. Outfit, Plus Jakarta Sans, DM Sans). Data-dense B2B SaaS/utility: Inter, Roboto, or native system type permitted for density and zero-FOIT. No unstyled browser defaults without a reason.
|
|
151
180
|
- [ ] No default indigo/purple accent.
|
|
152
181
|
- [ ] No rows of identical cards with pastel icon boxes.
|
|
153
182
|
- [ ] No gradient-text hero.
|
|
@@ -172,6 +201,7 @@ Every component and view covers these.
|
|
|
172
201
|
| **Error** | Plain diagnosis with a Retry action. |
|
|
173
202
|
| **Success** | Clear confirmation. |
|
|
174
203
|
| **Disabled** | Visibly inactive, with a reason where useful. |
|
|
204
|
+
| **Mutation / Action** | Behavior during Create/Update/Delete (optimistic vs inline spinner, disabled submit, rollback on failure). |
|
|
175
205
|
| **Mobile only** | Offline, slow connection, permission denied. |
|
|
176
206
|
|
|
177
207
|
---
|