|
| 1 | +# Architecture |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Skillet is a thin CLI wrapper over `git submodule` that makes it friendly to add, remove, and update AI agent skill repos in `.claude/skills/`. |
| 6 | + |
| 7 | +## Core Design |
| 8 | + |
| 9 | +``` |
| 10 | +User CLI command → Commander parser → Command handler → git submodule operation |
| 11 | +``` |
| 12 | + |
| 13 | +No custom package manager, no registry, no config file. `.gitmodules` is the manifest. |
| 14 | + |
| 15 | +## File Tree |
| 16 | + |
| 17 | +``` |
| 18 | +skillet/ |
| 19 | +├── CLAUDE.md # AI working instructions |
| 20 | +├── SPEC.md # Product spec |
| 21 | +├── ARCH.md # This file |
| 22 | +├── TASKS.md # Task tracking |
| 23 | +├── README.md # Public docs |
| 24 | +├── package.json # npm config |
| 25 | +├── tsconfig.json # TypeScript config |
| 26 | +├── .context/ # AI memory bank |
| 27 | +│ ├── activeContext.md |
| 28 | +│ ├── progress.md |
| 29 | +│ ├── techContext.md |
| 30 | +│ └── systemPatterns.md |
| 31 | +├── .claude/ # Claude Code config |
| 32 | +│ ├── settings.json |
| 33 | +│ ├── hooks/ |
| 34 | +│ ├── commands/ |
| 35 | +│ └── skills/ |
| 36 | +├── .cursor/ # Cursor IDE config |
| 37 | +│ └── rules/ |
| 38 | +├── src/ |
| 39 | +│ ├── cli.ts # Entry point, Commander setup |
| 40 | +│ ├── types.ts # Shared types |
| 41 | +│ ├── commands/ |
| 42 | +│ │ ├── init.ts # Initialize submodules |
| 43 | +│ │ ├── add.ts # Add skill (submodule add) |
| 44 | +│ │ ├── remove.ts # Remove skill (deinit + rm + cleanup) |
| 45 | +│ │ ├── update.ts # Update skills (submodule update --remote) |
| 46 | +│ │ └── status.ts # Show skill status |
| 47 | +│ └── git/ |
| 48 | +│ ├── submodule.ts # All git submodule operations |
| 49 | +│ └── resolve.ts # GitHub shorthand → URL resolution |
| 50 | +├── tests/ |
| 51 | +│ └── git/ |
| 52 | +│ ├── resolve.test.ts |
| 53 | +│ └── submodule.test.ts |
| 54 | +└── dist/ # Build output (gitignored) |
| 55 | +``` |
| 56 | + |
| 57 | +## Key Modules |
| 58 | + |
| 59 | +### `src/git/resolve.ts` |
| 60 | +Resolves GitHub shorthand (`org/repo`) to full SSH URL (`git@github.com:org/repo.git`). Also accepts full SSH and HTTPS URLs passthrough. |
| 61 | + |
| 62 | +### `src/git/submodule.ts` |
| 63 | +Wraps all `git submodule` commands via `child_process.exec`. Handles: |
| 64 | +- `add` with destination path and optional `--branch` for ref pinning |
| 65 | +- `deinit -f` + `git rm -f` + `.git/modules/` cleanup for removal |
| 66 | +- `update --remote --merge` for updates |
| 67 | +- `update --init` for initialization |
| 68 | +- `status` parsing into structured objects |
| 69 | + |
| 70 | +### `src/commands/*` |
| 71 | +One file per CLI command. Each imports from `git/submodule.ts` and `git/resolve.ts`. Handles user output and error formatting. |
0 commit comments