reference-signal-forms
Explains the mental model and architecture of the code under `packages/forms/signals`. You MUST use this skill any time you plan to work with code in `packages/forms/signals`
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o reference-signal-forms.zip https://jpskill.com/download/22425.zip && unzip -o reference-signal-forms.zip && rm reference-signal-forms.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22425.zip -OutFile "$d\reference-signal-forms.zip"; Expand-Archive "$d\reference-signal-forms.zip" -DestinationPath $d -Force; ri "$d\reference-signal-forms.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
reference-signal-forms.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
reference-signal-formsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
Signal Forms Architecture
The packages/forms/signals directory contains an experimental, signal-based forms API for Angular.
This system differs significantly from the existing Reactive and Template-driven forms.
Mental Model
-
Model-Driven: The system is built around a
WritableSignal<T>which serves as the single source of truth. Unlike Reactive Forms where theFormControlholds the value, here theSignalholds the value. The form is merely a view or projection of that signal, adding form-specific state (validity, dirty, touched). -
Proxy-Based Traversal: The form API (
form(signal)) returns aFieldTree. This object is a Proxy. It allows accessing nested fields (e.g.,myForm.user.name) without manually creating control groups. Accessing a property on the proxy lazily resolves or creates the correspondingFieldNode. -
Schema-Based Logic: Validation, disabled state, and other metadata are defined separately via Schemas. Schemas are applied to the form structure using functions like
apply,applyEach(for arrays), andapplyWhen. This separates the structure of the data from the rules governing it. -
Directives as Glue: The
[formField]directive binds a DOM element (native input or custom control) to aFieldNode. It handles:- Syncing the value between the DOM and the Signal.
- Reflecting state (valid, touched, etc.) to the UI.
- Handling user interaction events (blur, input).
Key Components
1. FieldNode (src/field/node.ts)
The central internal class representing a single field in the form graph. It aggregates several state managers:
structure: Manages parent/child relationships and signal slicing.validationState: Computesvalid,invalid,errorssignals.nodeState: Trackstouched,dirty,pristine.metadataState: Stores metadata likemin,max,required.submitState: Tracks submission status and server errors.
2. ValidationState (src/field/validation.ts)
Manages the complexity of validation:
- Synchronous Errors: Derived from schema rules.
- Asynchronous Errors: Handled via signals, including 'pending' states.
- Tree Errors: Errors that bubble up or are targeted at specific fields.
- Submission Errors: Server-side errors injected imperatively via
submit().
3. FormField Directive (src/directive/form_field_directive.ts)
The bridge between the FieldNode and the DOM.
- Selector:
[formField] - It supports:
- Native Elements:
<input>,<select>,<textarea>. - Custom Controls: Components implementing
FormUiControlorFormValueControl. - Legacy Interop: Components implementing
ControlValueAccessor(viaInteropNgControl).
- Native Elements:
4. Schema (src/api/structure.ts & src/api/rules)
Defines the behavior.
- Created via
schema(fn). - Applied via
apply(path, schema). - Rules include validators (
required,pattern,min,max) and state modifiers (disabled,hidden).
Data Flow
- Read:
form.field.value()reads directly from the underlying signal (projected to the specific path). - Write: Writing to the form (e.g., via UI) updates the underlying signal.
- Validation: A computed effect observes the value signal and runs validators defined in the schema.
Usage Example (Conceptual)
// 1. Define Model
const user = signal({name: '', age: 0});
// 2. Define Schema
const userRules = schema((u) => {
required(u.name);
min(u.age, 18);
});
// 3. Create Form
const userForm = form(user, userRules); // OR apply(userForm, userRules)
// 4. Bind in Template
// <input [formField]="userForm.name">
Important Files
packages/forms/signals/src/api/structure.ts: Public API entry points (form,apply).packages/forms/signals/src/api/control.ts: Interfaces for custom controls (FormUiControl).packages/forms/signals/src/field/node.ts: TheFieldNodeimplementation.packages/forms/signals/src/directive/form_field_directive.ts: The[formField]directive.
Supplemental Information
- Compiler & Core Integration: Details how
[formField]hooks into type-checking and the runtime.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (4,503 bytes)
- 📎 references/integration.md (3,313 bytes)