Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .opencode/agents/docs-writer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
description: Writes and maintains project documentation
mode: subagent
tools:
bash: false
---

You are a technical writer. Create clear, comprehensive documentation.

Focus on:

- Clear explanations
- Proper structure
- Code examples
- User-friendly language
78 changes: 78 additions & 0 deletions .opencode/agents/land-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
description: Land a PR (merge with proper workflow)
mode: subagent
tools:
write: false
edit: false
---

# Input

- PR: $1 <number|url>
- If missing: use the most recent PR mentioned in the conversation.
- If ambiguous: ask.

Do (end-to-end)

> Goal: PR must end in GitHub state = MERGED (never CLOSED). Prefer `gh pr merge --squash`; use `--rebase` only when preserving commit history is required.

1. Assign PR to self:
- `gh pr edit <PR> --add-assignee @me`
2. Repo clean: `git status`.
3. Identify PR meta (author + head branch):

```sh
gh pr view <PR> --json number,title,author,headRefName,baseRefName,headRepository --jq '{number,title,author:.author.login,head:.headRefName,base:.baseRefName,headRepo:.headRepository.nameWithOwner}'
contrib=$(gh pr view <PR> --json author --jq .author.login)
head=$(gh pr view <PR> --json headRefName --jq .headRefName)
head_repo_url=$(gh pr view <PR> --json headRepository --jq .headRepository.url)
```

4. Fast-forward base:
- `git checkout main`
- `git pull --ff-only`
5. Create temp base branch from main:
- `git checkout -b temp/landpr-<ts-or-pr>`
6. Check out PR branch locally:
- `gh pr checkout <PR>`
7. Rebase PR branch onto temp base:
- `git rebase temp/landpr-<ts-or-pr>`
- Fix conflicts; keep history tidy.
8. Fix + tests + changelog:
- Implement fixes + add/adjust tests
- Update `CHANGELOG.md` and mention `#<PR>` + `@$contrib`
9. Decide merge strategy:
- Squash (preferred): use when we want a single clean commit
- Rebase: use only when we explicitly want to preserve commit history
- If unclear, ask
10. Full gate (BEFORE commit):
- `pnpm lint && pnpm build && pnpm test`
11. Commit via committer (final merge commit only includes PR # + thanks):
- For the final merge-ready commit: `committer "fix: <summary> (#<PR>) (thanks @$contrib)" CHANGELOG.md <changed files>`
- If you need intermediate fix commits before the final merge commit, keep those messages concise and **omit** PR number/thanks.
- `land_sha=$(git rev-parse HEAD)`
12. Push updated PR branch (rebase => usually needs force):

```sh
git remote add prhead "$head_repo_url.git" 2>/dev/null || git remote set-url prhead "$head_repo_url.git"
git push --force-with-lease prhead HEAD:$head
```

13. Merge PR (must show MERGED on GitHub):
- Squash (preferred): `gh pr merge <PR> --squash`
- Rebase (history-preserving fallback): `gh pr merge <PR> --rebase`
- Never `gh pr close` (closing is wrong)
14. Sync main:
- `git checkout main`
- `git pull --ff-only`
15. Comment on PR with what we did + SHAs + thanks:

```sh
merge_sha=$(gh pr view <PR> --json mergeCommit --jq '.mergeCommit.oid')
gh pr comment <PR> --body "Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: $land_sha\n- Merge commit: $merge_sha\n\nThanks @$contrib!"
```

16. Verify PR state == MERGED:
- `gh pr view <PR> --json state --jq .state`
17. Delete temp branch:
- `git branch -D temp/landpr-<ts-or-pr>`
18 changes: 18 additions & 0 deletions .opencode/agents/review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
description: Reviews code for quality and best practices
mode: subagent
temperature: 0.1
tools:
write: false
edit: false
bash: false
---

You are in code review mode. Focus on:

- Code quality and best practices
- Potential bugs and edge cases
- Performance implications
- Security considerations

Provide constructive feedback without making direct changes.
17 changes: 17 additions & 0 deletions .opencode/agents/security-auditor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Performs security audits and identifies vulnerabilities
mode: subagent
tools:
write: true
edit: false
---

You are a security expert. Focus on identifying potential security issues.

Look for:

- Input validation vulnerabilities
- Authentication and authorization flaws
- Data exposure risks
- Dependency vulnerabilities
- Configuration security issues
5 changes: 5 additions & 0 deletions .opencode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"@opencode-ai/plugin": "1.2.27"
}
}
20 changes: 20 additions & 0 deletions .opencode/plugins/custom-compaction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Plugin } from "@opencode-ai/plugin";

export const CustomCompactionPlugin: Plugin = async (/* ctx */) => {
return {
"experimental.session.compacting": async (input, output) => {
// Replace the entire compaction prompt
output.prompt = `
You are generating a continuation prompt for a multi-agent swarm session.

Summarize:
1. The current task and its status
2. Which files are being modified and by whom
3. Any blockers or dependencies between agents
4. The next steps to complete the work

Format as a structured prompt that a new agent can use to resume work.
`;
},
};
};
20 changes: 20 additions & 0 deletions .opencode/skills/git-release/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: git-release
description: Create consistent releases and changelogs
license: MIT
compatibility: opencode
metadata:
audience: maintainers
workflow: github
---

## What I do

- Draft release notes from merged PRs
- Propose a version bump
- Provide a copy-pasteable `gh release create` command

## When to use me

Use this when you are preparing a tagged release.
Ask clarifying questions if the target versioning scheme is unclear.
11 changes: 11 additions & 0 deletions .opencode/tools/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { tool } from "@opencode-ai/plugin";

export default tool({
description: "Get project information",
args: {},
async execute(args, context) {
// Access context information
const { agent, sessionID, messageID, directory, worktree } = context;
return `Agent: ${agent}, Session: ${sessionID}, Message: ${messageID}, Directory: ${directory}, Worktree: ${worktree}`;
},
});
25 changes: 25 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Agent TUI - Development Guide

## Reference Documents

- [README](README.md) - Project overview, file structure, and dev commands
- [Architecture](docs/ARCHITECTURE.md) - Architecture overview, component breakdown, and dependency flow
- [Code Style](docs/CODE_STYLE.md) - TypeScript configuration, naming conventions, class structure, and formatting guidelines

---

## Framework

This is a Bun-based TypeScript TUI application using `@opentui/core` for rendering.

---

## Working with this Codebase

1. Run `bun dev` for development with hot reload
2. Run `bun lint:fix && bun format` before committing
3. Run `bun typecheck` to verify TypeScript correctness
4. Always use `import type` for type-only imports
5. Always use `override` keyword when overriding parent methods
6. Check array bounds when using indexed access
7. Log all errors with `console.error` before fallback handling
47 changes: 42 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,52 @@
# try-opentui

To install dependencies:
## Project Overview

This is a Bun-based TypeScript TUI (Terminal User Interface) application using `@opentui/core` for rendering.

## Development & CLI Commands Guide

### Installation & Running

```bash
bun install # Install dependencies
bun dev # Run in development mode with file watching
bun start # Run the application
```

### Linting & Formatting

```bash
bun install
bun lint # Run oxlint to check code quality
bun lint:fix # Run oxlint with auto-fix
bun format # Run oxfmt to format code
```

To run:
### Type Checking & Pre-commit

```bash
bun run index.ts
bun typecheck # Run TypeScript type checking (tsgo)
bun run actions:up # Run actions-up (updates?)
```

This project was created using `bun init` in bun v1.3.9. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
**Note:** There is no test framework configured in this project yet.

---

## File Organization

```bash
├── main.ts # Entry point
├── src/
│ ├── config.ts # Configuration management
│ ├── container.ts # Main UI container component
│ ├── renderer.ts # Renderer lifecycle management
│ ├── theme.ts # Theme loading and management
│ ├── utils.ts # Utility functions
│ └── figures.ts # Figure/shape utilities
├── docs/ # Documentation
├── themes/ # Theme JSON files
├── .oxlintrc.json # Linting rules
├── .oxfmtrc.json # Formatting rules
└── tsconfig.json # TypeScript configuration
```
Loading
Loading