@ihyeon/flow-qa 0.9.0 → 0.9.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/README.ko.md CHANGED
@@ -39,6 +39,8 @@ npm run demo:smoke
39
39
 
40
40
  ## 내 서비스 연결
41
41
 
42
+ AI 도우미와 사용할 때는 패키지에 포함된 [Flow QA 스킬](skills/flow-qa/SKILL.md)과 [AI 사용 안내](docs/ai.md)를 참고하세요. 프로젝트에 설치한 뒤 `mkdir -p .agents/skills && cp -R node_modules/@ihyeon/flow-qa/skills/flow-qa .agents/skills/flow-qa`로 폴더 전체를 복사하고, 도우미에게 특정 플로우에 `flow-qa` 스킬을 사용하도록 요청할 수 있습니다. 참조 파일도 함께 복사되며 [llms.txt](llms.txt)에서 안내 문서를 찾을 수 있습니다. 로컬 설치의 CLI는 `npx --no-install flow-qa --help`로 확인합니다.
43
+
42
44
  테스트용 작업 공간에서 시작합니다. 연결한 앱에 실제 클릭과 입력이 발생하므로 테스트 환경과 데이터를 사용하세요.
43
45
 
44
46
  ```sh
package/README.md CHANGED
@@ -39,6 +39,8 @@ npm run demo:smoke
39
39
 
40
40
  ## Connect your own app
41
41
 
42
+ An AI assistant can use the packaged [Flow QA skill](skills/flow-qa/SKILL.md) and [AI guide](docs/ai.md) to review cases and choose a local run or external browser-agent handoff. With a project-local install, copy the complete folder using `mkdir -p .agents/skills && cp -R node_modules/@ihyeon/flow-qa/skills/flow-qa .agents/skills/flow-qa`; then ask your assistant to use the `flow-qa` skill for a specific flow. The copied skill includes its own reference, and the package exposes [llms.txt](llms.txt) for discovery. Use `npx --no-install flow-qa --help` with the local install.
43
+
42
44
  Start with a test workspace and test data: a run can click and enter text in the connected app.
43
45
 
44
46
  ```sh
@@ -22,20 +22,24 @@ export const agentHandoffRequestSchema = z.object({
22
22
  selection: z.object({ caseIds: z.array(idSchema).min(1).max(100), totalCases: z.number().int().min(2).max(100) }).strict().optional(),
23
23
  suite: suiteSchema,
24
24
  }).strict();
25
+ const observationSchema = z.object({
26
+ stepIndex: z.number().int().min(0).max(99),
27
+ outcome: z.enum(['matched', 'mismatch']),
28
+ detail: safeDetail,
29
+ evidence: evidencePath,
30
+ }).strict();
31
+ const emptyObservations = z.array(observationSchema).length(0);
32
+ const observedAssertions = z.array(observationSchema).min(1).max(100);
33
+ const agentResultCaseSchema = z.discriminatedUnion('status', [
34
+ z.object({ id: idSchema, status: z.literal('unverified'), observations: emptyObservations }).strict(),
35
+ z.object({ id: idSchema, status: z.literal('blocked'), reason: safeDetail, observations: emptyObservations }).strict(),
36
+ z.object({ id: idSchema, status: z.literal('observed-passed'), observations: observedAssertions }).strict(),
37
+ z.object({ id: idSchema, status: z.literal('observed-failed'), observations: observedAssertions }).strict(),
38
+ ]);
25
39
  export const agentResultSchema = z.object({
26
40
  schemaVersion: z.literal('flow-qa/agent-result-1'),
27
41
  requestSha256: hash,
28
- cases: z.array(z.object({
29
- id: idSchema,
30
- status: z.enum(['unverified', 'blocked', 'observed-passed', 'observed-failed']),
31
- reason: safeDetail.optional(),
32
- observations: z.array(z.object({
33
- stepIndex: z.number().int().min(0).max(99),
34
- outcome: z.enum(['matched', 'mismatch']),
35
- detail: safeDetail,
36
- evidence: evidencePath,
37
- }).strict()).max(100),
38
- }).strict()).min(1).max(100),
42
+ cases: z.array(agentResultCaseSchema).min(1).max(100),
39
43
  }).strict();
40
44
  function within(parent, child) {
41
45
  return child.startsWith(`${parent}${path.sep}`);
@@ -94,7 +98,7 @@ The registered target URL in \`request.json\` has no credentials, query, or frag
94
98
 
95
99
  For a web case, execute steps in order: \`open\` navigates to the target origin plus its app-relative path (a leading \`/\` replaces any base URL path, matching the built-in runner); if the first step is not \`open\`, start at the target origin's \`/\`. \`click\` and \`fill\` use the specified role/name, label, text, or test ID; \`act\` is a natural-language browser action within the target; \`assertVisible\` checks the requested visibility; \`assertText\` checks exact or contained text; \`assertUrl\` checks the expected URL; \`assertAgent\` requires a reasoned observation of its stated condition. If a locator, prerequisite, or expected outcome is unclear, mark that case \`blocked\` and explain why. Stop a case on the first mismatch or blocked prerequisite. Do not invent missing setup or mark a step passed from an action alone.
96
100
 
97
- Copy \`agent-result.template.json\` to a new \`agent-result.json\` and fill every selected case ID. Keep \`requestSha256\` unchanged. Use \`unverified\` for cases you did not inspect, \`blocked\` with a concrete reason for cases that cannot be evaluated, \`observed-passed\` only when every assertion was observed to match, and \`observed-failed\` when an assertion mismatch was observed. For each evaluated assertion, add its zero-based \`stepIndex\`, \`outcome\`, a concrete \`detail\` describing what appeared, and a file path such as \`evidence/TC-001-step-3.png\` or \`evidence/TC-001-step-3.txt\`. Create the referenced screenshot or text note under this folder's \`evidence/\` directory. Redact secrets and personal data before saving evidence. Do not claim a product defect from one observation; describe the observed mismatch and conditions.
101
+ Copy \`agent-result.template.json\` to a new \`agent-result.json\` and fill every selected case ID. Keep \`requestSha256\` unchanged. Use \`unverified\` for cases you did not inspect: omit \`reason\` and leave \`observations\` empty. Use \`blocked\` for cases that cannot be evaluated: include a concrete \`reason\` and leave \`observations\` empty. Use \`observed-passed\` only when every assertion was observed to match, and \`observed-failed\` when an assertion mismatch was observed. For either observed status, omit \`reason\` and record the mismatch explanation in the assertion's \`detail\`. List evaluated assertions in step order; for a failure, stop after the first mismatch. For each evaluated assertion, add its zero-based \`stepIndex\`, \`outcome\`, a concrete \`detail\` describing what appeared, and a file path such as \`evidence/TC-001-step-3.png\` or \`evidence/TC-001-step-3.txt\`. Create the referenced screenshot or text note under this folder's \`evidence/\` directory. Redact secrets and personal data before saving evidence. Do not claim a product defect from one observation; describe the observed mismatch and conditions.
98
102
 
99
103
  Run \`flow-qa agent-review <this-folder> <this-folder>/agent-result.json\` on the reviewer's machine to check completeness and evidence references. The review is an agent-supplied analysis, not an engine-verified \`qa-report.json\` or proof that the agent truly executed the case.
100
104
  `;
@@ -152,17 +156,11 @@ function validateAgentResult(request, result) {
152
156
  if (testCase.questions.length && item.status !== 'blocked' && item.status !== 'unverified')
153
157
  throw new Error(`Case ${item.id} has open questions and cannot be reported as observed.`);
154
158
  if (item.status === 'blocked') {
155
- if (!item.reason || item.observations.length)
156
- throw new Error(`Case ${item.id} needs a block reason and no observations.`);
157
159
  continue;
158
160
  }
159
161
  if (item.status === 'unverified') {
160
- if (item.reason || item.observations.length)
161
- throw new Error(`Case ${item.id} is unverified but contains findings.`);
162
162
  continue;
163
163
  }
164
- if (item.reason || !item.observations.length)
165
- throw new Error(`Case ${item.id} needs assertion observations and no block reason.`);
166
164
  for (const [observationIndex, observation] of item.observations.entries()) {
167
165
  if (observation.stepIndex !== assertionIndexes[observationIndex])
168
166
  throw new Error(`Case ${item.id} has an invalid, duplicate, or out-of-order assertion step index.`);
@@ -226,7 +224,7 @@ export async function reviewAgentHandoff(directoryPath, resultPath) {
226
224
  `Observed passed: ${counts['observed-passed']} · observed failed: ${counts['observed-failed']} · blocked: ${counts.blocked} · unverified: ${counts.unverified}`, '',
227
225
  ...result.cases.flatMap((item) => [
228
226
  `## ${safeLine(item.id)} — ${safeLine(item.status)}`,
229
- ...(item.reason ? [`Reason: ${markdownLiteral(item.reason)}`] : []),
227
+ ...(item.status === 'blocked' ? [`Reason: ${markdownLiteral(item.reason)}`] : []),
230
228
  ...item.observations.map((observation) => `- Assertion step ${observation.stepIndex}: ${observation.outcome}; ${markdownLiteral(observation.detail)} [${observation.evidence}]`),
231
229
  '',
232
230
  ]),
package/docs/ai.md ADDED
@@ -0,0 +1,33 @@
1
+ # Using Flow QA with an AI assistant
2
+
3
+ Flow QA supplies a local CLI, a case schema, a planning prompt, deterministic test execution, and a separate external agent handoff. An AI assistant can help author or review the inputs, but its proposed product expectations need human review. The [portable Flow QA skill](../skills/flow-qa/SKILL.md) gives an assistant the CLI decision path; it and its reference are included in the npm package.
4
+
5
+ ## Install the project skill
6
+
7
+ After installing `@ihyeon/flow-qa` in your project, copy the complete skill folder into an agent skill directory. For example:
8
+
9
+ ```sh
10
+ mkdir -p .agents/skills
11
+ cp -R node_modules/@ihyeon/flow-qa/skills/flow-qa .agents/skills/flow-qa
12
+ ```
13
+
14
+ The copied folder is self-contained. Invoke `flow-qa` from the installed package through `npx --no-install flow-qa` (or use a globally installed CLI). The skill never installs a global agent configuration and does not call a model by itself.
15
+
16
+ ## Plan, review, and run
17
+
18
+ Write a flow with its initial state, actions, observable expected outcomes, and needed test data. Then:
19
+
20
+ ```sh
21
+ flow-qa init my-qa
22
+ flow-qa plan flows/my-flow.md --prompt-only --workspace my-qa
23
+ # Give my-qa/planning/my-flow.prompt.md to an AI you choose; save the JSON as my-qa/cases/my-flow.json.
24
+ flow-qa validate cases/my-flow.json --workspace my-qa
25
+ flow-qa connect preview --url https://preview.example.test --workspace my-qa
26
+ flow-qa run cases/my-flow.json --target preview --workspace my-qa
27
+ ```
28
+
29
+ Review the AI's requirements, locators, preconditions, and assertions before execution. Unknown desired behavior belongs in `questions` and blocks the case. Validation verifies case structure, not the truth of a product requirement. A registered target is a choice of app/device, not proof that it is ready or safe for a run. Runs can change data in the connected app. Use `--case TC-001` repeatedly for a selected run; its report does not cover omitted cases. `act` and `assertAgent` require a separately configured agent model; fixed steps do not.
30
+
31
+ For a coding agent with its own browser tools, use `flow-qa agent-handoff cases/my-flow.json --target preview --workspace my-qa` after review. Give the agent the resulting folder and `AGENT_PROMPT.md`; when it returns `agent-result.json` and evidence files, run `flow-qa agent-review <folder> <folder>/agent-result.json`. The bundle starts `not-run`. Review validates the returned structure and local evidence references; it does not prove the agent visited the app, and its observations stay separate from engine backed `qa-report.json`. Read the [handoff guide](agent-handoff.md) for the bundle contract.
32
+
33
+ The CLI accepts `--lang ko` for Korean product messages. It does not translate your flow, cases, or evidence. Inspect target URLs, case text, screenshots, and reports for sensitive data before sharing them.
package/docs/releases.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Releases and verification
2
2
 
3
+ ## 0.9.2 — copied-skill installation and agent result contract
4
+
5
+ An independent agent used a generated handoff to observe a real browser failure, then returned an observed-failed case with an explanatory `reason`. The exported JSON Schema allowed that field while `agent-review` already rejected it. Generated schemas and prompts now describe the existing per-status rules: observed outcomes put the explanation in assertion observations and omit the blocking reason; blocked and unverified outcomes retain their distinct reason/observation limits. The result schema version and runtime interpretation are unchanged.
6
+
7
+ The portable skill also identifies the scoped npm package `@ihyeon/flow-qa` and local CLI invocation so a new project does not try to install the binary name as an unscoped package. Focused status-contract regression checks, the full 124-test check, type/UI checks, package checks, and installed-package smoke passed locally. Public package and end-to-end evidence are verified separately for this source.
8
+
9
+ ## 0.9.1 — portable AI integration guidance
10
+
11
+ The npm package now includes `skills/flow-qa/` with a self-contained integration skill and workflow reference, `docs/ai.md`, and `llms.txt`. A consumer can copy the whole skill folder from the installed package into a project-local agent directory, without global installation or a new model API. Instructions use the installed CLI and distinguish planning, case review, external agent observations, and native runner reports. Runtime behavior and public result formats are unchanged.
12
+
13
+ Package checks assert that the skill and references survive packing and installation. Local tarball consumer checks executed `init`, `plan --prompt-only`, `validate`, `agent-handoff`, and `agent-review` with an unverified result template; this does not claim a real external target or model run. Remote CI and registry publication are verified separately for this version.
14
+
3
15
  ## 0.9.0: hand web QA to an external agent
4
16
 
5
17
  `agent-handoff` exports a validated web suite, clean registered target, selection identity, portable prompt, JSON result schema/template, and evidence directory. The recipient uses its own browser tools without installing or invoking Flow QA or the e2e runtime. Creating the bundle opens no browser and calls no model. Source changes, unsupported mobile suites, unsafe target URLs, existing outputs, and symlinked output parents are rejected.
package/llms.txt ADDED
@@ -0,0 +1,9 @@
1
+ # Flow QA
2
+
3
+ > Local CLI and UI for planning user-flow cases and recording evidence-backed QA results.
4
+
5
+ - [AI assistant guide](docs/ai.md): Install the portable skill, plan and review cases, choose a runner or external agent handoff.
6
+ - [Portable skill](skills/flow-qa/SKILL.md): Instructions that can be copied with its references into a project's `.agents/skills` directory.
7
+ - [External agent handoff](docs/agent-handoff.md): Bundle contract and result-review limits.
8
+ - [CLI and overview](README.md): Setup, commands, and result interpretation.
9
+ - [한국어 안내](README.ko.md): Korean overview.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/flow-qa",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "license": "MIT",
5
5
  "author": "Hyeonse Im",
6
6
  "repository": {
@@ -28,6 +28,8 @@
28
28
  "dist",
29
29
  "licenses",
30
30
  "docs/*.md",
31
+ "llms.txt",
32
+ "skills/flow-qa",
31
33
  "LICENSE",
32
34
  "THIRD_PARTY_NOTICES.md",
33
35
  "README.ko.md"
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: flow-qa
3
+ description: Use Flow QA to turn a user flow into reviewed cases, run a registered test target, or prepare and review a web suite for an external browser agent. Use when the user asks for Flow QA setup, case planning, execution, or result interpretation.
4
+ ---
5
+
6
+ # Flow QA
7
+
8
+ Install the CLI in the current project with `npm install --save-dev @ihyeon/flow-qa` if needed. Invoke the project-local CLI as `npx --no-install flow-qa` (for example, `npx --no-install flow-qa init my-qa`). Read [the workflow reference](references/workflow.md) for actual command forms and the choice between a local run and an external agent handoff. This reference travels with this skill when copied out of the npm package.
9
+
10
+ Before execution, review the flow, proposed cases, target, and side effects with the user when their authorization does not already cover them. Keep unknown expected results in case `questions`; never convert an observation or assumed product behavior into a passing assertion. Verify the selected case IDs and target identity before a run or handoff.
11
+
12
+ Report what happened: authored or validated cases, an engine run with its saved report, or external agent observations checked by `agent-review`. A handoff is `not-run`; reviewing an agent result checks its shape and evidence references, not whether the agent actually visited the app. A selected run covers only selected cases. Keep model calls, browser runs, and external sharing within the user's authorization.
@@ -0,0 +1,50 @@
1
+ # Flow QA CLI workflow
2
+
3
+ Install `@ihyeon/flow-qa` in the project with `npm install --save-dev @ihyeon/flow-qa` if needed. Run the local CLI with `npx --no-install flow-qa`; prefix each example below with `npx --no-install` when using a project-local install. Run `npx --no-install flow-qa --help` to inspect the installed version. Paths to flows and cases below are relative to `--workspace`; `flow-qa init my-qa` creates a local example and configuration without replacing existing files.
4
+
5
+ ## Design and review
6
+
7
+ Describe the starting state, actions, observable expected result, and required test data in `flows/my-flow.md`. For an AI already in use, generate a planning prompt without configuring a model:
8
+
9
+ ```sh
10
+ flow-qa plan flows/my-flow.md --prompt-only --workspace my-qa
11
+ ```
12
+
13
+ Give the generated `planning/my-flow.prompt.md` to that AI, save its JSON reply as `cases/my-flow.json`, review every requirement, locator, assertion, precondition and open question, then run:
14
+
15
+ ```sh
16
+ flow-qa validate cases/my-flow.json --workspace my-qa
17
+ ```
18
+
19
+ Validation confirms the schema, not that product expectations are correct. Cases with `questions` are blocked. `preconditions` describe setup but do not create accounts, inventory, login state, or other data. A changed source flow invalidates a suite with recorded source provenance; redesign cases rather than bypassing the check. Planning can also use a configured planner model, which sends the flow to the configured endpoint.
20
+
21
+ ## Choose and execute a target
22
+
23
+ For web, register a test URL and review that it points to an allowed test environment:
24
+
25
+ ```sh
26
+ flow-qa connect preview --url https://preview.example.test --workspace my-qa
27
+ flow-qa doctor --workspace my-qa
28
+ flow-qa run cases/my-flow.json --target preview --workspace my-qa
29
+ ```
30
+
31
+ Web execution needs the package's Chromium (`flow-qa browser install`). The run can click and type in the connected app; prepare test data first. Fixed steps run without a model. `act` and `assertAgent` need a separately configured tool and image capable agent model. `flow-qa generate cases/my-flow.json --workspace my-qa` writes test code without executing it.
32
+
33
+ To run only named cases, repeat `--case TC-001 --case TC-003` on `run`. Omitted cases were not evaluated. Each case must establish its own starting state; selecting a case does not run earlier cases as prerequisites. The run writes `qa-report.json` and `qa-report.md` under a new `.flowqa/runs/<run-id>/`. Use `flow-qa report <run-directory> --workspace my-qa` to read a saved report. Compare only with attention to suite, target, selection, and external data state.
34
+
35
+ ## External browser agent path (web only)
36
+
37
+ For a reviewed web suite and an external agent with its own browser tools:
38
+
39
+ ```sh
40
+ flow-qa agent-handoff cases/my-flow.json --target preview --workspace my-qa
41
+ # Optionally repeat --case TC-001, or set --out to a new directory.
42
+ ```
43
+
44
+ The command prints a private handoff directory; no test runs. Inspect `request.json`, the selected case text, target URL, and the generated `AGENT_PROMPT.md` before sharing. The bundle contains a result template and JSON Schema. Have the agent record actual observations and evidence under `evidence/`, leaving unvisited cases `unverified` and cases with unresolved expectations `blocked`. Then run:
45
+
46
+ ```sh
47
+ flow-qa agent-review <handoff-directory> <handoff-directory>/agent-result.json
48
+ ```
49
+
50
+ This review checks request binding, case scope and order, observation structure, and evidence file references. It does not verify visits or evidence authenticity and does not create an engine QA report. Handoff omits model connection settings but does not mask case content; check material before sharing. See `AGENT_PROMPT.md` and `agent-result.schema.json` inside each generated bundle for that bundle's exact contract.