# astrimid - It feels like I'm fighting LLM again... Channel: #support Source: https://discord.com/channels/1233487248129921135/1529241486053478534 Started: 2026-07-21T21:39:42.807000+00:00 Last activity: 2026-07-22T13:40:10.991000+00:00 ## astrimid — 2026-07-21T21:39:42.208000+00:00 It feels like I'm fighting LLM again. This is schPinArrangement property of ``: ``` topSide: { direction: "left-to-right" as const, pins: [ "CS1", // Pin 1 (leftmost) "VFB1", // Pin 2 "VREG3", // Pin 3 "VFB2", // Pin 4 "CS2", // Pin 5 (rightmost) "TP", // Pin 21 ], }, ``` When I ask LLM to do counter clockwise, it seems to change both direction to "right-to-left" and reverse pins in a list. Is there a prompt that makes it do either pin reversal or change direction? ## astrimid — 2026-07-21T21:42:23.820000+00:00 Ok, LLM can generate a prompt, but can't follow it 😩 : ``` For the counter-clockwise layout, keep pins in ascending order (Pin 1, 2, 3, 4, 5) and use the direction property to control placement: - Top side: direction "right-to-left" (so Pin 1 appears on the left) - Right side: direction "bottom-to-top" (so Pin 6 appears on top) - Bottom side: direction "left-to-right" (so Pin 11 appears on the right) - Left side: direction "top-to-bottom" (so Pin 16 appears at the bottom) ``` ``` For the counter-clockwise layout, use direction "left-to-right" for all sides and reverse the pin order: - Top side: ["CS2", "VFB2", "VREG3", "VFB1", "CS1"] // Pin 5 to Pin 1 - Right side: ["DRVH2", "VBST2", "SW2", "PGOOD", "EN2"] // Pin 10 to Pin 6 - Bottom side: ["DRVL1", "VO1", "VREG5", "VIN", "DRVL2"] // Pin 15 to Pin 11 - Left side: ["EN1", "VCLK", "SW1", "VBST1", "DRVH1"] // Pin 20 to Pin 16 ``` ## astrimid — 2026-07-21T21:42:47.284000+00:00 it seems to overeager to help and uses both ## astrimid — 2026-07-21T21:44:07.498000+00:00 ``` For the counter-clockwise numerical layout: IMPORTANT: Choose EXACTLY ONE of these two methods, DO NOT combine them. METHOD A (Recommended): Use direction only - Keep ALL pins in ascending order (Pin 1, 2, 3, 4, 5) - Use ONLY the direction property to position them - DO NOT reverse the pin order in the pins array Top side: direction "right-to-left" → pins: ["CS1", "VFB1", "VREG3", "VFB2", "CS2"] Right side: direction "bottom-to-top" → pins: ["EN2", "PGOOD", "SW2", "VBST2", "DRVH2"] Bottom side: direction "left-to-right" → pins: ["DRVL2", "VIN", "VREG5", "VO1", "DRVL1"] Left side: direction "top-to-bottom" → pins: ["DRVH1", "VBST1", "SW1", "VCLK", "EN1"] OR METHOD B: Use pin order only - Keep ALL directions as "left-to-right" (or "top-to-bottom") - Reverse ONLY the pin order in the pins array - DO NOT change the direction properties Top side: direction "left-to-right" → pins: ["CS2", "VFB2", "VREG3", "VFB1", "CS1"] Right side: direction "top-to-bottom" → pins: ["DRVH2", "VBST2", "SW2", "PGOOD", "EN2"] Bottom side: direction "right-to-left" → pins: ["DRVL1", "VO1", "VREG5", "VIN", "DRVL2"] Left side: direction "bottom-to-top" → pins: ["EN1", "VCLK", "SW1", "VBST1", "DRVH1"] CONFIRM: You are using ONLY Method A OR ONLY Method B, not both. ``` ## astrimid — 2026-07-21T21:58:24.789000+00:00 ok. this might be correct prompt for top pins, but completely wrong for bottom pins ## astrimid — 2026-07-21T21:59:34.022000+00:00 It feels like I would specify it much faster manually. ## Seve — 2026-07-21T22:08:21.352000+00:00 what model are you using ## Seve — 2026-07-21T22:08:35.209000+00:00 we could try to improve the API to something that makes less mistakes ## Seve — 2026-07-21T22:08:43.117000+00:00 CC <@809856037376491570> related to some stuff you're doing ## astrimid — 2026-07-21T22:08:45.134000+00:00 this prompt seem to work ``` Create a counter-clockwise pin arrangement for a {PACKAGE_TYPE} package where Pin 1 is at the top-left corner. Package details: - Total pins: {TOTAL_PINS} (including thermal pad if applicable) - Pins per side: {PINS_PER_SIDE} - Pin 1 location: top-left corner - Thermal pad pin: {THERMAL_PIN_NUMBER} (if applicable, placed after the last pin on the top side) IMPORTANT: Follow Method A ONLY (do not combine with Method B). Method A (use direction property to control placement, keep pins in ascending order): For each side, use the direction property to position pins correctly: Top side: - direction: "right-to-left" - pins array: [{PIN_1}, {PIN_2}, ..., {PIN_N}, {THERMAL_PIN}] - This places Pin 1 on the LEFT and Pin N on the RIGHT - Thermal pad (if present) goes after Pin N Left side: - direction: "top-to-bottom" - pins array: [{PIN_N+1}, {PIN_N+2}, ..., {PIN_2N}] - This places Pin N+1 on TOP and Pin 2N on BOTTOM Bottom side: - direction: "left-to-right" - pins array: [{PIN_2N+1}, {PIN_2N+2}, ..., {PIN_3N}] - This places Pin 2N+1 on the LEFT and Pin 3N on the RIGHT Right side: - direction: "bottom-to-top" - pins array: [{PIN_3N+1}, {PIN_3N+2}, ..., {PIN_4N}] - This places Pin 3N+1 on BOTTOM and Pin 4N on TOP CRITICAL RULES: 1. DO NOT reverse the pin order in the pins array - keep them in ascending order (1,2,3,4,5...) 2. ONLY use the direction property to control visual placement 3. The resulting layout should have Pin 1 at top-left and go counter-clockwise: Top → Left → Bottom → Right 4. Pin numbers should be in ascending order around the package Generate the schPinArrangement object with these specifications. ``` ## astrimid — 2026-07-21T22:08:56.386000+00:00 I'm using deepseek ## astrimid — 2026-07-21T22:09:46.899000+00:00 maybe there's a simple clockwise and counter-clockwise pin arrangement preset for qfn chip footprint? ## astrimid — 2026-07-21T22:16:00.102000+00:00 Could probably define a simple helper function ``` const pinLabels16 = { pin1: "VCC", pin2: "GND", pin3: "EN", pin4: "FB", pin5: "SW", pin6: "PG", pin7: "VIN", pin8: "VOUT", pin9: "COMP", pin10: "SS", pin11: "CLK", pin12: "SYNC", pin13: "AGND", pin14: "PGND", pin15: "BOOT", pin16: "PH", } export const schPinArrangementQFN16 = generateQFNPinArrangement({ pinsPerSide: 4, pinLabels: pinLabels16, // thermalPadPin: undefined // No thermal pad }) ``` ## astrimid — 2026-07-21T22:29:13.380000+00:00 Maybe this API: ``` interface QFNConfig { pinsPerSide: number pinLabels: Record /** * The corner where Pin 1 is located. * This ALONE determines the orientation. */ pin1Corner: "top-left" | "top-right" | "bottom-right" | "bottom-left" /** * Direction of pin numbering around the package. * This ALONE determines the order. */ numberingDirection: "counter-clockwise" | "clockwise" thermalPadPin?: string } ``` OTOH, maybe schRotation is better for pin1Corner? ## astrimid — 2026-07-21T23:50:14.942000+00:00 Thinking a bit more, pin1corner is a bit confusing, maybe pin1side is better: ``` const schPinArrangementRightCounter = generateQFNPinArrangement({ pinsPerSide: 4, pinLabels: pinLabels16, pin1Side: "right", numberingDirection: "counter-clockwise", }) ``` ## astrimid — 2026-07-21T23:55:55.628000+00:00 My first package: https://tscircuit.com/astrimid/qfn-numbering-direction/blob/index.tsx Is there a way to mark it as an API package? Attachment: image.png — https://community.tscircuit.com/media/1529275768050548818 ## astrimid — 2026-07-21T23:57:12.173000+00:00 Also, it's a schematic only package. Is there a way to disable pcb? ## Seve — 2026-07-21T23:57:53.538000+00:00 congrats on the first package!!!! ## Seve — 2026-07-21T23:57:57.696000+00:00 yes you can disable pcb ## astrimid — 2026-07-22T00:06:22.605000+00:00 can't seem to find a way to do it. Is it some metadata? It seems even if I don't use ` ``` ## Rishabh — 2026-07-22T00:09:43.419000+00:00 `pcbDisabled` is passed in platformConfig ## astrimid — 2026-07-22T00:10:07.655000+00:00 platformConfig? where do I set it? ## Rishabh — 2026-07-22T00:10:25.006000+00:00 Are you using just the tscircuit.com editor, or the cli? ## astrimid — 2026-07-22T00:10:32.918000+00:00 tscircuit.com ## astrimid — 2026-07-22T00:12:03.528000+00:00 Type '{ children: Element[]; pcbDisabled: boolean; }' is not assignable to type 'BoardProps'. ## Seve — 2026-07-22T00:13:37.421000+00:00 oh do you want to use this locally? The web editor is a bit hard to use ## Seve — 2026-07-22T00:13:48.501000+00:00 normally you would edit tscircuit.config.json ## astrimid — 2026-07-22T00:16:32.272000+00:00 doesn't appear to have any effect Attachment: image.png — https://community.tscircuit.com/media/1529280954399719434 ## Rishabh — 2026-07-22T00:17:39.877000+00:00 Looking into it ## astrimid — 2026-07-22T00:19:58.153000+00:00 should it be *.ts? ## Rishabh — 2026-07-22T00:21:23.926000+00:00 No, I am adding a fix. `pcbDisabled` isn't a supported flag in `tscircuit.config.json` . I am adding that support ## astrimid — 2026-07-22T00:23:00.154000+00:00 This appears to work: export default { platformConfig: { pcbDisabled: true } } ## astrimid — 2026-07-22T00:23:08.336000+00:00 using *.ts ## Rishabh — 2026-07-22T00:23:53.052000+00:00 Okay, but the `tscircuit.config.json` should be working as well in sometime ## astrimid — 2026-07-22T00:47:07.757000+00:00 Okay. So, I've created a package, but how do I import it? `import { generateQFNPinArrangement } from "astrimid/qfn-numbering-direction"` doesn't seem to work? Should there be some package.json ? ## Rishabh — 2026-07-22T00:48:26.410000+00:00 You don't export it Attachment: image.png — https://community.tscircuit.com/media/1529288982989639680 ## astrimid — 2026-07-22T01:00:08.477000+00:00 the error says : Could not fetch "astrimid/qfn-numbering-direction" from https://cdn.jsdelivr.net/npm/astrimid/qfn-numbering-direction/+esm: ## astrimid — 2026-07-22T01:03:40.202000+00:00 also, exporting funtion I see the error: Execution Error:Error evaluating "entrypoint.tsx": Cannot read properties of undefined (reading '0') ## astrimid — 2026-07-22T01:07:12.044000+00:00 if exporting functions not supported, I might need to define it as a JSX element? ## Rishabh — 2026-07-22T01:07:51.327000+00:00 Taking a look, it should work though ## Rishabh — 2026-07-22T01:11:27.965000+00:00 Testing this package, it works Attachment: image.png — https://community.tscircuit.com/media/1529294777928122418 ## Rishabh — 2026-07-22T01:11:42.609000+00:00 I think you missed the `@tsci/*` prefix ## Rishabh — 2026-07-22T01:11:57.511000+00:00 import { MyChip } from "@tsci/astrimid.qfn-numbering-direction" ## astrimid — 2026-07-22T01:18:50.050000+00:00 Thanks, it works! Could you also help with ``` export { generateQFNPinArrangement, MyChip }; export type { QFNConfig, SchematicPinArrangement }``` This seem to generate cryptic error ## astrimid — 2026-07-22T01:19:10.201000+00:00 ``` Execution Error:Error evaluating "entrypoint.tsx": Cannot read properties of undefined (reading '0') at importLocalFile (blob:https://tscircuit.com/5fa13c9c-631c-41ef-887a-dcdc1228d044:955:2290) at async importEvalPath (blob:https://tscircuit.com/5fa13c9c-631c-41ef-887a-dcdc1228d044:973:743) at async Object.executeWithFsMap (blob:https://tscircuit.com/5fa13c9c-631c-41ef-887a-dcdc1228d044:1007:729596) @tscircuit/eval@0.0.1030 • @tscircuit/core@0.0.1474 ``` ## astrimid — 2026-07-22T01:20:16.280000+00:00 Ok, it seems I can't export just a function, I must export a function and a component ## astrimid — 2026-07-22T01:21:15.594000+00:00 Awesome: https://tscircuit.com/editor?#data:application/gzip;base64,H4sIAAUbYGoAA3WTzW7iMBCAX8XyCaRtuqGb3S5q0C4/7a6KIG1Qe/ElJAasEtu1XZUq4t3rnwDDobfk82Q838ykwYxXdBcZvcN9zGoplEENWlNOVWHow+0sY/yvUgVf05pyg/ZopUSNCP5jdMkuC20Uq1kVva74BX+rl1Qxvr6omKKlYYITTHgpuDbISJ3EvetkaRNqlKKGcIQk43HfJhvlMcHfWtJz5Ol2CNCVR4+Tu6sT+9GG9U4oCbkA+enIZAbIL0eyu/l8fGLXjuXPIOq3Tz7MF4DF3x0cPz79g9DXb+EUwqDwfwbQUSEBMDjMgWnsHVw+CL2GuxlCb+JqhLBVgSi4jKb3oMVeZTKDXfcii8yTPSo08nMj/DBAXW7Od2GR5X6iQzvNLxemc5izzqjKWUX7KDlcOS2WdKv756txLDsEE2yEbKs87tf4sF7uvNyK8uWdadpGmQ1VdbHNisqmcwFeLmh1nQ7d+S0PVlCiI5WQtp7RhsnMPd6YD0nF6rzAQRelA9RxV92UNtI9ILQSwkhbm0kJtv+CuzAcHD3T5izNPhy7rtpqQMfS5utOtx81URT5Wv375YDwLt5/Aj9cReLLAwAA ## astrimid — 2026-07-22T01:23:49.939000+00:00 Still see Module '"@tsci/astrimid.qfn-numbering-direction"' has no exported member 'generateQFNPinArrangement', but running it works ## Seve — 2026-07-22T02:32:35.629000+00:00 interesting, CC <@809856037376491570> this is a type export error yea? maybe we're messing up the type bundle ## Seve — 2026-07-22T02:32:49.240000+00:00 i launched an improvement for the errors today fwiw ## Seve — 2026-07-22T02:32:57.963000+00:00 hopefully that particular error will be improved in the future ## Rishabh — 2026-07-22T02:33:57.075000+00:00 I tried it but didn't see the error ## astrimid — 2026-07-22T10:59:30.024000+00:00 What I notice it is more often reproducible when I open it in incognito. So might be some kind of race condition or caching issue. ## Seve — 2026-07-22T13:40:10.991000+00:00 Yep i think so