diary-docs 0.1.0__py3-none-any.whl
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.
- diary/__init__.py +1 -0
- diary/__main__.py +3 -0
- diary/aimb/__init__.py +48 -0
- diary/aimb/hasher.py +157 -0
- diary/aimb/merge.py +252 -0
- diary/aimb/parser.py +202 -0
- diary/cli.py +999 -0
- diary/git_utils.py +202 -0
- diary/indexer/__init__.py +44 -0
- diary/indexer/database.py +340 -0
- diary/indexer/extractors.py +468 -0
- diary/indexer/gitignore.py +62 -0
- diary/indexer/indexer.py +511 -0
- diary/indexer/reporter.py +137 -0
- diary/indexer/scanner.py +65 -0
- diary/sync/__init__.py +33 -0
- diary/sync/detector.py +405 -0
- diary/sync/engine.py +404 -0
- diary/sync/protocol.py +176 -0
- diary/templates.py +102 -0
- diary_docs-0.1.0.dist-info/METADATA +228 -0
- diary_docs-0.1.0.dist-info/RECORD +26 -0
- diary_docs-0.1.0.dist-info/WHEEL +5 -0
- diary_docs-0.1.0.dist-info/entry_points.txt +2 -0
- diary_docs-0.1.0.dist-info/licenses/LICENSE +21 -0
- diary_docs-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: diary-docs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Scaffold DIARY documentation structure with MkDocs and Backstage support
|
|
5
|
+
Author-email: bakhija senakmoiky <senakmoiky@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/bakhija/diary-docs
|
|
8
|
+
Project-URL: Repository, https://github.com/bakhija/diary-docs
|
|
9
|
+
Keywords: documentation,mkdocs,backstage,techdocs,scaffolder
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Documentation
|
|
22
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: rich>=13.0
|
|
27
|
+
Requires-Dist: inquirerpy>=0.3.4
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# diary-docs — DIARY Documentation Scaffolder
|
|
31
|
+
|
|
32
|
+
A CLI tool that scaffolds a DIARY documentation structure with MkDocs and Backstage support, indexes your codebase for knowledge retrieval, and keeps docs in sync with code changes.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install diary-docs
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For development:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install -e .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
### `diary-docs init`
|
|
49
|
+
|
|
50
|
+
Initialize a new DIARY documentation project in the current directory.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
diary-docs init
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The tool prompts for a project name, then creates:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
docs/
|
|
60
|
+
├── index.md
|
|
61
|
+
├── objectives.md
|
|
62
|
+
├── structure/
|
|
63
|
+
│ └── index.md
|
|
64
|
+
├── techdocs/
|
|
65
|
+
│ ├── index.md
|
|
66
|
+
│ ├── architecture.md
|
|
67
|
+
│ ├── api-contracts.md
|
|
68
|
+
│ ├── deployment.md
|
|
69
|
+
│ ├── adr.md
|
|
70
|
+
│ └── development-guide.md
|
|
71
|
+
├── product/
|
|
72
|
+
│ ├── index.md
|
|
73
|
+
│ ├── user-guide.md
|
|
74
|
+
│ └── modules.md
|
|
75
|
+
├── ops-governance/
|
|
76
|
+
│ ├── index.md
|
|
77
|
+
│ ├── runbooks.md
|
|
78
|
+
│ └── security.md
|
|
79
|
+
└── knowledge-base/
|
|
80
|
+
├── index.md
|
|
81
|
+
├── faq.md
|
|
82
|
+
└── troubleshooting.md
|
|
83
|
+
mkdocs.yml
|
|
84
|
+
catalog-info.yaml
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
It also generates an AI agent skill file for content generation.
|
|
88
|
+
|
|
89
|
+
**Options:**
|
|
90
|
+
|
|
91
|
+
| Flag | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `-f`, `--force` | Overwrite existing files |
|
|
94
|
+
| `--help` | Show help for this command |
|
|
95
|
+
|
|
96
|
+
If files already exist, they are skipped (unless `--force` is used).
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### `diary-docs index`
|
|
101
|
+
|
|
102
|
+
Index the workspace codebase for knowledge retrieval. Extracts symbols, files, and relationships into a SQLite database.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
diary-docs index
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Options:**
|
|
109
|
+
|
|
110
|
+
| Flag | Description |
|
|
111
|
+
|------|-------------|
|
|
112
|
+
| `-r`, `--report` | Generate a documentation coverage report after indexing |
|
|
113
|
+
| `--db-path PATH` | Custom database path (default: `docs/.index/knowledge.db`) |
|
|
114
|
+
| `--help` | Show help for this command |
|
|
115
|
+
|
|
116
|
+
The index powers the `diary-docs generate-content` skill, allowing AI agents to query the codebase structure without manually scanning files.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### `diary-docs sync`
|
|
121
|
+
|
|
122
|
+
Synchronize documentation with detected code changes. Compares the current workspace against git history to find outdated AIMB (AI-Managed) blocks in markdown files.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Preview changes without applying
|
|
126
|
+
diary-docs sync --dry-run
|
|
127
|
+
|
|
128
|
+
# Apply all detected changes
|
|
129
|
+
diary-docs sync --force
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Options:**
|
|
133
|
+
|
|
134
|
+
| Flag | Description |
|
|
135
|
+
|------|-------------|
|
|
136
|
+
| `-n`, `--dry-run` | Preview changes as JSON without applying |
|
|
137
|
+
| `-b`, `--branch NAME` | Override branch detection |
|
|
138
|
+
| `-f`, `--force` | Skip conflict warnings |
|
|
139
|
+
| `-o`, `--output FILE` | Write JSON report to file |
|
|
140
|
+
| `--help` | Show help for this command |
|
|
141
|
+
|
|
142
|
+
**Dry-run output** is a JSON SyncReport showing code changes, affected docs, confidence scores, and any conflicts.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### Global Options
|
|
147
|
+
|
|
148
|
+
| Flag | Description |
|
|
149
|
+
|------|-------------|
|
|
150
|
+
| `--version` | Show version |
|
|
151
|
+
| `--help` | Show top-level help |
|
|
152
|
+
|
|
153
|
+
## AI Agent Skills
|
|
154
|
+
|
|
155
|
+
`diary-docs init` generates two slash commands for AI coding agents (Claude Code, OpenCode). The skill files are placed in `.claude/commands/` or `.opencode/commands/` (you choose during init).
|
|
156
|
+
|
|
157
|
+
### `/diary-generate-content`
|
|
158
|
+
|
|
159
|
+
Analyzes the workspace codebase via the pre-built index and generates enterprise-grade documentation content for every DIARY file.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# In Claude Code or OpenCode:
|
|
163
|
+
/diary-generate-content
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The skill follows a multi-step workflow:
|
|
167
|
+
1. Reads existing docs structure
|
|
168
|
+
2. Queries the knowledge index (`docs/.index/knowledge.db`)
|
|
169
|
+
3. Asks clarifying questions for missing context
|
|
170
|
+
4. Generates content with Mermaid diagrams, tables, and use cases
|
|
171
|
+
5. Writes all `docs/` files with AIMB (AI-Managed Block) wrappers
|
|
172
|
+
|
|
173
|
+
Output covers: architecture overview, API contracts, deployment flow, ADR log, user guide, runbooks, security compliance, FAQ, and troubleshooting.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### `/diary-sync`
|
|
178
|
+
|
|
179
|
+
Synchronizes documentation with detected code changes. Compares the current git state against history to find outdated AIMB blocks.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# In Claude Code or OpenCode:
|
|
183
|
+
/diary-sync
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The skill follows a structured workflow:
|
|
187
|
+
1. Verifies git state and runs `diary-docs sync --dry-run`
|
|
188
|
+
2. Parses the SyncReport JSON for changes and conflicts
|
|
189
|
+
3. Processes each high-confidence change by updating relevant AIMB blocks
|
|
190
|
+
4. Flags conflicts for manual review (never auto-resolves)
|
|
191
|
+
5. Finalizes with `diary-docs sync --force`
|
|
192
|
+
6. Prints a summary of all processed files
|
|
193
|
+
|
|
194
|
+
**Prerequisites:** All code changes must be committed to git before running `/diary-sync`.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## What It Generates
|
|
199
|
+
|
|
200
|
+
| File/Folder | Description |
|
|
201
|
+
|-------------|-------------|
|
|
202
|
+
| `docs/` | Main documentation folder |
|
|
203
|
+
| `docs/index.md` | Root documentation index |
|
|
204
|
+
| `docs/objectives.md` | Project objectives and goals |
|
|
205
|
+
| `docs/structure/index.md` | Writing guidelines and conventions |
|
|
206
|
+
| `docs/techdocs/` | Technical documentation section |
|
|
207
|
+
| `docs/techdocs/architecture.md` | System architecture overview |
|
|
208
|
+
| `docs/techdocs/api-contracts.md` | API endpoint specifications |
|
|
209
|
+
| `docs/techdocs/deployment.md` | Deployment flow and environments |
|
|
210
|
+
| `docs/techdocs/adr.md` | Architecture Decision Records |
|
|
211
|
+
| `docs/techdocs/development-guide.md` | Local development setup guide |
|
|
212
|
+
| `docs/product/` | Product documentation section |
|
|
213
|
+
| `docs/product/user-guide.md` | End-user guide with use cases |
|
|
214
|
+
| `docs/product/modules.md` | Module/component reference |
|
|
215
|
+
| `docs/ops-governance/` | Operations & governance section |
|
|
216
|
+
| `docs/ops-governance/runbooks.md` | Operational runbooks |
|
|
217
|
+
| `docs/ops-governance/security.md` | Security compliance docs |
|
|
218
|
+
| `docs/knowledge-base/` | Knowledge base section |
|
|
219
|
+
| `docs/knowledge-base/faq.md` | Frequently asked questions |
|
|
220
|
+
| `docs/knowledge-base/troubleshooting.md` | Troubleshooting guide |
|
|
221
|
+
| `mkdocs.yml` | MkDocs configuration with TechDocs Core plugin |
|
|
222
|
+
| `catalog-info.yaml` | Backstage component registration file |
|
|
223
|
+
|
|
224
|
+
## Development
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
pytest tests/ -v
|
|
228
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
diary/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
2
|
+
diary/__main__.py,sha256=8CI7J7aAE0ayPQcX_31ew1YkhO30DvT4MAOGjTMa9_k,35
|
|
3
|
+
diary/cli.py,sha256=78fROQJG6Tuo9ZY26uto3O_nvEBsYXEs4utK31km-WI,34649
|
|
4
|
+
diary/git_utils.py,sha256=a3MkTPbwOT-VaC6JXmojX8wOCSJTrLnXOXIbZ0aOp7U,5429
|
|
5
|
+
diary/templates.py,sha256=twsyGJpZeP91lZQAxDrrULyE4CulkMIR85z-N7VRkJI,2875
|
|
6
|
+
diary/aimb/__init__.py,sha256=D9Mt7LfmBHEKPX675qP5eOPyKHUz4e6Tyaw4xJMkH6Y,997
|
|
7
|
+
diary/aimb/hasher.py,sha256=ZwSpbdmPXEr0BzCWLitz5PgWNrN8a9L0wqZ9tiapUNs,4615
|
|
8
|
+
diary/aimb/merge.py,sha256=SEDppV5XYOkFEo4XuTmFN2ywXZhqXnvRQ3OVFHFI-1k,8140
|
|
9
|
+
diary/aimb/parser.py,sha256=jLvQ6fe1keACq40lL4juefbiZ_e516HiWnJcwNC7BFw,6094
|
|
10
|
+
diary/indexer/__init__.py,sha256=Km4TXEU9LAMFXRhUegkfrZv6dGgQWDNgJRgXHIvVAuM,1407
|
|
11
|
+
diary/indexer/database.py,sha256=9uEVGlSbVPFqPkZBMqQ7kPMiPURH_he04L7XsAQT85w,11114
|
|
12
|
+
diary/indexer/extractors.py,sha256=j2YjX2P6k81ye2_tj1PN7tCPYeZltJ18mEqRlGQwjPw,16429
|
|
13
|
+
diary/indexer/gitignore.py,sha256=vaX3zmv4ml2hijVWfllcQ2ydSty43Q6BfkSeibv-MUs,1798
|
|
14
|
+
diary/indexer/indexer.py,sha256=4OK4H2ixWb6qYyhFQsG8P-2HbzBgVoiPtz-MBadgzIg,16349
|
|
15
|
+
diary/indexer/reporter.py,sha256=RqbzuPZwBzTSnjbVuXSdQeKZELRCAeqr74Flg7mF3DI,4367
|
|
16
|
+
diary/indexer/scanner.py,sha256=y6eXf5zv7GnmpIq7G9koA0O61oa1EGfNWPRck8jkF_s,1761
|
|
17
|
+
diary/sync/__init__.py,sha256=Lo8JT7apEp5EkgnzfCXpvGfqU-0R0sjzRQu-XtoJ8EY,682
|
|
18
|
+
diary/sync/detector.py,sha256=AoySXB0tEXCwKrPPbjiCLK2XVO-adg0I14b66xwSf1U,12816
|
|
19
|
+
diary/sync/engine.py,sha256=mQfbu8G69_-sGWkH40hzI4PrhYDep0E7shiB0gB_YGs,13823
|
|
20
|
+
diary/sync/protocol.py,sha256=jyooIttJNt2uDTzco0hNxem_itUy80kL27SmaCtCxS4,6162
|
|
21
|
+
diary_docs-0.1.0.dist-info/licenses/LICENSE,sha256=VfIh7tKcjMr5NC5zjA2A-xRq7K8nfibQJ5Y8oub5jUk,1075
|
|
22
|
+
diary_docs-0.1.0.dist-info/METADATA,sha256=YQGn_hrtLXAKTXPoDpDW5073F9_su3udx0YxDGPOJ2k,7355
|
|
23
|
+
diary_docs-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
24
|
+
diary_docs-0.1.0.dist-info/entry_points.txt,sha256=LC96dsvVc1sig1sEJxTAaDSVROyApP6GMTkFAQjDlrQ,46
|
|
25
|
+
diary_docs-0.1.0.dist-info/top_level.txt,sha256=0Di9045_-hpmWycLwR0KQDSbRP8Q1jYg2dcqsZ6Y7RY,6
|
|
26
|
+
diary_docs-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bakhija senakmoiky
|
|
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 @@
|
|
|
1
|
+
diary
|