dotmd-parser 0.1.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.
- dotmd_parser-0.1.0/LICENSE +21 -0
- dotmd_parser-0.1.0/PKG-INFO +121 -0
- dotmd_parser-0.1.0/README.md +94 -0
- dotmd_parser-0.1.0/pyproject.toml +54 -0
- dotmd_parser-0.1.0/setup.cfg +4 -0
- dotmd_parser-0.1.0/src/dotmd_parser/__init__.py +33 -0
- dotmd_parser-0.1.0/src/dotmd_parser/parser.py +576 -0
- dotmd_parser-0.1.0/src/dotmd_parser.egg-info/PKG-INFO +121 -0
- dotmd_parser-0.1.0/src/dotmd_parser.egg-info/SOURCES.txt +11 -0
- dotmd_parser-0.1.0/src/dotmd_parser.egg-info/dependency_links.txt +1 -0
- dotmd_parser-0.1.0/src/dotmd_parser.egg-info/entry_points.txt +2 -0
- dotmd_parser-0.1.0/src/dotmd_parser.egg-info/top_level.txt +1 -0
- dotmd_parser-0.1.0/tests/test_parser.py +630 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 dotmd-projects
|
|
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.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dotmd-parser
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Dependency graph parser for .md skill files — parse @include/@delegate directives, build graphs, and resolve templates for AI agent prompt engineering
|
|
5
|
+
Author: dotmd-projects
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/dotmd-projects/dotmd-parser
|
|
8
|
+
Project-URL: Repository, https://github.com/dotmd-projects/dotmd-parser
|
|
9
|
+
Project-URL: Issues, https://github.com/dotmd-projects/dotmd-parser/issues
|
|
10
|
+
Keywords: claude-code,ai-agent,skill-management,prompt-engineering,dependency-graph,SKILL.md,markdown,parser,dotmd,llm
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
21
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# dotmd-parser
|
|
29
|
+
|
|
30
|
+
Dependency graph parser for `.md` skill files. Parses `@include` / `@delegate` directives and `Read` references, then builds a file dependency graph.
|
|
31
|
+
|
|
32
|
+
Designed for AI agent prompt engineering workflows — manage modular prompt skills with dependency tracking, template resolution, and impact analysis.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install dotmd-parser
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For development:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/dotmd-projects/dotmd-parser.git
|
|
44
|
+
cd dotmd-parser
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Quick Start
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from dotmd_parser import build_graph, resolve, dependents_of, summary
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### build_graph — Build a dependency graph
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
graph = build_graph("./my-skill/")
|
|
58
|
+
# or
|
|
59
|
+
graph = build_graph("./my-skill/SKILL.md")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"nodes": [{"id": "...", "type": "skill", "missing": false, "placeholders": []}],
|
|
66
|
+
"edges": [{"from": "...", "to": "...", "type": "include", "parallel": false}],
|
|
67
|
+
"warnings": []
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### resolve — Expand @include directives
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
result = resolve("./prompts/main.md", variables={"name": "Alice"})
|
|
75
|
+
print(result["content"]) # Fully expanded text
|
|
76
|
+
print(result["placeholders"]) # Unresolved {{variable}} list
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### dependents_of — Reverse dependency query
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
# Find all files affected by changes to shared/role.md
|
|
83
|
+
affected = dependents_of(graph, "/abs/path/to/shared/role.md")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### summary — Print graph overview
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
print(summary(graph))
|
|
90
|
+
# Nodes: 5 (agent:1, shared:2, skill:1, reference:1)
|
|
91
|
+
# Edges: 4 (include:3, read-ref:1)
|
|
92
|
+
# Warnings: 0
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Directives
|
|
96
|
+
|
|
97
|
+
| Directive | Description |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `@include path/to/file.md` | Inline expansion of the referenced file |
|
|
100
|
+
| `@delegate path/to/agent.md` | Delegate to an agent (no expansion) |
|
|
101
|
+
| `@delegate path/to/agent.md --parallel` | Delegate with parallel execution flag |
|
|
102
|
+
| `Read \`path/to/file.md\`` | Runtime reference (no expansion, recorded in graph) |
|
|
103
|
+
|
|
104
|
+
## CLI
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
dotmd-parser ./my-skill/
|
|
108
|
+
# or
|
|
109
|
+
python -m dotmd_parser.parser ./my-skill/
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Testing
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
pip install pytest
|
|
116
|
+
pytest tests/ -v
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# dotmd-parser
|
|
2
|
+
|
|
3
|
+
Dependency graph parser for `.md` skill files. Parses `@include` / `@delegate` directives and `Read` references, then builds a file dependency graph.
|
|
4
|
+
|
|
5
|
+
Designed for AI agent prompt engineering workflows — manage modular prompt skills with dependency tracking, template resolution, and impact analysis.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install dotmd-parser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For development:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/dotmd-projects/dotmd-parser.git
|
|
17
|
+
cd dotmd-parser
|
|
18
|
+
pip install -e .
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from dotmd_parser import build_graph, resolve, dependents_of, summary
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### build_graph — Build a dependency graph
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
graph = build_graph("./my-skill/")
|
|
31
|
+
# or
|
|
32
|
+
graph = build_graph("./my-skill/SKILL.md")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"nodes": [{"id": "...", "type": "skill", "missing": false, "placeholders": []}],
|
|
39
|
+
"edges": [{"from": "...", "to": "...", "type": "include", "parallel": false}],
|
|
40
|
+
"warnings": []
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### resolve — Expand @include directives
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
result = resolve("./prompts/main.md", variables={"name": "Alice"})
|
|
48
|
+
print(result["content"]) # Fully expanded text
|
|
49
|
+
print(result["placeholders"]) # Unresolved {{variable}} list
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### dependents_of — Reverse dependency query
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
# Find all files affected by changes to shared/role.md
|
|
56
|
+
affected = dependents_of(graph, "/abs/path/to/shared/role.md")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### summary — Print graph overview
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
print(summary(graph))
|
|
63
|
+
# Nodes: 5 (agent:1, shared:2, skill:1, reference:1)
|
|
64
|
+
# Edges: 4 (include:3, read-ref:1)
|
|
65
|
+
# Warnings: 0
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Directives
|
|
69
|
+
|
|
70
|
+
| Directive | Description |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `@include path/to/file.md` | Inline expansion of the referenced file |
|
|
73
|
+
| `@delegate path/to/agent.md` | Delegate to an agent (no expansion) |
|
|
74
|
+
| `@delegate path/to/agent.md --parallel` | Delegate with parallel execution flag |
|
|
75
|
+
| `Read \`path/to/file.md\`` | Runtime reference (no expansion, recorded in graph) |
|
|
76
|
+
|
|
77
|
+
## CLI
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
dotmd-parser ./my-skill/
|
|
81
|
+
# or
|
|
82
|
+
python -m dotmd_parser.parser ./my-skill/
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Testing
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install pytest
|
|
89
|
+
pytest tests/ -v
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "dotmd-parser"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Dependency graph parser for .md skill files — parse @include/@delegate directives, build graphs, and resolve templates for AI agent prompt engineering"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "dotmd-projects" },
|
|
10
|
+
]
|
|
11
|
+
keywords = [
|
|
12
|
+
"claude-code",
|
|
13
|
+
"ai-agent",
|
|
14
|
+
"skill-management",
|
|
15
|
+
"prompt-engineering",
|
|
16
|
+
"dependency-graph",
|
|
17
|
+
"SKILL.md",
|
|
18
|
+
"markdown",
|
|
19
|
+
"parser",
|
|
20
|
+
"dotmd",
|
|
21
|
+
"llm",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 3 - Alpha",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
32
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
33
|
+
"Topic :: Software Development :: Code Generators",
|
|
34
|
+
"Topic :: Text Processing :: Markup :: Markdown",
|
|
35
|
+
"Typing :: Typed",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/dotmd-projects/dotmd-parser"
|
|
40
|
+
Repository = "https://github.com/dotmd-projects/dotmd-parser"
|
|
41
|
+
Issues = "https://github.com/dotmd-projects/dotmd-parser/issues"
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
dotmd-parser = "dotmd_parser.parser:main"
|
|
45
|
+
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["setuptools>=68.0"]
|
|
48
|
+
build-backend = "setuptools.build_meta"
|
|
49
|
+
|
|
50
|
+
[tool.setuptools.packages.find]
|
|
51
|
+
where = ["src"]
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
dotmd-parser — Dependency graph parser for .md skill files.
|
|
3
|
+
|
|
4
|
+
Parse @include/@delegate directives, build dependency graphs,
|
|
5
|
+
and resolve templates for AI agent prompt engineering.
|
|
6
|
+
|
|
7
|
+
API:
|
|
8
|
+
from dotmd_parser import build_graph, resolve, dependents_of, summary
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|
|
12
|
+
|
|
13
|
+
from dotmd_parser.parser import (
|
|
14
|
+
build_graph,
|
|
15
|
+
resolve,
|
|
16
|
+
dependents_of,
|
|
17
|
+
parse_directives,
|
|
18
|
+
parse_read_refs,
|
|
19
|
+
parse_placeholders,
|
|
20
|
+
parse_deps_yml,
|
|
21
|
+
summary,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"build_graph",
|
|
26
|
+
"resolve",
|
|
27
|
+
"dependents_of",
|
|
28
|
+
"parse_directives",
|
|
29
|
+
"parse_read_refs",
|
|
30
|
+
"parse_placeholders",
|
|
31
|
+
"parse_deps_yml",
|
|
32
|
+
"summary",
|
|
33
|
+
]
|