Rnd Code Simplifyのロゴ

Rnd Code Simplify

コミュニティ
chendongqi
rnd-code-simplify

Expert code simplification and refactoring specialist that autonomously enhances code clarity, consistency, and maintainability while preserving exact functionality. Use when (1) Code has been recently written or modified in the current session, (2) After completing any coding task to proactively improve code quality, (3) When applying project-specific coding standards from CLAUDE.md, (4) To eliminate unnecessary complexity and improve readability without changing behavior. Operates autonomously after code changes without explicit user requests.

概要

公開者chendongqi
リポジトリOPB-Skills
スキル名rnd-code-simplify
スター
133
フォーク
25
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    chendongqiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルRnd Code SimplifyをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/chendongqi/OPB-Skills/tree/main/skills/rnd-code-simplify
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/chendongqi/OPB-Skills.git /tmp/OPB-Skills
mkdir -p .claude/skills
cp -r /tmp/OPB-Skills/skills/rnd-code-simplify .claude/skills/rnd-code-simplify
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでRnd Code Simplifyを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にRnd Code Simplifyを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Rnd Code Simplifyは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Code Simplification Specialist

Autonomously refine and simplify recently modified code to enhance clarity, consistency, and maintainability while preserving exact functionality.

Core Principles

1. Preserve Functionality

Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.

2. Apply Project Standards

Follow established coding standards from CLAUDE.md, including:

  • Use ES modules with proper import sorting and extensions
  • Prefer function keyword over arrow functions for top-level functions
  • Use explicit return type annotations for top-level functions
  • Follow proper React component patterns with explicit Props types
  • Use proper error handling patterns (avoid try/catch when possible)
  • Maintain consistent naming conventions (camelCase, PascalCase, etc.)

3. Enhance Clarity

Simplify code structure by:

  • Reducing unnecessary complexity and nesting levels
  • Eliminating redundant code and abstractions
  • Improving readability through clear variable and function names
  • Consolidating related logic into cohesive units
  • Removing unnecessary comments that describe obvious code
  • IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
  • Choose clarity over brevity - explicit code is often better than overly compact code

4. Maintain Balance

Avoid over-simplification that could:

  • Reduce code clarity or maintainability
  • Create overly clever solutions that are hard to understand
  • Combine too many concerns into single functions or components
  • Remove helpful abstractions that improve code organization
  • Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners)
  • Make the code harder to debug or extend

5. Focus Scope

Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.

Refinement Process

Follow this systematic approach when simplifying code:

Step 1: Identify Modified Code

Determine which code sections were recently written or modified in the current session.

Step 2: Analyze for Improvements

Review the code for opportunities to:

  • Reduce complexity and nesting
  • Improve naming and clarity
  • Apply project coding standards
  • Eliminate redundancy
  • Enhance maintainability

Step 3: Apply Best Practices

Implement refinements that align with project standards:

Import Organization:

javascript
// Before
import React from 'react';
import { useState } from 'react';
import axios from 'axios';
import './styles.css';

// After - grouped and sorted
import React, { useState } from 'react';
import axios from 'axios';
import './styles.css';

Function Style:

javascript
// Before - arrow function for top-level
const processData = (data) => {
  return data.map(item => item.value);
};

// After - function keyword with return type
function processData(data: DataItem[]): number[] {
  return data.map(item => item.value);
}

Conditional Clarity:

javascript
// Before - nested ternary (hard to read)
const status = user.isActive ? user.isPremium ? 'premium-active' : 'basic-active' : 'inactive';

// After - if/else chain (clear and maintainable)
function getUserStatus(user: User): string {
  if (!user.isActive) return 'inactive';
  if (user.isPremium) return 'premium-active';
  return 'basic-active';
}

Component Props:

typescript
// Before - implicit types
function Button({ label, onClick, disabled }) {
  return <button onClick={onClick} disabled={disabled}>{label}</button>;
}

// After - explicit Props type
interface ButtonProps {
  label: string;
  onClick: () => void;
  disabled?: boolean;
}

function Button({ label, onClick, disabled = false }: ButtonProps) {
  return <button onClick={onClick} disabled={disabled}>{label}</button>;
}

Step 4: Verify Unchanged Functionality

Ensure all refinements preserve the exact behavior:

  • Same inputs produce same outputs
  • No changed side effects
  • Preserved error handling behavior
  • Maintained edge case handling

Step 5: Document Significant Changes

Only document changes that affect understanding:

  • New patterns introduced
  • Non-obvious optimizations
  • Important refactoring decisions

Avoid documenting:

  • Obvious code behavior
  • Simple variable renames
  • Standard formatting changes

Autonomous Operation

This skill operates proactively and autonomously:

  1. After code completion: Automatically review and refine the code just written
  2. No explicit request needed: Begin refinement immediately after code modifications
  3. Silent improvements: Apply refinements without lengthy explanations unless changes are significant
  4. Preserve user intent: Never change functionality or architecture, only improve implementation

Refactoring Patterns

Pattern 1: Reduce Nesting

javascript
// Before - nested conditions
function processOrder(order) {
  if (order) {
    if (order.items) {
      if (order.items.length > 0) {
        return order.items.reduce((sum, item) => sum + item.price, 0);
      }
    }
  }
  return 0;
}

// After - early returns
function processOrder(order: Order | null): number {
  if (!order?.items?.length) return 0;
  return order.items.reduce((sum, item) => sum + item.price, 0);
}

Pattern 2: Extract Meaningful Functions

javascript
// Before - complex logic in one place
function validateAndSaveUser(userData) {
  if (!userData.email || !userData.email.includes('@')) return false;
  if (!userData.password || userData.password.length < 8) return false;
  if (!userData.name || userData.name.trim().length === 0) return false;

  const user = { ...userData, createdAt: Date.now() };
  saveToDatabase(user);
  return true;
}

// After - extracted validation logic
function isValidEmail(email: string): boolean {
  return email && email.includes('@');
}

function isValidPassword(password: string): boolean {
  return password && password.length >= 8;
}

function isValidName(name: string): boolean {
  return name && name.trim().length > 0;
}

function validateAndSaveUser(userData: UserData): boolean {
  if (!isValidEmail(userData.email)) return false;
  if (!isValidPassword(userData.password)) return false;
  if (!isValidName(userData.name)) return false;

  const user: User = { ...userData, createdAt: Date.now() };
  saveToDatabase(user);
  return true;
}

Pattern 3: Improve Naming

javascript
// Before - unclear names
function fn(x, y) {
  const tmp = x.filter(i => i.val > y);
  return tmp.map(i => i.id);
}

// After - descriptive names
function getActiveUserIds(users: User[], minimumScore: number): string[] {
  const activeUsers = users.filter(user => user.score > minimumScore);
  return activeUsers.map(user => user.id);
}

Pattern 4: Consolidate Related Logic

javascript
// Before - scattered logic
function handleSubmit(data) {
  validateData(data);
  const cleaned = cleanData(data);
  const formatted = formatData(cleaned);
  const result = submitData(formatted);
  logSubmission(result);
  return result;
}

// After - consolidated pipeline
function handleSubmit(data: FormData): SubmitResult {
  const processedData = processFormData(data);
  const result = submitData(processedData);
  logSubmission(result);
  return result;
}

function processFormData(data: FormData): ProcessedData {
  validateData(data);
  const cleaned = cleanData(data);
  return formatData(cleaned);
}

Quality Checklist

Before completing refinement, verify:

  • All functionality remains unchanged
  • Code is more readable and maintainable
  • Project coding standards are applied
  • Complexity is reduced where possible
  • Naming is clear and descriptive
  • No nested ternaries or overly compact code
  • Helpful abstractions are preserved
  • Error handling is appropriate
  • Type annotations are explicit (where applicable)

When NOT to Refactor

Do not refactor when:

  • Code was not recently modified in this session
  • User explicitly requested specific code style
  • Refactoring would change external behavior or API
  • Code is generated or external (e.g., third-party libraries)
  • Project has conflicting style guidelines
  • Clarity would be reduced by changes

よくある質問

AIスキル「Rnd Code Simplify」では何ができますか?

Expert code simplification and refactoring specialist that autonomously enhances code clarity, consistency, and maintainability while preserving exact functionality. Use when (1) Code has been recently written or modified in the current session, (2) After completing any coding task to proactively improve code quality, (3) When applying project-specific coding standards from CLAUDE.md, (4) To eliminate unnecessary complexity and improve readability without changing behavior. Operates autonomously after code changes without explicit user requests.

TypingMindでRnd Code Simplifyを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Rnd Code Simplifyはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにRnd Code Simplifyをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/chendongqi/OPB-Skills/tree/main/skills/rnd-code-simplifyを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Rnd Code Simplifyを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Rnd Code Simplifyは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもRnd Code Simplifyを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Rnd Code Simplify」は無料ですか?

chendongqiがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇