Skip to content

feat: add shared writing guides, documentation skills, and repo infrastructure#720

Open
RiskeyL wants to merge 1 commit intomainfrom
feat/docs-skills-integration
Open

feat: add shared writing guides, documentation skills, and repo infrastructure#720
RiskeyL wants to merge 1 commit intomainfrom
feat/docs-skills-integration

Conversation

@RiskeyL
Copy link
Copy Markdown
Contributor

@RiskeyL RiskeyL commented Mar 27, 2026

Summary

  • Add writing-guides/ with shared style guide, formatting guide, and trilingual glossary (with UI Labels section)
  • Add 5 Claude Code skills in .claude/skills/: dify-docs-guides, dify-docs-api-reference, dify-docs-env-vars, dify-docs-release-sync,
    dify-docs-reader-test
  • Add termbase derivation script (tools/translate/derive-termbase.py) and pre-commit hook (.githooks/) to keep glossary and termbase in sync
  • Add language-specific formatting guides for Chinese and Japanese (tools/translate/formatting-zh.md, formatting-ja.md)
  • Add translation system overview (tools/translate/translation-system-overview.md)
  • Redesign CLAUDE.md as a concise task-routing hub
  • Add README.md with contributor guide

Context

Previously, three documentation skills (dify-docs-writer, dify-openapi-standards, dify-env-var-docs) lived in a personal directory and maintained their own terminology, formatting rules, and style guidelines independently. This caused duplication and made team collaboration difficult.

This PR establishes a unified system:

  • Shared writing guides (writing-guides/) serve as the single source of truth for style, formatting, and terminology
  • Skills are thin, task-specific layers that load the shared guides and add domain-specific overrides
  • Glossary is the single source of truth for terminology; the translation pipeline's termbase is auto-derived from it
  • Reader personas are defined per documentation path so the AI adjusts tone and assumed knowledge appropriately

Copilot AI review requested due to automatic review settings March 27, 2026 11:39
@mintlify
Copy link
Copy Markdown
Contributor

mintlify bot commented Mar 27, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
dify-core-product 🟢 Ready View Preview Mar 27, 2026, 11:42 AM

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 27, 2026
@dosubot dosubot bot added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR sets up shared documentation authoring infrastructure for the Dify docs repo—centralizing style/formatting/terminology guidance, codifying Claude “skills” for common doc tasks, and adding tooling to keep the translation termbase derived from the glossary.

Changes:

  • Add writing-guides/ (style guide, formatting guide, glossary, and an index that routes tasks to the right skill).
  • Add multiple .claude/skills/ for guides, API reference, env vars, release sync, and reader verification.
  • Add translation tooling docs + automation helpers (termbase derivation script, pre-commit hook, language-specific formatting guides, translation system overview).

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
writing-guides/style-guide.md Defines voice/tone and writing patterns for docs.
writing-guides/index.md Routes contributors to the correct skill and reference guides.
writing-guides/glossary.md Establishes standardized terminology + UI labels (source of truth).
writing-guides/formatting-guide.md Defines MDX/Mintlify formatting standards and component usage.
tools/translate/translation-system-overview.md Documents the end-to-end translation pipeline architecture and workflows.
tools/translate/termbase_i18n.md Expands/refactors the termbase content used by the translation engine.
tools/translate/formatting-zh.md Adds Chinese-specific formatting rules for translations.
tools/translate/formatting-ja.md Adds Japanese-specific formatting rules for translations.
tools/translate/derive-termbase.py Adds generator to derive termbase_i18n.md from the rich glossary.
README.md Adds contributor guide and repo usage conventions.
CLAUDE.md Redesigns instructions into a concise task-routing hub.
.mintignore Excludes internal guides/config from Mintlify build output.
.githooks/pre-commit Auto-regenerates and stages the derived termbase when glossary changes.
.claude/skills/dify-docs-release-sync/SKILL.md Adds a workflow for milestone-based pre-release doc synchronization.
.claude/skills/dify-docs-reader-test/SKILL.md Adds a “reader persona” verification skill for post-writing review.
.claude/skills/dify-docs-guides/SKILL.md Adds the primary user-guide writing/review skill referencing shared guides.
.claude/skills/dify-docs-env-vars/verify-env-docs.py Adds a script to verify env-var docs against .env.example.
.claude/skills/dify-docs-env-vars/deep-dive.md Adds a deep-dive reference for env var behavior and code trace notes.
.claude/skills/dify-docs-env-vars/SKILL.md Adds env-var documentation process, conventions, and verification steps.
.claude/skills/dify-docs-api-reference/references/common-mistakes.md Adds a quick-reference list of common OpenAPI spec issues.
.claude/skills/dify-docs-api-reference/references/codebase-paths.md Adds mappings between docs/specs and Dify codebase locations.
.claude/skills/dify-docs-api-reference/references/audit-checklist.md Adds a per-endpoint audit checklist for spec/code fidelity.
.claude/skills/dify-docs-api-reference/SKILL.md Adds the main OpenAPI editing/auditing skill with strict fidelity rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


### SECRET_KEY

**Default:** `sk-xxxx...xxxx` (pre-filled in .env.example; must be replaced for production)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc includes an sk-...-prefixed placeholder for SECRET_KEY (sk-xxxx...xxxx). The skill’s own style rules say to avoid sk-* patterns because they can trigger GitHub push protection / secret scanning. Consider rewriting the default example to avoid the sk- prefix entirely (while still explaining that it’s pre-filled and must be replaced).

Suggested change
**Default:** `sk-xxxx...xxxx` (pre-filled in .env.example; must be replaced for production)
**Default:** `secret-key-example-xxxx` (pre-filled in .env.example; must be replaced for production)

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +33
def parse_glossary(glossary_text: str) -> list[tuple[str, list[tuple[str, list[list[str]]]]]]:
"""Parse glossary into top-level sections of (h2_heading, [(h3_heading, rows)]).

Each row is [English, Chinese, Japanese] with Notes/i18n Key stripped.
Capitalization markers (`*`) are stripped from English terms.
"""
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse_glossary() docstring says capitalization markers (*) are stripped from English terms, but the implementation never removes them. If the glossary starts using * markers, the generated termbase will include the markers and break terminology matching. Either implement the stripping on the English cell or update the docstring/comments to match actual behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +16
### Quick Start

1. Fork and clone the repository.
2. Create a branch, make your changes, and open a pull request against `main`.
3. Your PR will be reviewed by a maintainer. Once approved, translations are generated automatically.

Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo adds a custom .githooks/pre-commit, but the README never tells contributors to enable it (e.g., via git config core.hooksPath .githooks). As-is, most clones won’t run the hook, so termbase_i18n.md can drift from writing-guides/glossary.md despite the new sync mechanism.

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +116
PLACEHOLDER_PATTERNS = [
"your-", "your_", "YOUR-", "YOUR_",
"xxx", "difyai", "dify-sandbox",
"sk-9f73s", "lYkiYYT6", "QaHbTe77",
"testaccount", "testpassword", "difypassword",
"gp-test.", "gp-ab",
"instance-name",
"WVF5YTha",
]
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PLACEHOLDER_PATTERNS includes a literal sk-... prefix (and other key-like fragments). Given the repo’s own guidance about push-protection / secret scanning for sk-*, hardcoding these strings can trigger false positives and is easy to forget to update. Prefer detecting placeholders by pattern (e.g., any value starting with sk-) rather than embedding example key prefixes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants