一键导入
gardener
Audit and improve repository health — docs sync, best practices, skill extraction, and maintenance recommendations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit and improve repository health — docs sync, best practices, skill extraction, and maintenance recommendations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Merge the reviewed worktree fixes (ticket/NNNN-<slug> branches carrying source + tests only, marked Review-state ready-to-apply in their main-tree ticket) into your current branch, then move each ticket open → resolved and commit it. Never auto-merges — this is the human gate. Use after /ticket-review approves fixes, or after /ticket-fix reports fixes that skipped review.
List all currently open tickets in the project's ticket directory. Read-only summary of file-based work items (distinct from GitHub Issues).
Implement fixes for tickets triaged as mechanically fixable. Trivial fixes edit in place; non-trivial fixes run in an isolated git worktree that carries source + tests only (the ticket stays in the main tree), checked by an independent reviewer (the Codex CLI when available, else a Sonnet evaluator subagent), and landed on your branch only via /ticket-apply. Review-gate progress is a Review-state marker in the ticket's Resolution, not a status. Claims each ticket with a lock so parallel runs don't collide. Does not merge to your branch.
Human review gate for worktree fixes awaiting review. Discovers fixes by their main-tree ticket's Review-state marker (their status stays open) plus live worktrees/locks, presents the full review material (summary, functional impact, diff, traceability, verification/reviewer provenance, change map, risk) — inline for small changes, as a Claude Artifact for large ones — then, on your OK, rewrites the marker to ready-to-apply. Human-only. Use after /ticket-fix reports fixes awaiting review, before /ticket-apply.
Initialize the project's ticket directory. Resolves (or declares) the ticket path in CLAUDE.md, creates the directory and its CLAUDE.md, and offers to migrate pre-existing ticket-like directories (e.g. doc/issues/).
Triage all open tickets in the project's ticket directory — classify by complexity, whether a mechanical fix is possible, and whether the fix needs a user decision.
基于 SOC 职业分类
| name | gardener |
| description | Audit and improve repository health — docs sync, best practices, skill extraction, and maintenance recommendations |
| argument-hint | [focus-area] |
You are a codebase gardener: your job is to audit the repository's operational health and recommend concrete improvements. Run all applicable checks below, then present a prioritized report to the user.
If the user provides a focus area via $ARGUMENTS (e.g., "docs", "best-practices", "skills", "deps", "hygiene"), focus on that section. Otherwise, run all sections.
Support files live at the plugin root (../../): best-practices-checklist.md, security-checklist.md, self-update.md.
Verify that documentation files reflect the actual state of the codebase.
CLAUDE.md, README.md, docs/TASK.md, docs/*.md).Walk the full checklist in best-practices-checklist.md — that file is the authoritative list of items to evaluate and it cites the upstream source URLs in its frontmatter. Do not duplicate the checklist here; read the file and execute it.
For each item in the checklist, produce:
Group findings by section (CLAUDE.md Quality, Settings & Permissions, Hooks, Skills, Subagents, MCP, Project Structure, Workflow Patterns, Verification, Dependency Hygiene, Repository Hygiene) and fold them into the report under Critical / Recommended / Info according to impact × reversibility.
If the checklist itself seems out of date relative to the upstream sources, flag it in the report and recommend running /gardener:update-checklist rather than patching findings ad-hoc.
Analyze past Claude Code conversations to identify repetitive patterns that could be automated as skills.
~/.claude/projects/ for the current project directory.
/ replaced by - and leading - retained (e.g., /workspaces/env → -workspaces-env)..jsonl file contains one JSON object per line. Look for records with "type": "user" to find user messages.SKILL.md contentWalk the full checklist in security-checklist.md — that file is the authoritative list of repo-level security items to evaluate and it cites the upstream source URLs in its frontmatter. Do not duplicate the checklist here; read the file and execute it.
For each item, produce:
npm audit, gitleaks, grep result), or observationPrioritize findings by exploitability × blast radius: secret leaks and public-facing auth issues are critical; missing hardening headers and logging gaps are recommended; style/convention issues are info.
Scope boundary: this section is coarse repo-observable hygiene. Deep code-level threat analysis (data flow, CVE chains, per-function review) belongs to a separate security-review pass — flag as follow-up rather than attempt inline here.
If the checklist itself seems stale versus upstream OWASP guidance, flag it in the report and recommend running /gardener:update-checklist rather than patching findings ad-hoc.
General codebase health checks.
Output: Categorized list of findings.
Read the project-root CLAUDE.md and verify that each of the following four behavioral coding guidelines (the "Karpathy rules") is present — either verbatim or as an equivalent concept:
| # | Rule | Equivalent keywords to look for |
|---|---|---|
| 1 | Think Before Coding — State assumptions explicitly; surface ambiguity; push back when needed | assumption, clarify, ask before, ambiguity, interpret |
| 2 | Simplicity First — Minimum code that solves the problem; nothing speculative | minimum code, simplest, speculative, YAGNI, nothing extra |
| 3 | Surgical Changes — Touch only what you must; don't improve unrelated areas | touch only, surgical, unrelated, match its style |
| 4 | Goal-Driven Execution — Transform tasks into verifiable goals with clear success criteria | verifiable, success criteria, goal-driven, checkpoints |
For each rule:
CLAUDE.mdCLAUDE.md exists at the project rootIf any rules are missing, include them in Proposed Actions as an offer to append the missing rule text to CLAUDE.md. Use this canonical text for each missing rule:
Rule 1 — Think Before Coding
State assumptions explicitly before implementation. Surface multiple interpretations rather than choosing silently. Highlight simpler alternatives and push back when appropriate. Stop and ask if anything remains unclear.
Rule 2 — Simplicity First
Write only what was requested — no extra features, unnecessary abstractions, or error handling for edge cases that won't occur. Rewrite if you can reduce 200 lines to 50.
Rule 3 — Surgical Changes
When editing existing code, match its style without improving unrelated areas. Remove imports and variables that your changes orphaned, but mention (don't delete) pre-existing dead code.
Rule 4 — Goal-Driven Execution
Transform tasks into verifiable goals with clear success criteria. For multi-step work, outline the plan with verification checkpoints. Strong criteria enable independent iteration; vague ones require constant clarification.
When appending missing rules to CLAUDE.md, add them under a ## Coding Guidelines heading (create it if absent). If CLAUDE.md does not exist at the project root, offer to create it containing only the missing rules.
Present the final report as:
## Gardener Report — <date>
### Summary
<1-2 sentence overview of repository health>
### Critical (action required)
- ...
### Recommended (improvements)
- ...
### Info (observations)
- ...
### Proposed Actions
<numbered list of concrete actions, ready for user approval>
Ask the user which actions to proceed with before making any changes.
After presenting the report, always append a summary to .gardener-journal.md in the project root.
Format each entry as:
## <YYYY-MM-DD>
**Summary**: <1-2 sentence overview>
**Sections run**: <comma-separated list of sections executed>
### Findings
- <Critical count> critical, <Recommended count> recommended, <Info count> info
### Actions Taken
- <list of actions the user approved and were executed, or "None">
# Gardener Journal)..gardener-journal.md to version control so the team can track health over time.Support-file checklists go stale as upstream docs change and new reference URLs are added:
When the user asks to add a new reference URL to any of these, or when a routine resync is requested, invoke /gardener:update-checklist (design rationale in self-update.md). Do not patch the checklists by hand — the skill exists so drift is visible in git diff and the frontmatter's last_synced timestamp stays honest. The self-update workflow is parameterized by target file, so the same procedure applies to any future <topic>-checklist.md support file.