codexspec 0.5.16__tar.gz → 0.5.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codexspec-0.5.16 → codexspec-0.5.18}/PKG-INFO +1 -1
- {codexspec-0.5.16 → codexspec-0.5.18}/pyproject.toml +1 -1
- {codexspec-0.5.16 → codexspec-0.5.18}/src/codexspec/__init__.py +0 -66
- {codexspec-0.5.16 → codexspec-0.5.18}/src/codexspec/commands/installer.py +1 -15
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/commit-staged.md +5 -13
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/quick.md +1 -1
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/review-plan.md +4 -4
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/review-python-code.md +4 -4
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/review-react-code.md +4 -4
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/review-tasks.md +41 -4
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/specify.md +1 -1
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/de.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/en.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/es.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/fr.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/ja.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/ko.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/pt-BR.json +0 -8
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/translations/zh-CN.json +0 -8
- codexspec-0.5.16/templates/commands/check-i18n-semantics.md +0 -138
- codexspec-0.5.16/templates/commands/translate-docs.md +0 -232
- {codexspec-0.5.16 → codexspec-0.5.18}/.gitignore +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/LICENSE +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/README.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/codexspec-icon.svg +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/codexspec-logo-dark.svg +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/codexspec-logo-light.svg +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/bash/check-i18n-completeness.sh +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/bash/check-i18n-structure.sh +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/bash/check-prerequisites.sh +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/bash/common.sh +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/bash/create-new-feature.sh +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/powershell/check-prerequisites.ps1 +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/powershell/common.ps1 +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/powershell/create-new-feature.ps1 +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/python/.claude/settings.local.json +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/python/README.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/python/claude_ctl.py +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/python/claude_monitor.py +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/scripts/python/notify_telegram.py +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/src/codexspec/commands/__init__.py +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/src/codexspec/i18n.py +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/src/codexspec/idea.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/src/codexspec/translator.py +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/analyze.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/checklist.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/clarify.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/config.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/constitution.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/generate-spec.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/implement-tasks.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/plan-to-tasks.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/pr.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/review-spec.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/spec-to-plan.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/commands/tasks-to-issues.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/checklist-template.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/constitution-template.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/plan-template-detailed.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/plan-template-simple.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/spec-template-detailed.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/spec-template-simple.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/tasks-template-detailed.md +0 -0
- {codexspec-0.5.16 → codexspec-0.5.18}/templates/docs/tasks-template-simple.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codexspec
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.18
|
|
4
4
|
Summary: CodexSpec - A Spec-Driven Development (SDD) toolkit for Claude Code
|
|
5
5
|
Project-URL: Homepage, https://github.com/Zts0hg/codexspec
|
|
6
6
|
Project-URL: Repository, https://github.com/Zts0hg/codexspec
|
|
@@ -734,8 +734,6 @@ def _create_default_commands(commands_dir: Path) -> None:
|
|
|
734
734
|
"pr": _get_pr_command(),
|
|
735
735
|
"review-python-code": _get_review_python_code_command(),
|
|
736
736
|
"review-react-code": _get_review_react_code_command(),
|
|
737
|
-
"translate-docs": _get_translate_docs_command(),
|
|
738
|
-
"check-i18n-semantics": _get_check_i18n_semantics_command(),
|
|
739
737
|
}
|
|
740
738
|
|
|
741
739
|
for name, content in commands.items():
|
|
@@ -1488,70 +1486,6 @@ This command combines static analysis tools with architectural review to provide
|
|
|
1488
1486
|
"""
|
|
1489
1487
|
|
|
1490
1488
|
|
|
1491
|
-
def _get_translate_docs_command() -> str:
|
|
1492
|
-
"""Return the translate-docs command template."""
|
|
1493
|
-
return """---
|
|
1494
|
-
description: Translate documentation to target languages using AI-assisted translation with glossary support
|
|
1495
|
-
argument-hint: "--lang <language_codes> (e.g., 'zh,ja,ko') or 'all' for all languages"
|
|
1496
|
-
handoffs:
|
|
1497
|
-
- agent: claude
|
|
1498
|
-
step: Execute document translation with glossary guidance
|
|
1499
|
-
---
|
|
1500
|
-
|
|
1501
|
-
# Document Translator
|
|
1502
|
-
|
|
1503
|
-
## User Input
|
|
1504
|
-
|
|
1505
|
-
$ARGUMENTS
|
|
1506
|
-
|
|
1507
|
-
## Instructions
|
|
1508
|
-
|
|
1509
|
-
Translate documentation files to specified target languages while maintaining technical accuracy and formatting.
|
|
1510
|
-
|
|
1511
|
-
### Steps
|
|
1512
|
-
|
|
1513
|
-
1. **Parse Arguments**: Identify target languages from --lang parameter
|
|
1514
|
-
2. **Load Glossary**: Read terminology guidelines from .codexspec/i18n/glossary.yml
|
|
1515
|
-
3. **Translate Files**: Process each documentation file
|
|
1516
|
-
4. **Maintain Formatting**: Preserve markdown structure and code blocks
|
|
1517
|
-
|
|
1518
|
-
> [!NOTE]
|
|
1519
|
-
> This command supports batch translation for multiple languages.
|
|
1520
|
-
"""
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
def _get_check_i18n_semantics_command() -> str:
|
|
1524
|
-
"""Return the check-i18n-semantics command template."""
|
|
1525
|
-
return """---
|
|
1526
|
-
description: Check semantic consistency between source and translated documentation using AI
|
|
1527
|
-
argument-hint: "[source_file] [--lang <lang>] [--strict]"
|
|
1528
|
-
allowed-tools: Read, Glob, Grep, Bash
|
|
1529
|
-
---
|
|
1530
|
-
|
|
1531
|
-
# Semantic Consistency Check
|
|
1532
|
-
|
|
1533
|
-
## User Input
|
|
1534
|
-
|
|
1535
|
-
```
|
|
1536
|
-
$ARGUMENTS
|
|
1537
|
-
```
|
|
1538
|
-
|
|
1539
|
-
## Instructions
|
|
1540
|
-
|
|
1541
|
-
Analyze translated documentation for semantic consistency with the source English content.
|
|
1542
|
-
|
|
1543
|
-
### Steps
|
|
1544
|
-
|
|
1545
|
-
1. **Parse Arguments**: Identify source file and target languages
|
|
1546
|
-
2. **Load Files**: Read source and translated versions
|
|
1547
|
-
3. **Semantic Analysis**: Compare meaning and accuracy
|
|
1548
|
-
4. **Generate Report**: List inconsistencies with severity levels
|
|
1549
|
-
|
|
1550
|
-
> [!NOTE]
|
|
1551
|
-
> Use --strict flag to fail on any semantic drift.
|
|
1552
|
-
"""
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
1489
|
def _get_default_constitution() -> str:
|
|
1556
1490
|
"""Return the default constitution content."""
|
|
1557
1491
|
return """> **SUPREME AUTHORITY**: This constitution defines the governing principles
|
|
@@ -42,7 +42,7 @@ def get_commands_metadata() -> list[CommandMetadata]:
|
|
|
42
42
|
|
|
43
43
|
Returns:
|
|
44
44
|
List of CommandMetadata dictionaries sorted by category priority:
|
|
45
|
-
core (9) -> enhanced (
|
|
45
|
+
core (9) -> enhanced (4) -> git (2) -> review (2)
|
|
46
46
|
"""
|
|
47
47
|
return [
|
|
48
48
|
# Core Commands (9)
|
|
@@ -138,20 +138,6 @@ def get_commands_metadata() -> list[CommandMetadata]:
|
|
|
138
138
|
"category": "enhanced",
|
|
139
139
|
"file_name": "tasks-to-issues.md",
|
|
140
140
|
},
|
|
141
|
-
{
|
|
142
|
-
"name": "translate-docs",
|
|
143
|
-
"display_name": "/codexspec:translate-docs",
|
|
144
|
-
"description": "翻译项目文档到指定语言",
|
|
145
|
-
"category": "enhanced",
|
|
146
|
-
"file_name": "translate-docs.md",
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"name": "check-i18n-semantics",
|
|
150
|
-
"display_name": "/codexspec:check-i18n-semantics",
|
|
151
|
-
"description": "检查多语言文档的语义一致性和质量",
|
|
152
|
-
"category": "enhanced",
|
|
153
|
-
"file_name": "check-i18n-semantics.md",
|
|
154
|
-
},
|
|
155
141
|
# Git Workflow Commands (2)
|
|
156
142
|
{
|
|
157
143
|
"name": "commit-staged",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Analyze staged git changes and generate Conventional Commits compliant commit messages
|
|
2
|
+
description: Analyze staged git changes and generate Conventional Commits compliant commit messages strictly from the staged diff
|
|
3
3
|
argument-hint: "[-p] Use -p to only preview the message without committing"
|
|
4
4
|
allowed-tools: Bash(git diff --staged:*), Bash(git diff --cached:*), Bash(git status:*), Bash(git commit:*)
|
|
5
5
|
forbidden-tools: Bash(git add:*), Bash(git reset:*), Bash(git checkout:*), Bash(git restore:*), Bash(git stash:*), Bash(git rm:*)
|
|
@@ -30,7 +30,7 @@ forbidden-tools: Bash(git add:*), Bash(git reset:*), Bash(git checkout:*), Bash(
|
|
|
30
30
|
- Display a one-time prompt:
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
-
💡
|
|
33
|
+
💡 Project language is not configured. Run `/codexspec:config` to create a configuration file.
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
- Use default values for current session:
|
|
@@ -105,6 +105,8 @@ Before analyzing changes, verify the staged state:
|
|
|
105
105
|
|
|
106
106
|
### Change Analysis
|
|
107
107
|
|
|
108
|
+
**Source of truth**: The staged diff is the *only* authoritative input for the commit message. Do NOT infer intent, motivation, or scope from prior conversation turns, earlier session messages, or any discussion unrelated to what is actually staged. If the diff alone is insufficient to write a clear and accurate message, ABORT and ask the user for clarification rather than guessing.
|
|
109
|
+
|
|
108
110
|
1. Execute `git diff --staged` to retrieve staged changes.
|
|
109
111
|
|
|
110
112
|
2. Analyze the changes and generate a commit message that strictly follows **Conventional Commits** specification:
|
|
@@ -113,7 +115,7 @@ Before analyzing changes, verify the staged state:
|
|
|
113
115
|
- If the project has a `CLAUDE.md` with custom commit conventions, follow those instead
|
|
114
116
|
- **DO NOT** include any AI attribution in the commit message
|
|
115
117
|
- Do not add `Co-Authored-By` lines or any references to AI tools/agents
|
|
116
|
-
- The commit message should focus solely on describing the changes
|
|
118
|
+
- The commit message should focus solely on describing the changes present in the staged diff
|
|
117
119
|
|
|
118
120
|
3. **If preview mode (`-p`)**: Display the generated commit message and stop.
|
|
119
121
|
|
|
@@ -128,16 +130,6 @@ If `git commit` fails due to a pre-commit hook modifying files:
|
|
|
128
130
|
3. Retry the commit with the same message
|
|
129
131
|
4. If it still fails or the situation is unclear, ABORT and inform the user
|
|
130
132
|
|
|
131
|
-
## Session Context Awareness
|
|
132
|
-
|
|
133
|
-
When analyzing changes, consider the current session context:
|
|
134
|
-
|
|
135
|
-
- What the user has been working on in this session
|
|
136
|
-
- The purpose and goals discussed in the conversation
|
|
137
|
-
- Any related specifications, plans, or tasks mentioned
|
|
138
|
-
|
|
139
|
-
This context helps generate more meaningful commit messages that reflect the "why" behind the changes, not just the "what".
|
|
140
|
-
|
|
141
133
|
## Important Notes
|
|
142
134
|
|
|
143
135
|
- In execute mode (default), execute `git commit` directly after generating the message
|
|
@@ -19,7 +19,7 @@ argument-hint: "Describe your requirement"
|
|
|
19
19
|
- Display a one-time prompt:
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
💡
|
|
22
|
+
💡 Project language is not configured. Run `/codexspec:config` to create a configuration file.
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
- Use default values for current session:
|
|
@@ -140,7 +140,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
140
140
|
- Tight coupling between modules: -8 each
|
|
141
141
|
- Missing separation of concerns: -10
|
|
142
142
|
|
|
143
|
-
#### Phase Planning (
|
|
143
|
+
#### Phase Planning (20%)
|
|
144
144
|
|
|
145
145
|
| Score Range | Criteria |
|
|
146
146
|
|-------------|----------|
|
|
@@ -156,7 +156,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
156
156
|
- Overly large phase scope: -5 each
|
|
157
157
|
- Missing phase dependencies: -5
|
|
158
158
|
|
|
159
|
-
#### Constitution Alignment (
|
|
159
|
+
#### Constitution Alignment (10%)
|
|
160
160
|
|
|
161
161
|
| Score Range | Criteria |
|
|
162
162
|
|-------------|----------|
|
|
@@ -304,8 +304,8 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
304
304
|
| Spec Alignment | 30% | X/100 | [Which rubric range applies] | [List specific deductions, e.g., "REQ-003 not addressed: -15"] | X |
|
|
305
305
|
| Tech Stack | 15% | X/100 | [Which rubric range applies] | [e.g., "No version for DB: -5"] | X |
|
|
306
306
|
| Architecture Quality | 25% | X/100 | [Which rubric range applies] | [e.g., "Missing dependency graph: -10"] | X |
|
|
307
|
-
| Phase Planning |
|
|
308
|
-
| Constitution Alignment |
|
|
307
|
+
| Phase Planning | 20% | X/100 | [Which rubric range applies] | [e.g., "Phase 2 scope too large: -5"] | X |
|
|
308
|
+
| Constitution Alignment | 10% | X/100 | [Which rubric range applies] | [e.g., "All principles addressed"] | X |
|
|
309
309
|
| **Total** | **100%** | | | | **X/100** |
|
|
310
310
|
|
|
311
311
|
> **Suggestion Cap**: Suggestions deducted X/5 points (cap: 5 points max)
|
|
@@ -129,7 +129,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
129
129
|
- Missing `raise ... from err` context: -3 each
|
|
130
130
|
- mypy error: -5 each
|
|
131
131
|
|
|
132
|
-
#### Engineering Robustness (
|
|
132
|
+
#### Engineering Robustness (30%)
|
|
133
133
|
|
|
134
134
|
| Score Range | Criteria |
|
|
135
135
|
|-------------|----------|
|
|
@@ -146,7 +146,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
146
146
|
- Incorrect log level usage: -3 each
|
|
147
147
|
- ruff violation: -3 each
|
|
148
148
|
|
|
149
|
-
#### Constitution Alignment (
|
|
149
|
+
#### Constitution Alignment (10%)
|
|
150
150
|
|
|
151
151
|
| Score Range | Criteria |
|
|
152
152
|
|-------------|----------|
|
|
@@ -267,8 +267,8 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
267
267
|
|----------|--------|-------|-------------|-------------------|----------|
|
|
268
268
|
| Pythonic & KISS | 30% | X/100 | [Which rubric range applies] | [List specific deductions, e.g., "Unnecessary class in utils.py: -8"] | X |
|
|
269
269
|
| Type Safety | 30% | X/100 | [Which rubric range applies] | [e.g., "2 functions missing annotations: -10"] | X |
|
|
270
|
-
| Engineering Robustness |
|
|
271
|
-
| Constitution Alignment |
|
|
270
|
+
| Engineering Robustness | 30% | X/100 | [Which rubric range applies] | [e.g., "File opened without context manager: -8"] | X |
|
|
271
|
+
| Constitution Alignment | 10% | X/100 | [Which rubric range applies] | [e.g., "All principles followed"] | X |
|
|
272
272
|
| **Total** | **100%** | | | | **X/100** |
|
|
273
273
|
|
|
274
274
|
> **Suggestion Cap**: LOW suggestions deducted X/5 points (cap: 5 points max)
|
|
@@ -152,7 +152,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
152
152
|
- Missing error handling for async operation: -8 each
|
|
153
153
|
- Race condition in async operation: -10 each
|
|
154
154
|
|
|
155
|
-
#### Performance & Robustness (
|
|
155
|
+
#### Performance & Robustness (15%)
|
|
156
156
|
|
|
157
157
|
| Score Range | Criteria |
|
|
158
158
|
|-------------|----------|
|
|
@@ -168,7 +168,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
168
168
|
- Missing optional chaining for nullable access: -3 each
|
|
169
169
|
- Missing React.memo for frequently re-rendered component: -5 each
|
|
170
170
|
|
|
171
|
-
#### Constitution Alignment (
|
|
171
|
+
#### Constitution Alignment (10%)
|
|
172
172
|
|
|
173
173
|
| Score Range | Criteria |
|
|
174
174
|
|-------------|----------|
|
|
@@ -291,8 +291,8 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
291
291
|
| Component Atomicity & SRP | 25% | X/100 | [Which rubric range applies] | [List specific deductions, e.g., "UserPanel.tsx 350 lines: -5"] | X |
|
|
292
292
|
| Hooks Compliance | 25% | X/100 | [Which rubric range applies] | [e.g., "useEffect missing dep in Form.tsx: -8"] | X |
|
|
293
293
|
| State Management | 25% | X/100 | [Which rubric range applies] | [e.g., "Missing error state in useFetch: -8"] | X |
|
|
294
|
-
| Performance & Robustness |
|
|
295
|
-
| Constitution Alignment |
|
|
294
|
+
| Performance & Robustness | 15% | X/100 | [Which rubric range applies] | [e.g., "Unmemoized filter in List.tsx: -8"] | X |
|
|
295
|
+
| Constitution Alignment | 10% | X/100 | [Which rubric range applies] | [e.g., "All principles followed"] | X |
|
|
296
296
|
| **Total** | **100%** | | | | **X/100** |
|
|
297
297
|
|
|
298
298
|
> **Suggestion Cap**: LOW suggestions deducted X/5 points (cap: 5 points max)
|
|
@@ -85,11 +85,17 @@ Review the task breakdown for quality and implementation readiness. This command
|
|
|
85
85
|
- [ ] File paths are consistent with plan
|
|
86
86
|
- [ ] File naming conventions are followed (per constitution)
|
|
87
87
|
|
|
88
|
+
9. **Constitution Alignment Check**: Verify task breakdown respects project principles:
|
|
89
|
+
- [ ] TDD enforcement aligns with constitution testing standards
|
|
90
|
+
- [ ] Quality gates and checkpoints reflect constitution principles
|
|
91
|
+
- [ ] Naming conventions are followed (per constitution)
|
|
92
|
+
- [ ] Workflow guidelines from constitution are considered
|
|
93
|
+
|
|
88
94
|
### Scoring Rubrics
|
|
89
95
|
|
|
90
96
|
Before scoring, apply these rubrics to ensure consistent, transparent evaluation.
|
|
91
97
|
|
|
92
|
-
#### Plan Coverage (
|
|
98
|
+
#### Plan Coverage (25%)
|
|
93
99
|
|
|
94
100
|
| Score Range | Criteria |
|
|
95
101
|
|-------------|----------|
|
|
@@ -136,7 +142,7 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
136
142
|
- Incorrect task ordering: -8 each
|
|
137
143
|
- Foundation task not placed first: -10
|
|
138
144
|
|
|
139
|
-
#### Task Granularity (
|
|
145
|
+
#### Task Granularity (10%)
|
|
140
146
|
|
|
141
147
|
| Score Range | Criteria |
|
|
142
148
|
|-------------|----------|
|
|
@@ -167,6 +173,22 @@ Before scoring, apply these rubrics to ensure consistent, transparent evaluation
|
|
|
167
173
|
- Task without file path specification: -5 each
|
|
168
174
|
- File path not following project convention: -3 each
|
|
169
175
|
|
|
176
|
+
#### Constitution Alignment (10%)
|
|
177
|
+
|
|
178
|
+
| Score Range | Criteria |
|
|
179
|
+
|-------------|----------|
|
|
180
|
+
| 90-100 | Fully aligned with all constitution principles; TDD/quality standards addressed; workflow guidelines followed |
|
|
181
|
+
| 70-89 | Mostly aligned; minor gaps in addressing specific principles |
|
|
182
|
+
| 50-69 | Partial alignment; several principles not addressed |
|
|
183
|
+
| Below 50 | Significant violations or disregard of constitution |
|
|
184
|
+
|
|
185
|
+
> **Note**: If no constitution exists, this category defaults to 100 (full marks) and its weight is redistributed proportionally to other categories.
|
|
186
|
+
|
|
187
|
+
**Typical Deductions**:
|
|
188
|
+
|
|
189
|
+
- Constitution principle not addressed: -10 per principle
|
|
190
|
+
- Direct violation of a constitution principle (e.g., test tasks omitted despite TDD requirement): -20 per violation
|
|
191
|
+
|
|
170
192
|
#### Suggestion Score Cap Rule
|
|
171
193
|
|
|
172
194
|
**IMPORTANT**: Suggestions (Nice to Have) items may deduct a **maximum of 5 points** from the total score. After resolving all Critical Issues and Warnings, the score should be **≥ 95**.
|
|
@@ -307,6 +329,19 @@ Valid Dependency Chain:
|
|
|
307
329
|
- [ ] **[FILE-001]**: Task 2.1 file path doesn't match project naming convention
|
|
308
330
|
- [ ] **[FILE-002]**: Task 3.1 missing file path specification
|
|
309
331
|
|
|
332
|
+
## Constitution Alignment
|
|
333
|
+
|
|
334
|
+
> [!NOTE]
|
|
335
|
+
> If no constitution exists, state "No project constitution found - using general best practices."
|
|
336
|
+
|
|
337
|
+
| Principle | Alignment | Notes |
|
|
338
|
+
|-----------|-----------|-------|
|
|
339
|
+
| [Principle 1] | ✅/⚠️/❌ | [How task breakdown aligns or conflicts] |
|
|
340
|
+
| [Principle 2] | ✅/⚠️/❌ | [How task breakdown aligns or conflicts] |
|
|
341
|
+
|
|
342
|
+
### Constitution Issues
|
|
343
|
+
- [ ] **[CONST-001]**: [Principle violation or gap, e.g., "TDD principle not enforced for Module C"]
|
|
344
|
+
|
|
310
345
|
## Detailed Findings
|
|
311
346
|
|
|
312
347
|
### Critical Issues (Must Fix)
|
|
@@ -328,11 +363,12 @@ Valid Dependency Chain:
|
|
|
328
363
|
|
|
329
364
|
| Category | Weight | Score | Rubric Basis | Deduction Details | Weighted |
|
|
330
365
|
|----------|--------|-------|-------------|-------------------|----------|
|
|
331
|
-
| Plan Coverage |
|
|
366
|
+
| Plan Coverage | 25% | X/100 | [Which rubric range applies] | [List specific deductions, e.g., "Module C missing task: -10"] | X |
|
|
332
367
|
| TDD Compliance | 25% | X/100 | [Which rubric range applies] | [e.g., "Service X test after impl: -8"] | X |
|
|
333
368
|
| Dependency & Ordering | 20% | X/100 | [Which rubric range applies] | [e.g., "Missing dependency Task 2.3→1.2: -5"] | X |
|
|
334
|
-
| Task Granularity |
|
|
369
|
+
| Task Granularity | 10% | X/100 | [Which rubric range applies] | [e.g., "Task 2.5 involves 3 files: -8"] | X |
|
|
335
370
|
| Parallelization & Files | 10% | X/100 | [Which rubric range applies] | [e.g., "Task 2.1 false [P] marker: -8"] | X |
|
|
371
|
+
| Constitution Alignment | 10% | X/100 | [Which rubric range applies] | [e.g., "All principles addressed"] | X |
|
|
336
372
|
| **Total** | **100%** | | | | **X/100** |
|
|
337
373
|
|
|
338
374
|
> **Suggestion Cap**: Suggestions deducted X/5 points (cap: 5 points max)
|
|
@@ -426,6 +462,7 @@ Before completing the review, verify:
|
|
|
426
462
|
- [ ] Dependency graph is validated with no cycles (Dependency & Ordering)
|
|
427
463
|
- [ ] Task granularity is appropriate (Task Granularity)
|
|
428
464
|
- [ ] Parallelization markers and file paths are correct (Parallelization & Files)
|
|
465
|
+
- [ ] Constitution principles are addressed (Constitution Alignment)
|
|
429
466
|
- [ ] Issues have clear, actionable suggestions
|
|
430
467
|
- [ ] Score reflects actual quality accurately (validated via Score Validation Checklist)
|
|
431
468
|
|
|
@@ -19,7 +19,7 @@ argument-hint: "Describe your initial idea or requirement"
|
|
|
19
19
|
- Display a one-time prompt:
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
💡
|
|
22
|
+
💡 Project language is not configured. Run `/codexspec:config` to create a configuration file.
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
- Use default values for current session:
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "Strukturierte Pull Request (GitHub) oder Merge Request (GitLab) Beschreibung basierend auf git diff und optionaler spec.md-Integration generieren"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "Semantische Konsistenz und Qualität mehrsprachiger Dokumentation prüfen",
|
|
139
|
-
"argument-hint": "[quelldatei] [--lang <sprache>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "Projektdokumentation in die angegebene Sprache übersetzen",
|
|
143
|
-
"argument-hint": "--lang <sprachcodes> (z.B. 'zh,ja,ko') oder 'all' für alle Sprachen"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "Python-Code auf PEP 8-Konformität, Typsicherheit, Engineering-Robustheit und Verfassungsübereinstimmung überprüfen",
|
|
147
139
|
"argument-hint": "Pfad zur Python-Datei oder zum Verzeichnis zur Überprüfung\n\nBeispiele:\n- `src/codexspec/` - Gesamtes Paket überprüfen\n- `src/codexspec/__init__.py` - Einzelne Datei überprüfen\n- `src/ tests/` - Mehrere Pfade überprüfen"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "Generate structured Pull Request (GitHub) or Merge Request (GitLab) description based on git diff and optional spec.md integration"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "Check semantic consistency and quality of multilingual documentation",
|
|
139
|
-
"argument-hint": "[source_file] [--lang <language>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "Translate project documentation to specified language",
|
|
143
|
-
"argument-hint": "--lang <language_codes> (e.g. 'zh,ja,ko') or 'all' for all languages"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "Review Python code for PEP 8 compliance, type safety, engineering robustness, and constitution alignment",
|
|
147
139
|
"argument-hint": "Path to Python file or directory to review\n\nExamples:\n- `src/codexspec/` - Review entire package\n- `src/codexspec/__init__.py` - Review single file\n- `src/ tests/` - Review multiple paths"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "Generar descripción estructurada de Pull Request (GitHub) o Merge Request (GitLab) basada en git diff e integración opcional de spec.md"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "Verificar consistencia semántica y calidad de documentación multilingüe",
|
|
139
|
-
"argument-hint": "[archivo_fuente] [--lang <idioma>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "Traducir documentación del proyecto al idioma especificado",
|
|
143
|
-
"argument-hint": "--lang <códigos_idioma> (ej: 'zh,ja,ko') o 'all' para todos los idiomas"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "Revisar código Python por conformidad PEP 8, seguridad de tipos, robustez de ingeniería y alineación con la constitución",
|
|
147
139
|
"argument-hint": "Ruta al archivo o directorio Python a revisar\n\nEjemplos:\n- `src/codexspec/` - Revisar paquete completo\n- `src/codexspec/__init__.py` - Revisar archivo único\n- `src/ tests/` - Revisar múltiples rutas"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "Générer une description structurée de Pull Request (GitHub) ou Merge Request (GitLab) basée sur git diff et intégration optionnelle de spec.md"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "Vérifier la cohérence sémantique et la qualité de la documentation multilingue",
|
|
139
|
-
"argument-hint": "[fichier_source] [--lang <langue>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "Traduire la documentation du projet dans la langue spécifiée",
|
|
143
|
-
"argument-hint": "--lang <codes_langue> (ex: 'zh,ja,ko') ou 'all' pour toutes les langues"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "Réviser le code Python pour la conformité PEP 8, la sécurité des types, la robustesse d'ingénierie et l'alignement avec la constitution",
|
|
147
139
|
"argument-hint": "Chemin vers le fichier ou répertoire Python à réviser\n\nExemples:\n- `src/codexspec/` - Réviser le paquet complet\n- `src/codexspec/__init__.py` - Réviser un seul fichier\n- `src/ tests/` - Réviser plusieurs chemins"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "git diffとオプションのspec.md統合に基づいて構造化されたPull Request (GitHub) またはMerge Request (GitLab) 説明を生成"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "多言語ドキュメントの意味的一貫性と品質をチェック",
|
|
139
|
-
"argument-hint": "[ソースファイル] [--lang <言語>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "プロジェクトドキュメントを指定言語に翻訳",
|
|
143
|
-
"argument-hint": "--lang <言語コード> (例: 'zh,ja,ko') または 'all' ですべての言語"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "PythonコードのPEP 8準拠、型安全性、エンジニアリングの堅牢性、憲法整合性をレビュー",
|
|
147
139
|
"argument-hint": "レビューするPythonファイルまたはディレクトリへのパス\n\n例:\n- `src/codexspec/` - パッケージ全体をレビュー\n- `src/codexspec/__init__.py` - 単一ファイルをレビュー\n- `src/ tests/` - 複数パスをレビュー"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "git diff와 선택적 spec.md 통합을 기반으로 구조화된 Pull Request (GitHub) 또는 Merge Request (GitLab) 설명 생성"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "다국어 문서의 의미적 일관성과 품질 검사",
|
|
139
|
-
"argument-hint": "[소스_파일] [--lang <언어>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "프로젝트 문서를 지정된 언어로 번역",
|
|
143
|
-
"argument-hint": "--lang <언어_코드> (예: 'zh,ja,ko') 또는 'all'로 모든 언어"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "Python 코드의 PEP 8 준수, 타입 안전성, 엔지니어링 견고성 및 헌법 정렬 검토",
|
|
147
139
|
"argument-hint": "검토할 Python 파일 또는 디렉토리 경로\n\n예시:\n- `src/codexspec/` - 전체 패키지 검토\n- `src/codexspec/__init__.py` - 단일 파일 검토\n- `src/ tests/` - 여러 경로 검토"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "Gerar descrição estruturada de Pull Request (GitHub) ou Merge Request (GitLab) baseada em git diff e integração opcional de spec.md"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "Verificar consistência semântica e qualidade de documentação multilíngue",
|
|
139
|
-
"argument-hint": "[arquivo_origem] [--lang <idioma>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "Traduzir documentação do projeto para o idioma especificado",
|
|
143
|
-
"argument-hint": "--lang <códigos_idioma> (ex: 'zh,ja,ko') ou 'all' para todos os idiomas"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "Revisar código Python por conformidade PEP 8, segurança de tipos, robustez de engenharia e alinhamento com a constituição",
|
|
147
139
|
"argument-hint": "Caminho para arquivo ou diretório Python a revisar\n\nExemplos:\n- `src/codexspec/` - Revisar pacote completo\n- `src/codexspec/__init__.py` - Revisar arquivo único\n- `src/ tests/` - Revisar múltiplos caminhos"
|
|
@@ -134,14 +134,6 @@
|
|
|
134
134
|
"pr": {
|
|
135
135
|
"description": "基于 git diff 和可选的 spec.md 集成生成结构化的 Pull Request (GitHub) 或 Merge Request (GitLab) 描述"
|
|
136
136
|
},
|
|
137
|
-
"check-i18n-semantics": {
|
|
138
|
-
"description": "检查多语言文档的语义一致性和质量",
|
|
139
|
-
"argument-hint": "[源文件] [--lang <语言>] [--strict]"
|
|
140
|
-
},
|
|
141
|
-
"translate-docs": {
|
|
142
|
-
"description": "翻译项目文档到指定语言",
|
|
143
|
-
"argument-hint": "--lang <语言代码> (如 'zh,ja,ko') 或 'all' 翻译所有语言"
|
|
144
|
-
},
|
|
145
137
|
"review-python-code": {
|
|
146
138
|
"description": "审查 Python 代码的 PEP 8 合规性、类型安全、工程健壮性和宪法一致性",
|
|
147
139
|
"argument-hint": "要审查的 Python 文件或目录路径\n\n示例:\n- `src/codexspec/` - 审查整个包\n- `src/codexspec/__init__.py` - 审查单个文件\n- `src/ tests/` - 审查多个路径"
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Check semantic consistency between source and translated documentation using AI
|
|
3
|
-
argument-hint: "[source_file] [--lang <lang>] [--strict]"
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Read
|
|
6
|
-
- Glob
|
|
7
|
-
- Grep
|
|
8
|
-
- Bash
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Semantic Consistency Check
|
|
12
|
-
|
|
13
|
-
## Language Preference
|
|
14
|
-
|
|
15
|
-
**IMPORTANT**: Before proceeding, read the project's language configuration from `.codexspec/config.yml`.
|
|
16
|
-
|
|
17
|
-
- If `language.output` is set to a language other than "en", respond and generate all content in that language
|
|
18
|
-
- If not configured or set to "en", use English as default
|
|
19
|
-
- Technical terms (e.g., API, JWT, OAuth) may remain in English when appropriate
|
|
20
|
-
- All user-facing messages, questions, and generated documents should use the configured language
|
|
21
|
-
|
|
22
|
-
## User Input
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
$ARGUMENTS
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Instructions
|
|
29
|
-
|
|
30
|
-
You are a **Translation Quality Reviewer**. Your task is to analyze translated documentation for semantic consistency with the source English content.
|
|
31
|
-
|
|
32
|
-
### Steps
|
|
33
|
-
|
|
34
|
-
1. **Parse Arguments**
|
|
35
|
-
- `source_file`: Optional specific file to check (e.g., `user-guide/getting-started.md`)
|
|
36
|
-
- `--lang <lang>`: Target language code (e.g., `zh`, `ja`, `ko`). If not specified, check all languages
|
|
37
|
-
- `--strict`: Enable strict mode (fail on any semantic drift)
|
|
38
|
-
|
|
39
|
-
2. **Load Configuration**
|
|
40
|
-
- Read `.codexspec/config.yml` for project settings
|
|
41
|
-
- Read `.codexspec/i18n/glossary.yml` for terminology guidelines
|
|
42
|
-
|
|
43
|
-
3. **Identify Files to Check**
|
|
44
|
-
- If `source_file` specified: Check only that file across target languages
|
|
45
|
-
- If no file specified: Check all markdown files in `docs/<lang>/`
|
|
46
|
-
|
|
47
|
-
4. **Perform Semantic Analysis**
|
|
48
|
-
|
|
49
|
-
For each source-target file pair:
|
|
50
|
-
|
|
51
|
-
a. **Read both files**
|
|
52
|
-
- Source: `docs/en/<path>`
|
|
53
|
-
- Target: `docs/<lang>/<path>`
|
|
54
|
-
|
|
55
|
-
b. **Compare semantic elements**:
|
|
56
|
-
- **Heading hierarchy**: Same structure and meaning
|
|
57
|
-
- **Key concepts**: All important terms present
|
|
58
|
-
- **Code examples**: Identical functionality
|
|
59
|
-
- **Links**: Valid and correctly translated
|
|
60
|
-
- **Warnings/Notes**: Same severity and meaning
|
|
61
|
-
|
|
62
|
-
c. **Identify issues**:
|
|
63
|
-
- **Missing content**: Sections or paragraphs omitted
|
|
64
|
-
- **Added content**: Extra information not in source
|
|
65
|
-
- **Semantic drift**: Meaning changed in translation
|
|
66
|
-
- **Inconsistent terminology**: Not following glossary
|
|
67
|
-
|
|
68
|
-
5. **Generate Report**
|
|
69
|
-
|
|
70
|
-
Create a structured report with:
|
|
71
|
-
|
|
72
|
-
```markdown
|
|
73
|
-
# Semantic Consistency Report
|
|
74
|
-
|
|
75
|
-
## Summary
|
|
76
|
-
- **Files Checked**: X
|
|
77
|
-
- **Issues Found**: Y
|
|
78
|
-
- **Severity**: High/Medium/Low
|
|
79
|
-
|
|
80
|
-
## Details
|
|
81
|
-
|
|
82
|
-
### File: <path>
|
|
83
|
-
|
|
84
|
-
#### Source (en)
|
|
85
|
-
[Brief summary of source content]
|
|
86
|
-
|
|
87
|
-
#### Target (<lang>)
|
|
88
|
-
[Brief summary of translated content]
|
|
89
|
-
|
|
90
|
-
#### Issues
|
|
91
|
-
1. **[Severity]** <issue description>
|
|
92
|
-
- Source: "<original text>"
|
|
93
|
-
- Translation: "<translated text>"
|
|
94
|
-
- Problem: <what's wrong>
|
|
95
|
-
- Suggestion: <how to fix>
|
|
96
|
-
|
|
97
|
-
## Recommendations
|
|
98
|
-
[List of recommended fixes]
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
6. **Exit Codes**
|
|
102
|
-
- `0`: No issues found (or only minor issues in non-strict mode)
|
|
103
|
-
- `1`: Issues found requiring attention
|
|
104
|
-
- `2`: Error during execution
|
|
105
|
-
|
|
106
|
-
### Quality Criteria
|
|
107
|
-
|
|
108
|
-
A translation passes semantic check if:
|
|
109
|
-
|
|
110
|
-
- [ ] All sections from source are present
|
|
111
|
-
- [ ] No significant content added or removed
|
|
112
|
-
- [ ] Technical terms match glossary
|
|
113
|
-
- [ ] Code examples are functionally equivalent
|
|
114
|
-
- [ ] Links work and point to correct destinations
|
|
115
|
-
- [ ] Warnings/notes maintain same severity
|
|
116
|
-
|
|
117
|
-
### Example Usage
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
# Check all files in Chinese translation
|
|
121
|
-
/codexspec:check-i18n-semantics --lang zh
|
|
122
|
-
|
|
123
|
-
# Check specific file in Japanese
|
|
124
|
-
/codexspec:check-i18n-semantics user-guide/installation.md --lang ja
|
|
125
|
-
|
|
126
|
-
# Strict mode - fail on any drift
|
|
127
|
-
/codexspec:check-i18n-semantics --lang ko --strict
|
|
128
|
-
|
|
129
|
-
# Check all languages for a specific file
|
|
130
|
-
/codexspec:check-i18n-semantics getting-started.md
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Notes
|
|
134
|
-
|
|
135
|
-
- This command uses AI analysis and may not catch all semantic issues
|
|
136
|
-
- For critical documentation, consider human review in addition to this check
|
|
137
|
-
- The glossary helps ensure consistent terminology usage
|
|
138
|
-
- Strict mode is recommended for production releases
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Translate documentation to target languages using AI-assisted translation with glossary support
|
|
3
|
-
argument-hint: "--lang <language_codes> (e.g., 'zh,ja,ko') or 'all' for all languages"
|
|
4
|
-
handoffs:
|
|
5
|
-
- agent: claude
|
|
6
|
-
step: Execute document translation with glossary guidance
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Document Translator
|
|
10
|
-
|
|
11
|
-
## Language Preference
|
|
12
|
-
|
|
13
|
-
**IMPORTANT**: Before proceeding, read the project's language configuration from `.codexspec/config.yml`.
|
|
14
|
-
|
|
15
|
-
- If `language.output` is set to a language other than "en", respond and generate all content in that language
|
|
16
|
-
- If not configured or set to "en", use English as default
|
|
17
|
-
- Technical terms (e.g., API, JWT, OAuth) may remain in English when appropriate
|
|
18
|
-
- All user-facing messages, questions, and generated documents should use the configured language
|
|
19
|
-
|
|
20
|
-
## User Input
|
|
21
|
-
|
|
22
|
-
$ARGUMENTS
|
|
23
|
-
|
|
24
|
-
## Role
|
|
25
|
-
|
|
26
|
-
You are a **Technical Document Translator** with expertise in:
|
|
27
|
-
|
|
28
|
-
- Multi-language technical documentation
|
|
29
|
-
- AI-assisted translation workflows
|
|
30
|
-
- Terminology consistency and glossary management
|
|
31
|
-
- Markdown formatting preservation
|
|
32
|
-
- Cultural localization for developer audiences
|
|
33
|
-
|
|
34
|
-
Your responsibility is to translate English documentation to target languages while maintaining technical accuracy, formatting consistency, and terminology standards.
|
|
35
|
-
|
|
36
|
-
## When to Use This Command
|
|
37
|
-
|
|
38
|
-
**Use `/codexspec:translate-docs` when:**
|
|
39
|
-
|
|
40
|
-
- You need to translate documentation to one or more target languages
|
|
41
|
-
- You want AI-assisted translation with terminology consistency
|
|
42
|
-
- You need to generate initial translations for a new language
|
|
43
|
-
- You want to update existing translations after source changes
|
|
44
|
-
|
|
45
|
-
**Do NOT use this command for:**
|
|
46
|
-
|
|
47
|
-
- Manual translation editing → Edit files directly
|
|
48
|
-
- Translation quality review → Use `/codexspec:check-i18n-semantics`
|
|
49
|
-
- Adding new languages to the project → Update mkdocs.yml first
|
|
50
|
-
|
|
51
|
-
## Instructions
|
|
52
|
-
|
|
53
|
-
### 1. Parse Arguments
|
|
54
|
-
|
|
55
|
-
Parse the user input to determine:
|
|
56
|
-
|
|
57
|
-
- **Target languages**: Extract from `--lang` or `-l` flag
|
|
58
|
-
- If "all" or not specified, translate to all supported languages
|
|
59
|
-
- Otherwise, parse comma-separated language codes (e.g., "zh,ja,ko")
|
|
60
|
-
- **Source directory**: Extract from `--source` or `-s` flag (default: `docs/en/`)
|
|
61
|
-
- **Incremental mode**: Check for `--incremental` or `-i` flag
|
|
62
|
-
- **Dry run**: Check for `--dry-run` or `-d` flag
|
|
63
|
-
|
|
64
|
-
Supported language codes:
|
|
65
|
-
|
|
66
|
-
| Code | Language | Target Directory |
|
|
67
|
-
|------|----------|-----------------|
|
|
68
|
-
| zh | Chinese (Simplified) | docs/zh/ |
|
|
69
|
-
| ja | Japanese | docs/ja/ |
|
|
70
|
-
| ko | Korean | docs/ko/ |
|
|
71
|
-
| es | Spanish | docs/es/ |
|
|
72
|
-
| fr | French | docs/fr/ |
|
|
73
|
-
| de | German | docs/de/ |
|
|
74
|
-
| pt-BR | Portuguese (Brazil) | docs/pt-BR/ |
|
|
75
|
-
|
|
76
|
-
### 2. Load Glossary
|
|
77
|
-
|
|
78
|
-
Read `docs/i18n/glossary.yml` and extract:
|
|
79
|
-
|
|
80
|
-
- **keep_english**: Terms that should NOT be translated
|
|
81
|
-
- **translations**: Pre-defined translations for specific terms
|
|
82
|
-
- **rules**: Patterns for intelligent term handling
|
|
83
|
-
|
|
84
|
-
If glossary file doesn't exist, proceed with general translation (no terminology constraints).
|
|
85
|
-
|
|
86
|
-
### 3. Scan Source Files
|
|
87
|
-
|
|
88
|
-
Scan the source directory for all Markdown files:
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
docs/en/
|
|
92
|
-
├── index.md
|
|
93
|
-
├── getting-started/
|
|
94
|
-
│ ├── installation.md
|
|
95
|
-
│ └── quick-start.md
|
|
96
|
-
├── user-guide/
|
|
97
|
-
│ ├── workflow.md
|
|
98
|
-
│ ├── commands.md
|
|
99
|
-
│ └── i18n.md
|
|
100
|
-
└── ...
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
If `--incremental` flag is set, only translate files where:
|
|
104
|
-
|
|
105
|
-
- Target file doesn't exist, OR
|
|
106
|
-
- Source file is newer than target file
|
|
107
|
-
|
|
108
|
-
### 4. Execute Translation
|
|
109
|
-
|
|
110
|
-
For each source file and target language:
|
|
111
|
-
|
|
112
|
-
1. **Read source content**
|
|
113
|
-
2. **Apply glossary rules**:
|
|
114
|
-
- Identify terms in `keep_english` list
|
|
115
|
-
- Apply pre-defined `translations` where available
|
|
116
|
-
- Apply `rules` patterns (regex matching)
|
|
117
|
-
3. **Preserve formatting**:
|
|
118
|
-
- Keep YAML frontmatter unchanged
|
|
119
|
-
- Preserve code blocks (```...```) without translation
|
|
120
|
-
- Keep inline code (`...`) unchanged
|
|
121
|
-
- Preserve URLs and links
|
|
122
|
-
- Maintain heading structure and levels
|
|
123
|
-
4. **Translate content**:
|
|
124
|
-
- Translate prose text to target language
|
|
125
|
-
- Maintain technical accuracy
|
|
126
|
-
- Use appropriate formality level for technical documentation
|
|
127
|
-
5. **Write output** (unless `--dry-run`):
|
|
128
|
-
- Create target directory if needed
|
|
129
|
-
- Write translated content to target path
|
|
130
|
-
|
|
131
|
-
### 5. Output Format
|
|
132
|
-
|
|
133
|
-
Display progress during translation:
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
🌐 CodexSpec 文档翻译 / Document Translation
|
|
137
|
-
|
|
138
|
-
📁 源目录 / Source: docs/en/
|
|
139
|
-
🎯 目标语言 / Target: zh, ja
|
|
140
|
-
📄 文件数量 / Files: 12
|
|
141
|
-
|
|
142
|
-
[1/24] 翻译 index.md → zh ... ✅ 完成 (2.3s)
|
|
143
|
-
[2/24] 翻译 index.md → ja ... ✅ 完成 (2.5s)
|
|
144
|
-
[3/24] 翻译 getting-started/installation.md → zh ... ✅ 完成 (1.8s)
|
|
145
|
-
...
|
|
146
|
-
|
|
147
|
-
✅ 翻译完成 / Translation Complete
|
|
148
|
-
📊 统计 / Stats: 24 个文件,0 个错误 / 24 files, 0 errors
|
|
149
|
-
⏱️ 总耗时 / Total time: 45.2 秒
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 6. Error Handling
|
|
153
|
-
|
|
154
|
-
If a translation fails:
|
|
155
|
-
|
|
156
|
-
- Log the error with file path and language
|
|
157
|
-
- Continue with remaining translations
|
|
158
|
-
- Report all errors at the end
|
|
159
|
-
|
|
160
|
-
## Translation Guidelines
|
|
161
|
-
|
|
162
|
-
### Terms to Keep in English
|
|
163
|
-
|
|
164
|
-
Based on glossary.yml `keep_english` list, these should NOT be translated:
|
|
165
|
-
|
|
166
|
-
- Tool names: uv, pip, pytest, ruff, MkDocs
|
|
167
|
-
- File formats: JSON, YAML, TOML, Markdown
|
|
168
|
-
- Technical terms: CLI, API, SDK, TDD, CI/CD
|
|
169
|
-
- Protocols: HTTP, HTTPS, REST, OAuth, JWT
|
|
170
|
-
- Platforms: GitHub, PyPI
|
|
171
|
-
- File names: spec.md, plan.md, tasks.md, CLAUDE.md
|
|
172
|
-
|
|
173
|
-
### Content to NOT Translate
|
|
174
|
-
|
|
175
|
-
1. **Code blocks**: Everything between ``` and ```
|
|
176
|
-
2. **Inline code**: Text within backticks `...`
|
|
177
|
-
3. **URLs**: All http/https links
|
|
178
|
-
4. **File paths**: Paths like `/path/to/file`
|
|
179
|
-
5. **Command examples**: Shell commands and options
|
|
180
|
-
6. **Environment variables**: Variables like `$HOME`, `%USERPROFILE%`
|
|
181
|
-
|
|
182
|
-
### Formatting Preservation
|
|
183
|
-
|
|
184
|
-
1. **YAML frontmatter**: Keep unchanged
|
|
185
|
-
2. **Markdown headings**: Translate text, preserve level (# ## ###)
|
|
186
|
-
3. **Lists**: Translate items, preserve structure
|
|
187
|
-
4. **Tables**: Translate content, preserve format
|
|
188
|
-
5. **Admonitions**: Translate content, keep type (note, warning, tip)
|
|
189
|
-
6. **Links**: Translate link text, preserve URL
|
|
190
|
-
|
|
191
|
-
## Quality Standards
|
|
192
|
-
|
|
193
|
-
Each translation should:
|
|
194
|
-
|
|
195
|
-
1. **Be technically accurate**: Correct terminology and concepts
|
|
196
|
-
2. **Read naturally**: Appropriate phrasing for target language
|
|
197
|
-
3. **Maintain consistency**: Same term translated same way throughout
|
|
198
|
-
4. **Preserve structure**: Same heading hierarchy and formatting
|
|
199
|
-
5. **Respect glossary**: Follow terminology definitions
|
|
200
|
-
|
|
201
|
-
## Example Usage
|
|
202
|
-
|
|
203
|
-
```bash
|
|
204
|
-
# Translate to all supported languages
|
|
205
|
-
/codexspec:translate-docs
|
|
206
|
-
|
|
207
|
-
# Translate to specific languages
|
|
208
|
-
/codexspec:translate-docs --lang zh,ja
|
|
209
|
-
|
|
210
|
-
# Incremental translation (only changed files)
|
|
211
|
-
/codexspec:translate-docs --lang zh --incremental
|
|
212
|
-
|
|
213
|
-
# Preview without writing files
|
|
214
|
-
/codexspec:translate-docs --lang ko --dry-run
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## Exit Codes
|
|
218
|
-
|
|
219
|
-
- `0`: All translations completed successfully
|
|
220
|
-
- `1`: Some translations failed (partial success)
|
|
221
|
-
- `2`: All translations failed (complete failure)
|
|
222
|
-
- `3`: Configuration error (missing source, invalid language)
|
|
223
|
-
|
|
224
|
-
## Available Follow-up Commands
|
|
225
|
-
|
|
226
|
-
After translation:
|
|
227
|
-
|
|
228
|
-
- `/codexspec:check-i18n-semantics` - Verify translation quality
|
|
229
|
-
- `uv run mkdocs build` - Test build with all languages
|
|
230
|
-
|
|
231
|
-
> [!NOTE]
|
|
232
|
-
> This command requires the source documentation to exist in `docs/en/`. Make sure Phase 1 (Foundation) tasks are completed before running translation.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|