feat: 补全 auto mode 分类器 prompt 模板,支持 FEATURE_* 环境变量注入

- 重建 yolo-classifier-prompts/ 三个缺失的 prompt 文件
- dev.ts/build.ts 扫描 FEATURE_* 环境变量注入 Bun --feature
- AUTO_MODE_ENABLED_DEFAULT 由 feature flag 决定,开 feature 即开 auto mode
- 补充 docs/safety/auto-mode.mdx prompt 模板章节

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-02 21:18:39 +08:00
parent 88b45e0e6c
commit be82b71c3e
5 changed files with 46 additions and 2 deletions

View File

@@ -1,6 +1,12 @@
#!/usr/bin/env bun
import { feature } from 'bun:bundle';
// eslint-disable-next-line custom-rules/no-top-level-side-effects
if (feature('TRANSCRIPT_CLASSIFIER')) {
// eslint-disable-next-line custom-rules/no-console, custom-rules/no-top-level-side-effects
console.log('[dev] feature TRANSCRIPT_CLASSIFIER enabled');
}
// Bugfix for corepack auto-pinning, which adds yarnpkg to peoples' package.jsons
// eslint-disable-next-line custom-rules/no-top-level-side-effects
process.env.COREPACK_ENABLE_AUTO_PIN = '0';

View File

@@ -1310,7 +1310,8 @@ export function getAutoModeUnavailableReason(): AutoModeUnavailableReason | null
*/
export type AutoModeEnabledState = 'enabled' | 'disabled' | 'opt-in'
const AUTO_MODE_ENABLED_DEFAULT: AutoModeEnabledState = 'disabled'
const AUTO_MODE_ENABLED_DEFAULT: AutoModeEnabledState =
feature('TRANSCRIPT_CLASSIFIER') ? 'enabled' : 'disabled'
function parseAutoModeEnabledState(value: unknown): AutoModeEnabledState {
if (value === 'enabled' || value === 'disabled' || value === 'opt-in') {