From 7db0d3d78168576e5b122c5ea86958971223442a Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 19 Oct 2026 09:11:13 +0300 Subject: [PATCH] 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) --- .pi/gg/APPEND_SYSTEM.md | 6 ++++++ .pi/gg/SYSTEM.md | 44 ----------------------------------------- scripts/pr2wt.sh | 7 ------- scripts/wc2wt.sh | 7 ------- 4 files changed, 6 insertions(+), 58 deletions(-) create mode 100644 .pi/gg/APPEND_SYSTEM.md delete mode 100644 .pi/gg/SYSTEM.md diff --git a/.pi/gg/APPEND_SYSTEM.md b/.pi/gg/APPEND_SYSTEM.md new file mode 100644 index 000000000..dd79897e3 --- /dev/null +++ b/.pi/gg/APPEND_SYSTEM.md @@ -0,0 +1,6 @@ + +Project-specific instructions: + +## Coding + +- In `test-backend-ops.cpp`, do not mention specific backends (e.g. Metal, CUDA) in comments diff --git a/.pi/gg/SYSTEM.md b/.pi/gg/SYSTEM.md deleted file mode 100644 index 927224fbf..000000000 --- a/.pi/gg/SYSTEM.md +++ /dev/null @@ -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: ` : `. 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 diff --git a/scripts/pr2wt.sh b/scripts/pr2wt.sh index ce0327ead..31d5f4599 100755 --- a/scripts/pr2wt.sh +++ b/scripts/pr2wt.sh @@ -72,19 +72,12 @@ dir=$(basename $(pwd)) git branch -D pr/$PR 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) echo "git worktree created in $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 pull --ff-only || { echo "error: failed to pull pr/$PR" diff --git a/scripts/wc2wt.sh b/scripts/wc2wt.sh index b6e92f869..5944ea93a 100755 --- a/scripts/wc2wt.sh +++ b/scripts/wc2wt.sh @@ -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 -og_path=$(pwd) wt_path=$(cd "../$dir-$dir_suffix" && pwd) echo "git worktree created in $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 echo "executing: $2" eval "$2"