Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 17:55:01 +08:00
commit 0489a976ec
15 changed files with 1607 additions and 0 deletions

210
commands/batch-review.md Normal file
View File

@@ -0,0 +1,210 @@
---
description: Batch review multiple blog articles against editorial style guide
argument-hint: [brand-name] [directory-path] [--auto-apply]
---
# Batch Review: Process Multiple Articles
Review all articles in **$2** against the **$1** brand style guide.
## Step 1: Validate Inputs
Before proceeding:
- Verify style guide exists at `brands/$1/style-guide.md`
- If missing: Error and suggest running `/generate-style-guide $1 [source]`
- Verify directory exists at $2
- If missing: Error with clear message
- Check if $3 is `--auto-apply` (determines whether to apply corrections automatically)
## Step 2: Discover Articles
Scan the directory at $2 for markdown files:
- Use Glob to find all `*.md` files in $2
- Exclude files ending with `_edited.md` (already processed)
- Exclude README.md files
- Sort by filename
- Report number of articles found
**If no articles found:**
- Provide clear message and exit
**If articles found:**
- Display list of articles to be reviewed
- Ask user to confirm: "Found [X] articles. Proceed with batch review? (yes/no)"
## Step 3: Process Each Article
For each article in the list:
### Option A: Sequential Processing (Default - More Reliable)
1. Display: "Processing article [N] of [total]: [filename]"
2. Run the equivalent of `/style-check $1 [article-path]` on this article
3. Collect findings
4. If --auto-apply: Apply corrections and save to `edited/` folder
5. Move to next article
### Option B: Parallel Processing (Faster but Resource-Intensive)
- If user confirms they want parallel processing:
- Batch articles into groups of 3
- Process each group in parallel
- Note: This will spawn 24 agents per batch (8 agents × 3 articles)
## Step 4: Aggregate Portfolio Results
After all articles processed, create portfolio compliance report:
```markdown
# Batch Review Report: $1
**Brand:** $1
**Source Directory:** $2
**Review Date:** [current date]
**Articles Reviewed:** [number]
**Auto-Apply:** [yes/no]
---
## Portfolio Compliance Summary
**Overall Statistics:**
- Total articles reviewed: [X]
- Fully compliant (0 violations): [X] articles ([%])
- Minor issues (1-5 violations): [X] articles ([%])
- Moderate issues (6-15 violations): [X] articles ([%])
- Major issues (16+ violations): [X] articles ([%])
**Total Violations Across Portfolio:**
- Voice & Tone: [X] violations
- Grammar & Usage: [X] violations
- Punctuation: [X] violations
- Formatting: [X] violations
- Technical Standards: [X] violations
- Content Patterns: [X] violations
- Industry Terms: [X] violations
**Average violations per article:** [number]
---
## Most Common Violations
1. [Most frequent issue]: [X] occurrences across [Y] articles
2. [Second most frequent]: [X] occurrences across [Y] articles
3. [Third most frequent]: [X] occurrences across [Y] articles
4. [etc.]
---
## Article-by-Article Summary
| Article | Total Violations | Status | Priority |
|---------|-----------------|--------|----------|
| [filename-1] | [X] | ✅/⚠️/❌ | High/Med/Low |
| [filename-2] | [X] | ✅/⚠️/❌ | High/Med/Low |
| [etc.] | [X] | ✅/⚠️/❌ | High/Med/Low |
**Legend:**
- ✅ Fully compliant (0 violations)
- ⚠️ Minor issues (1-5 violations)
- ❌ Needs attention (6+ violations)
---
## Priority Recommendations
### High Priority Articles (Review First)
[List articles with major brand voice/structural issues]
### Medium Priority Articles
[List articles with consistency/formatting issues]
### Low Priority Articles
[List articles with minor polish needed]
---
## Common Patterns to Address
**Voice & Tone Issues:**
[List common voice/tone violations seen across multiple articles]
**Grammar & Usage Issues:**
[List common grammar violations]
**Formatting Issues:**
[List common formatting violations]
[etc.]
---
## Next Steps
1. Review high-priority articles first
2. Consider updating style guide if new patterns emerge
3. For articles with 0 violations: Consider them as exemplars
4. For articles with many violations: May indicate style guide misalignment
**Files Generated:**
- Batch report: docs/logs/[date]_batch-review_$1.md
- Individual reports: docs/logs/[date]_style-check_$1_[article].md (for each article)
- Edited articles: $2/../edited/ (if --auto-apply used)
```
## Step 5: Save Reports
Save the following:
- **Portfolio report**: `docs/logs/[YYYY-MM-DD]_batch-review_$1.md`
- **Individual reports**: One per article in `docs/logs/`
- **Edited articles**: If --auto-apply, save to `brands/$1/articles/edited/` or `$2/../edited/`
## Step 6: Update Brand README
If `brands/$1/README.md` exists:
- Add note about this batch review
- Update "Last Reviewed" date
- Add summary statistics
If doesn't exist:
- Create basic README with review statistics
## Usage Examples
```bash
# Review all articles in directory (report only)
/batch-review animalz brands/animalz/articles/original/
# Review and automatically apply corrections
/batch-review animalz brands/animalz/articles/original/ --auto-apply
# Review articles from any directory
/batch-review hubspot /Users/name/Documents/hubspot-drafts/
```
## Performance Estimates
**Sequential processing (default):**
- Time per article: ~5-10 minutes
- For 10 articles: ~50-100 minutes (1-2 hours)
- More reliable, less resource-intensive
**Parallel processing (if user requests):**
- Time for 3 articles (batch): ~10-15 minutes
- For 10 articles (4 batches): ~40-60 minutes
- Faster but more complex
## Error Handling
- **Style guide missing**: Provide helpful error with suggestion
- **Directory not found**: Check path and provide clear error
- **No articles found**: Inform user and suggest checking directory
- **Individual article failures**: Continue with remaining articles; note failures in report
- **Permission issues**: Report which files couldn't be accessed
## Quality Assurance
After batch processing:
- Verify all articles were processed
- Check that reports were generated
- If --auto-apply: Verify edited files were created
- Count total violations vs. articles to ensure reasonable results

View File

@@ -0,0 +1,123 @@
---
description: Generate editorial style guide by analyzing published blog articles
argument-hint: [brand-name] [blog-url-or-directory]
---
# Generate Style Guide for Brand
Generate a comprehensive house style guide for **$1** based on sample articles.
## Step 1: Collect Sample Articles
**If $2 is a URL (blog/website):**
- Use WebFetch to analyze the blog at $2
- Identify and fetch 15-20 representative articles spanning multiple years
- Look for variety in topics, formats, and publication dates
- Save articles to `brands/$1/source-articles/`
**If $2 is a directory path:**
- Read all markdown files from the directory $2
- Verify there are at least 15 articles (warn if fewer)
- Articles should already be in `brands/$1/source-articles/`
## Step 2: Validate Inputs
Before proceeding:
- Confirm at least 15 articles are available for analysis
- Create brand directory if it doesn't exist: `brands/$1/`
- Create subdirectories: `brands/$1/source-articles/`, `brands/$1/articles/original/`, `brands/$1/articles/edited/`
## Step 3: Launch Style Guide Generator Agent
Use the Task tool with the general-purpose subagent to analyze all collected articles.
**Provide the agent with:**
- The style guide generator prompt from `.claude/prompts/style-guide-generator.md`
- All collected article contents
- Brand name: $1
- Instruction to create comprehensive 8-section style guide
**The agent should analyze articles and create a style guide with:**
1. Voice & Tone
2. Grammar & Usage
3. Punctuation
4. Formatting
5. Technical Standards
6. Content Patterns
7. Industry-Specific Terms
8. Quick Reference Checklist
## Step 4: Save Style Guide
- Save the generated style guide to `brands/$1/style-guide.md`
- Include metadata: last updated date, number of articles analyzed, version 1.0
- Create a README in `brands/$1/source-articles/README.md` documenting:
- Number of articles analyzed
- Date range of articles
- Topics covered
- Any notable patterns or decisions
## Step 5: Validation & Summary
After generation:
- Verify the style guide has all 8 sections
- Verify it includes 50+ specific rules
- Verify it has clear examples (✅ DO / ❌ DON'T format)
- Verify Quick Reference Checklist is complete
**Report to user:**
```markdown
## Style Guide Generated Successfully
**Brand:** $1
**Source:** $2
**Articles Analyzed:** [number]
**Output Location:** brands/$1/style-guide.md
**Style Guide Contents:**
- ✅ Section 1: Voice & Tone
- ✅ Section 2: Grammar & Usage
- ✅ Section 3: Punctuation
- ✅ Section 4: Formatting
- ✅ Section 5: Technical Standards
- ✅ Section 6: Content Patterns
- ✅ Section 7: Industry-Specific Terms
- ✅ Section 8: Quick Reference Checklist
**Total Rules:** [number]
**Examples Provided:** [number]
**Next Steps:**
1. Review the generated style guide at brands/$1/style-guide.md
2. Test it on an article: `/style-check $1 [article-path]`
3. Refine the guide based on edge cases
```
## Special Instructions
**If updating existing style guide:**
- Check if `brands/$1/style-guide.md` already exists
- If yes, read the existing guide first
- Preserve core brand guidelines
- Add new patterns discovered from additional articles
- Increment version number
- Add changelog note at bottom
**Error Handling:**
- If fewer than 15 articles available, warn user and ask if they want to proceed anyway
- If blog URL is inaccessible, provide clear error message
- If brand directory creation fails, report the issue
## Usage Examples
```bash
# Generate style guide from blog URL
/generate-style-guide animalz https://www.animalz.co/blog
# Generate style guide from local directory
/generate-style-guide hubspot brands/hubspot/source-articles/
# Update existing style guide with new articles
/generate-style-guide animalz brands/animalz/source-articles/
```

185
commands/style-check.md Normal file
View File

@@ -0,0 +1,185 @@
---
description: Review blog article against editorial style guide using 8 specialized agents
argument-hint: [brand-name] [article-path] [--auto-apply]
---
# Style Check: Multi-Agent Article Review
Review the article at **$2** against the **$1** brand style guide using 8 specialized agents running in parallel.
## Step 1: Validate Inputs
Before proceeding:
- Verify style guide exists at `brands/$1/style-guide.md`
- If missing: Error and suggest running `/generate-style-guide $1 [source]`
- Verify article exists at $2
- If missing: Error with clear message
- Check if $3 is `--auto-apply` (determines whether to apply corrections automatically)
## Step 2: Read Required Files
Read the following files:
- Article to review: $2
- Brand style guide: `brands/$1/style-guide.md`
- All 8 agent prompts from `.claude/prompts/`:
- voice-tone-agent.md
- grammar-usage-agent.md
- punctuation-agent.md
- formatting-agent.md
- technical-standards-agent.md
- content-patterns-agent.md
- industry-terms-agent.md
- quick-reference-agent.md
## Step 3: Launch 8 Specialized Agents in Parallel
**CRITICAL: Use Task tool to launch ALL 8 agents simultaneously in a SINGLE message.**
Each agent should receive:
- The agent prompt from `.claude/prompts/[agent-name].md`
- The complete article content from $2
- The relevant section(s) from `brands/$1/style-guide.md`
**Launch these 8 agents in parallel:**
1. **Agent 1 - Voice & Tone**: Review against Section 1 of style guide
2. **Agent 2 - Grammar & Usage**: Review against Section 2 of style guide
3. **Agent 3 - Punctuation**: Review against Section 3 of style guide
4. **Agent 4 - Formatting**: Review against Section 4 of style guide
5. **Agent 5 - Technical Standards**: Review against Section 5 of style guide
6. **Agent 6 - Content Patterns**: Review against Section 6 of style guide
7. **Agent 7 - Industry Terms**: Review against Section 7 of style guide
8. **Agent 8 - Quick Reference**: Final comprehensive check against Section 8
**Each agent must return:**
- List of violations with line numbers
- Specific corrections for each issue
- Citation of relevant style guide rules
## Step 4: Aggregate Findings
Once all 8 agents complete:
- Collect all violation reports
- Remove duplicate findings (if multiple agents caught same issue)
- Sort violations by line number (top to bottom)
- Calculate total violations by category
- Determine severity (High/Medium/Low)
## Step 5: Generate Review Report
Create a structured report:
```markdown
# Style Check Report: $1
**Article:** $2
**Brand:** $1
**Review Date:** [current date]
**Total Violations:** [number]
---
## Summary by Section
- Voice & Tone: [X] violations
- Grammar & Usage: [X] violations
- Punctuation: [X] violations
- Formatting: [X] violations
- Technical Standards: [X] violations
- Content Patterns: [X] violations
- Industry Terms: [X] violations
- Additional (Quick Check): [X] violations
---
## Detailed Findings
### Agent 1 - Voice & Tone
[Paste agent findings]
### Agent 2 - Grammar & Usage
[Paste agent findings]
### Agent 3 - Punctuation
[Paste agent findings]
### Agent 4 - Formatting
[Paste agent findings]
### Agent 5 - Technical Standards
[Paste agent findings]
### Agent 6 - Content Patterns
[Paste agent findings]
### Agent 7 - Industry Terms
[Paste agent findings]
### Agent 8 - Quick Reference Check
[Paste agent findings]
---
## Priority Recommendations
**High Priority** (Brand voice/structural issues):
[List critical violations]
**Medium Priority** (Consistency/formatting):
[List standard violations]
**Low Priority** (Minor polish):
[List minor violations]
---
## Next Steps
- Review findings above
- To apply corrections automatically: `/article-edit $1 $2`
- To apply manually: Edit the article at $2 using the corrections provided
```
## Step 6: Conditional Auto-Apply
**If $3 is `--auto-apply`:**
- Proceed to apply all corrections automatically
- Work through violations from top to bottom by line number
- Use the Edit tool to apply each correction
- Save result to same path with `_edited` suffix (unless already in `edited/` folder)
- Generate before/after summary
**If $3 is NOT `--auto-apply`:**
- Display the report
- Prompt user: "Review complete. Run `/article-edit $1 $2` to apply corrections."
## Step 7: Save Report
Save the review report to:
- `docs/logs/[YYYY-MM-DD]_style-check_$1_[article-name].md`
## Usage Examples
```bash
# Review only (no auto-apply)
/style-check animalz brands/animalz/articles/original/my-article.md
# Review and automatically apply corrections
/style-check animalz brands/animalz/articles/original/my-article.md --auto-apply
# Review article from different location
/style-check hubspot /Users/name/Documents/draft-article.md
```
## Error Handling
- **Style guide missing**: Provide helpful error with suggestion to generate one
- **Article not found**: Check path and provide clear error
- **Agent failures**: If any agent fails, continue with others and note the failure
- **No violations found**: Celebrate! Report that article is fully compliant
## Performance Notes
- 8 agents running in parallel: ~5-10 minutes
- Sequential would take: ~40+ minutes
- Speedup factor: 4-5x