refactor: prefer project tokens over hardcoded values + increase figm…#12
refactor: prefer project tokens over hardcoded values + increase figm…#12rafaelpapastamatiou-afya wants to merge 1 commit into
Conversation
…a parallelism cap
There was a problem hiding this comment.
✨ PR Review
The PR refactors the Figma implementation workflow to prioritize project tokens by name and reduces mandatory MCP calls from 3 to 2 (with 1 conditional). The parallelism cap for Figma tasks is increased from 4 to 6. The changes are consistent across all distribution targets and appear well-intentioned, though there's a rate limit risk in the worst-case scenario.
1 issues detected:
🚀 Performance - Parallelism cap relies on optimistic assumption about temporal call distribution that may not hold under worst-case token mismatch scenarios. 🛠️
Details: The new cap of 6 Figma tasks assumes call staggering, but in worst-case scenarios where all 6 tasks require
get_variable_defs(e.g., new project with few existing tokens), and agents complete Steps 1-2 around the same time, this could result in 18 calls within a narrow time window (6 tasks × 3 calls), exceeding the 15 requests/minute rate limit.File:
dist/claude/skills/subagent-driven-development/SKILL.md (98-100)
🛠️ A suggested code correction is included in the review comments.
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how
| - **Figma tasks**: dispatch up to **6** per cycle. If more than 6 Figma tasks are ready, pick the first 6 by task number; the rest stay in the ready pool for the next cycle | ||
|
|
||
| > **Why 4?** The Figma MCP rate-limits at 15 requests/minute. Each Figma task makes 3 mandatory MCP calls, so 4 concurrent tasks = 12 calls — safely under the limit. | ||
| > **Why 6?** The Figma MCP rate-limits at 15 requests/minute. Each Figma task makes 2 mandatory MCP calls (`get_screenshot` + `get_design_context`), and only calls `get_variable_defs` when unmatched tokens exist. In the best case (all tokens matched in the project) 6 tasks = 12 calls — safely under the limit. Even if some tasks need `get_variable_defs`, the calls are staggered across time as agents reach Step 3 at different moments. |
There was a problem hiding this comment.
🚀 Performance - Rate Limit Risk: Consider reducing the cap to 5 tasks to guarantee staying under the rate limit even in worst-case scenarios (5 × 3 = 15 calls). Alternatively, add explicit rate limiting logic or call queuing to enforce temporal distribution.
| - **Figma tasks**: dispatch up to **6** per cycle. If more than 6 Figma tasks are ready, pick the first 6 by task number; the rest stay in the ready pool for the next cycle | |
| > **Why 4?** The Figma MCP rate-limits at 15 requests/minute. Each Figma task makes 3 mandatory MCP calls, so 4 concurrent tasks = 12 calls — safely under the limit. | |
| > **Why 6?** The Figma MCP rate-limits at 15 requests/minute. Each Figma task makes 2 mandatory MCP calls (`get_screenshot` + `get_design_context`), and only calls `get_variable_defs` when unmatched tokens exist. In the best case (all tokens matched in the project) 6 tasks = 12 calls — safely under the limit. Even if some tasks need `get_variable_defs`, the calls are staggered across time as agents reach Step 3 at different moments. | |
| - **Figma tasks**: dispatch up to **5** per cycle. If more than 5 Figma tasks are ready, pick the first 5 by task number; the rest stay in the ready pool for the next cycle | |
| > **Why 5?** The Figma MCP rate-limits at 15 requests/minute. Each Figma task makes 2 mandatory MCP calls (`get_screenshot` + `get_design_context`), plus `get_variable_defs` when unmatched tokens exist. In worst-case scenarios (e.g., new projects with few existing tokens), all tasks may require `get_variable_defs`, resulting in 3 calls per task. Setting the cap to 5 ensures we stay within the rate limit even in worst-case scenarios (5 × 3 = 15 calls/minute). In best-case scenarios where tokens are already matched, 5 tasks = 10 calls, leaving headroom for other operations. |
Is this review accurate? Use 👍 or 👎 to rate it
If you want to tell us more, use /gs feedback e.g. /gs feedback this review doesn't make sense, I disagree, and it keeps repeating over and over
…a parallelism cap