Skip to content
cccskills
FreePublished on GitHub

infra

Get guidance for package and dependency work in a bun-based monorepo. It covers package boundaries, cross-package imports, build commands, type checks, linting, and the structure for adding a new package.

OriginalShow the original description

Use when working with packages, dependencies, monorepo structure, or build configuration

trycompai/comp2,061 stars(GitHub 2,061 + cccskills 0)

Run score Not tested

See how to install

Good for

  • Adding a dependency to one monorepo package
  • Choosing whether code belongs in a shared package
  • Running builds and checks across packages

Files included (1)

  • SKILL.md2.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Source Cursor rule: .cursor/rules/infra.mdc. Original Cursor alwaysApply: false.

Infrastructure

Package Manager

Use bun, never npm/yarn/pnpm.

bun install              # Install deps
bun add <pkg>            # Add package
bun add -D <pkg>         # Add dev dependency
bun run <script>         # Run script
bunx <cmd>               # Execute binary

Monorepo Structure

comp/
├── apps/
│   ├── api/             # NestJS backend
│   ├── app/             # Next.js main app
│   └── portal/          # Next.js portal
├── packages/
│   ├── db/              # Prisma (@trycompai/db)
│   ├── ui/              # Legacy UI (@trycompai/ui); prefer @trycompai/design-system
│   └── ...
├── turbo.json
└── package.json

Running Commands

# Multi-package (via turbo)
bun run build            # Build all
bun run lint             # Lint all
bun run typecheck        # Type check all
bun run dev              # Dev all

# Single package
bun run -F apps/app dev
bun run -F @trycompai/db prisma:generate
turbo build --filter=@trycompai/ui

Importing Between Packages

// ✅ Import from package name
import { Button } from '@trycompai/design-system';
import { prisma } from '@trycompai/db';

// ❌ Never relative paths across packages
import { Button } from '../../../packages/ui/src/button';

Adding Dependencies

# To specific package
bun add axios -F apps/app
bun add -D vitest -F @trycompai/ui

# To root (dev tools only)
bun add -D -w prettier typescript

After Code Changes

Always run checks:

bun run typecheck
bun run lint

Fix all errors before committing.

Common TypeScript Fixes

  • Property does not exist: Check interface definitions
  • Type mismatch: Verify expected vs actual type
  • Empty interface extends: Use type X = SomeType instead

Common ESLint Fixes

  • Unused variables: Remove or prefix with _
  • Any type: Add proper typing
  • Empty object type: Use type instead of interface

Creating a New Package

mkdir packages/my-package
// packages/my-package/package.json
{
  "name": "@trycompai/my-package",
  "version": "0.0.0",
  "private": true,
  "main": "./src/index.ts",
  "scripts": {
    "build": "tsup src/index.ts --format cjs,esm --dts",
    "typecheck": "tsc --noEmit"
  }
}
// packages/my-package/tsconfig.json
{
  "extends": "@trycompai/tsconfig/base.json",
  "include": ["src"]
}

Package Boundaries

✅ Create packages for:

  • Code used by 2+ apps
  • Self-contained, focused functionality

❌ Don't create packages for:

  • Code only used in one app (colocate instead)
  • App-specific business logic

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Guide API endpoint changes so request DTOs, runtime validation, OpenAPI documentation, and MCP tool metadata stay aligned. It covers discoverability, authentication, uploads, long-running tasks, and response types that MCP tools cannot handle.

  • Adding an API endpoint with a request body
  • Updating DTO validation and OpenAPI metadata
  • Making an endpoint available as an MCP tool
trycompai/comp2.1KUpdated Oct 24, 2026

Review specified files for design system usage, replace legacy @trycompai/ui components and lucide-react icons with available @trycompai/design-system equivalents, and run the app type check to verify the migration.

  • Migrating legacy UI components
  • Replacing lucide-react icons with Carbon icons
  • Checking specified files for design system compliance
trycompai/comp2.1KUpdated Oct 24, 2026

audit-hooks

FreeSummary

Review specified files for outdated hook and API patterns, then replace them with the prescribed SWR hooks, API clients, or server API calls. The guidance covers data fetching, mutations, cache updates, and response handling, followed by a typecheck command.

  • Auditing files for disallowed API and hook patterns
  • Replacing raw fetch calls with the API client
  • Migrating server actions and database mutations to API hooks
trycompai/comp2.1KUpdated Oct 24, 2026

audit-rbac

FreeSummary

Review NestJS API endpoints and frontend components for role-based access control and audit log compliance. The skill lists permission, guard, route, and UI gating rules, then directs the agent to fix violations and run type checks.

  • Auditing API routes for permission decorators
  • Checking UI actions against user permissions
  • Fixing access control inconsistencies
trycompai/comp2.1KUpdated Oct 24, 2026

audit-tests

FreeSummary

Audit unit tests for components that use permissions. Add missing tests and fix failures, checking that administrators can use mutation controls, auditors cannot, and read-only content remains visible to both.

  • Adding permission tests for a component
  • Checking admin and auditor behavior
  • Fixing failing permission-related tests
trycompai/comp2.1KUpdated Oct 24, 2026

Set up Better Auth for TypeScript applications, including server and client configuration, database adapters, sessions, email and social sign-in, and plugins. The guide also highlights environment variables, schema generation, and security settings to review.

  • Configuring Better Auth in a TypeScript app
  • Connecting an ORM or database adapter
  • Setting up sessions and cookie storage
trycompai/comp2.1KUpdated Oct 24, 2026

See all skills by trycompai

Report a problem with this skill