VibeKoding / Level 2 ยท DeveloperLevel 2 ยท Developer / Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata
VK

Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

๐Ÿ“š Level 2 ยท DeveloperLevel 2 ยท Developer ๐ŸŒ Dual Bahasa (ID / EN) โšก VibeKoding Native

Modul praktis Level 2 VibeKoding: Dari Prototipe Desain Menjadi Kode Nyata.Modul praktis Level 2 VibeKoding: Dari Prototipe Desain Menjadi Kode Nyata.

๐Ÿ’ก Tips Praktis๐Ÿ’ก Pro Tip

How can you turn a prototype from a design tool into frontend code that actually runs in the browser?How can you turn a prototype from a design tool into frontend code that actually runs in the browser?

------

1. Three main paths from prototype to code1. Three main paths from prototype to code

After finishing a UI design in tools like Figma or MasterGo, a practical question naturally appears: how do you turn that structured design into real frontend code?After finishing a UI design in tools like Figma or MasterGo, a practical question naturally appears: how do you turn that structured design into real frontend code?

In practice, there are three common paths:In practice, there are three common paths:

PathMethodCharacteristicsBest for
Path 1Use multimodal models to recreate code directly from screenshotsFlexible, no specific platform requiredFast prototype validation, simple pages
Path 2Export usable code through the platform itself or pluginsHigh fidelity, strong editabilityExisting Figma or MasterGo workflows
Path 3Combine the design platform with MCP-based exportHighly automated, customizableDeeply integrated design-to-dev workflows

This chapter walks through all three so you can choose the one that fits your project.This chapter walks through all three so you can choose the one that fits your project.

๐Ÿ’ก Tips Praktis๐Ÿ’ก Pro Tip

Before starting this chapter, it is helpful to first read [Figma and MasterGo Basics](../figma-mastergo/).Before starting this chapter, it is helpful to first read [Figma and MasterGo Basics](../figma-mastergo/).

------

2. Path 1: use multimodal AI to recreate code directly2. Path 1: use multimodal AI to recreate code directly

Models with vision capabilities are naturally suited to turning images into code. All you need to do is upload screenshots of the design and ask the model to generate the implementation.Models with vision capabilities are naturally suited to turning images into code. All you need to do is upload screenshots of the design and ask the model to generate the implementation.

2.1 Workflow2.1 Workflow

  1. Capture the designCapture the design
  2. Export the designed page from Figma or MasterGo as PNG or JPGExport the designed page from Figma or MasterGo as PNG or JPG
  3. Make sure the screenshot contains the complete layoutMake sure the screenshot contains the complete layout
    1. Choose a multimodal AI modelChoose a multimodal AI model
    2. You can use Gemini, Qwen, Claude, or any model that accepts image inputYou can use Gemini, Qwen, Claude, or any model that accepts image input
    3. The example below uses GeminiThe example below uses Gemini
      1. Write a promptWrite a prompt
      2. CODE
         Generate the corresponding HTML/CSS code from this design image. Requirements: - Use modern CSS layout techniques such as Flexbox or Grid - Make it responsive for different screen sizes - Include all visible UI elements - Match colors and font sizes as closely as possible
        

        ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

        1. Save the generated codeSave the generated code
        2. Ask the model to return complete HTMLAsk the model to return complete HTML
        3. Save it as a single .html file for easy local testingSave it as a single .html file for easy local testing
        4. Later, you can convert it into a React or Vue structure inside your local IDELater, you can convert it into a React or Vue structure inside your local IDE
        5. 2.2 Common issues and solutions2.2 Common issues and solutions

          Design-to-code is never fully automatic. Here are a few issues you may run into:Design-to-code is never fully automatic. Here are a few issues you may run into:

          ProblemSolution
          Uneven layoutDescribe the layout problem clearly and ask the model to adjust CSS margin and padding
          The page is cut offCheck whether the viewport is set correctly and ask for responsive breakpoints
          Colors are inaccurateUse a color picker on the design and provide the exact values
          Fonts do not matchSpecify a font family or ask for a Google Fonts replacement
          ๐Ÿ’ก Tips Praktis๐Ÿ’ก Pro Tip

          It is often easier to generate plain HTML first, then import that result into your local IDE and convert it into a React or Vue project afterward.It is often easier to generate plain HTML first, then import that result into your local IDE and convert it into a React or Vue project afterward.

          2.3 Generate pages with MasterGo AI2.3 Generate pages with MasterGo AI

          MasterGo also provides strong AI page generation features and can generate usable webpage code from a reference image.MasterGo also provides strong AI page generation features and can generate usable webpage code from a reference image.

          Find the AI entryFind the AI entry

          In the top toolbar of the MasterGo editor, you can find the AI tool entry:In the top toolbar of the MasterGo editor, you can find the AI tool entry:

          ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

          Generation flowGeneration flow

          1. Upload a reference imageUpload a reference image
          2. Upload the design reference imageUpload the design reference image
          3. Add a text description of what you wantAdd a text description of what you want
            1. Inspect the generated resultInspect the generated result
            2. ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

              ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

              1. Get the codeGet the code
              2. Click the blue Insert to canvas button if you want to edit the result visuallyClick the blue Insert to canvas button if you want to edit the result visually
              3. Or click the Code button on the right to copy the implementation locallyOr click the Code button on the right to copy the implementation locally
              4. ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

                ------

                3. Path 2: export code through the design platform or plugins3. Path 2: export code through the design platform or plugins

                3.1 Generate code with Figma Make3.1 Generate code with Figma Make

                Figma Make is Figma's official AI design feature. It can recreate webpage UI prototypes with much higher fidelity from either prompts or reference images.Figma Make is Figma's official AI design feature. It can recreate webpage UI prototypes with much higher fidelity from either prompts or reference images.

                Key featuresKey features

                • High-fidelity recreation: usually better than generic screenshot-to-code generationHigh-fidelity recreation: usually better than generic screenshot-to-code generation
                • Editable results: you can convert the result back into an editable Figma design fileEditable results: you can convert the result back into an editable Figma design file
                • GitHub integration: the generated code can be synced directly to GitHubGitHub integration: the generated code can be synced directly to GitHub
                ๐Ÿ’ก Tips Praktis๐Ÿ’ก Pro Tip

                To use the full Figma Make experience, you usually need Figma Pro. Students can often get Pro access through education verification.To use the full Figma Make experience, you usually need Figma Pro. Students can often get Pro access through education verification.

                StepsSteps

                1. Open Figma MakeOpen Figma Make
                2. Click the Make button on the Figma homepageClick the Make button on the Figma homepage
                3. Or visit [Figma Make](https://www.figma.com/make)Or visit [Figma Make](https://www.figma.com/make)
                  1. Upload your referenceUpload your reference
                  2. Upload the design you want to recreateUpload the design you want to recreate
                  3. Add a prompt describing what you wantAdd a prompt describing what you want
                  4. ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

                    1. Check the resultCheck the result
                    2. After a short wait, you will see the rendered resultAfter a short wait, you will see the rendered result
                    3. Click the play button in the upper right to preview it fullscreenClick the play button in the upper right to preview it fullscreen
                    4. ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

                      1. Fine-tune the detailsFine-tune the details
                      2. Click the editor icon in the upper rightClick the editor icon in the upper right
                      3. Go back into the familiar Figma editor and make detailed adjustmentsGo back into the familiar Figma editor and make detailed adjustments
                      4. ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

                        1. Export the codeExport the code
                        2. Once the result looks good, export the codeOnce the result looks good, export the code
                        3. You can even connect it directly to GitHubYou can even connect it directly to GitHub
                        4. ๐Ÿ–ผ๏ธ Dari Prototipe Desain Menjadi Kode NyataDari Prototipe Desain Menjadi Kode Nyata

                          3.2 Export code with plugins3.2 Export code with plugins

                          Besides the native AI features, both Figma and MasterGo support plugins that export code.Besides the native AI features, both Figma and MasterGo support plugins that export code.

                          Common Figma pluginsCommon Figma plugins

                          • Figma to Code: converts designs into React, Vue, HTML, and moreFigma to Code: converts designs into React, Vue, HTML, and more
                          • Anima: high-fidelity export with interaction supportAnima: high-fidelity export with interaction support
                          • Locofy: AI-assisted design-to-code workflowLocofy: AI-assisted design-to-code workflow

                          Typical workflowTypical workflow

                          1. Open the Plugins panel in FigmaOpen the Plugins panel in Figma
                          2. Search for and install the export plugin you wantSearch for and install the export plugin you want
                          3. Select the design elements you want to exportSelect the design elements you want to export
                          4. Run the plugin and choose the target framework and output formatRun the plugin and choose the target framework and output format
                          5. Copy or download the generated codeCopy or download the generated code
                          6. ------

                            4. Path 3: export code through MCP-enabled design tools4. Path 3: export code through MCP-enabled design tools

                            4.1 What is MCP?4.1 What is MCP?

                            MCP, or Model Context Protocol, is an open standard that lets AI models access external tools and data sources in a safe and controllable way. In the context of frontend design, MCP allows a model to read the structure, styles, and component metadata of a design file directly instead of guessing from screenshots.MCP, or Model Context Protocol, is an open standard that lets AI models access external tools and data sources in a safe and controllable way. In the context of frontend design, MCP allows a model to read the structure, styles, and component metadata of a design file directly instead of guessing from screenshots.

                            4.2 How MCP works4.2 How MCP works

                            text
                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AI model โ”‚ โ†โ†’ โ”‚ MCP server โ”‚ โ†โ†’ โ”‚ Design tool โ”‚ โ”‚ (Claude etc.)โ”‚ โ”‚(protocol adapter)โ”‚ โ”‚(Figma/MasterGo)โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            

                            Typical flowTypical flow

                            1. The AI model sends a request through the MCP protocolThe AI model sends a request through the MCP protocol
                            2. The design tool returns structured design data such as layers, styles, and componentsThe design tool returns structured design data such as layers, styles, and components
                            3. The model understands the structure and generates matching codeThe model understands the structure and generates matching code
                            4. The result can then be exported or written into the development environmentThe result can then be exported or written into the development environment
                            5. 4.3 Figma + MCP in practice4.3 Figma + MCP in practice

                              Environment setupEnvironment setup

                              1. Install an MCP serverInstall an MCP server
                              2. bash
                                 npx figma-mcp-server
                                
                                1. Configure Claude Desktop or another MCP-capable AI toolConfigure Claude Desktop or another MCP-capable AI tool
                                2. json
                                   { "mcpServers": { "figma": { "command": "npx", "args": ["figma-mcp-server"], "env": { "FIGMA_ACCESS_TOKEN": "your-figma-token" } } } }
                                  
                                  1. Create a Figma access tokenCreate a Figma access token
                                  2. Go to Figma โ†’ Settings โ†’ Personal Access TokensGo to Figma โ†’ Settings โ†’ Personal Access Tokens
                                  3. Generate and save a new tokenGenerate and save a new token
                                  4. WorkflowWorkflow

                                    1. Enable MCP in your AI toolEnable MCP in your AI tool
                                    2. Open Claude Code or another MCP-aware IDEOpen Claude Code or another MCP-aware IDE
                                    3. Confirm that the MCP server is connectedConfirm that the MCP server is connected
                                      1. Provide the design file linkProvide the design file link
                                      2. text
                                         User: Please convert this Figma design into React code Link: https://www.figma.com/file/xxxxx AI: I have connected to Figma through MCP and I am reading the design structure...
                                        
                                        1. Let the AI analyze and generateLet the AI analyze and generate
                                        2. The MCP server retrieves the layer treeThe MCP server retrieves the layer tree
                                        3. The AI understands component structure and style propertiesThe AI understands component structure and style properties
                                        4. It generates React or Vue components with more accurate names and structureIt generates React or Vue components with more accurate names and structure
                                          1. IterateIterate
                                          2. text
                                             User: Please extract the button into a reusable component AI: I identified the Button component from the design system via MCP and I am generating a reusable React component with props...
                                            

                                            4.4 Why MCP is powerful4.4 Why MCP is powerful

                                            FeatureTraditional approachMCP approach
                                            Data accuracyBased on screenshots, may lose detailReads the original design data directly
                                            Component recognitionThe model has to guess boundariesExact component definitions are available
                                            Style fidelityEstimated from pixelsReads exact design tokens
                                            Iteration speedRe-screenshot after every changeDesign changes can be synced directly
                                            AutomationCopy and paste manuallyCan write directly into project files

                                            4.5 MCP tools available today4.5 MCP tools available today

                                            Design-side MCP toolsDesign-side MCP tools

                                            • Figma MCP Server: official MCP support for FigmaFigma MCP Server: official MCP support for Figma
                                            • MasterGo MCP: community-built MasterGo adapterMasterGo MCP: community-built MasterGo adapter

                                            Development-side MCP toolsDevelopment-side MCP tools

                                            • Claude Code: native MCP supportClaude Code: native MCP support
                                            • Cline: VS Code extension with MCP supportCline: VS Code extension with MCP support
                                            • Trae: can enable MCP through configurationTrae: can enable MCP through configuration
                                            ๐Ÿ’ก Tips Praktis๐Ÿ’ก Pro Tip

                                            The MCP ecosystem is evolving quickly. Over time, design tools and development environments will become much more tightly integrated, and one-click design-to-code workflows will likely become far more common.The MCP ecosystem is evolving quickly. Over time, design tools and development environments will become much more tightly integrated, and one-click design-to-code workflows will likely become far more common.

                                            ------

                                            5. What to do after exporting code5. What to do after exporting code

                                            5.1 Test locally5.1 Test locally

                                            Once you have the code, open it in your local IDE and test it:Once you have the code, open it in your local IDE and test it:

                                            1. Create or open a projectCreate or open a project
                                            2. bash
                                               # For plain HTML, open it directly in the browser open index.html # For React/Vue projects npm install npm run dev
                                              
                                              1. Collaborate with your AI IDECollaborate with your AI IDE
                                              2. Import the generated code into Trae or another AI IDEImport the generated code into Trae or another AI IDE
                                              3. Ask AI to help fix layout issues or add interactionsAsk AI to help fix layout issues or add interactions
                                              4. 5.2 Common issues5.2 Common issues

                                                StageProblemSolution
                                                LayoutElements are misalignedCheck display, position, and container structure
                                                StylesColors do not matchUse browser devtools to inspect the actual applied values
                                                Responsive behaviorMobile layout breaksAdd or refine media-query breakpoints
                                                InteractionButtons do nothingCheck JavaScript event bindings

                                                ------

                                                6. How to choose between the three paths6. How to choose between the three paths

                                                6.1 Comparison6.1 Comparison

                                                DimensionPath 1: Multimodal AIPath 2: Platform featuresPath 3: MCP
                                                Ease of getting startedโญ Easyโญโญ Moderateโญโญโญ More complex
                                                Fidelityโญโญโญ Mediumโญโญโญโญ Highโญโญโญโญโญ Highest
                                                Flexibilityโญโญโญโญโญ Highโญโญโญ Mediumโญโญโญโญ Fairly high
                                                Automationโญโญ Lowโญโญโญ Mediumโญโญโญโญโญ High
                                                CostLowMediumLow

                                                6.2 Recommendations6.2 Recommendations

                                                Choose Path 1 ifChoose Path 1 if

                                                • You need to validate an idea quicklyYou need to validate an idea quickly
                                                • Your design tools change oftenYour design tools change often
                                                • Perfect fidelity is not criticalPerfect fidelity is not critical
                                                • Your budget is limitedYour budget is limited

                                                Choose Path 2 ifChoose Path 2 if

                                                • Your team mainly uses Figma or MasterGoYour team mainly uses Figma or MasterGo
                                                • You need high-fidelity outputYou need high-fidelity output
                                                • Designers and developers collaborate frequentlyDesigners and developers collaborate frequently
                                                • You are willing to pay for Pro tooling when neededYou are willing to pay for Pro tooling when needed

                                                Choose Path 3 ifChoose Path 3 if

                                                • You want the highest degree of automationYou want the highest degree of automation
                                                • You have the technical ability to configure MCPYou have the technical ability to configure MCP
                                                • The project iterates from design to code frequentlyThe project iterates from design to code frequently
                                                • You want a standardized design-development workflowYou want a standardized design-development workflow

                                                ------

                                                7. Summary7. Summary

                                                In this chapter, you learned the three core paths from design prototype to code:In this chapter, you learned the three core paths from design prototype to code:

                                                1. Direct multimodal AI conversion: flexible and fast, ideal for early validationDirect multimodal AI conversion: flexible and fast, ideal for early validation
                                                2. Platform-native capabilities: higher fidelity and a better fit for professional design workflowsPlatform-native capabilities: higher fidelity and a better fit for professional design workflows
                                                3. MCP protocol integration: the most automated path, and likely the direction of future workflowsMCP protocol integration: the most automated path, and likely the direction of future workflows
                                                4. ๐Ÿ’ก Tips Praktis๐Ÿ’ก Pro Tip

                                                  - If you are new: start with Path 1 for speed - For team collaboration: use Path 2 to preserve design consistency - For maximum efficiency: experiment with Path 3 and build an automated workflow - Use them together: switch between paths depending on the project stage- If you are new: start with Path 1 for speed - For team collaboration: use Path 2 to preserve design consistency - For maximum efficiency: experiment with Path 3 and build an automated workflow - Use them together: switch between paths depending on the project stage

                                                  ------

                                                  ReferencesReferences

                                                  • [Figma and MasterGo Basics](../figma-mastergo/)[Figma and MasterGo Basics](../figma-mastergo/)
                                                  • [Let's Build Hogwarts Portraits](../hogwarts-portraits/)[Let's Build Hogwarts Portraits](../hogwarts-portraits/)
                                                  • [MCP Official Documentation](https://modelcontextprotocol.io/)[MCP Official Documentation](https://modelcontextprotocol.io/)
                                                  • [Figma Make Documentation](https://help.figma.com/hc/en-us/sections/360007453634-Figma-Make)[Figma Make Documentation](https://help.figma.com/hc/en-us/sections/360007453634-Figma-Make)
                                                  • [MasterGo AI Tutorials](https://mastergo.com/tutorials)[MasterGo AI Tutorials](https://mastergo.com/tutorials)