Skip to content

feat: guided Sprint 0 bootstrapping workflow - #79

Merged
ablanrob merged 2 commits into
mainfrom
feat/sprint-zero-bootstrap
May 13, 2026
Merged

ablanrob merged 2 commits into
mainfrom
feat/sprint-zero-bootstrap

Conversation

@ablanrob

Copy link
Copy Markdown
Owner

Summary

  • Adds bootstrap_sprint_zero MCP tool — a multi-step workflow (survey → draft → populate → review → commit) that creates a fully scaffolded Sprint 0 with linked bootstrapping actions
  • The populate step reads the Sprint 0 checklist from the concept registry (merged in feat: concept-explanation tools for queryable methodology knowledge #78), so adding new bootstrapping categories requires no tool changes
  • AEM-specific addendum items are auto-included when project methodology is sap-aem; excluded for generic-agile
  • Duplicate Sprint 0 creation is prevented (checks for existing sprint-0/bootstrapping tags)
  • Only the commit step writes to disk; all other steps are read-only and idempotent
  • Updates get_started to recommend bootstrap_sprint_zero by name when the project has work items but no sprints

Test plan

  • 33 new tests (27 bootstrap workflow + 6 tool wrapper) — all passing
  • Verify survey reflects correct project state counts (AC2.1)
  • Verify full workflow produces sprint + N linked actions matching checklist (AC2.2)
  • Verify second commit returns error referencing existing Sprint 0 (AC2.3)
  • Verify AEM addendum items present for methodology=aem (AC2.4)
  • Verify AEM addendum absent for methodology=generic-agile (AC2.5)
  • Verify get_started references bootstrap_sprint_zero by name (AC2.6)
  • Full test suite (967 tests) passes, typecheck clean

Add bootstrap_sprint_zero MCP tool that drives a multi-step workflow
(survey → draft → populate → review → commit) to create a fully
scaffolded Sprint 0 with linked bootstrapping actions.

The populate step consumes the Sprint 0 checklist from the concept
registry, so adding new bootstrapping categories requires no tool
changes. AEM-specific addendum items are auto-included when the
project methodology is sap-aem. Duplicate Sprint 0 creation is
prevented.

Also updates get_started to recommend bootstrap_sprint_zero by name
when the project has work items but no sprints, and adds
normalizeMethodology() to map config IDs (sap-aem) to concept
registry values (aem).
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Automated Sprint 0 bootstrap workflow to survey the project, draft a Sprint 0, propose backlog items by methodology, review, and commit created sprint and actions.
    • Onboarding guide now adapts Sprint 0 guidance based on whether work items or an existing Sprint 0 are present.
    • Sprint 0 bootstrap exposed as an assistant tool for interactive use.
  • Tests

    • Added comprehensive tests covering the full bootstrap workflow and tool behavior.

Walkthrough

This PR implements a complete Sprint 0 bootstrap workflow as a step-sequenced state machine (survey → draft → populate → review → commit), exposes it as an MCP tool, integrates it into the MCP server and onboarding guide, and provides comprehensive test coverage validating the full flow.

Changes

Sprint 0 Bootstrap Workflow

Layer / File(s) Summary
Bootstrap workflow types and context
src/methodology/bootstrap.ts (lines 1–127)
Exports step/section/result type definitions (BootstrapStep, BootstrapSection, SurveyResult, DraftResult, PopulateResult, ReviewResult, CommitResult), BootstrapContext carrier interface, and internal helpers for normalizing methodology and detecting existing Sprint 0 sprints.
Survey and draft steps
src/methodology/bootstrap.ts (lines 128–165)
Implements survey to compute store counts and draft to produce a Sprint 0 draft suggestion and route to populate.
Populate and review steps
src/methodology/bootstrap.ts (lines 166–297)
Implements populate to build proposed action items (per-section filtering, owner persona assignment, skipReason) and review to summarize items, warnings, and set nextStep: "commit".
Commit and dispatcher
src/methodology/bootstrap.ts (lines 299–380)
Implements commit to create sprint and action documents while preventing duplicates, includes helpers for category extraction, and adds runStep dispatcher.
MCP tool wrapper for bootstrap
src/methodology/bootstrap-tools.ts
Adds BootstrapToolOptions and createBootstrapTools(store, options) producing a bootstrap_sprint_zero MCP tool with Zod-validated arguments, config/manifest wiring, runStep invocation, result formatting, and error handling.
MCP server and onboarding integration
src/agent/mcp-server.ts (lines 19, 56–59), src/doctor/health/onboarding.ts (lines 31, 107–125)
Imports and wires createBootstrapTools into the MCP server tools array; updates onboarding Step 6 to conditionally select bootstrap_sprint_zero or create_sprint based on whether work items exist and whether Sprint 0 already exists.
Test coverage
test/methodology/bootstrap-tools.test.ts, test/methodology/bootstrap.test.ts
Adds Vitest suites validating MCP tool invocation behavior (step dispatch, default to survey, config validation, duplicate Sprint 0 detection, section filtering) and core workflow state transitions (step sequencing, sprint/action document creation, methodology-specific AEM addendum handling, comprehensive end-to-end workflows).

Sequence Diagram

sequenceDiagram
  participant Claude as Claude/MCP Client
  participant Tool as bootstrap_sprint_zero Tool Handler
  participant Bootstrap as Bootstrap Workflow (runStep)
  participant Store as Document Store

  Claude->>Tool: invoke(step="survey")
  Tool->>Bootstrap: runStep(ctx, "survey")
  Bootstrap->>Store: read sprints/features/actions/decisions
  Bootstrap-->>Tool: SurveyResult{projectState, nextStep}
  Tool-->>Claude: JSON(SurveyResult)

  Claude->>Tool: invoke(step="draft")
  Tool->>Bootstrap: runStep(ctx, "draft")
  Bootstrap-->>Tool: DraftResult{sprintDraft, nextStep}
  Tool-->>Claude: JSON(DraftResult)

  Claude->>Tool: invoke(step="commit")
  Tool->>Bootstrap: runStep(ctx, "commit")
  Bootstrap->>Store: create sprint document
  Bootstrap->>Store: create action documents
  Bootstrap-->>Tool: CommitResult{sprintId, actionIds, totalCreated}
  Tool-->>Claude: JSON(CommitResult)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ablanrob/marvin-cli#75: Introduces the buildOnboardingGuide function and "Set up Sprint 0" step that this PR updates to conditionally invoke the new bootstrap_sprint_zero tool.
  • ablanrob/marvin-cli#77: Also modifies buildOnboardingGuide; related to onboarding checklist changes in this PR.

Poem

🐰 A rabbit hops through projects new,
Survey, draft, then populate true,
Review the plan, then commit with care,
Sprint 0 springs to life from there! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: guided Sprint 0 bootstrapping workflow' directly and clearly summarizes the main change—the addition of a new guided workflow for Sprint 0 bootstrapping.
Description check ✅ Passed The description follows the required template structure, includes all key sections (Summary, Changes, Type of Change checked, Testing checklist, and general Checklist), and provides comprehensive details about the feature.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sprint-zero-bootstrap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/methodology/bootstrap-tools.ts (1)

16-16: ⚡ Quick win

Reconsider scope: any in SdkMcpToolDefinition is a systemic codebase pattern.

The SdkMcpToolDefinition<any>[] return type violates the strict-mode guideline, but this pattern is defined in the SkillDefinition interface itself and used consistently across 30+ tool factory functions. Refactoring this single file in isolation would be incomplete. If addressing this violation, it should be a codebase-wide effort with a wrapper type or structural approach that applies to all tool factories. Alternatively, document this as an accepted exception for external SDK generics where the type parameter is inherently unconstrained across heterogeneous tool arrays.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/methodology/bootstrap-tools.ts` at line 16, The current return type uses
SdkMcpToolDefinition<any>[] which violates strict-mode; either (1) change the
return type to SdkMcpToolDefinition<unknown>[] in the function in this file to
comply with strict generics (referencing SdkMcpToolDefinition and
SkillDefinition) or (2) if this is a systemic pattern, add a short comment above
the function documenting this as an accepted exception and open a follow-up
issue/PR to introduce a project-wide wrapper type for heterogeneous tool
factories (reference SkillDefinition and all tool factory functions) so the
single-file change is not left inconsistent with the rest of the codebase.
Ensure the chosen approach is applied consistently across other tool factory
functions or tracked in the follow-up issue.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/doctor/health/onboarding.ts`:
- Around line 112-118: The current step uses hasSprints (and branches
description/tool/done) which treats any sprint as fulfilling “Sprint 0”; change
the logic to detect an actual Sprint 0 instead of any sprint. Replace uses of
hasSprints in the description, tool and done fields with a boolean like
hasSprintZero (or a helper that checks sprint titles/tags for "Sprint 0" using
the same detection logic used in the bootstrap flow), and keep hasWorkItems for
the bootstrap_sprint_zero branch; ensure done: uses hasSprintZero so the step is
only marked complete when a Sprint 0 exists.

In `@src/methodology/bootstrap-tools.ts`:
- Around line 36-41: The schema field includeAemAddendum is declared but never
used; either propagate its value into the workflow context passed to runStep or
remove the schema option. Locate the z.boolean() includeAemAddendum declaration
and update the call site for runStep (the runStep invocation that starts the
workflow) to include includeAemAddendum in the options/context object (e.g.,
context.includeAemAddendum = args.includeAemAddendum or pass {
includeAemAddendum: args.includeAemAddendum } into runStep), ensuring any
downstream code reads context.includeAemAddendum; alternatively, if you opt to
drop the feature, remove the includeAemAddendum schema entry and any references
so the API isn't misleading.

In `@src/methodology/bootstrap.ts`:
- Around line 200-233: The logic computing nextStep can indicate another
populate even when section is omitted and targetSections already contains the
full checklist; update the nextStep calculation so that when doing a
full-populate (section is null/undefined or targetSections.length ===
allSections.length) it returns "review" instead of `populate (next: ...)`.
Change the current nextStep assignment (which uses
hasMore/currentIdx/allSections) to first detect full-populate (e.g., section ==
null || targetSections.length === allSections.length) and set nextStep =
"review" in that case, otherwise keep the existing hasMore-based `populate
(next: ${allSections[currentIdx + 1]})` behavior.
- Around line 147-150: integrationsConfigured.confluence is wrongly using the
Jira check; update the confluence boolean to check the real Confluence config
field instead of config.jira?.projectKey?.trim() — for example, mirror how Jira
is computed (jira uses config.jira?.projectKey?.trim()) and change confluence to
check the appropriate Confluence property such as
config.confluence?.spaceKey?.trim() (or the actual Confluence identifier field
used in your config) within the integrationsConfigured object.
- Around line 293-295: Replace the plain throws that use `new Error(...)` in
bootstrap.ts (the duplicate-sprint throw referencing `existingId` and the
unknown-step throw at 366-367) with the project's typed errors: import the
appropriate error class from `src/core/errors.ts` (e.g., `ConfigError` for
validation/duplicate/unknown-step conditions or `MarvinError` for a general
runtime error) and rethrow using that class with the same descriptive message
(e.g., `throw new ConfigError("Sprint 0 already exists (...) ...")`), ensuring
the import is added and the original message/context (including `existingId` and
the suggestion to use `get_sprint(...)`) is preserved.

---

Nitpick comments:
In `@src/methodology/bootstrap-tools.ts`:
- Line 16: The current return type uses SdkMcpToolDefinition<any>[] which
violates strict-mode; either (1) change the return type to
SdkMcpToolDefinition<unknown>[] in the function in this file to comply with
strict generics (referencing SdkMcpToolDefinition and SkillDefinition) or (2) if
this is a systemic pattern, add a short comment above the function documenting
this as an accepted exception and open a follow-up issue/PR to introduce a
project-wide wrapper type for heterogeneous tool factories (reference
SkillDefinition and all tool factory functions) so the single-file change is not
left inconsistent with the rest of the codebase. Ensure the chosen approach is
applied consistently across other tool factory functions or tracked in the
follow-up issue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8b34591-3292-4e15-82a4-5a119b259387

📥 Commits

Reviewing files that changed from the base of the PR and between 481634c and d7d7ab0.

📒 Files selected for processing (6)
  • src/agent/mcp-server.ts
  • src/doctor/health/onboarding.ts
  • src/methodology/bootstrap-tools.ts
  • src/methodology/bootstrap.ts
  • test/methodology/bootstrap-tools.test.ts
  • test/methodology/bootstrap.test.ts

Comment thread src/doctor/health/onboarding.ts Outdated
Comment thread src/methodology/bootstrap-tools.ts
Comment thread src/methodology/bootstrap.ts
Comment thread src/methodology/bootstrap.ts Outdated
Comment thread src/methodology/bootstrap.ts Outdated
- Detect actual Sprint 0 (by tag/title) in onboarding instead of any sprint
- Wire includeAemAddendum through to bootstrap context and checklist
- Fix full-populate nextStep to return "review" instead of "populate (next:…)"
- Fix confluence check to return false (no independent config field exists)
- Use ConfigError instead of plain Error for duplicate sprint and unknown step

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/methodology/bootstrap-tools.ts`:
- Around line 13-16: The return type currently uses SdkMcpToolDefinition<any>[];
define a concrete args interface (e.g., BootstrapToolArgs) that models the
expected properties passed to bootstrap tools (leveraging existing types like
BootstrapStep and BootstrapSection from ./bootstrap.js) and replace the any with
SdkMcpToolDefinition<BootstrapToolArgs>[] on createBootstrapTools; ensure the
new interface is exported/declared near the top of
src/methodology/bootstrap-tools.ts and update any internal uses or type
annotations inside createBootstrapTools to use BootstrapToolArgs for strict
typing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7435bc06-af3e-43e0-a1ec-03988b5a9d6a

📥 Commits

Reviewing files that changed from the base of the PR and between d7d7ab0 and bbd52a4.

📒 Files selected for processing (3)
  • src/doctor/health/onboarding.ts
  • src/methodology/bootstrap-tools.ts
  • src/methodology/bootstrap.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/methodology/bootstrap.ts

Comment on lines +13 to +16
export function createBootstrapTools(
store: DocumentStore,
options?: BootstrapToolOptions,
): SdkMcpToolDefinition<any>[] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify explicit `any` usage in this file
rg -nP --type=ts 'SdkMcpToolDefinition<any>|:\s*any\b' src/methodology/bootstrap-tools.ts

Repository: ablanrob/marvin-cli

Length of output: 99


🏁 Script executed:

cat -n src/methodology/bootstrap-tools.ts | head -100

Repository: ablanrob/marvin-cli

Length of output: 3557


🏁 Script executed:

# Check for type definitions of BootstrapStep, BootstrapSection
rg -n "type|interface.*\b(BootstrapStep|BootstrapSection|BootstrapToolOptions)\b" src/methodology/bootstrap-tools.ts

Repository: ablanrob/marvin-cli

Length of output: 597


🏁 Script executed:

# Check for any other usages of 'any' in the file
rg -n ":\s*any\b|<any>" src/methodology/bootstrap-tools.ts

Repository: ablanrob/marvin-cli

Length of output: 99


Replace any with explicit BootstrapToolArgs type.

The return type SdkMcpToolDefinition<any>[] at line 16 violates strict typing requirements. Since BootstrapStep and BootstrapSection are already imported from ./bootstrap.js, define an explicit args interface and use it:

Suggested fix
+interface BootstrapToolArgs {
+  step?: BootstrapStep;
+  section?: BootstrapSection;
+  includeAemAddendum?: boolean;
+}
+
 export function createBootstrapTools(
   store: DocumentStore,
   options?: BootstrapToolOptions,
-): SdkMcpToolDefinition<any>[] {
+): SdkMcpToolDefinition<BootstrapToolArgs>[] {

Per coding guidelines: "Never use any unless absolutely unavoidable — prefer explicit types." This improves IDE support and maintainability without runtime cost.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/methodology/bootstrap-tools.ts` around lines 13 - 16, The return type
currently uses SdkMcpToolDefinition<any>[]; define a concrete args interface
(e.g., BootstrapToolArgs) that models the expected properties passed to
bootstrap tools (leveraging existing types like BootstrapStep and
BootstrapSection from ./bootstrap.js) and replace the any with
SdkMcpToolDefinition<BootstrapToolArgs>[] on createBootstrapTools; ensure the
new interface is exported/declared near the top of
src/methodology/bootstrap-tools.ts and update any internal uses or type
annotations inside createBootstrapTools to use BootstrapToolArgs for strict
typing.

@ablanrob
ablanrob merged commit b722ecf into main May 13, 2026
2 checks passed
@ablanrob
ablanrob deleted the feat/sprint-zero-bootstrap branch May 13, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant