Logo Glab Govern

Glab Govern

Cộng đồng
vince-winkintel
glab-govern

Cấu hình và chẩn đoán các hook quản trị tác nhân AI của GitLab, tính năng đồng bộ định kỳ dự phòng và việc tải lên nhật ký kiểm tra phiên của Claude Code, OpenCode, Codex hoặc Cursor đã được phê duyệt rõ ràng. Dùng cho glab govern setup, govern doctor và govern audit sync, bao gồm chọn tác nhân và gỡ cài đặt. Kích hoạt khi có các cụm từ: AI agent governance, agent audit, session audit, Claude hooks, OpenCode audit, Codex audit, Cursor audit, fallback sync, govern setup, govern doctor, govern audit sync, govern uninstall.

Tổng quan

Nhà phát hànhvince-winkintel
Kho mãgitlab-cli-skills
Tên kỹ năngglab-govern
Sao
50
Bản fork
6
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được vince-winkintel công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Glab Govern trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/vince-winkintel/gitlab-cli-skills/tree/main/glab-govern
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vince-winkintel/gitlab-cli-skills.git /tmp/gitlab-cli-skills
mkdir -p .claude/skills
cp -r /tmp/gitlab-cli-skills/glab-govern .claude/skills/glab-govern
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Glab Govern trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Glab Govern ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Glab Govern với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

glab govern

Configure and operate GitLab's experimental AI agent governance support for external agents.

OpenCode integration and diagnosis

After explicit approval, glab govern setup --agents opencode installs ~/.config/opencode/plugins/glab-govern.js (or $XDG_CONFIG_HOME/opencode/plugins/glab-govern.js) for OpenCode 1.4 or later on macOS/Linux. OpenCode loads it for all sessions in every project and syncs each session when it goes idle. Sessions use their own GitLab host/project mappings. OpenCode 2 uses opencode session export; earlier supported releases use opencode export.

Later setup runs keep a previously selected glab-owned plugin current even if opencode is omitted. Only setup --uninstall removes it. A foreign file at the destination is not overwritten or removed; resolve it deliberately before an approved installation. --no-fallback-sync still installs/runs the plugin and does not remove an existing periodic job. Plugin installation and transcript uploads require approval independently of reading help or doctor output. Installation can partly succeed; inspect hooks, plugin, and job after any failure.

Doctor reports agent-neutral hook/session status, OpenCode detection and plugin state, and background sync outcomes. Project lookup 404s are reported separately as projects not found, not generic sync errors; sessions are retained for a later run. Deleted/inaccessible projects and missing job credentials can all cause this. Failed hosts without credentials are called out; an unreadable/locked keyring remains an error. When AI Governance is off, ask a group Owner or administrator to enable it; it is unavailable for personal projects on GitLab.com. Do not change project settings or upload a transcript merely to clear a diagnostic.

Session and tool metadata

New governance sessions include glab_version and the transcript's agent_version when available. Claude Code records supply their version, Codex uses session_meta.cli_version, and OpenCode uses the export's info.version; Cursor supplies no version. Empty values and values longer than 255 characters after trimming are omitted. These are informational metadata, not proof of task success; this creation path does not send a separate version-metadata update for an existing session.

Codex tool-call events and their matched results include tool_namespace when present, and qualify the tool name as <namespace>__<name>. A trailing __ separator is removed from the recorded namespace; an all-underscore namespace becomes empty. Built-in tools without a namespace retain their bare names. Treat this metadata as part of the approved transcript-upload scope, alongside prompts and tool arguments.

Redaction and incomplete transcripts

Before upload, glab applies pattern-based redaction to session goals, user prompts, tool-result errors, and tool-call arguments. Valid JSON arguments are walked for recognized secrets in string values and keys; redacted arguments are re-encoded. Goal redaction happens before goal truncation. Recognized common secret formats are replaced with typed markers such as [REDACTED:credential]; unknown formats and sensitive content outside those patterns can remain. This is not a blanket secret-safety guarantee and does not scrub local transcript files. Review the upload scope and obtain approval even when redaction is enabled; never upload a transcript just to test the filter.

Claude Code JSONL parsing defers a final line without a newline, even if its JSON is already complete, so a later sync can read the finished entry. Earlier complete entries can still sync. Malformed newline-terminated JSON is still skipped; this is not recovery for arbitrary corrupt transcripts. A successful sync does not prove an unfinished final entry was uploaded. Do not modify an active transcript to force it through sync.

Safety and scope

  • Governance sync is an external data upload, not just local diagnostic logging. Uploaded data can include user prompts, tool-call arguments (commands, file paths, edits; replaced with a marker over 8 KB), outcomes/errors/durations, model, token usage, version metadata, and Codex tool namespaces. Tool output and response text are not uploaded. Pattern-based redaction reduces some exposure but does not guarantee these fields are free of secrets.
  • On a fresh setup without an agent selection, glab govern setup selects Claude Code, installs its Stop and SessionEnd hooks in ~/.claude/settings.json, and installs a durable fallback periodic sync job on macOS/Linux. Later runs reuse the previously selected agents. Obtain approval for both the settings change and transcript upload scope before running setup.
  • Use --no-fallback-sync to install selected hooks/plugins without installing or replacing the fallback job. By itself it does not remove an existing job or clear stored agents; verify those separately before treating the machine as hooks-only. The hooks still upload audit events. This is not a no-upload mode.
  • --agents codex,cursor enables transcript discovery without agent hooks, including sessions from before enablement, for repositories on GitLab hosts you are logged in to. Enabling these agents needs explicit approval for historical uploads and all eligible repositories, not just the current checkout.
  • This integration does not automatically govern Hermes. --agents opencode installs a global OpenCode plugin with upload scope across every OpenCode project; obtain explicit approval for that scope.
  • Prefer glab govern doctor for read-only diagnosis. Help inspection does not authorize running setup, sync, uninstall, or changing host services.

Setup and verification

bash
# Inspect the experimental surface without changing settings or uploading transcripts
glab govern --help
glab govern setup --help
glab govern audit sync --help
glab govern doctor

After reviewing the target host, visible GitLab actor, eligible repositories, and upload contents, choose exactly the approved setup scope:

bash
# Previously selected agents (Claude Code on a fresh setup) plus fallback sync
glab govern setup

# Select Claude Code hooks without installing/replacing the job (existing agents/jobs remain)
glab govern setup --agents claude-code --no-fallback-sync

# Explicitly include Codex and Cursor historical/local sessions
glab govern setup --agents codex,cursor

--agents accepts claude-code, opencode, codex, and cursor, comma-separated or repeated. Explicit selection adds to the existing hook/plugin and discovery lists; it never narrows the selection. On a fresh machine --agents opencode selects OpenCode without implicitly adding Claude Code. Omitting --agents reuses the recorded selection, defaulting to Claude Code only when no agents were set up. Setup also recognizes earlier installed hooks/plugins when no recorded selection exists.

--agents opencode --no-fallback-sync installs the selected plugin without installing/replacing the job. Explicit Codex/Cursor selection cannot be combined with --no-fallback-sync; they rely on the fallback job. A retained discovery-only selection without hooks/plugins is also rejected with that flag. If hooks/plugins and stored discovery already coexist, --no-fallback-sync can leave discovery and an existing job intact. It is never a way to narrow upload scope.

Use --yes only after approving the complete retained and added upload scope. Existing hooks are not duplicated and ordinary setup replaces the fallback job. An empty --agents "" is invalid. To remove an agent, explicitly approve setup --uninstall, verify removal, then separately approve setup with exactly the desired agents. Uninstall forgets the selection, so the next setup without --agents defaults to Claude Code again. --agents and --uninstall are mutually exclusive. Inspect settings/plugin/job files and rerun glab govern doctor after changes. A failed fallback installation can leave the previous job removed while other installation steps remain; do not assume the “Setup complete” line means every component succeeded.

Fallback periodic sync

On macOS, setup installs ~/Library/LaunchAgents/com.gitlab.glab-govern-audit-sync.plist. On Linux it installs the user timer ~/.config/systemd/user/glab-govern-audit-sync.timer. The fallback job runs glab govern audit sync --all every 30 minutes (also 5 minutes after boot on Linux) until removed. It uses stored credentials and the glab configuration directory selected at setup. Windows has no fallback periodic sync.

--all sends each recorded/discovered session to its own project and host, not simply the current checkout or one --repo target. It marks sessions complete after 24 hours of inactivity. Claude Code sessions are paused while the glab Stop hook is missing; OpenCode sessions are paused while the glab plugin is missing. doctor reports fallback configuration, the last-run result, and whether the job's configured glab binary reports a different version from the running CLI. A drift warning recommends rerunning setup; that is a settings/job change requiring the same upload-scope approval, not an automatic repair.

A never-synced session inactive for 89 days is not uploaded. If an instance does not yet accept an agent's sessions, those sessions are skipped permanently; upgrading the instance does not backfill them, while sessions created after the upgrade are eligible.

Manual audit sync

For current-session sync, first verify the intended actor, host, and project:

bash
: "${GITLAB_HOST:?set GITLAB_HOST to the intended GitLab hostname}"
glab auth status --hostname "$GITLAB_HOST"
glab api --hostname "$GITLAB_HOST" user
# Upload only after the target and transcript scope have been approved
glab govern audit sync --repo "https://$GITLAB_HOST/my-group/my-project"

The normal target comes from -R/--repo when supplied (namespace path, full URL, or Git URL), otherwise the current checkout's Git remote. Do not run from an arbitrary checkout. Use --complete only when the session should be completed. --silent hides output for hooks; avoid it during initial verification. Do not use --all as a harmless connectivity test.

Agent limitations:

  • OpenCode does not send prompts/responses; an outcome is included only if the tool call was complete when first synced.
  • Codex tool outcomes are reported as completed, not proven successful.
  • Cursor sends only prompts and tool calls, timed by transcript modification; it has no outcome/token/timestamp records. Ambiguous workspace mappings or file calls outside the inferred workspace cause that session to be skipped rather than uploaded to the wrong project.

Uninstall and pause

bash
# After approving removal of the local job and agent discovery
glab govern setup --uninstall

Uninstall removes the installed Claude Code hooks, glab-owned OpenCode plugin, and fallback periodic job, and stops Codex/Cursor syncing; unrelated hooks and settings are preserved. If settings cannot be read, removal of other components can still occur while hook removal fails. Review warnings, repair the settings, and rerun the approved uninstall before considering capture stopped. Verify the resulting settings, absence of the exact job, and doctor output. --no-fallback-sync is a hooks/plugin setup option, not a replacement for uninstalling an already-installed fallback job.

Troubleshooting

  • Missing hooks: inspect the settings file and the glab executable's non-interactive PATH; rerun setup only within approved scope.
  • Failed auth/connectivity: verify the intended actor using glab auth status and glab api user; never print tokens or upload a transcript just to test access.
  • Unexpected uploads: inspect the fallback job, stored host credentials, agent list, and per-session repository mappings. Stop the approved job/hooks before changing credentials or project state.
  • Wrong project or potentially sensitive prompts/arguments: stop before sync; do not treat outcome labels, omitted responses, or argument truncation as content redaction.

Command reference

See references/commands.md for complete checksum-verified parent, setup, doctor, audit, and audit-sync help.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Glab Govern làm được gì?

Cấu hình và chẩn đoán các hook quản trị tác nhân AI của GitLab, tính năng đồng bộ định kỳ dự phòng và việc tải lên nhật ký kiểm tra phiên của Claude Code, OpenCode, Codex hoặc Cursor đã được phê duyệt rõ ràng. Dùng cho glab govern setup, govern doctor và govern audit sync, bao gồm chọn tác nhân và gỡ cài đặt. Kích hoạt khi có các cụm từ: AI agent governance, agent audit, session audit, Claude hooks, OpenCode audit, Codex audit, Cursor audit, fallback sync, govern setup, govern doctor, govern audit sync, govern uninstall.

Vì sao nên dùng Glab Govern trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Glab Govern là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Glab Govern trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/vince-winkintel/gitlab-cli-skills/tree/main/glab-govern. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Glab Govern?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Glab Govern với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Glab Govern với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Glab Govern có miễn phí không?

Có. Kỹ năng này được vince-winkintel phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇