Agent skill

add-core-function

Add new core business logic functions to Catalyst-Relay. Use when creating pure functions, ADT operations, or library-consumable code.

Stars 232
Forks 15

Install this agent skill to your Project

npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/artisan-edge/add-core-function

SKILL.md

Adding Core Functions

When to Use

  • Creating new ADT operations (CRAUD, discovery, preview)
  • Adding pure business logic functions
  • Implementing library-consumable functionality

One Function Per File

Each core function gets its own file. No multi-function files.

Location: src/core/{domain}/{function}.ts

core/adt/
├── index.ts              # Barrel exports
├── types.ts              # Shared types (AdtRequestor, ObjectConfig)
├── helpers.ts            # Internal helpers (not exported from barrel)
│
├── craud/
│   ├── read.ts           → readObject()
│   ├── create.ts         → createObject()
│   └── ...
│
└── discovery/
    ├── packages.ts       → getPackages()
    └── ...

Import Hierarchy

Files must follow this hierarchy (no circular dependencies):

types.ts           (shared types, no imports from package)
    ↓
helpers.ts         (internal utilities, imports types)
    ↓
subfolder files    (import ../types and ../helpers)
    ↓
index.ts           (barrel exports, imports from subfolders)

Relative path patterns:

  • ../types — shared types
  • ../helpers — shared helpers
  • ../../utils/xml — core utilities
  • ../../../types/result — global types

Function File Pattern

typescript
// src/core/adt/discovery/packages.ts

import type { AdtRequestor } from '../types';
import type { AsyncResult } from '../../../types/result';

export interface Package {
    name: string;
    description: string;
}

export async function getPackages(
    requestor: AdtRequestor,
    filter?: string
): AsyncResult<Package[]> {
    // Implementation
    const response = await requestor.get('/packages', { params: { filter } });

    if (response.error) {
        return [null, response.error];
    }

    return [parsePackages(response.data), null];
}

// Internal helper (not exported)
function parsePackages(xml: string): Package[] {
    // ...
}

Return Type Convention

Use Go-style error tuples:

typescript
import type { AsyncResult } from '../../../types/result';

// Returns [data, null] on success, [null, error] on failure
export async function someOperation(): AsyncResult<Data> {
    // ...
}

Barrel Exports

Add to index.ts for public API:

typescript
// src/core/adt/index.ts

// Types
export type { AdtRequestor, ObjectConfig } from './types';

// Discovery
export { getPackages } from './discovery/packages';
export { getTree } from './discovery/tree';

// CRAUD
export { readObject } from './craud/read';
export { createObject } from './craud/create';

Internal Helpers

Helpers not exported from barrel go in helpers.ts:

typescript
// src/core/adt/helpers.ts

import type { AdtRequestor } from './types';

// Internal - not exported from index.ts
export function buildObjectUri(name: string, extension: string): string {
    // ...
}

Checklist

- [ ] Create function file in src/core/{domain}/{subfolder}/
- [ ] Define types at top of file or in ../types.ts
- [ ] Use AsyncResult return type for async functions
- [ ] Follow import hierarchy (no circular deps)
- [ ] Export from index.ts if public API
- [ ] Put internal helpers in helpers.ts
- [ ] Run typecheck: bun run typecheck

Expand your agent's capabilities with these related and highly-rated skills.

aiskillstore/marketplace

perigon-backend

Perigon ASP.NET Core + EF Core + Aspire conventions

232 15
Explore
aiskillstore/marketplace

perigon-agent

Pointers for Copilot/agents to apply Perigon conventions

232 15
Explore
aiskillstore/marketplace

perigon-angular

Angular 21+ standalone/Material/signal conventions for Perigon WebApp

232 15
Explore
aiskillstore/marketplace

fastapi-mastery

Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.

232 15
Explore
aiskillstore/marketplace

context7-efficient

Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.

232 15
Explore
aiskillstore/marketplace

browser-use

Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.

232 15
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results