Skip to main content
skill CX Codex

import · jaguarjack — CatchAdmin Claude Code skill: what it does, how to install

Writes the PHP class that imports an Excel sheet into a CatchAdmin module: drops the header row and maps each column onto a model field.

Apache-2.0 1 installs ★ 941 updated 2026-10-27

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add JaguarJack/catch-admin --skill import -a claude-code
Open on GitHub

What import does

The skill handles step eight of a CatchAdmin module build and writes the import class to modules/{Module}/Import/{Model}.php. It extends Catch\Support\Excel\Import and fills in collection(), which receives the row collection, drops the header with $rows->skip(1) and creates one model record per row.

Columns are addressed by position starting at zero: A is $row[0], B is $row[1]. The validation variant builds an array from the row first, runs Validator::make with rules per field, and returns early on rows that fail.

All the controller needs is $import->import($request->file('file')). The class extends Catch\Support\Excel\Import, so a project without CatchAdmin's Excel layer has nothing to inherit. Column order is part of the deal: move a column in the sheet and the values land in the wrong fields.

What it helps with

  • generate an Excel import class for a CatchAdmin module
  • skip the header row while reading a sheet
  • map spreadsheet columns onto model fields
  • drop rows that fail validation
  • wire the import into a controller action

Example prompts for the agent

  • Generate the import class for the Catalog module and the Product model.
  • Add validation to the import: name is required, email must be an email address.
  • Show the controller action that passes an uploaded file to the import.

How to install import

1Skills CLI (Vercel)

npx skills add JaguarJack/catch-admin --skill import -a claude-code

2Manually: put the files in place

~/.claude/skills/08-import/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/08-import/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about import

How do I install import in Claude Code?

Run npx skills add JaguarJack/catch-admin --skill 08-import -a claude-code. The skill lands in ~/.claude/skills/08-import/SKILL.md.

What does the import skill do?

It generates the PHP import class for a CatchAdmin module: a subclass of Catch\Support\Excel\Import whose collection() method turns sheet rows into model records.

Does it need CatchAdmin installed?

Yes. The generated class inherits from Catch\Support\Excel\Import and works with Illuminate\Support\Collection, so it belongs in a CatchAdmin project.

Source text

SKILL.md · Apache-2.0
---
name: import
description: Generate Excel import class for CatchAdmin module.
---

# Step 8: Generate Import Class

创建数据导入类。

## File Location

```
modules/{Module}/Import/{Model}.php
```

## Template

```php
<?php

namespace Modules\{Module}\Import;

use Catch\Support\Excel\Import;
use Illuminate\Support\Collection;
use Modules\{Module}\Models\{Model};

class {Model} extends Import
{
    public function collection(Collection $rows): void
    {
        // Skip header row
        $rows->skip(1)->each(function ($row) {
            {Model}::create([
                'name' => $row[0],
                // map other columns
            ]);
        });
    }
}
```

## Column Mapping

Excel 列索引从 0 开始:
- Column A = `$row[0]`
- Column B = `$row[1]`
- Column C = `$row[2]`

## With Validation

```php
public function collection(Collection $rows): void
{
    $rows->skip(1)->each(function ($row, $index) {
        $data = [
            'name' => $row[0] ?? null,
            'email' => $row[1] ?? null,
        ];

        $validator = Validator::make($data, [
            'name' => 'required|string|max:100',
            'email' => 'required|email',
        ]);

        if ($validator->fails()) {
            return; // Skip invalid row
        }

        {Model}::create($data);
    });
}
```

## Controller Usage

```php
public function import(Request $request, {Model}Import $import)
{
    return $import->import($request->file('file'));
}
```

© JaguarJack · Apache-2.0 · JaguarJack/catch-admin

Similar skills

All skills for Backend and APIs →

import by other authors comes first.

import SubframeApp Imports an existing codebase or website design system into Subframe. Recreates theme tokens, typography, icon assets, and reusable component libraries. CX Codex +1 266installs import Insilico-org This Claude Code skill imports wearable data into PLSI maps. It runs on requests to load data from Open Wearables, Google Health, or an export file. CX Codex +1 ★ 93repo stars neo4j-import-skill neo4j-contrib The neo4j-import-skill Claude Code skill guides structured-data imports into Neo4j. It covers CSV, JSON and Parquet loads, plus relational-to-graph migrations. CX Codex +1 908installs square-import openaccountant square-import is a Claude Code skill that imports Square sales CSVs into Open Accountant. It splits tips, fees, and refunds into separate transaction entries. CX Codex +1 429installs wiki-import Ar9av wiki-import is a Claude Code skill that imports a wiki graph into the current Obsidian vault from graph.json or an OKF Markdown bundle. It handles conflicts with existing pages. CX Codex +1 1,000installs paypal-import openaccountant paypal-import turns a PayPal CSV export into ledger entries: payments, fees, refunds and currency conversions. Useful if you keep books in Open Accountant. CX Codex +1 436installs agent-import starchild agent-import moves an agent into Starchild from a migration bundle. Use it when an agent comes from another platform and you have its migration code and download token. CX Codex +1 232installs re0-import LilMGenius re0-import — a Claude Code skill routes handed-over material into documents in an existing knowledge base. It follows that base’s own routing rules for notes, links, and corrections. CX Codex +1 123installs

Project sponsors

Companies that keep this analytics open