native-navigation
できること
このスキルは、Agent-Native アプリで、コードでページを移動させるボタンではなく、本物のリンクをどのような場合に使うべきかを示します。Cmd+クリック、中クリック、キーボード操作が機能し続けるようにします。画面上のナビゲーションを作る開発者向けです。
使う場面
- ✓別のページを開くべきボタンやカードを追加するとき。
- ✓ナビゲーションの操作が Cmd+クリックや中クリックに反応しないとき。
- ✓アプリ内のリンクと外部リンクのどちらを使うか決める必要があるとき。
スキルのリンク
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/native-navigation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“プロジェクトのカードを変更して、プロジェクトページを開くようにしてください。Cmd+クリックでも使えるようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
開発者は、アプリ内のページにはルーターのリンクを、外部や新しいタブで開くページには通常のリンクを使います。必要に応じて、ボタンをリンクで囲みます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Native Navigation
Rule
Pure navigation must render a real React Router <Link> for same-SPA routes,
a native <a href> for external/public or explicit new-tab destinations, or a
shadcn Button asChild wrapper around one. Do not use a button whose only job
is to call navigate(), window.open(), or window.location.
Why
Browser modifier-click, middle-click, keyboard activation, accessibility, and normal client-side routing come from real links. Imperative JavaScript navigation hides the destination and blocks those browser semantics.
How
import { Link } from "react-router";
<Link to={`/items/${item.id}`}>...</Link>
<Button asChild>
<Link to="/settings">Settings</Link>
</Button>
<a href={previewUrl} target="_blank" rel="noopener noreferrer">
Preview
</a>
- Use
Linkfor same-SPA internal routes. - Use
<a>when the URL is external, crosses an app/public boundary, is an auth or sign-in destination, or intentionally opens in a new tab. - Preserve query strings and hashes in
toorhref. - For cards with nested actions, link only the non-interactive card region or use a transparent Link overlay; never nest links or buttons.
- If selection mode changes click behavior, prevent default only for an unmodified primary click and preserve modified clicks.
Keep imperative navigation for post-mutation redirects, OAuth and popup flows, downloads, media/blob URLs, playback, keyboard shortcuts, and stateful tabs.
Review
Search for onClick={() => navigate, window.open, window.location,
onAuxClick, and buttons whose only purpose is routing. For each candidate,
confirm whether it is pure navigation or a stateful workflow before changing
it.
Verify the rendered DOM exposes an href, then test normal click, Cmd/Ctrl-click,
middle-click, keyboard Enter, and nested controls where applicable. Run oxfmt
and focused app tests or typechecks for the touched package.
Related Skills
client-side-routingfrontend-designshadcn-ui
よくある質問
ページの移動にボタンを使ってはいけないのはなぜですか?
ボタンは移動先を隠し、Cmd+クリックや中クリックなどのブラウザの動作を妨げるからです。
コードによる移動が正しい場合もありますか?
あります。更新後のリダイレクトや、サインインやポップアップの流れでは、コードによる移動を使うべきだとスキルは述べています。
中にボタンがあるカードはどうしますか?
操作できない部分だけをリンクにします。リンクやボタンを入れ子にしないよう、スキルは指示しています。
詳細
作者による元の説明
Use when adding or reviewing UI navigation so internal routes preserve normal SPA behavior plus Cmd/Ctrl-click and middle-click new-tab semantics.
repo: BuilderIO/agent-native
人気
- GitHubのスター
- 7.6k
- ランキング
- #13168
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
design-exploration
7.6kUIの複数のデザインの方向性を並べて検討し、1つを選んでもらい、選んだデザインを磨き上げるようエージェントを支援します。
visual-edit
7.6k実行中のローカルのアプリをビジュアルエディターで開き、本物の画面をまとめて確認し編集できるようエージェントを支援します。
turn-into-app
7.6kワークフロー、スプレッドシート、プロジェクトを、画面にデータが入り、操作の裏でエージェントが働く、洗練されたビジュアルアプリに変えます。
visual-plan
7.6kプレーンテキストの計画を、図、ファイルのマップ、コードの断片、未解決の質問を含む、対話できるビジュアルな計画に変えます。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。