Skip to content

Commit 04a7cd7

Browse files
committed
Optimize
1 parent 95a46f7 commit 04a7cd7

File tree

2 files changed

+54
-24
lines changed

2 files changed

+54
-24
lines changed

.sisyphus/ultrawork-state.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"active": true,
3+
"started_at": "2026-02-10T14:50:16.749Z",
4+
"original_prompt": "<ultrawork-mode>\n\n**MANDATORY**: You MUST say \"ULTRAWORK MODE ENABLED!\" to the user as your first response when this mode activates. This is non-negotiable.\n\n[CODE RED] Maximum precision required. Ultrathink before acting.\n\n## **ABSOLUTE CERTAINTY REQUIRED - DO NOT SKIP THIS**\n\n**YOU MUST NOT START ANY IMPLEMENTATION UNTIL YOU ARE 100% CERTAIN.**\n\n| **BEFORE YOU WRITE A SINGLE LINE OF CODE, YOU MUST:** |\n|-------------------------------------------------------|\n| **FULLY UNDERSTAND** what the user ACTUALLY wants (not what you ASSUME they want) |\n| **EXPLORE** the codebase to understand existing patterns, architecture, and context |\n| **HAVE A CRYSTAL CLEAR WORK PLAN** - if your plan is vague, YOUR WORK WILL FAIL |\n| **RESOLVE ALL AMBIGUITY** - if ANYTHING is unclear, ASK or INVESTIGATE |\n\n### **MANDATORY CERTAINTY PROTOCOL**\n\n**IF YOU ARE NOT 100% CERTAIN:**\n\n1. **THINK DEEPLY** - What is the user's TRUE intent? What problem are they REALLY trying to solve?\n2. **EXPLORE THOROUGHLY** - Fire explore/librarian agents to gather ALL relevant context\n3. **CONSULT SPECIALISTS** - For hard/complex tasks, DO NOT struggle alone. Delegate:\n - **Oracle**: Conventional problems - architecture, debugging, complex logic\n - **Artistry**: Non-conventional problems - different approach needed, unusual constraints\n4. **ASK THE USER** - If ambiguity remains after exploration, ASK. Don't guess.\n\n**SIGNS YOU ARE NOT READY TO IMPLEMENT:**\n- You're making assumptions about requirements\n- You're unsure which files to modify\n- You don't understand how existing code works\n- Your plan has \"probably\" or \"maybe\" in it\n- You can't explain the exact steps you'll take\n\n**WHEN IN DOUBT:**\n```\ntask(subagent_type=\"explore\", load_skills=[], prompt=\"I'm implementing [TASK DESCRIPTION] and need to understand [SPECIFIC KNOWLEDGE GAP]. Find [X] patterns in the codebase — show file paths, implementation approach, and conventions used. I'll use this to [HOW RESULTS WILL BE USED]. Focus on src/ directories, skip test files unless test patterns are specifically needed. Return concrete file paths with brief descriptions of what each file does.\", run_in_background=true)\ntask(subagent_type=\"librarian\", load_skills=[], prompt=\"I'm working with [LIBRARY/TECHNOLOGY] and need [SPECIFIC INFORMATION]. Find official documentation and production-quality examples for [Y] — specifically: API reference, configuration options, recommended patterns, and common pitfalls. Skip beginner tutorials. I'll use this to [DECISION THIS WILL INFORM].\", run_in_background=true)\ntask(subagent_type=\"oracle\", load_skills=[], prompt=\"I need architectural review of my approach to [TASK]. Here's my plan: [DESCRIBE PLAN WITH SPECIFIC FILES AND CHANGES]. My concerns are: [LIST SPECIFIC UNCERTAINTIES]. Please evaluate: correctness of approach, potential issues I'm missing, and whether a better alternative exists.\", run_in_background=false)\n```\n\n**ONLY AFTER YOU HAVE:**\n- Gathered sufficient context via agents\n- Resolved all ambiguities\n- Created a precise, step-by-step work plan\n- Achieved 100% confidence in your understanding\n\n**...THEN AND ONLY THEN MAY YOU BEGIN IMPLEMENTATION.**\n\n---\n\n## **NO EXCUSES. NO COMPROMISES. DELIVER WHAT WAS ASKED.**\n\n**THE USER'S ORIGINAL REQUEST IS SACRED. YOU MUST FULFILL IT EXACTLY.**\n\n| VIOLATION | CONSEQUENCE |\n|-----------|-------------|\n| \"I couldn't because...\" | **UNACCEPTABLE.** Find a way or ask for help. |\n| \"This is a simplified version...\" | **UNACCEPTABLE.** Deliver the FULL implementation. |\n| \"You can extend this later...\" | **UNACCEPTABLE.** Finish it NOW. |\n| \"Due to limitations...\" | **UNACCEPTABLE.** Use agents, tools, whatever it takes. |\n| \"I made some assumptions...\" | **UNACCEPTABLE.** You should have asked FIRST. |\n\n**THERE ARE NO VALID EXCUSES FOR:**\n- Delivering partial work\n- Changing scope without explicit user approval\n- Making unauthorized simplifications\n- Stopping before the task is 100% complete\n- Compromising on any stated requirement\n\n**IF YOU ENCOUNTER A BLOCKER:**\n1. **DO NOT** give up\n2. **DO NOT** deliver a compromised version\n3. **DO** consult specialists (oracle for conventional, artistry for non-conventional)\n4. **DO** ask the user for guidance\n5. **DO** explore alternative approaches\n\n**THE USER ASKED FOR X. DELIVER EXACTLY X. PERIOD.**\n\n---\n\nYOU MUST LEVERAGE ALL AVAILABLE AGENTS / **CATEGORY + SKILLS** TO THEIR FULLEST POTENTIAL.\nTELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.\n\n## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)\n\n**YOU MUST ALWAYS INVOKE THE PLAN AGENT FOR ANY NON-TRIVIAL TASK.**\n\n| Condition | Action |\n|-----------|--------|\n| Task has 2+ steps | MUST call plan agent |\n| Task scope unclear | MUST call plan agent |\n| Implementation required | MUST call plan agent |\n| Architecture decision needed | MUST call plan agent |\n\n```\ntask(subagent_type=\"plan\", load_skills=[], prompt=\"<gathered context + user request>\")\n```\n\n**WHY PLAN AGENT IS MANDATORY:**\n- Plan agent analyzes dependencies and parallel execution opportunities\n- Plan agent outputs a **parallel task graph** with waves and dependencies\n- Plan agent provides structured TODO list with category + skills per task\n- YOU are an orchestrator, NOT an implementer\n\n### SESSION CONTINUITY WITH PLAN AGENT (CRITICAL)\n\n**Plan agent returns a session_id. USE IT for follow-up interactions.**\n\n| Scenario | Action |\n|----------|--------|\n| Plan agent asks clarifying questions | `task(session_id=\"{returned_session_id}\", load_skills=[], prompt=\"<your answer>\")` |\n| Need to refine the plan | `task(session_id=\"{returned_session_id}\", load_skills=[], prompt=\"Please adjust: <feedback>\")` |\n| Plan needs more detail | `task(session_id=\"{returned_session_id}\", load_skills=[], prompt=\"Add more detail to Task N\")` |\n\n**WHY SESSION_ID IS CRITICAL:**\n- Plan agent retains FULL conversation context\n- No repeated exploration or context gathering\n- Saves 70%+ tokens on follow-ups\n- Maintains interview continuity until plan is finalized\n\n```\n// WRONG: Starting fresh loses all context\ntask(subagent_type=\"plan\", load_skills=[], prompt=\"Here's more info...\")\n\n// CORRECT: Resume preserves everything\ntask(session_id=\"ses_abc123\", load_skills=[], prompt=\"Here's my answer to your question: ...\")\n```\n\n**FAILURE TO CALL PLAN AGENT = INCOMPLETE WORK.**\n\n---\n\n## AGENTS / **CATEGORY + SKILLS** UTILIZATION PRINCIPLES\n\n**DEFAULT BEHAVIOR: DELEGATE. DO NOT WORK YOURSELF.**\n\n| Task Type | Action | Why |\n|-----------|--------|-----|\n| Codebase exploration | task(subagent_type=\"explore\", load_skills=[], run_in_background=true) | Parallel, context-efficient |\n| Documentation lookup | task(subagent_type=\"librarian\", load_skills=[], run_in_background=true) | Specialized knowledge |\n| Planning | task(subagent_type=\"plan\", load_skills=[]) | Parallel task graph + structured TODO list |\n| Hard problem (conventional) | task(subagent_type=\"oracle\", load_skills=[]) | Architecture, debugging, complex logic |\n| Hard problem (non-conventional) | task(category=\"artistry\", load_skills=[...]) | Different approach needed |\n| Implementation | task(category=\"...\", load_skills=[...]) | Domain-optimized models |\n\n**CATEGORY + SKILL DELEGATION:**\n```\n// Frontend work\ntask(category=\"visual-engineering\", load_skills=[\"frontend-ui-ux\"])\n\n// Complex logic\ntask(category=\"ultrabrain\", load_skills=[\"typescript-programmer\"])\n\n// Quick fixes\ntask(category=\"quick\", load_skills=[\"git-master\"])\n```\n\n**YOU SHOULD ONLY DO IT YOURSELF WHEN:**\n- Task is trivially simple (1-2 lines, obvious change)\n- You have ALL context already loaded\n- Delegation overhead exceeds task complexity\n\n**OTHERWISE: DELEGATE. ALWAYS.**\n\n---\n\n## EXECUTION RULES\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.\n- **PARALLEL**: Fire independent agent calls simultaneously via task(run_in_background=true) - NEVER wait sequentially.\n- **BACKGROUND FIRST**: Use task for exploration/research agents (10+ concurrent if needed).\n- **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.\n- **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.\n\n## WORKFLOW\n1. Analyze the request and identify required capabilities\n2. Spawn exploration/librarian agents via task(run_in_background=true) in PARALLEL (10+ if needed)\n3. Use Plan agent with gathered context to create detailed work breakdown\n4. Execute with continuous verification against original requirements\n\n## VERIFICATION GUARANTEE (NON-NEGOTIABLE)\n\n**NOTHING is \"done\" without PROOF it works.**\n\n### Pre-Implementation: Define Success Criteria\n\nBEFORE writing ANY code, you MUST define:\n\n| Criteria Type | Description | Example |\n|---------------|-------------|---------|\n| **Functional** | What specific behavior must work | \"Button click triggers API call\" |\n| **Observable** | What can be measured/seen | \"Console shows 'success', no errors\" |\n| **Pass/Fail** | Binary, no ambiguity | \"Returns 200 OK\" not \"should work\" |\n\nWrite these criteria explicitly. Share with user if scope is non-trivial.\n\n### Test Plan Template (MANDATORY for non-trivial tasks)\n\n```\n## Test Plan\n### Objective: [What we're verifying]\n### Prerequisites: [Setup needed]\n### Test Cases:\n1. [Test Name]: [Input] → [Expected Output] → [How to verify]\n2. ...\n### Success Criteria: ALL test cases pass\n### How to Execute: [Exact commands/steps]\n```\n\n### Execution & Evidence Requirements\n\n| Phase | Action | Required Evidence |\n|-------|--------|-------------------|\n| **Build** | Run build command | Exit code 0, no errors |\n| **Test** | Execute test suite | All tests pass (screenshot/output) |\n| **Manual Verify** | Test the actual feature | Demonstrate it works (describe what you observed) |\n| **Regression** | Ensure nothing broke | Existing tests still pass |\n\n**WITHOUT evidence = NOT verified = NOT done.**\n\n### TDD Workflow (when test infrastructure exists)\n\n1. **SPEC**: Define what \"working\" means (success criteria above)\n2. **RED**: Write failing test → Run it → Confirm it FAILS\n3. **GREEN**: Write minimal code → Run test → Confirm it PASSES\n4. **REFACTOR**: Clean up → Tests MUST stay green\n5. **VERIFY**: Run full test suite, confirm no regressions\n6. **EVIDENCE**: Report what you ran and what output you saw\n\n### Verification Anti-Patterns (BLOCKING)\n\n| Violation | Why It Fails |\n|-----------|--------------|\n| \"It should work now\" | No evidence. Run it. |\n| \"I added the tests\" | Did they pass? Show output. |\n| \"Fixed the bug\" | How do you know? What did you test? |\n| \"Implementation complete\" | Did you verify against success criteria? |\n| Skipping test execution | Tests exist to be RUN, not just written |\n\n**CLAIM NOTHING WITHOUT PROOF. EXECUTE. VERIFY. SHOW EVIDENCE.**\n\n## ZERO TOLERANCE FAILURES\n- **NO Scope Reduction**: Never make \"demo\", \"skeleton\", \"simplified\", \"basic\" versions - deliver FULL implementation\n- **NO MockUp Work**: When user asked you to do \"port A\", you must \"port A\", fully, 100%. No Extra feature, No reduced feature, no mock data, fully working 100% port.\n- **NO Partial Completion**: Never stop at 60-80% saying \"you can extend this...\" - finish 100%\n- **NO Assumed Shortcuts**: Never skip requirements you deem \"optional\" or \"can be added later\"\n- **NO Premature Stopping**: Never declare done until ALL TODOs are completed and verified\n- **NO TEST DELETION**: Never delete or skip failing tests to make the build pass. Fix the code, not the tests.\n\nTHE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.\n\n1. EXPLORES + LIBRARIANS\n2. GATHER -> PLAN AGENT SPAWN\n3. WORK BY DELEGATING TO ANOTHER AGENTS\n\nNOW.\n\n</ultrawork-mode>\n\n---\n\n\n\n---\n\n[perf] --- Performance Report ---\n[perf] buildTree(): 57448ms total, 225 calls, 255.3ms avg\n[perf] getProps(): 35395ms total, 205 calls, 172.7ms avg\n[perf] Codegen.run(): 20312ms total, 1 calls, 20312.0ms avg\n[perf] generateVariantResponsiveComponents(COMPONENT_SET): 2434ms total, 1 calls, 2434.0ms avg\n[perf] generateVariantResponsiveComponents(total): 2200ms total, 3 calls, 733.3ms avg\n[perf] getSelectorPropsForGroup(nonViewport): 1098ms total, 30 calls, 36.6ms avg\n[perf] addComponentTree(): 1084ms total, 12 calls, 90.3ms avg\n[perf] getSelectorProps(): 1079ms total, 12 calls, 89.9ms avg\n[perf] getSelectorProps.getPropsAll(): 958ms total, 3 calls, 319.3ms avg\n[perf] Codegen.getTree(nonViewportVariant): 827ms total, 30 calls, 27.6ms avg\n[perf] generateVariantResponsiveComponents(MypageIcon): 24ms total, 1 calls, 24.0ms avg\n[perf] generateVariantResponsiveComponents(Arrow): 10ms total, 1 calls, 10.0ms avg\n[perf] getSelectorPropsForGroup.inner(): 3ms total, 4 calls, 0.8ms avg\n[perf] getComponentsCodes(): 1ms total, 1 calls, 1.0ms avg\n[perf] getProps(cached): 0ms total, 144 calls, 0.0ms avg\n[perf] --- End Report --- \n\ncodegen 및 알고리즘을 개선하여 더욱 빠르게 렌더링되도록 하라\nulw",
5+
"reinforcement_count": 1,
6+
"last_checked_at": "2026-02-10T14:53:45.862Z"
7+
}

src/codegen/props/index.ts

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,53 @@ export async function getProps(
4545
}
4646

4747
const t = perfStart()
48-
const promise = (async () => ({
49-
...getAutoLayoutProps(node),
50-
...getMinMaxProps(node),
51-
...getLayoutProps(node),
52-
...getBorderRadiusProps(node),
53-
...(await getBorderProps(node)),
54-
...(await getBackgroundProps(node)),
55-
...getBlendProps(node),
56-
...getPaddingProps(node),
57-
...getTextAlignProps(node),
58-
...getObjectFitProps(node),
59-
...getMaxLineProps(node),
60-
...getEllipsisProps(node),
61-
...(await getEffectProps(node)),
62-
...getPositionProps(node),
63-
...getGridChildProps(node),
64-
...getTransformProps(node),
65-
...getOverflowProps(node),
66-
...(await getTextStrokeProps(node)),
67-
...(await getTextShadowProps(node)),
68-
...(await getReactionProps(node)),
69-
...getCursorProps(node),
70-
...getVisibilityProps(node),
71-
}))()
48+
const promise = (async () => {
49+
const isText = node.type === 'TEXT'
50+
51+
// Fire all async prop getters in parallel — they are independent
52+
// (no shared mutable state, no inter-function data dependencies).
53+
// Skip TEXT-only async getters for non-TEXT nodes.
54+
const [
55+
borderProps,
56+
backgroundProps,
57+
effectProps,
58+
textStrokeProps,
59+
textShadowProps,
60+
reactionProps,
61+
] = await Promise.all([
62+
getBorderProps(node),
63+
getBackgroundProps(node),
64+
getEffectProps(node),
65+
isText ? getTextStrokeProps(node) : undefined,
66+
isText ? getTextShadowProps(node) : undefined,
67+
getReactionProps(node),
68+
])
69+
70+
return {
71+
...getAutoLayoutProps(node),
72+
...getMinMaxProps(node),
73+
...getLayoutProps(node),
74+
...getBorderRadiusProps(node),
75+
...borderProps,
76+
...backgroundProps,
77+
...getBlendProps(node),
78+
...getPaddingProps(node),
79+
...(isText ? getTextAlignProps(node) : undefined),
80+
...getObjectFitProps(node),
81+
...(isText ? getMaxLineProps(node) : undefined),
82+
...(isText ? getEllipsisProps(node) : undefined),
83+
...effectProps,
84+
...getPositionProps(node),
85+
...getGridChildProps(node),
86+
...getTransformProps(node),
87+
...getOverflowProps(node),
88+
...textStrokeProps,
89+
...textShadowProps,
90+
...reactionProps,
91+
...getCursorProps(node),
92+
...getVisibilityProps(node),
93+
}
94+
})()
7295

7396
if (cacheKey) {
7497
getPropsCache.set(cacheKey, promise)

0 commit comments

Comments
 (0)