Skip to content

Commit 2a839e5

Browse files
authored
Merge pull request #5206 from ag-grid/ajt/fix-gemini-prompt-config
Fix Gemini /docs-review prompt.
2 parents cc6f9d5 + 4b41d85 commit 2a839e5

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ vitest.config.*.timestamp*
6868
/.github/prompts/
6969
/.github/instructions/
7070
/.mcp.json
71+
/.vscode/mcp.json
7172
.tmp

tools/prompts/AGENTS.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AG Charts is a sophisticated TypeScript monorepo providing canvas-based JavaScri
88

99
## Technology Stack
1010

11-
For detailed information about preferred technologies and architectural constraints, see [`tools/prompts/technology-stack.md`](tools/prompts/technology-stack.md).
11+
For detailed information about preferred technologies and architectural constraints, see [Technology Stack](tools/prompts/technology-stack.md).
1212

1313
**Key Constraint:** The main AG Charts libraries must have ZERO third-party runtime dependencies.
1414

@@ -46,6 +46,15 @@ nx benchmark <package> # Performance benchmarks
4646
nx lint <package> # ESLint + custom rules
4747
```
4848

49+
## Slash Commands
50+
51+
NOTE: These are only intended for agentic tools that don't support custom slash commands, such as Cursor or Codex.
52+
53+
- `/spruce-example` - execute `tools/prompts/commands/spruce-example.md` on specified example.
54+
- `/pr-review` - execute `tools/prompts/commands/pr-review.md` on specified PR.
55+
- `/release-options-review` - execute `tools/prompts/commands/release-options-review.md` on specified release options.
56+
- `/docs-review` - execute `tools/prompts/commands/docs-review.md` on specified docs.
57+
4958
## Architecture
5059

5160
### Monorepo Structure
@@ -225,3 +234,11 @@ nx e2e ag-charts-website
225234
- For typechecking docs examples run: `nx run ag-charts-website-${pageName}_${exampleName}_main.ts:typecheck`
226235
- For all examples also run: `nx validate-examples` (NOTE: This does a batch `typecheck` which is VERY fast compared to running individual `typecheck` targets).
227236
- For adhoc examples to quickly test things or `-test` pages, adding `// @ag-skip-fws` to `main.ts` will disable framework (React, Angylar, Vue) variant generation.
237+
238+
## Releases
239+
240+
- Releases are typically monthly for minor releases, and 6-monthly for major releases (typically in June and December).
241+
- Patch releases are typically only for critical bug fixes, at most weekly.
242+
- Minor releases cannot have breaking changes, we must hold these back for major releases.
243+
- Deprecations are allowed, but must be clearly marked as deprecated and still work as before.
244+
- Deprecated features/options are typically immediately removed from public website documentation to discourage use.

tools/prompts/commands/docs-review.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ Then: **ADAPTIVE MODE** - Allow degraded operation with user confirmation.
2929
When running in orchestrated mode, ALL tools are REQUIRED:
3030

3131
1. **MCP Puppeteer** - REQUIRED, no fallback
32-
- Must be available via `ListMcpResourcesTool`
33-
- Test with `mcp__puppeteer__puppeteer_navigate` and `mcp__puppeteer__puppeteer_screenshot`
32+
- There tools must be available for testing `puppeteer_navigate` and `puppeteer_screenshot`
3433
2. **Task tool** - REQUIRED for example-tester delegation
3534
3. **Read/Write tools** - REQUIRED
3635

tools/setup-prompts.sh

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,46 @@ function setup_instructions() {
9898
function setup_mcp() {
9999
local target_file=$1
100100

101-
ln -sf "./tools/prompts/.mcp.json" "$target_file"
101+
# Calculate the relative path from target_file to the MCP config
102+
local target_dir=$(dirname "$target_file")
103+
104+
# Count directory levels in target_file path
105+
local dir_count=$(echo "$target_file" | tr -cd '/' | wc -c)
106+
107+
# Build relative path with appropriate number of ../ prefixes
108+
local relative_path="./"
109+
for ((i=0; i<dir_count; i++)); do
110+
relative_path="$relative_path../"
111+
done
112+
113+
# Create symlink with calculated relative path
114+
ln -sf "${relative_path}tools/prompts/.mcp.json" "$target_file"
115+
}
116+
117+
function setup_vscode_mcp() {
118+
local target_file=$1
119+
local mcp_json_file="./tools/prompts/.mcp.json"
120+
121+
# Check if jq is available
122+
if ! command -v jq >/dev/null 2>&1; then
123+
echo "Warning: jq not found. Cannot update MCP config."
124+
echo "Install with: brew install jq"
125+
return 1
126+
fi
127+
128+
# Check if source JSON file exists
129+
if [[ ! -f "$target_file" ]]; then
130+
mkdir -p $(dirname "$target_file")
131+
echo '{"servers": {}}' > "$target_file"
132+
fi
133+
134+
# Add each MCP server from JSON to the target JSON file by reading and then editing the file in place
135+
jq -r '.mcpServers | to_entries[] | @base64' "$mcp_json_file" | while read -r entry; do
136+
local server_name=$(echo "$entry" | base64 -d | jq -r '.key')
137+
local server_config=$(echo "$entry" | base64 -d | jq -r '.value')
138+
jq --argjson server_config "$server_config" ".servers += { (\"$server_name\"): \$server_config }" "$target_file" > "$target_file.tmp"
139+
mv "$target_file.tmp" "$target_file"
140+
done
102141
}
103142

104143
function setup_codex_mcp() {
@@ -248,6 +287,7 @@ fi
248287

249288
# Copilot setup - not sure if there is a better way to detect?
250289
if [[ "${TERM_PROGRAM:-}" == "vscode" ]]; then
290+
setup_vscode_mcp .vscode/mcp.json
251291
setup_instructions AGENTS.md
252292
mkdir -p .github/prompts
253293
for prompt in pr-review.md release-options-review.md docs-review.md spruce-example.md; do

0 commit comments

Comments
 (0)