-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_claude_code_rule.py
More file actions
28 lines (22 loc) · 986 Bytes
/
add_claude_code_rule.py
File metadata and controls
28 lines (22 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import sys
def main() -> None:
script_dir = os.path.dirname(os.path.abspath(__file__))
doc_path = os.path.join(script_dir, "LLM_DOC.md")
user_project_root = os.getcwd()
output_file = os.path.join(user_project_root, "CLAUDE.md")
relative_doc_path = os.path.relpath(doc_path, user_project_root)
try:
rule = f"""
# Nutrient DWS Python Client Usage
- Use the `nutrient-dws` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
- Package Documentation and Examples can be found at: {relative_doc_path}
"""
with open(output_file, "a", encoding="utf-8") as f:
f.write(rule)
print(
f"📄 Updated Claude Code Rules to point to Nutrient DWS documentation at {relative_doc_path}."
)
except Exception as err:
print(f"Failed to update CLAUDE.md file: {err}", file=sys.stderr)
sys.exit(1)