@manhd_d/ai-harness 0.14.0 → 0.15.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 (93) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +21 -9
  3. package/adapters/react-native/adapter.yaml +1 -1
  4. package/adapters/react-native/skills/harness-react-native-behavior-testing/SKILL.md +9 -0
  5. package/adapters/react-nextjs/adapter.yaml +1 -1
  6. package/adapters/react-nextjs/skills/harness-react-nextjs-behavior-testing/SKILL.md +9 -0
  7. package/capabilities/product/capability.json +1 -1
  8. package/capabilities/product/workflows/idea-to-prd.md +15 -0
  9. package/capabilities/product/workflows/idea-to-prd.workflow.json +82 -0
  10. package/cli/adapters.js +1 -1
  11. package/cli/agents.js +14 -5
  12. package/cli/capabilities.js +2 -1
  13. package/cli/end-user.js +30 -0
  14. package/cli/environment.js +2 -0
  15. package/cli/evaluation-contract.js +11 -1
  16. package/cli/files.js +7 -2
  17. package/cli/harness.js +53 -11
  18. package/cli/journey-evidence.js +34 -0
  19. package/cli/kiro.js +15 -0
  20. package/cli/knowledge.js +104 -0
  21. package/cli/main.js +60 -22
  22. package/cli/portable-config.js +6 -3
  23. package/cli/project-decisions.js +47 -0
  24. package/cli/readiness.js +82 -41
  25. package/cli/setup.js +66 -0
  26. package/cli/skill-requirements.js +47 -0
  27. package/cli/start.js +15 -2
  28. package/cli/structured.js +65 -0
  29. package/cli/sync-integrations.js +49 -0
  30. package/cli/verification-report.js +9 -5
  31. package/cli/verification.js +7 -2
  32. package/cli/workflow.js +76 -0
  33. package/core/agents/orchestrator.md +1 -1
  34. package/core/agents/test-engineer.md +4 -2
  35. package/core/checks/verification.json +12 -0
  36. package/core/evals/cases.json +75 -1
  37. package/core/rules/context.md +9 -0
  38. package/core/skills/harness-end-user-testing/SKILL.md +55 -0
  39. package/core/skills/harness-review/SKILL.md +4 -0
  40. package/core/skills/harness-spec/SKILL.md +3 -1
  41. package/core/skills/harness-start/SKILL.md +66 -0
  42. package/core/skills/harness-verification/SKILL.md +2 -0
  43. package/core/workflows/adaptive-verification.md +5 -0
  44. package/core/workflows/agent-routing.md +6 -0
  45. package/core/workflows/approvals.schema.json +62 -0
  46. package/core/workflows/clarification.md +6 -1
  47. package/core/workflows/continuous-development.md +5 -0
  48. package/core/workflows/end-user-acceptance.md +36 -0
  49. package/core/workflows/greenfield-setup.md +27 -0
  50. package/core/workflows/project-setup.md +13 -2
  51. package/core/workflows/seed.md +25 -0
  52. package/core/workflows/spec-to-code.md +19 -8
  53. package/core/workflows/spec-to-code.workflow.json +99 -0
  54. package/core/workflows/workflow.schema.json +113 -0
  55. package/docs/README.md +8 -0
  56. package/docs/adaptive-verification.md +10 -1
  57. package/docs/agent-configuration.md +7 -0
  58. package/docs/agent-handoffs.md +6 -1
  59. package/docs/architecture.md +43 -3
  60. package/docs/cli.md +39 -4
  61. package/docs/configuration-backup.md +10 -2
  62. package/docs/conformance-runner.md +64 -0
  63. package/docs/end-to-end-workflow.md +4 -0
  64. package/docs/end-user-testing.md +128 -0
  65. package/docs/frontend-mobile.md +7 -0
  66. package/docs/getting-started.md +17 -5
  67. package/docs/harness-maintenance.md +1 -0
  68. package/docs/i18n/README.es.md +17 -7
  69. package/docs/i18n/README.vi.md +18 -8
  70. package/docs/i18n/README.zh-CN.md +17 -7
  71. package/docs/project-configuration.md +6 -0
  72. package/docs/python-installation.md +85 -0
  73. package/docs/session-onboarding.md +215 -0
  74. package/docs/skill-matrix.md +5 -3
  75. package/docs/start.md +7 -2
  76. package/docs/tool-setup/README.md +13 -14
  77. package/docs/tool-setup/claude-code.md +10 -0
  78. package/docs/tool-setup/codex.md +10 -0
  79. package/docs/tool-setup/copilot.md +10 -0
  80. package/docs/tool-setup/cursor.md +10 -0
  81. package/docs/tool-setup/gemini-cli.md +10 -0
  82. package/docs/tool-setup/kiro.md +112 -38
  83. package/docs/versioning.md +56 -0
  84. package/docs/workflow-contract.md +66 -0
  85. package/evals/README.md +7 -0
  86. package/harness.yaml +13 -1
  87. package/package.json +7 -3
  88. package/scripts/conformance-runner.js +119 -0
  89. package/scripts/score-eval.js +3 -1
  90. package/templates/AGENTS.md +6 -1
  91. package/templates/decisions.json +4 -0
  92. package/templates/local.md +21 -0
  93. package/templates/openspec/approvals.json +5 -0
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: harness-end-user-testing
3
+ description: Exercise approved user journeys through the actual browser, device, CLI or API interface and record outcome evidence. Use when the user requests end-user testing or a change affects an externally observable flow; report unavailable tools/access as BLOCKED.
4
+ ---
5
+
6
+ # Test as an end user
7
+
8
+ ## Input
9
+ Approved AC/use cases and changed paths, app entry/start instructions, current revision/environment,
10
+ existing runner or actual host tools, test-role/account references, authorized isolated fixtures and
11
+ configured evidence destinations. Never ask for passwords in chat or record them in shared reports.
12
+
13
+ ## Procedure
14
+ 1. Load `.harness/core/workflows/end-user-acceptance.md` and reuse `harness-verification` for report
15
+ validation. Inspect requirements and affected interfaces. Choose proportional journeys with stable
16
+ AC IDs: happy path and applicable validation/error/empty/denied-role/state/persistence regressions.
17
+ Avoid imposing a CRM CRUD/login suite on static tools, backend-only services or unrelated changes.
18
+ 2. Verify that the running app, test accounts and tools are actually reachable. Reuse existing Playwright,
19
+ Cypress, device or CLI/API tests and project commands. If a web runner is missing, propose Playwright
20
+ or an authorized host browser tool and clarify only the consequential setup choice. A declared MCP
21
+ alias does not prove access. Missing essentials block only affected journeys.
22
+ 3. Exercise the real boundary: web browser navigation/click/fill/keyboard, device/simulator taps,
23
+ terminal commands/output/file state or API-client actor workflows. For web, use accessible roles,
24
+ labels and user-visible controls; avoid internal component state or calling JS handlers as a
25
+ substitute for interaction. API setup can create isolated fixtures but cannot count as UI coverage.
26
+ 4. Compare outcomes with reviewed AC. Check visible results and applicable persisted state after
27
+ refresh/navigation/reopen, denied actions and negative input. Inspect affected console/network
28
+ failures; they are diagnostic context, not a replacement for business assertions. Avoid fixed sleeps;
29
+ use bounded waits/assertions and reviewed retry limits. Reproduce defects before scoped repairs.
30
+ 5. Capture redacted machine observations, executed tool/command, timestamps/revision/environment,
31
+ real vs mocked dependencies, role, steps, expected/observed outcomes and fixture cleanup. Keep
32
+ screenshot/trace/video/report attachments separate from JSON assertion evidence and review them
33
+ for sensitive data. Screenshots alone, HTTP 200 or a successful build do not establish a journey PASS.
34
+ 6. Reuse schema-1 verification reports: user-facing requirements set verification_target to end-user and name the web/mobile/cli/api surface;
35
+ scenarios record journey surface/actor/entrypoint/interaction/dependencies/attachments. Mocked
36
+ or unknown dependency coverage can pass its scoped assertions but cannot verify full end-user AC.
37
+ Run `aih verify --report <file>`; independently inspect raw evidence and current source revision.
38
+ 7. Fix accepted defects through debugging/TDD/implementer, then rerun affected journeys and regression
39
+ checks. Bound repair/retest rounds according to existing host/project limits. Report remaining
40
+ FAILED/BLOCKED/NOT_RUN before handoff; do not weaken AC or ignore failing assertions to finish.
41
+
42
+ ## Output
43
+ AC → actual interface steps → expected/observed/assertions → evidence/attachments → tested scope,
44
+ PASSED/FAILED/BLOCKED/NOT_RUN, cleanup receipts, defect reproductions and concrete remaining needs.
45
+
46
+ ## Constraints
47
+ No dependency installation, production/shared fixtures, paid provider calls or remote writes beyond
48
+ existing authorization. Reuse host/runtime permission and source-write policies. No automatic merge,
49
+ release or business-owner UAT approval. Playwright mobile viewport emulation is web evidence, not a
50
+ native mobile device test. Test steps and receipts are producer-declared, not independent proof of agent
51
+ compliance; independent Harness/model evaluation is a separate use of harness-ai-evaluation.
52
+
53
+ ## Handoff
54
+ Give Implementer/Reviewer exact failed AC, reproducible interaction, tested revision/fixture, scoped
55
+ result and evidence paths. Domain-owner acceptance remains separate from automated end-user checks.
@@ -26,3 +26,7 @@ Use `.harness/core/workflows/continuous-development.md` to review baseline fresh
26
26
  stable requirement → spec → code → tests/evidence links and selective documentation diffs/proposals.
27
27
  Check required maintenance blockers and remaining-work handoff. Separate implementation complete,
28
28
  merged and released; neither a passing test nor this review supplies business approval.
29
+
30
+ For required end-user acceptance, inspect actual interface interaction, real/mocked dependency scope,
31
+ requirement surface, redacted attachments and source revision. API/unit/build evidence cannot prove a
32
+ browser/device journey. Required BLOCKED/NOT_RUN journeys prevent an unconditional completion claim.
@@ -11,7 +11,9 @@ User request, authoritative source links, existing specs and repository boundari
11
11
  1. Read source context and identify missing or conflicting business decisions. Follow the installed
12
12
  clarification workflow: ask 1–3 consequential questions with A/B/C trade-offs, a grounded
13
13
  recommendation and free text. Reuse established answers and authorization.
14
- 2. Draft proposal, design, tasks and capability delta specs in openspec/changes/<id>/.
14
+ 2. Use aih new-change <id> for Harness drafts. If an external OpenSpec propose flow created the change,
15
+ run aih change-sidecars <id> to add missing metadata/decisions/verification/artifact-impact templates
16
+ without overwriting existing files. Draft proposal, design, tasks and capability delta specs there.
15
17
  3. Use ADDED/MODIFIED/REMOVED requirement sections and WHEN/THEN acceptance scenarios.
16
18
  4. Include affected repositories, non-goals, security impact, migration and rollback.
17
19
  5. Plan vertical tasks with public test boundaries and trace them to requirements.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: harness-start
3
+ description: Start or resume Harness onboarding inside the current AI session; inspect existing context and ask only missing consequential questions.
4
+ ---
5
+
6
+ ## Input
7
+ The current user request, AGENTS.md, project-owned .harness/ configuration and available host tools.
8
+ The native Kiro wrapper exposes this skill as /harness-start. Other hosts can load this canonical skill.
9
+
10
+ ## Procedure
11
+ 1. Read AGENTS.md and the installed project-setup workflow. Identify the installed CLI invocation
12
+ already used by the user (npm/pip aih, npx, or offline node/aih.cmd); reuse it without downloading
13
+ or requiring another installation. Run `start --compact --host <current-host>` for a read-only orientation in any host, or read the same local configs
14
+ if shell access is unavailable. This returns a plan, not a second interview in a terminal.
15
+ If shared configuration is missing in a cloned snapshot, use `setup --apply --dry-run`, then
16
+ `setup --apply` with that same CLI. This scaffolds missing user files without changing the bundle.
17
+ Without shell access, read installed templates and create missing configs with host file tools;
18
+ preserve existing bytes, and report CLI integrity checks NOT_RUN. Do not reinstall or invent paths.
19
+ 2. Read local.md frontmatter first, then prose and start.json if present. Run `seed --check` to assess
20
+ freshness. On first use run `seed` for the source map. Inspect only needed sources and relevant
21
+ scoped AGENTS/conventions; cached summaries never replace applicable instructions.
22
+ Read .harness/decisions.json if present before asking. Reuse only confirmed project/applicable
23
+ module choices while their scope and sources remain valid; proposed/superseded answers do not
24
+ establish current behavior. A do_not_ask_again flag never prevents reconsidering changed evidence.
25
+ 3. Infer goal from the user's actual request. A bug report means change; do not ask them to choose
26
+ the category again. Reuse declared stack, accepted deviations, sources, outputs and host settings.
27
+ Ask at most 1–3 missing consequential questions at a time, with concrete options and a grounded
28
+ recommendation. Never require Maven for a non-Java skill or docs destinations for a tiny bugfix.
29
+ 4. During initial setup inspect build manifests, relevant conventions and authorized docs. Populate
30
+ local.md using the installed templates/local.md schema: stack/build values, sources inspected and
31
+ already approved deviations. Preserve all existing prose and decisions; migrate legacy prose
32
+ additively, without treating inferred exceptions as approved. Keep the summary compact and linked.
33
+ Declare shared tools/files/commands in environment.json; ignored machine.json overrides only
34
+ declared tool executables and file paths. For Maven settings use files.maven-settings.path.
35
+ For existing modules follow .harness/core/workflows/seed.md; for new work follow
36
+ .harness/core/workflows/greenfield-setup.md. Classify mode per affected module. Save observations
37
+ with sources, mark inferences/unknowns explicitly, and distinguish user-confirmed choices. Do not
38
+ force technology/CI/MCP interviews before they are relevant to the task.
39
+ 5. Inspect host MCP availability. For Kiro, `sync-integrations --host kiro --dry-run` can import server
40
+ aliases from local host config. Review discoveries and save declarations with the same command
41
+ without --dry-run. Inspect actual tools in the host; imported config does not establish access.
42
+ 6. Save a known task using `start --goal <idea|docs|change|resume> --task <text>` and --change only for
43
+ an existing resume checkpoint. Use structured tool arguments/proper shell quoting for user text.
44
+ Save accepted choices incrementally in their existing configs; no duplicate onboarding database.
45
+ Project/module decisions go in .harness/decisions.json; change-specific answers stay under the
46
+ OpenSpec change. Preserve superseded history and its replacement ID. Save after each meaningful
47
+ answer so interruption resumes from partial context; a completed hash cache is not required to
48
+ preserve a useful observation or confirmed answer.
49
+ Run doctor (and doctor --skill <name> before a selected skill). Resolve relevant missing fields,
50
+ then `seed --record` after reconciling the inspected sources. If interrupted, preserve partial facts;
51
+ do not mark uninspected sources as complete. The next invocation continues from saved facts.
52
+ 7. Show a short summary: task, stack/build, approved exceptions, sources, blockers and next action.
53
+ Continue the user's authorized task through solution-framing or continuous-development, loading
54
+ only relevant roles/skills. For spec proposals created by an external OpenSpec flow, run
55
+ `change-sidecars <id>` to add missing decisions/evidence/impact sidecars without overwriting.
56
+
57
+ ## Output
58
+ Shared context in local.md/environment.json, host connection declarations in integrations.json,
59
+ task in start.json, ignored machine paths if needed and reconciled hashes in knowledge.json.
60
+ An actionable next step or concrete blockers, with no repeated questionnaire for known facts.
61
+
62
+ ## Constraints
63
+ The host understands the project and asks questions; CLI validates and records local data. No model
64
+ API key, provider call, automatic delegation, secret copying or upstream OpenSpec modification.
65
+ Do not execute a saved task solely on SessionStart. Host/user authorization and core security apply.
66
+ Never claim token savings, live hook loading or model compliance without actual measurements.
@@ -11,6 +11,8 @@ Approved requirements/AC, scoped code and contracts, existing project tests/comm
11
11
  ## Procedure
12
12
  1. Discover languages, frameworks, architecture, routes/auth, data dependencies, existing docs and test entry points. `aih verify --adaptive` supplies metadata hints only; inspect scoped source and record unknowns.
13
13
  2. Select needed unit, integration, API/contract, backend/browser/mobile E2E, authorization/security, regression or AI/RAG evaluation. Reuse existing frameworks. A static site needs no invented API; a mobile app needs no forced browser suite.
14
+ For changed public journeys or an explicit end-user request, load harness-end-user-testing and the
15
+ installed end-user-acceptance workflow; use the actual interface and distinguish real/mocked scope.
14
16
  3. Derive scenarios from requirements: CRUD, approval/roles, state transitions, uploads, asynchronous events, transactions or external integrations only when applicable. Record preconditions, isolated fixtures, steps, expected business assertions, cleanup and evidence.
15
17
  4. Check actual tools, permissions and environment. Declare BLOCKED for missing infrastructure/access; NOT_RUN for skipped scope. Agree consequential gaps using existing clarification workflow.
16
18
  5. Execute through authorized host tools with bounded timeouts/retries. Assert transport plus business/schema/state/authorization semantics. Expected errors require exact HTTP/application assertions; timeout/network exceptions never pass by default.
@@ -6,3 +6,8 @@ Choose applicable verification methods from feature risk and existing tooling, r
6
6
 
7
7
  On resume, use `continuous-development.md` to compare the tested revision with the current baseline.
8
8
  Re-run affected checks after code/spec changes; a previous PASS does not verify a new revision.
9
+
10
+ For changed public journeys or an explicit end-user testing request, apply
11
+ `.harness/core/workflows/end-user-acceptance.md` and `harness-end-user-testing`: exercise the actual
12
+ interface, distinguish real/mocked dependencies, and include user-facing outcome evidence or concrete
13
+ BLOCKED/NOT_RUN reasons before completion. API/unit/build success cannot replace required browser/device flows.
@@ -27,3 +27,9 @@ canonical aliases and preferred skills without spawning workers or probing provi
27
27
  receipts and next owner. Reconcile checkpoint and current source/remote state before retries.
28
28
 
29
29
  Use continuous-development.md for full changes/resume. No CLI orchestration runtime or paid model calls.
30
+
31
+ Before applying a role, read contract_load_order from aih agents: the canonical core/capability contract,
32
+ then project-owned extensions in declared order. Extensions specialize domain facts; they cannot grant
33
+ permissions or weaken core security. Missing extensions block that role; reconcile contradictory facts
34
+ with the owner. Before a selected skill use aih doctor --skill <name> for declared requires; verify MCP
35
+ access/tools in the actual host even when local prerequisites pass.
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": [
6
+ "schema_version",
7
+ "workflow",
8
+ "approvals"
9
+ ],
10
+ "properties": {
11
+ "schema_version": {
12
+ "const": 1
13
+ },
14
+ "workflow": {
15
+ "type": "string",
16
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
17
+ },
18
+ "approvals": {
19
+ "type": "array",
20
+ "maxItems": 64,
21
+ "items": {
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": [
25
+ "stage",
26
+ "role",
27
+ "by",
28
+ "at",
29
+ "source_ref"
30
+ ],
31
+ "properties": {
32
+ "stage": {
33
+ "type": "string"
34
+ },
35
+ "role": {
36
+ "enum": [
37
+ "spec-owner",
38
+ "product-owner",
39
+ "reviewer"
40
+ ]
41
+ },
42
+ "by": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "maxLength": 4096
46
+ },
47
+ "at": {
48
+ "type": "string",
49
+ "format": "date-time",
50
+ "pattern": "Z$"
51
+ },
52
+ "source_ref": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "maxLength": 4096
56
+ }
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "description": "Producer declaration only. Drivers validate stage/role pairs, uniqueness and actual review authority/freshness separately."
62
+ }
@@ -3,6 +3,8 @@
3
3
  Apply during setup, requirement discovery and any later change that exposes a new consequential gap.
4
4
 
5
5
  1. Read the user request, project facts, relevant code/specs and previously recorded decisions.
6
+ Read .harness/decisions.json for project-wide/applicable module choices, then the active change's
7
+ decisions.json. Confirm applicability; superseded/proposed records are not current decisions.
6
8
  2. Separate verified facts, consequential unknowns and reversible implementation details.
7
9
  Ask about business behavior, public API contracts, data changes, authorization or costly architecture.
8
10
  Use project conventions for routine choices; record assumptions rather than blocking every edit.
@@ -12,7 +14,10 @@ Apply during setup, requirement discovery and any later change that exposes a ne
12
14
  Use the host's question UI if available; plain text is a valid fallback.
13
15
  4. For critical decisions, an unanswered question is not approval. Pause only the affected slice;
14
16
  continue independent authorized work. Do not silently implement a suggested answer.
15
- 5. Save shared setup answers in local.md/environment.json. Save change-specific questions, selected
17
+ 5. Save shared setup facts in local.md/environment.json and confirmed project/module choices in
18
+ .harness/decisions.json. Reuse them without asking again while scope and sources still apply.
19
+ Changed evidence may reopen an affected choice; do_not_ask_again is not permanent authority.
20
+ Save change-specific questions, selected
16
21
  answers and source references in decisions.json. Set reviewed=true only after examining the actual
17
22
  scope for consequential ambiguity; an empty decision list is valid when there are no such gaps.
18
23
  Status open means unresolved; resolved needs both answer and source. Preserve superseded decisions
@@ -99,3 +99,8 @@ implementation/merge/release status. On the next session, start again at baselin
99
99
 
100
100
  ## Meaningful-step recovery
101
101
  Use agent-routing.md for scoped perspectives. Keep the existing design/tasks/decisions/evidence current, then save a compact project-owned checkpoint after meaningful steps and before external side effects. aih checkpoint/resume supplies validation and local freshness hints, not execution. Record task/evidence IDs, baseline digests, completed/pending work, blockers, operation identity/status and next action; never copy chat or secrets. If interrupted, reconcile actual sources and unknown/prepared remote operations before retrying. Read real host usage/quota only when available; otherwise record unknown and retain user model settings. Use explicit actions/repository scope for an authorized autopilot; host/repo permission rules still apply.
102
+
103
+ For changed public journeys or an explicit end-user testing request, apply
104
+ `.harness/core/workflows/end-user-acceptance.md` and `harness-end-user-testing`: exercise the actual
105
+ interface, distinguish real/mocked dependencies, and include user-facing outcome evidence or concrete
106
+ BLOCKED/NOT_RUN reasons before completion. API/unit/build success cannot replace required browser/device flows.
@@ -0,0 +1,36 @@
1
+ # End-user acceptance
2
+
3
+ Trigger when the user asks to test like an end user or the changed behavior has an applicable public
4
+ journey. Use harness-end-user-testing with harness-verification. This workflow is available in Core;
5
+ it requires actual host tools and app access, not a separately launched Harness runtime.
6
+
7
+ 1. Read agreed AC/source revisions, saved project context, existing tests and affected routes/screens.
8
+ Reuse prior answers. `aih verify --adaptive` supplies end_user_acceptance metadata hints and a host
9
+ prompt; the host derives concrete scenarios from actual requirements, not generic detector rules.
10
+ 2. Establish the app URL or executable/start command, local/test/staging environment, actor/test-account
11
+ references and isolated data. Inspect existing environment.json/integrations.json; keep credentials
12
+ in the host. Ask 1–3 missing consequential questions with alternatives and a grounded recommendation.
13
+ 3. Reuse existing runners. Web: available Playwright/Cypress or authorized browser tools; native mobile:
14
+ existing device/simulator runner; CLI: real terminal; API-only: public HTTP interface and business
15
+ state. Documents-only changes use source review; do not invent a web app or claim browser coverage.
16
+ 4. Run the agreed happy and relevant negative/role/state journeys through that interface. Web test must
17
+ actually navigate and use controls. Fixture setup/API assertions supplement, not replace, UI steps.
18
+ Assert visible results and persistence where specified. Record exactly which backend/services were
19
+ real, mocked, absent by design or unknown; third-party mocks narrow the proven scope.
20
+ 5. Save redacted JSON observations and optional screenshots/traces/videos into existing configured
21
+ evidence locations (fallback local project-owned verification/ only when no external canonical route
22
+ is required). Use schema-1 report with requirement verification_target=end-user plus the expected surface and scenario journey
23
+ declarations; digest-check attachments as well as JSON. Raw attachments can contain secrets: review
24
+ before retention/sharing; do not dump storage-state cookies or credential-bearing traces into Git.
25
+ 6. PASSED only for actually executed scenarios whose expected AC assertions and owned cleanup pass.
26
+ Mocked/unknown dependencies cannot establish full end-user verification. Missing browser/device,
27
+ app/account/service access is BLOCKED; unexecuted or deliberate skips remain NOT_RUN with reasons.
28
+ Unit/component/build/static checks are supplementary. No check-count/coverage threshold substitutes
29
+ for the journey. CLI validation checks consistency, not real tool execution or stakeholder approval.
30
+ 7. Route bugs to scoped implementation and rerun affected journeys after source changes. Preserve
31
+ unrelated user work and stop bounded retries on persistent blockers. Reviewer's handoff includes
32
+ AC coverage, real/mocked scope, defects, redacted evidence and actual next needs. Required missing
33
+ journeys prevent unconditional completion; business-owner UAT and independent model eval are separate.
34
+
35
+ A small change needs only affected user journeys. Do not require every browser/platform on every task;
36
+ choose them from target users and risk, and disclose what was not exercised.
@@ -0,0 +1,27 @@
1
+ # Build context for a new project
2
+
3
+ Enter from harness-start/project-setup when no relevant implementation exists. `setup --greenfield`
4
+ selects this guidance; it does not establish project facts or install an adapter. Read current ideas,
5
+ authorized docs, local.md and confirmed decisions before asking. A new module in an existing repo
6
+ also needs the relevant existing-module seed and scoped conventions.
7
+
8
+ 1. Purpose: clarify only missing user outcomes, acceptance behavior and material constraints. Reuse
9
+ an existing BRD/PRD or the current conversation. Do not force stack choices before understanding
10
+ the requested product, or require every document template for a small tool.
11
+ 2. Design: when implementation needs it, propose the smallest stack/architecture satisfying known
12
+ constraints. Ask only consequential unresolved choices (data, integrations, deployment/network).
13
+ A framework choice does not imply microservices, corporate tooling or infrastructure.
14
+ 3. Conventions: adopt the relevant installed defaults unless an applicable approved project rule
15
+ overrides them. Record source/reason/scope for confirmed exceptions. Proposed conventions are
16
+ not user approval. Resolve API/error/data/test choices only when they affect the accepted scope.
17
+ 4. Tooling: discover the actual host, build/test commands and available integrations as needed.
18
+ Save shared commands/references separately from machine-only paths; never ask for credentials.
19
+ Defer irrelevant CI/MCP/IDE details rather than blocking useful requirements or implementation.
20
+
21
+ Ask at most 1–3 questions per turn with options, trade-offs and an evidence-based recommendation.
22
+ Save each established answer incrementally in existing configs and .harness/decisions.json; reuse
23
+ confirmed answers while their scope/sources apply. Mark unknowns/proposals explicitly, preserve
24
+ superseded decisions, and reopen only material affected choices when new evidence warrants it.
25
+ Before seed --record, create/link actual inspected project sources (such as accepted requirements);
26
+ no codebase or source means no claim of a reconciled source cache. Resume from partial saved answers.
27
+ Start authorized work once relevant minimum context exists; additional planning follows task depth.
@@ -4,9 +4,15 @@ Read AGENTS.md, local.md, actual build files and existing environment configurat
4
4
  For project/MVP/architecture decisions, apply `solution-framing.md` at the appropriate depth.
5
5
  For input/output/storage/source-write decisions, apply `artifact-contract.md`; ask only when
6
6
  needed for the task and reuse known project/session decisions.
7
+ Use harness-start in the current session (Kiro: /harness-start), with seed freshness checks.
7
8
  Use `aih start` for terminal intake or a read-only host plan; reuse `.harness/start.json` and declared
8
9
  artifacts before asking. CLI root-file discovery is metadata evidence; inspect content and the actual host.
9
10
  Use `aih setup` for structured suggestions; it never interviews the user or writes answers.
11
+ Use `aih setup --apply` only to scaffold missing user files from a cloned installed snapshot;
12
+ preview with --dry-run. Existing configs and managed payload/lock are preserved. Missing setup
13
+ does not justify reinstalling the bundle. machine.json/start.json are not fabricated by scaffolding.
14
+ Follow seed.md for existing modules and greenfield-setup.md for new modules; inspect their relevant
15
+ project-wide and module-scoped decisions in .harness/decisions.json before asking.
10
16
  Do not ask about facts already established in the repository or current conversation.
11
17
 
12
18
  1. Identify project scope, source documents, build/test commands and environment constraints.
@@ -19,11 +25,15 @@ Do not ask about facts already established in the repository or current conversa
19
25
  3. For Java, inspect Maven/Gradle wrappers before proposing PATH or a custom tool. A wrapper is
20
26
  a recommendation only when present and consistent with project policy; do not switch corporate
21
27
  tools or download a replacement without authorization.
22
- 4. Record shared facts and decisions in `.harness/local.md`: scope/mode, authoritative source paths,
28
+ 4. Record shared facts in `.harness/local.md`: scope/mode, authoritative source paths,
23
29
  layout and dependency boundaries, reusable common APIs, naming/error/test conventions, commands
24
30
  and approved exceptions. Link existing documentation instead of duplicating it. Keep missing facts
25
31
  explicit; do not overwrite previous answers. Define exact tool IDs, argument arrays
26
32
  and required file paths in `.harness/environment.json`. Record evidence/source, not guessed versions.
33
+ Save project-wide/module decisions in `.harness/decisions.json` with scope/status/answer/reason/source.
34
+ Keep proposed choices separate from confirmed ones. When replacing a decision preserve the old
35
+ record as superseded and link its confirmed replacement. Reuse answers only while applicable;
36
+ changed scope or contradictory sources can warrant a focused question even with do_not_ask_again.
27
37
  5. For a machine-specific executable/file location, use `.harness/machine.json` or an environment
28
38
  reference. The machine file can only override declared paths. It does not override permissions,
29
39
  arguments, requirements or business decisions. Do not store passwords/tokens in either file.
@@ -44,7 +54,8 @@ If C is selected, ask for only the missing executable/settings locations. Do not
44
54
 
45
55
  Explain the user-owned files in `.harness/`: project selection in project.json, model/agent preferences in
46
56
  agents.json, task in start.json, sources/destinations in artifacts.json, connection aliases in
47
- integrations.json, shared commands in environment.json and domain facts in local.md. OpenSpec config
57
+ integrations.json, shared commands in environment.json, domain facts in local.md and shared decisions
58
+ in decisions.json. OpenSpec config
48
59
  lives in openspec/config.yaml; checkpoints/evidence live under openspec/changes/<id>/, not in `.harness/state/`.
49
60
  Keep managed core/adapters/capabilities/templates/lock separate from customization. Update preserves
50
61
  user files; use `aih backup` and copy the reported JSON outside the project before consequential changes.
@@ -0,0 +1,25 @@
1
+ # Understand an existing project
2
+
3
+ Enter from harness-start/project-setup when affected modules already exist. CLI `seed` discovers
4
+ paths/hashes; the host reads and understands them. Reuse current context and applicable confirmed
5
+ project/module decisions; do not repeat a full repository scan each session.
6
+
7
+ 1. Topology: read root/scoped AGENTS, build manifests and declared convention/source guides.
8
+ Identify module boundaries and the affected stack. Do not infer architecture from adapter names.
9
+ 2. Architecture: inspect one or two representative modules relevant to the task, aiming at no more
10
+ than eight source files initially. Expand only to resolve a concrete boundary/behavior uncertainty.
11
+ Record source-linked observations; label inferences separately. Existing code is not approval for
12
+ an exception, especially when it conflicts with instructions or security.
13
+ 3. Tooling: discover only relevant skills/roles, current changes, declared commands and host tools.
14
+ MCP config names indicate declarations; confirm actual availability and scope in the host.
15
+ 4. Machine: reuse shared environment declarations. Ask only missing local executable/file locations
16
+ and save overrides in ignored machine.json. PATH/wrappers/custom settings are project choices;
17
+ do not universally require Maven or a settings flag.
18
+
19
+ Keep local.md compact with evidence paths and unresolved facts. Save confirmed project-wide/module
20
+ choices in .harness/decisions.json and change-specific choices under the active OpenSpec change.
21
+ Keep superseded answers traceable. Source changes invalidate affected assumptions; inspect the
22
+ changed source and any relevant scoped instructions, update only affected context, then seed --record.
23
+ Save partial observations after each useful step; do not fabricate completion or a confidence score.
24
+ Continue the authorized task when its relevant facts are sufficient; do not make exhaustive discovery
25
+ a gate for a small fix. Semantic understanding and token/time savings require actual host measurement.
@@ -2,14 +2,14 @@
2
2
 
3
3
  | Stage | Input | Output and gate |
4
4
  | --- | --- | --- |
5
- | Discover | Request, repository, linked sources | Scope/mode, affected repos and risks, convention sources, comparable code and reuse candidates; clarify consequential unknowns |
6
- | Specify | Agreed behavior | proposal, design, delta specs and vertical tasks |
7
- | Review spec | Acceptance scenarios and design | Owner agreement for consequential choices; explicit task authorization may already cover routine choices |
8
- | Implement | One task with a public test boundary and reuse plan | Failing meaningful test, minimal implementation, green test; established boundaries and rationale for new components |
9
- | Verify | Changed behavior | Relevant automated checks and honest skipped-check list |
10
- | Review | Diff plus spec and convention sources | Findings on correctness, security, compatibility, reuse, placement and unnecessary abstraction |
11
- | Deliver | Reviewed branch | PR with change ID, evidence, residual risks and rollback plan |
12
- | Archive | All associated PRs merged | Sync accepted specs and archive via OpenSpec in a separate reviewed change if needed |
5
+ | `discover` | Request, repository, linked sources | Scope/mode, affected repos and risks, convention sources, comparable code and reuse candidates; clarify consequential unknowns |
6
+ | `specify` | Agreed behavior | proposal, design, delta specs and vertical tasks |
7
+ | `review-spec` | Acceptance scenarios and design | Owner agreement for consequential choices; explicit task authorization may already cover routine choices |
8
+ | `implement` | One task with a public test boundary and reuse plan | Failing meaningful test, minimal implementation, green test; established boundaries and rationale for new components |
9
+ | `verify` | Changed behavior | Relevant automated checks and honest skipped-check list |
10
+ | `review` | Diff plus spec and convention sources | Findings on correctness, security, compatibility, reuse, placement and unnecessary abstraction |
11
+ | `deliver` | Reviewed branch | PR with change ID, evidence, residual risks and rollback plan |
12
+ | `archive` | All associated PRs merged | Sync accepted specs and archive via OpenSpec in a separate reviewed change if needed |
13
13
 
14
14
  Apply `artifact-contract.md` for declared inputs/outputs, canonical ownership and connections.
15
15
  Maintain affected docs/spec/UI in the same change; record artifact-impact.json when outputs are
@@ -42,3 +42,14 @@ For proportional checks and evidence integrity, use `.harness/core/workflows/ada
42
42
 
43
43
  For successive changes and resumed sessions, enter through `continuous-development.md` for baseline
44
44
  reconciliation, selective artifact maintenance, feedback triage and evidence-linked handoff.
45
+
46
+ For changed public journeys or an explicit end-user testing request, apply
47
+ `.harness/core/workflows/end-user-acceptance.md` and `harness-end-user-testing`: exercise the actual
48
+ interface, distinguish real/mocked dependencies, and include user-facing outcome evidence or concrete
49
+ BLOCKED/NOT_RUN reasons before completion. API/unit/build success cannot replace required browser/device flows.
50
+
51
+ When an external OpenSpec propose flow creates a change, run aih change-sidecars <id> before the
52
+ clarification/readiness stages to create missing metadata, decisions, verification and artifact-impact
53
+ sidecars. Existing files remain unchanged; Harness does not patch the upstream OpenSpec CLI.
54
+
55
+ Machine contract: spec-to-code.workflow.json. Use explicit `aih ready <id> --workflow spec-to-code --stage implement` to require a recorded review-spec approval; legacy implement/review calls retain their structural behavior. Approval records declare an external review, not authenticated identity or permission.
@@ -0,0 +1,99 @@
1
+ {
2
+ "schema_version": 1,
3
+ "id": "spec-to-code",
4
+ "stages": [
5
+ {
6
+ "id": "discover",
7
+ "owner": "core:planner",
8
+ "next": [
9
+ "specify"
10
+ ]
11
+ },
12
+ {
13
+ "id": "specify",
14
+ "owner": "core:planner",
15
+ "outputs": [
16
+ "proposal.md",
17
+ "design.md",
18
+ "tasks.md"
19
+ ],
20
+ "next": [
21
+ "review-spec"
22
+ ]
23
+ },
24
+ {
25
+ "id": "review-spec",
26
+ "owner": "human:spec-owner",
27
+ "entry_gate": {
28
+ "deterministic": [
29
+ "spec-structure"
30
+ ]
31
+ },
32
+ "approval": {
33
+ "role": "spec-owner"
34
+ },
35
+ "next": [
36
+ "implement"
37
+ ],
38
+ "on_reject": "specify"
39
+ },
40
+ {
41
+ "id": "implement",
42
+ "owner": "core:implementer",
43
+ "entry_gate": {
44
+ "deterministic": [
45
+ "spec-structure",
46
+ "decisions-resolved",
47
+ "tasks-present",
48
+ "artifact-impact"
49
+ ],
50
+ "approval_from": "review-spec"
51
+ },
52
+ "next": [
53
+ "verify"
54
+ ]
55
+ },
56
+ {
57
+ "id": "verify",
58
+ "owner": "core:test-engineer",
59
+ "entry_gate": {
60
+ "deterministic": [
61
+ "tasks-complete"
62
+ ]
63
+ },
64
+ "next": [
65
+ "review"
66
+ ],
67
+ "on_fail": "implement"
68
+ },
69
+ {
70
+ "id": "review",
71
+ "owner": "core:reviewer",
72
+ "entry_gate": {
73
+ "deterministic": [
74
+ "spec-structure",
75
+ "decisions-resolved",
76
+ "tasks-complete",
77
+ "verification-evidence",
78
+ "artifact-impact"
79
+ ]
80
+ },
81
+ "next": [
82
+ "deliver"
83
+ ],
84
+ "on_fail": "implement"
85
+ },
86
+ {
87
+ "id": "deliver",
88
+ "owner": "core:planner",
89
+ "next": [
90
+ "archive"
91
+ ]
92
+ },
93
+ {
94
+ "id": "archive",
95
+ "owner": "core:planner",
96
+ "next": []
97
+ }
98
+ ]
99
+ }