Skip to content

feat(templates): add --start-date to templates construct - #695

Merged
jeremy merged 4 commits into
mainfrom
feat/templates-construct-start-date
Sep 10, 2026
Merged

feat(templates): add --start-date to templates construct#695
jeremy merged 4 commits into
mainfrom
feat/templates-construct-start-date

Conversation

@jeremy

@jeremy jeremy commented Sep 10, 2026

Copy link
Copy Markdown
Member

What

basecamp templates construct <id> --name NAME [--start-date DATE]

The API has accepted project[start_date] on template construction since 2022 (bc3 project_operations.rb#project_from_template_params), but the command exposed only --name/--description, so every constructed project anchored the template's relative dates to the day of construction and a script had to re-date each to-do and schedule entry afterwards (#659).

  • --start-date takes YYYY-MM-DD or the natural forms the other date flags accept (tomorrow, next monday, +7), is validated before any request (Invalid start date: "…", usage exit, no network), and rides under the project envelope through the SDK's CreateProjectOptions. Unset, it stays off the wire.
  • Template weeks start on Sunday, so the server anchors the template's dates to the Sunday on or before the date; without the flag they anchor to the week of construction. The command's long help, the templates group's agent_notes, and skills/basecamp/SKILL.md say so; .surface carries the new flag.

Dependency — pinned to the tagged SDK release

Depends on basecamp/basecamp-sdk#856 (ProjectConstructionAttributes.start_date, Go CreateProjectOptions), which shipped in basecamp-sdk v0.18.0. go.mod pins github.com/basecamp/basecamp-sdk/go v0.18.0 via make bump-sdk REF=v0.18.0; the vendored MCP model is re-synced from the go/v0.18.0 checkout (scripts/sync-mcp-model.sh, PROVENANCE.json ref go/v0.18.0) and the Nix vendorHash recomputed and build-verified (make update-nix-hash). No replace directive. The earlier pseudo-version pin to the #856 branch head is gone; this is the same flip #689 made to v0.17.0.

Fixes #659. Tracked on this card; the bc3 doc side is basecamp/bc3#13259.

Tests

  • templates_test.go: the literal wire body {"project":{"name","description","start_date":"2026-09-01"}} from the recording transport; start_date absent when the flag is unset; natural-language parsing; a malformed date rejected as a usage error before any request.
  • e2e/templates.bats: offline usage error for a malformed --start-date.

Every bin/ci target run locally: fmt, vet, lint, lint-actions, e2e, naming, surface, skill drift, bare groups, lint lockstep, smoke coverage, SDK provenance, and go mod tidy green; MCP catalog provenance test green against the v0.18.0 pin. The Go unit run is green except TestBareBasecampNeverReportsASetupError, TestExplicitSetupStillRefuses, TestDeleteConfirmableFollowsTheAudienceNotTheDevice and the TestIsInteractive*/TestInteractive*/TestIsTerminal cases in appctx/cli, which fail identically on pristine main in this non-TTY shell (as #689 and #677 noted).

I'm babysitting the review loop on this PR through to convergence.

Release note: Features (enhancement).


Summary by cubic

Adds --start-date to templates construct so template relative dates anchor to a chosen week instead of the week of construction (fixes #659).

  • Accepts YYYY-MM-DD or natural forms (tomorrow, next monday, +7); malformed or explicitly blank values fail with a usage error before any request.
  • Template weeks start on Sunday, so dates anchor to the Sunday on or before the given date; without the flag the field stays off the wire.
  • Updated command help, agent notes, skill docs, and the MCP model to cover the new flag.

Dependencies

  • Upgrades github.com/basecamp/basecamp-sdk/go to v0.18.0, which provides CreateProjectOptions.StartDate.

Written for commit 902b2c4. Summary will update on new commits.

Review in cubic

The API has accepted project[start_date] on template construction since
2022, so a scripted construction could anchor the template's relative
dates to a chosen week only by re-dating every to-do and schedule entry
afterwards. --start-date takes YYYY-MM-DD or the natural forms the other
date flags accept, is validated before any request, and rides under the
project envelope through the SDK's CreateProjectOptions. Template weeks
start on Sunday, so the server anchors to the Sunday on or before the
date; the help, agent notes and skill say so.

Pins the SDK to the head of basecamp/basecamp-sdk#856 through
make bump-sdk, with the vendored MCP model re-synced from that checkout
and the Nix vendorHash recomputed and build-verified.
Copilot AI balanced review requested due to automatic review settings September 10, 2026 04:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T05:48:54.380511Z 902b2c4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The SDK remains pinned to an open PR head that must be replaced with a tagged release before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds --start-date to template construction, enabling natural or ISO dates while documenting Sunday-based anchoring.

Changes:

  • Validates and sends start_date through the SDK.
  • Adds unit/e2e coverage and CLI documentation.
  • Updates SDK-generated metadata and dependency hashes.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File summaries
File Description
internal/commands/templates.go Implements the new flag and validation.
internal/commands/templates_test.go Tests parsing and request serialization.
e2e/templates.bats Tests malformed-date handling.
skills/basecamp/SKILL.md Documents date anchoring.
.surface Records the new CLI flag.
go.mod Pins the supporting SDK revision.
go.sum Updates SDK checksums.
nix/package.nix Refreshes the vendor hash.
internal/version/sdk-provenance.json Records SDK provenance.
internal/mcpserver/model/PROVENANCE.json Updates model provenance.
internal/mcpserver/model/openapi.json Adds start_date to the schema.
Review details
  • Files reviewed: 10/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go.mod Outdated
Comment thread internal/commands/templates_test.go Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9fd04df4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/commands/templates.go Outdated
Copilot AI review requested due to automatic review settings September 10, 2026 04:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The implementation is sound, but SDK PR #856 remains open and the temporary pseudo-version must be replaced with its tagged release before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 10/11 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 10, 2026 05:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation is consistent with existing date validation patterns and thoroughly tests wire format, omission, parsing, and pre-request failures.

Review details
  • Files reviewed: 10/11 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@jeremy
jeremy merged commit 771fc91 into main Sep 10, 2026
35 checks passed
@jeremy
jeremy deleted the feat/templates-construct-start-date branch September 10, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations deps sdk SDK wrapper and provenance skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

templates construct has no way to set a project start date (template dates always anchor to construction date)

2 participants