@xuxiao-dev/ai-dev-kit 0.2.0 → 0.2.2

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.
Files changed (46) hide show
  1. package/README.md +71 -11
  2. package/bin/ai-dev-kit.js +104 -11
  3. package/codex/index.html +35 -11
  4. package/codex/packs/multi-agent-investment/manifest.json +56 -0
  5. package/codex/packs/multi-agent-investment/skills/project-ui-style/SKILL.md +32 -0
  6. package/codex/packs/multi-agent-investment/skills/project-ui-style/agents/openai.yaml +4 -0
  7. package/codex/packs/multi-agent-investment/skills/project-ui-style/references/component-guide.md +44 -0
  8. package/codex/packs/multi-agent-investment/skills/project-ui-style/references/page-patterns.md +90 -0
  9. package/codex/packs/multi-agent-investment/skills/project-ui-style/references/visual-guidelines.md +99 -0
  10. package/codex/packs/multi-agent-investment/skills/project-verification/SKILL.md +32 -0
  11. package/codex/packs/multi-agent-investment/skills/project-verification/agents/openai.yaml +4 -0
  12. package/codex/packs/multi-agent-investment/skills/project-verification/references/local-environments.md +52 -0
  13. package/codex/packs/multi-agent-investment/skills/project-verification/references/optional-mock.md +23 -0
  14. package/codex/packs/multi-agent-investment/skills/project-verification/references/verification-guide.md +63 -0
  15. package/codex/packs/multi-agent-investment/skills/staged-change-report/SKILL.md +101 -0
  16. package/codex/packs/multi-agent-investment/skills/staged-change-report/agents/openai.yaml +4 -0
  17. package/codex/skills/{content-blog-optimize → blog}/SKILL.md +16 -30
  18. package/codex/skills/blog/agents/openai.yaml +4 -0
  19. package/codex/skills/{engineering-bug-review → bug-review}/SKILL.md +1 -1
  20. package/codex/skills/{engineering-bug-review → bug-review}/agents/openai.yaml +1 -1
  21. package/codex/skills/{document-project-docs → docs}/SKILL.md +1 -1
  22. package/codex/skills/{document-project-docs → docs}/agents/openai.yaml +1 -1
  23. package/codex/skills/draw/SKILL.md +28 -0
  24. package/codex/skills/draw/agents/openai.yaml +4 -0
  25. package/codex/skills/draw/assets/architecture.drawio +61 -0
  26. package/codex/skills/draw/assets/architecture.png +0 -0
  27. package/codex/skills/draw/assets/concurrent-save.drawio +86 -0
  28. package/codex/skills/draw/assets/concurrent-save.png +0 -0
  29. package/codex/skills/draw/assets/network-layers.drawio +76 -0
  30. package/codex/skills/draw/assets/network-layers.png +0 -0
  31. package/codex/skills/draw/assets/operator-flow.drawio +76 -0
  32. package/codex/skills/draw/assets/operator-flow.png +0 -0
  33. package/codex/skills/draw/references/article-diagrams.md +15 -0
  34. package/codex/skills/draw/references/diagram-styles.md +21 -0
  35. package/codex/skills/draw/references/ppt-and-exports.md +33 -0
  36. package/codex/skills/draw/scripts/export_drawio.py +194 -0
  37. package/codex/skills/{git-commit-staged → git-commit}/SKILL.md +1 -1
  38. package/codex/skills/{git-commit-staged → git-commit}/agents/openai.yaml +1 -1
  39. package/codex/skills/git-submit/SKILL.md +45 -0
  40. package/codex/skills/git-submit/agents/openai.yaml +4 -0
  41. package/codex/skills/{document-project-readme → readme}/SKILL.md +1 -1
  42. package/codex/skills/{document-project-readme → readme}/agents/openai.yaml +1 -1
  43. package/codex/skills/{vue-component-config → vue-config}/SKILL.md +1 -1
  44. package/codex/skills/{vue-component-config → vue-config}/agents/openai.yaml +1 -1
  45. package/package.json +2 -1
  46. package/codex/skills/content-blog-optimize/agents/openai.yaml +0 -4
@@ -0,0 +1,86 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <mxfile host="app.diagrams.net" compressed="false">
3
+ <diagram id="concurrent-save" name="两个页面同时保存">
4
+ <mxGraphModel dx="680" dy="519" grid="0" gridSize="10" guides="1" connect="1" arrows="1" page="1" pageScale="1" pageWidth="680" pageHeight="519" background="#FFFFFF" math="0" shadow="0">
5
+ <root>
6
+ <mxCell id="0" />
7
+ <mxCell id="1" parent="0" />
8
+ <mxCell id="background" value="" style="fillColor=#FFFFFF;strokeColor=none;locked=1;" parent="1" vertex="1">
9
+ <mxGeometry x="0" y="0" width="680" height="519" as="geometry" />
10
+ </mxCell>
11
+ <mxCell id="title" value="两个页面同时保存" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=34;fontStyle=1;align=left;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
12
+ <mxGeometry x="32" y="17" width="616" height="48" as="geometry" />
13
+ </mxCell>
14
+ <mxCell id="page-a-lifeline" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#BAC6D2;strokeWidth=2.2;dashed=1;dashPattern=5 4;startArrow=none;endArrow=none;endFill=1;endSize=8;">
15
+ <mxGeometry relative="1" as="geometry">
16
+ <mxPoint x="118" y="112" as="sourcePoint" />
17
+ <mxPoint x="118" y="485" as="targetPoint" />
18
+ </mxGeometry>
19
+ </mxCell>
20
+ <mxCell id="page-a" value="页面 A" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=27;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#E3EFF8;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
21
+ <mxGeometry x="38" y="78" width="160" height="46" as="geometry" />
22
+ </mxCell>
23
+ <mxCell id="service-lifeline" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#BAC6D2;strokeWidth=2.2;dashed=1;dashPattern=5 4;startArrow=none;endArrow=none;endFill=1;endSize=8;">
24
+ <mxGeometry relative="1" as="geometry">
25
+ <mxPoint x="340" y="112" as="sourcePoint" />
26
+ <mxPoint x="340" y="485" as="targetPoint" />
27
+ </mxGeometry>
28
+ </mxCell>
29
+ <mxCell id="service" value="保存服务" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=27;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#94C6E2;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
30
+ <mxGeometry x="260" y="78" width="160" height="46" as="geometry" />
31
+ </mxCell>
32
+ <mxCell id="page-b-lifeline" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#BAC6D2;strokeWidth=2.2;dashed=1;dashPattern=5 4;startArrow=none;endArrow=none;endFill=1;endSize=8;">
33
+ <mxGeometry relative="1" as="geometry">
34
+ <mxPoint x="562" y="112" as="sourcePoint" />
35
+ <mxPoint x="562" y="485" as="targetPoint" />
36
+ </mxGeometry>
37
+ </mxCell>
38
+ <mxCell id="page-b" value="页面 B" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=27;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#E3EFF8;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
39
+ <mxGeometry x="482" y="78" width="160" height="46" as="geometry" />
40
+ </mxCell>
41
+ <mxCell id="request-a" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;">
42
+ <mxGeometry relative="1" as="geometry">
43
+ <mxPoint x="118" y="164" as="sourcePoint" />
44
+ <mxPoint x="340" y="164" as="targetPoint" />
45
+ </mxGeometry>
46
+ </mxCell>
47
+ <mxCell id="request-a-label" value="提交版本 3" style="text;html=0;fontFamily=Arial;fontColor=#384757;fontSize=25;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
48
+ <mxGeometry x="118" y="129" width="222" height="32" as="geometry" />
49
+ </mxCell>
50
+ <mxCell id="request-b" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;">
51
+ <mxGeometry relative="1" as="geometry">
52
+ <mxPoint x="562" y="222" as="sourcePoint" />
53
+ <mxPoint x="340" y="222" as="targetPoint" />
54
+ </mxGeometry>
55
+ </mxCell>
56
+ <mxCell id="request-b-label" value="提交版本 3" style="text;html=0;fontFamily=Arial;fontColor=#384757;fontSize=25;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
57
+ <mxGeometry x="340" y="187" width="222" height="32" as="geometry" />
58
+ </mxCell>
59
+ <mxCell id="save-a" value="保存 A,版本升到 4" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=26;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#DCEBD4;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
60
+ <mxGeometry x="210" y="237" width="260" height="55" as="geometry" />
61
+ </mxCell>
62
+ <mxCell id="reply-a" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;">
63
+ <mxGeometry relative="1" as="geometry">
64
+ <mxPoint x="340" y="340" as="sourcePoint" />
65
+ <mxPoint x="118" y="340" as="targetPoint" />
66
+ </mxGeometry>
67
+ </mxCell>
68
+ <mxCell id="reply-a-label" value="保存成功" style="text;html=0;fontFamily=Arial;fontColor=#384757;fontSize=25;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
69
+ <mxGeometry x="118" y="305" width="222" height="32" as="geometry" />
70
+ </mxCell>
71
+ <mxCell id="check-b" value="校验 B,3 ≠ 4" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=26;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#FFF0CB;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
72
+ <mxGeometry x="220" y="356" width="240" height="55" as="geometry" />
73
+ </mxCell>
74
+ <mxCell id="reject-b" parent="1" edge="1" style="edgeStyle=none;html=0;rounded=0;strokeColor=#9B5619;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;">
75
+ <mxGeometry relative="1" as="geometry">
76
+ <mxPoint x="340" y="465" as="sourcePoint" />
77
+ <mxPoint x="562" y="465" as="targetPoint" />
78
+ </mxGeometry>
79
+ </mxCell>
80
+ <mxCell id="reject-b-label" value="409 版本冲突" style="text;html=0;fontFamily=Arial;fontColor=#9B5619;fontSize=25;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
81
+ <mxGeometry x="340" y="430" width="222" height="32" as="geometry" />
82
+ </mxCell>
83
+ </root>
84
+ </mxGraphModel>
85
+ </diagram>
86
+ </mxfile>
@@ -0,0 +1,76 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <mxfile host="app.diagrams.net" compressed="false">
3
+ <diagram id="network-layers" name="残差特征变换">
4
+ <mxGraphModel dx="1040" dy="332" grid="0" gridSize="10" guides="1" connect="1" arrows="1" page="1" pageScale="1" pageWidth="1040" pageHeight="332" background="#FFFFFF" math="0" shadow="0">
5
+ <root>
6
+ <mxCell id="0" />
7
+ <mxCell id="1" parent="0" />
8
+ <mxCell id="background" value="" style="fillColor=#FFFFFF;strokeColor=none;locked=1;" parent="1" vertex="1">
9
+ <mxGeometry x="0" y="0" width="1040" height="332" as="geometry" />
10
+ </mxCell>
11
+ <mxCell id="title" value="残差特征变换" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=34;fontStyle=1;align=left;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
12
+ <mxGeometry x="32" y="17" width="976" height="48" as="geometry" />
13
+ </mxCell>
14
+ <mxCell id="input" value="" style="shape=cube;html=0;flipH=1;size=16;darkOpacity=0;darkOpacity2=0;fillColor=#FFFFFF;strokeColor=#384757;strokeWidth=1.5;" parent="1" vertex="1">
15
+ <mxGeometry x="90" y="145" width="22" height="110" as="geometry" />
16
+ </mxCell>
17
+ <mxCell id="input-label" value="输入 x" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=29;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
18
+ <mxGeometry x="27" y="265" width="148" height="44" as="geometry" />
19
+ </mxCell>
20
+ <mxCell id="conv" value="" style="shape=cube;html=0;flipH=1;size=16;darkOpacity=0;darkOpacity2=0;fillColor=#57A4D3;strokeColor=#384757;strokeWidth=1.5;" parent="1" vertex="1">
21
+ <mxGeometry x="270" y="145" width="22" height="110" as="geometry" />
22
+ </mxCell>
23
+ <mxCell id="conv-label" value="Conv" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=29;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
24
+ <mxGeometry x="207" y="265" width="148" height="44" as="geometry" />
25
+ </mxCell>
26
+ <mxCell id="norm" value="" style="shape=cube;html=0;flipH=1;size=16;darkOpacity=0;darkOpacity2=0;fillColor=#C9CED4;strokeColor=#384757;strokeWidth=1.5;" parent="1" vertex="1">
27
+ <mxGeometry x="440" y="145" width="22" height="110" as="geometry" />
28
+ </mxCell>
29
+ <mxCell id="norm-label" value="Norm" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=29;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
30
+ <mxGeometry x="377" y="265" width="148" height="44" as="geometry" />
31
+ </mxCell>
32
+ <mxCell id="activation" value="" style="shape=cube;html=0;flipH=1;size=16;darkOpacity=0;darkOpacity2=0;fillColor=#A5C97B;strokeColor=#384757;strokeWidth=1.5;" parent="1" vertex="1">
33
+ <mxGeometry x="610" y="145" width="22" height="110" as="geometry" />
34
+ </mxCell>
35
+ <mxCell id="activation-label" value="ReLU" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=29;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
36
+ <mxGeometry x="547" y="265" width="148" height="44" as="geometry" />
37
+ </mxCell>
38
+ <mxCell id="add" value="+" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=30;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;ellipse;fillColor=#FFF0CB;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
39
+ <mxGeometry x="762" y="176" width="48" height="48" as="geometry" />
40
+ </mxCell>
41
+ <mxCell id="output" value="" style="shape=cube;html=0;flipH=1;size=16;darkOpacity=0;darkOpacity2=0;fillColor=#FFFFFF;strokeColor=#384757;strokeWidth=1.5;" parent="1" vertex="1">
42
+ <mxGeometry x="930" y="145" width="22" height="110" as="geometry" />
43
+ </mxCell>
44
+ <mxCell id="output-label" value="输出 y" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=29;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
45
+ <mxGeometry x="867" y="265" width="148" height="44" as="geometry" />
46
+ </mxCell>
47
+ <mxCell id="input-to-conv" parent="1" edge="1" source="input" target="conv" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=0;exitY=0.5;exitPerimeter=0;entryX=1;entryY=0.5;entryPerimeter=0;">
48
+ <mxGeometry relative="1" as="geometry" />
49
+ </mxCell>
50
+ <mxCell id="conv-to-norm" parent="1" edge="1" source="conv" target="norm" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=0;exitY=0.5;exitPerimeter=0;entryX=1;entryY=0.5;entryPerimeter=0;">
51
+ <mxGeometry relative="1" as="geometry" />
52
+ </mxCell>
53
+ <mxCell id="norm-to-activation" parent="1" edge="1" source="norm" target="activation" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=0;exitY=0.5;exitPerimeter=0;entryX=1;entryY=0.5;entryPerimeter=0;">
54
+ <mxGeometry relative="1" as="geometry" />
55
+ </mxCell>
56
+ <mxCell id="activation-to-add" parent="1" edge="1" source="activation" target="add" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=0;exitY=0.5;exitPerimeter=0;entryX=0;entryY=0.5;entryPerimeter=0;">
57
+ <mxGeometry relative="1" as="geometry" />
58
+ </mxCell>
59
+ <mxCell id="add-to-output" parent="1" edge="1" source="add" target="output" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=1;entryY=0.5;entryPerimeter=0;">
60
+ <mxGeometry relative="1" as="geometry" />
61
+ </mxCell>
62
+ <mxCell id="residual" parent="1" edge="1" source="input" target="add" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=0.5;exitY=0;exitPerimeter=0;entryX=0.5;entryY=0;entryPerimeter=0;">
63
+ <mxGeometry relative="1" as="geometry">
64
+ <Array as="points">
65
+ <mxPoint x="101" y="112" />
66
+ <mxPoint x="786" y="112" />
67
+ </Array>
68
+ </mxGeometry>
69
+ </mxCell>
70
+ <mxCell id="residual-label" value="残差连接" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=25;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
71
+ <mxGeometry x="365" y="72" width="160" height="36" as="geometry" />
72
+ </mxCell>
73
+ </root>
74
+ </mxGraphModel>
75
+ </diagram>
76
+ </mxfile>
@@ -0,0 +1,76 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <mxfile host="app.diagrams.net" compressed="false">
3
+ <diagram id="operator-flow" name="双路池化与特征拼接">
4
+ <mxGraphModel dx="1040" dy="369" grid="0" gridSize="10" guides="1" connect="1" arrows="1" page="1" pageScale="1" pageWidth="1040" pageHeight="369" background="#FFFFFF" math="0" shadow="0">
5
+ <root>
6
+ <mxCell id="0" />
7
+ <mxCell id="1" parent="0" />
8
+ <mxCell id="background" value="" style="fillColor=#FFFFFF;strokeColor=none;locked=1;" parent="1" vertex="1">
9
+ <mxGeometry x="0" y="0" width="1040" height="369" as="geometry" />
10
+ </mxCell>
11
+ <mxCell id="title" value="双路池化与特征拼接" style="text;html=0;fontFamily=Arial;fontColor=#223346;fontSize=34;fontStyle=1;align=left;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
12
+ <mxGeometry x="32" y="17" width="976" height="48" as="geometry" />
13
+ </mxCell>
14
+ <mxCell id="input" value="输入特征" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=28;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#EDF0F3;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
15
+ <mxGeometry x="48" y="167" width="148" height="63" as="geometry" />
16
+ </mxCell>
17
+ <mxCell id="mean" value="均值池化" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=28;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#E3EFF8;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
18
+ <mxGeometry x="284" y="105" width="174" height="62" as="geometry" />
19
+ </mxCell>
20
+ <mxCell id="max" value="最大池化" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=28;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#E6E1F2;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
21
+ <mxGeometry x="284" y="230" width="174" height="62" as="geometry" />
22
+ </mxCell>
23
+ <mxCell id="concat" value="C" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=28;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;ellipse;fillColor=#FFF0CB;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
24
+ <mxGeometry x="551" y="170" width="56" height="56" as="geometry" />
25
+ </mxCell>
26
+ <mxCell id="projection" value="线性投影" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=28;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#DCEBD4;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
27
+ <mxGeometry x="681" y="167" width="158" height="63" as="geometry" />
28
+ </mxCell>
29
+ <mxCell id="output" value="输出" style="html=0;fontFamily=Arial;fontColor=#223346;fontSize=28;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;rounded=1;arcSize=12;fillColor=#EDF0F3;strokeColor=#384757;strokeWidth=1.8;" parent="1" vertex="1">
30
+ <mxGeometry x="909" y="167" width="86" height="63" as="geometry" />
31
+ </mxCell>
32
+ <mxCell id="input-mean" parent="1" edge="1" source="input" target="mean" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=0;entryY=0.5;entryPerimeter=0;">
33
+ <mxGeometry relative="1" as="geometry">
34
+ <Array as="points">
35
+ <mxPoint x="230" y="199" />
36
+ <mxPoint x="230" y="136" />
37
+ </Array>
38
+ </mxGeometry>
39
+ </mxCell>
40
+ <mxCell id="input-max" parent="1" edge="1" source="input" target="max" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=0;entryY=0.5;entryPerimeter=0;">
41
+ <mxGeometry relative="1" as="geometry">
42
+ <Array as="points">
43
+ <mxPoint x="230" y="199" />
44
+ <mxPoint x="230" y="261" />
45
+ </Array>
46
+ </mxGeometry>
47
+ </mxCell>
48
+ <mxCell id="mean-concat" parent="1" edge="1" source="mean" target="concat" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=0.12;entryY=0.22;entryPerimeter=0;">
49
+ <mxGeometry relative="1" as="geometry">
50
+ <Array as="points">
51
+ <mxPoint x="511" y="136" />
52
+ <mxPoint x="511" y="182" />
53
+ </Array>
54
+ </mxGeometry>
55
+ </mxCell>
56
+ <mxCell id="max-concat" parent="1" edge="1" source="max" target="concat" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=0.12;entryY=0.78;entryPerimeter=0;">
57
+ <mxGeometry relative="1" as="geometry">
58
+ <Array as="points">
59
+ <mxPoint x="511" y="261" />
60
+ <mxPoint x="511" y="214" />
61
+ </Array>
62
+ </mxGeometry>
63
+ </mxCell>
64
+ <mxCell id="concat-projection" parent="1" edge="1" source="concat" target="projection" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=0;entryY=0.5;entryPerimeter=0;">
65
+ <mxGeometry relative="1" as="geometry" />
66
+ </mxCell>
67
+ <mxCell id="projection-output" parent="1" edge="1" source="projection" target="output" style="edgeStyle=none;html=0;rounded=0;strokeColor=#384757;strokeWidth=2.2;dashed=0;dashPattern=5 4;startArrow=none;endArrow=block;endFill=1;endSize=8;exitX=1;exitY=0.5;exitPerimeter=0;entryX=0;entryY=0.5;entryPerimeter=0;">
68
+ <mxGeometry relative="1" as="geometry" />
69
+ </mxCell>
70
+ <mxCell id="legend" value="C 表示拼接" style="text;html=0;fontFamily=Arial;fontColor=#384757;fontSize=24;fontStyle=0;align=center;verticalAlign=middle;whiteSpace=wrap;spacing=0;strokeColor=none;fillColor=none;" parent="1" vertex="1">
71
+ <mxGeometry x="499" y="299" width="160" height="43" as="geometry" />
72
+ </mxCell>
73
+ </root>
74
+ </mxGraphModel>
75
+ </diagram>
76
+ </mxfile>
@@ -0,0 +1,15 @@
1
+ # 技术文章配图
2
+
3
+ 先从正文选一个读者容易卡住的问题。总图适合交代组成和职责,交换方向或时间顺序需要解释时,单独画调用图或时序图。
4
+
5
+ - **架构图**可以借用总体架构图的分层布局。按实际职责排列客户端、服务或数据存储,箭头写操作或传递的内容。多条路径共享同一组件时,共用一个节点。
6
+ - **双向调用图**为请求、回调或异步通知各保留一条箭头,区分方向与触发条件。若通知到达后需要重新读取状态,把读取作为单独一步。
7
+ - **并发时序图**从上到下排时间,给页面、服务或数据库各自留一列。标出真正影响结果的动作和状态,例如第一个请求提交后服务器版本前进,第二个请求仍带旧表单版本。侧重因果时,可以把不影响理解的中间步骤省略,并在正文补充。
8
+
9
+ [双请求示例](../assets/concurrent-save.drawio)使用虚构的表单与版本号,标出两个页面如何与服务端交互。同一配色在一张图里只承担一种含义,重点结果还应有文字说明。
10
+
11
+ ## 手机预览
12
+
13
+ - 按文章实际正文宽度预览。第一轮可把图片缩到约 360 px 宽,检查参与方、步骤、状态值和箭头是否仍易读。图片放大后的清晰度不能替代正文中的可读性。
14
+ - 用短标签和短连线。需要横向浏览才能看完时,优先把流程改成纵向或拆两张图。
15
+ - 文章可用 PNG 搭配一句图注,源文件另存。目标平台支持 SVG 且预览通过时,也可使用 SVG。
@@ -0,0 +1,21 @@
1
+ # 网络图型与科研语义
2
+
3
+ 先确认输入、输出、算子顺序、数据依赖、共享参数和残差。结构图可以用一个大框概括内部机制,前提是范围清楚,且没有改变计算顺序。区分设计示意和实测结果,实测数值回查原始记录。
4
+
5
+ ## 薄片层图
6
+
7
+ 适合顺序特征变换与残差融合。主干节点同高,残差只绕过所需层。卷积用蓝色、归一化用浅灰、激活用绿色,颜色代表算子类别。输入输出用白底轮廓,运算符用小圆。各算子靠拢,文字和箭头留清晰间距。
8
+
9
+ 模板用原生 `mxCell` 和薄片形状。示例的几何组合为 `shape=cube;html=0;flipH=1;size=16;darkOpacity=0;darkOpacity2=0;`。应用 `flipH` 后检查左右端口,要跟随元素移动的线应连接节点或节点端口。
10
+
11
+ ## 彩色算子展开图
12
+
13
+ 用来说明单个机制的内部步骤。支路并排或上下对齐,同类算子颜色一致。合并位置写清计算方式,示例用 `C` 表示拼接、`+` 表示相加、`×` 表示逐元素乘。没有确认的卷积核、膨胀率、层数和通道数可以留成符号或省略。图外标题可以把概览和展开对应起来。
14
+
15
+ ## 总体架构图
16
+
17
+ 用横向主干承载主要流程,辅助路径按实际分叉与汇合位置放置。可用蓝色表示主干、桃色表示重点变换、浅黄表示仅训练时使用的节点。数据流用有向实线,监督或其他特殊路径可以用带说明的有向虚线。无方向的共享关联单独标注。仅在确有多尺度特征、跨层融合或上下采样时画出这些层级。
18
+
19
+ ## 数据几何图解
20
+
21
+ 用相同帧、相同裁剪和对应坐标并排展示两种关系。以原始样本为底图,节点和关系线单独编辑。原坐标先减裁剪起点,再按实际显示宽高缩放。可用中性灰标普通点、蓝标参照点和线、橙标目标点。图例写清点线表示几何参照、模型邻接还是实测权重。记录素材来源、裁剪范围及适用的使用范围。
@@ -0,0 +1,33 @@
1
+ # 导出与演示文稿验收
2
+
3
+ ## 导出源图
4
+
5
+ 使用本机已安装的 draw.io 桌面程序。脚本先检查指定的 `--drawio`,省略时查找 `DRAWIO_BIN`、macOS 应用或 PATH。以下命令从 Skill 目录运行,也可以用脚本的绝对路径。
6
+
7
+ ```bash
8
+ python3 scripts/export_drawio.py /path/to/figure.drawio --out-dir /path/to/export --width 4000
9
+ ```
10
+
11
+ `--page` 从 1 开始,默认导出第一页。脚本先在临时目录生成并检查 PNG、SVG,再写入目标目录,输出尺寸、文件路径和 SVG 诊断。需要替换已有导出时显式用 `--overwrite`。
12
+
13
+ SVG 的 HTML 标签、内嵌照片或外链资源可能影响不同阅读器的显示。脚本保留没有有效 SVG 回退的 HTML 标签,并提示检查实际显示。含照片的 WPS 几何图优先插入已核对的高清 PNG,源图和 SVG 留作编辑与交付。若 SVG 含外链图,先让源图包含所需素材再重新导出。
14
+
15
+ ## 字号与整页排版
16
+
17
+ 先确定图在最终 PPT 或论文里的展示宽度,再排模块。投屏时可将核心模块和公式以 22–28 pt 为起点,主要图例以 18–22 pt 为起点,按实际模板和内容调整。中文说明可以用 PPT 原生文本,贴近所解释的模块。短英文算子保持统一字号。
18
+
19
+ ```text
20
+ 最终字号(pt)≈ 源图字号(px)× 图片在 PPT 中的宽度(pt)÷ 源图宽度(px)
21
+ ```
22
+
23
+ 例如源图宽 1440 px,插入后宽 12 英寸(864 pt),源图 24 px 的字约为 14.4 pt。改变导出分辨率不会改变这个比例。字小就先缩短空连线、去掉重复标签或把细节拆到另一张图。期刊按最终栏宽检查,答辩按整页和实际放映尺寸检查。
24
+
25
+ ## WPS 可编辑表格和图表
26
+
27
+ - 按实验记录制作原生 PPTX 表格和图表。三线表仅留表顶、表头下方、表底三线,条件列左对齐,数字列精度一致。写清单位和条件,区分百分比与百分点。
28
+ - 图表内嵌可编辑数据工作簿。表用于查准确值,图用于看趋势或分布。柱状图从零起轴。图表标签应和数据系列对应,必要时把标签字号写到系列级 `c:ser/c:dLbls/c:txPr`,再核对 WPS 实际显示。
29
+ - 核对表格单元格、内嵌数据、标签、符号与精度。若只有示例数据,在图或图注里标明。
30
+
31
+ ## 替换目标页
32
+
33
+ 保存可恢复副本,按演示文稿顺序定位目标页。保留现有母版、标题和其他页面,确认目标页引用的媒体是本次定稿。先看整页渲染,再在用户使用的 WPS 或 PowerPoint 中重新打开核对。如果只完成了文件或离线渲染检查,交代实际验证范围。
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env python3
2
+ """Export one editable draw.io page to PNG/SVG without editing its source or a PPTX."""
3
+
4
+ import argparse
5
+ import hashlib
6
+ import json
7
+ import os
8
+ from pathlib import Path
9
+ import shutil
10
+ import struct
11
+ import subprocess
12
+ import sys
13
+ import tempfile
14
+ import xml.etree.ElementTree as ET
15
+
16
+ SVG = 'http://www.w3.org/2000/svg'
17
+ XLINK = 'http://www.w3.org/1999/xlink'
18
+ ET.register_namespace('', SVG)
19
+ ET.register_namespace('xlink', XLINK)
20
+
21
+
22
+ def local(tag):
23
+ return tag.rsplit('}', 1)[-1]
24
+
25
+
26
+ def sha(path):
27
+ return hashlib.sha256(path.read_bytes()).hexdigest()
28
+
29
+
30
+ def drawio_binary(explicit):
31
+ choices = [explicit, os.environ.get('DRAWIO_BIN'),
32
+ '/Applications/draw.io.app/Contents/MacOS/draw.io',
33
+ shutil.which('drawio'), shutil.which('draw.io')]
34
+ for item in choices:
35
+ if not item:
36
+ continue
37
+ found = shutil.which(str(item)) or str(Path(item).expanduser())
38
+ if Path(found).is_file() and os.access(found, os.X_OK):
39
+ return str(Path(found).resolve())
40
+ if explicit:
41
+ break
42
+ raise ValueError('Cannot find draw.io. Pass --drawio with an installed executable.')
43
+
44
+
45
+ def is_svg_warning(value):
46
+ return value.startswith('Text is not SVG') and 'cannot display' in value
47
+
48
+
49
+ def has_displayable_content(element):
50
+ tag = local(element.tag)
51
+ if tag == 'text':
52
+ value = ''.join(element.itertext()).strip()
53
+ return bool(value) and not is_svg_warning(value)
54
+ if tag == 'path':
55
+ return bool(element.get('d', '').strip())
56
+ if tag in {'image', 'use'}:
57
+ return bool((element.get('href') or element.get('{'+XLINK+'}href', '')).strip())
58
+ return False
59
+
60
+
61
+ def clean_svg(path):
62
+ tree = ET.parse(path)
63
+ root = tree.getroot()
64
+ if local(root.tag) != 'svg':
65
+ raise ValueError('Export is not an SVG document')
66
+ unfolded = 0
67
+ for parent in list(root.iter()):
68
+ for switch in list(parent):
69
+ if local(switch.tag) != 'switch':
70
+ continue
71
+ fallback = [x for x in switch if local(x.tag) != 'foreignObject']
72
+ # Never discard an HTML-only label just because foreignObject is less portable.
73
+ if not any(has_displayable_content(x) for branch in fallback for x in branch.iter()):
74
+ continue
75
+ at = list(parent).index(switch)
76
+ parent.remove(switch)
77
+ for child in fallback:
78
+ parent.insert(at, child)
79
+ at += 1
80
+ unfolded += 1
81
+ removed_messages = 0
82
+ for parent in list(root.iter()):
83
+ for child in list(parent):
84
+ if local(child.tag) == 'text':
85
+ text = ''.join(child.itertext()).strip()
86
+ if is_svg_warning(text):
87
+ parent.remove(child)
88
+ removed_messages += 1
89
+ images = [x for x in root.iter() if local(x.tag) == 'image']
90
+ embedded = 0
91
+ external = []
92
+ for image in images:
93
+ href = image.get('href', image.get('{'+XLINK+'}href', ''))
94
+ if href.startswith('data:image/'):
95
+ embedded += 1
96
+ elif not href.startswith('#'):
97
+ external.append(href)
98
+ html_count = sum(local(x.tag) == 'foreignObject' for x in root.iter())
99
+ tree.write(path, encoding='utf-8', xml_declaration=True)
100
+ return {'switches_unfolded': unfolded, 'fallback_messages_removed': removed_messages,
101
+ 'remaining_foreign_objects': html_count, 'embedded_raster_images': embedded,
102
+ 'external_image_count': len(external),
103
+ 'recommended_ppt_media': 'png' if embedded or html_count or external else 'png_or_verified_svg'}
104
+
105
+
106
+ def png_dimensions(path):
107
+ with path.open('rb') as f:
108
+ header = f.read(24)
109
+ if len(header) < 24 or header[:8] != b'\x89PNG\r\n\x1a\n' or header[12:16] != b'IHDR':
110
+ raise ValueError('Export is not a valid PNG header')
111
+ width, height = struct.unpack('>II', header[16:24])
112
+ if width <= 0 or height <= 0:
113
+ raise ValueError('PNG has invalid dimensions')
114
+ return width, height
115
+
116
+
117
+ def run(args):
118
+ source = Path(args.source).expanduser().resolve()
119
+ out_dir = Path(args.out_dir).expanduser().resolve()
120
+ if not source.is_file():
121
+ raise ValueError(f'Source does not exist: {source}')
122
+ if source.suffix.lower() not in {'.drawio', '.xml'}:
123
+ raise ValueError('Provide a .drawio or draw.io XML source')
124
+ if args.width < 100 or args.page < 1 or args.timeout <= 0:
125
+ raise ValueError('Use width >= 100, page >= 1 and a positive timeout')
126
+ stem = args.stem or source.stem
127
+ if stem in {'.', '..'} or Path(stem).name != stem or '/' in stem or '\\' in stem:
128
+ raise ValueError('--stem must be a filename stem, not a path')
129
+ targets = {fmt: out_dir/f'{stem}.{fmt}' for fmt in ['png', 'svg']}
130
+ if not args.overwrite:
131
+ exists = [str(p) for p in targets.values() if p.exists()]
132
+ if exists:
133
+ raise ValueError('Outputs already exist; use --overwrite deliberately: '+', '.join(exists))
134
+ binary = drawio_binary(args.drawio)
135
+ source_hash = sha(source)
136
+ out_dir.mkdir(parents=True, exist_ok=True)
137
+ with tempfile.TemporaryDirectory(prefix='drawio-export-', dir=out_dir) as temporary:
138
+ stage = Path(temporary)
139
+ for fmt in ['png', 'svg']:
140
+ command = [binary, '--export', '--theme', 'light', '--size', 'page',
141
+ '--format', fmt, '--page-index', str(args.page),
142
+ '--timeout', str(args.timeout), '--output', str(stage/f'{stem}.{fmt}')]
143
+ command += ['--width', str(args.width)] if fmt == 'png' else [
144
+ '--embed-svg-images', '--embed-svg-fonts', 'false']
145
+ command += [str(source)]
146
+ done = subprocess.run(command, capture_output=True, text=True, timeout=args.timeout+10)
147
+ if done.returncode != 0:
148
+ raise RuntimeError(f'draw.io {fmt} export failed: {(done.stderr or done.stdout)[-2000:]}')
149
+ result = stage/f'{stem}.{fmt}'
150
+ if not result.is_file() or result.stat().st_size == 0:
151
+ raise RuntimeError(f'draw.io did not produce {fmt} output')
152
+ width, height = png_dimensions(stage/f'{stem}.png')
153
+ svg_info = clean_svg(stage/f'{stem}.svg')
154
+ if sha(source) != source_hash:
155
+ raise RuntimeError('The source changed during export; outputs were not published')
156
+ for fmt, destination in targets.items():
157
+ if destination.exists() and not args.overwrite:
158
+ raise RuntimeError(f'Output appeared during export: {destination}')
159
+ for fmt, destination in targets.items():
160
+ os.replace(stage/f'{stem}.{fmt}', destination)
161
+ warnings = []
162
+ if svg_info['embedded_raster_images']:
163
+ warnings.append('For WPS photo overlays, insert the PNG; embedded SVG photos may be omitted.')
164
+ if svg_info['remaining_foreign_objects']:
165
+ warnings.append('SVG still has HTML-only content; inspect labels in the actual target application.')
166
+ if svg_info['external_image_count']:
167
+ warnings.append('SVG contains non-embedded images; make the source self-contained and export again.')
168
+ return {'source': str(source), 'source_sha256': source_hash, 'page': args.page,
169
+ 'drawio_executable': binary, 'png_dimensions': [width, height], 'svg': svg_info,
170
+ 'outputs': {fmt: {'path': str(p), 'sha256': sha(p)} for fmt, p in targets.items()},
171
+ 'warnings': warnings}
172
+
173
+
174
+ def main():
175
+ parser = argparse.ArgumentParser(description=__doc__)
176
+ parser.add_argument('source')
177
+ parser.add_argument('--out-dir', required=True)
178
+ parser.add_argument('--width', type=int, default=4000)
179
+ parser.add_argument('--page', type=int, default=1, help='1-based draw.io page index')
180
+ parser.add_argument('--stem')
181
+ parser.add_argument('--drawio')
182
+ parser.add_argument('--timeout', type=int, default=60)
183
+ parser.add_argument('--overwrite', action='store_true')
184
+ args = parser.parse_args()
185
+ try:
186
+ print(json.dumps(run(args), ensure_ascii=False, indent=2))
187
+ except (ValueError, RuntimeError, OSError, ET.ParseError, subprocess.TimeoutExpired) as exc:
188
+ print(json.dumps({'error': str(exc)}, ensure_ascii=False), file=sys.stderr)
189
+ return 1
190
+ return 0
191
+
192
+
193
+ if __name__ == '__main__':
194
+ raise SystemExit(main())
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: git-commit-staged
2
+ name: git-commit
3
3
  description: Generate a Chinese Conventional Commit message from Git staged changes and execute exactly one safe commit. Use when the user explicitly asks Codex to commit the current staged changes, says “提交暂存区”, “帮我 commit”, or invokes this skill; do not use for merely explaining Git or reviewing changes without authorization to commit.
4
4
  ---
5
5
 
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "提交暂存区变更"
3
3
  short_description: "生成中文 Conventional Commit 并安全提交暂存区"
4
- default_prompt: "Use $git-commit-staged to commit the current staged changes."
4
+ default_prompt: "Use $git-commit to commit the current staged changes."
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: git-submit
3
+ description: "在当前个人分支完成工作区暂存、中文 Conventional Commit、主干同步及推送,供用户随后提交 PR。适用于用户明确要求执行个人分支提交流程;用户指定只暂存、只提交或只核对时按指定范围执行。"
4
+ ---
5
+
6
+ # 个人分支提交与同步
7
+
8
+ 默认流程为检查分支、暂存工作区、提交、同步最新主干、推送个人分支。用户明确要求执行这套流程时,这些步骤均在本次授权范围内。仅展示、审核或讨论 Skill 时执行只读操作。用户明确限定文件或步骤时,以该次要求为准。
9
+
10
+ ## 确认仓库和分支
11
+
12
+ - 读取仓库约定,定位仓库根目录,核对当前分支、upstream、远端、工作树和暂存区。目标主干依次取自用户明确要求、已有 PR 或仓库约定、远端默认分支。优先用 upstream 确定推送远端与目标分支;没有 upstream 时使用唯一可确认的远端和当前同名分支。多个候选无法确定时说明具体候选,请用户选择。
13
+ - 当前分支为 `main`、`master` 或已确定的目标主干时,报告分支并暂停写操作。detached HEAD 或存在未结束的 merge、rebase、cherry-pick、revert 时,同样先报告状态。用户明确授权对应的分支处理后再继续。
14
+ - 检查推送目标也属于个人分支。upstream 若指向 `main`、`master` 或目标主干,应先明确正确目标。记录已确定的个人分支、远端和主干,后续操作均在该个人分支执行。
15
+
16
+ ## 暂存工作区
17
+
18
+ - 默认从仓库根目录执行 `git add -A`,包含本仓库全部未忽略的新增、修改和删除。用户指定文件或变更块时只暂存对应范围;已有暂存内容超出该范围时先说明并确认归属,保留其原有状态。
19
+ - 核对 `git diff --cached --stat`、`git diff --cached --name-status` 和完整暂存差异,运行 `git diff --cached --check` 及仓库要求的相关检查。检查失败时报告原因和已暂存范围,按用户授权处理后再继续。
20
+ - 暂存区为空时跳过业务提交。完整流程继续核对同步与推送;用户只要求本地提交时报告没有可提交的改动。
21
+
22
+ ## 提交当前改动
23
+
24
+ - 使用 `<type>(<scope>): <主题>`,scope 不明确时省略。按实际影响选择 `feat`、`fix`、`refactor`、`style`、`docs`、`test`、`chore`、`perf`、`build`、`ci` 或 `revert`。默认用中文写主题和可选正文,用户明确要求英文时均改用英文。主题写清本次实际变化,必要时用正文补充重要细节。
25
+ - 报告拟使用的提交信息后执行一次普通 `git commit`,保留 hooks。用独立参数或消息文件传给 Git,预先去掉 `Co-authored-by:` 尾注。提交失败时报告具体原因、工作区和暂存区状态,停止后续同步与推送,保留现有修改。
26
+ - 成功后核对实际提交信息、提交编号及文件范围。实际信息若仍含 `Co-authored-by:` 尾注,或 hooks 带入范围外的内容,报告差异并暂停后续步骤,不自行 amend、跳过 hooks 或重写历史。必要的主干合并提交属于后续同步步骤。
27
+
28
+ ## 同步最新主干
29
+
30
+ - 业务提交后重新检查工作区和暂存区。存在剩余已跟踪改动或暂存内容时暂停同步并报告;新出现的未跟踪文件需确认不会被合并覆盖。同步前保持当前修改可恢复,不自动 stash、丢弃或把检查产物混入提交。
31
+ - fetch 已确定的主干及远端个人分支,记录最新主干完整 SHA。fetch 失败时停止同步并报告已经完成的提交。远端个人分支存在且不是本地 `HEAD` 的祖先时,报告领先或分叉的提交,等待确定同步方式。
32
+ - 使用已 fetch 的远端主干检查祖先关系。主干已经是 `HEAD` 的祖先时直接核对差异;当前分支可快进时使用 `git merge --ff-only`。两边分叉时使用 `git merge --no-ff --no-commit`,先检查合并后的差异和相关验证,再创建一条独立同步提交。同步提交沿用提交语言、hooks 和尾注规则。
33
+ - 遇到冲突时核对双方的业务变更,在已明确的需求内处理。无法确定取舍时说明具体文件与冲突,保留当前状态并暂停。验证失败时报告合并状态和原因,待处理后继续。
34
+ - 合并完成后确认最新主干是 `HEAD` 的祖先,再检查 `git diff <远端主干>...HEAD` 是否符合本次功能范围、是否带入旧功能。Squash 合并后仍按实际祖先关系同步。树内容未变化时,可复用同一份代码的验证结果。
35
+
36
+ ## 推送个人分支
37
+
38
+ - 完整流程在同步及检查通过后执行推送。用户只要求暂存或本地提交时,完成对应步骤即可。
39
+ - 推送前重新核对当前分支、远端与目标个人分支,检查远端最新指针。存在远端分支时 fetch 并确认它已包含在本地历史中;发现并行更新时报告差异。使用普通 push,由 Git 处理检查后再次出现的远端竞争。
40
+ - 显式推送 `HEAD:refs/heads/<个人分支>` 到已确定远端。首次推送使用 `--set-upstream`。推送失败时报告原因和已完成步骤;成功后用远端分支指针核对是否等于本地 `HEAD`,不一致时报告并行更新。
41
+ - 流程终点是个人分支推送成功,由用户继续提交 PR。改写历史、强推、创建或合并 PR、打 tag、部署均需要各自的明确授权。
42
+
43
+ ## 交付
44
+
45
+ 按实际完成的步骤报告个人分支、暂存文件范围、提交信息与编号、验证结果和工作区状态。执行过主干同步时补充主干 SHA 与合并结果,执行过推送时补充远端、目标分支及核对结果。中途停止时说明已完成步骤、当前 Git 状态和剩余工作。
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "个人分支提交与同步"
3
+ short_description: "核对个人分支,暂存工作区并中文提交,同步最新主干后推送,供用户提交 PR"
4
+ default_prompt: "使用 $git-submit,检查当前个人分支,暂存工作区改动并提交,同步最新主干后推送个人分支。"
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: document-project-readme
2
+ name: readme
3
3
  description: Create or update a GitHub-ready README.md by inspecting the real project structure, dependencies, scripts, and implemented features. Use when the user asks to generate, rewrite, improve, or document a project's README; never invent unverified features or configuration.
4
4
  ---
5
5
 
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "生成项目 README"
3
3
  short_description: "基于真实项目结构生成专业 README 文档"
4
- default_prompt: "Use $document-project-readme to create or update this project README."
4
+ default_prompt: "Use $readme to create or update this project README."