mtkit 1.16.2__tar.gz → 1.16.3__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.
Files changed (40) hide show
  1. mtkit-1.16.3/PKG-INFO +174 -0
  2. mtkit-1.16.3/README.md +147 -0
  3. mtkit-1.16.3/mtkit.egg-info/PKG-INFO +174 -0
  4. {mtkit-1.16.2 → mtkit-1.16.3}/pyproject.toml +1 -1
  5. mtkit-1.16.2/PKG-INFO +0 -174
  6. mtkit-1.16.2/README.md +0 -147
  7. mtkit-1.16.2/mtkit.egg-info/PKG-INFO +0 -174
  8. {mtkit-1.16.2 → mtkit-1.16.3}/MANIFEST.in +0 -0
  9. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/__init__.py +0 -0
  10. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/__main__.py +0 -0
  11. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/asset.py +0 -0
  12. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/audit.py +0 -0
  13. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/builder.py +0 -0
  14. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/cli.py +0 -0
  15. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/conf.py +0 -0
  16. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/coverage.py +0 -0
  17. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/db.py +0 -0
  18. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/evolve.py +0 -0
  19. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/extract/__init__.py +0 -0
  20. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/extract/code_facts.py +0 -0
  21. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/extract/docx_loader.py +0 -0
  22. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/extract/xmind_loader.py +0 -0
  23. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/generate/__init__.py +0 -0
  24. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/generate/llm.py +0 -0
  25. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/generate/prompts.py +0 -0
  26. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/generate/skeleton.py +0 -0
  27. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/normalize.py +0 -0
  28. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/parsers.py +0 -0
  29. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/review.py +0 -0
  30. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/selfheal.py +0 -0
  31. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/tb.py +0 -0
  32. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/track.py +0 -0
  33. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/validator.py +0 -0
  34. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit/writer.py +0 -0
  35. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit.egg-info/SOURCES.txt +0 -0
  36. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit.egg-info/dependency_links.txt +0 -0
  37. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit.egg-info/entry_points.txt +0 -0
  38. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit.egg-info/requires.txt +0 -0
  39. {mtkit-1.16.2 → mtkit-1.16.3}/mtkit.egg-info/top_level.txt +0 -0
  40. {mtkit-1.16.2 → mtkit-1.16.3}/setup.cfg +0 -0
mtkit-1.16.3/PKG-INFO ADDED
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: mtkit
3
+ Version: 1.16.3
4
+ Summary: AI 全站测试工程师:计划先行生成标准 XMind 测试用例(质量门禁把关),用例资产体检修复,交互式测试咨询与问题定位指导,使用即训练、越用越成熟
5
+ Author: mtkit
6
+ License-Expression: MIT
7
+ Keywords: testing,xmind,test-case,ai,qoder
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Testing
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ Provides-Extra: docx
21
+ Requires-Dist: python-docx; extra == "docx"
22
+ Provides-Extra: mysql
23
+ Requires-Dist: pymysql; extra == "mysql"
24
+ Provides-Extra: all
25
+ Requires-Dist: python-docx; extra == "all"
26
+ Requires-Dist: pymysql; extra == "all"
27
+
28
+ # mtkit — AI Full-Stack Test Engineer
29
+
30
+ Plan-first generation of standard XMind test cases (quality-gated), health checks and repair of test case assets, interactive test consulting and issue diagnosis guidance. It learns with every use and matures over time.
31
+
32
+ ## Pipeline
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ IN[Input: plan.docx + sample.xmind + backend repo + custom docs] --> READ[Read & document health check]
37
+ READ --> FACTS[Code facts scan<br/>9 languages / SQL]
38
+ FACTS --> PLAN[Test case output plan<br/>design methods + builder advice]
39
+ PLAN --> AUTH{Authorization}
40
+ AUTH -->|confirm| CONTRACT[Contract JSON]
41
+ CONTRACT --> GATE[Quality gate<br/>review + AI audit]
42
+ GATE --> RENDER[Render XMind]
43
+ RENDER --> CHECK[Validate + gap comparison]
44
+ CHECK --> OUT[Delivery: XMind + defect summary + work traces]
45
+ ```
46
+
47
+ ## Quick Start (Zero Dependencies)
48
+
49
+ ```bash
50
+ # 1. Generate XMind (pure standard library, no installation required)
51
+ cd d:\mtkit
52
+ mtkit gen -i examples/sample.json -o cases.xmind
53
+
54
+ # 2. Validate & inspect
55
+ mtkit validate -i cases.xmind
56
+ mtkit info -i cases.xmind
57
+ ```
58
+
59
+ Optional dependencies (install only when used): `.docx` parsing `pip install python-docx`; direct DB access `pip install pymysql`.
60
+
61
+ ## One-Click Install (with Qoder plugin registration & optional deps)
62
+
63
+ ```bash
64
+ # Option 1 (recommended, zero setup on new machines): install CLI from PyPI
65
+ pip install mtkit
66
+
67
+ # Option 2: run in the repo root (optional deps installed automatically)
68
+ python install.py # or double-click install.bat
69
+
70
+ # Option 3: provide a git URL to fetch and install automatically
71
+ python install.py --git <git-url> [--dir target-dir]
72
+ ```
73
+
74
+ After installation, **restart Qoder**; typing `/` in the chat should list `mtkit-gen-xmind`, or trigger it with natural language.
75
+
76
+ > Qoder plugin registration: `skills/` and `commands/` are not shipped in the PyPI package. After `pip install`,
77
+ > run `mtkit install --git <git-url>` (or set the `MTKIT_INSTALL_GIT` env var first) to fetch the full repo and register the plugins.
78
+
79
+ ## Commands
80
+
81
+ | Command | Purpose | Example |
82
+ |---|---|---|
83
+ | `gen` | Contract/data → .xmind | `mtkit gen -i contract.json -o cases.xmind` |
84
+ | `gather` | Plan + samples + code → context | `mtkit gather -i plan.docx --hist sample.xmind -r backend -o ctx.json` |
85
+ | `facts` | 9-language code facts scan | `mtkit facts -r backend -o facts.json` |
86
+ | `review` | Contract quality gate | `mtkit review -i contract.json -f facts.json` |
87
+ | `audit` | Test asset health check (find unfit cases) | `mtkit audit -i legacy.xmind -f facts.json` |
88
+ | `db` | Read-only DB access (check/schema/verify) | `mtkit db verify -c db.json -i contract.json` |
89
+ | `validate` / `info` | Validate / inspect .xmind | `mtkit validate -i cases.xmind` |
90
+ | `diff` | Missed-test gap comparison | `mtkit diff -i cases.xmind -f facts.json -d plan.docx` |
91
+ | `contract` / `tree` | Cases ↔ contract conversion / restore tree | `mtkit contract -i cases.xmind -o contract.json` |
92
+ | `track` | Test management: execution records/reports/trends | `mtkit track record --case case --result pass` |
93
+ | `bug` | Defect library: add/list/close/stats | `mtkit bug add --title defect --severity P1` |
94
+ | `evolve` | Self-evolution: backup/restore/list/cleanup | `mtkit evolve backup file` |
95
+ | `asset` | Test asset aging detection (governance) | `mtkit asset --dir output-dir --days 30` |
96
+
97
+ Contract format (the single input convention):
98
+
99
+ ```json
100
+ {"chapters":[{"t":"Chapter","cases":[{"t":"tc-P0-Functional: case name",
101
+ "pc":["preconditions"],"steps":["steps"],"expects":["expected"],"sql":["SELECT ..."]}]}]}
102
+ ```
103
+
104
+ ## Database Access (Optional, Strictly Read-Only)
105
+
106
+ Four data sources in `db.json` (via the `type` field):
107
+
108
+ ```json
109
+ {"type":"cli","connect":{"cmd":"mysql -h{host} -u{user} -p{pass} {db} -N -e \"{sql}\"","host":"10.0.0.1","user":"ro","pass":"${DB_PASS}","db":"bill_db"}}
110
+ {"type":"driver","driver":"pymysql","host":"10.0.0.1","user":"ro","password":"${DB_PASS}","db":"bill_db"}
111
+ {"type":"http","url":"https://gw.example.com/query","token":"${DB_TOKEN}"}
112
+ {"type":"file","path":"schema.json"}
113
+ ```
114
+
115
+ Only SELECT/EXPLAIN/DESC/SHOW are allowed; all write operations are rejected. Passwords use `${ENV_VAR}` environment variables.
116
+
117
+ ## Qoder Integration (2 Steps)
118
+
119
+ 1. Qoder plugin manager → local plugin → select `d:\mtkit`
120
+ 2. Chat prompts:
121
+ - Generate cases: "Use mtkit to generate XMind test cases: plan xxx.docx, sample xxx.xmind, backend repo xxx"
122
+ - Test consulting: "How should I test this feature?" / "The production error, help me look into it" / "Is this a bug?"
123
+
124
+ ## Skill Sequence
125
+
126
+ ```mermaid
127
+ sequenceDiagram
128
+ participant U as User
129
+ participant A as AI (test builder)
130
+ U->>A: Provide the three inputs + optional docs/db
131
+ A->>U: Document health check (defects + advice, confirm item by item)
132
+ A->>A: gather + facts + experience library loading
133
+ A->>U: Test case output plan (design methods + builder advice)
134
+ U->>A: Authorization (can add/remove/adjust)
135
+ A->>A: Generate contract → quality gate → fix loop
136
+ A->>U: Case adjustment suggestions (confirm item by item)
137
+ A->>A: Render XMind → validate → gap comparison
138
+ A->>U: Delivery (XMind / defect summary / work traces) + training
139
+ ```
140
+
141
+ ## Iterative Updates (Editable Install, No Reinstall Needed)
142
+
143
+ ```bash
144
+ pip install --force-reinstall --no-deps -e d:\mtkit # only when needed
145
+ python -m unittest # self-check
146
+ ```
147
+
148
+ - Plugin side: repo file updates take effect immediately; only `plugin.json` version changes require a Qoder restart
149
+ - **Self-iteration**: improvements discovered by the AI during use are written to `.mtkit-work/improvements.json`; with `auto_improve` enabled in `.mtkit.json` and authorization granted, the AI can optimize itself and self-verify (see skills docs)
150
+ - Details: see [CHANGELOG.md](CHANGELOG.md) and [skills/mtkit-gen-xmind/](skills/mtkit-gen-xmind/) (skills & conventions)
151
+
152
+ ## PyPI Release (Maintainer Guide)
153
+
154
+ ```bash
155
+ # 1. Build
156
+ python -m pip install build twine
157
+ python -m build # produces dist/mtkit-<version>.tar.gz + .whl
158
+
159
+ # 2. Recommended: verify on TestPyPI first
160
+ python -m twine upload --repository testpypi dist/*
161
+ pip install -i https://test.pypi.org/simple/ mtkit
162
+ mtkit --help # verify the CLI
163
+
164
+ # 3. Publish officially after verification (requires project-level API token + PyPI account 2FA)
165
+ python -m twine upload dist/* # enter API token
166
+ ```
167
+
168
+ Installation flow for new teammates after release (final form):
169
+
170
+ ```bash
171
+ pip install mtkit # installs only the Python CLI (pure stdlib, installs in seconds)
172
+ mtkit install --git <git-url> # fetches the full repo + registers Qoder plugins (requires intranet repo URL)
173
+ # restart Qoder → / lists mtkit-gen-xmind
174
+ ```
mtkit-1.16.3/README.md ADDED
@@ -0,0 +1,147 @@
1
+ # mtkit — AI Full-Stack Test Engineer
2
+
3
+ Plan-first generation of standard XMind test cases (quality-gated), health checks and repair of test case assets, interactive test consulting and issue diagnosis guidance. It learns with every use and matures over time.
4
+
5
+ ## Pipeline
6
+
7
+ ```mermaid
8
+ flowchart LR
9
+ IN[Input: plan.docx + sample.xmind + backend repo + custom docs] --> READ[Read & document health check]
10
+ READ --> FACTS[Code facts scan<br/>9 languages / SQL]
11
+ FACTS --> PLAN[Test case output plan<br/>design methods + builder advice]
12
+ PLAN --> AUTH{Authorization}
13
+ AUTH -->|confirm| CONTRACT[Contract JSON]
14
+ CONTRACT --> GATE[Quality gate<br/>review + AI audit]
15
+ GATE --> RENDER[Render XMind]
16
+ RENDER --> CHECK[Validate + gap comparison]
17
+ CHECK --> OUT[Delivery: XMind + defect summary + work traces]
18
+ ```
19
+
20
+ ## Quick Start (Zero Dependencies)
21
+
22
+ ```bash
23
+ # 1. Generate XMind (pure standard library, no installation required)
24
+ cd d:\mtkit
25
+ mtkit gen -i examples/sample.json -o cases.xmind
26
+
27
+ # 2. Validate & inspect
28
+ mtkit validate -i cases.xmind
29
+ mtkit info -i cases.xmind
30
+ ```
31
+
32
+ Optional dependencies (install only when used): `.docx` parsing `pip install python-docx`; direct DB access `pip install pymysql`.
33
+
34
+ ## One-Click Install (with Qoder plugin registration & optional deps)
35
+
36
+ ```bash
37
+ # Option 1 (recommended, zero setup on new machines): install CLI from PyPI
38
+ pip install mtkit
39
+
40
+ # Option 2: run in the repo root (optional deps installed automatically)
41
+ python install.py # or double-click install.bat
42
+
43
+ # Option 3: provide a git URL to fetch and install automatically
44
+ python install.py --git <git-url> [--dir target-dir]
45
+ ```
46
+
47
+ After installation, **restart Qoder**; typing `/` in the chat should list `mtkit-gen-xmind`, or trigger it with natural language.
48
+
49
+ > Qoder plugin registration: `skills/` and `commands/` are not shipped in the PyPI package. After `pip install`,
50
+ > run `mtkit install --git <git-url>` (or set the `MTKIT_INSTALL_GIT` env var first) to fetch the full repo and register the plugins.
51
+
52
+ ## Commands
53
+
54
+ | Command | Purpose | Example |
55
+ |---|---|---|
56
+ | `gen` | Contract/data → .xmind | `mtkit gen -i contract.json -o cases.xmind` |
57
+ | `gather` | Plan + samples + code → context | `mtkit gather -i plan.docx --hist sample.xmind -r backend -o ctx.json` |
58
+ | `facts` | 9-language code facts scan | `mtkit facts -r backend -o facts.json` |
59
+ | `review` | Contract quality gate | `mtkit review -i contract.json -f facts.json` |
60
+ | `audit` | Test asset health check (find unfit cases) | `mtkit audit -i legacy.xmind -f facts.json` |
61
+ | `db` | Read-only DB access (check/schema/verify) | `mtkit db verify -c db.json -i contract.json` |
62
+ | `validate` / `info` | Validate / inspect .xmind | `mtkit validate -i cases.xmind` |
63
+ | `diff` | Missed-test gap comparison | `mtkit diff -i cases.xmind -f facts.json -d plan.docx` |
64
+ | `contract` / `tree` | Cases ↔ contract conversion / restore tree | `mtkit contract -i cases.xmind -o contract.json` |
65
+ | `track` | Test management: execution records/reports/trends | `mtkit track record --case case --result pass` |
66
+ | `bug` | Defect library: add/list/close/stats | `mtkit bug add --title defect --severity P1` |
67
+ | `evolve` | Self-evolution: backup/restore/list/cleanup | `mtkit evolve backup file` |
68
+ | `asset` | Test asset aging detection (governance) | `mtkit asset --dir output-dir --days 30` |
69
+
70
+ Contract format (the single input convention):
71
+
72
+ ```json
73
+ {"chapters":[{"t":"Chapter","cases":[{"t":"tc-P0-Functional: case name",
74
+ "pc":["preconditions"],"steps":["steps"],"expects":["expected"],"sql":["SELECT ..."]}]}]}
75
+ ```
76
+
77
+ ## Database Access (Optional, Strictly Read-Only)
78
+
79
+ Four data sources in `db.json` (via the `type` field):
80
+
81
+ ```json
82
+ {"type":"cli","connect":{"cmd":"mysql -h{host} -u{user} -p{pass} {db} -N -e \"{sql}\"","host":"10.0.0.1","user":"ro","pass":"${DB_PASS}","db":"bill_db"}}
83
+ {"type":"driver","driver":"pymysql","host":"10.0.0.1","user":"ro","password":"${DB_PASS}","db":"bill_db"}
84
+ {"type":"http","url":"https://gw.example.com/query","token":"${DB_TOKEN}"}
85
+ {"type":"file","path":"schema.json"}
86
+ ```
87
+
88
+ Only SELECT/EXPLAIN/DESC/SHOW are allowed; all write operations are rejected. Passwords use `${ENV_VAR}` environment variables.
89
+
90
+ ## Qoder Integration (2 Steps)
91
+
92
+ 1. Qoder plugin manager → local plugin → select `d:\mtkit`
93
+ 2. Chat prompts:
94
+ - Generate cases: "Use mtkit to generate XMind test cases: plan xxx.docx, sample xxx.xmind, backend repo xxx"
95
+ - Test consulting: "How should I test this feature?" / "The production error, help me look into it" / "Is this a bug?"
96
+
97
+ ## Skill Sequence
98
+
99
+ ```mermaid
100
+ sequenceDiagram
101
+ participant U as User
102
+ participant A as AI (test builder)
103
+ U->>A: Provide the three inputs + optional docs/db
104
+ A->>U: Document health check (defects + advice, confirm item by item)
105
+ A->>A: gather + facts + experience library loading
106
+ A->>U: Test case output plan (design methods + builder advice)
107
+ U->>A: Authorization (can add/remove/adjust)
108
+ A->>A: Generate contract → quality gate → fix loop
109
+ A->>U: Case adjustment suggestions (confirm item by item)
110
+ A->>A: Render XMind → validate → gap comparison
111
+ A->>U: Delivery (XMind / defect summary / work traces) + training
112
+ ```
113
+
114
+ ## Iterative Updates (Editable Install, No Reinstall Needed)
115
+
116
+ ```bash
117
+ pip install --force-reinstall --no-deps -e d:\mtkit # only when needed
118
+ python -m unittest # self-check
119
+ ```
120
+
121
+ - Plugin side: repo file updates take effect immediately; only `plugin.json` version changes require a Qoder restart
122
+ - **Self-iteration**: improvements discovered by the AI during use are written to `.mtkit-work/improvements.json`; with `auto_improve` enabled in `.mtkit.json` and authorization granted, the AI can optimize itself and self-verify (see skills docs)
123
+ - Details: see [CHANGELOG.md](CHANGELOG.md) and [skills/mtkit-gen-xmind/](skills/mtkit-gen-xmind/) (skills & conventions)
124
+
125
+ ## PyPI Release (Maintainer Guide)
126
+
127
+ ```bash
128
+ # 1. Build
129
+ python -m pip install build twine
130
+ python -m build # produces dist/mtkit-<version>.tar.gz + .whl
131
+
132
+ # 2. Recommended: verify on TestPyPI first
133
+ python -m twine upload --repository testpypi dist/*
134
+ pip install -i https://test.pypi.org/simple/ mtkit
135
+ mtkit --help # verify the CLI
136
+
137
+ # 3. Publish officially after verification (requires project-level API token + PyPI account 2FA)
138
+ python -m twine upload dist/* # enter API token
139
+ ```
140
+
141
+ Installation flow for new teammates after release (final form):
142
+
143
+ ```bash
144
+ pip install mtkit # installs only the Python CLI (pure stdlib, installs in seconds)
145
+ mtkit install --git <git-url> # fetches the full repo + registers Qoder plugins (requires intranet repo URL)
146
+ # restart Qoder → / lists mtkit-gen-xmind
147
+ ```
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: mtkit
3
+ Version: 1.16.3
4
+ Summary: AI 全站测试工程师:计划先行生成标准 XMind 测试用例(质量门禁把关),用例资产体检修复,交互式测试咨询与问题定位指导,使用即训练、越用越成熟
5
+ Author: mtkit
6
+ License-Expression: MIT
7
+ Keywords: testing,xmind,test-case,ai,qoder
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Testing
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ Provides-Extra: docx
21
+ Requires-Dist: python-docx; extra == "docx"
22
+ Provides-Extra: mysql
23
+ Requires-Dist: pymysql; extra == "mysql"
24
+ Provides-Extra: all
25
+ Requires-Dist: python-docx; extra == "all"
26
+ Requires-Dist: pymysql; extra == "all"
27
+
28
+ # mtkit — AI Full-Stack Test Engineer
29
+
30
+ Plan-first generation of standard XMind test cases (quality-gated), health checks and repair of test case assets, interactive test consulting and issue diagnosis guidance. It learns with every use and matures over time.
31
+
32
+ ## Pipeline
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ IN[Input: plan.docx + sample.xmind + backend repo + custom docs] --> READ[Read & document health check]
37
+ READ --> FACTS[Code facts scan<br/>9 languages / SQL]
38
+ FACTS --> PLAN[Test case output plan<br/>design methods + builder advice]
39
+ PLAN --> AUTH{Authorization}
40
+ AUTH -->|confirm| CONTRACT[Contract JSON]
41
+ CONTRACT --> GATE[Quality gate<br/>review + AI audit]
42
+ GATE --> RENDER[Render XMind]
43
+ RENDER --> CHECK[Validate + gap comparison]
44
+ CHECK --> OUT[Delivery: XMind + defect summary + work traces]
45
+ ```
46
+
47
+ ## Quick Start (Zero Dependencies)
48
+
49
+ ```bash
50
+ # 1. Generate XMind (pure standard library, no installation required)
51
+ cd d:\mtkit
52
+ mtkit gen -i examples/sample.json -o cases.xmind
53
+
54
+ # 2. Validate & inspect
55
+ mtkit validate -i cases.xmind
56
+ mtkit info -i cases.xmind
57
+ ```
58
+
59
+ Optional dependencies (install only when used): `.docx` parsing `pip install python-docx`; direct DB access `pip install pymysql`.
60
+
61
+ ## One-Click Install (with Qoder plugin registration & optional deps)
62
+
63
+ ```bash
64
+ # Option 1 (recommended, zero setup on new machines): install CLI from PyPI
65
+ pip install mtkit
66
+
67
+ # Option 2: run in the repo root (optional deps installed automatically)
68
+ python install.py # or double-click install.bat
69
+
70
+ # Option 3: provide a git URL to fetch and install automatically
71
+ python install.py --git <git-url> [--dir target-dir]
72
+ ```
73
+
74
+ After installation, **restart Qoder**; typing `/` in the chat should list `mtkit-gen-xmind`, or trigger it with natural language.
75
+
76
+ > Qoder plugin registration: `skills/` and `commands/` are not shipped in the PyPI package. After `pip install`,
77
+ > run `mtkit install --git <git-url>` (or set the `MTKIT_INSTALL_GIT` env var first) to fetch the full repo and register the plugins.
78
+
79
+ ## Commands
80
+
81
+ | Command | Purpose | Example |
82
+ |---|---|---|
83
+ | `gen` | Contract/data → .xmind | `mtkit gen -i contract.json -o cases.xmind` |
84
+ | `gather` | Plan + samples + code → context | `mtkit gather -i plan.docx --hist sample.xmind -r backend -o ctx.json` |
85
+ | `facts` | 9-language code facts scan | `mtkit facts -r backend -o facts.json` |
86
+ | `review` | Contract quality gate | `mtkit review -i contract.json -f facts.json` |
87
+ | `audit` | Test asset health check (find unfit cases) | `mtkit audit -i legacy.xmind -f facts.json` |
88
+ | `db` | Read-only DB access (check/schema/verify) | `mtkit db verify -c db.json -i contract.json` |
89
+ | `validate` / `info` | Validate / inspect .xmind | `mtkit validate -i cases.xmind` |
90
+ | `diff` | Missed-test gap comparison | `mtkit diff -i cases.xmind -f facts.json -d plan.docx` |
91
+ | `contract` / `tree` | Cases ↔ contract conversion / restore tree | `mtkit contract -i cases.xmind -o contract.json` |
92
+ | `track` | Test management: execution records/reports/trends | `mtkit track record --case case --result pass` |
93
+ | `bug` | Defect library: add/list/close/stats | `mtkit bug add --title defect --severity P1` |
94
+ | `evolve` | Self-evolution: backup/restore/list/cleanup | `mtkit evolve backup file` |
95
+ | `asset` | Test asset aging detection (governance) | `mtkit asset --dir output-dir --days 30` |
96
+
97
+ Contract format (the single input convention):
98
+
99
+ ```json
100
+ {"chapters":[{"t":"Chapter","cases":[{"t":"tc-P0-Functional: case name",
101
+ "pc":["preconditions"],"steps":["steps"],"expects":["expected"],"sql":["SELECT ..."]}]}]}
102
+ ```
103
+
104
+ ## Database Access (Optional, Strictly Read-Only)
105
+
106
+ Four data sources in `db.json` (via the `type` field):
107
+
108
+ ```json
109
+ {"type":"cli","connect":{"cmd":"mysql -h{host} -u{user} -p{pass} {db} -N -e \"{sql}\"","host":"10.0.0.1","user":"ro","pass":"${DB_PASS}","db":"bill_db"}}
110
+ {"type":"driver","driver":"pymysql","host":"10.0.0.1","user":"ro","password":"${DB_PASS}","db":"bill_db"}
111
+ {"type":"http","url":"https://gw.example.com/query","token":"${DB_TOKEN}"}
112
+ {"type":"file","path":"schema.json"}
113
+ ```
114
+
115
+ Only SELECT/EXPLAIN/DESC/SHOW are allowed; all write operations are rejected. Passwords use `${ENV_VAR}` environment variables.
116
+
117
+ ## Qoder Integration (2 Steps)
118
+
119
+ 1. Qoder plugin manager → local plugin → select `d:\mtkit`
120
+ 2. Chat prompts:
121
+ - Generate cases: "Use mtkit to generate XMind test cases: plan xxx.docx, sample xxx.xmind, backend repo xxx"
122
+ - Test consulting: "How should I test this feature?" / "The production error, help me look into it" / "Is this a bug?"
123
+
124
+ ## Skill Sequence
125
+
126
+ ```mermaid
127
+ sequenceDiagram
128
+ participant U as User
129
+ participant A as AI (test builder)
130
+ U->>A: Provide the three inputs + optional docs/db
131
+ A->>U: Document health check (defects + advice, confirm item by item)
132
+ A->>A: gather + facts + experience library loading
133
+ A->>U: Test case output plan (design methods + builder advice)
134
+ U->>A: Authorization (can add/remove/adjust)
135
+ A->>A: Generate contract → quality gate → fix loop
136
+ A->>U: Case adjustment suggestions (confirm item by item)
137
+ A->>A: Render XMind → validate → gap comparison
138
+ A->>U: Delivery (XMind / defect summary / work traces) + training
139
+ ```
140
+
141
+ ## Iterative Updates (Editable Install, No Reinstall Needed)
142
+
143
+ ```bash
144
+ pip install --force-reinstall --no-deps -e d:\mtkit # only when needed
145
+ python -m unittest # self-check
146
+ ```
147
+
148
+ - Plugin side: repo file updates take effect immediately; only `plugin.json` version changes require a Qoder restart
149
+ - **Self-iteration**: improvements discovered by the AI during use are written to `.mtkit-work/improvements.json`; with `auto_improve` enabled in `.mtkit.json` and authorization granted, the AI can optimize itself and self-verify (see skills docs)
150
+ - Details: see [CHANGELOG.md](CHANGELOG.md) and [skills/mtkit-gen-xmind/](skills/mtkit-gen-xmind/) (skills & conventions)
151
+
152
+ ## PyPI Release (Maintainer Guide)
153
+
154
+ ```bash
155
+ # 1. Build
156
+ python -m pip install build twine
157
+ python -m build # produces dist/mtkit-<version>.tar.gz + .whl
158
+
159
+ # 2. Recommended: verify on TestPyPI first
160
+ python -m twine upload --repository testpypi dist/*
161
+ pip install -i https://test.pypi.org/simple/ mtkit
162
+ mtkit --help # verify the CLI
163
+
164
+ # 3. Publish officially after verification (requires project-level API token + PyPI account 2FA)
165
+ python -m twine upload dist/* # enter API token
166
+ ```
167
+
168
+ Installation flow for new teammates after release (final form):
169
+
170
+ ```bash
171
+ pip install mtkit # installs only the Python CLI (pure stdlib, installs in seconds)
172
+ mtkit install --git <git-url> # fetches the full repo + registers Qoder plugins (requires intranet repo URL)
173
+ # restart Qoder → / lists mtkit-gen-xmind
174
+ ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mtkit"
7
- version = "1.16.2"
7
+ version = "1.16.3"
8
8
  description = "AI 全站测试工程师:计划先行生成标准 XMind 测试用例(质量门禁把关),用例资产体检修复,交互式测试咨询与问题定位指导,使用即训练、越用越成熟"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
mtkit-1.16.2/PKG-INFO DELETED
@@ -1,174 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mtkit
3
- Version: 1.16.2
4
- Summary: AI 全站测试工程师:计划先行生成标准 XMind 测试用例(质量门禁把关),用例资产体检修复,交互式测试咨询与问题定位指导,使用即训练、越用越成熟
5
- Author: mtkit
6
- License-Expression: MIT
7
- Keywords: testing,xmind,test-case,ai,qoder
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Topic :: Software Development :: Testing
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Operating System :: OS Independent
18
- Requires-Python: >=3.8
19
- Description-Content-Type: text/markdown
20
- Provides-Extra: docx
21
- Requires-Dist: python-docx; extra == "docx"
22
- Provides-Extra: mysql
23
- Requires-Dist: pymysql; extra == "mysql"
24
- Provides-Extra: all
25
- Requires-Dist: python-docx; extra == "all"
26
- Requires-Dist: pymysql; extra == "all"
27
-
28
- # mtkit — AI 全站测试工程师
29
-
30
- 计划先行生成标准 XMind 测试用例(质量门禁把关),体检修复用例资产,交互式测试咨询与问题定位指导;使用即训练,越用越成熟。
31
-
32
- ## 流水线
33
-
34
- ```mermaid
35
- flowchart LR
36
- IN[输入: 方案.docx + 样例.xmind + 后端仓库 + 自定义文档] --> READ[读取与文档体检]
37
- READ --> FACTS[代码事实扫描<br/>九语言接口/SQL]
38
- FACTS --> PLAN[测试用例输出计划<br/>设计方法 + 构建者建议]
39
- PLAN --> AUTH{授权}
40
- AUTH -->|确认| CONTRACT[契约 JSON]
41
- CONTRACT --> GATE[质量门禁<br/>review + AI 审查]
42
- GATE --> RENDER[渲染 XMind]
43
- RENDER --> CHECK[校验 + 漏测对比]
44
- CHECK --> OUT[交付: XMind + 缺陷点汇总 + 工作痕迹]
45
- ```
46
-
47
- ## 快速上手(零依赖)
48
-
49
- ```bash
50
- # 1. 生成 XMind(纯标准库,无需任何安装)
51
- cd d:\mtkit
52
- mtkit gen -i examples/sample.json -o 用例.xmind
53
-
54
- # 2. 校验与统计
55
- mtkit validate -i 用例.xmind
56
- mtkit info -i 用例.xmind
57
- ```
58
-
59
- 可选依赖(用到才装):`.docx` 解析 `pip install python-docx`;数据库直连 `pip install pymysql`。
60
-
61
- ## 一键安装(含 Qoder 插件注册与可选依赖)
62
-
63
- ```bash
64
- # 方式一(推荐,新机器零门槛):PyPI 安装 CLI
65
- pip install mtkit
66
-
67
- # 方式二:仓库根目录执行(含可选依赖自动安装)
68
- python install.py # 或双击 install.bat
69
-
70
- # 方式三:输入 git 地址自动拉取安装
71
- python install.py --git <git 地址> [--dir 目标目录]
72
- ```
73
-
74
- 安装完成后**重启 Qoder**,对话框输入 `/` 应列出 mtkit-gen-xmind,或直接自然语言触发。
75
-
76
- > Qoder 插件注册:`skills/`、`commands/` 不在 PyPI 包中,pip 安装后执行
77
- > `mtkit install --git <git 地址>`(或先设置环境变量 `MTKIT_INSTALL_GIT`)拉取完整仓库并注册插件。
78
-
79
- ## 命令
80
-
81
- | 命令 | 作用 | 示例 |
82
- |---|---|---|
83
- | `gen` | 契约/数据 → .xmind | `mtkit gen -i 契约.json -o 用例.xmind` |
84
- | `gather` | 方案+样例+代码 → 生成上下文 | `mtkit gather -i 方案.docx --hist 样例.xmind -r 后端 -o ctx.json` |
85
- | `facts` | 九语言代码事实扫描 | `mtkit facts -r 后端 -o facts.json` |
86
- | `review` | 契约质量门禁 | `mtkit review -i 契约.json -f facts.json` |
87
- | `audit` | 用例资产体检(检索不合适用例) | `mtkit audit -i 旧用例.xmind -f facts.json` |
88
- | `db` | 数据库只读接入(check/schema/verify) | `mtkit db verify -c db.json -i 契约.json` |
89
- | `validate` / `info` | 校验 / 统计 .xmind | `mtkit validate -i 用例.xmind` |
90
- | `diff` | 漏测对比 | `mtkit diff -i 用例.xmind -f facts.json -d 方案.docx` |
91
- | `contract` / `tree` | 用例 ↔ 契约互转 / 还原树 | `mtkit contract -i 用例.xmind -o 契约.json` |
92
- | `track` | 测试管理:执行记录/报告/趋势 | `mtkit track record --case 用例 --result pass` |
93
- | `bug` | 缺陷库:登记/清单/关闭/统计 | `mtkit bug add --title 缺陷 --severity P1` |
94
- | `evolve` | 自进化:备份/恢复/清单/清理 | `mtkit evolve backup 文件` |
95
- | `asset` | 用例资产老化检测(治理) | `mtkit asset --dir 输出目录 --days 30` |
96
-
97
- 契约格式(唯一输入约定):
98
-
99
- ```json
100
- {"chapters":[{"t":"章节","cases":[{"t":"tc-P0-功能测试:用例名",
101
- "pc":["前置"],"steps":["步骤"],"expects":["预期"],"sql":["SELECT ..."]}]}]}
102
- ```
103
-
104
- ## 数据库接入(可选,严格只读)
105
-
106
- `db.json` 四种数据源(`type` 字段):
107
-
108
- ```json
109
- {"type":"cli","connect":{"cmd":"mysql -h{host} -u{user} -p{pass} {db} -N -e \"{sql}\"","host":"10.0.0.1","user":"ro","pass":"${DB_PASS}","db":"bill_db"}}
110
- {"type":"driver","driver":"pymysql","host":"10.0.0.1","user":"ro","password":"${DB_PASS}","db":"bill_db"}
111
- {"type":"http","url":"https://gw.example.com/query","token":"${DB_TOKEN}"}
112
- {"type":"file","path":"schema.json"}
113
- ```
114
-
115
- 仅允许 SELECT/EXPLAIN/DESC/SHOW;写操作一律拒绝。密码用 `${ENV_VAR}` 环境变量。
116
-
117
- ## Qoder 集成(2 步)
118
-
119
- 1. Qoder 插件管理 → 本地插件 → 选择 `d:\mtkit`
120
- 2. 对话输入:
121
- - 生成用例:"用 mtkit 生成 XMind 测试用例:方案 xxx.docx,样例 xxx.xmind,后端仓库 xxx"
122
- - 测试咨询:"这个功能怎么测?" / "线上报错了帮我看看" / "是不是 bug?"
123
-
124
- ## 技能时序
125
-
126
- ```mermaid
127
- sequenceDiagram
128
- participant U as 使用者
129
- participant A as AI(测试构建者)
130
- U->>A: 输入三件套 + 可选文档/db
131
- A->>U: 文档体检(缺陷点+建议,逐条确认)
132
- A->>A: gather + facts + 经验库加载
133
- A->>U: 测试用例输出计划(设计方法+构建者建议)
134
- U->>A: 授权(可增删调整)
135
- A->>A: 生成契约 → 质量门禁 → 修正循环
136
- A->>U: 用例调整建议(逐条确认)
137
- A->>A: 渲染 XMind → 校验 → 漏测对比
138
- A->>U: 交付(XMind/缺陷点汇总/工作痕迹)+ 训练沉淀
139
- ```
140
-
141
- ## 迭代更新(editable 安装,无需重装)
142
-
143
- ```bash
144
- pip install --force-reinstall --no-deps -e d:\mtkit # 仅在需要时
145
- python -m unittest # 自检
146
- ```
147
-
148
- - 插件侧:仓库文件更新即生效,仅 plugin.json 版本变化需重启 Qoder
149
- - **自我迭代**:AI 使用中发现改进点会写入 `.mtkit-work/improvements.json`;在 `.mtkit.json` 开启 `auto_improve` 并授权后,AI 可自行优化并自验(详见 skills 文档)
150
- - 详细说明:见 [CHANGELOG.md](CHANGELOG.md)、[skills/mtkit-gen-xmind/](skills/mtkit-gen-xmind/)(技能与规范)
151
-
152
- ## PyPI 发布(维护者指南)
153
-
154
- ```bash
155
- # 1. 构建
156
- python -m pip install build twine
157
- python -m build # 生成 dist/mtkit-<版本>.tar.gz + .whl
158
-
159
- # 2. 建议先传 TestPyPI 验证
160
- python -m twine upload --repository testpypi dist/*
161
- pip install -i https://test.pypi.org/simple/ mtkit
162
- mtkit --help # 验证 CLI
163
-
164
- # 3. 验证 OK 后正式发布(需项目级 API token + PyPI 账户 2FA)
165
- python -m twine upload dist/* # 输入 API token
166
- ```
167
-
168
- 发布后新同事的安装流程(最终形态):
169
-
170
- ```bash
171
- pip install mtkit # 只装 Python CLI(纯标准库,秒装)
172
- mtkit install --git <git 地址> # 拉取完整仓库 + 注册 Qoder 插件(需内网仓库地址)
173
- # 重启 Qoder → / 出现 mtkit-gen-xmind
174
- ```
mtkit-1.16.2/README.md DELETED
@@ -1,147 +0,0 @@
1
- # mtkit — AI 全站测试工程师
2
-
3
- 计划先行生成标准 XMind 测试用例(质量门禁把关),体检修复用例资产,交互式测试咨询与问题定位指导;使用即训练,越用越成熟。
4
-
5
- ## 流水线
6
-
7
- ```mermaid
8
- flowchart LR
9
- IN[输入: 方案.docx + 样例.xmind + 后端仓库 + 自定义文档] --> READ[读取与文档体检]
10
- READ --> FACTS[代码事实扫描<br/>九语言接口/SQL]
11
- FACTS --> PLAN[测试用例输出计划<br/>设计方法 + 构建者建议]
12
- PLAN --> AUTH{授权}
13
- AUTH -->|确认| CONTRACT[契约 JSON]
14
- CONTRACT --> GATE[质量门禁<br/>review + AI 审查]
15
- GATE --> RENDER[渲染 XMind]
16
- RENDER --> CHECK[校验 + 漏测对比]
17
- CHECK --> OUT[交付: XMind + 缺陷点汇总 + 工作痕迹]
18
- ```
19
-
20
- ## 快速上手(零依赖)
21
-
22
- ```bash
23
- # 1. 生成 XMind(纯标准库,无需任何安装)
24
- cd d:\mtkit
25
- mtkit gen -i examples/sample.json -o 用例.xmind
26
-
27
- # 2. 校验与统计
28
- mtkit validate -i 用例.xmind
29
- mtkit info -i 用例.xmind
30
- ```
31
-
32
- 可选依赖(用到才装):`.docx` 解析 `pip install python-docx`;数据库直连 `pip install pymysql`。
33
-
34
- ## 一键安装(含 Qoder 插件注册与可选依赖)
35
-
36
- ```bash
37
- # 方式一(推荐,新机器零门槛):PyPI 安装 CLI
38
- pip install mtkit
39
-
40
- # 方式二:仓库根目录执行(含可选依赖自动安装)
41
- python install.py # 或双击 install.bat
42
-
43
- # 方式三:输入 git 地址自动拉取安装
44
- python install.py --git <git 地址> [--dir 目标目录]
45
- ```
46
-
47
- 安装完成后**重启 Qoder**,对话框输入 `/` 应列出 mtkit-gen-xmind,或直接自然语言触发。
48
-
49
- > Qoder 插件注册:`skills/`、`commands/` 不在 PyPI 包中,pip 安装后执行
50
- > `mtkit install --git <git 地址>`(或先设置环境变量 `MTKIT_INSTALL_GIT`)拉取完整仓库并注册插件。
51
-
52
- ## 命令
53
-
54
- | 命令 | 作用 | 示例 |
55
- |---|---|---|
56
- | `gen` | 契约/数据 → .xmind | `mtkit gen -i 契约.json -o 用例.xmind` |
57
- | `gather` | 方案+样例+代码 → 生成上下文 | `mtkit gather -i 方案.docx --hist 样例.xmind -r 后端 -o ctx.json` |
58
- | `facts` | 九语言代码事实扫描 | `mtkit facts -r 后端 -o facts.json` |
59
- | `review` | 契约质量门禁 | `mtkit review -i 契约.json -f facts.json` |
60
- | `audit` | 用例资产体检(检索不合适用例) | `mtkit audit -i 旧用例.xmind -f facts.json` |
61
- | `db` | 数据库只读接入(check/schema/verify) | `mtkit db verify -c db.json -i 契约.json` |
62
- | `validate` / `info` | 校验 / 统计 .xmind | `mtkit validate -i 用例.xmind` |
63
- | `diff` | 漏测对比 | `mtkit diff -i 用例.xmind -f facts.json -d 方案.docx` |
64
- | `contract` / `tree` | 用例 ↔ 契约互转 / 还原树 | `mtkit contract -i 用例.xmind -o 契约.json` |
65
- | `track` | 测试管理:执行记录/报告/趋势 | `mtkit track record --case 用例 --result pass` |
66
- | `bug` | 缺陷库:登记/清单/关闭/统计 | `mtkit bug add --title 缺陷 --severity P1` |
67
- | `evolve` | 自进化:备份/恢复/清单/清理 | `mtkit evolve backup 文件` |
68
- | `asset` | 用例资产老化检测(治理) | `mtkit asset --dir 输出目录 --days 30` |
69
-
70
- 契约格式(唯一输入约定):
71
-
72
- ```json
73
- {"chapters":[{"t":"章节","cases":[{"t":"tc-P0-功能测试:用例名",
74
- "pc":["前置"],"steps":["步骤"],"expects":["预期"],"sql":["SELECT ..."]}]}]}
75
- ```
76
-
77
- ## 数据库接入(可选,严格只读)
78
-
79
- `db.json` 四种数据源(`type` 字段):
80
-
81
- ```json
82
- {"type":"cli","connect":{"cmd":"mysql -h{host} -u{user} -p{pass} {db} -N -e \"{sql}\"","host":"10.0.0.1","user":"ro","pass":"${DB_PASS}","db":"bill_db"}}
83
- {"type":"driver","driver":"pymysql","host":"10.0.0.1","user":"ro","password":"${DB_PASS}","db":"bill_db"}
84
- {"type":"http","url":"https://gw.example.com/query","token":"${DB_TOKEN}"}
85
- {"type":"file","path":"schema.json"}
86
- ```
87
-
88
- 仅允许 SELECT/EXPLAIN/DESC/SHOW;写操作一律拒绝。密码用 `${ENV_VAR}` 环境变量。
89
-
90
- ## Qoder 集成(2 步)
91
-
92
- 1. Qoder 插件管理 → 本地插件 → 选择 `d:\mtkit`
93
- 2. 对话输入:
94
- - 生成用例:"用 mtkit 生成 XMind 测试用例:方案 xxx.docx,样例 xxx.xmind,后端仓库 xxx"
95
- - 测试咨询:"这个功能怎么测?" / "线上报错了帮我看看" / "是不是 bug?"
96
-
97
- ## 技能时序
98
-
99
- ```mermaid
100
- sequenceDiagram
101
- participant U as 使用者
102
- participant A as AI(测试构建者)
103
- U->>A: 输入三件套 + 可选文档/db
104
- A->>U: 文档体检(缺陷点+建议,逐条确认)
105
- A->>A: gather + facts + 经验库加载
106
- A->>U: 测试用例输出计划(设计方法+构建者建议)
107
- U->>A: 授权(可增删调整)
108
- A->>A: 生成契约 → 质量门禁 → 修正循环
109
- A->>U: 用例调整建议(逐条确认)
110
- A->>A: 渲染 XMind → 校验 → 漏测对比
111
- A->>U: 交付(XMind/缺陷点汇总/工作痕迹)+ 训练沉淀
112
- ```
113
-
114
- ## 迭代更新(editable 安装,无需重装)
115
-
116
- ```bash
117
- pip install --force-reinstall --no-deps -e d:\mtkit # 仅在需要时
118
- python -m unittest # 自检
119
- ```
120
-
121
- - 插件侧:仓库文件更新即生效,仅 plugin.json 版本变化需重启 Qoder
122
- - **自我迭代**:AI 使用中发现改进点会写入 `.mtkit-work/improvements.json`;在 `.mtkit.json` 开启 `auto_improve` 并授权后,AI 可自行优化并自验(详见 skills 文档)
123
- - 详细说明:见 [CHANGELOG.md](CHANGELOG.md)、[skills/mtkit-gen-xmind/](skills/mtkit-gen-xmind/)(技能与规范)
124
-
125
- ## PyPI 发布(维护者指南)
126
-
127
- ```bash
128
- # 1. 构建
129
- python -m pip install build twine
130
- python -m build # 生成 dist/mtkit-<版本>.tar.gz + .whl
131
-
132
- # 2. 建议先传 TestPyPI 验证
133
- python -m twine upload --repository testpypi dist/*
134
- pip install -i https://test.pypi.org/simple/ mtkit
135
- mtkit --help # 验证 CLI
136
-
137
- # 3. 验证 OK 后正式发布(需项目级 API token + PyPI 账户 2FA)
138
- python -m twine upload dist/* # 输入 API token
139
- ```
140
-
141
- 发布后新同事的安装流程(最终形态):
142
-
143
- ```bash
144
- pip install mtkit # 只装 Python CLI(纯标准库,秒装)
145
- mtkit install --git <git 地址> # 拉取完整仓库 + 注册 Qoder 插件(需内网仓库地址)
146
- # 重启 Qoder → / 出现 mtkit-gen-xmind
147
- ```
@@ -1,174 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mtkit
3
- Version: 1.16.2
4
- Summary: AI 全站测试工程师:计划先行生成标准 XMind 测试用例(质量门禁把关),用例资产体检修复,交互式测试咨询与问题定位指导,使用即训练、越用越成熟
5
- Author: mtkit
6
- License-Expression: MIT
7
- Keywords: testing,xmind,test-case,ai,qoder
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Topic :: Software Development :: Testing
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Operating System :: OS Independent
18
- Requires-Python: >=3.8
19
- Description-Content-Type: text/markdown
20
- Provides-Extra: docx
21
- Requires-Dist: python-docx; extra == "docx"
22
- Provides-Extra: mysql
23
- Requires-Dist: pymysql; extra == "mysql"
24
- Provides-Extra: all
25
- Requires-Dist: python-docx; extra == "all"
26
- Requires-Dist: pymysql; extra == "all"
27
-
28
- # mtkit — AI 全站测试工程师
29
-
30
- 计划先行生成标准 XMind 测试用例(质量门禁把关),体检修复用例资产,交互式测试咨询与问题定位指导;使用即训练,越用越成熟。
31
-
32
- ## 流水线
33
-
34
- ```mermaid
35
- flowchart LR
36
- IN[输入: 方案.docx + 样例.xmind + 后端仓库 + 自定义文档] --> READ[读取与文档体检]
37
- READ --> FACTS[代码事实扫描<br/>九语言接口/SQL]
38
- FACTS --> PLAN[测试用例输出计划<br/>设计方法 + 构建者建议]
39
- PLAN --> AUTH{授权}
40
- AUTH -->|确认| CONTRACT[契约 JSON]
41
- CONTRACT --> GATE[质量门禁<br/>review + AI 审查]
42
- GATE --> RENDER[渲染 XMind]
43
- RENDER --> CHECK[校验 + 漏测对比]
44
- CHECK --> OUT[交付: XMind + 缺陷点汇总 + 工作痕迹]
45
- ```
46
-
47
- ## 快速上手(零依赖)
48
-
49
- ```bash
50
- # 1. 生成 XMind(纯标准库,无需任何安装)
51
- cd d:\mtkit
52
- mtkit gen -i examples/sample.json -o 用例.xmind
53
-
54
- # 2. 校验与统计
55
- mtkit validate -i 用例.xmind
56
- mtkit info -i 用例.xmind
57
- ```
58
-
59
- 可选依赖(用到才装):`.docx` 解析 `pip install python-docx`;数据库直连 `pip install pymysql`。
60
-
61
- ## 一键安装(含 Qoder 插件注册与可选依赖)
62
-
63
- ```bash
64
- # 方式一(推荐,新机器零门槛):PyPI 安装 CLI
65
- pip install mtkit
66
-
67
- # 方式二:仓库根目录执行(含可选依赖自动安装)
68
- python install.py # 或双击 install.bat
69
-
70
- # 方式三:输入 git 地址自动拉取安装
71
- python install.py --git <git 地址> [--dir 目标目录]
72
- ```
73
-
74
- 安装完成后**重启 Qoder**,对话框输入 `/` 应列出 mtkit-gen-xmind,或直接自然语言触发。
75
-
76
- > Qoder 插件注册:`skills/`、`commands/` 不在 PyPI 包中,pip 安装后执行
77
- > `mtkit install --git <git 地址>`(或先设置环境变量 `MTKIT_INSTALL_GIT`)拉取完整仓库并注册插件。
78
-
79
- ## 命令
80
-
81
- | 命令 | 作用 | 示例 |
82
- |---|---|---|
83
- | `gen` | 契约/数据 → .xmind | `mtkit gen -i 契约.json -o 用例.xmind` |
84
- | `gather` | 方案+样例+代码 → 生成上下文 | `mtkit gather -i 方案.docx --hist 样例.xmind -r 后端 -o ctx.json` |
85
- | `facts` | 九语言代码事实扫描 | `mtkit facts -r 后端 -o facts.json` |
86
- | `review` | 契约质量门禁 | `mtkit review -i 契约.json -f facts.json` |
87
- | `audit` | 用例资产体检(检索不合适用例) | `mtkit audit -i 旧用例.xmind -f facts.json` |
88
- | `db` | 数据库只读接入(check/schema/verify) | `mtkit db verify -c db.json -i 契约.json` |
89
- | `validate` / `info` | 校验 / 统计 .xmind | `mtkit validate -i 用例.xmind` |
90
- | `diff` | 漏测对比 | `mtkit diff -i 用例.xmind -f facts.json -d 方案.docx` |
91
- | `contract` / `tree` | 用例 ↔ 契约互转 / 还原树 | `mtkit contract -i 用例.xmind -o 契约.json` |
92
- | `track` | 测试管理:执行记录/报告/趋势 | `mtkit track record --case 用例 --result pass` |
93
- | `bug` | 缺陷库:登记/清单/关闭/统计 | `mtkit bug add --title 缺陷 --severity P1` |
94
- | `evolve` | 自进化:备份/恢复/清单/清理 | `mtkit evolve backup 文件` |
95
- | `asset` | 用例资产老化检测(治理) | `mtkit asset --dir 输出目录 --days 30` |
96
-
97
- 契约格式(唯一输入约定):
98
-
99
- ```json
100
- {"chapters":[{"t":"章节","cases":[{"t":"tc-P0-功能测试:用例名",
101
- "pc":["前置"],"steps":["步骤"],"expects":["预期"],"sql":["SELECT ..."]}]}]}
102
- ```
103
-
104
- ## 数据库接入(可选,严格只读)
105
-
106
- `db.json` 四种数据源(`type` 字段):
107
-
108
- ```json
109
- {"type":"cli","connect":{"cmd":"mysql -h{host} -u{user} -p{pass} {db} -N -e \"{sql}\"","host":"10.0.0.1","user":"ro","pass":"${DB_PASS}","db":"bill_db"}}
110
- {"type":"driver","driver":"pymysql","host":"10.0.0.1","user":"ro","password":"${DB_PASS}","db":"bill_db"}
111
- {"type":"http","url":"https://gw.example.com/query","token":"${DB_TOKEN}"}
112
- {"type":"file","path":"schema.json"}
113
- ```
114
-
115
- 仅允许 SELECT/EXPLAIN/DESC/SHOW;写操作一律拒绝。密码用 `${ENV_VAR}` 环境变量。
116
-
117
- ## Qoder 集成(2 步)
118
-
119
- 1. Qoder 插件管理 → 本地插件 → 选择 `d:\mtkit`
120
- 2. 对话输入:
121
- - 生成用例:"用 mtkit 生成 XMind 测试用例:方案 xxx.docx,样例 xxx.xmind,后端仓库 xxx"
122
- - 测试咨询:"这个功能怎么测?" / "线上报错了帮我看看" / "是不是 bug?"
123
-
124
- ## 技能时序
125
-
126
- ```mermaid
127
- sequenceDiagram
128
- participant U as 使用者
129
- participant A as AI(测试构建者)
130
- U->>A: 输入三件套 + 可选文档/db
131
- A->>U: 文档体检(缺陷点+建议,逐条确认)
132
- A->>A: gather + facts + 经验库加载
133
- A->>U: 测试用例输出计划(设计方法+构建者建议)
134
- U->>A: 授权(可增删调整)
135
- A->>A: 生成契约 → 质量门禁 → 修正循环
136
- A->>U: 用例调整建议(逐条确认)
137
- A->>A: 渲染 XMind → 校验 → 漏测对比
138
- A->>U: 交付(XMind/缺陷点汇总/工作痕迹)+ 训练沉淀
139
- ```
140
-
141
- ## 迭代更新(editable 安装,无需重装)
142
-
143
- ```bash
144
- pip install --force-reinstall --no-deps -e d:\mtkit # 仅在需要时
145
- python -m unittest # 自检
146
- ```
147
-
148
- - 插件侧:仓库文件更新即生效,仅 plugin.json 版本变化需重启 Qoder
149
- - **自我迭代**:AI 使用中发现改进点会写入 `.mtkit-work/improvements.json`;在 `.mtkit.json` 开启 `auto_improve` 并授权后,AI 可自行优化并自验(详见 skills 文档)
150
- - 详细说明:见 [CHANGELOG.md](CHANGELOG.md)、[skills/mtkit-gen-xmind/](skills/mtkit-gen-xmind/)(技能与规范)
151
-
152
- ## PyPI 发布(维护者指南)
153
-
154
- ```bash
155
- # 1. 构建
156
- python -m pip install build twine
157
- python -m build # 生成 dist/mtkit-<版本>.tar.gz + .whl
158
-
159
- # 2. 建议先传 TestPyPI 验证
160
- python -m twine upload --repository testpypi dist/*
161
- pip install -i https://test.pypi.org/simple/ mtkit
162
- mtkit --help # 验证 CLI
163
-
164
- # 3. 验证 OK 后正式发布(需项目级 API token + PyPI 账户 2FA)
165
- python -m twine upload dist/* # 输入 API token
166
- ```
167
-
168
- 发布后新同事的安装流程(最终形态):
169
-
170
- ```bash
171
- pip install mtkit # 只装 Python CLI(纯标准库,秒装)
172
- mtkit install --git <git 地址> # 拉取完整仓库 + 注册 Qoder 插件(需内网仓库地址)
173
- # 重启 Qoder → / 出现 mtkit-gen-xmind
174
- ```
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