Skip to content

hashgraph-online/awesome-codex-plugins / plugins/boshu2/agentops/skills/doc

Write source-checked docs, READMEs, change descriptions and handoffs. Use when: documenting a change, leaving or resuming a handoff, or drafting a questionnaire for someone else.

scripts/audit-oss-docs.sh

View on GitHub
#!/bin/bash
# OSS Documentation Audit Script
# Usage: audit-oss-docs.sh [--json]
#
# Checks for presence of standard OSS documentation files
# and reports coverage across tiers.

set -e

usage() {
    echo "Usage: audit-oss-docs.sh [--json]"
    echo "Reports which standard OSS documentation files exist in the current directory."
    echo "  --json      print the report as JSON"
    echo "  -h, --help  print this help"
}

JSON_OUTPUT=false
case "${1:-}" in
    "") ;;
    --json) JSON_OUTPUT=true ;;
    -h|--help) usage; exit 0 ;;
    *) usage >&2; exit 2 ;;
esac

# Colors (human output to a terminal only)
if [[ "$JSON_OUTPUT" == "false" ]] && [[ -t 1 ]]; then
    RED='\033[0;31m'
    GREEN='\033[0;32m'
    YELLOW='\033[0;33m'
    BLUE='\033[0;34m'
    NC='\033[0m' # No Color
else
    RED='' GREEN='' YELLOW='' BLUE='' NC=''
fi

# Project detection
PROJECT_NAME=$(basename "$(pwd)")

# Detect project type
# Order matters: more specific types checked first
detect_type() {
    # Kubernetes Operator (kubebuilder/operator-sdk) - check BEFORE cli-go
    # because operators also have go.mod + cmd/
    if [[ -f PROJECT ]] || [[ -d config/crd ]] || [[ -d config/rbac ]]; then
        echo "operator"
    # Helm Chart
    elif [[ -f Chart.yaml ]]; then
        echo "helm"
    # Go CLI Tool
    elif [[ -f go.mod ]] && [[ -d cmd ]]; then
        echo "cli-go"
    # Python CLI Tool (has entry points)
    elif [[ -f pyproject.toml ]] && grep -q "\[project.scripts\]" pyproject.toml 2>/dev/null; then
        echo "cli-python"
    # Go Library (go.mod but no cmd/)
    elif [[ -f go.mod ]]; then
        echo "library-go"
    # Python Library
    elif [[ -f pyproject.toml ]] || [[ -f setup.py ]]; then
        echo "library-python"
    # Node.js
    elif [[ -f package.json ]]; then
        if grep -q '"bin"' package.json 2>/dev/null; then
            echo "cli-node"
        else
            echo "library-node"
        fi
    # Rust
    elif [[ -f Cargo.toml ]]; then
        if [[ -d src/bin ]] || grep -q '^\[\[bin\]\]' Cargo.toml 2>/dev/null; then
            echo "cli-rust"
        else
            echo "library-rust"
        fi
    else
        echo "unknown"
    fi
}

# Detect languages
detect_languages() {
    local langs=()
    [[ -f go.mod ]] && langs+=("go")
    [[ -f pyproject.toml ]] || [[ -f setup.py ]] && langs+=("python")
    [[ -f package.json ]] && langs+=("javascript")
    [[ -f Cargo.toml ]] && langs+=("rust")
    [[ -f Makefile ]] && langs+=("make")
    [[ -f Dockerfile ]] && langs+=("docker")
    [[ -f Chart.yaml ]] && langs+=("helm")
    echo "${langs[*]}"
}

PROJECT_TYPE=$(detect_type)
LANGUAGES=$(detect_languages)

# GitHub reads CONTRIBUTING, CODE_OF_CONDUCT and SECURITY from the root,
# docs/ or .github/; print the first path found
find_community_file() {
    local dir
    for dir in "" docs/ .github/; do
        if [[ -f "${dir}$1" ]]; then
            echo "${dir}$1"
            return 0
        fi
    done
    return 1
}

# Tier 1: Required
check_tier1() {
    local score=0
    local total=4
    local results=()
    local name found

    if [[ -f LICENSE ]]; then
        results+=("LICENSE:pass")
        ((score++))
    else
        results+=("LICENSE:fail")
    fi

    if [[ -f README.md ]]; then
        results+=("README.md:pass")
        ((score++))
    else
        results+=("README.md:fail")
    fi

    for name in CONTRIBUTING.md CODE_OF_CONDUCT.md; do
        if found=$(find_community_file "$name"); then
            results+=("$found:pass")
            ((score++))
        else
            results+=("$name:fail")
        fi
    done

    echo "$score:$total:${results[*]}"
}

# Tier 2: Standard
check_tier2() {
    local score=0
    local total=5
    local results=()
    local found

    if found=$(find_community_file SECURITY.md); then
        results+=("$found:pass")
        ((score++))
    else
        results+=("SECURITY.md:fail")
    fi

    if [[ -f CHANGELOG.md ]]; then
        results+=("CHANGELOG.md:pass")
        ((score++))
    else
        results+=("CHANGELOG.md:fail")
    fi

    if [[ -f AGENTS.md ]]; then
        results+=("AGENTS.md:pass")
        ((score++))
    else
        results+=("AGENTS.md:fail")
    fi

    if [[ -d .github/ISSUE_TEMPLATE ]]; then
        results+=("issue_templates:pass")
        ((score++))
    else
        results+=("issue_templates:fail")
    fi

    if [[ -f .github/PULL_REQUEST_TEMPLATE.md ]]; then
        results+=("pr_template:pass")
        ((score++))
    else
        results+=("pr_template:fail")
    fi

    echo "$score:$total:${results[*]}"
}

# Tier 3: Enhanced (with recommendations)
check_tier3() {
    local score=0
    local total=6
    local results=()

    # QUICKSTART - recommended for all
    if [[ -f docs/QUICKSTART.md ]]; then
        results+=("docs/QUICKSTART.md:pass:recommended")
        ((score++))
    else
        results+=("docs/QUICKSTART.md:fail:recommended")
    fi

    # ARCHITECTURE - recommended for non-trivial projects
    if [[ -f docs/ARCHITECTURE.md ]]; then
        results+=("docs/ARCHITECTURE.md:pass:conditional")
        ((score++))
    else
        local rec="optional"
        # Recommend if large codebase
        [[ $(find . -name "*.go" -o -name "*.py" 2>/dev/null | wc -l) -gt 20 ]] && rec="recommended"
        results+=("docs/ARCHITECTURE.md:fail:$rec")
    fi

    # CLI_REFERENCE - recommended for CLI tools
    # CRD_REFERENCE - recommended for operators (check for either)
    if [[ -f docs/CLI_REFERENCE.md ]] || [[ -f docs/CRD_REFERENCE.md ]]; then
        local found_file="docs/CLI_REFERENCE.md"
        [[ -f docs/CRD_REFERENCE.md ]] && found_file="docs/CRD_REFERENCE.md"
        results+=("$found_file:pass:conditional")
        ((score++))
    else
        local rec="optional"
        local check_file="docs/CLI_REFERENCE.md"
        if [[ "$PROJECT_TYPE" == "operator" ]]; then
            check_file="docs/CRD_REFERENCE.md"
            rec="recommended"
        elif [[ "$PROJECT_TYPE" == "cli-go" ]] || [[ "$PROJECT_TYPE" == "cli-python" ]] || [[ "$PROJECT_TYPE" == "cli-node" ]] || [[ "$PROJECT_TYPE" == "cli-rust" ]]; then
            rec="recommended"
        fi
        results+=("$check_file:fail:$rec")
    fi

    # CONFIG - recommended if configurable or operator
    if [[ -f docs/CONFIG.md ]]; then
        results+=("docs/CONFIG.md:pass:conditional")
        ((score++))
    else
        local rec="optional"
        # Operators should document CRD spec fields
        [[ "$PROJECT_TYPE" == "operator" ]] && rec="recommended"
        [[ -f config.yaml ]] || [[ -d config ]] && rec="recommended"
        results+=("docs/CONFIG.md:fail:$rec")
    fi

    # TROUBLESHOOTING - recommended for production software
    if [[ -f docs/TROUBLESHOOTING.md ]]; then
        results+=("docs/TROUBLESHOOTING.md:pass:conditional")
        ((score++))
    else
        results+=("docs/TROUBLESHOOTING.md:fail:optional")
    fi

    # examples/ directory
    if [[ -d examples ]]; then
        results+=("examples/:pass:recommended")
        ((score++))
    else
        results+=("examples/:fail:optional")
    fi

    echo "$score:$total:${results[*]}"
}

# Parse tier results
parse_results() {
    local tier_data="$1"
    local score="${tier_data%%:*}"
    local rest="${tier_data#*:}"
    local total="${rest%%:*}"
    local items="${rest#*:}"
    echo "$score" "$total" "$items"
}

# Run checks
TIER1=$(check_tier1)
TIER2=$(check_tier2)
TIER3=$(check_tier3)

read -r T1_SCORE T1_TOTAL T1_ITEMS <<< "$(parse_results "$TIER1")"
read -r T2_SCORE T2_TOTAL T2_ITEMS <<< "$(parse_results "$TIER2")"
read -r T3_SCORE T3_TOTAL T3_ITEMS <<< "$(parse_results "$TIER3")"

TOTAL_SCORE=$((T1_SCORE + T2_SCORE + T3_SCORE))
TOTAL_POSSIBLE=$((T1_TOTAL + T2_TOTAL + T3_TOTAL))

# Output
if [[ "$JSON_OUTPUT" == "true" ]]; then
    # JSON output
    cat <<EOF
{
  "project": "$PROJECT_NAME",
  "type": "$PROJECT_TYPE",
  "languages": "$(echo $LANGUAGES | tr ' ' ',')",
  "tier1": {
    "score": $T1_SCORE,
    "total": $T1_TOTAL,
    "items": [$(echo "$T1_ITEMS" | tr ' ' '\n' | sed 's/\(.*\):\(.*\)/{"file":"\1","status":"\2"}/' | tr '\n' ',' | sed 's/,$//' )]
  },
  "tier2": {
    "score": $T2_SCORE,
    "total": $T2_TOTAL,
    "items": [$(echo "$T2_ITEMS" | tr ' ' '\n' | sed 's/\(.*\):\(.*\)/{"file":"\1","status":"\2"}/' | tr '\n' ',' | sed 's/,$//' )]
  },
  "tier3": {
    "score": $T3_SCORE,
    "total": $T3_TOTAL,
    "items": [$(echo "$T3_ITEMS" | tr ' ' '\n' | sed 's/\([^:]*\):\([^:]*\):\(.*\)/{"file":"\1","status":"\2","recommendation":"\3"}/' | tr '\n' ',' | sed 's/,$//' )]
  },
  "total_score": $TOTAL_SCORE,
  "total_possible": $TOTAL_POSSIBLE
}
EOF
else
    # Human-readable output
    echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}"
    echo -e "${BLUE}  OSS Documentation Audit: ${PROJECT_NAME}${NC}"
    echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}"
    echo ""
    echo -e "Project Type: ${YELLOW}$PROJECT_TYPE${NC}"
    echo -e "Languages: ${YELLOW}$LANGUAGES${NC}"
    echo ""

    # Tier 1
    echo -e "${BLUE}── Tier 1: Required ──${NC}"
    for item in $T1_ITEMS; do
        file="${item%%:*}"
        status="${item##*:}"
        if [[ "$status" == "pass" ]]; then
            echo -e "  ${GREEN}✓${NC} $file"
        else
            echo -e "  ${RED}✗${NC} $file"
        fi
    done
    echo -e "  Score: ${T1_SCORE}/${T1_TOTAL}"
    echo ""

    # Tier 2
    echo -e "${BLUE}── Tier 2: Standard ──${NC}"
    for item in $T2_ITEMS; do
        file="${item%%:*}"
        status="${item##*:}"
        if [[ "$status" == "pass" ]]; then
            echo -e "  ${GREEN}✓${NC} $file"
        else
            echo -e "  ${RED}✗${NC} $file"
        fi
    done
    echo -e "  Score: ${T2_SCORE}/${T2_TOTAL}"
    echo ""

    # Tier 3
    echo -e "${BLUE}── Tier 3: Enhanced ──${NC}"
    for item in $T3_ITEMS; do
        IFS=':' read -r file status rec <<< "$item"
        if [[ "$status" == "pass" ]]; then
            echo -e "  ${GREEN}✓${NC} $file"
        elif [[ "$rec" == "recommended" ]]; then
            echo -e "  ${YELLOW}✗${NC} $file (recommended)"
        else
            echo -e "  ${NC}○${NC} $file (optional)"
        fi
    done
    echo -e "  Score: ${T3_SCORE}/${T3_TOTAL}"
    echo ""

    # Summary
    echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}"
    echo -e "  Total Score: ${TOTAL_SCORE}/${TOTAL_POSSIBLE}"
    echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}"

    # Scaffold hint
    if [[ $TOTAL_SCORE -lt $TOTAL_POSSIBLE ]]; then
        echo ""
        echo "To scaffold missing files, ask the Doc skill (OSS pack) to create the ones you need."
    fi
fi
rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).Stars: 196kUpdated Claude CodeCodexUnverifiedInstall
doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.Stars: 196kUpdated Claude CodeCodexVerifiedInstall