docs: add GitHub Spark prompt and tools#441
Conversation
WalkthroughThis pull request adds the GitHub Spark system prompt and tool definitions from the referenced documentation. Three new files provide directory documentation (README), a comprehensive system prompt with execution workflow, design principles, technical constraints, runtime API, and process requirements (System Prompt.txt), and a tools registry with four callable tools and their parameter schemas (Tools.json). ChangesGitHub Spark System Prompt and Tools Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
GitHub Spark/Tools.json (1)
11-87: ⚡ Quick winAdd explicit parameter types (and enums where applicable) to make
tools[]reliably machine-consumable.Right now consumers must infer types from prose. Adding
type(andenumfor constrained fields likecommand) will make this structured index much more robust for validation/generation workflows.Proposed JSON shape adjustment (example)
"parameters": [ { "name": "command", + "type": "string", + "enum": ["view", "create", "str_replace", "insert", "undo_edit"], "required": true, "description": "The command to run: view, create, str_replace, insert, or undo_edit" }, { "name": "path", + "type": "string", "required": true, "description": "Absolute path to the file or directory" }, { "name": "insert_line", + "type": "number", "required": false, "description": "Required for 'insert' command, specifying the line number after which to insert" }, { "name": "view_range", + "type": "array", "required": false, "description": "Optional for 'view' command, specifies line range like [11, 12] or [start, -1] for end" } ]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@GitHub` Spark/Tools.json around lines 11 - 87, The tools[] entries (e.g., entries named "npm", "bash", "create_suggestions" and the file tool with parameters like command, path, file_text, old_str, new_str, insert_line, view_range) currently expose only prose descriptions; add explicit schema fields to each parameter: add "type" (string, integer, array, boolean, object) and where applicable add "enum" for constrained values (e.g., for the various "command" parameters enumerate allowed commands like ["view","create","str_replace","insert","undo_edit"] for the file tool and ["install","uninstall","update","list","view","search"] for "npm"); also specify required vs optional consistently (keep existing "required" boolean) and provide "items" types for array parameters (e.g., view_range: {"type":"array","items":{"type":"integer"}}) and type "integer" for insert_line; update create_suggestions.parameters.suggestions to {"type":"array","items":{"type":"string"},"minItems":3} so each tool is machine-consumable and validateable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@GitHub` Spark/System Prompt.txt:
- Around line 321-327: The code example passes an unsupported model string
("gpt-4") to spark.llm; update the example so it uses a supported model (e.g.,
"gpt-4o-mini") and keeps the jsonMode boolean usage intact (replace const
jsonResult = await spark.llm(prompt, "gpt-4", true) with the same call using
"gpt-4o-mini"), ensuring the documented supported models (gpt-4o, gpt-4o-mini)
and the spark.llm usage remain consistent.
---
Nitpick comments:
In `@GitHub` Spark/Tools.json:
- Around line 11-87: The tools[] entries (e.g., entries named "npm", "bash",
"create_suggestions" and the file tool with parameters like command, path,
file_text, old_str, new_str, insert_line, view_range) currently expose only
prose descriptions; add explicit schema fields to each parameter: add "type"
(string, integer, array, boolean, object) and where applicable add "enum" for
constrained values (e.g., for the various "command" parameters enumerate allowed
commands like ["view","create","str_replace","insert","undo_edit"] for the file
tool and ["install","uninstall","update","list","view","search"] for "npm");
also specify required vs optional consistently (keep existing "required"
boolean) and provide "items" types for array parameters (e.g., view_range:
{"type":"array","items":{"type":"integer"}}) and type "integer" for insert_line;
update create_suggestions.parameters.suggestions to
{"type":"array","items":{"type":"string"},"minItems":3} so each tool is
machine-consumable and validateable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 91c788c7-fb96-4603-987c-fcf08a28c1c1
📒 Files selected for processing (3)
GitHub Spark/README.mdGitHub Spark/System Prompt.txtGitHub Spark/Tools.json
| - You may specify one of the following models: gpt-4o (default), gpt-4o-mini | ||
| - If your prompt requires valid JSON as output, set jsonMode to true (default false) | ||
|
|
||
| ```typescript | ||
| const result = await spark.llm(prompt) | ||
| const jsonResult = await spark.llm(prompt, "gpt-4", true) | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
For GitHub Spark's spark.llm(prompt, modelName?, jsonMode?), which model names are currently supported in production (e.g., gpt-4o, gpt-4o-mini, gpt-4)?
💡 Result:
The currently supported model names for GitHub Spark's spark.llm(prompt, modelName?, jsonMode?) in production are "gpt-4o" and "gpt-4o-mini". A reverse-engineered analysis of the Spark playground confirms that only these two models are supported, executed through Azure OpenAI.[1] Official GitHub documentation does not list specific model names but notes integration with GitHub Models, which includes OpenAI models like gpt-4o.[2][3][4] GPT-4 is not currently supported, though hoped for in future updates.[1] As of 2025-07 (latest direct evidence), no changes to this list were found in more recent sources.
Citations:
- 1: https://simonw.substack.com/p/using-github-spark-to-reverse-engineer
- 2: https://docs.github.com/en/copilot/concepts/spark
- 3: https://patch-diff.githubusercontent.com/features/models
- 4: https://docs.github.com/en/github-models/github-models-at-scale/use-models-at-scale
Code example uses unsupported model: use gpt-4o-mini instead of gpt-4.
Line 321 documents supported models as gpt-4o and gpt-4o-mini, but the code example on line 326 uses "gpt-4", which is not supported by GitHub Spark. This will cause the example to fail at runtime.
Proposed fix
-const jsonResult = await spark.llm(prompt, "gpt-4", true)
+const jsonResult = await spark.llm(prompt, "gpt-4o-mini", true)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@GitHub` Spark/System Prompt.txt around lines 321 - 327, The code example
passes an unsupported model string ("gpt-4") to spark.llm; update the example so
it uses a supported model (e.g., "gpt-4o-mini") and keeps the jsonMode boolean
usage intact (replace const jsonResult = await spark.llm(prompt, "gpt-4", true)
with the same call using "gpt-4o-mini"), ensuring the documented supported
models (gpt-4o, gpt-4o-mini) and the spark.llm usage remain consistent.
Summary
GitHub Spark/directory for issue Add Github Spark system prompt and tools #357Tools.jsonfor the Spark tool surface, with the raw tools block preserved for provenanceCloses #357.
Source
Validation
python3 -m json.tool 'GitHub Spark/Tools.json'git diff --check -- 'GitHub Spark'Summary by CodeRabbit
Documentation
Chores