スキル一覧に戻る
bash0C7

development-guidelines

by bash0C7

[WIP]Development Kit for PicoRuby Application running on R2P2-ESP32 with ESP32 Microcontroller Device

1🍴 0📅 2025年12月30日
GitHubで見るManusで実行

SKILL.md


name: Development Guidelines description: Defines coding standards, test patterns, and language conventions for this project. Use this when writing code, comments, documentation, or git commit messages.

Development Guidelines

Coding standards, naming conventions, and language conventions for PicoRuby development.

Output Style & Language

For complete output style requirements (Japanese output with ピョン。ending, etc.), see:

.claude/docs/output-style.md — PROTECTED output style requirements

Code Comments

Ruby files (.rb):

  • Language: Japanese
  • Style: Noun-ending (体言止め) — no period needed
  • Purpose: Explain the why, not the what
# ピクセルの色計算
def calc_color(intensity)
  # 0-255 スケールで正規化
  # グリーンチャネル優先
  [0, intensity, intensity / 2]
end

Documentation Files

Markdown (.md):

  • Language: English
  • Purpose: Reference material, API docs, architecture
  • No Japanese in .md files (except code comments within blocks)

Git Commits

Format: English, imperative mood

Add LED animation feature
Implement blinking pattern with configurable frequency.

Guidelines:

  • Title: 50 chars max, imperative ("Add", "Fix", "Refactor")
  • Body: Explain why the change matters (if needed)
  • Always use commit subagent (never raw git commands)

Examples:

  • ✅ "Add MP3 playback support"
  • ✅ "Fix memory leak in LED buffer"
  • ✅ "Refactor IMU data reading for clarity"
  • ❌ "Added new feature"
  • ❌ "Fixed stuff"

Test Temporary Files Management

Principle: Block-Based Temp File Creation

Reasons:

  • Security: Prevent symlink attacks (IPA security guidelines)
  • Safety: Guaranteed cleanup on block exit (even on exceptions)
  • Reference: Rubyist Magazine 0029, "安全に一時ファイルを作成するのは素人には難しく"

Pattern A: File Operations (Preferred)

test "file operation" do
  Tempfile.open('test') do |file|
    file.write("content")
    # Assertions
  end  # Auto-deleted
end

Docs: https://docs.ruby-lang.org/ja/latest/class/Tempfile.html

Pattern B: Directory Structures (When Needed)

test "directory structure" do
  Dir.mktmpdir do |tmpdir|
    Dir.chdir(tmpdir) do
      FileUtils.mkdir_p("foo/bar")
      # Assertions
    end
  end  # Removed by FileUtils.remove_entry_secure
end

Docs: https://docs.ruby-lang.org/ja/latest/method/Dir/s/mktmpdir.html

Exception: setup/teardown (Discouraged)

  • Use only when: Multiple tests must share state
  • Must: Implement teardown for guaranteed cleanup (FileUtils.rm_rf)
  • Risk: Cleanup failure if teardown not executed

References

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です