vcode-analysis 0.8.0__tar.gz → 0.9.0__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 (104) hide show
  1. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/MANIFEST.in +1 -0
  2. {vcode_analysis-0.8.0/vcode_analysis.egg-info → vcode_analysis-0.9.0}/PKG-INFO +1 -1
  3. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/cli.py +21 -7
  4. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/config.py +33 -9
  5. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/prompt_manager.py +78 -11
  6. vcode_analysis-0.9.0/prompts/__init__.py +1 -0
  7. vcode_analysis-0.9.0/prompts/architecture.md +27 -0
  8. vcode_analysis-0.9.0/prompts/batch_review.md +22 -0
  9. vcode_analysis-0.9.0/prompts/code_review.md +31 -0
  10. vcode_analysis-0.9.0/prompts/code_review_v2.md +37 -0
  11. vcode_analysis-0.9.0/prompts/commit_review.md +49 -0
  12. vcode_analysis-0.9.0/prompts/documentation/api.md +28 -0
  13. vcode_analysis-0.9.0/prompts/documentation/module.md +33 -0
  14. vcode_analysis-0.9.0/prompts/documentation/readme.md +42 -0
  15. vcode_analysis-0.9.0/prompts/mcp/code_review_checklist.md +16 -0
  16. vcode_analysis-0.9.0/prompts/mcp/mr_review_template.md +15 -0
  17. vcode_analysis-0.9.0/prompts/mcp/vuln_tuning_advisor.md +14 -0
  18. vcode_analysis-0.9.0/prompts/security_analysis.md +61 -0
  19. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/pyproject.toml +6 -2
  20. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0/vcode_analysis.egg-info}/PKG-INFO +1 -1
  21. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_analysis.egg-info/SOURCES.txt +13 -0
  22. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_analysis.egg-info/top_level.txt +1 -0
  23. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_mcp/server.py +1 -1
  24. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_mcp/tool_handler.py +2 -2
  25. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/LICENSE +0 -0
  26. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/README.md +0 -0
  27. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/__init__.py +0 -0
  28. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/_tuning_context.py +0 -0
  29. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/architecture.py +0 -0
  30. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/code_review.py +0 -0
  31. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/context_builder.py +0 -0
  32. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/directory.py +0 -0
  33. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/documentation.py +0 -0
  34. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/knowledge_graph.py +0 -0
  35. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/security.py +0 -0
  36. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/analyzers/security_ast.py +0 -0
  37. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/__init__.py +0 -0
  38. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/analyzer.py +0 -0
  39. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/batch_analyzer.py +0 -0
  40. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/batch_planner.py +0 -0
  41. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/cache_manager.py +0 -0
  42. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/feedback_hub.py +0 -0
  43. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/git_handler.py +0 -0
  44. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/ignore.py +0 -0
  45. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/json_utils.py +0 -0
  46. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/llm_client.py +0 -0
  47. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/metrics_store.py +0 -0
  48. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/report_generator.py +0 -0
  49. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/core/token_estimator.py +0 -0
  50. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/2026-stage-highlights.md +0 -0
  51. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/PPT/345/244/247/347/272/262-VCode_Analysis_/346/231/272/350/203/275/344/273/243/347/240/201/345/210/206/346/236/220/345/267/245/345/205/267/345/210/206/344/272/253.md" +0 -0
  52. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/PPT/347/224/237/346/210/220/346/217/220/347/244/272/350/257/215-VCode_Analysis/345/210/206/344/272/253.md" +0 -0
  53. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/USER_MANUAL.md +0 -0
  54. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/batch-cache-optimization.md +0 -0
  55. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/c-parser-design.md +0 -0
  56. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/code-knowledge-graph.md +0 -0
  57. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/critical-severity.md +0 -0
  58. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/expert-review-response-2026-07.md +0 -0
  59. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/kotlin-parser-design.md +0 -0
  60. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/prompt-externalization.md +0 -0
  61. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/three-year-roadmap.md +0 -0
  62. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/design/vcode-analysis-tool.md +0 -0
  63. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/review-scenarios.md +0 -0
  64. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/security-sharing-article.md +0 -0
  65. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/severity-standard.md +0 -0
  66. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs/superpowers/plans/2026-07-22-expert-review-response.md +0 -0
  67. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/docs//350/207/252/350/215/220/344/272/256/347/202/271/350/257/264/346/230/216.md" +0 -0
  68. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/__init__.py +0 -0
  69. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/c/__init__.py +0 -0
  70. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/c/ast_parser.py +0 -0
  71. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/c/models.py +0 -0
  72. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/c/patterns.py +0 -0
  73. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/c/regex_parser.py +0 -0
  74. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/c_parser.py +0 -0
  75. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/java_parser.py +0 -0
  76. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/javascript_parser.py +0 -0
  77. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/kotlin/__init__.py +0 -0
  78. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/kotlin/ast_parser.py +0 -0
  79. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/kotlin/models.py +0 -0
  80. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/kotlin/patterns.py +0 -0
  81. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/kotlin/regex_parser.py +0 -0
  82. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/kotlin_parser.py +0 -0
  83. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/python_parser.py +0 -0
  84. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/sql_parser.py +0 -0
  85. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/parsers/typescript_parser.py +0 -0
  86. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/requirements.txt +0 -0
  87. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/setup.cfg +0 -0
  88. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_batch_operations.py +0 -0
  89. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_c_parser.py +0 -0
  90. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_context_builder_sql.py +0 -0
  91. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_kotlin_parser.py +0 -0
  92. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_mcp_tools.py +0 -0
  93. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_metrics_store.py +0 -0
  94. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_prompt_manager.py +0 -0
  95. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_report_generator.py +0 -0
  96. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_security_rules.py +0 -0
  97. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/tests/test_sql_parser.py +0 -0
  98. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_analysis.egg-info/dependency_links.txt +0 -0
  99. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_analysis.egg-info/entry_points.txt +0 -0
  100. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_analysis.egg-info/requires.txt +0 -0
  101. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_mcp/__init__.py +0 -0
  102. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_mcp/prompt_handler.py +0 -0
  103. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_mcp/resource_handler.py +0 -0
  104. {vcode_analysis-0.8.0 → vcode_analysis-0.9.0}/vcode_mcp/transports/__init__.py +0 -0
@@ -7,6 +7,7 @@ recursive-include docs *.md
7
7
  recursive-include analyzers *.py
8
8
  recursive-include core *.py
9
9
  recursive-include parsers *.py
10
+ recursive-include prompts *.md
10
11
 
11
12
  global-exclude __pycache__
12
13
  global-exclude *.py[cod]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vcode-analysis
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: 基于大模型的智能代码分析工具,支持代码审查、文档生成、架构分析和安全扫描
5
5
  Author-email: Wellchang <2483808264@qq.com>
6
6
  License: MIT
@@ -38,6 +38,7 @@ Commands:
38
38
 
39
39
  Options:
40
40
  -c, --config <file> 配置文件路径
41
+ --prompts-dir <dir> 自定义提示词目录(与内置提示词叠加,同名覆盖)
41
42
  --path <path> 仓库路径 (review-commit 使用)
42
43
  --type <type> 文档类型 (doc 使用, 默认: module)
43
44
  --base-url <url> LLM API 地址
@@ -110,7 +111,7 @@ from analyzers import (
110
111
  )
111
112
 
112
113
 
113
- __version__ = "0.8.0"
114
+ __version__ = "0.9.0"
114
115
 
115
116
 
116
117
  def _timestamp() -> str:
@@ -430,6 +431,7 @@ def cmd_review(args: dict) -> int:
430
431
 
431
432
  config = Config.create(
432
433
  config_file=args.get("--config"),
434
+ prompts_dir=args.get("--prompts-dir"),
433
435
  base_url=args.get("--base-url"),
434
436
  api_key=args.get("--api-key"),
435
437
  model=args.get("--model"),
@@ -515,7 +517,7 @@ def cmd_review(args: dict) -> int:
515
517
  reviewer.metrics_store = _metrics_store
516
518
  reviewer._current_run_id = _metrics_store.record_scan_run(ScanRun(
517
519
  repo_path=str(Path(target_path).resolve()),
518
- analyzer="code_review", tool_version="0.8.0",
520
+ analyzer="code_review", tool_version="0.9.0",
519
521
  ))
520
522
  _log_section("分析中(逐文件模式)")
521
523
  _log(f"开始分析 {total} 个文件...", "START")
@@ -625,7 +627,7 @@ def cmd_review(args: dict) -> int:
625
627
  _metrics_store = MetricsStore(_metrics_db)
626
628
  _run_id = _metrics_store.record_scan_run(ScanRun(
627
629
  repo_path=str(Path(target_path).resolve()),
628
- analyzer="code_review", tool_version="0.8.0",
630
+ analyzer="code_review", tool_version="0.9.0",
629
631
  ))
630
632
  for r in results:
631
633
  if r.success and r.issues:
@@ -761,6 +763,7 @@ def cmd_review_commit(args: dict) -> int:
761
763
 
762
764
  config = Config.create(
763
765
  config_file=args.get("--config"),
766
+ prompts_dir=args.get("--prompts-dir"),
764
767
  base_url=args.get("--base-url"),
765
768
  api_key=args.get("--api-key"),
766
769
  model=args.get("--model"),
@@ -787,7 +790,7 @@ def cmd_review_commit(args: dict) -> int:
787
790
  _metrics_store = MetricsStore(_metrics_db)
788
791
  _run_id = _metrics_store.record_scan_run(ScanRun(
789
792
  repo_path=str(Path(target_path).resolve()),
790
- analyzer="code_review", tool_version="0.8.0",
793
+ analyzer="code_review", tool_version="0.9.0",
791
794
  ))
792
795
 
793
796
  with Analyzer(config) as analyzer:
@@ -857,6 +860,7 @@ def cmd_doc(args: dict) -> int:
857
860
 
858
861
  config = Config.create(
859
862
  config_file=args.get("--config"),
863
+ prompts_dir=args.get("--prompts-dir"),
860
864
  base_url=args.get("--base-url"),
861
865
  api_key=args.get("--api-key"),
862
866
  model=args.get("--model"),
@@ -945,7 +949,10 @@ def cmd_metrics(args: dict) -> int:
945
949
  from datetime import date
946
950
  from core.metrics_store import MetricsStore
947
951
 
948
- config = Config.create(config_file=args.get("--config"))
952
+ config = Config.create(
953
+ config_file=args.get("--config"),
954
+ prompts_dir=args.get("--prompts-dir"),
955
+ )
949
956
  db_path = config.metrics.db_path or str(
950
957
  Path.home() / ".code-analysis" / "metrics.db"
951
958
  )
@@ -1011,7 +1018,10 @@ def cmd_feedback(args: dict) -> int:
1011
1018
  """反馈管理命令"""
1012
1019
  from core.metrics_store import MetricsStore
1013
1020
 
1014
- config = Config.create(config_file=args.get("--config"))
1021
+ config = Config.create(
1022
+ config_file=args.get("--config"),
1023
+ prompts_dir=args.get("--prompts-dir"),
1024
+ )
1015
1025
  db_path = config.metrics.db_path or str(
1016
1026
  Path.home() / ".code-analysis" / "metrics.db"
1017
1027
  )
@@ -1118,6 +1128,7 @@ def cmd_arch(args: dict) -> int:
1118
1128
 
1119
1129
  config = Config.create(
1120
1130
  config_file=args.get("--config"),
1131
+ prompts_dir=args.get("--prompts-dir"),
1121
1132
  base_url=args.get("--base-url"),
1122
1133
  api_key=args.get("--api-key"),
1123
1134
  model=args.get("--model"),
@@ -1236,6 +1247,7 @@ def cmd_security(args: dict) -> int:
1236
1247
 
1237
1248
  config = Config.create(
1238
1249
  config_file=args.get("--config"),
1250
+ prompts_dir=args.get("--prompts-dir"),
1239
1251
  base_url=args.get("--base-url"),
1240
1252
  api_key=args.get("--api-key"),
1241
1253
  model=args.get("--model"),
@@ -1265,7 +1277,7 @@ def cmd_security(args: dict) -> int:
1265
1277
  security.metrics_store = _metrics_store
1266
1278
  security._current_run_id = _metrics_store.record_scan_run(ScanRun(
1267
1279
  repo_path=str(Path(target_path).resolve()),
1268
- analyzer="security", tool_version="0.8.0",
1280
+ analyzer="security", tool_version="0.9.0",
1269
1281
  ))
1270
1282
  results = security.scan_project(target_path, deep=deep_scan, log_callback=_log)
1271
1283
  scan_time = time.time() - scan_start
@@ -1440,6 +1452,7 @@ def cmd_clone(args: dict) -> int:
1440
1452
 
1441
1453
  config = Config.create(
1442
1454
  config_file=args.get("--config"),
1455
+ prompts_dir=args.get("--prompts-dir"),
1443
1456
  base_url=args.get("--base-url"),
1444
1457
  api_key=args.get("--api-key"),
1445
1458
  model=args.get("--model"),
@@ -1720,6 +1733,7 @@ def cmd_kg(args: dict) -> int:
1720
1733
 
1721
1734
  config = Config.create(
1722
1735
  config_file=args.get("--config"),
1736
+ prompts_dir=args.get("--prompts-dir"),
1723
1737
  base_url=args.get("--base-url"),
1724
1738
  api_key=args.get("--api-key"),
1725
1739
  model=args.get("--model"),
@@ -112,6 +112,9 @@ class Config:
112
112
  target_path: Optional[str] = None
113
113
  output_format: str = "markdown" # markdown, json
114
114
 
115
+ # 自定义提示词目录(可选,与内置 prompts 叠加;同名提示词覆盖内置)
116
+ prompts_dir: Optional[str] = None
117
+
115
118
  _config_path: Optional[str] = field(default=None, repr=False)
116
119
 
117
120
  @classmethod
@@ -216,6 +219,10 @@ class Config:
216
219
  if hasattr(self.mcp, key):
217
220
  setattr(self.mcp, key, value)
218
221
 
222
+ # 加载提示词目录(顶层配置项)
223
+ if "prompts_dir" in data and data["prompts_dir"]:
224
+ self.prompts_dir = str(data["prompts_dir"])
225
+
219
226
  def load_from_env(self) -> None:
220
227
  """从环境变量加载"""
221
228
  env_mappings = {
@@ -225,19 +232,24 @@ class Config:
225
232
  "CODE_ANALYSIS_MODEL": ("llm", "model"),
226
233
  "CODE_ANALYSIS_TEMPERATURE": ("llm", "temperature"),
227
234
  "CODE_ANALYSIS_MAX_TOKENS": ("llm", "max_tokens"),
235
+ "CODE_ANALYSIS_PROMPTS_DIR": ("_prompts_dir", "prompts_dir"),
228
236
  }
229
237
 
230
238
  for env_key, (section, attr) in env_mappings.items():
231
239
  value = os.environ.get(env_key)
232
- if value:
233
- target = self.llm if section == "llm" else self.analysis
234
- # 类型转换
235
- current_value = getattr(target, attr)
236
- if isinstance(current_value, int):
237
- value = int(value)
238
- elif isinstance(current_value, float):
239
- value = float(value)
240
- setattr(target, attr, value)
240
+ if not value:
241
+ continue
242
+ if section == "_prompts_dir":
243
+ self.prompts_dir = value
244
+ continue
245
+ target = self.llm if section == "llm" else self.analysis
246
+ # 类型转换
247
+ current_value = getattr(target, attr)
248
+ if isinstance(current_value, int):
249
+ value = int(value)
250
+ elif isinstance(current_value, float):
251
+ value = float(value)
252
+ setattr(target, attr, value)
241
253
 
242
254
  # 多模型配置时,环境变量也覆盖主模型
243
255
  if self.llm_models.models:
@@ -269,6 +281,8 @@ class Config:
269
281
  self.output_format = kwargs["output_format"]
270
282
  if kwargs.get("max_workers"):
271
283
  self.analysis.max_workers = kwargs["max_workers"]
284
+ if kwargs.get("prompts_dir"):
285
+ self.prompts_dir = kwargs["prompts_dir"]
272
286
 
273
287
  # 多模型配置时,CLI 参数也覆盖主模型
274
288
  if self.llm_models.models:
@@ -297,6 +311,15 @@ class Config:
297
311
  # 3. 最后应用 CLI 参数(最高优先级)
298
312
  config.apply_cli_overrides(**cli_kwargs)
299
313
 
314
+ # 4. 将自定义提示词目录注入 PromptManager(与内置 prompts 叠加)
315
+ from .prompt_manager import set_default_prompts_dir
316
+ from pathlib import Path as _Path
317
+
318
+ if config.prompts_dir:
319
+ set_default_prompts_dir(_Path(config.prompts_dir).expanduser())
320
+ else:
321
+ set_default_prompts_dir(None)
322
+
300
323
  return config
301
324
 
302
325
  def to_dict(self) -> dict:
@@ -315,6 +338,7 @@ class Config:
315
338
  },
316
339
  "target_path": self.target_path,
317
340
  "output_format": self.output_format,
341
+ "prompts_dir": self.prompts_dir,
318
342
  }
319
343
  if self.llm_models.models:
320
344
  result["llm_models"] = {
@@ -10,6 +10,7 @@ prompts/*.md 文件(YAML front matter + Markdown 正文),启动时加载
10
10
  from __future__ import annotations
11
11
 
12
12
  import re
13
+ import sys
13
14
  from dataclasses import dataclass, field
14
15
  from pathlib import Path
15
16
  from typing import Optional
@@ -38,24 +39,70 @@ class PromptManager:
38
39
  _VAR_PATTERN = re.compile(r"\{\{\s*(\w+)\s*\}\}")
39
40
 
40
41
  def __init__(self, prompts_dir: Optional[Path] = None):
41
- self.prompts_dir = prompts_dir or Path(__file__).parent.parent / "prompts"
42
+ """初始化提示词管理器。
43
+
44
+ prompts_dir 优先级(从高到低):
45
+ 1. 显式传入的 prompts_dir(CLI / 配置 / 环境变量)
46
+ 2. 包内内置 prompts(已随 whl 打包,importlib.resources 读取)
47
+ 3. 源码仓库内 prompts/(开发模式,__file__ 回溯定位)
48
+
49
+ 当传入 prompts_dir 时,它作为**用户自定义目录**与内置 prompts **叠加**——
50
+ 用户目录中的同名提示词会覆盖内置提示词,未覆盖的仍使用内置默认。
51
+ 若不传 prompts_dir,则仅使用内置(或开发目录)提示词。
52
+ """
53
+ self.prompts_dir = prompts_dir # 用户自定义目录(可选)
54
+ self._builtin_dir = self._resolve_builtin_dir()
42
55
  self._cache: dict[str, PromptTemplate] = {}
43
56
  self.load()
44
57
 
45
58
  # ------------------------------------------------------------------ 加载
46
59
 
60
+ def _resolve_builtin_dir(self) -> Optional[Path]:
61
+ """定位内置 prompts 目录。
62
+
63
+ 优先用 importlib.resources 读取已安装的 ``prompts`` 包(随 whl 打包),
64
+ 失败则回退到源码仓库布局 core/../prompts(开发模式)。
65
+ """
66
+ # 已安装:prompts 作为顶层包随 whl 打包
67
+ try:
68
+ from importlib import resources
69
+
70
+ try:
71
+ files = resources.files("prompts")
72
+ with resources.as_file(files) as f:
73
+ if f.exists():
74
+ return f
75
+ except (ModuleNotFoundError, TypeError, ValueError):
76
+ pass
77
+ except Exception:
78
+ pass
79
+
80
+ # 回退:开发模式或源码仓库布局
81
+ repo_path = Path(__file__).resolve().parent.parent / "prompts"
82
+ if repo_path.exists():
83
+ return repo_path
84
+ return None
85
+
47
86
  def load(self) -> None:
48
- """扫描 prompts/**/*.md,解析 front matter,缓存到 _cache。
87
+ """扫描内置与自定义 prompts/**/*.md,解析 front matter,缓存到 _cache。
88
+
89
+ 先加载内置 prompts,再加载用户自定义目录——自定义目录中的同名
90
+ 提示词会**覆盖**内置提示词,实现"默认内置 + 单独覆盖"的诉求。
49
91
 
50
92
  子目录结构决定 category:
51
93
  prompts/*.md -> category 取 front matter 或 "analyzer"
52
94
  prompts/mcp/*.md -> category = "mcp"
53
95
  prompts/documentation/*.md -> category = "documentation"
54
96
  """
55
- if not self.prompts_dir.exists():
56
- return
97
+ if self._builtin_dir and self._builtin_dir.exists():
98
+ self._scan_dir(self._builtin_dir)
57
99
 
58
- for md_path in sorted(self.prompts_dir.rglob("*.md")):
100
+ if self.prompts_dir and self.prompts_dir.exists():
101
+ self._scan_dir(self.prompts_dir)
102
+
103
+ def _scan_dir(self, prompts_dir: Path) -> None:
104
+ """扫描单个 prompts 目录并写入缓存(自定义目录后扫,可覆盖)。"""
105
+ for md_path in sorted(prompts_dir.rglob("*.md")):
59
106
  try:
60
107
  text = md_path.read_text(encoding="utf-8")
61
108
  except OSError:
@@ -66,7 +113,7 @@ class PromptManager:
66
113
  continue
67
114
 
68
115
  # 子目录决定 category 默认值
69
- rel = md_path.relative_to(self.prompts_dir)
116
+ rel = md_path.relative_to(prompts_dir)
70
117
  if len(rel.parts) > 1:
71
118
  fm.setdefault("category", rel.parts[0])
72
119
  else:
@@ -201,17 +248,37 @@ class PromptManager:
201
248
  # ------------------------------------------------------------------ 单例
202
249
 
203
250
  _prompt_manager: Optional[PromptManager] = None
251
+ _default_prompts_dir: Optional[Path] = None
252
+
204
253
 
254
+ def set_default_prompts_dir(prompts_dir: Optional[Path]) -> None:
255
+ """设置应用级默认自定义提示词目录(由 CLI / 配置 / 环境变量在启动时调用)。
205
256
 
206
- def get_prompt_manager() -> PromptManager:
207
- """获取模块级单例(首次调用时加载 prompts/ 目录)"""
257
+ 之后任意无参 get_prompt_manager() 都会使用此目录(与内置 prompts 叠加)。
258
+ 若新目录与当前默认不同,会重置单例,使后续调用重新加载。
259
+ """
260
+ global _default_prompts_dir, _prompt_manager
261
+ if prompts_dir != _default_prompts_dir:
262
+ _default_prompts_dir = prompts_dir
263
+ _prompt_manager = None # 触达重建
264
+
265
+
266
+ def get_prompt_manager(prompts_dir: Optional[Path] = None) -> PromptManager:
267
+ """获取模块级单例。
268
+
269
+ 优先级:显式 prompts_dir 参数 > 应用级默认目录(set_default_prompts_dir)
270
+ > 仅内置(打包)提示词。传入任意目录都会导致单例**重建**,以便配置变更生效。
271
+ """
208
272
  global _prompt_manager
209
- if _prompt_manager is None:
210
- _prompt_manager = PromptManager()
273
+ if prompts_dir is None:
274
+ prompts_dir = _default_prompts_dir
275
+ if _prompt_manager is None or prompts_dir != _prompt_manager.prompts_dir:
276
+ _prompt_manager = PromptManager(prompts_dir=prompts_dir)
211
277
  return _prompt_manager
212
278
 
213
279
 
214
280
  def reset_prompt_manager() -> None:
215
281
  """重置单例(仅供测试使用)"""
216
- global _prompt_manager
282
+ global _prompt_manager, _default_prompts_dir
217
283
  _prompt_manager = None
284
+ _default_prompts_dir = None
@@ -0,0 +1 @@
1
+ """内置提示词包(随 whl 打包,由 core.prompt_manager 加载)"""
@@ -0,0 +1,27 @@
1
+ ---
2
+ id: architecture
3
+ version: 1.0
4
+ variables: [total_files, total_lines, languages, modules_count, circular_deps, modules_summary]
5
+ category: analyzer
6
+ ---
7
+
8
+ 分析以下项目的架构信息并提供改进建议:
9
+
10
+ 项目统计:
11
+ - 文件数: {{total_files}}
12
+ - 代码行数: {{total_lines}}
13
+ - 语言分布: {{languages}}
14
+ - 模块数: {{modules_count}}
15
+ - 循环依赖: {{circular_deps}}
16
+
17
+ 模块列表:
18
+ {{modules_summary}}
19
+
20
+ 请分析项目的架构质量,包括:
21
+ 1. 模块化程度评价
22
+ 2. 依赖关系分析
23
+ 3. 潜在的架构问题
24
+ 4. 改进建议
25
+
26
+ 以 JSON 格式输出:
27
+ {"summary": "架构评价", "suggestions": ["建议1", "建议2"]}
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: batch_review
3
+ version: 1.0
4
+ variables: [language, count, file_sections]
5
+ category: analyzer
6
+ ---
7
+
8
+ 审查以下 {{language}} 文件({{count}} 个):
9
+
10
+ {{file_sections}}
11
+
12
+ 输出格式(仅输出 JSON,不要思考过程):
13
+ {"files":[{"path":"文件路径","score":8,"issues":[{"t":"类型","s":"high/medium/low","l":行号,"d":"描述"}],"suggestions":["建议"],"summary":"总结"}]}
14
+
15
+ 注意:
16
+ - score: 1-10 的整数,表示代码质量评分
17
+ - issues: 问题列表,最多 5 条(t=类型, s=严重程度, l=行号, d=描述)
18
+ - suggestions: 改进建议,最多 3 条
19
+ - summary: 简短总结,控制在 50 字以内
20
+ - path 必须与上面的文件路径一致
21
+
22
+ 只输出 JSON 对象,不要输出思考过程或其他内容。
@@ -0,0 +1,31 @@
1
+ ---
2
+ id: code_review
3
+ version: 1.3
4
+ variables: [language, file_path, content]
5
+ category: analyzer
6
+ ---
7
+
8
+ 请审查以下 {{language}} 代码:
9
+
10
+ 文件: {{file_path}}
11
+
12
+ ```{{language}}
13
+ {{content}}
14
+ ```
15
+
16
+ 请进行代码审查,必须严格按照以下 JSON 格式输出,不要输出任何其他内容:
17
+
18
+ {"score": 评分1-10, "issues": [{"type": "问题类型", "severity": "high/medium/low", "line": 行号, "description": "问题描述"}], "suggestions": ["改进建议"], "summary": "代码评价总结"}
19
+
20
+ severity 判定标准(严格按此执行):
21
+ - high: 可能导致运行时错误、数据丢失、安全漏洞(如 SQL注入、XSS、硬编码密钥、空指针、资源泄漏)
22
+ - medium: 代码质量问题,可能影响可维护性或性能(如循环依赖、重复代码、缺少异常处理、魔法数字)
23
+ - low: 轻微代码风格问题(如命名不规范、缺少注释、过长函数、未使用的导入)
24
+
25
+ ## SQL / DDL 审查要点(当语言为 SQL 时)
26
+
27
+ 若当前文件是 SQL/DDL,请重点检查:
28
+ 1. **外键类型一致性**:外键列的数据类型必须与引用表对应列类型一致(建议长度/精度也一致);类型不兼容为 high。
29
+ 2. **引用完整性**:外键引用的目标表、目标列必须存在;引用不存在的表/列为 high。
30
+ 3. **破坏性变更防护**:`DROP COLUMN`、缩短长度、改窄类型等可能丢数据,需谨慎(high)。
31
+ 4. **重复定义**:同一张表在多处定义且列不一致时提示收敛(low)。
@@ -0,0 +1,37 @@
1
+ ---
2
+ id: code_review_v2
3
+ version: 1.1
4
+ variables: [language, file_path, context_section, content]
5
+ category: analyzer
6
+ ---
7
+
8
+ 请审查以下 {{language}} 代码:
9
+
10
+ 文件: {{file_path}}
11
+
12
+ {{context_section}}
13
+
14
+ ## 当前文件代码
15
+ ```{{language}}
16
+ {{content}}
17
+ ```
18
+
19
+ 请进行代码审查,必须严格按照以下 JSON 格式输出,不要输出任何其他内容:
20
+
21
+ {"score": 评分1-10, "issues": [{"type": "问题类型", "severity": "high/medium/low", "line": 行号, "description": "问题描述", "context": "相关上下文说明(可选)"}], "suggestions": ["改进建议"], "summary": "代码评价总结", "cross_file_issues": ["跨文件问题(可选)"]}
22
+
23
+ severity 判定标准(严格按此执行):
24
+ - high: 可能导致运行时错误、数据丢失、安全漏洞(如 SQL注入、XSS、硬编码密钥、空指针、资源泄漏)
25
+ - medium: 代码质量问题,可能影响可维护性或性能(如循环依赖、重复代码、缺少异常处理、魔法数字)
26
+ - low: 轻微代码风格问题(如命名不规范、缺少注释、过长函数、未使用的导入)
27
+
28
+ ## SQL / 数据库 Schema 完整性检查(重点)
29
+
30
+ 若上下文中的「数据库 Schema 上下文」提供了本次提交涉及的表定义,请**重点核对当前文件中的数据库访问代码与 Schema 是否一致**:
31
+
32
+ 1. **代码字段引用一致性**:代码中访问的列(如 `table.column`、INSERT/SELECT 字段列表、ORM 实体字段)必须与 Schema 中声明的列一致。引用了不存在的列(可能被重命名/删除而代码未同步)标记为 medium 问题。
33
+ 2. **外键类型一致性**:若代码涉及外键关联的列,确认两端类型匹配;类型完全不兼容标记 high。
34
+ 3. **DDL 与代码同步**:若代码中内嵌了 `CREATE TABLE` / `ALTER TABLE` / `ADD COLUMN` / `DROP COLUMN` 等 DDL 字符串但本次提交没有对应迁移脚本,标记为 medium(建议收敛到迁移脚本)。
35
+ 4. **破坏性变更防护**:对已有表的 `DROP COLUMN`、缩短长度、改窄类型等破坏性操作需谨慎,确认无数据丢失风险。
36
+
37
+ 将发现的跨文件/跨文件 schema 不一致问题写入 `cross_file_issues`,并在 `issues` 中给出对应项(severity 按上述标准)。
@@ -0,0 +1,49 @@
1
+ ---
2
+ id: commit_review
3
+ version: 1.1
4
+ variables: [commit_message, author, diff, schema_context]
5
+ category: analyzer
6
+ ---
7
+
8
+ 你是一位代码审查专家。请审查以下 Git 提交的变更。
9
+
10
+ 提交信息: {{commit_message}}
11
+ 作者: {{author}}
12
+
13
+ 变更内容:
14
+ {{diff}}
15
+
16
+ {% if schema_context %}
17
+ 数据库 Schema 上下文(本次提交及仓库中相关的 SQL/DDL 定义):
18
+ {{schema_context}}
19
+ {% endif %}
20
+
21
+ 请进行代码审查,必须严格按照以下 JSON 格式输出,不要输出任何其他内容:
22
+
23
+ {"score": 评分1-10, "issues": [{"type": "问题类型", "severity": "high/medium/low", "line": 行号, "description": "问题描述", "file": "文件路径"}], "suggestions": ["改进建议"], "summary": "代码评价总结"}
24
+
25
+ ## 审查重点
26
+
27
+ 除常规代码质量、安全(SQL 注入、XSS、硬编码密钥、空指针等)、性能问题外,请**特别关注本次提交中 SQL / 数据库 schema 变更的完整性**:
28
+
29
+ 1. **字段类型变更是否同步**
30
+ - 若某张表的列类型被修改(ALTER/MODIFY),检查所有引用该列的代码(ORM 实体、查询、DTO)是否同步调整,避免类型不匹配导致运行时错误。
31
+ - 若新增/删除/重命名列,检查代码中对该列的引用是否同步更新(避免引用已不存在的列)。
32
+
33
+ 2. **关联表类型是否同步变更**
34
+ - 外键(FOREIGN KEY)关联的列,其数据类型必须与引用表对应列的类型完全一致(建议长度/精度也一致)。
35
+ - 若一端变更了类型而另一端未变更,标记为 medium/high 问题。
36
+ - 检查外键引用的目标表、目标列是否真实存在;引用了不存在的表/列属于 high 问题。
37
+
38
+ 3. **代码与 DDL 同步完整性**
39
+ - 若代码中存在对表的列访问(如 `table.column`、INSERT/SELECT 字段列表),核对其在 schema 中是否存在。
40
+ - 若代码内嵌了 CREATE TABLE / ALTER TABLE / ADD COLUMN / DROP COLUMN 等 DDL 字符串,但本次提交没有对应的迁移/SQL 脚本文件,提示将 schema 变更收敛到迁移脚本(medium)。
41
+ - 同一张表在多个 SQL 文件中重复定义且列不一致时,提示收敛到单一文件(low)。
42
+
43
+ 4. **迁移安全**
44
+ - 对已有表的破坏性变更(DROP COLUMN、缩短长度、改窄类型)需谨慎,确认是否会导致数据丢失。
45
+
46
+ severity 判定标准(严格按此执行):
47
+ - high: 可能导致运行时错误、数据丢失、安全漏洞(如 SQL 注入、引用不存在的表/列、外键类型完全不兼容、破坏性 DDL 无防护)
48
+ - medium: schema 与代码不同步、外键精度不一致、内嵌 DDL 未纳入迁移脚本
49
+ - low: 轻微风格问题、重复定义可收敛
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: documentation/api
3
+ version: 1.0
4
+ variables: [file_path, language, content]
5
+ category: documentation
6
+ ---
7
+
8
+ 你是一位 API 文档专家。请为以下代码生成 API 文档。
9
+
10
+ 文件: {{file_path}}
11
+ 语言: {{language}}
12
+
13
+ ```{{language}}
14
+ {{content}}
15
+ ```
16
+
17
+ 请生成 OpenAPI/Swagger 风格的 API 文档,包括:
18
+
19
+ ## 接口列表
20
+ 对于每个公开的接口/函数/方法:
21
+
22
+ ### <函数名>
23
+ - **描述**: 功能说明
24
+ - **参数**: 参数名、类型、描述、是否必填
25
+ - **返回值**: 类型、描述
26
+ - **示例**: 调用示例
27
+
28
+ 请以 Markdown 格式输出。
@@ -0,0 +1,33 @@
1
+ ---
2
+ id: documentation/module
3
+ version: 1.0
4
+ variables: [language, file_path, content]
5
+ category: documentation
6
+ ---
7
+
8
+ 你是一位技术文档专家。请为以下 {{language}} 模块生成详细的文档。
9
+
10
+ 文件: {{file_path}}
11
+
12
+ ```{{language}}
13
+ {{content}}
14
+ ```
15
+
16
+ 请生成以下内容:
17
+
18
+ ## 模块概述
19
+ 简要描述模块的用途和功能。
20
+
21
+ ## 主要组件
22
+ 列出主要的类、函数、常量及其用途。
23
+
24
+ ## 使用示例
25
+ 提供典型的使用示例代码。
26
+
27
+ ## 依赖关系
28
+ 列出该模块依赖的其他模块或库。
29
+
30
+ ## 注意事项
31
+ 使用时需要注意的事项或限制。
32
+
33
+ 请以 Markdown 格式输出。
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: documentation/readme
3
+ version: 1.0
4
+ variables: [project_name, project_description, file_summaries]
5
+ category: documentation
6
+ ---
7
+
8
+ 你是一位技术写作专家。请根据项目结构生成 README.md 文档。
9
+
10
+ 项目信息:
11
+ - 名称: {{project_name}}
12
+ - 描述: {{project_description}}
13
+
14
+ 主要文件:
15
+ {{file_summaries}}
16
+
17
+ 请生成完整的 README.md,包括:
18
+
19
+ # <项目名称>
20
+
21
+ ## 简介
22
+ 项目简介和主要功能。
23
+
24
+ ## 特性
25
+ 主要特性和亮点。
26
+
27
+ ## 安装
28
+ 安装步骤和依赖要求。
29
+
30
+ ## 快速开始
31
+ 基本使用示例。
32
+
33
+ ## 项目结构
34
+ 目录结构说明。
35
+
36
+ ## 贡献指南
37
+ 如何参与项目开发。
38
+
39
+ ## 许可证
40
+ 开源许可证信息。
41
+
42
+ 请以 Markdown 格式输出。
@@ -0,0 +1,16 @@
1
+ ---
2
+ id: code-review-checklist
3
+ version: 1.0
4
+ variables: []
5
+ category: mcp
6
+ ---
7
+
8
+ 你是一位资深代码审查专家。在审查代码时,请遵循以下清单:
9
+
10
+ 1. **正确性**: 逻辑是否正确?边界条件是否处理?
11
+ 2. **安全性**: 是否存在 OWASP Top 10 漏洞?
12
+ 3. **性能**: 是否有 N+1 查询、不必要的内存分配?
13
+ 4. **可读性**: 命名是否清晰?函数是否过长?
14
+ 5. **可维护性**: 是否有硬编码?是否易于测试?
15
+
16
+ 使用 review tool 对目标路径进行代码审查,然后基于审查结果给出改进建议。
@@ -0,0 +1,15 @@
1
+ ---
2
+ id: mr-review-template
3
+ version: 1.0
4
+ variables: []
5
+ category: mcp
6
+ ---
7
+
8
+ 请审查以下 Merge Request 的代码变更:
9
+
10
+ 使用 review tool 分析变更文件,重点关注:
11
+ - 新增代码的安全性
12
+ - 修改是否引入回归风险
13
+ - 是否符合项目编码规范
14
+
15
+ 输出格式:问题列表 + 改进建议 + 总体评分。
@@ -0,0 +1,14 @@
1
+ ---
2
+ id: vuln-tuning-advisor
3
+ version: 1.0
4
+ variables: []
5
+ category: mcp
6
+ ---
7
+
8
+ 你是一位安全规则调优顾问。请基于 metrics 数据帮助用户分析:
9
+
10
+ 1. 使用 metrics tool 获取当前误报率最高的规则
11
+ 2. 对每条高频误报规则,分析可能的误报原因
12
+ 3. 建议规则抑制条件或 LLM 提示词改进方案
13
+
14
+ 目标是降低误报率的同时不引入漏报。
@@ -0,0 +1,61 @@
1
+ ---
2
+ id: security_analysis
3
+ version: 1.0
4
+ variables: [language, file_path, project_context, content, ast_context, detected_issues]
5
+ category: analyzer
6
+ ---
7
+
8
+ 作为安全专家,请审查以下 {{language}} 代码的安全问题。
9
+
10
+ ## 文件信息
11
+ 文件: {{file_path}}
12
+
13
+ ## 项目上下文
14
+ {{project_context}}
15
+
16
+ ## 代码内容(带行号)
17
+ ```{{language}}
18
+ {{content}}
19
+ ```
20
+
21
+ ## AST 分析结果
22
+ {{ast_context}}
23
+
24
+ ## 已检测到的模式匹配问题
25
+ {{detected_issues}}
26
+
27
+ ## 分析要求
28
+
29
+ 请进行以下分析:
30
+
31
+ 1. **确认已检测到的问题是否真实存在**
32
+ - 检查代码中是否已有防御措施(如 escape、validate、sanitize、try/except 等)
33
+ - 检查可疑代码是否在安全上下文中(如测试文件、配置文件)
34
+ - 检查用户输入是否经过验证或过滤
35
+
36
+ 2. **评估每个问题的严重程度**
37
+ - critical: 可被直接利用,导致系统被攻破、数据泄露或远程代码执行
38
+ - high: 可被利用但需特定条件,导致敏感信息泄露或权限提升
39
+ - medium: 存在安全风险但利用难度较高
40
+ - low: 代码质量问题,不直接影响安全
41
+
42
+ 3. **检查是否有其他潜在的安全风险**
43
+ - 未检测到的 SQL 注入、XSS、命令注入等
44
+ - 不安全的配置或默认设置
45
+ - 敏感信息泄露
46
+
47
+ 4. **提供具体的修复建议**
48
+ - 针对每个 confirmed issue,给出具体的修复代码示例
49
+ - 说明如何验证修复是否有效
50
+
51
+ ## 输出格式
52
+
53
+ 必须严格按以下 JSON 格式输出,不要输出其他内容:
54
+
55
+ {"confirmed_issues": [{"type": "类型", "severity": "critical/high/medium/low", "line": 行号, "description": "问题描述", "recommendation": "修复建议"}], "dismissed_issues": [{"type": "类型", "line": 行号, "reason": "排除原因"}], "additional_risks": ["额外风险描述"], "risk_score": 0-100}
56
+
57
+ 注意:
58
+ - confirmed_issues: 确认真实存在的高风险问题
59
+ - dismissed_issues: 已排除的误报,需说明原因
60
+ - additional_risks: 未在模式匹配中检测到的额外风险
61
+ - risk_score: 综合风险评分(0-100)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "vcode-analysis"
7
- version = "0.8.0"
7
+ version = "0.9.0"
8
8
  description = "基于大模型的智能代码分析工具,支持代码审查、文档生成、架构分析和安全扫描"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -70,7 +70,11 @@ py-modules = ["cli"]
70
70
 
71
71
  [tool.setuptools.packages.find]
72
72
  where = ["."]
73
- include = ["core*", "analyzers*", "parsers*", "vcode_mcp*"]
73
+ include = ["core*", "analyzers*", "parsers*", "vcode_mcp*", "prompts*"]
74
+
75
+ # 将 prompts 包内的 Markdown 提示词打包进 whl(默认内置,可被用户目录覆盖)
76
+ [tool.setuptools.package-data]
77
+ prompts = ["**/*.md"]
74
78
 
75
79
  [tool.black]
76
80
  line-length = 100
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vcode-analysis
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: 基于大模型的智能代码分析工具,支持代码审查、文档生成、架构分析和安全扫描
5
5
  Author-email: Wellchang <2483808264@qq.com>
6
6
  License: MIT
@@ -65,6 +65,19 @@ parsers/kotlin/ast_parser.py
65
65
  parsers/kotlin/models.py
66
66
  parsers/kotlin/patterns.py
67
67
  parsers/kotlin/regex_parser.py
68
+ prompts/__init__.py
69
+ prompts/architecture.md
70
+ prompts/batch_review.md
71
+ prompts/code_review.md
72
+ prompts/code_review_v2.md
73
+ prompts/commit_review.md
74
+ prompts/security_analysis.md
75
+ prompts/documentation/api.md
76
+ prompts/documentation/module.md
77
+ prompts/documentation/readme.md
78
+ prompts/mcp/code_review_checklist.md
79
+ prompts/mcp/mr_review_template.md
80
+ prompts/mcp/vuln_tuning_advisor.md
68
81
  tests/test_batch_operations.py
69
82
  tests/test_c_parser.py
70
83
  tests/test_context_builder_sql.py
@@ -2,4 +2,5 @@ analyzers
2
2
  cli
3
3
  core
4
4
  parsers
5
+ prompts
5
6
  vcode_mcp
@@ -8,7 +8,7 @@ from vcode_mcp.prompt_handler import PROMPTS
8
8
  from vcode_mcp.resource_handler import read_metrics_summary, read_report, read_rule
9
9
  from vcode_mcp.tool_handler import handle_tool
10
10
 
11
- mcp = MCPServer("vcode-analysis", version="0.8.0")
11
+ mcp = MCPServer("vcode-analysis", version="0.9.0")
12
12
 
13
13
 
14
14
  # ── Tools ────────────────────────────────────────────────────────
@@ -61,7 +61,7 @@ def _run_review(target: str, config, args: dict) -> list[dict]:
61
61
  reviewer.metrics_store = ms
62
62
  reviewer._current_run_id = ms.record_scan_run(ScanRun(
63
63
  repo_path=str(Path(target).resolve()), analyzer="code_review",
64
- tool_version="0.8.0",
64
+ tool_version="0.9.0",
65
65
  ))
66
66
 
67
67
  path = Path(target)
@@ -99,7 +99,7 @@ def _run_security(target: str, config, args: dict) -> list[dict]:
99
99
  scanner.metrics_store = ms
100
100
  scanner._current_run_id = ms.record_scan_run(ScanRun(
101
101
  repo_path=str(Path(target).resolve()), analyzer="security",
102
- tool_version="0.8.0",
102
+ tool_version="0.9.0",
103
103
  ))
104
104
 
105
105
  path = Path(target)
File without changes
File without changes
File without changes