Why Use This
This skill provides specialized capabilities for OneKeyHQ's codebase.
Use Cases
- Developing new features in the OneKeyHQ repository
- Refactoring existing code to follow OneKeyHQ standards
- Understanding and working with OneKeyHQ's codebase structure
Install Guide
2 steps - 1
- 2
Install inside Ananke
Click Install Skill, paste the link below, then press Install.
https://github.com/OneKeyHQ/app-monorepo/tree/x/.claude/skills/1k-coding-patterns
Skill Snapshot
Auto scan of skill assets. Informational only.
Valid SKILL.md
Checks against SKILL.md specification
Source & Community
Updated At Feb 5, 2026, 03:54 AM
Skill Stats
SKILL.md 68 Lines
Total Files 2
Total Size 1.9 KB
License NOASSERTION
---
name: 1k-coding-patterns
description: Coding patterns and best practices — React components, promise handling, and TypeScript conventions.
allowed-tools: Read, Grep, Glob, Write, Edit
---
# OneKey Coding Patterns and Best Practices
## Quick Reference
| Topic | Guide | Key Points |
|-------|-------|------------|
| Promise handling | [promise-handling.md](references/rules/promise-handling.md) | Always await or use `void`, never floating promises |
| React components | [react-components.md](references/rules/react-components.md) | Named imports, functional components, no FC type |
| Restricted patterns | [restricted-patterns.md](references/rules/restricted-patterns.md) | Forbidden: `toLocaleLowerCase`, direct hd-core import |
## Critical Rules Summary
### Promise Handling
```typescript
// ❌ FORBIDDEN - floating promise
apiCall();
// ✅ CORRECT
await apiCall();
// or
void apiCall(); // intentionally not awaited
```
### React Components
```typescript
// ❌ FORBIDDEN
import React, { FC } from 'react';
const MyComponent: FC<Props> = () => {};
// ✅ CORRECT
import { useState, useCallback } from 'react';
function MyComponent({ prop }: { prop: string }) {}
```
### Restricted Patterns
```typescript
// ❌ 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-date-formatting` - Date and time formatting
- `/1k-i18n` - Internationalization and translations
- `/1k-error-handling` - Error handling patterns
- `/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
- `/1k-code-quality` - Lint fixes, pre-commit tasks