import type { Register } from 'claude-code' import { resolveConfig } from './config' import { buildRules, SECTION_ID } from './rules' // 依強度與稱呼把規則段落加到系統提示最後;人格卡與檢索見 W5~W7。 export const register: Register = (on, options) => { const config = resolveConfig(options) on('prompt.compose', async ($, e, next) => { const result = await next(e) const text = buildRules(config) if (text === null) return result return { sections: [...result.sections, { id: SECTION_ID, text, scope: 'session' }] } }) }