init repo
This commit is contained in:
15
ai/prompts/fix.md
Normal file
15
ai/prompts/fix.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Task type: bug fixing
|
||||
|
||||
Read:
|
||||
- AGENTS.md
|
||||
- docs/ai/bevy-debug-playbook.md
|
||||
- ai/context/project-context.md
|
||||
|
||||
Then:
|
||||
- restate bug
|
||||
- list top 3 likely root causes
|
||||
- point to exact file/section likely involved
|
||||
- propose smallest fix first
|
||||
- show verify commands
|
||||
- if evidence weak, say what to inspect next
|
||||
- keep Bevy 0.18.1 APIs only
|
||||
16
ai/prompts/plan.md
Normal file
16
ai/prompts/plan.md
Normal file
@@ -0,0 +1,16 @@
|
||||
Task type: feature planning
|
||||
|
||||
Read:
|
||||
- AGENTS.md
|
||||
- docs/ai/bevy-quick-reference.md
|
||||
- docs/ai/bevy-project-patterns.md
|
||||
- ai/context/project-context.md
|
||||
|
||||
Then:
|
||||
- summarize current architecture
|
||||
- propose smallest next milestone
|
||||
- list files to add/edit
|
||||
- sketch ECS design: components, resources, events, states, plugins
|
||||
- give ordered patch steps
|
||||
- give verify commands
|
||||
- keep Bevy 0.18.1 APIs only
|
||||
16
ai/prompts/review.md
Normal file
16
ai/prompts/review.md
Normal file
@@ -0,0 +1,16 @@
|
||||
Task type: architecture review
|
||||
|
||||
Read:
|
||||
- AGENTS.md
|
||||
- docs/ai/bevy-quick-reference.md
|
||||
- docs/ai/bevy-project-patterns.md
|
||||
- ai/context/project-context.md
|
||||
|
||||
Then:
|
||||
- identify top 3 strengths
|
||||
- identify top 5 risks
|
||||
- call out ECS smells
|
||||
- suggest plugin split
|
||||
- suggest resources/events/states to add or remove
|
||||
- keep advice concrete and patchable
|
||||
- keep Bevy 0.18.1 APIs only
|
||||
68
ai/scripts/build-context.sh
Executable file
68
ai/scripts/build-context.sh
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
mkdir -p ai/context
|
||||
|
||||
OUT="ai/context/project-context.md"
|
||||
|
||||
{
|
||||
echo "# Project Context"
|
||||
echo
|
||||
echo "Generated: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
echo
|
||||
echo "## Repo Tree"
|
||||
echo
|
||||
echo '```text'
|
||||
if command -v tree >/dev/null 2>&1; then
|
||||
tree -a -I target -I .git
|
||||
else
|
||||
echo "[tree not installed, showing file list fallback]"
|
||||
fd -t f . src docs ai .cargo -E ai/context -E target | sort
|
||||
fi
|
||||
echo '```'
|
||||
echo
|
||||
echo "## Cargo.toml"
|
||||
echo
|
||||
echo '```toml'
|
||||
cat Cargo.toml
|
||||
echo '```'
|
||||
echo
|
||||
echo "## AGENTS.md"
|
||||
echo
|
||||
cat AGENTS.md
|
||||
echo
|
||||
echo "## Source Files"
|
||||
echo
|
||||
while IFS= read -r file; do
|
||||
echo "### ${file}"
|
||||
echo
|
||||
case "${file}" in
|
||||
*.rs)
|
||||
echo '```rust'
|
||||
cat "${file}"
|
||||
echo '```'
|
||||
;;
|
||||
*.toml)
|
||||
echo '```toml'
|
||||
cat "${file}"
|
||||
echo '```'
|
||||
;;
|
||||
*.md)
|
||||
cat "${file}"
|
||||
;;
|
||||
*)
|
||||
echo '```text'
|
||||
cat "${file}"
|
||||
echo '```'
|
||||
;;
|
||||
esac
|
||||
echo
|
||||
done < <(fd -t f . src docs ai .cargo -E ai/context -E target | sort)
|
||||
echo "## TODO / FIXME / HACK"
|
||||
echo
|
||||
echo '```text'
|
||||
rg -n "TODO|FIXME|HACK|BUG" . --glob '!target/**' --glob '!ai/context/**' || true
|
||||
echo '```'
|
||||
} > "${OUT}"
|
||||
|
||||
echo "Wrote ${OUT}"
|
||||
18
ai/scripts/llama-chat.sh
Executable file
18
ai/scripts/llama-chat.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
MODEL="${LLAMA_MODEL:-}"
|
||||
if [ -z "${MODEL}" ]; then
|
||||
echo "error: LLAMA_MODEL not set"
|
||||
echo "export LLAMA_MODEL=/absolute/path/to/model.gguf"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./ai/scripts/build-context.sh >/dev/null
|
||||
|
||||
exec llama-cli \
|
||||
-m "${MODEL}" \
|
||||
-sysf ai/system-prompt.md \
|
||||
-f ai/context/project-context.md \
|
||||
-cnv \
|
||||
-mli
|
||||
47
ai/scripts/llama-task.sh
Executable file
47
ai/scripts/llama-task.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
MODE="${1:-}"
|
||||
TASK="${2:-}"
|
||||
|
||||
if [ -z "${MODE}" ] || [ -z "${TASK}" ]; then
|
||||
echo "usage: $0 <plan|fix|review> <task text>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MODEL="${LLAMA_MODEL:-}"
|
||||
if [ -z "${MODEL}" ]; then
|
||||
echo "error: LLAMA_MODEL not set"
|
||||
echo "export LLAMA_MODEL=/absolute/path/to/model.gguf"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${MODE}" in
|
||||
plan|fix|review) ;;
|
||||
*)
|
||||
echo "error: mode must be one of: plan fix review"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
./ai/scripts/build-context.sh >/dev/null
|
||||
|
||||
TMP="$(mktemp)"
|
||||
trap 'rm -f "$TMP"' EXIT
|
||||
|
||||
{
|
||||
cat "ai/prompts/${MODE}.md"
|
||||
echo
|
||||
echo "User task:"
|
||||
echo "${TASK}"
|
||||
echo
|
||||
echo "Project context follows:"
|
||||
echo
|
||||
cat ai/context/project-context.md
|
||||
} > "${TMP}"
|
||||
|
||||
exec llama-cli \
|
||||
-m "${MODEL}" \
|
||||
-sysf ai/system-prompt.md \
|
||||
-f "${TMP}" \
|
||||
-st
|
||||
34
ai/system-prompt.md
Normal file
34
ai/system-prompt.md
Normal file
@@ -0,0 +1,34 @@
|
||||
You are local game-dev copilot for Rust + Bevy project.
|
||||
|
||||
Goals:
|
||||
- help build small playable games fast
|
||||
- preserve clean ECS design
|
||||
- keep answers grounded in repo files and local docs
|
||||
- prefer smallest safe next step
|
||||
|
||||
Project facts:
|
||||
- Rust 1.95.0
|
||||
- Bevy 0.18.1
|
||||
- workshop setting
|
||||
- 2D-first scope
|
||||
- assets in ./assets
|
||||
- GIMP exists on host, not in Nix shell
|
||||
|
||||
Behavior:
|
||||
- read project context first if present
|
||||
- propose small diffs
|
||||
- prefer Bevy built-ins before new crates
|
||||
- keep main.rs thin
|
||||
- suggest plugins, resources, events, states when code grows
|
||||
- quote exact commands to run
|
||||
- when fixing bug: identify likely root cause, not symptoms only
|
||||
- when unsure: state uncertainty and list what file or example to inspect next
|
||||
- never invent Bevy APIs
|
||||
- do not upgrade dependencies unless asked
|
||||
|
||||
Response format:
|
||||
1. Goal
|
||||
2. Plan
|
||||
3. Patch sketch
|
||||
4. Verify commands
|
||||
5. Risks
|
||||
Reference in New Issue
Block a user