feat: propagate workflow output language#53
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces output language constraints across various Comet workflows and skills (both English and Chinese versions) to ensure that generated artifacts, proposals, plans, and reports respect the language of the triggering user request. It also adds corresponding test coverage to safeguard these language rules. A review comment suggests optimizing the test file by reading the skill markdown files concurrently using Promise.all instead of sequentially.
| const zhComet = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhOpen = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-open', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhDesign = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-design', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhBuild = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-build', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhVerify = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-verify', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhArchive = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-archive', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhHotfix = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-hotfix', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const zhTweak = await fs.readFile( | ||
| path.resolve('assets', 'skills-zh', 'comet-tweak', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enComet = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enOpen = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-open', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enDesign = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-design', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enBuild = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-build', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enVerify = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-verify', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enArchive = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-archive', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enHotfix = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-hotfix', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); | ||
| const enTweak = await fs.readFile( | ||
| path.resolve('assets', 'skills', 'comet-tweak', 'SKILL.md'), | ||
| 'utf-8', | ||
| ); |
There was a problem hiding this comment.
Reading 16 files sequentially using await fs.readFile blocks the event loop and can slow down test execution, especially in CI environments with slower disk I/O. We can optimize this by reading all files concurrently using Promise.all.
const [
zhComet,
zhOpen,
zhDesign,
zhBuild,
zhVerify,
zhArchive,
zhHotfix,
zhTweak,
enComet,
enOpen,
enDesign,
enBuild,
enVerify,
enArchive,
enHotfix,
enTweak,
] = await Promise.all([
fs.readFile(path.resolve('assets', 'skills-zh', 'comet', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-open', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-design', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-build', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-verify', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-archive', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-hotfix', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills-zh', 'comet-tweak', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-open', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-design', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-build', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-verify', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-archive', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-hotfix', 'SKILL.md'), 'utf-8'),
fs.readFile(path.resolve('assets', 'skills', 'comet-tweak', 'SKILL.md'), 'utf-8'),
]);|
Please fix the issues in the Gemini review first. |
|
已经解决Gemini评论中的问题。 |
Summary
Test Plan
npx vitest run test/ts/skills.test.tsgit diff --check origin/master..HEADNotes
npx vitest runcurrently fails intest/ts/init-e2e.test.tsbecause the clean-directory init fixture cannot find.claude/skillsin the temporary Lingma Superpowers staging directory, which also leaves.codex/skills/comet/SKILL.mdabsent.