Fix Interface Errors

VerifiedCaution

Fix compilation errors in interface and controller files following code conventions.

Sby Skills Guide Bot
DevelopmentIntermediate
7/23/2026
Claude Code
#typescript#nestjs#typia#interfaces#type-errors

Recommended for

Automated summary

Fixes TypeScript compilation errors in a NestJS project's interface and controller files by applying the project's typia conventions until the build passes.

Strengths

  • Explicit build → fix → rebuild loop that only stops at zero errors
  • Copy-ready conventions: ICreate, IUpdate, ISummary, IRequest and typia tags (uuid, email, uri, date-time, Minimum/Maximum)
  • Explicitly bans `as` assertions and `any`, forcing real type definitions
  • Documents intentional exceptions to leave alone (console.log/console.error in catch blocks) and corrects redundant route path segments

Limitations

  • Tightly coupled to a specific stack (NestJS + Prisma + typia) and a project-specific `npm run build:main` script
  • Only handles interface and controller errors, not other compilation failures
  • Assumes the Prisma schema is the source of truth for filling empty interfaces
When to use it

Use it when `npm run build:main` fails on empty interfaces, nullable types, or missing typia tags in interface and controller files.

When not to use it

Don't use it for compilation errors outside interfaces/controllers, or on a project that doesn't use typia or the conventions described here.

Security analysis

Caution
Quality score78/100

Nothing malicious: no curl|sh, no secret/credential exfiltration, no obfuscated payloads, no safety-disabling instructions, and the build loop is a normal TypeScript workflow. Risk comes from the powerful toolset (shell + write) combined with a heuristic that renames files, moves directories and rewrites test paths, which can cause unintended edits if the agent overreaches. Treat as caution rather than risky.

Findings
  • •Grants Bash, Edit, and Write, so the agent can execute arbitrary shell commands and rewrite source files; the only command explicitly given (`npm run build:main`) runs whatever script lives in package.json, which is an inherited supply-chain risk.
  • •Step 3 instructs renaming controller classes, files, directories and test paths based on path-deduplication heuristics - a broad refactor that goes well beyond fixing compilation errors and can silently break routing/tests.
  • •No confirmation/scope guard before multi-file edits, and no instruction to avoid destructive git or file operations (e.g. no 'do not delete files' clause).
How this analysis is made

Examples

Fix empty interface build error
`npm run build:main` fails with "Property 'name' does not exist on type '{}'". Fill the empty IEntity interface from the Prisma schema and re-run the build until it passes.
Add typia tags
Fix the type error where a plain string is assigned to `string & Format<"uuid">` in the controller — add the correct typia tags to the interface instead of using `as`.
Fix redundant route path
The controller route is /user/users which repeats the word — fix the redundant path segment in the controller and verify the build still passes.

name: fix-interface description: Fix Interface and Controller compilation errors allowed-tools: Read, Edit, Write, Bash, Grep, Glob

Fix Interface Errors

Fix interface and controller compilation errors according to code conventions.

FORBIDDEN

NEVER use:

  • as keyword (type assertion)
  • any type

Fix type issues by properly defining interfaces.

DO NOT MODIFY

Leave as-is:

  • console.log in Controller catch blocks
  • console.error in Controller catch blocks

These are intentional and should not be changed to NestJS Logger.


Purpose

Fix compilation errors in interface and controller files to ensure npm run build:main passes.

Workflow

┌─────────────────────────────────────┐
│  Step 1: Run Build                  │
│  npm run build:main                 │
└───────────────┬─────────────────────┘
                │
                ▼
┌─────────────────────────────────────┐
│  Step 2: Parse Interface Errors     │
│  - Empty interfaces {}              │
│  - Type mismatches                  │
│  - Missing properties               │
└───────────────┬─────────────────────┘
                │
                ▼
┌─────────────────────────────────────┐
│  Step 3: Fix by Convention          │
│  - Fill empty interfaces            │
│  - Add typia tags                   │
│  - Fix nullable types               │
└───────────────┬─────────────────────┘
                │
                ▼
┌─────────────────────────────────────┐
│  Step 4: Re-run Build               │
│  Loop until 0 errors                │
└─────────────────────────────────────┘

Step 1: Run Build

npm run build:main 2>&1 | head -100

Capture interface-related errors.


Step 2: Parse Errors

Common error patterns:

  • Type '{}' is not assignable → Empty interface
  • Property 'X' does not exist on type '{}' → Empty interface
  • Type 'string' is not assignable to type 'string & Format<"uuid">' → Missing typia tag

Step 3: Fix by Convention

Empty Interface Fix

Read Prisma schema and fill interface:

// Before
export type IEntity = {};

// After
import { tags } from "typia";

export type IEntity = {
  id: string & tags.Format<"uuid">;
  name: string;
  status: "active" | "inactive";
  created_at: string & tags.Format<"date-time">;
  updated_at: string & tags.Format<"date-time">;
  deleted_at: (string & tags.Format<"date-time">) | null;
};

ICreate Convention

export namespace IEntity {
  export type ICreate = {
    name: string;
    status?: "active" | "inactive";  // optional with default
  };
}

IUpdate Convention

export namespace IEntity {
  export type IUpdate = {
    name?: string;
    status?: "active" | "inactive";
  };
}

ISummary Convention

export namespace IEntity {
  export type ISummary = {
    id: string & tags.Format<"uuid">;
    name: string;
    status: "active" | "inactive";
    created_at: string & tags.Format<"date-time">;
  };
}

IRequest Convention

export namespace IEntity {
  export type IRequest = {
    page?: number & tags.Minimum<1>;
    limit?: number & tags.Minimum<1> & tags.Maximum<100>;
    search?: string;
    status?: "active" | "inactive";
  };
}

Typia Tags

// UUID
id: string & tags.Format<"uuid">;

// Email
email: string & tags.Format<"email">;

// URL
url: string & tags.Format<"uri">;

// DateTime
created_at: string & tags.Format<"date-time">;

// Numeric constraints
page: number & tags.Minimum<1>;
limit: number & tags.Minimum<1> & tags.Maximum<100>;

Nullable Types

// Nullable field
deleted_at: (string & tags.Format<"date-time">) | null;

// Optional nullable field
description?: string | null;

Path Naming Fix

Fix redundant path segments where the same word repeats:

// Before - redundant word in path: /{word}/{word}s
@Controller("{prefix}/{word}/{word}s")
export class {Word}{Word}sController { ... }

// After - remove redundant segment
@Controller("{prefix}/{word}s")
export class {Word}sController { ... }

Pattern to fix:

  • /{word}/{word}s → /{word}s
  • /{word}/{word}-* → /{word}-* or /{word}/*

When fixing paths, also update:

  1. Controller @Controller() decorator
  2. Controller class name
  3. Controller file name and directory
  4. Related provider function names
  5. Test file paths and API calls

Step 4: Verify

npm run build:main

Repeat Steps 2-4 until no interface errors.


Common Fixes

| Error Pattern | Fix | |---------------|-----| | Empty interface {} | Read Prisma schema, define all fields | | Missing typia tag | Add appropriate tags.Format<> | | Nullable mismatch | Add \| null for nullable fields | | Missing namespace | Add namespace with ICreate, IUpdate, etc. | | Redundant path /{word}/{word}s | Remove duplication: /{word}s |


Exit Condition

  • npm run build:main completes with no interface errors
  • All interfaces properly defined
  • All typia tags applied
  • No redundant path segments (/{word}/{word}s pattern)

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/fix-interface-errors-mrx3xxtv' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/fix-interface-errors-mrx3xxtv/download' --output '.skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md.part' && mv '.skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md.part' '.skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Edit, Write, Bash, Grep, Glob

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md' && test -s '.skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/fix-interface' && cp -R '.skill-downloads/fix-interface-errors-mrx3xxtv' '.claude/skills/fix-interface'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/fix-interface-errors-mrx3xxtv'

openskills read 'fix-interface-errors-mrx3xxtv'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/fix-interface-errors-mrx3xxtv/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills