Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Unify approval example to pre-start and add drift test (#1770)

Maximilian Roos7efd4f7d9a74
diff --git a/docs/content/faq.md b/docs/content/faq.md
index 11f028fa1..48f26c584 100644
--- a/docs/content/faq.md
+++ b/docs/content/faq.md
@@ -176,11 +176,11 @@ User hooks don't require approval (you defined them). Commands from project hook
{% terminal() %}
<span class="y">▲ <b>repo</b> needs approval to execute <b>3</b> commands:</span>
-<span class="d">○</span> post-create <b>install</b>:
+<span class="d">○</span> pre-start <b>install</b>:
<span style='background:var(--bright-white,#fff)'> </span> <span class="d"><span class="b">npm</span> ci</span>
-<span class="d">○</span> post-create <b>build</b>:
+<span class="d">○</span> pre-start <b>build</b>:
<span style='background:var(--bright-white,#fff)'> </span> <span class="d"><span class="b">cargo</span> build <span class="c">--release</span></span>
-<span class="d">○</span> post-create <b>env</b>:
+<span class="d">○</span> pre-start <b>env</b>:
<span style='background:var(--bright-white,#fff)'> </span> <span class="d"><span class="b">echo</span> <span class="g">'PORT={{ branch | hash_port }}'</span> <span class="c">></span> .env.local</span>
<span class="c">❯</span> Allow and remember? <b>[y/N]</b>
diff --git a/skills/worktrunk/reference/faq.md b/skills/worktrunk/reference/faq.md
index fd547001d..7367c982a 100644
--- a/skills/worktrunk/reference/faq.md
+++ b/skills/worktrunk/reference/faq.md
@@ -168,11 +168,11 @@ User hooks don't require approval (you defined them). Commands from project hook
<span class="y">▲ <b>repo</b> needs approval to execute <b>3</b> commands:</span>
-<span class="d">○</span> post-create <b>install</b>:
+<span class="d">○</span> pre-start <b>install</b>:
<span style='background:var(--bright-white,#fff)'> </span> <span class="d"><span class="b">npm</span> ci</span>
-<span class="d">○</span> post-create <b>build</b>:
+<span class="d">○</span> pre-start <b>build</b>:
<span style='background:var(--bright-white,#fff)'> </span> <span class="d"><span class="b">cargo</span> build <span class="c">--release</span></span>
-<span class="d">○</span> post-create <b>env</b>:
+<span class="d">○</span> pre-start <b>env</b>:
<span style='background:var(--bright-white,#fff)'> </span> <span class="d"><span class="b">echo</span> <span class="g">'PORT={{ branch | hash_port }}'</span> <span class="c">></span> .env.local</span>
<span class="c">❯</span> Allow and remember? <b>[y/N]</b>
diff --git a/tests/integration_tests/readme_sync.rs b/tests/integration_tests/readme_sync.rs
index d95c615f1..0aaea4542 100644
--- a/tests/integration_tests/readme_sync.rs
+++ b/tests/integration_tests/readme_sync.rs
@@ -1947,3 +1947,24 @@ fn test_command_pages_and_skill_files_are_in_sync() {
);
}
}
+
+/// Verify that post_process_for_html() transforms the approval prompt code block
+/// into a styled terminal shortcode. If the source text in cli/mod.rs changes
+/// without updating the replacement in help.rs, the .replace() silently stops
+/// matching and the web docs fall back to a plain code block.
+#[test]
+fn test_approval_prompt_styled_in_hook_page() {
+ let project_root = Path::new(env!("CARGO_MANIFEST_DIR"));
+ let output = wt_command()
+ .args(["hook", "--help-page"])
+ .current_dir(project_root)
+ .output()
+ .expect("Failed to run wt hook --help-page");
+
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ assert!(
+ stdout.contains(r#"class="y""#),
+ "hook --help-page should contain styled approval prompt (class=\"y\" for yellow ▲). \
+ If cli/mod.rs approval example changed, update the replacement in help.rs post_process_for_html()."
+ );
+}