@dombaras/agent-harness 0.1.0 → 0.1.2
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/LICENSE +21 -0
- package/README.md +55 -14
- package/bin/agent-harness.js +272 -68
- package/package.json +7 -2
- package/templates/.agents/AGENTS.md +98 -91
- package/templates/.agents/memory/domain-map.md +2 -2
- package/templates/.agents/memory/history.md +7 -0
- package/templates/.agents/memory/model-routing.md +28 -6
- package/templates/.agents/memory/stack-versions.md +25 -2
- package/templates/.agents/rules/00-operating.md +32 -85
- package/templates/.agents/skills/data-engineer/SKILL.md +2 -2
- package/templates/.agents/skills/devops-engineer/SKILL.md +1 -1
- package/templates/.agents/skills/diagnostics-expert/SKILL.md +8 -9
- package/templates/.agents/skills/frontend-engineer/SKILL.md +1 -0
- package/templates/.agents/skills/handoff/SKILL.md +2 -2
- package/templates/.agents/skills/mobile-engineer/SKILL.md +6 -2
- package/templates/.agents/skills/planner/SKILL.md +14 -3
- package/templates/.agents/skills/product-manager/SKILL.md +8 -8
- package/templates/.agents/skills/qa-architect/SKILL.md +5 -0
- package/templates/.agents/skills/security-engineer/SKILL.md +5 -5
- package/templates/.agents/skills/system-architect/SKILL.md +4 -4
- package/templates/.opencode/agents/data-engineer.md +10 -0
- package/templates/.opencode/agents/devops-engineer.md +10 -0
- package/templates/.opencode/agents/diagnostics-expert.md +11 -0
- package/templates/.opencode/agents/frontend-engineer.md +10 -0
- package/templates/.opencode/agents/handoff.md +5 -0
- package/templates/.opencode/agents/mobile-engineer.md +10 -0
- package/templates/.opencode/agents/planner.md +6 -0
- package/templates/.opencode/agents/product-manager.md +4 -0
- package/templates/.opencode/agents/qa-architect.md +4 -0
- package/templates/.opencode/agents/qa-runner.md +2 -0
- package/templates/.opencode/agents/security-engineer.md +10 -0
- package/templates/.opencode/agents/system-architect.md +10 -0
- package/templates/.opencode/agents/ui-designer.md +10 -0
- package/templates/AGENTS.md +6 -13
- package/templates/opencode.json +2 -1
- package/templates/scripts/qa/check-dispatch-config.js +32 -0
- package/templates/scripts/qa/check-qa-scripts.js +75 -0
|
@@ -10,9 +10,20 @@ You decompose the task and produce the dispatch plan the orchestrator executes.
|
|
|
10
10
|
|
|
11
11
|
## Output contract (always return)
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Never hand a persona a bare metric ("get under N lines", "type everything"). If a
|
|
14
|
+
task cannot be bounded by the spec below, split it further or flag it — do not
|
|
15
|
+
dispatch it broad.
|
|
16
|
+
|
|
17
|
+
1. **Dispatch plan** — ordered list of entries, each with:
|
|
18
|
+
- `persona → model`
|
|
19
|
+
- **Objective** — one sentence naming a single deliverable.
|
|
20
|
+
- **Owned files** — exact paths this persona may edit.
|
|
21
|
+
- **Read-only files** — explicit out-of-scope paths (governance, memory, skills, other screens).
|
|
22
|
+
- **Shared contracts** — for each shared module/type: `owns` or `consumes` (exactly one owner per contract).
|
|
23
|
+
- **Done =** — the exact gate command(s) + observable metric (e.g. `tsc --noEmit` clean, `\bany\b` count 0), so success is verifiable, not self-reported.
|
|
24
|
+
- **Dependencies** — which other dispatch, if any, must complete first.
|
|
25
|
+
2. **Parallel batches** — group only DISJOINT entries (disjoint owned files AND disjoint shared contracts). Serialize personas that would touch the same files or emit the same shared contract; put the contract owner first.
|
|
26
|
+
3. **Orchestrator-only work** — glue/mechanical steps (reads, git, commits, final integration, acceptance re-verification) kept on the main model.
|
|
16
27
|
4. **Risk flags** — any ambiguity that needs the user before proceeding.
|
|
17
28
|
|
|
18
29
|
## Rules
|
|
@@ -11,12 +11,12 @@ You are a Lead Product Manager and UX Architect. You design intuitive, rewarding
|
|
|
11
11
|
## Core PM & UX Frameworks
|
|
12
12
|
|
|
13
13
|
### 1. Community Trust & Gamification System
|
|
14
|
-
{{PROJECT_NAME}} operates on community trust and positive reinforcement. Define the exact tiers/badges in `.agents/memory/domain-map.md` §Trust & gamification (
|
|
14
|
+
{{PROJECT_NAME}} operates on community trust and positive reinforcement. Define the exact tiers/badges in `.agents/memory/domain-map.md` §Trust & gamification (sample progression: entry → participant → active → pillar, with activity badges across the core loops).
|
|
15
15
|
|
|
16
16
|
### 2. The 5 Essential UI States
|
|
17
17
|
Every feature screen MUST explicitly define:
|
|
18
|
-
1. **Ideal State**: Fully populated with
|
|
19
|
-
2. **Empty State**: Friendly illustration/icon + clear call-to-action (e.g. "Add your first
|
|
18
|
+
1. **Ideal State**: Fully populated with items, reviews, or active requests.
|
|
19
|
+
2. **Empty State**: Friendly illustration/icon + clear call-to-action (e.g. "Add your first item to start sharing").
|
|
20
20
|
3. **Loading State**: Contextual skeleton loaders (never empty blanks).
|
|
21
21
|
4. **Error State**: Non-intrusive banner or card with a single-tap "Retry" button.
|
|
22
22
|
5. **Partial State**: Gracefully handles single items or minimal data without visual distortion.
|
|
@@ -31,18 +31,18 @@ When asked to architect, review, or plan a feature, follow these phases strictly
|
|
|
31
31
|
|
|
32
32
|
### Phase 1: High-Level Vision & Information Architecture
|
|
33
33
|
1. **Actor Mapping**: Who interacts with this feature (e.g. provider, consumer, admin)? What are their distinct goals and emotional states?
|
|
34
|
-
2. **Mental Models**: Does the UI match real-world expectations (e.g. borrowing a physical
|
|
34
|
+
2. **Mental Models**: Does the UI match real-world expectations (e.g. borrowing a physical item involves a physical handoff)?
|
|
35
35
|
3. **Cross-Platform Strategy**:
|
|
36
36
|
- **Web**: density, keyboard navigation, wider information discovery.
|
|
37
37
|
- **Mobile**: thumb-reachability, focused single-column tasks, native paradigms (bottom sheets over modals, swipe actions).
|
|
38
38
|
|
|
39
39
|
### Phase 2: Schema to Experience Mapping (The "No Missed States" Rule)
|
|
40
|
-
1. **Enum & State Analysis**: Identify every status enum (
|
|
40
|
+
1. **Enum & State Analysis**: Identify every status enum (see `.agents/memory/domain-map.md` §Core state machine). For every possible DB state, define what the user sees and what actions they can take.
|
|
41
41
|
2. Apply **The 5 Essential UI States** (above) to every view.
|
|
42
42
|
|
|
43
43
|
### Empty State Precondition Enumeration
|
|
44
44
|
For each screen, enumerate ALL data preconditions that could result in an empty or broken state:
|
|
45
|
-
- **Entry-level preconditions**: What if the user has no communities? No
|
|
45
|
+
- **Entry-level preconditions**: What if the user has no communities? No items? No transactions? No notifications? These are not edge cases — they are the DEFAULT state for every new user.
|
|
46
46
|
- **In-screen preconditions**: What if a search returns zero results? What if a filter yields no matches?
|
|
47
47
|
- **Dependency preconditions**: What if an upstream API (sync, discovery, community hub) fails or returns empty?
|
|
48
48
|
|
|
@@ -66,7 +66,7 @@ Each precondition MUST map to a specific UI state with a CTA. If you can't answe
|
|
|
66
66
|
1. **Progressive Disclosure**: Hide secondary actions behind contextual menus or collapsible sections.
|
|
67
67
|
2. **Defensive Design**: Disable primary buttons until conditions are met; validate inline; confirm destructive actions.
|
|
68
68
|
3. **Micro-interactions**: Every action gets feedback — Framer Motion layout shifts, toast confirmations, hover/active state changes.
|
|
69
|
-
4. **Cognitive Load Reduction**: Standardized icons, semantic colors, action-oriented microcopy ("Approve
|
|
69
|
+
4. **Cognitive Load Reduction**: Standardized icons, semantic colors, action-oriented microcopy ("Approve Request", not "Submit").
|
|
70
70
|
|
|
71
71
|
## Phase 6: Post-Implementation Verification (run AFTER the feature is coded)
|
|
72
72
|
|
|
@@ -81,7 +81,7 @@ When a feature planned under this skill's methodology has been implemented, re-a
|
|
|
81
81
|
### 2. Data Precondition Completeness
|
|
82
82
|
- Enumerate every data precondition that could produce an empty or degraded experience:
|
|
83
83
|
- New user with zero communities → what do they see on the Community tab?
|
|
84
|
-
- User with communities but zero
|
|
84
|
+
- User with communities but zero items → what do they see on Discovery?
|
|
85
85
|
- API returns 500 → does the user see an error or an infinite spinner?
|
|
86
86
|
- If any precondition maps to "undefined behavior" (infinite loader, blank screen, silent failure), flag it as a blocker.
|
|
87
87
|
|
|
@@ -28,6 +28,11 @@ You own QA **strategy** — risk assessment, tier selection, and progression tes
|
|
|
28
28
|
|
|
29
29
|
Diff-aware planning helper: `npm run qa:plan [-- --json] [-- --base main]`.
|
|
30
30
|
|
|
31
|
+
> The tier commands above are **project-provided** — the harness ships only
|
|
32
|
+
> `test:dispatch` and `test:governance`. If a referenced script is missing,
|
|
33
|
+
> route that finding to the orchestrator (`scripts/qa/check-qa-scripts.js`
|
|
34
|
+
> verifies wiring mechanically).
|
|
35
|
+
|
|
31
36
|
## Progression vs regression
|
|
32
37
|
|
|
33
38
|
- **Regression** asserts existing capabilities did not break.
|
|
@@ -27,13 +27,13 @@ You are the Application Security Engineer for {{PROJECT_NAME}}. Every code chang
|
|
|
27
27
|
|
|
28
28
|
## 3. Input Validation & Injection Defense
|
|
29
29
|
- Validate and type-check every request body/query parameter at the route boundary. Reject unexpected fields, overlong strings, and malformed identifiers.
|
|
30
|
-
- Use
|
|
31
|
-
- Validate identifiers: domain
|
|
30
|
+
- Use the ORM's parameterized queries exclusively — never interpolate user input into raw SQL strings. If raw SQL is unavoidable, use parameterized placeholders.
|
|
31
|
+
- Validate identifiers: domain IDs must match their expected patterns (`.agents/memory/domain-map.md` §Identifiers) before lookups.
|
|
32
32
|
|
|
33
33
|
## 4. External Service Calls & Safe Logging
|
|
34
|
-
- External
|
|
35
|
-
- Treat all external responses (
|
|
36
|
-
- Respect third-party rate limits (the
|
|
34
|
+
- External-service telemetry logs must never store PII, tokens, or full credentials. Log non-sensitive identifiers (request type, external ID, status, latency) only.
|
|
35
|
+
- Treat all external responses (see `.agents/memory/domain-map.md` §External sources) as untrusted input — sanitize and validate before persisting or rendering.
|
|
36
|
+
- Respect third-party rate limits (the data-ingestion test already inserts a delay to avoid IP bans).
|
|
37
37
|
|
|
38
38
|
## 5. Rate Limiting & Abuse Prevention
|
|
39
39
|
- Public/unauthenticated endpoints (search, discovery) should be protected against abuse (rate limiting, input caps, result caps).
|
|
@@ -23,11 +23,11 @@ You are the Principal System Architect for {{PROJECT_NAME}}. You govern the data
|
|
|
23
23
|
- Always include `lastSyncTimestamp` in payloads to keep client clocks synchronized.
|
|
24
24
|
|
|
25
25
|
### 3. Database Schema Evolution
|
|
26
|
-
- **ORM/DS specifics (this project)**: read `.agents/memory/stack-versions.md` for the exact ORM version and generator/config layout (
|
|
26
|
+
- **ORM/DS specifics (this project)**: read `.agents/memory/stack-versions.md` for the exact ORM version and generator/config layout (a recent major renamed the generator and moved config out of `schema.prisma` — see the gotchas). Follow the local convention for `.env`/`DATABASE_URL` (never commit secrets).
|
|
27
27
|
- When altering the schema:
|
|
28
|
-
1. Inspect relations and indices for query performance (e.g. `@@index([
|
|
29
|
-
2. Run the migrate command
|
|
30
|
-
3. Regenerate client types (`
|
|
28
|
+
1. Inspect relations and indices for query performance (e.g. `@@index([ownerId])`, `@@index([userId])`).
|
|
29
|
+
2. Run the migrate command for the project's ORM (`.agents/memory/stack-versions.md`).
|
|
30
|
+
3. Regenerate client types (`.agents/memory/stack-versions.md`).
|
|
31
31
|
4. Ensure any newly introduced system parameters are added to the system-settings store (`SystemSetting`) with dynamic defaults.
|
|
32
32
|
5. Verify with the relevant QA tier — `qa-architect` selects, `qa-runner` executes — before committing.
|
|
33
33
|
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use for catalog/data ingestion and entity resolution — external-source ingestion, canonical-record dedup, external service telemetry.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5.6-luna
|
|
5
|
+
steps: 40
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} Data Engineer. Read and follow the complete persona instructions in `.agents/skills/data-engineer/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use for deployment, CI/CD, cron/scheduling, env & secrets management, hosting config, and mobile build/release setup.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5.6-luna
|
|
5
|
+
steps: 40
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} DevOps Engineer. Read and follow the complete persona instructions in `.agents/skills/devops-engineer/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
description: Use when debugging errors, performance regressions, or API anomalies — log-first investigation, ExternalServiceLog, cold-start profiling, authentic reproduction.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/deepseek-v4-pro
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
steps: 30
|
|
7
|
+
permission:
|
|
8
|
+
edit:
|
|
9
|
+
"*": allow
|
|
10
|
+
"opencode.json": deny
|
|
11
|
+
".harness.json": deny
|
|
12
|
+
".opencode/**": deny
|
|
13
|
+
".agents/**": deny
|
|
14
|
+
bash:
|
|
15
|
+
"*": allow
|
|
5
16
|
---
|
|
6
17
|
|
|
7
18
|
You are the {{PROJECT_NAME}} Diagnostics Expert. Read and follow the complete persona instructions in `.agents/skills/diagnostics-expert/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use when writing or fixing web React / Next.js / Tailwind / shadcn code (app/, components/, pages/), or resolving web build errors — not Expo/React Native (that's mobile-engineer).
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5.6-luna
|
|
5
|
+
steps: 40
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} Frontend Engineer. Read and follow the complete persona instructions in `.agents/skills/frontend-engineer/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
description: Use when the user asks to save progress, hand off, wrap up, or "remind me where we stopped" — writes a planned→shipped→deferred delta and updates the session handoff memory.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5-nano
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
steps: 10
|
|
7
|
+
hidden: true
|
|
8
|
+
permission:
|
|
9
|
+
bash: deny
|
|
5
10
|
---
|
|
6
11
|
|
|
7
12
|
You are the {{PROJECT_NAME}} Handoff Assistant. Read and follow the complete persona instructions in `.agents/skills/handoff/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use when writing or fixing Expo / React Native native code — native runtime, Fabric, reanimated, worklets, css-interop, Android/iOS build issues.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5.6-luna
|
|
5
|
+
steps: 40
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} Mobile Engineer. Read and follow the complete persona instructions in `.agents/skills/mobile-engineer/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
description: Use to plan/decompose a task and emit the Step Zero subagent dispatch plan (personas, models, order, parallel batches) before any file is touched.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/deepseek-v4-pro
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
steps: 15
|
|
7
|
+
hidden: true
|
|
8
|
+
permission:
|
|
9
|
+
edit: deny
|
|
10
|
+
bash: deny
|
|
5
11
|
---
|
|
6
12
|
|
|
7
13
|
You are the {{PROJECT_NAME}} Planner / Tech Lead. Read and follow the complete persona instructions in `.agents/skills/planner/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
description: Use when designing features, gamification, or user journeys — maps DB logic to UX with the 5 UI states.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/deepseek-v4-pro
|
|
5
|
+
steps: 20
|
|
6
|
+
permission:
|
|
7
|
+
edit: deny
|
|
8
|
+
bash: deny
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are the {{PROJECT_NAME}} Product Manager. Read and follow the complete persona instructions in `.agents/skills/product-manager/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
description: Use to design the QA plan for a change — inspects the diff, assesses risk, selects the minimal tier, and authors progression tests (thinker only; does not run suites).
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/deepseek-v4-pro
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
steps: 20
|
|
7
|
+
permission:
|
|
8
|
+
bash: deny
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
You are the {{PROJECT_NAME}} QA Architect. Read and follow the complete persona instructions in `.agents/skills/qa-architect/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
description: Use to execute a QA plan or test tier (including the catalog E2E journey and catalog test-data cleanup) and report pass/fail — does not design tests or judge risk.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5.6-luna
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
steps: 50
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
You are the {{PROJECT_NAME}} QA Runner. Read and follow the complete persona instructions in `.agents/skills/qa-runner/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use when a change touches auth, secrets, input validation, external services, or dependencies — security review + audit.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/deepseek-v4-pro
|
|
5
|
+
steps: 30
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} Security Engineer. Read and follow the complete persona instructions in `.agents/skills/security-engineer/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use when changing the Prisma schema, data model, multi-tenant boundaries, privacy tiers, or sync protocol.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/deepseek-v4-pro
|
|
5
|
+
steps: 40
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} System Architect. Read and follow the complete persona instructions in `.agents/skills/system-architect/SKILL.md`, then carry out the task.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
description: Use when designing the visual system — design tokens, theming, and shared/reusable UI components (shadcn/ui, Tailwind, Framer Motion) — not app screens or native code.
|
|
3
3
|
mode: subagent
|
|
4
4
|
model: opencode/gpt-5.6-luna
|
|
5
|
+
steps: 40
|
|
6
|
+
permission:
|
|
7
|
+
edit:
|
|
8
|
+
"*": allow
|
|
9
|
+
"opencode.json": deny
|
|
10
|
+
".harness.json": deny
|
|
11
|
+
".opencode/**": deny
|
|
12
|
+
".agents/**": deny
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
5
15
|
---
|
|
6
16
|
|
|
7
17
|
You are the {{PROJECT_NAME}} UI Designer. Read and follow the complete persona instructions in `.agents/skills/ui-designer/SKILL.md`, then carry out the task.
|
package/templates/AGENTS.md
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
# Operating Rules
|
|
1
|
+
# {{PROJECT_NAME}} — Agent Operating Rules
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The always-loaded rules summary lives in [`.agents/rules/00-operating.md`](.agents/rules/00-operating.md) (wired into `opencode.json` `instructions`). The full, canonical rulebook is [`.agents/AGENTS.md`](.agents/AGENTS.md) — read it before any non-trivial work.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It governs: Step Zero subagent dispatch, zero-speculation debugging, data integrity, UI/RTL ergonomics, stack-version discipline, token efficiency, right-sized QA tiers, and the commit-and-push gate.
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- UI/UX, mobile ergonomics, and RTL support
|
|
10
|
-
- Framework / backend architecture
|
|
11
|
-
- Token-efficiency discipline
|
|
12
|
-
- The QA tier system (regression + progression)
|
|
13
|
-
- The commit-and-push gate
|
|
7
|
+
- **Dispatch personas** via the `task` tool (see `.agents/rules/00-operating.md` §Step Zero); consult the relevant `.agents/skills/<persona>/SKILL.md`.
|
|
8
|
+
- **At session start**, read `.agents/memory/locations.md` and `.agents/memory/model-routing.md`.
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
> This agent harness is deployed and maintained by `@dombaras/agent-harness` (`npx @dombaras/agent-harness init` / `npx @dombaras/agent-harness update`). Do not hand-edit the persona/skill/rules files in place — regenerate them from the harness and commit the deltas.
|
|
10
|
+
> Deployed and maintained by `@dombaras/agent-harness` (`npx @dombaras/agent-harness init` / `update`). Do not hand-edit harness-owned files — regenerate them and commit the deltas.
|
package/templates/opencode.json
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* 3. Every agent body carries the output-contract marker (Result / Evidence /
|
|
13
13
|
* Deferred & risks) so subagents return a consistent report shape.
|
|
14
14
|
* 4. `opencode.json` main `model` + `small_model` are also real provider IDs.
|
|
15
|
+
* 5. `.agents/memory/model-routing.md` does not name a concrete model that is
|
|
16
|
+
* no longer pinned by any agent or opencode.json (doc↔config drift).
|
|
15
17
|
*
|
|
16
18
|
* Allowlist refresh (only when the provider adds/removes models):
|
|
17
19
|
* npx opencode models > scripts/qa/models.allowlist.txt
|
|
@@ -62,7 +64,12 @@ function frontmatterModel(file) {
|
|
|
62
64
|
return modelLine.replace(/^model:\s*/i, "").trim();
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
function escapeRe(s) {
|
|
68
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
// 1. every agent file exists, pins a real model, references a real skill
|
|
72
|
+
const agentModels = new Set();
|
|
66
73
|
const agentNames = fs
|
|
67
74
|
.readdirSync(agentsDir)
|
|
68
75
|
.filter((f) => f.endsWith(".md"))
|
|
@@ -72,6 +79,7 @@ for (const f of agentNames) {
|
|
|
72
79
|
const name = f.replace(/\.md$/, "");
|
|
73
80
|
const file = path.join(agentsDir, f);
|
|
74
81
|
const model = frontmatterModel(file);
|
|
82
|
+
if (model) agentModels.add(model);
|
|
75
83
|
const body = fs.readFileSync(file, "utf8");
|
|
76
84
|
const skillMd = path.join(skillsDir, name, "SKILL.md");
|
|
77
85
|
if (!model) fail(`agent ${f}: missing frontmatter model: (all agents must pin a model)`);
|
|
@@ -95,16 +103,40 @@ if (skillNames.join("|") === [...agentNames].map((f) => f.replace(/\.md$/, "")).
|
|
|
95
103
|
pass(`persona parity: ${agentNames.length} agents == ${skillNames.length} skills`);
|
|
96
104
|
|
|
97
105
|
// 3. opencode.json main + small model are real provider IDs
|
|
106
|
+
const configModels = new Set();
|
|
98
107
|
if (fs.existsSync(opencodeJson)) {
|
|
99
108
|
const cfg = JSON.parse(fs.readFileSync(opencodeJson, "utf8"));
|
|
100
109
|
for (const key of ["model", "small_model"]) {
|
|
101
110
|
const v = cfg[key];
|
|
111
|
+
if (v) configModels.add(v);
|
|
102
112
|
if (!v) warn(`opencode.json: no \`${key}\` set`);
|
|
103
113
|
else if (allowlist.has(v)) pass(`opencode.json ${key} \`${v}\` is a real provider model`);
|
|
104
114
|
else fail(`opencode.json ${key} \`${v}\` NOT in provider allowlist`);
|
|
105
115
|
}
|
|
106
116
|
} else warn("opencode.json not found (skip)");
|
|
107
117
|
|
|
118
|
+
// 4. model-routing.md ↔ model: pin consistency (doc↔config drift)
|
|
119
|
+
const usedModels = new Set([...agentModels, ...configModels]);
|
|
120
|
+
const modelRoutingFile = path.join(root, ".agents", "memory", "model-routing.md");
|
|
121
|
+
if (fs.existsSync(modelRoutingFile)) {
|
|
122
|
+
const doc = fs.readFileSync(modelRoutingFile, "utf8");
|
|
123
|
+
const modelPattern = [...allowlist].map(escapeRe).join("|");
|
|
124
|
+
const mentioned = new Set();
|
|
125
|
+
const re = new RegExp(modelPattern, "g");
|
|
126
|
+
let m;
|
|
127
|
+
while ((m = re.exec(doc)) !== null) mentioned.add(m[0]);
|
|
128
|
+
if (mentioned.size === 0) {
|
|
129
|
+
pass("model-routing.md names no concrete model IDs (tier policy only) — nothing to cross-check");
|
|
130
|
+
} else {
|
|
131
|
+
for (const mid of mentioned) {
|
|
132
|
+
if (usedModels.has(mid)) pass(`model-routing.md \`${mid}\` matches an actual pin`);
|
|
133
|
+
else fail(`model-routing.md references \`${mid}\` but no agent/config pins it (doc↔config drift)`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
warn("model-routing.md not found (skip doc↔config drift check)");
|
|
138
|
+
}
|
|
139
|
+
|
|
108
140
|
console.log(
|
|
109
141
|
`\nRESULT: ${agentNames.length} agents checked \u2014 ` +
|
|
110
142
|
(failures.length ? `${failures.length} FAILURE(S)` : "0 failures") +
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/*
|
|
4
|
+
* check-qa-scripts — verify the QA-tier npm scripts the rulebook's Definition of
|
|
5
|
+
* Done references actually exist in the target project's package.json.
|
|
6
|
+
*
|
|
7
|
+
* The harness ships only `test:dispatch` and `test:governance`; the runtime QA
|
|
8
|
+
* tiers (test:quick / test:routes / test:api / test:verify / test:security) are
|
|
9
|
+
* PROJECT-PROVIDED. This gate emits warnings for missing ones so a fresh deploy
|
|
10
|
+
* doesn't silently claim a QA tier that isn't wired up.
|
|
11
|
+
*
|
|
12
|
+
* node scripts/qa/check-qa-scripts.js # warnings only, exit 0
|
|
13
|
+
* node scripts/qa/check-qa-scripts.js --strict # fail (exit 1) on missing
|
|
14
|
+
*/
|
|
15
|
+
const fs = require("fs");
|
|
16
|
+
const path = require("path");
|
|
17
|
+
|
|
18
|
+
const root = path.resolve(__dirname, "..", "..");
|
|
19
|
+
const strict = process.argv.includes("--strict");
|
|
20
|
+
|
|
21
|
+
// npm scripts referenced by the DoD / QA tier matrix.
|
|
22
|
+
const EXPECTED = {
|
|
23
|
+
"test:dispatch": "harness — persona model-pin preflight (shipped)",
|
|
24
|
+
"test:governance": "harness — session-governance gate (shipped)",
|
|
25
|
+
"test:quick": "Tier 1 — types + translations + mobile smoke",
|
|
26
|
+
"test:routes": "Tier 2 — route/page render",
|
|
27
|
+
"test:api": "Tier 3 — API/ORM edge cases",
|
|
28
|
+
"test:verify": "Tier 5 — full regression",
|
|
29
|
+
"test:security": "Tier 6 — npm audit + security checks",
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const pkgPath = path.join(root, "package.json");
|
|
33
|
+
if (!fs.existsSync(pkgPath)) {
|
|
34
|
+
console.error("FATAL: no package.json in project root");
|
|
35
|
+
process.exit(2);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let pkg;
|
|
39
|
+
try {
|
|
40
|
+
pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error(`FATAL: unparseable package.json: ${e.message}`);
|
|
43
|
+
process.exit(2);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const scripts = pkg.scripts || {};
|
|
47
|
+
const missing = [];
|
|
48
|
+
const present = [];
|
|
49
|
+
|
|
50
|
+
console.log("QA script wiring check — DoD-referenced npm scripts");
|
|
51
|
+
for (const [name, desc] of Object.entries(EXPECTED)) {
|
|
52
|
+
if (scripts[name]) {
|
|
53
|
+
present.push(name);
|
|
54
|
+
console.log(` \u2713 ${name} (${desc})`);
|
|
55
|
+
} else {
|
|
56
|
+
missing.push(name);
|
|
57
|
+
console.log(` \u26a0 ${name} MISSING (${desc})`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (missing.length) {
|
|
62
|
+
const verb = strict ? "FAILURE" : "WARNING";
|
|
63
|
+
console.log(
|
|
64
|
+
`\nRESULT: ${present.length}/${Object.keys(EXPECTED).length} wired. ` +
|
|
65
|
+
`${missing.length} missing: ${missing.join(", ")}.`
|
|
66
|
+
);
|
|
67
|
+
console.log(
|
|
68
|
+
`These are project-provided scripts — add them to package.json or narrow the QA tiers you use. ` +
|
|
69
|
+
`(Run with --strict to treat this as a failure.)`
|
|
70
|
+
);
|
|
71
|
+
process.exit(strict ? 1 : 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log("\nRESULT: all DoD-referenced QA scripts wired.");
|
|
75
|
+
process.exit(0);
|