1k-coding-patterns
Provides standardization for OneKey coding styles and best practices.
Install
mkdir -p .claude/skills/1k-coding-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5300" && unzip -o skill.zip -d .claude/skills/1k-coding-patterns && rm skill.zipInstalls to .claude/skills/1k-coding-patterns
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
OneKey coding patterns for TypeScript, React, promises, date formatting, and error handling.Key capabilities
- →Enforce promise handling patterns
- →Standardize React component definitions
- →Restrict forbidden coding patterns
- →Manage date formatting via utility modules
How it works
The skill provides a set of reference rules and code examples that define the required syntax and patterns for common development tasks.
Inputs & outputs
When to use 1k-coding-patterns
- →Reviewing component code
- →Standardizing promise logic
- →Applying TypeScript conventions
About this skill
OneKey Coding Patterns and Best Practices
Quick Reference
| Topic | Guide | Key Points |
|---|---|---|
| Promise handling | promise-handling.md | Always await or use void, never floating promises |
| React components | react-components.md | Named imports, functional components, no FC type |
| Restricted patterns | restricted-patterns.md | Forbidden: toLocaleLowerCase, direct hd-core import |
| Date formatting | date-formatting.md | Use OneKey dateUtils, not native date formatting |
| Error handling | error-handling.md | Preserve errors across RPC/runtime boundaries |
Critical Rules Summary
Promise Handling
// ❌ FORBIDDEN - floating promise
apiCall();
// ✅ CORRECT
await apiCall();
// or
void apiCall(); // intentionally not awaited
React Components
// ❌ FORBIDDEN
import React, { FC } from 'react';
const MyComponent: FC<Props> = () => {};
// ✅ CORRECT
import { useState, useCallback } from 'react';
function MyComponent({ prop }: { prop: string }) {}
Restricted Patterns
// ❌ FORBIDDEN
string.toLocaleLowerCase()
import { x } from '@onekeyfe/hd-core';
import { localDbInstance } from '...';
// ✅ CORRECT
string.toLowerCase()
const { x } = await CoreSDKLoader();
import { localDb } from '...';
Related Skills
/1k-i18n- Internationalization and translations/1k-cross-platform- Platform-specific code/1k-code-quality- Linting and code quality/1k-performance- Performance optimization/1k-state-management- Jotai atom patterns/1k-architecture- Project structure and import rules
When not to use it
- →When using native date formatting
- →When using floating promises
Limitations
- →Must follow specific reference files for each coding topic
How it compares
It explicitly forbids common patterns like floating promises and specific native methods to maintain project-wide consistency.
Compared to similar skills
1k-coding-patterns side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| 1k-coding-patterns (this skill) | 1 | 1mo | No flags | Intermediate |
| accessibility-compliance | 45 | 2mo | No flags | Intermediate |
| typescript | 28 | 2mo | No flags | Beginner |
| frontend-code-review | 11 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by OneKeyHQ
View all by OneKeyHQ →You might also like
accessibility-compliance
wshobson
Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.
typescript
lobehub
TypeScript code style and optimization guidelines. Use when writing TypeScript code (.ts, .tsx, .mts files), reviewing code quality, or implementing type-safe patterns. Triggers on TypeScript development, type safety questions, or code style discussions.
frontend-code-review
langgenius
Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules.
react-best-practices
redpanda-data
Client-side React performance optimization patterns.
react-patterns
davila7
Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.
coding-standards
affaan-m
适用于TypeScript、JavaScript、React和Node.js开发的通用编码标准、最佳实践和模式。