Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .claude/commands/add-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Add New Version to Existing Product

This command helps you quickly add a new version to an existing product in the documentation.

## Steps to Complete

1. **Gather Information**
- Ask user for product name (e.g., "accessanalyzer", "threatprevention")
- Ask for new version number (e.g., "12.1", "7.6")
- Identify the current latest version by checking existing directories

2. **Copy Documentation from Latest Version**
```bash
# Find latest version
ls -d /docs/{productname}/*/ | sort -V | tail -1

# Copy to new version
cp -r /docs/{productname}/{latest_version}/ /docs/{productname}/{new_version}/
```

3. **Update Frontmatter in Copied Files**
- Update version references in all `.md` files
- Update any version-specific content in whatsnew.md

4. **Create New Sidebar Configuration**
```bash
cp /sidebars/{productname}-{latest_version}-sidebar.js /sidebars/{productname}-{new_version}-sidebar.js
```

Update the sidebar file if it contains version-specific paths.

5. **Add to docusaurus.config.js**

Add new plugin configuration after the existing versions:
```javascript
[
'@docusaurus/plugin-content-docs',
{
id: '{productname}{version_underscores}', // e.g., 'accessanalyzer12_1'
path: 'docs/{productname}/{version}',
routeBasePath: 'docs/{productname}/{version}',
sidebarPath: require.resolve('./sidebars/{productname}-{version}-sidebar.js'),
editUrl: 'https://github.com/netwrix/docs/tree/main/',
exclude: ['**/CLAUDE.md'],
versions: {
current: {
label: '{version}',
},
},
},
],
```

6. **Update HomepageFeatures Component**

Find the product in `/src/components/HomepageFeatures/index.js` and update the link to point to the new version:
```javascript
{
title: '{Product Name}',
link: '/docs/{productname}/{new_version}', // Update to new version
description: '{product description}'
},
```

7. **Test the New Version**
```bash
npm start {productname}/{new_version}
```

8. **Update What's New Page**
- Clear the content in `/docs/{productname}/{new_version}/whatsnew.md`
- Add placeholder for new version features

## Example

Adding version 12.1 to Access Analyzer:
1. Copy from 12.0: `cp -r docs/accessanalyzer/12.0/ docs/accessanalyzer/12.1/`
2. Create sidebar: `cp sidebars/accessanalyzer-12.0-sidebar.js sidebars/accessanalyzer-12.1-sidebar.js`
3. Add plugin with id: `accessanalyzer12_1`
4. Update HomepageFeatures link to `/docs/accessanalyzer/12.1`
5. Test: `npm start accessanalyzer/12.1`

## Important Notes

- Version numbers use dots in paths (12.1) but underscores in IDs (12_1)
- Always test the new version before committing
- Update whatsnew.md with actual changes for the new version
- Consider if any version-specific content needs updating
125 changes: 125 additions & 0 deletions .claude/commands/convert-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Convert Images to WebP Format

This command helps you batch convert PNG/JPG images to WebP format for better performance and update all references in the documentation.

## Prerequisites

Ensure `cwebp` is installed:
```bash
# macOS
brew install webp

# Ubuntu/Debian
sudo apt-get install webp

# Check installation
cwebp -version
```

## Steps to Complete

1. **Select Scope**
- Ask user: Convert images for specific product or all products?
- If specific product, ask which one (e.g., "accessanalyzer")

2. **Find Images to Convert**
```bash
# For specific product
find /static/img/product_docs/{productname} -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \) -print0

# For all products
find /static/img/product_docs -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \) -print0
```

3. **Create Backup**
```bash
# Create backup directory with timestamp
backup_dir="/static/img/product_docs/.backup-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$backup_dir"

# Copy images to backup
find /static/img/product_docs/{scope} -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \) -exec cp {} "$backup_dir/" \;
```

4. **Convert Images to WebP**
```bash
# Convert each image
find /static/img/product_docs/{scope} -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \) | while read -r img; do
# Get filename without extension
filename="${img%.*}"

# Convert to WebP (quality 85 is usually good balance)
cwebp -q 85 "$img" -o "${filename}.webp"

echo "Converted: $img -> ${filename}.webp"
done
```

5. **Update Markdown References**
```bash
# Find all markdown files that reference the images
# For each converted image, update references

# Example for a specific image:
old_image="image.png"
new_image="image.webp"

# Find and replace in markdown files
find /docs/{scope} -name "*.md" -type f -exec grep -l "$old_image" {} \; | while read -r file; do
# Use sed to replace image references
sed -i.bak "s|${old_image}|${new_image}|g" "$file"
done
```

6. **Verify Updates**
- Check that all references were updated
- Preview a few pages to ensure images display correctly
- Compare file sizes to show savings

7. **Clean Up Old Images**
After verification, ask user to confirm deletion:
```bash
# Show size comparison
echo "Original images size:"
du -sh /static/img/product_docs/.backup-*/

echo "WebP images size:"
find /static/img/product_docs/{scope} -name "*.webp" -exec du -ch {} + | grep total

# If confirmed, remove original images
find /static/img/product_docs/{scope} -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \) -delete
```

8. **Test Documentation**
```bash
# Start development server to verify images load
npm start {productname}
```

## Quality Settings

- **85**: Good balance of quality and size (default)
- **90**: Higher quality for detailed screenshots
- **80**: Smaller size for simple diagrams
- **95**: Near-lossless for critical images

## Example Output

```
Converting images for accessanalyzer...
✓ Created backup at /static/img/product_docs/.backup-20240119-143022/
✓ Converted 45 images to WebP format
✓ Updated 127 markdown files
✓ Size reduction: 12.3MB → 4.7MB (62% smaller)
✓ All images verified in documentation

Delete original images? (y/n)
```

## Important Notes

- Always create a backup before converting
- Test image quality before deleting originals
- WebP is supported by all modern browsers
- Some images may not benefit from conversion (already optimized PNGs)
- Consider keeping originals if they're source files for editing
132 changes: 132 additions & 0 deletions .claude/commands/new-product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Create New Product Documentation: $ARGUMENTS

This command helps you quickly set up a new product in the Netwrix documentation site.

Product name provided: **$ARGUMENTS**

## Steps to Complete

1. **Create product directory structure**
- Parse product name from $ARGUMENTS. If given a normal name (e.g. "Netwrix Privilege Secure") use all lowercase, no spaces, and always remove "netwrix" from the name (e.g., "privilegesecure")
- Ask if product has versions or is single version (e.g., SaaS)
- If versioned: ask for version numbers (e.g., "7.4", "7.5")
- Create directories:
- Single version: `/docs/{productname}/`
- Versioned: `/docs/{productname}/{version}/` for each version

2. **Create sidebar configuration**
- For single version: create `/sidebars/{productname}-sidebar.js`
- For versioned: create `/sidebars/{productname}-{version}-sidebar.js` for each version

Example sidebar format:
```javascript
// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
sidebar: [
{
type: 'autogenerated',
dirName: '.',
},
],
};

export default sidebars;
```

3. **Add to the plugins list of docusaurus.config.js**

For single version product:
```javascript
// $ARGUMENTS Product
[
'@docusaurus/plugin-content-docs',
{
id: '{productname}',
path: 'docs/{productname}',
routeBasePath: 'docs/{productname}',
sidebarPath: require.resolve('./sidebars/{productname}-sidebar.js'),
editUrl: 'https://github.com/netwrix/docs/tree/main/',
exclude: ['**/CLAUDE.md'],
versions: {
current: {
label: 'Current',
},
},
},
],
```

For versioned product (add one for each version):
```javascript
// $ARGUMENTS Product {version}
[
'@docusaurus/plugin-content-docs',
{
id: '{productname}{version_with_underscores}', // e.g., 'threatprevention7_5'
path: 'docs/{productname}/{version}',
routeBasePath: 'docs/{productname}/{version}',
sidebarPath: require.resolve('./sidebars/{productname}-{version}-sidebar.js'),
editUrl: 'https://github.com/netwrix/docs/tree/main/',
exclude: ['**/CLAUDE.md'],
versions: {
current: {
label: '{version}',
},
},
},
],
```

4. **Add to HomepageFeatures component**

Ask user which category $ARGUMENTS belongs to:
- Identity Management
- Privileged Access Management (PAM)
- Directory Management
- Endpoint Management
- Data Security Posture Management (DSPM)
- Identity Threat Detection & Response (ITDR)
- Other

Add to `/src/components/HomepageFeatures/index.js` in the appropriate category:

For single version:
```javascript
{
title: '$ARGUMENTS',
link: '/docs/{productname}',
description: '{Brief product description}'
},
```

For versioned (add latest version):
```javascript
{
title: '$ARGUMENTS',
link: '/docs/{productname}/{latest_version}',
description: '{Brief product description}'
},
```

5. **Collapse directories in IDE**
If using Cursor IDE, collapse all directories except `/docs/{productname}`

## Product Categories Reference // Update this list with $ARGUMENTS

- **Identity Management**: Identity Manager, Directory Manager, Platform Governance products
- **Privileged Access Management (PAM)**: Privilege Secure, Endpoint Privilege Manager, Password Secure
- **Directory Management**: Auditor, Directory Manager, Password Policy Enforcer
- **Endpoint Management**: Endpoint Protector, Endpoint Policy Manager, Change Tracker
- **Data Security Posture Management (DSPM)**: 1Secure, Auditor, Access Analyzer, Data Classification
- **Identity Threat Detection & Response (ITDR)**: PingCastle, Access Analyzer, Threat Manager, Threat Prevention, Recovery for AD
- **Other**: Access Information Center, Activity Monitor, Password Reset, Flashlight products

## Important Notes

- Product names should be lowercase with no spaces (e.g., "privilegesecure" not "Privilege Secure")
- Version numbers use dots in paths but underscores in IDs (e.g., path: "7.5", id: "7_5")
- All products need the CLAUDE.md exclusion in their config
- Test with `npm start {productname}` or `npm start {productname}/{version}` after creation
- Product being created: **$ARGUMENTS**
24 changes: 24 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"permissions": {
"allow": [
"Bash(*)",
"mcp__*"
],
"deny": [
"Bash(rm -rf /)",
"Bash(rm -rf /*)",
"Bash(rm -rf ~)",
"Bash(rm -rf ~/*)",
"Bash(rm -rf .)",
"Bash(rm -rf ..)",
"Bash(rm -rf *)",
"Bash(find / -delete)",
"Bash(find . -delete)",
"Bash(find ~ -delete)"
]
},
"autoApprove": {
"write": true,
"edit": true
}
}
Loading
Loading