diff --git a/src/core/init.ts b/src/core/init.ts index aa38408f2..e29e42e06 100644 --- a/src/core/init.ts +++ b/src/core/init.ts @@ -700,8 +700,12 @@ export class InitCommand { const globalCfg = getGlobalConfig(); const activeProfile: Profile = (this.profileOverride as Profile) ?? globalCfg.profile ?? 'core'; const activeWorkflows = [...getProfileWorkflows(activeProfile, globalCfg.workflows)]; + const hasConfiguredTools = results.createdTools.length > 0 || results.refreshedTools.length > 0; console.log(); - if (activeWorkflows.includes('propose')) { + if (!hasConfiguredTools) { + console.log('OpenSpec structure created, but no agent integrations were installed.'); + console.log(' Install integrations later with: openspec init --tools '); + } else if (activeWorkflows.includes('propose')) { console.log(chalk.bold('Getting started:')); console.log(' Start your first change: /opsx:propose "your idea"'); } else if (activeWorkflows.includes('new')) { diff --git a/test/cli-e2e/basic.test.ts b/test/cli-e2e/basic.test.ts index 22657513d..1f102148e 100644 --- a/test/cli-e2e/basic.test.ts +++ b/test/cli-e2e/basic.test.ts @@ -156,6 +156,7 @@ describe('openspec CLI e2e basics', () => { expect(result.exitCode).toBe(0); expect(result.stdout).toContain('OpenSpec Setup Complete'); expect(result.stdout).toContain('Claude Code'); + expect(result.stdout).toContain('/opsx:propose'); // New init creates skills, not CLAUDE.md const claudeSkillPath = path.join(emptyProjectDir, '.claude/skills/openspec-explore/SKILL.md'); @@ -172,6 +173,9 @@ describe('openspec CLI e2e basics', () => { const result = await runCLI(['init', '--tools', 'none'], { cwd: emptyProjectDir }); expect(result.exitCode).toBe(0); expect(result.stdout).toContain('OpenSpec Setup Complete'); + expect(result.stdout).toContain('no agent integrations were installed'); + expect(result.stdout).toContain('openspec init --tools '); + expect(result.stdout).not.toContain('/opsx:propose'); // With --tools none, no tool skills should be created const claudeSkillPath = path.join(emptyProjectDir, '.claude/skills/openspec-explore/SKILL.md'); diff --git a/test/core/init.test.ts b/test/core/init.test.ts index 6a436eaed..c7edc3cea 100644 --- a/test/core/init.test.ts +++ b/test/core/init.test.ts @@ -231,6 +231,11 @@ describe('InitCommand', () => { // No tool-specific directories should be created const claudeSkillsDir = path.join(testDir, '.claude', 'skills'); expect(await directoryExists(claudeSkillsDir)).toBe(false); + + const logCalls = (console.log as unknown as { mock: { calls: unknown[][] } }).mock.calls.flat().map(String); + expect(logCalls.some((entry) => entry.includes('no agent integrations were installed'))).toBe(true); + expect(logCalls.some((entry) => entry.includes('openspec init --tools '))).toBe(true); + expect(logCalls.some((entry) => entry.includes('/opsx:propose'))).toBe(false); }); it('should throw error for invalid tool names', async () => {