GhostQA

io.github.SyncTekLLC由 GitHub 账号 SyncTekLLC 发布v0.2.2更新于 Oct 24, 2026

AI personas navigate your web app in real browsers, find bugs and UX issues. No scripts needed.

概览

AI 生成的概览

GhostQA(SpecterQA)让 AI 角色在真实浏览器中走查你的 Web、macOS 或 iOS 应用以发现缺陷与体验问题,并以 MCP 工具形式提供这些测试。

可以做什么
  • 对已配置的产品执行行为测试,可按 smoke 等层级筛选,并返回结构化运行报告
  • 列出已配置的产品及其可用旅程
  • 按运行 ID 取回以往运行的完整结构化结果
  • 在指定目录初始化带示例配置的新项目
  • 运行由 YAML 中的角色与旅程驱动:引擎截图界面、请求 Claude 视觉模型给出下一步操作,再由 Playwright 执行,并保存截图、发现项与费用明细作为证据
适用场景
适合希望助手像真实用户一样操作运行中的应用、在不编写选择器或测试脚本的情况下报告体验与布局问题,或在 Claude Desktop、Cursor 等 MCP 客户端中直接触发并读取这些测试的场景。
运行要求
本地 Python 包(需 Python 3.10 及以上),安装时需包含 mcp 附加项,并通过其安装命令下载 Playwright 浏览器二进制文件。必须通过 ANTHROPIC_API_KEY 提供 Anthropic API 密钥。macOS 与 iOS 模拟器测试需可选的 native 附加项。目标应用须可访问,且需存在包含产品、角色与旅程 YAML 的项目目录。
安装前请注意
每次运行都会产生 Anthropic API 费用,默认每次运行预算为 5.00 美元,超限会强制停止,但计费持续进行。该服务器会操作真实浏览器,可点击、输入和跳转,应仅指向测试环境。若未设置 GHOSTQA_ALLOWED_DIRS,directory 参数可指向文件系统任意路径,建议设置白名单。角色 YAML 可能包含测试凭据;项目处于 alpha 阶段,API 可能变动。

安装

在 SourceWeft 中

  1. 打开 控制台中的 GhostQA,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

SpecterQA

[PyPI version] [Python 3.10+] [License: MIT] [CI] [MCP Compatible] [FTI Trust Score]

AI personas walk your app so real users don't trip.

SpecterQA sends AI personas through your application — they look at the screen, decide what to do, and interact like real humans. No test scripts. No selectors. You describe personas and journeys in YAML, and SpecterQA handles the rest.

$ specterqa run -p myapp
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃ SpecterQA Run                                                    ┃┃ Product: myapp   Budget: $5.00   Viewport: 1280x720            ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
  ✓ Step 1/4: Navigate to homepage       PASS   3.2s   $0.0081  ✓ Step 2/4: Click signup link          PASS   2.1s   $0.0043  ✓ Step 3/4: Fill registration form     PASS   8.7s   $0.0312  ✓ Step 4/4: Verify dashboard loads     PASS   4.5s   $0.0127
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃ ALL TESTS PASSED                                                ┃┃ Steps: 4/4   Findings: 0   Duration: 18.5s   Cost: $0.0563     ┃┃ Run ID: GQA-RUN-20260222-143052-a1b2                            ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

What is this?

Traditional E2E tests are brittle. You write selectors, they break. You maintain scripts, they rot. SpecterQA takes a different approach: AI vision models look at your actual UI and navigate it the way a person would.

You define personas (who is using your app) and journeys (what they're trying to do). SpecterQA's engine takes a screenshot, sends it to a Claude vision model, gets back a decision ("click this button", "fill this field"), executes it via Playwright, takes another screenshot, and repeats until the goal is achieved or something goes wrong.

When something goes wrong, you get evidence: screenshots, UX observations, cost breakdowns, and findings categorized by severity.

Installation

SpecterQA is distributed via PyPI and requires Python 3.10 or later.

bash
pip install specterqa

After installing, download the Playwright browser binaries:

bash
specterqa install

For macOS native app testing and iOS Simulator support, install the optional native extra:

bash
pip install specterqa[native]

For MCP server support (integrating SpecterQA as a tool in Claude Desktop, Cursor, or other MCP clients):

bash
pip install specterqa[mcp]

You will also need an Anthropic API key to run tests:

bash
export ANTHROPIC_API_KEY=sk-ant-...

To verify the installation:

bash
specterqa --versionspecterqa init       # scaffold a sample projectspecterqa run -p demo

Quick Start

bash
pip install specterqaspecterqa install          # downloads Playwright browsersspecterqa init             # scaffolds .specterqa/ with sample configsspecterqa run -p demo      # runs the sample journey

You'll need an Anthropic API key:

bash
export ANTHROPIC_API_KEY=sk-ant-...

That's it. Three commands and an API key.

How It Works

The core loop is simple:

screenshot --> vision model --> action decision --> execute --> repeat
  1. Screenshot -- Playwright captures the current page state as a PNG
  2. Decide -- A Claude vision model receives the screenshot + persona context + goal, returns a structured JSON action (click, fill, navigate, scroll, keyboard, wait, done, or stuck)
  3. Execute -- Playwright performs the action (click at coordinates, type text, navigate to URL, etc.)
  4. Repeat -- Loop until the goal is achieved, the agent gets stuck, or the budget runs out

The persona's profile shapes how the AI behaves. A "tech-savvy developer" explores differently than a "frustrated first-time user." Persona patience, tech comfort, and frustrations all influence the system prompt.

Model routing keeps costs down. Simple actions (click, scroll) use Haiku. Complex actions (form filling, initial assessment) use Sonnet. You can also route simple actions to a local Ollama model (llava:13b) for zero API cost on straightforward navigation.

Features

  • Persona-based testing -- Define AI users with backgrounds, goals, frustrations, and tech comfort levels. They don't just follow scripts; they react to what they see.
  • Vision-powered -- No selectors, no DOM queries. The AI interprets screenshots like a human would. Catches visual/layout issues that selector-based tests miss entirely.
  • YAML-configured -- Products, personas, and journeys are all YAML files. PMs can read them. No code to maintain.
  • Budget enforcement -- Per-run, per-day, and per-month cost caps. The engine hard-stops if you hit the limit. No surprise bills.
  • JUnit XML output -- Drop --junit-xml results.xml and plug it into any CI system.
  • Tiered model routing -- Haiku for cheap navigation, Sonnet for complex reasoning, optional local Ollama for zero-cost simple actions.
  • Multi-platform -- Web apps (via Playwright), macOS native apps (via Accessibility API + pyobjc), iOS Simulator (via simctl). Same YAML format, different runners.
  • Evidence collection -- Every run produces screenshots, a findings report, cost breakdown, and a structured JSON result. Everything is saved to an evidence directory.
  • Stuck detection -- If the AI repeats the same action or the UI stops changing, the engine escalates to a stronger model, then aborts if nothing works. No infinite loops.
  • Template variables -- Use {{persona.credentials.email}} in your journey steps. Variables resolve from persona configs at runtime.
  • Precondition checks -- Verify services are up before running tests. Fail fast with clear errors instead of wasting API calls.

Configuration

SpecterQA uses three types of YAML config files, all living in .specterqa/:

Product (products/myapp.yaml)

yaml
product:  name: myapp  display_name: "My Application"  base_url: "http://localhost:3000"
  services:    frontend:      url: "http://localhost:3000"      health_endpoint: /
  viewports:    desktop:      width: 1280      height: 720    mobile:      width: 375      height: 812
  cost_limits:    per_run_usd: 5.00

Persona (personas/alex-developer.yaml)

yaml
persona:  name: alex_developer  display_name: "Alex Chen"  role: "Full-Stack Developer"  age: 28  tech_comfort: high  patience: medium  preferred_device: desktop
  goals:    - "Evaluate the app from a developer's perspective"    - "Check for common UX anti-patterns"
  frustrations:    - "Unclear error messages"    - "Missing loading indicators"
  credentials:    email: "[email protected]"    password: "TestPass123!"

Journey (journeys/onboarding.yaml)

yaml
scenario:  id: onboarding-happy-path  name: "Onboarding Happy Path"  description: "New user signs up, completes onboarding, reaches dashboard."  tags: [onboarding, critical_path, smoke]
  personas:    - ref: alex_developer      role: primary
  preconditions:    - service: frontend      check: /      expected_status: 200
  steps:    - id: visit_homepage      mode: browser      goal: "Navigate to the homepage and verify it loads"      checkpoints:        - type: text_present          value: "Welcome"
    - id: navigate_signup      mode: browser      goal: "Find and click the signup link"
    - id: fill_signup_form      mode: browser      goal: "Complete the signup form with test credentials"
    - id: verify_dashboard      mode: browser      goal: "Verify signup succeeded and the dashboard loads"

See docs/configuration.md for the full reference.

YAML schema support

SpecterQA includes a JSON Schema for product YAML files at schemas/product.schema.json.

yaml
# yaml-language-server: $schema=../../schemas/product.schema.json

CI Integration

SpecterQA is built for CI. It runs headless by default and returns proper exit codes.

bash
# Basic CI runspecterqa run -p myapp --junit-xml results.xml
# Smoke test (runs first scenario only, fast)specterqa run -p myapp --level smoke --budget 2.00
# JSON output for programmatic consumptionspecterqa run -p myapp --output json > results.json

Exit codes:

  • 0 -- all tests passed
  • 1 -- one or more tests failed
  • 2 -- configuration error
  • 3 -- infrastructure error (missing dependencies, API unreachable)

See docs/ci-integration.md for GitHub Actions, GitLab CI, and CircleCI examples.

Cost

SpecterQA uses Anthropic's Claude API. Every run costs money. Here's what to expect:

ModelRoleInput (per 1M tokens)Output (per 1M tokens)
Claude Haiku 4.5Simple navigation$0.80$4.00
Claude Sonnet 4Complex reasoning$3.00$15.00
Ollama llava:13bLocal fallbackFreeFree

Typical costs per run:

  • 3-step smoke test: ~$0.30-0.60
  • 5-step standard journey: ~$0.50-1.50
  • Complex 10-step journey with forms: ~$1.00-3.00

The default budget is $5.00 per run. The engine hard-stops if the budget is exceeded -- no silent overruns. You can set per-day and per-month caps too.

You can also set a default budget via an environment variable to avoid passing --budget every time:

bash
export SPECTERQA_BUDGET=2.00specterqa run -p myapp          # uses $2.00 budgetspecterqa run -p myapp --budget 5.00  # uses $5.00 budget (CLI flag wins)

Model routing helps: simple clicks and scrolls use Haiku ($0.01 per action), while form fills and initial assessments use Sonnet ($0.03-0.05 per action). If you have a local Ollama instance, simple actions can route there for zero API cost.

See docs/cost-guide.md for detailed cost breakdowns and budgeting strategies.

Multi-Platform

SpecterQA isn't web-only. The same persona/journey YAML format works across platforms:

Web apps (default) -- Uses Playwright for browser automation.

macOS native apps -- Uses the macOS Accessibility API via pyobjc. The AI reads the accessibility tree and screenshots, then executes clicks and keypresses through AX actions.

yaml
product:  name: my-mac-app  app_type: native_macos  app_path: /Applications/MyApp.app  bundle_id: com.example.myapp

iOS Simulator -- Uses simctl for screenshots and touch simulation. Useful for testing iOS apps without a physical device.

yaml
product:  name: my-ios-app  app_type: ios_simulator  bundle_id: com.example.myiosapp  simulator_device: "iPhone 15 Pro"  simulator_os: "17.2"

Native and simulator support require the native optional dependency:

bash
pip install specterqa[native]

For AI Agents

If you're an AI agent or building agent tooling, SpecterQA provides structured interfaces for programmatic use.

CLI with JSON output

bash
specterqa run -p myapp --output json

Returns structured JSON to stdout:

json
{  "passed": true,  "run_id": "GQA-RUN-20260222-143052-a1b2",  "step_reports": [    {      "step_id": "visit_homepage",      "passed": true,      "duration_seconds": 12.3    }  ],  "findings": [],  "cost_usd": 0.4521}

Python API

python
from specterqa.config import SpecterQAConfigfrom specterqa.engine.orchestrator import SpecterQAOrchestrator
config = SpecterQAConfig()config.project_dir = Path(".specterqa")config.products_dir = Path(".specterqa/products")config.personas_dir = Path(".specterqa/personas")config.journeys_dir = Path(".specterqa/journeys")config.evidence_dir = Path(".specterqa/evidence")config.anthropic_api_key = "sk-ant-..."config.budget = 5.00config.headless = True
orchestrator = SpecterQAOrchestrator(config)report_md, all_passed = orchestrator.run(product="myapp", level="smoke")

Federated Protocol

SpecterQA exposes a protocols.py module with Python Protocol classes (AIDecider, ActionExecutor) that let you swap in your own AI model or action backend:

python
from specterqa.engine.protocols import AIDecider, Decision
class MyCustomDecider:    def decide(self, goal, screenshot_base64, **kwargs) -> Decision:        # Your logic here        ...

MCP Server

SpecterQA ships an MCP (Model Context Protocol) server. Any MCP-compatible agent (Claude Desktop, Cursor, Cline, custom agent tooling) can discover and invoke SpecterQA as a tool -- run tests, read results, manage configs -- without shelling out to the CLI.

Add to your MCP client config (claude_desktop_config.json or equivalent):

json
{  "specterqa": {    "command": "specterqa-mcp",    "args": []  }}

Available tools:

ToolDescription
specterqa_runExecute behavioral tests against a product. Synchronous — may take 45-300s. Incurs API costs (default budget: $5.00).
specterqa_list_productsList configured products and their available journeys
specterqa_get_resultsRetrieve full structured results from a previous run by run ID
specterqa_initInitialize a new SpecterQA project directory

See docs/for-agents.md for the full programmatic API reference and MCP integration details.

API Reference

The complete API reference is available at specterqa.synctek.io/docs.

Key classes

ClassModuleDescription
SpecterQAConfigspecterqa.configRoot configuration object. Set project dirs, API key, budget, and model routing preferences.
SpecterQAOrchestratorspecterqa.engine.orchestratorMain entry point for programmatic runs. Call orchestrator.run(product, level) to execute a journey.
AIDeciderspecterqa.engine.protocolsProtocol class. Implement to swap in a custom vision model or decision backend.
ActionExecutorspecterqa.engine.protocolsProtocol class. Implement to swap in a custom action execution backend (e.g., replace Playwright).
RunReportspecterqa.modelsStructured result returned by orchestrator.run(). Contains step reports, findings, and cost breakdown.
Findingspecterqa.modelsIndividual UX issue captured during a run. Includes severity, step ID, screenshot reference, and description.

CLI reference

CommandDescription
specterqa run -p PRODUCTRun all journeys for a product
specterqa run -p PRODUCT --level smokeRun only smoke-tagged journeys
specterqa run -p PRODUCT --junit-xml results.xmlEmit JUnit XML for CI
specterqa run -p PRODUCT --output jsonEmit structured JSON to stdout
specterqa initScaffold a .specterqa/ project directory with sample configs
specterqa installDownload Playwright browser binaries
specterqa listList configured products and journeys
specterqa results RUN_IDPrint the full report for a previous run
specterqa-mcpStart the MCP server

MCP tools

ToolDescription
specterqa_runExecute behavioral tests. Parameters: product (str), level (str, optional), directory (str, optional). Returns a RunReport JSON object.
specterqa_list_productsList all products and their configured journeys. No parameters required.
specterqa_get_resultsRetrieve a previous run report by run_id.
specterqa_initInitialize a new SpecterQA project at a given directory.

For schema definitions, type stubs, and federated protocol details, see docs/for-agents.md.

Security

Directory access: When the environment variable SPECTERQA_ALLOWED_DIRS is unset, the SpecterQA MCP server permits the directory parameter of specterqa_run to point at any path on the filesystem accessible to the process. In shared or multi-user environments — or anywhere the MCP server is exposed to untrusted agents — you should set this variable to an explicit allowlist:

bash
export SPECTERQA_ALLOWED_DIRS="/home/user/projects:/ci/workspaces"

When set, the MCP server rejects any directory value that is not under one of the listed prefixes. This mitigates the MCP directory traversal vector described in SECURITY_ADVISORY.md (GHSA-SPECTERQA-001).

Command injection fix (v0.2.1): The check_command field in product YAML service definitions has been removed. It was the source of a critical command injection vulnerability. Precondition checks are now limited to TCP connectivity and HTTP health endpoint checks, which are safe. See SECURITY_ADVISORY.md for full details.

Credential scrubbing: Run artifacts (JSON result files, log output) automatically scrub known credential patterns — API keys, tokens, passwords — from captured content before writing to disk.

Reporting vulnerabilities: Do not open public issues for security bugs. Email [email protected] or see SECURITY.md for the full disclosure policy.

Limitations

Be honest with yourself about what this is and isn't:

  • Requires an Anthropic API key. No API key, no testing. There's no free tier built into SpecterQA itself.
  • Costs money. Every run makes API calls. A typical 3-step journey costs $0.30-0.60. Budget enforcement prevents surprises, but the meter is always running.
  • Vision models aren't perfect. The AI sometimes misreads small text, clicks the wrong element, or gets confused by complex layouts. It's good, not infallible. You'll occasionally see false positives and false negatives.
  • Not a replacement for unit tests. SpecterQA tests behavioral UX flows. It doesn't test your business logic, data integrity, or edge case handling. Use it alongside your existing test suite, not instead of it.
  • macOS native testing requires pyobjc. The specterqa[native] extra pulls in pyobjc packages (~200MB). Only needed for native macOS and iOS Simulator testing.
  • Alpha software. Version 0.4.0. APIs may change. File structure may change. Expect rough edges.
  • Single-persona per journey (for now). Multi-persona concurrent testing (e.g., simulating a chat between two users) is on the roadmap but not yet supported.
  • Deterministic reproduction is hard. Because the AI makes decisions at runtime, the exact sequence of actions varies between runs. Same journey, same persona, slightly different clicks. This is by design (it catches more issues) but makes exact reproduction tricky.

Contributing

Contributions welcome. The repo is at github.com/SyncTek-LLC/specterqa.

bash
git clone https://github.com/SyncTek-LLC/specterqa.gitcd specterqapip install -e ".[dev]"pytest

Open an issue before starting large PRs. We'd rather discuss the approach first.

License

MIT -- see LICENSE for details.


Built by SyncTek LLC.

来源:README.md,提交 3441d0e

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分