@@ -737,6 +737,66 @@ describe('InitCommand', () => {
737737 ) ;
738738 expect ( auggieChoice . configured ) . toBe ( true ) ;
739739 } ) ;
740+
741+ it ( 'should create Crush slash command files with templates' , async ( ) => {
742+ queueSelections ( 'crush' , DONE ) ;
743+
744+ await initCommand . execute ( testDir ) ;
745+
746+ const crushProposal = path . join (
747+ testDir ,
748+ '.crush/commands/openspec/proposal.md'
749+ ) ;
750+ const crushApply = path . join (
751+ testDir ,
752+ '.crush/commands/openspec/apply.md'
753+ ) ;
754+ const crushArchive = path . join (
755+ testDir ,
756+ '.crush/commands/openspec/archive.md'
757+ ) ;
758+
759+ expect ( await fileExists ( crushProposal ) ) . toBe ( true ) ;
760+ expect ( await fileExists ( crushApply ) ) . toBe ( true ) ;
761+ expect ( await fileExists ( crushArchive ) ) . toBe ( true ) ;
762+
763+ const proposalContent = await fs . readFile ( crushProposal , 'utf-8' ) ;
764+ expect ( proposalContent ) . toContain ( '---' ) ;
765+ expect ( proposalContent ) . toContain ( 'name: OpenSpec: Proposal' ) ;
766+ expect ( proposalContent ) . toContain ( 'description: Scaffold a new OpenSpec change and validate strictly.' ) ;
767+ expect ( proposalContent ) . toContain ( 'category: OpenSpec' ) ;
768+ expect ( proposalContent ) . toContain ( 'tags: [openspec, change]' ) ;
769+ expect ( proposalContent ) . toContain ( '<!-- OPENSPEC:START -->' ) ;
770+ expect ( proposalContent ) . toContain ( '**Guardrails**' ) ;
771+
772+ const applyContent = await fs . readFile ( crushApply , 'utf-8' ) ;
773+ expect ( applyContent ) . toContain ( '---' ) ;
774+ expect ( applyContent ) . toContain ( 'name: OpenSpec: Apply' ) ;
775+ expect ( applyContent ) . toContain ( 'description: Implement an approved OpenSpec change and keep tasks in sync.' ) ;
776+ expect ( applyContent ) . toContain ( 'category: OpenSpec' ) ;
777+ expect ( applyContent ) . toContain ( 'tags: [openspec, apply]' ) ;
778+ expect ( applyContent ) . toContain ( 'Work through tasks sequentially' ) ;
779+
780+ const archiveContent = await fs . readFile ( crushArchive , 'utf-8' ) ;
781+ expect ( archiveContent ) . toContain ( '---' ) ;
782+ expect ( archiveContent ) . toContain ( 'name: OpenSpec: Archive' ) ;
783+ expect ( archiveContent ) . toContain ( 'description: Archive a deployed OpenSpec change and update specs.' ) ;
784+ expect ( archiveContent ) . toContain ( 'category: OpenSpec' ) ;
785+ expect ( archiveContent ) . toContain ( 'tags: [openspec, archive]' ) ;
786+ expect ( archiveContent ) . toContain ( 'openspec archive <id> --yes' ) ;
787+ } ) ;
788+
789+ it ( 'should mark Crush as already configured during extend mode' , async ( ) => {
790+ queueSelections ( 'crush' , DONE , 'crush' , DONE ) ;
791+ await initCommand . execute ( testDir ) ;
792+ await initCommand . execute ( testDir ) ;
793+
794+ const secondRunArgs = mockPrompt . mock . calls [ 1 ] [ 0 ] ;
795+ const crushChoice = secondRunArgs . choices . find (
796+ ( choice : any ) => choice . value === 'crush'
797+ ) ;
798+ expect ( crushChoice . configured ) . toBe ( true ) ;
799+ } ) ;
740800 } ) ;
741801
742802 describe ( 'non-interactive mode' , ( ) => {
0 commit comments