local-test

local-test is a skill for Claude Code, Codex from hxy91819/mason-skills. It costs 57 tokens per session (2,847 once invoked), scanned A, original, MIT.

A workflow for starting, checking, and stopping a local multi-service test environment, such as a database, backend, and frontend running together. It also covers safe local ports, process cleanup, and keeping test data by default.

In plain words
What is it for?
Use it to run end-to-end checks that require several local services to work together before deployment or acceptance.
Why use it?
It prevents incomplete test setups, orphaned processes, stuck ports, accidental data deletion, and unnecessary network exposure during integration testing.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: $skill-name invocation.

Good fit Use it to run end-to-end checks that require several local services to work together before deployment or acceptance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hxy91819/mason-skills/local-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hxy91819/mason-skills --skill local-test
Clone the repo
git clone --depth 1 https://github.com/hxy91819/mason-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for local-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/hxy91819/mason-skills/local-test/github.svg)](https://agentmods.dev/skills/hxy91819/mason-skills/local-test)
Your own site
<a href="https://agentmods.dev/skills/hxy91819/mason-skills/local-test"><img src="https://agentmods.dev/badge/skills/hxy91819/mason-skills/local-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for local-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/hxy91819/mason-skills/local-test"><img src="https://agentmods.dev/badge/skills/hxy91819/mason-skills/local-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,847 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.02847
Opus 5 $0.00028 $0.01424
Sonnet 5 $0.00011 $0.00569
Haiku 4.5 $0.00006 $0.00285

Measured today against content hash ce11dd67a475, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

local-test scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (tests/smoke.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

`lt status` 是只读汇总:服务、PID、端口、预览 URL、代理配置位置,不显示凭据。CLI 没有运行历史、裁决回写或滚动聚合,只有即时状态与本地日志 `.local-test/logs/<svc>.log`;不得把即时状态当历史成功率或完整验收证据。`.local-test/` 必须被 Git 忽略。改动 `bin/lt` 后必须跑通 [tests/smoke.sh](tests/smoke.sh)(需 git、python
common-skills/local-test/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Local Test 环境规范与治理

流程类 skill;仅在用户明确调用 $local-test 时采用。机制全在 bin/lt(技术栈无关 CLI),项目只需一份 .local-test.yml;本文只留 CLI 替不了你的判断。

门禁适用范围

触发:需要启动或复用本地多服务联调环境做集成测试与功能验收;为项目配置 lt.local-test.yml。仅远端发布受阻本身不触发。

非目标(严禁触发):单纯跑单元测试;普通代码修改、重构、Bug 修复;代码评审或写文档;发布静态 HTML 给用户看(用 html-preview);纯远端部署或 CI/CD 配置。

术语

  • 本地环境:当前工作机器,含其上所有 git worktree、中间件容器与裸进程。远端 Dev/Beta/staging 都不是。
  • worktree 环境:某个 worktree 内由 lt 登记、拥有独立 namespace、端口与库名的一组业务进程。可多个并存。
  • 本地开发库(业务服务用)与本地测试库(自动化测试用):都按 namespace 隔离,生命周期分开管理。

一、先跑 doctor

bin/lt 复制或软链到项目 bin/lt,任何操作前先 lt doctor:它检查 git、docker、cksum、进程组隔离方案(setsid / perl / bash job control,macOS 无 setsid 时自动回退并报告采用了哪种)与配置合法性,不启动任何东西。缺件先补,不要带着未知环境直接 start

二、无配置时:扫描仓库生成

lt init 不做问卷。你扫描仓库产出 JSON 再交给 CLI:cat scan.json | lt init(或 --from-json <file>;已存在配置需 --force 才覆盖)。它同时用 git check-ignore 确认 .local-test/ 被忽略,缺则追加到 .git/info/exclude 并提示。

扫描来源:Procfile*package.json scripts、docker-compose*.ymlMakefile.env.example、框架约定。只有一种情况问用户:某个外部系统调用是只读还是写入,代码里判断不出来时(见第五节)。其余自行决策。

.local-test.yml 用 CLI 自带解析器,不依赖 ruby/python/yq。只支持两空格缩进、最多三层、key: value# 注释(整行或值后带空格)、可选成对单/双引号;不支持列表、锚点、多行标量、TAB、引号内转义。违反即报错并指出行号。

project: saiens                      # 可选,默认仓库目录名
middleware: docker-compose.yml       # 可选
database:
  prepare: bin/rails db:prepare      # 可选,可读 $LOCAL_TEST_NAMESPACE 推导库名
  drop: bin/rails db:drop            # 可选,destroy/gc 用
external:
  mode_env: EXTERNAL_MODE            # 可选;有此项时 real 只允许主 checkout
services:
  web:
    port: 4777                       # 基准端口;实际端口 = 基准 + namespace 偏移
    cmd: bin/rails server -p $LOCAL_TEST_PORT_WEB
  css:
    cmd: bin/rails tailwindcss:watch # 无 port 的服务不做端口守卫
preview_url: http://127.0.0.1:$LOCAL_TEST_PORT_WEB

cmd 运行时由 bash -c 求值,可引用 $LOCAL_TEST_NAMESPACE$LOCAL_TEST_PORT_<服务名大写>preview_url 只做同名变量替换,不执行。服务顺序即配置顺序:start 按序、stop 逆序。配置原则:中间件容器化且全机一份、按 namespace 分库;业务服务默认裸进程(利于热重载与断点),不为每个 worktree 复制中间件,不用固定槽位环境池,不把未验证代码合入主干来借环境。

Read the full file on GitHub · 104 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +2 lines ce11dd67a475
  2. 2d ago Changed · +13 lines · +1 tokens per session ce30fb8e3df9
  3. 3d ago Changed · +1 lines 7e3e55b9002d
  4. 4d ago Changed · -14 lines · -10 tokens per session 790f9f045663
  5. 6d ago Changed · -14 lines b88af6da9f7a
  6. 8d ago First seen · 116 lines · 66 tokens per session scan A 9ed8eaf3b43b

Subscribe to this mod's changes

local-test is a skill published in the GitHub repository hxy91819/mason-skills (2 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 2,847 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.