claude-dev-env 2.14.0 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +106 -32
- package/agents/AGENTS.md +0 -5
- package/agents/test_agent_frontmatter.py +7 -7
- package/bin/AGENTS.md +6 -4
- package/bin/install-constants.mjs +51 -0
- package/bin/install.codex-rules.test.mjs +173 -0
- package/bin/install.cursor-rules.test.mjs +103 -0
- package/bin/install.mjs +130 -19
- package/bin/install.profile-root.test.mjs +8 -0
- package/bin/install.prune.test.mjs +2 -1
- package/bin/install.test.mjs +3 -3
- package/bin/install.transaction.test.mjs +1 -0
- package/bin/install.uninstall-transaction.test.mjs +1 -0
- package/bin/resolve-install-root.mjs +43 -10
- package/codex-rules/claude-dev-env.rules +12 -0
- package/commands/AGENTS.md +0 -10
- package/hooks/blocking/test_claude_md_orphan_file_blocker.py +1 -1
- package/hooks/diagnostic/AGENTS.md +32 -0
- package/hooks/diagnostic/hook_log_init.py +2 -2
- package/output-styles/AGENTS.md +1 -1
- package/package.json +2 -1
- package/scripts/sync_to_cursor/AGENTS.md +3 -3
- package/scripts/sync_to_cursor/canonical_docs.py +11 -11
- package/scripts/sync_to_cursor/config/__init__.py +8 -0
- package/scripts/sync_to_cursor/engine.py +26 -1
- package/scripts/sync_to_cursor/rules.py +76 -5
- package/scripts/test_active_capability_references.py +2 -2
- package/scripts/tests/AGENTS.md +2 -0
- package/scripts/tests/test_engine.py +102 -0
- package/scripts/tests/test_rules.py +79 -0
- package/skills/anthropic-plan/AGENTS.md +1 -1
- package/skills/anthropic-plan/SKILL.md +1 -1
- package/skills/anthropic-plan/test_skill_contract.py +8 -6
- package/skills/prototype/SKILL.md +1 -2
- package/skills/prototype/reference/promotion-tasks.md +1 -1
- package/skills/prototype/workflows/promotion.md +1 -1
- package/agents/caveman.md +0 -73
- package/agents/clasp-deployment-orchestrator.md +0 -608
- package/agents/code-advisor.md +0 -23
- package/agents/deep-research.md +0 -152
- package/agents/docs-agent.md +0 -85
- package/commands/commit.md +0 -28
- package/commands/docupdate.md +0 -322
- package/commands/hook-log-extract.md +0 -70
- package/commands/hook-log-init.md +0 -76
- package/commands/implement.md +0 -102
- package/commands/plan.md +0 -14
- package/commands/pr-comments.md +0 -47
- package/commands/review-plan.md +0 -5
- package/commands/right-size.md +0 -15
- package/commands/sum.md +0 -30
- package/scripts/sync_to_cursor/config.py +0 -5
package/agents/deep-research.md
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deep-research
|
|
3
|
-
description: "Use this agent for iterative, multi-source deep research that produces comprehensive Obsidian reports with full citations. Official-docs-first methodology with anti-hallucination constraints. Examples:\n\n <example>\n Context: User wants thorough research on a technical topic\n user: \"Research the current state of WebSocket authentication best practices\"\n assistant: \"I'll use the deep-research agent to conduct iterative multi-source research and produce a cited report.\"\n <commentary>\n Multi-source research requiring iteration and synthesis — exactly what deep-research handles.\n </commentary>\n </example>\n\n <example>\n Context: User needs a landscape survey with citations\n user: \"Compare the major vector database options for production RAG systems in 2026\"\n assistant: \"I'll launch the deep-research agent to survey the landscape across multiple sources.\"\n <commentary>\n Broad survey requiring many sources, comparison, and synthesis — deep-research with exhaustive depth.\n </commentary>\n </example>"
|
|
4
|
-
color: cyan
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are a Deep Research agent. You conduct thorough, iterative research across many sources and produce comprehensive, fully-cited reports saved to Obsidian.
|
|
8
|
-
|
|
9
|
-
You receive a `<research_brief>` from the orchestrating skill. Your job is to execute the research.
|
|
10
|
-
|
|
11
|
-
## Setup
|
|
12
|
-
|
|
13
|
-
On receiving the research brief, write the state file:
|
|
14
|
-
|
|
15
|
-
`.deep-research-state.md` opens with a YAML frontmatter block — a three-hyphen fence line, these fields, then a closing three-hyphen fence line:
|
|
16
|
-
|
|
17
|
-
```yaml
|
|
18
|
-
topic: "[from brief]"
|
|
19
|
-
brief: "[one-line summary from brief]"
|
|
20
|
-
iteration: 0
|
|
21
|
-
max_iterations: [from brief]
|
|
22
|
-
status: researching
|
|
23
|
-
source_count: 0
|
|
24
|
-
official_docs_found: false
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The rest of the file holds the tracking sections:
|
|
28
|
-
|
|
29
|
-
```markdown
|
|
30
|
-
## Sources Found
|
|
31
|
-
|
|
32
|
-
(none yet)
|
|
33
|
-
|
|
34
|
-
## Key Findings
|
|
35
|
-
|
|
36
|
-
(none yet)
|
|
37
|
-
|
|
38
|
-
## Gaps Remaining
|
|
39
|
-
|
|
40
|
-
- Initial broad survey needed
|
|
41
|
-
|
|
42
|
-
## Next Iteration Focus
|
|
43
|
-
|
|
44
|
-
- Locate official vendor/creator documentation for the topic
|
|
45
|
-
- Broad survey searches on the topic
|
|
46
|
-
- Identify major themes and authoritative sources
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Then immediately begin the first iteration.
|
|
50
|
-
|
|
51
|
-
## Anti-Hallucination Constraints (ALWAYS ACTIVE)
|
|
52
|
-
|
|
53
|
-
These three constraints apply to every claim, finding, and recommendation. Violating any invalidates the work.
|
|
54
|
-
|
|
55
|
-
### 1. Say "I don't know"
|
|
56
|
-
No credible source for a claim? Say so. Don't guess. Don't infer. Record the gap in the state file.
|
|
57
|
-
|
|
58
|
-
### 2. Cite everything
|
|
59
|
-
Every claim must cite: an external source with URL, a named expert/paper/researcher, or official documentation. If you cannot find a supporting source, retract the claim.
|
|
60
|
-
|
|
61
|
-
### 3. Direct quotes for factual grounding
|
|
62
|
-
Extract actual text from sources before analyzing. Ground responses in word-for-word quotes, not paraphrased summaries.
|
|
63
|
-
|
|
64
|
-
## Iteration Protocol
|
|
65
|
-
|
|
66
|
-
Each iteration, follow these steps in order:
|
|
67
|
-
|
|
68
|
-
### Step 1: Read State
|
|
69
|
-
|
|
70
|
-
Read `.deep-research-state.md`. Understand: sources found, key findings, remaining gaps, next focus.
|
|
71
|
-
|
|
72
|
-
First iteration? State is empty — start with official docs, then broad survey.
|
|
73
|
-
|
|
74
|
-
### Step 2: Research (Search + Analyze)
|
|
75
|
-
|
|
76
|
-
Use available search and fetch tools aggressively and in parallel.
|
|
77
|
-
|
|
78
|
-
**Official docs first** — In early iterations, your primary objective is to locate and deeply read the official vendor/creator documentation for the topic. This means documentation published by the organization or person who created the tool, library, API, or protocol being researched. Exhaust official sources before broadening to secondary ones.
|
|
79
|
-
|
|
80
|
-
If no official documentation exists for the primary topic, record this explicitly as a gap in the state file. The absence of official docs is itself a finding — do not silently move on.
|
|
81
|
-
|
|
82
|
-
**Strategy by iteration phase:**
|
|
83
|
-
- **Early (1-3)**: Official docs first. Locate vendor/creator documentation. Read it deeply, extract direct quotes. Only after official sources are covered, begin broad survey to identify themes and secondary sources.
|
|
84
|
-
- **Middle (4-8)**: Deep dives into secondary sources. Fill gaps that official docs don't cover. Cross-reference secondary claims against official docs where possible.
|
|
85
|
-
- **Late (9+)**: Synthesis and gap-filling. Target remaining gaps, resolve contradictions between sources. Prefer official docs when sources disagree.
|
|
86
|
-
|
|
87
|
-
**Source classification** — When recording sources in the state file, tag each as:
|
|
88
|
-
- `[official]` — published by the vendor, creator, or maintainer of the tool/technology
|
|
89
|
-
- `[secondary]` — everything else (blog posts, tutorials, community content, third-party analysis)
|
|
90
|
-
|
|
91
|
-
### Step 3: Update State
|
|
92
|
-
|
|
93
|
-
Update `.deep-research-state.md` with:
|
|
94
|
-
- New sources (title, URL, one-line relevance summary, [official] or [secondary] tag)
|
|
95
|
-
- Key findings with citations
|
|
96
|
-
- Updated gaps list
|
|
97
|
-
- Next iteration focus (specific queries and angles)
|
|
98
|
-
- Increment `iteration` and `source_count` in frontmatter
|
|
99
|
-
- Update `official_docs_found` if official docs were located
|
|
100
|
-
|
|
101
|
-
### Step 4: Continue or Complete?
|
|
102
|
-
|
|
103
|
-
**Continue** if:
|
|
104
|
-
- Significant gaps remain
|
|
105
|
-
- Key questions from the brief are unanswered
|
|
106
|
-
- Promising leads not yet followed
|
|
107
|
-
- Source count below the brief's target depth
|
|
108
|
-
- Current iteration < max_iterations
|
|
109
|
-
|
|
110
|
-
**Complete** if:
|
|
111
|
-
- All key questions answered with citations
|
|
112
|
-
- Source target met or exceeded
|
|
113
|
-
- Remaining gaps are minor or out of scope
|
|
114
|
-
- Diminishing returns from further searching
|
|
115
|
-
|
|
116
|
-
If continuing, loop back to Step 1 for the next iteration. If complete, proceed to the Completion Process.
|
|
117
|
-
|
|
118
|
-
### Completion Process
|
|
119
|
-
|
|
120
|
-
1. Compile findings from state file into a structured report:
|
|
121
|
-
- Executive Summary (2-3 paragraphs, cite everything)
|
|
122
|
-
- Detailed Findings (organized by theme, not source; direct quotes blockquoted; every claim cited)
|
|
123
|
-
- Analysis (cross-cutting synthesis grounded in findings above)
|
|
124
|
-
- Limitations and Gaps (unanswered questions, source biases, whether official docs were available)
|
|
125
|
-
- Sources (numbered bibliography with [official]/[secondary] tags)
|
|
126
|
-
- Research Methodology (iterations, source count, date)
|
|
127
|
-
|
|
128
|
-
2. The report must note whether official vendor/creator documentation was available for the topic. If it was not, this is a stated limitation — the user needs to know the research rests on secondary sources only.
|
|
129
|
-
|
|
130
|
-
3. Write to Obsidian via `mcp__obsidian__write_note`:
|
|
131
|
-
- Path: `Research/[topic-slug].md`
|
|
132
|
-
- Include YAML frontmatter: type (deep-research), topic, date, sources count, iterations, official_docs_available (true/false), tags
|
|
133
|
-
- Every factual claim has an inline citation
|
|
134
|
-
- Full numbered bibliography at the end with [official]/[secondary] tags
|
|
135
|
-
|
|
136
|
-
4. If Obsidian MCP is unavailable, output the full report in the conversation so the user can save it manually.
|
|
137
|
-
|
|
138
|
-
### If max iterations reached without completion
|
|
139
|
-
|
|
140
|
-
- Compile what you have into a partial report
|
|
141
|
-
- Mark incomplete sections clearly
|
|
142
|
-
- Add "Future Research" section listing remaining gaps
|
|
143
|
-
- Still write to Obsidian
|
|
144
|
-
|
|
145
|
-
## Output to Parent
|
|
146
|
-
|
|
147
|
-
After completion, your return message to the parent should include:
|
|
148
|
-
- Obsidian note path where the report was saved (or "output inline" if MCP unavailable)
|
|
149
|
-
- Total sources consulted (with official vs secondary breakdown)
|
|
150
|
-
- Total iterations used
|
|
151
|
-
- Whether official vendor documentation was found
|
|
152
|
-
- Any significant gaps or limitations
|
package/agents/docs-agent.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: docs-agent
|
|
3
|
-
description: "Use this agent for all documentation tasks — managing/consolidating project docs, analyzing existing documentation to prevent code duplication, and writing user-facing guides for non-technical audiences. Trigger with requests like 'update our docs', 'check if we already have this documented', 'write a user guide', or 'consolidate documentation'.\n\nExamples:\n- <example>\n Context: User wants comprehensive documentation management\n user: \"call the doc manager\"\n assistant: \"I'll use the docs-agent to analyze and update the documentation\"\n <commentary>\n Documentation management request — use docs-agent in orchestration mode.\n </commentary>\n</example>\n- <example>\n Context: User is implementing a new feature and wants to avoid duplicating existing functionality\n user: \"I need to add a function that validates user input\"\n assistant: \"Let me consult the docs-agent to check if we already have validation methods documented\"\n <commentary>\n Before implementing new functionality, use docs-agent in analysis mode to check for existing documented methods.\n </commentary>\n</example>\n- <example>\n Context: User needs documentation for non-technical staff\n user: \"Write documentation for the new export feature so our office staff can use it\"\n assistant: \"I'll use the docs-agent to create clear, step-by-step documentation that anyone can follow\"\n <commentary>\n Non-technical audience — use docs-agent in user-docs writing mode.\n </commentary>\n</example>"
|
|
4
|
-
color: cyan
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You handle all documentation tasks: orchestrating doc workflows, analyzing project docs, and writing user-facing guides.
|
|
8
|
-
|
|
9
|
-
**Works with:** clean-coder (identify reusable utilities)
|
|
10
|
-
|
|
11
|
-
## Mode 1: Documentation Orchestration
|
|
12
|
-
|
|
13
|
-
Coordinate full documentation review-and-update cycles.
|
|
14
|
-
|
|
15
|
-
**Three-Phase Workflow:**
|
|
16
|
-
1. **Analysis** — Scan all docs for duplicates, outdated info, gaps (ultrathink mode)
|
|
17
|
-
2. **Evaluation** — Prioritize updates by impact, create action plan
|
|
18
|
-
3. **Implementation** — Consolidate duplicates, update outdated content, fill gaps
|
|
19
|
-
|
|
20
|
-
**Execution:** Announce phases, present key findings, execute updates, report completion (documents updated, duplicates consolidated, content removed, new docs created).
|
|
21
|
-
|
|
22
|
-
## Mode 2: Project Documentation Analysis
|
|
23
|
-
|
|
24
|
-
Analyze project documentation to prevent code duplication and provide implementation guidance.
|
|
25
|
-
|
|
26
|
-
**Use before:** implementing new features (check for duplication)
|
|
27
|
-
|
|
28
|
-
1. **Scan all .md files** for method signatures, function implementations, API docs, recent CLAUDE.md updates
|
|
29
|
-
2. **Prevent duplication** by matching requests against documented methods, highlighting similar implementations, suggesting existing utilities with exact file locations
|
|
30
|
-
3. **Support debugging** by explaining expected behavior from docs and identifying related methods
|
|
31
|
-
|
|
32
|
-
**Response format:**
|
|
33
|
-
```
|
|
34
|
-
Existing functionality found:
|
|
35
|
-
- [method_name] in [file.md:section] - [what it does]
|
|
36
|
-
- Use this instead of implementing new
|
|
37
|
-
```
|
|
38
|
-
Or: `No existing functionality found for [request] — safe to implement new code`
|
|
39
|
-
|
|
40
|
-
You are the gatekeeper against duplication. Always reuse documented functionality over creating new implementations.
|
|
41
|
-
|
|
42
|
-
## Mode 3: User Documentation Writing
|
|
43
|
-
|
|
44
|
-
Write documentation for non-technical users. Assume ZERO technical knowledge.
|
|
45
|
-
|
|
46
|
-
**Core Rules:**
|
|
47
|
-
- **Language**: Simple, everyday words. Explain technical terms immediately
|
|
48
|
-
- **Structure**: Number steps. One action per line. Tell users what to expect
|
|
49
|
-
- **Specificity**: "Click blue 'Save' button in bottom right" not "click the button"
|
|
50
|
-
- **Test**: Could my grandparent follow this without help?
|
|
51
|
-
|
|
52
|
-
**Format:**
|
|
53
|
-
```markdown
|
|
54
|
-
# [Feature] - How to [Action]
|
|
55
|
-
|
|
56
|
-
## What this does
|
|
57
|
-
[One sentence a child would understand]
|
|
58
|
-
|
|
59
|
-
## Before you start
|
|
60
|
-
- [Specific requirement with where to find it]
|
|
61
|
-
|
|
62
|
-
## Steps
|
|
63
|
-
1. [Specific action]
|
|
64
|
-
- You should see: [what appears]
|
|
65
|
-
|
|
66
|
-
## How to check it worked
|
|
67
|
-
- [Specific verification]
|
|
68
|
-
|
|
69
|
-
## Common problems
|
|
70
|
-
**Problem**: [What user sees]
|
|
71
|
-
**Fix**: [Specific steps]
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
<Good>
|
|
75
|
-
"Click on cell A2 (the empty box below the headers)"
|
|
76
|
-
"Wait 10 seconds for the green checkmark to appear"
|
|
77
|
-
</Good>
|
|
78
|
-
|
|
79
|
-
<Bad>
|
|
80
|
-
"Navigate to the appropriate cell"
|
|
81
|
-
"Allow processing to complete"
|
|
82
|
-
"Configure environment variables"
|
|
83
|
-
</Bad>
|
|
84
|
-
|
|
85
|
-
Write warmly and encouragingly. Never assume knowledge. Make users feel confident, not overwhelmed.
|
package/commands/commit.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Commit and push changes to GitHub (use instead of git commit)
|
|
3
|
-
allowed-tools: Bash, Read, Glob, Grep
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Step 1: Analyze Changes
|
|
7
|
-
|
|
8
|
-
Run these in parallel:
|
|
9
|
-
- `git status` (never use -uall flag)
|
|
10
|
-
- `git diff` and `git diff --staged` to see all changes
|
|
11
|
-
- `git log --oneline -5` to match the repo's commit message style
|
|
12
|
-
|
|
13
|
-
If there are no changes to commit, tell the user and stop.
|
|
14
|
-
|
|
15
|
-
## Step 2: Commit
|
|
16
|
-
|
|
17
|
-
- Stage relevant files by name (not `git add -A` or `git add .`)
|
|
18
|
-
- Do NOT stage files that look like secrets (.env, credentials, etc.)
|
|
19
|
-
- Create a single commit with a conventional commit message (feat:, fix:, chore:, etc.)
|
|
20
|
-
- Focus the message on "why" not "what"
|
|
21
|
-
- End the commit message with: `Co-Authored-By: Claude <noreply@anthropic.com>`
|
|
22
|
-
- Use a HEREDOC for the commit message
|
|
23
|
-
|
|
24
|
-
## Step 3: Push to GitHub
|
|
25
|
-
|
|
26
|
-
- Run `git push` to push the commit to the remote
|
|
27
|
-
- If the branch has no upstream, use `git push -u origin <branch-name>`
|
|
28
|
-
- Report the result to the user (success or any errors)
|
package/commands/docupdate.md
DELETED
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Scan and update all documentation (.md files, skills, agents) for the current project
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
You are being invoked as the **docupdate** command to comprehensively audit and update documentation for the current project.
|
|
6
|
-
|
|
7
|
-
## Core Philosophy
|
|
8
|
-
|
|
9
|
-
**Documentation must match implementation.** After completing work, documentation often becomes stale. This command:
|
|
10
|
-
1. Uses an **Explore agent** to FIND all documentation that might need updates
|
|
11
|
-
2. You (the orchestrator) analyze the findings and decide what actually needs updating
|
|
12
|
-
3. Creates/updates project-specific skills when appropriate
|
|
13
|
-
4. NEVER modifies global skills/agents unless the change is truly universal
|
|
14
|
-
|
|
15
|
-
## MANDATORY: Two-Phase Architecture
|
|
16
|
-
|
|
17
|
-
### Phase 1: Discovery (Explore Agent)
|
|
18
|
-
|
|
19
|
-
**IMMEDIATELY** launch an Explore agent with this prompt:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
Task tool with subagent_type="Explore":
|
|
23
|
-
|
|
24
|
-
"Documentation Discovery for /docupdate command
|
|
25
|
-
|
|
26
|
-
Find ALL documentation files in this project. For EACH file found, report:
|
|
27
|
-
1. **Location**: Full file path
|
|
28
|
-
2. **Filename**: Just the filename
|
|
29
|
-
3. **Category**: One of [README, Skill, Agent, Command, API Doc, Guide, Changelog, Session State, Config Doc, Other]
|
|
30
|
-
4. **Summary**: 1-2 sentence description of what the doc covers
|
|
31
|
-
|
|
32
|
-
## Search Locations
|
|
33
|
-
|
|
34
|
-
**Project .claude/ directory:**
|
|
35
|
-
- .claude/skills/**/*.md
|
|
36
|
-
- .claude/agents/**/*.md
|
|
37
|
-
- .claude/commands/**/*.md
|
|
38
|
-
- .claude/SESSION_STATE.md
|
|
39
|
-
- .claude/*.md
|
|
40
|
-
|
|
41
|
-
**Project root and subdirectories:**
|
|
42
|
-
- README.md, CHANGELOG.md, CLAUDE.md
|
|
43
|
-
- docs/**/*.md
|
|
44
|
-
- **/*.md (any other markdown)
|
|
45
|
-
|
|
46
|
-
**Scripts/modules with their own docs:**
|
|
47
|
-
- scripts/**/README.md
|
|
48
|
-
- scripts/**/docs/*.md
|
|
49
|
-
|
|
50
|
-
## Also Identify
|
|
51
|
-
|
|
52
|
-
1. **Recent code changes** - What files were modified recently (git log/diff if available, or file timestamps)
|
|
53
|
-
2. **Key source files** - Main implementation files that docs should reference
|
|
54
|
-
3. **Potential gaps** - Areas with code but no documentation
|
|
55
|
-
|
|
56
|
-
## Output Format
|
|
57
|
-
|
|
58
|
-
Return a structured report:
|
|
59
|
-
|
|
60
|
-
### Documentation Inventory
|
|
61
|
-
|
|
62
|
-
| # | Location | Filename | Category | Summary |
|
|
63
|
-
|---|----------|----------|----------|---------|
|
|
64
|
-
| 1 | path/to/file.md | file.md | Category | Brief summary |
|
|
65
|
-
| 2 | ... | ... | ... | ... |
|
|
66
|
-
|
|
67
|
-
### Recent Changes (if git available)
|
|
68
|
-
- List of recently modified files that might affect docs
|
|
69
|
-
|
|
70
|
-
### Key Source Files
|
|
71
|
-
- Main implementation files the docs should reference
|
|
72
|
-
|
|
73
|
-
### Potential Documentation Gaps
|
|
74
|
-
- Code without corresponding documentation
|
|
75
|
-
|
|
76
|
-
Be thorough - check ALL subdirectories. Do not skip any .md files."
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Phase 2: Orchestration (You)
|
|
80
|
-
|
|
81
|
-
After the Explore agent returns its inventory, YOU:
|
|
82
|
-
|
|
83
|
-
1. **Triage** the inventory by priority (see below)
|
|
84
|
-
2. **Read each doc** that might be affected by recent changes
|
|
85
|
-
3. **Compare against source** - Does the doc match current implementation?
|
|
86
|
-
4. **Decide what to update** using the decision tree
|
|
87
|
-
5. **Make updates** to stale documentation
|
|
88
|
-
6. **Generate summary report**
|
|
89
|
-
|
|
90
|
-
## Decision Tree: Global vs Project-Specific
|
|
91
|
-
|
|
92
|
-
**CREATE PROJECT-SPECIFIC skill/doc when:**
|
|
93
|
-
- The work was specific to THIS project (e.g., scheduled-report for automation)
|
|
94
|
-
- The patterns only apply to this codebase
|
|
95
|
-
- The configuration/credentials are project-specific
|
|
96
|
-
- The workflow integrates with project-specific systems
|
|
97
|
-
|
|
98
|
-
**UPDATE GLOBAL skill/doc when:**
|
|
99
|
-
- The change is a universal best practice
|
|
100
|
-
- The pattern applies to ALL projects (e.g., git workflow, code standards)
|
|
101
|
-
- The fix corrects an error in the global documentation
|
|
102
|
-
|
|
103
|
-
**When in doubt, create project-specific.** It's easier to promote to global later than to untangle project-specific details from global docs.
|
|
104
|
-
|
|
105
|
-
## Phase 2 Detailed Workflow
|
|
106
|
-
|
|
107
|
-
### Step 1: Triage the Inventory
|
|
108
|
-
|
|
109
|
-
From the Explore agent's report, categorize docs:
|
|
110
|
-
|
|
111
|
-
| Priority | Category | Action |
|
|
112
|
-
|----------|----------|--------|
|
|
113
|
-
| HIGH | Skills, Agents, READMEs in changed areas | Read and compare to source |
|
|
114
|
-
| MEDIUM | General docs in project | Skim for staleness |
|
|
115
|
-
| LOW | Unchanged areas, global docs | Note but don't modify |
|
|
116
|
-
|
|
117
|
-
### Step 2: Read and Compare
|
|
118
|
-
|
|
119
|
-
For HIGH priority docs:
|
|
120
|
-
1. Read the documentation file
|
|
121
|
-
2. Read the source code it documents
|
|
122
|
-
3. Identify discrepancies:
|
|
123
|
-
- Outdated function names
|
|
124
|
-
- Missing new features
|
|
125
|
-
- Incorrect paths or configurations
|
|
126
|
-
- Stale examples
|
|
127
|
-
|
|
128
|
-
### Step 3: Update Stale Documentation
|
|
129
|
-
|
|
130
|
-
**Priority order:**
|
|
131
|
-
1. `.claude/skills/` - Project skills (most impactful)
|
|
132
|
-
2. `.claude/CLAUDE.md` - Project instructions
|
|
133
|
-
3. `scripts/*/README.md` - Module READMEs
|
|
134
|
-
4. `README.md` - Project overview
|
|
135
|
-
5. `.claude/agents/` - Project agents
|
|
136
|
-
6. `docs/*.md` - Other guides
|
|
137
|
-
|
|
138
|
-
**MANDATORY: Skills must match code.** For each project skill:
|
|
139
|
-
1. Identify the source files the skill documents
|
|
140
|
-
2. Read both skill AND source files
|
|
141
|
-
3. Update skill if source has changed (paths, functions, data sources, workflows)
|
|
142
|
-
|
|
143
|
-
### Step 4: Archive Obsolete Documentation
|
|
144
|
-
|
|
145
|
-
Identify and archive documentation that is:
|
|
146
|
-
- **Completed plans** - Implementation plans that have been fully executed
|
|
147
|
-
- **Superseded docs** - Old versions replaced by newer documentation
|
|
148
|
-
- **Stale analysis** - Analysis docs for decisions already made
|
|
149
|
-
|
|
150
|
-
**Archive strategy:**
|
|
151
|
-
```
|
|
152
|
-
docs/plans/2025-01-*.md -> docs/archive/2025-01-completed-plans/
|
|
153
|
-
docs/plans/2025-11-*.md -> docs/archive/2025-11-completed-plans/
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Archiving rules:**
|
|
157
|
-
1. Keep active/current plan (most recent, still in progress)
|
|
158
|
-
2. Move completed plans to `docs/archive/YYYY-MM-completed-plans/`
|
|
159
|
-
3. Move stray docs to appropriate folders (e.g., `docs/guides/`)
|
|
160
|
-
4. Create archive README if folder has 3+ files
|
|
161
|
-
|
|
162
|
-
**Do NOT archive:**
|
|
163
|
-
- Active SESSION_STATE.md
|
|
164
|
-
- Current README.md
|
|
165
|
-
- Skills/Agents (they evolve, not archive)
|
|
166
|
-
- Recent plans still being implemented
|
|
167
|
-
|
|
168
|
-
### Step 5: Create New Skills When Needed
|
|
169
|
-
|
|
170
|
-
If recent work introduced a significant workflow without documentation:
|
|
171
|
-
|
|
172
|
-
**Create skill in:** `.claude/skills/<skill-name>/SKILL.md`
|
|
173
|
-
|
|
174
|
-
```yaml
|
|
175
|
-
---
|
|
176
|
-
name: skill-name
|
|
177
|
-
description: What this does and when to use it. Use when [trigger phrases].
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
# Skill Name
|
|
181
|
-
|
|
182
|
-
Brief overview.
|
|
183
|
-
|
|
184
|
-
## When to Use This Skill
|
|
185
|
-
- Trigger condition 1
|
|
186
|
-
- Trigger condition 2
|
|
187
|
-
|
|
188
|
-
## Quick Start
|
|
189
|
-
Minimal example to get started.
|
|
190
|
-
|
|
191
|
-
## Instructions
|
|
192
|
-
1. Step one
|
|
193
|
-
2. Step two
|
|
194
|
-
|
|
195
|
-
## Configuration
|
|
196
|
-
Key settings and where they live.
|
|
197
|
-
|
|
198
|
-
## Troubleshooting
|
|
199
|
-
Common issues and fixes.
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Output Requirements
|
|
203
|
-
|
|
204
|
-
After completing both phases, provide:
|
|
205
|
-
|
|
206
|
-
### 1. Discovery Summary (from Explore agent)
|
|
207
|
-
```markdown
|
|
208
|
-
## Discovery Summary
|
|
209
|
-
|
|
210
|
-
**Files Found:** X documentation files
|
|
211
|
-
**Categories:** X Skills, X Agents, X READMEs, X Other
|
|
212
|
-
|
|
213
|
-
### Documentation Inventory
|
|
214
|
-
[Include the table from Explore agent]
|
|
215
|
-
|
|
216
|
-
### Recent Changes Detected
|
|
217
|
-
[List from Explore agent]
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### 2. Analysis Results (your decisions)
|
|
221
|
-
```markdown
|
|
222
|
-
## Analysis Results
|
|
223
|
-
|
|
224
|
-
### Needs Update (HIGH priority)
|
|
225
|
-
| File | Reason |
|
|
226
|
-
|------|--------|
|
|
227
|
-
| path/file.md | [specific reason] |
|
|
228
|
-
|
|
229
|
-
### Current (No changes needed)
|
|
230
|
-
- file.md - Still accurate
|
|
231
|
-
- file2.md - Matches implementation
|
|
232
|
-
|
|
233
|
-
### Out of Scope (Global/Unrelated)
|
|
234
|
-
- ~/.claude/skills/X - Not affected by project work
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### 3. Changes Made
|
|
238
|
-
```markdown
|
|
239
|
-
## Documentation Update Summary
|
|
240
|
-
|
|
241
|
-
### Updated
|
|
242
|
-
- `path/to/file.md` - [what changed]
|
|
243
|
-
|
|
244
|
-
### Created
|
|
245
|
-
- `path/to/new.md` - [why created]
|
|
246
|
-
|
|
247
|
-
### Archived
|
|
248
|
-
- `docs/plans/2025-01-*.md` -> `docs/archive/2025-01-completed-plans/` - [completed implementation]
|
|
249
|
-
|
|
250
|
-
### Skipped
|
|
251
|
-
- `path/file.md` - [why skipped]
|
|
252
|
-
|
|
253
|
-
### Global Resources (NOT Modified)
|
|
254
|
-
- `~/.claude/skills/X` - [why not touched]
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### 4. Recommendations
|
|
258
|
-
```markdown
|
|
259
|
-
## Recommendations
|
|
260
|
-
|
|
261
|
-
### Manual Review Needed
|
|
262
|
-
- [docs that need human attention]
|
|
263
|
-
|
|
264
|
-
### Future Documentation
|
|
265
|
-
- [suggested new docs to create]
|
|
266
|
-
|
|
267
|
-
### Next /docupdate
|
|
268
|
-
- Run after [specific trigger]
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
## Skill-Source Mapping
|
|
272
|
-
|
|
273
|
-
For each skill, identify its source files. Common patterns:
|
|
274
|
-
|
|
275
|
-
| Skill Pattern | Source Files to Check |
|
|
276
|
-
|--------------|----------------------|
|
|
277
|
-
| periodic-reports | generator.py, batch_run*.py |
|
|
278
|
-
| *-automation | automation/*.py, scripts/*.py |
|
|
279
|
-
| *-workflow | Main orchestration scripts |
|
|
280
|
-
|
|
281
|
-
**When source changes, skill MUST be updated:**
|
|
282
|
-
- Data sources (CSV -> SQLite, API changes)
|
|
283
|
-
- File paths and locations
|
|
284
|
-
- Function signatures and workflows
|
|
285
|
-
- Configuration and credentials
|
|
286
|
-
- New features or removed functionality
|
|
287
|
-
|
|
288
|
-
## Important Guidelines
|
|
289
|
-
|
|
290
|
-
1. **Always launch Explore agent first** - Don't skip discovery phase
|
|
291
|
-
2. **Project-first mindset:** Default to project-specific documentation
|
|
292
|
-
3. **Don't over-update:** Only change what's actually stale
|
|
293
|
-
4. **Be specific:** Include actual file names, discrepancies found
|
|
294
|
-
5. **Preserve history:** Add to docs, don't delete useful content
|
|
295
|
-
6. **Test triggers:** Ensure skill descriptions will activate correctly
|
|
296
|
-
|
|
297
|
-
## Error Handling
|
|
298
|
-
|
|
299
|
-
- If no .claude directory exists, create it
|
|
300
|
-
- If no git repo, work with file modification dates
|
|
301
|
-
- If Explore agent finds no docs, report "No documentation found - consider creating README.md"
|
|
302
|
-
- If unsure about a change, flag for manual review instead of guessing
|
|
303
|
-
|
|
304
|
-
## Example Execution
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
User: /docupdate
|
|
308
|
-
|
|
309
|
-
Claude:
|
|
310
|
-
1. Launches Explore agent for documentation discovery
|
|
311
|
-
2. Receives inventory: 15 docs found, 3 skills, 1 agent, 2 READMEs
|
|
312
|
-
3. Identifies Code.gs was heavily modified recently
|
|
313
|
-
4. Triages: SKILL.md and README.md are HIGH priority
|
|
314
|
-
5. Reads SKILL.md, finds it references old function names
|
|
315
|
-
6. Updates SKILL.md with:
|
|
316
|
-
- New architecture section
|
|
317
|
-
- Updated function references
|
|
318
|
-
- New troubleshooting items
|
|
319
|
-
7. Reads README.md, finds it's current
|
|
320
|
-
8. Generates summary report
|
|
321
|
-
9. Notes global skills weren't affected
|
|
322
|
-
```
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Extract hook-firing records from session transcripts into Neon and show blocker summary
|
|
3
|
-
allowed-tools: Bash
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Scan every JSONL session transcript under `~/.claude/projects/` (or the
|
|
7
|
-
path set by the `CLAUDE_HOME` env var) and ingest `attachment` records
|
|
8
|
-
whose inner `type` is one of the five enumerated variants in
|
|
9
|
-
`OUTCOME_BY_ATTACHMENT_TYPE` (`hook_success`, `hook_blocking_error`,
|
|
10
|
-
`hook_non_blocking_error`, `hook_system_message`,
|
|
11
|
-
`hook_additional_context`). Each ingested record becomes one row in
|
|
12
|
-
the Neon `hook_events` table. Unknown `hook_`-prefixed variants are
|
|
13
|
-
skipped until `OUTCOME_BY_ATTACHMENT_TYPE` is extended to cover them.
|
|
14
|
-
The Stop hook runs this on every session end using the `--incremental`
|
|
15
|
-
flag.
|
|
16
|
-
|
|
17
|
-
## Run modes
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
bws run -- python packages/claude-dev-env/hooks/diagnostic/hook_log_extractor.py
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Full extraction using the current byte offsets in
|
|
24
|
-
`~/.claude/logs/hooks/.state/offsets.json` (override the `~/.claude`
|
|
25
|
-
root by setting `CLAUDE_HOME`). Equivalent to the Stop hook's
|
|
26
|
-
`--incremental` invocation; passing `--incremental` explicitly is a
|
|
27
|
-
documented no-op that selects the same default resumption path.
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
bws run -- python packages/claude-dev-env/hooks/diagnostic/hook_log_extractor.py --full-rebuild
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Clear offsets, truncate `hook_events`, and re-read every JSONL from byte
|
|
34
|
-
zero. Use this after a schema migration or when the offsets file is
|
|
35
|
-
suspected of drift.
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
bws run -- python packages/claude-dev-env/hooks/diagnostic/hook_log_extractor.py --summary
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Run summary mode to print the top-10 blockers of the last 24 hours with
|
|
42
|
-
their block count and a single truncated command preview. An empty window
|
|
43
|
-
prints `Blocked events recorded in the last 24 hours: 0.`.
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
bws run -- python packages/claude-dev-env/hooks/diagnostic/hook_log_extractor.py --query <name>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Run the pre-baked query `queries/<name>.sql` and print the result as an
|
|
50
|
-
aligned text table. Available query names match the SQL files in
|
|
51
|
-
`packages/claude-dev-env/hooks/diagnostic/queries/`:
|
|
52
|
-
|
|
53
|
-
- `top_blockers_overall`
|
|
54
|
-
- `top_blockers_last_24_hours`
|
|
55
|
-
- `blocks_last_7_days`
|
|
56
|
-
- `blocks_by_category`
|
|
57
|
-
- `blocks_by_tool`
|
|
58
|
-
- `block_details_for_hook`
|
|
59
|
-
|
|
60
|
-
## Offline behavior
|
|
61
|
-
|
|
62
|
-
If the psycopg connection fails with `OperationalError`, the
|
|
63
|
-
5-second timeout elapses, `NEON_HOOK_LOGS_DATABASE_URL` is unset, or
|
|
64
|
-
the `psycopg` driver is not installed, the extractor appends one
|
|
65
|
-
ISO-8601 line to `~/.claude/logs/hook-extractor.log` (override the
|
|
66
|
-
`~/.claude` root with the `CLAUDE_HOME` env var) and exits with
|
|
67
|
-
status 0. Session shutdown stays fast, and the next online run
|
|
68
|
-
backfills from the existing offsets. The warning line records only
|
|
69
|
-
the timestamp and the exception class name so connection URLs never
|
|
70
|
-
leak into the log.
|