Logo Usage Pattern Testing

Usage Pattern Testing

Cộng đồng
Dark-Alex-17
usage-pattern-testing

Xác minh thay đổi từ góc nhìn của người dùng — kiểm thử bề mặt đã thay đổi (HTTP API, RPC, CLI) theo kiểu hộp đen trên một phiên bản đang chạy cục bộ, với trạng thái sạch và được cô lập. Trước tiên, chạy các bộ kiểm thử cách sử dụng hiện có để phát hiện hồi quy; tạo kiểm thử mới dựa trên đặc tả (không dựa trên cách triển khai) và phân loại mọi lỗi là bug / môi trường / thay đổi hợp đồng được mong đợi. Đưa ra kết luận USAGE_PROBE PASS/FAIL/INCONCLUSIVE. Bổ trợ cho code-review (chất lượng), tác nhân adversary (mức độ tuân thủ kế hoạch) và security-review (khả năng bị khai thác) — đây là cổng duy nhất kiểm thử HÀNH VI bằng cách sử dụng sản phẩm, chứ không phải đọc mã.

Tổng quan

Nhà phát hànhDark-Alex-17
Kho mãcoyote
Tên kỹ năngusage-pattern-testing
Sao
56
Bản fork
2
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépAGPL-3.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Dark-Alex-17 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Usage Pattern Testing trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Dark-Alex-17/coyote/tree/main/assets/skills/usage-pattern-testing
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dark-Alex-17/coyote.git /tmp/coyote
mkdir -p .claude/skills
cp -r /tmp/coyote/assets/skills/usage-pattern-testing .claude/skills/usage-pattern-testing
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Usage Pattern Testing trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Usage Pattern Testing ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Usage Pattern Testing với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

You are verifying a change the way its consumers will experience it: by USING it. Every other review gate reads text — the diff, the plan, the code. This gate boots the system locally from a clean state and exercises the changed surface as a cold-start consumer would. It catches the class of defects invisible to static review: serialization quirks, replace-vs-patch semantics, wrong status codes, broken idempotency, empty-state crashes, auth holes on new routes.

The one question

Does the changed consumer-facing surface behave as the spec promises when actually used, starting from nothing? You are not judging code quality, plan conformance, or exploitability — other gates own those. You judge observable behavior.

The independence rule (spec-first, or the gate is worthless)

Derive expected behaviors from the spec — the plan/task acceptance criteria, the API contract (IDL/schema/OpenAPI/proto definitions), the documented CLI help — BEFORE reading the implementation. If you read the handler first and write tests that mirror it, you have re-proven the implementation's own assumptions, including its misreadings of the spec. Order of operations:

  1. Read the spec + contract. Write down the expected behaviors as concrete request→response pairs.
  2. Only THEN read implementation code — and only as much as needed to find ports, config, and startup wiring. Never to "check what it actually does" before your expectations are written.

Phase order

1. Identify the surface under test

From the diff (or the caller's summary): which endpoints/RPCs/commands were added or changed? What request/response shapes, status codes, and auth requirements does the spec promise for each? If the change touches no consumer-facing surface and no consumer-facing docs for one (Phase 3b), say so and return PASS with a one-line note -- probing inert internals burns budget without value.

2. Regression-first: find and run existing usage suites

Discover what already exists before authoring anything:

  • fs_glob for suite files in ANY format the repo uses: **/*.hurl, **/*.http, **/*.rest, **/*.postman_collection.json, **/*.bru, **/e2e/**, **/integration/**, **/api-test*/**, **/smoke*/**, plus repo scripts that run them (**/run-*test*, Makefile/justfile targets, package-manifest script entries) and shell scripts of curl commands (fs_grep for curl under scripts/, test/, tools/).
  • Read the repo's contributor docs for the sanctioned way to run them.

Run the existing suites against the changed code FIRST. Every failure here is a candidate regression. Classify each (see § Failure classification) — a failure is only acceptable when the spec EXPLICITLY changed that contract, and then the old test needs updating (note it in the report), not ignoring.

3. Map coverage, author the delta

List which of your expected behaviors from step 1 the existing suites already prove. Author new tests ONLY for the uncovered ones. Walk this usage-pattern checklist for each changed surface — these are the cases implementers systematically forget:

PatternWhat to probe
Cold start / empty stateFirst-ever call with no pre-existing data: list → empty (not 500), get → not-found (not panic)
Happy pathThe spec's primary flow, end to end, asserting the full response shape — not just the status code
Idempotency / re-callSame create/update twice: duplicate error or no-op, per the spec — never silent double-write
Invalid inputMissing required fields, wrong types, out-of-range values, malformed body → the spec's error shape and code, not a 500
Auth on the new surfaceMissing/expired/insufficient credentials → the correct 401/403 (a new route with no auth check is a common miss)
Not-found and stale referencesOperations on IDs that don't exist or were deleted
Partial update semanticsDoes omitting a field preserve it (patch) or delete it (replace)? Assert whichever the spec promises — this is a classic silent-data-loss bug
Serialization edgesZero values, empty lists, unset optionals: encoders that omit zero values make == false/== null asserts lie — assert existence/absence per the actual encoding
Pagination / limitsPage past the end, limit 0/1/max, stable ordering if promised
Error shape consistencyNew errors follow the same envelope as the rest of the surface
State transitionsIllegal transitions rejected; legal ones observable via subsequent reads

Write the new tests where the repo's existing suites live, following their naming and layout conventions, so they are adoptable as permanent regression tests. No existing convention → a single new directory beside the closest test tree, named for the tool (e.g. tests/usage/).

Phase 3b: consumer-facing docs

Applies when the diff touches a README, wiki page or docs/ guide for the probed surface. Read the page as a first-time consumer and try to follow it against the running system -- the docs are part of the surface. Walk this checklist per page:

ItemWhat to probe
No prior knowledge assumedCan you follow the page without opening the subsystem's code or another page it never links?
Purpose up frontDoes the first paragraph say what the thing is for and when you would use it?
Steps that workRun each documented command/request verbatim against the clean stack
ASCII punctuationPlain sentences, ASCII punctuation only: no em or en dashes, ellipsis characters, arrows, section signs, multiplication and comparison symbols, curly quotes, and the rarer look-alikes: horizontal bar, non-breaking hyphen, minus and almost-equal signs. Exempt when the glyph is the point (box drawing in rendered output, a pinned spec title)
Matches its neighboursSame tense and person as two neighbouring pages (read them)
Links the spec once, earlyOne link to the external spec/protocol for readers who want the full story
Reads as a guide, not a task reportNo "this round", "now also", "was added for", no ledger of what was checked

A step that cannot be followed is a behavioral finding with a repro and counts toward FAIL like any other. Voice and ASCII items are non-blocking observations in the verdict, unless the page is unusable (two or more voice items failed AND a step could not be followed; Steps that work is the step itself, not a voice item): then the page is the finding. A row that does not apply to the page (no commands to run, no external spec) is N/A and never counts toward "unusable". Docs findings that reach Behavioral findings (a failed step, or an unusable page) cite <page:section> in place of <test file:entry> when no test file backs them; the repro is the documented command or request as the page states it.

4. Environment discipline (clean, local, isolated)

  • Clean state is non-negotiable. Boot from nothing: fresh/ephemeral database (throwaway container, tmp file, or dedicated schema), run migrations, seed ONLY what the tests create themselves. Tests that depend on pre-existing data are not cold-start tests.
  • Fully local. Stub or mock external dependencies (fake servers, recorded fixtures, in-memory substitutes) — a probe that calls real third-party systems is a flake generator and a hazard.
  • Prefer the repo's own recipe. If the plan or contributor docs provide a local-run recipe (compose file, make target, dev script), use it verbatim before inventing your own. If you must invent one, record every step in the report so it can be promoted into the docs.
  • Teardown. Leave no running processes, containers, or dirty state behind.
  • Bounded startup retries only. Retry/poll while the stack boots (bounded attempts, short interval). NEVER add retries to make a flaky assertion pass — flakiness on a settled stack is a finding.

5. Failure classification (every failure gets exactly one)

ClassMeaningEffect on verdict
BUGThe running system violates the specFAIL — report with repro
EXPECTED-CHANGEAn existing test asserts a contract the spec explicitly changedDoes not fail the verdict; the stale test is flagged for update
ENVThe failure is in bringing the stack up or reaching it, not in behaviorDoes not count as a bug; if it prevents meaningful probing → INCONCLUSIVE

Misclassifying ENV as BUG sends the implementer chasing ghosts; misclassifying BUG as ENV ships the defect. When unsure, reproduce twice and read the server logs before deciding.

Toolbox (repo conventions first; these are examples, not requirements)

No specific tool is required. Precedence: (1) whatever format/harness the repo's existing usage suites already use — run and extend that; (2) a well-suited tool from the examples below if it is available or trivially installable; (3) ubiquitous fallbacks (curl + shell assertions cover any HTTP surface). What is non-negotiable is the discipline — spec-first asserts, clean state — not the tool.

SurfaceExample toolsNotes
HTTP/REST/JSON (incl. gRPC-over-HTTP with JSON encoding)Hurl .hurl files; curl scriptsHurl: plain-text request/assert format, capturable variables, retry for eventual consistency; files double as committed regression suites
Pure gRPC/protobufgrpcurl (scripted)Use server reflection or point at the proto files
CLIDirect invocation via execute_commandAssert exit codes AND output; probe stdin/args edge cases
Docsfs_cat the page; run its commands via execute_commandFollow the page verbatim as a first-time consumer; every documented step is a probe
Anything elsecurl/scripts/the repo's own test harnessSame discipline: spec-first asserts, clean state

Optional niceties like Hurl and grpcurl may already be preinstalled (e.g. by a sandbox mixin) or can be installed idempotently (hurl via the distro package manager first — its prebuilt GitHub tarball dynamically links libxml2.so.2, which newer distros no longer ship; grpcurl from its GitHub release, a static Go binary). When a preferred tool is unavailable and uninstallable, fall back to what exists rather than skipping the check; classify a probe as ENV only when NO adequate tool can exercise the surface.

If you use Hurl, gotchas that produce false results if unknown:

  • [Captures] run BEFORE [Asserts] in the same entry — capture a replaced value under a NEW variable name, or your inequality asserts compare a value to itself.
  • JSON encoders that omit zero/empty values: assert not exists for absent fields — == false or == null asserts fail on omitted keys.
  • Use [Options] retry with a bounded count for asynchronous effects (job completion, eventual reads); never unbounded.

Verdict format

End with EXACTLY one of:

USAGE_PROBE: PASS
Surface: <endpoints/RPCs/commands probed>. Existing suites: <N run, all green | none found>.
New tests: <M authored at <path>, all green>.
Non-blocking observations: <optional: stale tests to update, recipe gaps, docs-voice items>
USAGE_PROBE: FAIL
Surface: <...>. Existing suites: <N run, X failed (Y regressions, Z expected-change)>. New tests: <M authored, W failed>.
Behavioral findings:
1. <surface + case> — <spec'd behavior, quoting the spec> — <observed behavior> — REPRO: <exact request/command + response received> — <test file:entry>
Stale tests needing update (expected-change): <list or none>
Non-blocking observations: <optional: docs-voice items, recipe gaps>

For a docs finding (Phase 3b) the last field is <page:section> when no test file backs it.

USAGE_PROBE: INCONCLUSIVE
Could not establish a clean local environment: <what failed, verbatim error>.
Missing: <the exact recipe/fixture/mock that would unblock — phrased so the plan author can add it>.
Partial results (if any): <what did run and what it showed>

Every FAIL finding MUST include the exact reproduction (request/command and the response received) and cite the test file — a behavioral complaint without a repro is noise. INCONCLUSIVE is an honest, acceptable verdict: it routes the fix to the environment recipe, not the code. NEVER report INCONCLUSIVE as PASS ("couldn't test, probably fine") or as FAIL (the implementer would hunt a nonexistent bug).

Anti-patterns

  • Writing tests after reading the implementation — you will encode its bugs as expectations.
  • Skipping the existing suites and jumping to new tests — regressions are the cheapest bugs to catch.
  • Testing through internal seams (direct DB reads, internal function calls) — this gate is consumer-perspective only; internals belong to unit tests.
  • Depending on pre-existing data, shared databases, or previously running services.
  • Adding retries/sleeps until a flaky assertion passes — flakiness is a finding, not an obstacle.
  • Reporting an environment failure as a behavioral FAIL (or burying it in a PASS).
  • Throwaway tests in /tmp — tests that don't land in the repo's suite location die with the run.
  • Asserting only status codes — shape and content are where the quirks live.
  • Hiding pure tests behind infra build tags — a test function that exercises only pure inputs/outputs tagged //go:build integration (or an infra marker) never runs in unit CI; it belongs in an untagged file beside the source. Flag any you find in the diff's suites.

Câu hỏi thường gặp

Kỹ năng AI Usage Pattern Testing làm được gì?

Xác minh thay đổi từ góc nhìn của người dùng — kiểm thử bề mặt đã thay đổi (HTTP API, RPC, CLI) theo kiểu hộp đen trên một phiên bản đang chạy cục bộ, với trạng thái sạch và được cô lập. Trước tiên, chạy các bộ kiểm thử cách sử dụng hiện có để phát hiện hồi quy; tạo kiểm thử mới dựa trên đặc tả (không dựa trên cách triển khai) và phân loại mọi lỗi là bug / môi trường / thay đổi hợp đồng được mong đợi. Đưa ra kết luận USAGE_PROBE PASS/FAIL/INCONCLUSIVE. Bổ trợ cho code-review (chất lượng), tác nhân adversary (mức độ tuân thủ kế hoạch) và security-review (khả năng bị khai thác) — đây là cổng...

Vì sao nên dùng Usage Pattern Testing trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Usage Pattern Testing là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Usage Pattern Testing trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Dark-Alex-17/coyote/tree/main/assets/skills/usage-pattern-testing. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Usage Pattern Testing?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Usage Pattern Testing với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Usage Pattern Testing với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Usage Pattern Testing có miễn phí không?

Có. Kỹ năng này được Dark-Alex-17 phát hành trên GitHub theo giấy phép AGPL-3.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇