installing-posthog-in-a-codebase
ما الذي تفعله
تجعل هذه المهارة الوكيل يثبّت مكتبة التحليلات من PostHog في قاعدة كود يستطيع قراءتها وتعديلها. وهي موجهة إلى المطورين الذين يريدون إضافة تحليلات المنتج وإعادة تشغيل الجلسات إلى تطبيقهم.
متى تستخدمها
- ✓عندما تطلب إضافة PostHog أو تحليلات المنتج أو إعادة تشغيل الجلسات إلى تطبيقك.
- ✓عندما تريد تثبيت مكتبة PostHog لإطار عملك، مثل React أو Next.js.
- ✓عندما تريد أن يحفظ الوكيل رمز المشروع وإعدادات المضيف في المكان الصحيح.
رابط المهارة
https://github.com/PostHog/posthog/blob/master/products/wizard/skills/installing-posthog-in-a-codebase/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“من فضلك أضف تحليلات PostHog إلى تطبيق Next.js الخاص بي باستخدام الإعداد الحالي من وثائقهم.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يتعرف الوكيل على إطار عملك من ملفات المشروع، ويقرأ صفحة الوثائق المطابقة لـ PostHog، ثم يثبّت أحدث حزمة ويضيف رمز المشروع وإعدادات المضيف، ويكتب كود الإعداد.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Installing PostHog in a codebase
Use this skill when you can read and edit the user's code.
If you can't access their code, as is common in ChatGPT on the web or Claude on the web, use installing-posthog-from-chat.
PostHog's docs are the source of truth for each SDK's setup. Init options, file locations and recommended settings change between SDK releases, so read the docs page for the framework before you write code, and follow it rather than what you remember.
1. Find the framework and read its docs
Detect the framework from the manifest files (package.json, pyproject.toml, requirements.txt, Gemfile, composer.json, go.mod, and so on) and the app's entry points.
A web app with its own backend usually needs a client SDK and a server SDK, so read both pages.
For a framework that isn't listed, call docs-search with the framework name.
2. Install the latest SDK
Add each package with the project's own package manager and no version, for example npm install posthog-js, pnpm add posthog-node, uv add posthog or bundle add posthog-ruby.
That resolves the newest release.
Don't type a version into the manifest from memory, because that pins an old release.
In a monorepo, install into the package that runs the app, not the workspace root.
3. Get the token and host
Call project-get without an ID.
Use api_token as the project token and api_host as the SDK's host option.
- Read both from environment variables in code, using the names the docs page uses (for example
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOST). - Write the real values to the env file the framework loads, such as
.env.localor.env. If the project has an example env file, add the variable names there with empty values. - Never hard-code the
الأسئلة الشائعة
هل يعتمد الوكيل على الذاكرة في إعداد PostHog؟
لا. يقرأ الوثائق الحالية لإطار عملك أولاً، لأن تفاصيل الإعداد تتغير بين الإصدارات.
ماذا لو لم أستطع إعطاء الوكيل صلاحية الوصول إلى كودي؟
عندها تُستخدم مهارة أخرى تشرح الإعداد في المحادثة وتسلمه كطلب سحب.
ما الأطر المغطاة؟
أطر الويب الشائعة مثل React وNext.js وVue وNuxt، إضافةً إلى عدة لغات خادم، ولكل منها صفحة وثائق خاصة.
التفاصيل
الوصف الأصلي من المؤلف
Install and configure a PostHog SDK in a repository you can read and edit, following PostHog's docs for the framework. Use when a user working in their codebase asks to add, install, or set up PostHog, product analytics, session replay, or a PostHog SDK. Covers finding the right docs page, installing the latest package, getting the project token and ingestion host from project-get, keeping them in the env file, server-side setup, identifying users, and verifying the change. If you can't access the user's code, as is common in ChatGPT on the web or Claude on the web, use installing-posthog-from
repo: PostHog/posthog
الشعبية
- نجوم GitHub
- 41k
- الترتيب
- #6979
- الترخيص
- —
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
depot-ci
41kيساعد وكيلك على إعداد سير عمل Depot CI وتشغيله، وهو بديل لـ GitHub Actions، بما في ذلك نقل سير العمل الحالي وقراءة سجلات التشغيل.
depot-container-builds
41kيساعد وكيلك على بناء صور Docker على بُنّاة Depot البعيدين، بما في ذلك الصور متعددة المنصات والدفع إلى السجلات وإصلاح أخطاء البناء.
depot-github-runners
41kيساعد وكيلك على نقل مهام GitHub Actions إلى مشغّلات Depot المُدارة، واختيار أحجامها وتسمياتها، وإصلاح مشاكل إعدادها.
editing-agents-md
41kيساعد وكيلك على تحديد ما إذا كانت القاعدة تنتمي إلى ملف AGENTS.md أو CLAUDE.md، وكتابتها بطريقة تُتَّبع دون تضخيم الملف.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.