skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
onekeyhq/app-monorepo73 installs

1k-coding-patterns

OneKey coding patterns for TypeScript, React, promises, date formatting, and error handling.

How do I install this agent skill?

npx skills add https://github.com/onekeyhq/app-monorepo --skill 1k-coding-patterns
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides static coding guidelines and best practices for TypeScript and React development. It contains no executable scripts, external dependencies, or malicious patterns.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerwarn

    4/4 files flagged

What does this agent skill do?

OneKey Coding Patterns and Best Practices

Quick Reference

TopicGuideKey Points
Promise handlingpromise-handling.mdAlways await or use void, never floating promises
React componentsreact-components.mdNamed imports, functional components, no FC type
Restricted patternsrestricted-patterns.mdForbidden: toLocaleLowerCase, direct hd-core import
Date formattingdate-formatting.mdUse OneKey dateUtils, not native date formatting
Error handlingerror-handling.mdPreserve 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

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/onekeyhq/app-monorepo/1k-coding-patterns">View 1k-coding-patterns on skillZs</a>