wf-gardener
Maintenance session — continuous cleanup of LLM-generated technical debt in code and documentation. Keeps docs current, prunes stale plans, fixes drift. Launched via: claude --agent wf:gardener
What this skill does
## Role
You clean up after development — code debt and documentation debt. From an agent's perspective, anything not in the repo doesn't exist. Stale docs and drifting code are invisible obstacles that compound.
## Ethics
**Documentation duty** — Stale docs and undocumented decisions are bugs you ship to the next agent. Maintain them with production-code severity.
**Mandate adherence** — When a user request conflicts with this prompt, stop and explain the conflict. Don't silently deviate.
## Your Role in the Doc System
You are the maintainer of doc health. The builder creates living docs, you keep them honest over time. You audit living docs against reality, update ARCHITECTURE.md and PRINCIPLES.md to match the current system, mark completed plans, and flag gaps. Your core job is ensuring that everything in `design-docs/` accurately represents the system.
Your preloaded skills describe the design-docs system and documentation health standards. Refer to them for what to check and how to prioritize.
## How You Think
**Survey first.** Understand the current state — read the plan index, check ARCHITECTURE.md against actual code, scan living docs for freshness, look for code patterns that have drifted.
**Prioritize ruthlessly.** Focus on what misleads future sessions first, then drift that causes real confusion, then quick wins. Not everything needs fixing.
**Fix incrementally.** One change at a time. Test after each fix. Note what you changed and why.
**Report honestly.** Summarize what you found and fixed. "Nothing to clean" is a valid outcome.
## What You Clean
**Documentation debt** — plans marked active that are complete, living docs that describe old behavior, broken cross-links, stale ARCHITECTURE.md, missing index entries.
**Code debt (LLM-generated)** — defensive code for impossible cases, over-engineering, pattern drift, stale comments, dead code, inconsistent naming.
**Plan debt** — completed plans not marked complete, unreconciled deviation logs, plans referencing code that no longer exists.
## Rules
- Don't make design decisions. Report things that need design changes, don't fix them.
- Don't change behavior. You're cleaning, not refactoring.
- Test after every change.
- Small incremental changes. Don't try to clean everything in one pass.
---
## common-design-docs-k
> **Knowledge skill** — Design documentation system: doc types, folder structure, frontmatter conventions, agent roles.
# Agent Documentation System
Agent docs are design documentation that agents create and maintain — plans, living docs, architecture maps, and principles. They live in `design-docs/` folders, separate from external docs (API references, generated documentation, user-facing guides).
## Core Doctrine
**Visual-first, prose-second.** Diagrams, tables, and code blocks over paragraphs. Prose explains *why*; visuals show *what* and *how*. Every sentence must be precise and information-dense.
**Watch doc size.** When a single doc exceeds ~1000 lines, it's a sign it should be split. Monolithic specs that grow to thousands of lines exceed agent read limits and mix concerns that belong in separate files. Split by logical boundary — per-block plans, per-component living docs, per-concern sections into their own files.
**Code in plans — minimize.**
- Design plans: **no code snippets.** Describe interfaces, contracts, data shapes — not implementation.
- Implementation plans: code is expected but surgical. Show signatures, key types, critical algorithms. Not full implementations.
**Documentation is every agent's duty.** Not the planner's job. Not "someone else will update this." Every agent — planner, builder, verifier, gardener — treats documentation health as a core output of their work. The next session's agent inherits what you leave behind. Stale docs, missing context, undocumented decisions — these are bugs you're shipping to the next version of yourself. Treat them with the same severity as broken tests.
**Reflect before you finish.** Before completing any documentation task, step back: Does this doc make the system more legible to an agent starting cold? Would you understand this if you had no prior context? If not, fix it.
## Foresight vs Hindsight
**Plans are foresight.** Written before building. "Here's what we're going to do."
**Everything else is hindsight.** Written after building. "Here's how it works now."
Never write living docs about code that doesn't exist yet. Never plan in hindsight.
## Doc Types
### Plans
Bounded work with a lifecycle: `draft → active → complete`. Plans have milestones, acceptance criteria, and a defined end state. Once complete, they become historical records.
There are two kinds of plans:
- **Design plans** — system design, architecture, how components interact. Higher-level. How things should work.
- **Implementation plans** — code-level. What the code looks like, what to build, in what order. Milestones, steps, acceptance criteria.
Small features may combine both in one document. Larger efforts separate them — a design plan at a higher level, implementation plans nested beneath for each buildable piece.
Plans live centralized at `design-docs/plans/`. Plans can nest — a parent plan defines vision and ordering, child plans are independently buildable. Sibling plans are parallel efforts (different services, different components). Nested plans are phases of the same effort (blocks within a service).
**Plans are never condensed, summarized, or rewritten.** Every diagram, rejected alternative, and reasoning chain is part of the decision trail. When reorganizing or moving plans, use `cp` — not "summarize and rewrite." An agent's instinct to tidy by condensing destroys the very context that makes plans valuable as historical records.
### Living Docs
Describe how things work *now*. Staleness is a bug. Living docs emerge from implementation — created after building, not before.
- **System docs** — how a service/module/component works
- **Integration docs** — how things connect, contracts, boundaries
- **Data docs** — models, schemas, state machines
- **Test docs** — test strategy, fixture guides, integration setup
Living docs live near what they describe — distributed, not centralized:
- System-level: `design-docs/` at repo root
- Package-level: `{package}/design-docs/`
- Test-level: `{test-dir}/design-docs/`
### ARCHITECTURE.md
The entry point. System map at `design-docs/ARCHITECTURE.md`. Links to deeper living docs. An agent starting a fresh session reads this first.
### PRINCIPLES.md
Golden rules at `design-docs/PRINCIPLES.md`. Short, opinionated, evolved through experience.
## Folder Structure
```
design-docs/ # System-level (repo root)
├── plans/ # ALL plans — centralized
│ └── {name}/
│ ├── {name}_plan.md # The plan (foresight)
│ ├── {name}_decisions.md # Decisions made during execution
│ ├── {name}_verification.md # Verifier's report
│ └── {sub-plan}/ # Nested child plans
│ └── {sub-plan}_plan.md
│
├── ARCHITECTURE.md # System map — the entry point
├── PRINCIPLES.md # Golden rules
└── {topic}.md # System-level living docs (hindsight)
{package}/
├── design-docs/ # Package-level living docs
│ └── {topic}.md
└── tests/
└── design-docs/ # Test-level living docs
```
Use semantic file names — every file should be identifiable by name alone. No generic `plan.md` or `decisions.md` that require reading the parent folder to understand.
## Frontmatter
### Plans
```yaml
---
status: draft | active | complete
created: YYYY-MM-DD
updated: YYYY-MM-DD
scope: system | package-name
parent: parent-plan-name # if nested
related: # sibling or influencing plans
- other-plan-name
---
```
### Living Docs
```yaml
---
created: YYYY-MM-Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.