Skip to content
Open
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
6 changes: 6 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,38 @@ Vocab = Docs
[*.{md,mdx}]
BasedOnStyles = nf-core, Vale
Vale.Spelling = NO
Vale.Terms = NO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we not loosing a lot of things then with disabling the vale.terms? in all these files, also below


# Blog posts - apply standard rules with relaxed personal pronouns
[sites/main-site/src/content/blog/**/*.{md,mdx}]
BasedOnStyles = nf-core, Vale
Vale.Spelling = NO
Vale.Terms = NO
nf-core.We = NO

# Documentation - stricter rules for formal documentation
[sites/docs/src/content/**/*.{md,mdx}]
BasedOnStyles = nf-core, Vale
Vale.Spelling = NO
Vale.Terms = NO


# Component and pipeline pages
[sites/modules-subworkflows/src/content/**/*.{md,mdx}]
BasedOnStyles = nf-core, Vale
Vale.Spelling = NO
Vale.Terms = NO

[sites/pipelines/src/content/**/*.{md,mdx}]
BasedOnStyles = nf-core, Vale
Vale.Spelling = NO
Vale.Terms = NO

# Config pages
[sites/configs/src/content/**/*.{md,mdx}]
BasedOnStyles = nf-core, Vale
Vale.Spelling = NO
Vale.Terms = NO

# Ignore API reference documentation (auto-generated) - must be at end
[sites/docs/src/content/api_reference/**/*.md]
Expand Down
86 changes: 86 additions & 0 deletions hooks/post-tool.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add any cc specific files

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
# Claude Code Post-Tool Hook
# Runs after Claude uses Write, Edit, or MultiEdit tools
# Automatically formats files with prettier and checks prose with Vale

# Source utilities
source "$(dirname "$0")/utils.sh"

# Get hook input from Claude
HOOK_DATA="$1"

# Extract tool name and file paths from the hook data
TOOL_NAME=$(echo "$HOOK_DATA" | jq -r '.tool_name // empty' 2>/dev/null)
FILE_PATHS=$(echo "$HOOK_DATA" | jq -r '.file_paths[]? // empty' 2>/dev/null)

# If we can't parse JSON, try to extract file paths from environment or arguments
if [ -z "$FILE_PATHS" ] && [ -n "$CLAUDE_MODIFIED_FILES" ]; then
FILE_PATHS="$CLAUDE_MODIFIED_FILES"
elif [ -z "$FILE_PATHS" ] && [ $# -gt 1 ]; then
shift # Remove first argument (hook data)
FILE_PATHS="$*"
fi

# If still no files, try to detect recently modified files
if [ -z "$FILE_PATHS" ]; then
FILE_PATHS=$(get_recent_files)
fi

# Exit if no files to process
if [ -z "$FILE_PATHS" ]; then
exit 0
fi

print_header "Post-Tool Formatting & Linting"

echo "🔧 Tool used: ${TOOL_NAME:-unknown}"
echo "📁 Processing files:"

# Convert FILE_PATHS to array and process each file
processed_any=false
vale_issues=false

# Handle both space-separated and newline-separated file lists
while IFS= read -r file; do
# Skip empty lines
[ -z "$file" ] && continue

# Skip if file doesn't exist
[ ! -f "$file" ] && continue

echo " → $file"

# Format with prettier
if format_file "$file"; then
processed_any=true
fi

# Lint with Vale
if ! lint_file "$file"; then
vale_issues=true
fi

echo ""
done <<< "$(echo "$FILE_PATHS" | tr ' ' '\n')"

# Summary
if [ "$processed_any" = true ]; then
echo "🎯 File processing complete!"

if [ "$vale_issues" = true ]; then
echo ""
echo "📚 Vale found some prose suggestions above. These help ensure:"
echo " • Consistent terminology (nf-core, Nextflow, etc.)"
echo " • Clear, readable documentation"
echo " • Professional writing style"
echo ""
echo "💡 Consider reviewing and addressing these suggestions for better documentation quality."
else
echo "✨ All prose checks passed - excellent writing!"
fi
else
echo "ℹ️ No eligible files found to process"
fi

print_separator
echo "✅ Hook execution complete"
85 changes: 85 additions & 0 deletions hooks/user-prompt-submit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env bash
# Claude Code User Prompt Submit Hook
# Runs when user submits a prompt
# Provides quick prose quality check on recently modified documentation

# Source utilities
source "$(dirname "$0")/utils.sh"

# Get user prompt from arguments
USER_PROMPT="$1"

# Only run if the prompt is related to documentation/writing
# Check for common documentation keywords
if ! echo "$USER_PROMPT" | grep -qi -E "(document|write|edit|readme|guide|tutorial|prose|content|markdown|mdx|vale|style|writing|docs)"; then
# Not a documentation-related prompt, exit silently
exit 0
fi

# Get recently modified documentation files
RECENT_FILES=$(find . \( -name "*.md" -o -name "*.mdx" \) -newermt '10 minutes ago' 2>/dev/null | head -5)

# If no recent files, exit silently
if [ -z "$RECENT_FILES" ]; then
exit 0
fi

print_header "Documentation Quality Check"

echo "🔍 Checking recently modified documentation files for prose quality..."
echo ""

issues_found=false
files_checked=0

while IFS= read -r file; do
[ -z "$file" ] && continue
[ ! -f "$file" ] && continue

# Skip API reference files (they're ignored in Vale config anyway)
if echo "$file" | grep -q "api_reference"; then
continue
fi

# Skip old events (they're ignored in Vale config anyway)
if echo "$file" | grep -qE "events/(2018|2019|2020|2021|2022|2023|2024)/"; then
continue
fi

files_checked=$((files_checked + 1))
echo "📄 Checking: $file"

if ! check_tool "vale"; then
echo " ⚠️ Vale not available for prose checking"
continue
fi

# Quick Vale check
vale_output=$(vale --config=.vale.ini "$file" 2>&1)
vale_exit_code=$?

if [ $vale_exit_code -eq 0 ]; then
echo " ✅ Prose quality looks good"
else
issues_found=true
echo " 📝 Found prose suggestions:"
echo "$vale_output" | sed 's/^/ /'
fi
echo ""
done <<< "$RECENT_FILES"

# Summary for Claude
if [ $files_checked -eq 0 ]; then
echo "ℹ️ No recent documentation files found to check"
elif [ "$issues_found" = true ]; then
echo "📊 Summary: Found some prose suggestions in recent documentation."
echo "💡 Consider these suggestions to improve clarity and consistency."
echo "🎯 Common improvements: terminology consistency, readability, style."
else
echo "✨ Summary: All recent documentation looks great!"
echo "🎉 No prose issues found in recently modified files."
fi

print_separator
echo "🤖 Ready to help with your documentation request!"
echo ""
111 changes: 111 additions & 0 deletions hooks/utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/usr/bin/env bash
# Utility functions for Claude Code hooks

# Check if a tool is available
check_tool() {
local tool="$1"
if ! command -v "$tool" &> /dev/null; then
echo "⚠️ $tool not found - skipping"
return 1
fi
return 0
}

# Check if file should be processed based on extension
should_process_file() {
local file="$1"
case "$file" in
*.md|*.mdx|*.js|*.ts|*.astro|*.svelte|*.css|*.scss|*.json|*.yml|*.yaml)
return 0
;;
*)
return 1
;;
esac
}

# Check if file should be linted with Vale
should_lint_with_vale() {
local file="$1"
case "$file" in
*.md|*.mdx)
return 0
;;
*)
return 1
;;
esac
}

# Format file with prettier if available
format_file() {
local file="$1"

if ! check_tool "prettier"; then
return 1
fi

if ! should_process_file "$file"; then
return 1
fi

echo "🎨 Formatting $file with prettier..."
if prettier --write --log-level=error "$file" 2>/dev/null; then
echo "✅ Formatted successfully"
return 0
else
echo "❌ Prettier formatting failed"
return 1
fi
}

# Lint file with Vale if available
lint_file() {
local file="$1"

if ! check_tool "vale"; then
return 1
fi

if ! should_lint_with_vale "$file"; then
return 1
fi

echo "📝 Checking prose quality with Vale..."

# Run Vale and capture output
local vale_output
vale_output=$(vale --config=.vale.ini "$file" 2>&1)
local vale_exit_code=$?

if [ $vale_exit_code -eq 0 ]; then
echo "✅ Vale: No prose issues found"
return 0
else
echo "📊 Vale found prose suggestions:"
echo "$vale_output" | sed 's/^/ /'
echo ""
echo "💡 These suggestions help improve documentation clarity and consistency."
return 1
fi
}

# Get list of recently modified files (in last 5 minutes)
get_recent_files() {
find . \( -name "*.md" -o -name "*.mdx" -o -name "*.js" -o -name "*.ts" -o -name "*.astro" -o -name "*.yml" -o -name "*.yaml" \) -newermt '5 minutes ago' 2>/dev/null | head -10
}

# Pretty print a separator
print_separator() {
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
}

# Print hook header
print_header() {
local hook_name="$1"
echo ""
echo "🤖 Claude Code Hook: $hook_name"
print_separator
}
2 changes: 2 additions & 0 deletions sites/configs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Local Netlify folder
.netlify
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Instructions for [nf-core pipeline](https://github.com/nf-core/proposals) approv
11. [ ] Core/Dev: Sync the nf-co.re pipelines page by triggering the [GitHub action](https://github.com/nf-core/website/actions/workflows/build-json-files.yml)
- Website repo > Actions > Build json files and md-cache > Run workflow > From main.

## Uploading test data to s3 bucket
## Uploading test data to S3 bucket

Instructions for uploading full-test AWS files for a pipeline to a S3 bucket:

Expand Down Expand Up @@ -62,9 +62,9 @@ Instructions for uploading full-test AWS files for a pipeline to a S3 bucket:
6. Select **Create** at the bottom of the page. Do not modify any fields.
7. Repeat the import (step 5) and create (step 6) steps for each JSON file provided.

## Making custom docker containers for modules
## Making custom Docker containers for modules

Instructions for adding custom docker containers to the nf-core [https://quay.io](https://quay.io/organization/nf-core) organisation.
Instructions for adding custom Docker containers to the nf-core [https://quay.io](https://quay.io/organization/nf-core) organisation.

:::note
These instructions require the person building and pushing the container to have push rights to the organization.
Expand Down Expand Up @@ -130,7 +130,7 @@ Before release:

Post release:

1. [ ] Select **Github** in the dropdown menu of your account in Zenodo and find the relevant repository.
1. [ ] Select **GitHub** in the dropdown menu of your account in Zenodo and find the relevant repository.
2. [ ] Click the Zenodo **Record** page for the release.
3. [ ] Find the **Communities** box on the record page and submit the record to the nf-core community.
4. [ ] Copy the DOI for **Cite all versions?** in the **Versions** tab.
Expand All @@ -141,12 +141,12 @@ Post release:

## Adding new community member to the GitHub organisation

Anyone can request to join the nf-core GitHub organisation via the #github-invitations channel.
Anyone can request to join the nf-core GitHub organisation via the #GitHub-invitations channel.

1. [ ] Verify the request is reasonable (i.e., clearly not spam).
2. [ ] Send an invitation via [nf-core github teams](https://github.com/orgs/nf-core/teams)
2. [ ] Send an invitation via [nf-core GitHub teams](https://github.com/orgs/nf-core/teams)
3. [ ] Add new member to the [nf-core contributors team](https://github.com/orgs/nf-core/teams/contributors)
4. [ ] Respond to the #github-invitations channel request by reacting with the ✅ emoji.
4. [ ] Respond to the #GitHub-invitations channel request by reacting with the ✅ emoji.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. [ ] Respond to the #GitHub-invitations channel request by reacting with the ✅ emoji.
4. [ ] Respond to the `#github-invitations` channel request by reacting with the ✅ emoji.


## Updating online bingo cards

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To add maintainers:
Team lead:

1. [ ] Add member to [#team-maintainers](https://nfcore.slack.com/archives/C043UU89KKQ)
2. [ ] Add member to [Github group](https://github.com/orgs/nf-core/teams/maintainers)
2. [ ] Add member to [GitHub group](https://github.com/orgs/nf-core/teams/maintainers)
3. [ ] Add member to Slack group
4. [ ] Add member to the [Maintainers team google calendar](https://calendar.google.com/calendar/u/0?cid=ZDA3MmVkOGI1NzQ0YWViOWE3ZjBkMDE4YjFjZWE1OGE5M2MwZDZlZTIyMzM1YWE5YzA0NTlmODg0YTZkMDNkZEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t)

Expand Down
Loading
Loading