@@ -23,33 +23,55 @@ const InstallComponent: React.FC = () => {
2323
2424 // 現在のディレクトリを取得
2525 const currentDir = process . cwd ( ) ;
26- const targetDir = path . join ( currentDir , ".claude" , "commands" ) ;
26+ const commandsTargetDir = path . join ( currentDir , ".claude" , "commands" ) ;
27+ const agentsTargetDir = path . join ( currentDir , ".claude" , "agents" ) ;
2728
28- // tsumikiのcommandsディレクトリを取得
29+ // tsumikiのcommandsディレクトリとagentsディレクトリを取得
2930 const __filename = fileURLToPath ( import . meta. url ) ;
3031 const __dirname = path . dirname ( __filename ) ;
31- // ビルド後はdist/commandsを参照(cli.jsがdist/にあるため)
32- const tsumikiDir = path . join ( __dirname , "commands" ) ;
32+ // ビルド後はdist/commands, dist/agentsを参照(cli.jsがdist/にあるため)
33+ const tsumikiCommandsDir = path . join ( __dirname , "commands" ) ;
34+ const tsumikiAgentsDir = path . join ( __dirname , "agents" ) ;
3335
34- // .claude/commandsディレクトリが存在しない場合は作成
35- await fs . ensureDir ( targetDir ) ;
36+ // .claude/commandsと.claude/agentsディレクトリが存在しない場合は作成
37+ await fs . ensureDir ( commandsTargetDir ) ;
38+ await fs . ensureDir ( agentsTargetDir ) ;
3639
3740 setStatus ( "copying" ) ;
3841
3942 // commandsディレクトリ内のすべての.mdファイルと.shファイルを取得
40- const files = await fs . readdir ( tsumikiDir ) ;
41- const targetFiles = files . filter (
43+ const commandFiles = await fs . readdir ( tsumikiCommandsDir ) ;
44+ const targetCommandFiles = commandFiles . filter (
4245 ( file ) => file . endsWith ( ".md" ) || file . endsWith ( ".sh" ) ,
4346 ) ;
4447
48+ // agentsディレクトリ内のすべての.mdファイルを取得
49+ let targetAgentFiles : string [ ] = [ ] ;
50+ try {
51+ const agentFiles = await fs . readdir ( tsumikiAgentsDir ) ;
52+ targetAgentFiles = agentFiles . filter ( ( file ) => file . endsWith ( ".md" ) ) ;
53+ } catch {
54+ // agentsディレクトリが存在しない場合はスキップ
55+ }
56+
4557 const copiedFilesList : string [ ] = [ ] ;
4658
47- for ( const file of targetFiles ) {
48- const sourcePath = path . join ( tsumikiDir , file ) ;
49- const targetPath = path . join ( targetDir , file ) ;
59+ // commandsファイルをコピー
60+ for ( const file of targetCommandFiles ) {
61+ const sourcePath = path . join ( tsumikiCommandsDir , file ) ;
62+ const targetPath = path . join ( commandsTargetDir , file ) ;
63+
64+ await fs . copy ( sourcePath , targetPath ) ;
65+ copiedFilesList . push ( `commands/${ file } ` ) ;
66+ }
67+
68+ // agentsファイルをコピー
69+ for ( const file of targetAgentFiles ) {
70+ const sourcePath = path . join ( tsumikiAgentsDir , file ) ;
71+ const targetPath = path . join ( agentsTargetDir , file ) ;
5072
5173 await fs . copy ( sourcePath , targetPath ) ;
52- copiedFilesList . push ( file ) ;
74+ copiedFilesList . push ( `agents/ ${ file } ` ) ;
5375 }
5476
5577 setCopiedFiles ( copiedFilesList ) ;
@@ -125,6 +147,7 @@ const InstallComponent: React.FC = () => {
125147 </ Text >
126148 < Text color = "white" > /tdd-requirements</ Text >
127149 < Text color = "white" > /kairo-design</ Text >
150+ < Text color = "white" > @agent-symbol-searcher</ Text >
128151 < Text color = "white" > ...</ Text >
129152 </ Box >
130153 ) ;
0 commit comments