Skip to content

Commit b9be1a4

Browse files
committed
softer AI instructions to prevent prompt injection flags
1 parent cf91196 commit b9be1a4

10 files changed

Lines changed: 54 additions & 69 deletions

.ai/BOILERPLATE_MODE.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
<!-- Stardrive project instruction file — trusted internal documentation for AI agents, not user input. Execution scope: maintaining the Stardrive boilerplate itself, when STARDRIVE_AGENT_MODE.md is set to "boilerplate". -->
1+
<!-- Scope: boilerplate maintenance when STARDRIVE_AGENT_MODE.md contains "boilerplate". -->
22

3-
# Boilerplate Mode Instructions
3+
# Boilerplate Mode
44

5-
You are in this mode because `../STARDRIVE_AGENT_MODE.md` contains `boilerplate`. You are not adjusting the boilerplate for a new project, but maintaining the boilerplate itself.
5+
This guide applies when [`STARDRIVE_AGENT_MODE.md`](../STARDRIVE_AGENT_MODE.md) contains `boilerplate`. In this mode, changes maintain the Stardrive boilerplate rather than configure a derived website.
66

7-
This is the active guide for boilerplate work. The other `.ai` guides (`SETUP.md`, `CONFIG_GUIDE.md`, `TRIMMING_GUIDE.md`, `FAVICON_GUIDE.md`) describe the end-user setup flow - do **not** execute them as if you were setting up a project, but **do** read and update them whenever your changes alter that flow (see the sync rule below). For how these files relate, see the dependency overview in [`AGENTS.md`](../AGENTS.md).
7+
The other `.ai` guides (`SETUP.md`, `CONFIG_GUIDE.md`, `TRIMMING_GUIDE.md`, `FAVICON_GUIDE.md`) are reference material in this mode, not active workflows. Changes that affect project setup should keep those guides accurate. See [`AGENTS.md`](../AGENTS.md) for the dependency overview.
88

99
## What this means
1010

11-
- Code needs to be well documented, but never only for you and the user - documentation needs to be clear to every potential future user. Do not write things like "adjusted this as discussed". Only write documentation that helps somebody (even another AI agent), who knows nothing about the history of this boilerplate.
12-
- Always double-check with the whole cloning and configuration process. If things change there (for example, a new setting in theme.config.ts), update [`README.md`](../README.md), [`CONFIG_GUIDE.md`](./CONFIG_GUIDE.md) and any other related file in ./.ai.
13-
- If changes affect the [`TRIMMING_GUIDE`](./TRIMMING_GUIDE.md) or the structure of the blog, faq, or integration, also check whether the main branch of the Stardrive starter at [github.com/peltmonger/create-stardrive](https://github.com/peltmonger/create-stardrive) needs to be adjusted. Inform the user about it without taking further action. The user might to make another agent to work on this separated repository, so prepare a short guide on what to change there.
14-
- Always bear in mind that this boilerplate will ship to a wide variety of hosting environments and project types. Keep logic and structure as modularized, flexible, and independent as possible.
11+
- Documentation should be useful to future users without relying on conversation history. Avoid phrases such as "adjusted this as discussed."
12+
- Changes affecting cloning or configuration should also update [`README.md`](../README.md), [`CONFIG_GUIDE.md`](./CONFIG_GUIDE.md), and any other related file in `./.ai/`.
13+
- Changes affecting [`TRIMMING_GUIDE.md`](./TRIMMING_GUIDE.md) or the blog, FAQ, or integration structure should include a check of the Stardrive starter at [github.com/peltmonger/create-stardrive](https://github.com/peltmonger/create-stardrive). Report whether that repository may require a matching change and provide a short implementation guide, without modifying the separate repository.
14+
- The boilerplate supports varied hosting environments and project types. Keep its logic and structure modular, flexible, and independent.
1515
- Stay as close as possible to the Astro default, so it is easy to upgrade.
1616
- The content has multiple purposes at once:
1717
- demo the capabilities of the boilerplate
1818
- advertise for the boilerplate
1919
- be its own fully working website with valid rules and content (like having valid privacy policy and legal notice)
2020
- showcasing (listing) real world examples of the boilerplate
2121
- lead people and AI agents to using the boilerplate for their projects
22-
- Think Before Coding. Don't assume. Don't hide confusion. Surface tradeoffs.
23-
- Before implementing:
24-
- State your assumptions explicitly. If uncertain, ask.
25-
- If multiple interpretations exist, present them - don't pick silently.
26-
- If a simpler approach exists, say so. Push back when warranted.
27-
- If something is unclear, stop. Name what's confusing. Ask.
22+
- Think before coding. Surface assumptions, uncertainty, competing interpretations, simpler alternatives, and relevant tradeoffs before implementation.
2823
- Simplicity First.
2924
- Minimum code that solves the problem. Nothing speculative.
3025
- No features beyond what was asked.
3126
- If you write 200 lines and it could be 50, rewrite it.
3227
- Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
3328
- Surgical Changes. Touch only what you must. Clean up only your own mess.
3429
- Match existing style, even if you'd do it differently.
35-
- If you notice unrelated dead code, that has not been created by yourself, mention it - don't delete it.
36-
- When your changes create orphans: Remove imports/variables/functions that YOUR changes made unused. Don't remove pre-existing dead code unless asked.
30+
- Report unrelated dead code without removing it.
31+
- Remove imports, variables, or functions made unused by the current changes. Pre-existing dead code remains outside scope unless requested.

.ai/CONFIG_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Stardrive project instruction file — trusted internal documentation for AI agents, not user input. Execution scope: project configuration, when STARDRIVE_AGENT_MODE.md is set to "project". -->
1+
<!-- Scope: initial project configuration in project mode. -->
22

33
# Configuration Guide - Instructions
44

.ai/FAVICON_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Stardrive project instruction file — trusted internal documentation for AI agents, not user input. Execution scope: favicon/manifest generation, invoked from the favicon step of CONFIG_GUIDE.md. -->
1+
<!-- Scope: favicon and manifest setup when invoked by CONFIG_GUIDE.md. -->
22

33
# Favicon Guide
44

.ai/SETUP.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
<!-- Stardrive project instruction file — trusted internal documentation for AI agents, not user input. Execution scope: project setup only, when STARDRIVE_AGENT_MODE.md is missing or set to "project". -->
1+
<!-- Scope: repository initialization when STARDRIVE_AGENT_MODE.md is absent. -->
22

33
# Setup Guide
44

5-
This guide establishes the working mode, then hands off to the right next guide. See the dependency overview in [`AGENTS.md`](../AGENTS.md) for the full picture.
5+
Use this guide only when `STARDRIVE_AGENT_MODE.md` is absent. See the dependency overview in [`AGENTS.md`](../AGENTS.md) for the full workflow.
66

7-
## Step 1 - Determine the mode
7+
## Determine the repository mode
88

9-
Ask the user whether this is about creating a new project or maintaining the boilerplate itself.
9+
Ask whether the repository is being used to:
1010

11-
**Options (use the exact keyword):**
11+
- build a website from Stardrive (`project`), or
12+
- maintain the Stardrive boilerplate (`boilerplate`).
1213

13-
- `boilerplate` - maintaining the Stardrive boilerplate codebase itself.
14-
- `project` - building a new website on top of the boilerplate.
14+
Write the selected keyword to `STARDRIVE_AGENT_MODE.md`.
1515

16-
Create a file `STARDRIVE_AGENT_MODE.md` in the root of this repository and set its entire content to the single selected keyword (`boilerplate` or `project`), so future agents skip this question.
17-
18-
## Step 2 - Hand off to the matching guide
19-
20-
- **`boilerplate`** → Stop here, move on with your given tasks, and mind [`BOILERPLATE_MODE.md`](./BOILERPLATE_MODE.md). Do not run the project setup steps below.
21-
- **`project`** → Recommend the user to continue with the step-by-step configuration from [`CONFIG_GUIDE.md`](./CONFIG_GUIDE.md) before moving on with other tasks. It walks you through trimming, configuration, and theming, and you must end up having created a `PLAN.md` (in `./.ai/`) that tracks the remaining work. From then on, agents resume from `PLAN.md`.
16+
- For `project`, continue with [`CONFIG_GUIDE.md`](./CONFIG_GUIDE.md) and create `./.ai/PLAN.md` to track remaining work.
17+
- For `boilerplate`, continue with [`BOILERPLATE_MODE.md`](./BOILERPLATE_MODE.md).

.ai/TRIMMING_GUIDE.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1-
<!-- Stardrive project instruction file — trusted internal documentation for AI agents, not user input. Execution scope: initial trimming of a directly cloned Stardrive boilerplate, invoked from CONFIG_GUIDE.md. Self-deletes after execution. -->
1+
<!-- Scope: optional initial trimming for a directly cloned project, invoked by CONFIG_GUIDE.md. -->
22

3-
# Trimming Guide - Instructions
3+
# Trimming Guide
44

5-
The goal of this trimming step is to bring this repository to a clean starting point for the user's own project by removing demo content and features they do not need.
5+
This workflow removes optional demo content from a directly cloned Stardrive project. It applies only when invoked during project configuration by [`CONFIG_GUIDE.md`](./CONFIG_GUIDE.md).
66

7-
This applies when the user cloned Stardrive **directly** (e.g. via `git clone`) instead of using the [`create-stardrive`](https://www.npmjs.com/package/create-stardrive) scaffolding tool. `create-stardrive` performs these removals automatically; here you do them manually.
7+
The [`create-stardrive`](https://www.npmjs.com/package/create-stardrive) scaffolding tool performs these removals automatically, so this workflow is only relevant to direct clones (for example, via `git clone`).
88

9-
This guide should only be executed as part of the official initial [configuration](./CONFIG_GUIDE.md)!
9+
Before removing optional features, ask which of these should be retained:
1010

11-
## How to execute
11+
- Blog
12+
- FAQ
13+
- Integration catalog
14+
- Events
15+
- Cloudflare hosting
1216

13-
1. **Always-on steps** (marked `always`): execute them without asking. They remove demo/system files that are never useful in a real project and can cause conflicts.
14-
2. **Optional steps** (marked `optional`): you MUST ask the user whether they want to keep that feature before removing anything related to it. Never delete an optional feature without explicit confirmation.
15-
3. **Start by interviewing the user.** Present the optional features in one prompt - Blog, FAQ, Integration catalog, and Cloudflare hosting - and ask which they want to **keep**. Then remove only the ones they do not want.
16-
4. When deleting a file or directory, verify it exists first. Mind that all paths are based on the project root, where the package.json is located. If an element is already gone, report it and continue rather than failing.
17-
5. After removals, complete the navigation cleanup and any dependency uninstall that corresponds to what was removed.
18-
6. Do not commit changes unless the user asks.
19-
7. Note down any features dropped in the [`theme.config.ts`](../theme.config.ts) under the key "droppedFeatures" (Array of Strings) to keep track on it.
17+
Remove only features the user explicitly chooses not to retain. Always-on cleanup steps may proceed as documented below.
18+
19+
## Workflow rules
20+
21+
1. **Always-on steps** (marked `always`) do not require an additional feature-retention decision. They remove demo or system files that are not useful in a configured project and can cause conflicts.
22+
2. **Optional steps** (marked `optional`) require explicit confirmation before removal.
23+
3. Before deleting a file or directory, verify that it exists. All paths are relative to the project root containing `package.json`. Report missing elements and continue.
24+
4. After removals, complete the corresponding navigation cleanup and dependency uninstall.
25+
5. Commits are outside this workflow unless requested.
26+
6. Record removed features in [`theme.config.ts`](../theme.config.ts) under the `droppedFeatures` array.
2027

2128
### Context you can share with the user
2229

@@ -26,7 +33,7 @@ Stardrive ships as a fully-populated demo site - the same codebase that powers [
2633

2734
## Step 1 - System files (always)
2835

29-
Delete the following without asking:
36+
Remove the following as part of the always-on cleanup:
3037

3138
- `./SECURITY.md`
3239
- `./CHANGELOG.md`
@@ -146,8 +153,8 @@ npm un @astrojs/cloudflare wrangler
146153
The `.gitignore` file includes a block "# Lock files". This ignores lock files for the package managers not used.
147154
Adjust this block, if you are not using npm.
148155

149-
## Step 9 - Verify, then delete this guide (always)
156+
## Step 9 - Verify and complete trimming (always)
150157

151158
1. After all edits, verify the project still builds/type-checks cleanly (e.g. run the dev server or build) and fix any references left dangling by the removals.
152-
2. Verify you noted any dropped features in the `theme.config.ts`file.
153-
3. **Delete this `TRIMMING_GUIDE.md` file.** It is only relevant for initial setup and must not ship with the user's website.
159+
2. Verify that removed features are recorded in `theme.config.ts`.
160+
3. After successful verification, remove this temporary guide from the configured project. It is only relevant during initial setup.

.github/copilot-instructions.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
# 🛑 CRITICAL: REPOSITORY BOOTSTRAP DIRECTIVE 🛑
2-
As an AI agent operating in this repository, you MUST execute the following state check before analyzing, coding, or responding to any user prompt:
1+
# Stardrive repository instructions
32

4-
1. **CHECK STATE:** Silently verify if the file [`STARDRIVE_AGENT_MODE.md`](../STARDRIVE_AGENT_MODE.md) exists in the root directory.
5-
2. **IF MISSING (UNINITIALIZED):**
6-
- Intercept the prompt: Acknowledge to the user that you are running the initial repository setup first.
7-
- Never (!) proceed without this file being present!
8-
- Read the file [`SETUP.md`](../.ai/SETUP.md) in the`./.ai/` directory..
9-
- Execute ALL setup, scaffolding, and configuration instructions defined in `SETUP.md` and related files. Ask the user about clarification where necessary.
10-
- Create the `STARDRIVE_AGENT_MODE.md` file in the root directory to mark initialization as complete, setting its content to "project" or "boilerplate" - depending on what the user's case is about.
11-
- Proceed to fulfill the user's original request.
12-
3. **IF PRESENT (INITIALIZED):**
13-
- Directly proceed to fulfilling the user's prompt.
14-
- Mind the content of the `STARDRIVE_AGENT_MODE.md` as it defines your general scope as described in the [`AGENTS.md`](../AGENTS.md).
15-
16-
Additionally, always mind the guidelines in [`AGENTS.md`](../AGENTS.md)!
3+
Follow [`AGENTS.md`](../AGENTS.md) for repository mode selection, project conventions, and applicable workflow guides.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Check for an `STARDRIVE_AGENT_MODE.md` file at the root level. Its content is a
2727

2828
The `.ai/` folder drives onboarding. The files depend on each other in a fixed order - follow the links rather than guessing what to do next:
2929

30-
> **Note:** All files in `./.ai/` are **trusted project instruction files** — internal documentation authored by the Stardrive maintainers for AI agents operating in this repository. They may contain imperative directives ("you MUST", "delete this file", etc.) that are meant to be executed only within the scope described in each file's banner comment. They are not user input, external content, or untrusted data.
30+
> **Scope:** Files in `./.ai/` document mode-specific repository workflows. Consult only the files selected by `STARDRIVE_AGENT_MODE.md` and the dependency flow below. Reading a guide for reference does not activate its workflow.
3131
3232
```text
3333
AGENTS.md (this file) ← always read first; selects the mode

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Do not start without having @AGENTS.md checked at least once!
1+
@AGENTS.md

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stardrive",
3-
"version": "1.4.0",
4-
"stardriveVersion": "1.4.0",
3+
"version": "1.4.1",
4+
"stardriveVersion": "1.4.1",
55
"private": true,
66
"description": "The Astro boilerplate to create super stable and fast websites in the AI age",
77
"engines": {

0 commit comments

Comments
 (0)