
yuchunbo/ai-frontend-guard
Code review이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
一前前的AIAI。G用 Claude Code、GitHub Copilot、Cursor 樹AIAI,::
개요
一前前的AIAI。G用 Claude Code、GitHub Copilot、Cursor 樹AIAI,:: - AI 前 前 前 前 前 安 安 安 安 安 流 流 流 流 流 流 流 流 流 流 流 流 和 和 AI 프론트엔드 가드 李俊億 per 大 大 大 n n n n per per per 中 中 中 中 中 中 per per per per per - sec-no-dangerously-set-innerhtml - XSSonly - sec-no-eval - sec - sec-no-hardcoded-secret - 信 - sec-https-only - S用HTTPS - bp-no-console-log - bconsole b - bp-prefer-const - b用const - bp-no-var - b用var - bp-meaningful-name - 使的名名 - ts-no-any - tsany - ts-explicit-return-type - ts - ts-no-non-null-assertion - - react-use-key-prop - key - - react-no-unused-prop - 用的prop - react-prefer-functional-component - 用s件
개요(AI 번역)
AIAI生成和和和
AI Frontend Guard 是一前前AI的AIAI。G用 ude、GitHub Copilot、Cursor AIAIAI,::
- ✅ AIAI生成的前合前前 安、安
- ✅ ·
- 流成AI
- ✅ **Trae Skill 体 **:和用和和
Tra Tra 体e
前的前前 기술 体,前 Tra中中:
# # # # # # # # # # #
인포메이션
|----------|------|
| frontend-code-style | 命(名、TS、TS、样、样) |
| [T2] | (T、安、安、安、安) |
用
用
AI 프론트엔드 가드 aifg analyze
스킬 目
######################################################################################################
用m:.trae/skills/USAGE.md
🚀
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # #
一一一.aifg.json]文件,T目一定义规则。
分
# # # # # # # # # # #
perf-no-large-bundle- 大大的npmperf-no-inline-function- 中perf-use-memo- 用useMemomo
安
- [T8] - TXSS -
sec-no-eval- - 인가기관 증명sec-https-only- 用HTTPS
# # # # # # # # # # #
- [T12] - [T12] - [T12] - [T12]] - [T12] - [T12] - [T12] - [T12] - [T12]] - [T12] - [T12] - [T12] - [T12] - [T12] - [T12] - [T12] - [T12] - [T12]] - [T12] - [T12] - [T12]] - [T12]] - [T12] - [T12]] - [T12] - [T12]] - [T12]]
bp-prefer-const- 用constbp-no-var- 用var- [T15] - 的名名
유형 스크립트
ts-no-any- [T16]] - [T16]] - [T16]] - [T16] - [T16] - [T16]] - [T16]] - [T16] - [T16] - [T16] - [T16]] - [T16] - [T16] - [T16] - [T16] - [T16]] - [T16] - [T16]] - [T16] - [T16]] - [T16]] - [T16]] - [T16]] - [T16] - [T16]]
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
AI Frontend Guard
📖 简介
AI Frontend Guard 是一个专为前端开发者设计的AI代码质量管控工具。当使用 Claude Code、GitHub Copilot、Cursor 等AI编程助手时,它能帮助你:
- ✅ 确保AI生成的代码符合前端最佳实践
- ✅ 自动检测潜在的性能、安全和质量问题
- ✅ 提供可定制的代码规范规则
- ✅ 与主流AI工具无缝集成
- ✅ Trae Skill 体系支持:支持对话调用和自动触发
🎯 Trae Skill 体系
项目内置了完整的前端领域 Skill 规约体系,支持在 Trae 对话中调用:
技能列表
| 技能名称 | 功能描述 |
|---|---|
frontend-code-style |
代码规范检查(命名、TS类型、组件结构、样式、导入顺序) |
frontend-code-review |
代码审查(质量、性能、安全、可维护性、复杂度) |
对话调用
# 显性调用
用 frontend-code-review 审查 src/ 下的代码
# 隐性触发
帮我查一下这段代码规范
做一次前端代码审查
自动调用
AI Frontend Guard 执行 aifg analyze 时会自动调用相关 Skill,检查结果融入工具输出报告。
Skill 目录结构
.trae/skills/
├── frontend-code-style/ # 代码规范规约
│ ├── SKILL.md # 技能入口
│ └── references/ # 规则文件
│ ├── naming-rules.md
│ ├── code-style.md
│ └── import-order.md
└── frontend-code-review/ # 代码审查规约
├── SKILL.md # 技能入口
└── references/ # 规则文件
├── checklist.md
├── performance-checklist.md
├── security-checklist.md
└── maintainability-checklist.md
使用说明
详细使用说明请参考:.trae/skills/USAGE.md
🚀 快速开始
安装
npm install -g ai-frontend-guard
# 或
pnpm add -g ai-frontend-guard
初始化配置
aifg init
这将创建一个 .aifg.json 配置文件,你可以根据项目需求自定义规则。
分析代码
# 分析整个项目
aifg analyze
# 分析特定目录
aifg analyze ./src
# 分析单个文件
aifg check ./src/App.tsx
# 指定框架
aifg analyze --framework react
# 输出为 JSON 格式
aifg analyze --output json
# 输出为 Markdown 格式
aifg analyze --output markdown
📋 内置规则
性能优化
perf-no-large-bundle- 避免引入过大的npm包perf-no-inline-function- 避免React组件中的内联函数perf-use-memo- 建议使用useMemo优化计算
安全检查
sec-no-dangerously-set-innerhtml- 避免XSS风险sec-no-eval- 避免代码注入sec-no-hardcoded-secrets- 避免硬编码敏感信息sec-https-only- 确保使用HTTPS
最佳实践
bp-no-console-log- 避免console语句bp-prefer-const- 优先使用constbp-no-var- 避免使用varbp-meaningful-names- 使用有意义的变量名
TypeScript
ts-no-any- 避免any类型ts-explicit-return-type- 函数返回类型注解ts-no-non-null-assertion- 避免非空断言
React
react-use-key-prop- 列表项需要key属性react-no-unused-props- 避免未使用的propsreact-prefer-functional-component- 优先使用函数组件
查看所有规则:
aifg rules
⚙️ 配置文件
.aifg.json 配置示例:
{
"rules": [
{ "ruleId": "sec-no-dangerously-set-innerhtml", "enabled": true, "severity": "error" },
{ "ruleId": "ts-no-any", "enabled": true, "severity": "warning" }
],
"frameworks": ["react"],
"aiTools": [
{ "name": "claude-code", "enabled": true }
],
"output": {
"format": "console"
}
}
🔗 与AI工具集成
Claude Code 集成
추천 도구
다른 키워드를 입력하거나 필터를 제거해 보세요.
설치
npx skillfish add yuchunbo/ai-frontend-guard