From 14a50ad4aeb806d56b7c608be4c8de508543a4ad Mon Sep 17 00:00:00 2001 From: ZenchantLive Date: Wed, 18 Feb 2026 12:50:53 -0800 Subject: [PATCH] docs+skills: add main UI/UX visual-truth PRD and skill links --- .agent/skills/shadcn-ui | 1 + .agents/skills/agent-browser/SKILL.md | 288 ++ .../references/authentication.md | 297 ++ .../agent-browser/references/commands.md | 272 ++ .../agent-browser/references/proxy-support.md | 295 ++ .../references/session-management.md | 204 + .../agent-browser/references/snapshot-refs.md | 251 ++ .../references/video-recording.md | 286 ++ .../templates/authenticated-session.sh | 138 + .../templates/capture-workflow.sh | 149 + .../templates/form-automation.sh | 126 + .../skills/backtesting-frameworks/SKILL.md | 663 ++++ .agents/skills/beadboard-driver/SKILL.md | 78 + .../beadboard-driver/agents/openai.yaml | 4 + .../references/command-matrix.md | 38 + .../references/failure-modes.md | 40 + .../references/session-lifecycle.md | 33 + .../scripts/generate-agent-name.mjs | 142 + .../scripts/lib/driver-lib.mjs | 185 + .../scripts/readiness-report.mjs | 112 + .../beadboard-driver/scripts/resolve-bb.mjs | 26 + .../scripts/session-preflight.mjs | 83 + .../generate-agent-name.contract.test.mjs | 26 + .../tests/resolve-bb.contract.test.mjs | 32 + .../beadboard-driver/tests/run-tests.mjs | 23 + .../tests/session-preflight.contract.test.mjs | 43 + .agents/skills/brainstorming/SKILL.md | 53 + .agents/skills/code-review-linus/skill.md | 375 ++ .../.beads/issues.jsonl | 2 + .../hooks/block-branch-for-epic-child.sh | 68 + .../.claude/settings.json | 25 + .../create-beads-orchestration/SKILL.md | 208 + .../.github/workflows/release.yml | 54 + .../create-beads-orchestration/.gitignore | 23 + .../skills/create-beads-orchestration/LICENSE | 21 + .../create-beads-orchestration/SKILL.md | 263 ++ .../create-beads-orchestration/bootstrap.py | 928 +++++ .../docs/memory-architecture.md | 114 + .../mcp-provider-delegator/CLAUDE.md | 7 + .../mcp-provider-delegator/pyproject.toml | 25 + .../src/mcp_provider_delegator/CLAUDE.md | 7 + .../mcp_provider_delegator/agent_loader.py | 79 + .../mcp_provider_delegator/provider_client.py | 322 ++ .../src/mcp_provider_delegator/server.py | 133 + .../mcp-provider-delegator/tests/CLAUDE.md | 7 + .../tests/fixtures/CLAUDE.md | 7 + .../tests/fixtures/scout.md | 16 + .../tests/test_agent_loader.py | 26 + .../tests/test_integration.py | 38 + .../tests/test_provider_client.py | 58 + .../tests/test_server.py | 28 + .../mcp-provider-delegator/uv.lock | 815 ++++ .../create-beads-orchestration/package.json | 37 + .../screenshots/kanbanui.png | Bin 0 -> 526408 bytes .../create-beads-orchestration/scripts/cli.js | 64 + .../scripts/postinstall.js | 71 + .../create-beads-orchestration/SKILL.md | 263 ++ .../skills/subagents-discipline/SKILL.md | 158 + .../templates/CLAUDE.md | 156 + .../templates/agents/architect.md | 121 + .../templates/agents/code-reviewer.md | 248 ++ .../templates/agents/detective.md | 101 + .../templates/agents/discovery.md | 500 +++ .../templates/agents/merge-supervisor.md | 119 + .../templates/agents/scout.md | 100 + .../templates/agents/scribe.md | 96 + .../templates/beads-workflow-injection-api.md | 116 + .../templates/beads-workflow-injection-git.md | 108 + .../templates/beads-workflow-injection.md | 111 + .../templates/frontend-reviews-requirement.md | 61 + .../hooks/block-orchestrator-tools.sh | 171 + .../templates/hooks/clarify-vague-request.sh | 39 + .../hooks/enforce-bead-for-supervisor.sh | 32 + .../hooks/enforce-branch-before-edit.sh | 52 + .../hooks/enforce-concise-response.sh | 41 + .../hooks/enforce-sequential-dispatch.sh | 63 + .../hooks/inject-discipline-reminder.sh | 28 + .../templates/hooks/log-dispatch-prompt.sh | 39 + .../templates/hooks/memory-capture.sh | 104 + .../templates/hooks/nudge-claude-md-update.sh | 44 + .../templates/hooks/remind-inprogress.sh | 14 + .../templates/hooks/session-start.sh | 121 + .../templates/hooks/validate-completion.sh | 131 + .../templates/hooks/validate-epic-close.sh | 84 + .../templates/mcp.json.template | 12 + .../templates/memory/recall.sh | 121 + .../templates/settings.json | 81 + .../skills/react-best-practices/SKILL.md | 487 +++ .../skills/subagents-discipline/SKILL.md | 127 + .../templates/ui-constraints.md | 76 + .../tests/test-validate-epic-close.sh | 192 + .../dispatching-parallel-agents/SKILL.md | 180 + .../entry-signals/.pattern_history.json | 452 +++ .agents/skills/entry-signals/.skill_meta.json | 9 + .agents/skills/entry-signals/SKILL.md | 103 + .agents/skills/executing-plans/SKILL.md | 76 + .agents/skills/find-skills/SKILL.md | 133 + .../finishing-a-development-branch/SKILL.md | 200 + .../skills/linus-beads-discipline/SKILL.md | 45 + .../linus-beads-discipline/TEST-RESULTS.md | 175 + .../linus-beads-discipline/TEST-SCENARIOS.md | 98 + .../resources/BD_MASTERY.md | 246 ++ .../resources/BEADS_INTEGRATION.md | 367 ++ .../resources/BEADS_MEMORY.md | 113 + .../resources/DECISION_FRAMEWORKS.md | 240 ++ .../resources/EXAMPLES.md | 303 ++ .../resources/IRON_LAWS.md | 90 + .../resources/LINUS_PHILOSOPHY.md | 184 + .../resources/RATIONALIZATION_TABLE.md | 66 + .../resources/VERIFICATION_GATES.md | 131 + .../resources/WORKFLOW_ENGINE.md | 189 + .../linus-beads-discipline/workflows/debug.md | 105 + .../workflows/design.md | 128 + .../workflows/implement.md | 146 + .../linus-beads-discipline/workflows/plan.md | 126 + .../workflows/refactor.md | 123 + .../workflows/research.md | 91 + .../workflows/review.md | 118 + .../workflows/triage.md | 68 + .../market-regimes/.pattern_history.json | 527 +++ .../skills/market-regimes/.skill_meta.json | 9 + .agents/skills/market-regimes/SKILL.md | 257 ++ .agents/skills/mobile-fronted/skill.md | 113 + .agents/skills/penpot-uiux-design/SKILL.md | 342 ++ .../references/accessibility.md | 329 ++ .../references/component-patterns.md | 339 ++ .../references/platform-guidelines.md | 367 ++ .../references/setup-troubleshooting.md | 328 ++ .agents/skills/personas/skill.md | 196 + .agents/skills/receiving-code-review/SKILL.md | 213 + .../skills/remotion-best-practices/SKILL.md | 43 + .../remotion-best-practices/rules/3d.md | 86 + .../rules/animations.md | 29 + .../remotion-best-practices/rules/assets.md | 78 + .../rules/assets/charts-bar-chart.tsx | 173 + .../assets/text-animations-typewriter.tsx | 100 + .../assets/text-animations-word-highlight.tsx | 108 + .../remotion-best-practices/rules/audio.md | 172 + .../rules/calculate-metadata.md | 104 + .../rules/can-decode.md | 75 + .../remotion-best-practices/rules/charts.md | 58 + .../rules/compositions.md | 146 + .../rules/display-captions.md | 126 + .../rules/extract-frames.md | 229 ++ .../remotion-best-practices/rules/fonts.md | 152 + .../rules/get-audio-duration.md | 58 + .../rules/get-video-dimensions.md | 68 + .../rules/get-video-duration.md | 58 + .../remotion-best-practices/rules/gifs.md | 138 + .../remotion-best-practices/rules/images.md | 130 + .../rules/import-srt-captions.md | 67 + .../remotion-best-practices/rules/lottie.md | 68 + .../rules/measuring-dom-nodes.md | 35 + .../rules/measuring-text.md | 143 + .../rules/sequencing.md | 106 + .../remotion-best-practices/rules/tailwind.md | 11 + .../rules/text-animations.md | 20 + .../remotion-best-practices/rules/timing.md | 179 + .../rules/transcribe-captions.md | 19 + .../rules/transitions.md | 122 + .../remotion-best-practices/rules/trimming.md | 53 + .../remotion-best-practices/rules/videos.md | 171 + .../skills/requesting-code-review/SKILL.md | 105 + .../requesting-code-review/code-reviewer.md | 146 + .../skills/risk-metrics-calculation/SKILL.md | 557 +++ .agents/skills/rlm-mem/.gitignore | 4 + .agents/skills/rlm-mem/ACTIVE_SOUL.md | 38 + .../skills/rlm-mem/FRESH_AGENT_CHECKLIST.md | 155 + .agents/skills/rlm-mem/SKILL.md | 134 + .agents/skills/rlm-mem/USER.md | 1 + .agents/skills/rlm-mem/auto_memory.py | 331 ++ .agents/skills/rlm-mem/bootstrap.py | 170 + .agents/skills/rlm-mem/brain/COMPATIBILITY.md | 100 + .agents/skills/rlm-mem/brain/MASTER_SPEC.md | 270 ++ .../rlm-mem/brain/MEMORY_PROTOCOL_LEGACY.md | 130 + .agents/skills/rlm-mem/brain/MEMORY_SCHEMA.md | 137 + .../brain/audit_v2_latent_integrity.md | 78 + .../skills/rlm-mem/brain/gauges/LIVEHUD.md | 183 + .../rlm-mem/brain/personalities/BASE.md | 103 + .../brain/personalities/CREATIVE_DIRECTOR.md | 125 + .../brain/personalities/RESEARCH_ANALYST.md | 109 + .../brain/personalities/TECHNICAL_COPILOT.md | 148 + .../rlm-mem/brain/scripts/auto_linker.py | 231 ++ .../rlm-mem/brain/scripts/cache_system.py | 241 ++ .../rlm-mem/brain/scripts/chunking_engine.py | 582 +++ .../rlm-mem/brain/scripts/layered_adapter.py | 269 ++ .../brain/scripts/layered_memory_store.py | 129 + .../rlm-mem/brain/scripts/llm_client.py | 231 ++ .../rlm-mem/brain/scripts/memory_cli.py | 161 + .../rlm-mem/brain/scripts/memory_layers.py | 46 + .../rlm-mem/brain/scripts/memory_policy.py | 160 + .../rlm-mem/brain/scripts/memory_safety.py | 40 + .../rlm-mem/brain/scripts/memory_schema.py | 140 + .../rlm-mem/brain/scripts/memory_store.py | 525 +++ .../rlm-mem/brain/scripts/migration_tool.py | 129 + .../rlm-mem/brain/scripts/original_rlm_mem.py | 346 ++ .../rlm-mem/brain/scripts/reason_operation.py | 450 +++ .../rlm-mem/brain/scripts/recall_operation.py | 333 ++ .../brain/scripts/remember_operation.py | 138 + .../rlm-mem/brain/scripts/repl_environment.py | 734 ++++ .../rlm-mem/brain/scripts/repl_functions.py | 150 + .../rlm-mem/brain/scripts/test_cache.py | 116 + .../rlm-mem/brain/scripts/test_chunking.py | 476 +++ .../brain/scripts/test_final_integration.py | 127 + .../brain/scripts/test_layered_retrieval.py | 95 + .../brain/scripts/test_layered_writer.py | 107 + .../test_layered_writer_concurrency.py | 133 + .../rlm-mem/brain/scripts/test_linking.py | 203 + .../rlm-mem/brain/scripts/test_memory_cli.py | 115 + .../brain/scripts/test_memory_layers.py | 102 + .../brain/scripts/test_memory_policy.py | 136 + .../brain/scripts/test_memory_safety.py | 51 + .../scripts/test_memory_safety_enforcement.py | 104 + .../brain/scripts/test_memory_schema.py | 124 + .../brain/scripts/test_migration_tool.py | 55 + .../scripts/test_multi_agent_isolation.py | 112 + .../rlm-mem/brain/scripts/test_reason.py | 201 + .../test_reason_layered_integration.py | 68 + .../brain/scripts/test_reason_quality.py | 67 + .../rlm-mem/brain/scripts/test_recall.py | 353 ++ .../test_recall_layered_integration.py | 69 + .../brain/scripts/test_recall_ranking.py | 67 + .../rlm-mem/brain/scripts/test_remember.py | 945 +++++ .../test_remember_layered_integration.py | 85 + .../skills/rlm-mem/brain/scripts/test_repl.py | 1065 +++++ .../rlm-mem/brain/scripts/test_storage.py | 537 +++ .../rlm-mem/brain/sliders/CREATIVITY.md | 69 + .../rlm-mem/brain/sliders/DIRECTNESS.md | 69 + .agents/skills/rlm-mem/brain/sliders/HUMOR.md | 56 + .../skills/rlm-mem/brain/sliders/IDENTITY.md | 94 + .../skills/rlm-mem/brain/sliders/MORALITY.md | 67 + .agents/skills/rlm-mem/brain/sliders/SOUL.md | 78 + .../rlm-mem/brain/sliders/TECHNICALITY.md | 72 + .agents/skills/rlm-mem/brain/sliders/TOOLS.md | 88 + .agents/skills/rlm-mem/brain/sliders/USER.md | 110 + .agents/skills/rlm-mem/references/API.md | 622 +++ .../skills/rlm-mem/references/ARCHITECTURE.md | 376 ++ .../scripts/check_no_runtime_duplicates.py | 79 + .../scripts/check_skill_only_integrity.py | 65 + .agents/skills/rlm-mem/scripts/manage_soul.py | 108 + .agents/skills/rlm-mem/scripts/manage_user.py | 52 + .../skills/rlm-mem/scripts/setup_rlm_mem.py | 104 + .agents/skills/rlm-mem/souls/linus_soul.md | 38 + .agents/skills/shadcn-ui/SKILL.md | 1930 +++++++++ .agents/skills/shadcn-ui/references/chart.md | 306 ++ .agents/skills/shadcn-ui/references/learn.md | 145 + .../references/official-ui-reference.md | 1725 +++++++++ .../skills/shadcn-ui/references/reference.md | 586 +++ .../shadcn-ui/references/ui-reference.md | 1578 ++++++++ .../subagent-driven-development/SKILL.md | 240 ++ .../code-quality-reviewer-prompt.md | 20 + .../implementer-prompt.md | 78 + .../spec-reviewer-prompt.md | 61 + .../systematic-debugging/CREATION-LOG.md | 119 + .agents/skills/systematic-debugging/SKILL.md | 296 ++ .../condition-based-waiting-example.ts | 158 + .../condition-based-waiting.md | 111 + .../systematic-debugging/defense-in-depth.md | 122 + .../systematic-debugging/find-polluter.sh | 63 + .../root-cause-tracing.md | 169 + .../systematic-debugging/test-academic.md | 14 + .../systematic-debugging/test-pressure-1.md | 58 + .../systematic-debugging/test-pressure-2.md | 68 + .../systematic-debugging/test-pressure-3.md | 69 + .../skills/test-driven-development/SKILL.md | 371 ++ .../testing-anti-patterns.md | 299 ++ .../tradelab-backtest-interpretation/SKILL.md | 47 + .../skills/tradelab-iteration-policy/SKILL.md | 39 + .../tradelab-saveStrategy-contract/SKILL.md | 46 + .../trading-wisdom/.pattern_history.json | 3443 +++++++++++++++++ .../skills/trading-wisdom/.skill_meta.json | 9 + .agents/skills/trading-wisdom/SKILL.md | 389 ++ .agents/skills/using-git-worktrees/SKILL.md | 217 ++ .agents/skills/using-superpowers/SKILL.md | 87 + .../verification-before-completion/SKILL.md | 139 + .agents/skills/writing-plans/SKILL.md | 116 + .agents/skills/writing-skills/SKILL.md | 655 ++++ .../anthropic-best-practices.md | 1150 ++++++ .../examples/CLAUDE_MD_TESTING.md | 189 + .../writing-skills/graphviz-conventions.dot | 172 + .../writing-skills/persuasion-principles.md | 187 + .../skills/writing-skills/render-graphs.js | 168 + .../testing-skills-with-subagents.md | 384 ++ .augment/skills/shadcn-ui | 1 + .claude/skills/shadcn-ui | 1 + .cline/skills/shadcn-ui | 1 + .openhands/skills/shadcn-ui | 1 + .../2026-02-18-main-ui-ux-visual-truth-prd.md | 240 ++ skills/shadcn-ui | 1 + 289 files changed, 54463 insertions(+) create mode 120000 .agent/skills/shadcn-ui create mode 100644 .agents/skills/agent-browser/SKILL.md create mode 100644 .agents/skills/agent-browser/references/authentication.md create mode 100644 .agents/skills/agent-browser/references/commands.md create mode 100644 .agents/skills/agent-browser/references/proxy-support.md create mode 100644 .agents/skills/agent-browser/references/session-management.md create mode 100644 .agents/skills/agent-browser/references/snapshot-refs.md create mode 100644 .agents/skills/agent-browser/references/video-recording.md create mode 100644 .agents/skills/agent-browser/templates/authenticated-session.sh create mode 100644 .agents/skills/agent-browser/templates/capture-workflow.sh create mode 100644 .agents/skills/agent-browser/templates/form-automation.sh create mode 100644 .agents/skills/backtesting-frameworks/SKILL.md create mode 100644 .agents/skills/beadboard-driver/SKILL.md create mode 100644 .agents/skills/beadboard-driver/agents/openai.yaml create mode 100644 .agents/skills/beadboard-driver/references/command-matrix.md create mode 100644 .agents/skills/beadboard-driver/references/failure-modes.md create mode 100644 .agents/skills/beadboard-driver/references/session-lifecycle.md create mode 100644 .agents/skills/beadboard-driver/scripts/generate-agent-name.mjs create mode 100644 .agents/skills/beadboard-driver/scripts/lib/driver-lib.mjs create mode 100644 .agents/skills/beadboard-driver/scripts/readiness-report.mjs create mode 100644 .agents/skills/beadboard-driver/scripts/resolve-bb.mjs create mode 100644 .agents/skills/beadboard-driver/scripts/session-preflight.mjs create mode 100644 .agents/skills/beadboard-driver/tests/generate-agent-name.contract.test.mjs create mode 100644 .agents/skills/beadboard-driver/tests/resolve-bb.contract.test.mjs create mode 100644 .agents/skills/beadboard-driver/tests/run-tests.mjs create mode 100644 .agents/skills/beadboard-driver/tests/session-preflight.contract.test.mjs create mode 100644 .agents/skills/brainstorming/SKILL.md create mode 100644 .agents/skills/code-review-linus/skill.md create mode 100644 .agents/skills/create-beads-orchestration/.beads/issues.jsonl create mode 100644 .agents/skills/create-beads-orchestration/.claude/hooks/block-branch-for-epic-child.sh create mode 100644 .agents/skills/create-beads-orchestration/.claude/settings.json create mode 100644 .agents/skills/create-beads-orchestration/.claude/skills/create-beads-orchestration/SKILL.md create mode 100644 .agents/skills/create-beads-orchestration/.github/workflows/release.yml create mode 100644 .agents/skills/create-beads-orchestration/.gitignore create mode 100644 .agents/skills/create-beads-orchestration/LICENSE create mode 100644 .agents/skills/create-beads-orchestration/SKILL.md create mode 100644 .agents/skills/create-beads-orchestration/bootstrap.py create mode 100644 .agents/skills/create-beads-orchestration/docs/memory-architecture.md create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/CLAUDE.md create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/pyproject.toml create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/src/mcp_provider_delegator/CLAUDE.md create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/src/mcp_provider_delegator/agent_loader.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/src/mcp_provider_delegator/provider_client.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/src/mcp_provider_delegator/server.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/CLAUDE.md create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/fixtures/CLAUDE.md create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/fixtures/scout.md create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/test_agent_loader.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/test_integration.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/test_provider_client.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/tests/test_server.py create mode 100644 .agents/skills/create-beads-orchestration/mcp-provider-delegator/uv.lock create mode 100644 .agents/skills/create-beads-orchestration/package.json create mode 100644 .agents/skills/create-beads-orchestration/screenshots/kanbanui.png create mode 100644 .agents/skills/create-beads-orchestration/scripts/cli.js create mode 100644 .agents/skills/create-beads-orchestration/scripts/postinstall.js create mode 100644 .agents/skills/create-beads-orchestration/skills/create-beads-orchestration/SKILL.md create mode 100644 .agents/skills/create-beads-orchestration/skills/subagents-discipline/SKILL.md create mode 100644 .agents/skills/create-beads-orchestration/templates/CLAUDE.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/architect.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/code-reviewer.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/detective.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/discovery.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/merge-supervisor.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/scout.md create mode 100644 .agents/skills/create-beads-orchestration/templates/agents/scribe.md create mode 100644 .agents/skills/create-beads-orchestration/templates/beads-workflow-injection-api.md create mode 100644 .agents/skills/create-beads-orchestration/templates/beads-workflow-injection-git.md create mode 100644 .agents/skills/create-beads-orchestration/templates/beads-workflow-injection.md create mode 100644 .agents/skills/create-beads-orchestration/templates/frontend-reviews-requirement.md create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/block-orchestrator-tools.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/clarify-vague-request.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/enforce-bead-for-supervisor.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/enforce-branch-before-edit.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/enforce-concise-response.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/enforce-sequential-dispatch.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/inject-discipline-reminder.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/log-dispatch-prompt.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/memory-capture.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/nudge-claude-md-update.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/remind-inprogress.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/session-start.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/validate-completion.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/hooks/validate-epic-close.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/mcp.json.template create mode 100644 .agents/skills/create-beads-orchestration/templates/memory/recall.sh create mode 100644 .agents/skills/create-beads-orchestration/templates/settings.json create mode 100644 .agents/skills/create-beads-orchestration/templates/skills/react-best-practices/SKILL.md create mode 100644 .agents/skills/create-beads-orchestration/templates/skills/subagents-discipline/SKILL.md create mode 100644 .agents/skills/create-beads-orchestration/templates/ui-constraints.md create mode 100644 .agents/skills/create-beads-orchestration/tests/test-validate-epic-close.sh create mode 100644 .agents/skills/dispatching-parallel-agents/SKILL.md create mode 100644 .agents/skills/entry-signals/.pattern_history.json create mode 100644 .agents/skills/entry-signals/.skill_meta.json create mode 100644 .agents/skills/entry-signals/SKILL.md create mode 100644 .agents/skills/executing-plans/SKILL.md create mode 100644 .agents/skills/find-skills/SKILL.md create mode 100644 .agents/skills/finishing-a-development-branch/SKILL.md create mode 100644 .agents/skills/linus-beads-discipline/SKILL.md create mode 100644 .agents/skills/linus-beads-discipline/TEST-RESULTS.md create mode 100644 .agents/skills/linus-beads-discipline/TEST-SCENARIOS.md create mode 100644 .agents/skills/linus-beads-discipline/resources/BD_MASTERY.md create mode 100644 .agents/skills/linus-beads-discipline/resources/BEADS_INTEGRATION.md create mode 100644 .agents/skills/linus-beads-discipline/resources/BEADS_MEMORY.md create mode 100644 .agents/skills/linus-beads-discipline/resources/DECISION_FRAMEWORKS.md create mode 100644 .agents/skills/linus-beads-discipline/resources/EXAMPLES.md create mode 100644 .agents/skills/linus-beads-discipline/resources/IRON_LAWS.md create mode 100644 .agents/skills/linus-beads-discipline/resources/LINUS_PHILOSOPHY.md create mode 100644 .agents/skills/linus-beads-discipline/resources/RATIONALIZATION_TABLE.md create mode 100644 .agents/skills/linus-beads-discipline/resources/VERIFICATION_GATES.md create mode 100644 .agents/skills/linus-beads-discipline/resources/WORKFLOW_ENGINE.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/debug.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/design.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/implement.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/plan.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/refactor.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/research.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/review.md create mode 100644 .agents/skills/linus-beads-discipline/workflows/triage.md create mode 100644 .agents/skills/market-regimes/.pattern_history.json create mode 100644 .agents/skills/market-regimes/.skill_meta.json create mode 100644 .agents/skills/market-regimes/SKILL.md create mode 100644 .agents/skills/mobile-fronted/skill.md create mode 100644 .agents/skills/penpot-uiux-design/SKILL.md create mode 100644 .agents/skills/penpot-uiux-design/references/accessibility.md create mode 100644 .agents/skills/penpot-uiux-design/references/component-patterns.md create mode 100644 .agents/skills/penpot-uiux-design/references/platform-guidelines.md create mode 100644 .agents/skills/penpot-uiux-design/references/setup-troubleshooting.md create mode 100644 .agents/skills/personas/skill.md create mode 100644 .agents/skills/receiving-code-review/SKILL.md create mode 100644 .agents/skills/remotion-best-practices/SKILL.md create mode 100644 .agents/skills/remotion-best-practices/rules/3d.md create mode 100644 .agents/skills/remotion-best-practices/rules/animations.md create mode 100644 .agents/skills/remotion-best-practices/rules/assets.md create mode 100644 .agents/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx create mode 100644 .agents/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx create mode 100644 .agents/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx create mode 100644 .agents/skills/remotion-best-practices/rules/audio.md create mode 100644 .agents/skills/remotion-best-practices/rules/calculate-metadata.md create mode 100644 .agents/skills/remotion-best-practices/rules/can-decode.md create mode 100644 .agents/skills/remotion-best-practices/rules/charts.md create mode 100644 .agents/skills/remotion-best-practices/rules/compositions.md create mode 100644 .agents/skills/remotion-best-practices/rules/display-captions.md create mode 100644 .agents/skills/remotion-best-practices/rules/extract-frames.md create mode 100644 .agents/skills/remotion-best-practices/rules/fonts.md create mode 100644 .agents/skills/remotion-best-practices/rules/get-audio-duration.md create mode 100644 .agents/skills/remotion-best-practices/rules/get-video-dimensions.md create mode 100644 .agents/skills/remotion-best-practices/rules/get-video-duration.md create mode 100644 .agents/skills/remotion-best-practices/rules/gifs.md create mode 100644 .agents/skills/remotion-best-practices/rules/images.md create mode 100644 .agents/skills/remotion-best-practices/rules/import-srt-captions.md create mode 100644 .agents/skills/remotion-best-practices/rules/lottie.md create mode 100644 .agents/skills/remotion-best-practices/rules/measuring-dom-nodes.md create mode 100644 .agents/skills/remotion-best-practices/rules/measuring-text.md create mode 100644 .agents/skills/remotion-best-practices/rules/sequencing.md create mode 100644 .agents/skills/remotion-best-practices/rules/tailwind.md create mode 100644 .agents/skills/remotion-best-practices/rules/text-animations.md create mode 100644 .agents/skills/remotion-best-practices/rules/timing.md create mode 100644 .agents/skills/remotion-best-practices/rules/transcribe-captions.md create mode 100644 .agents/skills/remotion-best-practices/rules/transitions.md create mode 100644 .agents/skills/remotion-best-practices/rules/trimming.md create mode 100644 .agents/skills/remotion-best-practices/rules/videos.md create mode 100644 .agents/skills/requesting-code-review/SKILL.md create mode 100644 .agents/skills/requesting-code-review/code-reviewer.md create mode 100644 .agents/skills/risk-metrics-calculation/SKILL.md create mode 100644 .agents/skills/rlm-mem/.gitignore create mode 100644 .agents/skills/rlm-mem/ACTIVE_SOUL.md create mode 100644 .agents/skills/rlm-mem/FRESH_AGENT_CHECKLIST.md create mode 100644 .agents/skills/rlm-mem/SKILL.md create mode 100644 .agents/skills/rlm-mem/USER.md create mode 100644 .agents/skills/rlm-mem/auto_memory.py create mode 100644 .agents/skills/rlm-mem/bootstrap.py create mode 100644 .agents/skills/rlm-mem/brain/COMPATIBILITY.md create mode 100644 .agents/skills/rlm-mem/brain/MASTER_SPEC.md create mode 100644 .agents/skills/rlm-mem/brain/MEMORY_PROTOCOL_LEGACY.md create mode 100644 .agents/skills/rlm-mem/brain/MEMORY_SCHEMA.md create mode 100644 .agents/skills/rlm-mem/brain/audit_v2_latent_integrity.md create mode 100644 .agents/skills/rlm-mem/brain/gauges/LIVEHUD.md create mode 100644 .agents/skills/rlm-mem/brain/personalities/BASE.md create mode 100644 .agents/skills/rlm-mem/brain/personalities/CREATIVE_DIRECTOR.md create mode 100644 .agents/skills/rlm-mem/brain/personalities/RESEARCH_ANALYST.md create mode 100644 .agents/skills/rlm-mem/brain/personalities/TECHNICAL_COPILOT.md create mode 100644 .agents/skills/rlm-mem/brain/scripts/auto_linker.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/cache_system.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/chunking_engine.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/layered_adapter.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/layered_memory_store.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/llm_client.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/memory_cli.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/memory_layers.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/memory_policy.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/memory_safety.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/memory_schema.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/memory_store.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/migration_tool.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/original_rlm_mem.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/reason_operation.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/recall_operation.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/remember_operation.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/repl_environment.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/repl_functions.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_cache.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_chunking.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_final_integration.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_layered_retrieval.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_layered_writer.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_layered_writer_concurrency.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_linking.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_memory_cli.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_memory_layers.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_memory_policy.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_memory_safety.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_memory_safety_enforcement.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_memory_schema.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_migration_tool.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_multi_agent_isolation.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_reason.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_reason_layered_integration.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_reason_quality.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_recall.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_recall_layered_integration.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_recall_ranking.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_remember.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_remember_layered_integration.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_repl.py create mode 100644 .agents/skills/rlm-mem/brain/scripts/test_storage.py create mode 100644 .agents/skills/rlm-mem/brain/sliders/CREATIVITY.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/DIRECTNESS.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/HUMOR.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/IDENTITY.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/MORALITY.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/SOUL.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/TECHNICALITY.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/TOOLS.md create mode 100644 .agents/skills/rlm-mem/brain/sliders/USER.md create mode 100644 .agents/skills/rlm-mem/references/API.md create mode 100644 .agents/skills/rlm-mem/references/ARCHITECTURE.md create mode 100644 .agents/skills/rlm-mem/scripts/check_no_runtime_duplicates.py create mode 100644 .agents/skills/rlm-mem/scripts/check_skill_only_integrity.py create mode 100644 .agents/skills/rlm-mem/scripts/manage_soul.py create mode 100644 .agents/skills/rlm-mem/scripts/manage_user.py create mode 100644 .agents/skills/rlm-mem/scripts/setup_rlm_mem.py create mode 100644 .agents/skills/rlm-mem/souls/linus_soul.md create mode 100644 .agents/skills/shadcn-ui/SKILL.md create mode 100644 .agents/skills/shadcn-ui/references/chart.md create mode 100644 .agents/skills/shadcn-ui/references/learn.md create mode 100644 .agents/skills/shadcn-ui/references/official-ui-reference.md create mode 100644 .agents/skills/shadcn-ui/references/reference.md create mode 100644 .agents/skills/shadcn-ui/references/ui-reference.md create mode 100644 .agents/skills/subagent-driven-development/SKILL.md create mode 100644 .agents/skills/subagent-driven-development/code-quality-reviewer-prompt.md create mode 100644 .agents/skills/subagent-driven-development/implementer-prompt.md create mode 100644 .agents/skills/subagent-driven-development/spec-reviewer-prompt.md create mode 100644 .agents/skills/systematic-debugging/CREATION-LOG.md create mode 100644 .agents/skills/systematic-debugging/SKILL.md create mode 100644 .agents/skills/systematic-debugging/condition-based-waiting-example.ts create mode 100644 .agents/skills/systematic-debugging/condition-based-waiting.md create mode 100644 .agents/skills/systematic-debugging/defense-in-depth.md create mode 100644 .agents/skills/systematic-debugging/find-polluter.sh create mode 100644 .agents/skills/systematic-debugging/root-cause-tracing.md create mode 100644 .agents/skills/systematic-debugging/test-academic.md create mode 100644 .agents/skills/systematic-debugging/test-pressure-1.md create mode 100644 .agents/skills/systematic-debugging/test-pressure-2.md create mode 100644 .agents/skills/systematic-debugging/test-pressure-3.md create mode 100644 .agents/skills/test-driven-development/SKILL.md create mode 100644 .agents/skills/test-driven-development/testing-anti-patterns.md create mode 100644 .agents/skills/tradelab-backtest-interpretation/SKILL.md create mode 100644 .agents/skills/tradelab-iteration-policy/SKILL.md create mode 100644 .agents/skills/tradelab-saveStrategy-contract/SKILL.md create mode 100644 .agents/skills/trading-wisdom/.pattern_history.json create mode 100644 .agents/skills/trading-wisdom/.skill_meta.json create mode 100644 .agents/skills/trading-wisdom/SKILL.md create mode 100644 .agents/skills/using-git-worktrees/SKILL.md create mode 100644 .agents/skills/using-superpowers/SKILL.md create mode 100644 .agents/skills/verification-before-completion/SKILL.md create mode 100644 .agents/skills/writing-plans/SKILL.md create mode 100644 .agents/skills/writing-skills/SKILL.md create mode 100644 .agents/skills/writing-skills/anthropic-best-practices.md create mode 100644 .agents/skills/writing-skills/examples/CLAUDE_MD_TESTING.md create mode 100644 .agents/skills/writing-skills/graphviz-conventions.dot create mode 100644 .agents/skills/writing-skills/persuasion-principles.md create mode 100644 .agents/skills/writing-skills/render-graphs.js create mode 100644 .agents/skills/writing-skills/testing-skills-with-subagents.md create mode 120000 .augment/skills/shadcn-ui create mode 120000 .claude/skills/shadcn-ui create mode 120000 .cline/skills/shadcn-ui create mode 120000 .openhands/skills/shadcn-ui create mode 100644 docs/plans/2026-02-18-main-ui-ux-visual-truth-prd.md create mode 120000 skills/shadcn-ui diff --git a/.agent/skills/shadcn-ui b/.agent/skills/shadcn-ui new file mode 120000 index 0000000..3223608 --- /dev/null +++ b/.agent/skills/shadcn-ui @@ -0,0 +1 @@ +/mnt/c/Users/Zenchant/codex/beadboard/.agents/skills/shadcn-ui/ \ No newline at end of file diff --git a/.agents/skills/agent-browser/SKILL.md b/.agents/skills/agent-browser/SKILL.md new file mode 100644 index 0000000..0cd7894 --- /dev/null +++ b/.agents/skills/agent-browser/SKILL.md @@ -0,0 +1,288 @@ +--- +name: agent-browser +description: | + Browser automation for AI agents via inference.sh. + Navigate web pages, interact with elements using @e refs, take screenshots, record video. + Capabilities: web scraping, form filling, clicking, typing, drag-drop, file upload, JavaScript execution. + Use for: web automation, data extraction, testing, agent browsing, research. + Triggers: browser, web automation, scrape, navigate, click, fill form, screenshot, + browse web, playwright, headless browser, web agent, surf internet, record video +allowed-tools: Bash(infsh *) +--- + +# Agentic Browser + +![Agentic Browser](https://cloud.inference.sh/app/files/u/4mg21r6ta37mpaz6ktzwtt8krr/01kgjw8atdxgkrsr8a2t5peq7b.jpeg) + +Browser automation for AI agents via [inference.sh](https://inference.sh). Uses Playwright under the hood with a simple `@e` ref system for element interaction. + +## Quick Start + +```bash +# Install CLI +curl -fsSL https://cli.inference.sh | sh && infsh login + +# Open a page and get interactive elements +infsh app run agent-browser --function open --input '{"url": "https://example.com"}' --session new +``` + +## Core Workflow + +Every browser automation follows this pattern: + +1. **Open** - Navigate to URL, get `@e` refs for elements +2. **Interact** - Use refs to click, fill, drag, etc. +3. **Re-snapshot** - After navigation/changes, get fresh refs +4. **Close** - End session (returns video if recording) + +```bash +# 1. Start session +RESULT=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com/login" +}') +SESSION_ID=$(echo $RESULT | jq -r '.session_id') +# Elements: @e1 [input] "Email", @e2 [input] "Password", @e3 [button] "Sign In" + +# 2. Fill and submit +infsh app run agent-browser --function interact --session $SESSION_ID --input '{ + "action": "fill", "ref": "@e1", "text": "user@example.com" +}' +infsh app run agent-browser --function interact --session $SESSION_ID --input '{ + "action": "fill", "ref": "@e2", "text": "password123" +}' +infsh app run agent-browser --function interact --session $SESSION_ID --input '{ + "action": "click", "ref": "@e3" +}' + +# 3. Re-snapshot after navigation +infsh app run agent-browser --function snapshot --session $SESSION_ID --input '{}' + +# 4. Close when done +infsh app run agent-browser --function close --session $SESSION_ID --input '{}' +``` + +## Functions + +| Function | Description | +|----------|-------------| +| `open` | Navigate to URL, configure browser (viewport, proxy, video recording) | +| `snapshot` | Re-fetch page state with `@e` refs after DOM changes | +| `interact` | Perform actions using `@e` refs (click, fill, drag, upload, etc.) | +| `screenshot` | Take page screenshot (viewport or full page) | +| `execute` | Run JavaScript code on the page | +| `close` | Close session, returns video if recording was enabled | + +## Interact Actions + +| Action | Description | Required Fields | +|--------|-------------|-----------------| +| `click` | Click element | `ref` | +| `dblclick` | Double-click element | `ref` | +| `fill` | Clear and type text | `ref`, `text` | +| `type` | Type text (no clear) | `text` | +| `press` | Press key (Enter, Tab, etc.) | `text` | +| `select` | Select dropdown option | `ref`, `text` | +| `hover` | Hover over element | `ref` | +| `check` | Check checkbox | `ref` | +| `uncheck` | Uncheck checkbox | `ref` | +| `drag` | Drag and drop | `ref`, `target_ref` | +| `upload` | Upload file(s) | `ref`, `file_paths` | +| `scroll` | Scroll page | `direction` (up/down/left/right), `scroll_amount` | +| `back` | Go back in history | - | +| `wait` | Wait milliseconds | `wait_ms` | +| `goto` | Navigate to URL | `url` | + +## Element Refs + +Elements are returned with `@e` refs: + +``` +@e1 [a] "Home" href="/" +@e2 [input type="text"] placeholder="Search" +@e3 [button] "Submit" +@e4 [select] "Choose option" +@e5 [input type="checkbox"] name="agree" +``` + +**Important:** Refs are invalidated after navigation. Always re-snapshot after: +- Clicking links/buttons that navigate +- Form submissions +- Dynamic content loading + +## Features + +### Video Recording + +Record browser sessions for debugging or documentation: + +```bash +# Start with recording enabled (optionally show cursor indicator) +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "record_video": true, + "show_cursor": true +}' | jq -r '.session_id') + +# ... perform actions ... + +# Close to get the video file +infsh app run agent-browser --function close --session $SESSION --input '{}' +# Returns: {"success": true, "video": } +``` + +### Cursor Indicator + +Show a visible cursor in screenshots and video (useful for demos): + +```bash +infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "show_cursor": true, + "record_video": true +}' +``` + +The cursor appears as a red dot that follows mouse movements and shows click feedback. + +### Proxy Support + +Route traffic through a proxy server: + +```bash +infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "proxy_url": "http://proxy.example.com:8080", + "proxy_username": "user", + "proxy_password": "pass" +}' +``` + +### File Upload + +Upload files to file inputs: + +```bash +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "upload", + "ref": "@e5", + "file_paths": ["/path/to/file.pdf"] +}' +``` + +### Drag and Drop + +Drag elements to targets: + +```bash +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "drag", + "ref": "@e1", + "target_ref": "@e2" +}' +``` + +### JavaScript Execution + +Run custom JavaScript: + +```bash +infsh app run agent-browser --function execute --session $SESSION --input '{ + "code": "document.querySelectorAll(\"h2\").length" +}' +# Returns: {"result": "5", "screenshot": } +``` + +## Deep-Dive Documentation + +| Reference | Description | +|-----------|-------------| +| [references/commands.md](references/commands.md) | Full function reference with all options | +| [references/snapshot-refs.md](references/snapshot-refs.md) | Ref lifecycle, invalidation rules, troubleshooting | +| [references/session-management.md](references/session-management.md) | Session persistence, parallel sessions | +| [references/authentication.md](references/authentication.md) | Login flows, OAuth, 2FA handling | +| [references/video-recording.md](references/video-recording.md) | Recording workflows for debugging | +| [references/proxy-support.md](references/proxy-support.md) | Proxy configuration, geo-testing | + +## Ready-to-Use Templates + +| Template | Description | +|----------|-------------| +| [templates/form-automation.sh](templates/form-automation.sh) | Form filling with validation | +| [templates/authenticated-session.sh](templates/authenticated-session.sh) | Login once, reuse session | +| [templates/capture-workflow.sh](templates/capture-workflow.sh) | Content extraction with screenshots | + +## Examples + +### Form Submission + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com/contact" +}' | jq -r '.session_id') + +# Get elements: @e1 [input] "Name", @e2 [input] "Email", @e3 [textarea], @e4 [button] "Send" + +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e1", "text": "John Doe"}' +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e2", "text": "john@example.com"}' +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e3", "text": "Hello!"}' +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "click", "ref": "@e4"}' + +infsh app run agent-browser --function snapshot --session $SESSION --input '{}' +infsh app run agent-browser --function close --session $SESSION --input '{}' +``` + +### Search and Extract + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://google.com" +}' | jq -r '.session_id') + +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e1", "text": "weather today"}' +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "press", "text": "Enter"}' +infsh app run agent-browser --function interact --session $SESSION --input '{"action": "wait", "wait_ms": 2000}' + +infsh app run agent-browser --function snapshot --session $SESSION --input '{}' +infsh app run agent-browser --function close --session $SESSION --input '{}' +``` + +### Screenshot with Video + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "record_video": true +}' | jq -r '.session_id') + +# Take full page screenshot +infsh app run agent-browser --function screenshot --session $SESSION --input '{ + "full_page": true +}' + +# Close and get video +RESULT=$(infsh app run agent-browser --function close --session $SESSION --input '{}') +echo $RESULT | jq '.video' +``` + +## Sessions + +Browser state persists within a session. Always: + +1. Start with `--session new` on first call +2. Use returned `session_id` for subsequent calls +3. Close session when done + +## Related Skills + +```bash +# Web search (for research + browse) +npx skills add inferencesh/skills@web-search + +# LLM models (analyze extracted content) +npx skills add inferencesh/skills@llm-models +``` + +## Documentation + +- [inference.sh Sessions](https://inference.sh/docs/extend/sessions) - Session management +- [Multi-function Apps](https://inference.sh/docs/extend/multi-function-apps) - How functions work diff --git a/.agents/skills/agent-browser/references/authentication.md b/.agents/skills/agent-browser/references/authentication.md new file mode 100644 index 0000000..c3a534b --- /dev/null +++ b/.agents/skills/agent-browser/references/authentication.md @@ -0,0 +1,297 @@ +# Authentication Patterns + +Login flows, OAuth, 2FA, and authenticated browsing. + +**Related**: [session-management.md](session-management.md) for session details, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Basic Login Flow](#basic-login-flow) +- [OAuth / SSO Flows](#oauth--sso-flows) +- [Two-Factor Authentication](#two-factor-authentication) +- [Session Reuse Patterns](#session-reuse-patterns) +- [Cookie Extraction](#cookie-extraction) +- [Security Best Practices](#security-best-practices) + +## Basic Login Flow + +Standard username/password login: + +```bash +#!/bin/bash + +# Start session +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://app.example.com/login" +}' | jq -r '.session_id') + +# Get form elements +# Expected: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Sign In" + +# Fill credentials +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "fill", "ref": "@e1", "text": "user@example.com" +}' + +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "fill", "ref": "@e2", "text": "'"$PASSWORD"'" +}' + +# Submit +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e3" +}' + +# Wait for redirect +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "wait", "wait_ms": 2000 +}' + +# Verify login succeeded +RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION --input '{}') +URL=$(echo $RESULT | jq -r '.url') + +if [[ "$URL" == *"/login"* ]]; then + echo "Login failed - still on login page" + exit 1 +fi + +echo "Login successful" +# Continue with authenticated actions... +``` + +## OAuth / SSO Flows + +For OAuth redirects (Google, GitHub, etc.): + +```bash +#!/bin/bash + +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://app.example.com/auth/google" +}' | jq -r '.session_id') + +# Wait for redirect to Google +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "wait", "wait_ms": 3000 +}' + +# Snapshot to see Google login form +RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION --input '{}') +echo $RESULT | jq '.elements_text' + +# Fill Google email +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "fill", "ref": "@e1", "text": "user@gmail.com" +}' + +# Click Next +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e2" +}' + +# Wait and snapshot for password field +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "wait", "wait_ms": 2000 +}' +RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION --input '{}') + +# Fill password +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "fill", "ref": "@e1", "text": "'"$GOOGLE_PASSWORD"'" +}' + +# Click Sign in +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e2" +}' + +# Wait for redirect back to app +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "wait", "wait_ms": 5000 +}' + +# Verify we're back on the app +RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION --input '{}') +URL=$(echo $RESULT | jq -r '.url') +echo "Final URL: $URL" +``` + +## Two-Factor Authentication + +For 2FA, you may need human intervention or TOTP generation: + +### With TOTP Code + +```bash +# After password, check for 2FA prompt +RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION --input '{}') +ELEMENTS=$(echo $RESULT | jq -r '.elements_text') + +if echo "$ELEMENTS" | grep -qi "verification\|2fa\|authenticator"; then + # Generate TOTP code (requires oathtool) + TOTP_CODE=$(oathtool --totp -b "$TOTP_SECRET") + + # Fill 2FA code + infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "fill", "ref": "@e1", "text": "'"$TOTP_CODE"'" + }' + + # Submit + infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e2" + }' +fi +``` + +### With Manual Intervention + +For SMS or hardware token 2FA: + +```bash +# Record video so user can see the 2FA prompt +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://app.example.com/login", + "record_video": true +}' | jq -r '.session_id') + +# ... login flow ... + +# At 2FA step, prompt user +echo "2FA code sent. Enter the code:" +read -r CODE + +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "fill", "ref": "@e1", "text": "'"$CODE"'" +}' +``` + +## Session Reuse Patterns + +Since sessions maintain cookies, you can reuse authenticated sessions: + +```bash +#!/bin/bash +# login-and-work.sh + +# Login once +login() { + SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://app.example.com/login" + }' | jq -r '.session_id') + + # ... login steps ... + + echo $SESSION +} + +# Do work with authenticated session +do_work() { + local SESSION=$1 + + # Navigate to protected page + infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "goto", "url": "https://app.example.com/dashboard" + }' + + # Extract data + infsh app run agent-browser --function snapshot --session $SESSION --input '{}' +} + +# Main +SESSION=$(login) +do_work $SESSION + +# Don't close if you want to reuse! +# infsh app run agent-browser --function close --session $SESSION --input '{}' +``` + +## Cookie Extraction + +Extract cookies for use in other tools: + +```bash +# Get cookies via JavaScript +RESULT=$(infsh app run agent-browser --function execute --session $SESSION --input '{ + "code": "document.cookie" +}') +COOKIES=$(echo $RESULT | jq -r '.result') +echo "Cookies: $COOKIES" + +# Get all cookies including httpOnly (more complete) +RESULT=$(infsh app run agent-browser --function execute --session $SESSION --input '{ + "code": "JSON.stringify(performance.getEntriesByType(\"resource\").map(r => r.name))" +}') +``` + +## Security Best Practices + +### 1. Never Hardcode Credentials + +```bash +# Good: Use environment variables +'{"action": "fill", "ref": "@e2", "text": "'"$PASSWORD"'"}' + +# Bad: Hardcoded +'{"action": "fill", "ref": "@e2", "text": "mypassword123"}' +``` + +### 2. Use Secure Environment Variables + +```bash +# Set securely +export PASSWORD=$(cat /path/to/secure/password) + +# Or use a secrets manager +export PASSWORD=$(vault read -field=password secret/app) +``` + +### 3. Don't Log Sensitive Data + +```bash +# Good: Redact sensitive info +echo "Logging in as $USERNAME" + +# Bad: Logging passwords +echo "Password: $PASSWORD" # Never do this! +``` + +### 4. Close Sessions After Use + +```bash +# Always clean up +trap 'infsh app run agent-browser --function close --session $SESSION --input "{}" 2>/dev/null' EXIT +``` + +### 5. Use Video Recording for Debugging Only + +Video may capture sensitive information: + +```bash +# Only enable when debugging +if [ "$DEBUG" = "true" ]; then + RECORD_VIDEO="true" +else + RECORD_VIDEO="false" +fi +``` + +### 6. Verify Login Success + +Always confirm authentication worked: + +```bash +# Check URL changed from login page +URL=$(echo $RESULT | jq -r '.url') +if [[ "$URL" == *"/login"* ]] || [[ "$URL" == *"/signin"* ]]; then + echo "ERROR: Login failed" + exit 1 +fi + +# Or check for specific element on authenticated page +ELEMENTS=$(echo $RESULT | jq -r '.elements_text') +if ! echo "$ELEMENTS" | grep -q "Logout\|Dashboard\|Welcome"; then + echo "ERROR: Not authenticated" + exit 1 +fi +``` diff --git a/.agents/skills/agent-browser/references/commands.md b/.agents/skills/agent-browser/references/commands.md new file mode 100644 index 0000000..8737107 --- /dev/null +++ b/.agents/skills/agent-browser/references/commands.md @@ -0,0 +1,272 @@ +# Command Reference + +Complete reference for all agent-browser functions. For quick start, see [SKILL.md](../SKILL.md). + +## Base Command + +All commands follow this pattern: + +```bash +infsh app run agent-browser --function --session --input '' +``` + +- `--function`: Function to call (open, snapshot, interact, screenshot, execute, close) +- `--session`: Session ID from previous call, or `new` to start fresh +- `--input`: JSON input for the function + +## Functions + +### open + +Navigate to URL and configure browser. This is the entry point for all sessions. + +```bash +infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "width": 1280, + "height": 720, + "user_agent": "Mozilla/5.0...", + "record_video": false, + "show_cursor": false, + "proxy_url": null, + "proxy_username": null, + "proxy_password": null +}' +``` + +**Input Fields:** + +| Field | Type | Default | Description | +|-------|------|---------|-------------| +| `url` | string | required | URL to navigate to | +| `width` | int | 1280 | Viewport width in pixels | +| `height` | int | 720 | Viewport height in pixels | +| `user_agent` | string | null | Custom user agent string | +| `record_video` | bool | false | Record video (returned on close) | +| `show_cursor` | bool | false | Show cursor indicator in screenshots/video | +| `proxy_url` | string | null | Proxy server URL | +| `proxy_username` | string | null | Proxy auth username | +| `proxy_password` | string | null | Proxy auth password | + +**Output:** + +```json +{ + "session_id": "abc123", + "url": "https://example.com", + "title": "Example Domain", + "elements": [...], + "elements_text": "@e1 [a] \"More information...\" href=\"...\"\n...", + "screenshot": "" +} +``` + +### snapshot + +Re-fetch page state with `@e` refs. Call after navigation or DOM changes. + +```bash +infsh app run agent-browser --function snapshot --session $SESSION_ID --input '{}' +``` + +**Output:** Same as `open` (url, title, elements, elements_text, screenshot) + +### interact + +Perform actions on the page using `@e` refs. + +```bash +infsh app run agent-browser --function interact --session $SESSION_ID --input '{ + "action": "click", + "ref": "@e1" +}' +``` + +**Input Fields:** + +| Field | Type | Description | +|-------|------|-------------| +| `action` | string | Action to perform (see Actions table) | +| `ref` | string | Element ref (e.g., `@e1`) | +| `text` | string | Text for fill/type/press/select | +| `direction` | string | Scroll direction: up, down, left, right | +| `scroll_amount` | int | Scroll pixels (default 400) | +| `wait_ms` | int | Wait duration in milliseconds | +| `url` | string | URL for goto action | +| `target_ref` | string | Target ref for drag action | +| `file_paths` | array | File paths for upload action | + +**Actions:** + +| Action | Required Fields | Description | +|--------|-----------------|-------------| +| `click` | `ref` | Single click | +| `dblclick` | `ref` | Double click | +| `fill` | `ref`, `text` | Clear input and type text | +| `type` | `text` | Type text without clearing | +| `press` | `text` | Press key (Enter, Tab, Escape, etc.) | +| `select` | `ref`, `text` | Select dropdown option by label | +| `hover` | `ref` | Hover over element | +| `check` | `ref` | Check checkbox | +| `uncheck` | `ref` | Uncheck checkbox | +| `drag` | `ref`, `target_ref` | Drag from ref to target_ref | +| `upload` | `ref`, `file_paths` | Upload files to file input | +| `scroll` | `direction` | Scroll page (optional: `scroll_amount`) | +| `back` | - | Go back in browser history | +| `wait` | `wait_ms` | Wait for specified milliseconds | +| `goto` | `url` | Navigate to different URL | + +**Output:** + +```json +{ + "success": true, + "action": "click", + "message": null, + "screenshot": "", + "snapshot": { + "url": "...", + "title": "...", + "elements": [...], + "elements_text": "..." + } +} +``` + +### screenshot + +Take a screenshot of the current page. + +```bash +infsh app run agent-browser --function screenshot --session $SESSION_ID --input '{ + "full_page": true +}' +``` + +**Input Fields:** + +| Field | Type | Default | Description | +|-------|------|---------|-------------| +| `full_page` | bool | false | Capture full scrollable page | + +**Output:** + +```json +{ + "screenshot": "", + "width": 1280, + "height": 720 +} +``` + +### execute + +Run JavaScript code on the page. + +```bash +infsh app run agent-browser --function execute --session $SESSION_ID --input '{ + "code": "document.title" +}' +``` + +**Input Fields:** + +| Field | Type | Description | +|-------|------|-------------| +| `code` | string | JavaScript code to execute | + +**Output:** + +```json +{ + "result": "Example Domain", + "error": null, + "screenshot": "" +} +``` + +**Examples:** + +```bash +# Get page title +'{"code": "document.title"}' + +# Count elements +'{"code": "document.querySelectorAll(\"a\").length"}' + +# Extract text +'{"code": "document.querySelector(\"h1\").textContent"}' + +# Get all links +'{"code": "Array.from(document.querySelectorAll(\"a\")).map(a => a.href)"}' + +# Scroll to bottom +'{"code": "window.scrollTo(0, document.body.scrollHeight)"}' + +# Get computed style +'{"code": "getComputedStyle(document.body).backgroundColor"}' +``` + +### close + +Close the browser session. Returns video if recording was enabled. + +```bash +infsh app run agent-browser --function close --session $SESSION_ID --input '{}' +``` + +**Output:** + +```json +{ + "success": true, + "video": "" +} +``` + +## Key Combinations + +For the `press` action, use these key names: + +| Key | Name | +|-----|------| +| Enter | `Enter` | +| Tab | `Tab` | +| Escape | `Escape` | +| Backspace | `Backspace` | +| Delete | `Delete` | +| Arrow keys | `ArrowUp`, `ArrowDown`, `ArrowLeft`, `ArrowRight` | +| Modifiers | `Control`, `Shift`, `Alt`, `Meta` | + +**Key combinations:** + +```bash +# Ctrl+A (select all) +'{"action": "press", "text": "Control+a"}' + +# Ctrl+C (copy) +'{"action": "press", "text": "Control+c"}' + +# Shift+Tab (focus previous) +'{"action": "press", "text": "Shift+Tab"}' +``` + +## Error Handling + +When an action fails, `success` is `false` and `message` contains the error: + +```json +{ + "success": false, + "action": "click", + "message": "Unknown ref: @e99. Run 'snapshot' to get current elements.", + "screenshot": "", + "snapshot": {...} +} +``` + +Common errors: +- `Unknown ref: @eN` - Ref doesn't exist, re-snapshot needed +- `'text' required for fill action` - Missing required field +- `'target_ref' required for drag action` - Missing drag target +- `Timeout 5000ms exceeded` - Element not found or not clickable diff --git a/.agents/skills/agent-browser/references/proxy-support.md b/.agents/skills/agent-browser/references/proxy-support.md new file mode 100644 index 0000000..81fc956 --- /dev/null +++ b/.agents/skills/agent-browser/references/proxy-support.md @@ -0,0 +1,295 @@ +# Proxy Support + +Proxy configuration for geo-testing, privacy, and corporate environments. + +**Related**: [commands.md](commands.md) for full function reference, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [Basic Proxy Configuration](#basic-proxy-configuration) +- [Authenticated Proxy](#authenticated-proxy) +- [Common Use Cases](#common-use-cases) +- [Proxy Types](#proxy-types) +- [Verifying Proxy Connection](#verifying-proxy-connection) +- [Troubleshooting](#troubleshooting) +- [Best Practices](#best-practices) + +## Basic Proxy Configuration + +Set proxy when opening a session: + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "proxy_url": "http://proxy.example.com:8080" +}' | jq -r '.session_id') +``` + +All traffic for this session routes through the proxy. + +## Authenticated Proxy + +For proxies requiring username/password: + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com", + "proxy_url": "http://proxy.example.com:8080", + "proxy_username": "myuser", + "proxy_password": "mypassword" +}' | jq -r '.session_id') +``` + +## Common Use Cases + +### Geo-Location Testing + +Test how your site appears from different regions: + +```bash +#!/bin/bash +# Test from multiple regions + +PROXIES=( + "us|http://us-proxy.example.com:8080" + "eu|http://eu-proxy.example.com:8080" + "asia|http://asia-proxy.example.com:8080" +) + +for entry in "${PROXIES[@]}"; do + REGION="${entry%%|*}" + PROXY="${entry##*|}" + + echo "Testing from: $REGION" + + SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://mysite.com", + "proxy_url": "'"$PROXY"'" + }' | jq -r '.session_id') + + # Take screenshot + infsh app run agent-browser --function screenshot --session $SESSION --input '{ + "full_page": true + }' > "${REGION}-screenshot.json" + + # Get page content + RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION --input '{}') + echo $RESULT | jq '.elements_text' > "${REGION}-elements.txt" + + infsh app run agent-browser --function close --session $SESSION --input '{}' +done + +echo "Geo-testing complete" +``` + +### Rate Limit Avoidance + +Rotate proxies for web scraping: + +```bash +#!/bin/bash +# Rotate through proxy list + +PROXIES=( + "http://proxy1.example.com:8080" + "http://proxy2.example.com:8080" + "http://proxy3.example.com:8080" +) + +URLS=( + "https://site.com/page1" + "https://site.com/page2" + "https://site.com/page3" +) + +for i in "${!URLS[@]}"; do + # Rotate proxy + PROXY_INDEX=$((i % ${#PROXIES[@]})) + PROXY="${PROXIES[$PROXY_INDEX]}" + URL="${URLS[$i]}" + + echo "Fetching $URL via proxy $((PROXY_INDEX + 1))" + + SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "'"$URL"'", + "proxy_url": "'"$PROXY"'" + }' | jq -r '.session_id') + + # Extract data + RESULT=$(infsh app run agent-browser --function execute --session $SESSION --input '{ + "code": "document.body.innerText" + }') + echo $RESULT | jq -r '.result' > "page-$i.txt" + + infsh app run agent-browser --function close --session $SESSION --input '{}' + + # Polite delay + sleep 1 +done +``` + +### Corporate Network Access + +Access sites through corporate proxy: + +```bash +# Use corporate proxy for external sites +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://external-vendor.com", + "proxy_url": "http://corpproxy.company.com:8080", + "proxy_username": "'"$CORP_USER"'", + "proxy_password": "'"$CORP_PASS"'" +}' | jq -r '.session_id') +``` + +### Privacy and Anonymity + +Route through privacy-focused proxy: + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://whatismyip.com", + "proxy_url": "socks5://privacy-proxy.example.com:1080" +}' | jq -r '.session_id') +``` + +## Proxy Types + +### HTTP/HTTPS Proxy + +```json +{"proxy_url": "http://proxy.example.com:8080"} +{"proxy_url": "https://proxy.example.com:8080"} +``` + +### SOCKS5 Proxy + +```json +{"proxy_url": "socks5://proxy.example.com:1080"} +``` + +### With Authentication + +```json +{ + "proxy_url": "http://proxy.example.com:8080", + "proxy_username": "user", + "proxy_password": "pass" +} +``` + +## Verifying Proxy Connection + +Check that traffic routes through proxy: + +```bash +SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://httpbin.org/ip", + "proxy_url": "http://proxy.example.com:8080" +}' | jq -r '.session_id') + +# Get the IP shown +RESULT=$(infsh app run agent-browser --function execute --session $SESSION --input '{ + "code": "document.body.innerText" +}') +echo "IP via proxy: $(echo $RESULT | jq -r '.result')" + +infsh app run agent-browser --function close --session $SESSION --input '{}' +``` + +The IP should be the proxy's IP, not your real IP. + +## Troubleshooting + +### Connection Failed + +``` +Error: Failed to open URL: net::ERR_PROXY_CONNECTION_FAILED +``` + +**Solutions:** +1. Verify proxy URL is correct +2. Check proxy is running and accessible +3. Confirm port is correct +4. Test proxy with curl: `curl -x http://proxy:8080 https://example.com` + +### Authentication Failed + +``` +Error: 407 Proxy Authentication Required +``` + +**Solutions:** +1. Verify username/password are correct +2. Check if proxy requires different auth method +3. Ensure credentials don't contain special characters that need escaping + +### SSL Errors + +Some proxies perform SSL inspection. If you see certificate errors: + +```bash +# The browser should handle most SSL proxies automatically +# If issues persist, verify proxy SSL certificate is valid +``` + +### Slow Performance + +**Solutions:** +1. Choose proxy closer to target site +2. Use faster proxy provider +3. Reduce number of requests per session + +## Best Practices + +### 1. Use Environment Variables + +```bash +# Good: Credentials in env vars +'{"proxy_url": "'"$PROXY_URL"'", "proxy_username": "'"$PROXY_USER"'"}' + +# Bad: Hardcoded +'{"proxy_url": "http://user:pass@proxy.com:8080"}' +``` + +### 2. Test Proxy Before Automation + +```bash +# Verify proxy works +curl -x "$PROXY_URL" https://httpbin.org/ip +``` + +### 3. Handle Proxy Failures + +```bash +# Retry with different proxy on failure +for PROXY in "${PROXIES[@]}"; do + SESSION=$(infsh app run agent-browser --function open --session new --input '{ + "url": "'"$URL"'", + "proxy_url": "'"$PROXY"'" + }' 2>&1) + + if echo "$SESSION" | jq -e '.session_id' > /dev/null 2>&1; then + SESSION_ID=$(echo $SESSION | jq -r '.session_id') + break + fi + echo "Proxy $PROXY failed, trying next..." +done +``` + +### 4. Respect Rate Limits + +Even with proxies, be a good citizen: + +```bash +# Add delays between requests +'{"action": "wait", "wait_ms": 1000}' +``` + +### 5. Log Proxy Usage + +For debugging, log which proxy was used: + +```bash +echo "$(date): Using proxy $PROXY for $URL" >> proxy.log +``` diff --git a/.agents/skills/agent-browser/references/session-management.md b/.agents/skills/agent-browser/references/session-management.md new file mode 100644 index 0000000..5613465 --- /dev/null +++ b/.agents/skills/agent-browser/references/session-management.md @@ -0,0 +1,204 @@ +# Session Management + +Browser sessions for state persistence and parallel browsing. + +**Related**: [authentication.md](authentication.md) for login patterns, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [How Sessions Work](#how-sessions-work) +- [Starting a Session](#starting-a-session) +- [Using Session IDs](#using-session-ids) +- [Session State](#session-state) +- [Parallel Sessions](#parallel-sessions) +- [Session Cleanup](#session-cleanup) +- [Best Practices](#best-practices) + +## How Sessions Work + +Each session maintains an isolated browser context with: +- Cookies +- LocalStorage / SessionStorage +- Browser history +- Page state +- Video recording (if enabled) + +Sessions persist across function calls, allowing multi-step workflows. + +## Starting a Session + +Use `--session new` to create a fresh session: + +```bash +RESULT=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com" +}') +SESSION_ID=$(echo $RESULT | jq -r '.session_id') +echo "Session: $SESSION_ID" +``` + +## Using Session IDs + +All subsequent calls use the session ID: + +```bash +# Navigate +infsh app run agent-browser --function open --session $SESSION_ID --input '{ + "url": "https://example.com/page2" +}' + +# Interact +infsh app run agent-browser --function interact --session $SESSION_ID --input '{ + "action": "click", "ref": "@e1" +}' + +# Screenshot +infsh app run agent-browser --function screenshot --session $SESSION_ID --input '{}' + +# Close +infsh app run agent-browser --function close --session $SESSION_ID --input '{}' +``` + +## Session State + +### What Persists + +Within a session, these persist across calls: +- Cookies (login state, preferences) +- LocalStorage and SessionStorage +- IndexedDB data +- Browser history (for back/forward) +- Current page and DOM state +- Video recording buffer + +### What Doesn't Persist + +- Sessions don't persist across server restarts +- No automatic session recovery +- Video is only available until close is called + +## Parallel Sessions + +Run multiple independent sessions simultaneously: + +```bash +#!/bin/bash +# Scrape multiple sites in parallel + +# Start sessions +RESULT1=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://site1.com" +}') +SESSION1=$(echo $RESULT1 | jq -r '.session_id') + +RESULT2=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://site2.com" +}') +SESSION2=$(echo $RESULT2 | jq -r '.session_id') + +# Work with each session independently +infsh app run agent-browser --function screenshot --session $SESSION1 --input '{}' & +infsh app run agent-browser --function screenshot --session $SESSION2 --input '{}' & +wait + +# Clean up both +infsh app run agent-browser --function close --session $SESSION1 --input '{}' +infsh app run agent-browser --function close --session $SESSION2 --input '{}' +``` + +### Use Cases for Parallel Sessions + +1. **A/B Testing** - Compare different pages or user experiences +2. **Multi-site scraping** - Gather data from multiple sources +3. **Load testing** - Simulate multiple users +4. **Cross-region testing** - Use different proxies per session + +## Session Cleanup + +Always close sessions when done: + +```bash +infsh app run agent-browser --function close --session $SESSION_ID --input '{}' +``` + +**Why close matters:** +- Releases server resources +- Returns video recording (if enabled) +- Prevents resource leaks + +### Error Handling + +```bash +#!/bin/bash +set -e + +cleanup() { + infsh app run agent-browser --function close --session $SESSION_ID --input '{}' 2>/dev/null || true +} +trap cleanup EXIT + +SESSION_ID=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com" +}' | jq -r '.session_id') + +# ... your automation ... +# cleanup runs automatically on exit +``` + +## Best Practices + +### 1. Store Session IDs + +```bash +# Good: Store for reuse +SESSION_ID=$(... | jq -r '.session_id') +infsh ... --session $SESSION_ID ... + +# Bad: Parse every time +infsh ... --session $(... | jq -r '.session_id') ... +``` + +### 2. Close Sessions Promptly + +Don't leave sessions open longer than needed. Server resources are limited. + +### 3. Use Meaningful Variable Names + +```bash +# Good: Clear purpose +LOGIN_SESSION=$(...) +SCRAPE_SESSION=$(...) + +# Bad: Generic names +S1=$(...) +S2=$(...) +``` + +### 4. Handle Session Expiry + +Sessions may expire after extended inactivity: + +```bash +# Check if session is still valid +RESULT=$(infsh app run agent-browser --function snapshot --session $SESSION_ID --input '{}' 2>&1) +if echo "$RESULT" | grep -q "session not found"; then + echo "Session expired, starting new one" + SESSION_ID=$(infsh app run agent-browser --function open --session new --input '{ + "url": "https://example.com" + }' | jq -r '.session_id') +fi +``` + +### 5. One Task Per Session + +For clarity, use one session per logical task: + +```bash +# Good: Separate sessions for separate tasks +LOGIN_SESSION=$(...) # Handle login +SCRAPE_SESSION=$(...) # Handle scraping + +# Okay for related tasks: One session for a workflow +SESSION=$(...) +# login -> navigate -> extract -> close +``` diff --git a/.agents/skills/agent-browser/references/snapshot-refs.md b/.agents/skills/agent-browser/references/snapshot-refs.md new file mode 100644 index 0000000..77d3db7 --- /dev/null +++ b/.agents/skills/agent-browser/references/snapshot-refs.md @@ -0,0 +1,251 @@ +# Snapshot and Refs + +Compact element references that reduce context usage for AI agents. + +**Related**: [commands.md](commands.md) for full function reference, [SKILL.md](../SKILL.md) for quick start. + +## Contents + +- [How Refs Work](#how-refs-work) +- [Snapshot Output Format](#snapshot-output-format) +- [Using Refs](#using-refs) +- [Ref Lifecycle](#ref-lifecycle) +- [Best Practices](#best-practices) +- [Ref Notation Details](#ref-notation-details) +- [Troubleshooting](#troubleshooting) + +## How Refs Work + +Traditional approach: +``` +Full DOM/HTML -> AI parses -> CSS selector -> Action (~3000-5000 tokens) +``` + +agent-browser approach: +``` +Compact snapshot -> @refs assigned -> Direct interaction (~200-400 tokens) +``` + +The snapshot extracts interactive elements and assigns short `@e` refs, reducing token usage significantly. + +## Snapshot Output Format + +```bash +infsh app run agent-browser --function snapshot --session $SESSION --input '{}' +``` + +**Response `elements_text`:** + +``` +@e1 [a] "Home" href="/" +@e2 [a] "Products" href="/products" +@e3 [a] "About" href="/about" +@e4 [button] "Sign In" +@e5 [input type="email"] placeholder="Email" +@e6 [input type="password"] placeholder="Password" +@e7 [button type="submit"] "Log In" +@e8 [input type="checkbox"] name="remember" +``` + +**Response `elements` (structured):** + +```json +[ + { + "ref": "@e1", + "desc": "@e1 [a] \"Home\" href=\"/\"", + "tag": "a", + "text": "Home", + "role": null, + "name": null, + "href": "/", + "input_type": null + }, + ... +] +``` + +## Using Refs + +Once you have refs, interact directly: + +```bash +# Click the "Sign In" button +'{"action": "click", "ref": "@e4"}' + +# Fill email input +'{"action": "fill", "ref": "@e5", "text": "user@example.com"}' + +# Fill password +'{"action": "fill", "ref": "@e6", "text": "password123"}' + +# Submit the form +'{"action": "click", "ref": "@e7"}' + +# Check the "remember me" checkbox +'{"action": "check", "ref": "@e8"}' +``` + +## Ref Lifecycle + +**IMPORTANT**: Refs are invalidated when the page changes! + +```bash +# Get initial snapshot +infsh app run agent-browser --function snapshot --session $SESSION --input '{}' +# @e1 [button] "Next" + +# Click triggers page change +infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e1" +}' + +# MUST re-snapshot to get new refs! +infsh app run agent-browser --function snapshot --session $SESSION --input '{}' +# @e1 [h1] "Page 2" <- Different element now! +``` + +### When to Re-snapshot + +Always re-snapshot after: + +1. **Navigation** - Clicking links, form submissions, `goto` action +2. **Dynamic content** - AJAX loads, modals opening, tabs switching +3. **Page mutations** - JavaScript modifying the DOM + +The `interact` function returns a fresh snapshot in its response, so you can often use that instead of a separate snapshot call. + +## Best Practices + +### 1. Always Use the Latest Snapshot + +```bash +# CORRECT: Use snapshot from previous response +RESULT=$(infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e1" +}') +# Use elements from $RESULT.snapshot for next action + +# WRONG: Using stale refs +# After navigation, @e1 may point to a completely different element +``` + +### 2. Check Success Before Continuing + +```bash +RESULT=$(infsh app run agent-browser --function interact --session $SESSION --input '{ + "action": "click", "ref": "@e5" +}') + +SUCCESS=$(echo $RESULT | jq -r '.success') +if [ "$SUCCESS" != "true" ]; then + echo "Click failed: $(echo $RESULT | jq -r '.message')" + # Re-snapshot and retry +fi +``` + +### 3. Use elements_text for Quick Decisions + +For AI agents, `elements_text` provides a compact text representation: + +``` +@e1 [input type="email"] placeholder="Email" +@e2 [input type="password"] placeholder="Password" +@e3 [button] "Submit" +``` + +This is often enough to decide which element to interact with without parsing the full `elements` array. + +## Ref Notation Details + +``` +@e1 [tag type="value"] "text content" name="attr" +| | | | | +| | | | +- Additional attributes +| | | +- Visible text +| | +- Key attributes shown +| +- HTML tag name ++- Unique ref ID +``` + +### Common Patterns + +``` +@e1 [button] "Submit" # Button with text +@e2 [input type="email"] # Email input +@e3 [input type="password"] # Password input +@e4 [a] "Link Text" href="/page" # Anchor link +@e5 [select] # Dropdown +@e6 [textarea] placeholder="Message" # Text area +@e7 [input type="file"] # File upload +@e8 [input type="checkbox"] checked # Checked checkbox +@e9 [input type="radio"] selected # Selected radio +@e10 [button type="submit"] "Send" # Submit button +``` + +### Elements Captured + +The snapshot captures these interactive elements: + +- Links (``) +- Buttons (`