Shikigami:在并行 Git 工作树中运行多个 AI 编码代理
英文标题:🔶 Show HN: Shikigami, run AI coding agents in parallel, each in a Git worktree
Shikigami 是一个允许开发者在独立 Git 工作树中并行运行多个 AI 编码代理的工具。这段 PHP 代码示例展示了 Mira、Igor 和 Koneko 三个代理在同一文件上所做的不同贡献,每个代理的改动被清晰标记。对于需要同时处理多个代码生成或润色任务的开发者,这种方式可以显著提升效率,并保持每次修改的隔离性。
249.5 KB
51.3 KB
44.4 KB
135.2 KB
17.8 KB
500.7 KB
中文
1 <?php
2
3 declare(strict_types=1);
4
5 namespace App\Module\Holiday\UseCase\Command;
6
7 use App\Module\Holiday\DTO\PublicHolidayCalendarDTO; Mira 9a31c2e 8 use App\Shared\Facade\DateNagerInterface;
9
10 final readonly class SyncCalendarCommandHandler
11 {
12 public function __construct( Igor 5d01a4e 13 private DateNagerInterface $dateNager,
14 private CalendarRepositoryInterface $calendarRepository,
15 ) {}
16
17 public function __invoke(SyncCalendarCommand $command): void
18 {
19 [$countryCode, $countryName, $year] = $command->unpack(); Koneko 27c5b9c 20 $holidays = $this->dateNager->getHolidaysForCountry($countryCode, $year);
21 $dto = PublicHolidayCalendarDTO::createFromNager($countryCode, $countryName, $holidays);
22 $this->calendarRepository->upsertByCountryCode($dto, $year);
23 }
24 }
English / 原文
1 <?php
2
3 declare(strict_types=1);
4
5 namespace App\Module\Holiday\UseCase\Command;
6
7 use App\Module\Holiday\DTO\PublicHolidayCalendarDTO;
Mira 9a31c2e 8 use App\Shared\Facade\DateNagerInterface;
9
10 final readonly class SyncCalendarCommandHandler
11 {
12 public function __construct(
Igor 5d01a4e 13 private DateNagerInterface $dateNager,
14 private CalendarRepositoryInterface $calendarRepository,
15 ) {}
16
17 public function __invoke(SyncCalendarCommand $command): void
18 {
19 [$countryCode, $countryName, $year] = $command->unpack();
Koneko 27c5b9c 20 $holidays = $this->dateNager->getHolidaysForCountry($countryCode, $year);
21 $dto = PublicHolidayCalendarDTO::createFromNager($countryCode, $countryName, $holidays);
22 $this->calendarRepository->upsertByCountryCode($dto, $year);
23 }
24 }