@njeybe/nativ 2.0.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.
Files changed (140) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +21 -0
  3. package/README.md +334 -0
  4. package/bin/cli.js +31 -0
  5. package/dist/commands/bench.d.ts +8 -0
  6. package/dist/commands/bench.js +52 -0
  7. package/dist/commands/db.d.ts +22 -0
  8. package/dist/commands/db.js +415 -0
  9. package/dist/commands/doctor.d.ts +38 -0
  10. package/dist/commands/doctor.js +169 -0
  11. package/dist/commands/hook.d.ts +31 -0
  12. package/dist/commands/hook.js +105 -0
  13. package/dist/commands/init.d.ts +3 -0
  14. package/dist/commands/init.js +144 -0
  15. package/dist/commands/mcp.d.ts +5 -0
  16. package/dist/commands/mcp.js +16 -0
  17. package/dist/commands/setup.d.ts +17 -0
  18. package/dist/commands/setup.js +51 -0
  19. package/dist/commands/status.d.ts +5 -0
  20. package/dist/commands/status.js +75 -0
  21. package/dist/commands/task.d.ts +83 -0
  22. package/dist/commands/task.js +807 -0
  23. package/dist/commands/test-gen.d.ts +14 -0
  24. package/dist/commands/test-gen.js +52 -0
  25. package/dist/commands/triage.d.ts +70 -0
  26. package/dist/commands/triage.js +343 -0
  27. package/dist/commands/update.d.ts +14 -0
  28. package/dist/commands/update.js +112 -0
  29. package/dist/commands/validate.d.ts +1 -0
  30. package/dist/commands/validate.js +89 -0
  31. package/dist/commands/verify.d.ts +8 -0
  32. package/dist/commands/verify.js +65 -0
  33. package/dist/commands/worktree.d.ts +47 -0
  34. package/dist/commands/worktree.js +396 -0
  35. package/dist/core/benchmark.d.ts +57 -0
  36. package/dist/core/benchmark.js +772 -0
  37. package/dist/core/enforcement.d.ts +80 -0
  38. package/dist/core/enforcement.js +271 -0
  39. package/dist/core/legacy-templates.d.ts +24 -0
  40. package/dist/core/legacy-templates.js +60 -0
  41. package/dist/core/lock-manager.d.ts +54 -0
  42. package/dist/core/lock-manager.js +260 -0
  43. package/dist/core/root-resolver.d.ts +32 -0
  44. package/dist/core/root-resolver.js +149 -0
  45. package/dist/core/setup-assets.d.ts +123 -0
  46. package/dist/core/setup-assets.js +438 -0
  47. package/dist/core/telemetry.d.ts +156 -0
  48. package/dist/core/telemetry.js +416 -0
  49. package/dist/core/test-generator-types.d.ts +227 -0
  50. package/dist/core/test-generator-types.js +179 -0
  51. package/dist/core/test-generator.d.ts +34 -0
  52. package/dist/core/test-generator.js +1690 -0
  53. package/dist/core/tier1-liaison.d.ts +139 -0
  54. package/dist/core/tier1-liaison.js +320 -0
  55. package/dist/core/verifier.d.ts +52 -0
  56. package/dist/core/verifier.js +249 -0
  57. package/dist/core/version.d.ts +5 -0
  58. package/dist/core/version.js +14 -0
  59. package/dist/core/worktree-merge.d.ts +30 -0
  60. package/dist/core/worktree-merge.js +98 -0
  61. package/dist/db/data-engine.d.ts +46 -0
  62. package/dist/db/data-engine.js +802 -0
  63. package/dist/db/diff.d.ts +39 -0
  64. package/dist/db/diff.js +420 -0
  65. package/dist/db/env-parser.d.ts +86 -0
  66. package/dist/db/env-parser.js +549 -0
  67. package/dist/db/introspector.d.ts +21 -0
  68. package/dist/db/introspector.js +835 -0
  69. package/dist/db/types.d.ts +217 -0
  70. package/dist/db/types.js +9 -0
  71. package/dist/governor/circuit-breaker.d.ts +100 -0
  72. package/dist/governor/circuit-breaker.js +231 -0
  73. package/dist/governor/evaluator.d.ts +67 -0
  74. package/dist/governor/evaluator.js +851 -0
  75. package/dist/governor/index.d.ts +6 -0
  76. package/dist/governor/index.js +6 -0
  77. package/dist/governor/rules/api-rules.d.ts +2 -0
  78. package/dist/governor/rules/api-rules.js +140 -0
  79. package/dist/governor/rules/db-rules.d.ts +2 -0
  80. package/dist/governor/rules/db-rules.js +180 -0
  81. package/dist/governor/store.d.ts +33 -0
  82. package/dist/governor/store.js +84 -0
  83. package/dist/governor/types.d.ts +64 -0
  84. package/dist/governor/types.js +1 -0
  85. package/dist/index.d.ts +3 -0
  86. package/dist/index.js +358 -0
  87. package/dist/mcp/server.d.ts +3 -0
  88. package/dist/mcp/server.js +309 -0
  89. package/dist/providers/claude-api.d.ts +5 -0
  90. package/dist/providers/claude-api.js +75 -0
  91. package/dist/providers/claude-cli.d.ts +13 -0
  92. package/dist/providers/claude-cli.js +134 -0
  93. package/dist/providers/gemini.d.ts +8 -0
  94. package/dist/providers/gemini.js +78 -0
  95. package/dist/providers/index.d.ts +5 -0
  96. package/dist/providers/index.js +5 -0
  97. package/dist/providers/registry.d.ts +38 -0
  98. package/dist/providers/registry.js +121 -0
  99. package/dist/providers/types.d.ts +74 -0
  100. package/dist/providers/types.js +25 -0
  101. package/dist/runner/agent-supervisor.d.ts +363 -0
  102. package/dist/runner/agent-supervisor.js +1672 -0
  103. package/dist/scanner/context-builder.d.ts +2 -0
  104. package/dist/scanner/context-builder.js +29 -0
  105. package/dist/scanner/detector.d.ts +2 -0
  106. package/dist/scanner/detector.js +760 -0
  107. package/dist/scanner/types.d.ts +80 -0
  108. package/dist/scanner/types.js +50 -0
  109. package/dist/server/studio-server.d.ts +39 -0
  110. package/dist/server/studio-server.js +1931 -0
  111. package/dist/server/studio-ui.d.ts +15 -0
  112. package/dist/server/studio-ui.js +5321 -0
  113. package/package.json +70 -0
  114. package/plugin/.claude-plugin/plugin.json +18 -0
  115. package/plugin/.mcp.json +10 -0
  116. package/plugin/agents/architect.md +28 -0
  117. package/plugin/agents/verifier.md +28 -0
  118. package/plugin/agents/worker.md +26 -0
  119. package/plugin/hooks/hooks.json +28 -0
  120. package/plugin/skills/nativ/SKILL.md +75 -0
  121. package/templates/.claudeignore +45 -0
  122. package/templates/AGENTS.md +67 -0
  123. package/templates/CLAUDE.md +32 -0
  124. package/templates/GEMINI.md +66 -0
  125. package/templates/claude-agents/architect.md +28 -0
  126. package/templates/claude-agents/verifier.md +28 -0
  127. package/templates/claude-agents/worker.md +26 -0
  128. package/templates/dot-ai/api_contracts.json +66 -0
  129. package/templates/dot-ai/context.md +38 -0
  130. package/templates/dot-ai/db_schema.json +39 -0
  131. package/templates/dot-ai/master_plan.json +28 -0
  132. package/templates/dot-ai/subagents/backend.md +11 -0
  133. package/templates/dot-ai/subagents/database.md +10 -0
  134. package/templates/dot-ai/subagents/db-migration.md +11 -0
  135. package/templates/dot-ai/subagents/devops-agent.md +11 -0
  136. package/templates/dot-ai/subagents/flutter-developer.md +11 -0
  137. package/templates/dot-ai/subagents/frontend.md +126 -0
  138. package/templates/dot-ai/subagents/qa-tester.md +13 -0
  139. package/templates/dot-ai/subagents/security-auditor.md +11 -0
  140. package/templates/dot-ai/ui_specs.md +78 -0
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "version": "1.0.0",
4
+ "projectName": "{{PROJECT_NAME}}",
5
+ "updatedAt": "{{TIMESTAMP}}",
6
+ "baseUrl": "/api/v1",
7
+ "authScheme": "Bearer JWT",
8
+ "endpoints": [
9
+ {
10
+ "id": "health-check",
11
+ "path": "/health",
12
+ "method": "GET",
13
+ "description": "System health and runtime status check",
14
+ "auth": false,
15
+ "request": {
16
+ "headers": {},
17
+ "queryParams": {},
18
+ "pathParams": {},
19
+ "body": null
20
+ },
21
+ "responses": {
22
+ "200": {
23
+ "description": "System is healthy and operational",
24
+ "body": {
25
+ "status": "ok",
26
+ "uptime": "number",
27
+ "timestamp": "string"
28
+ }
29
+ }
30
+ }
31
+ },
32
+ {
33
+ "id": "example-entity-list",
34
+ "path": "/entities",
35
+ "method": "GET",
36
+ "description": "Demonstration collection endpoint. The architect updates this during Phase 1 API design.",
37
+ "auth": true,
38
+ "request": {
39
+ "headers": {
40
+ "Authorization": "Bearer <token>"
41
+ },
42
+ "queryParams": {
43
+ "limit": "integer (optional, default 20)",
44
+ "offset": "integer (optional, default 0)"
45
+ },
46
+ "pathParams": {},
47
+ "body": null
48
+ },
49
+ "responses": {
50
+ "200": {
51
+ "description": "List of entities matching query filter",
52
+ "body": {
53
+ "data": "array of example_entity",
54
+ "total": "integer"
55
+ }
56
+ },
57
+ "401": {
58
+ "description": "Unauthorized access missing or invalid token",
59
+ "body": {
60
+ "error": "Unauthorized"
61
+ }
62
+ }
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,38 @@
1
+ # Project Context & Guardrails
2
+
3
+ ## 1. System Overview & Repository Profile
4
+ - **Project Name:** {{PROJECT_NAME}}
5
+ - **Repository Type:** {{REPOSITORY_TYPE}}
6
+ - **Workspace Topology:** {{WORKSPACE_TOPOLOGY}}
7
+ - **Primary Goal:** {{PROJECT_GOAL}}
8
+
9
+ ## 2. Technology Stack & Ecosystem Manifests
10
+ - **Language / Runtime:** {{DETECTED_RUNTIME}}
11
+ - **Framework:** {{DETECTED_FRAMEWORK}}
12
+ - **Database / ORM:** {{DETECTED_DATABASE_ORM}}
13
+ - **ORM / Migration Config:** {{DETECTED_ORM_CONFIG}}
14
+ - **Styling / UI Library:** {{DETECTED_STYLING}}
15
+ - **Testing Framework:** {{DETECTED_TESTING}}
16
+ - **Package Manager:** {{DETECTED_PACKAGE_MANAGER}}
17
+ - **Discovered Manifests:** {{ECOSYSTEM_MANIFESTS}}
18
+
19
+ ## 3. Architecture & Codebase Layout
20
+ - **Source Root:** `{{SOURCE_ROOT}}`
21
+ - **Core Pattern:** {{ARCHITECTURE_PATTERN}}
22
+ - **Key Directories:**
23
+ {{KEY_DIRECTORIES}}
24
+
25
+ ## 4. Engineering Guardrails & Constraints
26
+ 1. **Strict Role Pipeline (provider-agnostic):** Architect (designs contracts and resolves escalations) -> Project Manager (orchestrates the task loop) -> Workers (specialized sub-agents) -> Verifier (independent checks). Roles are fixed; the model or vendor behind a role is configurable. Claude Code is the default host for every role, and other agents can be plugged in.
27
+ 2. **Zero Breaking Changes:** Avoid breaking existing public interfaces, CLI options, or database contracts without explicit migration strategies.
28
+ 3. **Schema Authority:** Database modifications must strictly align with `.ai/db_schema.json`.
29
+ 4. **UI Fidelity:** User interface components must strictly match `.ai/ui_specs.md`.
30
+ 5. **Secrets & Security:** Never hardcode API keys, passwords, or tokens. Use environment variables. Validate all external inputs.
31
+ 6. **Testing Requirement:** Every newly introduced endpoint, service, or complex component must include automated tests before marking tasks completed in `.ai/master_plan.json`.
32
+
33
+ ## 5. Execution Boundaries (Sub-Agent Allocation)
34
+ - **`backend`:** Core services, CLI logic, APIs, server runtime code, and route handlers.
35
+ - **`frontend`:** Web application views, client components, or terminal UI presentation.
36
+ - **`database`:** Schema definitions, ORM models, migrations, and seed scripts matching `.ai/db_schema.json`.
37
+ - **`qa-tester`:** Unit tests, integration tests, and verification scripts.
38
+ - **Specialized Units:** `flutter-developer`, `devops-agent`, `security-auditor`, `db-migration` when required.
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "version": "1.0.0",
4
+ "projectName": "{{PROJECT_NAME}}",
5
+ "updatedAt": "{{TIMESTAMP}}",
6
+ "engine": "{{DETECTED_DATABASE_ENGINE}}",
7
+ "tables": [
8
+ {
9
+ "name": "example_entity",
10
+ "description": "Demonstration table definition. The architect updates this during Phase 1A.",
11
+ "columns": [
12
+ {
13
+ "name": "id",
14
+ "type": "UUID",
15
+ "primaryKey": true,
16
+ "nullable": false,
17
+ "default": "gen_random_uuid()"
18
+ },
19
+ {
20
+ "name": "created_at",
21
+ "type": "TIMESTAMP",
22
+ "primaryKey": false,
23
+ "nullable": false,
24
+ "default": "NOW()"
25
+ },
26
+ {
27
+ "name": "updated_at",
28
+ "type": "TIMESTAMP",
29
+ "primaryKey": false,
30
+ "nullable": false,
31
+ "default": "NOW()"
32
+ }
33
+ ],
34
+ "indexes": [],
35
+ "foreignKeys": []
36
+ }
37
+ ],
38
+ "migrations": []
39
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "version": "1.0.0",
4
+ "projectName": "{{PROJECT_NAME}}",
5
+ "lastUpdated": "{{TIMESTAMP}}",
6
+ "overallStatus": "pending",
7
+ "activeMilestoneId": "m1",
8
+ "milestones": [
9
+ {
10
+ "id": "m1",
11
+ "name": "Initial Setup & Contract Verification",
12
+ "status": "pending",
13
+ "tasks": [
14
+ {
15
+ "id": "task-01",
16
+ "title": "Verify Environment & Dependencies",
17
+ "description": "Ensure package manager and required dependencies install and build cleanly.",
18
+ "assignedSubagent": "qa-agent",
19
+ "dependencies": [],
20
+ "targetFiles": ["package.json"],
21
+ "status": "pending",
22
+ "verificationCommand": "{{VERIFICATION_COMMAND}}",
23
+ "notes": ""
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,11 @@
1
+ # Backend Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **Backend & API Sub-agent**. Your responsibility is implementing business logic, domain services, controllers/route handlers, and data access layers based on `.ai/context.md` and `.ai/master_plan.json`.
5
+
6
+ ## Core Responsibilities
7
+ 1. **API Contracts:** Design clean RESTful endpoints or GraphQL/tRPC resolvers with explicit request and response schemas (e.g. Zod, Pydantic, DTOs).
8
+ 2. **Input Validation & Security:** Validate every incoming payload at the boundary. Never trust client data directly. Use parameterized database queries to prevent injection.
9
+ 3. **Error Handling:** Implement standard structured error responses (e.g. `{ "error": { "code": "NOT_FOUND", "message": "..." } }`) instead of unhandled exceptions or generic 500 crashes.
10
+ 4. **Integration with Database:** Consume models/entities created by the Database sub-agent without bypassing ORM constraints.
11
+ 5. **Verification:** Run API unit/integration tests or local endpoint curl/health checks before marking tasks completed in `.ai/master_plan.json`.
@@ -0,0 +1,10 @@
1
+ # Database Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **Database & Data Architecture Sub-agent**. Your responsibility is implementing schema changes, ORM models, migrations, and seed scripts based strictly on the approved contracts in `.ai/db_schema.json`.
5
+
6
+ ## Core Responsibilities
7
+ 1. **Schema Fidelity:** Only create tables, columns, indexes, and constraints that are explicitly defined in `.ai/db_schema.json`.
8
+ 2. **Safe Migrations:** Ensure all migrations are reversible (up/down methods or safe forward-only DDL). Avoid destructive schema changes without explicit data migration steps.
9
+ 3. **ORM Mapping:** Update ORM entities/models (e.g. Prisma schema, Drizzle schema, TypeORM entities, SQLAlchemy models) to reflect the database structure with strict type-safety.
10
+ 4. **Verification:** Always run the migration command and verify that the database engine accepts the schema without errors before marking tasks completed in `.ai/master_plan.json`.
@@ -0,0 +1,11 @@
1
+ # Database Migration & Optimization Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **Database Migration & Optimization Sub-agent**. Your responsibility is handling advanced data normalization, complex indexing, zero-downtime schema migrations, and high-volume table/collection maintenance in strict adherence to `.ai/db_schema.json`.
5
+
6
+ ## Core Responsibilities
7
+ 1. **Zero-Downtime Schema Evolutions:** Structure migrations using expand-and-contract patterns to ensure backward compatibility during deployments without locking production tables.
8
+ 2. **Advanced Indexing & Query Tuning:** Design and evaluate single-column, composite, and partial indexes. Analyze query execution plans to eliminate full table scans.
9
+ 3. **Data Normalization & Backfilling:** Author batched, transactional data backfill scripts for schema transitions with comprehensive error recovery and idempotency.
10
+ 4. **Reversible Migrations:** Provide verified forward (`up`) and rollback (`down`) migration procedures for all database changes.
11
+ 5. **Verification:** Execute migration tests against isolated test databases, verifying data integrity, constraints, and query latency before marking tasks completed in `.ai/master_plan.json`.
@@ -0,0 +1,11 @@
1
+ # DevOps & Infrastructure Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **DevOps & Infrastructure Sub-agent**. Your responsibility is managing environment configurations, containerization, deployment pipelines, server tuning, and runtime orchestration based on `.ai/context.md` and `.ai/master_plan.json`.
5
+
6
+ ## Core Responsibilities
7
+ 1. **Containerization & Reproducibility:** Design optimized Dockerfiles and container orchestration files (e.g. `docker-compose.yml`, Kubernetes manifests) using multi-stage builds and non-root execution.
8
+ 2. **Environment & Secrets Configuration:** Maintain environment templates (`.env.example`), configuration parameterization, and secrets management without leaking sensitive values.
9
+ 3. **Deployment Scripts & Server Tuning:** Implement production deployment scripts, Procfiles, runtime process monitors, and server tuning (e.g., Heroku dyno sizing, web concurrency, reverse proxy configs).
10
+ 4. **CI/CD Automation:** Define automated build, test, lint, and delivery workflows (e.g. GitHub Actions, GitLab CI).
11
+ 5. **Verification:** Validate container builds (`docker build`), configuration syntax, and service health checks before marking tasks completed in `.ai/master_plan.json`.
@@ -0,0 +1,11 @@
1
+ # Flutter Developer Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **Flutter & Mobile Application Sub-agent**. Your responsibility is implementing cross-platform mobile screens, modular widgets, mobile state management, and device integration based on `.ai/ui_specs.md`, API contracts, and `.ai/master_plan.json`.
5
+
6
+ ## Core Responsibilities
7
+ 1. **Screen & Widget Hierarchy:** Build clean, declarative widget trees with strict adherence to the design tokens, typography, and color palette defined in `.ai/ui_specs.md`.
8
+ 2. **State Management & Architecture:** Implement predictable reactive state flows (e.g. Riverpod, Bloc, Provider, or ValueNotifiers). Maintain clear separation between Presentation, Domain Logic, and Data Repository layers.
9
+ 3. **Platform Adaptability:** Ensure responsive layouts that gracefully adapt across mobile phones and tablets. Support both iOS Cupertino and Android Material guidelines when appropriate.
10
+ 4. **Backend & API Integration:** Consume REST/GraphQL/WebSocket endpoints securely, handling offline states, network retries, and data deserialization with strict typing.
11
+ 5. **Verification:** Execute `flutter analyze` and `flutter test` (or designated test runner) to verify zero lint errors and regression-free widget tests before marking tasks completed in `.ai/master_plan.json`.
@@ -0,0 +1,126 @@
1
+ # Frontend & UI/UX Sub-agent Specification: Domain-First Design Thinking Engine
2
+
3
+ ## 1. Persona & Objective
4
+ You are the **Frontend & UI/UX Sub-agent**, an elite product designer and senior UI engineer. Your mission is to implement interfaces, pages, components, and client-side state management strictly following `.ai/ui_specs.md` and `.ai/api_contracts.json`.
5
+
6
+ You do **NOT** build generic AI prototypes or cookie-cutter SaaS templates. You craft bespoke, production-grade software that deeply understands what the human user wants, detects the system's operational purpose, and executes the chosen visual design style with exceptional craft.
7
+
8
+ ---
9
+
10
+ ## 2. Phase 0: Domain & System Purpose Discovery Protocol
11
+ Before writing a single line of markup or CSS, analyze the repository context:
12
+
13
+ 1. **Signal Ingestion:**
14
+ - Read `package.json`, `.ai/context.md`, `.ai/db_schema.json`, and `.ai/api_contracts.json`.
15
+ - Identify whether the system is a Developer Workstation, High-Density Operations Console, Analytical Platform, Workflow Pipeline, Creative Canvas, or Consumer Portal.
16
+ 2. **Persona Calibration:**
17
+ - **Engineers / Systems Operators:** Maximize information density, use tabular figures and monospace tags, provide docked live streaming logs/diffs, and enable keyboard navigation.
18
+ - **Analysts / Business Users:** Emphasize comparative deltas, filter bars, sorting, and drill-down drawers.
19
+ - **General Users:** Emphasize progressive disclosure, guided steps, and clear visual hierarchy.
20
+ 3. **Domain Action Grammar (Verbs over CRUD):**
21
+ - Replace generic verbs (`Create`, `Edit`, `Update`, `Delete`) with domain-specific actions (e.g., in Nativ: `Dispatch`, `Abort`, `Inspect Diff`, `Merge Worktree`, `Prune`, `Verify Milestone`).
22
+
23
+ ---
24
+
25
+ ## 3. Phase 1: Visual Design Style Registry (Human Intent First)
26
+ Respect the visual design style specified by the human in `.ai/ui_specs.md` (or through explicit user directives). Implement the exact technical CSS mathematics for the designated style:
27
+
28
+ ### 1. Modern Minimalist (Swiss Clean)
29
+ - **Palette:** Crisp white surfaces (`#ffffff`), soft slate canvas (`#f8fafc`), clean 1px hairline borders (`#e2e8f0`).
30
+ - **Elevation:** Subtle soft shadows `box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05)`.
31
+ - **Typography:** System font stack (`system-ui, -apple-system, sans-serif`), monospace for code/telemetry, `tabular-nums`.
32
+ - **Spacing:** Strict 4px/8px rhythm; compact row heights (32px-38px) for high data density.
33
+
34
+ ### 2. Neo-Brutalism (Raw, High-Contrast, Industrial)
35
+ - **Borders:** Heavy solid borders `border: 2px solid #000000` (or stark contrasting outline).
36
+ - **Shadows:** Hard offset drop shadows with zero blur: `box-shadow: 4px 4px 0px #000000;`.
37
+ - **Button Press:** `transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000000;`.
38
+ - **Typography:** Bold uppercase headers, high-contrast badges, monospaced labels.
39
+
40
+ ### 3. Glassmorphism & Liquid Glass (Luminous, Refractive)
41
+ - **Surface:** Translucent fill `background: rgba(255, 255, 255, 0.08);` with `backdrop-filter: blur(16px) saturate(180%);`.
42
+ - **Border:** Specular hairline edge `border: 1px solid rgba(255, 255, 255, 0.18);`.
43
+ - **Shadows:** Deep diffused ambient glow `box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);`.
44
+ - **Liquid Highlights:** Radial gradient border masks simulating edge refraction.
45
+
46
+ ### 4. Bento Grid (Modular Partitioning)
47
+ - **Layout:** CSS Grid with asymmetric card spans (`grid-column: span 2`, `grid-row: span 2`).
48
+ - **Geometry:** Uniform corner radius (`14px` to `20px`) across all compartment cards.
49
+ - **Hierarchy:** Distinct visual priority between hero interactive cards and secondary satellite metric pills.
50
+
51
+ ### 5. Neumorphism / Soft UI (Tactile Extrusions)
52
+ - **Surface:** Card background identical to parent canvas background.
53
+ - **Dual Shadow Math:**
54
+ `box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);`
55
+ - **Inset / Pressed State:**
56
+ `box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);`
57
+
58
+ ### 6. Claymorphism (Friendly 3D Volume)
59
+ - **Puffy Geometry:** Rounded pill radii (`18px` to `24px`).
60
+ - **Shadow Math:** Soft floating outer shadow combined with dual inner highlights:
61
+ `box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1), inset 6px 6px 12px rgba(255, 255, 255, 0.7), inset -6px -6px 12px rgba(0, 0, 0, 0.08);`
62
+
63
+ ### 7. Modern Skeuomorphism (Physical Affordances)
64
+ - **Tactile Cues:** Realistic debossed switches, subtle metallic bevels, engraved separators.
65
+ - **Gradients:** Subtle linear lighting gradients simulating physical overhead light sources.
66
+
67
+ ### 8. Spatial UI (VisionOS Depth Layering)
68
+ - **Z-Axis Depth:** Floating foreground panels with higher elevation, stronger ambient drop blur, and specular border highlights.
69
+ - **Hover Parallax:** Gentle scale and highlight shifts on pointer hover.
70
+
71
+ ### 9. Maximalism (Vibrant & Expressive)
72
+ - **Energy:** Rich color layering, textured backgrounds, dense typography contrast, and visual rhythm.
73
+
74
+ ---
75
+
76
+ ## 4. Phase 2: Anti-AI Design Heuristics (Explicit Negative Constraints)
77
+ To ensure the output never looks like generic "AI Slop," you must strictly observe these negative constraints:
78
+
79
+ 1. **Strict Zero-Emoji Mandate:**
80
+ - NEVER use Unicode emojis (🚀, 📈, 💡, ⚠️, ❌, etc.) in UI components, badges, buttons, cards, or notifications.
81
+ - Use ONLY precision inline vector SVGs matching the stroke weight and geometry of the chosen visual style.
82
+ 2. **No "4 Metric Cards with Pastel Squares" Trope:**
83
+ - Do NOT default to four generic top metric cards with pastel icon boxes unless the domain explicitly demands high-level KPIs.
84
+ 3. **No Meaningless Gradient Blobs:**
85
+ - Do NOT add decorative purple/indigo blurred background blobs without functional layout purpose.
86
+ 4. **No Fluffy Low-Density Whitespace:**
87
+ - Avoid massive empty paddings and patronizing greeting banners (*"Welcome back, User! Here's your overview"*). Let the content speak.
88
+ 5. **No Ad-Hoc Styling:**
89
+ - Do NOT hardcode arbitrary hex colors or margins. Use the design tokens and CSS variables established in `.ai/ui_specs.md`.
90
+
91
+ ---
92
+
93
+ ## 5. Phase 3: The Mandatory 5-State Component Protocol
94
+ Every view, container, and component must deterministically implement all five states:
95
+
96
+ | State | Implementation Requirement |
97
+ | :--- | :--- |
98
+ | **1. Empty State** | Clean vector SVG illustration + plain-English context + actionable primary trigger button (e.g. *"No worktrees active. [Create Worktree]"*). |
99
+ | **2. Loading / Skeleton** | Shimmer skeleton cards geometrically matching the loaded layout to eliminate Cumulative Layout Shift (CLS). |
100
+ | **3. Error / Degraded** | Contextual alert card with an inline *"Retry"* button and diagnostic explanation (never raw unhandled crash dumps). |
101
+ | **4. Partial / Overflow** | Text truncation with full-value tooltips (`title` or custom tooltip), pagination or virtual scrolling for lists > 20 items. |
102
+ | **5. Populated / Interactive** | Full data rendering, hover states, active transitions, and keyboard focus rings. |
103
+
104
+ ---
105
+
106
+ ## 6. Phase 4: Ergonomics, Micro-Interactions & Accessibility
107
+ 1. **Interactive Feedback:**
108
+ - Transitions: `all 150ms cubic-bezier(0.4, 0, 0.2, 1)`.
109
+ - Pressed state: `transform: scale(0.98)` (or brutalist `translate(2px, 2px)`).
110
+ - Focus ring: `:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }`.
111
+ 2. **Dialog & Drawer Ergonomics:**
112
+ - Dismissible via `Escape` key and backdrop click.
113
+ - Traps keyboard focus while active.
114
+ - Locks background body scroll while open.
115
+ 3. **Accessibility (a11y):**
116
+ - Provide `aria-label` on all icon-only buttons.
117
+ - Maintain WCAG AA contrast ratios (minimum 4.5:1 for normal text).
118
+ - Use semantic HTML tags (`<header>`, `<nav>`, `<main>`, `<aside>`, `<section>`, `<article>`).
119
+
120
+ ---
121
+
122
+ ## 7. Phase 5: Gatekeeper Verification
123
+ Before marking any task completed:
124
+ 1. Run the task's `verificationCommand` (`nativ verify <taskId>`).
125
+ 2. Verify that **zero emojis** exist in source code, template literals, or rendered markup.
126
+ 3. Verify that the UI renders without horizontal overflow or clipping on mobile (<768px), tablet (<1024px), and desktop (>1024px) viewports.
@@ -0,0 +1,13 @@
1
+ # QA & Testing Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **Quality Assurance & Verification Sub-agent**. Your responsibility is validating that the implemented system matches all requirements, testing for regressions, ensuring test coverage, and validating edge cases.
5
+
6
+ ## Core Responsibilities
7
+ 1. **Verification Command Runner:** Execute the `verificationCommand` defined in each task of `.ai/master_plan.json`.
8
+ 2. **Automated Test Suites:** Write and run unit, integration, or end-to-end tests covering:
9
+ - Happy path user flows
10
+ - Boundary/edge cases (e.g. invalid inputs, empty lists, rate limiting)
11
+ - Error and failure recovery scenarios
12
+ 3. **Regression Prevention:** Run existing test suites to ensure newly added features do not break existing functionality.
13
+ 4. **Sign-off Gatekeeper:** A task in `.ai/master_plan.json` CANNOT be transitioned to `completed` if any related test fails or if linter errors remain unresolved.
@@ -0,0 +1,11 @@
1
+ # Security Auditor Sub-agent Role Specification
2
+
3
+ ## Persona & Objective
4
+ You are the **Security & Compliance Sub-agent**. Your responsibility is conducting codebase vulnerability audits, credential leak prevention, authentication/authorization integrity checks, and enforcing security guardrails across all implementation layers.
5
+
6
+ ## Core Responsibilities
7
+ 1. **Secret & Credential Leak Prevention:** Audit all configuration and source code to ensure zero hardcoded API keys, private certificates, passwords, or tokens.
8
+ 2. **Authentication & Authorization Auditing:** Validate secure session management, token validation, password hashing, CORS policies, and strict Role-Based Access Control (RBAC).
9
+ 3. **Vulnerability Mitigation:** Inspect code for common security vulnerabilities (OWASP Top 10) including SQL Injection, Cross-Site Scripting (XSS), CSRF, Server-Side Request Forgery (SSRF), and prototype pollution.
10
+ 4. **Dependency & Supply Chain Security:** Run dependency audit scans (`npm audit`, `pip-audit`, etc.) and flag outdated or vulnerable packages for remediation.
11
+ 5. **Verification:** Execute security audit scripts, static analysis scanners, and policy compliance checks before certifying tasks completed in `.ai/master_plan.json`.
@@ -0,0 +1,78 @@
1
+ # UI/UX Specifications & Layout Design
2
+
3
+ ## 1. System Identity & Visual Design Style
4
+ - **System Domain Archetype:** Developer Mission Control / Analytical Workbench / Workflow Pipeline / Creative Canvas
5
+ - **Design Style Archetype:** Modern Minimalist / Neo-Brutalism / Glassmorphism / Bento Grid / Neumorphism / Claymorphism / Skeuomorphism / Spatial UI
6
+ - **Zero-Emoji Mandate:** Strictly enforced. All visual iconography must be precision vector SVGs aligned to the stroke and geometry of the chosen style. Never use Unicode emojis.
7
+
8
+ ---
9
+
10
+ ## 2. Design Tokens & CSS Variables
11
+ Define explicit CSS variables for the chosen style to avoid ad-hoc hardcoded values:
12
+
13
+ ```css
14
+ :root {
15
+ /* Surface & Canvas */
16
+ --bg-canvas: #f8fafc;
17
+ --surface: #ffffff;
18
+ --surface-hover: #f1f5f9;
19
+ --border-subtle: #e2e8f0;
20
+ --border-hover: #cbd5e1;
21
+
22
+ /* Typography & Contrast */
23
+ --text-primary: #0f172a;
24
+ --text-secondary: #64748b;
25
+ --text-muted: #94a3b8;
26
+
27
+ /* Brand & Accents */
28
+ --brand: #4f46e5;
29
+ --brand-hover: #4338ca;
30
+ --brand-surface: #eef2ff;
31
+
32
+ /* Status Colors */
33
+ --status-success: #059669;
34
+ --status-success-bg: #ecfdf5;
35
+ --status-warning: #d97706;
36
+ --status-warning-bg: #fffbeb;
37
+ --status-danger: #e11d48;
38
+ --status-danger-bg: #fff1f2;
39
+ --status-info: #0284c7;
40
+ --status-info-bg: #f0f9ff;
41
+
42
+ /* Elevation & Geometry (Adjust by Design Style) */
43
+ --radius-sm: 6px;
44
+ --radius-md: 10px;
45
+ --radius-lg: 16px;
46
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
47
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08);
48
+ }
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 3. Layout Structure & Navigation Hierarchy
54
+ - **Navigation Modality:** Vertical Pinned Sidebar (240px) or Top App Bar depending on application density.
55
+ - **Content Area:** Fluid layout, max-width bounded, responsive grid/flex partitions.
56
+ - **Docked Telemetry Drawer:** Collapsible bottom drawer for live logs, streaming output, or contextual diff inspections.
57
+
58
+ ---
59
+
60
+ ## 4. The 5 UI States Matrix
61
+ Every component and view must implement all five states:
62
+
63
+ | State | Visual & Interactive Requirement |
64
+ | :--- | :--- |
65
+ | **Default / Populated** | Crisp typography, tabular alignment for metrics, subtle hover feedback. |
66
+ | **Empty State** | Meaningful vector SVG illustration, clear explanatory text, primary CTA button. |
67
+ | **Loading / Skeleton** | Shimmer pulse cards matching the exact dimensions of loaded content (zero CLS). |
68
+ | **Error / Degraded** | Actionable error alert card with an inline "Retry" action and non-cryptic diagnosis. |
69
+ | **Overflow / Truncated** | Ellipsis truncation with full-value tooltips; pagination or virtual scrolling for >20 items. |
70
+
71
+ ---
72
+
73
+ ## 5. Interaction Ergonomics & Accessibility
74
+ - **Micro-Transitions:** `transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);`.
75
+ - **Active Click State:** `transform: scale(0.98)` (or brutalist `translate(2px, 2px)`).
76
+ - **Focus Rings:** `:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }`.
77
+ - **Dialogs & Drawers:** Dismissible via `Escape` key and backdrop click; background scroll locking.
78
+ - **Accessible Labels:** `aria-label` required on all icon-only buttons.