{"_id":"pi-figma-kit","_rev":"12-b7273488857e8d6139ca211e3d50c53a","name":"pi-figma-kit","dist-tags":{"latest":"0.3.9"},"versions":{"0.0.0-stage":{"name":"pi-figma-kit","version":"0.0.0-stage","_id":"pi-figma-kit@0.0.0-stage","stub":true,"maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"dist":{"shasum":"28ffe3b7d2791454d631f28065cb1e45134fcc7c","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-hurg3LvnTDgQWDvfnBEqDPAqC5IXevJQnqsif63e7CZGsmCJaWo9khYUcAohGR2Vn3EZ/ypv+09TXhDNKLZg+A==","signatures":[{"sig":"MEUCIC8ujyFpsqCp/hCoi21j8qWqQzLAHORugyK7KapTB7uNAiEA4gpIr4+Hhebv/YtIekRjR4MoKyCBiWcS9NtRwUd2cas=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":334},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"0.2.1":{"name":"pi-figma-kit","version":"0.2.1","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.2.1","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"f386bbf5be6f5983e6c9a4b383dbffb687a2722c","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.2.1.tgz","fileCount":23,"integrity":"sha512-BC9EDBemDMw9gR7KPIG6wUjLaJlfBjwnpfbMxMNZ+0qPEsg/B+lk7BnCDmjfF09gH+tiUqjPHWL0svHFO9sDnA==","signatures":[{"sig":"MEUCIQD3zkZa3c3LBDfNivh8UqcDY/2K2ud9RCtg0u2Mj+eshAIgQafce3qSbEdo1LYTxG/Zy8IFV1OsFV2nVvC3l/B2Fyc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIB4Y4I5Y0yvoDOYrHHWp+UcuXIAPRBG08JcNipNTXFK8AiEA+7VYbik1385tBQnpW8LhPScDQ+FM+4mC/4Hje4/p8NE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":122842},"gitHead":"058f714c7a5821be1c1cf0cfcff0cc28f1e5fa70","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 33 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to the Figma desktop MCP serve","directories":{},"_nodeVersion":"22.23.4","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.2.1_1793015028506_0.006250260136487329","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"pi-figma-kit","version":"0.3.0","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.0","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"50618214c2a4711c4cba4e9aef77abe9fa46178c","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.0.tgz","fileCount":27,"integrity":"sha512-5FKY+RjrItKHDaHquSBXP5oJfXTHCfDFBTN8QMwL0uAMb6FWmgsJd0Wuq3AaQUZRpddoRNiqRzkcs6E79NpCdA==","signatures":[{"sig":"MEUCIQDchbjYjBUBdIM0dltznNsqFAT8dVF0jP0dFgeAxFNuhgIgeUpmWuuXEOeVBZNob4FaYLQebU7HIkMuWRIGY1Dvd1M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCOxCT96RhGTYkKYe8Fo67uRW2kVJwCD+/nuzpLDz/CTAIgNBlmSmaEcEyDOBv1Bo1nX53seYTMNwaQasR9Qgkl/Xo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":179174},"gitHead":"e93c1272016322e6ea7f8264b918e6223b82020e","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.0_1793394330278_0.9514929254701997","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"pi-figma-kit","version":"0.3.1","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.1","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"b1f81ff6c8af381ba118f7716c75d128fc76348b","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.1.tgz","fileCount":27,"integrity":"sha512-8PE6y3XWxhx+n3FYFYCUrzpi3VR/qitaB7rtmntOPocyoSUxk1/rT5weXxA8MbT04vWswaW9C4uQwPEWHpr5dA==","signatures":[{"sig":"MEUCIQCWsnldLxUl3AA39g9yCtG+j+u3cfOyXuqcqrVtRTWp4wIgFEUXSlfYbcnZSabxNLI4SW8+Z2i7RbUXhhWL5Qoi4sQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIGSe0s+OkifmFGkRZ9J3iX2ISnoVM3WkuMK0NmvEt27gAiEAoV5ehEQpE//Op8K7OK7QXeqoEuK0/I+zqekiNgowkw8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":179297},"gitHead":"16bbb505d5f271201180c7ac5a4e5b9515c1050e","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.1_1793414453978_0.5754457765675755","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"pi-figma-kit","version":"0.3.2","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.2","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"9ee37d8363033a985e2225c5ede37443f29f0c4c","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.2.tgz","fileCount":27,"integrity":"sha512-Ri4G13SmQwHFcdfFvrSkR+3FmjX7dc0tp+97f4k0JXuoN/w/94z64zB/zQGLBzzGBLbnoua2y8X+cz2lLG5zlQ==","signatures":[{"sig":"MEQCIHs86VnxjAXUCERTYCsUx5kUdI9bhU8X9bnMCofFMitQAiAlh+iJM53rvgkZMCRXVGF0JOTIFvcXnhjxZ3ZXcK6LTw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICt5xyQXKYobYN1kc0NUUpoa9orGDK9c+b1RfhDQCiA0AiAIh6E3dkdA3GUHnAK9JHNMyoVAVVrx/sTs7uDsKUStjQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":179522},"gitHead":"1826076ba392a6a720de924fcfde341382d896c7","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.2_1793452810358_0.1349091618119581","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"pi-figma-kit","version":"0.3.3","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.3","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"0d1641c195013abf1fb4af8144ac8248e5b74c84","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.3.tgz","fileCount":27,"integrity":"sha512-gJMkG67fhPitLapb2FZcrICsGfjKWkwKZj7G3wSjYuy7ewHklcqtp21nDyYzVnc8nlu1HP3FAKagomp7u7ucKw==","signatures":[{"sig":"MEUCIFTfOv8vAXTcQvJGVU559cNwMsLTuJpJH4N8IXZLXh5ZAiEAlrr5f9d8jOqtzj3bRfIGBDyBd13OMxvyzWB3O1eLJpk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDJL/VQYHn/7HLwQUPwhES26L4HPRp2Mzd6BwAEYTO2xgIhANTBzSavS+u0xkO9rgtyelOmDQReSG+Q5/e/ysrhdD+3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":179743},"gitHead":"0e21514252218ded0c5f7fe1d7bfc73caaa94fdd","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.3_1793522891319_0.9881411917233315","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"pi-figma-kit","version":"0.3.4","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.4","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"eebd051631662594c74dbbe3aa007f34a958559a","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.4.tgz","fileCount":27,"integrity":"sha512-SmOx390Z2DPIO90oTVkwUQ7fvJXGDpgGbt24StVKzIByVIsEY8zOPG84QPPMOUnVcPRuFg6w895xzCgQEQlJIQ==","signatures":[{"sig":"MEQCICcyEb10p9hGSvOhxdni/C+Bnctt9h6QAgAFd46QbRcBAiAzB2eVhSaa8KzZRIsbQKPBmVQTlyOHmSyo6M4AIC0nYg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDwMKjC6b4ZYMHK+PgH9Hcpox43ncSDLN5F3hI2rvjNrAIhALCoGaW2Mq0ItHc5Lb+m0RJX0cOY+6nszPoe+HL5vRf3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":179743},"gitHead":"4d9ed0982f2b17b6dc2ab8e853f3dc0f1e19e19b","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.4_1793530388394_0.9042102319278732","host":"s3://npm-registry-packages-npm-production"}},"0.3.5":{"name":"pi-figma-kit","version":"0.3.5","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.5","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"a6fc6bb842b9373af845f0ba2fb32a3490dd6b82","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.5.tgz","fileCount":27,"integrity":"sha512-ojhD77mPtLy+B+6XcalPqFLh/RO8MqjLiTKVhzUrcK8yZJ2Z0Z+50/lFB8fNTUhwtIlZZvsQleBLsGy2STif8A==","signatures":[{"sig":"MEYCIQD/B4y4K9dtS41MtCMMZEKdgz/TYevgTdu04ilY3uzHOgIhAMJI+3Hwg0cNJTWBAPwgWpdCdFfcPrlHIA79ZdTCp5+L","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCctUj9CI7lEmGnKxlX6mhvr5yXGnYqaH6LP0NFvXDorgIhAPfQtBD8pUKWt7kaAVFrhaUc2tDphqVVT0xyhPUMaK9u","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":180306},"gitHead":"490ecb8b1a584ccc65036a866e5074923cd7c0b6","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.4.0","@earendil-works/pi-coding-agent":"^1.4.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.5_1793598105924_0.7897138605015109","host":"s3://npm-registry-packages-npm-production"}},"0.3.6":{"name":"pi-figma-kit","version":"0.3.6","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.6","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"55652859fae70d17390547fa45e5197a88e9ea8d","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.6.tgz","fileCount":27,"integrity":"sha512-WbE+fWH8/dRsMwSZeN2sybWsPlhhQ/oPONGtSy5Mn3EMgiHwBtxgpGilOFHMzskm8bUUaUolibhNfz40OrnTCQ==","signatures":[{"sig":"MEQCIB3+01+6ixiJHBL3GovgQBAJ3TFN/82d3qCo9T+V0cU5AiB2Np2+P1qhaxQjSHwG0B4HFGXk/GjPQbIN78OZFh+cmg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIHDkrBnWosFQ0hlUa+D7Ea0p9J4cSAeVMRQ7BD5Q0XmGAiEAimVHC0Y2C57/ZBPege3q1M2ks/kLwzBlKLWRdR0EP74=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":180369},"gitHead":"6c9b8179b51b56ae06cd3e6655dfb5e057f44cad","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.5"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"^1.4.6","@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.5.0","@earendil-works/pi-coding-agent":"^1.5.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.6_1794215731958_0.07919421360207024","host":"s3://npm-registry-packages-npm-production"}},"0.3.7":{"name":"pi-figma-kit","version":"0.3.7","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.7","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"ee23cf64df602fbf5f094afbdf72a4bd6c4166cd","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.7.tgz","fileCount":27,"integrity":"sha512-0kJrhZQJA7ZYlrGx+DHqn0XEP6we12EVLkT8HavHTQE3o/O8ufwOpzdp4iC4VwEvkyzUMr4GYjWOhE/rpwvL7Q==","signatures":[{"sig":"MEYCIQC23QMATg7n+nbfqHqoxJZO+a5C0WHOP0sNnGIFQvdMcQIhANY/ao6Uv4GgZx+4C7zlpjBtjFC08qIfH3abrU2XWZI3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIA3O7uLpQ2PUtAC/z+3PIpKzF1MJv5QsvV7AceG7YTXkAiEAuZKqm+ipvnP9ubwbPP4s9UzNTnTXG5rEY6QgaFxS3CQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":180369},"gitHead":"5ae35ae315aa773420952033341edd06b96d6f05","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.6"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"^1.4.6","@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.5.2","@earendil-works/pi-coding-agent":"^1.5.2"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.7_1794387356082_0.5684962837965218","host":"s3://npm-registry-packages-npm-production"}},"0.3.8":{"name":"pi-figma-kit","version":"0.3.8","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"author":{"name":"sorinirimies"},"license":"MIT","_id":"pi-figma-kit@0.3.8","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"pi":{"extensions":["./extensions/figma.ts"]},"dist":{"shasum":"8459e1f6b1ae807a341f0ed313d594e2d627c426","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.8.tgz","fileCount":27,"integrity":"sha512-cygm1wUTzLCZWgQMDEP+yuhGWqPaC3g7Uf0Pr/iEyp6ItG9pP9DAfe5sa+X5nEnGuS/Wua5rDiRNewWgLr7spQ==","signatures":[{"sig":"MEUCIEwNXmqQ0FDc/aolRXx9Yrkc03ANHLTEpTdB/bADISfDAiEA16Vwyz/CytsoWWaEs/ndR8ydLGzJ7SSrd129ZL/rjVo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCLz9HasmeWJccfWf52R/GtLSehygG7Wh51owhxV/yMxQIgVG1YTOmAD5KWKCY1sTxYbXodR7LAVQKxUP3tUcLoP28=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":180369},"gitHead":"c50315e61d6ef5db523ce9abe9623cb2aca910fd","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.7"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"^1.4.6","@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.5.2","@earendil-works/pi-coding-agent":"^1.5.2"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-figma-kit_0.3.8_1794475530074_0.622020560051835","host":"s3://npm-registry-packages-npm-production"}},"0.3.9":{"pi":{"extensions":["./extensions/figma.ts"]},"_id":"pi-figma-kit@0.3.9","bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"dist":{"shasum":"6fb2e808ba475b78e7124e5771ecce91b23d6c3d","tarball":"https://registry.npmjs.org/pi-figma-kit/-/pi-figma-kit-0.3.9.tgz","fileCount":27,"integrity":"sha512-13Ob47vxLYKpOt532HBu+xp5zZpp2xFKeC2C1ZYh5Ny9wAEvj9l4S1Yd9U4h/WOJ/+DF516HtiX3Upf5E08Rhg==","signatures":[{"sig":"MEYCIQDYbZ8KZt1Op6KeoS1EPZ5NTV6WnTZcdVHe2fw3G48mxgIhAJ2GGkRLvJervybIZNm/1Uql4VFxEsOdciG6dCuTwzsz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDrAIlQNaRvVEYN5pwvX2XaznOattGflwW5EcWEN6VQsAiEA8SSeBj70kbRcRk1GQGkFpA/n1ZnG17CBejsiYUxci7E="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pi-figma-kit@0.3.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":180369},"name":"pi-figma-kit","author":{"name":"sorinirimies"},"gitHead":"48296d7786613e1c544c68dd56ce194d3dc16775","license":"MIT","scripts":{"fuzz":"FUZZ_ITERS=20000 bun test tests/fuzz.test.ts --config=bunfig.fuzz.toml","test":"bun test","audit":"bun audit","check":"nu scripts/ci/quality_gate.nu","typecheck":"tsc --noEmit"},"version":"0.3.9","_npmUser":{"name":"greenspand","email":"mihaiirimies@gmail.com"},"homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"overrides":{"undici":"8.12.3","minimatch":"11.0.3"},"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"_npmVersion":"10.9.9","description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","directories":{},"maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"_nodeVersion":"22.23.4","dependencies":{"arrow-resilience-kit":"^0.10.8"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"^1.4.7","@types/bun":"^1.4.4","typescript":"^7.0.2","@earendil-works/pi-ai":"^1.5.2","@earendil-works/pi-coding-agent":"^1.5.2"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-figma-kit_0.3.9_1794733118977_0.580166841660354"}}},"time":{"created":"2026-10-26T11:42:27.999Z","modified":"2026-11-15T08:58:39.545Z","0.0.0-stage":"2026-10-26T11:42:27.999Z","0.2.1":"2026-10-26T11:43:48.600Z","0.3.0":"2026-10-30T21:05:30.467Z","0.3.1":"2026-10-31T02:40:54.071Z","0.3.2":"2026-10-31T13:20:10.530Z","0.3.3":"2026-11-01T08:48:11.415Z","0.3.4":"2026-11-01T10:53:08.480Z","0.3.5":"2026-11-02T05:41:46.027Z","0.3.6":"2026-11-09T09:15:32.030Z","0.3.7":"2026-11-11T08:55:56.178Z","0.3.8":"2026-11-12T09:25:30.165Z","0.3.9":"2026-11-15T08:58:39.094Z"},"bugs":{"url":"https://github.com/sorinirimies/pi-figma-kit/issues"},"author":{"name":"sorinirimies"},"license":"MIT","homepage":"https://github.com/sorinirimies/pi-figma-kit#readme","keywords":["pi-package","pi-extension","figma","design","design-tokens","codegen","compose","tailwind","mcp"],"repository":{"url":"git+https://github.com/sorinirimies/pi-figma-kit.git","type":"git"},"description":"Pi extension: 35 Figma tools (design context, HTML/React/Tailwind/Compose codegen, screenshots, visual diff, version diff, assets, design tokens, prototype flows, comments) and a /figma project browser, over the Figma REST API, with an optional bridge to ","maintainers":[{"name":"greenspand","email":"mihaiirimies@gmail.com"}],"readme":"# pi-figma-kit\n\n[![npm](https://img.shields.io/npm/v/pi-figma-kit.svg)](https://www.npmjs.com/package/pi-figma-kit)\n[![npm downloads](https://img.shields.io/npm/dm/pi-figma-kit.svg)](https://www.npmjs.com/package/pi-figma-kit)\n[![CI](https://github.com/sorinirimies/pi-figma-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/sorinirimies/pi-figma-kit/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Audit](https://github.com/sorinirimies/pi-figma-kit/actions/workflows/security.yml/badge.svg)](https://github.com/sorinirimies/pi-figma-kit/actions/workflows/security.yml)\n[![Fuzz](https://github.com/sorinirimies/pi-figma-kit/actions/workflows/fuzz.yml/badge.svg)](https://github.com/sorinirimies/pi-figma-kit/actions/workflows/fuzz.yml)\n\nFigma for [pi](https://github.com/earendil-works/pi-coding-agent): **35 `figma_*` tools** and a `/figma` command that let the agent explore your Figma files, read designs as compact CSS-annotated trees, look at renders, export assets and design tokens, and generate **HTML / React / Tailwind / Jetpack Compose** scaffolds. You can also browse your teams, projects and files from inside pi.\n\nIt talks to the **Figma REST API** directly: no desktop app, no separate MCP server process, nothing to keep running. Works with any file you can open, including ones you only have view access to. If the Figma desktop app is running, an optional **bridge** adds live selection, Dev Mode and Code Connect.\n\n<img src=\"examples/vhs/generated/overview.gif\" alt=\"pi-figma-kit: /figma whoami, then the agent explores the file, generates Compose code and exports design tokens\" width=\"900\">\n\n## Features\n\n- **30 REST tools + 3 desktop tools:** explore files, read designs, render and export, tokens, flows, comments, dev resources.\n- **Design → code:** a compact CSS-annotated tree and generators for **HTML, React, Tailwind and Jetpack Compose**.\n- **Design tokens:** variables (multi-mode, aliases) or styles as **CSS custom properties, JSON or a Tailwind theme**.\n- **Sees the design:** renders frames and shows them to the model inline; exports SVG, PNG, JPG and PDF into your project.\n- **`/figma` browser:** team → project → file → frame, then straight to the agent.\n- **Desktop bridge (optional):** the frame you have selected in Figma, Dev Mode snippets and Code Connect.\n- **Safe by default:** read-only unless you ask; token in a `600` file; **zero runtime dependencies**; no telemetry.\n- **Tested:** 95%+ coverage gate, seeded fuzzing, dependency audit.\n\n- [Install](#install) · [Authentication](#authentication) · [How it works](#how-it-works) · [Tools](#tools) · [`/figma` command](#figma-command) · [Workflows](#workflows) · [Design translation](#design-translation) · [Limits](#limits) · [Security](#security-notes) · [Development](#development) · [Releases](#releases)\n\n## Install\n\nFrom npm:\n\n```bash\npi install npm:pi-figma-kit\n```\n\nOr from git:\n\n```bash\npi install git:github.com/sorinirimies/pi-figma-kit\n```\n\nTry it without installing: `pi -e ./extensions/figma.ts` from a checkout.\n\n## Authentication\n\nCreate a **personal access token**: Figma → *Settings* → *Security* → *Personal access tokens*. Scopes by feature:\n\n| Scope | Needed for |\n|---|---|\n| `file_content:read` | design context, code, screenshots, assets, search, flows, text |\n| `file_metadata:read` | file meta |\n| `file_comments:read` / `file_comments:write` | `figma_get_comments`, `figma_post_comment`, `figma_delete_comment` |\n| `file_versions:read` | `figma_get_versions`, `figma_diff` |\n| `library_content:read` | components, styles (file, team and by key) |\n| `file_variables:read` (+ `:write`) | variables, token export, `figma_update_variables` (**Enterprise plans**) |\n| `file_dev_resources:read` / `:write` | Dev Mode resources |\n| `projects:read` | `figma_list_projects`, `figma_list_files`, `/figma` browser |\n| `current_user:read` | `figma_whoami`, `/figma login` check |\n\nThen either:\n\n```bash\nexport FIGMA_ACCESS_TOKEN=figd_...      # also FIGMA_TOKEN / FIGMA_API_KEY; wins over the saved token\n```\n\nor inside pi: `/figma login figd_...`, saved to `~/.pi/agent/figma.json` (file mode `600`). OAuth tokens (`figu_…`) are sent as `Authorization: Bearer`, personal tokens as `X-Figma-Token`.\n\n## How it works\n\n```\n you / the agent                       pi-figma-kit (in pi's process)                         Figma\n┌──────────────────┐   tool call   ┌─────────────────────────────────────────────┐        ┌────────────┐\n│ \"implement this  │ ────────────▶ │ tools/   parse URL → file key + node id     │        │            │\n│  frame ...\"      │               │    │                                        │  REST  │ api.figma  │\n│                  │               │    ▼                                        │ ─────▶ │   .com     │\n│                  │               │ core/api  auth · 60 s GET cache · 429 retry │ ◀───── │            │\n│                  │ ◀──────────── │    │                                        │  JSON  │            │\n│  compact text,   │   text/image  │    ▼                                        │        └────────────┘\n│  images, files   │               │ design/  Figma JSON → CSS → DNode tree      │\n└──────────────────┘               │          → outline / HTML / React / TW /    │\n                                   │            Compose / tokens / flows         │\n                                   └─────────────────────────────────────────────┘\n```\n\n1. **Registration.** On load, the extension registers every tool with pi (`pi.registerTool`) and the `/figma` command. The saved config is read lazily on first use, so startup is instant and does no network I/O.\n2. **Addressing.** Every tool takes a Figma **URL or file key**. A URL's `?node-id=12-34` (or branch URL) is parsed into file key + node id `12:34`, so you can paste a link from Figma's *Copy link to selection* and the agent sees exactly that frame.\n3. **Fetching.** `core/api.ts` is a thin REST client: token header, per-URL GET cache (60 s, so exploring the same file repeatedly costs one request), and error messages that tell you what to fix (bad token, missing scope, wrong key). Network resilience comes from [arrow-resilience-kit](https://github.com/sorinirimies/arrow-resilience-kit): a `429` is retried after exactly the `Retry-After` Figma sends (up to 10 s), GETs also retry `502`/`503`/`504` and network errors with capped backoff (writes never retry blindly), and pressing Esc cancels a pending wait. The desktop bridge sits behind a circuit breaker: when the app hangs or is gone, calls fail fast for 15 s instead of each waiting out the timeout.\n4. **Simplifying.** The raw Figma node JSON is huge and noisy. `design/simplify.ts` walks it and produces a **DNode tree**: hidden layers dropped, depth and node budget enforced, auto-layout turned into flex, paints into CSS, text into typography (including mixed-style runs), instances annotated with their component names, applied styles by name, and icon-only subtrees collapsed into a single *SVG asset* so you export them instead of rebuilding vectors.\n5. **Emitting.** From the DNode tree the tools render a compact **outline** (`figma_get_design_context`), or generate code (`figma_generate_code` → HTML+CSS, React, Tailwind, Compose). Tokens (`figma_export_tokens`) and prototype flows (`figma_get_prototype_flows`) have their own translators.\n   Values bound to a Figma variable (or a named fill/stroke style) come out as `var(--token, literal)` with the same names `figma_export_tokens` defines, so generated code uses your tokens instead of hardcoded hex/px. Compose keeps literals and lists the tokens in a comment. Variable names need Enterprise (`file_variables:read`); without it, styles still map.\n6. **Seeing and exporting.** `figma_get_screenshot` asks Figma to render nodes, downloads the PNG/JPG, **returns it inline as an image** the model can look at, and saves it. `figma_download_assets` writes SVG/PNG/JPG/PDF files into your project.\n7. **Responses are bounded.** Output is truncated at 60 000 characters with a hint to lower `depth` / `max_nodes`, so one huge frame can't blow the context.\n\nThe code layout mirrors that pipeline:\n\n```\nextensions/\n  figma.ts            wiring only: registers the tools and /figma\n  core/               url parsing · config (token) · REST client · mcp.ts (desktop MCP client)\n  design/             css.ts (Figma → CSS) · simplify.ts (DNode tree + outline) · codegen.ts (HTML/React/Tailwind)\n                      compose.ts (Jetpack Compose) · tokens.ts (CSS/JSON/Tailwind) · flows.ts (prototype graph)\n  tools/              read.ts · assets.ts · system.ts · browse.ts · extra.ts · desktop.ts · util.ts · index.ts\n  command/            /figma\n```\n\n## Tools\n\nEvery `file` argument accepts a Figma URL (its `node-id` is used automatically) or a file key. `node_ids` accept `1:2` or `1-2`.\n\n### Explore\n\n| Tool | What it does |\n|---|---|\n| `figma_get_file_structure` | Pages and top-level frames with ids, sizes and URLs. **Start here.** |\n| `figma_search_nodes` | Find nodes by name or text, as substring or `/regex/`, filtered by type |\n| `figma_get_file_meta` | Name, folder, creator, last editor, link access, no document download |\n| `figma_get_versions` | Version history |\n| `figma_diff` | What changed in a node between versions (`from`: version id or `YYYY-MM-DD`, default: last saved version → now): added/removed/moved nodes, text, component and CSS changes |\n| `figma_list_projects` / `figma_list_files` | Team → project → file |\n| `figma_get_prototype_flows` | Flow starting points and every interaction (trigger → destination / URL / back) |\n\n### Read designs and generate code\n\n| Tool | What it does |\n|---|---|\n| `figma_get_design_context` | Compact tree with layout, fills, gradients, borders, radii, shadows, blurs, typography, text runs, component and style names, and icon / image-fill detection. `outline` or `json`. |\n| `figma_generate_code` | Scaffold as `html`, `react`, `tailwind` or `compose` (Kotlin, with imports) |\n| `figma_get_text` | All text of a node with ids, sizes and layer path: copy deck / i18n strings |\n| `figma_get_node_raw` | Raw REST JSON for nodes (constraints, interactions, bound variables…) |\n\n### See and export\n\n| Tool | What it does |\n|---|---|\n| `figma_get_screenshot` | Render nodes; PNG/JPG shown inline (up to 4) and saved, SVG/PDF saved |\n| `figma_download_assets` | Export nodes as `svg` / `png` / `jpg` / `pdf` into the project (`scale` 1–4) |\n| `figma_download_image_fills` | Download original bitmaps by `imageRef`; without refs, lists them |\n| `figma_compare` | Pixel-diff a PNG screenshot of your implementation against the node, rendered at the screenshot's width: mismatch %, differing regions, Figma render + diff image |\n\n### Design system\n\n| Tool | What it does |\n|---|---|\n| `figma_export_tokens` | Variables (or styles as fallback) → **CSS custom properties**, **JSON** or **Tailwind** theme. Multi-mode (`[data-mode=\"Dark\"]` overrides), aliases become `var()`. |\n| `figma_get_variables` / `figma_get_published_variables` | Variable collections, modes and values (Enterprise) |\n| `figma_get_styles` | File styles resolved to CSS values |\n| `figma_get_team_styles` | Team library styles |\n| `figma_get_components` | Components and component sets of a file or a team library, with search |\n| `figma_get_component` / `figma_get_style` | Look up one published component, component set or style by key |\n| `figma_update_variables` | **Write.** Raw create/update/delete of variables (Enterprise) |\n\n### Collaboration\n\n| Tool | What it does |\n|---|---|\n| `figma_get_comments` | Threads with replies, resolved state and anchored node |\n| `figma_post_comment` | **Write.** New comment (optionally on a node) or reply |\n| `figma_delete_comment` | **Write.** Delete a comment |\n| `figma_get_dev_resources` / `figma_create_dev_resource` | Dev Mode links on nodes; attach a PR or source file to a node (**write**) |\n\n### Figma desktop bridge (optional)\n\n| Tool | What it does |\n|---|---|\n| `figma_desktop_selection` | Design context (+ optional screenshot) of the frame **currently selected** in the Figma app, or of a node id; accepts language/framework hints |\n| `figma_desktop_call` | Call any tool of the desktop MCP server (`get_design_context`, `get_metadata`, `get_screenshot`, `get_variable_defs`, `get_code_connect_map`, …) |\n| `figma_desktop_tools` | List the desktop server's tools with their schemas; doubles as a connectivity check |\n\nThese talk to Figma's own MCP server running in the desktop app (default `http://127.0.0.1:3845/mcp`, MCP Streamable HTTP; JSON and SSE replies are both handled). They give you what REST can't: **live selection, Dev Mode snippets and Code Connect**. Enable it in Figma: *Dev Mode → \"Enable desktop MCP server\"* (needs a Dev or Full seat). If the app isn't running, only these three tools fail, with a message saying so; everything else keeps working. Override the URL with `FIGMA_MCP_URL` or `\"desktopUrl\"` in `~/.pi/agent/figma.json`. Tool names and arguments come from your Figma version, so call `figma_desktop_tools` first.\n\n### Utility\n\n`figma_whoami` (token check) and `figma_parse_url` (no network).\n\n> Tools marked **Write** change the Figma file/comments. Their descriptions tell the model to use them only when you ask.\n\n## `/figma` command\n\n```\n/figma                       interactive browser: team → project → file → frame, then sent to the agent\n/figma login <token>         save a token (checks it with /v1/me)\n/figma logout\n/figma whoami                checks the REST token and whether the desktop bridge is reachable\n/figma team <id|url>         add a team to the browser\n/figma teams                 list configured teams\n/figma tools                 list all figma_* tools (read / write)\n/figma open <url>            the agent inspects and summarizes a link\n/figma implement <url> [instructions]   fetch the design and implement it in the current project\n```\n\nFigma has **no endpoint that lists your teams**, so add one once with `/figma team 123456789` (the id is in `figma.com/files/team/<ID>/…`, a full URL works too). The browser then lists its projects and files, shows each file's frames, and sends your pick to the agent.\n\n## Workflows\n\n**Implement a screen**\n\n```\n/figma implement https://www.figma.com/design/KEY/App?node-id=12-34 as a Compose screen using our theme\n```\n\nThe agent typically runs `figma_get_design_context` → `figma_get_screenshot` (to see it) → `figma_export_tokens` / `figma_get_styles` (to map colors and type to your theme) → `figma_download_assets` (icons as SVG) → writes the code → screenshots it and checks it with `figma_compare`.\n\n**Tokens to code**\n\n> Export the Figma variables of `KEY` as CSS and write them to `src/tokens.css`.\n\n**Review a design**\n\n> Summarize the open comments on `KEY` and list which frames they refer to.\n\n**Navigation graph**\n\n> From the prototype flows of `KEY`, generate the navigation routes for the app.\n\n**i18n**\n\n> Extract all text of the Settings frame into `strings.xml`.\n\n## Design translation\n\nWhat the deterministic translator covers:\n\n| Figma | Output |\n|---|---|\n| Auto layout (direction, gap, padding, alignment, wrap, fill/hug/fixed) | `display:flex`, `gap`, `padding`, `justify-content`, `align-items`, `flex` / `align-self` (Compose: `Column`/`Row`, `Arrangement`, `Alignment`, `weight`, `fillMax*`) |\n| Free-form frames | absolute children with `left`/`top` relative to the parent (Compose: `Box` + `offset`) |\n| Fills | solid, linear / radial / angular gradients, image fills (`cover`/`contain`/tile), stacked fills |\n| Strokes | `border` (per-side, dashed) or `outline` for outside strokes |\n| Corner radius | uniform, per-corner, ellipse → `50%` |\n| Effects | drop / inner shadows, layer blur, background blur |\n| Opacity, blend mode, rotation, clipping | `opacity`, `mix-blend-mode`, `transform`, `overflow:hidden` |\n| Text | family, size, weight, italic, line height, letter spacing, alignment, case, decoration, colour, **mixed-style runs** |\n| Instances / styles | component name and applied style names are attached to nodes |\n| Icons | vector-only subtrees collapse into one SVG asset |\n\nGenerated code is a **scaffold**: structure, spacing, colours and typography are faithful, but you (or the agent) still map it onto your design system's components.\n\n## Previews\n\nRecorded from a real pi with only this plugin loaded, against a **fake Figma** and a scripted model (no token, no network, no real files).\n\n**Browse** (`/figma`): team, project, file, frame, then the agent takes over:\n\n![Browsing teams, projects, files and frames](examples/vhs/generated/browse.gif)\n\n**Design context** (`figma_get_design_context`): a compact tree with layout, fills, gradients, text runs, instance and style names:\n\n![The agent inspects the Welcome frame](examples/vhs/generated/design.gif)\n\n**Code** (`figma_generate_code`, `html` / `react` / `tailwind` / `compose`): here Jetpack Compose with imports and modifiers:\n\n![Jetpack Compose generated from a frame](examples/vhs/generated/compose.gif)\n\n**Design tokens** (`figma_export_tokens`): Light and Dark modes, aliases kept as `var()`:\n\n![Design tokens exported as CSS custom properties](examples/vhs/generated/tokens.gif)\n\n**Explore** (`figma_get_file_structure`, `figma_get_prototype_flows`, `figma_get_comments`):\n\n![File structure, prototype flows and comments](examples/vhs/generated/explore.gif)\n\n**Desktop bridge** (`figma_desktop_selection`): what you have selected in the Figma app right now, with Code Connect:\n\n![The selected frame via the Figma desktop app](examples/vhs/generated/desktop.gif)\n\n**Tab-completion** uses pi's own menu, with a description for every option:\n\n![Autocomplete for /figma](examples/vhs/generated/completion.gif)\n\n## Limits\n\n- The REST tools have no live selection, Code Connect or Dev Mode snippets. Pass links with `node-id`, or use the [desktop bridge](#figma-desktop-bridge-optional) for those.\n- Variables and variable writes need a Figma **Enterprise** plan; `figma_export_tokens` falls back to styles otherwise.\n- Figma rate-limits per token. `429`s with a `Retry-After` of up to 10 s are retried after exactly that wait; longer ones are reported with the wait time.\n- Rendered images come from Figma's servers and expire; they are downloaded immediately.\n- Gradients/effects that CSS or Compose can't express exactly are approximated (Compose gradients are left as a `TODO` comment with the CSS value).\n\n## Demo recordings\n\nThe GIFs above live in [`examples/vhs/generated/`](examples/vhs/generated) and are stored with **Git LFS** (`git lfs install` once). They are recorded with [VHS](https://github.com/charmbracelet/vhs) from a **real pi** that loads only this extension, against `examples/vhs/mock-figma.ts` (a fake of the REST API and of the desktop MCP server, one fictional file) and `examples/vhs/mock-llm.ts` (a scripted model that calls the `figma_*` tools). `HOME` and the pi agent dir are redirected to `/tmp`, so nothing real is recorded.\n\n```sh\njust vhs-all          # every tape (examples/vhs/*.tape): needs vhs, ttyd, ffmpeg, pi, bun, python3\njust vhs-tape compose # one tape\njust vhs-list         # list the tapes\njust demo             # try it yourself in a real pi against the fake Figma\n```\n\n## Security notes\n\n- **Read-only by default.** Only the tools marked *Write* change anything in Figma, and the model is told to use them only on request.\n- **Token handling.** The token is read from the environment or `~/.pi/agent/figma.json` (mode `600`); it is only sent to `api.figma.com` (or `baseUrl` if you set one in that file). It is never logged or echoed in tool output.\n- **Files are written only where you point.** `figma_get_screenshot` defaults to a temp directory; `figma_download_*` write into `dir` (default `./assets`, relative to the project).\n- **No telemetry.** Zero runtime dependencies.\n\n## Development\n\n```bash\nbun install\njust check          # typecheck + tests + pack check + nushell tests (what CI runs)\njust test           # bun test only (with coverage)\njust coverage       # tests + a coverage table\njust fuzz           # randomised robustness tests: just fuzz [iterations] [seed]\njust audit          # bun audit: known vulnerabilities in dependencies\njust push-all       # push main to every configured remote; `just --list` shows pull-all, push-tags-all, release-all, the *-force and sync-gitea-* variants\n```\n\n**Coverage:** every `bun test` collects coverage (`bunfig.toml`) and **fails below 95% lines / 95% functions**. All Figma calls are mocked (`tests/fixtures.ts`), so tests need no token or network.\n\n**Fuzzing:** `tests/fuzz.test.ts` throws seeded random Figma nodes, variables, URLs and MCP replies at the translators and clients (they must never throw). A failure prints `FUZZ_SEED=…` to replay it. A short run is part of `bun test`; the **Fuzz** workflow runs 200 000 iterations nightly.\n\n**Audit:** the **Security** workflow runs `bun audit` nightly and on every dependency change.\n\nTo add a tool: write it in the matching file under `extensions/tools/` with `defineTool`, add it to that file's returned list, and add a test in `tests/extension.test.ts` (the first test pins the tool list).\n\nCI scripts are [nushell](https://www.nushell.sh) (`scripts/`), the same ones locally and in GitHub / Gitea Actions. `just --list` shows every task.\n\n## Releases\n\n| Workflow | When | What |\n|---|---|---|\n| **CI** | push / PR | quality gate (typecheck, tests with coverage, pack check, nushell tests) |\n| **Fuzz** | nightly (GitHub 04:00 UTC, Gitea 04:30), and when the extension changes | seeded randomised robustness tests (`tests/fuzz.test.ts`), 200 000 runs per property; a failure prints the seed that reproduces it |\n| **Security** | nightly (GitHub 03:00 UTC, Gitea 03:30), and when dependencies change | `bun audit`: fails on any known vulnerability |\n| **Nightly Dependency Update** | every night | `bun update` within ranges, verify, commit `chore(deps)`, then build, tag and publish a patch when something changed |\n| **Mirror GitHub** (Gitea) | hourly | Gitea has no nightly of its own: fast-forwards its `main` to GitHub's and pushes the new tags (starting Gitea's release for each), so the hosts never diverge; fails loudly if they did |\n| **Release** | tag `vX.Y.Z`, or run it with a bump | validates the tag against `package.json`, runs the gate, `npm publish` (idempotent, with provenance), creates the release |\n\nRelease from CI: **Actions → Release → Run workflow** with a bump (`patch`, `minor`, `major`), or `just release-ci minor`: runs the gate, bumps, writes the changelog, tags, pushes and publishes. Manual release: `just release patch` (or `minor` / `major` / `X.Y.Z`); `just release-all patch` pushes to every remote.\n\n**Secrets:** `NPM_TOKEN` (granular access token with publish rights and \"bypass 2FA\"). `GH_PAT` (classic PAT, `repo` + `workflow`: needed to auto-merge GitHub Actions bumps). Optional: `GITEA_TOKEN`.\n\nCommits follow [Conventional Commits](https://www.conventionalcommits.org); the changelog is generated by git-cliff.\n\n## Related plugins\n\nSmall [pi](https://github.com/earendil-works/pi-coding-agent) extensions by the same author:\n\n| Plugin | What it does |\n|---|---|\n| [**pi-tokenburn**](https://github.com/sorinirimies/pi-tokenburn) | Live token and cost counter in pi's footer, with charts and budgets |\n| [**pi-context-diet**](https://github.com/sorinirimies/pi-context-diet) | Drops stale tool results from the context when the prompt cache is cold |\n| [**pi-edit-first**](https://github.com/sorinirimies/pi-edit-first) | Steers the agent to targeted `edit` calls instead of whole-file rewrites |\n| [**pi-read-guard**](https://github.com/sorinirimies/pi-read-guard) | Blocks full reads of large files |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}