Mock Engineのロゴ

Mock Engine

組織
addxai
mock-engine

Mock Engine local development environment management. Use for starting/stopping mock services, loading test data, creating test scenarios, and troubleshooting startup issues. Triggers when the user mentions "start mock", "mock environment", "local dev environment", "mock-up", "test data", or "test scenarios".

概要

公開者addxai
リポジトリenterprise-harness-engineering
スキル名mock-engine
スター
47
フォーク
8
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    addxaiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルMock EngineをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/addxai/enterprise-harness-engineering/tree/main/skills/mock-engine
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/addxai/enterprise-harness-engineering.git /tmp/enterprise-harness-engineering
mkdir -p .claude/skills
cp -r /tmp/enterprise-harness-engineering/skills/mock-engine .claude/skills/mock-engine
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMock Engineを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にMock Engineを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Mock Engineは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Mock Engine — Local Development Mock Environment Management

Provides unified mock infrastructure (MySQL, Redis, Kafka, MQTT, LocalStack, WireMock) via Docker Compose, supporting local development and integration testing.

Description

Applicable scenarios:

  • Start/stop mock environment: make mock-up one-command launch of all dependency services
  • Load test data: Base fixtures auto-load; scenario fixtures load on demand
  • Create test scenarios: Prepare preset data (SQL + Redis + WireMock stubs) for specific business flows
  • Troubleshoot startup issues: Container status checks, port conflicts, data loading failures
  • Integration testing: Manage mock infrastructure in automated tests via Java SDK or Go SDK

Prerequisites:

  • Docker Compose v2.20+ (verify with docker compose version)
  • A mock/ directory exists at the project root (containing docker-compose.yml and Makefile)
  • If there is no mock/ directory, initialize from the mock-engine template:
    bash
    cp -r /path/to/mock-engine/core/templates/mock/ ./mock/
    # Modify project configuration in mock/Makefile (database name, password, etc.)

Rules

Operational Flow

First-time initialization:

bash
cd mock/
make mock-init    # Download compose fragments

Start Mock environment:

bash
make mock-up      # Start all services + wait for health checks + load data
make mock-status  # Verify all services are running normally

Start the application (backend-service example):

bash
# The appName environment variable must be set
appName=your-app mvn spring-boot:run \
  -pl your-app \
  -Dspring-boot.run.profiles=dev-local,mock

Load a test scenario:

bash
make mock-scenario SCENARIO=user-registration
# View available scenarios:
ls fixtures/scenarios/

Stop/reset:

bash
make mock-down    # Stop services (preserve data)
make mock-clean   # Stop + delete data volumes
make mock-reset   # Full reset (clean + init + up)

Default Port Mapping

ServicePortEnvironment Variable Override
MySQL13306MOCK_MYSQL_PORT
Redis (business)16379MOCK_REDIS_BUSINESS_PORT
Redis (readonly)16380MOCK_REDIS_READONLY_PORT
Redis (event)16381MOCK_REDIS_EVENT_PORT
Kafka19092MOCK_KAFKA_PORT
MQTT11883MOCK_MQTT_PORT
LocalStack14566MOCK_LOCALSTACK_PORT
WireMock19999MOCK_WIREMOCK_PORT

Test Data Management

Base Fixtures (auto-loaded): Place in mock/fixtures/base/, executed in filename order:

fixtures/base/
├── 01-seed-users.sql        # INSERT test users
├── 02-seed-devices.sql      # INSERT test devices
└── 03-seed-data.sql         # INSERT test data

Scenario Fixtures (load on demand): One subdirectory per scenario:

fixtures/scenarios/user-registration/
├── data.sql                 # MySQL data
├── redis-cmds.txt           # Redis CLI commands (one per line)
└── stubs-override/          # WireMock stub overrides

redis-cmds.txt format:

# Comment line
SET user:1001:token abc123
HSET device:DEV001 status online
EXPIRE user:1001:token 3600

WireMock Stubs: Place in mock/stubs/<service-name>/:

json
{
  "request": {
    "method": "POST",
    "urlPath": "/stripe/v1/customers"
  },
  "response": {
    "status": 200,
    "jsonBody": { "id": "cus_mock_001" }
  }
}

Supports advanced features: conditional routing (queryParameters/bodyPatterns), dynamic templates (response-template), state machines (scenarioName), Webhook callbacks (serveEventListeners).

Common Troubleshooting

MySQL connection failed:

bash
docker ps --filter name=mock-mysql
docker logs mock-mysql
docker exec -e MYSQL_PWD=root123456 mock-mysql mysql -uroot -e "SELECT 1"

Bind mount not taking effect (Docker-in-Docker): SQL files not auto-loaded into MySQL:

bash
docker exec -e MYSQL_PWD=root123456 -i mock-mysql mysql -uroot < mock/sql/init-schema.sql

WireMock stubs not loaded:

bash
curl http://localhost:19999/__admin/mappings | python3 -m json.tool
docker cp mock/stubs/. mock-wiremock:/home/wiremock/mappings/
curl -X POST http://localhost:19999/__admin/mappings/reset

Spring Bean missing (CloudBeanCondition): Ensure the appName=your-app environment variable is set.

SDK Integration (Automated Testing)

Java (Testcontainers):

java
// pom.xml: <dependency>com.example:mock-engine</dependency>
MockInfraManager manager = MockInfraManager.fromProjectMockDir("./mock");
manager.startAll();
Map<String, String> props = manager.getAllProperties();

Go:

go
// go.mod: require gitlab.example.com/tools/mock-engine/go
infra := mockinfra.New(mockinfra.WithProjectDir("./mock"))
infra.Start(ctx)
defer infra.Stop(ctx)
infra.LoadScenario(ctx, "user-registration")

Examples

Bad Example

User: Help me start the mock environment
AI: Let me just docker compose up directly

docker compose up -d

# Then directly start the application
mvn spring-boot:run -pl your-app

Problems:

  • Did not enter the mock/ directory
  • Did not use make mock-init to initialize fragments
  • Did not use make mock-up (skips health checks and data loading)
  • Did not set appName environment variable or mock profile

Good Example

User: Help me start the mock environment
AI: OK, let me check the mock directory and start the environment.

cd mock/
# Check if already initialized
ls .fragments/Makefile.include 2>/dev/null || make mock-init
# Start and wait for all services to be ready
make mock-up
# Verify service status
make mock-status

# Start the application (with correct environment variable and profile)
cd ..
appName=your-app mvn spring-boot:run \
  -pl your-app \
  -Dspring-boot.run.profiles=dev-local,mock

# Verify health check
curl -s http://localhost:7777/actuator/health

Bad Example

User: I need to test the user registration flow
AI: Let me just call the registration API directly

curl -X POST http://localhost:7777/account/register \
  -H "Content-Type: application/json" \
  -d '{"email":"newuser@test.com"}'

Problems:

  • Did not load the test scenario data first
  • Did not provide an Authorization token
  • Missing required request parameters

Good Example

User: I need to test the user registration flow
AI: OK, let me load the registration test scenario data first, then test step by step.

# 1. Load user registration scenario data
cd mock/
make mock-scenario SCENARIO=user-registration

# 2. Login first to get an admin token
TOKEN=$(curl -s -X POST http://localhost:7777/account/login \
  -H "Content-Type: application/json" \
  -d '{"email":"testuser1@mock.local","password":"password","loginType":99}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['token'])")

# 3. Check if the email is available
curl -s -X POST http://localhost:7777/account/check-email \
  -H "Content-Type: application/json" \
  -H "Authorization: $TOKEN" \
  -d '{"email":"newuser@mock.local"}'

# 4. Execute registration
curl -s -X POST http://localhost:7777/account/register \
  -H "Content-Type: application/json" \
  -H "Authorization: $TOKEN" \
  -d '{"email":"newuser@mock.local","password":"Test@1234","nickname":"TestUser"}'

Related Resources

  • mock-engine repository: gitlab.example.com/tools/mock-engine
  • Design document: mock-engine/docs/specs/2026-03-20-mock-engine-generalization-design.md

よくある質問

AIスキル「Mock Engine」では何ができますか?

Mock Engine local development environment management. Use for starting/stopping mock services, loading test data, creating test scenarios, and troubleshooting startup issues. Triggers when the user mentions "start mock", "mock environment", "local dev environment", "mock-up", "test data", or "test scenarios".

TypingMindでMock Engineを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Mock Engineはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMock Engineをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/addxai/enterprise-harness-engineering/tree/main/skills/mock-engineを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Mock Engineを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Mock Engineは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMock Engineを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Mock Engine」は無料ですか?

はい。addxaiがGitHubでApache-2.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇