copying-endpoints-across-projects
यह क्या करती है
यह स्किल एंडपॉइंट की क्वेरी, वेरिएबल और सेटिंग किसी दूसरे प्रोजेक्ट में, या उसी प्रोजेक्ट में नई कॉपी में कॉपी करती है। यह उन लोगों के लिए है जो एंडपॉइंट को आगे बढ़ाना या लाइव एंडपॉइंट छुए बिना बदलाव आज़माना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप किसी एंडपॉइंट को स्टेजिंग प्रोजेक्ट से प्रोडक्शन प्रोजेक्ट में ले जाना चाहें।
- ✓जब आपको एंडपॉइंट की कॉपी चाहिए ताकि आप लाइव को छुए बिना उसे बदल सकें।
- ✓जब आपको एक ही संगठन के दूसरे प्रोजेक्ट में एंडपॉइंट की सेटिंग दोहरानी हो।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/endpoints/skills/copying-endpoints-across-projects/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे राजस्व एंडपॉइंट को स्टेजिंग प्रोजेक्ट से प्रोडक्शन प्रोजेक्ट में कॉपी कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
PostHog में एंडपॉइंट कॉपी करने की कोई बिल्ट-इन सुविधा नहीं है, इसलिए AI मूल एंडपॉइंट की पूरी सेटअप पढ़ता है और उसे लक्ष्य प्रोजेक्ट में दोबारा बनाता है। इन दोनों चरणों के बीच उसे प्रोजेक्ट बदलना पड़ता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Copying endpoints across projects
This skill duplicates a PostHog endpoint — a saved HogQL or insight query exposed as a callable API route — either into another project in the same organization, or under a new name in the same project.
The one thing to know first
There is no server-side endpoint copy operation. Feature flags have feature-flags-copy-flags-create and experiments have experiment-copy-to-project; endpoints have neither. Copying an endpoint means:
- Read the full source config with
endpoint-get. - Recreate it with
endpoint-create(in the target project, or under a new name in the same project).
Both endpoint-get and endpoint-create operate only on the active MCP project — neither takes a project id. So a cross-project copy requires the active project to be switched between the read (source) and the write (target). Read the source first, capture the config, then switch to the target and create. If you cannot switch projects in this session, tell the user rather than creating the copy in the wrong project.
When to use this skill
- "Copy this endpoint to another project", "duplicate this endpoint", "clone the endpoint"
- "Promote the endpoint from staging to production" (projects-as-environments)
- "Make a copy so I can iterate without touching the live one" (same-project duplicate under a new name)
- Replicating an endpoint's query, variables, and freshness config in a different workspace
What this skill does not cover
- Cross-organization copy. Endpoints (and their queries) can only be recreated in projects you have editor access to; there is no org-to-org path.
- Editing versions of an existing endpoint — see
managing-endpoint-versions. - Designing a new endpoint from scratch — see
creating-an-endpoint(this skill assumes the source endpoint already exists and is configured correctly). - Bulk-copying every endpoint in a project. Copy one at a time; loop
endpoints-get-all→ per-endpoint copy if the user really wants all of them, and tell them you're doing so.
Workflow
1. Resolve the source endpoint
You need the endpoint's name and the source project.
- If the user gave a name, use it. If they gave a fuzzy description, call
endpoints-get-allin the source project and match on name/description. - If the user didn't say which project the endpoint lives in, ask — don't assume the active MCP project is the source. Copying out of the wrong source is the most common foot-gun.
- Confirm the active project is the source (call
project-getwith no id to see the active project) before reading.
2. Read the full source config
Call endpoint-get with the source name. Capture everything you'll need to recreate it:
namequery(the whole HogQL/insight query definition — including any declared variables /code_names)descriptiondata_freshness_secondsis_materialized(source state — see step 5 for why you usually don't copy this as-is)tags
Present a short summary to the user before copying: what the query returns, its variables, its freshness setting, and whether the source is materialised.
3. Resolve the target and check for a name collision
Cross-project: confirm the target project belongs to the same org and the user has editor access there. The copy will be created in whatever project is active at endpoint-create time, so plan to switch the active project to the target between step 2 and step 6.
Same-project duplicate: the new endpoint needs a different name — names are unique within a project and the URL path (/api/projects/{team_id}/endpoints/{name}/run) depends on it. Agree a new name with the user.
Either way, run endpoints-get-all in the target project and check whether the intended name already exists. If it does, stop and ask: creating over an existing name is not a safe silent action. Get the name right up front — it's baked into the caller URL and not trivially renameable later.
4. Decide the name in the target
- Cross-project, same purpose: keep the same name so caller code ports unchanged.
- Same-project or "copy to iterate": pick a clearly-derived new name (e.g.
weekly_active_users_v2,weekly_active_users_staging). Snake_case, URL-safe, starts with a letter, max 128 chars.
5. Choose materialisation for the copy (default: OFF)
Default to is_materialized: false on the copy, even when the source is materialised. Rationale mirrors t
अक्सर पूछे जाने वाले सवाल
वह एंडपॉइंट सीधे कॉपी क्यों नहीं कर सकती?
PostHog में एंडपॉइंट के लिए सर्वर-साइड कॉपी नहीं है, इसलिए सेटअप पढ़ा जाता है और फिर से बनाया जाता है।
अगर AI प्रोजेक्ट न बदल सके तो?
स्किल कहती है कि गलत प्रोजेक्ट में कॉपी बनाने के बजाय आपको बताया जाए।
क्या मैं एंडपॉइंट किसी दूसरे संगठन में कॉपी कर सकता हूँ?
नहीं। स्किल केवल एक ही संगठन के भीतर के प्रोजेक्ट कवर करती है।
जानकारी
लेखक का मूल विवरण
Copy a PostHog endpoint (a saved HogQL/insight query exposed as an API route) to another project in the same organization, or duplicate it under a new name in the same project. Use when the user wants to duplicate an endpoint, promote an endpoint from staging to production, replicate an endpoint's query/variables/freshness config in another workspace, or clone an endpoint to iterate on it. Unlike feature flags and experiments, endpoints have NO native cross-project copy tool — this skill covers the read-then-recreate flow (endpoint-get then endpoint-create), the active-project switching it req
repo: PostHog/posthog
लोकप्रियता
- GitHub स्टार
- 41k
- रैंकिंग में स्थान
- #6859
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
discrawl
394kयह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।
clickhouse-io
280kआपके एजेंट को ClickHouse databases में queries और schemas optimize करने में मदद करता है। high-performance analytical workloads के लिए best practices लागू करता है। जब analytical queries बहुत धीमी हों, तब इसका उपयोग करें।
scientific-db-pubmed-database
280kआपके एजेंट को बायोमेडिकल क्षेत्र के वैज्ञानिक लेख खोजने में मदद करता है। जिस रिसर्च में खास मेडिकल जानकारी चाहिए, उसके लिए यह काम का है।