Expert TypeScript development rules for the FileArchitect monorepo - clean, DRY, maintainable code with pnpm package management
Expert TypeScript development assistant for the FileArchitect monorepo project. This skill enforces best practices for clean, maintainable code using TypeScript and pnpm in a monorepo structure.
Provides specialized guidance for developing in the FileArchitect codebase, which creates file and folder structures from simple text outlines. Ensures consistent TypeScript patterns, monorepo architecture adherence, and clean code principles.
When working on FileArchitect code, follow these rules:
1. **Language & Expertise**
- Write all code in TypeScript with full type safety
- Apply expert-level TypeScript patterns and best practices
- Use modern TypeScript features appropriately
2. **Monorepo Structure**
- Recognize the monorepo architecture
- The core package is located at `packages/core` as `@filearchitect/core`
- Respect package boundaries and dependencies
- Use workspace references correctly
3. **Code Quality Standards**
- Write clean, readable code that is easy to understand
- Apply DRY (Don't Repeat Yourself) principle - extract reusable logic
- Ensure maintainability - code should be easy to modify and extend
- Follow consistent naming conventions and code organization
4. **Package Management**
- Use `pnpm` for all package management operations
- When installing dependencies: `pnpm add <package>`
- When installing dev dependencies: `pnpm add -D <package>`
- For workspace operations: `pnpm --filter <package-name> <command>`
- Never use npm or yarn commands
5. **Code Organization**
- Keep functions focused and single-purpose
- Use meaningful variable and function names
- Organize imports logically (external, internal, relative)
- Extract complex logic into well-named helper functions
6. **TypeScript Best Practices**
- Avoid `any` types - use proper type definitions
- Leverage type inference where appropriate
- Use interfaces for object shapes, types for unions/intersections
- Apply generics for reusable type-safe code
```bash
pnpm add lodash
pnpm add -D @types/node
pnpm --filter @filearchitect/core add zod
```
```typescript
// Good - DRY and maintainable
interface FileNode {
name: string;
type: 'file' | 'directory';
children?: FileNode[];
}
function createFileStructure(nodes: FileNode[]): void {
nodes.forEach(node => {
if (node.type === 'directory') {
createDirectory(node.name);
if (node.children) {
createFileStructure(node.children);
}
} else {
createFile(node.name);
}
});
}
// Bad - repetitive and unclear
function createStuff(things: any[]): void {
for (let i = 0; i < things.length; i++) {
if (things[i].t === 'd') {
// create dir
if (things[i].c) {
for (let j = 0; j < things[i].c.length; j++) {
// nested logic...
}
}
}
}
}
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/filearchitect-typescript-development/raw