jpskill.com
🛠️ 開発・MCP コミュニティ

conform

Conformは、JavaScriptなしでも動作するフォームや、サーバーで検証されたフォームをRemix/Next.jsで構築したり、アクセシビリティに配慮したフォームを段階的に強化したりする際に、より進化したフォームを構築するSkill。

📜 元の英語説明(参考)

Build progressive forms with Conform. Use when creating forms that work without JavaScript, implementing server-validated forms in Remix/Next.js, or building accessible forms with progressive enhancement.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Conformは、JavaScriptなしでも動作するフォームや、サーバーで検証されたフォームをRemix/Next.jsで構築したり、アクセシビリティに配慮したフォームを段階的に強化したりする際に、より進化したフォームを構築するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o conform.zip https://jpskill.com/download/14778.zip && unzip -o conform.zip && rm conform.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14778.zip -OutFile "$d\conform.zip"; Expand-Archive "$d\conform.zip" -DestinationPath $d -Force; ri "$d\conform.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して conform.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → conform フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Conform

概要

Conform は、プログレッシブエンハンスメントなフォームライブラリです。フォームは JavaScript なしでも動作し(サーバーサイドバリデーション)、JS がロードされるとクライアントサイドバリデーションで拡張されます。Remix および Next.js Server Actions にネイティブに対応しています。クライアント/サーバー間で共有されるバリデーションには Zod スキーマを使用します。

手順

ステップ 1: Next.js Server Action フォーム

// app/actions.ts — Conform を使用したサーバーアクション
'use server'
import { parseWithZod } from '@conform-to/zod'
import { z } from 'zod'

const schema = z.object({
  name: z.string().min(2),
  email: z.string().email(),
  message: z.string().min(10).max(1000),
})

export async function submitContact(prevState: unknown, formData: FormData) {
  const submission = parseWithZod(formData, { schema })

  if (submission.status !== 'success') {
    return submission.reply()     // フォームにエラーを返す
  }

  await db.contacts.create(submission.value)
  return submission.reply({ resetForm: true })
}
// app/contact/page.tsx — プログレッシブエンハンスメントを使用したクライアントフォーム
'use client'
import { useForm } from '@conform-to/react'
import { parseWithZod } from '@conform-to/zod'
import { useActionState } from 'react'
import { submitContact } from '../actions'

export default function ContactPage() {
  const [lastResult, action] = useActionState(submitContact, undefined)
  const [form, fields] = useForm({
    lastResult,
    onValidate({ formData }) {
      return parseWithZod(formData, { schema })    // クライアントサイドバリデーション
    },
    shouldValidate: 'onBlur',
    shouldRevalidate: 'onInput',
  })

  return (
    <form id={form.id} onSubmit={form.onSubmit} action={action} noValidate>
      <div>
        <label htmlFor={fields.name.id}>Name</label>
        <input {...getInputProps(fields.name, { type: 'text' })} />
        <p>{fields.name.errors}</p>
      </div>
      <div>
        <label htmlFor={fields.email.id}>Email</label>
        <input {...getInputProps(fields.email, { type: 'email' })} />
        <p>{fields.email.errors}</p>
      </div>
      <div>
        <label htmlFor={fields.message.id}>Message</label>
        <textarea {...getTextareaProps(fields.message)} />
        <p>{fields.message.errors}</p>
      </div>
      <button type="submit">Send</button>
    </form>
  )
}

ガイドライン

  • Conform フォームは JS なしでも動作します — サーバーがバリデーションを行い、フォームの再送信によってエラーを返します。
  • クライアントとサーバー間で Zod スキーマを共有します — バリデーションの信頼できる唯一の情報源となります。
  • shouldValidate: 'onBlur' は、ユーザーがフィールドから離れたときにバリデーションを行います — onChange よりも控えめです。
  • ネイティブのフォーム属性(required、minLength)は、JS が無効になっている場合のフォールバックとして機能します。
  • Remix および Next.js Server Actions に最適です — それらのフォームパターンに合わせて設計されています。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Conform

Overview

Conform is a progressive enhancement form library. Forms work without JavaScript (server-side validation), then enhance with client-side validation when JS loads. Native to Remix and Next.js Server Actions. Uses Zod schemas for shared client/server validation.

Instructions

Step 1: Next.js Server Action Form

// app/actions.ts — Server action with Conform
'use server'
import { parseWithZod } from '@conform-to/zod'
import { z } from 'zod'

const schema = z.object({
  name: z.string().min(2),
  email: z.string().email(),
  message: z.string().min(10).max(1000),
})

export async function submitContact(prevState: unknown, formData: FormData) {
  const submission = parseWithZod(formData, { schema })

  if (submission.status !== 'success') {
    return submission.reply()     // return errors to form
  }

  await db.contacts.create(submission.value)
  return submission.reply({ resetForm: true })
}
// app/contact/page.tsx — Client form with progressive enhancement
'use client'
import { useForm } from '@conform-to/react'
import { parseWithZod } from '@conform-to/zod'
import { useActionState } from 'react'
import { submitContact } from '../actions'

export default function ContactPage() {
  const [lastResult, action] = useActionState(submitContact, undefined)
  const [form, fields] = useForm({
    lastResult,
    onValidate({ formData }) {
      return parseWithZod(formData, { schema })    // client-side validation
    },
    shouldValidate: 'onBlur',
    shouldRevalidate: 'onInput',
  })

  return (
    <form id={form.id} onSubmit={form.onSubmit} action={action} noValidate>
      <div>
        <label htmlFor={fields.name.id}>Name</label>
        <input {...getInputProps(fields.name, { type: 'text' })} />
        <p>{fields.name.errors}</p>
      </div>
      <div>
        <label htmlFor={fields.email.id}>Email</label>
        <input {...getInputProps(fields.email, { type: 'email' })} />
        <p>{fields.email.errors}</p>
      </div>
      <div>
        <label htmlFor={fields.message.id}>Message</label>
        <textarea {...getTextareaProps(fields.message)} />
        <p>{fields.message.errors}</p>
      </div>
      <button type="submit">Send</button>
    </form>
  )
}

Guidelines

  • Conform forms work without JS — server validates and returns errors via form resubmission.
  • Share Zod schema between client and server — single source of truth for validation.
  • shouldValidate: 'onBlur' validates when user leaves field — less aggressive than onChange.
  • Native form attributes (required, minLength) work as fallback when JS is disabled.
  • Ideal for Remix and Next.js Server Actions — designed for their form patterns.