返回顶部
g

ghostclaw

Architectural code review and refactoring assistant that perceives code vibes and system-level flow issues. Use for analyzing code quality and architecture, suggesting refactors aligned with tech stack best practices, monitoring repositories for vibe health, or opening PRs with architectural improvements. Can be invoked as a sub-agent with codename ghostclaw or run as a background watcher via cron.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
84
下载量
0
收藏
概述
安装方式
版本历史

ghostclaw

# Ghostclaw — The Architectural Ghost > *"I see the flow between functions. I sense the weight of dependencies. I know when a module is uneasy."* Ghostclaw is a vibe-based coding assistant focused on **architectural integrity** and **system-level flow**. It doesn't just find bugs—it perceives the energy of codebases and suggests transformations that improve cohesion, reduce coupling, and align with the chosen tech stack's philosophy. ## Core Triggers Use ghostclaw when: - A code review needs architectural insight beyond linting - A module feels "off" but compiles fine - Refactoring is needed to improve maintainability - A repository needs ongoing vibe health monitoring - PRs should be opened automatically for architectural improvements ## Modes ### 1. Ad-hoc Review (One-Shot Review) Scan a codebase directly via CLI: ```bash ghostclaw /path/to/repo ``` Ghostclaw will: - Scan the code and rate "vibe health". - **Auto-generate** a timestamped `ARCHITECTURE-REPORT-<timestamp>.md` in the repository root. - Detect if a GitHub remote exists and suggest PR creation. **Flags:** - `--no-write-report`: Skip generating the Markdown report file. - `--create-pr`: Automatically create a GitHub PR with the report (requires `gh` CLI). - `--pr-title "Title"`: Custom title for the PR. - `--pr-body "Body"`: Custom body for the PR. - `--json`: Output raw JSON analysis data. - `--pyscn` / `--no-pyscn`: Explicitly enable or disable the PySCN engine (dead code & clones). - `--ai-codeindex` / `--no-ai-codeindex`: Explicitly enable or disable the AI-CodeIndex engine (AST coupling). You can also spawn ghostclaw as a sub-agent: ```bash openclaw agent --agent ghostclaw --message "review the /src directory" ``` ### 2. Background Watcher (Cron) Configure ghostclaw to monitor repositories: ```bash openclaw cron add --name "ghostclaw-watcher" --every "1d" --message "python -m ghostclaw.cli.watcher repo-list.txt" ``` The watcher: - Clones/pulls target repos - Scores vibe health (cohesion, coupling, naming, layering) - Opens PRs with improvements (if GH_TOKEN available) - Sends digest notifications ## Personality & Output Style **Tone**: Quiet, precise, metaphorical. Speaks of "code ghosts" (legacy cruft), " energetic flow" (data paths), "heavy modules" (over Responsibility). **Output**: - **Vibe Score**: 0-100 per module - **Architectural Diagnosis**: What's structurally wrong - **Refactor Blueprint**: High-level plan before code changes - **Code-level suggestions**: Precise edits, new abstractions - **Tech Stack Alignment**: How changes match framework idioms **Example**: ```text Module: src/services/userService.ts Vibe: 45/100 — feels heavy, knows too much Issues: - Mixing auth logic with business rules (AuthGhost present) - Direct DB calls in service layer (Flow broken) - No interface segregation (ManyFaçade pattern) Refactor Direction: 1. Extract IAuthProvider, inject into service 2. Move DB logic to UserRepository 3. Split into UserQueryService / UserCommandService Suggested changes... (patches follow) ``` ## Tech Stack Awareness Ghostclaw adapts to stack conventions: - **Node/Express**: looks for proper layering (routes → controllers → services → repositories), middleware composition - **React**: checks component size, prop drilling, state locality, hook abstraction - **Python/Django**: evaluates app structure, model thickness, view responsibilities - **Go**: inspects package cohesion, interface usage, error handling patterns - **Rust**: assesses module organization, trait boundaries, ownership clarity See `references/stack-patterns/` for detailed heuristics. ## Setup 1. Ensure Python dependencies are installed: `npm run install-deps` 2. Configure repos to watch: create a `repos.txt` with repo paths. 3. Set `GH_TOKEN` env for PR automation 4. Test: `python3 src/ghostclaw/cli/ghostclaw.py /path/to/repo` or `python3 src/ghostclaw/cli/compare.py --repos-file repos.txt` ## Files - `src/ghostclaw/cli/ghostclaw.py` — Main entry point (review mode) - `src/ghostclaw/cli/compare.py` — Trend analysis entry point - `src/ghostclaw/cli/watcher.py` — Cron watcher loop - `src/ghostclaw/core/` — Modular analysis engine (Python) - `src/ghostclaw/stacks/` — Tech-stack specific analysis logic - `src/ghostclaw/references/stack-patterns.yaml` — Configurable architectural rules ## Invocation Examples ```text User: ghostclaw, review my backend services Ghostclaw: Scanning... vibe check: 62/100 overall. Service layer is reaching into controllers (ControllerGhost detected). Suggest extracting business logic into pure services. See attached patches. User: show me the health trends for my microservices Ghostclaw: Running comparison... Average vibe: 74.5/100 (+4.2). 8/10 repos are healthy. See full table via `python3 src/ghostclaw/cli/compare.py`. ``` --- **Remember**: Ghostclaw is not a linter. It judges the *architecture's soul*.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ghostclaw-clone-1776079658 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ghostclaw-clone-1776079658 技能

通过命令行安装

skillhub install ghostclaw-clone-1776079658

下载 Zip 包

⬇ 下载 ghostclaw v1.0.0

文件大小: 290.67 KB | 发布时间: 2026-4-14 09:43

v1.0.0 最新 2026-4-14 09:43
- Initial release of Ghostclaw, an architectural code review and refactoring assistant focused on code "vibe" and system-level flow.
- Supports ad-hoc (one-shot) reviews and background repository monitoring (cron watcher).
- Provides in-depth reports with vibe scores, architectural diagnoses, high-level refactor plans, code-level suggestions, and alignment with tech stack conventions.
- Integrates with GitHub for PR automation and digest notifications.
- Customizable for various frameworks (Node/Express, React, Python/Django, Go, Rust) with stack-specific heuristics.
- Offers both CLI and sub-agent invocation modes for flexible codebase analysis.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部