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
npx skills add JaguarJack/catch-admin --skill import -a claude-codeWhat 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
Catalogmodule and theProductmodel. - Add validation to the import:
nameis required,emailmust 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-code2Manually: put the files in place
~/.claude/skills/08-import/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/08-import/
1Skills CLI (Vercel)
npx skills add JaguarJack/catch-admin --skill import -a codex2Manually: put the files in place
.agents/skills/08-import/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JaguarJack/catch-admin --skill import -a cursor2Manually: put the files in place
.cursor/skills/08-import/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JaguarJack/catch-admin .claude/skills/08-import2Manually: put the files in place
.github/skills/08-import/SKILL.md1Skills CLI (Vercel)
npx skills add JaguarJack/catch-admin --skill import -a gemini-cli2Platform CLI
gemini skills install https://github.com/JaguarJack/catch-admin --path .claude/skills/08-importManually: put the files in place
.devin/skills/08-import/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JaguarJack/catch-admin --skill import -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.