Token导航 LogoToken导航TokenDH.com
前端设计可写文件github未标认证来源可访问许可证需确认审计通过

gova-declarative-guigova 声明式图形用户界面

Agent Skill

gova-declarative-gui 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,032

周安装

43

GitHub Stars

39

下载量

344
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gova-declarative-gui(gova 声明式图形用户界面)
来源仓库:https://github.com/aradotso/trending-skills
仓库路径:skills/gova-declarative-gui
安装命令:
npx skills add https://github.com/aradotso/trending-skills --skill gova-declarative-gui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/aradotso/trending-skills --skill gova-declarative-gui

简介

适用于需要可视化展示和管理 GitHub 项目状态的场景,如代码审查或协作流程跟踪。

  • 核心能力包括仓库信息解析、Issue 管理和 Pull Request 状态监控。
  • 通过声明式接口与宿主环境集成,支持交互式界面操作。
  • 安装需通过 npx 从指定 GitHub 仓库获取, 使用前请确认权限范围及是否涉及网络访问或文件读写。

SKILL.md

Gova Declarative GUI Framework

Skill by ara.so — Daily 2026 Skills collection.

Gova is a declarative GUI framework for Go that builds native desktop apps for macOS, Windows, and Linux from a single codebase. Views are plain Go structs, state is explicit via a Scope, and go build produces one static binary. Internally powered by Fyne (BSD-3), but the public API is stable and renderer-independent.


Install

go get github.com/nv404/gova@latest

Optional CLI:

go install github.com/nv404/gova/cmd/gova@latest

Prerequisites:

  • Go 1.26+
  • C toolchain: Xcode CLT (macOS), build-essential + libgl1-mesa-dev (Linux), MinGW (Windows)

Key CLI Commands

CommandPurpose
gova dev./path/to/appHot reload — watch .go files, rebuild and relaunch on save
gova build./path/to/appCompile to ./bin/<name> static binary
gova run./path/to/appBuild and launch once, no file watching
go build -ldflags "-s -w"Stripped binary (~23 MB for simple apps)

Core Concepts

1. Components as Structs

A component is a Go struct implementing Body(s *g.Scope) g.View. Fields on the struct are typed props; zero values are defaults.

package main

import g "github.com/nv404/gova"

type Greeting struct {
    Name string // prop with zero-value default ""
}

func (c Greeting) Body(s *g.Scope) g.View {
    name := c.Name
    if name == "" {
        name = "World"
    }
    return g.Text("Hello, " + name + "!").Font(g.Title)
}

2. Reactive State with Scope

State lives on the *g.Scope passed to Body. No hidden scheduler, no hook-ordering rules.

func (Counter) Body(s *g.Scope) g.View {
    count := g.State(s, 0) // typed signal, initial value 0

    return g.VStack(
        g.Text(count.Format("Count: %d")).Font(g.Title),
        g.HStack(
            g.Button("-", func() { count.Set(count.Get() - 1) }),
            g.Button("+", func() { count.Set(count.Get() + 1) }),
        ).Spacing(g.SpaceMD),
    ).Padding(g.SpaceLG)
}

3. Entry Point

func main() {
    g.Run("My App", g.Component(MyComponent{}))
}

Layout Primitives

// Vertical stack
g.VStack(child1, child2, child3).Spacing(g.SpaceMD).Padding(g.SpaceLG)

// Horizontal stack
g.HStack(child1, child2).Spacing(g.SpaceSM)

// Layered/overlapping stack
g.ZStack(background, foreground)

// Scaffold (app shell with nav, toolbar, etc.)
g.Scaffold(
    g.NavBar("Title"),
    content,
)

Spacing Constants

ConstantUse
g.SpaceSMSmall gaps
g.SpaceMDMedium gaps
g.SpaceLGLarge padding

Built-in Views

g.Text("Hello").Font(g.Title)        // styled text
g.Text("body text").Font(g.Body)

g.Button("Click me", func() { /* handler */ })

g.TextField(value.Get(), func(s string) { value.Set(s) })

g.Toggle(enabled.Get(), func(b bool) { enabled.Set(b) })

g.Image("path/to/image.png")

g.Spacer() // flexible space
g.Divider()

Font Constants

g.Title, g.Headline, g.Body, g.Caption, g.Mono


State Patterns

Basic State

count := g.State(s, 0)
count.Get()        // read
count.Set(42)      // write, triggers re-render
count.Format("Value: %d") // returns formatted string signal

Derived / Computed State

doubled := g.Derived(s, func() int {
    return count.Get() * 2
})

Effects (side effects on state change)

g.Effect(s, func() {
    fmt.Println("count changed to", count.Get())
}, count) // dependencies

Persisted State (survives hot reload)

name := g.PersistedState(s, "user-name", "")

Full Example: Todo App

package main

import g "github.com/nv404/gova"

type Todo struct {
    Text string
    Done bool
}

type TodoApp struct{}

func (TodoApp) Body(s *g.Scope) g.View {
    todos := g.State(s, []Todo{})
    input := g.State(s, "")

    addTodo := func() {
        if input.Get() == "" {
            return
        }
        todos.Set(append(todos.Get(), Todo{Text: input.Get()}))
        input.Set("")
    }

    rows := make([]g.View, 0, len(todos.Get()))
    for i, todo := range todos.Get() {
        i, todo := i, todo // capture loop vars
        rows = append(rows, g.HStack(
            g.Toggle(todo.Done, func(v bool) {
                list := todos.Get()
                list[i].Done = v
                todos.Set(list)
            }),
            g.Text(todo.Text),
        ).Spacing(g.SpaceSM))
    }

    return g.VStack(
        g.Text("Todos").Font(g.Title),
        g.VStack(rows...).Spacing(g.SpaceSM),
        g.HStack(
            g.TextField(input.Get(), func(v string) { input.Set(v) }),
            g.Button("Add", addTodo),
        ).Spacing(g.SpaceSM),
    ).Padding(g.SpaceLG)
}

func main() {
    g.Run("Todo", g.Component(TodoApp{}))
}

Native Dialogs (macOS: NSAlert / NSOpenPanel; other platforms: Fyne fallback)

// Alert dialog
g.Button("Alert", func() {
    g.Alert(g.AlertOptions{
        Title:   "Warning",
        Message: "Something happened.",
        Style:   g.AlertWarning,
    })
})

// Open file dialog
g.Button("Open File", func() {
    path, err := g.OpenFileDialog(g.OpenFileOptions{
        Title:      "Choose a file",
        Extensions: []string{".txt", ".md"},
    })
    if err == nil && path != "" {
        filePath.Set(path)
    }
})

// Save file dialog
g.Button("Save", func() {
    dest, err := g.SaveFileDialog(g.SaveFileOptions{
        Title:           "Save As",
        DefaultFilename: "output.txt",
    })
    if err == nil && dest != "" {
        // write to dest
    }
})

Platform Integration (macOS Dock)

// Dock badge (macOS)
g.DockBadge("3")
g.DockBadge("") // clear badge

// Dock progress (macOS)
g.DockProgress(0.75) // 0.0–1.0
g.DockProgress(-1)   // hide

// Dock menu (macOS)
g.SetDockMenu([]g.MenuItem{
    {Label: "New Window", Action: func() { /* ... */ }},
    {Label: "Preferences", Action: func() { /* ... */ }},
})

Theming and Colors

// Dark/light toggle
g.Button("Toggle Theme", func() {
    if g.CurrentTheme() == g.ThemeDark {
        g.SetTheme(g.ThemeLight)
    } else {
        g.SetTheme(g.ThemeDark)
    }
})

// Semantic colors in custom views
g.Text("Primary").Color(g.ColorPrimary)
g.Text("Secondary").Color(g.ColorSecondary)
g.Text("Danger").Color(g.ColorDanger)

Component Composition with Viewable

type Card struct {
    Title   string
    Content g.View
}

func (c Card) Body(s *g.Scope) g.View {
    return g.VStack(
        g.Text(c.Title).Font(g.Headline),
        g.Divider(),
        c.Content,
    ).Padding(g.SpaceMD)
}

// Usage
g.Component(Card{
    Title:   "My Card",
    Content: g.Text("Card body text"),
})

Navigation / Multi-View

type NotesApp struct{}

func (NotesApp) Body(s *g.Scope) g.View {
    selected := g.State(s, "list")

    switch selected.Get() {
    case "detail":
        return g.Component(DetailView{OnBack: func() { selected.Set("list") }})
    default:
        return g.Component(ListView{OnSelect: func() { selected.Set("detail") }})
    }
}

App Icon at Runtime

func main() {
    app := g.NewApp("My App")
    app.SetIcon("assets/icon.png") // set before Run
    app.Run(g.Component(MyComponent{}))
}

Hot Reload with PersistedState

When using gova dev, use g.PersistedState to keep UI state across rebuilds:

func (MyApp) Body(s *g.Scope) g.View {
    // survives hot reload, lost on full restart
    activeTab := g.PersistedState(s, "active-tab", "home")
    // ...
}

Project Structure (recommended)

myapp/
├── main.go          # g.Run entry point
├── components/
│   ├── header.go
│   └── sidebar.go
├── views/
│   ├── home.go
│   └── settings.go
├── assets/
│   └── icon.png
└── go.mod

Platform Support Matrix

FeaturemacOSWindowsLinux
Core UI
Hot reload
App icon
Native dialogsNSAlert/NSOpenPanelFyne fallbackFyne fallback
Dock/taskbarNSDockTile ✅PlannedPlanned

Troubleshooting

cgo: C compiler not found

  • macOS: xcode-select --install
  • Linux: sudo apt install build-essential libgl1-mesa-dev
  • Windows: Install MinGW-w64 and add to PATH

go build fails with OpenGL errors on Linux

sudo apt install libgl1-mesa-dev xorg-dev

Hot reload not picking up changes

  • Ensure you're using gova dev, not go run
  • Confirm .go files are in a directory watched by gova dev./path

Binary is large (~32 MB)

  • Strip symbols: go build -ldflags "-s -w" -o./bin/myapp
  • Result: ~23 MB. This is expected — Fyne (OpenGL renderer) is bundled.

State not updating the UI

  • Always call count.Set(...) — mutating a slice/map in place without Set won't trigger re-render
  • For slices: copy, modify, then set: list:= todos.Get(); list[i] = newVal; todos.Set(list)

API breakage (pre-1.0)

  • Pin a specific tag: go get github.com/nv404/gova@v0.x.y
  • Check the CHANGELOG before upgrading

Useful Links

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.59%
按下载量换算119

Claude

32.2%
按下载量换算111

Cursor

19.42%
按下载量换算67

Gemini CLI

8.5%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

可写文件

该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills