Skip to content

Instantly share code, notes, and snippets.

@mizchi
mizchi / HOW_TO_USE_DXT.md
Created June 28, 2025 09:09
DXT (Desktop Extensions) の使い方 - MCPサーバーをClaude Desktopで使う最小実装ガイド

DXT (Desktop Extensions) の使い方

DXT (Desktop Extensions) は、MCPサーバーをClaude Desktopに簡単にインストールできるパッケージ形式です。

DXTとは

  • MCPサーバーと依存関係を1つの.dxtファイルにパッケージ化
  • Claude Desktopでワンクリックインストール可能
  • 非技術者でも簡単に強力なローカルツールを利用可能

Gemini CLI に Gemini CLI 自体のソースコードを読ませつつ、高度な使い方を分析させたもの


Gemini CLI 実践ガイド: 基本から応用まで

Gemini CLIは、単なる対話ツールではありません。その設計の核心を理解することで、私たちはGemini CLIを、自らの開発ワークフローに最適化された、強力な自動化エンジンへと変貌させることができます。このガイドでは、基本的な使い方から、コードリーディングによって明らかになった高度な実践テクニックまでを解説します。


@mizchi
mizchi / rag.ts
Last active July 4, 2025 16:25
My Portable RAG
/**
* My Portable RAG
* $ pnpm add sqlite-vec @ai-sdk/google ai
* SQLite Vector Search + Google AI Embeddings
*
* Required environment variables:
* GOOGLE_GENERATIVE_AI_API_KEY=your-api-key
*
* Usage:
* # Index text content

MoonBit Knowledge Base for LLMs (Claude Code)

This document contains essential MoonBit knowledge that LLMs cannot know without external environment access. Last updated: December 2024.

Language Version and Status

Current Status: Beta (as of December 2024)

  • Version 1.0 planned for 2026
  • Core language features are now stable
  • Breaking changes will follow RFC process
import React, { useState } from "react";
import { render } from "ink-testing-library";
import { Text, Box, useInput, useApp } from "ink";
import { describe, it, expect, beforeAll } from "vitest";
// テスト環境設定
beforeAll(() => {
process.stdin.isTTY = true;
process.stdout.isTTY = true;
});
// node --test ask-claude.test.ts
import { test } from "node:test";
import { query, type Options } from "@anthropic-ai/claude-code";
async function assertAI(prompt: string, options: Options = {}): Promise<void> {
const MARKER = "**ASSERT_OK**";
const abortController = new AbortController();
const finalPrompt = `Assert user query. Return ${MARKER} if it is true. \n\n${prompt}`;
for await (const message of query({
prompt: finalPrompt,
// node --test ask-claude.test.ts
import { test } from "node:test";
import { query } from "@anthropic-ai/claude-code";
test("Ask", async () => {
const EXPECTED = "paris";
const abortController = new AbortController();
for await (const message of query({
prompt: "What is the capital of France?",
options: { maxTurns: 1, abortController },
// pnpm add vitepress -D
// add this on docs/.vitepress/config.ts
// "doc:dev": "pnpm vitepress dev docs --port=9999",
// "doc:build": "pnpm vitepress build"
import { defineConfig } from "vitepress";
// Hyrum's Law: With a sufficient number of users of an API,
// it does not matter what you promise in the contract:
// all observable behaviors of your system will be depended on by somebody.
-- リアルワールド例:カウンターボタンの実装と証明
-- カウンターの状態
structure Counter where
value : Nat
-- カウンターの初期状態
def Counter.init : Counter := ⟨0
-- インクリメント操作