开发者生态
morning
我要重新开始手工编写代码
2026-05-11
1 阅读
dropbox_miner
我将在 2026 年 5 月 9 日重新开始手工编写代码,我这里是 k10s:https://github.com/shvbsle/k10s/tree/archive/go-v0.4.0 234 次提交。 〜30个周末。完全建立在与克劳德的振动编码会话上,每当我的代币持续足够长的时间来运送东西时。我正在归档我的 TUI 工具并从头开始重写。 k10s 最初是一个 GPU 感知的 Kubernetes 仪表板(也是我第一次尝试用 AI 构建一些严肃的东西)。想想 k9s,但它是为运行 NVIDIA 集群的人们而构建的,这些人真正关心 GPU 利用率、DCGM 指标以及哪些节点闲置,每小时消耗 32 美元。我用 Go 和 Bubble Tea [1] 构建了它,并且成功了。有一段时间... :(我在这 7 个月中学到的价值比我扔掉的 1690 行 model.go 更有价值。我认为任何认真进行振动编码的人都可以从中受益,因为这部分并没有太多表面化(我觉得它被埋在演示卷轴下并且速度获胜)。tl;dr:AI 编写功能,而不是架构。你让它在没有约束的情况下驱动的时间越长,残骸就越严重。速度让你认为你赢了。直到一切都崩溃的那一刻,我在 2025 年 9 月下旬开始使用 k10s。最初的几周是神奇的,我提示 Claude “添加带有实时更新的 pod 视图”,然后它就成功了,资源列表视图、命名空间过滤、日志流、描述面板、键盘导航都完成了。因为该项目足够小,所以基本的 k9s 克隆可能需要 3 个周末的时间。 nodes, deployments, services. A command palette. Watch-based live updates. Vim keybindings. All working, all vibe-coded in single sessions. I was building at maybe 10x my normal speed and it felt incredible. Then I wanted the main selling point. The whole reason k10s exists is the GPU fleet view. A dedicated screen that shows you every node's GPU allocation, utilization from DCGM, temperature, power draw, memory. Not buried in kubectl describe node output, but right there in a purpose-built table with color-coded status. Idle nodes in yellow. Busy in green. Saturated in red. The fleet view on mock GPU nodes And Claude one-shot it. I prompted for the fleet view, it generated the FleetView struct, the tab filtering (GPU/CPU/All), the custom rendering with allocation bars. It looked beautiful. I was riding the high. Then I typed :rs pods to switch back to the pods view. Nothing rendered. The table was empty. Live updates had我切换到节点,它显示了舰队视图过滤器中的陈旧数据,上帝对象已经消耗了自己。这是我第一次进行干预,而没有坐下来实际阅读克劳德编写的代码,但现在有些事情从根本上被破坏了。 couldn't just prompt my way out of it. So I sat down and read model.go . All 1690 lines. I was horrified. Here's what it looked like. One struct to rule them all: type Model struct { // 3rd party UI components table table . Model paginator paginator . Model commandInput textinput . Model help help . Model // cluster info and state k8sClient * k8s . Client currentGVR schema . GroupVersionResource接口资源 [] k8s . OrderedResourceFields listOptions clusterInfo * k8s . ClusterInfo logLines [] k8s . DescribeViewport logViewport * LogViewport logStreamCancel func () logLinesChan <- chan k8s . LogLine HorizontalOffset int mouse * MouseHandler舰队视图 * FleetView createTimes [] time . Time allResources [] k8s . OrderedResourceFields // 舰队的未过滤集 allCreationTimes [] time . Time // 舰队的时间戳 rawObjects [] unstructed . int // ... } UI widgets. K8s client. Per-view state for logs, describe, fleet. Navigation history. Caching. Mouse handling. All in one struct. And the Update() method was a 500-line function dispatching on msg.(type) with 110 switch/case branches. This is the moment I stopped vibe-coding and started thinking. Ok I guess I'll let you copy logs with your mouse. What could go wrong? III five tenets from the wreckage以下是我从 7 个月观察 AI 生成慢慢吞噬自身的代码库中提取的内容,其中每一个都是我做错的事情,为什么在 AI 辅助编码中会发生这种情况,以及您实际上应该在 CLAUDE.md 或agents.md