@antaif3ng/til-work 0.1.2 → 0.3.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.
Files changed (57) hide show
  1. package/README.md +265 -297
  2. package/dist/core/config.d.ts +29 -11
  3. package/dist/core/config.d.ts.map +1 -1
  4. package/dist/core/config.js +65 -101
  5. package/dist/core/config.js.map +1 -1
  6. package/dist/core/llm.d.ts.map +1 -1
  7. package/dist/core/llm.js +14 -0
  8. package/dist/core/llm.js.map +1 -1
  9. package/dist/core/pricing.d.ts.map +1 -1
  10. package/dist/core/pricing.js +0 -2
  11. package/dist/core/pricing.js.map +1 -1
  12. package/dist/core/session.d.ts +3 -2
  13. package/dist/core/session.d.ts.map +1 -1
  14. package/dist/core/session.js +4 -3
  15. package/dist/core/session.js.map +1 -1
  16. package/dist/core/skills.d.ts +2 -1
  17. package/dist/core/skills.d.ts.map +1 -1
  18. package/dist/core/skills.js +9 -0
  19. package/dist/core/skills.js.map +1 -1
  20. package/dist/core/system-prompt.d.ts.map +1 -1
  21. package/dist/core/system-prompt.js +6 -2
  22. package/dist/core/system-prompt.js.map +1 -1
  23. package/dist/main.d.ts.map +1 -1
  24. package/dist/main.js +66 -124
  25. package/dist/main.js.map +1 -1
  26. package/dist/modes/interactive.d.ts.map +1 -1
  27. package/dist/modes/interactive.js +514 -273
  28. package/dist/modes/interactive.js.map +1 -1
  29. package/dist/tools/browser.d.ts +10 -0
  30. package/dist/tools/browser.d.ts.map +1 -0
  31. package/dist/tools/browser.js +231 -0
  32. package/dist/tools/browser.js.map +1 -0
  33. package/dist/tools/computer.d.ts +3 -0
  34. package/dist/tools/computer.d.ts.map +1 -0
  35. package/dist/tools/computer.js +251 -0
  36. package/dist/tools/computer.js.map +1 -0
  37. package/dist/tools/index.d.ts +5 -2
  38. package/dist/tools/index.d.ts.map +1 -1
  39. package/dist/tools/index.js +11 -2
  40. package/dist/tools/index.js.map +1 -1
  41. package/dist/tools/read.d.ts.map +1 -1
  42. package/dist/tools/read.js +29 -4
  43. package/dist/tools/read.js.map +1 -1
  44. package/dist/tools/screenshot.d.ts +3 -0
  45. package/dist/tools/screenshot.d.ts.map +1 -0
  46. package/dist/tools/screenshot.js +113 -0
  47. package/dist/tools/screenshot.js.map +1 -0
  48. package/dist/utils/file-processor.d.ts +2 -2
  49. package/dist/utils/file-processor.d.ts.map +1 -1
  50. package/dist/utils/file-processor.js +7 -10
  51. package/dist/utils/file-processor.js.map +1 -1
  52. package/package.json +3 -2
  53. package/skills/find-skills/SKILL.md +66 -0
  54. package/skills/playwright-mcp/SKILL.md +90 -0
  55. package/skills/self-improving-agent/SKILL.md +88 -0
  56. package/skills/skill-creator/SKILL.md +93 -0
  57. package/skills/summarize/SKILL.md +55 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antaif3ng/til-work",
3
- "version": "0.1.2",
4
- "description": "TIL Agent — 运行在终端里的个人 AI 助手 (Personal AI assistant CLI powered by LLM)",
3
+ "version": "0.3.0",
4
+ "description": "TIL Work — 运行在终端里的个人 AI 助手 (Personal AI assistant CLI powered by LLM)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "til": "dist/cli.js"
@@ -10,6 +10,7 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "files": [
12
12
  "dist",
13
+ "skills",
13
14
  "README.md",
14
15
  "LICENSE"
15
16
  ],
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: find-skills
3
+ description: "Helps users discover and install agent skills. Use when the user asks 'how do I do X', 'find a skill for X', 'is there a skill that can...', or wants to extend capabilities."
4
+ ---
5
+
6
+ # Find Skills
7
+
8
+ This skill helps you discover and install skills from the open agent skills ecosystem.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when the user:
13
+ - Asks "how do I do X" where X might be a common task with an existing skill
14
+ - Says "find a skill for X" or "is there a skill for X"
15
+ - Asks "can you do X" where X is a specialized capability
16
+ - Expresses interest in extending agent capabilities
17
+ - Wants to search for tools, templates, or workflows
18
+ - Mentions they wish they had help with a specific domain (design, testing, deployment, etc.)
19
+
20
+ ## What is the Skills CLI?
21
+
22
+ The Skills CLI (`npx skills`) is the package manager for the open agent skills ecosystem.
23
+
24
+ **Key commands:**
25
+ - `npx skills find [query]` - Search for skills interactively or by keyword
26
+ - `npx skills add <package>` - Install a skill from GitHub or other sources
27
+ - `npx skills check` - Check for skill updates
28
+ - `npx skills update` - Update all installed skills
29
+
30
+ **Browse skills at:** https://skills.sh/ or https://clawhub.ai/
31
+
32
+ ## How to Help Users Find Skills
33
+
34
+ ### Step 1: Understand What They Need
35
+ Identify: domain, specific task, whether a skill likely exists.
36
+
37
+ ### Step 2: Search for Skills
38
+ ```bash
39
+ npx skills find [query]
40
+ ```
41
+
42
+ ### Step 3: Present Options to the User
43
+ Present: skill name, install command, link to learn more.
44
+
45
+ ### Step 4: Offer to Install
46
+ ```bash
47
+ npx skills add <owner/repo@skill> -g -y
48
+ ```
49
+
50
+ ## Common Skill Categories
51
+
52
+ | Category | Example Queries |
53
+ |---|---|
54
+ | Web Development | react, nextjs, typescript, css, tailwind |
55
+ | Testing | testing, jest, playwright, e2e |
56
+ | DevOps | deploy, docker, kubernetes, ci-cd |
57
+ | Documentation | docs, readme, changelog, api-docs |
58
+ | Code Quality | review, lint, refactor, best-practices |
59
+ | Design | ui, ux, design-system, accessibility |
60
+ | Productivity | workflow, automation, git |
61
+
62
+ ## When No Skills Are Found
63
+
64
+ 1. Acknowledge no skill was found
65
+ 2. Offer to help directly with your existing capabilities
66
+ 3. Suggest creating a custom skill for the task
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: playwright-mcp
3
+ description: "Browser automation via Playwright MCP server. Use when the user needs to navigate websites, click elements, fill forms, extract data, take screenshots, or perform browser automation workflows."
4
+ ---
5
+
6
+ # Playwright MCP Skill
7
+
8
+ Browser automation powered by Playwright MCP server.
9
+
10
+ ## Prerequisites
11
+
12
+ Install the Playwright MCP server:
13
+
14
+ ```bash
15
+ npm install -g @playwright/mcp
16
+ npx playwright install chromium
17
+ ```
18
+
19
+ ## MCP Configuration
20
+
21
+ Add to your `~/.til/config.json`:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "playwright": {
27
+ "command": "npx",
28
+ "args": ["@playwright/mcp", "--headless"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ For headed mode (visible browser):
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "playwright": {
39
+ "command": "npx",
40
+ "args": ["@playwright/mcp"]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ## MCP Tools Reference
47
+
48
+ | Tool | Description |
49
+ |------|-------------|
50
+ | `browser_navigate` | Navigate to URL |
51
+ | `browser_click` | Click element by CSS selector or coordinates |
52
+ | `browser_type` | Type text into input field |
53
+ | `browser_select_option` | Select dropdown option |
54
+ | `browser_get_text` | Get text content of element or page |
55
+ | `browser_evaluate` | Execute JavaScript in page context |
56
+ | `browser_snapshot` | Get accessible page snapshot (recommended before interactions) |
57
+ | `browser_close` | Close browser context |
58
+ | `browser_choose_file` | Upload file to input |
59
+ | `browser_press` | Press keyboard key (Enter, Tab, etc.) |
60
+
61
+ ## Workflow
62
+
63
+ 1. **Navigate** to the target URL
64
+ 2. **Snapshot** to understand the page structure
65
+ 3. **Interact** with elements (click, type, select)
66
+ 4. **Extract** data or take screenshots as needed
67
+ 5. **Close** when done
68
+
69
+ ## Configuration Options
70
+
71
+ | Flag | Description |
72
+ |------|-------------|
73
+ | `--allowed-hosts` | Restrict navigation to specific hosts |
74
+ | `--blocked-origins` | Block specific origins |
75
+ | `--browser` | Browser engine (chromium, firefox, webkit) |
76
+ | `--headless` | Run without visible browser window |
77
+ | `--viewport-size` | Set viewport dimensions (e.g. "1280x720") |
78
+ | `--timeout-action` | Action timeout in ms |
79
+ | `--timeout-navigation` | Navigation timeout in ms |
80
+ | `--output-dir` | Directory for screenshots and traces |
81
+ | `--save-trace` | Save Playwright trace file |
82
+ | `--save-video` | Record browser session video |
83
+
84
+ ## Tips
85
+
86
+ - Always use `browser_snapshot` before interacting with elements
87
+ - Use CSS selectors for reliable element targeting
88
+ - Set appropriate timeouts for slow-loading pages
89
+ - Use `--headless` in CI/automation environments
90
+ - Use `browser_evaluate` for complex page manipulation
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: self-improvement
3
+ description: "Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects you, (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) You realize your knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task."
4
+ ---
5
+
6
+ # Self-Improving Agent
7
+
8
+ Captures learnings, errors, and corrections into structured files for continuous improvement across sessions.
9
+
10
+ ## Trigger Conditions
11
+
12
+ Activate this skill when:
13
+ 1. A command or operation fails unexpectedly
14
+ 2. User corrects you ("No, that's wrong...", "Actually...")
15
+ 3. User requests a capability that doesn't exist
16
+ 4. An external API or tool fails
17
+ 5. You realize your knowledge is outdated or incorrect
18
+ 6. A better approach is discovered for a recurring task
19
+
20
+ ## Storage Structure
21
+
22
+ All learnings are stored in the project's `.til/` directory:
23
+
24
+ ```
25
+ .til/
26
+ ├── MEMORY.md # Persistent memory (existing system)
27
+ └── learnings/
28
+ ├── LEARNINGS.md # Corrections, knowledge gaps, best practices
29
+ ├── ERRORS.md # Command failures, API errors, exceptions
30
+ └── FEATURE_REQUESTS.md # User needs, missing capabilities
31
+ ```
32
+
33
+ ## Entry Format
34
+
35
+ Each entry follows this format:
36
+
37
+ ```markdown
38
+ ### [ID] Short Title
39
+ - **Date**: YYYY-MM-DD
40
+ - **Context**: What was happening
41
+ - **Issue**: What went wrong / what was learned
42
+ - **Resolution**: How it was fixed / the correct approach
43
+ - **Tags**: #category #subcategory
44
+ ```
45
+
46
+ **ID format**: `TYPE-YYYYMMDD-XXX`
47
+ - `LRN-20250115-001` for learnings
48
+ - `ERR-20250115-001` for errors
49
+ - `FRQ-20250115-001` for feature requests
50
+
51
+ ## How to Record
52
+
53
+ ### On Error
54
+ 1. Capture the exact error message
55
+ 2. Document what was attempted
56
+ 3. Record the fix or workaround
57
+ 4. Add to `ERRORS.md`
58
+
59
+ ### On Correction
60
+ 1. Note what you said that was wrong
61
+ 2. Record the correct information from the user
62
+ 3. Update your understanding
63
+ 4. Add to `LEARNINGS.md`
64
+
65
+ ### On Feature Request
66
+ 1. Document what the user wanted
67
+ 2. Note current limitations
68
+ 3. Suggest possible implementations
69
+ 4. Add to `FEATURE_REQUESTS.md`
70
+
71
+ ## Before Major Tasks
72
+
73
+ Before starting a complex task, review existing learnings:
74
+ ```bash
75
+ # Check for relevant past learnings
76
+ cat .til/learnings/LEARNINGS.md
77
+ cat .til/learnings/ERRORS.md
78
+ ```
79
+
80
+ This helps avoid repeating past mistakes and apply discovered best practices.
81
+
82
+ ## Promoting Learnings
83
+
84
+ When a learning is important enough, promote it to persistent memory:
85
+ - Write to `~/.til/MEMORY.md` (global, cross-project) using the write tool
86
+ - Write to `.til/MEMORY.md` (project-specific) using the write tool
87
+
88
+ This ensures the learning persists across sessions via the existing memory system.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: skill-creator
3
+ description: "Guide for creating effective skills. Use when users want to create a new skill (or update an existing skill) that extends the agent's capabilities with specialized knowledge, workflows, or tool integrations."
4
+ ---
5
+
6
+ # Skill Creator
7
+
8
+ Guide for creating effective agent skills.
9
+
10
+ ## Skill Structure
11
+
12
+ A skill is a directory containing a `SKILL.md` file:
13
+
14
+ ```
15
+ my-skill/
16
+ ├── SKILL.md # Required: frontmatter + instructions
17
+ ├── scripts/ # Optional: helper scripts
18
+ ├── references/ # Optional: reference docs
19
+ └── assets/ # Optional: templates, configs
20
+ ```
21
+
22
+ ## SKILL.md Format
23
+
24
+ ```markdown
25
+ ---
26
+ name: my-skill
27
+ description: "One-line description. Include WHEN to use this skill."
28
+ ---
29
+
30
+ # Skill Title
31
+
32
+ Instructions for the agent...
33
+ ```
34
+
35
+ ### Frontmatter Rules
36
+
37
+ - `name`: kebab-case, max 64 characters
38
+ - `description`: **Critical** — this is the primary trigger. Must include:
39
+ - What the skill does
40
+ - When to activate it (trigger phrases)
41
+ - Keep under 160 characters for the summary
42
+
43
+ ## Core Principles
44
+
45
+ ### 1. Concise over verbose
46
+ Context window is a shared resource. Every token in a skill competes with the user's conversation.
47
+
48
+ ### 2. Progressive disclosure
49
+ - **Level 1**: Frontmatter (always loaded) — triggers activation
50
+ - **Level 2**: SKILL.md body (loaded on demand via read tool) — detailed instructions
51
+ - **Level 3**: Bundled resources (loaded as needed) — scripts, references
52
+
53
+ ### 3. Appropriate freedom
54
+ Don't over-constrain. Give the agent guidelines, not rigid scripts.
55
+
56
+ ## Creating a Skill — Step by Step
57
+
58
+ ### Step 1: Define the purpose
59
+ What specific task does this skill help with? Be concrete.
60
+
61
+ ### Step 2: Write the description
62
+ This is the most important part. The description determines when the agent loads the skill.
63
+
64
+ Bad: "Helps with code"
65
+ Good: "Generate comprehensive test suites for TypeScript projects. Use when the user asks to write tests, add test coverage, or set up a testing framework."
66
+
67
+ ### Step 3: Write instructions
68
+ Structure as:
69
+ 1. **When to use** — trigger conditions
70
+ 2. **How to do it** — step-by-step workflow
71
+ 3. **Tools/commands** — specific commands or tools to use
72
+ 4. **Examples** — concrete examples
73
+ 5. **Pitfalls** — common mistakes to avoid
74
+
75
+ ### Step 4: Test the skill
76
+ Place in `~/.til/skills/my-skill/SKILL.md` and verify:
77
+ - Does it trigger on the right queries?
78
+ - Are the instructions clear enough?
79
+ - Does it produce good results?
80
+
81
+ ## Installation Paths
82
+
83
+ - **Global**: `~/.til/skills/<skill-name>/SKILL.md`
84
+ - **Project**: `.til/skills/<skill-name>/SKILL.md`
85
+ - **CLI**: `til --skill /path/to/skill-dir`
86
+
87
+ ## Tips
88
+
89
+ - Keep SKILL.md under 200 lines — longer skills should use bundled references
90
+ - Use markdown headers for structure — the agent processes these well
91
+ - Include example commands that the agent can run directly
92
+ - Reference tool names that exist in the agent's toolkit (bash, read, write, edit, etc.)
93
+ - Test with real user queries, not just ideal inputs
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: summarize
3
+ description: "Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube). Use when the user asks to summarize a webpage, document, PDF, or video."
4
+ ---
5
+
6
+ # Summarize
7
+
8
+ Fast CLI to summarize URLs, local files, and YouTube links.
9
+
10
+ ## Quick start
11
+
12
+ ```bash
13
+ summarize "https://example.com" --model google/gemini-3-flash-preview
14
+ summarize "/path/to/file.pdf" --model google/gemini-3-flash-preview
15
+ summarize "https://youtu.be/dQw4w9WgXcQ" --youtube auto
16
+ ```
17
+
18
+ ## Model + keys
19
+
20
+ Set the API key for your chosen provider:
21
+ - OpenAI: `OPENAI_API_KEY`
22
+ - Anthropic: `ANTHROPIC_API_KEY`
23
+ - xAI: `XAI_API_KEY`
24
+ - Google: `GEMINI_API_KEY` (aliases: `GOOGLE_GENERATIVE_AI_API_KEY`, `GOOGLE_API_KEY`)
25
+
26
+ Default model is `google/gemini-3-flash-preview` if none is set.
27
+
28
+ ## Useful flags
29
+
30
+ - `--length short|medium|long|xl|xxl`
31
+ - `--max-output-tokens <n>`
32
+ - `--extract-only` (URLs only)
33
+ - `--json` (machine readable)
34
+ - `--firecrawl auto|off|always` (fallback extraction)
35
+ - `--youtube auto` (Apify fallback if `APIFY_API_TOKEN` set)
36
+
37
+ ## Config
38
+
39
+ Optional config file: `~/.summarize/config.json`
40
+
41
+ ```json
42
+ { "model": "openai/gpt-5.2" }
43
+ ```
44
+
45
+ Optional services:
46
+ - `FIRECRAWL_API_KEY` for blocked sites
47
+ - `APIFY_API_TOKEN` for YouTube fallback
48
+
49
+ ## Prerequisites
50
+
51
+ Install the summarize CLI:
52
+ ```bash
53
+ brew install steipete/tap/summarize
54
+ ```
55
+ Or check https://summarize.sh/ for other installation methods.