Agent Dev 101

Модуль 02 · Урок 2.13

Урок 2.13. GSD 2

На этой странице
  1. Зачем это нужно
  2. Основная идея
  3. Ключевые термины
  4. Как это устроено
  5. Требования и запуск
  6. Session commands
  7. Artifacts
  8. Как пользоваться
  9. Пример: migration на новую notification subsystem
  10. Когда GSD 2 полезен
  11. Когда не стоит брать
  12. Риски
  13. GSD 2 vs GSD Core
  14. Prompt patterns
  15. Практика
  16. Критерии готовности
  17. Краткое резюме
  18. Вопросы для самопроверки
  19. Источники для актуализации
  20. Что дальше

Зачем это нужно

GSD 2 полезен как пример того, как SDD tooling может сдвинуться от "набор prompts and commands" к более полноценной runtime-системе для agentic development.

Если GSD Core удобно объяснять через phase loop, то GSD 2 интересен другим:

text
Agent workflow начинает иметь собственное состояние,
memory architecture, database, runtime files и session commands.

Это важный шаг в развитии AI-agent tooling. Чем длиннее и сложнее задача, тем меньше хватает одного Markdown plan. Нужны state, memory, resume, autonomous mode and verification discipline.

Основная идея

GSD 2 можно воспринимать как AI coding agent/runtime, который управляет:

  • planning;
  • execution;
  • verification;
  • shipping;
  • state;
  • memory;
  • provider routing;
  • skills;
  • session lifecycle.

Его mental model:

text
Не просто "agent читает файлы".
Agent работает внутри runtime, где есть authoritative state и workflow commands.

Ключевые термины

Термин Значение
Runtime state Состояние workflow, которое хранится вне текущего chat context.
gsd.db Database-backed state для hierarchy and completion.
PROJECT.md Living description of what the project is now.
REQUIREMENTS.md Project-level capability contract and out-of-scope list.
DECISIONS.md Append-only register of architectural decisions.
KNOWLEDGE.md Cross-session rules, patterns, lessons learned.
RUNTIME.md Runtime context: APIs, env vars, services.
STATE.md Quick-glance dashboard rendered from runtime state.
Autonomous mode Режим, где agent research, plans, executes, commits and repeats with fewer prompts.

Как это устроено

flowchart TD A[User goal] --> B[GSD session command] B --> C[Runtime state] C --> D[Project memory] D --> E[Planning] E --> F[Execution] F --> G[Verification] G --> H[Commit / ship] H --> C

В такой модели artifacts and database становятся частью "операционной памяти" agent workflow. Это снижает зависимость от одного context window, но увеличивает complexity.

Требования и запуск

По docs GSD 2 требует:

  • Node.js 22+;
  • Git;
  • LLM provider or subscription flow;
  • project repository.

Он поддерживает множество providers через Pi SDK style layer: Anthropic, OpenAI, Gemini, OpenRouter, GitHub Copilot, Bedrock, Azure OpenAI, Vertex, Groq, Mistral and others.

Практический вывод:

text
Перед использованием GSD 2 проверьте requirements и installation docs.
Это не просто Markdown toolkit, а runtime с зависимостями.

Session commands

В docs GSD 2 выделяются commands вроде:

Command Назначение
/gsd или /gsd next Step mode: выполнить одну единицу и остановиться.
/gsd auto Autonomous mode: research, plan, execute, commit, repeat.
/gsd quick Быстрая задача с GSD guarantees без полного planning overhead.
/gsd stop Gracefully stop auto mode.
/gsd pause Pause and preserve state.
/gsd steer Hard-steer plan documents during execution.
/gsd discuss Обсудить architecture and decisions alongside workflow.

Для курса здесь важны два режима:

  • step mode для контролируемого обучения;
  • auto mode для long-running agent execution, когда specs and verification достаточно сильные.

Artifacts

GSD 2 manages context through artifacts:

text
gsd.db
PROJECT.md
REQUIREMENTS.md
DECISIONS.md
KNOWLEDGE.md
RUNTIME.md
STATE.md
M001-ROADMAP.md
M001-CONTEXT.md
research/*.md

Роль artifacts:

  • gsd.db хранит authoritative runtime state;
  • PROJECT.md описывает текущую систему;
  • REQUIREMENTS.md фиксирует capabilities and exclusions;
  • DECISIONS.md защищает architecture от silent drift;
  • KNOWLEDGE.md переносит lessons между sessions;
  • RUNTIME.md помогает agent понимать environment;
  • STATE.md дает dashboard;
  • roadmap/context files удерживают milestone structure.

Как пользоваться

На обзорном уровне:

  1. Проверить prerequisites.
  2. Установить GSD 2 по official README.
  3. Запустить в repository.
  4. Начать с step mode, а не сразу с auto mode.
  5. Дать agent сформировать project artifacts.
  6. Проверить requirements and decisions.
  7. Запускать /gsd next для controlled progress.
  8. Использовать /gsd auto только когда test baseline and verification reliable.

Пример cautious workflow:

text
/gsd

Потом review generated state.

text
/gsd discuss

Потом steering:

text
/gsd steer

И только после этого:

text
/gsd auto

Пример: migration на новую notification subsystem

Задача:

text
Перенести notifications с синхронных calls на event-driven subsystem.

Почему GSD 2 может быть уместен:

  • задача длинная;
  • нужны decisions;
  • нужны runtime details;
  • нужна память между sessions;
  • есть risk of partial migration;
  • нужно много verification.

Prompt:

text
Use GSD 2 in controlled step mode.

Goal:
Migrate notifications to an event-driven subsystem.

First update project understanding:
- current notification flow
- event infrastructure
- database tables
- runtime services
- test commands

Do not enter auto mode until PROJECT, REQUIREMENTS, DECISIONS, and STATE are reviewed.

Когда GSD 2 полезен

GSD 2 хорошо подходит, когда:

  • задача long-running;
  • требуется runtime state;
  • нужны resume and pause semantics;
  • project memory должна жить между sessions;
  • есть несколько model providers;
  • нужно autonomous execution, но с tracked state;
  • project has reliable tests and CI.

Когда не стоит брать

GSD 2 может быть лишним, если:

  • нужна одна маленькая feature;
  • команда не хочет runtime dependencies;
  • project state проще держать в Markdown;
  • нет стабильных verification commands;
  • разработчики не готовы review runtime-generated artifacts;
  • требуются very strict enterprise controls, которые tool не покрывает.

Риски

Риск Как проявляется Что делать
Runtime complexity Tool становится еще одной системой, которую надо понимать. Начинать с step mode and small feature.
State/code mismatch gsd.db или STATE.md не совпадает с repository reality. Регулярно revalidate and inspect artifacts.
Auto mode overreach Agent продолжает работу после неверного assumption. Использовать approval gates and stop conditions.
Provider variability Разные models дают разные outcomes. Закреплять model policy and verification.
Hidden drift Decisions меняются без update DECISIONS.md. Требовать decision log updates.

GSD 2 vs GSD Core

Вопрос GSD Core GSD 2
Основной фокус Phase loop and context engineering Runtime state, memory, autonomous agent execution
Complexity Ниже Выше
State Markdown/process artifacts Database plus Markdown artifacts
Best for Teams wanting adaptable core workflow Long-running autonomous workflows with state
Риск Недостаточно governance Слишком много runtime complexity

Prompt patterns

Controlled start

text
Use GSD 2 in step mode.
Do not use auto mode yet.
First build project understanding and show the generated artifacts for review.

Auto mode guard

text
Before entering auto mode, confirm:
- tests are passing
- requirements are explicit
- decisions are logged
- runtime assumptions are documented
- stop conditions are clear

Decision update

text
This changes architecture.
Update DECISIONS.md with:
- decision
- alternatives considered
- rationale
- consequences
- verification required

Практика

Выберите long-running task и определите, нужен ли runtime-style tool:

text
Task:
Estimated phases:
Requires persistent state: yes/no
Requires decision log: yes/no
Requires runtime context: yes/no
Can be done with simple specs: yes/no
Recommended tool:
Why:

Критерии готовности

После урока студент должен уметь:

  • объяснить GSD 2 как runtime-oriented SDD tool;
  • назвать основные state artifacts;
  • понять разницу между step mode and auto mode;
  • объяснить риск autonomous execution без verification;
  • выбрать между GSD Core and GSD 2.

Краткое резюме

GSD 2 показывает, что SDD tooling может стать полноценной runtime-системой. Это дает memory, state and autonomous execution, но требует большей дисциплины. Чем мощнее agent runtime, тем важнее approval gates, evidence and state validation.

Вопросы для самопроверки

  1. Зачем GSD 2 нужен gsd.db?
  2. Чем DECISIONS.md отличается от REQUIREMENTS.md?
  3. Когда auto mode опасен?
  4. Почему step mode лучше для первого внедрения?
  5. Когда GSD Core будет лучше GSD 2?

Источники для актуализации

Что дальше

Следующий урок разберет Agent-OS / Ouroboros - подход, где agent workflow описывается почти как operating system: seed specs, ledger, runtime adapters and evaluation gates.

Обновлено 03.10.2026