Skip to content

feat(cli): add OpenSpec as alternative workflow mode#79

Merged
salimomrani merged 1 commit into
masterfrom
018-openspec-spec-mode
May 3, 2026
Merged

feat(cli): add OpenSpec as alternative workflow mode#79
salimomrani merged 1 commit into
masterfrom
018-openspec-spec-mode

Conversation

@salimomrani

Copy link
Copy Markdown
Owner

Summary

  • Extends WorkflowMode to four values (speckit | openspec | vibe | none) and removes the redundant speckit: boolean from ProjectConfig. Single source of truth, no impossible states.
  • New src/generators/openspec.ts bootstraps OpenSpec via npx --yes @fission-ai/openspec@latest init --tools <aiTool> --force .. No global install required; failures degrade to a warning (never abort the project), matching the speckit silent-skip pattern (Constitution §5).
  • New CLI flags --speckit and --openspec (mutually exclusive); --workflow description updated to list openspec. Mutual-exclusion gate fires before any filesystem work.
  • AGENTS.md (Codex) and CLAUDE.md (Claude Code) templates gain a Workflow Mode: line and a parameterized {{#if workflowOpenspec}} documentation block. Project name is injected via {{name}} — no hard-coded reference to any sample project.
  • commands/add.ts exposes openspec as a layer (spec-mode conflict group with speckit); utils/detect-project.ts recognizes openspec/config.yaml as a sentinel.
  • Spec artifacts under specs/018-openspec-spec-mode/ (spec.md, plan.md, tasks.md, qa-summary.md, checklists/requirements.md) included for auditability.

Test plan

  • npm run typecheck — 0 errors
  • npm test -- --run554/554 tests passing across 51 files
  • New unit tests in src/generators/__tests__/openspec.test.ts cover argv shape (codex + claude), isNpxAvailable detection, early-skip when aiTool === "none", and silent-failure on non-zero exit
  • New CLI test in src/__tests__/new-command.test.ts asserts --speckit --openspec exits with code 1 and the conflict message (covers FR-009 / SC-004)
  • Updated codex/claude-code template tests assert Workflow Mode: openspec, the OpenSpec doc section, parameterised {{name}} substitution, and absence of any hard-coded sample project name (SC-006)
  • Manual smoke: forgekit new tmp-openspec-smoke --ai-tool codex --openspec --no-git -y produced openspec/config.yaml + 4 native skills under .codex/skills/openspec-*/ + parameterised AGENTS.md
  • Verify the same smoke path with --ai-tool claude before merge (skills land under .claude/skills/openspec-*/)

Extend WorkflowMode to four values (speckit | openspec | vibe | none),
removing the redundant `speckit: boolean` from ProjectConfig. New
src/generators/openspec.ts bootstraps OpenSpec via
`npx --yes @fission-ai/openspec@latest init --tools <aiTool> --force .`,
mirroring the speckit silent-skip pattern (warn, never abort).

CLI gains `--speckit` and `--openspec` flags with mutual-exclusion
gate; `--workflow` description updated to list openspec. AGENTS.md and
CLAUDE.md templates render `Workflow Mode:` and a parameterized
`{{#if workflowOpenspec}}` doc block — no hard-coded project names,
all paths driven by `{{name}}`.

`commands/new.ts` dispatches the bootstrap on workflowMode;
`commands/add.ts` exposes openspec as a layer with spec-mode conflict
group; `detect-project.ts` recognizes `openspec/config.yaml` as a
sentinel.

Tests: 554/554 passing. New coverage: initOpenspec argv shape,
isNpxAvailable detection, CLI mutual-exclusion (FR-009/SC-004),
template rendering for both AGENTS.md and CLAUDE.md (positive +
negative cases, plus a guard that no `relationship-crm` reference
leaks into generated artifacts — SC-006).

Spec artifacts under specs/018-openspec-spec-mode/ included for
auditability of the spec → plan → tasks workflow.
@salimomrani
salimomrani merged commit 3c717b3 into master May 3, 2026
5 checks passed
@salimomrani
salimomrani deleted the 018-openspec-spec-mode branch May 3, 2026 18:03
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