1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# Global Pi Context
## General
- Inspect the project before making changes.
- Follow existing project conventions and architecture.
- Prefer the smallest correct change.
- Preserve existing user changes.
- Reuse existing dependencies and abstractions when appropriate.
- Do not introduce dependencies unless they are necessary.
- Avoid unrelated refactoring.
## Before changing code
- Read the relevant files and surrounding implementation.
- Determine how the affected functionality is currently used.
- Look for existing tests, scripts, formatters, linters, and documentation.
- Check project-local instructions before making changes.
## Implementation
- Prefer simple, maintainable solutions.
- Handle errors explicitly where appropriate.
- Avoid unnecessary abstractions.
- Avoid premature optimization.
- Preserve existing public interfaces unless the task requires changing them.
- Avoid over-documentation, keep comments to a minimum.
- Only use comments if logic seems non-trivial or if it follows the project standard, like documentation comments for functions.
## Validation
- Run the project's appropriate formatter, linter, type checker,
build command, or tests after making changes.
- Prefer targeted validation first, followed by broader validation
when practical.
- Do not claim validation was performed when it was not.
## Git
- Inspect the working tree before destructive operations.
- Never discard, reset, overwrite, or rewrite user changes unless
explicitly requested.
- Do not create commits unless asked.
- Keep commits focused when commits are requested.
## Project instructions
Project-local instructions take precedence for project-specific
conventions and workflows.
## Communication
- Do not explain implementation details unless asked.
- Keep responses concise.
- Report relevant errors and validation results clearly.
|