@bovinphang/frontend-craft 2.8.0 → 2.9.0
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.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +378 -339
- package/CHANGELOG.zh-CN.md +377 -338
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -320
- package/README.openclaw.zh-CN.md +359 -320
- package/README.zh-CN.md +545 -493
- package/agents/fec-code-reviewer.md +24 -3
- package/agents/fec-debugger.md +1 -1
- package/agents/fec-doc-updater.md +1 -1
- package/agents/fec-e2e-runner.md +1 -1
- package/agents/fec-figma-implementer.md +1 -1
- package/agents/fec-performance-optimizer.md +1 -1
- package/agents/fec-refactor-cleaner.md +4 -1
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +17 -1
- package/agents/fec-test-planner.md +1 -1
- package/agents/fec-typescript-reviewer.md +24 -8
- package/agents/fec-ui-checker.md +11 -11
- package/commands/fec-debug.md +1 -1
- package/commands/fec-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +40 -10
- package/commands/fec-scaffold.md +1 -1
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +6 -2
- package/dist/bin/frontend-craft.js +190 -38
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -140
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -131
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -140
- package/docs/zh-CN/project-structure.md +148 -128
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-code-reviewer.md +22 -3
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +3 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +16 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +23 -7
- package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +40 -9
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +4 -0
- package/localized/zh-CN/skills/eval_queries.json +244 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +20 -1
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +11 -1
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +31 -1
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +10 -3
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
- package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +3 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +16 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +10 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +3 -0
- package/localized/zh-CN/skills/metadata.json +408 -50
- package/localized/zh-CN/skills/relations.json +271 -3
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +1 -0
- package/openclaw.plugin.json +2 -3
- package/package.json +27 -17
- package/skills/eval_queries.json +244 -0
- package/skills/fec-code-review/SKILL.md +20 -1
- package/skills/fec-code-review/references/report-template.md +11 -1
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/skills/fec-data-fetching/SKILL.md +1 -1
- package/skills/fec-image-generation/SKILL.md +31 -1
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +10 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
- package/skills/fec-legacy-web-standard/SKILL.md +1 -1
- package/skills/fec-refactor-clean/SKILL.md +3 -0
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- package/skills/fec-security-review/SKILL.md +16 -0
- package/skills/fec-security-review/references/report-template.md +10 -0
- package/skills/fec-tdd-workflow/SKILL.md +5 -1
- package/skills/metadata.json +434 -71
- package/skills/relations.json +264 -0
- package/templates/shared/rules/fec-agent-workflow.md +1 -0
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# Smell-to-Refactoring Map
|
|
2
|
+
|
|
3
|
+
Candidate techniques are advisory. Select by observed cause, preconditions, risk, and the smallest safe transformation; never reduce diagnosis to keyword lookup.
|
|
4
|
+
|
|
5
|
+
## SMELL-MYSTERIOUS-NAME — Mysterious Name
|
|
6
|
+
|
|
7
|
+
**Primary/Supporting Candidates**
|
|
8
|
+
- `RF-CHANGE-FUNCTION-DECLARATION`
|
|
9
|
+
- `RF-RENAME-VARIABLE`
|
|
10
|
+
- `RF-RENAME-FIELD`
|
|
11
|
+
|
|
12
|
+
**Selection Note**
|
|
13
|
+
- Confirm the diagnosed cause of Mysterious Name and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
14
|
+
|
|
15
|
+
## SMELL-DUPLICATED-CODE — Duplicated Code
|
|
16
|
+
|
|
17
|
+
**Primary/Supporting Candidates**
|
|
18
|
+
- `RF-EXTRACT-FUNCTION`
|
|
19
|
+
- `RF-SLIDE-STATEMENTS`
|
|
20
|
+
- `RF-PULL-UP-METHOD`
|
|
21
|
+
|
|
22
|
+
**Selection Note**
|
|
23
|
+
- Confirm the diagnosed cause of Duplicated Code and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
24
|
+
|
|
25
|
+
## SMELL-LONG-FUNCTION — Long Function
|
|
26
|
+
|
|
27
|
+
**Primary/Supporting Candidates**
|
|
28
|
+
- `RF-EXTRACT-FUNCTION`
|
|
29
|
+
- `RF-REPLACE-TEMP-WITH-QUERY`
|
|
30
|
+
- `RF-INTRODUCE-PARAMETER-OBJECT`
|
|
31
|
+
- `RF-PRESERVE-WHOLE-OBJECT`
|
|
32
|
+
- `RF-REPLACE-FUNCTION-WITH-COMMAND`
|
|
33
|
+
- `RF-DECOMPOSE-CONDITIONAL`
|
|
34
|
+
- `RF-REPLACE-CONDITIONAL-WITH-POLYMORPHISM`
|
|
35
|
+
- `RF-SPLIT-LOOP`
|
|
36
|
+
|
|
37
|
+
**Selection Note**
|
|
38
|
+
- Confirm the diagnosed cause of Long Function and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
39
|
+
|
|
40
|
+
## SMELL-LONG-PARAMETER-LIST — Long Parameter List
|
|
41
|
+
|
|
42
|
+
**Primary/Supporting Candidates**
|
|
43
|
+
- `RF-REPLACE-PARAMETER-WITH-QUERY`
|
|
44
|
+
- `RF-PRESERVE-WHOLE-OBJECT`
|
|
45
|
+
- `RF-INTRODUCE-PARAMETER-OBJECT`
|
|
46
|
+
- `RF-REMOVE-FLAG-ARGUMENT`
|
|
47
|
+
- `RF-COMBINE-FUNCTIONS-INTO-CLASS`
|
|
48
|
+
|
|
49
|
+
**Selection Note**
|
|
50
|
+
- Confirm the diagnosed cause of Long Parameter List and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
51
|
+
|
|
52
|
+
## SMELL-GLOBAL-DATA — Global Data
|
|
53
|
+
|
|
54
|
+
**Primary/Supporting Candidates**
|
|
55
|
+
- `RF-ENCAPSULATE-VARIABLE`
|
|
56
|
+
|
|
57
|
+
**Selection Note**
|
|
58
|
+
- Confirm the diagnosed cause of Global Data and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
59
|
+
|
|
60
|
+
## SMELL-MUTABLE-DATA — Mutable Data
|
|
61
|
+
|
|
62
|
+
**Primary/Supporting Candidates**
|
|
63
|
+
- `RF-ENCAPSULATE-VARIABLE`
|
|
64
|
+
- `RF-SPLIT-VARIABLE`
|
|
65
|
+
- `RF-SLIDE-STATEMENTS`
|
|
66
|
+
- `RF-EXTRACT-FUNCTION`
|
|
67
|
+
- `RF-SEPARATE-QUERY-FROM-MODIFIER`
|
|
68
|
+
- `RF-REMOVE-SETTING-METHOD`
|
|
69
|
+
- `RF-REPLACE-DERIVED-VARIABLE-WITH-QUERY`
|
|
70
|
+
- `RF-COMBINE-FUNCTIONS-INTO-CLASS`
|
|
71
|
+
- `RF-COMBINE-FUNCTIONS-INTO-TRANSFORM`
|
|
72
|
+
- `RF-CHANGE-REFERENCE-TO-VALUE`
|
|
73
|
+
|
|
74
|
+
**Selection Note**
|
|
75
|
+
- Confirm the diagnosed cause of Mutable Data and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
76
|
+
|
|
77
|
+
## SMELL-DIVERGENT-CHANGE — Divergent Change
|
|
78
|
+
|
|
79
|
+
**Primary/Supporting Candidates**
|
|
80
|
+
- `RF-SPLIT-PHASE`
|
|
81
|
+
- `RF-MOVE-FUNCTION`
|
|
82
|
+
- `RF-EXTRACT-FUNCTION`
|
|
83
|
+
- `RF-EXTRACT-CLASS`
|
|
84
|
+
|
|
85
|
+
**Selection Note**
|
|
86
|
+
- Confirm the diagnosed cause of Divergent Change and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
87
|
+
|
|
88
|
+
## SMELL-SHOTGUN-SURGERY — Shotgun Surgery
|
|
89
|
+
|
|
90
|
+
**Primary/Supporting Candidates**
|
|
91
|
+
- `RF-MOVE-FUNCTION`
|
|
92
|
+
- `RF-MOVE-FIELD`
|
|
93
|
+
- `RF-COMBINE-FUNCTIONS-INTO-CLASS`
|
|
94
|
+
- `RF-COMBINE-FUNCTIONS-INTO-TRANSFORM`
|
|
95
|
+
- `RF-SPLIT-PHASE`
|
|
96
|
+
- `RF-INLINE-FUNCTION`
|
|
97
|
+
- `RF-INLINE-CLASS`
|
|
98
|
+
|
|
99
|
+
**Selection Note**
|
|
100
|
+
- Confirm the diagnosed cause of Shotgun Surgery and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
101
|
+
|
|
102
|
+
## SMELL-FEATURE-ENVY — Feature Envy
|
|
103
|
+
|
|
104
|
+
**Primary/Supporting Candidates**
|
|
105
|
+
- `RF-MOVE-FUNCTION`
|
|
106
|
+
- `RF-EXTRACT-FUNCTION`
|
|
107
|
+
|
|
108
|
+
**Selection Note**
|
|
109
|
+
- Confirm the diagnosed cause of Feature Envy and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
110
|
+
|
|
111
|
+
## SMELL-DATA-CLUMPS — Data Clumps
|
|
112
|
+
|
|
113
|
+
**Primary/Supporting Candidates**
|
|
114
|
+
- `RF-EXTRACT-CLASS`
|
|
115
|
+
- `RF-INTRODUCE-PARAMETER-OBJECT`
|
|
116
|
+
- `RF-PRESERVE-WHOLE-OBJECT`
|
|
117
|
+
|
|
118
|
+
**Selection Note**
|
|
119
|
+
- Confirm the diagnosed cause of Data Clumps and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
120
|
+
|
|
121
|
+
## SMELL-PRIMITIVE-OBSESSION — Primitive Obsession
|
|
122
|
+
|
|
123
|
+
**Primary/Supporting Candidates**
|
|
124
|
+
- `RF-REPLACE-PRIMITIVE-WITH-OBJECT`
|
|
125
|
+
- `RF-REPLACE-TYPE-CODE-WITH-SUBCLASSES`
|
|
126
|
+
- `RF-REPLACE-CONDITIONAL-WITH-POLYMORPHISM`
|
|
127
|
+
- `RF-EXTRACT-CLASS`
|
|
128
|
+
- `RF-INTRODUCE-PARAMETER-OBJECT`
|
|
129
|
+
|
|
130
|
+
**Selection Note**
|
|
131
|
+
- Confirm the diagnosed cause of Primitive Obsession and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
132
|
+
|
|
133
|
+
## SMELL-REPEATED-SWITCHES — Repeated Switches
|
|
134
|
+
|
|
135
|
+
**Primary/Supporting Candidates**
|
|
136
|
+
- `RF-REPLACE-CONDITIONAL-WITH-POLYMORPHISM`
|
|
137
|
+
|
|
138
|
+
**Selection Note**
|
|
139
|
+
- Confirm the diagnosed cause of Repeated Switches and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
140
|
+
|
|
141
|
+
## SMELL-LOOPS — Loops
|
|
142
|
+
|
|
143
|
+
**Primary/Supporting Candidates**
|
|
144
|
+
- `RF-REPLACE-LOOP-WITH-PIPELINE`
|
|
145
|
+
|
|
146
|
+
**Selection Note**
|
|
147
|
+
- Confirm the diagnosed cause of Loops and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
148
|
+
|
|
149
|
+
## SMELL-LAZY-ELEMENT — Lazy Element
|
|
150
|
+
|
|
151
|
+
**Primary/Supporting Candidates**
|
|
152
|
+
- `RF-INLINE-FUNCTION`
|
|
153
|
+
- `RF-INLINE-CLASS`
|
|
154
|
+
- `RF-COLLAPSE-HIERARCHY`
|
|
155
|
+
|
|
156
|
+
**Selection Note**
|
|
157
|
+
- Confirm the diagnosed cause of Lazy Element and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
158
|
+
|
|
159
|
+
## SMELL-SPECULATIVE-GENERALITY — Speculative Generality
|
|
160
|
+
|
|
161
|
+
**Primary/Supporting Candidates**
|
|
162
|
+
- `RF-COLLAPSE-HIERARCHY`
|
|
163
|
+
- `RF-INLINE-FUNCTION`
|
|
164
|
+
- `RF-INLINE-CLASS`
|
|
165
|
+
- `RF-CHANGE-FUNCTION-DECLARATION`
|
|
166
|
+
- `RF-REMOVE-DEAD-CODE`
|
|
167
|
+
|
|
168
|
+
**Selection Note**
|
|
169
|
+
- Confirm the diagnosed cause of Speculative Generality and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
170
|
+
|
|
171
|
+
## SMELL-TEMPORARY-FIELD — Temporary Field
|
|
172
|
+
|
|
173
|
+
**Primary/Supporting Candidates**
|
|
174
|
+
- `RF-EXTRACT-CLASS`
|
|
175
|
+
- `RF-MOVE-FUNCTION`
|
|
176
|
+
- `RF-INTRODUCE-SPECIAL-CASE`
|
|
177
|
+
|
|
178
|
+
**Selection Note**
|
|
179
|
+
- Confirm the diagnosed cause of Temporary Field and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
180
|
+
|
|
181
|
+
## SMELL-MESSAGE-CHAINS — Message Chains
|
|
182
|
+
|
|
183
|
+
**Primary/Supporting Candidates**
|
|
184
|
+
- `RF-HIDE-DELEGATE`
|
|
185
|
+
- `RF-EXTRACT-FUNCTION`
|
|
186
|
+
- `RF-MOVE-FUNCTION`
|
|
187
|
+
|
|
188
|
+
**Selection Note**
|
|
189
|
+
- Confirm the diagnosed cause of Message Chains and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
190
|
+
|
|
191
|
+
## SMELL-MIDDLE-MAN — Middle Man
|
|
192
|
+
|
|
193
|
+
**Primary/Supporting Candidates**
|
|
194
|
+
- `RF-REMOVE-MIDDLE-MAN`
|
|
195
|
+
- `RF-INLINE-FUNCTION`
|
|
196
|
+
- `RF-REPLACE-SUPERCLASS-WITH-DELEGATE`
|
|
197
|
+
- `RF-REPLACE-SUBCLASS-WITH-DELEGATE`
|
|
198
|
+
|
|
199
|
+
**Selection Note**
|
|
200
|
+
- Confirm the diagnosed cause of Middle Man and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
201
|
+
|
|
202
|
+
## SMELL-INSIDER-TRADING — Insider Trading
|
|
203
|
+
|
|
204
|
+
**Primary/Supporting Candidates**
|
|
205
|
+
- `RF-MOVE-FUNCTION`
|
|
206
|
+
- `RF-MOVE-FIELD`
|
|
207
|
+
- `RF-HIDE-DELEGATE`
|
|
208
|
+
- `RF-REPLACE-SUBCLASS-WITH-DELEGATE`
|
|
209
|
+
- `RF-REPLACE-SUPERCLASS-WITH-DELEGATE`
|
|
210
|
+
|
|
211
|
+
**Selection Note**
|
|
212
|
+
- Confirm the diagnosed cause of Insider Trading and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
213
|
+
|
|
214
|
+
## SMELL-LARGE-CLASS — Large Class
|
|
215
|
+
|
|
216
|
+
**Primary/Supporting Candidates**
|
|
217
|
+
- `RF-EXTRACT-CLASS`
|
|
218
|
+
- `RF-EXTRACT-SUPERCLASS`
|
|
219
|
+
- `RF-REPLACE-TYPE-CODE-WITH-SUBCLASSES`
|
|
220
|
+
|
|
221
|
+
**Selection Note**
|
|
222
|
+
- Confirm the diagnosed cause of Large Class and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
223
|
+
|
|
224
|
+
## SMELL-ALTERNATIVE-CLASSES-DIFFERENT-INTERFACES — Alternative Classes with Different Interfaces
|
|
225
|
+
|
|
226
|
+
**Primary/Supporting Candidates**
|
|
227
|
+
- `RF-CHANGE-FUNCTION-DECLARATION`
|
|
228
|
+
- `RF-MOVE-FUNCTION`
|
|
229
|
+
- `RF-EXTRACT-SUPERCLASS`
|
|
230
|
+
|
|
231
|
+
**Selection Note**
|
|
232
|
+
- Confirm the diagnosed cause of Alternative Classes with Different Interfaces and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
233
|
+
|
|
234
|
+
## SMELL-DATA-CLASS — Data Class
|
|
235
|
+
|
|
236
|
+
**Primary/Supporting Candidates**
|
|
237
|
+
- `RF-ENCAPSULATE-RECORD`
|
|
238
|
+
- `RF-REMOVE-SETTING-METHOD`
|
|
239
|
+
- `RF-MOVE-FUNCTION`
|
|
240
|
+
- `RF-EXTRACT-FUNCTION`
|
|
241
|
+
- `RF-SPLIT-PHASE`
|
|
242
|
+
|
|
243
|
+
**Selection Note**
|
|
244
|
+
- Confirm the diagnosed cause of Data Class and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
245
|
+
|
|
246
|
+
## SMELL-REFUSED-BEQUEST — Refused Bequest
|
|
247
|
+
|
|
248
|
+
**Primary/Supporting Candidates**
|
|
249
|
+
- `RF-PUSH-DOWN-METHOD`
|
|
250
|
+
- `RF-PUSH-DOWN-FIELD`
|
|
251
|
+
- `RF-REPLACE-SUBCLASS-WITH-DELEGATE`
|
|
252
|
+
- `RF-REPLACE-SUPERCLASS-WITH-DELEGATE`
|
|
253
|
+
|
|
254
|
+
**Selection Note**
|
|
255
|
+
- Confirm the diagnosed cause of Refused Bequest and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
256
|
+
|
|
257
|
+
## SMELL-COMMENTS — Comments
|
|
258
|
+
|
|
259
|
+
**Primary/Supporting Candidates**
|
|
260
|
+
- `RF-EXTRACT-FUNCTION`
|
|
261
|
+
- `RF-CHANGE-FUNCTION-DECLARATION`
|
|
262
|
+
- `RF-INTRODUCE-ASSERTION`
|
|
263
|
+
|
|
264
|
+
**Selection Note**
|
|
265
|
+
- Confirm the diagnosed cause of Comments and choose only a technique whose preconditions fit the current ownership and behavior contract.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fec-data-fetching
|
|
3
|
-
description: Use when implementing or reviewing frontend server-state flows: typed queries, request caching, invalidation, mutations, optimistic updates, infinite queries, prefetch, SSR hydration, or API-layer integration. Do not use for local UI state or Service Worker caching; Chinese triggers include data fetch, cache, optimistic updates.
|
|
3
|
+
description: "Use when implementing or reviewing frontend server-state flows: typed queries, request caching, invalidation, mutations, optimistic updates, infinite queries, prefetch, SSR hydration, or API-layer integration. Do not use for local UI state or Service Worker caching; Chinese triggers include data fetch, cache, optimistic updates."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Server State data acquisition
|
|
@@ -14,7 +14,7 @@ Generate or edit diagrams, visual assets, and image workflows, and perform revie
|
|
|
14
14
|
1. Determine product type
|
|
15
15
|
- When accuracy of text, structure, and connections is a priority, use Mermaid, SVG, HTML/CSS, canvas, or a graphics library to generate editable sources and then export as PNG.
|
|
16
16
|
- Use HTML technical diagrams when the user needs a browser-ready single file with dark/light theme support for system blueprints, architecture, deployment topology, agent runtime, memory flow, before-after architecture, workflow, sequence, data-flow, lifecycle, runbook, state-machine, or PII/data-lineage diagrams.
|
|
17
|
-
- Use the HTML `workflow` route for process maps, approvals, automation runs, exception paths, and cyclical operating flows that need readable start/end, decision, actor, numbered-step, and summary treatment without requiring diagrams.net.
|
|
17
|
+
- Use the compatible HTML `workflow` route when Mermaid is unavailable or browser-specific lane/style delivery is required for process maps, approvals, automation runs, exception paths, and cyclical operating flows that need readable start/end, decision, actor, numbered-step, and summary treatment without requiring diagrams.net.
|
|
18
18
|
- Use themed HTML technical diagrams when a system, agent, memory, data, or tool-call map needs semantic node shapes, flow-aware arrows, and a browser-ready source that can still be exported and QA-checked.
|
|
19
19
|
- Use the interactive live diagram route when the user benefits from watching nodes and edges appear incrementally in a local browser, or when they want to drag, relabel, remove, zoom, and export a quick diagram during the session.
|
|
20
20
|
- When aesthetics, texture, photos, illustrations, comics, product images or brand atmosphere are priorities, use image generation or editing tools, and then save the final assets to the project or report directory.
|
|
@@ -79,3 +79,33 @@ Generate or edit diagrams, visual assets, and image workflows, and perform revie
|
|
|
79
79
|
## Expected Output
|
|
80
80
|
|
|
81
81
|
Produce editable source, final PNG or edited image with generated routes and QA results. Diagrams should be clearly structured, with uncensored labels and uncluttered connections; visual assets should match purpose, size, brand tone, and delivery path.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## Technical diagram quality and tool routing
|
|
85
|
+
|
|
86
|
+
Prefer locally installed Mermaid for standard sequence diagrams and flowcharts. Reuse fec-drawio-studio for architecture that needs long-term manual editing; local Graphviz is optional for dense topology. Record unavailable tools and fall back to the compatible JSON/HTML route without installation, downloads or CDN. Preserve complete text and every node/relationship; do not silently rearrange explicit sizes, coordinates or waypoints.
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
node skills/fec-image-generation/scripts/mermaid-render.mjs --input sequence.mmd --output sequence.svg --report sequence.render.json
|
|
90
|
+
node skills/fec-image-generation/scripts/export-diagram.mjs --input diagram.html --format png --output diagram.png --theme light --scale 2 --manifest diagram.layout.json --output-manifest diagram.actual.json
|
|
91
|
+
node skills/fec-image-generation/scripts/png-qa.mjs --png diagram.png --manifest diagram.actual.json --format json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Use the exported actual manifest for PNG QA. The source manifest has SVG coordinates and estimated bounds and cannot be reused unchanged at 2x. Browser export waits for fonts and measures real text bounds; standalone SVG embeds theme styles. Successful rendering, estimates and passing automation do not prove visual acceptance. Inspect the final PNG and record tool versions, theme, scale, repair rounds, unresolved issues and partial acceptance. Higher resolution cannot repair truncated text or layout collisions.
|
|
95
|
+
|
|
96
|
+
Bundled internal modules and reproducible fixtures:
|
|
97
|
+
- [mermaid-render.mjs](scripts/mermaid-render.mjs)
|
|
98
|
+
- [diagram-layout.mjs](scripts/diagram-layout.mjs)
|
|
99
|
+
- [diagram-browser.mjs](scripts/diagram-browser.mjs)
|
|
100
|
+
- [quality examples](assets/quality-examples/README.md)
|
|
101
|
+
- [sequence.json](assets/quality-examples/sequence.json)
|
|
102
|
+
- [workflow.json](assets/quality-examples/workflow.json)
|
|
103
|
+
- [architecture.json](assets/quality-examples/architecture.json)
|
|
104
|
+
- [sequence.mmd](assets/quality-examples/sequence.mmd)
|
|
105
|
+
- [workflow.mmd](assets/quality-examples/workflow.mmd)
|
|
106
|
+
|
|
107
|
+
The built-in sequence route supports participants and ordered messages. Use Mermaid for activations, alt/loop/par fragments and complex async semantics; never silently simplify them into plain messages. Enable optional ELK only when the installed Mermaid version supports it, otherwise use its compatible default layout.
|
|
108
|
+
|
|
109
|
+
- [invalid-explicit.json](assets/quality-examples/invalid-explicit.json)
|
|
110
|
+
|
|
111
|
+
- [png-qa.mjs](scripts/png-qa.mjs)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Diagram quality examples
|
|
2
|
+
|
|
3
|
+
The JSON fixtures cover sequence self calls, workflow decisions and loops, and architecture groups with reverse/data/async edges. The Mermaid sources are equivalent text-first examples for standard sequence/workflow rendering. Preserve their labels and relationships when changing layout.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
node skills/fec-image-generation/scripts/tech-diagram-render.mjs --input skills/fec-image-generation/assets/quality-examples/workflow.json --type workflow --output workflow.html --manifest workflow.layout.json
|
|
7
|
+
node skills/fec-image-generation/scripts/export-diagram.mjs --input workflow.html --format png --output workflow.png --theme light --scale 2 --manifest workflow.layout.json --output-manifest workflow.actual.json
|
|
8
|
+
node skills/fec-image-generation/scripts/png-qa.mjs --png workflow.png --manifest workflow.actual.json --format json
|
|
9
|
+
node skills/fec-image-generation/scripts/mermaid-render.mjs --input skills/fec-image-generation/assets/quality-examples/sequence.mmd --output sequence.svg --report sequence.render.json
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Use a local Chromium browser for PNG; set FEC_BROWSER_PATH to its executable when detection fails. Mermaid needs an already installed mmdc; no automatic install or CDN is used. Missing Mermaid must be recorded as unavailable and the HTML route selected. Architecture editing uses the existing fec-drawio-studio skill when available, otherwise the JSON/HTML fixture. Graphviz is optional for dense topology and is not installed automatically.
|
|
13
|
+
|
|
14
|
+
Inspect final PNGs at intended reading size. Check node text against shape interiors, edge labels against arrowheads, branch/return directions, loop visibility, group boundaries and light/dark contrast. Run at 1x and 2x and inspect both. Geometry QA is evidence, not a substitute for visual review. Small explicit node sizes, overlapping explicit coordinates or obstructed explicit waypoints are reported; change the source with user intent preserved. Limit automatic source repairs to two rounds (five only when requested), and report partial acceptance if unresolved.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"diagram_type": "architecture",
|
|
4
|
+
"meta": {
|
|
5
|
+
"title": "Platform layers and trust boundaries"
|
|
6
|
+
},
|
|
7
|
+
"visual": {
|
|
8
|
+
"style": "minimal"
|
|
9
|
+
},
|
|
10
|
+
"groups": [
|
|
11
|
+
{
|
|
12
|
+
"id": "private",
|
|
13
|
+
"label": "Trusted network / business and data services",
|
|
14
|
+
"x": 360,
|
|
15
|
+
"y": 70,
|
|
16
|
+
"width": 920,
|
|
17
|
+
"height": 470,
|
|
18
|
+
"type": "security"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"nodes": [
|
|
22
|
+
{
|
|
23
|
+
"id": "web",
|
|
24
|
+
"label": "Browser application",
|
|
25
|
+
"sublabel": "External entry",
|
|
26
|
+
"type": "browser",
|
|
27
|
+
"x": 70,
|
|
28
|
+
"y": 160,
|
|
29
|
+
"width": 200,
|
|
30
|
+
"height": 112
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "gateway",
|
|
34
|
+
"label": "Identity and request routing gateway",
|
|
35
|
+
"type": "gateway",
|
|
36
|
+
"x": 420,
|
|
37
|
+
"y": 150,
|
|
38
|
+
"width": 220,
|
|
39
|
+
"height": 112,
|
|
40
|
+
"group": "private"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "service",
|
|
44
|
+
"label": "Order query and approval service",
|
|
45
|
+
"type": "backend",
|
|
46
|
+
"x": 760,
|
|
47
|
+
"y": 150,
|
|
48
|
+
"width": 220,
|
|
49
|
+
"height": 112,
|
|
50
|
+
"group": "private"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "cache",
|
|
54
|
+
"label": "Short-lived query cache",
|
|
55
|
+
"type": "memory",
|
|
56
|
+
"x": 420,
|
|
57
|
+
"y": 370,
|
|
58
|
+
"width": 220,
|
|
59
|
+
"height": 112,
|
|
60
|
+
"group": "private"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "db",
|
|
64
|
+
"label": "Order and approval database",
|
|
65
|
+
"type": "database",
|
|
66
|
+
"x": 760,
|
|
67
|
+
"y": 370,
|
|
68
|
+
"width": 220,
|
|
69
|
+
"height": 112,
|
|
70
|
+
"group": "private"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "queue",
|
|
74
|
+
"label": "Async tasks and notification queue",
|
|
75
|
+
"type": "queue",
|
|
76
|
+
"x": 1060,
|
|
77
|
+
"y": 370,
|
|
78
|
+
"width": 180,
|
|
79
|
+
"height": 112,
|
|
80
|
+
"group": "private"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"connections": [
|
|
84
|
+
{
|
|
85
|
+
"from": "web",
|
|
86
|
+
"to": "gateway",
|
|
87
|
+
"label": "Authentication request",
|
|
88
|
+
"flow": "control"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"from": "gateway",
|
|
92
|
+
"to": "service",
|
|
93
|
+
"label": "Validated request",
|
|
94
|
+
"flow": "control"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"from": "service",
|
|
98
|
+
"to": "gateway",
|
|
99
|
+
"label": "Query response",
|
|
100
|
+
"flow": "data"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"from": "service",
|
|
104
|
+
"to": "cache",
|
|
105
|
+
"label": "Read cache",
|
|
106
|
+
"flow": "read"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"from": "service",
|
|
110
|
+
"to": "db",
|
|
111
|
+
"label": "Query records",
|
|
112
|
+
"flow": "read"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"from": "service",
|
|
116
|
+
"to": "queue",
|
|
117
|
+
"label": "Submit notification task",
|
|
118
|
+
"flow": "async"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"diagram_type": "architecture",
|
|
4
|
+
"meta": {
|
|
5
|
+
"title": "Expected diagnostics"
|
|
6
|
+
},
|
|
7
|
+
"nodes": [
|
|
8
|
+
{
|
|
9
|
+
"id": "tiny",
|
|
10
|
+
"label": "A complete long label that cannot fit explicit size",
|
|
11
|
+
"x": -12,
|
|
12
|
+
"y": 40,
|
|
13
|
+
"width": 48,
|
|
14
|
+
"height": 24
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "overlap",
|
|
18
|
+
"label": "Overlap",
|
|
19
|
+
"x": 20,
|
|
20
|
+
"y": 44,
|
|
21
|
+
"width": 100,
|
|
22
|
+
"height": 60
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"connections": [
|
|
26
|
+
{
|
|
27
|
+
"from": "tiny",
|
|
28
|
+
"to": "overlap",
|
|
29
|
+
"waypoints": [
|
|
30
|
+
[
|
|
31
|
+
30,
|
|
32
|
+
50
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
800,
|
|
36
|
+
-20
|
|
37
|
+
]
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"diagram_type": "sequence",
|
|
4
|
+
"meta": {
|
|
5
|
+
"title": "Order query and cache refill"
|
|
6
|
+
},
|
|
7
|
+
"participants": [
|
|
8
|
+
{
|
|
9
|
+
"id": "client",
|
|
10
|
+
"label": "Browser client",
|
|
11
|
+
"type": "frontend"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "api",
|
|
15
|
+
"label": "Order service API",
|
|
16
|
+
"type": "backend"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "db",
|
|
20
|
+
"label": "Persistent database",
|
|
21
|
+
"type": "database"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"messages": [
|
|
25
|
+
{
|
|
26
|
+
"from": "client",
|
|
27
|
+
"to": "api",
|
|
28
|
+
"label": "Query order details and current payment status"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"from": "api",
|
|
32
|
+
"to": "api",
|
|
33
|
+
"label": "Validate identity and order access"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"from": "api",
|
|
37
|
+
"to": "db",
|
|
38
|
+
"label": "Cache miss: read order records"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"from": "db",
|
|
42
|
+
"to": "api",
|
|
43
|
+
"label": "Return order records and payment status",
|
|
44
|
+
"variant": "return"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"from": "api",
|
|
48
|
+
"to": "client",
|
|
49
|
+
"label": "Return results and update the page",
|
|
50
|
+
"variant": "return"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
sequenceDiagram
|
|
2
|
+
participant Web as Browser client
|
|
3
|
+
participant API as Order service API
|
|
4
|
+
participant DB as Persistent database
|
|
5
|
+
Web->>API: Query order details and current payment status
|
|
6
|
+
API->>API: Validate identity and order access
|
|
7
|
+
API->>DB: Cache miss: read order records
|
|
8
|
+
DB-->>API: Return order records and payment status
|
|
9
|
+
API-->>Web: Return results and update the page
|
|
10
|
+
|
|
11
|
+
activate API
|
|
12
|
+
alt Cache hit
|
|
13
|
+
API-->>Web: Return cached result
|
|
14
|
+
else Cache miss
|
|
15
|
+
loop Retry failed query
|
|
16
|
+
API->>DB: Read records
|
|
17
|
+
DB-->>API: Return result
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
API-)Web: Async update notification
|
|
21
|
+
deactivate API
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"diagram_type": "workflow",
|
|
4
|
+
"meta": {
|
|
5
|
+
"title": "Order approval and recovery"
|
|
6
|
+
},
|
|
7
|
+
"lanes": [
|
|
8
|
+
{
|
|
9
|
+
"id": "user",
|
|
10
|
+
"label": "User submission"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "ops",
|
|
14
|
+
"label": "Approval and handling"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "sys",
|
|
18
|
+
"label": "System execution"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"nodes": [
|
|
22
|
+
{
|
|
23
|
+
"id": "start",
|
|
24
|
+
"lane": "user",
|
|
25
|
+
"col": 0,
|
|
26
|
+
"label": "Submit order request",
|
|
27
|
+
"type": "start"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "check",
|
|
31
|
+
"lane": "ops",
|
|
32
|
+
"col": 1,
|
|
33
|
+
"label": "Check order completeness and approval eligibility",
|
|
34
|
+
"type": "decision"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "approve",
|
|
38
|
+
"lane": "ops",
|
|
39
|
+
"col": 2,
|
|
40
|
+
"label": "Review manually and record the decision",
|
|
41
|
+
"type": "backend"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "retry",
|
|
45
|
+
"lane": "user",
|
|
46
|
+
"col": 1,
|
|
47
|
+
"label": "Add missing evidence and resubmit",
|
|
48
|
+
"type": "waiting"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "save",
|
|
52
|
+
"lane": "sys",
|
|
53
|
+
"col": 3,
|
|
54
|
+
"label": "Save approval and notify the applicant asynchronously",
|
|
55
|
+
"type": "database"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "done",
|
|
59
|
+
"lane": "sys",
|
|
60
|
+
"col": 4,
|
|
61
|
+
"label": "Completed",
|
|
62
|
+
"type": "success"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"edges": [
|
|
66
|
+
{
|
|
67
|
+
"from": "start",
|
|
68
|
+
"to": "check",
|
|
69
|
+
"label": "Submit for review"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"from": "check",
|
|
73
|
+
"to": "approve",
|
|
74
|
+
"label": "Complete information"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"from": "check",
|
|
78
|
+
"to": "retry",
|
|
79
|
+
"label": "More evidence needed",
|
|
80
|
+
"variant": "dashed"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"from": "retry",
|
|
84
|
+
"to": "check",
|
|
85
|
+
"label": "Review again"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"from": "approve",
|
|
89
|
+
"to": "save",
|
|
90
|
+
"label": "Approved"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"from": "save",
|
|
94
|
+
"to": "done",
|
|
95
|
+
"label": "Notification sent"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
flowchart TD
|
|
2
|
+
A([Submit order request]) --> B{Check order completeness and approval eligibility}
|
|
3
|
+
B -->|Complete information| C[Review manually and record the decision]
|
|
4
|
+
B -->|More evidence needed| D[Add missing evidence and resubmit]
|
|
5
|
+
D -->|Review again| B
|
|
6
|
+
C -->|Approved| E[(Save approval and notify the applicant asynchronously)]
|
|
7
|
+
E -->|Notification sent| F([Completed])
|