@ggdna/dna-gg

中文文档
1.6.1发布于 2026/11/15MITES Module近 30 天下载 3620

DNA layer: gg CLI workflow guides, repo setup scripts and CI check

原始使用文档
文档目录9 节
  1. Guides
  2. CLAUDE.md
  3. Skills
  4. Hooks
  5. Scripts
  6. Layers
  7. Variables
  8. Usage
  9. Development

dna_gg

The DNA layer for the gg CLI workflow: ticket, commit, push, review, publish.

Guides

  • dna/doc/guides/develop-guide.md, dna/doc/guides/develop-without-ai-guide.md — the ticket driven workflow, with and without an AI
  • dna/doc/guides/for-ai/ai-dev-guide.md — the same workflow as instructions for an agent. Its section "Keep every repo in its scope" makes the agent propose on its own to split a repo, add a new or an existing one, or move code, whenever code leaves the scope of its repo — and its section "Keep the index.jsonc up to date" makes it update the index.jsonc with every code change that alters what the repo does or uses, and create it in every repo of a ticket that has none yet. Its section "Describe every repo in its own terms" keeps the parent repos of a ticket out of what the agent writes into their dependencies: commit and merge messages, changelog, blog posts, code comments, index.jsonc
  • dna/doc/guides/install-guide/install-gg-guide.md, dna/doc/guides/install-guide/install-gg-workspace-guide.md — install gg and set up a workspace

CLAUDE.md

  • dna/CLAUDE.md — points the agent to the ai-dev-guide and the skills. helix writes it into the managed block of the consumer's CLAUDE.md (<!-- helix:claude_md:start/end -->), everything outside the block stays with the repo.

Skills

All skills of this layer are prefixed with gg-:

  • /gg — lists the skills below and says which one comes next
  • /gg-ticket — creates a ticket, adds the repos it needs and keeps every repo in its scope
  • /gg-commit — proposes a message and commits through gg do commit
  • /gg-push — pushes the ticket branches
  • /gg-review — checks the scope of every repo, writes the blog posts and opens the pull requests, printing their URLs
  • /gg-publish — releases the ticket
  • /gg-cleanup — removes what the ticket left behind

Hooks

  • dna/dot-claude/settings.json — runs .claude/hooks/pm-prompts.mjs on the Claude Code hooks SessionStart, UserPromptSubmit and SessionEnd
  • dna/dot-claude/hooks/pm-prompts.mjs — keeps every prompt written to Claude Code in the project management repo dnaPmRepo names. The prompts wait in ~/.claude/pm-prompts/sessions/ and are committed to the branch prompts of that repo when a session starts or ends, under doc/<yyyy>-Q<n>/prompts/<first name>/<yyyy-mm-dd>_<repo>_<session>.md, the quarter of the day the session started. The first name comes from team/people.md of the newest quarter folder there (doc/team/people.md in a repo without quarter folders), found by the git user name: a first name equal to it or to its first word, or a Git line listing it. An unknown name goes to prompts/_unknown/. No e-mail address is read or written; the commits carry the neutral author pm-prompts. Only the prompts are kept, never the answers; tokens and passwords are replaced by [redacted]. No working tree is touched: the commit is built in a bare cache below ~/.claude/pm-prompts/repos/. Needs node and git; a failure never stops a prompt and ends up in ~/.claude/pm-prompts/sync.log.
  • dna/dot-claude/hooks/pm-prompts.json — the name of the project management repo, dnaPmRepo. Empty, nothing is kept. In a folder that holds several repos, like a gg ticket, the prompts go to the project management repos those repos name.

A repo with a .claude/settings.json of its own moves its settings to dna/dot-claude/settings.overrides.json, otherwise the DNA overwrites them. Arrays are appended with a + after the key, e.g. "SessionStart+": [ … ] below "hooks".

Scripts

  • dna/scripts/delete-feature-branch.js — the one script this layer calls itself, from /gg-cleanup, with the two functions it imports: dna/scripts/functions/colors.js and dna/scripts/functions/run-command.js

These three files are byte-identical copies of their originals in dna_scripts. They are duplicated on purpose so that this layer does not drag the whole script set into every repo that only wants the gg workflow. A repo that wants the full set lists dna_scripts as a layer of its own — the copies are identical, so both layers together produce exactly the same files.

Layers

Builds on dna_install for the install overview and dna_index for the repo index every gg repo keeps.

It extends the @tooling section of the install overview through dna/doc/guides/install-guide.overrides.md: it adds Install gg and appends the Workspace section.

Variables

  • dnaCopyrightHolder — the name in the license header of every file
  • dnaCompany, dnaGitOrg, dnaGitOrgUrl — the organization repos are created in
  • dnaJiraPrefix — the prefix of a ticket id
  • dnaGitQuickCheckPipelineName — the name the branch rules require
  • dnaPubDevPublisher — the pub.dev publisher packages are transferred to
  • dnaPmRepo — the project management repo the prompts go to: its name with .git appended, e.g. my_pm.git, which finds it beside the repo's own origin, or a full git URL. helix re-cases a bare name like my_pm to the case of the reference, .git keeps it as written. Empty by default, then no prompt is kept

dnaCopyrightHolder, dnaCompany and dnaJiraPrefix name the organization, so they are never inherited: every layer or project listing this one sets them in its own dna/_vars.json. helix init and helix add ask for the missing ones.

Usage

Declare it as a dev-dependency and initialize once:

pnpm add -D @ggdna/dna-gg   # TypeScript projects
dart pub add dev:dna_gg     # Dart projects
helix init

The placed test instantiates and verifies the DNA on every test run.

Development

The dna/ folder is hand-authored source and is never generated. The repo instantiates its own DNA — run dart test after changes; commit first, a file the DNA would overwrite must not carry uncommitted work.

版本与发布记录

@ggdna/dna-gg 共发布 33 个版本,首次发布于 2026/08/20;过去 12 个月发布了 33 个版本。

版本发布日期距今
1.6.1latest2026/11/15今天
1.6.02026/11/079 天前
1.5.12026/11/069 天前
1.5.02026/11/069 天前
1.4.12026/11/0610 天前
1.4.02026/11/0313 天前

关于 @ggdna/dna-gg 的常见问题

@ggdna/dna-gg 是什么?

DNA layer: gg CLI workflow guides, repo setup scripts and CI check

如何安装 @ggdna/dna-gg?

在项目目录运行 npm install @ggdna/dna-gg,或使用 pnpm add / yarn add / bun add。

@ggdna/dna-gg 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ggdna__dna-gg 是否存在。

@ggdna/dna-gg 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ggdna/dna-gg 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ggdna/dna-gg 可以商用吗?

@ggdna/dna-gg 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ggdna/dna-gg 的下载量有多少?

根据 npm 官方下载统计,@ggdna/dna-gg 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,620 次,日均约 121 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ggdna/dna-gg 还在维护吗?

最新版本 1.6.1 发布于 2026/11/15(今天);至今共发布 33 个版本,其中过去 12 个月发布了 33 个;首次发布于 2026/08/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。