@antaif3ng/til-work 0.1.2 → 0.2.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 (50) hide show
  1. package/README.md +256 -298
  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/session.d.ts +3 -2
  10. package/dist/core/session.d.ts.map +1 -1
  11. package/dist/core/session.js +4 -3
  12. package/dist/core/session.js.map +1 -1
  13. package/dist/core/skills.d.ts +2 -1
  14. package/dist/core/skills.d.ts.map +1 -1
  15. package/dist/core/skills.js +9 -0
  16. package/dist/core/skills.js.map +1 -1
  17. package/dist/core/system-prompt.d.ts.map +1 -1
  18. package/dist/core/system-prompt.js +4 -1
  19. package/dist/core/system-prompt.js.map +1 -1
  20. package/dist/main.d.ts.map +1 -1
  21. package/dist/main.js +66 -124
  22. package/dist/main.js.map +1 -1
  23. package/dist/modes/interactive.d.ts.map +1 -1
  24. package/dist/modes/interactive.js +272 -180
  25. package/dist/modes/interactive.js.map +1 -1
  26. package/dist/tools/browser.d.ts +10 -0
  27. package/dist/tools/browser.d.ts.map +1 -0
  28. package/dist/tools/browser.js +231 -0
  29. package/dist/tools/browser.js.map +1 -0
  30. package/dist/tools/computer.d.ts +3 -0
  31. package/dist/tools/computer.d.ts.map +1 -0
  32. package/dist/tools/computer.js +251 -0
  33. package/dist/tools/computer.js.map +1 -0
  34. package/dist/tools/index.d.ts +5 -2
  35. package/dist/tools/index.d.ts.map +1 -1
  36. package/dist/tools/index.js +11 -2
  37. package/dist/tools/index.js.map +1 -1
  38. package/dist/tools/read.d.ts.map +1 -1
  39. package/dist/tools/read.js +29 -4
  40. package/dist/tools/read.js.map +1 -1
  41. package/dist/tools/screenshot.d.ts +3 -0
  42. package/dist/tools/screenshot.d.ts.map +1 -0
  43. package/dist/tools/screenshot.js +113 -0
  44. package/dist/tools/screenshot.js.map +1 -0
  45. package/package.json +2 -1
  46. package/skills/find-skills/SKILL.md +66 -0
  47. package/skills/playwright-mcp/SKILL.md +90 -0
  48. package/skills/self-improving-agent/SKILL.md +88 -0
  49. package/skills/skill-creator/SKILL.md +93 -0
  50. package/skills/summarize/SKILL.md +55 -0
@@ -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.