Markdown Converter
Agent skill for markdown-converter
This file contains essential information for agentic coding assistants working in this repository.
Sign in to like and favorite skills
This file contains essential information for agentic coding assistants working in this repository.
opencode-pty is an OpenCode plugin that provides interactive PTY (pseudo-terminal) management. It enables AI agents to run background processes, send interactive input, and read output on demand. The plugin supports multiple concurrent PTY sessions with features like output buffering, regex filtering, and permission integration.
bun run typecheck
Runs TypeScript compiler in no-emit mode to check for type errors.
bun test
Runs all tests using Bun's test runner.
bun test --match "test name pattern"
Use the
--match flag with a regex pattern to run specific tests. For example:
bun test --match "spawn"
No dedicated linter configured. TypeScript strict mode serves as the primary code quality gate.
.ts extensions in importsstrict: true)noFallthroughCasesInSwitch, noUncheckedIndexedAccess, noImplicitOverride.ts extensions: import { foo } from "../foo.ts"import type { Foo } from "./types.ts"import * as foo)processData, spawnSession)DEFAULT_LIMIT, MAX_LINE_LENGTH)PTYSession, SpawnOptions)PTYManager, RingBuffer)PTYStatus)spawn.ts, manager.ts)createLogger from ../logger.ts for consistent loggingtool() wrapper with schema validation for all exported toolsAll tool functions must use schema validation:
export const myTool = tool({ description: "Brief description", args: { param: tool.schema.string().describe("Parameter description"), optionalParam: tool.schema.boolean().optional().describe("Optional param"), }, async execute(args, ctx) { // Implementation }, });
src/ ├── plugin.ts # Main plugin entry point ├── types.ts # Plugin-level types ├── logger.ts # Logging utilities └── plugin/ # Plugin-specific code ├── pty/ # PTY-specific code │ ├── types.ts # PTY types and interfaces │ ├── manager.ts # PTY session management │ ├── buffer.ts # Output buffering (RingBuffer) │ ├── permissions.ts # Permission checking │ ├── wildcard.ts # Wildcard matching utilities │ └── tools/ # Tool implementations │ ├── spawn.ts # pty_spawn tool │ ├── write.ts # pty_write tool │ ├── read.ts # pty_read tool │ ├── list.ts # pty_list tool │ ├── kill.ts # pty_kill tool │ └── *.txt # Tool descriptions └── types.ts # Plugin types
const DEFAULT_LIMIT = 500;PTY_MAX_BUFFER_LINES)pty_${hex}.txt description files for each tool in tools/ directorydescribe() in schemasFollow conventional commit format:
feat: for new featuresfix: for bug fixesrefactor: for code restructuringtest: for test additionsdocs: for documentation changesv prefixed tagscurl -fsSL https://bun.sh/install | bashbun installbun run <script>curl -L https://nixos.org/nix/install | shnix developnix run github:nix-community/bun2nix -- -o nix/bun.nixnix flake updatemanager singleton for PTY operationsbun run typecheck and fix reported issuespty_list to check active sessionsThis guide should be updated as the codebase evolves. When adding new features or changing conventions, update this document accordingly.