--- name: myappstree description: Lock an app so it only opens through MyAppsTree (myappstree.com), update its key, or remove the lock. Use when the user mentions MyAppsTree, the MYAPPSTREE_KEY variable or the X-MyAppsTree-Key header. --- # MyAppsTree Last updated: 21 November 2026. The current version is at https://myappstree.com/skill.md. If you can open that address, use what it says over this copy. MyAppsTree (https://myappstree.com) is one page for all the apps a person has built. It does not host apps. Each app keeps running where it already is, and people open it through a MyAppsTree address such as https://budget.myappstr.ee, which signs them in with Google when the app is private. A lock makes the app refuse visits that skip MyAppsTree and go straight to its real address. MyAppsTree sends a secret key in the X-MyAppsTree-Key request header, and the app checks it before anything else. ## Before you start - These instructions are written the way the person would say them to you: β€œI” and β€œme” mean the person you are working for. - There are three main tasks: add the lock, update the key, remove the lock. A fourth, smaller one repairs a lock that blocks development. If it is not clear which one is wanted, ask. - The lock needs an app with a server side, such as Next.js or anything with middleware. A purely static site cannot check a key; say so and stop. - The app must open without a login of the hosting service: visitor access, password or deployment protection at Netlify, Vercel and others. Such a login sends visitors to the host's own address, so the app cannot be opened through MyAppsTree. If it is on, switch it off or tell the person where to switch it off; the lock protects the app instead. A sign-in that is part of the app itself can stay. - The person does these parts themselves in MyAppsTree, because you cannot: adding the app, creating the key (open the app there, then "Lock the original address", then Create key, then Copy instructions), and pressing "Check" at the end. - The instructions the person copies contain a one-time link. You collect the key from it yourself; the person does not copy or paste the key. - The key is a secret. It must never appear in the chat, in logs, in git or in the browser, and it is kept only at the host. - The lock applies to published deployments, including preview deployments at a host. Development stays open without the key: the person's own computer and the unpublished development sandbox of the tool they build in. ## Add the lock Lock this app so it only answers requests that come through MyAppsTree (myappstree.com). WHAT TO BUILD - Add one check that runs first, before anything else in the app: before any login, pages, API routes and, where the framework allows it, static files. - It compares the X-MyAppsTree-Key request header with the MYAPPSTREE_KEY environment variable, using a constant-time comparison. - If the variable is not set, or the header is missing or different, respond with status 403 and a small HTML page that says "Open this app from MyAppsTree", where "MyAppsTree" is a link to https://myappstree.com - If the key matches, let the request continue exactly as it does today. Change nothing else: if the app has its own login, keep it, and if it has none, do not add one. - The key must never reach the browser. Keep it out of client-side code and out of public variable names such as NEXT_PUBLIC_ or VITE_. - If the app already has this check, change it to follow these rules instead of adding a second one. WHERE THE LOCK APPLIES - Locked: every published deployment. That is production and anything else that was published or deployed for other people to open, such as preview deployments at a host. There, a missing or wrong key always gets the 403 page. - Open, without the key: development. That is the app running on my own computer, the unpublished development sandbox or live preview of the tool I build in (the version shown next to the editor or chat before I press Publish), and any development build. - Tell the two apart on the server, with a signal a visitor cannot change. Use the first of these that this project and platform support: 1. A variable that exists only in development: MYAPPSTREE_LOCK=off, set in the local env file (ignored by git) or in the platform's development-only variables. Never set it for a published environment and never put it in a file that is committed or deployed. 2. The platform's or framework's own development signal: a run mode that says development outright (for example NODE_ENV is exactly "development", or the framework's dev flag is true), or a variable the platform itself sets in its development sandbox and not in published deployments. A missing value counts as published. - Never decide from the request itself (host name, headers, query string, cookies): a visitor can fake those. - If it is not certain that the app is running in development, treat it as published and keep it locked. GETTING THE KEY If you can reach the link, collect the key yourself, so that I do not have to copy or paste it. - The key is at the one-time link I gave you with this request (its address contains /k/). If I gave you none, ask me to copy the instructions from the "Lock the original address" panel in MyAppsTree again. - The link answers one request only, and only for 30 minutes after I created the key. The answer is the key and nothing else, as plain text. - So request it exactly once, with a shell command (for example curl -fsS) that saves the answer straight into a temporary file outside the project. Do not open it in a browser or with a web fetch or search tool, and do not try it out first: that would use up the one request and put the key into this chat. - The key is a secret. Do not print or log it, and do not show it in this chat. - Check, without showing the value, that the saved key is 64 characters long. - Set the key only at my host, as the MYAPPSTREE_KEY variable, stored as a secret (the hidden or encrypted type, often called "Secret" or "Sensitive"), replacing any value already there. Set it for every published environment: production and also preview deployments, so those are locked too. If the platform keeps one set of secrets for development and published, set it there; development simply does not use it. - Do not keep the key on my computer. The local env file gets no MYAPPSTREE_KEY; if an older setup left one there, remove that line. - Pass the value from the temporary file to the host's own command through a pipe or a file (for example "vercel env add MYAPPSTREE_KEY" or "wrangler secret put MYAPPSTREE_KEY"), so it is never shown. Make every choice yourself (variable type, environments). Delete the temporary file as soon as the host has the key. - If the link answers that it was already used or has expired, or the request fails, stop and tell me to press "Update key" in MyAppsTree and give you the new instructions. - If you cannot reach the link or cannot run such a command, and you have a secure way to take a secret from me (a prompt with hidden input, your tool's own form for secrets, or my host's field for secret variables), use that instead: ask me to enter the key there. I copy it with "Copy key" in the "Lock the original address" panel of MyAppsTree. Never ask me to paste the key into this chat. - If my host has no command for setting a secret, tell me the exact settings page and field, and that I can copy the key the same way. LEAVE A NOTE IN THE PROJECT So that nobody removes the check by accident later, add this note to the project's instructions file for coding agents: AGENTS.md, or CLAUDE.md if the project already uses that one. If neither exists, create AGENTS.md. If a note with this heading is already there, replace it with this one. ```markdown ## MyAppsTree lock This app only answers requests that come through MyAppsTree (https://myappstree.com). The check that compares the X-MyAppsTree-Key request header with the MYAPPSTREE_KEY environment variable must stay the first thing that runs. Every published deployment is locked. Development is open without the key: a local run and the unpublished development sandbox or preview of the tool the app is built in. The check tells them apart on the server (MYAPPSTREE_LOCK=off in a development-only variable, or the platform's own development signal), never from anything in the request, and stays locked when unsure. The key exists only at the host. Do not remove or weaken the check, and never show the key in the browser, in logs or in a chat. To update the key or remove the lock, follow https://myappstree.com/agents.md ``` WHEN THE KEY IS IN PLACE - Redeploy or publish the live app yourself so it starts using the key. - Check the live app: a request without the X-MyAppsTree-Key header must now get status 403. - Check development: the local app, or the tool's development preview, must open normally without any key. - If you cannot redeploy or publish it yourself, tell me to do it (for example with the Publish button of my tool). The changes and the key do nothing until then. - Then tell me to press "Check" under "Lock the original address" in MyAppsTree, only after the app is redeployed. ## Update the key Use this after the person pressed "Update key" in MyAppsTree. The old key stopped working at that moment. It also covers an app whose lock was never finished: then you build the lock as well. The MyAppsTree key for this app has changed. Put the new key in place, so the app only answers requests that come through MyAppsTree (myappstree.com). FIRST, LOOK AT THE APP - Look for the check that compares the X-MyAppsTree-Key request header with the MYAPPSTREE_KEY environment variable. - If the check is there: leave the code alone and only replace the key, as described next. - If the check is not there, the lock was never finished. Do not stop and do not ask me: build it now, as described under IF THE LOCK IS MISSING, and set the key too. GETTING THE NEW KEY If you can reach the link, collect the key yourself, so that I do not have to copy or paste it. - The key is at the one-time link I gave you with this request (its address contains /k/). If I gave you none, ask me to copy the instructions from the "Lock the original address" panel in MyAppsTree again. - The link answers one request only, and only for 30 minutes after I created the key. The answer is the key and nothing else, as plain text. - So request it exactly once, with a shell command (for example curl -fsS) that saves the answer straight into a temporary file outside the project. Do not open it in a browser or with a web fetch or search tool, and do not try it out first: that would use up the one request and put the key into this chat. - The key is a secret. Do not print or log it, and do not show it in this chat. - Check, without showing the value, that the saved key is 64 characters long. - Set the key only at my host, as the MYAPPSTREE_KEY variable, stored as a secret (the hidden or encrypted type, often called "Secret" or "Sensitive"), replacing any value already there. Set it for every published environment: production and also preview deployments, so those are locked too. If the platform keeps one set of secrets for development and published, set it there; development simply does not use it. - Do not keep the key on my computer. The local env file gets no MYAPPSTREE_KEY; if an older setup left one there, remove that line. - Pass the value from the temporary file to the host's own command through a pipe or a file (for example "vercel env add MYAPPSTREE_KEY" or "wrangler secret put MYAPPSTREE_KEY"), so it is never shown. Make every choice yourself (variable type, environments). Delete the temporary file as soon as the host has the key. - If the link answers that it was already used or has expired, or the request fails, stop and tell me to press "Update key" in MyAppsTree and give you the new instructions. - If you cannot reach the link or cannot run such a command, and you have a secure way to take a secret from me (a prompt with hidden input, your tool's own form for secrets, or my host's field for secret variables), use that instead: ask me to enter the key there. I copy it with "Copy key" in the "Lock the original address" panel of MyAppsTree. Never ask me to paste the key into this chat. - If my host has no command for setting a secret, tell me the exact settings page and field, and that I can copy the key the same way. - If the variable does not exist yet, create it. That is expected when the lock was never finished. IF THE LOCK IS MISSING Skip this part when the check is already there. - Add one check that runs first, before anything else in the app: before any login, pages, API routes and, where the framework allows it, static files. - It compares the X-MyAppsTree-Key request header with the MYAPPSTREE_KEY environment variable, using a constant-time comparison. - If the variable is not set, or the header is missing or different, respond with status 403 and a small HTML page that says "Open this app from MyAppsTree", where "MyAppsTree" is a link to https://myappstree.com - If the key matches, let the request continue exactly as it does today. Change nothing else: if the app has its own login, keep it, and if it has none, do not add one. - The key must never reach the browser. Keep it out of client-side code and out of public variable names such as NEXT_PUBLIC_ or VITE_. - If the app already has this check, change it to follow these rules instead of adding a second one. Where the lock applies: - Locked: every published deployment. That is production and anything else that was published or deployed for other people to open, such as preview deployments at a host. There, a missing or wrong key always gets the 403 page. - Open, without the key: development. That is the app running on my own computer, the unpublished development sandbox or live preview of the tool I build in (the version shown next to the editor or chat before I press Publish), and any development build. - Tell the two apart on the server, with a signal a visitor cannot change. Use the first of these that this project and platform support: 1. A variable that exists only in development: MYAPPSTREE_LOCK=off, set in the local env file (ignored by git) or in the platform's development-only variables. Never set it for a published environment and never put it in a file that is committed or deployed. 2. The platform's or framework's own development signal: a run mode that says development outright (for example NODE_ENV is exactly "development", or the framework's dev flag is true), or a variable the platform itself sets in its development sandbox and not in published deployments. A missing value counts as published. - Never decide from the request itself (host name, headers, query string, cookies): a visitor can fake those. - If it is not certain that the app is running in development, treat it as published and keep it locked. So that nobody removes the check by accident later, add this note to the project's instructions file for coding agents: AGENTS.md, or CLAUDE.md if the project already uses that one. If neither exists, create AGENTS.md. If a note with this heading is already there, replace it with this one. ```markdown ## MyAppsTree lock This app only answers requests that come through MyAppsTree (https://myappstree.com). The check that compares the X-MyAppsTree-Key request header with the MYAPPSTREE_KEY environment variable must stay the first thing that runs. Every published deployment is locked. Development is open without the key: a local run and the unpublished development sandbox or preview of the tool the app is built in. The check tells them apart on the server (MYAPPSTREE_LOCK=off in a development-only variable, or the platform's own development signal), never from anything in the request, and stays locked when unsure. The key exists only at the host. Do not remove or weaken the check, and never show the key in the browser, in logs or in a chat. To update the key or remove the lock, follow https://myappstree.com/agents.md ``` WHEN THE NEW KEY IS IN PLACE - Redeploy or publish the live app yourself so it starts using the new key. - Check the live app: a request without the X-MyAppsTree-Key header must now get status 403. - Check development: the local app, or the tool's development preview, must open normally without any key. - If you cannot redeploy or publish it yourself, tell me to do it (for example with the Publish button of my tool). The changes and the key do nothing until then. - Then tell me to press "Check" under "Lock the original address" in MyAppsTree, only after the app is redeployed. ## Open development again Use this when the app is already locked and the lock also blocks development: the app on the person's computer, or the unpublished development preview of the tool they build in, shows "Open this app from MyAppsTree". Change only the check, so it follows these rules. Do not change or ask for the key, and do not touch MYAPPSTREE_KEY at the host. - Locked: every published deployment. That is production and anything else that was published or deployed for other people to open, such as preview deployments at a host. There, a missing or wrong key always gets the 403 page. - Open, without the key: development. That is the app running on my own computer, the unpublished development sandbox or live preview of the tool I build in (the version shown next to the editor or chat before I press Publish), and any development build. - Tell the two apart on the server, with a signal a visitor cannot change. Use the first of these that this project and platform support: 1. A variable that exists only in development: MYAPPSTREE_LOCK=off, set in the local env file (ignored by git) or in the platform's development-only variables. Never set it for a published environment and never put it in a file that is committed or deployed. 2. The platform's or framework's own development signal: a run mode that says development outright (for example NODE_ENV is exactly "development", or the framework's dev flag is true), or a variable the platform itself sets in its development sandbox and not in published deployments. A missing value counts as published. - Never decide from the request itself (host name, headers, query string, cookies): a visitor can fake those. - If it is not certain that the app is running in development, treat it as published and keep it locked. Then update the "MyAppsTree lock" note in AGENTS.md or CLAUDE.md to the version shown under "Add the lock", publish, and check both sides: the published address still gets status 403 without the X-MyAppsTree-Key header, and development opens normally. ## If you cannot use the key link Use this only when you cannot run shell commands or cannot reach the link. It replaces the part about getting the key in the two tasks above. The person copies the key with "Copy key" in the "Lock the original address" panel. I have the key copied and ready. It is a secret, so do not ask me to paste it into this chat, and do not print or log it. The key is the only thing you ask me for. Make every other choice yourself (variable type, environments) and pass it as flags or options, so I am not shown any other question. - Set the key only at my host, as the MYAPPSTREE_KEY variable, stored as a secret (the hidden or encrypted type, often called "Secret" or "Sensitive"), replacing any value already there. Set it for every published environment: production and also preview deployments, so those are locked too. If the platform keeps one set of secrets for development and published, set it there; development simply does not use it. - Do not keep the key on my computer. The local env file gets no MYAPPSTREE_KEY; if an older setup left one there, remove that line. - Use the host's own command that asks me for the value with hidden input (for example "vercel env add MYAPPSTREE_KEY" or "wrangler secret put MYAPPSTREE_KEY"), choosing the secret type yourself. If the host has no such command, tell me the exact settings page and field to paste the key into. - If you cannot run a command that waits for my input, give me the one command to run in my terminal instead. ## Remove the lock Use this after the person pressed "Remove the lock" in MyAppsTree. Remove the MyAppsTree lock from this app. I have turned the lock off in MyAppsTree, so requests no longer carry a key. WHAT TO REMOVE - The check that compares the X-MyAppsTree-Key request header with the MYAPPSTREE_KEY environment variable and answers 403 with "Open this app from MyAppsTree". Remove that check and any code that exists only for it. - Leave everything else as it is, including any login the app has. - The MYAPPSTREE_KEY variable: remove it from my host for every environment, and from the local env file and any example env file if it is there. Do not print its value. - The MYAPPSTREE_LOCK variable, wherever it was set for development, and any other code that told development and published apart only for the lock. - The "MyAppsTree lock" note in AGENTS.md or CLAUDE.md, if the project has one. WHEN IT IS REMOVED - Redeploy or publish the live app yourself, and restart the local one. If you cannot, tell me to do it; the lock stays in the live app until then. - Check the live app: a request without the X-MyAppsTree-Key header must now get the normal page, not status 403. - Then tell me it is done. ## Optional: know who is signed in Build this only if the person asks for it. - For a private app, MyAppsTree adds the X-User-Email request header with the Google email of the signed-in person. A public app gets no such header. - Read it only on the server, and only after the key check has passed. Without the lock anyone could send that header themselves. - The app does not need a login of its own for this. If it already has one, leave it unless the person asks to remove it.