# New Package Skill

Create a new package in the Topographic Studio monorepo.

## Task

You are helping the user scaffold a new package in the monorepo with all necessary configuration.

## Instructions

1. **Gather information** from the user:
   - Package name (e.g., "hooks", "animations", "api-client")
   - Package description
   - Package type (library, UI components, utilities, types, config)
   - Dependencies needed

2. **Create package structure**:
   ```
   packages/{name}/
   ├── package.json
   ├── tsconfig.json
   ├── tsup.config.ts (if applicable)
   ├── README.md
   └── src/
       └── index.ts
   ```

3. **Configure package.json**:
   - Name: `@topographic-studio/{name}`
   - Version: `0.0.1`
   - Exports configuration
   - Build scripts
   - Repository info

4. **Add TypeScript config**:
   - Extend root tsconfig
   - Configure paths

5. **Create initial source file**:
   - Basic export structure
   - Example implementation

6. **Update root package.json**:
   - Ensure workspace includes the new package

7. **Install dependencies**:
   ```bash
   bun install
   ```

8. **Verify setup**:
   ```bash
   bun run build --filter=@topographic-studio/{name}
   ```

## Package.json Template

```json
{
  "name": "@topographic-studio/{name}",
  "version": "0.0.1",
  "description": "{description}",
  "main": "./dist/index.js",
  "module": "./dist/index.mjs",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.mjs",
      "require": "./dist/index.js"
    }
  },
  "files": ["dist"],
  "scripts": {
    "build": "tsup",
    "dev": "tsup --watch",
    "lint": "biome check .",
    "lint:fix": "biome check --write .",
    "typecheck": "tsc --noEmit"
  },
  "keywords": [],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/leobrival/core.git",
    "directory": "packages/{name}"
  },
  "devDependencies": {
    "tsup": "^8.3.5",
    "typescript": "^5.7.2"
  }
}
```

## Success Criteria

- Package builds successfully
- TypeScript types are correct
- Can be imported from other packages
- Documentation is complete

## Output Format

```
Created new package: @topographic-studio/{name}

Location: packages/{name}/
Files created:
  ✅ package.json
  ✅ tsconfig.json
  ✅ tsup.config.ts
  ✅ README.md
  ✅ src/index.ts

Next steps:
1. Implement your package logic in src/
2. Add dependencies if needed: bun add -D package-name
3. Build: bun run build --filter=@topographic-studio/{name}
4. Use in other packages: import from "@topographic-studio/{name}"
```
