cgraphx 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +0 -1
  2. package/dist/.claude-template/hooks/precommit-check/precommit-check.cjs +90 -0
  3. package/dist/.claude-template/skills/cgraphx/SKILL.md +3 -3
  4. package/dist/.claude-template/skills/cgraphx/agent-prompt.md +1 -1
  5. package/dist/.claude-template/skills/cgraphx-guide/SKILL.md +94 -0
  6. package/dist/.claude-template/skills/cgraphx-guide/how-to-use.html +424 -0
  7. package/dist/.claude-template/skills/clarify-requirements/SKILL.md +19 -8
  8. package/dist/.claude-template/skills/code-impact-docgen/SKILL.md +186 -176
  9. package/dist/.claude-template/skills/code-impact-docgen/template-design-html.md +357 -0
  10. package/dist/.claude-template/skills/code-impact-docgen/template-design-md.md +164 -0
  11. package/dist/.claude-template/skills/code-impact-init/SKILL.md +47 -47
  12. package/dist/.claude-template/skills/developer-timeline/SKILL.md +9 -0
  13. package/dist/.claude-template/skills/precommit-review/SKILL.md +50 -0
  14. package/dist/.claude-template/skills/run-api-test/SKILL.md +187 -0
  15. package/dist/.claude-template/skills/run-api-test/assets/template-test-report.md +103 -0
  16. package/dist/.claude-template/skills/run-api-test/assets/template-test-verify.jsonl +5 -0
  17. package/dist/.claude-template/skills/run-api-test/references/bru-run.md +60 -0
  18. package/dist/.claude-template/skills/run-api-test/references/db-verification.md +81 -0
  19. package/dist/.claude-template/skills/run-api-test/references/report-format.md +104 -0
  20. package/dist/.claude-template/skills/run-api-test/references/service-readiness.md +61 -0
  21. package/dist/.claude-template/skills/run-api-test/references/test-scope.md +64 -0
  22. package/dist/.claude-template/skills/write-api/SKILL.md +150 -0
  23. package/dist/.claude-template/skills/write-api/assets/template-api-spec.md +112 -0
  24. package/dist/.claude-template/skills/write-api/assets/template-request.bru +75 -0
  25. package/dist/.claude-template/skills/write-api/references/ai-prompts.md +133 -0
  26. package/dist/.claude-template/skills/write-api/references/api-spec-format.md +108 -0
  27. package/dist/.claude-template/skills/write-api/references/bru-format.md +144 -0
  28. package/dist/.claude-template/skills/write-api/references/collection-layout.md +81 -0
  29. package/dist/.claude-template/skills/write-api/references/environment-setup.md +105 -0
  30. package/dist/.claude-template/skills/write-api/references/interface-scope.md +74 -0
  31. package/dist/.claude-template/skills/write-api-doc/SKILL.md +317 -0
  32. package/dist/.claude-template/skills/write-api-doc/template-api-html.md +422 -0
  33. package/dist/.claude-template/skills/write-plan/SKILL.md +38 -16
  34. package/dist/.claude-template/skills/write-prd/SKILL.md +32 -8
  35. package/dist/.claude-template/skills/write-spec/SKILL.md +34 -9
  36. package/dist/api-test/ai-fields.d.ts +37 -0
  37. package/dist/api-test/ai-fields.d.ts.map +1 -0
  38. package/dist/api-test/ai-fields.js +114 -0
  39. package/dist/api-test/ai-fields.js.map +1 -0
  40. package/dist/api-test/assemble.d.ts +76 -0
  41. package/dist/api-test/assemble.d.ts.map +1 -0
  42. package/dist/api-test/assemble.js +185 -0
  43. package/dist/api-test/assemble.js.map +1 -0
  44. package/dist/api-test/bru-cli-invoker.d.ts +72 -0
  45. package/dist/api-test/bru-cli-invoker.d.ts.map +1 -0
  46. package/dist/api-test/bru-cli-invoker.js +169 -0
  47. package/dist/api-test/bru-cli-invoker.js.map +1 -0
  48. package/dist/api-test/bru-report-parser.d.ts +24 -0
  49. package/dist/api-test/bru-report-parser.d.ts.map +1 -0
  50. package/dist/api-test/bru-report-parser.js +110 -0
  51. package/dist/api-test/bru-report-parser.js.map +1 -0
  52. package/dist/api-test/bru-runner.d.ts +101 -0
  53. package/dist/api-test/bru-runner.d.ts.map +1 -0
  54. package/dist/api-test/bru-runner.js +316 -0
  55. package/dist/api-test/bru-runner.js.map +1 -0
  56. package/dist/api-test/bru-writer.d.ts +52 -0
  57. package/dist/api-test/bru-writer.d.ts.map +1 -0
  58. package/dist/api-test/bru-writer.js +159 -0
  59. package/dist/api-test/bru-writer.js.map +1 -0
  60. package/dist/api-test/call-chain-extractor.d.ts +80 -0
  61. package/dist/api-test/call-chain-extractor.d.ts.map +1 -0
  62. package/dist/api-test/call-chain-extractor.js +179 -0
  63. package/dist/api-test/call-chain-extractor.js.map +1 -0
  64. package/dist/api-test/cli.d.ts +133 -0
  65. package/dist/api-test/cli.d.ts.map +1 -0
  66. package/dist/api-test/cli.js +1009 -0
  67. package/dist/api-test/cli.js.map +1 -0
  68. package/dist/api-test/config.d.ts +75 -0
  69. package/dist/api-test/config.d.ts.map +1 -0
  70. package/dist/api-test/config.js +406 -0
  71. package/dist/api-test/config.js.map +1 -0
  72. package/dist/api-test/db-query-cli.d.ts +51 -0
  73. package/dist/api-test/db-query-cli.d.ts.map +1 -0
  74. package/dist/api-test/db-query-cli.js +119 -0
  75. package/dist/api-test/db-query-cli.js.map +1 -0
  76. package/dist/api-test/enhance-prepare.d.ts +111 -0
  77. package/dist/api-test/enhance-prepare.d.ts.map +1 -0
  78. package/dist/api-test/enhance-prepare.js +425 -0
  79. package/dist/api-test/enhance-prepare.js.map +1 -0
  80. package/dist/api-test/enhance-write.d.ts +28 -0
  81. package/dist/api-test/enhance-write.d.ts.map +1 -0
  82. package/dist/api-test/enhance-write.js +145 -0
  83. package/dist/api-test/enhance-write.js.map +1 -0
  84. package/dist/api-test/errors.d.ts +48 -0
  85. package/dist/api-test/errors.d.ts.map +1 -0
  86. package/dist/api-test/errors.js +76 -0
  87. package/dist/api-test/errors.js.map +1 -0
  88. package/dist/api-test/field-extractor.d.ts +98 -0
  89. package/dist/api-test/field-extractor.d.ts.map +1 -0
  90. package/dist/api-test/field-extractor.js +327 -0
  91. package/dist/api-test/field-extractor.js.map +1 -0
  92. package/dist/api-test/impl-finder.d.ts +37 -0
  93. package/dist/api-test/impl-finder.d.ts.map +1 -0
  94. package/dist/api-test/impl-finder.js +54 -0
  95. package/dist/api-test/impl-finder.js.map +1 -0
  96. package/dist/api-test/index.d.ts +41 -0
  97. package/dist/api-test/index.d.ts.map +1 -0
  98. package/dist/api-test/index.js +124 -0
  99. package/dist/api-test/index.js.map +1 -0
  100. package/dist/api-test/java-parser.d.ts +89 -0
  101. package/dist/api-test/java-parser.d.ts.map +1 -0
  102. package/dist/api-test/java-parser.js +508 -0
  103. package/dist/api-test/java-parser.js.map +1 -0
  104. package/dist/api-test/md-writer.d.ts +49 -0
  105. package/dist/api-test/md-writer.d.ts.map +1 -0
  106. package/dist/api-test/md-writer.js +202 -0
  107. package/dist/api-test/md-writer.js.map +1 -0
  108. package/dist/api-test/parser-httpservice.d.ts +91 -0
  109. package/dist/api-test/parser-httpservice.d.ts.map +1 -0
  110. package/dist/api-test/parser-httpservice.js +271 -0
  111. package/dist/api-test/parser-httpservice.js.map +1 -0
  112. package/dist/api-test/report.d.ts +188 -0
  113. package/dist/api-test/report.d.ts.map +1 -0
  114. package/dist/api-test/report.js +522 -0
  115. package/dist/api-test/report.js.map +1 -0
  116. package/dist/api-test/snapshot.d.ts +26 -0
  117. package/dist/api-test/snapshot.d.ts.map +1 -0
  118. package/dist/api-test/snapshot.js +150 -0
  119. package/dist/api-test/snapshot.js.map +1 -0
  120. package/dist/api-test/test-history.d.ts +48 -0
  121. package/dist/api-test/test-history.d.ts.map +1 -0
  122. package/dist/api-test/test-history.js +122 -0
  123. package/dist/api-test/test-history.js.map +1 -0
  124. package/dist/api-test/types.d.ts +174 -0
  125. package/dist/api-test/types.d.ts.map +1 -0
  126. package/dist/api-test/types.js +13 -0
  127. package/dist/api-test/types.js.map +1 -0
  128. package/dist/api-test/verify-prepare.d.ts +30 -0
  129. package/dist/api-test/verify-prepare.d.ts.map +1 -0
  130. package/dist/api-test/verify-prepare.js +150 -0
  131. package/dist/api-test/verify-prepare.js.map +1 -0
  132. package/dist/api-test/verify-write.d.ts +31 -0
  133. package/dist/api-test/verify-write.d.ts.map +1 -0
  134. package/dist/api-test/verify-write.js +159 -0
  135. package/dist/api-test/verify-write.js.map +1 -0
  136. package/dist/bin/codegraph.js +0 -100
  137. package/dist/bin/codegraph.js.map +1 -1
  138. package/dist/dbquery/dump-schema.d.ts +46 -0
  139. package/dist/dbquery/dump-schema.d.ts.map +1 -0
  140. package/dist/dbquery/dump-schema.js +379 -0
  141. package/dist/dbquery/dump-schema.js.map +1 -0
  142. package/dist/installer/targets/claude.d.ts +15 -0
  143. package/dist/installer/targets/claude.d.ts.map +1 -1
  144. package/dist/installer/targets/claude.js +53 -0
  145. package/dist/installer/targets/claude.js.map +1 -1
  146. package/dist/resolution/index.d.ts.map +1 -1
  147. package/dist/resolution/index.js +13 -0
  148. package/dist/resolution/index.js.map +1 -1
  149. package/dist/resolution/scope-index.d.ts +86 -0
  150. package/dist/resolution/scope-index.d.ts.map +1 -0
  151. package/dist/resolution/scope-index.js +143 -0
  152. package/dist/resolution/scope-index.js.map +1 -0
  153. package/dist/resolution/stdlib-blocklist.d.ts +53 -0
  154. package/dist/resolution/stdlib-blocklist.d.ts.map +1 -0
  155. package/dist/resolution/stdlib-blocklist.js +143 -0
  156. package/dist/resolution/stdlib-blocklist.js.map +1 -0
  157. package/dist/search/ast-helpers.d.ts +42 -0
  158. package/dist/search/ast-helpers.d.ts.map +1 -0
  159. package/dist/search/ast-helpers.js +106 -0
  160. package/dist/search/ast-helpers.js.map +1 -0
  161. package/dist/search/call-sites.d.ts +398 -0
  162. package/dist/search/call-sites.d.ts.map +1 -0
  163. package/dist/search/call-sites.js +1433 -0
  164. package/dist/search/call-sites.js.map +1 -0
  165. package/dist/search/context.d.ts +134 -0
  166. package/dist/search/context.d.ts.map +1 -0
  167. package/dist/search/context.js +575 -0
  168. package/dist/search/context.js.map +1 -0
  169. package/dist/search/impact.d.ts +139 -0
  170. package/dist/search/impact.d.ts.map +1 -0
  171. package/dist/search/impact.js +646 -0
  172. package/dist/search/impact.js.map +1 -0
  173. package/dist/search/related.d.ts +178 -0
  174. package/dist/search/related.d.ts.map +1 -0
  175. package/dist/search/related.js +667 -0
  176. package/dist/search/related.js.map +1 -0
  177. package/dist/search/slice.d.ts +148 -0
  178. package/dist/search/slice.d.ts.map +1 -0
  179. package/dist/search/slice.js +460 -0
  180. package/dist/search/slice.js.map +1 -0
  181. package/dist/search/snr-constants.d.ts +41 -0
  182. package/dist/search/snr-constants.d.ts.map +1 -0
  183. package/dist/search/snr-constants.js +44 -0
  184. package/dist/search/snr-constants.js.map +1 -0
  185. package/dist/search/types.d.ts +28 -0
  186. package/dist/search/types.d.ts.map +1 -0
  187. package/dist/search/types.js +12 -0
  188. package/dist/search/types.js.map +1 -0
  189. package/dist/timeline/cli.d.ts.map +1 -1
  190. package/dist/timeline/cli.js +22 -3
  191. package/dist/timeline/cli.js.map +1 -1
  192. package/dist/timeline/store.d.ts +5 -0
  193. package/dist/timeline/store.d.ts.map +1 -1
  194. package/dist/timeline/store.js +23 -3
  195. package/dist/timeline/store.js.map +1 -1
  196. package/package.json +1 -1
  197. package/scripts/agent-eval/subagent-token-cost.py +188 -0
  198. package/dist/.claude-template/skills/code-impact-docgen/template-business-html.md +0 -242
  199. package/dist/.claude-template/skills/code-impact-docgen/template-business-md.md +0 -107
  200. package/dist/.claude-template/skills/code-impact-docgen/template-technical-html.md +0 -205
  201. package/dist/.claude-template/skills/code-impact-docgen/template-technical-md.md +0 -155
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env python3
2
+ """Measure real API token usage and $ cost from Claude Code subagent transcripts.
3
+
4
+ Reads the `.output` JSONL file Claude Code writes per background subagent
5
+ (the `output_file` returned by the Agent tool), sums the `usage` field on
6
+ each assistant message, and applies Sonnet list pricing to get a cache-aware
7
+ $ cost.
8
+
9
+ Why this exists: tool-output chars (the easy thing to count by eye) is a
10
+ poor proxy for real cost. The dominant cost driver in multi-turn sessions is
11
+ `cache_read_input_tokens` — every turn re-sends the growing conversation as
12
+ cached input, billed at ~10% of full input cost. A tool that returns tiny
13
+ output but forces many turns (grep) is more expensive than a tool that
14
+ returns rich output in few turns (codegraph_explore). chars hides this;
15
+ `usage` + $ pricing exposes it.
16
+
17
+ See docs/features/2026-07-01-calls-command/abac-comparison.md for the case
18
+ study that motivated this script.
19
+
20
+ Pricing (Sonnet, per million tokens):
21
+ input $3.00
22
+ output $15.00
23
+ cache_read $0.30 (10% of input)
24
+ cache_creation $3.75 (125% of input — first-time cache write)
25
+
26
+ Usage:
27
+ python3 subagent-token-cost.py <agent-id> [<agent-id> ...]
28
+ python3 subagent-token-cost.py --dir <tasks-dir> # all .output files
29
+
30
+ The agent-id form looks up `<tasks-dir>/<agent-id>.output` under the standard
31
+ session tasks directory. Pass `--dir` to point at a different directory
32
+ (e.g. when comparing across sessions).
33
+
34
+ Output: one line per arm with turns, tool_uses, input/output/cache_read/
35
+ cache_write token counts, raw total, and $ cost. Sorted in input order.
36
+
37
+ Notes:
38
+ - This reads ONLY the `usage` field and tool_use block counts — never message
39
+ content. Safe to run on large transcripts; won't overflow your context.
40
+ - For main-session cost (not subagent), use offload-eval-cost.mjs instead,
41
+ which reads the structured eval-runs format and uses Claude Code's own
42
+ authoritative costUSD accounting from the `result` event.
43
+ """
44
+ from __future__ import annotations
45
+
46
+ import argparse
47
+ import json
48
+ import os
49
+ import sys
50
+ from pathlib import Path
51
+
52
+ # Sonnet list pricing, per million tokens.
53
+ PRICE_INPUT_PER_M = 3.00
54
+ PRICE_OUTPUT_PER_M = 15.00
55
+ PRICE_CACHE_READ_PER_M = 0.30
56
+ PRICE_CACHE_WRITE_PER_M = 3.75
57
+
58
+
59
+ def default_tasks_dir() -> Path:
60
+ """Best-effort default for this session's tasks dir."""
61
+ # Claude Code writes subagent .output files under a session-scoped tasks dir.
62
+ # The exact path varies; common locations:
63
+ candidates = [
64
+ Path('/private/tmp/claude-501'),
65
+ Path.home() / '.claude' / 'tasks',
66
+ ]
67
+ for c in candidates:
68
+ if c.exists():
69
+ # Find the most recently modified session dir
70
+ session_dirs = sorted(
71
+ c.glob('*-Users-*'), key=lambda p: p.stat().st_mtime, reverse=True
72
+ )
73
+ for sd in session_dirs:
74
+ tasks = sd / 'tasks'
75
+ if tasks.exists():
76
+ return tasks
77
+ return Path('/private/tmp/claude-501/unknown-session/tasks')
78
+
79
+
80
+ def measure_file(path: Path) -> dict | None:
81
+ if not path.exists():
82
+ return None
83
+ totals = {'input': 0, 'output': 0, 'cache_read': 0, 'cache_creation': 0}
84
+ assistant_turns = 0
85
+ tool_uses = 0
86
+ with path.open() as f:
87
+ for line in f:
88
+ line = line.strip()
89
+ if not line:
90
+ continue
91
+ try:
92
+ obj = json.loads(line)
93
+ except json.JSONDecodeError:
94
+ continue
95
+ msg = obj.get('message') or {}
96
+ if msg.get('role') != 'assistant':
97
+ continue
98
+ usage = msg.get('usage') or {}
99
+ if not usage:
100
+ continue
101
+ assistant_turns += 1
102
+ totals['input'] += usage.get('input_tokens', 0) or 0
103
+ totals['output'] += usage.get('output_tokens', 0) or 0
104
+ totals['cache_read'] += usage.get('cache_read_input_tokens', 0) or 0
105
+ totals['cache_creation'] += usage.get('cache_creation_input_tokens', 0) or 0
106
+ content = msg.get('content') or []
107
+ if isinstance(content, list):
108
+ for block in content:
109
+ if isinstance(block, dict) and block.get('type') == 'tool_use':
110
+ tool_uses += 1
111
+ cost = (
112
+ totals['input'] * PRICE_INPUT_PER_M
113
+ + totals['output'] * PRICE_OUTPUT_PER_M
114
+ + totals['cache_read'] * PRICE_CACHE_READ_PER_M
115
+ + totals['cache_creation'] * PRICE_CACHE_WRITE_PER_M
116
+ ) / 1_000_000
117
+ return {
118
+ 'turns': assistant_turns,
119
+ 'tool_uses': tool_uses,
120
+ 'totals': totals,
121
+ 'all_tokens': sum(totals.values()),
122
+ 'cost_usd': cost,
123
+ }
124
+
125
+
126
+ def main() -> int:
127
+ ap = argparse.ArgumentParser(description=__doc__.split('\n')[0])
128
+ ap.add_argument('agent_ids', nargs='*', help='subagent IDs to measure')
129
+ ap.add_argument(
130
+ '--dir',
131
+ help='tasks directory containing <id>.output files (default: auto-detect latest session)',
132
+ )
133
+ ap.add_argument(
134
+ '--label',
135
+ action='append',
136
+ default=[],
137
+ help='label for an agent, in the same order as agent_ids (repeatable)',
138
+ )
139
+ args = ap.parse_args()
140
+
141
+ tasks_dir = Path(args.dir) if args.dir else default_tasks_dir()
142
+
143
+ if not args.agent_ids:
144
+ # Measure every .output file in the tasks dir
145
+ files = sorted(tasks_dir.glob('*.output'))
146
+ if not files:
147
+ print(f'no .output files in {tasks_dir}', file=sys.stderr)
148
+ return 1
149
+ targets = [(f.stem, f) for f in files]
150
+ else:
151
+ targets = [(aid, tasks_dir / f'{aid}.output') for aid in args.agent_ids]
152
+
153
+ rows = []
154
+ for i, (label, path) in enumerate(targets):
155
+ if args.label and i < len(args.label):
156
+ label = args.label[i]
157
+ r = measure_file(path)
158
+ if r is None:
159
+ print(f'{label}: transcript not found at {path}', file=sys.stderr)
160
+ continue
161
+ r['label'] = label
162
+ rows.append(r)
163
+
164
+ if not rows:
165
+ return 1
166
+
167
+ header = (
168
+ f'{"Arm":<32} {"turns":>6} {"tools":>6} {"input":>10} {"output":>10} '
169
+ f'{"cache_r":>10} {"cache_w":>10} {"total_tok":>11} {"$ cost":>9}'
170
+ )
171
+ print(header)
172
+ print('-' * len(header))
173
+ for r in rows:
174
+ t = r['totals']
175
+ print(
176
+ f'{r["label"]:<32} {r["turns"]:>6} {r["tool_uses"]:>6} {t["input"]:>10,} '
177
+ f'{t["output"]:>10,} {t["cache_read"]:>10,} {t["cache_creation"]:>10,} '
178
+ f'{r["all_tokens"]:>11,} ${r["cost_usd"]:>8.4f}'
179
+ )
180
+
181
+ print()
182
+ print('Pricing: Sonnet list. input $3/M, output $15/M, cache_read $0.30/M, cache_write $3.75/M.')
183
+ print('total_tok = raw token sum (ignores cache discount). $ cost = cache-aware (what actually bills).')
184
+ return 0
185
+
186
+
187
+ if __name__ == '__main__':
188
+ sys.exit(main())
@@ -1,242 +0,0 @@
1
- # Business 文档 HTML 模板
2
-
3
- 适用于面向业务读者的 HTML 格式文档。
4
-
5
- 生成前阅读此文件获取完整的 CSS 样式和章节结构参考。
6
-
7
- ## 完整 HTML 结构
8
-
9
- ```html
10
- <!DOCTYPE html>
11
- <html lang="zh-CN">
12
- <head>
13
- <meta charset="UTF-8">
14
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
15
- <title>{文档标题} — {项目名称}</title>
16
- <style>
17
- :root {
18
- --bg: #ffffff;
19
- --surface: #f8f9fa;
20
- --text: #1d1d1f;
21
- --text-secondary: #6e6e73;
22
- --accent: #0071e3;
23
- --accent-light: #e8f0fe;
24
- --border: #d2d2d7;
25
- --code-bg: #f5f5f7;
26
- --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
27
- --font-mono: "SF Mono", "Fira Code", "Cascadia Code", "Source Code Pro", monospace;
28
- --max-width: 800px;
29
- }
30
-
31
- *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
32
-
33
- body {
34
- font-family: var(--font-sans);
35
- font-size: 16px;
36
- line-height: 1.7;
37
- color: var(--text);
38
- background: var(--bg);
39
- }
40
-
41
- .container {
42
- max-width: var(--max-width);
43
- margin: 0 auto;
44
- padding: 2rem 1.5rem;
45
- }
46
-
47
- h1 {
48
- font-size: 2rem;
49
- font-weight: 700;
50
- letter-spacing: -0.02em;
51
- margin-bottom: 0.5em;
52
- padding-bottom: 0.5em;
53
- border-bottom: 2px solid var(--border);
54
- }
55
-
56
- .meta {
57
- color: var(--text-secondary);
58
- font-size: 0.875rem;
59
- margin-bottom: 2em;
60
- }
61
-
62
- h2 {
63
- font-size: 1.5rem;
64
- font-weight: 600;
65
- margin-top: 2.5em;
66
- margin-bottom: 0.75em;
67
- padding-bottom: 0.3em;
68
- border-bottom: 1px solid var(--border);
69
- }
70
-
71
- h3 {
72
- font-size: 1.2rem;
73
- font-weight: 600;
74
- margin-top: 1.5em;
75
- margin-bottom: 0.5em;
76
- }
77
-
78
- p { margin-bottom: 1em; }
79
-
80
- ul, ol {
81
- margin-bottom: 1em;
82
- padding-left: 1.5em;
83
- }
84
-
85
- li { margin-bottom: 0.3em; }
86
-
87
- strong { font-weight: 600; }
88
-
89
- code {
90
- font-family: var(--font-mono);
91
- background: var(--code-bg);
92
- padding: 0.15em 0.4em;
93
- border-radius: 4px;
94
- font-size: 0.9em;
95
- }
96
-
97
- pre {
98
- background: var(--code-bg);
99
- border: 1px solid var(--border);
100
- border-radius: 8px;
101
- padding: 1em;
102
- margin-bottom: 1em;
103
- overflow-x: auto;
104
- }
105
-
106
- pre code {
107
- background: none;
108
- padding: 0;
109
- font-size: 0.875em;
110
- }
111
-
112
- table {
113
- width: 100%;
114
- border-collapse: collapse;
115
- margin-bottom: 1em;
116
- font-size: 0.95em;
117
- }
118
-
119
- th, td {
120
- padding: 0.6em 1em;
121
- text-align: left;
122
- border-bottom: 1px solid var(--border);
123
- }
124
-
125
- thead th {
126
- font-weight: 600;
127
- color: var(--accent);
128
- background: var(--surface);
129
- }
130
-
131
- tbody tr:nth-child(even) { background: var(--surface); }
132
-
133
- .toc {
134
- background: var(--surface);
135
- border: 1px solid var(--border);
136
- border-radius: 8px;
137
- padding: 1em 1.5em;
138
- margin-bottom: 2em;
139
- }
140
-
141
- .toc h3 {
142
- margin-top: 0;
143
- margin-bottom: 0.5em;
144
- font-size: 1rem;
145
- }
146
-
147
- .toc ul { list-style: none; padding-left: 0; }
148
- .toc li { margin-bottom: 0.25em; }
149
- .toc a { color: var(--accent); text-decoration: none; }
150
- .toc a:hover { text-decoration: underline; }
151
- .toc ul ul { padding-left: 1.5em; margin-top: 0.25em; }
152
-
153
- .callout {
154
- background: var(--accent-light);
155
- border-left: 4px solid var(--accent);
156
- padding: 0.75em 1em;
157
- border-radius: 0 8px 8px 0;
158
- margin-bottom: 1em;
159
- }
160
-
161
- @media print {
162
- body { font-size: 12pt; }
163
- .container { max-width: 100%; padding: 0; }
164
- .toc { break-after: page; }
165
- h2 { break-after: avoid; }
166
- }
167
- </style>
168
- </head>
169
- <body>
170
- <div class="container">
171
- <h1>{文档标题}</h1>
172
- <p class="meta">生成日期:YYYY-MM-DD | 主题范围:{范围描述}</p>
173
-
174
- <nav class="toc">
175
- <h3>目录</h3>
176
- <ul>
177
- <li><a href="#背景与目标">背景与目标</a></li>
178
- <li><a href="#核心能力">核心能力</a></li>
179
- <li><a href="#业务流程">业务流程</a></li>
180
- <li><a href="#关键决策">关键决策</a></li>
181
- <li><a href="#现状与展望">现状与展望</a></li>
182
- </ul>
183
- </nav>
184
-
185
- <article>
186
- <section id="背景与目标">
187
- <h2>背景与目标</h2>
188
- <p>说明项目或系统的定位、目标和解决的问题。</p>
189
- </section>
190
-
191
- <section id="核心能力">
192
- <h2>核心能力</h2>
193
- <p>描述系统提供的主要能力和价值。</p>
194
- </section>
195
-
196
- <section id="业务流程">
197
- <h2>业务流程</h2>
198
- <p>说明核心业务流程和操作步骤。</p>
199
- </section>
200
-
201
- <section id="关键决策">
202
- <h2>关键决策</h2>
203
- <p>列出重要的技术和业务决策及其理由。</p>
204
- </section>
205
-
206
- <section id="现状与展望">
207
- <h2>现状与展望</h2>
208
- <p>说明当前状态和未来方向。</p>
209
- </section>
210
- </article>
211
- </div>
212
- </body>
213
- </html>
214
- ```
215
-
216
- ## Business HTML 章节内容指南
217
-
218
- 每个章节应按照以下指引从 AI 知识文档中提取、转换和改写内容。
219
-
220
- | 章节 | 内容来源 | 改写方向 |
221
- |------|------------------------|----------|
222
- | 背景与目标 | Summary 文本 | 从"为什么分析"转为"项目/系统的目标和定位" |
223
- | 核心能力 | Summary 文本 | 从"发现"转为"能力描述",面向非技术读者 |
224
- | 业务流程 | Read 文件原文(该章节 cgraphx 不提取) | 从"操作步骤"转为"业务流程说明",去除技术细节 |
225
- | 关键决策 | Read 文件原文(该章节 cgraphx 不提取) | 从"决策记录"转为"决策解释",说明决策的业务原因 |
226
- | 价值与影响 | Read 文件原文(该章节 cgraphx 不提取) | 从"对未来变更的影响"转为"对业务的价值和影响" |
227
- | 现状与展望 | Read 文件原文(该章节 cgraphx 不提取) | 从"发现和后续"转为"当前状态和未来规划" |
228
- | 风险与注意事项 | Read 文件原文(该章节 cgraphx 不提取) | 从"故障排除"转为"风险提示和应对措施" |
229
- | 常见问题 | Read 文件原文(该章节 cgraphx 不提取) | 从"分析记录"转为"Q&A 格式" |
230
- | 术语表 | 各文本字段中的术语 | 提取关键术语,给出简洁的业务定义 |
231
- | 相关资源 | — | 列出相关的代码文件(相对路径)或外部文档 |
232
-
233
- ## HTML 格式要点
234
-
235
- - 所有 CSS 内联在 `<style>` 标签中,不引用外部样式表
236
- - `<title>` 包含文档标题和项目名称
237
- - 使用 `<nav class="toc">` 作为目录容器
238
- - 每个章节使用 `<section id="章节锚点">` 包裹
239
- - 章节锚点使用中文 ID(如 `id="背景与目标"`)
240
- - 重要提示或注意事项使用 `<div class="callout">` 样式
241
- - 代码示例使用 `<pre><code>` 标签
242
- - 表格使用 `<thead>` + `<tbody>` 结构
@@ -1,107 +0,0 @@
1
- # Business 文档 Markdown 模板
2
-
3
- 适用于面向业务读者的 Markdown 格式文档。
4
-
5
- ## 文档结构
6
-
7
- ```markdown
8
- # {文档标题}
9
-
10
- > 生成日期:YYYY-MM-DD | 主题范围:{范围描述}
11
-
12
- ## 目录
13
-
14
- - [背景与目标](#背景与目标)
15
- - [核心能力](#核心能力)
16
- - [业务流程](#业务流程)
17
- - [关键决策](#关键决策)
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
-
43
- ```markdown
44
- ## 用户场景
45
-
46
- 描述典型使用场景。
47
-
48
- ## 价值与影响
49
-
50
- 说明对业务的价值和影响。
51
-
52
- ## 风险与注意事项
53
-
54
- 列出已知风险和应对措施。
55
-
56
- ## 常见问题
57
-
58
- **Q: 问题一?**
59
-
60
- A: 回答。
61
-
62
- **Q: 问题二?**
63
-
64
- A: 回答。
65
-
66
- ## 术语表
67
-
68
- | 术语 | 定义 |
69
- |------|------|
70
- | 术语 A | 简洁的业务定义 |
71
- | 术语 B | 简洁的业务定义 |
72
-
73
- ## 相关资源
74
-
75
- - [相关文档](相对路径)
76
- - [外部链接](URL)
77
- ```
78
-
79
- ## Business Markdown 章节内容指南
80
-
81
- | 章节 | 内容来源 | 改写方向 |
82
- |------|------------------------|----------|
83
- | 背景与目标 | Summary 文本 | 从"为什么分析"转为"项目/系统的目标和定位" |
84
- | 核心能力 | Summary 文本 | 从"发现"转为"能力描述",面向非技术读者 |
85
- | 业务流程 | Read 文件原文(该章节 cgraphx 不提取) | 从"操作步骤"转为"业务流程说明",去除技术细节 |
86
- | 关键决策 | Read 文件原文(该章节 cgraphx 不提取) | 从"决策记录"转为"决策解释",说明决策的业务原因 |
87
- | 价值与影响 | Read 文件原文(该章节 cgraphx 不提取) | 从"对未来变更的影响"转为"对业务的价值和影响" |
88
- | 现状与展望 | Read 文件原文(该章节 cgraphx 不提取) | 从"发现和后续"转为"当前状态和未来规划" |
89
- | 风险与注意事项 | Read 文件原文(该章节 cgraphx 不提取) | 从"故障排除"转为"风险提示和应对措施" |
90
- | 常见问题 | Read 文件原文(该章节 cgraphx 不提取) | 从"分析记录"转为"Q&A 格式" |
91
- | 术语表 | 各文本字段中的术语 | 提取关键术语,给出简洁的业务定义 |
92
- | 相关资源 | — | 列出相关的代码文件(相对路径)或外部文档 |
93
-
94
- ## 格式规则
95
-
96
- - 不使用 YAML frontmatter
97
- - 文档标题使用单个 `#`
98
- - 章节使用 `##`
99
- - 子章节使用 `###`
100
- - 列表使用 `-` 或数字编号
101
- - 代码块使用三个反引号,标注语言
102
- - 表格使用标准 Markdown 表格
103
- - 强调使用 `**加粗**`
104
- - 技术术语用反引号包裹
105
- - 段落之间空一行
106
- - 每个章节以 `##` 标题开始,标题后空一行再写内容
107
- - 目录使用锚点链接,链接文本与章节标题一致