Skip to content

docs: add GitHub Spark prompt and tools#441

Open
cuyua9 wants to merge 1 commit into
x1xhlol:mainfrom
cuyua9:docs/github-spark-prompt-cuyua9
Open

docs: add GitHub Spark prompt and tools#441
cuyua9 wants to merge 1 commit into
x1xhlol:mainfrom
cuyua9:docs/github-spark-prompt-cuyua9

Conversation

@cuyua9
Copy link
Copy Markdown

@cuyua9 cuyua9 commented May 8, 2026

Summary

  • add a GitHub Spark/ directory for issue Add Github Spark system prompt and tools #357
  • include the Spark system prompt from the cited documentation page
  • add a structured Tools.json for the Spark tool surface, with the raw tools block preserved for provenance
  • add a short README pointing back to the source docs and issue

Closes #357.

Source

Validation

  • python3 -m json.tool 'GitHub Spark/Tools.json'
  • git diff --check -- 'GitHub Spark'

Summary by CodeRabbit

  • Documentation

    • Added GitHub Spark directory documentation detailing included resources.
  • Chores

    • Configured GitHub Spark system prompts and tool definitions for supported operations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Walkthrough

This 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).

Changes

GitHub Spark System Prompt and Tools Documentation

Layer / File(s) Summary
Directory Overview
GitHub Spark/README.md
README documents the directory purpose, references issue #357, lists System Prompt.txt and Tools.json, and notes content sourcing.
System Prompt: Execution Workflow and Communication
GitHub Spark/System Prompt.txt (lines 1–46)
Establishes Spark execution workflow (search tools, full implementation, minimal boilerplate) and response constraints (≤2 sentences, streamed UI).
System Prompt: Design and Product Philosophy
GitHub Spark/System Prompt.txt (lines 46–191)
Documents UI design philosophy: typography excellence, color theory, spatial layout, and interaction/motion principles.
System Prompt: Project Setup and Codebase Rules
GitHub Spark/System Prompt.txt (lines 193–287)
Specifies project constraints (React/Vite, protected files, directory boundaries), coding standards (element IDs, imports, useKV persistence).
System Prompt: Runtime API and Capabilities
GitHub Spark/System Prompt.txt (lines 287–434)
Documents Spark runtime API: spark.llmPrompt, spark.llm (with JSON mode), spark.kv operations, spark.user() access, and usage patterns.
System Prompt: Theme Implementation and Output Process
GitHub Spark/System Prompt.txt (lines 435–663)
Defines theme constraints (CSS variables, Tailwind mapping), requires PRD-first process (./src/prd.md), and enforces "return DONE" final instruction.
Tools Registry and Definitions
GitHub Spark/Tools.json
Defines four tools (str_replace_editor, npm, bash, create_suggestions) with metadata, parameter schemas, and raw_tools_prompt documenting function_calls invocation format.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Sparks now glow with purpose bright,
System prompts guiding every site,
Tools registry neat and complete,
GitHub's framework, docs so sweet!
bounces

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: add GitHub Spark prompt and tools' directly and concisely summarizes the main change: adding documentation files for GitHub Spark's system prompt and tools.
Linked Issues check ✅ Passed The PR fulfills issue #357 by adding the GitHub Spark system prompt and tools documentation from the referenced source, including System Prompt.txt, Tools.json, and a README.
Out of Scope Changes check ✅ Passed All changes are in-scope: the new GitHub Spark directory with README.md, System Prompt.txt, and Tools.json directly address issue #357's requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
GitHub Spark/Tools.json (1)

11-87: ⚡ Quick win

Add explicit parameter types (and enums where applicable) to make tools[] reliably machine-consumable.

Right now consumers must infer types from prose. Adding type (and enum for constrained fields like command) 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

📥 Commits

Reviewing files that changed from the base of the PR and between e674816 and a6f7b99.

📒 Files selected for processing (3)
  • GitHub Spark/README.md
  • GitHub Spark/System Prompt.txt
  • GitHub Spark/Tools.json

Comment on lines +321 to +327
- 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)
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 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:


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Github Spark system prompt and tools

1 participant