pi : turn .pi/gg into a system prompt addendum (#30762)
.pi/gg/SYSTEM.md repeated the full agent ruleset. Move it to .pi/gg/APPEND_SYSTEM.md and keep only the llama.cpp-specific rules, so it can be appended to a main system prompt with --append-system-prompt. Drop the .pi/SYSTEM.md symlink setup from wc2wt.sh and pr2wt.sh. Worktrees no longer need it now that the folder holds an addendum instead of a full prompt. Assisted-by: pi:llama.cpp/ggml-org/Qwen3.8-Flash-Next-GGUF (RTX 5090 32GB, DDR5 128GB)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
Project-specific instructions:
|
||||||
|
|
||||||
|
## Coding
|
||||||
|
|
||||||
|
- In `test-backend-ops.cpp`, do not mention specific backends (e.g. Metal, CUDA) in comments
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
You are a coding agent. Here are some very important rules that you must follow:
|
|
||||||
|
|
||||||
General:
|
|
||||||
- Be very precise and concise when writing code, comments, explanations, etc.
|
|
||||||
- If an inline comment exceeds 2 lines, replace it with: `// note: TODO LATER`
|
|
||||||
- PR and commit titles format: `<module> : <title>`. Lookup recents for examples
|
|
||||||
- Don't try to build or run the code unless you are explicitly asked to do so
|
|
||||||
- Use the `gh` CLI tool when querying PRs, issues, or other GitHub resources
|
|
||||||
- When a model name is needed, first try to get it from the `PI_MODEL_NAME` env var before asking the user
|
|
||||||
- When a hardware description is needed, first try to get it from the `PI_HARDWARE` env var before asking the user
|
|
||||||
- Never read the `AGENTS.md` file
|
|
||||||
|
|
||||||
Coding:
|
|
||||||
- Never write inline comments in the code unless the user tells you to
|
|
||||||
- When in doubt, always refer to the CONTRIBUTING.md file of the project
|
|
||||||
- In `test-backend-ops.cpp`, do not mention specific backends (e.g. Metal, CUDA) in comments
|
|
||||||
- When referencing issues or PRs in comments, use the format:
|
|
||||||
- C/C++ code: `// ref: <url>`
|
|
||||||
- Other (CMake, etc.): `# ref: <url>`
|
|
||||||
|
|
||||||
Pull requests (PRs):
|
|
||||||
- New branch names are prefixed with "gg/"
|
|
||||||
- Before opening a pull request, ask the user to confirm the description
|
|
||||||
- Don't explicitly wrap lines in the PR description (each paragraph and bullet is a single line)
|
|
||||||
- When creating a pull request, look for the repository's PR template and follow it
|
|
||||||
- For the AI usage disclosure section, write "YES", then these 4 bullets:
|
|
||||||
- Harness: `pi:llama.cpp`
|
|
||||||
- Hardware: `<hardware>`
|
|
||||||
- Model: `<model>`, linked to its Hugging Face page - the link text is the plain model name
|
|
||||||
- Stats: `<stats>`
|
|
||||||
- Run `~/.pi/stats.sh "$PI_SESSION_FILE"` to get `<stats>` and write it as
|
|
||||||
`◷ <time> · ↑ <input tokens> · ↓ <output tokens> · ≡ <messages> · ⌨ <user messages>`,
|
|
||||||
e.g. `◷ 12.3m · ↑ 120k · ↓ 45k · ≡ 87 · ⌨ 6`
|
|
||||||
- Write these symbols as literal unicode in the PR description, never `:shortcodes:`, and keep
|
|
||||||
commit trailers ASCII
|
|
||||||
- If `PI_MODEL_NAME` or `PI_HARDWARE` is not set, ask the user and use their answer for `<model>` or `<hardware>`
|
|
||||||
- Always create the pull requests in draft mode
|
|
||||||
- Never reply to review comments or post comments on issues/PRs without explicit permission from the user
|
|
||||||
|
|
||||||
Commits:
|
|
||||||
- On every commit that you make, include an `Assisted-by: pi:llama.cpp/<model> (<hardware>)` tag
|
|
||||||
- Do not explicitly set the git author in commits - rely on the default git config
|
|
||||||
- Always use `--no-gpg-sign` when committing
|
|
||||||
- Never `git push` without explicit confirmation from the user
|
|
||||||
@@ -72,19 +72,12 @@ dir=$(basename $(pwd))
|
|||||||
git branch -D pr/$PR 2> /dev/null
|
git branch -D pr/$PR 2> /dev/null
|
||||||
git worktree add -b pr/$PR ../$dir-pr-$PR pr/$PR/$head_ref 2> /dev/null
|
git worktree add -b pr/$PR ../$dir-pr-$PR pr/$PR/$head_ref 2> /dev/null
|
||||||
|
|
||||||
og_path=$(pwd)
|
|
||||||
wt_path=$(cd ../$dir-pr-$PR && pwd)
|
wt_path=$(cd ../$dir-pr-$PR && pwd)
|
||||||
|
|
||||||
echo "git worktree created in $wt_path"
|
echo "git worktree created in $wt_path"
|
||||||
|
|
||||||
cd $wt_path
|
cd $wt_path
|
||||||
|
|
||||||
# pi agent setup in the worktree
|
|
||||||
if [[ -f "$og_path/.pi/SYSTEM.md" && ! -f ".pi/SYSTEM.md" ]]; then
|
|
||||||
mkdir -p .pi
|
|
||||||
ln -sfn "$og_path/.pi/SYSTEM.md" .pi/SYSTEM.md
|
|
||||||
fi
|
|
||||||
|
|
||||||
git branch --set-upstream-to=pr/$PR/$head_ref
|
git branch --set-upstream-to=pr/$PR/$head_ref
|
||||||
git pull --ff-only || {
|
git pull --ff-only || {
|
||||||
echo "error: failed to pull pr/$PR"
|
echo "error: failed to pull pr/$PR"
|
||||||
|
|||||||
@@ -39,19 +39,12 @@ dir_suffix=$(echo "$BRANCH" | tr '/' '-')
|
|||||||
|
|
||||||
git worktree add "../$dir-$dir_suffix" "$BRANCH" || git worktree add -b "$BRANCH" "../$dir-$dir_suffix" HEAD
|
git worktree add "../$dir-$dir_suffix" "$BRANCH" || git worktree add -b "$BRANCH" "../$dir-$dir_suffix" HEAD
|
||||||
|
|
||||||
og_path=$(pwd)
|
|
||||||
wt_path=$(cd "../$dir-$dir_suffix" && pwd)
|
wt_path=$(cd "../$dir-$dir_suffix" && pwd)
|
||||||
|
|
||||||
echo "git worktree created in $wt_path"
|
echo "git worktree created in $wt_path"
|
||||||
|
|
||||||
cd "$wt_path"
|
cd "$wt_path"
|
||||||
|
|
||||||
# pi agent setup in the worktree
|
|
||||||
if [[ -f "$og_path/.pi/SYSTEM.md" && ! -f ".pi/SYSTEM.md" ]]; then
|
|
||||||
mkdir -p .pi
|
|
||||||
ln -sfn "$og_path/.pi/SYSTEM.md" .pi/SYSTEM.md
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $# -eq 2 ]]; then
|
if [[ $# -eq 2 ]]; then
|
||||||
echo "executing: $2"
|
echo "executing: $2"
|
||||||
eval "$2"
|
eval "$2"
|
||||||
|
|||||||
Reference in New Issue
Block a user