ワンクリックで
learn
WHEN capturing learnings/gotchas/decisions into CLAUDE.md; NOT trivial changes; guides what to record, where it lives, and format.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
WHEN capturing learnings/gotchas/decisions into CLAUDE.md; NOT trivial changes; guides what to record, where it lives, and format.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
WHEN scraping iOS/macOS App Store data (apps, reviews, ratings, search); NOT for installing or testing apps; retrieves structured JSON data using iTunes/App Store APIs with curl and jq formatting
Comprehensive guide for implementing on-device AI models on iOS using Foundation Models and MLX Swift frameworks. Use WHEN building iOS apps with (1) Local LLM inference, (2) Vision Language Models (VLMs), (3) Text embeddings, (4) Image generation, (5) Tool/function calling, (6) Multi-turn conversations, (7) Custom model integration, or (8) Structured generation.
WHEN building ChatGPT apps using the OpenAI Apps SDK and MCP; create conversational, composable experiences with proper UX, UI, state management, and server patterns.
WHEN building SwiftUI views, managing state, setting up shared services, or making architectural decisions; NOT for UIKit or legacy patterns; provides pure SwiftUI data flow without ViewModels using @State, @Binding, @Observable, and @Environment.
WHEN building design systems or component libraries with Tailwind CSS; covers design tokens, CVA patterns and dark mode.
WHEN building React components/pages/apps; enforces scalable architecture, state management, API layer, performance patterns.
| name | learn |
| description | WHEN capturing learnings/gotchas/decisions into CLAUDE.md; NOT trivial changes; guides what to record, where it lives, and format. |
Use this skill to identify learning opportunities and document insights into CLAUDE.md. The goal is to ensure hard-won knowledge is preserved for future developers.
Core Principle: Knowledge that isn't documented is knowledge that will be lost. Every hard-won insight must be preserved for future developers.
Watch for these signals during development:
Document if ANY of these are true:
Skip if ALL of these are true:
Determine which section the learning belongs to:
### New Principle Name
Brief explanation of why this matters.
**Key points:**
- Specific guideline with clear rationale
- Another guideline with example
- Edge case or gotcha to watch for
```typescript
// ✅ GOOD - Example following the principle
const example = "demonstrating correct approach";
// ❌ BAD - Example showing what not to do
const bad = "demonstrating wrong approach";
```
#### Gotcha: Descriptive Title
**Context**: When does this occur
**Issue**: What goes wrong
**Solution**: How to handle it
```typescript
// ✅ CORRECT - Solution example
const correct = handleEdgeCase();
// ❌ WRONG - What causes the problem
const wrong = naiveApproach();
```
## Project Setup / Architecture / Domain Knowledge
### Specific Area
Clear explanation with:
- Why this is important
- How it affects development
- Examples where relevant
## CLAUDE.md Learning Integration
### Summary
Brief description of what was learned and why it matters.
### Proposed Location
**Section**: [Section Name]
**Position**: [Before/After existing content, or new section]
### Proposed Addition
```markdown
[Exact markdown content to add to CLAUDE.md]
```
### Rationale
- Why this learning is valuable
- How it fits with existing guidelines
- What problems it helps prevent
- Time saved by documenting this
### Verification Checklist
- [ ] Learning is not already documented
- [ ] Fits naturally into CLAUDE.md structure
- [ ] Maintains consistent voice and style
- [ ] Includes concrete examples if applicable
- [ ] Prevents future confusion or wasted time
Before proposing documentation, verify:
## CLAUDE.md Learning Integration
### Summary
Discovered that Zod schemas must be exported from a shared location for test files to import them, preventing schema duplication in tests.
### Proposed Location
**Section**: Schema-First Development with Zod
**Position**: Add new subsection "Schema Exports and Imports"
### Proposed Addition
```markdown
#### Schema Organization for Tests
**CRITICAL**: All schemas must be exported from a shared module that both production and test code can import.
```typescript
// ✅ CORRECT - Shared schema module
// src/schemas/payment.schema.ts
export const PaymentSchema = z.object({
amount: z.number().positive(),
currency: z.string().length(3),
});
export type Payment = z.infer<typeof PaymentSchema>;
// src/services/payment.service.ts
import { PaymentSchema, type Payment } from "../schemas/payment.schema";
// src/services/payment.service.test.ts
import { PaymentSchema, type Payment } from "../schemas/payment.schema";
```
**Why this matters:**
- Tests must use the exact same schemas as production code
- Prevents schema drift between tests and production
- Ensures test data factories validate against real schemas
- Changes to schemas automatically propagate to tests
**Common mistake:**
```typescript
// ❌ WRONG - Redefining schema in test file
// payment.service.test.ts
const PaymentSchema = z.object({
/* duplicate definition */
});
```
```
### Rationale
- Encountered this when tests were failing due to schema mismatch
- Would have saved 30 minutes if schema export pattern was documented
- Prevents future schema duplication violations
- Directly relates to existing "Schema Usage in Tests" section
### Verification Checklist
- [x] Learning is not already documented
- [x] Fits naturally into Schema-First Development section
- [x] Maintains consistent voice with CLAUDE.md
- [x] Includes concrete examples showing right and wrong approaches
- [x] Prevents the specific confusion encountered during this task