add-language-hook
/add-language-hook
Dodaje hook chunkera dzielący pliki źródłowe danego języka na przeszukiwalne fragmenty (klasy, funkcje, komentarze) w potoku ingestu, np. dla Kotlina, TypeScriptu czy Ruby.
- Autor
- artk0de ↗
- Repozytorium
- tearags-mcp ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 18.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 18.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Dodaje hook chunkera dzielący pliki źródłowe danego języka na przeszukiwalne fragmenty (klasy, funkcje, komentarze) w potoku ingestu, np. dla Kotlina, TypeScriptu czy Ruby.
Wyzwalacze z opisu
Oryginalny opis (EN)
Add chunker hook splitting a language's source files into searchable chunks (classes, functions, comments) in ingest pipeline. Triggers on "add Kotlin support", "improve TypeScript class chunking", "fix Ruby comment extraction", "add language X". NOT for tweaking generic chunker behavior — edit chunker base directly for language-agnostic changes.
Jak działa
- Step 1: Check if the language directory exists
- Step 2: Understand the hook interface
- Step 3: Create the hook file
- Step 4: Create or update the barrel
- Step 5: Register in language config
- Step 6: Write tests
- Step 7: Verify
Podgląd SKILL.md
---
name: add-language-hook
description:
Add chunker hook splitting a language's source files into searchable chunks
(classes, functions, comments) in ingest pipeline. Triggers on "add Kotlin
support", "improve TypeScript class chunking", "fix Ruby comment extraction",
"add language X". NOT for tweaking generic chunker behavior — edit chunker
base directly for language-agnostic changes.
---
# Add Language Hook
Add chunking hook for new/existing language in ingest pipeline.
Hooks live in `src/core/domains/ingest/pipeline/chunker/hooks/<language>/`.
## Step 1: Check if the language directory exists
Look in `chunker/hooks/` for existing `<language>/` directory.
- **Exists** — adding new hook to existing language. Read `<language>/index.ts`
for current hook chain.
- **Doesn't exist** — adding hooks for new language. Create `<language>/`
directory.
## Step 2: Understand the hook interface
Read `chunker/hooks/types.ts`. Every hook implements:
```typescript
interface ChunkingHook {
name: string;
process: (ctx: HookContext) => void;
}
```
`HookContext` provides:
- **Read-only**: `containerNode`, `validChildren`, `code`, `codeLines`, `config`
- **Mutable**: `excludedRows`, `methodPrefixes`, `methodStartLines`,
`bodyChunks`
Hooks mutate context in order. Earlier hooks populate state later hooks read
(e.g. comment-capture populates `excludedRows`, body-chunker reads it).
## Step 3: Create the hook file
Create `hooks/<language>/<hook-name>.ts`. Follow existing patterns:
- `comment-capture.ts` — extracts doc comments, marks rows excluded
- `class-body-chunker.ts` — splits large class bodies into method-level chunks
Name exported hook: `<language><Purpose>Hook` (e.g. `rubyCommentCaptureHook`,
`typescriptBodyChunkingHook`).
## Step 4: Create or update the barrel
`hooks/<language>/index.ts` exports ordered hook array:
```typescript
import type { ChunkingHook } from "../types.js";
import { myCommentCaptureHook } from "./comment-capture.js";
import { myBodyChunkingHook } from "./class-body-chunker.js";
export const <language>Hooks: ChunkingHook[] = [
myCommentCaptureHook, // Order matters: comment-capture first
myBodyChunkingHook, // Body chunker reads excludedRows
];
```
## Step 5: Register in language config
Edit `chunker/language-config/config.ts`. Find language entry in
`LANGUAGE_DEFINITIONS`, add `hooks` property:
```typescript
import { <language>Hooks } from "../hooks/<language>/index.js";
// In LANGUAGE_DEFINITIONS:
<language>: {
// ... existing config ...
hooks: <language>Hooks,
},
```
Language absent from `LANGUAGE_DEFINITIONS` → add full entry with `loadModule`,
`extractLanguage`, `chunkableTypes`, `hooks`.
## Step 6: Write tests
Tests go in `tests/core/domains/ingest/pipeline/chunker/hooks/<language>/`.
Follow existing test patterns in `typescript/` or `ruby/` directories.
Each hook gets own test file testing `process()` with real `HookContext` (use
`createHookContext()` from `types.ts`).
## Step 7: Verify
```bash
npx tsc --noEmit
npx vitest run tests/core/domains/ingest/pipeline/chunker/hooks/<language>/
```
Wersje
W bazie nie ma innych skilli o nazwie add-language-hook.
Migawka bazy z 13.11.2026 · wersja paczki c7aef2086648 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100generate-emitter
Tworzy szkielet emitera nowego języka dla oagen, implementujący interfejs Emitter i generujący idiomatyczny kod SDK, na przykład dla Go, Pythona, Kotlina czy Javy. - 100kotlin
Opisuje podstawy języka Kotlin: bezpieczeństwo null, coroutines, Flow, klasy sealed i data, funkcje zakresu oraz funkcje Kotlin 2.x (kompilator K2, context parameters) dla Kotlin/JVM, Native i JS. - 100kotlin-language
Pomaga pisać idiomatyczny Kotlin 1.9+: bezpieczeństwo null, klasy sealed i data, funkcje rozszerzające, delegaty, kolekcje, generyki inline i reified oraz migracja z Javy do Kotlina. - 100lang-ruby
Pisze, przegląda, testuje i konfiguruje backend w Rubym w przebiegu loops: narzędzia, układ, pokrycie i pułapki języka. - 96add-language
Dodaje obsługę nowego języka programowania do narzędzia Acai: zależność Tree-sitter, parser i rejestrację w katalogu głównym. - 90ruby
Dostarcza listę kontrolną do wywiadów i wdrożeń specyfikacji w Ruby: klasy, moduły, RSpec i obiekty serwisowe.