Skip to content

feat(cli): add update command#9

Merged
TabishB merged 1 commit into
mainfrom
add-update-command-impl
Aug 11, 2025
Merged

feat(cli): add update command#9
TabishB merged 1 commit into
mainfrom
add-update-command-impl

Conversation

@TabishB

@TabishB TabishB commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Add openspec update CLI command to refresh OpenSpec instruction files
  • Fully replaces openspec/README.md with latest template
  • Updates CLAUDE.md OpenSpec-managed block via markers; creates file if missing
  • ASCII-safe success message: "Updated OpenSpec instructions"

Details

  • Verifies openspec directory exists (OPENSPEC_DIR_NAME)
  • Uses FileSystemUtils.writeFile and updateFileWithMarkers
  • Reuses readmeTemplate and TemplateManager.getClaudeTemplate()
  • Integrated into src/cli/index.ts with error handling via ora()

Test plan

  • Build succeeds: pnpm build
  • All tests pass: pnpm test
  • Manual smoke:
    • openspec update in a project with openspec/ updates files as expected
    • Running twice is idempotent
    • Missing openspec/ shows friendly error

Screenshots/Logs

  • Help: openspec update --help shows description
  • Success output: Updated OpenSpec instructions

@TabishB TabishB merged commit fc0e231 into main Aug 11, 2025
drvova pushed a commit to drvova/VovaSpec that referenced this pull request Oct 13, 2025
stanleykao72 referenced this pull request in stanleykao72/OpenSpec Apr 4, 2026
loadTemplate() called getSchemaDir(schemaName, projectRoot) without
loadedPlugins, causing "Schema 'odoo-sdd' not found" for plugin-provided
schemas. This was the last missing callsite after PR #8.

The error message was misleading — appeared as schema resolution failure
but was actually template loading failure because getSchemaDir returned
null for plugin schemas.

Constraint: loadTemplate is called from generateInstructions, which is
  the hot path for every `openspec instructions` command
Tested: 1579/1579 tests pass, `openspec instructions proposal --change X`
  correctly reports schemaName: odoo-sdd with plugin schema
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shwcsmack referenced this pull request in shwcsmack/c3spec May 27, 2026
Spawned from triage of #9 (workflow-routing spec). #9 will deliberately
stay docs-only because the repo has no precedent for new-test-per-
requirement enforcement. This entry captures the open question — what
"backing test" means, how to link requirements to tests, how to bootstrap
coverage across existing specs, and how to surface drift — so the
precedent can be set in a focused future change.

Co-authored-by: Cursor <cursoragent@cursor.com>
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