Unifi Context Mapのロゴ

Unifi Context Map

コミュニティ
t3chnaztea
unifi-context-map

Use when an agent keeps guessing wrong about a UniFi network, when starting recurring agent work against a gateway, or when asked to "map my network", "document my UniFi setup", "build a network inventory", "what's on my network", "why does the agent keep using the wrong AP", or "audit my reservations against reality". Covers writing and maintaining the site map file: networks, devices, SSIDs, reservations, zones, an append-only Gotchas list, provenance checks that keep it honest, and the security rules for a file that is a burglary aid if it leaks. Assumes unifi-connect. Not for making changes to any of it (unifi-firewall, unifi-wifi, unifi-clients).

概要

公開者t3chnaztea
リポジトリunifi-skills
スキル名unifi-context-map
スター
44
フォーク
1
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 指示だけで完結

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

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

UniFi Context Map

This repo deliberately ships no network inventory, because the useful one is yours. This skill is how the agent builds it.

An agent working a UniFi network without a map guesses: which AP is the one in the back bedroom, whether 10.x.x.50 is the NAS or a decommissioned print server, whether that camera reservation reflects where the camera actually is. UniFi answers with MAC addresses and machine names, and it is confidently wrong in a specific way: the config is not the operational reality. A reservation exists whether or not the device honors it. A port override is stored whether or not the hardware enforces it.

One markdown file, one human pass, fixes this.

Read this before you write anything down

A complete UniFi map is a burglary aid. Not being dramatic: assembled in one file it contains camera names and their physical placements, which cameras are on which segment, your WAN address, the MAC address of every device in the building, your alarm panel's IP, and which SSID is the trusted one. That is a casing document with a network diagram attached.

So, before the first line:

  • Never commit it to a public repo. Not "scrub it later". Git history is forever and the scrub is always harder than you think.
  • .gitignore it by name in whatever repo you do network work from. A suggested pattern is in this repo's .gitignore.
  • Never paste it into a shared or third-party context you do not control.
  • The API key never goes in it. Env var, always, same as unifi-connect.
  • If you do keep it in a repo, keep that repo private, and assume any file an agent reads freely is a file that can end up somewhere you did not intend.

This warning exists because the private skill this repo was distilled from could not be published as-written. Roughly seventy percent of it was exactly the inventory described above.

Where to keep it

Wherever your agent reads context from and nowhere else: the private repo you do network work from, or a local notes directory. Keep it in one place so there is one thing to protect.

Skeleton

Every section dated. The date is what tells a future agent how much to trust it.

markdown
# <Site> network map (snapshot YYYY-MM-DD)

## Gateway
- Host: <UDM_HOST>, web UI https://<UDM_HOST>
- Model, UniFi OS version, Network controller version
- Auth: X-API-Key, key name "agent", stored in env var; NOT in this file
- SSH: open/closed

## Networks and VLANs (as of YYYY-MM-DD)
| Name | Purpose | VLAN | Subnet | DHCP |

## Firewall zones (as of YYYY-MM-DD)
- Zone name, id, and in one line what it is allowed to reach
- Which networks belong to it

## Devices (as of YYYY-MM-DD)
| Name | Type | Model | IP | Firmware |
- Flag which have DHCP reservations and which hold dynamic leases:
  the dynamic ones drift, so pull `devices` before targeting one

## SSIDs (as of YYYY-MM-DD)
| SSID | Band | Security | Network | Enabled |

## Reservations (as of YYYY-MM-DD, N total)
| Name | IP | MAC |

## Port forwards (as of YYYY-MM-DD)
| Name | Protocol | External port | Destination |

## Reservation vs reality
The section that earns the file. See below.

## Gotchas (append-only, dated)
- YYYY-MM-DD: <thing that cost you an hour>

Building the inventory

The commands produce candidates. The human pass produces meaning.

bash
udm networks --json | python3 -c '
import json,sys
for n in json.load(sys.stdin):
    print(n.get("name"), n.get("vlan","-"), n.get("ip_subnet"))'

udm devices --json | python3 -c '
import json,sys
for d in json.load(sys.stdin):
    print(d.get("name"), d.get("type"), d.get("model"), d.get("ip"), d.get("version"))'

udm wlans --json | python3 -c '
import json,sys
for w in json.load(sys.stdin):
    print(w.get("name"), w.get("enabled"), w.get("security"))'

udm reservations --json | python3 -c '
import json,sys
r=json.load(sys.stdin); print(len(r),"reservations")
for u in r: print(" ", u.get("name") or u.get("hostname"), u.get("fixed_ip"))'

udm zones --json | python3 -c '
import json,sys
for z in json.load(sys.stdin): print(z.get("_id"), z.get("name"))'

udm portforward --json | python3 -c '
import json,sys
for p in json.load(sys.stdin):
    print(p.get("name"), p.get("dst_port"), "->", p.get("fwd"), p.get("fwd_port"))'

What no query can tell you is that the AP named U7PG2-a3f4 is the one in the back bedroom, or that a given reservation belongs to hardware you threw out in 2023. Do that pass once, write it down, mark it verified.

Reservation vs reality

Give this its own section. It is the highest-value thing in the file and it is never what you expect.

A DHCP reservation applies only if the device asks that DHCP server. Devices that join over a different SSID, sit behind an unmanaged switch, or were re-cabled at some point get an address from wherever they actually are, and the reservation sits dormant looking authoritative. In one real audit, of seven cameras with reservations on a dedicated camera VLAN, exactly one was actually on it. The rest had joined over Wi-Fi to an IoT SSID and held dynamic leases on a completely different subnet. Every one of them looked correctly segmented in the reservation table.

Check the live client list against the reservation list and record every mismatch with the reason:

bash
udm clients --all --json | python3 -c '
import json,sys
for c in json.load(sys.stdin):
    print(c.get("hostname") or c.get("name"), c.get("ip"), c.get("mac"), c.get("network"))'

Then write lines like: "dormant reservation, device actually joins over the IoT SSID and lives on that subnet", or "permanent exception, behind an unmanaged switch, cannot be segmented". That is the knowledge the API cannot give back.

The Gotchas list

The highest-value section and the one nobody writes. Every network accumulates local traps no vendor doc can predict. The shape:

  • "The printer is behind an in-wall AP data port, so it cannot be VLAN-jailed. Permanent exception, do not retry."
  • "The basement camera shares an unmanaged switch with another device, so both are stuck on the trusted network."
  • "Two APs hold dynamic leases and their addresses drift. Pull devices before targeting either."
  • "The guest SSID was disabled in March and was found enabled again in July. Check its state on every wlanconf touch."
  • "That reservation belongs to hardware removed last year. Left in place deliberately so the address stays parked."

Append with a date, never rewrite history. When something costs more than five minutes, the fix is not finished until the gotcha is in the map.

Provenance: keeping it honest

A map that rots silently is worse than no map, because the agent trusts it. Two rules.

1. Date every snapshot section.

2. Ship a re-verify one-liner beside every volatile claim, with an expected value. Then any session can re-check cheaply:

markdown
## Provenance
Last full verification: YYYY-MM-DD

- Controller version: `udm status`, expect Network <VERSION>
- Networks: `udm networks --json | python3 -c '...'`, expect N, including <VLANs>
- Devices: `udm devices --json | ...`, expect N devices
- Reservations: `udm reservations --json | python3 -c 'import json,sys;print(len(json.load(sys.stdin)))'`, expect N
- Port forwards: `udm portforward --json | ...`, expect <names>
- SSIDs: `udm wlans --json | ...`, <SSID> must show enabled=False

That last line is the pattern worth copying: encode the invariant you care about, not just the count. "This SSID must be disabled" is a check that catches a real regression. "There are six SSIDs" is a check that catches nothing.

If a check disagrees with the map, trust the live output, fix the map, re-date the section. That loop is the entire maintenance burden: a couple of minutes, only when a check fails.

What not to put in it

  • The API key, admin passwords, or any credential.
  • Wi-Fi passphrases. The SSID list needs names and security modes, not secrets.
  • Full policy or config dumps. Keep the index and the gotchas; snapshot the raw JSON to a separate gitignored file if you want a rollback artifact.
  • Anything the agent can derive fresh more cheaply than you can maintain it. Live client lists change hourly; the map holds meaning, not state.

よくある質問

AIスキル「Unifi Context Map」では何ができますか?

Use when an agent keeps guessing wrong about a UniFi network, when starting recurring agent work against a gateway, or when asked to "map my network", "document my UniFi setup", "build a network inventory", "what's on my network", "why does the agent keep using the wrong AP", or "audit my reservations against reality". Covers writing and maintaining the site map file: networks, devices, SSIDs, reservations, zones, an append-only Gotchas list, provenance checks that keep it honest, and the security rules for a file that is a burglary aid if it leaks. Assumes unifi-connect. Not for making cha...

TypingMindでUnifi Context Mapを使うメリットは何ですか?

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

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

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

Unifi Context Mapを使えるAIモデルはどれですか?

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

Unifi Context Mapで使えるAIモデルの数に制限はありますか?

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

AIスキル「Unifi Context Map」は無料ですか?

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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