tskel 0.90__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 (160) hide show
  1. tskel-0.90/LICENSE +21 -0
  2. tskel-0.90/MANIFEST.in +9 -0
  3. tskel-0.90/PKG-INFO +349 -0
  4. tskel-0.90/README.md +305 -0
  5. tskel-0.90/TESTING.md +244 -0
  6. tskel-0.90/docs/README.md +55 -0
  7. tskel-0.90/docs/assets/tskel_logo.png +0 -0
  8. tskel-0.90/docs/configuration/cli.md +49 -0
  9. tskel-0.90/docs/configuration/configuration.md +270 -0
  10. tskel-0.90/docs/configuration/workflows.md +54 -0
  11. tskel-0.90/docs/getting_started.md +178 -0
  12. tskel-0.90/docs/language_examples.md +149 -0
  13. tskel-0.90/docs/python/customization_overview.md +150 -0
  14. tskel-0.90/docs/python/customize_extensions.md +319 -0
  15. tskel-0.90/docs/python/customize_python.md +283 -0
  16. tskel-0.90/docs/reports/README.md +11 -0
  17. tskel-0.90/docs/reports/html_reports.md +93 -0
  18. tskel-0.90/docs/reports/json_format.md +170 -0
  19. tskel-0.90/docs/reports/output_formats.md +370 -0
  20. tskel-0.90/docs/skills.md +20 -0
  21. tskel-0.90/docs/source_inspection/find_rules.md +251 -0
  22. tskel-0.90/docs/source_inspection/source_inspection.md +146 -0
  23. tskel-0.90/examples/basic/.gitignore +2 -0
  24. tskel-0.90/examples/basic/README.md +37 -0
  25. tskel-0.90/examples/basic/sample.java +19 -0
  26. tskel-0.90/examples/basic/sample.js +48 -0
  27. tskel-0.90/examples/basic/sample.php +47 -0
  28. tskel-0.90/examples/basic/sample.py +87 -0
  29. tskel-0.90/examples/basic/sample.ts +17 -0
  30. tskel-0.90/examples/basic/sample_context.md +45 -0
  31. tskel-0.90/examples/basic/tskel.yaml +28 -0
  32. tskel-0.90/examples/basic/tskel_rules.yaml +26 -0
  33. tskel-0.90/examples/extends/README.md +19 -0
  34. tskel-0.90/examples/extends/analysis/README.md +19 -0
  35. tskel-0.90/examples/extends/analysis/extract_structure.py +22 -0
  36. tskel-0.90/examples/extends/analysis/reuse_parsed_tree.py +36 -0
  37. tskel-0.90/examples/extends/extensions/README.md +134 -0
  38. tskel-0.90/examples/extends/extensions/collect_classes.py +51 -0
  39. tskel-0.90/examples/extends/extensions/collect_functions.py +47 -0
  40. tskel-0.90/examples/extends/extensions/custom_extraction.py +39 -0
  41. tskel-0.90/examples/extends/extensions/custom_output.py +27 -0
  42. tskel-0.90/examples/extends/extensions/forward_cli_options.py +17 -0
  43. tskel-0.90/examples/extends/extensions/generate_in_process.py +32 -0
  44. tskel-0.90/examples/extends/extensions/print_ast.py +31 -0
  45. tskel-0.90/examples/extends/output/README.md +26 -0
  46. tskel-0.90/examples/extends/output/custom_report.py +33 -0
  47. tskel-0.90/examples/extends/output/generate_from_yaml.py +25 -0
  48. tskel-0.90/examples/extends/output/generate_text.py +20 -0
  49. tskel-0.90/examples/extends/output/generate_with_config.py +24 -0
  50. tskel-0.90/examples/extends/output/read_json.py +27 -0
  51. tskel-0.90/examples/extends/output/save_partitions.py +32 -0
  52. tskel-0.90/examples/extends/parsing/README.md +18 -0
  53. tskel-0.90/examples/extends/parsing/inspect_function.py +26 -0
  54. tskel-0.90/examples/extends/parsing/inspect_syntax_errors.py +24 -0
  55. tskel-0.90/examples/extends/parsing/inspect_tree.py +32 -0
  56. tskel-0.90/examples/find_rules/README.md +124 -0
  57. tskel-0.90/examples/find_rules/all_disabled.yaml +16 -0
  58. tskel-0.90/examples/find_rules/sample.js +11 -0
  59. tskel-0.90/examples/find_rules/sample.py +11 -0
  60. tskel-0.90/examples/find_rules/settings.yaml +33 -0
  61. tskel-0.90/examples/output_formats/json.yaml +6 -0
  62. tskel-0.90/examples/output_formats/repo.json +115 -0
  63. tskel-0.90/examples/output_formats/settings.json +6 -0
  64. tskel-0.90/examples/relations/README.md +90 -0
  65. tskel-0.90/examples/relations/client.js +22 -0
  66. tskel-0.90/examples/relations/repo.js +3 -0
  67. tskel-0.90/examples/relations/settings.yaml +11 -0
  68. tskel-0.90/examples/relations/typed-client.ts +25 -0
  69. tskel-0.90/examples/styles/README.md +40 -0
  70. tskel-0.90/examples/styles/repo.java +10 -0
  71. tskel-0.90/examples/styles/repo.py +14 -0
  72. tskel-0.90/examples/styles/settings.yaml +6 -0
  73. tskel-0.90/pyproject.toml +78 -0
  74. tskel-0.90/setup.cfg +4 -0
  75. tskel-0.90/skills/tskel/SKILL.md +103 -0
  76. tskel-0.90/skills/tskel/references/configuration.md +122 -0
  77. tskel-0.90/skills/tskel/references/html-reports.md +31 -0
  78. tskel-0.90/skills/tskel/references/source-inspection.md +127 -0
  79. tskel-0.90/skills/tskel-extend/SKILL.md +121 -0
  80. tskel-0.90/skills/tskel-extend/references/extension-contracts.md +165 -0
  81. tskel-0.90/skills/tskel-extend/references/python-integration.md +101 -0
  82. tskel-0.90/src/tskel/__init__.py +143 -0
  83. tskel-0.90/src/tskel/arguments.py +247 -0
  84. tskel-0.90/src/tskel/cli.py +53 -0
  85. tskel-0.90/src/tskel/configuration.py +383 -0
  86. tskel-0.90/src/tskel/constant.py +3 -0
  87. tskel-0.90/src/tskel/context_generator.py +194 -0
  88. tskel-0.90/src/tskel/extraction/__init__.py +1 -0
  89. tskel-0.90/src/tskel/extraction/ast_walker.py +309 -0
  90. tskel-0.90/src/tskel/extraction/comment_extractor.py +102 -0
  91. tskel-0.90/src/tskel/extraction/find_rules.py +147 -0
  92. tskel-0.90/src/tskel/extraction/result.py +25 -0
  93. tskel-0.90/src/tskel/extraction/source_analyzer.py +129 -0
  94. tskel-0.90/src/tskel/extraction/structure_extractor.py +254 -0
  95. tskel-0.90/src/tskel/file_processor.py +304 -0
  96. tskel-0.90/src/tskel/integration/__init__.py +1 -0
  97. tskel-0.90/src/tskel/integration/api.py +137 -0
  98. tskel-0.90/src/tskel/integration/extensions.py +26 -0
  99. tskel-0.90/src/tskel/language_handlers/__init__.py +105 -0
  100. tskel-0.90/src/tskel/language_handlers/c_handler.py +126 -0
  101. tskel-0.90/src/tskel/language_handlers/c_sharp_handler.py +112 -0
  102. tskel-0.90/src/tskel/language_handlers/cpp_handler.py +178 -0
  103. tskel-0.90/src/tskel/language_handlers/css_handler.py +22 -0
  104. tskel-0.90/src/tskel/language_handlers/ecmascript_handler.py +111 -0
  105. tskel-0.90/src/tskel/language_handlers/elixir_handler.py +149 -0
  106. tskel-0.90/src/tskel/language_handlers/go_handler.py +111 -0
  107. tskel-0.90/src/tskel/language_handlers/html_handler.py +27 -0
  108. tskel-0.90/src/tskel/language_handlers/java_handler.py +121 -0
  109. tskel-0.90/src/tskel/language_handlers/javascript_handler.py +93 -0
  110. tskel-0.90/src/tskel/language_handlers/kotlin_handler.py +152 -0
  111. tskel-0.90/src/tskel/language_handlers/language_handler.py +457 -0
  112. tskel-0.90/src/tskel/language_handlers/lua_handler.py +37 -0
  113. tskel-0.90/src/tskel/language_handlers/php_handler.py +111 -0
  114. tskel-0.90/src/tskel/language_handlers/python_handler.py +219 -0
  115. tskel-0.90/src/tskel/language_handlers/ruby_handler.py +116 -0
  116. tskel-0.90/src/tskel/language_handlers/rust_handler.py +129 -0
  117. tskel-0.90/src/tskel/language_handlers/scala_handler.py +122 -0
  118. tskel-0.90/src/tskel/language_handlers/swift_handler.py +181 -0
  119. tskel-0.90/src/tskel/language_handlers/tsx_handler.py +18 -0
  120. tskel-0.90/src/tskel/language_handlers/typescript_handler.py +101 -0
  121. tskel-0.90/src/tskel/language_parser/__init__.py +1 -0
  122. tskel-0.90/src/tskel/language_parser/language_styles.py +104 -0
  123. tskel-0.90/src/tskel/language_parser/language_syntax.py +263 -0
  124. tskel-0.90/src/tskel/language_parser/parsed_source.py +21 -0
  125. tskel-0.90/src/tskel/language_parser/source_nodes.py +146 -0
  126. tskel-0.90/src/tskel/models.py +76 -0
  127. tskel-0.90/src/tskel/output/__init__.py +4 -0
  128. tskel-0.90/src/tskel/output/cli_output.py +78 -0
  129. tskel-0.90/src/tskel/output/diagram_graph.py +81 -0
  130. tskel-0.90/src/tskel/output/diagram_models.py +28 -0
  131. tskel-0.90/src/tskel/output/diagram_notation.py +206 -0
  132. tskel-0.90/src/tskel/output/generation_result.py +21 -0
  133. tskel-0.90/src/tskel/output/outline_formatter.py +55 -0
  134. tskel-0.90/src/tskel/output/relation_formatter.py +163 -0
  135. tskel-0.90/src/tskel/output/report.py +162 -0
  136. tskel-0.90/src/tskel/relation/__init__.py +1 -0
  137. tskel-0.90/src/tskel/relation/relation_extractor.py +246 -0
  138. tskel-0.90/src/tskel/relation/relation_models.py +50 -0
  139. tskel-0.90/src/tskel/relation/relation_resolver.py +269 -0
  140. tskel-0.90/src/tskel/relation/relation_syntax.py +43 -0
  141. tskel-0.90/src/tskel/renderers/__init__.py +1 -0
  142. tskel-0.90/src/tskel/renderers/diagram_output_renderer.py +47 -0
  143. tskel-0.90/src/tskel/renderers/json_output_renderer.py +270 -0
  144. tskel-0.90/src/tskel/renderers/output_renderer.py +60 -0
  145. tskel-0.90/src/tskel/renderers/output_renderer_factory.py +51 -0
  146. tskel-0.90/src/tskel/renderers/text_output_renderer.py +173 -0
  147. tskel-0.90/src/tskel.egg-info/PKG-INFO +349 -0
  148. tskel-0.90/src/tskel.egg-info/SOURCES.txt +158 -0
  149. tskel-0.90/src/tskel.egg-info/dependency_links.txt +1 -0
  150. tskel-0.90/src/tskel.egg-info/entry_points.txt +3 -0
  151. tskel-0.90/src/tskel.egg-info/requires.txt +30 -0
  152. tskel-0.90/src/tskel.egg-info/top_level.txt +2 -0
  153. tskel-0.90/src/tskel_report/__init__.py +1 -0
  154. tskel-0.90/src/tskel_report/__main__.py +4 -0
  155. tskel-0.90/src/tskel_report/cli.py +92 -0
  156. tskel-0.90/src/tskel_report/loader.py +77 -0
  157. tskel-0.90/src/tskel_report/model.py +478 -0
  158. tskel-0.90/src/tskel_report/renderer.py +61 -0
  159. tskel-0.90/src/tskel_report/templates/report.html +542 -0
  160. tskel-0.90/tskel.yaml +42 -0
tskel-0.90/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) tskel contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
tskel-0.90/MANIFEST.in ADDED
@@ -0,0 +1,9 @@
1
+ include TESTING.md tskel.yaml
2
+ recursive-include docs *.md
3
+ include docs/assets/tskel_logo.png
4
+ recursive-include examples *.gitignore *.java *.js *.json *.md *.php *.py *.ts *.yaml
5
+ recursive-include skills *.md
6
+ # The complete suite and development notes live in the checkout.
7
+ prune tests
8
+ global-exclude *.py[cod]
9
+ global-exclude */__pycache__/* */.pytest_cache/* .tskel.json
tskel-0.90/PKG-INFO ADDED
@@ -0,0 +1,349 @@
1
+ Metadata-Version: 2.4
2
+ Name: tskel
3
+ Version: 0.90
4
+ Summary: Generate source outlines and class diagrams with Tree-sitter.
5
+ License-Expression: MIT
6
+ Keywords: tree-sitter,source-code,code-analysis,static-analysis,source-analysis,outline,code-outline,ai-assisted-development,code-review,class-diagram,mermaid,plantuml
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Environment :: Console
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Topic :: Software Development :: Documentation
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: tree-sitter>=0.25.2
16
+ Requires-Dist: tree-sitter-c==0.24.2
17
+ Requires-Dist: tree-sitter-cpp==0.23.4
18
+ Requires-Dist: tree-sitter-c-sharp==0.23.5
19
+ Requires-Dist: tree-sitter-css==0.25.0
20
+ Requires-Dist: tree-sitter-elixir==0.3.5
21
+ Requires-Dist: tree-sitter-go==0.25.0
22
+ Requires-Dist: tree-sitter-html==0.23.2
23
+ Requires-Dist: tree-sitter-java==0.23.5
24
+ Requires-Dist: tree-sitter-javascript==0.25.0
25
+ Requires-Dist: tree-sitter-kotlin==1.1.0
26
+ Requires-Dist: tree-sitter-lua==0.5.0
27
+ Requires-Dist: tree-sitter-php==0.25.1
28
+ Requires-Dist: tree-sitter-python==0.25.0
29
+ Requires-Dist: tree-sitter-ruby==0.23.1
30
+ Requires-Dist: tree-sitter-rust==0.24.2
31
+ Requires-Dist: tree-sitter-scala==0.26.2
32
+ Requires-Dist: tree-sitter-swift==0.7.4
33
+ Requires-Dist: tree-sitter-typescript==0.23.2
34
+ Requires-Dist: pathspec>=0.12
35
+ Requires-Dist: PyYAML>=6.0
36
+ Provides-Extra: test
37
+ Requires-Dist: pytest>=9; extra == "test"
38
+ Requires-Dist: build>=1.2; extra == "test"
39
+ Requires-Dist: setuptools>=77.0.3; extra == "test"
40
+ Provides-Extra: release
41
+ Requires-Dist: build>=1.2; extra == "release"
42
+ Requires-Dist: twine>=6; extra == "release"
43
+ Dynamic: license-file
44
+
45
+ # tskel
46
+
47
+ ![tskel logo](docs/assets/tskel_logo.png)
48
+
49
+ ## Overview
50
+
51
+ tskel generates declaration outlines and class diagrams for code review and LLM context.
52
+
53
+ It parses source files with tree-sitter without executing them. Output formats
54
+ are text, JSON, PlantUML, and Mermaid.
55
+
56
+ > The name `tskel` comes from "Tree-sitter Skeleton" and is pronounced "tee-ess-kel".
57
+
58
+ Supports C, C++, C#, CSS, Elixir, Go, HTML, Java, JavaScript, Kotlin, Lua,
59
+ PHP, Python, Ruby, Rust, Scala, Swift, and TypeScript. Its 19 handlers cover
60
+ 26 source-file suffixes, including a separate TSX handler. See the
61
+ [language and suffix table](docs/configuration/configuration.md#languages).
62
+
63
+ ### What can I do with tskel?
64
+
65
+ Use tskel to review declarations, signatures, and selected source evidence.
66
+
67
+ - **Read a codebase's structure:** Extract classes, constants, functions, and
68
+ method signatures without reading every implementation body.
69
+ - **Prepare code context:** Display a compact outline, save it as text, or use
70
+ JSON output in another program.
71
+ - **Generate class diagrams:** Produce PlantUML or Mermaid source from selected
72
+ declarations and their relationships.
73
+ - **Inspect selected source content:** Include documentation comments, TODO
74
+ tags, and custom regex matches.
75
+ - **Split large results:** Write an index and separate outlines grouped by
76
+ directory with `--file --segment=1`.
77
+
78
+ ## Installation
79
+
80
+ Install from the project directory in a Git checkout or extracted source archive.
81
+ Python **3.10 or later** is required.
82
+
83
+ ```sh
84
+ python -m pip install .
85
+ tskel --help
86
+ ```
87
+
88
+ See [installation options](docs/getting_started.md#installation) for virtual
89
+ environments, editable installs, and release wheels.
90
+
91
+ ### Requirements and dependencies
92
+
93
+ | Requirement | Version |
94
+ | --- | --- |
95
+ | Python | 3.10 or later |
96
+ | Tree-sitter | 0.25.2 or later |
97
+
98
+ pip installs Tree-sitter and the 18 pinned grammar packages with tskel.
99
+
100
+ The `test` and `release` extras provide development tools. See the
101
+ [dependency details](docs/getting_started.md#requirements-and-dependencies)
102
+ and [package configuration](pyproject.toml).
103
+
104
+ ## Getting started
105
+
106
+ ### From source code to an outline
107
+
108
+ From the project directory, generate an outline for the sample class.
109
+
110
+ ```sh
111
+ tskel examples/styles/repo.py
112
+ ```
113
+
114
+ The outline retains declarations, types, and documentation comments.
115
+ See the [output from this command](#display-output-without---file) below.
116
+
117
+ ## Examples
118
+
119
+ Run the commands below from the project directory to see how tskel selects
120
+ files, formats outlines, and reports source evidence.
121
+
122
+ - Compare source and generated outlines by language. [Basic samples](examples/basic/README.md) · [Language examples](docs/language_examples.md)
123
+ - Try parsing, generation, and customization from Python. [Python examples](examples/extends/README.md)
124
+ - Browse sample projects, settings, and output by topic. [All examples](docs/README.md#examples)
125
+
126
+ | Task | Command | Result |
127
+ | --- | --- | --- |
128
+ | Color a terminal outline | `tskel examples/styles/repo.py --color` | Colored source headings and declarations. Files, JSON, and diagrams remain plain. [Terminal colors](docs/reports/output_formats.md#terminal-colors) |
129
+ | Select Python files | `tskel examples/styles --glob='*.py' --comment=0 --quiet` | An outline of `repo.py`, without comments. [Input selection](docs/configuration/configuration.md) |
130
+ | Produce JSON | `tskel examples/styles/repo.py --json --quiet` | A JSON document whose `files` array contains `repo.py` and its `Repo` class. [JSON format](docs/reports/json_format.md) |
131
+ | Produce a diagram | `tskel examples/styles/repo.py --format=mermaid --quiet` | Mermaid source beginning with `classDiagram`, containing `Repo`. Render it with a Mermaid viewer. [Diagram formats](docs/reports/output_formats.md#choose-a-format-and-style) |
132
+ | Search source text | `tskel examples/find_rules/sample.py --config=examples/find_rules/settings.yaml --comment=0 --quiet` | Named sections such as `Audit Markers`, with matching lines and line numbers. [Find rules](docs/source_inspection/find_rules.md) |
133
+ | Inspect relations | `tskel --config=examples/relations/settings.yaml --style=simple --quiet` | Declarations with relation evidence, including `Client` constructing `Cache`. [Relations](docs/source_inspection/source_inspection.md#relations) |
134
+
135
+ ## Configuration
136
+
137
+ Use the [CLI reference](docs/configuration/cli.md) to select source paths, filters, and languages.
138
+
139
+ The checkout's [tskel.yaml](tskel.yaml) records the application defaults and is
140
+ loaded automatically when present in the current directory. CLI options override
141
+ corresponding YAML settings; path patterns are combined. The
142
+ [configuration reference](docs/configuration/configuration.md#settings-reference) documents
143
+ each setting, defaults, precedence, and examples. See [configuration workflows](docs/configuration/workflows.md) for runnable examples.
144
+
145
+ | Option | Purpose and guide |
146
+ | --- | --- |
147
+ | Source paths | Select one or more files or directories. See [input selection and configuration](docs/configuration/configuration.md#select-files-and-settings). |
148
+ | `--lang=LANG` | Select a language by extension, such as `py`. See [languages](docs/configuration/configuration.md#languages). |
149
+ | `--glob=PATTERN` | Select paths with repeatable wildcard patterns before regex filters. See [glob and regex selection](docs/configuration/configuration.md#glob-and-regex-selection). |
150
+ | `--filter=PATTERN`, `--exclude=PATTERN` | Include or exclude paths with regular expressions. See [path filtering](docs/configuration/configuration.md#filter-paths-and-comments). |
151
+ | `--gitignore[=BOOL]` | Enable or disable Gitignore filtering. See [path filtering](docs/configuration/configuration.md#filter-paths-and-comments). |
152
+ | `--config=FILE` | Load a specific YAML or JSON settings file. See [configuration and precedence](docs/configuration/configuration.md#select-files-and-settings). |
153
+
154
+ ### Select a language
155
+
156
+ The [examples/styles](examples/styles/README.md) directory contains both Python
157
+ and Java source. Select only the Python handler with `--lang=py`:
158
+
159
+ ```sh
160
+ tskel examples/styles --lang=py --comment=0 --quiet
161
+ ```
162
+
163
+ This produces the `repo.py` outline shown above without documentation comments;
164
+ `repo.java` is omitted. Use
165
+ extension-style selectors such as `java`, `js`, or `tsx` for other languages.
166
+ Without `--lang`, tskel selects handlers from source-file suffixes. See
167
+ [language selection](docs/configuration/configuration.md#languages) for the full list.
168
+
169
+ ## Output formats
170
+
171
+ Display, save, or split declaration outlines and class diagrams, or export structured JSON.
172
+
173
+ See the [output formats guide](docs/reports/output_formats.md) and the [JSON reference](docs/reports/json_format.md).
174
+
175
+ | Option | Purpose and guide |
176
+ | --- | --- |
177
+ | `--json[=compact\|pretty]` | Select JSON output. Bare `--json` uses compact output; `--json=pretty` uses two-space indentation. |
178
+ | `--json_level=LEVEL` | Choose JSON detail from 1 to 5 (default 5). Also accepts `--json-level`. [JSON detail levels](docs/reports/json_format.md#detail-levels) |
179
+ | `--format=FORMAT` | Choose text, JSON, PlantUML, or Mermaid. See [output examples](docs/reports/output_formats.md#choose-a-format-and-style) and [JSON outlines](docs/reports/json_format.md). |
180
+ | `--file[=FILE]` | Save to the format's default filename or a specified file. See [save output](docs/reports/output_formats.md#save-output). |
181
+ | `--segment[=N]` | Split text or diagram file output by directory depth. See [segmented output and its index](docs/reports/output_formats.md#split-a-large-result). |
182
+ | `--quiet` | Hide normal command messages and write summaries. See [quiet mode](docs/reports/output_formats.md#hide-command-messages). |
183
+ | `--color` | Color text outlines on stdout and dim comments. See the [usage example](#display-a-colored-outline) and [terminal colors](docs/reports/output_formats.md#terminal-colors). |
184
+ | `--style=STYLE` | Choose signature layout, such as `auto`, `simple`, or `python`. See [style examples](docs/reports/output_formats.md#choose-a-format-and-style). |
185
+
186
+ ### Display output without --file
187
+
188
+ `tskel examples/styles/repo.py` displays the outline on stdout.
189
+
190
+ ```text
191
+ ## repo.py
192
+
193
+ # Python style example without executing application code.
194
+ # Store a value.
195
+ class Repo:
196
+ LIMIT: int
197
+
198
+ def __init__(self, value: int):
199
+
200
+ @staticmethod
201
+ def label(value: int) -> str:
202
+ ```
203
+
204
+ The operation summary goes to stderr and no file is created.
205
+
206
+ ```text
207
+ Completed generating the code outline.
208
+
209
+ Format: text
210
+ Style: auto
211
+ Source files: 1 files / 0.26 KB
212
+ Source path: examples/styles/repo.py
213
+ ```
214
+
215
+ See [output streams and exit status](docs/reports/output_formats.md#output-streams-and-exit-status) for redirection and pipelines.
216
+
217
+ ### Display a colored outline
218
+
219
+ Add `--color` to highlight a text outline in the terminal:
220
+
221
+ ```sh
222
+ tskel examples/styles/repo.py --color
223
+ ```
224
+
225
+ Headings, declarations, and comments are highlighted in different styles.
226
+ See [terminal colors](docs/reports/output_formats.md#terminal-colors) for the palette
227
+ and behavior when redirecting output.
228
+
229
+ ### Save output with --file
230
+
231
+ Write the full outline to a file and see where it was saved.
232
+
233
+ ```sh
234
+ tskel examples/styles/repo.py --file=context.txt
235
+ ```
236
+
237
+ `context.txt` contains the same complete outline as display mode. Stdout now
238
+ reports where the file was saved.
239
+
240
+ Use bare `--file` to select the format's default filename. See
241
+ [saving output](docs/reports/output_formats.md#save-output) for filenames,
242
+ destination summaries, and overwrite behavior.
243
+
244
+ ## Segmented output
245
+
246
+ ```sh
247
+ tskel examples --format=text --file --segment=1
248
+ ```
249
+
250
+ The command groups files by the first directory level under `examples/`.
251
+ The output includes these paths.
252
+
253
+ ```text
254
+ .tskel.txt # Index with links and class names
255
+ .tskel/
256
+ basic.txt # Outline for examples/basic/
257
+ styles.txt # Outline for examples/styles/
258
+ ```
259
+
260
+ The index lists `Repo` under the link to `.tskel/styles.txt`. Follow the link
261
+ to read the declarations from that directory.
262
+
263
+ Text, PlantUML, and Mermaid support segmentation.
264
+ See the [segmentation guide](docs/reports/output_formats.md#split-a-large-result) for depth settings and YAML configuration.
265
+
266
+ ## HTML reports
267
+
268
+ `tskel-report` turns JSON into a browsable HTML report for declarations, search results, and relations.
269
+
270
+ Pipe JSON directly into the converter to write `report.html` in the working directory.
271
+
272
+ ```sh
273
+ tskel examples/ --json | tskel-report
274
+ ```
275
+
276
+ Convert a saved JSON document and choose an output filename and report title:
277
+
278
+ ```sh
279
+ tskel-report outline.json --output=source-report.html --title="My project"
280
+ ```
281
+
282
+ See the [HTML report guide](docs/reports/html_reports.md) for input,
283
+ output, and browser requirements.
284
+
285
+ ## Source inspection
286
+
287
+ Include documentation comments, find matching source text, or inspect relations between declarations.
288
+
289
+ | Option | Purpose and guide |
290
+ | --- | --- |
291
+ | `--public-only` | Include public class methods and constructors. See the [public-member example](docs/configuration/configuration.md#settings-reference). |
292
+ | `--comment[=BOOL]`, `--comment_scope=SCOPE` | Control documentation comments. See [comment examples](docs/source_inspection/source_inspection.md#comments-and-tags). |
293
+
294
+ ### Find Rules
295
+
296
+ Use YAML `find_rules` to add named regex searches to an outline.
297
+
298
+ The [Find Rules guide](docs/source_inspection/find_rules.md) includes settings and input/output
299
+ examples; [runnable examples](examples/find_rules/README.md) show individual
300
+ rules and temporary disabling.
301
+
302
+ ### Relations
303
+
304
+ Use the YAML `relation` section to include file and class dependency evidence.
305
+
306
+ Relations appear under their owning declarations. Construction and references
307
+ default to on when relations are enabled. Instance and static calls
308
+ are opt-in.
309
+ See [relation settings](docs/source_inspection/source_inspection.md#relations) and the runnable
310
+ [example and pattern guide](examples/relations/README.md).
311
+
312
+ ## Python integration and customization
313
+
314
+ Use tskel from Python to inspect syntax trees, generate outlines, or customize extraction and output.
315
+
316
+ - [Program Customization Overview](docs/python/customization_overview.md): features and execution boundaries.
317
+ - [Python Integration](docs/python/customize_python.md): native ASTs, analysis, generation, and examples.
318
+ - [Extension Customization](docs/python/customize_extensions.md): extension points and runnable programs.
319
+
320
+ ## Guides
321
+
322
+ Browse the complete set of topic guides and examples in the [documentation index](docs/README.md).
323
+
324
+ ## Scope and limitations
325
+
326
+ - Extraction is syntax-based, not a compiler or full semantic analysis.
327
+ Language-specific declaration coverage differs.
328
+ - Syntax errors can produce partial outlines. For strict input validation,
329
+ check `parsed.tree.root_node.has_error` through the Python API.
330
+ - Relations describe selected source evidence, not a complete runtime call graph.
331
+ - JSON schema version 2 contains declarations, comments, search matches, and resolved relations. JSON source inputs and
332
+ segmented JSON writes are not supported.
333
+ - Diagrams are source documents, not rendered images. Mermaid labelled namespaces
334
+ require a renderer supporting Mermaid 11.15.0 or later.
335
+ - Outlines can include source comments, strings, and search results. Review
336
+ generated output before sharing it with an external service.
337
+ - Version 0.90 is pre-1.0; do not assume future releases will keep every API or
338
+ output detail unchanged.
339
+
340
+ ## Skills
341
+
342
+ The bundled skills give coding assistants task-specific instructions for using tskel.
343
+ `tskel` covers CLI options, configuration, source searches, and reports.
344
+ `tskel-extend` covers Python integration, native syntax trees, and extension hooks.
345
+ See the [skills guide](docs/skills.md) to choose and use a skill.
346
+
347
+ ## License
348
+
349
+ Licensed under the [MIT License](LICENSE).
tskel-0.90/README.md ADDED
@@ -0,0 +1,305 @@
1
+ # tskel
2
+
3
+ ![tskel logo](docs/assets/tskel_logo.png)
4
+
5
+ ## Overview
6
+
7
+ tskel generates declaration outlines and class diagrams for code review and LLM context.
8
+
9
+ It parses source files with tree-sitter without executing them. Output formats
10
+ are text, JSON, PlantUML, and Mermaid.
11
+
12
+ > The name `tskel` comes from "Tree-sitter Skeleton" and is pronounced "tee-ess-kel".
13
+
14
+ Supports C, C++, C#, CSS, Elixir, Go, HTML, Java, JavaScript, Kotlin, Lua,
15
+ PHP, Python, Ruby, Rust, Scala, Swift, and TypeScript. Its 19 handlers cover
16
+ 26 source-file suffixes, including a separate TSX handler. See the
17
+ [language and suffix table](docs/configuration/configuration.md#languages).
18
+
19
+ ### What can I do with tskel?
20
+
21
+ Use tskel to review declarations, signatures, and selected source evidence.
22
+
23
+ - **Read a codebase's structure:** Extract classes, constants, functions, and
24
+ method signatures without reading every implementation body.
25
+ - **Prepare code context:** Display a compact outline, save it as text, or use
26
+ JSON output in another program.
27
+ - **Generate class diagrams:** Produce PlantUML or Mermaid source from selected
28
+ declarations and their relationships.
29
+ - **Inspect selected source content:** Include documentation comments, TODO
30
+ tags, and custom regex matches.
31
+ - **Split large results:** Write an index and separate outlines grouped by
32
+ directory with `--file --segment=1`.
33
+
34
+ ## Installation
35
+
36
+ Install from the project directory in a Git checkout or extracted source archive.
37
+ Python **3.10 or later** is required.
38
+
39
+ ```sh
40
+ python -m pip install .
41
+ tskel --help
42
+ ```
43
+
44
+ See [installation options](docs/getting_started.md#installation) for virtual
45
+ environments, editable installs, and release wheels.
46
+
47
+ ### Requirements and dependencies
48
+
49
+ | Requirement | Version |
50
+ | --- | --- |
51
+ | Python | 3.10 or later |
52
+ | Tree-sitter | 0.25.2 or later |
53
+
54
+ pip installs Tree-sitter and the 18 pinned grammar packages with tskel.
55
+
56
+ The `test` and `release` extras provide development tools. See the
57
+ [dependency details](docs/getting_started.md#requirements-and-dependencies)
58
+ and [package configuration](pyproject.toml).
59
+
60
+ ## Getting started
61
+
62
+ ### From source code to an outline
63
+
64
+ From the project directory, generate an outline for the sample class.
65
+
66
+ ```sh
67
+ tskel examples/styles/repo.py
68
+ ```
69
+
70
+ The outline retains declarations, types, and documentation comments.
71
+ See the [output from this command](#display-output-without---file) below.
72
+
73
+ ## Examples
74
+
75
+ Run the commands below from the project directory to see how tskel selects
76
+ files, formats outlines, and reports source evidence.
77
+
78
+ - Compare source and generated outlines by language. [Basic samples](examples/basic/README.md) · [Language examples](docs/language_examples.md)
79
+ - Try parsing, generation, and customization from Python. [Python examples](examples/extends/README.md)
80
+ - Browse sample projects, settings, and output by topic. [All examples](docs/README.md#examples)
81
+
82
+ | Task | Command | Result |
83
+ | --- | --- | --- |
84
+ | Color a terminal outline | `tskel examples/styles/repo.py --color` | Colored source headings and declarations. Files, JSON, and diagrams remain plain. [Terminal colors](docs/reports/output_formats.md#terminal-colors) |
85
+ | Select Python files | `tskel examples/styles --glob='*.py' --comment=0 --quiet` | An outline of `repo.py`, without comments. [Input selection](docs/configuration/configuration.md) |
86
+ | Produce JSON | `tskel examples/styles/repo.py --json --quiet` | A JSON document whose `files` array contains `repo.py` and its `Repo` class. [JSON format](docs/reports/json_format.md) |
87
+ | Produce a diagram | `tskel examples/styles/repo.py --format=mermaid --quiet` | Mermaid source beginning with `classDiagram`, containing `Repo`. Render it with a Mermaid viewer. [Diagram formats](docs/reports/output_formats.md#choose-a-format-and-style) |
88
+ | Search source text | `tskel examples/find_rules/sample.py --config=examples/find_rules/settings.yaml --comment=0 --quiet` | Named sections such as `Audit Markers`, with matching lines and line numbers. [Find rules](docs/source_inspection/find_rules.md) |
89
+ | Inspect relations | `tskel --config=examples/relations/settings.yaml --style=simple --quiet` | Declarations with relation evidence, including `Client` constructing `Cache`. [Relations](docs/source_inspection/source_inspection.md#relations) |
90
+
91
+ ## Configuration
92
+
93
+ Use the [CLI reference](docs/configuration/cli.md) to select source paths, filters, and languages.
94
+
95
+ The checkout's [tskel.yaml](tskel.yaml) records the application defaults and is
96
+ loaded automatically when present in the current directory. CLI options override
97
+ corresponding YAML settings; path patterns are combined. The
98
+ [configuration reference](docs/configuration/configuration.md#settings-reference) documents
99
+ each setting, defaults, precedence, and examples. See [configuration workflows](docs/configuration/workflows.md) for runnable examples.
100
+
101
+ | Option | Purpose and guide |
102
+ | --- | --- |
103
+ | Source paths | Select one or more files or directories. See [input selection and configuration](docs/configuration/configuration.md#select-files-and-settings). |
104
+ | `--lang=LANG` | Select a language by extension, such as `py`. See [languages](docs/configuration/configuration.md#languages). |
105
+ | `--glob=PATTERN` | Select paths with repeatable wildcard patterns before regex filters. See [glob and regex selection](docs/configuration/configuration.md#glob-and-regex-selection). |
106
+ | `--filter=PATTERN`, `--exclude=PATTERN` | Include or exclude paths with regular expressions. See [path filtering](docs/configuration/configuration.md#filter-paths-and-comments). |
107
+ | `--gitignore[=BOOL]` | Enable or disable Gitignore filtering. See [path filtering](docs/configuration/configuration.md#filter-paths-and-comments). |
108
+ | `--config=FILE` | Load a specific YAML or JSON settings file. See [configuration and precedence](docs/configuration/configuration.md#select-files-and-settings). |
109
+
110
+ ### Select a language
111
+
112
+ The [examples/styles](examples/styles/README.md) directory contains both Python
113
+ and Java source. Select only the Python handler with `--lang=py`:
114
+
115
+ ```sh
116
+ tskel examples/styles --lang=py --comment=0 --quiet
117
+ ```
118
+
119
+ This produces the `repo.py` outline shown above without documentation comments;
120
+ `repo.java` is omitted. Use
121
+ extension-style selectors such as `java`, `js`, or `tsx` for other languages.
122
+ Without `--lang`, tskel selects handlers from source-file suffixes. See
123
+ [language selection](docs/configuration/configuration.md#languages) for the full list.
124
+
125
+ ## Output formats
126
+
127
+ Display, save, or split declaration outlines and class diagrams, or export structured JSON.
128
+
129
+ See the [output formats guide](docs/reports/output_formats.md) and the [JSON reference](docs/reports/json_format.md).
130
+
131
+ | Option | Purpose and guide |
132
+ | --- | --- |
133
+ | `--json[=compact\|pretty]` | Select JSON output. Bare `--json` uses compact output; `--json=pretty` uses two-space indentation. |
134
+ | `--json_level=LEVEL` | Choose JSON detail from 1 to 5 (default 5). Also accepts `--json-level`. [JSON detail levels](docs/reports/json_format.md#detail-levels) |
135
+ | `--format=FORMAT` | Choose text, JSON, PlantUML, or Mermaid. See [output examples](docs/reports/output_formats.md#choose-a-format-and-style) and [JSON outlines](docs/reports/json_format.md). |
136
+ | `--file[=FILE]` | Save to the format's default filename or a specified file. See [save output](docs/reports/output_formats.md#save-output). |
137
+ | `--segment[=N]` | Split text or diagram file output by directory depth. See [segmented output and its index](docs/reports/output_formats.md#split-a-large-result). |
138
+ | `--quiet` | Hide normal command messages and write summaries. See [quiet mode](docs/reports/output_formats.md#hide-command-messages). |
139
+ | `--color` | Color text outlines on stdout and dim comments. See the [usage example](#display-a-colored-outline) and [terminal colors](docs/reports/output_formats.md#terminal-colors). |
140
+ | `--style=STYLE` | Choose signature layout, such as `auto`, `simple`, or `python`. See [style examples](docs/reports/output_formats.md#choose-a-format-and-style). |
141
+
142
+ ### Display output without --file
143
+
144
+ `tskel examples/styles/repo.py` displays the outline on stdout.
145
+
146
+ ```text
147
+ ## repo.py
148
+
149
+ # Python style example without executing application code.
150
+ # Store a value.
151
+ class Repo:
152
+ LIMIT: int
153
+
154
+ def __init__(self, value: int):
155
+
156
+ @staticmethod
157
+ def label(value: int) -> str:
158
+ ```
159
+
160
+ The operation summary goes to stderr and no file is created.
161
+
162
+ ```text
163
+ Completed generating the code outline.
164
+
165
+ Format: text
166
+ Style: auto
167
+ Source files: 1 files / 0.26 KB
168
+ Source path: examples/styles/repo.py
169
+ ```
170
+
171
+ See [output streams and exit status](docs/reports/output_formats.md#output-streams-and-exit-status) for redirection and pipelines.
172
+
173
+ ### Display a colored outline
174
+
175
+ Add `--color` to highlight a text outline in the terminal:
176
+
177
+ ```sh
178
+ tskel examples/styles/repo.py --color
179
+ ```
180
+
181
+ Headings, declarations, and comments are highlighted in different styles.
182
+ See [terminal colors](docs/reports/output_formats.md#terminal-colors) for the palette
183
+ and behavior when redirecting output.
184
+
185
+ ### Save output with --file
186
+
187
+ Write the full outline to a file and see where it was saved.
188
+
189
+ ```sh
190
+ tskel examples/styles/repo.py --file=context.txt
191
+ ```
192
+
193
+ `context.txt` contains the same complete outline as display mode. Stdout now
194
+ reports where the file was saved.
195
+
196
+ Use bare `--file` to select the format's default filename. See
197
+ [saving output](docs/reports/output_formats.md#save-output) for filenames,
198
+ destination summaries, and overwrite behavior.
199
+
200
+ ## Segmented output
201
+
202
+ ```sh
203
+ tskel examples --format=text --file --segment=1
204
+ ```
205
+
206
+ The command groups files by the first directory level under `examples/`.
207
+ The output includes these paths.
208
+
209
+ ```text
210
+ .tskel.txt # Index with links and class names
211
+ .tskel/
212
+ basic.txt # Outline for examples/basic/
213
+ styles.txt # Outline for examples/styles/
214
+ ```
215
+
216
+ The index lists `Repo` under the link to `.tskel/styles.txt`. Follow the link
217
+ to read the declarations from that directory.
218
+
219
+ Text, PlantUML, and Mermaid support segmentation.
220
+ See the [segmentation guide](docs/reports/output_formats.md#split-a-large-result) for depth settings and YAML configuration.
221
+
222
+ ## HTML reports
223
+
224
+ `tskel-report` turns JSON into a browsable HTML report for declarations, search results, and relations.
225
+
226
+ Pipe JSON directly into the converter to write `report.html` in the working directory.
227
+
228
+ ```sh
229
+ tskel examples/ --json | tskel-report
230
+ ```
231
+
232
+ Convert a saved JSON document and choose an output filename and report title:
233
+
234
+ ```sh
235
+ tskel-report outline.json --output=source-report.html --title="My project"
236
+ ```
237
+
238
+ See the [HTML report guide](docs/reports/html_reports.md) for input,
239
+ output, and browser requirements.
240
+
241
+ ## Source inspection
242
+
243
+ Include documentation comments, find matching source text, or inspect relations between declarations.
244
+
245
+ | Option | Purpose and guide |
246
+ | --- | --- |
247
+ | `--public-only` | Include public class methods and constructors. See the [public-member example](docs/configuration/configuration.md#settings-reference). |
248
+ | `--comment[=BOOL]`, `--comment_scope=SCOPE` | Control documentation comments. See [comment examples](docs/source_inspection/source_inspection.md#comments-and-tags). |
249
+
250
+ ### Find Rules
251
+
252
+ Use YAML `find_rules` to add named regex searches to an outline.
253
+
254
+ The [Find Rules guide](docs/source_inspection/find_rules.md) includes settings and input/output
255
+ examples; [runnable examples](examples/find_rules/README.md) show individual
256
+ rules and temporary disabling.
257
+
258
+ ### Relations
259
+
260
+ Use the YAML `relation` section to include file and class dependency evidence.
261
+
262
+ Relations appear under their owning declarations. Construction and references
263
+ default to on when relations are enabled. Instance and static calls
264
+ are opt-in.
265
+ See [relation settings](docs/source_inspection/source_inspection.md#relations) and the runnable
266
+ [example and pattern guide](examples/relations/README.md).
267
+
268
+ ## Python integration and customization
269
+
270
+ Use tskel from Python to inspect syntax trees, generate outlines, or customize extraction and output.
271
+
272
+ - [Program Customization Overview](docs/python/customization_overview.md): features and execution boundaries.
273
+ - [Python Integration](docs/python/customize_python.md): native ASTs, analysis, generation, and examples.
274
+ - [Extension Customization](docs/python/customize_extensions.md): extension points and runnable programs.
275
+
276
+ ## Guides
277
+
278
+ Browse the complete set of topic guides and examples in the [documentation index](docs/README.md).
279
+
280
+ ## Scope and limitations
281
+
282
+ - Extraction is syntax-based, not a compiler or full semantic analysis.
283
+ Language-specific declaration coverage differs.
284
+ - Syntax errors can produce partial outlines. For strict input validation,
285
+ check `parsed.tree.root_node.has_error` through the Python API.
286
+ - Relations describe selected source evidence, not a complete runtime call graph.
287
+ - JSON schema version 2 contains declarations, comments, search matches, and resolved relations. JSON source inputs and
288
+ segmented JSON writes are not supported.
289
+ - Diagrams are source documents, not rendered images. Mermaid labelled namespaces
290
+ require a renderer supporting Mermaid 11.15.0 or later.
291
+ - Outlines can include source comments, strings, and search results. Review
292
+ generated output before sharing it with an external service.
293
+ - Version 0.90 is pre-1.0; do not assume future releases will keep every API or
294
+ output detail unchanged.
295
+
296
+ ## Skills
297
+
298
+ The bundled skills give coding assistants task-specific instructions for using tskel.
299
+ `tskel` covers CLI options, configuration, source searches, and reports.
300
+ `tskel-extend` covers Python integration, native syntax trees, and extension hooks.
301
+ See the [skills guide](docs/skills.md) to choose and use a skill.
302
+
303
+ ## License
304
+
305
+ Licensed under the [MIT License](LICENSE).