@preapexis/pi-kit 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions/prompts.ts +2 -1
- package/package.json +1 -1
- package/prompts/init.md +144 -48
- package/prompts/repo-map.md +163 -0
package/extensions/prompts.ts
CHANGED
|
@@ -4,7 +4,8 @@ export default function (pi: ExtensionAPI): void {
|
|
|
4
4
|
const prompts = [
|
|
5
5
|
{
|
|
6
6
|
name: "init",
|
|
7
|
-
description:
|
|
7
|
+
description:
|
|
8
|
+
"Inspect the repository and create or update AGENTS.md for future Pi sessions",
|
|
8
9
|
usage: "/init"
|
|
9
10
|
},
|
|
10
11
|
{
|
package/package.json
CHANGED
package/prompts/init.md
CHANGED
|
@@ -1,43 +1,88 @@
|
|
|
1
1
|
# Initialize Repository Understanding
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your job is to deeply inspect this repository and create or update an `AGENTS.md` file that captures everything Pi needs to know to work effectively in this codebase.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
If the repository is large, inspect the most important files first and clearly mention what was not inspected.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Goal
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Create a useful `AGENTS.md` file so future Pi sessions can quickly understand:
|
|
10
|
+
|
|
11
|
+
- what this project does
|
|
12
|
+
- where important files live
|
|
13
|
+
- which commands to run
|
|
14
|
+
- which files are risky
|
|
15
|
+
- which files to inspect for common tasks
|
|
16
|
+
- what rules agents should follow
|
|
10
17
|
|
|
11
18
|
## Steps
|
|
12
19
|
|
|
13
|
-
1.
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
20
|
+
1. **Check for an existing `AGENTS.md`**
|
|
21
|
+
- If it exists, read it first.
|
|
22
|
+
- Preserve anything that is still accurate and relevant.
|
|
23
|
+
- Do not remove existing project-specific rules unless they are clearly outdated.
|
|
24
|
+
- Merge new findings with the existing content.
|
|
25
|
+
|
|
26
|
+
2. **Read the codebase thoroughly**
|
|
27
|
+
|
|
28
|
+
Read important files such as:
|
|
29
|
+
- `README.md`
|
|
30
|
+
- `package.json`
|
|
31
|
+
- `pyproject.toml`
|
|
32
|
+
- `go.mod`
|
|
33
|
+
- `Cargo.toml`
|
|
34
|
+
- `pom.xml`
|
|
35
|
+
- `build.gradle`
|
|
36
|
+
- `CONTRIBUTING.md`
|
|
37
|
+
- `docs/`
|
|
38
|
+
- `.github/workflows/`
|
|
39
|
+
- `docker-compose.yml`
|
|
40
|
+
- `Dockerfile`
|
|
41
|
+
- config files such as:
|
|
42
|
+
- `tsconfig.json`
|
|
43
|
+
- `vite.config.*`
|
|
44
|
+
- `next.config.*`
|
|
45
|
+
- `webpack.config.*`
|
|
46
|
+
- `eslint.config.*`
|
|
47
|
+
- `prettier.config.*`
|
|
48
|
+
- main source directories such as:
|
|
49
|
+
- `src/`
|
|
50
|
+
- `app/`
|
|
51
|
+
- `lib/`
|
|
52
|
+
- `packages/`
|
|
53
|
+
- `extensions/`
|
|
54
|
+
- `prompts/`
|
|
55
|
+
- `skills/`
|
|
56
|
+
- `themes/`
|
|
57
|
+
- test files and test configuration
|
|
58
|
+
- `.env.example` files only
|
|
59
|
+
|
|
60
|
+
Do not read actual `.env` files.
|
|
61
|
+
|
|
62
|
+
3. **Identify the project structure**
|
|
63
|
+
|
|
64
|
+
Find:
|
|
65
|
+
- main entry points
|
|
66
|
+
- important directories and their purposes
|
|
27
67
|
- config files
|
|
28
68
|
- generated/build output directories
|
|
29
69
|
- files that should be treated carefully
|
|
30
70
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
71
|
+
4. **Detect the development workflow**
|
|
72
|
+
|
|
73
|
+
Find commands for:
|
|
74
|
+
- install
|
|
75
|
+
- dev
|
|
76
|
+
- build
|
|
77
|
+
- test
|
|
78
|
+
- lint
|
|
79
|
+
- typecheck
|
|
80
|
+
- format
|
|
81
|
+
- reload or local development, if applicable
|
|
82
|
+
|
|
83
|
+
5. **Identify safety risks**
|
|
39
84
|
|
|
40
|
-
|
|
85
|
+
Look for:
|
|
41
86
|
- secrets or env files
|
|
42
87
|
- deployment files
|
|
43
88
|
- database migrations
|
|
@@ -47,52 +92,103 @@ If the repository is large, inspect the most important files first and clearly m
|
|
|
47
92
|
- destructive scripts
|
|
48
93
|
- commands that should require confirmation
|
|
49
94
|
|
|
50
|
-
|
|
95
|
+
6. **Infer coding conventions**
|
|
96
|
+
|
|
97
|
+
Look for:
|
|
51
98
|
- language/framework
|
|
52
99
|
- naming style
|
|
53
100
|
- error handling style
|
|
54
101
|
- testing style
|
|
55
102
|
- API conventions
|
|
56
103
|
- dependency management
|
|
104
|
+
- state management and data flow, if applicable
|
|
105
|
+
|
|
106
|
+
7. **Create a task-focused project map inside `AGENTS.md`**
|
|
107
|
+
|
|
108
|
+
Add a section that tells future agents where to look first for common tasks.
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
- For branding/UI changes, read `extensions/brand-ui.ts`.
|
|
112
|
+
- For update behavior, read `extensions/update.ts`.
|
|
113
|
+
- For safety behavior, read `extensions/safety.ts` and `extensions/git-guard.ts`.
|
|
114
|
+
- For prompt workflows, read `prompts/`.
|
|
115
|
+
- For skills, read `skills/<skill-name>/SKILL.md`.
|
|
57
116
|
|
|
58
117
|
## Output
|
|
59
118
|
|
|
60
|
-
|
|
119
|
+
Create or update `AGENTS.md` in the repository root with this structure:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
# Agent Guidelines: <project name>
|
|
123
|
+
|
|
124
|
+
## Project Summary
|
|
125
|
+
|
|
126
|
+
Briefly explain what this project does.
|
|
127
|
+
|
|
128
|
+
## Tech Stack
|
|
129
|
+
|
|
130
|
+
Languages, frameworks, libraries, and tools.
|
|
131
|
+
|
|
132
|
+
## Project Map
|
|
133
|
+
|
|
134
|
+
| Path | Purpose |
|
|
135
|
+
| ------ | ---------------- |
|
|
136
|
+
| `src/` | Main source code |
|
|
137
|
+
|
|
138
|
+
## Common Task Map
|
|
61
139
|
|
|
62
|
-
|
|
140
|
+
| Task | Read These Files First |
|
|
141
|
+
| ---------------------- | ------------------------------------------------- |
|
|
142
|
+
| Change branding/UI | `extensions/brand-ui.ts`, `themes/` |
|
|
143
|
+
| Change update behavior | `extensions/update.ts` |
|
|
144
|
+
| Change safety behavior | `extensions/safety.ts`, `extensions/git-guard.ts` |
|
|
63
145
|
|
|
64
|
-
|
|
146
|
+
## Development Commands
|
|
65
147
|
|
|
66
|
-
|
|
148
|
+
| Command | Purpose |
|
|
149
|
+
| ---------- | --------- |
|
|
150
|
+
| `npm test` | Run tests |
|
|
67
151
|
|
|
68
|
-
|
|
152
|
+
## Coding Conventions
|
|
69
153
|
|
|
70
|
-
|
|
154
|
+
Naming, error handling, testing, API patterns, state management.
|
|
71
155
|
|
|
72
|
-
|
|
156
|
+
## Safety Rules
|
|
73
157
|
|
|
74
|
-
|
|
158
|
+
Files, directories, and commands to treat carefully.
|
|
75
159
|
|
|
76
|
-
|
|
160
|
+
## Architecture Notes
|
|
77
161
|
|
|
78
|
-
|
|
162
|
+
Key patterns, data flow, important abstractions.
|
|
79
163
|
|
|
80
|
-
|
|
164
|
+
## Agent Rules
|
|
81
165
|
|
|
82
|
-
|
|
166
|
+
Repo-specific rules for AI agents working in this codebase.
|
|
83
167
|
|
|
84
|
-
|
|
168
|
+
## Open Questions
|
|
85
169
|
|
|
86
|
-
|
|
170
|
+
Anything unclear or missing.
|
|
87
171
|
|
|
88
|
-
|
|
172
|
+
## Inspection Notes
|
|
89
173
|
|
|
90
|
-
|
|
174
|
+
Mention important areas that were not inspected.
|
|
175
|
+
```
|
|
176
|
+
````
|
|
91
177
|
|
|
92
|
-
|
|
178
|
+
## Rules
|
|
93
179
|
|
|
94
|
-
|
|
180
|
+
- Be thorough but concise.
|
|
181
|
+
- `AGENTS.md` should be scannable.
|
|
182
|
+
- Do not include secrets, API keys, tokens, passwords, or sensitive data.
|
|
183
|
+
- Do not read actual `.env` files.
|
|
184
|
+
- If `AGENTS.md` already exists, merge with it instead of blindly replacing it.
|
|
185
|
+
- Focus on information that helps an AI agent write better code.
|
|
186
|
+
- Prefer specific file paths over vague explanations.
|
|
187
|
+
- Do not modify source code during initialization.
|
|
188
|
+
- Only create or update `AGENTS.md`.
|
|
189
|
+
- After creating or updating `AGENTS.md`, report:
|
|
190
|
+
- file path
|
|
191
|
+
- what sections were added or updated
|
|
192
|
+
- anything that was unclear
|
|
95
193
|
|
|
96
|
-
Mention important files or areas that were not inspected.
|
|
97
194
|
|
|
98
|
-
Do not modify the repository unless I explicitly ask.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Repository Map Generator
|
|
2
|
+
|
|
3
|
+
Create or update a repository map for this project.
|
|
4
|
+
|
|
5
|
+
You may create or edit only this file:
|
|
6
|
+
|
|
7
|
+
```txt
|
|
8
|
+
docs/PROJECT_MAP.md
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Do not edit source code, config files, prompts, skills, themes, or extensions.
|
|
12
|
+
|
|
13
|
+
## Goal
|
|
14
|
+
|
|
15
|
+
Generate a useful project map so future agent sessions know which files to inspect for common tasks.
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
1. Read existing project guidance:
|
|
20
|
+
- `AGENTS.md`
|
|
21
|
+
- `README.md`
|
|
22
|
+
- `package.json`
|
|
23
|
+
- existing `docs/PROJECT_MAP.md` if it exists
|
|
24
|
+
|
|
25
|
+
2. Inspect the repository structure:
|
|
26
|
+
- top-level files
|
|
27
|
+
- `extensions/`
|
|
28
|
+
- `prompts/`
|
|
29
|
+
- `skills/`
|
|
30
|
+
- `themes/`
|
|
31
|
+
- `docs/`
|
|
32
|
+
- config files
|
|
33
|
+
- test files
|
|
34
|
+
|
|
35
|
+
3. Identify important files and responsibilities.
|
|
36
|
+
|
|
37
|
+
4. Create or update:
|
|
38
|
+
|
|
39
|
+
```txt
|
|
40
|
+
docs/PROJECT_MAP.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
5. Keep the map practical and easy to scan.
|
|
44
|
+
|
|
45
|
+
## Output file structure
|
|
46
|
+
|
|
47
|
+
Write `docs/PROJECT_MAP.md` using this structure:
|
|
48
|
+
|
|
49
|
+
```md
|
|
50
|
+
# Project Map
|
|
51
|
+
|
|
52
|
+
## Purpose
|
|
53
|
+
|
|
54
|
+
Short explanation of what this repository does.
|
|
55
|
+
|
|
56
|
+
## Important Files
|
|
57
|
+
|
|
58
|
+
List important root files and what they are for.
|
|
59
|
+
|
|
60
|
+
## Directory Map
|
|
61
|
+
|
|
62
|
+
Explain each important directory.
|
|
63
|
+
|
|
64
|
+
## Extension Map
|
|
65
|
+
|
|
66
|
+
For each extension, explain:
|
|
67
|
+
|
|
68
|
+
- file path
|
|
69
|
+
- slash commands added, if any
|
|
70
|
+
- UI/status changes, if any
|
|
71
|
+
- safety behavior, if any
|
|
72
|
+
- when to edit this file
|
|
73
|
+
|
|
74
|
+
## Prompt Map
|
|
75
|
+
|
|
76
|
+
For each prompt, explain:
|
|
77
|
+
|
|
78
|
+
- slash command
|
|
79
|
+
- file path
|
|
80
|
+
- purpose
|
|
81
|
+
- when to use it
|
|
82
|
+
|
|
83
|
+
## Skill Map
|
|
84
|
+
|
|
85
|
+
For each skill, explain:
|
|
86
|
+
|
|
87
|
+
- skill name
|
|
88
|
+
- file path
|
|
89
|
+
- purpose
|
|
90
|
+
- when it should activate
|
|
91
|
+
|
|
92
|
+
## Theme Map
|
|
93
|
+
|
|
94
|
+
List available themes and where they live.
|
|
95
|
+
|
|
96
|
+
## Common Tasks
|
|
97
|
+
|
|
98
|
+
For each common task, list which files to read first.
|
|
99
|
+
|
|
100
|
+
Examples:
|
|
101
|
+
|
|
102
|
+
### Change branding/UI
|
|
103
|
+
|
|
104
|
+
Read:
|
|
105
|
+
|
|
106
|
+
- `extensions/brand-ui.ts`
|
|
107
|
+
- `themes/`
|
|
108
|
+
|
|
109
|
+
### Change update behavior
|
|
110
|
+
|
|
111
|
+
Read:
|
|
112
|
+
|
|
113
|
+
- `extensions/update.ts`
|
|
114
|
+
|
|
115
|
+
### Change safety behavior
|
|
116
|
+
|
|
117
|
+
Read:
|
|
118
|
+
|
|
119
|
+
- `extensions/safety.ts`
|
|
120
|
+
- `extensions/git-guard.ts`
|
|
121
|
+
|
|
122
|
+
### Change footer/status
|
|
123
|
+
|
|
124
|
+
Read:
|
|
125
|
+
|
|
126
|
+
- `extensions/status.ts`
|
|
127
|
+
- `extensions/usage-tracker.ts`
|
|
128
|
+
|
|
129
|
+
### Change prompt workflows
|
|
130
|
+
|
|
131
|
+
Read:
|
|
132
|
+
|
|
133
|
+
- `extensions/prompts.ts`
|
|
134
|
+
- `prompts/`
|
|
135
|
+
|
|
136
|
+
## Common Commands
|
|
137
|
+
|
|
138
|
+
List useful commands for development, testing, install, update, and reload.
|
|
139
|
+
|
|
140
|
+
## Safety Notes
|
|
141
|
+
|
|
142
|
+
List files and commands that should be handled carefully.
|
|
143
|
+
|
|
144
|
+
## Agent Rules
|
|
145
|
+
|
|
146
|
+
Add repo-specific rules future agents should follow.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Rules
|
|
150
|
+
|
|
151
|
+
- Be specific.
|
|
152
|
+
- Prefer file paths over vague descriptions.
|
|
153
|
+
- Do not guess if a file was not inspected.
|
|
154
|
+
- If something is unclear, add it under `Open Questions`.
|
|
155
|
+
- Do not modify anything except `docs/PROJECT_MAP.md`.
|
|
156
|
+
|
|
157
|
+
## Final response
|
|
158
|
+
|
|
159
|
+
After writing the file, summarize:
|
|
160
|
+
|
|
161
|
+
- whether the file was created or updated
|
|
162
|
+
- important sections added
|
|
163
|
+
- any open questions
|