Specx Add Infrastructure Adapterのロゴ

Specx Add Infrastructure Adapter

コミュニティ
maksimzayats
specx-add-infrastructure-adapter

specxのcoreスコープに技術インフラのアダプターを追加します。SQLAlchemyリポジトリやAlembicを使った永続化、Redisストア、HTTP/ネットワーククライアント、ファイル/キューアダプター、unit-of-workの実装、OpenAIなどの外部APIやSDK向けゲートウェイの実装、またはcoreスコープのリポジトリポートやゲートウェイポートに対する明示的な`diwire`バインディングを実装する場合に使用します。

Add to TypingMind

概要

公開者maksimzayats
リポジトリspecx
スキル名specx-add-infrastructure-adapter
スター
201
フォーク
34
同梱ファイル
2
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

関連するリクエストがあるとすぐに、モデルが自動的にSpecx Add Infrastructure Adapterを読み込みます。

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

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

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

スキルの指示

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

specx Add Infrastructure Adapter

Use this skill whenever code talks to external systems. Read references/adapter.md before writing adapters.

Workflow

  1. Define or reuse a repository under repositories/ for owned persistence. Repository ports inherit BaseRepository and mark required methods with @abstractmethod.
  2. Define or reuse a gateway under gateways/ for outbound business capabilities to external systems such as OpenAI, payments, email, queues, or external HTTP APIs. Gateway ports inherit BaseGateway, mark required methods with @abstractmethod, declare external effects, and do not return entities.
  3. Put concrete implementations under core/<scope>/infrastructure/<technology>/.
  4. Inject external clients, session factories, Redis clients, SDK clients, or project-owned client factories. Do not hide client construction inside business methods. Generated HTTP adapters use httpx2, imported from the httpx2 namespace; do not generate new legacy httpx imports.
  5. A bounded short-lived client factory may stay beside its scope adapter. Put every app-owned pooled client factory or wrapper under top-level infrastructure/<technology>/, even with only one current consumer.
  6. Give long-lived app-owned infrastructure resources an explicit async close() method; FastAPI lifecycle owns calling it on shutdown.
  7. Keep technical query/request code in infrastructure.
  8. Repositories may return entities. Gateways must not return entities; return DTOs, primitives, enums, or explicit result objects. Do not return ORM models or SDK response objects to core.
  9. Translate low-level exceptions into core exceptions only when callers need to handle them. Catch narrow driver or SDK exceptions, preserve the cause, and never expose raw provider messages, SQL, parameters, bodies, or URLs.
  10. For transactional persistence, implement an active UnitOfWork and a UnitOfWorkManager; register the manager, not repositories, active UoWs, or UoW providers for use-case injection.
  11. Register adapter bindings in private _register_dependencies(...) inside ioc/container.py. Register every technical resource once at its owner boundary and close that same app-scoped instance from lifecycle.
  12. Add focused integration tests only when the adapter has meaningful project-owned behavior to protect; do not add generic CRUD or upstream library tests just because an adapter file exists.
  13. For SQLAlchemy adapters, add or update Alembic migrations with $specx-sqlalchemy-migrations.

Logging is top-level runtime infrastructure, not a core-scope adapter. Put stdlib logging setup in infrastructure/logging/configurator.py with a LoggingConfigurator that inherits BaseConfigurator; do not create gateway ports or injected logger bindings for it.

For /readyz, implement required dependency checks as core/health gateway adapters, for example core/health/infrastructure/sqlalchemy/readiness_check_gateway.py, and bind them to ReadinessCheckGateway in ioc/container.py. Bound every dependency check with a short application timeout and return only a non-sensitive core status.

Code Style

Use blank lines as logical separators in all code. Keep related statements together, but separate independent setup, action, assertion, response, branch, and transformation groups so long blocks stay readable.

References

  • references/adapter.md - adapter layout, port binding, SQLAlchemy/UoW, Redis, HTTP client, migration, and test patterns.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Specx Add Infrastructure Adapter」では何ができますか?

specxのcoreスコープに技術インフラのアダプターを追加します。SQLAlchemyリポジトリやAlembicを使った永続化、Redisストア、HTTP/ネットワーククライアント、ファイル/キューアダプター、unit-of-workの実装、OpenAIなどの外部APIやSDK向けゲートウェイの実装、またはcoreスコープのリポジトリポートやゲートウェイポートに対する明示的な`diwire`バインディングを実装する場合に使用します。

TypingMindでSpecx Add Infrastructure Adapterを使うメリットは何ですか?

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

TypingMindにSpecx Add Infrastructure Adapterをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/maksimzayats/specx/tree/main/.agents/skills/specx-add-infrastructure-adapterを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Specx Add Infrastructure Adapterを使えるAIモデルはどれですか?

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

Specx Add Infrastructure Adapterで使えるAIモデルの数に制限はありますか?

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

AIスキル「Specx Add Infrastructure Adapter」は無料ですか?

はい。maksimzayatsがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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