Skip to content

Commit 6688c11

Browse files
RiskeyLclaude
andauthored
docs: sync App Toolkit with dify#35442 follow-up settings (#757)
* docs: sync App Toolkit page with follow-up settings PR and UI labels * fix: correct CJK format linter false positives * chore: broaden post-writing audit scope to whole documents * docs: address Copilot review on PR #754 Restore the Tab titles rule in formatting-zh.md, which had been trimmed to a stub. Drop the First-Mention Rule entry from the terminology-check skill's Output Format so the report sections match the Checks to Perform sections (the corresponding check was removed earlier). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 27bf0c6 commit 6688c11

9 files changed

Lines changed: 94 additions & 106 deletions

File tree

.claude/skills/dify-docs-format-check-cjk/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: >
1212

1313
## Purpose
1414

15-
Verify changed Chinese (`zh/`) and Japanese (`ja/`) documentation against every rule in:
15+
Verify Chinese (`zh/`) and Japanese (`ja/`) documentation against every rule in:
1616

1717
- `writing-guides/formatting-guide.md` — general rules
1818
- `tools/translate/formatting-zh.md` — Chinese-specific rules
@@ -22,13 +22,13 @@ Mechanical rules are enforced by the linter script (`check-format-cjk.py`); judg
2222

2323
## Before Starting
2424

25-
Detect changed documentation files by combining:
25+
Audit the entire file, not just the diff. Default to files currently under review, detected via:
2626

2727
- `git diff --name-only`
2828
- `git diff --cached --name-only`
2929
- Untracked files from `git status --porcelain` (lines starting with `??`)
3030

31-
Filter for `.mdx` and `.md` files under `zh/` or `ja/`. If no changed files are detected, ask the user which files to check.
31+
Filter for `.mdx` and `.md` files under `zh/` or `ja/`. If no files are detected, ask the user which files to check.
3232

3333
Because translations are typically produced as a zh/ja pair from the same English source, it is natural to audit both languages in a single session.
3434

.claude/skills/dify-docs-format-check-cjk/check-format-cjk.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def _strip_inline_code(line: str) -> str:
5757

5858
def _strip_code_and_urls(line: str) -> str:
5959
s = INLINE_CODE_RE.sub('', line)
60+
# collapse markdown image syntax ![alt](url) -> alt first so the leading
61+
# `!` doesn't survive as prose punctuation adjacent to the alt text
62+
s = re.sub(r'!\[([^\]\n]+)\]\([^)\n]+\)', r'\1', s)
6063
# collapse markdown link syntax [text](url) -> text so the bracket and
6164
# paren characters don't count as prose punctuation
6265
s = re.sub(r'\[([^\]\n]+)\]\([^)\n]+\)', r'\1', s)
@@ -500,17 +503,28 @@ def check_cjk_bold_spacing(lines: list[str]) -> list[Violation]:
500503
vs: list[Violation] = []
501504
in_fence = False
502505
# Bold adjacent to CJK without space: X**bold** or **bold**X where X is
503-
# CJK and no space between.
504-
pat_after = re.compile(rf'{CJK}\*\*[^*\n]+?\*\*')
505-
pat_before = re.compile(rf'\*\*[^*\n]+?\*\*{CJK}')
506+
# CJK and no space between. Match each complete **bold** span first, then
507+
# inspect its outer neighbors so the closing `**` of one bold is never
508+
# mistaken for the opening `**` of a later bold on the same line.
509+
bold_pat = re.compile(r'\*\*[^*\n]+?\*\*')
510+
cjk_re = re.compile(CJK)
506511
for i, line in enumerate(lines, 1):
507512
if FENCE_RE.match(line):
508513
in_fence = not in_fence
509514
continue
510515
if in_fence:
511516
continue
512517
s = _strip_inline_code(line)
513-
if pat_after.search(s) or pat_before.search(s):
518+
flagged = False
519+
for m in bold_pat.finditer(s):
520+
start, end = m.span()
521+
if start > 0 and cjk_re.match(s[start - 1]):
522+
flagged = True
523+
break
524+
if end < len(s) and cjk_re.match(s[end]):
525+
flagged = True
526+
break
527+
if flagged:
514528
vs.append(Violation(
515529
i, 'CJK-bold-no-space',
516530
'Bold adjacent to CJK without space on that side.'))

.claude/skills/dify-docs-format-check-en/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ description: >
1111

1212
## Purpose
1313

14-
Verify changed English documentation against every rule in `writing-guides/formatting-guide.md`. Mechanical rules are enforced by a linter script (`check-format-en.py`); judgment-call rules are checked by reading the file.
14+
Verify English documentation against every rule in `writing-guides/formatting-guide.md`. Mechanical rules are enforced by a linter script (`check-format-en.py`); judgment-call rules are checked by reading the file.
1515

1616
## Before Starting
1717

18-
Detect changed documentation files by combining:
18+
Audit the entire file, not just the diff. Default to files currently under review, detected via:
1919

2020
- `git diff --name-only` (unstaged changes in tracked files)
2121
- `git diff --cached --name-only` (staged changes)
2222
- Untracked files from `git status --porcelain` (lines starting with `??`)
2323

24-
Filter for `.mdx` and `.md` files under `en/`. If no changed files are detected, ask the user which files to check.
24+
Filter for `.mdx` and `.md` files under `en/`. If no files are detected, ask the user which files to check.
2525

2626
## Checks
2727

Lines changed: 37 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
22
name: dify-docs-terminology-check
33
description: >
4-
Check terminology consistency in changed documentation against the glossary
5-
and codebase UI labels. Use after finalizing a draft, or when the user says
6-
"check terminology", "check terms", "verify glossary", or "terminology audit".
4+
Audit terminology consistency across documentation against the codebase UI
5+
labels and the glossary. Covers full files, not just diffs; excludes env var
6+
docs. Use after finalizing a draft, or when the user says "check
7+
terminology", "check terms", "verify glossary", or "terminology audit".
78
---
89

910
# Terminology Consistency Check
1011

1112
## Purpose
1213

13-
Verify that changed documentation uses terms consistently with the glossary
14-
(`writing-guides/glossary.md`) and that bolded UI labels match the Dify
15-
codebase i18n files.
14+
Verify that documentation uses terms consistently with the codebase i18n
15+
(source of truth for UI labels) and the glossary (source of truth for general
16+
terms). Covers the whole file, not just the diff.
1617

1718
## Before Starting
1819

@@ -27,69 +28,53 @@ codebase i18n files.
2728
git fetch origin && git checkout <branch> && git pull origin <branch>
2829
```
2930

30-
2. Detect changed documentation files by combining:
31-
- `git diff --name-only` (unstaged changes in tracked files)
32-
- `git diff --cached --name-only` (staged changes)
33-
- Untracked files from `git status --porcelain` (lines starting with `??`)
31+
2. Determine the audit scope. Default to the whole file(s) currently under
32+
review (not just the diff), plus their zh/ja siblings when they exist.
33+
Expand to a directory or the full docs tree if the user specifies.
34+
Always exclude:
35+
- `en/self-host/configuration/environments.mdx`
36+
- `zh/self-host/configuration/environments.mdx`
37+
- `ja/self-host/configuration/environments.mdx`
3438

35-
Filter for `.mdx` and `.md` files under doc content directories (`en/`, `zh/`,
36-
`ja/`, `writing-guides/`). If no changed files are detected, ask the user
37-
which files to check.
39+
Environment variable names are not UI labels and do not belong in the
40+
terminology check.
3841

3942
## Checks to Perform
4043

4144
### 1. General Term Consistency
4245

4346
Read `writing-guides/glossary.md` — General Terms section.
4447

45-
For each changed file, verify:
48+
For each file in scope, verify:
4649

47-
- **English docs**: Terms match the English column. Flag any deviations
48-
(e.g., "sandbox runtime" instead of "sandboxed runtime").
49-
- **Chinese docs**: Terms match the Chinese column. Flag mismatches
50-
(e.g., 沙箱 instead of 沙盒).
50+
- **English docs**: Terms match the English column. Flag any deviations.
51+
- **Chinese docs**: Terms match the Chinese column. Flag mismatches.
5152
- **Japanese docs**: Terms match the Japanese column. Flag mismatches.
5253

5354
Skip zh/ja checks if the corresponding translation files don't exist locally
5455
(they may not have been generated yet for new documents).
5556

5657
### 2. UI Label Consistency
5758

58-
Read `writing-guides/glossary.md` — UI Labels section.
59+
For each file in scope, collect:
5960

60-
For each changed file, find all **bolded terms** (text wrapped in `**...**`).
61-
Cross-reference against the UI Labels tables:
61+
- Every **bolded term** (text wrapped in `**...**`) that refers to a UI element.
62+
- Every section heading (`##`, `###`) that names a product feature.
6263

63-
- The bolded text in English docs must match the English (UI) column.
64-
- The bolded text in Chinese docs must match the Chinese (UI) column.
65-
- The bolded text in Japanese docs must match the Japanese (UI) column.
64+
Use judgment to skip bolds that are pure emphasis (e.g., `**semantically**`).
6665

67-
Not all bolded terms are UI labels — use judgment to distinguish UI references
68-
from emphasis. UI labels typically appear in instructional context ("click
69-
**Publish**", "enable **Agent Mode**").
66+
Verify every collected term against the codebase i18n as the source of truth:
67+
`web/i18n/en-US/`, `web/i18n/zh-Hans/`, `web/i18n/ja-JP/`. Read files with
68+
`git show <branch>:<path>` so you don't need to switch branches. The
69+
glossary (`writing-guides/glossary.md`) is a convenience lookup; the
70+
codebase wins when they disagree.
7071

71-
### 3. Codebase Verification (UI Labels Only)
72+
### 3. Glossary Updates
7273

73-
For any UI label flagged as potentially inconsistent, or for new UI labels
74-
not yet in the glossary, verify against the codebase:
75-
76-
1. Use `git show <branch>:<path>` to read i18n files from the user-specified
77-
branch without switching branches. For example:
78-
`git show feat/support-agent-sandbox:web/i18n/en-US/workflow.json`
79-
2. Search the relevant i18n JSON for the key.
80-
3. Report the actual codebase values.
81-
4. If the glossary is outdated compared to the codebase, flag it.
82-
83-
### 4. First-Mention Rule (zh/ja Only)
84-
85-
For Chinese and Japanese docs, check that general terms follow the
86-
first-mention parenthetical rule (defined in the glossary):
87-
88-
- **Local term is primary**: First mention should be "本地术语(English term)"
89-
- **English term is primary**: First mention should be "English Term(本地术语)"
90-
- **Same across all languages**: No parenthetical needed
91-
92-
Scope is per document — each page resets.
74+
When the audit surfaces a UI label that is new, renamed, or inconsistent
75+
with the codebase, propose an update to `writing-guides/glossary.md` in the
76+
report. Note that `tools/translate/derive-termbase.py` should be run
77+
afterward so `tools/translate/termbase_i18n.md` stays in sync.
9378

9479
## Output Format
9580

@@ -104,14 +89,9 @@ Scope is per document — each page resets.
10489
- ⚠️ Line {n}: "{found}" should be "{expected}" per glossary
10590
10691
**UI Labels**
107-
- ✅ All bolded UI labels match glossary
108-
OR
109-
- ⚠️ Line {n}: **{label}** — glossary says "{expected}", codebase says "{actual}"
110-
111-
**First-Mention Rule** (zh/ja only)
112-
- ✅ All terms properly introduced
92+
- ✅ All UI labels (bolded terms and feature section headings) match codebase
11393
OR
114-
- ⚠️ Line {n}: "{term}"missing first-mention parenthetical
94+
- ⚠️ Line {n}: **{label}**codebase says "{expected}"
11595
11696
**Glossary Gaps**
11797
- Terms used in docs but missing from glossary: {list}
@@ -122,5 +102,5 @@ Scope is per document — each page resets.
122102

123103
- Do NOT modify any files. This is a read-only audit.
124104
- Report findings to the user for review.
125-
- If the glossary and codebase disagree, report both values and let the user
126-
decide which to update.
105+
- Codebase i18n is the source of truth for UI labels. When the glossary
106+
disagrees, update the glossary.

en/use-dify/build/additional-features.mdx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Dify apps come with optional features you can enable to improve the end-user exp
2222

2323
Set an opening message that greets users at the start of each conversation, with optional suggested questions to guide them toward what the app does well.
2424

25-
You can insert variables into the opening message and suggested questions to personalize the experience.
25+
You can insert variables into the opening message and suggested questions to personalize the experience.
2626

2727
- In the opening message, type `{` or `/` to insert variables from the picker.
2828

@@ -43,18 +43,16 @@ You can insert variables into the opening message and suggested questions to per
4343

4444
## Follow-up
4545

46-
When enabled, the LLM automatically suggests 3 follow-up questions after each response, helping users continue the conversation. This feature is a simple toggle—no additional configuration is needed.
46+
When enabled, follow-up questions are generated after each response to help users continue the conversation.
4747

48-
<Info>
49-
Follow-up questions are generated by a separate LLM call using your workspace's system reasoning model (set in **Settings** > **Model Provider** > **Default Model Settings**), not the model configured in your app.
50-
</Info>
48+
Click **Settings** to pick the model that generates the questions, or write a custom prompt (up to 1,000 characters) to adjust the number, wording, or length of the questions.
5149

5250
## Text to Speech
5351

5452
Convert AI responses to audio. You can configure the language and voice to match your app's audience, and enable **Auto Play** to stream audio automatically as the AI responds.
5553

5654
<Info>
57-
**Text to Speech** uses your workspace's text-to-speech model (set in **Settings** > **Model Provider** > **Default Model Settings**).
55+
**Text to Speech** uses your workspace's text-to-speech model (set in **Settings** > **Model Provider** > **Default Model Settings**).
5856

5957
The feature only appears in the **Features** panel when a default TTS model is configured.
6058
</Info>
@@ -64,7 +62,7 @@ The feature only appears in the **Features** panel when a default TTS model is c
6462
Enable voice input for the chat interface. When enabled, your end users can dictate messages instead of typing by clicking the microphone button.
6563

6664
<Info>
67-
**Speech to Text** uses your workspace's speech-to-text model (set in **Settings** > **Model Provider** > **Default Model Settings**).
65+
**Speech to Text** uses your workspace's speech-to-text model (set in **Settings** > **Model Provider** > **Default Model Settings**).
6866

6967
The feature only appears in the **Features** panel when a default STT model is configured.
7068
</Info>
@@ -112,7 +110,7 @@ You can configure the score threshold and the embedding model used for semantic
112110

113111
To create and manage your annotations:
114112

115-
- Convert existing conversations into annotations directly from **Debug & Preview** or **Logs** by clicking the **Add Annotation** icon on any LLM response.
113+
- Convert existing conversations into annotations directly from **Debug & Preview** or **Logs** by clicking the **Add annotation** icon on any LLM response.
116114

117115
Once a message is annotated, the icon changes to **Edit**, so you can modify the annotation in place.
118116

0 commit comments

Comments
 (0)