본문으로 건너뛰기
cccskills
무료GitHub에 공개

extensions

Write, test, turn on or off, add and remove gent extensions while gent runs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

An extension adds tools, requests, agents, hooks and Resources to gent. Gent loads extension files at the start of each turn. There is no restart and no file watcher.

Where extensions live

  • User scope: ~/.gent/extensions/. It reaches every project on this server.
  • Project scope: <project>/.gent/extensions/. It loads only when the user trusts the project (trustedProjects in ~/.gent/config.json). Only the user can trust a project.

An extension is one .ts, .js or .mjs file, or a directory with an index.ts, index.js or index.mjs. A file named *.client.* belongs to the TUI, not to the server. Names that start with . or _ are not loaded.

Write one

Write the file with the file tools. Import only effect, @gent/core/extensions/api and @gent/core/extensions/branch-tools; gent binds these to the modules it runs. A module that the file imports by a relative path is built with it. Do not install npm packages for an extension.

import { Effect, Schema } from "effect"
import { defineExtension, ExtensionHost, tool } from "@gent/core/extensions/api"

const Greet = tool({
  id: "greet.say",
  description: "Greet a person by name",
  params: Schema.Struct({ name: Schema.String }),
  output: Schema.String,
  execute: ({ name }) => Effect.succeed(`Hello, ${name}`),
})

export default defineExtension({
  id: "greet",
  setup: Effect.gen(function* () {
    const host = yield* ExtensionHost
    yield* host.register("tool", Greet)
  }),
})

Export one defineExtension(...). Register each contribution through yield* ExtensionHost in setup; setup returns nothing. Host facades (Session, Interaction, FileLock, Extensions, State) come from yield* ExtensionContext inside a handler.

Test it

  1. Write or edit the file.
  2. Call tools.extensions.status({ id }). It loads the files as they are now and runs the real loader. A failure names its phase: load (the file did not build or import), setup, validation (a tool id or an agent name collides) or startup (a Resource did not build), with the error.
  3. Fix and call it again until the extension is Active.
  4. Use the new tool in the next turn. To continue in the same task, pass resume to a verb below, or start a child agent: its first turn loads the new files.

When an edit breaks an extension that loaded before, gent keeps the last good version running. extensions.status reports it Active with reloadFailed: the phase and the error of the new version. Fix the file; the next turn loads the fix.

Change what loads

Each of these asks the user once. A headless run declines. The change reaches the next turn of every session in the scope, not the running turn.

  • tools.extensions.disable({ id, scope }) and tools.extensions.enable({ id, scope }) edit disabledExtensions in the scope's config.json. A config file gent cannot read is refused: the user fixes it first.
  • tools.extensions.add({ path, scope }) copies a file or directory into the scope's extensions directory. A name that exists is refused: edit that extension in place.
  • tools.extensions.remove({ id, scope }) moves the extension's file or directory into a new directory under extension-trash in gent's data directory, where the user can get it back. A shipped extension cannot be removed; disable it.
  • tools.extensions.reload({ id }) sets the extensions up again over the same files. It does not ask. A file edit needs no reload.

Name the scope (user or project) unless the session runs from the home directory. Pass resume: "<what to do next>" to queue that message as your next turn once the change is made. Use resume only to go on with the task the user gave you.

The ask is consent for the change, not a sandbox: the file tools and bash can write the same files without an ask. Tell the user what you change.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Foundational principles for architectural decisions and code review.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cevr/gent52026년 10월 22일 업데이트

Fetch and inspect external Git repositories and npm packages with their native command-line tools.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cevr/gent52026년 10월 22일 업데이트

Launch gent (this repo's TUI agent harness) on the scripted model in a scratch home, check the run is worth driving, drive the real TUI and `gent ctl` as a user does from a feature map, and keep the proof. Use to check a change in the real TUI, to confirm a turn, a slash command, a pane, a picker or a ctl call works, or to show the owner it works. No paid model call, no owner data.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cevr/gent52026년 10월 22일 업데이트

cevr의 스킬 모두 보기

이 스킬의 문제 신고