@voodocs/cli 0.3.0 → 0.3.2
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.
- package/CHANGELOG.md +24 -0
- package/cli.py +1 -1
- package/lib/darkarts/context/ai_integrations.py +22 -1
- package/lib/darkarts/context/checker.py +24 -1
- package/lib/darkarts/context/commands.py +38 -5
- package/lib/darkarts/context/diagram.py +22 -1
- package/lib/darkarts/context/yaml_utils.py +32 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## [0.3.2] - 2025-12-20
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
- Fixed architecture decisions and modules parsing in yaml_utils.py
|
|
5
|
+
- Now properly converts dict objects to ArchitectureDecision and Module objects
|
|
6
|
+
- Fixes "'dict' object has no attribute 'decision'" error in context view
|
|
7
|
+
- Discovered during dogfooding (setting up VooDocs in vooodooo-magic repo)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Comprehensive @voodocs annotations to 4 core modules (commands, ai_integrations, checker, diagram)
|
|
11
|
+
- Self-documentation: VooDocs now documents itself using its own annotation system
|
|
12
|
+
- 93 lines of detailed annotations with dependencies, assumptions, invariants, security and performance models
|
|
13
|
+
|
|
14
|
+
## [0.3.1] - 2025-12-20
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Improved AI selection prompt handling in `voodocs context init`
|
|
18
|
+
- Changed prompt text from '[6 for all]' to '[default: 6]' for clarity
|
|
19
|
+
- Added EOFError and KeyboardInterrupt handling for graceful abort
|
|
20
|
+
- Added sys.stdout.flush() to ensure prompt displays immediately
|
|
21
|
+
- Better error messages for invalid input
|
|
22
|
+
|
|
23
|
+
This patch fixes the hanging issue some users experienced at the AI selection prompt.
|
|
24
|
+
|
|
1
25
|
## [0.3.0] - 2025-12-20
|
|
2
26
|
|
|
3
27
|
### Added
|
package/cli.py
CHANGED
|
@@ -137,7 +137,7 @@ Documentation: https://github.com/3vilEnterprises/vooodooo-magic/tree/main/packa
|
|
|
137
137
|
parser.add_argument(
|
|
138
138
|
"--version",
|
|
139
139
|
action="version",
|
|
140
|
-
version="VooDocs 0.3.
|
|
140
|
+
version="VooDocs 0.3.2"
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""@voodocs
|
|
2
|
+
module_purpose: "Native AI assistant integrations (Claude, Cursor, Copilot, Windsurf, Cline)"
|
|
3
|
+
dependencies: [
|
|
4
|
+
"pathlib: File path handling",
|
|
5
|
+
"typing: Type hints"
|
|
6
|
+
]
|
|
7
|
+
assumptions: [
|
|
8
|
+
"AI config directories follow standard conventions (.claude/skills/, .cursor/rules/, etc.)",
|
|
9
|
+
"Project root is current working directory",
|
|
10
|
+
"File system allows directory creation",
|
|
11
|
+
"UTF-8 encoding is supported"
|
|
12
|
+
]
|
|
13
|
+
invariants: [
|
|
14
|
+
"All generated configs must be valid for their respective AIs",
|
|
15
|
+
"Detection must not modify any files",
|
|
16
|
+
"Generated content must be UTF-8 encoded",
|
|
17
|
+
"File paths must use forward slashes for cross-platform compatibility",
|
|
18
|
+
"Each AI integration must return Dict[str, str] mapping paths to content"
|
|
19
|
+
]
|
|
20
|
+
security_model: "Read-only detection, write only when explicitly called by user commands"
|
|
21
|
+
performance_model: "O(1) for detection, O(k) for generation where k=number of AI assistants"
|
|
22
|
+
|
|
2
23
|
AI-specific integration templates for VooDocs Context System.
|
|
3
24
|
|
|
4
25
|
This module provides native integration with different AI assistants:
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""@voodocs
|
|
2
|
+
module_purpose: "Invariant checking system - validates code against documented invariants"
|
|
3
|
+
dependencies: [
|
|
4
|
+
"re: Pattern matching for code analysis",
|
|
5
|
+
"ast: Python AST parsing",
|
|
6
|
+
"pathlib: File traversal",
|
|
7
|
+
"dataclasses: Data structures for violations"
|
|
8
|
+
]
|
|
9
|
+
assumptions: [
|
|
10
|
+
"Source files are text-based and UTF-8 encoded",
|
|
11
|
+
"Invariants are written in natural language",
|
|
12
|
+
"File system is readable",
|
|
13
|
+
"Code is syntactically valid (for AST parsing)"
|
|
14
|
+
]
|
|
15
|
+
invariants: [
|
|
16
|
+
"Checker must never modify source files",
|
|
17
|
+
"All file reads must handle encoding errors gracefully",
|
|
18
|
+
"Pattern matching must be case-insensitive for security checks",
|
|
19
|
+
"Each invariant check must return a list of violations",
|
|
20
|
+
"Violation severity must be one of: error, warning, info"
|
|
21
|
+
]
|
|
22
|
+
security_model: "Read-only access to source files, no execution of code"
|
|
23
|
+
performance_model: "O(n*m*l) where n=files, m=invariants, l=average lines per file"
|
|
24
|
+
|
|
2
25
|
Invariant Checker
|
|
3
26
|
|
|
4
27
|
Validates that code respects documented invariants.
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""@voodocs
|
|
2
|
+
module_purpose: "Core context system commands (init, generate, check, diagram, validate, etc.)"
|
|
3
|
+
dependencies: [
|
|
4
|
+
"yaml_utils: YAML parsing and serialization",
|
|
5
|
+
"models: Data structures for context",
|
|
6
|
+
"ai_integrations: AI assistant integration",
|
|
7
|
+
"checker: Invariant checking system",
|
|
8
|
+
"diagram: Architecture diagram generation"
|
|
9
|
+
]
|
|
10
|
+
assumptions: [
|
|
11
|
+
"Context file (.voodocs.context) is in project root",
|
|
12
|
+
"Git is available for commit/author detection",
|
|
13
|
+
"Python 3.11+ is installed",
|
|
14
|
+
"Project root is current working directory"
|
|
15
|
+
]
|
|
16
|
+
invariants: [
|
|
17
|
+
"Context file must be valid YAML",
|
|
18
|
+
"Version numbers must follow semver (major.minor)",
|
|
19
|
+
"All commands must return 0 (success) or 1 (error) exit code",
|
|
20
|
+
"Context updates must increment version number",
|
|
21
|
+
"Generated files must be UTF-8 encoded"
|
|
22
|
+
]
|
|
23
|
+
security_model: "Read context from disk, write only with user confirmation for init"
|
|
24
|
+
performance_model: "O(1) for most commands, O(n) for generate where n=number of source files"
|
|
25
|
+
|
|
2
26
|
Context System Commands
|
|
3
27
|
|
|
4
28
|
Implements the command-line interface for the context system.
|
|
@@ -285,14 +309,15 @@ def cmd_context_init(force: bool = False) -> int:
|
|
|
285
309
|
print(f" [{marker}] {i}. {desc}")
|
|
286
310
|
|
|
287
311
|
print()
|
|
312
|
+
sys.stdout.flush() # Ensure prompt is displayed
|
|
288
313
|
|
|
289
314
|
# Get user choice
|
|
290
315
|
while True:
|
|
291
|
-
choice_input = input("Enter number (1-7) [6 for all]: ").strip()
|
|
292
|
-
if not choice_input:
|
|
293
|
-
choice_input = "6" # Default to "all"
|
|
294
|
-
|
|
295
316
|
try:
|
|
317
|
+
choice_input = input("Enter number (1-7) [default: 6]: ").strip()
|
|
318
|
+
if not choice_input:
|
|
319
|
+
choice_input = "6" # Default to "all"
|
|
320
|
+
|
|
296
321
|
choice_num = int(choice_input)
|
|
297
322
|
if 1 <= choice_num <= len(choices):
|
|
298
323
|
ai_type = choices[choice_num - 1][0]
|
|
@@ -301,6 +326,14 @@ def cmd_context_init(force: bool = False) -> int:
|
|
|
301
326
|
print(f"Please enter a number between 1 and {len(choices)}")
|
|
302
327
|
except ValueError:
|
|
303
328
|
print("Please enter a valid number")
|
|
329
|
+
except EOFError:
|
|
330
|
+
# Handle Ctrl+D or EOF
|
|
331
|
+
print("\nAborted.")
|
|
332
|
+
return 1
|
|
333
|
+
except KeyboardInterrupt:
|
|
334
|
+
# Handle Ctrl+C
|
|
335
|
+
print("\nAborted.")
|
|
336
|
+
return 1
|
|
304
337
|
|
|
305
338
|
if ai_type != "none":
|
|
306
339
|
try:
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""@voodocs
|
|
2
|
+
module_purpose: "Architecture diagram generation from context (Mermaid and D2 formats)"
|
|
3
|
+
dependencies: [
|
|
4
|
+
"subprocess: External diagram rendering (manus-render-diagram)",
|
|
5
|
+
"pathlib: File path handling",
|
|
6
|
+
"typing: Type hints"
|
|
7
|
+
]
|
|
8
|
+
assumptions: [
|
|
9
|
+
"Context file contains architecture.modules section",
|
|
10
|
+
"manus-render-diagram utility is available for PNG rendering",
|
|
11
|
+
"Output directory is writable",
|
|
12
|
+
"Mermaid/D2 syntax is valid"
|
|
13
|
+
]
|
|
14
|
+
invariants: [
|
|
15
|
+
"Generated diagrams must be valid Mermaid or D2 syntax",
|
|
16
|
+
"Module names must be sanitized for diagram syntax",
|
|
17
|
+
"Diagram generation must not modify context file",
|
|
18
|
+
"PNG rendering is optional and fails gracefully if utility unavailable"
|
|
19
|
+
]
|
|
20
|
+
security_model: "Read context file, write diagram files to user-specified paths"
|
|
21
|
+
performance_model: "O(n) where n=number of modules, O(n^2) for dependency graphs"
|
|
22
|
+
|
|
2
23
|
Architecture Diagram Generator
|
|
3
24
|
|
|
4
25
|
Generates visual diagrams from context files.
|
|
@@ -121,9 +121,39 @@ def parse_context_file(data: Dict[str, Any]) -> ContextFile:
|
|
|
121
121
|
|
|
122
122
|
# Parse architecture
|
|
123
123
|
arch_data = data.get('architecture', {})
|
|
124
|
+
|
|
125
|
+
# Parse decisions
|
|
126
|
+
decisions_data = arch_data.get('decisions', [])
|
|
127
|
+
decisions = []
|
|
128
|
+
for dec in decisions_data:
|
|
129
|
+
if isinstance(dec, dict):
|
|
130
|
+
from .models import ArchitectureDecision
|
|
131
|
+
decisions.append(ArchitectureDecision(
|
|
132
|
+
decision=dec.get('decision', ''),
|
|
133
|
+
rationale=dec.get('rationale', ''),
|
|
134
|
+
alternatives_considered=dec.get('alternatives_considered', []),
|
|
135
|
+
tradeoffs=dec.get('tradeoffs'),
|
|
136
|
+
date=dec.get('date'),
|
|
137
|
+
author=dec.get('author')
|
|
138
|
+
))
|
|
139
|
+
|
|
140
|
+
# Parse modules
|
|
141
|
+
modules_data = arch_data.get('modules', {})
|
|
142
|
+
modules = {}
|
|
143
|
+
for name, mod in modules_data.items():
|
|
144
|
+
if isinstance(mod, dict):
|
|
145
|
+
from .models import Module
|
|
146
|
+
modules[name] = Module(
|
|
147
|
+
description=mod.get('description', mod.get('purpose', '')),
|
|
148
|
+
path=mod.get('path'),
|
|
149
|
+
language=mod.get('language'),
|
|
150
|
+
dependencies=mod.get('dependencies', []),
|
|
151
|
+
public_api=mod.get('public_api', [])
|
|
152
|
+
)
|
|
153
|
+
|
|
124
154
|
architecture = Architecture(
|
|
125
|
-
decisions=
|
|
126
|
-
modules=
|
|
155
|
+
decisions=decisions,
|
|
156
|
+
modules=modules,
|
|
127
157
|
tech_stack=arch_data.get('tech_stack', {})
|
|
128
158
|
)
|
|
129
159
|
|
package/package.json
CHANGED