fix(git-master): inject watermark only when enabled instead of overriding defaults

The watermark (commit footer and co-author) was inconsistently applied because:
1. The skill tool didn't receive gitMasterConfig
2. The approach was 'default ON, inject DISABLED override' which LLMs sometimes ignored

This refactors to 'inject only when enabled' approach:
- Remove hardcoded watermark section from base templates
- Dynamically inject section 5.5 based on config values
- Default is still ON (both true when no config)
- When both disabled, no injection occurs (clean prompt)

Also fixes missing config propagation to skill tool and createBuiltinAgents.
This commit is contained in:
Nguyen Khac Trung Kien
2026-01-16 08:01:04 +07:00
parent 837176d947
commit e36385e671
9 changed files with 157 additions and 86 deletions
+2 -1
View File
@@ -104,7 +104,8 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
pluginConfig.agents,
ctx.directory,
config.model as string | undefined,
pluginConfig.categories
pluginConfig.categories,
pluginConfig.git_master
);
// Claude Code agents: Do NOT apply permission migration