feat: implement ai-assisted authoring flow and metadata generation#23
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
83f280e to
84f8a75
Compare
There was a problem hiding this comment.
Pull request overview
Implements an AI-assisted authoring workflow in the DubStack CLI, including repo-configurable AI defaults, AI-generated PR description summaries, and a new end-to-end dub flow command, plus supporting UX, evals, and documentation updates.
Changes:
- Add tri-state AI enablement (
--ai/--no-ai/ repo default) fordub create,dub submit, and newdub flow, withdub config ai-defaults <create|submit|flow>. - Introduce shared AI metadata generation + template reading, and update PR body composition to safely insert/replace an AI-managed summary section.
- Add terminal markdown rendering for AI streaming, plus Evalite-based local evals and broad docs/skill updates for the new workflow.
Reviewed changes
Copilot reviewed 50 out of 53 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/dubstack/SKILL.md | Documents new AI create/submit/flow commands and setup/precedence. |
| skills/dub-flow/SKILL.md | Updates flow skill to prefer dub flow and include PR description/template guidance. |
| pnpm-workspace.yaml | Adds better-sqlite3 to built deps; normalizes workspace glob formatting. |
| packages/cli/test/commands/flow.test.ts | Adds integration-style test coverage for flow() behavior. |
| packages/cli/src/lib/terminal-render.ts | Adds reusable terminal renderer for markdown previews/status/tool activity. |
| packages/cli/src/lib/terminal-render.test.ts | Tests terminal renderer formatting behavior in TTY vs non-TTY. |
| packages/cli/src/lib/temp-text-file.ts | Adds temp markdown file helpers for file-backed git/gh operations. |
| packages/cli/src/lib/temp-text-file.test.ts | Tests temp file lifecycle and cleanup on success/failure. |
| packages/cli/src/lib/pr-body.ts | Adds AI summary markers + updated PR body composition logic. |
| packages/cli/src/lib/pr-body.test.ts | Tests AI summary strip/replace behavior and updated composition. |
| packages/cli/src/lib/metadata-templates.ts | Reads PR/commit templates from common repo locations and git config. |
| packages/cli/src/lib/metadata-templates.test.ts | Tests template discovery and commit template resolution via mocked git config. |
| packages/cli/src/lib/git.ts | Adds commitStagedFromFile() and getDiffBetween() helpers. |
| packages/cli/src/lib/git.test.ts | Adds tests for new git helpers. |
| packages/cli/src/lib/config.ts | Extends repo-local config with ai.defaults and DeepPartial write/read support. |
| packages/cli/src/lib/config.test.ts | Tests config default normalization and persistence for AI defaults. |
| packages/cli/src/lib/ai-metadata.ts | Introduces shared AI metadata generation (branch/commit/PR description) with template support. |
| packages/cli/src/lib/ai-metadata.test.ts | Tests provider selection, parsing/normalization, and template prompt inclusion. |
| packages/cli/src/index.ts | Wires new flow command + new AI flags (--no-ai) and config ai-defaults subcommand. |
| packages/cli/src/commands/submit.ts | Adds AI PR description generation, summary overrides, and safe temp-file body updates. |
| packages/cli/src/commands/submit.test.ts | Adds tests for submit AI behavior, overrides, and diff selection. |
| packages/cli/src/commands/flow.ts | Adds new AI-assisted flow() orchestration command. |
| packages/cli/src/commands/flow.test.ts | Unit tests for flow staging/preview/approval and delegation behavior. |
| packages/cli/src/commands/create.ts | Refactors create to use shared AI metadata, repo defaults, and file-backed commits for multiline messages. |
| packages/cli/src/commands/create.test.ts | Adds tests for repo-default AI behavior, --no-ai override, and multiline commit message handling. |
| packages/cli/src/commands/config.ts | Adds configAiDefaults() and standardizes boolean config result type. |
| packages/cli/src/commands/config.test.ts | Tests ai-defaults read/write behavior and validation. |
| packages/cli/src/commands/ai.ts | Switches AI streaming output to the new terminal renderer; adds tool activity rendering. |
| packages/cli/src/commands/ai.test.ts | Updates tests for new streaming + tool activity output behavior. |
| packages/cli/evals/dub-flow-metadata.eval.ts | Adds Evalite suite for generateFlowMetadata() quality and contract checks. |
| package.json | Adds eval scripts and Evalite dev dependency; adds check:all/cli:dev. |
| evalite.config.ts | Configures Evalite sqlite storage and scoring/timeouts. |
| docs/plans/2026-03-08-ai-assistant-metadata-flow.md | Adds implementation plan for AI metadata/flow work. |
| docs/plans/2026-03-08-ai-assistant-metadata-flow-design.md | Adds design doc describing AI workflow, config, and UX constraints. |
| apps/docs/content/docs/index.mdx | Updates intro + quickstart snippets to include AI defaults and dub flow. |
| apps/docs/content/docs/guides/migration-from-graphite.mdx | Updates AI feature description to include PR descriptions and flow. |
| apps/docs/content/docs/guides/ai-assistant.mdx | Expands AI guide with setup, defaults, templates, create/submit/flow usage. |
| apps/docs/content/docs/getting-started/quickstart.mdx | Adds AI defaults and optional dub flow usage to onboarding. |
| apps/docs/content/docs/contributing/development.mdx | Adds pnpm check:all and eval guidance for AI prompt/metadata changes. |
| apps/docs/content/docs/commands/submit.mdx | Documents submit --ai/--no-ai and PR template behavior. |
| apps/docs/content/docs/commands/create.mdx | Documents create --no-ai and commit template-aware AI behavior. |
| README.md | Documents AI defaults overrides, AI PR descriptions, flow command, and Evalite suite usage. |
| QUICKSTART.md | Updates quickstart to include AI defaults, templates, flow, and eval commands. |
| AGENTS.md | Updates agent guidance with eval scripts and pnpm check:all expectations. |
| .gitignore | Ignores Evalite artifacts. |
| .beads/dolt-monitor.pid.lock | Adds beads/Dolt runtime lock file to repo (as included in this PR). |
| .agents/skills/dubstack/SKILL.md | Updates agent skill with AI workflow guidance. |
| .agents/skills/dub-flow/SKILL.md | Updates agent flow skill to mirror dub flow + template behavior. |
| .agents/skills/dub-flow-evals/SKILL.md | Adds agent skill for maintaining Evalite coverage for flow metadata. |
| .agents/skills/beads/SKILL.md | Adds agent skill documenting bd/beads issue tracking conventions. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dbf67b6 to
9973861
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduced the
dub flow(aliasf) command and enhanced the existingcreateandsubmitworkflows with tri-state AI resolution. The system now supports repo-local defaults for AI authoring, enabling users to toggle automated metadata generation viadub config ai-defaults <create|submit|flow> on|offor per-invocation flags (--aivs--no-ai).Runtime and Product Behavior
dub flowcommand orchestrates staging changes, generating branch/commit/PR metadata, and executing creation and submission in one interactive step..gitmessagetemplates for commits and GitHub PR templates for pull request descriptions.dub submit --aigenerates a descriptive body for pull requests while preserving the commit-derived title for squash-merge safety.packages/cli/src/lib/terminal-render.tsthat provides live status lines, tool activity visibility, and formatted markdown previews for AI-generated content.<!-- dubstack-ai-summary:start -->), allowing DubStack to replace generated summaries while preserving user-authored freeform text.Internal Libraries and Config
packages/cli/src/lib/ai-metadata.ts.DubConfigto supportai.defaultsfor granular control over automated authoring behaviors.packages/cli/src/lib/temp-text-file.tsto manage the lifecycle of generated metadata during interactive edit sessions.Documentation and Skills
apps/docs/content/docs/guides/ai-assistant.mdxinto a comprehensive guide covering setup, precedence, and conflict resolution.createandsubmitdocumentation to reflect new flags and template support.skills/dubstackandskills/dub-flow) to teach coding assistants how to use the high-level AI flows.Testing and Evals
packages/cli/evals/dub-flow-metadata.eval.tsto score the quality and fidelity of generated branch, commit, and PR metadata against real diffs.submit,flow, and the new config subcommands.pnpm check:allas a comprehensive gate including formatting, types, tests, and AI evals.🥞 DubStack