gsd-2-agent-framework by aradotso/trending-skills
npx skills add https://github.com/aradotso/trending-skills --skill gsd-2-agent-framework技能来自 ara.so — Daily 2026 技能集
GSD 2 是一个独立的 CLI 工具,能将结构化规范自主转化为可运行的软件。它直接控制智能体运行环境——管理每个任务的新上下文窗口、git 工作树隔离、崩溃恢复、成本跟踪和卡顿检测——而不是依赖 LLM 的自循环。一条命令,离开,回来时项目已构建完成,并拥有干净的 git 历史记录。
npm install -g gsd-pi
需要 Node.js 18+。通过 Pi SDK 使用 Claude (Anthropic) 作为底层模型。
里程碑 → 一个可交付的版本 (4–10 个切片)
切片 → 一个可演示的垂直功能 (1–7 个任务)
任务 → 一个上下文窗口大小的工作单元
铁律: 一个任务必须能放入一个上下文窗口。如果不能,就将其拆分为两个任务。
project/
├── .gsd/
│ ├── STATE.md # 当前自动模式位置
│ ├── DECISIONS.md # 架构决策记录
│ ├── LOCK # 崩溃恢复锁文件
│ ├── milestones/
│ │ └── M1/
│ │ ├── slices/
│ │ │ └── S1/
│ │ │ ├── PLAN.md # 包含必备项的任务分解
│ │ │ ├── RESEARCH.md # 代码库/文档侦察输出
│ │ │ ├── SUMMARY.md # 完成总结
│ │ │ └── tasks/
│ │ │ └── T1/
│ │ │ ├── PLAN.md
│ │ │ └── SUMMARY.md
│ └── costs/
│ └── ledger.json # 按单元计费的令牌/成本跟踪
├── ROADMAP.md # 里程碑/切片结构
└── PROJECT.md # 项目描述和目标
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
/gsd auto — 主要自主模式运行完整的自动化循环。读取 .gsd/STATE.md,在每个新会话中分派每个单元,处理恢复,并在无需干预的情况下推进整个里程碑。
/gsd auto
# 或带选项:
/gsd auto --budget 5.00 # 如果成本超过 $5 则暂停
/gsd auto --milestone M1 # 仅运行里程碑 1
/gsd auto --dry-run # 显示分派计划但不执行
/gsd init — 初始化项目根据 ROADMAP.md 和可选的 PROJECT.md 搭建 .gsd/ 目录。
/gsd init
创建初始的 STATE.md,从路线图中注册里程碑和切片,设置成本账本。
/gsd status — 仪表板显示当前位置、每个切片的成本、令牌使用情况以及下一个待处理项。
/gsd status
输出示例:
Milestone 1: Auth System [3/5 slices complete]
✓ S1: User model + migrations
✓ S2: Password auth endpoints
✓ S3: JWT session management
→ S4: OAuth integration [PLANNING]
S5: Role-based access control
Cost: $1.84 / $5.00 budget
Tokens: 142k input, 38k output
/gsd run — 单个单元分派手动执行一个特定单元,而不是运行完整循环。
/gsd run --slice M1/S4 # 为一个切片运行研究 + 计划 + 执行
/gsd run --task M1/S4/T2 # 运行单个任务
/gsd run --phase research M1/S4 # 仅运行研究阶段
/gsd run --phase plan M1/S4 # 仅运行计划阶段
/gsd migrate — 从 v1 迁移从原始的 Get Shit Done 导入旧的 .planning/ 目录。
/gsd migrate # 迁移当前目录
/gsd migrate ~/projects/old-project # 迁移特定路径
/gsd costs — 成本报告详细的成本分解和预测。
/gsd costs
/gsd costs --by-phase
/gsd costs --by-slice
/gsd costs --export costs.csv
ROADMAP.md# My Project Roadmap
## Milestone 1: Core API
### S1: Database schema and migrations
Set up Postgres schema for users, posts, and comments.
### S2: REST endpoints
CRUD endpoints for all resources with validation.
### S3: Authentication
JWT-based auth with refresh tokens.
## Milestone 2: Frontend
### S1: React app scaffold
...
PROJECT.md# My Project
A REST API for a blogging platform built with Express + TypeScript + Postgres.
## Tech Stack
- Node.js 20, TypeScript 5
- Express 4
- PostgreSQL 15 via pg + kysely
- Jest for tests
## Conventions
- All endpoints return `{ data, error }` envelope
- Database migrations in `db/migrations/`
- Feature modules in `src/features/<name>/`
/gsd init
/gsd auto
Research → Plan → Execute (per task) → Complete → Reassess → Next Slice
每个阶段都在一个新会话中运行,上下文会预先内联到分派提示中:
| 阶段 | LLM 接收的内容 | LLM 产生的内容 |
|---|---|---|
| Research | PROJECT.md, ROADMAP.md, 切片描述, 代码库索引 | RESEARCH.md 包含发现、注意事项、相关文件 |
| Plan | 研究输出, 切片描述, 必备项 | PLAN.md 包含任务分解、验证步骤 |
| Execute (task N) | 任务计划, 先前任务总结, 依赖项总结, DECISIONS.md | 提交到 git 的工作代码 |
| Complete | 所有任务总结, 切片计划 | SUMMARY.md, UAT 脚本, 更新的 ROADMAP.md |
| Reassess | 已完成的切片总结, 完整的 ROADMAP.md | 更新后的路线图,包含任何修正 |
每个任务计划都包含必备项——明确的、可检查的标准,LLM 使用这些标准来确认完成。将它们写成 shell 命令或文件存在性检查:
## Must-Haves
- [ ] `npm test -- --testPathPattern=auth` passes with 0 failures
- [ ] File `src/features/auth/jwt.ts` exists and exports `signToken`, `verifyToken`
- [ ] `curl -X POST http://localhost:3000/auth/login` returns 200 with `{ data: { token } }`
- [ ] No TypeScript errors: `npx tsc --noEmit` exits 0
执行阶段只有在 LLM 能够勾选所有必备项后才结束。
GSD 在自动模式下自动管理 git:
main
└── milestone/M1 ← 开始时创建的工作树分支
├── commit: [M1/S1/T1] implement user model
├── commit: [M1/S1/T2] add migrations
├── commit: [M1/S1] slice complete
├── commit: [M1/S2/T1] POST /users endpoint
└── ...
After milestone complete:
main ← squash merge of milestone/M1 as "[M1] Auth system"
每个任务提交时都带有结构化的提交信息。每个切片提交一个总结性提交。里程碑通过 squash merge 合并到 main 分支,作为一个干净的条目。
GSD 在单元启动时写入锁文件 .gsd/LOCK,并在干净完成后移除它。如果进程异常终止:
# 下次运行会检测到锁并自动恢复:
/gsd auto
# 输出:
# ⚠ Lock file found: M1/S3/T2 was interrupted
# Synthesizing recovery briefing from session artifacts...
# Resuming with full context
恢复简报是根据到达磁盘的每个工具调用——文件写入、shell 输出、部分完成情况——综合生成的,因此恢复的会话具有上下文连续性。
设置预算上限,以便在超支前暂停自动模式:
/gsd auto --budget 10.00
成本账本位于 .gsd/costs/ledger.json:
{
"units": [
{
"id": "M1/S1/research",
"model": "claude-opus-4",
"inputTokens": 12400,
"outputTokens": 3200,
"costUsd": 0.21,
"completedAt": "2025-01-15T10:23:44Z"
}
],
"totalCostUsd": 1.84,
"budgetUsd": 10.00
}
.gsd/DECISIONS.md 会自动注入到每个任务分派中。在此记录架构决策,LLM 将在所有未来的会话中遵守它们:
# Decisions Register
## D1: Use kysely not prisma
**Date:** 2025-01-14
**Reason:** Better TypeScript inference, no code generation step needed.
**Impact:** All DB queries use kysely QueryBuilder syntax.
## D2: JWT in httpOnly cookie, not Authorization header
**Date:** 2025-01-14
**Reason:** Better XSS protection for the web client.
**Impact:** Auth middleware reads `req.cookies.token`.
如果同一个单元分派了两次而没有产生预期的产物,GSD 会:
✗ Stuck on M1/S3/T1 after 2 attempts
Expected: src/features/auth/jwt.ts (not found)
Last session: .gsd/sessions/M1-S3-T1-attempt2.log
Run `/gsd run --task M1/S3/T1` to retry manually
GSD 支持在研究阶段自动检测和安装相关技能。在项目中创建 SKILLS.md:
# Project Skills
- name: postgres-kysely
- name: express-typescript
- name: jest-testing
技能会被注入到研究和计划分派提示中,为 LLM 提供关于您确切技术栈的精选知识,而无需在不相关的文档上浪费上下文。
三层超时机制防止会话失控:
| 超时 | 默认值 | 行为 |
|---|---|---|
| Soft | 8 分钟 | 发送“请收尾”的引导消息 |
| Idle | 3 分钟无工具调用 | 发送“是否卡住了?”的恢复提示 |
| Hard | 15 分钟 | 暂停自动模式,保留所有磁盘状态 |
在 .gsd/config.json 中配置:
{
"timeouts": {
"softMinutes": 8,
"idleMinutes": 3,
"hardMinutes": 15
},
"defaultModel": "claude-opus-4",
"researchModel": "claude-sonnet-4"
}
GSD 基于 Pi SDK 构建。您可以以编程方式扩展它:
import { GSDProject, AutoRunner } from 'gsd-pi';
const project = await GSDProject.load('/path/to/project');
// Check current state
const state = await project.getState();
console.log(state.currentMilestone, state.currentSlice);
// Run a single slice programmatically
const runner = new AutoRunner(project, {
budget: 5.00,
onUnitComplete: (unit, cost) => {
console.log(`Completed ${unit.id}, cost: $${cost.toFixed(3)}`);
},
onStuck: (unit, attempts) => {
console.error(`Stuck on ${unit.id} after ${attempts} attempts`);
process.exit(1);
}
});
await runner.runSlice('M1/S4');
将自定义上下文注入到任何分派提示中:
// .gsd/hooks.ts
import type { DispatchHook } from 'gsd-pi';
export const beforeTaskDispatch: DispatchHook = async (ctx) => {
// Append custom context to every task dispatch
return {
...ctx,
extraContext: `
## Live API Docs
${await fetchInternalAPIDocs()}
`
};
};
在 .gsd/config.json 中注册:
{
"hooks": "./hooks.ts"
}
每个切片完成后,GSD 会运行一次重新评估,可能:
LLM 会就地编辑 ROADMAP.md。您可以使用以下命令查看差异:
git diff ROADMAP.md
要禁用重新评估:
{
"reassessment": false
}
ROADMAP.md 中的所有切片都被标记为 [x]。重置一个切片:从其条目中移除 [x] 并删除 .gsd/milestones/M1/slices/S3/SUMMARY.md。
检查 .gsd/sessions/ 中的最后一个会话日志。常见原因:必备项引用了错误的文件路径,或者测试命令需要环境变量。调整任务 PLAN.md 中的必备项,并使用 /gsd run --task M1/S3/T2 重新运行。
大型代码库上的研究阶段可能成本高昂。在配置中将 researchModel 设置为更便宜的模型,或者减少代码库索引深度。
rm .gsd/LOCK
/gsd auto
git worktree list # 查看活动的工作树
git worktree remove .gsd/worktrees/M1 --force
/gsd auto # 重新干净地创建
如果 .gsd/sessions/ 变得过大,GSD 会自动压缩超过 24 小时的会话。手动清理:
/gsd cleanup --sessions --older-than 7d
每周安装次数
361
代码仓库
GitHub Stars
10
首次出现
9 天前
安全审计
已安装于
gemini-cli357
github-copilot357
codex357
amp357
cline357
kimi-cli357
Skill by ara.so — Daily 2026 Skills collection
GSD 2 is a standalone CLI that turns a structured spec into running software autonomously. It controls the agent harness directly — managing fresh context windows per task, git worktree isolation, crash recovery, cost tracking, and stuck detection — rather than relying on LLM self-loops. One command, walk away, come back to a built project with clean git history.
npm install -g gsd-pi
Requires Node.js 18+. Works with Claude (Anthropic) as the underlying model via the Pi SDK.
Milestone → a shippable version (4–10 slices)
Slice → one demoable vertical capability (1–7 tasks)
Task → one context-window-sized unit of work
Iron rule: A task must fit in one context window. If it can't, split it into two tasks.
project/
├── .gsd/
│ ├── STATE.md # current auto-mode position
│ ├── DECISIONS.md # architecture decisions register
│ ├── LOCK # crash recovery lock file
│ ├── milestones/
│ │ └── M1/
│ │ ├── slices/
│ │ │ └── S1/
│ │ │ ├── PLAN.md # task breakdown with must-haves
│ │ │ ├── RESEARCH.md # codebase/doc scouting output
│ │ │ ├── SUMMARY.md # completion summary
│ │ │ └── tasks/
│ │ │ └── T1/
│ │ │ ├── PLAN.md
│ │ │ └── SUMMARY.md
│ └── costs/
│ └── ledger.json # per-unit token/cost tracking
├── ROADMAP.md # milestone/slice structure
└── PROJECT.md # project description and goals
/gsd auto — Primary Autonomous ModeRun the full automation loop. Reads .gsd/STATE.md, dispatches each unit in a fresh session, handles recovery, and advances through the entire milestone without intervention.
/gsd auto
# or with options:
/gsd auto --budget 5.00 # pause if cost exceeds $5
/gsd auto --milestone M1 # run only milestone 1
/gsd auto --dry-run # show dispatch plan without executing
/gsd init — Initialize a ProjectScaffold the .gsd/ directory from a ROADMAP.md and optional PROJECT.md.
/gsd init
Creates initial STATE.md, registers milestones and slices from your roadmap, sets up the cost ledger.
/gsd status — DashboardShows current position, per-slice costs, token usage, and what's queued next.
/gsd status
Output example:
Milestone 1: Auth System [3/5 slices complete]
✓ S1: User model + migrations
✓ S2: Password auth endpoints
✓ S3: JWT session management
→ S4: OAuth integration [PLANNING]
S5: Role-based access control
Cost: $1.84 / $5.00 budget
Tokens: 142k input, 38k output
/gsd run — Single Unit DispatchExecute one specific unit manually instead of running the full loop.
/gsd run --slice M1/S4 # run research + plan + execute for a slice
/gsd run --task M1/S4/T2 # run a single task
/gsd run --phase research M1/S4 # run just the research phase
/gsd run --phase plan M1/S4 # run just the planning phase
/gsd migrate — Migrate from v1Import old .planning/ directories from the original Get Shit Done.
/gsd migrate # migrate current directory
/gsd migrate ~/projects/old-project # migrate specific path
/gsd costs — Cost ReportDetailed cost breakdown with projections.
/gsd costs
/gsd costs --by-phase
/gsd costs --by-slice
/gsd costs --export costs.csv
ROADMAP.md# My Project Roadmap
## Milestone 1: Core API
### S1: Database schema and migrations
Set up Postgres schema for users, posts, and comments.
### S2: REST endpoints
CRUD endpoints for all resources with validation.
### S3: Authentication
JWT-based auth with refresh tokens.
## Milestone 2: Frontend
### S1: React app scaffold
...
PROJECT.md# My Project
A REST API for a blogging platform built with Express + TypeScript + Postgres.
## Tech Stack
- Node.js 20, TypeScript 5
- Express 4
- PostgreSQL 15 via pg + kysely
- Jest for tests
## Conventions
- All endpoints return `{ data, error }` envelope
- Database migrations in `db/migrations/`
- Feature modules in `src/features/<name>/`
/gsd init
/gsd auto
Research → Plan → Execute (per task) → Complete → Reassess → Next Slice
Each phase runs in a fresh session with context pre-inlined into the dispatch prompt:
| Phase | What the LLM receives | What it produces |
|---|---|---|
| Research | PROJECT.md, ROADMAP.md, slice description, codebase index | RESEARCH.md with findings, gotchas, relevant files |
| Plan | Research output, slice description, must-haves | PLAN.md with task breakdown, verification steps |
| Execute (task N) | Task plan, prior task summaries, dependency summaries, DECISIONS.md | Working code committed to git |
| Complete | All task summaries, slice plan | SUMMARY.md, UAT script, updated ROADMAP.md |
| Reassess | Completed slice summary, full ROADMAP.md | Updated roadmap with any corrections |
Every task plan includes must-haves — explicit, checkable criteria the LLM uses to confirm completion. Write them as shell commands or file existence checks:
## Must-Haves
- [ ] `npm test -- --testPathPattern=auth` passes with 0 failures
- [ ] File `src/features/auth/jwt.ts` exists and exports `signToken`, `verifyToken`
- [ ] `curl -X POST http://localhost:3000/auth/login` returns 200 with `{ data: { token } }`
- [ ] No TypeScript errors: `npx tsc --noEmit` exits 0
The execute phase ends only when the LLM can check off every must-have.
GSD manages git automatically in auto mode:
main
└── milestone/M1 ← worktree branch created at start
├── commit: [M1/S1/T1] implement user model
├── commit: [M1/S1/T2] add migrations
├── commit: [M1/S1] slice complete
├── commit: [M1/S2/T1] POST /users endpoint
└── ...
After milestone complete:
main ← squash merge of milestone/M1 as "[M1] Auth system"
Each task commits with a structured message. Each slice commits a summary commit. The milestone squash-merges to main as one clean entry.
GSD writes a lock file at .gsd/LOCK when a unit starts and removes it on clean completion. If the process dies:
# Next run detects the lock and auto-recovers:
/gsd auto
# Output:
# ⚠ Lock file found: M1/S3/T2 was interrupted
# Synthesizing recovery briefing from session artifacts...
# Resuming with full context
The recovery briefing is synthesized from every tool call that reached disk — file writes, shell output, partial completions — so the resumed session has context continuity.
Set a budget ceiling to pause auto mode before overspending:
/gsd auto --budget 10.00
The cost ledger at .gsd/costs/ledger.json:
{
"units": [
{
"id": "M1/S1/research",
"model": "claude-opus-4",
"inputTokens": 12400,
"outputTokens": 3200,
"costUsd": 0.21,
"completedAt": "2025-01-15T10:23:44Z"
}
],
"totalCostUsd": 1.84,
"budgetUsd": 10.00
}
.gsd/DECISIONS.md is auto-injected into every task dispatch. Record architectural decisions here and the LLM will respect them across all future sessions:
# Decisions Register
## D1: Use kysely not prisma
**Date:** 2025-01-14
**Reason:** Better TypeScript inference, no code generation step needed.
**Impact:** All DB queries use kysely QueryBuilder syntax.
## D2: JWT in httpOnly cookie, not Authorization header
**Date:** 2025-01-14
**Reason:** Better XSS protection for the web client.
**Impact:** Auth middleware reads `req.cookies.token`.
If the same unit dispatches twice without producing its expected artifact, GSD:
✗ Stuck on M1/S3/T1 after 2 attempts
Expected: src/features/auth/jwt.ts (not found)
Last session: .gsd/sessions/M1-S3-T1-attempt2.log
Run `/gsd run --task M1/S3/T1` to retry manually
GSD supports auto-detecting and installing relevant skills during the research phase. Create SKILLS.md in your project:
# Project Skills
- name: postgres-kysely
- name: express-typescript
- name: jest-testing
Skills are injected into the research and plan dispatch prompts, giving the LLM curated knowledge about your exact stack without burning context on irrelevant docs.
Three timeout tiers prevent runaway sessions:
| Timeout | Default | Behavior |
|---|---|---|
| Soft | 8 min | Sends "please wrap up" steering message |
| Idle | 3 min no tool calls | Sends "are you stuck?" recovery prompt |
| Hard | 15 min | Pauses auto mode, preserves all disk state |
Configure in .gsd/config.json:
{
"timeouts": {
"softMinutes": 8,
"idleMinutes": 3,
"hardMinutes": 15
},
"defaultModel": "claude-opus-4",
"researchModel": "claude-sonnet-4"
}
GSD is built on the Pi SDK. You can extend it programmatically:
import { GSDProject, AutoRunner } from 'gsd-pi';
const project = await GSDProject.load('/path/to/project');
// Check current state
const state = await project.getState();
console.log(state.currentMilestone, state.currentSlice);
// Run a single slice programmatically
const runner = new AutoRunner(project, {
budget: 5.00,
onUnitComplete: (unit, cost) => {
console.log(`Completed ${unit.id}, cost: $${cost.toFixed(3)}`);
},
onStuck: (unit, attempts) => {
console.error(`Stuck on ${unit.id} after ${attempts} attempts`);
process.exit(1);
}
});
await runner.runSlice('M1/S4');
Inject custom context into any dispatch prompt:
// .gsd/hooks.ts
import type { DispatchHook } from 'gsd-pi';
export const beforeTaskDispatch: DispatchHook = async (ctx) => {
// Append custom context to every task dispatch
return {
...ctx,
extraContext: `
## Live API Docs
${await fetchInternalAPIDocs()}
`
};
};
Register in .gsd/config.json:
{
"hooks": "./hooks.ts"
}
After each slice completes, GSD runs a reassessment pass that may:
The LLM edits ROADMAP.md in place. You can review diffs with:
git diff ROADMAP.md
To disable reassessment:
{
"reassessment": false
}
All slices in ROADMAP.md are marked [x]. Reset a slice: remove [x] from its entry and delete .gsd/milestones/M1/slices/S3/SUMMARY.md.
Check .gsd/sessions/ for the last session log. Common causes: must-have references wrong file path, or test command needs environment variable. Adjust must-haves in the task's PLAN.md and re-run with /gsd run --task M1/S3/T2.
The research phase on large codebases can be expensive. Set researchModel to a cheaper model in config, or reduce codebase index depth.
rm .gsd/LOCK
/gsd auto
git worktree list # see active worktrees
git worktree remove .gsd/worktrees/M1 --force
/gsd auto # recreates cleanly
If .gsd/sessions/ grows large, GSD compresses sessions older than 24h automatically. Manual cleanup:
/gsd cleanup --sessions --older-than 7d
Weekly Installs
361
Repository
GitHub Stars
10
First Seen
9 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli357
github-copilot357
codex357
amp357
cline357
kimi-cli357
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
41,400 周安装