coding-conventions
Apply consistent security, performance, and accessibility standards across all recommendations. Use when reviewing code, designing features, or validating implementations. Cross-cutting skill for all agents.
- License 许可
- MIT
- 最近更新
- 2026-11-01
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- coding-conventions
- description
- Apply consistent security, performance, and accessibility standards across all recommendations. Use when reviewing code, designing features, or validating implementations. Cross-cutting skill for all agents.
02 资源文件 3
- 参考文档checklists/accessibility-checklist.md5.7 KB
- 参考文档checklists/performance-checklist.md4.9 KB
- 参考文档checklists/security-checklist.md5.0 KB
03 SKILL.md 正文
Best Practices
A cross-cutting skill that enforces consistent security, performance, and quality standards across all agent recommendations. This skill provides actionable checklists aligned with industry standards.
When to Use
- Reviewing code for security vulnerabilities
- Validating performance characteristics of implementations
- Ensuring accessibility compliance in UI components
- Designing error handling strategies
- Auditing existing systems for quality gaps
Core Domains
Security
Covers common vulnerability prevention aligned with OWASP Top 10. Apply these checks to any code that handles user input, authentication, data storage, or external communications.
See: checklists/security-checklist.md
Performance
Covers optimization patterns for frontend, backend, and database operations. Apply these checks when performance is a concern or during code review.
See: checklists/performance-checklist.md
Accessibility
Covers WCAG 2.1 Level AA compliance. Apply these checks to all user-facing components to ensure inclusive design.
See: checklists/accessibility-checklist.md
Error Handling Patterns
All agents should recommend these error handling approaches:
Pattern 1: Fail Fast at Boundaries
Validate inputs at system boundaries and fail immediately with clear error messages. Do not allow invalid data to propagate through the system.
// At API boundary
function handleRequest(input) {
const validation = validateInput(input);
if (!validation.valid) {
throw new ValidationError(validation.errors);
}
// Process validated input
}
Pattern 2: Specific Error Types
Create domain-specific error types that carry context about what failed and why. Generic errors lose valuable debugging information.
class PaymentDeclinedError extends Error {
constructor(reason, transactionId) {
super(`Payment declined: ${reason}`);
this.reason = reason;
this.transactionId = transactionId;
}
}
Pattern 3: User-Safe Messages
Never expose internal error details to users. Log full context internally, present sanitized messages externally.
try {
await processPayment(order);
} catch (error) {
logger.error('Payment failed', {
error,
orderId: order.id,
userId: user.id
});
throw new UserFacingError('Payment could not be processed. Please try again.');
}
Pattern 4: Graceful Degradation
When non-critical operations fail, degrade gracefully rather than failing entirely. Define what is critical vs. optional.
async function loadDashboard() {
const [userData, analytics, recommendations] = await Promise.allSettled([
fetchUserData(), // Critical - fail if missing
fetchAnalytics(), // Optional - show placeholder
fetchRecommendations() // Optional - hide section
]);
if (userData.status === 'rejected') {
throw new Error('Cannot load dashboard');
}
return {
user: userData.value,
analytics: analytics.value ?? null,
recommendations: recommendations.value ?? []
};
}
Pattern 5: Retry with Backoff
For transient failures (network, rate limits), implement exponential backoff with maximum attempts.
async function fetchWithRetry(url, maxAttempts = 3) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
return await fetch(url);
} catch (error) {
if (attempt === maxAttempts) throw error;
await sleep(Math.pow(2, attempt) * 100); // 200ms, 400ms, 800ms
}
}
}
Best Practices
- Apply security checks before performance optimization
- Make accessibility a default, not an afterthought
- Use checklists during code review, not just at the end
- Document exceptions to standards with rationale
- Automate checks where possible (linting, testing)
References
checklists/security-checklist.md- OWASP-aligned security checkschecklists/performance-checklist.md- Performance optimization checklistchecklists/accessibility-checklist.md- WCAG 2.1 AA compliance checklist
04 同仓库更多 Skills
seedance-prompt-en
Write effective prompts for Jimeng Seedance 2.0 multimodal AI video generation. Use when users want to create video prompts using text, images, videos, and audio inputs with the @ reference system. Covers camera movements, effects replication, video extension, editing, music beat-matching, e-commerce ads, short dramas, and educational content.
onepage-pdf
Convert an HTML page into a single continuous-page PDF (one tall page, no pagination breaks), preserving desktop layout, backgrounds and selectable text. Use when the user asks to turn an HTML file/report/proposal into a "single-page PDF", "long PDF", "不分页 PDF", "单页 PDF", "长图式 PDF", or complains that an HTML-to-PDF export breaks into pages or cuts content. Supports optional string redaction with leak verification.
native-feel-cross-platform-desktop
Use when the user is designing, prototyping, or rewriting a desktop app that must run on multiple OSes (macOS + Windows, optionally Linux) AND feel indistinguishable from a native app to its users — fast launch, native windowing, native input handling, native materials. Trigger words include "cross-platform desktop", "Electron alternative", "Tauri vs native", "WebView wrapper", "near-native performance", "Raycast architecture", "WebKit/WebView2 quirks", "WKWebView", "system tray app", "global hotkey app", "launcher app". Do NOT trigger this skill for pure web apps, pure mobile apps, or for greenfield projects that have no native-feel requirement.
gstack
Router for the gstack skill suite. (gstack)
fireworks-tech-graph
Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent/memory, or concept map - and export as SVG+PNG. Trigger on: "画图" "帮我画" "生成图" "做个图" "架构图" "流程图" "可视化一下" "出图" "generate diagram" "draw diagram" "visualize" or any system/flow description the user wants illustrated.
dbs-video-extract
接收抖音、小红书、微信视频号等短视频链接或分享文案,查询作品/账号数据并提取语音文字稿,按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用;运行前检查 TikHub 与轻抖使用凭证,缺少时用新手能理解的方式引导购买和安全配置。