mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-17 23:53:30 +08:00
Compare commits
4 Commits
c8f54481b8
...
7daa830da9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7daa830da9 | ||
|
|
7e57d1b831 | ||
|
|
ff47dace11 | ||
|
|
c9dc53e862 |
91
commands/learn-eval.md
Normal file
91
commands/learn-eval.md
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
---
|
||||||
|
description: Extract reusable patterns from the session, self-evaluate quality before saving, and determine the right save location (Global vs Project).
|
||||||
|
---
|
||||||
|
|
||||||
|
# /learn-eval - Extract, Evaluate, then Save
|
||||||
|
|
||||||
|
Extends `/learn` with a quality gate and save-location decision before writing any skill file.
|
||||||
|
|
||||||
|
## What to Extract
|
||||||
|
|
||||||
|
Look for:
|
||||||
|
|
||||||
|
1. **Error Resolution Patterns** — root cause + fix + reusability
|
||||||
|
2. **Debugging Techniques** — non-obvious steps, tool combinations
|
||||||
|
3. **Workarounds** — library quirks, API limitations, version-specific fixes
|
||||||
|
4. **Project-Specific Patterns** — conventions, architecture decisions, integration patterns
|
||||||
|
|
||||||
|
## Process
|
||||||
|
|
||||||
|
1. Review the session for extractable patterns
|
||||||
|
2. Identify the most valuable/reusable insight
|
||||||
|
|
||||||
|
3. **Determine save location:**
|
||||||
|
- Ask: "Would this pattern be useful in a different project?"
|
||||||
|
- **Global** (`~/.claude/skills/learned/`): Generic patterns usable across 2+ projects (bash compatibility, LLM API behavior, debugging techniques, etc.)
|
||||||
|
- **Project** (`.claude/skills/learned/` in current project): Project-specific knowledge (quirks of a particular config file, project-specific architecture decisions, etc.)
|
||||||
|
- When in doubt, choose Global (moving Global → Project is easier than the reverse)
|
||||||
|
|
||||||
|
4. Draft the skill file using this format:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
---
|
||||||
|
name: pattern-name
|
||||||
|
description: "Under 130 characters"
|
||||||
|
user-invocable: false
|
||||||
|
origin: auto-extracted
|
||||||
|
---
|
||||||
|
|
||||||
|
# [Descriptive Pattern Name]
|
||||||
|
|
||||||
|
**Extracted:** [Date]
|
||||||
|
**Context:** [Brief description of when this applies]
|
||||||
|
|
||||||
|
## Problem
|
||||||
|
[What problem this solves - be specific]
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
[The pattern/technique/workaround - with code examples]
|
||||||
|
|
||||||
|
## When to Use
|
||||||
|
[Trigger conditions]
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Self-evaluate before saving** using this rubric:
|
||||||
|
|
||||||
|
| Dimension | 1 | 3 | 5 |
|
||||||
|
|-----------|---|---|---|
|
||||||
|
| Specificity | Abstract principles only, no code examples | Representative code example present | Rich examples covering all usage patterns |
|
||||||
|
| Actionability | Unclear what to do | Main steps are understandable | Immediately actionable, edge cases covered |
|
||||||
|
| Scope Fit | Too broad or too narrow | Mostly appropriate, some boundary ambiguity | Name, trigger, and content perfectly aligned |
|
||||||
|
| Non-redundancy | Nearly identical to another skill | Some overlap but unique perspective exists | Completely unique value |
|
||||||
|
| Coverage | Covers only a fraction of the target task | Main cases covered, common variants missing | Main cases, edge cases, and pitfalls covered |
|
||||||
|
|
||||||
|
- Score each dimension 1–5
|
||||||
|
- If any dimension scores 1–2, improve the draft and re-score until all dimensions are ≥ 3
|
||||||
|
- Show the user the scores table and the final draft
|
||||||
|
|
||||||
|
6. Ask user to confirm:
|
||||||
|
- Show: proposed save path + scores table + final draft
|
||||||
|
- Wait for explicit confirmation before writing
|
||||||
|
|
||||||
|
7. Save to the determined location
|
||||||
|
|
||||||
|
## Output Format for Step 5 (scores table)
|
||||||
|
|
||||||
|
| Dimension | Score | Rationale |
|
||||||
|
|-----------|-------|-----------|
|
||||||
|
| Specificity | N/5 | ... |
|
||||||
|
| Actionability | N/5 | ... |
|
||||||
|
| Scope Fit | N/5 | ... |
|
||||||
|
| Non-redundancy | N/5 | ... |
|
||||||
|
| Coverage | N/5 | ... |
|
||||||
|
| **Total** | **N/25** | |
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- Don't extract trivial fixes (typos, simple syntax errors)
|
||||||
|
- Don't extract one-time issues (specific API outages, etc.)
|
||||||
|
- Focus on patterns that will save time in future sessions
|
||||||
|
- Keep skills focused — one pattern per skill
|
||||||
|
- If Coverage score is low, add related variants before saving
|
||||||
158
skills/search-first/SKILL.md
Normal file
158
skills/search-first/SKILL.md
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
---
|
||||||
|
description: Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
|
||||||
|
---
|
||||||
|
|
||||||
|
# /search-first — Research Before You Code
|
||||||
|
|
||||||
|
Systematizes the "search for existing solutions before implementing" workflow.
|
||||||
|
|
||||||
|
## Trigger
|
||||||
|
|
||||||
|
Use this skill when:
|
||||||
|
- Starting a new feature that likely has existing solutions
|
||||||
|
- Adding a dependency or integration
|
||||||
|
- The user asks "add X functionality" and you're about to write code
|
||||||
|
- Before creating a new utility, helper, or abstraction
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────────────┐
|
||||||
|
│ 1. NEED ANALYSIS │
|
||||||
|
│ Define what functionality is needed │
|
||||||
|
│ Identify language/framework constraints │
|
||||||
|
├─────────────────────────────────────────────┤
|
||||||
|
│ 2. PARALLEL SEARCH (researcher agent) │
|
||||||
|
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
||||||
|
│ │ npm / │ │ MCP / │ │ GitHub / │ │
|
||||||
|
│ │ PyPI │ │ Skills │ │ Web │ │
|
||||||
|
│ └──────────┘ └──────────┘ └──────────┘ │
|
||||||
|
├─────────────────────────────────────────────┤
|
||||||
|
│ 3. EVALUATE │
|
||||||
|
│ Score candidates (functionality, maint, │
|
||||||
|
│ community, docs, license, deps) │
|
||||||
|
├─────────────────────────────────────────────┤
|
||||||
|
│ 4. DECIDE │
|
||||||
|
│ ┌─────────┐ ┌──────────┐ ┌─────────┐ │
|
||||||
|
│ │ Adopt │ │ Extend │ │ Build │ │
|
||||||
|
│ │ as-is │ │ /Wrap │ │ Custom │ │
|
||||||
|
│ └─────────┘ └──────────┘ └─────────┘ │
|
||||||
|
├─────────────────────────────────────────────┤
|
||||||
|
│ 5. IMPLEMENT │
|
||||||
|
│ Install package / Configure MCP / │
|
||||||
|
│ Write minimal custom code │
|
||||||
|
└─────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Decision Matrix
|
||||||
|
|
||||||
|
| Signal | Action |
|
||||||
|
|--------|--------|
|
||||||
|
| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
|
||||||
|
| Partial match, good foundation | **Extend** — install + write thin wrapper |
|
||||||
|
| Multiple weak matches | **Compose** — combine 2-3 small packages |
|
||||||
|
| Nothing suitable found | **Build** — write custom, but informed by research |
|
||||||
|
|
||||||
|
## How to Use
|
||||||
|
|
||||||
|
### Quick Mode (inline)
|
||||||
|
|
||||||
|
Before writing a utility or adding functionality, mentally run through:
|
||||||
|
|
||||||
|
1. Is this a common problem? → Search npm/PyPI
|
||||||
|
2. Is there an MCP for this? → Check `~/.claude/settings.json` and search
|
||||||
|
3. Is there a skill for this? → Check `~/.claude/skills/`
|
||||||
|
4. Is there a GitHub template? → Search GitHub
|
||||||
|
|
||||||
|
### Full Mode (agent)
|
||||||
|
|
||||||
|
For non-trivial functionality, launch the researcher agent:
|
||||||
|
|
||||||
|
```
|
||||||
|
Task(subagent_type="general-purpose", prompt="
|
||||||
|
Research existing tools for: [DESCRIPTION]
|
||||||
|
Language/framework: [LANG]
|
||||||
|
Constraints: [ANY]
|
||||||
|
|
||||||
|
Search: npm/PyPI, MCP servers, Claude Code skills, GitHub
|
||||||
|
Return: Structured comparison with recommendation
|
||||||
|
")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Search Shortcuts by Category
|
||||||
|
|
||||||
|
### Development Tooling
|
||||||
|
- Linting → `eslint`, `ruff`, `textlint`, `markdownlint`
|
||||||
|
- Formatting → `prettier`, `black`, `gofmt`
|
||||||
|
- Testing → `jest`, `pytest`, `go test`
|
||||||
|
- Pre-commit → `husky`, `lint-staged`, `pre-commit`
|
||||||
|
|
||||||
|
### AI/LLM Integration
|
||||||
|
- Claude SDK → Context7 for latest docs
|
||||||
|
- Prompt management → Check MCP servers
|
||||||
|
- Document processing → `unstructured`, `pdfplumber`, `mammoth`
|
||||||
|
|
||||||
|
### Data & APIs
|
||||||
|
- HTTP clients → `httpx` (Python), `ky`/`got` (Node)
|
||||||
|
- Validation → `zod` (TS), `pydantic` (Python)
|
||||||
|
- Database → Check for MCP servers first
|
||||||
|
|
||||||
|
### Content & Publishing
|
||||||
|
- Markdown processing → `remark`, `unified`, `markdown-it`
|
||||||
|
- Image optimization → `sharp`, `imagemin`
|
||||||
|
|
||||||
|
## Integration Points
|
||||||
|
|
||||||
|
### With planner agent
|
||||||
|
The planner should invoke researcher before Phase 1 (Architecture Review):
|
||||||
|
- Researcher identifies available tools
|
||||||
|
- Planner incorporates them into the implementation plan
|
||||||
|
- Avoids "reinventing the wheel" in the plan
|
||||||
|
|
||||||
|
### With architect agent
|
||||||
|
The architect should consult researcher for:
|
||||||
|
- Technology stack decisions
|
||||||
|
- Integration pattern discovery
|
||||||
|
- Existing reference architectures
|
||||||
|
|
||||||
|
### With iterative-retrieval skill
|
||||||
|
Combine for progressive discovery:
|
||||||
|
- Cycle 1: Broad search (npm, PyPI, MCP)
|
||||||
|
- Cycle 2: Evaluate top candidates in detail
|
||||||
|
- Cycle 3: Test compatibility with project constraints
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Example 1: "Add dead link checking"
|
||||||
|
```
|
||||||
|
Need: Check markdown files for broken links
|
||||||
|
Search: npm "markdown dead link checker"
|
||||||
|
Found: textlint-rule-no-dead-link (score: 9/10)
|
||||||
|
Action: ADOPT — npm install textlint-rule-no-dead-link
|
||||||
|
Result: Zero custom code, battle-tested solution
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example 2: "Add HTTP client wrapper"
|
||||||
|
```
|
||||||
|
Need: Resilient HTTP client with retries and timeout handling
|
||||||
|
Search: npm "http client retry", PyPI "httpx retry"
|
||||||
|
Found: got (Node) with retry plugin, httpx (Python) with built-in retry
|
||||||
|
Action: ADOPT — use got/httpx directly with retry config
|
||||||
|
Result: Zero custom code, production-proven libraries
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example 3: "Add config file linter"
|
||||||
|
```
|
||||||
|
Need: Validate project config files against a schema
|
||||||
|
Search: npm "config linter schema", "json schema validator cli"
|
||||||
|
Found: ajv-cli (score: 8/10)
|
||||||
|
Action: ADOPT + EXTEND — install ajv-cli, write project-specific schema
|
||||||
|
Result: 1 package + 1 schema file, no custom validation logic
|
||||||
|
```
|
||||||
|
|
||||||
|
## Anti-Patterns
|
||||||
|
|
||||||
|
- **Jumping to code**: Writing a utility without checking if one exists
|
||||||
|
- **Ignoring MCP**: Not checking if an MCP server already provides the capability
|
||||||
|
- **Over-customizing**: Wrapping a library so heavily it loses its benefits
|
||||||
|
- **Dependency bloat**: Installing a massive package for one small feature
|
||||||
Reference in New Issue
Block a user