@bgicli/bgicli 2.2.8 → 2.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/data/skills/anthropic-algorithmic-art/SKILL.md +405 -0
  2. package/data/skills/anthropic-canvas-design/SKILL.md +130 -0
  3. package/data/skills/anthropic-claude-api/SKILL.md +243 -0
  4. package/data/skills/anthropic-doc-coauthoring/SKILL.md +375 -0
  5. package/data/skills/anthropic-docx/SKILL.md +590 -0
  6. package/data/skills/anthropic-frontend-design/SKILL.md +42 -0
  7. package/data/skills/anthropic-internal-comms/SKILL.md +32 -0
  8. package/data/skills/anthropic-mcp-builder/SKILL.md +236 -0
  9. package/data/skills/anthropic-pdf/SKILL.md +314 -0
  10. package/data/skills/anthropic-pptx/SKILL.md +232 -0
  11. package/data/skills/anthropic-skill-creator/SKILL.md +485 -0
  12. package/data/skills/anthropic-webapp-testing/SKILL.md +96 -0
  13. package/data/skills/anthropic-xlsx/SKILL.md +292 -0
  14. package/data/skills/arxiv-database/SKILL.md +362 -0
  15. package/data/skills/astropy/SKILL.md +329 -0
  16. package/data/skills/ctx-advanced-evaluation/SKILL.md +402 -0
  17. package/data/skills/ctx-bdi-mental-states/SKILL.md +311 -0
  18. package/data/skills/ctx-context-compression/SKILL.md +272 -0
  19. package/data/skills/ctx-context-degradation/SKILL.md +206 -0
  20. package/data/skills/ctx-context-fundamentals/SKILL.md +201 -0
  21. package/data/skills/ctx-context-optimization/SKILL.md +195 -0
  22. package/data/skills/ctx-evaluation/SKILL.md +251 -0
  23. package/data/skills/ctx-filesystem-context/SKILL.md +287 -0
  24. package/data/skills/ctx-hosted-agents/SKILL.md +260 -0
  25. package/data/skills/ctx-memory-systems/SKILL.md +225 -0
  26. package/data/skills/ctx-multi-agent-patterns/SKILL.md +257 -0
  27. package/data/skills/ctx-project-development/SKILL.md +291 -0
  28. package/data/skills/ctx-tool-design/SKILL.md +271 -0
  29. package/data/skills/dhdna-profiler/SKILL.md +162 -0
  30. package/data/skills/generate-image/SKILL.md +183 -0
  31. package/data/skills/geomaster/SKILL.md +365 -0
  32. package/data/skills/get-available-resources/SKILL.md +275 -0
  33. package/data/skills/hamelsmu-build-review-interface/SKILL.md +96 -0
  34. package/data/skills/hamelsmu-error-analysis/SKILL.md +164 -0
  35. package/data/skills/hamelsmu-eval-audit/SKILL.md +183 -0
  36. package/data/skills/hamelsmu-evaluate-rag/SKILL.md +177 -0
  37. package/data/skills/hamelsmu-generate-synthetic-data/SKILL.md +131 -0
  38. package/data/skills/hamelsmu-validate-evaluator/SKILL.md +212 -0
  39. package/data/skills/hamelsmu-write-judge-prompt/SKILL.md +144 -0
  40. package/data/skills/hf-cli/SKILL.md +174 -0
  41. package/data/skills/hf-mcp/SKILL.md +178 -0
  42. package/data/skills/hugging-face-dataset-viewer/SKILL.md +121 -0
  43. package/data/skills/hugging-face-datasets/SKILL.md +542 -0
  44. package/data/skills/hugging-face-evaluation/SKILL.md +651 -0
  45. package/data/skills/hugging-face-jobs/SKILL.md +1042 -0
  46. package/data/skills/hugging-face-model-trainer/SKILL.md +717 -0
  47. package/data/skills/hugging-face-paper-pages/SKILL.md +239 -0
  48. package/data/skills/hugging-face-paper-publisher/SKILL.md +624 -0
  49. package/data/skills/hugging-face-tool-builder/SKILL.md +110 -0
  50. package/data/skills/hugging-face-trackio/SKILL.md +115 -0
  51. package/data/skills/hugging-face-vision-trainer/SKILL.md +593 -0
  52. package/data/skills/huggingface-gradio/SKILL.md +245 -0
  53. package/data/skills/matlab/SKILL.md +376 -0
  54. package/data/skills/modal/SKILL.md +381 -0
  55. package/data/skills/openai-cloudflare-deploy/SKILL.md +224 -0
  56. package/data/skills/openai-develop-web-game/SKILL.md +149 -0
  57. package/data/skills/openai-doc/SKILL.md +80 -0
  58. package/data/skills/openai-figma/SKILL.md +42 -0
  59. package/data/skills/openai-figma-implement-design/SKILL.md +264 -0
  60. package/data/skills/openai-gh-address-comments/SKILL.md +25 -0
  61. package/data/skills/openai-gh-fix-ci/SKILL.md +69 -0
  62. package/data/skills/openai-imagegen/SKILL.md +174 -0
  63. package/data/skills/openai-jupyter-notebook/SKILL.md +107 -0
  64. package/data/skills/openai-linear/SKILL.md +87 -0
  65. package/data/skills/openai-netlify-deploy/SKILL.md +247 -0
  66. package/data/skills/openai-notion-knowledge-capture/SKILL.md +56 -0
  67. package/data/skills/openai-notion-meeting-intelligence/SKILL.md +60 -0
  68. package/data/skills/openai-notion-research-documentation/SKILL.md +59 -0
  69. package/data/skills/openai-notion-spec-to-implementation/SKILL.md +58 -0
  70. package/data/skills/openai-openai-docs/SKILL.md +69 -0
  71. package/data/skills/openai-pdf/SKILL.md +67 -0
  72. package/data/skills/openai-playwright/SKILL.md +147 -0
  73. package/data/skills/openai-render-deploy/SKILL.md +479 -0
  74. package/data/skills/openai-screenshot/SKILL.md +267 -0
  75. package/data/skills/openai-security-best-practices/SKILL.md +86 -0
  76. package/data/skills/openai-security-ownership-map/SKILL.md +206 -0
  77. package/data/skills/openai-security-threat-model/SKILL.md +81 -0
  78. package/data/skills/openai-sentry/SKILL.md +123 -0
  79. package/data/skills/openai-sora/SKILL.md +178 -0
  80. package/data/skills/openai-speech/SKILL.md +144 -0
  81. package/data/skills/openai-spreadsheet/SKILL.md +145 -0
  82. package/data/skills/openai-transcribe/SKILL.md +81 -0
  83. package/data/skills/openai-vercel-deploy/SKILL.md +77 -0
  84. package/data/skills/openai-yeet/SKILL.md +28 -0
  85. package/data/skills/pennylane/SKILL.md +224 -0
  86. package/data/skills/polars-bio/SKILL.md +374 -0
  87. package/data/skills/primekg/SKILL.md +97 -0
  88. package/data/skills/pymatgen/SKILL.md +689 -0
  89. package/data/skills/qiskit/SKILL.md +273 -0
  90. package/data/skills/qutip/SKILL.md +316 -0
  91. package/data/skills/recursive-decomposition/SKILL.md +185 -0
  92. package/data/skills/rowan/SKILL.md +427 -0
  93. package/data/skills/scholar-evaluation/SKILL.md +298 -0
  94. package/data/skills/sentry-create-alert/SKILL.md +210 -0
  95. package/data/skills/sentry-fix-issues/SKILL.md +126 -0
  96. package/data/skills/sentry-pr-code-review/SKILL.md +105 -0
  97. package/data/skills/sentry-python-sdk/SKILL.md +317 -0
  98. package/data/skills/sentry-setup-ai-monitoring/SKILL.md +217 -0
  99. package/data/skills/stable-baselines3/SKILL.md +297 -0
  100. package/data/skills/sympy/SKILL.md +498 -0
  101. package/data/skills/trailofbits-ask-questions-if-underspecified/SKILL.md +85 -0
  102. package/data/skills/trailofbits-audit-context-building/SKILL.md +302 -0
  103. package/data/skills/trailofbits-differential-review/SKILL.md +220 -0
  104. package/data/skills/trailofbits-insecure-defaults/SKILL.md +117 -0
  105. package/data/skills/trailofbits-modern-python/SKILL.md +333 -0
  106. package/data/skills/trailofbits-property-based-testing/SKILL.md +123 -0
  107. package/data/skills/trailofbits-semgrep-rule-creator/SKILL.md +172 -0
  108. package/data/skills/trailofbits-sharp-edges/SKILL.md +292 -0
  109. package/data/skills/trailofbits-variant-analysis/SKILL.md +142 -0
  110. package/data/skills/transformers.js/SKILL.md +637 -0
  111. package/data/skills/writing/SKILL.md +419 -0
  112. package/dist/bgi.js +66 -2
  113. package/package.json +1 -1
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: "develop-web-game"
3
+ description: "Use when Codex is building or iterating on a web game (HTML/JS) and needs a reliable development + testing loop: implement small changes, run a Playwright-based test script with short input bursts and intentional pauses, inspect screenshots/text, and review console errors with render_game_to_text."
4
+ ---
5
+
6
+
7
+ # Develop Web Game
8
+
9
+ Build games in small steps and validate every change. Treat each iteration as: implement → act → pause → observe → adjust.
10
+
11
+ ## Skill paths (set once)
12
+
13
+ ```bash
14
+ export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
15
+ export WEB_GAME_CLIENT="$CODEX_HOME/skills/develop-web-game/scripts/web_game_playwright_client.js"
16
+ export WEB_GAME_ACTIONS="$CODEX_HOME/skills/develop-web-game/references/action_payloads.json"
17
+ ```
18
+
19
+ User-scoped skills install under `$CODEX_HOME/skills` (default: `~/.codex/skills`).
20
+
21
+ ## Workflow
22
+
23
+ 1. **Pick a goal.** Define a single feature or behavior to implement.
24
+ 2. **Implement small.** Make the smallest change that moves the game forward.
25
+ 3. **Ensure integration points.** Provide a single canvas and `window.render_game_to_text` so the test loop can read state.
26
+ 4. **Add `window.advanceTime(ms)`.** Strongly prefer a deterministic step hook so the Playwright script can advance frames reliably; without it, automated tests can be flaky.
27
+ 5. **Initialize progress.md.** If `progress.md` exists, read it first and confirm the original user prompt is recorded at the top (prefix with `Original prompt:`). Also note any TODOs and suggestions left by the previous agent. If missing, create it and write `Original prompt: <prompt>` at the top before appending updates.
28
+ 6. **Verify Playwright availability.** Ensure `playwright` is available (local dependency or global install). If unsure, check `npx` first.
29
+ 7. **Run the Playwright test script.** You must run `$WEB_GAME_CLIENT` after each meaningful change; do not invent a new client unless required.
30
+ 8. **Use the payload reference.** Base actions on `$WEB_GAME_ACTIONS` to avoid guessing keys.
31
+ 9. **Inspect state.** Capture screenshots and text state after each burst.
32
+ 10. **Inspect screenshots.** Open the latest screenshot, verify expected visuals, fix any issues, and rerun the script. Repeat until correct.
33
+ 11. **Verify controls and state (multi-step focus).** Exhaustively exercise all important interactions. For each, think through the full multi-step sequence it implies (cause → intermediate states → outcome) and verify the entire chain works end-to-end. Confirm `render_game_to_text` reflects the same state shown on screen. If anything is off, fix and rerun.
34
+ Examples of important interactions: move, jump, shoot/attack, interact/use, select/confirm/cancel in menus, pause/resume, restart, and any special abilities or puzzle actions defined by the request. Multi-step examples: shooting an enemy should reduce its health; when health reaches 0 it should disappear and update the score; collecting a key should unlock a door and allow level progression.
35
+ 12. **Check errors.** Review console errors and fix the first new issue before continuing.
36
+ 13. **Reset between scenarios.** Avoid cross-test state when validating distinct features.
37
+ 14. **Iterate with small deltas.** Change one variable at a time (frames, inputs, timing, positions), then repeat steps 7–13 until stable.
38
+
39
+ Example command (actions required):
40
+ ```
41
+ node "$WEB_GAME_CLIENT" --url http://localhost:5173 --actions-file "$WEB_GAME_ACTIONS" --click-selector "#start-btn" --iterations 3 --pause-ms 250
42
+ ```
43
+
44
+ Example actions (inline JSON):
45
+ ```json
46
+ {
47
+ "steps": [
48
+ { "buttons": ["left_mouse_button"], "frames": 2, "mouse_x": 120, "mouse_y": 80 },
49
+ { "buttons": [], "frames": 6 },
50
+ { "buttons": ["right"], "frames": 8 },
51
+ { "buttons": ["space"], "frames": 4 }
52
+ ]
53
+ }
54
+ ```
55
+
56
+ ## Test Checklist
57
+
58
+ Test any new features added for the request and any areas your logic changes could affect. Identify issues, fix them, and re-run the tests to confirm they’re resolved.
59
+
60
+ Examples of things to test:
61
+ - Primary movement/interaction inputs (e.g., move, jump, shoot, confirm/select).
62
+ - Win/lose or success/fail transitions.
63
+ - Score/health/resource changes.
64
+ - Boundary conditions (collisions, walls, screen edges).
65
+ - Menu/pause/start flow if present.
66
+ - Any special actions tied to the request (powerups, combos, abilities, puzzles, timers).
67
+
68
+ ## Test Artifacts to Review
69
+
70
+ - Latest screenshots from the Playwright run.
71
+ - Latest `render_game_to_text` JSON output.
72
+ - Console error logs (fix the first new error before continuing).
73
+ You must actually open and visually inspect the latest screenshots after running the Playwright script, not just generate them. Ensure everything that should be visible on screen is actually visible. Go beyond the start screen and capture gameplay screenshots that cover all newly added features. Treat the screenshots as the source of truth; if something is missing, it is missing in the build. If you suspect a headless/WebGL capture issue, rerun the Playwright script in headed mode and re-check. Fix and rerun in a tight loop until the screenshots and text state look correct. Once fixes are verified, re-test all important interactions and controls, confirm they work, and ensure your changes did not introduce regressions. If they did, fix them and rerun everything in a loop until interactions, text state, and controls all work as expected. Be exhaustive in testing controls; broken games are not acceptable.
74
+
75
+ ## Core Game Guidelines
76
+
77
+ ### Canvas + Layout
78
+ - Prefer a single canvas centered in the window.
79
+
80
+ ### Visuals
81
+ - Keep on-screen text minimal; show controls on a start/menu screen rather than overlaying them during play.
82
+ - Avoid overly dark scenes unless the design calls for it. Make key elements easy to see.
83
+ - Draw the background on the canvas itself instead of relying on CSS backgrounds.
84
+
85
+ ### Text State Output (render_game_to_text)
86
+ Expose a `window.render_game_to_text` function that returns a concise JSON string representing the current game state. The text should include enough information to play the game without visuals.
87
+
88
+ Minimal pattern:
89
+ ```js
90
+ function renderGameToText() {
91
+ const payload = {
92
+ mode: state.mode,
93
+ player: { x: state.player.x, y: state.player.y, r: state.player.r },
94
+ entities: state.entities.map((e) => ({ x: e.x, y: e.y, r: e.r })),
95
+ score: state.score,
96
+ };
97
+ return JSON.stringify(payload);
98
+ }
99
+ window.render_game_to_text = renderGameToText;
100
+ ```
101
+
102
+ Keep the payload succinct and biased toward on-screen/interactive elements. Prefer current, visible entities over full history.
103
+ Include a clear coordinate system note (origin and axis directions), and encode all player-relevant state: player position/velocity, active obstacles/enemies, collectibles, timers/cooldowns, score, and any mode/state flags needed to make correct decisions. Avoid large histories; only include what's currently relevant and visible.
104
+
105
+ ### Time Stepping Hook
106
+ Provide a deterministic time-stepping hook so the Playwright client can advance the game in controlled increments. Expose `window.advanceTime(ms)` (or a thin wrapper that forwards to your game update loop) and have the game loop use it when present.
107
+ The Playwright test script uses this hook to step frames deterministically during automated testing.
108
+
109
+ Minimal pattern:
110
+ ```js
111
+ window.advanceTime = (ms) => {
112
+ const steps = Math.max(1, Math.round(ms / (1000 / 60)));
113
+ for (let i = 0; i < steps; i++) update(1 / 60);
114
+ render();
115
+ };
116
+ ```
117
+
118
+ ### Fullscreen Toggle
119
+ - Use a single key (prefer `f`) to toggle fullscreen on/off.
120
+ - Allow `Esc` to exit fullscreen.
121
+ - When fullscreen toggles, resize the canvas/rendering so visuals and input mapping stay correct.
122
+
123
+ ## Progress Tracking
124
+
125
+ Create a `progress.md` file if it doesn't exist, and append TODOs, notes, gotchas, and loose ends as you go so another agent can pick up seamlessly.
126
+ If a `progress.md` file already exists, read it first, including the original user prompt at the top (you may be continuing another agent's work). Do not overwrite the original prompt; preserve it.
127
+ Update `progress.md` after each meaningful chunk of work (feature added, bug found, test run, or decision made).
128
+ At the end of your work, leave TODOs and suggestions for the next agent in `progress.md`.
129
+
130
+ ## Playwright Prerequisites
131
+
132
+ - Prefer a local `playwright` dependency if the project already has it.
133
+ - If unsure whether Playwright is available, check for `npx`:
134
+ ```
135
+ command -v npx >/dev/null 2>&1
136
+ ```
137
+ - If `npx` is missing, install Node/npm and then install Playwright globally:
138
+ ```
139
+ npm install -g @playwright/mcp@latest
140
+ ```
141
+ - Do not switch to `@playwright/test` unless explicitly asked; stick to the client script.
142
+
143
+ ## Scripts
144
+
145
+ - `$WEB_GAME_CLIENT` (installed default: `$CODEX_HOME/skills/develop-web-game/scripts/web_game_playwright_client.js`) — Playwright-based action loop with virtual-time stepping, screenshot capture, and console error buffering. You must pass an action burst via `--actions-file`, `--actions-json`, or `--click`.
146
+
147
+ ## References
148
+
149
+ - `$WEB_GAME_ACTIONS` (installed default: `$CODEX_HOME/skills/develop-web-game/references/action_payloads.json`) — example action payloads (keyboard + mouse, per-frame capture). Use these to build your burst.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: "doc"
3
+ description: "Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks."
4
+ ---
5
+
6
+
7
+ # DOCX Skill
8
+
9
+ ## When to use
10
+ - Read or review DOCX content where layout matters (tables, diagrams, pagination).
11
+ - Create or edit DOCX files with professional formatting.
12
+ - Validate visual layout before delivery.
13
+
14
+ ## Workflow
15
+ 1. Prefer visual review (layout, tables, diagrams).
16
+ - If `soffice` and `pdftoppm` are available, convert DOCX -> PDF -> PNGs.
17
+ - Or use `scripts/render_docx.py` (requires `pdf2image` and Poppler).
18
+ - If these tools are missing, install them or ask the user to review rendered pages locally.
19
+ 2. Use `python-docx` for edits and structured creation (headings, styles, tables, lists).
20
+ 3. After each meaningful change, re-render and inspect the pages.
21
+ 4. If visual review is not possible, extract text with `python-docx` as a fallback and call out layout risk.
22
+ 5. Keep intermediate outputs organized and clean up after final approval.
23
+
24
+ ## Temp and output conventions
25
+ - Use `tmp/docs/` for intermediate files; delete when done.
26
+ - Write final artifacts under `output/doc/` when working in this repo.
27
+ - Keep filenames stable and descriptive.
28
+
29
+ ## Dependencies (install if missing)
30
+ Prefer `uv` for dependency management.
31
+
32
+ Python packages:
33
+ ```
34
+ uv pip install python-docx pdf2image
35
+ ```
36
+ If `uv` is unavailable:
37
+ ```
38
+ python3 -m pip install python-docx pdf2image
39
+ ```
40
+ System tools (for rendering):
41
+ ```
42
+ # macOS (Homebrew)
43
+ brew install libreoffice poppler
44
+
45
+ # Ubuntu/Debian
46
+ sudo apt-get install -y libreoffice poppler-utils
47
+ ```
48
+
49
+ If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.
50
+
51
+ ## Environment
52
+ No required environment variables.
53
+
54
+ ## Rendering commands
55
+ DOCX -> PDF:
56
+ ```
57
+ soffice -env:UserInstallation=file:///tmp/lo_profile_$$ --headless --convert-to pdf --outdir $OUTDIR $INPUT_DOCX
58
+ ```
59
+
60
+ PDF -> PNGs:
61
+ ```
62
+ pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME
63
+ ```
64
+
65
+ Bundled helper:
66
+ ```
67
+ python3 scripts/render_docx.py /path/to/file.docx --output_dir /tmp/docx_pages
68
+ ```
69
+
70
+ ## Quality expectations
71
+ - Deliver a client-ready document: consistent typography, spacing, margins, and clear hierarchy.
72
+ - Avoid formatting defects: clipped/overlapping text, broken tables, unreadable characters, or default-template styling.
73
+ - Charts, tables, and visuals must be legible in rendered pages with correct alignment.
74
+ - Use ASCII hyphens only. Avoid U+2011 (non-breaking hyphen) and other Unicode dashes.
75
+ - Citations and references must be human-readable; never leave tool tokens or placeholder strings.
76
+
77
+ ## Final checks
78
+ - Re-render and inspect every page at 100% zoom before final delivery.
79
+ - Fix any spacing, alignment, or pagination issues and repeat the render loop.
80
+ - Confirm there are no leftovers (temp files, duplicate renders) unless the user asks to keep them.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: figma
3
+ description: Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.
4
+ ---
5
+
6
+ # Figma MCP
7
+
8
+ Use the Figma MCP server for Figma-driven implementation. For setup and debugging details (env vars, config, verification), see `references/figma-mcp-config.md`.
9
+
10
+ ## Figma MCP Integration Rules
11
+ These rules define how to translate Figma inputs into code for this project and must be followed for every Figma-driven change.
12
+
13
+ ### Required flow (do not skip)
14
+ 1. Run get_design_context first to fetch the structured representation for the exact node(s).
15
+ 2. If the response is too large or truncated, run get_metadata to get the high-level node map and then re-fetch only the required node(s) with get_design_context.
16
+ 3. Run get_screenshot for a visual reference of the node variant being implemented.
17
+ 4. Only after you have both get_design_context and get_screenshot, download any assets needed and start implementation.
18
+ 5. Translate the output (usually React + Tailwind) into this project's conventions, styles and framework. Reuse the project's color tokens, components, and typography wherever possible.
19
+ 6. Validate against Figma for 1:1 look and behavior before marking complete.
20
+
21
+ ### Implementation rules
22
+ - Treat the Figma MCP output (React + Tailwind) as a representation of design and behavior, not as final code style.
23
+ - Replace Tailwind utility classes with the project's preferred utilities/design-system tokens when applicable.
24
+ - Reuse existing components (e.g., buttons, inputs, typography, icon wrappers) instead of duplicating functionality.
25
+ - Use the project's color system, typography scale, and spacing tokens consistently.
26
+ - Respect existing routing, state management, and data-fetch patterns already adopted in the repo.
27
+ - Strive for 1:1 visual parity with the Figma design. When conflicts arise, prefer design-system tokens and adjust spacing or sizes minimally to match visuals.
28
+ - Validate the final UI against the Figma screenshot for both look and behavior.
29
+
30
+ ### Asset handling
31
+ - The Figma MCP Server provides an assets endpoint which can serve image and SVG assets.
32
+ - IMPORTANT: If the Figma MCP Server returns a localhost source for an image or an SVG, use that image or SVG source directly.
33
+ - IMPORTANT: DO NOT import/add new icon packages, all the assets should be in the Figma payload.
34
+ - IMPORTANT: do NOT use or create placeholders if a localhost source is provided.
35
+
36
+ ### Link-based prompting
37
+ - The server is link-based: copy the Figma frame/layer link and give that URL to the MCP client when asking for implementation help.
38
+ - The client cannot browse the URL but extracts the node ID from the link; always ensure the link points to the exact node/variant you want.
39
+
40
+ ## References
41
+ - `references/figma-mcp-config.md` — setup, verification, troubleshooting, and link-based usage reminders.
42
+ - `references/figma-tools-and-prompts.md` — tool catalog and prompt patterns for selecting frameworks/components and fetching metadata.
@@ -0,0 +1,264 @@
1
+ ---
2
+ name: "figma-implement-design"
3
+ description: "Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma specs. Requires a working Figma MCP server connection."
4
+ ---
5
+
6
+
7
+ # Implement Design
8
+
9
+ ## Overview
10
+
11
+ This skill provides a structured workflow for translating Figma designs into production-ready code with pixel-perfect accuracy. It ensures consistent integration with the Figma MCP server, proper use of design tokens, and 1:1 visual parity with designs.
12
+
13
+ ## Prerequisites
14
+
15
+ - Figma MCP server must be connected and accessible
16
+ - User must provide a Figma URL in the format: `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
17
+ - `:fileKey` is the file key
18
+ - `1-2` is the node ID (the specific component or frame to implement)
19
+ - **OR** when using `figma-desktop` MCP: User can select a node directly in the Figma desktop app (no URL required)
20
+ - Project should have an established design system or component library (preferred)
21
+
22
+ ## Required Workflow
23
+
24
+ **Follow these steps in order. Do not skip steps.**
25
+
26
+ ### Step 0: Set up Figma MCP (if not already configured)
27
+
28
+ If any MCP call fails because Figma MCP is not connected, pause and set it up:
29
+
30
+ 1. Add the Figma MCP:
31
+ - `codex mcp add figma --url https://mcp.figma.com/mcp`
32
+ 2. Enable remote MCP client:
33
+ - Set `[features].rmcp_client = true` in `config.toml` **or** run `codex --enable rmcp_client`
34
+ 3. Log in with OAuth:
35
+ - `codex mcp login figma`
36
+
37
+ After successful login, the user will have to restart codex. You should finish your answer and tell them so when they try again they can continue with Step 1.
38
+
39
+ ### Step 1: Get Node ID
40
+
41
+ #### Option A: Parse from Figma URL
42
+
43
+ When the user provides a Figma URL, extract the file key and node ID to pass as arguments to MCP tools.
44
+
45
+ **URL format:** `https://figma.com/design/:fileKey/:fileName?node-id=1-2`
46
+
47
+ **Extract:**
48
+
49
+ - **File key:** `:fileKey` (the segment after `/design/`)
50
+ - **Node ID:** `1-2` (the value of the `node-id` query parameter)
51
+
52
+ **Note:** When using the local desktop MCP (`figma-desktop`), `fileKey` is not passed as a parameter to tool calls. The server automatically uses the currently open file, so only `nodeId` is needed.
53
+
54
+ **Example:**
55
+
56
+ - URL: `https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15`
57
+ - File key: `kL9xQn2VwM8pYrTb4ZcHjF`
58
+ - Node ID: `42-15`
59
+
60
+ #### Option B: Use Current Selection from Figma Desktop App (figma-desktop MCP only)
61
+
62
+ When using the `figma-desktop` MCP and the user has NOT provided a URL, the tools automatically use the currently selected node from the open Figma file in the desktop app.
63
+
64
+ **Note:** Selection-based prompting only works with the `figma-desktop` MCP server. The remote server requires a link to a frame or layer to extract context. The user must have the Figma desktop app open with a node selected.
65
+
66
+ ### Step 2: Fetch Design Context
67
+
68
+ Run `get_design_context` with the extracted file key and node ID.
69
+
70
+ ```
71
+ get_design_context(fileKey=":fileKey", nodeId="1-2")
72
+ ```
73
+
74
+ This provides the structured data including:
75
+
76
+ - Layout properties (Auto Layout, constraints, sizing)
77
+ - Typography specifications
78
+ - Color values and design tokens
79
+ - Component structure and variants
80
+ - Spacing and padding values
81
+
82
+ **If the response is too large or truncated:**
83
+
84
+ 1. Run `get_metadata(fileKey=":fileKey", nodeId="1-2")` to get the high-level node map
85
+ 2. Identify the specific child nodes needed from the metadata
86
+ 3. Fetch individual child nodes with `get_design_context(fileKey=":fileKey", nodeId=":childNodeId")`
87
+
88
+ ### Step 3: Capture Visual Reference
89
+
90
+ Run `get_screenshot` with the same file key and node ID for a visual reference.
91
+
92
+ ```
93
+ get_screenshot(fileKey=":fileKey", nodeId="1-2")
94
+ ```
95
+
96
+ This screenshot serves as the source of truth for visual validation. Keep it accessible throughout implementation.
97
+
98
+ ### Step 4: Download Required Assets
99
+
100
+ Download any assets (images, icons, SVGs) returned by the Figma MCP server.
101
+
102
+ **IMPORTANT:** Follow these asset rules:
103
+
104
+ - If the Figma MCP server returns a `localhost` source for an image or SVG, use that source directly
105
+ - DO NOT import or add new icon packages - all assets should come from the Figma payload
106
+ - DO NOT use or create placeholders if a `localhost` source is provided
107
+ - Assets are served through the Figma MCP server's built-in assets endpoint
108
+
109
+ ### Step 5: Translate to Project Conventions
110
+
111
+ Translate the Figma output into this project's framework, styles, and conventions.
112
+
113
+ **Key principles:**
114
+
115
+ - Treat the Figma MCP output (typically React + Tailwind) as a representation of design and behavior, not as final code style
116
+ - Replace Tailwind utility classes with the project's preferred utilities or design system tokens
117
+ - Reuse existing components (buttons, inputs, typography, icon wrappers) instead of duplicating functionality
118
+ - Use the project's color system, typography scale, and spacing tokens consistently
119
+ - Respect existing routing, state management, and data-fetch patterns
120
+
121
+ ### Step 6: Achieve 1:1 Visual Parity
122
+
123
+ Strive for pixel-perfect visual parity with the Figma design.
124
+
125
+ **Guidelines:**
126
+
127
+ - Prioritize Figma fidelity to match designs exactly
128
+ - Avoid hardcoded values - use design tokens from Figma where available
129
+ - When conflicts arise between design system tokens and Figma specs, prefer design system tokens but adjust spacing or sizes minimally to match visuals
130
+ - Follow WCAG requirements for accessibility
131
+ - Add component documentation as needed
132
+
133
+ ### Step 7: Validate Against Figma
134
+
135
+ Before marking complete, validate the final UI against the Figma screenshot.
136
+
137
+ **Validation checklist:**
138
+
139
+ - [ ] Layout matches (spacing, alignment, sizing)
140
+ - [ ] Typography matches (font, size, weight, line height)
141
+ - [ ] Colors match exactly
142
+ - [ ] Interactive states work as designed (hover, active, disabled)
143
+ - [ ] Responsive behavior follows Figma constraints
144
+ - [ ] Assets render correctly
145
+ - [ ] Accessibility standards met
146
+
147
+ ## Implementation Rules
148
+
149
+ ### Component Organization
150
+
151
+ - Place UI components in the project's designated design system directory
152
+ - Follow the project's component naming conventions
153
+ - Avoid inline styles unless truly necessary for dynamic values
154
+
155
+ ### Design System Integration
156
+
157
+ - ALWAYS use components from the project's design system when possible
158
+ - Map Figma design tokens to project design tokens
159
+ - When a matching component exists, extend it rather than creating a new one
160
+ - Document any new components added to the design system
161
+
162
+ ### Code Quality
163
+
164
+ - Avoid hardcoded values - extract to constants or design tokens
165
+ - Keep components composable and reusable
166
+ - Add TypeScript types for component props
167
+ - Include JSDoc comments for exported components
168
+
169
+ ## Examples
170
+
171
+ ### Example 1: Implementing a Button Component
172
+
173
+ User says: "Implement this Figma button component: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"
174
+
175
+ **Actions:**
176
+
177
+ 1. Parse URL to extract fileKey=`kL9xQn2VwM8pYrTb4ZcHjF` and nodeId=`42-15`
178
+ 2. Run `get_design_context(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")`
179
+ 3. Run `get_screenshot(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42-15")` for visual reference
180
+ 4. Download any button icons from the assets endpoint
181
+ 5. Check if project has existing button component
182
+ 6. If yes, extend it with new variant; if no, create new component using project conventions
183
+ 7. Map Figma colors to project design tokens (e.g., `primary-500`, `primary-hover`)
184
+ 8. Validate against screenshot for padding, border radius, typography
185
+
186
+ **Result:** Button component matching Figma design, integrated with project design system.
187
+
188
+ ### Example 2: Building a Dashboard Layout
189
+
190
+ User says: "Build this dashboard: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Dashboard?node-id=10-5"
191
+
192
+ **Actions:**
193
+
194
+ 1. Parse URL to extract fileKey=`pR8mNv5KqXzGwY2JtCfL4D` and nodeId=`10-5`
195
+ 2. Run `get_metadata(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5")` to understand the page structure
196
+ 3. Identify main sections from metadata (header, sidebar, content area, cards) and their child node IDs
197
+ 4. Run `get_design_context(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId=":childNodeId")` for each major section
198
+ 5. Run `get_screenshot(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10-5")` for the full page
199
+ 6. Download all assets (logos, icons, charts)
200
+ 7. Build layout using project's layout primitives
201
+ 8. Implement each section using existing components where possible
202
+ 9. Validate responsive behavior against Figma constraints
203
+
204
+ **Result:** Complete dashboard matching Figma design with responsive layout.
205
+
206
+ ## Best Practices
207
+
208
+ ### Always Start with Context
209
+
210
+ Never implement based on assumptions. Always fetch `get_design_context` and `get_screenshot` first.
211
+
212
+ ### Incremental Validation
213
+
214
+ Validate frequently during implementation, not just at the end. This catches issues early.
215
+
216
+ ### Document Deviations
217
+
218
+ If you must deviate from the Figma design (e.g., for accessibility or technical constraints), document why in code comments.
219
+
220
+ ### Reuse Over Recreation
221
+
222
+ Always check for existing components before creating new ones. Consistency across the codebase is more important than exact Figma replication.
223
+
224
+ ### Design System First
225
+
226
+ When in doubt, prefer the project's design system patterns over literal Figma translation.
227
+
228
+ ## Common Issues and Solutions
229
+
230
+ ### Issue: Figma output is truncated
231
+
232
+ **Cause:** The design is too complex or has too many nested layers to return in a single response.
233
+ **Solution:** Use `get_metadata` to get the node structure, then fetch specific nodes individually with `get_design_context`.
234
+
235
+ ### Issue: Design doesn't match after implementation
236
+
237
+ **Cause:** Visual discrepancies between the implemented code and the original Figma design.
238
+ **Solution:** Compare side-by-side with the screenshot from Step 3. Check spacing, colors, and typography values in the design context data.
239
+
240
+ ### Issue: Assets not loading
241
+
242
+ **Cause:** The Figma MCP server's assets endpoint is not accessible or the URLs are being modified.
243
+ **Solution:** Verify the Figma MCP server's assets endpoint is accessible. The server serves assets at `localhost` URLs. Use these directly without modification.
244
+
245
+ ### Issue: Design token values differ from Figma
246
+
247
+ **Cause:** The project's design system tokens have different values than those specified in the Figma design.
248
+ **Solution:** When project tokens differ from Figma values, prefer project tokens for consistency but adjust spacing/sizing to maintain visual fidelity.
249
+
250
+ ## Understanding Design Implementation
251
+
252
+ The Figma implementation workflow establishes a reliable process for translating designs to code:
253
+
254
+ **For designers:** Confidence that implementations will match their designs with pixel-perfect accuracy.
255
+ **For developers:** A structured approach that eliminates guesswork and reduces back-and-forth revisions.
256
+ **For teams:** Consistent, high-quality implementations that maintain design system integrity.
257
+
258
+ By following this workflow, you ensure that every Figma design is implemented with the same level of care and attention to detail.
259
+
260
+ ## Additional Resources
261
+
262
+ - [Figma MCP Server Documentation](https://developers.figma.com/docs/figma-mcp-server/)
263
+ - [Figma MCP Server Tools and Prompts](https://developers.figma.com/docs/figma-mcp-server/tools-and-prompts/)
264
+ - [Figma Variables and Design Tokens](https://help.figma.com/hc/en-us/articles/15339657135383-Guide-to-variables-in-Figma)
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: gh-address-comments
3
+ description: Help address review/issue comments on the open GitHub PR for the current branch using gh CLI; verify gh auth first and prompt the user to authenticate if not logged in.
4
+ metadata:
5
+ short-description: Address comments in a GitHub PR review
6
+ ---
7
+
8
+ # PR Comment Handler
9
+
10
+ Guide to find the open PR for the current branch and address its comments with gh CLI. Run all `gh` commands with elevated network access.
11
+
12
+ Prereq: ensure `gh` is authenticated (for example, run `gh auth login` once), then run `gh auth status` with escalated permissions (include workflow/repo scopes) so `gh` commands succeed. If sandboxing blocks `gh auth status`, rerun it with `sandbox_permissions=require_escalated`.
13
+
14
+ ## 1) Inspect comments needing attention
15
+ - Run scripts/fetch_comments.py which will print out all the comments and review threads on the PR
16
+
17
+ ## 2) Ask the user for clarification
18
+ - Number all the review threads and comments and provide a short summary of what would be required to apply a fix for it
19
+ - Ask the user which numbered comments should be addressed
20
+
21
+ ## 3) If user chooses comments
22
+ - Apply fixes for the selected comments
23
+
24
+ Notes:
25
+ - If gh hits auth/rate issues mid-run, prompt the user to re-authenticate with `gh auth login`, then retry.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: "gh-fix-ci"
3
+ description: "Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL."
4
+ ---
5
+
6
+
7
+ # Gh Pr Checks Plan Fix
8
+
9
+ ## Overview
10
+
11
+ Use gh to locate failing PR checks, fetch GitHub Actions logs for actionable failures, summarize the failure snippet, then propose a fix plan and implement after explicit approval.
12
+ - If a plan-oriented skill (for example `create-plan`) is available, use it; otherwise draft a concise plan inline and request approval before implementing.
13
+
14
+ Prereq: authenticate with the standard GitHub CLI once (for example, run `gh auth login`), then confirm with `gh auth status` (repo + workflow scopes are typically required).
15
+
16
+ ## Inputs
17
+
18
+ - `repo`: path inside the repo (default `.`)
19
+ - `pr`: PR number or URL (optional; defaults to current branch PR)
20
+ - `gh` authentication for the repo host
21
+
22
+ ## Quick start
23
+
24
+ - `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"`
25
+ - Add `--json` if you want machine-friendly output for summarization.
26
+
27
+ ## Workflow
28
+
29
+ 1. Verify gh authentication.
30
+ - Run `gh auth status` in the repo.
31
+ - If unauthenticated, ask the user to run `gh auth login` (ensuring repo + workflow scopes) before proceeding.
32
+ 2. Resolve the PR.
33
+ - Prefer the current branch PR: `gh pr view --json number,url`.
34
+ - If the user provides a PR number or URL, use that directly.
35
+ 3. Inspect failing checks (GitHub Actions only).
36
+ - Preferred: run the bundled script (handles gh field drift and job-log fallbacks):
37
+ - `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"`
38
+ - Add `--json` for machine-friendly output.
39
+ - Manual fallback:
40
+ - `gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow`
41
+ - If a field is rejected, rerun with the available fields reported by `gh`.
42
+ - For each failing check, extract the run id from `detailsUrl` and run:
43
+ - `gh run view <run_id> --json name,workflowName,conclusion,status,url,event,headBranch,headSha`
44
+ - `gh run view <run_id> --log`
45
+ - If the run log says it is still in progress, fetch job logs directly:
46
+ - `gh api "/repos/<owner>/<repo>/actions/jobs/<job_id>/logs" > "<path>"`
47
+ 4. Scope non-GitHub Actions checks.
48
+ - If `detailsUrl` is not a GitHub Actions run, label it as external and only report the URL.
49
+ - Do not attempt Buildkite or other providers; keep the workflow lean.
50
+ 5. Summarize failures for the user.
51
+ - Provide the failing check name, run URL (if any), and a concise log snippet.
52
+ - Call out missing logs explicitly.
53
+ 6. Create a plan.
54
+ - Use the `create-plan` skill to draft a concise plan and request approval.
55
+ 7. Implement after approval.
56
+ - Apply the approved plan, summarize diffs/tests, and ask about opening a PR.
57
+ 8. Recheck status.
58
+ - After changes, suggest re-running the relevant tests and `gh pr checks` to confirm.
59
+
60
+ ## Bundled Resources
61
+
62
+ ### scripts/inspect_pr_checks.py
63
+
64
+ Fetch failing PR checks, pull GitHub Actions logs, and extract a failure snippet. Exits non-zero when failures remain so it can be used in automation.
65
+
66
+ Usage examples:
67
+ - `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "123"`
68
+ - `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "https://github.com/org/repo/pull/123" --json`
69
+ - `python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --max-lines 200 --context 40`