@voodocs/cli 1.0.4 → 1.0.6
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 +77 -0
- package/lib/cli/__init__.py +1 -1
- package/lib/cli/instruct.py +81 -60
- package/lib/darkarts/instructions/claude.md +139 -0
- package/lib/darkarts/instructions/cursor.md +139 -0
- package/lib/darkarts/instructions/default.md +139 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
## v1.0.6 (2024-12-21)
|
|
2
|
+
|
|
3
|
+
### 🐛 Bug Fix: Missing Instructions Directory in npm Package
|
|
4
|
+
|
|
5
|
+
**Problem:** The `voodocs instruct` command failed with "Error: Instructions directory not found" because the `lib/darkarts/instructions/` directory was not included in the npm package.
|
|
6
|
+
|
|
7
|
+
**Root Cause:** The `instructions/` directory was not listed in the `files` array in `package.json`.
|
|
8
|
+
|
|
9
|
+
**Fix:** Added `lib/darkarts/instructions/` to the `files` array in `package.json`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Changes
|
|
14
|
+
|
|
15
|
+
- Added `lib/darkarts/instructions/` to package.json `files` array
|
|
16
|
+
- Verified that all instruction templates are now included in the package:
|
|
17
|
+
- `claude.md`
|
|
18
|
+
- `cursor.md`
|
|
19
|
+
- `default.md`
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### Testing
|
|
24
|
+
|
|
25
|
+
| Test Case | Status |
|
|
26
|
+
|-----------|--------|
|
|
27
|
+
| Instructions directory included in package | ✅ Pass |
|
|
28
|
+
| `voodocs instruct --list-templates` | ✅ Pass |
|
|
29
|
+
| `voodocs instruct --ai cursor` | ✅ Pass |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Upgrade
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g @voodocs/cli@1.0.6
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## v1.0.5 (2024-12-21)
|
|
40
|
+
|
|
41
|
+
### 🐛 Bug Fix: Instruct Command Import Error
|
|
42
|
+
|
|
43
|
+
**Problem:** The `voodocs instruct` command failed with `ModuleNotFoundError: No module named 'darkarts.instruction_generator'` when trying to generate AI instructions.
|
|
44
|
+
|
|
45
|
+
**Root Cause:** The instruct command was trying to import complex modules (`InstructionGenerator`, `AIEnvironment`) that had dependencies issues in the npm package.
|
|
46
|
+
|
|
47
|
+
**Fix:** Simplified the instruct command to directly read template files without complex module dependencies.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### Changes
|
|
52
|
+
|
|
53
|
+
- Rewrote `lib/cli/instruct.py` to be self-contained
|
|
54
|
+
- Removed dependency on `darkarts.instruction_generator` and `darkarts.ai_detector`
|
|
55
|
+
- Simplified AI environment detection
|
|
56
|
+
- All functionality preserved
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### Testing
|
|
61
|
+
|
|
62
|
+
| Test Case | Status |
|
|
63
|
+
|-----------|--------|
|
|
64
|
+
| `voodocs instruct --list-templates` | ✅ Pass |
|
|
65
|
+
| `voodocs instruct --ai cursor` | ✅ Pass |
|
|
66
|
+
| `voodocs instruct --ai claude` | ✅ Pass |
|
|
67
|
+
| `voodocs instruct --output .cursorrules` | ✅ Pass |
|
|
68
|
+
| AI auto-detection | ✅ Pass |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Upgrade
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install -g @voodocs/cli@1.0.5
|
|
76
|
+
```
|
|
77
|
+
|
|
1
78
|
## v1.0.4 (2024-12-21)
|
|
2
79
|
|
|
3
80
|
### 🐛 Critical Bug Fixes: Documentation Generation
|
package/lib/cli/__init__.py
CHANGED
package/lib/cli/instruct.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""@darkarts
|
|
2
2
|
⊢{cli:instruct}
|
|
3
|
-
∂{click,pathlib,
|
|
3
|
+
∂{click,pathlib,os}
|
|
4
4
|
⚠{write-access:cwd}
|
|
5
5
|
⊨{idempotent:instruction-generation}
|
|
6
6
|
🔒{read-write:filesystem}
|
|
@@ -15,94 +15,115 @@ Generate AI-specific instructions for writing @darkarts annotations.
|
|
|
15
15
|
|
|
16
16
|
import click
|
|
17
17
|
from pathlib import Path
|
|
18
|
-
import
|
|
19
|
-
from pathlib import Path
|
|
20
|
-
|
|
21
|
-
# Add parent directory to path for imports
|
|
22
|
-
parent_dir = Path(__file__).parent.parent
|
|
23
|
-
sys.path.insert(0, str(parent_dir))
|
|
24
|
-
|
|
25
|
-
from darkarts.instruction_generator import InstructionGenerator
|
|
26
|
-
from darkarts.ai_detector import AIEnvironment, detect_ai_environment
|
|
18
|
+
import os
|
|
27
19
|
|
|
28
20
|
|
|
29
21
|
@click.command()
|
|
30
22
|
@click.option(
|
|
31
23
|
'--ai',
|
|
32
|
-
type=click.Choice([
|
|
33
|
-
|
|
34
|
-
help='Specify the AI environment (e.g., cursor, claude, gemini). Auto-detects if not provided.'
|
|
24
|
+
type=click.Choice(['cursor', 'claude', 'default'], case_sensitive=False),
|
|
25
|
+
help='Target AI assistant (auto-detects if not specified)'
|
|
35
26
|
)
|
|
36
27
|
@click.option(
|
|
37
28
|
'--output',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
help='Output file path
|
|
29
|
+
'-o',
|
|
30
|
+
type=click.Path(),
|
|
31
|
+
help='Output file path (prints to console if not specified)'
|
|
41
32
|
)
|
|
42
33
|
@click.option(
|
|
43
34
|
'--list-templates',
|
|
44
35
|
is_flag=True,
|
|
45
|
-
help='List
|
|
36
|
+
help='List available instruction templates'
|
|
46
37
|
)
|
|
47
38
|
def instruct(ai, output, list_templates):
|
|
48
39
|
"""
|
|
49
|
-
Generate AI instructions for writing
|
|
40
|
+
Generate AI-specific instructions for writing @darkarts annotations.
|
|
50
41
|
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
This command generates tailored instructions for AI assistants to help them
|
|
43
|
+
write correct symbolic DarkArts annotations in your codebase.
|
|
53
44
|
|
|
54
45
|
Examples:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
voodocs instruct
|
|
58
|
-
|
|
46
|
+
|
|
47
|
+
# Auto-detect AI and print instructions
|
|
48
|
+
voodocs instruct
|
|
49
|
+
|
|
50
|
+
# Generate for Cursor and save to .cursorrules
|
|
51
|
+
voodocs instruct --ai cursor --output .cursorrules
|
|
52
|
+
|
|
53
|
+
# Generate for Claude
|
|
54
|
+
voodocs instruct --ai claude
|
|
55
|
+
|
|
56
|
+
# List available templates
|
|
57
|
+
voodocs instruct --list-templates
|
|
59
58
|
"""
|
|
60
|
-
generator = InstructionGenerator()
|
|
61
59
|
|
|
60
|
+
# Get the instructions directory
|
|
61
|
+
cli_dir = Path(__file__).parent
|
|
62
|
+
instructions_dir = cli_dir.parent / 'darkarts' / 'instructions'
|
|
63
|
+
|
|
64
|
+
if not instructions_dir.exists():
|
|
65
|
+
click.secho("Error: Instructions directory not found", fg='red')
|
|
66
|
+
click.echo(f"Expected at: {instructions_dir}")
|
|
67
|
+
return
|
|
68
|
+
|
|
69
|
+
# List templates if requested
|
|
62
70
|
if list_templates:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
click.echo(click.style('Available AI instruction templates:', fg='green', bold=True))
|
|
71
|
+
click.echo("Available instruction templates:")
|
|
72
|
+
click.echo()
|
|
73
|
+
templates = list(instructions_dir.glob('*.md'))
|
|
69
74
|
for template in templates:
|
|
70
|
-
click.echo(f
|
|
75
|
+
click.echo(f" • {template.stem}")
|
|
76
|
+
click.echo()
|
|
77
|
+
click.echo(f"Total: {len(templates)} templates")
|
|
71
78
|
return
|
|
72
79
|
|
|
73
|
-
#
|
|
74
|
-
if ai:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
# Auto-detect AI if not specified
|
|
81
|
+
if not ai:
|
|
82
|
+
ai = _detect_ai_environment()
|
|
83
|
+
if ai:
|
|
84
|
+
click.echo(f"Detected AI environment: {ai}")
|
|
85
|
+
else:
|
|
86
|
+
ai = 'default'
|
|
87
|
+
click.echo("Using default instructions (AI environment not detected)")
|
|
88
|
+
click.echo()
|
|
89
|
+
|
|
90
|
+
# Load the appropriate template
|
|
91
|
+
template_file = instructions_dir / f"{ai}.md"
|
|
92
|
+
|
|
93
|
+
if not template_file.exists():
|
|
94
|
+
click.secho(f"Warning: Template '{ai}.md' not found, using default", fg='yellow')
|
|
95
|
+
template_file = instructions_dir / "default.md"
|
|
96
|
+
|
|
97
|
+
if not template_file.exists():
|
|
98
|
+
click.secho("Error: No instruction templates found", fg='red')
|
|
99
|
+
return
|
|
84
100
|
|
|
85
|
-
#
|
|
86
|
-
|
|
87
|
-
instructions = generator.generate(environment)
|
|
88
|
-
except FileNotFoundError:
|
|
89
|
-
click.echo(click.style(f'Error: No instruction template found for {environment.value}', fg='red'))
|
|
90
|
-
click.echo(f'Defaulting to generic instructions...')
|
|
91
|
-
environment = AIEnvironment.DEFAULT
|
|
92
|
-
instructions = generator.generate(environment)
|
|
101
|
+
# Read the template
|
|
102
|
+
instructions = template_file.read_text(encoding='utf-8')
|
|
93
103
|
|
|
94
|
-
# Output instructions
|
|
104
|
+
# Output the instructions
|
|
95
105
|
if output:
|
|
96
106
|
output_path = Path(output)
|
|
97
|
-
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
98
107
|
output_path.write_text(instructions, encoding='utf-8')
|
|
99
|
-
click.
|
|
108
|
+
click.secho(f"✅ Instructions written to: {output_path}", fg='green')
|
|
109
|
+
click.echo()
|
|
110
|
+
click.echo("Your AI assistant will now write symbolic DarkArts annotations!")
|
|
100
111
|
else:
|
|
101
|
-
click.echo('\n' + '-'*20 + ' AI Instructions ' + '-'*20 + '\n')
|
|
102
112
|
click.echo(instructions)
|
|
103
|
-
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def _detect_ai_environment():
|
|
116
|
+
"""Detect which AI environment is being used."""
|
|
117
|
+
# Check for Cursor
|
|
118
|
+
if os.environ.get('CURSOR_USER') or os.path.exists('.cursorrules'):
|
|
119
|
+
return 'cursor'
|
|
120
|
+
|
|
121
|
+
# Check for Claude
|
|
122
|
+
if os.environ.get('CLAUDE_API_KEY') or os.path.exists('.claude'):
|
|
123
|
+
return 'claude'
|
|
124
|
+
|
|
125
|
+
# Check for other AI indicators
|
|
126
|
+
if os.environ.get('OPENAI_API_KEY'):
|
|
127
|
+
return 'default'
|
|
104
128
|
|
|
105
|
-
|
|
106
|
-
click.echo(click.style('Tip: Save these instructions to a .cursorrules file in your project root.', fg='yellow'))
|
|
107
|
-
elif environment == AIEnvironment.CLAUDE and not output:
|
|
108
|
-
click.echo(click.style('Tip: Add these instructions to your Claude project settings.', fg='yellow'))
|
|
129
|
+
return None
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Claude AI Instructions for Symbolic DarkArts Annotations
|
|
2
|
+
|
|
3
|
+
**Version:** 2.0
|
|
4
|
+
**Date:** December 21, 2024
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Primary Goal
|
|
9
|
+
|
|
10
|
+
Your primary goal is to **write and maintain symbolic DarkArts annotations** for all new and existing code. This ensures that our documentation is always up-to-date, accurate, and machine-readable.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Annotation Format: Symbolic DarkArts
|
|
15
|
+
|
|
16
|
+
**Always use the symbolic DarkArts format.** Do not use the natural language `@voodocs` format.
|
|
17
|
+
|
|
18
|
+
### Correct Format
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
/**@darkarts
|
|
22
|
+
⊢{Module purpose}
|
|
23
|
+
∂{Dependencies}
|
|
24
|
+
⚠{Assumptions}
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**@darkarts
|
|
28
|
+
⊳{Preconditions}
|
|
29
|
+
⊲{Postconditions}
|
|
30
|
+
⊨{Invariants}
|
|
31
|
+
⚡{Side effects / Complexity}
|
|
32
|
+
🔒{Security implications}
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Incorrect Format (Do Not Use)
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
/**@voodocs
|
|
40
|
+
module_purpose: "..."
|
|
41
|
+
dependencies: [...]
|
|
42
|
+
*/
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 3. Key Rules
|
|
48
|
+
|
|
49
|
+
1. **Annotate Everything:** All modules, functions, classes, and interfaces must have a DarkArts annotation block.
|
|
50
|
+
2. **Use Symbolic Format Only:** Strictly adhere to the symbolic format (`⊢`, `∂`, `⚠`, `⊳`, `⊲`, `⊨`, `⚡`, `🔒`).
|
|
51
|
+
3. **Use Logic Symbols:** Use mathematical symbols for logic (`∧`, `∨`, `¬`, `∈`, `∃`, `∀`, `⇒`, `⇔`).
|
|
52
|
+
4. **Be Precise and Concise:** Annotations should be accurate and to the point.
|
|
53
|
+
5. **Validate Your Work:** After making changes, run `voodocs validate . --recursive` to ensure all annotations are correct.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Symbol Quick Reference
|
|
58
|
+
|
|
59
|
+
| Symbol | Meaning | Symbol | Meaning |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
| `⊢` | Module Purpose | `∧` | And |
|
|
62
|
+
| `∂` | Dependencies | `∨` | Or |
|
|
63
|
+
| `⚠` | Assumptions | `¬` | Not |
|
|
64
|
+
| `⊳` | Preconditions | `∈` | In |
|
|
65
|
+
| `⊲` | Postconditions | `∉` | Not In |
|
|
66
|
+
| `⊨` | Invariants | `∃` | Exists |
|
|
67
|
+
| `⚡` | Side Effects / Complexity | `∀` | For All |
|
|
68
|
+
| `🔒` | Security Implications | `⇒` | Implies |
|
|
69
|
+
| `⇔` | If and Only If | `⊤` | True |
|
|
70
|
+
| `⊥` | False | `∅` | Empty Set |
|
|
71
|
+
| `⊆` | Subset | `∪` | Union |
|
|
72
|
+
| `∩` | Intersection | | |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 5. Workflow
|
|
77
|
+
|
|
78
|
+
1. **When writing new code:** Add symbolic DarkArts annotations as you go.
|
|
79
|
+
2. **When modifying existing code:** Update the corresponding annotations to reflect your changes.
|
|
80
|
+
3. **Before committing:** Run `voodocs validate . --recursive` to catch any errors.
|
|
81
|
+
4. **If validation fails:** Run `voodocs fix . --recursive` to automatically fix common issues.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 6. Example: Adding a New Function
|
|
86
|
+
|
|
87
|
+
If you add a new function `getUserById`, you must add a symbolic annotation block:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
/**@darkarts
|
|
91
|
+
⊳{userId must be a valid UUID}
|
|
92
|
+
⊲{
|
|
93
|
+
Returns a user object if found
|
|
94
|
+
Returns null if ¬∃ user with that ID
|
|
95
|
+
}
|
|
96
|
+
⊨{Does ¬ modify the database}
|
|
97
|
+
⚡{O(1) lookup}
|
|
98
|
+
*/
|
|
99
|
+
export async function getUserById(userId: string): Promise<User | null> {
|
|
100
|
+
// ...
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 7. Example: Modifying a Module
|
|
107
|
+
|
|
108
|
+
If you add a new dependency to a module, update the `∂` field:
|
|
109
|
+
|
|
110
|
+
**Before:**
|
|
111
|
+
```typescript
|
|
112
|
+
/**@darkarts
|
|
113
|
+
⊢{User authentication service}
|
|
114
|
+
∂{jsonwebtoken}
|
|
115
|
+
*/
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**After (added bcrypt):**
|
|
119
|
+
```typescript
|
|
120
|
+
/**@darkarts
|
|
121
|
+
⊢{User authentication service}
|
|
122
|
+
∂{
|
|
123
|
+
jsonwebtoken: For JWT creation
|
|
124
|
+
bcrypt: For password hashing
|
|
125
|
+
}
|
|
126
|
+
*/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 8. Important Commands
|
|
132
|
+
|
|
133
|
+
- **Validate:** `voodocs validate . --recursive`
|
|
134
|
+
- **Fix:** `voodocs fix . --recursive`
|
|
135
|
+
- **Generate Docs:** `voodocs generate . ./docs --recursive`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
By following these instructions, you will help us maintain a high-quality, machine-readable, and self-validating codebase. Thank you for your contribution!
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Cursor AI Instructions for Symbolic DarkArts Annotations
|
|
2
|
+
|
|
3
|
+
**Version:** 2.0
|
|
4
|
+
**Date:** December 21, 2024
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Primary Goal
|
|
9
|
+
|
|
10
|
+
Your primary goal is to **write and maintain symbolic DarkArts annotations** for all new and existing code. This ensures that our documentation is always up-to-date, accurate, and machine-readable.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Annotation Format: Symbolic DarkArts
|
|
15
|
+
|
|
16
|
+
**Always use the symbolic DarkArts format.** Do not use the natural language `@voodocs` format.
|
|
17
|
+
|
|
18
|
+
### Correct Format
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
/**@darkarts
|
|
22
|
+
⊢{Module purpose}
|
|
23
|
+
∂{Dependencies}
|
|
24
|
+
⚠{Assumptions}
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**@darkarts
|
|
28
|
+
⊳{Preconditions}
|
|
29
|
+
⊲{Postconditions}
|
|
30
|
+
⊨{Invariants}
|
|
31
|
+
⚡{Side effects / Complexity}
|
|
32
|
+
🔒{Security implications}
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Incorrect Format (Do Not Use)
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
/**@voodocs
|
|
40
|
+
module_purpose: "..."
|
|
41
|
+
dependencies: [...]
|
|
42
|
+
*/
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 3. Key Rules
|
|
48
|
+
|
|
49
|
+
1. **Annotate Everything:** All modules, functions, classes, and interfaces must have a DarkArts annotation block.
|
|
50
|
+
2. **Use Symbolic Format Only:** Strictly adhere to the symbolic format (`⊢`, `∂`, `⚠`, `⊳`, `⊲`, `⊨`, `⚡`, `🔒`).
|
|
51
|
+
3. **Use Logic Symbols:** Use mathematical symbols for logic (`∧`, `∨`, `¬`, `∈`, `∃`, `∀`, `⇒`, `⇔`).
|
|
52
|
+
4. **Be Precise and Concise:** Annotations should be accurate and to the point.
|
|
53
|
+
5. **Validate Your Work:** After making changes, run `voodocs validate . --recursive` to ensure all annotations are correct.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Symbol Quick Reference
|
|
58
|
+
|
|
59
|
+
| Symbol | Meaning | Symbol | Meaning |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
| `⊢` | Module Purpose | `∧` | And |
|
|
62
|
+
| `∂` | Dependencies | `∨` | Or |
|
|
63
|
+
| `⚠` | Assumptions | `¬` | Not |
|
|
64
|
+
| `⊳` | Preconditions | `∈` | In |
|
|
65
|
+
| `⊲` | Postconditions | `∉` | Not In |
|
|
66
|
+
| `⊨` | Invariants | `∃` | Exists |
|
|
67
|
+
| `⚡` | Side Effects / Complexity | `∀` | For All |
|
|
68
|
+
| `🔒` | Security Implications | `⇒` | Implies |
|
|
69
|
+
| `⇔` | If and Only If | `⊤` | True |
|
|
70
|
+
| `⊥` | False | `∅` | Empty Set |
|
|
71
|
+
| `⊆` | Subset | `∪` | Union |
|
|
72
|
+
| `∩` | Intersection | | |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 5. Workflow
|
|
77
|
+
|
|
78
|
+
1. **When writing new code:** Add symbolic DarkArts annotations as you go.
|
|
79
|
+
2. **When modifying existing code:** Update the corresponding annotations to reflect your changes.
|
|
80
|
+
3. **Before committing:** Run `voodocs validate . --recursive` to catch any errors.
|
|
81
|
+
4. **If validation fails:** Run `voodocs fix . --recursive` to automatically fix common issues.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 6. Example: Adding a New Function
|
|
86
|
+
|
|
87
|
+
If you add a new function `getUserById`, you must add a symbolic annotation block:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
/**@darkarts
|
|
91
|
+
⊳{userId must be a valid UUID}
|
|
92
|
+
⊲{
|
|
93
|
+
Returns a user object if found
|
|
94
|
+
Returns null if ¬∃ user with that ID
|
|
95
|
+
}
|
|
96
|
+
⊨{Does ¬ modify the database}
|
|
97
|
+
⚡{O(1) lookup}
|
|
98
|
+
*/
|
|
99
|
+
export async function getUserById(userId: string): Promise<User | null> {
|
|
100
|
+
// ...
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 7. Example: Modifying a Module
|
|
107
|
+
|
|
108
|
+
If you add a new dependency to a module, update the `∂` field:
|
|
109
|
+
|
|
110
|
+
**Before:**
|
|
111
|
+
```typescript
|
|
112
|
+
/**@darkarts
|
|
113
|
+
⊢{User authentication service}
|
|
114
|
+
∂{jsonwebtoken}
|
|
115
|
+
*/
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**After (added bcrypt):**
|
|
119
|
+
```typescript
|
|
120
|
+
/**@darkarts
|
|
121
|
+
⊢{User authentication service}
|
|
122
|
+
∂{
|
|
123
|
+
jsonwebtoken: For JWT creation
|
|
124
|
+
bcrypt: For password hashing
|
|
125
|
+
}
|
|
126
|
+
*/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 8. Important Commands
|
|
132
|
+
|
|
133
|
+
- **Validate:** `voodocs validate . --recursive`
|
|
134
|
+
- **Fix:** `voodocs fix . --recursive`
|
|
135
|
+
- **Generate Docs:** `voodocs generate . ./docs --recursive`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
By following these instructions, you will help us maintain a high-quality, machine-readable, and self-validating codebase. Thank you for your contribution!
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# AI Instructions for Symbolic DarkArts Annotations
|
|
2
|
+
|
|
3
|
+
**Version:** 2.0
|
|
4
|
+
**Date:** December 21, 2024
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Primary Goal
|
|
9
|
+
|
|
10
|
+
Your primary goal is to **write and maintain symbolic DarkArts annotations** for all new and existing code. This ensures that our documentation is always up-to-date, accurate, and machine-readable.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Annotation Format: Symbolic DarkArts
|
|
15
|
+
|
|
16
|
+
**Always use the symbolic DarkArts format.** Do not use the natural language `@voodocs` format.
|
|
17
|
+
|
|
18
|
+
### Correct Format
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
/**@darkarts
|
|
22
|
+
⊢{Module purpose}
|
|
23
|
+
∂{Dependencies}
|
|
24
|
+
⚠{Assumptions}
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**@darkarts
|
|
28
|
+
⊳{Preconditions}
|
|
29
|
+
⊲{Postconditions}
|
|
30
|
+
⊨{Invariants}
|
|
31
|
+
⚡{Side effects / Complexity}
|
|
32
|
+
🔒{Security implications}
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Incorrect Format (Do Not Use)
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
/**@voodocs
|
|
40
|
+
module_purpose: "..."
|
|
41
|
+
dependencies: [...]
|
|
42
|
+
*/
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 3. Key Rules
|
|
48
|
+
|
|
49
|
+
1. **Annotate Everything:** All modules, functions, classes, and interfaces must have a DarkArts annotation block.
|
|
50
|
+
2. **Use Symbolic Format Only:** Strictly adhere to the symbolic format (`⊢`, `∂`, `⚠`, `⊳`, `⊲`, `⊨`, `⚡`, `🔒`).
|
|
51
|
+
3. **Use Logic Symbols:** Use mathematical symbols for logic (`∧`, `∨`, `¬`, `∈`, `∃`, `∀`, `⇒`, `⇔`).
|
|
52
|
+
4. **Be Precise and Concise:** Annotations should be accurate and to the point.
|
|
53
|
+
5. **Validate Your Work:** After making changes, run `voodocs validate . --recursive` to ensure all annotations are correct.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Symbol Quick Reference
|
|
58
|
+
|
|
59
|
+
| Symbol | Meaning | Symbol | Meaning |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
| `⊢` | Module Purpose | `∧` | And |
|
|
62
|
+
| `∂` | Dependencies | `∨` | Or |
|
|
63
|
+
| `⚠` | Assumptions | `¬` | Not |
|
|
64
|
+
| `⊳` | Preconditions | `∈` | In |
|
|
65
|
+
| `⊲` | Postconditions | `∉` | Not In |
|
|
66
|
+
| `⊨` | Invariants | `∃` | Exists |
|
|
67
|
+
| `⚡` | Side Effects / Complexity | `∀` | For All |
|
|
68
|
+
| `🔒` | Security Implications | `⇒` | Implies |
|
|
69
|
+
| `⇔` | If and Only If | `⊤` | True |
|
|
70
|
+
| `⊥` | False | `∅` | Empty Set |
|
|
71
|
+
| `⊆` | Subset | `∪` | Union |
|
|
72
|
+
| `∩` | Intersection | | |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 5. Workflow
|
|
77
|
+
|
|
78
|
+
1. **When writing new code:** Add symbolic DarkArts annotations as you go.
|
|
79
|
+
2. **When modifying existing code:** Update the corresponding annotations to reflect your changes.
|
|
80
|
+
3. **Before committing:** Run `voodocs validate . --recursive` to catch any errors.
|
|
81
|
+
4. **If validation fails:** Run `voodocs fix . --recursive` to automatically fix common issues.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 6. Example: Adding a New Function
|
|
86
|
+
|
|
87
|
+
If you add a new function `getUserById`, you must add a symbolic annotation block:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
/**@darkarts
|
|
91
|
+
⊳{userId must be a valid UUID}
|
|
92
|
+
⊲{
|
|
93
|
+
Returns a user object if found
|
|
94
|
+
Returns null if ¬∃ user with that ID
|
|
95
|
+
}
|
|
96
|
+
⊨{Does ¬ modify the database}
|
|
97
|
+
⚡{O(1) lookup}
|
|
98
|
+
*/
|
|
99
|
+
export async function getUserById(userId: string): Promise<User | null> {
|
|
100
|
+
// ...
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 7. Example: Modifying a Module
|
|
107
|
+
|
|
108
|
+
If you add a new dependency to a module, update the `∂` field:
|
|
109
|
+
|
|
110
|
+
**Before:**
|
|
111
|
+
```typescript
|
|
112
|
+
/**@darkarts
|
|
113
|
+
⊢{User authentication service}
|
|
114
|
+
∂{jsonwebtoken}
|
|
115
|
+
*/
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**After (added bcrypt):**
|
|
119
|
+
```typescript
|
|
120
|
+
/**@darkarts
|
|
121
|
+
⊢{User authentication service}
|
|
122
|
+
∂{
|
|
123
|
+
jsonwebtoken: For JWT creation
|
|
124
|
+
bcrypt: For password hashing
|
|
125
|
+
}
|
|
126
|
+
*/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 8. Important Commands
|
|
132
|
+
|
|
133
|
+
- **Validate:** `voodocs validate . --recursive`
|
|
134
|
+
- **Fix:** `voodocs fix . --recursive`
|
|
135
|
+
- **Generate Docs:** `voodocs generate . ./docs --recursive`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
By following these instructions, you will help us maintain a high-quality, machine-readable, and self-validating codebase. Thank you for your contribution!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voodocs/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "AI-Native Documentation System with Validation - The only documentation tool that validates your annotations and guarantees accuracy",
|
|
5
5
|
"main": "voodocs_cli.py",
|
|
6
6
|
"bin": {
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"lib/darkarts/context/",
|
|
59
59
|
"lib/darkarts/core/",
|
|
60
60
|
"lib/darkarts/validation/",
|
|
61
|
+
"lib/darkarts/instructions/",
|
|
61
62
|
"lib/darkarts/exceptions.py",
|
|
62
63
|
"lib/darkarts/telemetry.py",
|
|
63
64
|
"lib/darkarts/parsers/typescript/dist/",
|