with one click
ngaq-code-review-frontend
審查C#代碼(前端專用)
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
審查C#代碼(前端專用)
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
審查C#代碼
業務模塊文檔讀寫規範。涉及業務代碼的讀或寫時需要使用此技能
編寫C#代碼
調試 debug。在代碼有問題時使用此skill、通常不需要在開發編碼階段使用此skill
生成帶註釋的 C# 代碼。當編寫新的 C# 代碼時使用。
| name | ngaq-code-review-frontend |
| description | 審查C#代碼(前端專用) |
先自己看一遍 skill/ngaq-code-review。 如果你無法訪問skill 就手動翻閱 .agents/skills/ngaq-code-review/SKILL.typ
使用Tsinswreng.AvlnTool下的寫法。參見 /Doc/Spec/Frontend.typ。
示例: Ngaq.Frontend/proj/Ngaq.Ui/CodeTemplate/Sample/ViewSample.cs Ngaq.Frontend/proj/Ngaq.Ui/CodeTemplate/Sample/VmSample.cs
項目要求I18n。禁止硬編碼文字。 快速實現時臨時硬編碼則需先打I18n標記。
錯誤示例
btn.Content="Login"
正確示例:
btn.Content=Todo.I18n("Login")
下拉框 等 也要I18n、除非數據源是從後端獲取
遵守MVVM模式。
.A() 方法 能鏈式調用就必須鏈式調用 如
p.A(aaa)
.A(bbb)
;
```禁止拆散寫如
```cs
p.A(aaa);
p.A(bbb);
```Styles也同理、必須.A()鏈式調用
ContentControl.Content時使用o.SetContent(xxx); 不得直接o.Content=xxx。 Border也同理、必須使用o.SetChild(xxx)方法。g.SetRowDefs() / g.SetColDefs()、 不能寫 g.RowDefinitions=...。 GridStack同理。GridStack不能寫g.Grid.SetRowDefs()、只能寫g.SetRowDefs()= new(...); 的 就不要寫 = new SomeType(...);。 如要寫b.BorderThickness = new(0);而不是b.BorderThickness = new Thickness(0);OpBtn而不是普通 Buttonawait Task.Run(async()=>{})Dispacher.UIThread.Post(()=>{})具體 看 VmSample.cs
this.Content, 初始化this.Ctx, 初始化this.Styles)、除此之外 一般不應該在構造函數中做其他事。this.Loaded回調中。不能在同一文件夾下放置多個不同的View和Vm
默認情況下、直接把代碼中不符合規範的內容報告給用戶、不需要自行修改代碼。
如果用戶已經要求你自行迭代修改代碼 那就自行修改。改完一版之後再讀此文件對照評審。