スキル一覧に戻る
brainbloodbarrier

code-maintainer

by brainbloodbarrier

The CCleaner Killer - A Claude Code project for system cleanup without the bloat. No persistent daemons, just clean.

0🍴 0📅 2026年1月9日
GitHubで見るManusで実行

SKILL.md


name: code-maintainer description: Fix bugs, optimize performance, and maintain code quality in CClean-Killer. Use when asked to fix detection issues, false positives, false negatives, optimize scan speed, improve performance, refactor code, or do quick maintenance tasks like version bumps or linting. allowed-tools: Read, Grep, Glob, Bash, Edit, Write

Code Maintainer

Fix bugs, optimize performance, and maintain code quality in the CClean-Killer codebase.

Purpose

Handle day-to-day development tasks:

  • Fix detection issues (false positives/negatives)
  • Optimize script performance
  • Quick maintenance tasks

Modes

Mode: fix

Debug and fix detection issues including false positives and false negatives.

When to use: User says "fix detection", "false positive", "false negative", "not detecting", "wrongly detecting"

Workflow:

  1. Diagnose Phase

    • Identify the specific issue (FP or FN)
    • Run detection with verbose output:
      ./scripts/macos/find-parasites.sh --verbose 2>&1 | grep -i "[pattern]"
      ./scripts/macos/find-orphans.sh --verbose 2>&1 | grep -i "[pattern]"
      
    • Check pattern matching logic in script
  2. Trace Phase

    • Read the detection function in scripts/macos/find-parasites.sh
    • Check is_known_parasite() function
    • Verify bundle ID extraction from plist
    • Check skip patterns in scripts/macos/lib/common.sh
  3. Fix Phase

    • For false positive: Add to skip patterns or refine match
    • For false negative: Add/fix pattern in KNOWN_PARASITES array
    • Update knowledge/parasite-fingerprints.json if needed
  4. Verify Phase

    • Run tests:
      npm run test:unit
      
    • Verify fix works on real data

Files Modified:

  • scripts/macos/find-parasites.sh
  • scripts/macos/find-orphans.sh
  • scripts/macos/lib/common.sh (SKIP_PATTERNS)
  • knowledge/parasite-fingerprints.json
  • tests/unit/test-parasite-patterns.sh

Common Issues:

IssueLocationFix
Pattern too broadKNOWN_PARASITES arrayMake pattern more specific
Pattern too narrowKNOWN_PARASITES arrayUse broader glob pattern
Wrong bundle ID extractionget_bundle_id_from_plist()Fix plist parsing
App check failingapp_exists_for_agent()Fix mdfind or /Applications check
Safe item flaggedSKIP_PATTERNSAdd to skip list

Mode: optimize

Improve performance of scanning and detection scripts.

When to use: User says "optimize", "slow scan", "improve performance", "speed up", "benchmark"

Workflow:

  1. Profile Phase

    • Run benchmark:
      time ./scripts/macos/scan.sh --dry-run
      time ./scripts/macos/find-parasites.sh --dry-run
      
    • Identify slow operations
  2. Analyze Phase

    • Check for:
      • Repeated file system operations
      • Inefficient loops
      • Missing caching
      • Sequential operations that could be parallel
    • Reference scripts/macos/lib/optimized-patterns.sh for existing optimizations
  3. Implement Phase

    • Apply optimization techniques:
      # Cache app list instead of repeated mdfind
      declare -A APP_CACHE
      
      # Use find with -prune for skipping
      find "$dir" -name ".git" -prune -o -type f -print
      
      # Parallel processing
      find ... | xargs -P 4 ...
      
  4. Benchmark Phase

    • Compare before/after:
      ./scripts/benchmark.sh --compare
      
    • Document improvement in docs/OPTIMIZATION-REPORT.md

Files Modified:

  • scripts/macos/*.sh
  • scripts/macos/lib/common.sh
  • scripts/macos/lib/optimized-patterns.sh
  • docs/OPTIMIZATION-REPORT.md

Optimization Techniques:

TechniqueWhen to UseExample
Associative arraysRepeated lookupsdeclare -A cache
Find with -pruneSkip directories-name ".git" -prune
Parallel xargsIndependent operationsxargs -P 4
Early terminationFirst match sufficientreturn after match
CachingExpensive repeated callsCache mdfind results

Mode: maintain

Quick maintenance tasks: version bumps, linting, syncing, cleanup.

When to use: User says "bump version", "lint", "sync json", "cleanup", "maintenance"

Quick Tasks:

  1. Version Bump

    # Update version in package.json
    npm version patch  # or minor/major
    
  2. Lint Scripts

    # Check shell scripts
    shellcheck scripts/macos/*.sh scripts/macos/lib/*.sh
    
  3. Sync JSON Database

    • Ensure parasite-fingerprints.json matches common-parasites.md
    • Update totalParasites count
    • Update lastUpdated date
  4. Validate Configs

    # Check JSON syntax
    jq . knowledge/parasite-fingerprints.json > /dev/null
    
    # Check all scripts are executable
    find scripts -name "*.sh" ! -executable
    
  5. Clean Temp Files

    rm -f scripts/**/*.bak
    rm -f **/*.tmp
    

Files Modified:

  • package.json (version)
  • knowledge/parasite-fingerprints.json (metadata)
  • Various (linting fixes)

Safety Rules

  1. ALWAYS run tests after fixes
  2. NEVER remove safety checks during optimization
  3. PRESERVE backward compatibility in function signatures
  4. VERIFY optimizations don't change output
  5. DOCUMENT non-obvious optimizations with comments

Debugging Commands

# Verbose detection output
./scripts/macos/find-parasites.sh --verbose

# Dry run (no changes)
./scripts/macos/clean.sh --dry-run --all

# JSON output for parsing
./scripts/macos/scan.sh --json | jq .

# Test specific pattern
grep -r "com.example" knowledge/

# Check if pattern matches
[[ "com.google.keystone.agent" == com.google.* ]] && echo "matches"

Examples

Example 1: Fix false positive

User: "Google Chrome is being flagged as a parasite but it's installed"

1. Check detection: ./scripts/macos/find-parasites.sh --verbose | grep google
2. Find: com.google.keystone.agent flagged as zombie
3. Trace: app_exists_for_agent() not finding Chrome.app
4. Fix: Update app detection to check "Google Chrome.app"
5. Verify: Run detection again, no longer flagged

Example 2: Optimize slow scan

User: "Scanning takes 30 seconds, can we speed it up?"

1. Profile: time ./scripts/macos/scan.sh shows 25s in du calls
2. Analyze: Repeated du on same directories
3. Implement: Cache directory sizes in associative array
4. Benchmark: New time is 8 seconds
5. Document in OPTIMIZATION-REPORT.md
  • knowledge-manager: For adding new parasites after fixing detection
  • quality-assurance: For adding regression tests after fixes

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です