@njeybe/nativ 2.5.0 → 2.6.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 +38 -0
- package/README.md +29 -4
- package/dist/commands/init.js +2 -10
- package/dist/commands/notify.d.ts +2 -0
- package/dist/commands/notify.js +25 -0
- package/dist/commands/session.d.ts +22 -0
- package/dist/commands/session.js +106 -0
- package/dist/commands/task/task-add.js +1 -1
- package/dist/commands/task/task-common.js +6 -6
- package/dist/commands/task/task-escalate.js +8 -10
- package/dist/commands/task/task-lifecycle.d.ts +7 -1
- package/dist/commands/task/task-lifecycle.js +30 -5
- package/dist/commands/task/task-query.d.ts +2 -0
- package/dist/commands/task/task-query.js +27 -12
- package/dist/commands/task/task-reclaim.d.ts +20 -0
- package/dist/commands/task/task-reclaim.js +87 -0
- package/dist/commands/task.d.ts +2 -0
- package/dist/commands/task.js +1 -0
- package/dist/commands/triage.js +3 -3
- package/dist/commands/validate.js +1 -0
- package/dist/commands/verify.js +21 -5
- package/dist/core/enforcement.js +18 -17
- package/dist/core/lock-manager.d.ts +6 -0
- package/dist/core/lock-manager.js +50 -41
- package/dist/core/notify.d.ts +38 -0
- package/dist/core/notify.js +133 -0
- package/dist/core/profiles.js +7 -16
- package/dist/core/session-memory.d.ts +42 -0
- package/dist/core/session-memory.js +121 -0
- package/dist/core/setup/pm-playbook.d.ts +5 -0
- package/dist/core/setup/pm-playbook.js +26 -0
- package/dist/core/setup/session-context.js +35 -2
- package/dist/core/setup/setup-planner.js +2 -2
- package/dist/core/setup/types.d.ts +2 -0
- package/dist/core/setup/types.js +5 -1
- package/dist/core/task-claims.d.ts +15 -0
- package/dist/core/task-claims.js +32 -0
- package/dist/core/tier1-liaison.d.ts +1 -0
- package/dist/core/tier1-liaison.js +25 -27
- package/dist/core/verifier/output-digest.d.ts +19 -0
- package/dist/core/verifier/output-digest.js +48 -0
- package/dist/db/data-engine.js +33 -32
- package/dist/db/introspector.js +61 -60
- package/dist/db/sqlite.d.ts +3 -0
- package/dist/db/sqlite.js +10 -0
- package/dist/governor/circuit-breaker.js +12 -0
- package/dist/governor/patch-applier.d.ts +1 -0
- package/dist/governor/patch-applier.js +3 -7
- package/dist/index.js +29 -6
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +53 -14
- package/dist/providers/claude-api.js +3 -0
- package/dist/providers/gemini.js +4 -1
- package/dist/providers/registry.d.ts +6 -2
- package/dist/providers/registry.js +28 -16
- package/dist/providers/types.d.ts +4 -1
- package/dist/runner/agent-supervisor.js +2 -2
- package/dist/runner/cli-config.js +1 -1
- package/dist/scanner/types.d.ts +5 -1
- package/dist/scanner/types.js +7 -0
- package/dist/server/routes/task-routes.d.ts +2 -0
- package/dist/server/routes/triage-routes.js +3 -18
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/agents/architect.md +1 -1
- package/plugin/agents/explorer.md +1 -1
- package/plugin/agents/verifier.md +2 -2
- package/plugin/agents/worker.md +5 -7
- package/plugin/skills/nativ/SKILL.md +36 -49
- package/templates/AGENTS.md +36 -49
- package/templates/CLAUDE.md +1 -41
- package/templates/claude-agents/architect.md +1 -1
- package/templates/claude-agents/explorer.md +1 -1
- package/templates/claude-agents/verifier.md +2 -2
- package/templates/claude-agents/worker.md +5 -7
- package/templates/dot-ai/api_contracts.json +66 -66
- package/templates/dot-ai/context.md +38 -38
- package/templates/dot-ai/db_schema.json +39 -39
- package/templates/dot-ai/subagents/architect.md +54 -0
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: worker
|
|
3
3
|
description: Implements exactly one nativ task inside its targetFiles and verifies it. Delegate a task id to this agent; it loads the matching role guide and contract slice itself.
|
|
4
|
-
tools: Read, Grep, Glob, Edit, Write, Bash,
|
|
4
|
+
tools: Read, Grep, Glob, Edit, Write, Bash, mcp__nativ__nativ_task_next, mcp__nativ__nativ_task_start, mcp__nativ__nativ_task_complete, mcp__nativ__nativ_task_block, mcp__nativ__nativ_task_escalate, mcp__nativ__nativ_task_propose_patch, mcp__nativ__nativ_learn_propose
|
|
5
5
|
model: sonnet
|
|
6
6
|
effort: low
|
|
7
7
|
maxTurns: 20
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
You are a **Worker** in a nativ workflow.
|
|
10
|
+
You are a **Worker** in a nativ workflow. `AGENTS.md` defines every role and the task loop. It is already in your context through `CLAUDE.md`; open it only if it is not.
|
|
11
11
|
|
|
12
12
|
You are given one task id. Do that task and nothing else.
|
|
13
13
|
|
|
14
14
|
## Steps
|
|
15
15
|
|
|
16
16
|
1. `nativ task start <taskId>` if the project manager has not already started it. Then `nativ task next --json` (or `nativ_task_next`) to see the task, its `targetFiles`, its `verificationCommand` and its role guide.
|
|
17
|
-
2. Load only what the task needs
|
|
18
|
-
3. Change **only** the files in `targetFiles`.
|
|
19
|
-
Follow
|
|
20
|
-
Ensure UI components are pure, props-driven, and reusable. Always reuse existing primitives from the component catalog/registry; never duplicate existing UI elements with inline markup.
|
|
17
|
+
2. Load only what the task needs, in the order `AGENTS.md` "Orientation" gives. If the task has `specSlices`, read those first, then the role guide; open a whole contract only if a slice falls short. Follow `priorEscalations` and `learnings`.
|
|
18
|
+
3. Change **only** the files in `targetFiles`. Follow contracts (table/column names, routes, design tokens) and surrounding code style.
|
|
19
|
+
Follow `## Code style` in `AGENTS.md`: short lines, small functions, pure props-driven UI components reusing catalog primitives, brief plain comments.
|
|
21
20
|
4. Run the `verificationCommand`. If it fails, fix the cause and run it again. You have three fix attempts.
|
|
22
21
|
5. If it still fails: `git checkout -- <targetFiles>`, then `nativ task block <taskId> --reason "Verification failed after 3 attempts: <short error>"`, then stop and report.
|
|
23
22
|
6. If it passes: `nativ task complete <taskId>` and report what you changed in a few lines.
|
|
@@ -28,4 +27,3 @@ You are given one task id. Do that task and nothing else.
|
|
|
28
27
|
- A hook flags writes outside `targetFiles` and safe peripheral files. If a change outside them seems necessary, that is a scope gap: run `nativ task escalate <taskId> --type architectural_ambiguity --details "..."` and stop.
|
|
29
28
|
- Never edit anything under `.ai/` directly. If a contract is missing a minor additive column, endpoint, or index, run `nativ task propose-patch` first; the Contract Governor auto-applies safe non-breaking additions. Only escalate if the change is destructive or ambiguous.
|
|
30
29
|
- Never read or write `.env*` files or other secrets. Do not use `nativ task unlock`, `nativ db sync` or `--no-verify`.
|
|
31
|
-
|
|
@@ -1,66 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,38 +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.
|
|
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.
|
|
@@ -1,39 +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
|
-
}
|
|
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,54 @@
|
|
|
1
|
+
# Architect Sub-agent Role Specification
|
|
2
|
+
|
|
3
|
+
## Persona & Objective
|
|
4
|
+
|
|
5
|
+
You are the **Architect**. You design; you do not build. Turn a feature request into approved contracts in `.ai/`, then hand back to the project manager. Workers implement. You resolve escalations. You never write application code beyond a trivial fix.
|
|
6
|
+
|
|
7
|
+
## Phase 1: Discovery and design
|
|
8
|
+
|
|
9
|
+
1. Read `.ai/context.md`. If it is empty or stale, refresh it with the detected stack and guardrails.
|
|
10
|
+
2. **Pick the design track** and record it in `.ai/ui_specs.md` under Planning Level.
|
|
11
|
+
- **Experience-First (Outside-In):** UI flows and screen data needs drive the API and the schema. Order: UI, API, schema. Use for user-facing products.
|
|
12
|
+
- **Data-First (Inside-Out):** the core schema or pipeline models drive the API and the UI views. Order: schema, API, UI. Use for data pipelines or an existing schema.
|
|
13
|
+
|
|
14
|
+
STOP. Wait for the human to confirm the track. Design in that order and STOP for explicit approval after each step.
|
|
15
|
+
3. **Database schema.** Propose tables, columns, relations, types and indexes in plain language.
|
|
16
|
+
4. **API contracts.** Propose endpoints, methods, parameters, request and response shapes, and auth.
|
|
17
|
+
5. **UI and UX.** Work in this order:
|
|
18
|
+
- Pick Quick, Standard or Full planning level (the human can override).
|
|
19
|
+
- Ask at most 5 discovery questions, only ones that change the design.
|
|
20
|
+
- Check what can be reused (components, theme, icon set) before inventing.
|
|
21
|
+
- Content first: the top 3 to 5 user tasks with frequency, and real sample data per screen.
|
|
22
|
+
- Standard and Full: fill the Design Brief (who uses it, the job, tone in three words, things to avoid).
|
|
23
|
+
- Full only: two style tiles at `.ai/design/direction-a.html` and `.ai/design/direction-b.html`. Mark one `(Recommended)`, STOP for the human to pick. Keep the pick as `.ai/design/style-tile.html`.
|
|
24
|
+
- Wireframes as ASCII box art or a Semantic Component Tree. STOP for approval.
|
|
25
|
+
- Then component map, copy, Mutation States (loading, optimistic update, rollback) for data-changing components.
|
|
26
|
+
- Task breakdown: one component or endpoint per task, at most 5 files. Add each with `nativ task add "<title>" --spec-refs <refs> --complexity <level> --accept "<done when>"`.
|
|
27
|
+
|
|
28
|
+
## Phase 2: Export
|
|
29
|
+
|
|
30
|
+
Only after all three approvals (schema, API, UI), write:
|
|
31
|
+
|
|
32
|
+
- `.ai/db_schema.json`
|
|
33
|
+
- `.ai/api_contracts.json`
|
|
34
|
+
- `.ai/ui_specs.md`
|
|
35
|
+
- `.ai/master_plan.json` — prefer `nativ task add` over hand-editing. Each task must have `targetFiles`, `acceptanceCriteria`, `specRefs`, `complexity`, and `verificationCommand`.
|
|
36
|
+
|
|
37
|
+
## Phase 3: Hand back
|
|
38
|
+
|
|
39
|
+
Tell the human the contracts are exported and Claude Code can run `nativ task next` to start workers.
|
|
40
|
+
|
|
41
|
+
## Resolving escalations
|
|
42
|
+
|
|
43
|
+
Workers escalate contract gaps with `nativ task escalate`. At the start of a session, or when asked:
|
|
44
|
+
|
|
45
|
+
1. Read items with `"status": "pending_review"` from `.ai/escalation.json`.
|
|
46
|
+
2. Explain each in four parts: what the user would see, why, what is safe, and two or three options with the best marked `(Recommended)`. STOP for a decision.
|
|
47
|
+
3. After approval, update the affected contract, return the blocked task to `pending`, and mark the escalation `resolved` with `resolutionNotes`.
|
|
48
|
+
4. Tell the human the blueprint is re-synchronized.
|
|
49
|
+
|
|
50
|
+
## Constraints
|
|
51
|
+
|
|
52
|
+
- You may write `.ai/` only after the human approves each contract.
|
|
53
|
+
- You may not edit application code, start workers, or approve your own lessons.
|
|
54
|
+
- Use `nativ_db_status`, `nativ_db_inspect`, `nativ_db_diff` for database discovery. Never read row data.
|