Skip to content

Create, Evaluate, and Connect AI Skills

feat(ui): package local skill browser with Python CLI

Icarus-Chen9aa52584102e
diff --git a/README.md b/README.md
index 113d078..f8488d4 100644
--- a/README.md
+++ b/README.md
@@ -74,19 +74,20 @@ Explore the public skill library on [skillnet.openkg.cn](http://skillnet.openkg.
The site also introduces [SkillNet-Gym](http://skillnet.openkg.cn/skillgym) for skill graph construction and lifecycle benchmarking, and [SkillNet-Fabric](http://skillnet.openkg.cn/skillfabric) for Wiki-based skill routing, including research results and a guided routing demo.
-### Local skill library frontend
+### Browse local skills
-A [local frontend](frontend/README.md) is available in `frontend/` for browsing repository skills, bundled analysis examples, and personal skill folders. It is separate from the public web platform.
-
-Install Node.js 18, 20, or 22+ and Python 3.10+, then run:
+The [browser interface](skillnet-ai/src/skillnet_ai/web/ui/README.md) is part of the
+Python package. Browse your own skill folders, inspect saved analysis graphs,
+and follow relationship evidence to the original source lines.
```bash
-cd frontend
-npm ci
-npm run dev
+pip install "skillnet-ai[ui]"
+skillnet ui --skills-dir "/absolute/path/to/skills"
```
-Open the local URL printed by Vite. The personal library starts empty; you can create a local skills folder or connect an existing one. Repository examples are available separately and require no API key.
+Released packages include the website; Node.js is only needed for UI development.
+For this source checkout, follow the interface's build instructions before starting.
+The interface makes no model calls and starts with an empty personal library.
<div align="center">
diff --git a/frontend/README.md b/frontend/README.md
deleted file mode 100644
index 81c36a0..0000000
--- a/frontend/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# SkillNet local frontend
-
-## Run
-
-Install Node.js 18, 20, or 22+ and Python 3.10+. From `frontend/`, run:
-
-```bash
-npm ci
-npm run dev
-```
-
-Open the local URL printed by Vite. Run `npm run build` for a production build.
-
-## Use a skill library
-
-The personal library starts empty. Click **Create my skill library** to create `~/.skillnet/skills` in your home folder, or connect an existing skills folder. Opening the page alone does not create the folder. A skills folder directly contains one subfolder per skill, each with a `SKILL.md` file. Add skills there and click **Refresh folder**.
-
-Repository examples (WebShop, ALFWorld, and ScienceWorld) are separate from the personal library. Select a skill library first, then choose its `SKILL.md` source or an available analysis snapshot. A document reference means one source file explicitly mentions another skill; it is not a model-inferred relationship.
-
-To download or create skills, install the SDK from the repository root:
-
-```bash
-python -m pip install -e "./skillnet-ai[graph]"
-skillnet download "<GitHub skill folder URL>" --target-dir "<skills folder>"
-skillnet create --prompt "..." --output-dir "<skills folder>"
-skillnet analyze "<skills folder>"
-```
-
-The `create` and `analyze` commands need model configuration. `analyze` writes to `<skills folder>/.skillnet` by default. The frontend reads the snapshot selected by `CURRENT` and warns when the current skill source differs from the source stored in that snapshot. If you used `--output-dir`, connect that analysis folder in the **Local folders** menu.
-
-## Data and limits
-
-- The bundled analysis snapshots are examples generated from repository skills. A label such as `5/37` means the snapshot covers 5 of that library's 37 skills. They are separate from the public online SkillNet library and from the paper's scale claims.
-- Two completed skill-file evaluations are bundled as examples. The frontend displays their saved reports; it does not evaluate skills live.
-- **Import graph.json** accepts a local `GraphSnapshot v1` file with `compose_with` and `similar_to` relationships. The file is parsed in the browser and is not uploaded. The browser stores imported snapshots and connected folder records in IndexedDB and remembers the last view. Removing a folder record does not delete files on disk.
-- Local folder access requires `npm run dev` or `npm run preview` on the same machine. A static deployment can still browse bundled data and import snapshots, but cannot read local folders.
-- Imports are limited to 20 MB, 5,000 skills, and 20,000 relationships. The skill list initially shows up to 200 matches; search narrows it down.
-
-## Refresh bundled data
-
-`npm run dev` and `npm run build` rebuild `src/demo.json` from the repository's `SKILL.md` files and rebuild `src/catalog.json` from `public/data/`. Run `npm run demo:data` to regenerate the source examples separately. Use `python scripts/bundle_analysis.py COLLECTION PATH/TO/graph.json` to add a snapshot from a matching repository collection. Run `python scripts/bundle_evaluations.py` to regenerate `src/evaluations.json` from the two source reports in `data/evaluations/`.
diff --git a/frontend/data/evaluations/webshop-product-selector.json b/frontend/data/evaluations/webshop-product-selector.json
deleted file mode 100644
index ffa3ba4..0000000
--- a/frontend/data/evaluations/webshop-product-selector.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "status": "ok",
- "elapsed_seconds": 4.78,
- "report": {
- "safety": {
- "level": "Good",
- "reason": "The skill is narrowly scoped to selecting a product from a search results page and clicking its ID; it does not instruct destructive, credential-related, or security-bypassing actions. The only caveat is that the click target must match the observation exactly, which is a normal UI constraint rather than a safety risk."
- },
- "completeness": {
- "level": "Average",
- "reason": "The decision process, heuristic, and final action format are clearly described, but it assumes a lot about the surrounding WebShop observation and does not specify fallback handling for ties beyond price or for missing/ambiguous product fields. It also references a bundled selector.py script, but no actual script is provided in the evidence."
- },
- "executability": {
- "level": "Average",
- "reason": "An agent can follow the text instructions to choose a product and issue click[product_id], but the skill depends on observation formatting and exact click values that are only partially specified in the references. The cited lowercase/uppercase mismatch note adds uncertainty about the exact action token the environment expects."
- },
- "maintainability": {
- "level": "Good",
- "reason": "The scope is narrow and modular: it selects one item from a shortlist using a simple heuristic and then triggers a single navigation action. The inputs and output action are well bounded, making it easy to adapt the scoring heuristic or selection rules."
- },
- "cost_awareness": {
- "level": "Good",
- "reason": "The workflow is lightweight and limited to evaluating a shortlist of products on one page, with no loops, external services, or heavy computation described. The selection heuristic is simple and bounded by the current observation."
- },
- "prompt_injection_scan": {
- "clean": true,
- "max_severity": null,
- "count": 0,
- "findings": [],
- "complete": true,
- "scan_issues": []
- }
- }
-}
diff --git a/frontend/data/evaluations/webshop-query-interpreter.json b/frontend/data/evaluations/webshop-query-interpreter.json
deleted file mode 100644
index a103f5f..0000000
--- a/frontend/data/evaluations/webshop-query-interpreter.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "status": "ok",
- "elapsed_seconds": 5.67,
- "report": {
- "safety": {
- "level": "Good",
- "reason": "The skill is limited to interpreting shopping queries into structured search parameters and does not describe destructive, security-bypassing, or sensitive actions. The provided content and automated pre-screen show no injection artifacts or unsafe tool use."
- },
- "completeness": {
- "level": "Average",
- "reason": "The core workflow is clear: parse product type, attributes, and constraints, then format them into a template and hand off to a search skill. However, it gives limited edge-case handling beyond a few examples and does not specify how to resolve ambiguous queries beyond general references in the extra reference file."
- },
- "executability": {
- "level": "Good",
- "reason": "This is an instruction-only workflow that an agent can follow using typical LLM capabilities without needing scripts. The steps, output template, and examples are concrete enough to produce usable search parameters from user shopping text."
- },
- "maintainability": {
- "level": "Good",
- "reason": "The scope is narrow and modular, focused on extracting structured fields for downstream search. The template and example patterns make it easy to adjust or compose with other webshop skills."
- },
- "cost_awareness": {
- "level": "Good",
- "reason": "The task is a lightweight text-parsing step with no external services, large datasets, or repeated loops implied. The description naturally limits itself to a single query interpretation before handoff."
- },
- "prompt_injection_scan": {
- "clean": true,
- "max_severity": null,
- "count": 0,
- "findings": [],
- "complete": true,
- "scan_issues": []
- }
- }
-}
diff --git a/frontend/package.json b/frontend/package.json
deleted file mode 100644
index 9df60d6..0000000
--- a/frontend/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "skillnet-workbench",
- "private": true,
- "version": "0.1.0",
- "type": "module",
- "scripts": {
- "predev": "python scripts/build_demo.py && node scripts/build_catalog.mjs",
- "dev": "vite --host 127.0.0.1",
- "prebuild": "python scripts/build_demo.py && node scripts/build_catalog.mjs",
- "build": "tsc -b && vite build",
- "preview": "vite preview --host 127.0.0.1",
- "demo:data": "python scripts/build_demo.py"
- },
- "dependencies": {
- "lucide-react": "^0.468.0",
- "react": "^19.0.0",
- "react-dom": "^19.0.0"
- },
- "devDependencies": {
- "@types/react": "^19.0.0",
- "@types/react-dom": "^19.0.0",
- "@vitejs/plugin-react": "^4.3.4",
- "typescript": "^5.7.3",
- "vite": "^6.0.5"
- }
-}
diff --git a/frontend/public/data/alfworld-analysis.json b/frontend/public/data/alfworld-analysis.json
deleted file mode 100644
index 1f5e4e4..0000000
--- a/frontend/public/data/alfworld-analysis.json
+++ /dev/null
@@ -1 +0,0 @@
-{"schema_version":1,"skills":[{"skill_id":"alfworld-clean-object","name":"alfworld-clean-object","path":"experiments/src/skills/alfworld/alfworld-clean-object/SKILL.md","source":"---\nname: alfworld-clean-object\ndescription: Cleans a specified object using an appropriate cleaning receptacle (e.g., sinkbasin). Use when a task requires an object to be in a clean state (e.g., \"clean potato\", \"wash apple\") before proceeding. Navigates to the cleaning location, performs the clean action, and confirms the object is now clean.\n---\n# Instructions\n\nClean an object you are holding using a sinkbasin. The object must be in your inventory before cleaning.\n\n## Workflow\n1. **Navigate:** `go to sinkbasin 1` (or the appropriate sinkbasin in the environment)\n2. **Clean:** `clean {object} with sinkbasin 1` -- verify observation confirms \"You clean the {object}\"\n3. **Proceed:** The object is now clean. Continue with the next task step\n\n## Action Format\n- `clean {obj} with {recep}` (e.g., `clean potato 1 with sinkbasin 1`)\n\n## Error Recovery\n- \"Nothing happened\": Check (1) you are holding the object, (2) you are at the sinkbasin, (3) object and receptacle names are correct\n- Not at sinkbasin: execute `go to sinkbasin 1` first\n\n## Example\n\n**Scenario:** You are holding `potato 1` and need to clean it.\n\n```\nThought: I need to clean this potato. I should go to the sinkbasin.\nAction: go to sinkbasin 1\nObservation: On the sinkbasin 1, you see nothing.\nAction: clean potato 1 with sinkbasin 1\nObservation: You clean the potato 1 using the sinkbasin 1.\n```\n\n**Result:** The potato is now in a clean state and ready for the next task step.\n\n## Post-Condition\nAfter successful execution, the object will be in a clean state. You may proceed with the next step of your task (e.g., placing the clean object on a shelf or in a microwave).\n","profile":{"capability":{"text":"Clean a specified object using a sinkbasin when the task requires that object to become clean before continuing.","evidence":[{"line":3},{"line":7}]},"when_to_use":[{"text":"Use this when an object must be clean before proceeding, such as to clean or wash an item.","evidence":[{"line":3}]}],"scenarios":[{"name":"Clean a held object at the sinkbasin","before":[{"text":"You are holding an object in inventory that needs to be cleaned.","evidence":[{"line":7},{"line":23}]},{"text":"You are not yet at the sinkbasin and need to navigate there.","evidence":[{"line":10},{"line":19}]}],"after":[{"text":"The object is now in a clean state.","evidence":[{"line":11},{"line":12},{"line":35}]},{"text":"The task can proceed to the next step, such as placing the clean object elsewhere.","evidence":[{"line":12},{"line":36}]}]}],"inputs":[{"text":"An object you are holding that needs cleaning, such as `potato 1`.","evidence":[{"line":7},{"line":23},{"line":29}]},{"text":"A suitable sinkbasin in the environment, such as `sinkbasin 1`.","evidence":[{"line":10},{"line":15}]}],"outputs":[{"text":"The object is confirmed clean and ready for the next task step.","evidence":[{"line":11},{"line":12},{"line":33},{"line":35}]}],"constraints":[{"text":"The object must be in your inventory and you must be at the sinkbasin, with correct object and receptacle names, for cleaning to succeed.","evidence":[{"line":7},{"line":18},{"line":19}]},{"text":"The action format is `clean {obj} with {recep}`.","evidence":[{"line":15}]}],"tools":[{"text":"Use environment navigation to reach a sinkbasin and the clean action against that receptacle.","evidence":[{"line":10},{"line":11},{"line":15},{"line":19}]}]}},{"skill_id":"alfworld-device-operator","name":"alfworld-device-operator","path":"experiments/src/skills/alfworld/alfworld-device-operator/SKILL.md","source":"---\nname: alfworld-device-operator\ndescription: Operates a device or appliance (like a desklamp, microwave, or fridge) to interact with another object. Use when the task requires using a tool on a target item (e.g., \"look at laptop under the desklamp\", \"heat potato with microwave\"). Locates both the device and target object, co-locates them, and executes the appropriate use action (toggle, heat, cool, or clean).\n---\n# Instructions\n\n## 1. Skill Trigger\nActivate this skill when the task goal explicitly requires **using a device or appliance** to interact with a target object. Common indicators include phrases like:\n- \"look at [object] under the [device]\"\n- \"heat [object] with [device]\"\n- \"cool [object] with [device]\"\n- \"clean [object] with [device]\"\n\n## 2. Core Execution Flow\nFollow this sequence when the skill is triggered:\n\n### Phase 1: Locate the Device\n1. **Identify the device** from the task description (e.g., `desklamp`, `microwave`, `fridge`).\n2. **Search common receptacles** where such a device is typically found (e.g., desks, sidetables, countertops).\n3. Use the `go to {recep}` action to navigate to and inspect these locations until the device is found.\n4. **Note the device's exact name** (e.g., `desklamp 1`).\n\n### Phase 2: Locate the Target Object\n1. **Identify the target object** from the task description (e.g., `laptop`, `mug`, `plate`).\n2. **Search the environment** for this object. It may not be near the device initially.\n3. Use the `go to {recep}` and visual inspection to find the object.\n4. Once found, use `take {obj} from {recep}` to pick it up.\n\n### Phase 3: Co-locate Object and Device\n1. **Navigate** to the receptacle where the target device is located using `go to {recep}`.\n2. Ensure you are in the same location as the device before proceeding.\n\n### Phase 4: Operate the Device\n1. Execute the final **use action**. The specific action is determined by the device-object pair:\n * For a `desklamp` and a viewable object (like a `laptop`, `book`), use: `toggle {device} {recep}`.\n * For a `microwave` and a heatable object, use: `heat {obj} with {device}`.\n * For a `fridge` and a coolable object, use: `cool {obj} with {device}`.\n * For a `faucet`/`spraybottle` and a cleanable object, use: `clean {obj} with {device}`.\n2. **Action Format:** The action must use the exact object and device names discovered during Phases 1 & 2.\n\n## 3. Key Assumptions & Rules\n* **Co-location Required:** The skill assumes the final action requires the target object and the operating device to be in the same location (on the same receptacle).\n* **Device First:** Prioritize finding the device before extensively searching for the target object, as the device's location is often a fixed landmark.\n* **Invalid Actions:** If the environment responds with \"Nothing happened,\" re-evaluate your object/device names and your location. Ensure you are using the correct action verb for the device type.\n\n## Example\n\n**Scenario:** Task is \"look at laptop under the desklamp.\"\n\n```\nThought: I need to find the desklamp first. It's likely on a sidetable or desk.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a desklamp 1.\nThought: Found the desklamp. Now I need to find the laptop.\nAction: go to desk 1\nObservation: On the desk 1, you see a laptop 1, a pen 2.\nAction: take laptop 1 from desk 1\nObservation: You pick up the laptop 1 from the desk 1.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a desklamp 1.\nAction: use desklamp 1\nObservation: You turn on the desklamp 1.\n```\n\n**Result:** The laptop is now being examined under the desklamp, completing the task.\n","profile":{"capability":{"text":"Locates a device and a target object, co-locates them, and performs the appropriate device-specific interaction on the object.","evidence":[{"line":3},{"line":34},{"line":42}]},"when_to_use":[{"text":"Use this skill when the goal explicitly says to use a device or appliance on an object, including look under a lamp, heat, cool, or clean actions.","evidence":[{"line":8},{"line":9},{"line":10},{"line":11},{"line":12}]}],"scenarios":[{"name":"Operate a device on a target object","before":[{"text":"The task explicitly requires using a device or appliance to interact with a target object, such as looking at, heating, cooling, or cleaning it.","evidence":[{"line":3},{"line":8}]}],"after":[{"text":"The target object is being interacted with under or by the selected device in the way requested by the task.","evidence":[{"line":3}]}]}],"inputs":[{"text":"The task description must identify both a device type and a target object type.","evidence":[{"line":18},{"line":24}]},{"text":"The environment must provide searchable receptacles and visible objects that can be inspected to locate the device and target.","evidence":[{"line":19},{"line":25},{"line":26}]}],"outputs":[{"text":"The exact discovered device and object names are used in the final action.","evidence":[{"line":21},{"line":39}]},{"text":"The task outcome is established, such as the object being examined under a turned-on desk lamp.","evidence":[{"line":62},{"line":65}]}],"constraints":[{"text":"The target object and operating device must be co-located on the same receptacle before the final action.","evidence":[{"line":31},{"line":42}]},{"text":"The device should be found before extensively searching for the target object, and a 'Nothing happened' response requires checking names, location, and action verb.","evidence":[{"line":43},{"line":44}]},{"text":"The final action must use the exact discovered object and device names.","evidence":[{"line":39}]}],"tools":[{"text":"The environment's action verbs include go to {recep}, take {obj} from {recep}, toggle {device} {recep}, heat {obj} with {device}, cool {obj} with {device}, and clean {obj} with {device}.","evidence":[{"line":20},{"line":27},{"line":30},{"line":35},{"line":36},{"line":37},{"line":38}]}]}},{"skill_id":"alfworld-goal-interpreter","name":"alfworld-goal-interpreter","path":"experiments/src/skills/alfworld/alfworld-goal-interpreter/SKILL.md","source":"---\nname: alfworld-goal-interpreter\ndescription: Parses the natural language task goal to extract actionable sub-objectives and required objects. Trigger this skill whenever a new task is assigned to break down complex instructions into clear, sequential targets. It interprets phrases like 'look at X under Y' to identify target objects (pillow), reference objects (desklamp), and spatial relationships (under).\n---\n# Goal Interpretation Protocol\n\n## 1. Parse the Task Statement\nWhen a new task is assigned, immediately analyze the natural language instruction to extract its core components. Use the parsing script (`parse_goal.py`) to perform this analysis.\n\n**Input:** The raw task string (e.g., \"look at pillow under the desklamp\").\n**Output:** A structured dictionary containing:\n- `primary_target`: The main object to interact with.\n- `reference_object`: The object that defines a location or condition.\n- `spatial_relation`: The preposition linking them (e.g., under, on, in).\n- `action`: The verb defining the required interaction.\n\n## 2. Generate Sub-Objectives\nBased on the parsed components, formulate a clear, sequential plan. The plan must account for the spatial relationship.\n\n**Example Logic:**\n- **IF** relation is `under` → Sub-goal 1: Locate the `reference_object`. Sub-goal 2: Inspect the area beneath it for the `primary_target`.\n- **IF** relation is `in` or `on` → Sub-goal 1: Locate the `reference_object`. Sub-goal 2: Check its contents/surface.\n\n## 3. Identify Required Objects & Actions\nMap the parsed objects to the available action types in the environment. The primary action verbs (look, take, use, etc.) from the task must be translated into the agent's available action set (go to, take, use, etc.).\n\n**Critical Check:** If the `reference_object` is a container (drawer, fridge), ensure the plan includes the `open` action before inspection.\n\n## 4. Execute & Adapt\nInitiate the plan. After each action, monitor the observation. If the expected object is not found, or the action fails (\"Nothing happened\"), consult the fallback logic in the reference guide (`search_patterns.md`).\n\n**Remember:** The agent must maintain object permanence. If an object is moved (e.g., a pillow is picked up), it is now in the agent's inventory and the spatial relationship is void.\n","profile":{"capability":{"text":"Parse a natural-language task goal into structured components, derive sequential sub-objectives, and map them to environment actions.","evidence":[{"line":3},{"line":8},{"line":18},{"line":25}]},"when_to_use":[{"text":"Use when a new task is assigned and the goal must be broken down into clear sequential targets.","evidence":[{"line":3}]}],"scenarios":[{"name":"Parse task goal into actionable sub-objectives","before":[{"text":"A new natural-language task goal is assigned as a raw task string.","evidence":[{"line":3},{"line":8},{"line":10}]}],"after":[{"text":"A structured goal interpretation exists with primary_target, reference_object, spatial_relation, and action identified.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]},{"text":"A sequential sub-objective plan is formed that reflects the stated spatial relation.","evidence":[{"line":18},{"line":21},{"line":22}]}]},{"name":"Map parsed goal to environment actions","before":[{"text":"Parsed objects and action verbs are available, and the reference object may be a container.","evidence":[{"line":25},{"line":27}]}],"after":[{"text":"Task verbs are translated into the environment's available action set.","evidence":[{"line":25}]},{"text":"If the reference object is a container, the plan includes opening it before inspection.","evidence":[{"line":27}]}]},{"name":"Execute plan and adapt to observations","before":[{"text":"Actions have been executed and observations show a missing object or a failed action, or an object has been moved.","evidence":[{"line":30},{"line":32}]}],"after":[{"text":"The plan is adapted using fallback logic when the expected object is missing or an action fails.","evidence":[{"line":30}]},{"text":"Object permanence is maintained so moved objects are treated as inventory and the original spatial relation no longer applies.","evidence":[{"line":32}]}]}],"inputs":[{"text":"The raw task string.","evidence":[{"line":10}]}],"outputs":[{"text":"A structured dictionary with primary_target, reference_object, spatial_relation, and action.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]},{"text":"A clear sequential plan of sub-goals tailored to the spatial relation.","evidence":[{"line":18},{"line":21},{"line":22}]}],"constraints":[{"text":"Container reference objects require an open action before inspection.","evidence":[{"line":27}]},{"text":"If the expected object is not found or an action fails, fallback logic must be consulted.","evidence":[{"line":30}]},{"text":"Object permanence must be respected after an object is moved.","evidence":[{"line":32}]}],"tools":[{"text":"parse_goal.py is used to parse the task statement.","evidence":[{"line":8}]},{"text":"search_patterns.md is consulted for fallback logic.","evidence":[{"line":30}]}]}},{"skill_id":"alfworld-object-locator","name":"alfworld-object-locator","path":"experiments/src/skills/alfworld/alfworld-object-locator/SKILL.md","source":"---\nname: alfworld-object-locator\ndescription: Use when the agent needs to find a specific object in ALFWorld that is not currently in inventory and whose location is unknown. This skill parses the environment observation, ranks receptacles by likelihood of containing the target object using common-sense reasoning, and outputs a navigation action to the most promising location.\n---\n# Skill: Object Locator for ALFWorld\n\n## When to Use\nTrigger this skill when:\n1. Your goal requires a specific object (e.g., `knife`, `cellphone`, `apple`)\n2. The object is not in your inventory\n3. The current observation does not explicitly state the object's location\n\n## Core Workflow\n\n### 1. Parse the Environment\nExtract all visible receptacles from the observation text. Typical ALFWorld receptacles include:\n- **Surfaces**: countertop, desk, dresser, bed, shelf, sidetable, coffeetable, diningtable\n- **Containers**: drawer, cabinet, safe, fridge, microwave, garbagecan\n- **Appliances**: sinkbasin, bathtub, stoveburner, toaster\n\n### 2. Rank by Likelihood\nUse common-sense reasoning to prioritize where the target object is most likely found:\n\n| Object Type | High-Probability Receptacles |\n|-------------|------------------------------|\n| Kitchen items (knife, spatula, pan) | countertop, drawer, diningtable, stoveburner |\n| Food (apple, potato, tomato, bread) | fridge, countertop, diningtable, microwave |\n| Bathroom items (sponge, cloth, soap) | sinkbasin, bathtub, cart, shelf |\n| Electronics (cellphone, laptop, remote) | desk, sidetable, dresser, bed, coffeetable |\n| Stationery (pen, pencil, book) | desk, shelf, drawer, sidetable |\n| Lighting (candle, desklamp) | sidetable, shelf, desk, dresser |\n\n### 3. Navigate and Search\nFor each candidate receptacle (in priority order):\n1. `go to {receptacle}`\n2. Read the observation — does it mention the target object?\n - **YES**: `take {object} from {receptacle}` — object found\n - **NO**: If the receptacle is closed, `open {receptacle}` and re-check\n - **Still NO**: Move to the next candidate receptacle\n\n### 4. Track Searched Locations\nMaintain a list of already-searched receptacles to avoid revisiting them. If all high-probability locations are exhausted, expand the search to remaining receptacles.\n\n## Example\n\n**Task:** \"Clean the knife and put it in drawer.\"\n**Observation:** \"You are in the middle of a room. Looking quickly around you, you see a countertop 1, a drawer 1, a drawer 2, a fridge 1, a sinkbasin 1, a stoveburner 1.\"\n\n```\n> go to countertop 1\nOn the countertop 1, you see a knife 1, a saltshaker 2, a bread 1.\n> take knife 1 from countertop 1\nYou pick up the knife 1 from the countertop 1.\n```\n\n**Result:** Target object `knife 1` located and acquired from `countertop 1`.\n\n**Example — Object not at first location:**\n\n```\n> go to countertop 1\nOn the countertop 1, you see a saltshaker 2, a bread 1.\n> go to drawer 1\nThe drawer 1 is closed.\n> open drawer 1\nYou open the drawer 1. The drawer 1 is open. In it, you see a knife 1.\n> take knife 1 from drawer 1\nYou pick up the knife 1 from the drawer 1.\n```\n\n## Error Handling\n- **Object not found in any receptacle**: Re-check closed containers that may not have been opened. Some objects are only visible after opening.\n- **Multiple instances**: If the task requires a specific instance (e.g., `knife 1` vs `knife 2`), verify the object identifier matches before taking it.\n- **\"Nothing happened\"**: The `take` command may fail if the agent is not at the receptacle. Ensure navigation was successful before attempting to take.\n","profile":{"capability":{"text":"Locate a specified ALFWorld object that is not in inventory and whose location is unknown by parsing the observation, prioritizing likely receptacles, and navigating to search them.","evidence":[{"line":3},{"line":5}]},"when_to_use":[{"text":"Use this skill when the task requires a specific object, the object is not in inventory, and the observation does not state where it is.","evidence":[{"line":8},{"line":9},{"line":10},{"line":11}]},{"text":"Use this skill when common-sense ranking of receptacles can help choose the most promising search location.","evidence":[{"line":3}]}],"scenarios":[{"name":"Find and take a likely kitchen or food item from the first promising receptacle","before":[{"text":"The goal names a kitchen or food object, it is not in inventory, and its location is unknown while likely receptacles are visible.","evidence":[{"line":9},{"line":10},{"line":11},{"line":26},{"line":27}]}],"after":[{"text":"The target object is found in the highest-priority receptacle and taken from it.","evidence":[{"line":37},{"line":56}]}]},{"name":"Open a closed candidate receptacle and recover an object","before":[{"text":"The goal names an electronics object, it is not in inventory, its location is unknown, and some candidate receptacles may be closed.","evidence":[{"line":9},{"line":10},{"line":11},{"line":29},{"line":42}]}],"after":[{"text":"A closed candidate receptacle is opened, the object becomes visible, and the object is then taken from that receptacle.","evidence":[{"line":38},{"line":39},{"line":66},{"line":68}]}]}],"inputs":[{"text":"A goal naming a specific object and an observation that does not reveal that object's location.","evidence":[{"line":9},{"line":11}]},{"text":"Environment observation text containing visible receptacles to extract and consider.","evidence":[{"line":16},{"line":17},{"line":18},{"line":19}]}],"outputs":[{"text":"A navigation-oriented action plan that either moves to the most promising receptacle and acquires the object when found or establishes that the target was located and taken.","evidence":[{"line":3},{"line":37},{"line":56}]}],"constraints":[{"text":"Use applies only when the target object is not in inventory and the current observation does not explicitly state its location.","evidence":[{"line":10},{"line":11}]},{"text":"Already-searched receptacles should be tracked to avoid revisiting them, and the search expands to remaining receptacles only after high-probability locations are exhausted.","evidence":[{"line":42}]},{"text":"If the task requires a specific instance, the object identifier must match before taking it, and take actions require successful navigation to the receptacle.","evidence":[{"line":73},{"line":74}]}],"tools":[{"text":"Navigation and interaction actions such as going to a receptacle, opening it if closed, and taking the object from it.","evidence":[{"line":35},{"line":37},{"line":38},{"line":65},{"line":67}]}]}},{"skill_id":"alfworld-object-picker","name":"alfworld-object-picker","path":"experiments/src/skills/alfworld/alfworld-object-picker/SKILL.md","source":"---\nname: alfworld-object-picker\ndescription: Picks up a specified object from a given receptacle. Use this skill when the agent has located a required object and needs to acquire it for later use, such as taking an item from a surface or container. The skill requires the object and source receptacle as inputs, executing a 'take' action to transfer the object into the agent's inventory, enabling further manipulation like placement or usage.\n---\n# Instructions\nExecute the `take` action to acquire the target object from the source receptacle.\n\n## Inputs\n- `object`: The identifier of the object to pick up (e.g., \"toiletpaper 1\").\n- `source_receptacle`: The identifier of the receptacle where the object is located (e.g., \"toilet 1\").\n\n## Process\n1. **Verify Context:** Ensure the agent is at the location of the `source_receptacle`. If not, the agent must navigate there first using a separate movement skill.\n2. **Execute Action:** Perform the action: `take {object} from {source_receptacle}`.\n3. **Handle Feedback:** If the environment indicates \"Nothing happened,\" consult the troubleshooting guide in `references/troubleshooting.md` for potential issues.\n\n## Output\n- The specified object is transferred to the agent's inventory.\n- The agent receives an observation confirming the successful pickup (e.g., \"You pick up the {object} from the {source_receptacle}\").\n","profile":{"capability":{"text":"Picks up a specified object from a given receptacle by executing a take action to transfer it into the agent's inventory.","evidence":[{"line":3},{"line":6}]},"when_to_use":[{"text":"Use this skill when the agent has located a required object and needs to acquire it for later use.","evidence":[{"line":3}]}],"scenarios":[{"name":"Pick up a located object from a receptacle","before":[{"text":"The agent has located a required object and needs to acquire it for later use.","evidence":[{"line":3}]},{"text":"The object is located in a known source receptacle.","evidence":[{"line":10}]}],"after":[{"text":"The specified object is transferred to the agent's inventory.","evidence":[{"line":18}]},{"text":"The agent receives an observation confirming the successful pickup.","evidence":[{"line":19}]}]}],"inputs":[{"text":"`object`: the identifier of the object to pick up.","evidence":[{"line":9}]},{"text":"`source_receptacle`: the identifier of the receptacle where the object is located.","evidence":[{"line":10}]}],"outputs":[{"text":"The object is placed in the agent's inventory.","evidence":[{"line":18}]},{"text":"A successful pickup observation is returned.","evidence":[{"line":19}]}],"constraints":[{"text":"The agent must be at the location of the source receptacle before executing the take action, otherwise it must move there using a separate movement skill.","evidence":[{"line":13}]},{"text":"If the environment indicates \"Nothing happened,\" consult the troubleshooting guide in `references/troubleshooting.md`.","evidence":[{"line":15}]}],"tools":[{"text":"The `take` action is required to acquire the target object from the source receptacle.","evidence":[{"line":6},{"line":14}]}]}}],"relations":[{"source":"alfworld-device-operator","target":"alfworld-clean-object","type":"compose_with","contexts":[{"scenario":"Prepare and execute a cleaning interaction on a held object","explanation":"alfworld-device-operator covers the exact final action form `clean {obj} with {device}` for cleanable objects and requires using the discovered exact names after locating and co-locating the device and target. alfworld-clean-object then supplies the sinkbasin-specific cleaning step, requiring the object to be in inventory, navigation to the sinkbasin, and confirming the object is clean, so the device-operator stage can precede and support the clean-object step when the device is a sinkbasin-compatible cleaning receptacle.","conditions":["The task explicitly uses the clean-with-device action and the device can be a faucet/spraybottle rather than a sinkbasin.","The object has already been taken into inventory and the operator has located/co-located the device and object."],"source_evidence":[{"line":3},{"line":38},{"line":39},{"line":42}],"target_evidence":[{"line":7},{"line":10},{"line":11},{"line":12}]}]},{"source":"alfworld-goal-interpreter","target":"alfworld-clean-object","type":"compose_with","contexts":[{"scenario":"Goal interpretation can precede a cleaning step in a task plan.","explanation":"alfworld-goal-interpreter parses the raw task into a structured dictionary and sequential sub-objectives, which can then specify the cleaning target and action; alfworld-clean-object next executes the cleaning workflow on a held object at the sinkbasin and confirms the object is clean.","conditions":["The agent has a raw natural-language task goal that includes a need to clean an item.","The interpreter produces a structured plan identifying the object and action before execution."],"source_evidence":[{"line":3},{"line":7},{"line":10},{"line":11},{"line":12},{"line":15}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15},{"line":18}]},{"scenario":"After cleaning is complete, the resulting clean object can be used as the next step in the task.","explanation":"alfworld-clean-object produces the post-condition that the object is in a clean state and ready for the next task step; a downstream task plan can use that clean-state result when continuing execution.","conditions":["The object has already been cleaned successfully.","The next operation is to continue with the task, such as placing or using the clean object elsewhere."],"source_evidence":[{"line":11},{"line":12},{"line":30},{"line":32}],"target_evidence":[{"line":12},{"line":36}]}]},{"source":"alfworld-clean-object","target":"alfworld-object-locator","type":"compose_with","contexts":[{"scenario":"Locate a cleanable held object before cleaning it","explanation":"Object-locator can first navigate to a likely receptacle, open it if needed, and take the target object from there; clean-object then requires the object to be in inventory and at the sinkbasin before issuing `clean {obj} with {recep}`. In a path where the object is not yet held, locating and taking it is the necessary upstream stage before the cleaning step.","conditions":["The object is not yet in inventory? no: clean-object requires the object already be held","The object's location is unknown and must be searched for first, then picked up"],"source_evidence":[{"line":7},{"line":10},{"line":11},{"line":18},{"line":19}],"target_evidence":[{"line":7},{"line":10},{"line":11},{"line":35},{"line":37},{"line":74}]},{"scenario":"After a target object has been located and taken, clean it next if it is dirty","explanation":"Object-locator outputs that the target object has been located and acquired, including taking it from a receptacle; clean-object then uses a held object plus a sinkbasin to perform the clean action and marks it ready for the next step. This supports the sequence where locating a dirty item precedes cleaning it.","conditions":["The located object is one that must be cleaned before the next task step","A sinkbasin is available for the cleaning action"],"source_evidence":[{"line":11},{"line":12},{"line":15},{"line":19},{"line":23},{"line":33},{"line":36}],"target_evidence":[{"line":3},{"line":37},{"line":56},{"line":73},{"line":74}]}]},{"source":"alfworld-clean-object","target":"alfworld-object-picker","type":"compose_with","contexts":[{"scenario":"Acquire an object before cleaning it","explanation":"alfworld-object-picker can run first to transfer the target object into inventory, which is a required precondition for alfworld-clean-object. The cleaner explicitly requires an object already in inventory and then proceeds to clean it and continue to the next step.","conditions":["The object is not yet in inventory and must be picked up first.","The next step is cleaning the same object at a sinkbasin."],"source_evidence":[{"line":7},{"line":11},{"line":12},{"line":23},{"line":36}],"target_evidence":[{"line":7},{"line":18},{"line":19}]},{"scenario":"Pick up an object after it has been cleaned and is ready for the next step","explanation":"alfworld-clean-object can run first to establish the clean state and leave the object ready for the next task step, after which alfworld-object-picker can be used to acquire an object when the workflow requires obtaining an item for later use. This composition is only valid when the same workflow actually needs a pickup after cleaning, since the cleaner’s post-condition is to proceed to the next step, not to perform the pickup itself.","conditions":["The cleaning step has completed successfully and the object is now clean.","The downstream task needs the object acquired from a receptacle for later manipulation."],"source_evidence":[{"line":12},{"line":33},{"line":36}],"target_evidence":[{"line":3},{"line":13},{"line":18}]}]},{"source":"alfworld-goal-interpreter","target":"alfworld-device-operator","type":"compose_with","contexts":[{"scenario":"Parse task goal, then execute the device-based interaction from the parsed plan.","explanation":"The goal interpreter first parses the task into structured components and a sequential plan, including the primary target, reference object, spatial relation, and action; the device operator then uses those parsed names to locate the device and object and perform the exact final action with the discovered names.","conditions":["A raw natural-language ALFWorld task specifies both a device/appliance and a target object, and the device skill is used to execute the resulting action path."],"source_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15},{"line":18},{"line":25}],"target_evidence":[{"line":18},{"line":24},{"line":27},{"line":34},{"line":39},{"line":42}]},{"scenario":"Goal parsing produces the task entities and action vocabulary that the device operator consumes next.","explanation":"The goal interpreter turns the raw task string into a structured dictionary and translates the task verbs into the environment's action set; the device operator relies on those exact object and device names plus compatible action verbs to carry out the final interaction.","conditions":["The task is a device-based ALFWorld instruction such as 'look at X under Y' or 'heat X with Y' where parsing the goal produces the object/action vocabulary needed by the operator."],"source_evidence":[{"line":10},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15},{"line":25}],"target_evidence":[{"line":18},{"line":21},{"line":24},{"line":35},{"line":36},{"line":37},{"line":38},{"line":39}]}]},{"source":"alfworld-device-operator","target":"alfworld-object-picker","type":"compose_with","contexts":[{"scenario":"Pickup stage inside device-operation workflow","explanation":"`alfworld-device-operator` explicitly says it locates the target object, then in Phase 2 uses `take {obj} from {recep}` to pick it up before moving on to device co-location and the final device action. `alfworld-object-picker` provides exactly that pickup operation and requires the object and source receptacle as inputs, returning the object to inventory. So the operator skill can precede and set up the picker skill when the next step is to acquire the located object for later device use.","conditions":["The task already identified a target object that must later be used with a device, and the object is still in its receptacle."],"source_evidence":[{"line":24},{"line":27},{"line":30},{"line":39}],"target_evidence":[{"line":3},{"line":9},{"line":10},{"line":14},{"line":18}]}]},{"source":"alfworld-goal-interpreter","target":"alfworld-object-locator","type":"compose_with","contexts":[{"scenario":"From parsed goal to environment search and retrieval","explanation":"The goal interpreter produces a structured goal with primary_target, reference_object, spatial_relation, and action, plus a sequential plan; the object locator then uses a goal naming a specific object and unknown location to rank receptacles, navigate to one, and take the object when found. This makes the interpreter a valid precursor to the locator in task execution when the task is an ALFWorld find-and-retrieve objective.","conditions":["The raw task has been parsed into structured components and the reference object may be a container.","The next step is to search the environment for the named object when its location is not revealed.","After locating the object in a receptacle, the locator can hand off the discovered place for acquisition."],"source_evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":15},{"line":18},{"line":25}],"target_evidence":[{"line":3},{"line":8},{"line":9},{"line":10},{"line":11},{"line":22},{"line":35},{"line":37},{"line":42}]}]},{"source":"alfworld-object-locator","target":"alfworld-goal-interpreter","type":"compose_with","contexts":[{"scenario":"From located object state back into structured goal planning","explanation":"The object locator’s after-state is that the target object is found and acquired from a receptacle; the goal interpreter then can use the raw task goal to derive the structured fields and sequential sub-objectives needed to continue planning. The locator contributes the located object state, and the interpreter next converts the task into structured actions and relation-aware subgoals.","conditions":["The object locator has searched a receptacle, opened it if needed, and found the target object.","The next operation is to interpret the object’s relation/action requirements into a task plan for the broader goal.","This is only a complementary stage when the locator’s result is fed into downstream task planning rather than standalone retrieval."],"source_evidence":[{"line":37},{"line":56},{"line":66},{"line":67},{"line":68}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":18},{"line":25}]}]},{"source":"alfworld-goal-interpreter","target":"alfworld-object-picker","type":"compose_with","contexts":[{"scenario":"Goal interpretation can feed object pickup after the target and source receptacle are identified from the raw task string.","explanation":"alfworld-goal-interpreter produces the structured object/receptacle interpretation that the object-picker needs next: object identifier plus source receptacle for a take action.","conditions":["The interpreter has already parsed the instruction into primary_target and reference_object.","The pickup step is for acquiring a located object from a known receptacle."],"source_evidence":[{"line":3},{"line":8},{"line":10},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}],"target_evidence":[{"line":8},{"line":10},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]},{"scenario":"A sequential plan that includes locating the reference object can precede pickup of the target object from that receptacle.","explanation":"alfworld-goal-interpreter establishes the ordered sub-goals and, when the reference object is a container, includes opening before inspection; those outputs support the object-picker's next operation of taking the object from the identified receptacle.","conditions":["The task relation has been resolved into a step sequence.","The object to acquire is located in a known source receptacle."],"source_evidence":[{"line":18},{"line":21},{"line":22},{"line":25},{"line":27}],"target_evidence":[{"line":3},{"line":9},{"line":10},{"line":13},{"line":14},{"line":18},{"line":19}]},{"scenario":"Parsed task verbs and environment actions can supply the action framing required before pickup execution.","explanation":"alfworld-goal-interpreter maps task verbs to available actions and can therefore provide the action-level framing that leads into the object-picker's concrete take operation on the identified object and receptacle.","conditions":["The parser has translated task verbs into environment action types.","The pickup skill executes a take action using object and source receptacle inputs."],"source_evidence":[{"line":25},{"line":27}],"target_evidence":[{"line":6},{"line":8},{"line":9},{"line":10},{"line":14},{"line":18},{"line":19}]}]},{"source":"alfworld-object-locator","target":"alfworld-object-picker","type":"compose_with","contexts":[{"scenario":"After locating the target in a receptacle, pick it up from that receptacle.","explanation":"The locator can end with the object being found in a specific receptacle and then taken; the picker is the next step because it requires the object identifier and source receptacle to execute `take {object} from {source_receptacle}` and transfer it to inventory.","conditions":["The object has already been located in a known receptacle and the agent is positioned there or can first move there."],"source_evidence":[{"line":37},{"line":56},{"line":73},{"line":74}],"target_evidence":[{"line":3},{"line":9},{"line":10},{"line":13},{"line":14},{"line":18},{"line":19}]}]},{"source":"alfworld-object-picker","target":"alfworld-object-locator","type":"compose_with","contexts":[{"scenario":"After a successful pickup, search for another specific object whose location is still unknown.","explanation":"The picker can produce the post-pickup state where the object is transferred into inventory; that state satisfies the locator's use condition that the object is not in inventory and location is unknown, so the locator can run next to search for a different specific object under those conditions.","conditions":["The target object is not in inventory and its location is unknown from the current observation."],"source_evidence":[{"line":18},{"line":19}],"target_evidence":[{"line":8},{"line":9},{"line":10},{"line":11},{"line":3}]}]}]}
diff --git a/frontend/public/data/scienceworld-analysis.json b/frontend/public/data/scienceworld-analysis.json
deleted file mode 100644
index 2d1e496..0000000
--- a/frontend/public/data/scienceworld-analysis.json
+++ /dev/null
@@ -1 +0,0 @@
-{"schema_version":1,"skills":[{"skill_id":"scienceworld-circuit-builder","name":"scienceworld-circuit-builder","path":"experiments/src/skills/scienceworld/scienceworld-circuit-builder/SKILL.md","source":"---\nname: scienceworld-circuit-builder\ndescription: This skill constructs a simple electrical circuit by connecting components like batteries, wires, and light bulbs. Use when the agent needs to test electrical conductivity or create a functional circuit for an experiment. The input is a set of available components, and the output is a fully connected circuit ready for activation.\n---\n# Instructions\n\n## 1. Objective\nYour goal is to build a functional electrical circuit to test the conductivity of a target object (e.g., a metal pot). The circuit's success is indicated by a light bulb turning on.\n\n## 2. Prerequisites & Setup\n* **Location:** You must be in the **workshop**. If not, teleport there.\n* **Components:** Ensure the following are present on the table:\n * A battery\n * A light bulb (e.g., blue light bulb)\n * At least two wires (e.g., orange, yellow, green)\n * The target object to test (e.g., metal pot)\n * A blue box (for conductive objects) and an orange box (for non-conductive objects)\n* **Inventory:** The target object must be in your inventory. If not, locate and pick it up.\n\n## 3. Core Procedure\nFollow these steps to construct the series circuit. Use the exact `connect` actions as shown.\n\n1. **Place the Target Object:** Drop the target object from your inventory onto the floor of the workshop.\n2. **Connect Power Source:**\n * `connect battery anode to <Wire1> terminal 1` (e.g., `orange wire`)\n * `connect battery cathode to <Wire2> terminal 1` (e.g., `yellow wire`)\n3. **Connect Light Bulb:**\n * `connect <Wire1> terminal 2 to <LightBulb> cathode` (e.g., `blue light bulb`)\n * `connect <Wire3> terminal 2 to anode in <LightBulb>` (e.g., `green wire`)\n4. **Integrate Target Object into Circuit:**\n * `connect <TargetObject> terminal 1 to <Wire2> terminal 2`\n * `connect <TargetObject> terminal 2 to <Wire3> terminal 1`\n\n## 4. Testing & Conclusion\n1. **Observe:** After completing the connections, `wait1` for 1-2 iterations.\n2. **Check Result:** `look around`. If the light bulb is **on**, the target object is **electrically conductive**.\n3. **Final Action:** Based on the result:\n * If **conductive**: `move <TargetObject> to blue box`\n * If **non-conductive**: `move <TargetObject> to orange box`\n\n## 5. Key Principles\n* **Circuit Logic:** This builds a simple series circuit: Battery -> Wire1 -> Light Bulb -> Wire3 -> Target Object -> Wire2 -> Battery.\n* **Action Precision:** Use the exact object names and connection points (anode, cathode, terminal 1/2) as observed in the environment.\n* **Error Handling:** If a component is missing, examine the room (`look around`) to identify available substitutes before proceeding.\n\n## 6. Example\n**Task:** Test whether a metal pot is electrically conductive.\n1. `teleport to workshop`\n2. `pick up metal pot`\n3. `connect battery anode to orange wire terminal 1`\n4. `connect battery cathode to yellow wire terminal 1`\n5. `connect orange wire terminal 2 to blue light bulb cathode`\n6. `connect green wire terminal 2 to anode in blue light bulb`\n7. `connect metal pot terminal 1 to yellow wire terminal 2`\n8. `connect metal pot terminal 2 to green wire terminal 1`\n9. `wait1` — observe if the light bulb turns on\n10. Light bulb is on → `move metal pot to blue box` (conductive)\n","profile":{"capability":{"text":"Build a simple series electrical circuit to test whether a target object is electrically conductive and use the bulb state to decide where to place the object.","evidence":[{"line":3},{"line":8}]},"when_to_use":[{"text":"Use this skill when you need to test electrical conductivity or create a functional circuit for an experiment.","evidence":[{"line":3},{"line":8}]}],"scenarios":[{"name":"Conductivity test returns conductive","before":[{"text":"A target object is available to test and is already in the inventory.","evidence":[{"line":8},{"line":18}]},{"text":"The workshop table has a battery, a light bulb, at least two wires, and the blue and orange boxes.","evidence":[{"line":12},{"line":15},{"line":17}]}],"after":[{"text":"The bulb is on, establishing that the target object is electrically conductive.","evidence":[{"line":36},{"line":38}]},{"text":"The conductive target object is moved to the blue box.","evidence":[{"line":38}]}]}],"inputs":[{"text":"Available components on the table and the target object in inventory are the starting inputs.","evidence":[{"line":12},{"line":18}]}],"outputs":[{"text":"A completed circuit whose bulb indicates conductivity, plus the target object moved to the blue box if conductive or the orange box if non-conductive.","evidence":[{"line":36},{"line":38},{"line":39}]}],"constraints":[{"text":"The work must be done in the workshop, teleporting there if necessary.","evidence":[{"line":11}]},{"text":"The circuit requires the named components and exact connection points or suitable substitutes found by inspection if something is missing.","evidence":[{"line":12},{"line":21},{"line":43}]}],"tools":[{"text":"The skill uses teleport, pick up, connect, wait1, look around, and move actions.","evidence":[{"line":21},{"line":25},{"line":26},{"line":28},{"line":29},{"line":31},{"line":32},{"line":35},{"line":36},{"line":38},{"line":39}]}]}},{"skill_id":"scienceworld-heating-apparatus-setup","name":"scienceworld-heating-apparatus-setup","path":"experiments/src/skills/scienceworld/scienceworld-heating-apparatus-setup/SKILL.md","source":"---\nname: scienceworld-heating-apparatus-setup\ndescription: This skill positions a container with a substance onto a heating device (stove, oven) and activates the device. It should be triggered when a task requires melting, boiling, or heating a substance. The skill moves the prepared container to the heating element and turns it on.\n---\n# Instructions\n\n## Purpose\nThis skill automates the setup of a heating apparatus for scientific experiments involving melting, boiling, or heating a substance. It handles the positioning of a prepared container onto a heating element and the activation of the device.\n\n## Prerequisites\n1. **Target Substance:** The substance to be heated (e.g., chocolate, water) must be located and identified.\n2. **Suitable Container:** A compatible, heat-safe container (e.g., metal pot, beaker) must be available in the environment.\n3. **Heating Device:** A functional heating device (e.g., stove, oven) must be present and accessible.\n4. **Location:** The agent should be in the same room as the required items (kitchen, workshop, etc.).\n\n## Core Procedure\nFollow this sequence to execute the skill. Use the bundled `setup_heater.py` script for reliable, error-prone steps (1-4).\n\n1. **Prepare the Substance:** Ensure the target substance is placed into the chosen container.\n * *High Freedom Decision:* Select the most appropriate container based on the substance and heating method.\n * *Action Pattern:* `move <SUBSTANCE> to <CONTAINER>`\n\n2. **Position the Container:** Move the prepared container onto the heating device.\n * *Action Pattern:* `move <CONTAINER> to <HEATING_DEVICE>`\n\n3. **Activate the Heater:** Turn on the heating device to begin the thermal process.\n * *Action Pattern:* `activate <HEATING_DEVICE>`\n\n4. **Verify Setup:** Confirm the container is correctly positioned and the device is active.\n * *Action Pattern:* `look at <HEATING_DEVICE>`\n * *Expected Observation:* The device is \"turned on\" and the container is listed as being on it.\n\n## Post-Setup & Monitoring\nAfter the heating apparatus is active, proceed with the main experiment (e.g., temperature measurement). Use the bundled `monitor_temperature.py` script for consistent temperature checks.\n* **Monitor State:** Regularly examine the substance (`examine <SUBSTANCE>`) to observe phase changes (e.g., solid -> liquid).\n* **Measure Temperature:** Use a thermometer (`use thermometer on <SUBSTANCE>`) to track thermal progress.\n\n## Error Handling & Notes\n* If the initial `look around` does not reveal the necessary items, use `teleport to <ROOM>` to navigate to the correct location (e.g., kitchen).\n* All containers are pre-opened. Do not use `open` or `close` actions.\n* The skill assumes the heating device is initially deactivated and ready for use.\n* For complex thermal protocols (specific ramp rates, hold times), consult the `references/thermal_procedures.md` guide.\n","profile":{"capability":{"text":"Set up a heating apparatus by placing a prepared container with a target substance onto a heating device and activating it for scientific heating tasks.","evidence":[{"line":3},{"line":8}]},"when_to_use":[{"text":"Use this skill when a task requires melting, boiling, or heating a substance.","evidence":[{"line":3},{"line":8}]}],"scenarios":[{"name":"Prepare and activate a heating setup","before":[{"text":"A target substance, a suitable container, a heating device, and co-location in the same room are available.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14}]}],"after":[{"text":"The substance is in a container placed on the heating device with the heater activated.","evidence":[{"line":19},{"line":23},{"line":26},{"line":31}]}]}],"inputs":[{"text":"A target substance must be identified and available to be moved into a chosen container.","evidence":[{"line":11},{"line":19},{"line":21}]},{"text":"A compatible heat-safe container must be available for selecting the most appropriate vessel.","evidence":[{"line":12},{"line":20}]},{"text":"A functional heating device such as a stove or oven must be available as the destination for the prepared container.","evidence":[{"line":13},{"line":23},{"line":24}]}],"outputs":[{"text":"The container is correctly positioned on the heating device and the device is turned on.","evidence":[{"line":29},{"line":31}]},{"text":"After setup, the workflow can continue with heating monitoring such as examining the substance or measuring temperature.","evidence":[{"line":34},{"line":35},{"line":36}]}],"constraints":[{"text":"The environment must provide a suitable heat-safe container, a functional accessible heating device, and the agent must be in the same room; the heater is assumed initially deactivated.","evidence":[{"line":12},{"line":13},{"line":14},{"line":41}]},{"text":"Containers are pre-opened, so open and close actions should not be used.","evidence":[{"line":40}]},{"text":"Complex thermal protocols such as specific ramp rates or hold times are handled by an external thermal procedures guide.","evidence":[{"line":42}]}],"tools":[{"text":"Bundled scripts `setup_heater.py` and `monitor_temperature.py` are provided for setup and temperature monitoring.","evidence":[{"line":17},{"line":34}]}]}},{"skill_id":"scienceworld-substance-fetcher","name":"scienceworld-substance-fetcher","path":"experiments/src/skills/scienceworld/scienceworld-substance-fetcher/SKILL.md","source":"---\nname: scienceworld-substance-fetcher\ndescription: Locates and retrieves a target substance or material from a container in the environment. Use this skill when the task requires processing a specific substance (e.g., chocolate, sodium chloride, a chemical) and you need to find and acquire it. Searches rooms and containers (fridge, cupboard, counter) and retrieves the substance via pick up or move actions.\n---\n# Skill: Substance Fetcher\n\n## Primary Objective\nLocate a specified target substance (e.g., `chocolate`, `sodium chloride`) within the environment and retrieve it for subsequent processing.\n\n## Core Logic & Workflow\n1. **Identify Target:** The target substance name is provided as part of the task initiation (e.g., \"Your task is to measure the melting point of **chocolate**\").\n2. **Search Strategy:**\n * If the current room does not contain the target, use `teleport to [room]` to navigate to likely locations (e.g., `kitchen`, `workshop`, `greenhouse`).\n * Use `look around` to survey a room and identify containers.\n3. **Locate in Container:**\n * Examine open containers (`fridge`, `cupboard`, `counter`, `drawer`) listed in the room description.\n * The target substance is often found inside a container (e.g., \"In the fridge is: **chocolate**\").\n4. **Retrieval Action:**\n * If the substance is a portable object, use `pick up [substance]`.\n * If the substance is inside another object (e.g., in a pot), use `move [substance] to [destination container]` to prepare it for use.\n * **Key Assumption:** All containers are already open. Do not use `open` or `close` actions.\n\n## Critical Constraints & Notes\n* **Container State:** Assume all containers (fridge, cupboard, drawer) are **already open**. Do not waste actions opening them.\n* **Action Efficiency:** Prefer `pick up` for direct acquisition. Use `move` only when necessary to transfer the substance to a specific vessel for an experiment.\n* **Verification:** After retrieval, you may use `examine [substance]` or check your inventory to confirm success before proceeding to the next phase of the experiment.\n\n## Example Execution (Based on Trajectory)\n**Task Context:** \"Your task is to measure the melting point of **chocolate**...\"\n1. `teleport to kitchen`\n2. `look around` *(Observes: \"In the fridge is: chocolate...\")*\n3. `pick up chocolate` or `move chocolate to metal pot`\n\n## Error Handling\n* If the substance is not found in the initially suspected room, teleport to and search other relevant rooms (e.g., `workshop` for chemicals, `greenhouse` for plants).\n* If the retrieval action fails (e.g., object not found), re-examine the room description with `look around` to confirm the substance's location and container.\n","profile":{"capability":{"text":"Locate a specified target substance or material in the environment and retrieve it, either by picking it up directly or moving it to a destination container when needed.","evidence":[{"line":3},{"line":8},{"line":19},{"line":20}]},"when_to_use":[{"text":"Use this skill when a task requires finding and acquiring a specific substance or material for later processing.","evidence":[{"line":3},{"line":8},{"line":11}]}],"scenarios":[{"name":"Find and pick up a portable substance","before":[{"text":"The task specifies a target substance and the current room does not obviously contain it, so a room search is needed.","evidence":[{"line":11},{"line":13},{"line":16}]}],"after":[{"text":"The substance has been picked up and is available for subsequent processing.","evidence":[{"line":19},{"line":26},{"line":33}]}]},{"name":"Move a substance into a vessel","before":[{"text":"The substance is inside another object and must be transferred to a specific vessel for use.","evidence":[{"line":20},{"line":25}]}],"after":[{"text":"The substance has been moved into a destination container for experiment setup.","evidence":[{"line":20},{"line":25},{"line":33}]}]},{"name":"Search alternate rooms after a miss","before":[{"text":"The suspected room does not contain the target or the retrieval attempt fails.","evidence":[{"line":13},{"line":35},{"line":36}]}],"after":[{"text":"Other relevant rooms are searched and the substance’s location is rechecked after an initial search fails.","evidence":[{"line":35},{"line":36}]}]}],"inputs":[{"text":"A task context that names the target substance to find, such as chocolate or sodium chloride.","evidence":[{"line":11},{"line":29}]},{"text":"Room descriptions or the ability to survey rooms and identify likely containers holding the substance.","evidence":[{"line":13},{"line":14},{"line":16}]}],"outputs":[{"text":"The target substance is retrieved and can be confirmed in inventory or by examination before the next experiment phase.","evidence":[{"line":8},{"line":26},{"line":33}]}],"constraints":[{"text":"Containers are assumed to already be open, so opening or closing actions should not be used.","evidence":[{"line":21},{"line":24}]},{"text":"Prefer pick up for direct acquisition and use move only when the substance must be transferred for an experiment.","evidence":[{"line":25}]}],"tools":[{"text":"Teleport to move between rooms and look around to inspect room contents and containers.","evidence":[{"line":13},{"line":14},{"line":30},{"line":31}]},{"text":"Pick up and move actions are used to retrieve the substance or transfer it to a container.","evidence":[{"line":19},{"line":20},{"line":32}]}]}},{"skill_id":"scienceworld-substance-preparator","name":"scienceworld-substance-preparator","path":"experiments/src/skills/scienceworld/scienceworld-substance-preparator/SKILL.md","source":"---\nname: scienceworld-substance-preparator\ndescription: Use when you need to transfer a target substance into an appropriate container for processing (e.g., a pot for heating, a beaker for mixing). Trigger after acquiring the substance and before setting up an apparatus. Selects a suitable empty container and moves the substance into it.\n---\n# Substance Preparation Skill\n\n## Purpose\nPrepare a target substance for subsequent processing (e.g., heating, mixing) by transferring it from its current location into an appropriate, empty container.\n\n## When to Use\n1. **Trigger:** After successfully locating and focusing on the target substance.\n2. **Prerequisite:** The substance must be accessible (e.g., in inventory, in an open container).\n3. **Next Step:** This skill should be completed **before** setting up any apparatus (e.g., activating a stove, connecting electrical components).\n\n## Core Procedure\n1. **Identify Target Substance:** Confirm the exact name and location of the substance to be prepared.\n2. **Scan Environment for Containers:** Look for empty, process-appropriate containers in the current room. Priority order:\n * **Primary:** Metal pots, beakers, or bowls (for heating/mixing).\n * **Secondary:** Ceramic/glass cups, jars (if primary not available).\n * **Avoid:** Containers already holding items or substances.\n3. **Select & Validate Container:** Choose the most suitable empty container. If uncertain, `examine` it to confirm it's empty.\n4. **Execute Transfer:** Use the `move [SUBSTANCE] to [CONTAINER]` action.\n5. **Verify:** Briefly check the container's contents to confirm the transfer was successful.\n\n## Key Considerations\n* **Container State:** All containers are pre-opened. Do not use `open` or `close` actions.\n* **Efficiency:** Prefer containers in the same room to minimize `teleport` use.\n* **Substance Integrity:** If the substance is temperature-sensitive (e.g., chocolate in a fridge), moving it to a room-temperature container is part of preparation.\n* **Error Handling:** If the transfer fails (e.g., container not found), `look around` again and consult the bundled reference for common container names.\n\n## Example\n\n**Scenario:** You need to melt chocolate as part of a heating task.\n\n1. You have already located `chocolate` in the `fridge` in the kitchen.\n2. Run `look around` to scan for containers. You see: `metal pot` (empty, on counter), `glass beaker` (empty, on shelf), `ceramic cup` (contains water).\n3. Select `metal pot` as the best option (metal, empty, suitable for heating).\n4. Run `examine metal pot` to confirm it is empty.\n5. Run `move chocolate to metal pot`.\n6. Run `examine metal pot` — output confirms: \"metal pot (containing chocolate)\".\n\n**Proceed to the next skill (e.g., apparatus setup) only after this verification.**\n","profile":{"capability":{"text":"Transfer a target substance into an appropriate empty container so it is prepared for subsequent processing.","evidence":[{"line":3},{"line":8}]},"when_to_use":[{"text":"Use after acquiring and locating the target substance, and before setting up any apparatus or processing equipment.","evidence":[{"line":3},{"line":11},{"line":13}]},{"text":"Use when a substance must be prepared for heating, mixing, or a similar subsequent processing task.","evidence":[{"line":8},{"line":33},{"line":42}]}],"scenarios":[{"name":"Prepare a substance for later processing","before":[{"text":"The target substance has been located and is accessible in inventory or an open container.","evidence":[{"line":11},{"line":12}]},{"text":"At least one empty, suitable container is available to select and validate.","evidence":[{"line":17},{"line":21}]}],"after":[{"text":"The substance has been transferred into an appropriate empty container and the transfer has been verified.","evidence":[{"line":22},{"line":23}]},{"text":"The environment is ready for the next apparatus setup or processing step.","evidence":[{"line":13},{"line":42}]}]},{"name":"Relocate a temperature-sensitive substance into a process container","before":[{"text":"The target substance is temperature-sensitive and currently located in a source such as a fridge.","evidence":[{"line":28},{"line":35}]},{"text":"A suitable empty heating or mixing container is available in the room.","evidence":[{"line":36},{"line":37}]}],"after":[{"text":"A temperature-sensitive substance has been moved out of its current state into a room-temperature container for preparation.","evidence":[{"line":28},{"line":40}]}]}],"inputs":[{"text":"A successfully located target substance with its exact name and current location.","evidence":[{"line":11},{"line":16}]},{"text":"Available containers in the current room, especially metal pots, beakers, bowls, or secondary ceramic or glass cups and jars.","evidence":[{"line":17},{"line":18},{"line":19}]}],"outputs":[{"text":"The target substance is moved into a selected container and the container's contents confirm the transfer.","evidence":[{"line":22},{"line":23},{"line":40}]}],"constraints":[{"text":"The substance must be accessible, this skill is used before apparatus setup, and containers are already pre-opened so open or close actions should not be used.","evidence":[{"line":12},{"line":13},{"line":26}]},{"text":"Choose an empty, process-appropriate container, prefer one in the same room, and avoid containers that already hold items or substances.","evidence":[{"line":20},{"line":21},{"line":27}]},{"text":"If the substance is temperature-sensitive, moving it to a room-temperature container is part of preparation, and failed transfers should be retried by looking around and checking common container names.","evidence":[{"line":28},{"line":29}]}],"tools":[{"text":"Examine and look around are used to validate empty containers and recover from failed transfers.","evidence":[{"line":21},{"line":29}]},{"text":"The move [SUBSTANCE] to [CONTAINER] action is used to execute the transfer.","evidence":[{"line":22}]}]}},{"skill_id":"scienceworld-task-interpreter","name":"scienceworld-task-interpreter","path":"experiments/src/skills/scienceworld/scienceworld-task-interpreter/SKILL.md","source":"---\nname: scienceworld-task-interpreter\ndescription: This skill parses a user's high-level scientific task in the ScienceWorld environment and extracts the core objective and target location. It should be triggered when a new task instruction is received, especially those involving finding, comparing, or manipulating objects. The skill interprets the query to identify the goal (e.g., 'find the animal with the shortest life span') and any specified locations (e.g., 'animals are in the outside location'), outputting a clear, actionable sub-goal for navigation or observation.\n---\n# Instructions\n\nActivate this skill when the user provides a new task instruction for the ScienceWorld environment. Your primary function is to interpret the instruction and generate a clear, executable plan.\n\n## 1. Parse the Task\nRead the user's instruction carefully. Extract the following core components:\n* **Primary Objective:** What is the ultimate goal? (e.g., \"find\", \"compare\", \"manipulate\").\n* **Target Object/Subject:** What is the main focus of the task? (e.g., \"animal with the shortest life span\").\n* **Specified Location:** Is a location explicitly mentioned? (e.g., \"animals are in the 'outside' location\").\n\n## 2. Formulate the Plan\nBased on the parsed components, construct a plan. The standard plan structure is:\n1. **Navigate:** If a target location is specified and you are not there, teleport to it immediately.\n2. **Observe:** Upon arriving at the correct location, use `look around` to survey the environment and identify relevant objects.\n3. **Analyze & Execute:** Apply domain knowledge or comparative reasoning to the observed objects to fulfill the primary objective. Then, take the final required action (e.g., `focus on [OBJECT]`, `pick up [OBJECT]`).\n\n## 3. Output the Interpretation\nBefore taking the first action, articulate your interpretation and plan in a **Thought** step. This confirms the skill has correctly parsed the task.\n**Output Format:**\n","profile":{"capability":{"text":"Interprets a ScienceWorld task instruction to extract the core objective and any target location, then produces a clear actionable sub-goal for navigation or observation.","evidence":[{"line":3},{"line":7}]},"when_to_use":[{"text":"Use this skill when a new ScienceWorld task instruction is received, especially for tasks involving finding, comparing, or manipulating objects.","evidence":[{"line":3},{"line":7}]}],"scenarios":[{"name":"Navigate to a specified location before observation","before":[{"text":"The task instruction names a location and the agent is not already there.","evidence":[{"line":13},{"line":17}]}],"after":[{"text":"A navigation sub-goal is established that teleports to the specified location when one is given and the current position is elsewhere.","evidence":[{"line":16},{"line":17}]},{"text":"The environment is surveyed with a look-around observation at the correct location.","evidence":[{"line":18}]},{"text":"The final task-relevant action is determined using the observed objects and the primary objective.","evidence":[{"line":19}]}]},{"name":"Interpret and execute a task after parsing","before":[{"text":"The task instruction has been parsed into an objective, a target object or subject, and possibly a location.","evidence":[{"line":10},{"line":11},{"line":12},{"line":13}]}],"after":[{"text":"Relevant objects in the location are identified through observation.","evidence":[{"line":18}]},{"text":"Domain knowledge or comparative reasoning is applied to satisfy the objective and choose the final action.","evidence":[{"line":19}]}]},{"name":"State interpretation before acting","before":[{"text":"A new task instruction has been received and no first action has yet been taken.","evidence":[{"line":22}]}],"after":[{"text":"A Thought step is produced that states the interpretation and plan before any first action.","evidence":[{"line":22}]}]}],"inputs":[{"text":"A new user task instruction for the ScienceWorld environment, including any stated objective, target object or subject, and specified location.","evidence":[{"line":7},{"line":10},{"line":13}]}],"outputs":[{"text":"A parsed interpretation and executable plan, expressed as a Thought step and ending in a concrete next action or sub-goal.","evidence":[{"line":19},{"line":22}]}],"constraints":[{"text":"The interpretation and plan must be articulated in a Thought step before taking the first action.","evidence":[{"line":22}]}],"tools":[{"text":"look around","evidence":[{"line":18}]},{"text":"teleport","evidence":[{"line":17}]}]}}],"relations":[{"source":"scienceworld-heating-apparatus-setup","target":"scienceworld-substance-fetcher","type":"compose_with","contexts":[{"scenario":"Heating setup completed, then monitor the same substance during the experiment","explanation":"After the heating apparatus is active, the heating skill explicitly says to proceed with the main experiment using temperature measurement or examination, and the substance fetcher provides the retrieval-and-confirmation capability for the target substance that is then being monitored.","conditions":["The heating setup has already placed the substance in a container on the heating device and activated it.","The next phase is to verify or continue with thermal monitoring of that same substance."],"source_evidence":[{"line":34},{"line":35},{"line":36}],"target_evidence":[{"line":8},{"line":19},{"line":26}]}]},{"source":"scienceworld-substance-fetcher","target":"scienceworld-heating-apparatus-setup","type":"compose_with","contexts":[{"scenario":"Retrieve a substance, then prepare it for heating","explanation":"The substance fetcher can produce the target substance in hand or moved into a destination container, which directly satisfies the heating setup’s prerequisite that the target substance be located/available and then placed into a chosen container before the heater is activated.","conditions":["The substance-fetching step is used to obtain the target substance before the heating setup begins.","The fetched substance is then moved into a container that can be placed on a heater."],"source_evidence":[{"line":8},{"line":19},{"line":20},{"line":26}],"target_evidence":[{"line":11},{"line":12},{"line":19},{"line":23},{"line":26}]}]},{"source":"scienceworld-heating-apparatus-setup","target":"scienceworld-substance-preparator","type":"compose_with","contexts":[{"scenario":"Heating setup completed, then a later workflow needs substance preparation before another processing stage.","explanation":"The heating setup skill establishes the active heating state and container placement, after which the preparator can be used in workflows that need a substance transferred into an appropriate container before later processing steps. The preparator’s own procedure requires an accessible substance and an empty suitable container, then performs the transfer and verification next.","conditions":["A heating apparatus has already been set up and activated with the substance in a container on the heater.","The task then continues with preparing or relocating a substance for later processing in another container, rather than immediately heating it."],"source_evidence":[{"line":29},{"line":31},{"line":34}],"target_evidence":[{"line":8},{"line":13},{"line":22},{"line":23},{"line":42}]}]},{"source":"scienceworld-substance-preparator","target":"scienceworld-heating-apparatus-setup","type":"compose_with","contexts":[{"scenario":"Substance is prepared first, then heating apparatus is assembled and activated.","explanation":"The substance preparator produces the exact artifact the heating setup needs next: a target substance already transferred into an appropriate empty container and verified. The heating-apparatus skill then takes a prepared container, moves it onto the heating device, and activates the device, so the prepared container is the direct upstream input for its next operation.","conditions":["The substance-preparation step has already identified the target substance, selected an empty suitable container, moved the substance into it, and verified the transfer.","The next task is to set up heating in the same room with an accessible heater."],"source_evidence":[{"line":22},{"line":23},{"line":42}],"target_evidence":[{"line":19},{"line":23},{"line":26},{"line":31}]}]},{"source":"scienceworld-substance-fetcher","target":"scienceworld-substance-preparator","type":"compose_with","contexts":[{"scenario":"Fetched substance is passed directly into preparation for processing","explanation":"The fetcher completes with the substance retrieved and confirmed for later processing, which provides the exact target substance in inventory or an open container. The preparator then uses that accessible substance to move it into an appropriate empty container and verify the transfer before apparatus setup.","conditions":["The target substance has already been found and can be accessed in inventory or an open container.","A suitable empty process container is available in the same room.","The next step is preparing the substance for heating or mixing."],"source_evidence":[{"line":8},{"line":19},{"line":26}],"target_evidence":[{"line":8},{"line":12},{"line":22},{"line":23}]},{"scenario":"Fetcher performs the same container transfer that preparator consumes next","explanation":"The fetcher can finish by moving the substance to a destination container when needed, and the preparator’s next operation is exactly to choose an empty container, execute `move [SUBSTANCE] to [CONTAINER]`, and verify the contents. This makes the fetcher’s move-output a direct support for the preparator’s transfer-and-check workflow in the same environment.","conditions":["The substance is inside another object or otherwise needs to be transferred into a destination container.","A suitable empty container is available for the process step.","The next step after retrieval is to move the substance into that container and confirm success."],"source_evidence":[{"line":20},{"line":25},{"line":26}],"target_evidence":[{"line":17},{"line":20},{"line":22},{"line":23}]}]},{"source":"scienceworld-substance-fetcher","target":"scienceworld-task-interpreter","type":"compose_with","contexts":[{"scenario":"Using a fetched substance as the prepared object for a later interpreted action plan","explanation":"The substance-fetcher identifies and retrieves a named substance, leaving it available for subsequent processing. That retrieved state can support the task-interpreter's later step of selecting the final task-relevant action from the observed and parsed objective, since the interpreter explicitly produces an executable plan ending in a concrete next action or sub-goal.","conditions":["The ScienceWorld task names a specific substance/material to find and acquire.","The agent needs a concrete retrieval target before executing room search or pick-up steps."],"source_evidence":[{"line":8},{"line":19},{"line":20},{"line":26}],"target_evidence":[{"line":3},{"line":18},{"line":19},{"line":22}]}]},{"source":"scienceworld-task-interpreter","target":"scienceworld-substance-fetcher","type":"compose_with","contexts":[{"scenario":"Parsing a new ScienceWorld instruction into a retrieval plan","explanation":"The task-interpreter consumes the new instruction and produces a Thought-step plan before the first action; the substance-fetcher can then use that parsed task context to know which substance to search for and retrieve. This supports a direct execution sequence where interpretation happens first, then fetching.","conditions":["A ScienceWorld task has just been received and the agent must first understand what to do before acting."],"source_evidence":[{"line":7},{"line":10},{"line":16},{"line":22}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":18},{"line":26}]}]}]}
diff --git a/frontend/public/data/webshop-analysis.json b/frontend/public/data/webshop-analysis.json
deleted file mode 100644
index b139aaa..0000000
--- a/frontend/public/data/webshop-analysis.json
+++ /dev/null
@@ -1 +0,0 @@
-{"schema_version":1,"skills":[{"skill_id":"webshop-action-executor","name":"webshop-action-executor","path":"experiments/src/skills/webshop/webshop-action-executor/SKILL.md","source":"---\nname: webshop-action-executor\ndescription: This skill executes a specific interface action, such as clicking a button or selecting an option, within a web shopping environment. It should be triggered when a decision has been made (e.g., to choose a color or proceed to purchase). The input is the target action identifier (e.g., 'white' or 'buy now'), and the output is the corresponding formatted action command (e.g., click[white]).\n---\n# Skill: WebShop Action Executor\n\n## Purpose\nExecute a single, specific action in a WebShop environment after a decision has been made. This skill formats the action into the required command structure for the WebShop interface.\n\n## When to Use\n- **Trigger:** When the agent has completed its analysis and has decided on the exact action to take (e.g., \"select the white color option,\" \"proceed to buy now\").\n- **Input:** A clear target identifier (string) derived from the available actions on the current page.\n- **Output:** A correctly formatted `click[value]` or `search[keywords]` command.\n\n## Core Instruction\n1. **Receive Input:** The skill is provided with a single `target_action` string (e.g., 'white', 'buy now', 'b08w25dbb7').\n2. **Format Output:** Immediately output the action in the exact format required by the WebShop environment:\n ","profile":{"capability":{"text":"Formats one selected WebShop interface action into the required command structure.","evidence":[{"line":3},{"line":8},{"line":17}]},"when_to_use":[{"text":"Use after analysis is complete and the agent has decided the exact interface action to take.","evidence":[{"line":3},{"line":11},{"line":12}]}],"scenarios":[{"name":"Format a chosen WebShop action","before":[{"text":"A decision has already been made and a clear target action identifier from the current page is available.","evidence":[{"line":3},{"line":11},{"line":12}]}],"after":[{"text":"The environment receives one correctly formatted WebShop action command.","evidence":[{"line":3},{"line":8},{"line":17}]}]}],"inputs":[{"text":"A single target action string such as a color, button label, or item identifier.","evidence":[{"line":3},{"line":12},{"line":16}]}],"outputs":[{"text":"A formatted `click[value]` or `search[keywords]` command matching the WebShop interface.","evidence":[{"line":3},{"line":13},{"line":17}]}],"constraints":[{"text":"The output must be in the exact command format required by the WebShop environment.","evidence":[{"line":17}]}],"tools":[]}},{"skill_id":"webshop-attribute-selector","name":"webshop-attribute-selector","path":"experiments/src/skills/webshop/webshop-attribute-selector/SKILL.md","source":"---\nname: webshop-attribute-selector\ndescription: Selects specific product attributes (e.g., flavor, size) on a product detail page to match user requirements. Triggered when a product page presents configurable options and the parsed query specifies needed values. It identifies the correct option from available clickables (e.g., 'smoked bacon' for flavor, '4 ounce (pack of 2)' for size) and executes the selection click.\n---\n# Instructions\n\n## When to Use\nActivate this skill when ALL of the following are true:\n1. You are on a product detail page (not a search results page).\n2. The observation contains configurable product options (e.g., \"flavor\", \"size\") listed as available actions.\n3. The user's instruction specifies required values for one or more of these attributes (e.g., \"gluten free\", \"4 ounce (pack of 2)\", \"smoked peppered bacon\").\n\n## Core Process\n1. **Parse Requirements:** From the user's instruction, extract the required attribute values (e.g., target flavor, size, dietary feature).\n2. **Map to Options:** Examine the list of available actions (clickables). Identify which clickable text corresponds to each required attribute value.\n * Use exact or fuzzy matching (see `scripts/match_attribute.py` for logic).\n * Prioritize exact matches. For dietary features like \"gluten free\" or \"vegetarian,\" the product title or description may already confirm this; your goal is to select the correct flavor/size.\n3. **Execute Selection:** For each identified attribute option, perform a `click[value]` action, where `value` is the exact text of the matching clickable.\n4. **Finalize:** After all required attributes are selected, if a \"Buy Now\" or similar action is available and the instruction implies a purchase, you may proceed to click it.\n\n## Important Notes\n* Do not use this skill on search results pages. Use search actions there.\n* If a required attribute cannot be matched to any available clickable, do not click. Re-evaluate the instruction or consider a different product.\n* The observation may refresh after each click, showing the same page with selected options highlighted. Continue until all specified attributes are satisfied.\n","profile":{"capability":{"text":"Selects specific product attributes on a product detail page by matching user-specified values to available clickable options and clicking the matching choices.","evidence":[{"line":3}]},"when_to_use":[{"text":"Activate when on a product detail page that shows configurable options and the user's instruction names required attribute values.","evidence":[{"line":8},{"line":9},{"line":10},{"line":11}]}],"scenarios":[{"name":"Choose matching product options","before":[{"text":"You are on a product detail page with configurable options and the user specifies one or more required attribute values.","evidence":[{"line":9},{"line":10},{"line":11}]}],"after":[{"text":"All required attribute options have been clicked and the product reflects the requested configuration.","evidence":[{"line":18}]}]},{"name":"Proceed to buy after configuration","before":[{"text":"All required attributes are selected and the instruction implies a purchase.","evidence":[{"line":19}]}],"after":[{"text":"A purchase step has been initiated by clicking Buy Now or a similar action.","evidence":[{"line":19}]}]}],"inputs":[{"text":"An observation from a product detail page that lists configurable product options as available actions.","evidence":[{"line":10}]},{"text":"A user instruction that specifies required attribute values such as flavor, size, or dietary feature.","evidence":[{"line":11},{"line":14}]},{"text":"A list of available clickable texts used to map required values to matching options.","evidence":[{"line":15},{"line":16}]}],"outputs":[{"text":"Selected product attributes represented by click actions on the exact matching clickable text.","evidence":[{"line":18}]},{"text":"Optionally, a Buy Now or similar purchase action may be clicked when the instruction implies a purchase.","evidence":[{"line":19}]},{"text":"The page may refresh after each click and continue showing the selected options highlighted until all specified attributes are satisfied.","evidence":[{"line":24}]}],"constraints":[{"text":"Use only when on a product detail page, configurable options are present as available actions, and the user has specified required attribute values.","evidence":[{"line":8},{"line":9},{"line":10},{"line":11}]},{"text":"Do not use this skill on search results pages.","evidence":[{"line":22}]},{"text":"If a required attribute cannot be matched to any available clickable, do not click and reconsider the instruction or product.","evidence":[{"line":23}]}],"tools":[{"text":"scripts/match_attribute.py for exact or fuzzy attribute matching logic.","evidence":[{"line":16}]}]}},{"skill_id":"webshop-attribute-verifier","name":"webshop-attribute-verifier","path":"experiments/src/skills/webshop/webshop-attribute-verifier/SKILL.md","source":"---\nname: webshop-attribute-verifier\ndescription: >\n Verifies product attributes on a web shop detail page by extracting price, comparing color availability,\n validating specifications, and confirming option selections against user requirements before purchase.\n Use when you need to check if a product matches requirements, verify product details before buying,\n confirm item specifications on an online store product page, or validate that price, color, size,\n or other attributes satisfy the user's constraints. Outputs a `Thought:` assessment followed by a\n `click[value]` action to select the matching option and proceed, or navigates back to search if\n the product does not match.\n---\n\n# Instructions\n\nYou are verifying product attributes on a detailed product page. Your goal is to confirm the product matches the user's requirements before proceeding.\n\n## Input\n\nYou receive an **Observation** containing:\n- The original user instruction (e.g., \"find a black leather wallet, price lower than 40.00 dollars\")\n- Product details: Title, Price, Rating\n- Available options (e.g., color buttons like \"black\", \"brown\")\n- Available actions (e.g., \"Buy Now\", \"Back to Search\", \"Description\")\n\n## Core Workflow\n\n1. **Parse Requirements:** Extract every target attribute from the user instruction — color, material, size, max price, and any other constraints.\n2. **Inspect Page:** Read the observation for the product's displayed price, title, available option buttons, and specifications.\n3. **Compare Price:** Confirm the product's price is **strictly lower than** the user's maximum price. If not, navigate back immediately.\n4. **Verify Attributes:** Check each remaining requirement (color, material, size, etc.) against the product's details and available options.\n5. **Select or Reject:**\n - If all requirements are satisfied, `click[option]` on the required attribute (e.g., `click[black]`) **first**, then `click[Buy Now]`.\n - If any requirement fails, `click[Back to Search]` to find a different product.\n\n## Action Format\n\n- `click[value]` — interact with a page element. The `value` must exactly match a clickable item from the observation.\n- `search[keywords]` — start a new search only if the current product cannot meet requirements.\n- Every response must begin with `Thought:` stating which requirement is being checked and the verdict.\n\n## Critical Rules\n\n- **Price is strict:** The price must be strictly less than the user's budget — equal is not acceptable.\n- **Select before buying:** Always click the required attribute option (e.g., `click[black]`) before clicking `click[Buy Now]`. Never skip this step.\n- **One action per turn:** Output exactly one action after your `Thought:`.\n\n## Example\n\n**User instruction:** \"Find a black leather wallet with price lower than 40.00 dollars\"\n\n**Observation:**\n```\n[Back to Search] [< Prev]\nTitle: Genuine Leather Bifold Wallet - Multiple Colors\nPrice: $35.99\nRating: ★★★★☆\nOptions: [black] [brown] [tan]\nActions: [Buy Now] [Description] [Back to Search]\n```\n\n**Response:**\n```\nThought: The user wants a black leather wallet under $40. The price is $35.99, which is strictly less than $40 — price check passes. The title mentions \"Leather\" which matches the material requirement. The color \"black\" is available as a selectable option. All requirements are satisfied. I will select the black option first.\nAction: click[black]\n```\n\n**Next turn — after selecting black:**\n```\nThought: The black option is now selected. All requirements verified. Proceeding to purchase.\nAction: click[Buy Now]\n```\n","profile":{"capability":{"text":"Verify whether a web shop product detail page matches a user's attribute requirements before purchase by comparing the displayed price, options, and specifications against those constraints.","evidence":[{"line":4},{"line":15},{"line":27}]},"when_to_use":[{"text":"Use this skill when you need to check whether a product matches purchase requirements on an online store detail page before continuing.","evidence":[{"line":6},{"line":7},{"line":8},{"line":15}]},{"text":"Use it to verify product details before buying, confirm item specifications, or validate price, color, size, or other attribute constraints.","evidence":[{"line":6},{"line":7}]}],"scenarios":[{"name":"Product matches all requirements","before":[{"text":"The observation includes a product whose price, title, options, and specifications can be checked against the user's requirements.","evidence":[{"line":27},{"line":28},{"line":29},{"line":30}]},{"text":"The user's constraints include a maximum price and possibly other attributes such as color, material, or size.","evidence":[{"line":27},{"line":43}]}],"after":[{"text":"The matching option is selected first and the product is ready to proceed with purchase.","evidence":[{"line":32},{"line":44}]},{"text":"All user requirements are satisfied.","evidence":[{"line":32}]}]},{"name":"Product fails a requirement","before":[{"text":"At least one requirement fails, including a price that is not strictly below the user's maximum or another attribute mismatch.","evidence":[{"line":29},{"line":30},{"line":33}]}],"after":[{"text":"The workflow returns to search instead of proceeding to purchase.","evidence":[{"line":33},{"line":10}]}]}],"inputs":[{"text":"An observation containing the original user instruction, product title, price, rating, available options, and available actions.","evidence":[{"line":19},{"line":20},{"line":21},{"line":22},{"line":23}]}],"outputs":[{"text":"A response that starts with Thought: and then outputs one action such as selecting the matching option, clicking Buy Now, or going back to search when the product does not match.","evidence":[{"line":8},{"line":9},{"line":10},{"line":39},{"line":45}]}],"constraints":[{"text":"The product price must be strictly less than the user's maximum price, and equality is not acceptable.","evidence":[{"line":43}]},{"text":"The required attribute option must be selected before Buy Now, and exactly one action may be output after the Thought message.","evidence":[{"line":44},{"line":45}]},{"text":"The action value must exactly match a clickable item from the observation, and every response must begin with Thought:.","evidence":[{"line":37},{"line":39}]}],"tools":[]}},{"skill_id":"webshop-initial-search","name":"webshop-initial-search","path":"experiments/src/skills/webshop/webshop-initial-search/SKILL.md","source":"---\nname: webshop-initial-search\ndescription: Performs the first search on an e-commerce platform using keywords derived from parsed user requirements. Use when starting product discovery from a user instruction or when previous search results are insufficient and a new query is needed. It formulates a search query from the criteria (e.g., '24 pack of 7.5 ounce bottles of non-gmo classic tonic') and executes the search[] action, returning the initial result page.\n---\n# Instructions\n1. **Parse Requirements:** Extract the core product criteria from the user's instruction. Focus on:\n * **Quantity & Packaging:** (e.g., \"24 pack\")\n * **Size:** (e.g., \"7.5 ounce bottles\")\n * **Key Attributes:** (e.g., \"non-gmo\", \"classic tonic\")\n * **Price Constraint:** (e.g., \"price lower than 50.00 dollars\") - This is for validation later, not for the initial search query.\n\n2. **Formulate Search Query:** Combine the extracted criteria into a concise, natural-language search string. Prioritize specificity to filter results effectively.\n * **Example:** For \"i would like to get a 24 pack of 7.5 ounce bottles of non-gmo classic tonic\", the query should be: `24 pack of 7.5 ounce bottles of non-gmo classic tonic`\n * **Do not** include the price constraint in the search keywords.\n\n3. **Execute Search:** Use the platform's `search[<keywords>]` action with your formulated query.\n * The action output will be the initial search results page observation.\n\n4. **Next Steps:** After executing this skill, proceed to evaluate the search results. The next actions will typically involve clicking on a promising product listing or refining the search.\n\n## Example\n\n**User instruction:** \"I would like to find a 24 pack of 7.5 ounce bottles of non-gmo classic tonic, and target price lower than 50.00 dollars\"\n\n**Thought:** I need to search for the product using the key attributes. I will omit the price constraint from the search keywords.\n\n**Action:** `search[24 pack of 7.5 ounce bottles of non-gmo classic tonic]`\n\n**Observation:** The platform returns the initial search results page with matching product listings.\n","profile":{"capability":{"text":"Performs the initial e-commerce product search by turning parsed user requirements into a concise keyword query and executing the platform search action.","evidence":[{"line":3},{"line":16}]},"when_to_use":[{"text":"Use when starting product discovery from a user instruction or when previous search results are insufficient and a new query is needed.","evidence":[{"line":3}]}],"scenarios":[{"name":"Start product discovery from a user requirement","before":[{"text":"The user instruction has been parsed into core product criteria such as quantity, size, and key attributes.","evidence":[{"line":6},{"line":9}]}],"after":[{"text":"The platform has produced an initial results page containing matching product listings.","evidence":[{"line":17},{"line":29}]}]},{"name":"Refresh product search with a new query","before":[{"text":"Previous search results are insufficient and a new query is needed.","evidence":[{"line":3}]}],"after":[{"text":"A fresh search results page is available, ready for evaluation or follow-up refinement.","evidence":[{"line":17},{"line":19}]}]}],"inputs":[{"text":"Parsed product criteria may include quantity and packaging, size, and key attributes from the user's instruction.","evidence":[{"line":6},{"line":7},{"line":8},{"line":9}]},{"text":"A user instruction requesting product discovery or a new search query is the starting input.","evidence":[{"line":3},{"line":23}]}],"outputs":[{"text":"The action returns the initial search results page observation with matching product listings.","evidence":[{"line":17},{"line":29}]}],"constraints":[{"text":"Price constraints are excluded from the initial search keywords and are reserved for later validation.","evidence":[{"line":10},{"line":14}]},{"text":"The search query should be concise, natural-language, and specific enough to filter results effectively.","evidence":[{"line":12},{"line":13}]}],"tools":[{"text":"The platform's search[<keywords>] action is required to execute the query.","evidence":[{"line":16},{"line":17}]}]}},{"skill_id":"webshop-option-selector","name":"webshop-option-selector","path":"experiments/src/skills/webshop/webshop-option-selector/SKILL.md","source":"---\nname: webshop-option-selector\ndescription: This skill selects product options or variants (such as size, color, or quantity) on a product detail page based on user preferences or cost optimization. It should be triggered when a product page displays configurable options. The skill evaluates available choices (e.g., 1pcs vs 2pcs) and selects the one that best aligns with the user's constraints, such as minimizing cost.\n---\n# Skill: WebShop Option Selector\n\n## Trigger Condition\nActivate this skill when the observation from the WebShop environment contains:\n1. A product detail page (indicated by the presence of a \"Price:\" field and product title).\n2. One or more configurable option categories (e.g., \"size:\", \"color:\", \"quantity:\") with clickable values listed beneath them.\n\n## Core Logic\n1. **Parse the Observation:** Identify all configurable option categories and their available values from the current page state.\n2. **Apply Selection Strategy:** By default, implement a **cost-minimization strategy**. For each option category, select the value that results in the lowest final price while still meeting any explicit user constraints from the original instruction (e.g., \"price lower than 40.00 dollars\").\n3. **Execute Selection:** Perform a `click[value]` action for the chosen option value. If multiple categories exist, they should be selected in the order they appear on the page.\n\n## Important Notes\n- The skill assumes the displayed price updates (or is representative) after an option is selected. Your action should be based on the currently displayed information.\n- If the user's instruction contains specific preferences (e.g., \"large size\", \"blue color\"), prioritize those over cost minimization.\n- If no clear cost difference can be inferred, select the first available option.\n- After selecting the desired option, you may proceed with other actions (e.g., `click[buy now]`).\n\n## Example from Trajectory\n**Observation Excerpt:**\n","profile":{"capability":{"text":"Select product variants or options on a WebShop product detail page by evaluating available choices and choosing the one that best fits user preferences or cost minimization.","evidence":[{"line":3},{"line":13},{"line":14},{"line":15}]},"when_to_use":[{"text":"Use this skill when the WebShop observation is a product detail page with configurable options displayed as clickable values.","evidence":[{"line":8},{"line":9},{"line":10}]}],"scenarios":[{"name":"Choose the best option on a configurable product page","before":[{"text":"A product detail page is visible with at least one configurable option category and clickable values.","evidence":[{"line":9},{"line":10},{"line":13}]},{"text":"Either the cost-minimization strategy can distinguish the cheapest choice or, if not, the first available option is used.","evidence":[{"line":14},{"line":20}]}],"after":[{"text":"The selected option value has been clicked and other actions may continue afterward.","evidence":[{"line":15},{"line":21}]}]},{"name":"Honor explicit user preferences over price","before":[{"text":"The page shows configurable options and the user has given a specific preference such as size or color.","evidence":[{"line":10},{"line":19}]}],"after":[{"text":"The option matching the user's stated preference is selected before any cost-based tie-breaking.","evidence":[{"line":19},{"line":15}]}]},{"name":"Minimize cost within user constraints","before":[{"text":"The page shows options whose price impact can be judged from the currently displayed information, and the user has price constraints.","evidence":[{"line":14},{"line":18}]}],"after":[{"text":"The selected option is the one that produces the lowest final price while still meeting the stated user constraints.","evidence":[{"line":14}]}]}],"inputs":[{"text":"A WebShop observation showing a product detail page with a price, product title, and one or more configurable option categories with clickable values.","evidence":[{"line":3},{"line":8},{"line":9},{"line":10},{"line":13}]},{"text":"The original user instruction, including any explicit preferences or constraints relevant to option choice.","evidence":[{"line":14},{"line":19}]}],"outputs":[{"text":"The chosen option value is clicked, and the page is left ready for possible follow-up actions such as buying.","evidence":[{"line":15},{"line":21}]}],"constraints":[{"text":"Selection must rely on the currently displayed information and, when no clear cost difference can be inferred, the first available option should be chosen.","evidence":[{"line":18},{"line":20}]},{"text":"Explicit user preferences override the default cost-minimization strategy, and any stated user constraints must still be satisfied.","evidence":[{"line":14},{"line":19}]},{"text":"When multiple option categories exist, they should be selected in the order they appear on the page.","evidence":[{"line":15}]}],"tools":[{"text":"click[value]","evidence":[{"line":15}]}]}},{"skill_id":"webshop-price-checker","name":"webshop-price-checker","path":"experiments/src/skills/webshop/webshop-price-checker/SKILL.md","source":"---\nname: webshop-price-checker\ndescription: This skill scans product listings or detail pages to verify if an item's price meets a specified budget constraint. It is triggered when evaluating a potential product for purchase. It extracts the price from the displayed information (e.g., '$164.95') and compares it against the maximum allowed budget, outputting a boolean decision on whether the item is within budget.\n---\n# Instructions\nWhen evaluating a product for purchase, use this skill to check if its price is within the specified budget.\n\n## Process\n1. **Identify the Budget:** Extract the maximum allowed price from the user's instruction or the current context. The budget is typically expressed as a dollar amount (e.g., \"lower than 200.00 dollars\").\n2. **Locate the Price:** On the current web page (search results or product detail page), find the price string. It is usually prefixed with a `$` symbol and may be labeled \"Price:\".\n3. **Execute Check:** Run the `check_price.py` script, providing it with the extracted price string and the budget.\n4. **Make Decision:** Based on the script's boolean output (`True`/`False`):\n * If `True`: The item is within budget. You may proceed with further evaluation or purchase.\n * If `False`: The item exceeds the budget. You should continue searching or select a different item.\n\n## Notes\n* The primary action for this skill is to call the bundled script. Do not perform manual price parsing or comparison in your main reasoning.\n* If the price cannot be found on the page, assume the item is not suitable and continue your search.\n","profile":{"capability":{"text":"Check whether a product's displayed price is within a specified budget by extracting the page price and comparing it with the maximum allowed amount.","evidence":[{"line":3},{"line":6},{"line":17}]},"when_to_use":[{"text":"Use when evaluating a potential product for purchase and verifying whether its displayed price is within budget.","evidence":[{"line":3},{"line":6}]}],"scenarios":[{"name":"Price fits budget","before":[{"text":"A budget limit and a page with an identifiable price string are available for checking.","evidence":[{"line":9},{"line":10},{"line":12}]}],"after":[{"text":"The item is established as within budget and may be considered for further evaluation or purchase.","evidence":[{"line":13}]}]},{"name":"Price exceeds budget","before":[{"text":"A budget limit and a page with an identifiable price string are available for checking.","evidence":[{"line":9},{"line":10},{"line":12}]}],"after":[{"text":"The item is established as over budget and the search should continue or another item should be selected.","evidence":[{"line":14}]}]},{"name":"Missing price","before":[{"text":"A product page is available but no price string can be found.","evidence":[{"line":10},{"line":18}]}],"after":[{"text":"The item is treated as not suitable because no price could be located on the page.","evidence":[{"line":18}]}]}],"inputs":[{"text":"A user's maximum budget and a current web page or product listing/detail page containing a displayed price string.","evidence":[{"line":3},{"line":9},{"line":10}]}],"outputs":[{"text":"A boolean within-budget decision that indicates whether the item is suitable, or a non-suitable outcome when no price is found.","evidence":[{"line":3},{"line":12},{"line":13},{"line":14},{"line":18}]}],"constraints":[{"text":"The main reasoning should not manually parse or compare prices; the bundled script is the primary action.","evidence":[{"line":17}]},{"text":"If the price cannot be found on the page, treat the item as not suitable and keep searching.","evidence":[{"line":18}]}],"tools":[{"text":"The bundled `check_price.py` script.","evidence":[{"line":11},{"line":17}]}]}},{"skill_id":"webshop-product-detail-check","name":"webshop-product-detail-check","path":"experiments/src/skills/webshop/webshop-product-detail-check/SKILL.md","source":"---\nname: webshop-product-detail-check\ndescription: >-\n Examines a specific product's detailed page to verify it matches the user's requirements,\n checking price, description, features, and reviews. Use when you have navigated to a\n product detail page from search results and need to confirm the product meets all\n user-specified constraints before purchasing. It provides a final suitability assessment\n with a clear proceed-or-reject recommendation.\n---\n# Skill: Product Detail Verification\n\n## Trigger\nActivate this skill when the agent has navigated to a specific product's detailed page from a search results list. The agent should have a user query containing specific requirements (e.g., product type, attributes, price constraints).\n\n## Core Objective\nAnalyze the product detail page to confirm if the product meets all user-specified constraints. Provide a clear \"Proceed\" or \"Reject\" recommendation.\n\n## Execution Workflow\n\n1. **Parse User Requirements:** Extract key constraints from the user's instruction. Primary constraints are typically **Price** and **Key Attributes** (e.g., \"long\", \"clip-in\", \"natural looking\"). Store these in a structured format.\n\n2. **Scrape Product Page Data:** Systematically extract the following information from the current page observation:\n * **Product Title**\n * **Price**\n * **Key Description Snippets** (from Description/Features sections)\n * **Rating** (if available)\n * **Availability of \"Buy Now\"** action.\n\n3. **Constraint Verification:** Compare the scraped data against the user's requirements.\n * **Price Check:** Is the product price strictly less than the user's maximum? (e.g., < $40.00).\n * **Attribute Check:** Do the title and description contain terms matching the user's key attributes? (e.g., confirm \"clip-in\" and \"natural looking\" are present).\n * **Suitability Flag:** Product is suitable only if **ALL** hard constraints (price, mandatory attributes) are satisfied.\n\n4. **Decision & Action:**\n * **If SUITABLE:** Conclude the product matches requirements. The recommended action is `click[buy now]`.\n * **If NOT SUITABLE:** Conclude the product fails one or more constraints. The recommended action is to return to search (`click[back to search]`) to find another candidate.\n\n## Output Format\nYour response must use the following format:\n\n**Thought:** [Your reasoning, summarizing the user's constraints, the product details found, and the result of the verification check.]\n**Action:** [The single, valid action to take: `click[buy now]` or `click[back to search]`]\n\n## Example\n\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n\n**Observation:** Product page for \"22 Inch Long Natural Looking Clip-In Hair Extension\" — Price: $34.99, Description mentions \"clip-in\", \"natural looking\", \"synthetic fiber\".\n\n**Thought:** The user needs a long, natural-looking, clip-in hair extension under $40. This product is priced at $34.99 (< $40.00), the title confirms \"long\" and \"natural looking\", and the description confirms \"clip-in\". All constraints are satisfied.\n**Action:** `click[buy now]`\n\n---\n\n**Observation:** Product page for \"Premium Human Hair Extension\" — Price: $45.99, Description mentions \"clip-in\", \"natural\".\n\n**Thought:** The user's budget is under $40. This product is priced at $45.99, which exceeds the $40 limit. Price constraint fails.\n**Action:** `click[back to search]`\n\n## Notes\n* Prioritize information explicitly on the product page. Assume missing information (like a Rating of \"N.A.\") does not disqualify a product unless specified by the user.\n* The \"Buy Now\" button must be present in the available actions list for the purchase action to be valid.\n","profile":{"capability":{"text":"Verify a specific product detail page against user-specified requirements and produce a proceed-or-reject recommendation.","evidence":[{"line":4},{"line":7},{"line":16}]},"when_to_use":[{"text":"Use when on a specific product detail page reached from search results and the user needs confirmation that the product meets the stated requirements before purchase.","evidence":[{"line":5},{"line":6},{"line":12},{"line":13}]}],"scenarios":[{"name":"Accept product and proceed to purchase","before":[{"text":"A product detail page is open from search results and the product matches the user's maximum price and required attributes.","evidence":[{"line":13},{"line":30},{"line":31}]}],"after":[{"text":"The product is confirmed to meet all required constraints and the recommended action is to click buy now.","evidence":[{"line":35},{"line":51}]}]},{"name":"Reject unsuitable product and return to search","before":[{"text":"A product detail page is open from search results and at least one hard constraint such as price or mandatory attributes does not satisfy the user's requirements.","evidence":[{"line":13},{"line":30},{"line":32}]}],"after":[{"text":"The product is rejected because at least one hard constraint fails and the recommended action is to click back to search.","evidence":[{"line":36},{"line":58}]}]}],"inputs":[{"text":"A user query with specific requirements and constraints, especially product type, attributes, and price limits.","evidence":[{"line":13},{"line":20}]},{"text":"The current product page observation including title, price, description or features, rating if available, and Buy Now availability.","evidence":[{"line":22},{"line":23},{"line":24},{"line":25},{"line":26},{"line":27}]}],"outputs":[{"text":"A suitability verdict expressed as Proceed or Reject, along with the single valid action to take.","evidence":[{"line":16},{"line":35},{"line":36},{"line":42}]}],"constraints":[{"text":"The price check uses a strict less-than comparison against the user's maximum.","evidence":[{"line":30}]},{"text":"A product is suitable only if all hard constraints, including price and mandatory attributes, are satisfied.","evidence":[{"line":32}]},{"text":"Missing information such as rating does not disqualify a product unless the user explicitly requires it.","evidence":[{"line":61}]},{"text":"The purchase action is valid only when a \"Buy Now\" button is present in the available actions list.","evidence":[{"line":62}]}],"tools":[{"text":"The valid actions are click[buy now] and click[back to search].","evidence":[{"line":35},{"line":36},{"line":42}]}]}},{"skill_id":"webshop-product-detail-inspector","name":"webshop-product-detail-inspector","path":"experiments/src/skills/webshop/webshop-product-detail-inspector/SKILL.md","source":"---\nname: webshop-product-detail-inspector\ndescription: This skill examines a product detail page to verify specific attributes or select options like size, color, or quantity. It is used after clicking on a product, to confirm that the item matches the user's needs (e.g., checking for '10 slots' option, price, material). The input is the product page observation, and the output is an action to select a required variant (e.g., click[10 slots]) or proceed if criteria are satisfied.\n---\n# Instructions\n\n## Purpose\nYou are an agent navigating a web shop. Your current task is to inspect a product detail page. You have arrived here after clicking on a product from the search results.\n\n## Input\nYou will receive an **Observation** containing the product page state. This includes:\n* The original user instruction (e.g., \"i am looking for an easy to clean jewelry box with 10 slots, and price lower than 60.00 dollars\").\n* Product details: Title, Price, Rating.\n* Available options (e.g., size variants like \"3 slot\", \"10 slots\").\n* Available actions (e.g., \"Buy Now\", \"Description\").\n\n## Core Logic\n1. **Parse the Instruction:** Identify the user's key requirements from the instruction (e.g., specific attribute: \"10 slots\", price constraint: \"< $60\").\n2. **Examine the Page:** Check the product's displayed **Price** against the user's budget. Check the available options for the required attribute.\n3. **Decision & Action:**\n * If the required attribute (e.g., \"10 slots\") is present as a selectable option, click on it.\n * If the product does not have the required attribute or exceeds the price limit, you should go \"Back to Search\".\n * If the product meets all criteria (correct attribute selected, price is valid), you may proceed (e.g., click \"Buy Now\").\n\n## Output Format\nYour response must be in this exact format:\n","profile":{"capability":{"text":"Inspect a web shop product detail page to verify user-specified attributes and decide whether to select a matching variant, go back to search, or proceed.","evidence":[{"line":3},{"line":8},{"line":17},{"line":20}]},"when_to_use":[{"text":"Use this skill after clicking a product from search results when a product detail page must be checked against the user's needs.","evidence":[{"line":3},{"line":8}]}],"scenarios":[{"name":"Select a matching variant","before":[{"text":"The observation contains a user requirement for a specific attribute and the page shows that attribute among the available options.","evidence":[{"line":12},{"line":14},{"line":18},{"line":19}]}],"after":[{"text":"The required attribute is selected as a selectable option on the product page.","evidence":[{"line":21}]}]},{"name":"Reject an unsuitable product","before":[{"text":"The observation shows user requirements and product price or options do not meet them.","evidence":[{"line":12},{"line":13},{"line":14},{"line":18},{"line":19},{"line":22}]}],"after":[{"text":"The task returns to search because the product lacks the required attribute or exceeds the price limit.","evidence":[{"line":22}]}]},{"name":"Proceed when criteria are satisfied","before":[{"text":"The product page satisfies the user's attribute and price requirements after evaluation.","evidence":[{"line":13},{"line":18},{"line":19},{"line":23}]}],"after":[{"text":"The product meets all criteria and the agent may proceed with purchase actions such as Buy Now.","evidence":[{"line":23}]}]}],"inputs":[{"text":"An observation of the product page state, including the original user instruction, product title, price, rating, available options, and available actions.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]}],"outputs":[{"text":"An action choice to click a required selectable variant, go back to search if requirements are unmet, or proceed when all criteria are satisfied.","evidence":[{"line":21},{"line":22},{"line":23}]}],"constraints":[{"text":"The response must follow the exact output format specified by the skill.","evidence":[{"line":25},{"line":26}]}],"tools":[]}},{"skill_id":"webshop-product-detail-navigator","name":"webshop-product-detail-navigator","path":"experiments/src/skills/webshop/webshop-product-detail-navigator/SKILL.md","source":"---\nname: webshop-product-detail-navigator\ndescription: Navigates to and interacts with a specific product's detail page. This skill is triggered after a candidate product ID is selected from search results. It performs the click action to load the product page and then identifies available interactive elements (like flavor or size selectors) that need to be configured to match the user's requirements.\n---\n# Instructions\n\n## Purpose\nThis skill is used to navigate from a product search result to the product's detail page and configure it according to the user's specific requirements (e.g., flavor, size, dietary needs).\n\n## When to Use\nUse this skill when you have identified a candidate product from a search result list and need to:\n1. Load its detailed product page.\n2. Verify its attributes against the user's instruction.\n3. Select the correct options (like `flavor` or `size`) to match the user's request.\n4. Proceed to the final purchase step if all criteria are met.\n\n## Core Workflow\n1. **Navigate to Product Page:** Click on the product ID (e.g., `B06Y96MXJV`) from the search results to load its detail page.\n2. **Parse the Page State:** Once on the product page, the observation will contain the product title, price, and a list of available interactive elements (clickables). Analyze these to find configuration options.\n3. **Match Requirements:** Cross-reference the user's original instruction with the available options. Look for keywords related to:\n * **Product Type/Flavor:** (e.g., \"smoked peppered bacon\", \"smoked bacon\").\n * **Attributes:** (e.g., \"gluten free\", \"vegetarian\").\n * **Size/Packaging:** (e.g., \"4 ounce (pack of 2)\").\n * **Price:** Ensure the displayed price is below any specified maximum.\n4. **Configure the Product:** Sequentially click on the option values that match the user's requirements. The typical order is to select the correct `flavor` first, then the correct `size`.\n5. **Finalize:** After configuring the product, if all requirements are satisfied, click the final action button (e.g., `Buy Now`).\n\n## Action Format\nYour actions must strictly follow the required format:\n* `click[<exact_value>]` - The `<exact_value>` must match one of the strings in the \"clickables\" list from the observation, including case and spacing.\n* `search[<keywords>]` - Use only if you need to go back to search. This skill focuses on post-search navigation.\n\n## Key Logic (Handled by Script)\nThe deterministic sequence of checking for and selecting flavor and size options is handled by the bundled script `configure_product.py`. Use it to generate the correct click actions after loading the product page.\n\n## Important Notes\n* **Validation:** Do not click an option if it does not appear in the current list of clickables.\n* **Observation:** Always read the full observation after each action. The list of clickables updates after each selection.\n* **Goal:** The final goal is to have a product configured per the user's instruction and ready for purchase.\n","profile":{"capability":{"text":"Navigate from a selected search result to a product detail page, inspect available product options, configure them to match the user's requirements, and finalize the product for purchase when all criteria are met.","evidence":[{"line":8},{"line":11},{"line":25},{"line":26}]},"when_to_use":[{"text":"Use this skill after selecting a candidate product from search results when you need to open its detail page, verify it, configure its options, and possibly proceed to purchase.","evidence":[{"line":11},{"line":15}]}],"scenarios":[{"name":"Open candidate product and configure it","before":[{"text":"A candidate product has already been identified from search results and its product ID is available to click.","evidence":[{"line":11},{"line":12},{"line":18}]}],"after":[{"text":"The product detail page is loaded, the product is configured to satisfy the user's requirements, and it is ready for purchase.","evidence":[{"line":18},{"line":26},{"line":39}]}]},{"name":"Inspect product page state","before":[{"text":"The product detail page is open and the current observation is available.","evidence":[{"line":19},{"line":38}]}],"after":[{"text":"The page state has been parsed for title, price, and clickable options so the available configuration choices are known.","evidence":[{"line":19},{"line":20},{"line":38}]}]},{"name":"Match requirements and select options","before":[{"text":"The user's original instruction and the product page's available options are available for comparison.","evidence":[{"line":20},{"line":24},{"line":25}]}],"after":[{"text":"The selected product options match the user's requested product type, attributes, size or packaging, and any maximum price constraint.","evidence":[{"line":20},{"line":21},{"line":22},{"line":23},{"line":24},{"line":25}]}]}],"inputs":[{"text":"A selected product ID from search results and an observation containing exact clickables on the product page.","evidence":[{"line":18},{"line":30}]},{"text":"The user's original instruction, including desired product type, attributes, size or packaging, and any maximum price.","evidence":[{"line":20},{"line":24}]}],"outputs":[{"text":"A configured product that meets the user's instruction and is ready for the final purchase step.","evidence":[{"line":26},{"line":39}]}],"constraints":[{"text":"Actions must use exact clickables strings in the required click format, and an option may only be clicked if it appears in the current list of clickables.","evidence":[{"line":30},{"line":37}]},{"text":"The search action is only for returning to search, because this skill focuses on post-search navigation.","evidence":[{"line":31}]},{"text":"The full observation must be read after each action because the clickables list can change.","evidence":[{"line":38}]}],"tools":[{"text":"The bundled script configure_product.py is used to generate the correct click actions after the product page is loaded.","evidence":[{"line":34}]}]}},{"skill_id":"webshop-product-evaluator","name":"webshop-product-evaluator","path":"experiments/src/skills/webshop/webshop-product-evaluator/SKILL.md","source":"---\nname: webshop-product-evaluator\ndescription: >-\n Evaluates product listings against user requirements such as price limits and feature\n matches to identify viable options. Use when you are on a search results page containing\n multiple products and need to select the most promising candidate for detailed inspection.\n The skill analyzes product titles, prices, and brief descriptions to rank and choose\n the best match.\n---\n# Instructions\n\n## When to Use\nActivate this skill when you are on a **search results page** in a web shopping environment and need to evaluate multiple products against specific user requirements (e.g., price limits, feature keywords).\n\n## Core Process\n1. **Parse the Observation:** Identify the user's instruction, the list of available products, and their associated details (Title, Price, ASIN/Product ID).\n2. **Extract Requirements:** From the user instruction, identify:\n * **Price Limit:** The maximum acceptable price (e.g., \"lower than 40.00 dollars\").\n * **Feature Keywords:** Key product attributes (e.g., \"teeth whitening\", \"freshens breath\").\n3. **Evaluate Products:** For each product listing on the current page:\n * Check if the price is below the user's limit.\n * Check if the product title contains the required feature keywords.\n * Prioritize products that meet all criteria. If multiple products qualify, choose the one that appears most relevant or cost-effective.\n4. **Take Action:**\n * If a suitable product is found, click on its product ID (e.g., `click[B09NYFDNVX]`) to view its details.\n * If no suitable product is found on the current page, consider using the `search` action with refined keywords or clicking `Next >` to browse more results.\n\n## Thought Process Format\nAlways structure your internal reasoning and final action using this format:\n\n**Thought:** [Summarize the user's constraints, evaluate each product against them, and justify your selection.]\n**Action:** `click[<product_id>]`\n\n## Example\n\n**Instruction:** \"i need a teeth whitening toothpaste that also freshens breath, and price lower than 15.00 dollars\"\n\n**Observation (Search Results Page):**\n- B09NYFDNVX: \"Whitening Toothpaste with Breath Freshener\" — $12.99\n- B08KZPTL3M: \"Professional Teeth Whitening Kit\" — $24.99\n- B07HQRJ4WP: \"Mint Fresh Whitening Toothpaste\" — $9.49\n\n**Thought:** The user needs a teeth whitening toothpaste that freshens breath, under $15. Product B09NYFDNVX at $12.99 mentions both \"whitening\" and \"breath freshener\" in the title — meets all criteria. B08KZPTL3M exceeds the budget at $24.99. B07HQRJ4WP is within budget and mentions \"whitening\" but does not explicitly mention breath freshening. Selecting B09NYFDNVX as the best match.\n**Action:** `click[B09NYFDNVX]`\n","profile":{"capability":{"text":"Evaluate product listings against user requirements to identify the best matching option from a search results page.","evidence":[{"line":4},{"line":5},{"line":7},{"line":8}]},"when_to_use":[{"text":"Use this skill on a web shopping search results page when multiple products must be compared against specific requirements.","evidence":[{"line":13}]}],"scenarios":[{"name":"Select best-matching product from search results","before":[{"text":"You are on a web shopping search results page with multiple product listings and their titles, prices, and IDs available.","evidence":[{"line":13},{"line":16}]},{"text":"The user has specified product requirements such as a maximum price and feature keywords.","evidence":[{"line":17},{"line":18},{"line":19}]}],"after":[{"text":"The most suitable product is selected for detailed inspection by clicking its product ID.","evidence":[{"line":23},{"line":25}]}]},{"name":"Handle no match on current page","before":[{"text":"You are evaluating multiple products on the current search results page against the user's requirements.","evidence":[{"line":13},{"line":20},{"line":21},{"line":22},{"line":23}]}],"after":[{"text":"If no current listing fits, the evaluation shifts to refined searching or moving to the next page of results.","evidence":[{"line":26}]}]}],"inputs":[{"text":"The current observation includes the user instruction and the list of available products with title, price, and product ID.","evidence":[{"line":16}]},{"text":"User requirements may include a price ceiling and feature keywords to match in product titles.","evidence":[{"line":18},{"line":19}]}],"outputs":[{"text":"A chosen product ID is clicked as the final action to open its details.","evidence":[{"line":25},{"line":32}]}],"constraints":[{"text":"Products should satisfy the price limit and title keyword match, and if several qualify the most relevant or cost-effective option should be preferred.","evidence":[{"line":21},{"line":22},{"line":23}]},{"text":"The required reasoning and final action format is Thought followed by Action with a click command.","evidence":[{"line":29},{"line":32}]}],"tools":[{"text":"Click actions on product IDs, and optionally search or advance to the next results page when needed.","evidence":[{"line":26},{"line":32},{"line":44}]}]}},{"skill_id":"webshop-product-search","name":"webshop-product-search","path":"experiments/src/skills/webshop/webshop-product-search/SKILL.md","source":"---\nname: webshop-product-search\ndescription: >-\n Performs an initial product search using a web interface by generating appropriate search\n keywords based on interpreted query criteria. Use when starting a product discovery task,\n when returning to search results after rejecting a product, or when the observation contains\n a search interface prompt. The skill inputs structured search parameters and outputs a list\n of candidate products from the search results page.\n---\n# Skill: WebShop Product Search\n\n## Core Workflow\n1. **Interpret Criteria:** Extract key product attributes from the user's instruction (e.g., product type, features, price constraints).\n2. **Formulate Query:** Construct a concise search string prioritizing the core product type and critical attributes. Start broad; refine if results are poor.\n3. **Execute Search:** Use the `search[keywords]` action to submit the query. Keywords must be a single string enclosed in brackets.\n4. **Validate Results:** Success is marked by a \"Page 1\" observation containing product listings. If 0 results are returned, re-invoke with a broader or alternative query. If all results exceed the user's price constraint, refine with additional terms.\n\n## Key Decision Logic\n* **Trigger Condition:** This skill is the entry point for a new product discovery task. Also activate when the observation contains \"[SEP] Search\" or \"[SEP] Back to Search\".\n* **Output Handoff:** The search results page is passed to downstream skills (e.g., `webshop-result-filter`, `webshop-product-evaluator`) for individual product analysis.\n\n## Constraints\n* Do not use this skill if no search action is available in the current state.\n* Do not include multiple actions or extra formatting in the search keywords.\n\n## Example from Trajectory\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n**Skill Execution:**\n1. Criteria identified: `product_type=\"clip-in hair extension\"`, `attribute=\"long\"`, `attribute=\"natural looking\"`, `budget=\"<40.00\"`.\n2. Query formulated: Prioritizes core product type and key attribute -> `\"long clip-in hair extension\"`.\n3. Action: `search[long clip-in hair extension]`\n","profile":{"capability":{"text":"Generate search keywords from interpreted product criteria and execute an initial web product search to produce candidate products from the results page.","evidence":[{"line":4},{"line":7},{"line":8}]},"when_to_use":[{"text":"Use when starting product discovery, when returning to search results after rejecting a product, or when the observation contains a search interface prompt.","evidence":[{"line":5},{"line":6},{"line":19}]}],"scenarios":[{"name":"Start a new product discovery search","before":[{"text":"A product discovery task has begun with interpreted criteria available for keyword generation and a search action is available.","evidence":[{"line":4},{"line":5},{"line":15}]}],"after":[{"text":"A \"Page 1\" observation with product listings confirms the search succeeded.","evidence":[{"line":16}]},{"text":"The resulting search page is ready for downstream filtering or evaluation.","evidence":[{"line":20}]}]},{"name":"Resume searching after rejection or return to search","before":[{"text":"The user rejected a product or the observation shows search context that returns to search results.","evidence":[{"line":6},{"line":16},{"line":19}]}],"after":[{"text":"If the first query returns 0 results, a broader or alternative query can be issued to recover candidate products.","evidence":[{"line":16}]}]}],"inputs":[{"text":"Structured search parameters or user criteria such as product type, features, and price constraints.","evidence":[{"line":7},{"line":13}]},{"text":"An observation that indicates a new product discovery task or a return to search results, including \"[SEP] Search\" or \"[SEP] Back to Search\".","evidence":[{"line":19}]}],"outputs":[{"text":"A search results page containing a list of candidate products that can be handed off to downstream product-analysis skills.","evidence":[{"line":8},{"line":20}]}],"constraints":[{"text":"Do not use the skill when no search action is available in the current state.","evidence":[{"line":23}]},{"text":"Search keywords must contain only a single action string with no extra formatting.","evidence":[{"line":24}]}],"tools":[{"text":"The `search[keywords]` action is used to submit the query.","evidence":[{"line":15}]}]}},{"skill_id":"webshop-product-selector","name":"webshop-product-selector","path":"experiments/src/skills/webshop/webshop-product-selector/SKILL.md","source":"---\nname: webshop-product-selector\ndescription: >-\n Selects the most promising product candidate from a filtered shortlist for detailed\n inspection. Use when you are on a search results page with multiple viable items and need\n to make a final selection based on a heuristic such as best feature match or lowest price.\n Triggers navigation to the selected product's detail page via click[product_id].\n---\n# Instructions\nUse this skill when you are on a search results page with multiple product options that appear to meet the user's core requirements.\n\n## Decision Process\n1. **Assess the List:** Review the provided observation, which contains a list of products. Each product entry typically includes a Product ID (e.g., `B093C1THVP`), a title, and a price.\n2. **Apply Selection Heuristic:** Use the bundled `selector.py` script to programmatically identify the best candidate. The script implements the following logic:\n * Filters products strictly under the user's specified maximum price.\n * Scores remaining products based on keyword matching in the title against the user's core requirements (e.g., \"portable\", \"easy to carry\", \"double horn\").\n * Selects the product with the highest score. In case of a tie, it chooses the lowest-priced item.\n3. **Execute Action:** The final action is always to click on the selected product's ID to navigate to its detail page for final verification and purchase. The action format is `click[product_id]`.\n\n## Thought Process Template\nStructure your reasoning before acting using this template:\n\n**Thought:** [List the user's requirements, evaluate each candidate product against them, explain why the selected product is the best match.]\n**Action:** `click[<product_id>]`\n\n## Example\n\n**Instruction:** \"i need a portable double horn bluetooth speaker that is easy to carry, and price lower than 50.00 dollars\"\n\n**Observation (Search Results):**\n- B093C1THVP: \"Portable Double Horn Bluetooth Speaker — Compact & Easy to Carry\" — $32.99\n- B08XYZ1234: \"Double Horn Wireless Speaker — Premium Sound\" — $55.00\n- B07ABC5678: \"Mini Portable Bluetooth Speaker\" — $19.99\n\n**Thought:** The user needs a portable, double horn bluetooth speaker that is easy to carry, under $50. B093C1THVP at $32.99 matches \"portable\", \"double horn\", and \"easy to carry\" — all keywords present in the title. B08XYZ1234 exceeds the $50 budget. B07ABC5678 is within budget but lacks \"double horn\". Selecting B093C1THVP as the best match.\n**Action:** `click[B093C1THVP]`\n","profile":{"capability":{"text":"Select the most promising product from a filtered shortlist on a search results page and navigate to its detail page.","evidence":[{"line":4},{"line":7},{"line":10}]},"when_to_use":[{"text":"Use this skill when on a search results page with multiple product options that appear to meet the user's core requirements.","evidence":[{"line":5},{"line":10}]}],"scenarios":[{"name":"Choose the best-matching product from search results","before":[{"text":"A search results page shows multiple viable products that appear to meet the user's core requirements.","evidence":[{"line":4},{"line":10},{"line":13}]},{"text":"The shortlist is evaluated by price filtering, keyword scoring, and lowest-price tie breaking.","evidence":[{"line":15},{"line":16},{"line":17}]}],"after":[{"text":"The chosen product's detail page is opened for final verification and purchase.","evidence":[{"line":18}]}]}],"inputs":[{"text":"An observation listing multiple product entries, typically with product IDs, titles, and prices.","evidence":[{"line":13},{"line":30},{"line":31}]},{"text":"The user's core requirements including a maximum price and keyword-based feature preferences.","evidence":[{"line":5},{"line":16},{"line":28}]}],"outputs":[{"text":"A click action on the selected product ID that opens the product detail page.","evidence":[{"line":7},{"line":18},{"line":36}]}],"constraints":[{"text":"Only products strictly under the user's maximum price are considered, ties are broken by lowest price, and the final action is click[product_id].","evidence":[{"line":15},{"line":17},{"line":18}]}],"tools":[{"text":"The bundled selector.py script.","evidence":[{"line":14}]}]}},{"skill_id":"webshop-purchase-executor","name":"webshop-purchase-executor","path":"experiments/src/skills/webshop/webshop-purchase-executor/SKILL.md","source":"---\nname: webshop-purchase-executor\ndescription: Executes the purchase action for a confirmed suitable product on an e-commerce page. Use when a product has been verified against the user's requirements (price, attributes) and the decision is to buy. Performs a click[Buy Now] action on the purchase button to complete the transaction.\n---\n# Skill: webshop-purchase-executor\n\n## Purpose\nExecute the final purchase transaction for a verified product on an e-commerce platform. This skill is the terminal action in a shopping workflow, initiated only after a product has been confirmed to meet the user's criteria (e.g., price, description).\n\n## When to Use\n- **Trigger:** You are on a product detail page.\n- **Prerequisite:** The product has been verified against the user's requirements (e.g., price < $40.00, \"natural looking\").\n- **User Intent:** The user has made a decision to buy the product.\n- **Available Action:** A purchase button (e.g., \"Buy Now\") is present in the list of clickable elements.\n\n## Core Action\nPerform a `click` action on the purchase button.\n\n## Execution Logic\n1. **Locate Purchase Button:** Identify the purchase button from the available actions. Common identifiers include:\n - `buy now`\n - `add to cart` (if the instruction implies immediate purchase)\n - `purchase`\n2. **Validate Context:** Ensure you are on a product page and the prior verification step is logically complete.\n3. **Execute Click:** Perform the `click[purchase_button_value]` action using the exact value from the available actions list.\n\n## Important Notes\n- Do not use this skill for browsing, searching, or product comparison.\n- The skill assumes price and specification validation occurred in a previous step.\n- If multiple purchase options exist (e.g., \"Buy Now\", \"Add to Cart & Checkout\"), prefer the most direct path to complete the transaction, typically \"Buy Now\".\n\n## Example\n\n**Scenario:** The user wants a natural-looking wig priced under $40.00. You are on a product detail page for \"Natural Looking Human Hair Wig - $34.99\" and have verified it meets all criteria.\n\n**Thought:** The product matches the user's requirements (natural looking, price $34.99 < $40.00). I should proceed with the purchase.\n\n**Action:** `click[Buy Now]`\n\n**Observation:** The purchase is confirmed and the transaction is complete.\n","profile":{"capability":{"text":"Executes the final purchase transaction for a verified e-commerce product by clicking the purchase button.","evidence":[{"line":3},{"line":8},{"line":17}]},"when_to_use":[{"text":"Use only when on a product detail page with prior requirement verification, a buy decision, and an available purchase button.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14}]},{"text":"Do not use for browsing, searching, or product comparison, and assume validation already happened earlier.","evidence":[{"line":28},{"line":29}]}],"scenarios":[{"name":"Complete a verified product purchase","before":[{"text":"You are on a product detail page, the product has already been verified against the user's requirements, the user wants to buy it, and a purchase button is available.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14}]}],"after":[{"text":"The purchase action is executed and the transaction is complete.","evidence":[{"line":17},{"line":38},{"line":40}]}]}],"inputs":[{"text":"The user's requirements verification, the available clickable purchase-button label, and the decision to take the most direct purchase path when multiple options exist.","evidence":[{"line":12},{"line":14},{"line":25},{"line":30}]}],"outputs":[{"text":"A confirmed purchase with the transaction completed.","evidence":[{"line":40}]}],"constraints":[{"text":"The action must be on a product page after prior verification, must not be used for browsing or comparison, and should prefer the most direct checkout path such as Buy Now.","evidence":[{"line":24},{"line":28},{"line":29},{"line":30}]}],"tools":[{"text":"A click action on the exact purchase button value from the available actions list.","evidence":[{"line":17},{"line":25}]}]}},{"skill_id":"webshop-purchase-initiator","name":"webshop-purchase-initiator","path":"experiments/src/skills/webshop/webshop-purchase-initiator/SKILL.md","source":"---\nname: webshop-purchase-initiator\ndescription: >-\n Initiates the purchase process by clicking the buy button once a product and its options\n have been selected and verified against requirements. Use when you are on a product detail\n page, all selection criteria (price, features, options) are satisfied, and the user is\n ready to proceed to checkout. Confirms the final price meets budget constraints before\n executing click[buy now].\n---\n# Instructions\n\n## When to Use\nActivate this skill when:\n1. A product has been selected from search results.\n2. All required product options (e.g., size, color, quantity) have been chosen.\n3. The final displayed price has been verified to be within the user's specified budget.\n4. The user's instruction implicitly or explicitly indicates readiness to purchase (e.g., \"I need to buy...\", \"I want this one\").\n\n## Core Action\nExecute the `click[buy now]` action to proceed to checkout.\n\n## Verification Logic (Before Clicking)\nBefore clicking \"Buy Now\", you **must** perform these checks:\n1. **Budget Check**: Confirm the final displayed `Price:` is less than the maximum budget specified in the user's original instruction. If no budget is specified, skip this check.\n2. **Option Selection Check**: Ensure the required product options (like 'size', 'color') show a selected state or that your previous action has selected the correct option. The observation should reflect the chosen option.\n3. **Product Match Check**: Verify the product title and description align with the user's core requirements (e.g., \"teeth whitening that also freshens breath\").\n\nIf any check fails, do not use this skill. Instead, revert to selecting the correct option or searching for a different product.\n\n## Example\n\n**Instruction:** \"i need a teeth whitening toothpaste that also freshens breath, and price lower than 15.00 dollars\"\n\n**Observation:** Product page for \"Whitening Toothpaste with Breath Freshener\" — Price: $12.99, Size: 4oz (selected), Flavor: Mint (selected). Available actions: click[buy now], click[back to search].\n\n**Thought:** The user needs a teeth whitening toothpaste that freshens breath, under $15. The current product is priced at $12.99 (< $15.00), matches \"whitening\" and \"breath freshener\" in the title, and all required options (size, flavor) are selected. All checks pass — proceeding to purchase.\n**Action:** `click[buy now]`\n\n## Error Handling\n- If the \"Buy Now\" button is not present in the list of clickable actions, the action will be invalid. Do not force the action.\n- If the price changes after selecting options and exceeds the budget, abort the purchase and inform the user.\n","profile":{"capability":{"text":"Initiate the purchase process by clicking Buy Now after product, option, price, and requirement checks pass.","evidence":[{"line":4},{"line":19},{"line":23}]},"when_to_use":[{"text":"Use this skill when a product is selected, all required options are chosen, the price fits budget, and the user indicates readiness to purchase.","evidence":[{"line":13},{"line":14},{"line":15},{"line":16},{"line":17}]}],"scenarios":[{"name":"Proceed to checkout after all checks pass","before":[{"text":"A product has been selected, required options are chosen, the price is within budget, the product matches requirements, and the user is ready to buy.","evidence":[{"line":14},{"line":15},{"line":16},{"line":17},{"line":23},{"line":24},{"line":25},{"line":26}]}],"after":[{"text":"The user is taken to checkout.","evidence":[{"line":20}]}]},{"name":"Stop purchase when verification fails","before":[{"text":"A required verification fails, the Buy Now action is unavailable, or the price increases beyond budget.","evidence":[{"line":28},{"line":40},{"line":41}]}],"after":[{"text":"The purchase is aborted and the user is informed when checks fail or the price exceeds budget.","evidence":[{"line":28},{"line":41}]}]}],"inputs":[{"text":"A selected product with all required options chosen, a verified final price, and a user expression of readiness to purchase.","evidence":[{"line":14},{"line":15},{"line":16},{"line":17}]}],"outputs":[{"text":"Checkout is initiated by executing click[buy now].","evidence":[{"line":20}]}],"constraints":[{"text":"The final displayed price must be below the user's specified maximum budget when one is provided.","evidence":[{"line":24}]},{"text":"Required options must show a selected state and the product title or description must match the user's core requirements.","evidence":[{"line":25},{"line":26}]},{"text":"If any check fails, if Buy Now is absent, or if price changes beyond budget, the purchase must not proceed.","evidence":[{"line":28},{"line":40},{"line":41}]}],"tools":[{"text":"click[buy now]","evidence":[{"line":20},{"line":40}]}]}},{"skill_id":"webshop-query-interpreter","name":"webshop-query-interpreter","path":"experiments/src/skills/webshop/webshop-query-interpreter/SKILL.md","source":"---\nname: webshop-query-interpreter\ndescription: >-\n Interprets a user's shopping query to extract key product requirements such as item type,\n attributes, and constraints. Use when a new shopping instruction is received and you need\n to parse natural language into structured criteria (product category, desired features,\n price limits) before performing a search. The output is a clear set of search parameters\n for use in subsequent product lookup steps.\n---\n# Instructions\n\n## Trigger\nActivate this skill when a new shopping instruction is received from the user. The instruction will be a natural language request for a product.\n\n## Core Process\n\n1. **Parse the Instruction:** Analyze the user's query to identify the following key components:\n * **Primary Product Type:** The main item being requested (e.g., \"hair extension\").\n * **Key Attributes/Features:** Descriptive requirements (e.g., \"long\", \"clip-in\", \"natural looking\").\n * **Constraints:** Hard limits, especially price (e.g., \"price lower than 40.00 dollars\").\n\n2. **Structure the Output:** Format the extracted information into a clear, structured set of search parameters. Use the following template:\n\n ```\n Product Type: <primary item>\n Attributes: <comma-separated features>\n Constraints: <price limits or other hard requirements>\n Search Query: <recommended search string>\n ```\n\n3. **Hand Off:** Pass the structured parameters to the search execution skill (e.g., `webshop-search-executor` or `webshop-product-search`) to perform the actual query.\n\n## Example\n\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n\n**Thought:** The user wants a hair extension. Key attributes are \"long\", \"clip-in\", and \"natural looking\". The hard constraint is price under $40.00.\n\n**Structured Output:**\n```\nProduct Type: clip-in hair extension\nAttributes: long, natural looking\nConstraints: price < $40.00\nSearch Query: long clip-in natural looking hair extension\n```\n\n---\n\n**Instruction:** \"i want a pack of 6 moisturizing body wash bars with shea butter, price less than 20 dollars\"\n\n**Thought:** The user wants body wash bars. Key attributes are \"moisturizing\", \"shea butter\", quantity \"6 pack\". Hard constraint is price under $20.00.\n\n**Structured Output:**\n```\nProduct Type: body wash bars\nAttributes: moisturizing, shea butter, 6 pack\nConstraints: price < $20.00\nSearch Query: moisturizing body wash bars shea butter 6 pack\n```\n ","profile":{"capability":{"text":"Interprets a shopping query into structured product search criteria including product type, attributes, and hard constraints.","evidence":[{"line":4},{"line":7},{"line":17}]},"when_to_use":[{"text":"Use when a new shopping instruction is received and needs to be parsed into structured criteria before search.","evidence":[{"line":5},{"line":7},{"line":13}]}],"scenarios":[{"name":"Parse a product request with feature and price constraints","before":[{"text":"The user asks for a long clip-in hair extension that is natural looking and costs less than $40.","evidence":[{"line":35},{"line":37}]}],"after":[{"text":"The query is reduced to clip-in hair extension with long and natural-looking attributes, a price cap under $40, and a suggested search string.","evidence":[{"line":41},{"line":42},{"line":43},{"line":44}]}]},{"name":"Parse a quantity-bearing product request with a price limit","before":[{"text":"The user asks for a pack of 6 moisturizing body wash bars with shea butter and a price below $20.","evidence":[{"line":49},{"line":51}]}],"after":[{"text":"The query is reduced to body wash bars with moisturizing, shea butter, and 6-pack attributes, a price cap under $20, and a suggested search string.","evidence":[{"line":55},{"line":56},{"line":57},{"line":58}]}]}],"inputs":[{"text":"A natural-language request for a product.","evidence":[{"line":13},{"line":17}]}],"outputs":[{"text":"A structured set of search parameters containing product type, attributes, constraints, and a recommended search query.","evidence":[{"line":24},{"line":25},{"line":26},{"line":27},{"line":28}]}],"constraints":[{"text":"The input must be a new user shopping instruction expressed as natural language and may include hard limits such as price.","evidence":[{"line":13},{"line":17},{"line":20}]},{"text":"The extracted criteria are formatted for handoff to a downstream search execution skill rather than for direct purchasing.","evidence":[{"line":22},{"line":31}]}],"tools":[{"text":"webshop-search-executor or webshop-product-search.","evidence":[{"line":31}]}]}},{"skill_id":"webshop-query-parser","name":"webshop-query-parser","path":"experiments/src/skills/webshop/webshop-query-parser/SKILL.md","source":"---\nname: webshop-query-parser\ndescription: This skill extracts key constraints and product requirements from a user's shopping query. It should be triggered when the agent receives a new shopping instruction, to identify product attributes (e.g., 'gluten free'), price limits (e.g., 'lower than 140.00 dollars'), and other specifications. The skill outputs a structured set of search criteria to guide subsequent product discovery.\n---\n# Instructions\n\n## When to Use\nActivate this skill immediately when a new shopping instruction is received from the user, before any search or click actions are performed.\n\n## Core Task\nParse the user's natural language instruction to extract structured search criteria. Your goal is to identify:\n1. **Product Type/Name:** The primary item the user wants (e.g., \"popcorn\").\n2. **Key Attributes:** Descriptive features like \"gluten free\", \"organic\", \"vegan\", etc.\n3. **Price Constraints:** Any upper or lower price limits (e.g., \"lower than 140.00 dollars\").\n4. **Other Specifications:** Brand, size, quantity, or other qualifying terms.\n\n## Procedure\n1. **Run the Parser:** Execute the bundled script `parse_query.py` on the user's instruction.\n2. **Review & Refine:** Examine the script's output. If the instruction is complex or ambiguous, use your judgment to refine the criteria. For example, ensure price limits are correctly interpreted as numeric ranges.\n3. **Formulate Search Strategy:** Use the extracted criteria to plan the initial web search. Combine the **Product Type** with the most critical **Key Attributes** to form effective initial search keywords.\n * **Example:** For \"i need gluten free popcorn, and price lower than 140.00 dollars\", the script will output `{'product': 'popcorn', 'attributes': ['gluten free'], 'price_max': 140.0}`. Your initial search should be `search[gluten free popcorn]`.\n\n## Output\nAfter parsing, hold the structured criteria in memory. Use it to:\n* Guide the formulation of `search[keywords]` actions.\n* Evaluate product listings and details during `click` actions to check for constraint compliance (especially price).\n* Inform your reasoning in the `Thought:` part of your response.\n\n## Notes\n* Keep the initial search query concise but precise. Prioritize must-have attributes from the user's instruction.\n* The price filter is often not available as a direct web action; you must manually check prices in the search results and product details.\n* If the initial search yields no results, consider broadening the search by removing less critical attributes one at a time, but always respect hard constraints like \"gluten free\" if specified.\n","profile":{"capability":{"text":"Extract structured shopping search criteria from a user's natural-language query, including product type, key attributes, price limits, and other specifications.","evidence":[{"line":3}]},"when_to_use":[{"text":"Use this skill as soon as a new shopping instruction arrives, before any web interaction.","evidence":[{"line":8}]}],"scenarios":[{"name":"Initial query parsing","before":[{"text":"A new shopping instruction has been received and no search or click actions have yet been performed.","evidence":[{"line":3},{"line":8}]}],"after":[{"text":"The query is converted into structured criteria covering product type, key attributes, price constraints, and other specifications.","evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]}]}],"inputs":[{"text":"A user's shopping instruction in natural language.","evidence":[{"line":3},{"line":11}]}],"outputs":[{"text":"Structured search criteria held in memory to guide subsequent search keyword formation and product evaluation.","evidence":[{"line":3},{"line":24},{"line":25}]}],"constraints":[{"text":"Activate the skill immediately when a new shopping instruction is received, before any search or click actions are performed.","evidence":[{"line":8}]},{"text":"If the instruction is complex or ambiguous, refine the extracted criteria using judgment, especially to interpret price limits as numeric ranges.","evidence":[{"line":19}]},{"text":"Price often must be checked manually in results and details, and less critical attributes may be broadened only if hard constraints remain respected.","evidence":[{"line":31},{"line":32}]}],"tools":[{"text":"Bundled script parse_query.py.","evidence":[{"line":18}]}]}},{"skill_id":"webshop-result-analyzer","name":"webshop-result-analyzer","path":"experiments/src/skills/webshop/webshop-result-analyzer/SKILL.md","source":"---\nname: webshop-result-analyzer\ndescription: This skill evaluates a list of search results against the target product criteria. Trigger it when a search result page is observed, to identify promising product listings. It analyzes each result's title, price, and brief description to shortlist items that best match the required attributes (like size, color, and price), outputting a prioritized list of candidate product IDs or links for further inspection.\n---\n# Instructions\n\nTrigger this skill when you observe a search result page (e.g., containing \"Page 1 (Total results: 50)\" and multiple product listings).\n\n## 1. Extract User Requirements\nFirst, parse the user's instruction from the observation. Identify the following key attributes:\n- **Product Type:** (e.g., \"woman's us size 5 high heel shoe\")\n- **Specific Attributes:** (e.g., \"rubber sole\", \"color patent-beige\")\n- **Price Constraint:** (e.g., \"price lower than 90.00 dollars\")\n\n## 2. Analyze Search Results\nFor each product listing in the observation (typically formatted as `[ASIN/Product ID] [SEP] [Title] [SEP] [Price Range]`):\n1. Extract the **Product ID** (e.g., B09GXNYJCD).\n2. Extract the **Product Title**.\n3. Extract the **Price**. Convert any range (e.g., \"$49.99 to $54.99\") to its maximum value for comparison against the budget.\n4. Perform a **textual match** between the title/description and the required attributes (size, color, material like \"rubber\", product type).\n\n## 3. Score and Prioritize\nUse the bundled Python script `analyze_results.py` to perform a consistent, deterministic analysis.\n1. **Run the script** with the extracted user requirements and the list of product data.\n2. The script will output a **prioritized list** of candidate Product IDs, sorted by a match score.\n\n## 4. Output and Next Action\nPresent the analysis in this format:\n","profile":{"capability":{"text":"Evaluate search result pages against target product criteria by extracting product requirements, matching listings on title/description/price, and producing a prioritized shortlist of candidate product IDs or links for further inspection.","evidence":[{"line":3},{"line":7},{"line":23},{"line":25},{"line":28}]},"when_to_use":[{"text":"When a search result page is observed and the goal is to identify promising product listings that best match the required criteria.","evidence":[{"line":3},{"line":7}]}],"scenarios":[{"name":"Rank product listings from a search results page","before":[{"text":"A search result page is visible and the user's desired product attributes can be parsed from the observation.","evidence":[{"line":7},{"line":10},{"line":16}]}],"after":[{"text":"Each listing is converted into structured fields, scored against the requirements, and ranked into a prioritized candidate list.","evidence":[{"line":17},{"line":18},{"line":19},{"line":20},{"line":25}]}]},{"name":"Filter listings by attributes and budget","before":[{"text":"A listing includes price information and descriptive text that can be compared against the required attributes and budget.","evidence":[{"line":12},{"line":13},{"line":16}]}],"after":[{"text":"Listings with prices within budget and textual matches on attributes such as size, color, material, and product type are identified as promising candidates.","evidence":[{"line":19},{"line":20}]}]}],"inputs":[{"text":"The user's product requirements as expressed in the observation, including product type, specific attributes, and any price constraint.","evidence":[{"line":10},{"line":11},{"line":12},{"line":13}]},{"text":"Search result listings that include a product ID, title, price or price range, and brief descriptive text for textual matching.","evidence":[{"line":16},{"line":17},{"line":18},{"line":19},{"line":20}]}],"outputs":[{"text":"A prioritized list of candidate Product IDs or links, ordered by match score for further inspection.","evidence":[{"line":25},{"line":28}]}],"constraints":[{"text":"Use this skill only when a search result page is observed, such as a page containing multiple product listings and a result count header.","evidence":[{"line":7}]},{"text":"Treat price ranges by using the maximum value for comparison against the budget.","evidence":[{"line":19}]},{"text":"The analysis is intended to be deterministic and consistent by using the bundled Python script analyze_results.py.","evidence":[{"line":23},{"line":25}]}],"tools":[{"text":"Bundled Python script analyze_results.py.","evidence":[{"line":23},{"line":24},{"line":25}]}]}},{"skill_id":"webshop-result-filter","name":"webshop-result-filter","path":"experiments/src/skills/webshop/webshop-result-filter/SKILL.md","source":"---\nname: webshop-result-filter\ndescription: >-\n Filters search results by evaluating product listings against specific user constraints\n like price, features, or ratings. Use when you are on a search results page and need to\n systematically identify which products meet all given criteria before selecting one for\n closer inspection. Takes a list of products with their details and outputs a filtered\n subset that meets the defined requirements.\n---\n# Skill: webshop-result-filter\n\n## When to Use\nActivate this skill when you are on a search results page in a web shopping environment and need to systematically evaluate which products meet a user's specific, multi-faceted requirements (e.g., \"price lower than 40.00 dollars\" AND \"natural looking\").\n\n## Core Instruction\n1. **Parse the Instruction:** Extract the user's constraints from the instruction. Common constraints include:\n * **Price:** A maximum or target price (e.g., `price lower than 40.00 dollars`).\n * **Features:** Specific attributes or keywords (e.g., `natural looking`, `long`, `clip-in`).\n * **Ratings:** A minimum rating threshold (if available in the observation).\n\n2. **Validate Constraints:** Confirm you have at least one constraint extracted before proceeding. If the instruction contains no filterable criteria, skip filtering and select the first available product.\n\n3. **Parse the Observation:** Extract the list of products from the search results page (Product ID, Title, Price, Rating if available).\n\n4. **Apply Filters:** For each product, check it against **all** extracted constraints:\n * **Price Filter:** Is the product price strictly below the user's maximum?\n * **Keyword/Feature Filter:** Does the title/description contain the required feature keywords?\n * **Rating Filter:** If a rating constraint exists, does the product meet the minimum?\n\n5. **Output Decision:** Select the **first product** that passes all criteria as the primary candidate for `click[product_id]`. If no product passes:\n * Try `click[Next >]` to check additional result pages.\n * If no more pages, use `search[refined keywords]` with adjusted terms.\n\n## Example from Trajectory\n* **User Instruction:** `i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars`\n* **Extracted Constraints:**\n * `price < 40.00`\n * Keywords: `natural` (implied from \"natural looking\")\n* **Observation (First Page):** Contains ~10 products with IDs, titles, and prices.\n* **Filtering Process:**\n 1. `B09C337K8S`: Price $29.99 (< $40.00). Title contains \"Natural Looking\". **PASSES**.\n 2. `B093BKWHFK`: Price $63.99 (> $40.00). **FAILS** on price.\n 3. `B099K9Z9L2`: Price $43.99 (> $40.00). **FAILS** on price.\n* **Result:** `B09C337K8S` is selected as the top matching candidate.\n\n## Next Action\nAfter identifying a matching product, click on it for more details:\n\n**Thought:** [Summarize which constraints each product passed or failed, justify your selection.]\n**Action:** `click[<matching_product_id>]`\n","profile":{"capability":{"text":"Filter webshop search results by checking product listings against user constraints and returning the subset that meets all requirements.","evidence":[{"line":4},{"line":7},{"line":8}]},"when_to_use":[{"text":"Use on a web shopping search results page when products must be evaluated against specific multi-constraint requirements.","evidence":[{"line":13}]}],"scenarios":[{"name":"Filter and select the best matching product","before":[{"text":"You are on a search results page with a product list and a user request that includes multi-faceted requirements.","evidence":[{"line":13},{"line":23}]}],"after":[{"text":"The first product satisfying all extracted constraints is chosen for closer inspection.","evidence":[{"line":30}]}]},{"name":"Handle no match on the current page","before":[{"text":"No product on the current page satisfies all constraints.","evidence":[{"line":30},{"line":31},{"line":32}]}],"after":[{"text":"The workflow moves to additional result pages or refined search terms when no listed product matches.","evidence":[{"line":31},{"line":32}]}]}],"inputs":[{"text":"A search results page listing products with details such as Product ID, title, price, and rating if available.","evidence":[{"line":7},{"line":23}]},{"text":"A user instruction containing constraints such as price limits, feature keywords, or rating thresholds.","evidence":[{"line":16},{"line":18},{"line":19}]}],"outputs":[{"text":"A filtered subset of products that meet the defined requirements.","evidence":[{"line":7},{"line":8}]},{"text":"The first product that passes all criteria is identified as the primary candidate for click[product_id].","evidence":[{"line":30}]}],"constraints":[{"text":"If the instruction contains no filterable criteria, skip filtering and select the first available product.","evidence":[{"line":21}]},{"text":"A product must satisfy all extracted constraints to be selected as the primary candidate.","evidence":[{"line":25},{"line":30}]}],"tools":[{"text":"click[product_id], click[Next >], and search[refined keywords] actions.","evidence":[{"line":30},{"line":31},{"line":32},{"line":50}]}]}},{"skill_id":"webshop-result-page-navigator","name":"webshop-result-page-navigator","path":"experiments/src/skills/webshop/webshop-result-page-navigator/SKILL.md","source":"---\nname: webshop-result-page-navigator\ndescription: Navigates through paginated search results by moving to the next or previous page. Use this skill when the current page of product listings does not contain a suitable match and you need to review more options. It identifies and clicks the appropriate pagination controls (e.g., 'next >' or '< prev') to load additional result pages for evaluation.\n---\n# Skill: WebShop Result Page Navigator\n\n## Purpose\nThis skill enables systematic navigation through paginated product search results in a WebShop environment. It is triggered when the current page of results does not contain an item matching the user's criteria, allowing the agent to access more options.\n\n## Core Logic\n1. **Trigger Condition:** The agent has reviewed the current page of product listings and determined that no item satisfies the user's requirements (e.g., price, features).\n2. **Action Selection:** The skill identifies the correct pagination control to click:\n * `click[next >]` to load the subsequent page of results.\n * `click[< prev]` to return to the previous page of results.\n3. **Post-Action:** After navigation, the agent should resume its primary task of evaluating the newly loaded product listings against the user's instruction.\n\n## Usage in Trajectory\nThe skill was demonstrated when the agent, searching for a pendant light under $120 with a dimmer switch, found no suitable options on Page 1. It correctly executed `click[next >]` to access Page 2, and repeated the action to access Page 3, where a potential match was found.\n\n## Key Principle\nThis skill handles the deterministic, repetitive task of page navigation, freeing the agent's reasoning capacity for the higher-freedom task of evaluating product features and making purchase decisions.\n","profile":{"capability":{"text":"Navigate paginated WebShop product search results by selecting next or previous page controls when the current page lacks a suitable match.","evidence":[{"line":3},{"line":8},{"line":21}]},"when_to_use":[{"text":"Use this skill when the current product results page does not contain a suitable match and more options need to be reviewed.","evidence":[{"line":3},{"line":8},{"line":11}]}],"scenarios":[{"name":"Advance to the next results page","before":[{"text":"The current page has been reviewed and no item meets the user's requirements, and a next-page control is available.","evidence":[{"line":11},{"line":13}]}],"after":[{"text":"The next page of results is loaded and the agent continues evaluating product listings.","evidence":[{"line":13},{"line":15}]}]},{"name":"Return to the previous results page","before":[{"text":"The current page has been reviewed and the previous-page control is available.","evidence":[{"line":12},{"line":14}]}],"after":[{"text":"The previous page of results is loaded and the agent continues evaluating product listings.","evidence":[{"line":14},{"line":15}]}]}],"inputs":[{"text":"A reviewed current page of product listings that does not satisfy the user's requirements.","evidence":[{"line":11},{"line":8}]},{"text":"Pagination controls for moving to the subsequent or previous results page.","evidence":[{"line":12},{"line":13},{"line":14}]}],"outputs":[{"text":"A newly loaded result page that can be evaluated for additional product options.","evidence":[{"line":15},{"line":18}]}],"constraints":[{"text":"The skill is limited to choosing the appropriate pagination control such as next or previous.","evidence":[{"line":12},{"line":13},{"line":14}]},{"text":"After navigation, the agent should resume evaluating the newly loaded product listings against the user's instruction.","evidence":[{"line":15}]}],"tools":[{"text":"Pagination click actions such as click[next >] and click[< prev].","evidence":[{"line":13},{"line":14},{"line":18}]}]}},{"skill_id":"webshop-search-constructor","name":"webshop-search-constructor","path":"experiments/src/skills/webshop/webshop-search-constructor/SKILL.md","source":"---\nname: webshop-search-constructor\ndescription: This skill formulates an effective search query from structured product criteria. It is used when initiating a product search on an e-commerce platform, converting attributes into a concise, relevant keyword string. The input is a set of parsed criteria (e.g., 'jewelry box', '10 slots', 'easy to clean', 'price < $60'), and the output is a formatted search action string (e.g., 'search[jewelry box, 10 slots, less than $60, easy to clean]') optimized for the platform's search engine.\n---\n# Instructions\nWhen tasked with finding a product on an e-commerce platform, use this skill to construct the initial search query.\n\n## Core Process\n1. **Receive Criteria:** You will be given a set of structured product criteria (e.g., product type, attributes, price limit).\n2. **Construct Query:** Use the `construct_search_query.py` script to transform the criteria into a single, optimized search string. The script handles formatting and keyword ordering.\n3. **Execute Action:** Format the script's output into the required platform action: `search[<constructed_query>]`.\n\n## Workflow Example\n**Input Criteria:** `{'product': 'jewelry box', 'attributes': ['10 slots', 'easy to clean'], 'price_limit': 60.00}`\n**Skill Execution:**\n1. Run the script: `python scripts/construct_search_query.py --product \"jewelry box\" --attributes \"10 slots\" \"easy to clean\" --price-limit 60.00`\n2. The script returns: `jewelry box, 10 slots, less than $60, easy to clean`\n3. You output the final action: `search[jewelry box, 10 slots, less than $60, easy to clean]`\n\n## Important Notes\n* **Use the Script:** Always delegate query construction to the bundled script. Do not attempt to manually format the search string.\n* **Input Format:** Ensure criteria are passed to the script as discrete arguments (product, list of attributes, price limit). Parse the user's instruction into this structure before calling the script.\n* **Output Format:** The final action must strictly follow the `search[<query>]` syntax.\n","profile":{"capability":{"text":"Formulates an optimized initial e-commerce search action from structured product criteria by converting attributes into a concise keyword query.","evidence":[{"line":3}]},"when_to_use":[{"text":"Use when tasked with finding a product on an e-commerce platform and constructing the initial search query.","evidence":[{"line":6}]}],"scenarios":[{"name":"Initial product search query construction","before":[{"text":"A task to find a product on an e-commerce platform with parsed structured criteria.","evidence":[{"line":6},{"line":9}]}],"after":[{"text":"A platform-ready search action is produced using the constructed query string.","evidence":[{"line":11},{"line":18}]}]}],"inputs":[{"text":"Structured product criteria such as product type, attributes, and price limit passed as discrete arguments.","evidence":[{"line":9},{"line":22}]}],"outputs":[{"text":"A formatted search action string of the form `search[<constructed_query>]`.","evidence":[{"line":3},{"line":11},{"line":18}]}],"constraints":[{"text":"Query construction must be delegated to the bundled script and not manually formatted.","evidence":[{"line":21}]},{"text":"The final action must strictly follow the `search[<query>]` syntax.","evidence":[{"line":23}]},{"text":"Criteria must be parsed into discrete arguments before calling the script.","evidence":[{"line":22}]}],"tools":[{"text":"The bundled `construct_search_query.py` script.","evidence":[{"line":10},{"line":16},{"line":21}]}]}},{"skill_id":"webshop-search-executor","name":"webshop-search-executor","path":"experiments/src/skills/webshop/webshop-search-executor/SKILL.md","source":"---\nname: webshop-search-executor\ndescription: >-\n Executes a search on an e-commerce platform using parsed keywords. Use when you have\n extracted search terms from a user query and need to perform the actual search[] action\n on the WebShop interface. Takes structured search terms and performs a search action,\n returning a list of product results for evaluation.\n---\n# Instructions\n\n## 1. Trigger Condition\nActivate when the user provides an instruction to find or buy a product with specific attributes. The instruction will be in the `Observation`.\n\n## Edge Cases\n* If the search returns 0 results, retry with a broader query (e.g., drop the least critical attribute).\n* If all results exceed the user's price constraint, try adding price-related terms or narrowing the product category.\n\n## 2. Action Protocol\nYou must respond using **only** the following two action formats. Your final response must be in the exact structure:\n\n**Thought:** [Your reasoning about the search terms to use based on the user's requirements.]\n**Action:** `search[<keywords>]`\n\nOr, if selecting a product from results:\n\n**Thought:** [Your reasoning about which product best matches.]\n**Action:** `click[<product_id>]`\n\n## 3. Example\n\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n\n**Observation:** WebShop search page is displayed with a search bar.\n\n**Thought:** The user needs a clip-in hair extension that is long and natural looking, under $40. I will search for the core product type with key attributes to get relevant results.\n**Action:** `search[long natural looking clip-in hair extension]`\n\n---\n\n**Instruction:** \"i want a pack of organic green tea bags, price lower than 10.00 dollars\"\n\n**Observation:** WebShop search page is displayed with a search bar.\n\n**Thought:** The user wants organic green tea bags under $10. I will search with the key product terms.\n**Action:** `search[organic green tea bags]`\n","profile":{"capability":{"text":"Execute an e-commerce search on WebShop from parsed user keywords when the user wants to find or buy a product with specific attributes.","evidence":[{"line":4},{"line":6},{"line":12}]},"when_to_use":[{"text":"Use when a user asks to find or buy a product with specific attributes in the Observation.","evidence":[{"line":4},{"line":12}]}],"scenarios":[{"name":"Search for a specified product","before":[{"text":"The user has requested a product search with specific attributes and the WebShop search page is displayed.","evidence":[{"line":5},{"line":12},{"line":33}]}],"after":[{"text":"A WebShop search is performed and a list of product results is returned for evaluation.","evidence":[{"line":6},{"line":7},{"line":36}]}]}],"inputs":[{"text":"Structured search terms or a user instruction in the Observation that specifies desired product attributes.","evidence":[{"line":4},{"line":5},{"line":6},{"line":12}]},{"text":"A WebShop search page with a search bar is the expected interface state for issuing the search.","evidence":[{"line":33},{"line":42}]}],"outputs":[{"text":"A search action or product-selection click is produced, yielding product results for evaluation or selecting a specific product.","evidence":[{"line":7},{"line":22},{"line":27}]}],"constraints":[{"text":"Responses must use only the exact action formats `search[<keywords>]` or `click[<product_id>]` with the required Thought/Action structure.","evidence":[{"line":19},{"line":21},{"line":22}]},{"text":"If search results are empty or violate price constraints, broaden the query or adjust it with price-related or category-narrowing terms.","evidence":[{"line":15},{"line":16}]}],"tools":[{"text":"WebShop interface search action and result-item click action.","evidence":[{"line":6},{"line":22},{"line":27}]}]}},{"skill_id":"webshop-search-formulator","name":"webshop-search-formulator","path":"experiments/src/skills/webshop/webshop-search-formulator/SKILL.md","source":"---\nname: webshop-search-formulator\ndescription: This skill generates effective search keywords based on parsed product criteria. It is triggered after query parsing, when the agent needs to perform an initial product search on an e-commerce platform. The skill takes structured attributes (e.g., 'women's size 5 patent-beige high heel') and produces a concise, platform-appropriate search string designed to return relevant results, balancing specificity with recall.\n---\n# Skill: Webshop Search Formulator\n\n## Purpose\nYou are an expert at formulating the initial search query for an e-commerce product search. Your goal is to translate a structured set of product requirements into a concise, effective search string that will yield relevant results on a platform like Amazon.\n\n## Core Workflow\n1. **Input:** You receive a parsed query containing key product attributes (e.g., category, type, size, color, material, price limit).\n2. **Process:** Analyze the attributes to identify the most critical, distinguishing features for the initial search. Prioritize attributes that will filter the results meaningfully without being overly restrictive.\n3. **Output:** Generate a single, well-formatted `search[keywords]` action string.\n\n## Key Principles for Search Formulation\n* **Balance Specificity & Recall:** Start with a moderately specific query. Including 2-3 core attributes (e.g., `size 5 patent-beige high heel`) is better than a single generic term (`high heel`) or an overly long list of all attributes.\n* **Prioritize Distinctive Attributes:** Favor attributes that uniquely identify the product variant (e.g., \"patent-beige\", \"size 5\") over very common ones (e.g., \"women's\") in the initial search.\n* **Use Natural Keyword Order:** Place the most important or specific terms first. Mimic how a user might type the query.\n* **Exclude Non-Searchable Filters:** Do not include filters typically applied *after* the search (e.g., price ranges like `< $90`) in the initial keyword string. These are for later refinement.\n* **Standardize Formatting:** Use lowercase, avoid special characters, and separate keywords with spaces.\n\n## Example from Trajectory\n**Parsed Instruction:** `woman's us size 5 high heel shoe with a rubber sole and color patent-beige, and price lower than 90.00 dollars`\n**Effective Search:** `search[size 5 patent-beige high heel]`\n**Rationale:** \"size 5\" and \"patent-beige\" are the most specific, distinguishing attributes. \"high heel\" defines the product type. \"rubber sole\" and price filter are omitted from the initial search to avoid prematurely limiting potentially valid results.\n\n## Action Format\nYour final output must be a single action in the exact format:\n","profile":{"capability":{"text":"Formulate a concise initial e-commerce product search string from parsed product criteria, selecting the most distinguishing attributes and returning a single `search[keywords]` action string.","evidence":[{"line":3},{"line":8},{"line":11},{"line":13}]},"when_to_use":[{"text":"Use after query parsing when an agent needs to perform the first product search on an e-commerce platform.","evidence":[{"line":3},{"line":8},{"line":11}]}],"scenarios":[{"name":"Initial product search formulation","before":[{"text":"A parsed product request includes variant details and a price constraint.","evidence":[{"line":23}]}],"after":[{"text":"A single search query emphasizes the most specific product-defining attributes and is ready for initial platform search.","evidence":[{"line":24},{"line":25}]}]}],"inputs":[{"text":"A parsed query containing structured product attributes such as category, type, size, color, material, and price limit.","evidence":[{"line":3},{"line":11}]}],"outputs":[{"text":"One well-formatted `search[keywords]` action string suitable for an initial product search.","evidence":[{"line":13},{"line":24}]}],"constraints":[{"text":"Use a moderately specific, natural, lowercase space-separated keyword string with 2-3 core attributes, and exclude post-search filters such as price ranges.","evidence":[{"line":16},{"line":17},{"line":19},{"line":20}]}],"tools":[]}},{"skill_id":"webshop-variant-chooser","name":"webshop-variant-chooser","path":"experiments/src/skills/webshop/webshop-variant-chooser/SKILL.md","source":"---\nname: webshop-variant-chooser\ndescription: This skill selects a product variant (e.g., size, quantity) from available options on a product detail page. It is triggered when a product page displays multiple choices, assessing the options (like '1.1 pound (pack of 1)' or 'pack of 2') and selecting one that aligns with user needs, often defaulting to a standard single unit if unspecified.\n---\n# Instructions\n\n## When to Use\nUse this skill when you are on a product detail page and the observation contains a list of variant options (e.g., under a \"size\" or \"quantity\" heading). The skill is triggered by the presence of multiple clickable options that represent different configurations of the same product.\n\n## Core Decision Logic\n1. **Parse the Observation:** Identify the list of available variant options from the observation text. These are typically presented as clickable values after a label like \"size\".\n2. **Assess User Needs:** Review the original user instruction for any explicit or implicit preferences regarding variant (e.g., budget constraints, desired quantity). If no preference is stated, default logic applies.\n3. **Select and Act:** Choose the most appropriate variant and execute a `click[value]` action.\n * **If user instruction specifies a constraint (e.g., \"price lower than 40.00 dollars\"):** Ensure the selected variant's price (if displayed) complies.\n * **If no user preference is stated:** Prefer the standard, single-unit option (e.g., \"1.1 pound (pack of 1)\" over \"pack of 2\") as a sensible default.\n * **If the choice is ambiguous:** You may need to click on a variant to see its updated price/details before finalizing the selection, as shown in the trajectory.\n\n## Action Format\nYour response must strictly follow this format:\n","profile":{"capability":{"text":"Select an appropriate product variant from a product detail page with multiple options, using user preferences or defaulting to a standard single unit, and execute the required click action.","evidence":[{"line":3},{"line":8},{"line":13}]},"when_to_use":[{"text":"Use this skill on a product detail page when the observation shows multiple clickable options representing different configurations of the same product.","evidence":[{"line":8}]}],"scenarios":[{"name":"Select a product variant from available options","before":[{"text":"The user is on a product detail page and the observation contains multiple clickable variant options for the same product.","evidence":[{"line":8}]},{"text":"The available variant options are present in the observation text and can be parsed.","evidence":[{"line":11}]}],"after":[{"text":"The chosen product variant is selected by executing a click[value] action.","evidence":[{"line":13}]},{"text":"If no preference is stated, the standard single-unit option is selected by default.","evidence":[{"line":15}]}]},{"name":"Choose a variant that satisfies a user constraint","before":[{"text":"The user instruction contains an explicit or implicit preference or constraint affecting variant choice.","evidence":[{"line":12}]},{"text":"The variant’s price is displayed when price is needed for compliance checking.","evidence":[{"line":14}]}],"after":[{"text":"The selected variant complies with the stated constraint when the user specifies a condition such as a maximum price.","evidence":[{"line":14}]},{"text":"A variant is chosen and acted on with click[value].","evidence":[{"line":13}]}]},{"name":"Resolve ambiguous variant choice by inspecting a variant","before":[{"text":"The choice among variants is ambiguous from the current observation.","evidence":[{"line":16}]}],"after":[{"text":"A variant can be clicked to reveal updated price or details before the final selection is made.","evidence":[{"line":16}]}]}],"inputs":[{"text":"Observation text listing available variant options.","evidence":[{"line":11}]},{"text":"Original user instruction for preferences or constraints.","evidence":[{"line":12}]},{"text":"Displayed variant price or details when compliance or ambiguity checking is needed.","evidence":[{"line":14}]}],"outputs":[{"text":"A product variant is selected on the product detail page.","evidence":[{"line":13}]}],"constraints":[{"text":"The response must strictly follow the specified action format.","evidence":[{"line":19}]}],"tools":[{"text":"click[value] action","evidence":[{"line":13}]}]}}],"relations":[{"source":"webshop-action-executor","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Chosen WebShop action is formatted for the verifier's page workflow","explanation":"The action executor produces the formatted command for one chosen WebShop action, and the attribute verifier consumes such a click action in its workflow when it selects the matching option before Buy Now or returns Back to Search after a failed check. In that scenario, the executor's output can serve as the next command the verifier expects to issue on the page.","conditions":["A decision about the exact interface action has already been made on the current WebShop page."],"source_evidence":[{"line":3},{"line":8},{"line":13},{"line":17}],"target_evidence":[{"line":9},{"line":32},{"line":33},{"line":37},{"line":45}]}]},{"source":"webshop-attribute-verifier","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Verification completes, then the chosen WebShop action is issued","explanation":"The attribute verifier can finish by selecting the matching option and proceeding toward purchase; the action executor can then format that specific selected action into the exact WebShop command structure. The verifier establishes the required target action from the page, and the executor turns that chosen action into the environment command next.","conditions":["A product page has already been verified as matching the user's requirements and the needed option/action is available."],"source_evidence":[{"line":32},{"line":44},{"line":45}],"target_evidence":[{"line":3},{"line":8},{"line":12},{"line":16},{"line":17}]}]},{"source":"webshop-initial-search","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"WebShop search command formatting after query formulation","explanation":"The initial-search skill can produce the concise query and execute the platform search action; the action-executor skill can then format a single chosen WebShop action into the required command structure. In the discovery flow, the search stage supplies the action command form that the executor can emit next, and the executor is designed to run after a decision is made.","conditions":["An exact WebShop action identifier is already chosen from the current page."],"source_evidence":[{"line":12},{"line":16},{"line":17}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":12},{"line":13},{"line":16},{"line":17}]}]},{"source":"webshop-option-selector","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Option choice followed by command formatting","explanation":"webshop-option-selector performs the choice of an option value and leaves the page ready for follow-up actions, while webshop-action-executor takes a single target action string and turns it into the exact WebShop command syntax next. In this scenario, the selector can supply the chosen value identifier and the executor formats it into `click[value]`.","conditions":["The current page is a WebShop product detail page with configurable option values shown.","A specific option value has already been chosen from available values and needs to be issued as a command."],"source_evidence":[{"line":15},{"line":21}],"target_evidence":[{"line":3},{"line":12},{"line":17}]}]},{"source":"webshop-action-executor","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Formatting a chosen click action for the product page","explanation":"The action executor takes a single target action identifier and converts it into the exact WebShop command format, which can be used immediately by the product detail navigator when it is ready to click a known option or final button on the page.","conditions":["The agent has already chosen a specific WebShop interface action on the product page."],"source_evidence":[{"line":3},{"line":8},{"line":17}],"target_evidence":[{"line":18},{"line":30},{"line":37}]},{"scenario":"Executing a validated product-page option selection","explanation":"After the navigator has loaded and inspected the product page, it must click exact values from the clickables list and can proceed to final purchase; the executor produces the required `click[...]` command from that chosen identifier.","conditions":["The next step is to select an exact clickable option or final action that appears in the current product-page observation."],"source_evidence":[{"line":11},{"line":12},{"line":16},{"line":17}],"target_evidence":[{"line":19},{"line":25},{"line":26},{"line":30},{"line":37},{"line":38}]}]},{"source":"webshop-purchase-executor","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Purchase selection followed by action formatting","explanation":"webshop-purchase-executor can produce the exact clickable purchase-button action after product verification, and webshop-action-executor can then format that chosen action identifier into the required WebShop command structure. In a purchase workflow, the purchase skill supplies the specific purchase-button value next, and the action skill turns it into the exact command form accepted by the environment.","conditions":["The current task is an e-commerce purchase on a product detail page and the purchase button label is available."],"source_evidence":[{"line":17},{"line":25}],"target_evidence":[{"line":3},{"line":12},{"line":17}]}]},{"source":"webshop-action-executor","target":"webshop-purchase-executor","type":"similar_to","contexts":[{"scenario":"WebShop purchase-action capability overlap","explanation":"Both skills operate in the same WebShop shopping workflow and both ultimately deal with executing the purchase click using the available button value. The purchase executor is the terminal purchase step, while the action executor formats a single chosen interface action into the exact WebShop command syntax, making them comparable as adjacent purchase-action capabilities within the same environment.","conditions":["The task is a verified WebShop purchase flow that ends in a clicked purchase button."],"source_evidence":[{"line":8},{"line":13},{"line":17}],"target_evidence":[{"line":8},{"line":17},{"line":25}]}]},{"source":"webshop-query-parser","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Initial search preparation in WebShop","explanation":"The query parser produces structured criteria held in memory to guide subsequent `search[keywords]` actions, so it can feed the next stage where the action executor formats the chosen search action into the WebShop command syntax.","conditions":["The agent has already parsed a shopping query into structured criteria and is now choosing the first search action."],"source_evidence":[{"line":24},{"line":25}],"target_evidence":[{"line":8},{"line":13},{"line":17}]},{"scenario":"Formatting a selected WebShop action after query parsing","explanation":"The action executor takes a single target action string and immediately outputs the exact WebShop command format, which can consume a selected action produced after parsing the user's shopping instruction and deciding what to do next.","conditions":["The agent has finished analysis and has a clear target action identifier from the current page."],"source_evidence":[{"line":3},{"line":16},{"line":17}],"target_evidence":[{"line":11},{"line":12},{"line":13}]}]},{"source":"webshop-action-executor","target":"webshop-search-constructor","type":"compose_with","contexts":[{"scenario":"Formatted WebShop command reuse across search and action execution","explanation":"The action-executor runs first because it accepts a single target action string and formats it into the exact WebShop command syntax; the search-constructor can also consume a similarly shaped finalized `search[<query>]` action when the task is to initiate a product search, producing the platform-ready search action string next.","conditions":["The agent has already decided which specific page action to take and has a target action identifier from the current WebShop page."],"source_evidence":[{"line":3},{"line":8},{"line":11},{"line":12},{"line":13},{"line":16},{"line":17}],"target_evidence":[{"line":6},{"line":9},{"line":10},{"line":11},{"line":18},{"line":21},{"line":23}]}]},{"source":"webshop-search-constructor","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Initial search query creation followed by WebShop action execution","explanation":"The search-constructor runs first because it takes structured criteria, uses the bundled script to build a query, and outputs a platform-ready `search[<query>]` action; the action-executor can then consume that finalized WebShop action format and emit the exact command structure required by the environment.","conditions":["The agent has already decided to start a product search and has parsed structured product criteria."],"source_evidence":[{"line":6},{"line":9},{"line":10},{"line":11},{"line":21},{"line":22},{"line":23}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":16},{"line":17}]}]},{"source":"webshop-action-executor","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"Formatting a chosen search action before the WebShop search executor runs","explanation":"The action executor produces the formatted command string that a downstream WebShop search step can use when the chosen action is a search request. The action skill explicitly takes a single target action string and outputs a correctly formatted `click[value]` or `search[keywords]` command, while the search skill requires `search[<keywords>]` as its only search action format and operates on a WebShop search page with a search bar.","conditions":["The agent has already analyzed the page and decided the exact next interface action.","The next operation is to issue a WebShop command in the required syntax."],"source_evidence":[{"line":3},{"line":12},{"line":17}],"target_evidence":[{"line":12},{"line":19},{"line":22},{"line":33}]}]},{"source":"webshop-action-executor","target":"webshop-search-executor","type":"similar_to","contexts":[{"scenario":"WebShop action-formatting skills for shopping interaction","explanation":"Both skills operate on the same WebShop action vocabulary and can be used for the same shopping workflow, but they cover different stages: the action executor formats a single interface action, and the search executor performs a search or product-selection click using the exact WebShop response structure. They are comparable as WebShop action-producing executors, though the search skill is specialized for search-page interactions and result evaluation.","conditions":["The task is specifically to select or search for a product on WebShop.","The target action is one of the valid WebShop interface actions, including search or click."],"source_evidence":[{"line":3},{"line":8},{"line":13}],"target_evidence":[{"line":6},{"line":19},{"line":22},{"line":27}]}]},{"source":"webshop-action-executor","target":"webshop-search-formulator","type":"compose_with","contexts":[{"scenario":"Search-string output is reused as the concrete action identifier for execution","explanation":"The action executor provides a correctly formatted `click[value]` or `search[keywords]` command from a single target action identifier, while the search formulator specifically produces a single `search[keywords]` string as its output. For the narrow case where the chosen action is a search query, the executor can consume the formulator's output next to emit the final WebShop command.","conditions":["The agent has already decided on a concrete interface action from the current page and needs it expressed as a valid WebShop command."],"source_evidence":[{"line":12},{"line":13},{"line":17}],"target_evidence":[{"line":11},{"line":13},{"line":16},{"line":20}]}]},{"source":"webshop-search-formulator","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Initial search query is chosen as the concrete WebShop action","explanation":"The search formulator can produce the initial `search[keywords]` action string from parsed product criteria, and the action executor can then take a single target action string and format it into the required WebShop command. In a trajectory where the chosen action is the initial search query, the formulator runs first to create that action string, and the executor can use that string next to output the environment-ready command.","conditions":["An e-commerce agent has already selected a specific WebShop interface action and needs it emitted in the environment's exact command syntax."],"source_evidence":[{"line":11},{"line":13},{"line":18}],"target_evidence":[{"line":12},{"line":16},{"line":17}]}]},{"source":"webshop-action-executor","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"Choosing a specific option before command formatting","explanation":"Action executor receives a single target_action string and immediately outputs the exact WebShop command. Variant chooser does the preceding selection work on a product detail page by identifying options and executing click[value], which can produce the chosen identifier that the executor formats next.","conditions":["The agent has already determined the exact interface action on a WebShop page, including a chosen option or button label."],"source_evidence":[{"line":3},{"line":8},{"line":13}],"target_evidence":[{"line":8},{"line":12},{"line":13}]}]},{"source":"webshop-variant-chooser","target":"webshop-action-executor","type":"compose_with","contexts":[{"scenario":"Selecting a variant and then formatting the chosen action for execution","explanation":"Variant chooser first parses available options and selects a product variant with click[value]; action executor then takes a decided target action string and formats it into the required WebShop command. So the chooser can supply the chosen action identifier/state that the executor consumes next to emit the final command format.","conditions":["A product detail page shows multiple variant options and the agent must choose one before acting."],"source_evidence":[{"line":8},{"line":11},{"line":13}],"target_evidence":[{"line":3},{"line":11},{"line":12},{"line":17}]}]},{"source":"webshop-attribute-selector","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Selecting a required product option before purchase on a product detail page","explanation":"The verifier first parses requirements, checks the page's options and constraints, and if everything matches it clicks the required option before Buy Now. The selector produces exactly that clicked matching option from the page's clickable texts, so the selector can feed the verifier's option-selection step in the same purchase workflow.","conditions":["The current page is a product detail page with clickable options.","The user has specified required attribute values.","The matching option must be clicked before any purchase step."],"source_evidence":[{"line":8},{"line":10},{"line":11},{"line":15},{"line":18},{"line":19}],"target_evidence":[{"line":15},{"line":19},{"line":27},{"line":32},{"line":44}]},{"scenario":"Using a verified match to proceed into attribute selection and purchase","explanation":"The verifier establishes that the product satisfies the user's requirements and that the matching option should be selected first, after which purchase may proceed. The selector then maps the required value to the exact clickable text and performs the click, making it a downstream next step after verification in the same task path.","conditions":["The product has already been verified as matching the user's requirements.","A required attribute option is available as a clickable value.","The next step is selecting that matching option, then potentially Buy Now."],"source_evidence":[{"line":15},{"line":18},{"line":19}],"target_evidence":[{"line":15},{"line":30},{"line":32},{"line":44}]}]},{"source":"webshop-attribute-selector","target":"webshop-option-selector","type":"compose_with","contexts":[{"scenario":"Both skills are used on a product detail page to click a chosen configurable option, and the same page state can be passed from one to the other when no further attribute-specific matching is needed.","explanation":"webshop-attribute-selector can produce the clicked option-selection state that webshop-option-selector consumes next on the same kind of product page; both skills operate by clicking option values on configurable product pages, so the selected option and resulting page state from the attribute selector can directly support the option selector's next click-based action.","conditions":["The page is a WebShop product detail page with clickable option values.","The next step only needs a selected option click, not a different page type or transformation."],"source_evidence":[{"line":9},{"line":10},{"line":18}],"target_evidence":[{"line":8},{"line":10},{"line":15}]}]},{"source":"webshop-attribute-selector","target":"webshop-option-selector","type":"similar_to","contexts":[{"scenario":"Both skills select clickable product options on a configurable WebShop product detail page, using the currently displayed choices and user constraints/preferences.","explanation":"The two skills are similar because each explicitly performs option selection on a product detail page by examining available clickable values and clicking the chosen value. The main difference is that webshop-attribute-selector is specialized to matching named attribute values exactly or fuzzily, while webshop-option-selector also supports cost minimization and tie-breaking.","conditions":["The observation is a product detail page with configurable options.","Selection is based on visible clickable values and user requirements/preferences."],"source_evidence":[{"line":3},{"line":8},{"line":14},{"line":15},{"line":16},{"line":18}],"target_evidence":[{"line":3},{"line":8},{"line":13},{"line":15}]}]},{"source":"webshop-attribute-selector","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Continuing option selection on an already configured product page","explanation":"The attribute selector outputs selected product attributes as click actions and may leave the page refreshed with selected options highlighted; the product-detail navigator explicitly consumes a selected product ID plus the product-page observation, then loads the detail page, parses the clickables, and performs the same style of option-clicking workflow. In a workflow where configuration is already underway, the navigator's post-search navigation and page parsing can directly continue from the selector's configured-product state on the same product page.","conditions":["A candidate product has been identified from search results","The next step is to open the product detail page and inspect/configure options"],"source_evidence":[{"line":18},{"line":19},{"line":24}],"target_evidence":[{"line":3},{"line":11},{"line":19},{"line":20},{"line":25},{"line":34},{"line":38}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-attribute-selector","type":"compose_with","contexts":[{"scenario":"Configuring a product page after navigation","explanation":"The product-detail navigator first loads and parses the product page, then cross-references the user's requirements with available clickables and clicks matching options; that is the immediate state needed for the attribute selector's next operation of choosing exact clickable values on a product page. After the selector clicks the required attributes, the navigator can continue with finalization/purchase on the same configured product page.","conditions":["A product detail page is already open","The user has specified required attribute values","The navigator is at the stage of selecting clickable options and may then finalize purchase"],"source_evidence":[{"line":19},{"line":20},{"line":25},{"line":26},{"line":30},{"line":37},{"line":38}],"target_evidence":[{"line":3},{"line":8},{"line":10},{"line":11},{"line":15},{"line":18},{"line":19},{"line":24}]}]},{"source":"webshop-product-evaluator","target":"webshop-attribute-selector","type":"compose_with","contexts":[{"scenario":"Search-results selection feeds detail-page attribute selection","explanation":"The product evaluator ends by clicking a suitable product ID to view its details, which creates the product detail page that the attribute selector requires as its starting state. The selector is only activated on a product detail page with configurable options and then clicks matching attribute values.","conditions":["A product has been chosen from search results and the next step is opening its detail page."],"source_evidence":[{"line":25}],"target_evidence":[{"line":8},{"line":9},{"line":10},{"line":11},{"line":18}]},{"scenario":"Candidate product chosen upstream of attribute configuration","explanation":"After the evaluator clicks a product ID, the attribute selector can use the newly opened product detail page to parse required values, map them to available clickables, and perform the option clicks. This is a concrete adjacent handoff from choosing a candidate product to configuring that product.","conditions":["The selected listing opens a detail page that exposes configurable options like flavor or size, and the user still needs specific attribute values applied."],"source_evidence":[{"line":25},{"line":32}],"target_evidence":[{"line":14},{"line":15},{"line":16},{"line":18},{"line":24}]}]},{"source":"webshop-attribute-selector","target":"webshop-product-evaluator","type":"similar_to","contexts":[{"scenario":"Both choose shopping options but at different granularity","explanation":"Both skills support selecting a product for the user: the evaluator ranks and chooses the best product listing from search results, while the attribute selector matches user-specified values to clickable product options on a detail page. They share the broader shopping-selection task, but one operates on listings and the other on configurable attributes.","conditions":["Both skills are used in web shopping, but at different page stages."],"source_evidence":[{"line":3},{"line":8},{"line":15},{"line":18}],"target_evidence":[{"line":4},{"line":7},{"line":13},{"line":23},{"line":25}]}]},{"source":"webshop-product-selector","target":"webshop-attribute-selector","type":"compose_with","contexts":[{"scenario":"Search-result selection followed by detail-page attribute selection","explanation":"webshop-product-selector first produces the product detail page by clicking the selected product ID, and webshop-attribute-selector next operates on that detail page to map requested values to clickable options and click them. This is a concrete adjacent handoff: selection opens the detail page, then attribute selection uses the resulting page state.","conditions":["A search results page contains multiple candidate products and the selected item must be opened before option picking.","The chosen product detail page then shows configurable attributes matching the user's requested values."],"source_evidence":[{"line":7},{"line":18}],"target_evidence":[{"line":9},{"line":10},{"line":11},{"line":15},{"line":18}]},{"scenario":"Product choice that enables downstream configuration","explanation":"webshop-product-selector establishes the next execution state for webshop-attribute-selector by navigating to the chosen product's detail page for final verification. The attribute selector then uses that page plus the specified attribute values to complete configuration by clicking the exact matching options.","conditions":["The task is to choose a product from search results, then refine by selectable options on the product detail page.","The user requirements are only fully satisfied after both product choice and attribute clicks are completed."],"source_evidence":[{"line":10},{"line":18}],"target_evidence":[{"line":8},{"line":10},{"line":11},{"line":18},{"line":24}]}]},{"source":"webshop-attribute-selector","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Attribute selection completes and hands off to purchase execution","explanation":"The attribute selector can complete the configuration step and, when the instruction implies buying, it may click a Buy Now-like action after all required attributes are selected. The purchase executor then uses that verified, fully configured product state and the available purchase-button label to perform the final click and complete the transaction.","conditions":["The attribute selector has finished clicking all required configurable options on a product detail page.","The user instruction implies a purchase and a purchase button such as Buy Now is available.","The product is already verified as matching the requested attributes before the final transaction step."],"source_evidence":[{"line":18},{"line":19}],"target_evidence":[{"line":12},{"line":13},{"line":14},{"line":17},{"line":25}]},{"scenario":"Adjacent product-page stages in a checkout workflow","explanation":"Both skills participate in the same purchase workflow on a product page: the attribute selector finishes by optionally initiating a Buy Now-like purchase action after configuration, while the purchase executor is the terminal step that clicks the purchase button to complete checkout. They are adjacent stages in the same shopping path, with the selector establishing the configured/verified product state that the executor consumes next.","conditions":["Both skills operate on a product detail page in an e-commerce shopping flow.","The product has already been validated against the user's requirements before the final click action.","The user is ready to buy and a direct purchase control is available."],"source_evidence":[{"line":3},{"line":18},{"line":19}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":17}]}]},{"source":"webshop-attribute-selector","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Configured product handoff to checkout","explanation":"The selector’s after-state is that required attributes are selected and, when a purchase is implied, it may click Buy Now. The purchase-initiator’s input is a selected product with required options already chosen and readiness to buy, then it executes click[buy now] to proceed to checkout. So the selector can hand off the configured product state to the purchase step.","conditions":["The attribute-selector has finished clicking all required options on a product detail page and the user instruction implies a purchase."],"source_evidence":[{"line":18},{"line":19}],"target_evidence":[{"line":14},{"line":15},{"line":16},{"line":17},{"line":20}]}]},{"source":"webshop-purchase-initiator","target":"webshop-attribute-selector","type":"compose_with","contexts":[{"scenario":"Checkout initiation does not feed attribute selection","explanation":"The purchase-initiator’s output is checkout initiation via click[buy now], while the attribute-selector requires a product detail page with configurable options and a user-specified set of values. If checkout action is not yet final navigation away and the page still exposes selectable options, the earlier checkout-initiation state can continue into attribute selection only in the trivial sense that both act on the same product page; however, the skills do not provide a defensible reusable handoff where checkout initiation supplies the selector’s required inputs. Therefore no positive composition is supported in this direction.","conditions":["The purchase-initiator has completed checkout initiation by clicking Buy Now and the page remains on a product context with selectable options still visible."],"source_evidence":[{"line":20}],"target_evidence":[{"line":8},{"line":9},{"line":10},{"line":11},{"line":15},{"line":18}]}]},{"source":"webshop-query-parser","target":"webshop-attribute-selector","type":"compose_with","contexts":[{"scenario":"Parse query first, then select matching product options","explanation":"The query parser produces structured criteria from the user's natural-language shopping request, including key attributes and other specifications, which can then supply the attribute values that the selector needs to match against clickable options on a product detail page.","conditions":["The workflow starts from a user shopping instruction that specifies required product attributes, then moves to a product detail page with configurable options."],"source_evidence":[{"line":8},{"line":11},{"line":13},{"line":15},{"line":24},{"line":25}],"target_evidence":[{"line":8},{"line":9},{"line":10},{"line":11},{"line":14},{"line":15},{"line":18}]},{"scenario":"Structured shopping criteria inform attribute selection on product detail pages","explanation":"The query parser holds structured criteria in memory to guide later product evaluation and click actions, and the attribute selector consumes those specified values to click the exact matching option text on the product page.","conditions":["The selector is used after attributes have already been identified and a product detail page is available."],"source_evidence":[{"line":24},{"line":25},{"line":26}],"target_evidence":[{"line":3},{"line":10},{"line":11},{"line":15},{"line":16},{"line":18}]}]},{"source":"webshop-result-analyzer","target":"webshop-attribute-selector","type":"compose_with","contexts":[{"scenario":"Search shortlist feeding product-page option selection","explanation":"The result analyzer produces a prioritized shortlist of candidate Product IDs or links, which can be used next to choose a listing for detailed inspection; the attribute selector then operates on a product detail page with configurable options and user-specified values, so the analyzer’s output supports the selector’s next operation when moving from search results to a chosen product page.","conditions":["A search results page has been analyzed into prioritized candidate product IDs or links for further inspection.","The next step is to open one of those candidates as a product detail page where configurable options are shown."],"source_evidence":[{"line":25},{"line":28}],"target_evidence":[{"line":9},{"line":10},{"line":11},{"line":15},{"line":18}]}]},{"source":"webshop-attribute-selector","target":"webshop-result-analyzer","type":"similar_to","contexts":[{"scenario":"Attribute-based product selection at adjacent shopping stages","explanation":"Both skills work on product-requirement matching, but at different stages: the analyzer matches search listings on title, description, and price to produce a prioritized candidate list, while the attribute selector matches required values to clickable options on a product detail page and clicks the exact matching choices. They are comparable capabilities for attribute-based product selection, though one ranks listings and the other performs option clicks.","conditions":["The user needs product filtering at the search-results stage before opening any product detail page.","The target criteria include attribute requirements that can be parsed from the observation and matched against listings."],"source_evidence":[{"line":10},{"line":11},{"line":14},{"line":15},{"line":18}],"target_evidence":[{"line":10},{"line":16},{"line":20},{"line":25}]}]},{"source":"webshop-attribute-selector","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"After attribute selection, choose or confirm a product variant on the same product page.","explanation":"The attribute-selector produces the state that required attributes are already selected, which can directly support the variant chooser when it next decides among remaining variant options on the same product detail page. The chooser’s inputs include the observation of available options and the user’s preferences/constraints, so after attribute selection it can use the updated page state to choose the appropriate variant and click it.","conditions":["A product detail page shows configurable options and the user has specified required attribute values.","The attribute-selector finishes selecting the exact matching clickable options before the next step."],"source_evidence":[{"line":18},{"line":24}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13}]}]},{"source":"webshop-attribute-selector","target":"webshop-variant-chooser","type":"similar_to","contexts":[{"scenario":"Selecting configurable options on a product detail page.","explanation":"Both skills explicitly cover selecting clickable product options on a product detail page, parsing the observation, and executing click[value] actions. The attribute-selector focuses on matching specific attribute values such as flavor or size, while the variant-chooser focuses on choosing among product variants such as size or quantity, sometimes defaulting when unspecified. They are comparable in scope, though not identical in selection criteria.","conditions":["Both skills operate on a product detail page with clickable options.","The user may provide preferences or constraints, and the task is to click the matching option(s)."],"source_evidence":[{"line":3},{"line":8},{"line":15},{"line":18}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":13},{"line":15}]}]},{"source":"webshop-option-selector","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Selecting the required variant before purchase verification","explanation":"The option selector parses the page's configurable values and selects a `click[value]` option based on user preferences or constraints; the attribute verifier first parses requirements and then checks the page's price and attributes before choosing the required option and proceeding. In a purchase workflow, the selector can provide the needed option click that the verifier uses next when the product satisfies the constraints.","conditions":["A WebShop product detail page shows configurable options and the user has explicit attribute constraints to verify before purchase."],"source_evidence":[{"line":13},{"line":15},{"line":19}],"target_evidence":[{"line":27},{"line":28},{"line":32},{"line":44}]}]},{"source":"webshop-attribute-verifier","target":"webshop-option-selector","type":"similar_to","contexts":[{"scenario":"Comparing skills that evaluate product-page options under user constraints","explanation":"Both skills work on the same WebShop product detail page with clickable option values: the option selector chooses a variant using the displayed page state and user constraints, while the attribute verifier checks those same options against the user's requirements and confirms whether the product is acceptable. They overlap on option evaluation for purchase-time decision making, though the verifier's scope includes full requirement checking and the selector's scope is only choosing an option.","conditions":["A WebShop product detail page has one or more clickable option values and the task is to choose among them under user constraints."],"source_evidence":[{"line":4},{"line":6},{"line":15},{"line":27},{"line":30}],"target_evidence":[{"line":8},{"line":10},{"line":14},{"line":15},{"line":19}]}]},{"source":"webshop-price-checker","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Budget screening before full attribute verification","explanation":"The price-checker first extracts the page price and decides whether the item is within budget; that boolean result directly supports the attribute-verifier’s next step of checking the remaining requirements and deciding whether to proceed. In the verifier, price is one of the requirements to compare before selecting an option or buying, so a prior within-budget decision can feed into its purchase-screen workflow.","conditions":["The current product page includes a price string and the buyer has a maximum budget.","The attribute-verifier is being used on the same product detail page before purchase."],"source_evidence":[{"line":9},{"line":10},{"line":12},{"line":13},{"line":14}],"target_evidence":[{"line":27},{"line":28},{"line":29},{"line":30},{"line":31},{"line":32},{"line":33}]}]},{"source":"webshop-attribute-verifier","target":"webshop-product-detail-check","type":"similar_to","contexts":[{"scenario":"Shared product-detail suitability verification on a webshop page","explanation":"webshop-attribute-verifier first parses the user's requirements, inspects the product page, compares price and attributes, and either selects the matching option/Buy Now or goes back to search; webshop-product-detail-check then performs the same product-page constraint verification and issues the proceed-or-reject recommendation on the same kind of input page. That makes them similar in scope for product-detail suitability checking, with the former emphasizing option selection in addition to the verdict.","conditions":["When an agent is on a product detail page from search results and needs a check of whether the item satisfies user constraints before buying."],"source_evidence":[{"line":15},{"line":27},{"line":28},{"line":29},{"line":32},{"line":33},{"line":39}],"target_evidence":[{"line":13},{"line":16},{"line":20},{"line":29},{"line":32},{"line":35},{"line":36},{"line":41},{"line":42}]}]},{"source":"webshop-attribute-verifier","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Product page evaluation followed by variant/action choice","explanation":"The attribute verifier explicitly parses user requirements, inspects the product page observation, checks price and other attributes, and then either selects the matching option or proceeds/returns to search. The product-detail inspector is the next stage on the same product page: it receives the observation with title, price, options, and actions, parses the instruction, examines price/options, and decides whether to click the required variant or go back/proceed. Thus the verifier can precede and support the inspector in the concrete flow where requirements are checked before the page-action decision.","conditions":["When the current page is a product detail page after search and the agent needs to confirm attribute and price requirements before acting."],"source_evidence":[{"line":27},{"line":28},{"line":29},{"line":31},{"line":32},{"line":33}],"target_evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":18},{"line":19},{"line":20},{"line":21},{"line":22},{"line":23}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Product-page configuration followed by attribute verification","explanation":"The navigator loads and parses a product detail page, then selects exact clickable options and can finalize with Buy Now. The verifier’s workflow consumes the product-page observation, checks price and attributes against user constraints, and outputs the click action that selects the required option before purchase. In the shared product-page scenario, the navigator can supply the configured detail-page state that the verifier then uses to confirm the match and decide the next action.","conditions":["A candidate product has already been chosen from search results","The current page observation includes title, price, and clickable options","The next step is to configure the product before purchase"],"source_evidence":[{"line":18},{"line":19},{"line":25},{"line":26},{"line":30},{"line":37}],"target_evidence":[{"line":19},{"line":20},{"line":27},{"line":28},{"line":32},{"line":44}]}]},{"source":"webshop-attribute-verifier","target":"webshop-product-detail-navigator","type":"similar_to","contexts":[{"scenario":"Shared product-detail checking and option selection capability","explanation":"Both skills operate on the same product-detail observation and both explicitly verify price and other attributes against the user’s request. The navigator parses the page state, cross-references requirements, and clicks exact values, while the verifier extracts requirements, checks price and attributes, and returns the matching option or Back to Search. They are comparable for product-detail inspection and option selection, though the navigator emphasizes post-search navigation and finalization while the verifier emphasizes strict pass/fail purchase gating.","conditions":["A product detail page is already open","The observation exposes title, price, and clickable options","The next task is to compare those details against user requirements and choose an action"],"source_evidence":[{"line":19},{"line":27},{"line":28},{"line":29},{"line":30},{"line":32},{"line":43},{"line":45}],"target_evidence":[{"line":19},{"line":20},{"line":24},{"line":25},{"line":30},{"line":37}]}]},{"source":"webshop-attribute-verifier","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Failed detail-page verification returns to product selection","explanation":"The attribute verifier checks the detail-page price, options, and specifications against the user's requirements and then either selects the matching option and proceeds or sends the workflow back to search. The product evaluator can follow this decision only when the task is at the search-results stage after a failed or incomplete detail-page match, where it selects a different candidate for another inspection.","conditions":["A shopping task begins with a product detail page observation and must decide whether the item satisfies user constraints before buying."],"source_evidence":[{"line":29},{"line":30},{"line":32},{"line":33}],"target_evidence":[{"line":13},{"line":16},{"line":21},{"line":25},{"line":26}]}]},{"source":"webshop-product-evaluator","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Search-results selection feeds detailed product verification","explanation":"The product evaluator produces a selected product ID by clicking a suitable listing on the search results page, which the attribute verifier can then use as the detail-page observation to check price, options, and specifications before purchase. This is a concrete stage handoff from choosing a candidate to verifying it on the product page.","conditions":["A web shopping workflow starts on a search results page and needs to open one product's detail page for deeper verification."],"source_evidence":[{"line":16},{"line":21},{"line":25},{"line":32}],"target_evidence":[{"line":15},{"line":19},{"line":21},{"line":28},{"line":32}]}]},{"source":"webshop-attribute-verifier","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Verified product purchase flow","explanation":"The verifier first checks price and attributes, then if all requirements are satisfied it selects the required option first and proceeds to Buy Now. The purchase executor then uses that verified product-page state and available purchase button to click the purchase button next.","conditions":["The product has already been verified against the user's requirements on a product detail page","A purchase button such as Buy Now is available","The user has decided to buy"],"source_evidence":[{"line":15},{"line":31},{"line":32},{"line":44},{"line":45}],"target_evidence":[{"line":8},{"line":12},{"line":13},{"line":14},{"line":17}]},{"scenario":"Verified product purchase flow in reverse description order","explanation":"The verifier establishes the precondition of a confirmed match and the selected option state; the executor consumes that state by performing the terminal Buy Now click on the same product page.","conditions":["The executor is used only after prior verification and on a product detail page","The verifier can establish that the product matches all requirements and is ready to proceed"],"source_evidence":[{"line":15},{"line":31},{"line":32},{"line":44}],"target_evidence":[{"line":15},{"line":17},{"line":24},{"line":29},{"line":30}]}]},{"source":"webshop-attribute-verifier","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Attribute verification completes, then purchase is initiated.","explanation":"The verifier skill ends with the product ready to proceed after all requirements are satisfied and the matching option is selected first; the purchase initiator then uses that selected, verified state to execute click[buy now] and move to checkout.","conditions":["The product has already passed attribute verification and the required option has been selected.","The final displayed price remains below the user budget.","The Buy Now button is present in the current page actions."],"source_evidence":[{"line":32},{"line":44},{"line":45}],"target_evidence":[{"line":20},{"line":23},{"line":24},{"line":25},{"line":26}]},{"scenario":"Verified product state feeds the checkout step.","explanation":"The attribute verifier establishes the preconditions the purchase initiator requires: selected product, chosen options, and requirement satisfaction. The purchase initiator then performs the next step, clicking Buy Now to proceed to checkout.","conditions":["A product has been selected and the user is ready to buy.","All required options are already chosen and reflected as selected in the observation.","The product title/description and final price satisfy the user's requirements."],"source_evidence":[{"line":15},{"line":27},{"line":29},{"line":30},{"line":32}],"target_evidence":[{"line":14},{"line":15},{"line":16},{"line":17},{"line":20},{"line":23},{"line":24},{"line":25},{"line":26}]}]},{"source":"webshop-query-parser","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Initial shopping instruction -> structured criteria for later verification","explanation":"The query parser runs first to turn the user's shopping instruction into structured criteria, including product type, key attributes, and price constraints, which the verifier then uses on the product detail page to compare displayed price/options/specifications against those constraints.","conditions":["A fresh shopping instruction has just arrived and no search/click actions have happened yet.","The task is to extract purchase constraints before later product-page verification."],"source_evidence":[{"line":8},{"line":11},{"line":14},{"line":15},{"line":24},{"line":26}],"target_evidence":[{"line":15},{"line":27},{"line":28},{"line":29},{"line":30},{"line":32},{"line":43},{"line":44}]}]},{"source":"webshop-variant-chooser","target":"webshop-attribute-verifier","type":"compose_with","contexts":[{"scenario":"Choose a variant, then verify that chosen product against purchase constraints","explanation":"The variant chooser first parses available variant options and the user instruction, then selects and clicks the most appropriate variant; it explicitly handles constraints such as price lower than a threshold and may click a variant before finalizing selection. The attribute verifier consumes a product detail-page observation containing the user instruction, price, options, and specifications, and checks whether the product meets those requirements before proceeding. So the chooser can provide the selected variant/state that the verifier then evaluates next when the workflow is to inspect a chosen product variant against purchase constraints.","conditions":["On a product detail page with multiple clickable variants and a user instruction that includes a constraint affecting variant choice."],"source_evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":16}],"target_evidence":[{"line":15},{"line":19},{"line":21},{"line":22},{"line":27},{"line":28},{"line":29},{"line":30}]}]},{"source":"webshop-price-checker","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"After a price check rejects a candidate, restart product discovery with a fresh search query","explanation":"webshop-price-checker establishes that an item is not suitable when it exceeds budget or has no price and that the search should continue; webshop-initial-search is the next step when previous results are insufficient and a new query is needed, producing a fresh initial results page.","conditions":["A candidate product has already been evaluated against budget","The item is over budget or has no price, so the search must continue"],"source_evidence":[{"line":14},{"line":18}],"target_evidence":[{"line":14},{"line":18}]}]},{"source":"webshop-initial-search","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Search results feed detail-page verification","explanation":"The initial search skill produces the first results page, which is the source of candidate listings; the product-detail skill is triggered only once a specific product detail page has been opened from search results, so the search output supports the next navigation step into detail verification.","conditions":["Use after the initial search has returned a results page and the next step is selecting a candidate product detail page."],"source_evidence":[{"line":17},{"line":19},{"line":29}],"target_evidence":[{"line":13},{"line":22},{"line":36}]},{"scenario":"User requirements carried from search into product verification","explanation":"The search skill parses user criteria into a concise query and returns matching listings, while the detail-check skill takes the same user requirements and compares them against scraped product-page data for the final proceed/reject decision.","conditions":["The user query includes concrete requirements that were already parsed into search terms and then reused for verification on the chosen product page."],"source_evidence":[{"line":6},{"line":12},{"line":16}],"target_evidence":[{"line":13},{"line":20},{"line":29},{"line":32}]}]},{"source":"webshop-initial-search","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Search results feeding product-page inspection","explanation":"The initial search skill produces the initial results page after executing `search[<keywords>]`, and it explicitly says the next steps typically involve clicking a promising product listing. The product-detail inspector is used after clicking a product from search results and takes a product page observation to verify requirements next.","conditions":["A user has already supplied parsed product criteria and the search results page has been produced.","The next step is to click into a candidate product detail page for attribute/price verification."],"source_evidence":[{"line":16},{"line":17},{"line":19}],"target_evidence":[{"line":8},{"line":11},{"line":18},{"line":19}]}]},{"source":"webshop-initial-search","target":"webshop-product-detail-inspector","type":"similar_to","contexts":[{"scenario":"Shared web-shop product discovery task","explanation":"Both skills operate in the same web-shop product-discovery flow: the search skill starts product discovery from parsed requirements and returns matching listings, while the inspector checks a selected product page against those requirements and decides whether to select a variant, go back to search, or proceed. They share the named task of handling the user's product requirements, but one works on keyword search results and the other on product-detail verification.","conditions":["The user requirement includes a candidate product attribute or price constraint that must be checked on the detail page.","A product has been selected from the initial search results and its page observation is available."],"source_evidence":[{"line":3},{"line":6},{"line":12},{"line":17},{"line":19}],"target_evidence":[{"line":3},{"line":8},{"line":18},{"line":21},{"line":22},{"line":23}]}]},{"source":"webshop-initial-search","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Initial search results feed product-page navigation","explanation":"The initial-search skill produces the initial results page with matching listings, and its next step is to evaluate search results and typically click a promising product listing. The navigator skill then starts from a candidate product ID selected from search results and clicks it to load the product detail page.","conditions":["A search has already returned matching listings","A candidate product ID is selected from those listings"],"source_evidence":[{"line":3},{"line":17},{"line":29}],"target_evidence":[{"line":3},{"line":11},{"line":18}]}]},{"source":"webshop-initial-search","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Initial search output feeds product evaluation on the results page","explanation":"The initial search skill ends by returning the initial results page and explicitly says the next step is to evaluate the search results; the evaluator is the skill that takes that page next and inspects product titles, prices, and IDs to choose a product.","conditions":["A search results page has already been produced by the initial search and the next step is to compare listings against the user’s requirements."],"source_evidence":[{"line":17},{"line":19},{"line":29}],"target_evidence":[{"line":13},{"line":16},{"line":20},{"line":25}]}]},{"source":"webshop-product-evaluator","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"No suitable product on current page leads to a refreshed search","explanation":"The evaluator explicitly allows falling back to refined searching or the next results page when no current listing fits; the initial search skill is the one that executes a new keyword search and returns a fresh results page, so it is the next operation in that continuation path.","conditions":["The current results page does not contain a suitable item and the workflow needs to continue by refining the search."],"source_evidence":[{"line":26}],"target_evidence":[{"line":3},{"line":16},{"line":17}]}]},{"source":"webshop-initial-search","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"Initial e-commerce search flow","explanation":"webshop-initial-search produces the initial search results page after forming and executing a keyword query from parsed criteria; webshop-product-search consumes the same kind of interpreted criteria and search action to produce a candidate-products results page. In a workflow where the first search has already yielded a results page, the page can serve as the starting search context for the product-search skill's next evaluation or re-search step.","conditions":["The task is a product discovery search using interpreted product criteria and an available search action."],"source_evidence":[{"line":4},{"line":13},{"line":15}],"target_evidence":[{"line":3},{"line":16},{"line":17}]}]},{"source":"webshop-product-search","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"Initial e-commerce search flow","explanation":"webshop-product-search also describes the same initial-search task: it generates keywords from structured criteria, submits search[keywords], and validates by a Page 1/product-listing observation. webshop-initial-search provides exactly that initial results-page observation after executing search[], so it can feed the next search-product workflow stage that evaluates or refines those results.","conditions":["The task is a product discovery search using interpreted product criteria and an available search action."],"source_evidence":[{"line":3},{"line":7},{"line":17}],"target_evidence":[{"line":4},{"line":15},{"line":16}]}]},{"source":"webshop-initial-search","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Initial search results feed product selection","explanation":"webshop-initial-search outputs the initial search results page observation with matching product listings, and webshop-product-selector is explicitly used when on a search results page with multiple product options to review the list and click the selected product ID next.","conditions":["The search has already produced an initial results page with matching product listings.","The selector is being used on that results page to choose among multiple viable products."],"source_evidence":[{"line":17},{"line":29}],"target_evidence":[{"line":10},{"line":13},{"line":18}]}]},{"source":"webshop-query-interpreter","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"Parse user shopping request before the first platform search","explanation":"The query interpreter extracts product type, attributes, and constraints into a structured set of search parameters and a recommended search string, which the initial-search skill can use next to form its concise keyword query and execute search[].","conditions":["The shopping request has already been received in natural language and needs parsing before search."],"source_evidence":[{"line":4},{"line":6},{"line":7},{"line":8},{"line":22},{"line":31}],"target_evidence":[{"line":3},{"line":6},{"line":12},{"line":16},{"line":17},{"line":19}]}]},{"source":"webshop-initial-search","target":"webshop-query-interpreter","type":"similar_to","contexts":[{"scenario":"Shared first-stage product discovery workflow","explanation":"Both skills cover the same shopping-discovery task stage: they take a natural-language product request and turn it into search criteria for product lookup. The interpreter focuses on extracting structured parameters, while the initial-search skill focuses on converting parsed criteria into a concise keyword query and running the platform search.","conditions":["A new shopping instruction is received and needs both interpretation and initial search execution."],"source_evidence":[{"line":3},{"line":6},{"line":12},{"line":16},{"line":17},{"line":19}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":8},{"line":17},{"line":22},{"line":31}]}]},{"source":"webshop-query-parser","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"Parser output feeds initial search keyword formation","explanation":"The parser runs first to convert the user's natural-language shopping request into structured criteria, and the initial-search skill then uses those criteria to form concise search keywords and execute search[<keywords>].","conditions":["A new shopping instruction has just arrived and the agent has not yet started search or click actions."],"source_evidence":[{"line":8},{"line":11},{"line":24},{"line":25}],"target_evidence":[{"line":6},{"line":12},{"line":16},{"line":17}]},{"scenario":"Sequential shopping discovery pipeline","explanation":"Both skills are part of the same shopping flow: the parser extracts structured criteria from the user query, and the initial-search skill turns those criteria into the first platform search query. They are adjacent stages in one execution path, with the parser establishing the input state needed by the search step.","conditions":["The user instruction contains product type, attributes, quantity, size, or price constraints that need interpretation before searching."],"source_evidence":[{"line":3},{"line":8},{"line":20},{"line":24},{"line":25}],"target_evidence":[{"line":3},{"line":6},{"line":12},{"line":16},{"line":19}]}]},{"source":"webshop-initial-search","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"Initial search results are handed off for evaluation","explanation":"webshop-initial-search produces the initial search results page observation after executing the platform search, and webshop-result-analyzer consumes a visible search result page to extract product IDs, prices, and descriptions, then rank candidates.","conditions":["The search has already been executed and produced a results page.","The analyzer is being used on that observed search-result page to shortlist candidate products."],"source_evidence":[{"line":16},{"line":17},{"line":19},{"line":29}],"target_evidence":[{"line":7},{"line":16},{"line":23},{"line":25}]}]},{"source":"webshop-initial-search","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Initial search results are handed to result filtering for evaluation","explanation":"The initial search skill produces the results page observation, which the result-filter skill consumes next to evaluate each listing against the user's constraints and choose the first product that passes all criteria.","conditions":["The user instruction includes filterable constraints beyond the product search keywords, such as price or feature requirements.","The workflow is on an initial search results page produced by the search skill, not a raw user instruction alone."],"source_evidence":[{"line":17},{"line":19},{"line":29}],"target_evidence":[{"line":13},{"line":23},{"line":25},{"line":30}]}]},{"source":"webshop-initial-search","target":"webshop-result-page-navigator","type":"compose_with","contexts":[{"scenario":"Initial search produces the first results page, which the navigator can then advance through if needed.","explanation":"webshop-initial-search returns the initial search results page after executing `search[<keywords>]`; webshop-result-page-navigator then uses a reviewed current results page and pagination controls to move to the next or previous page. In a WebShop product-discovery flow, the search skill supplies the first loaded results page, and the navigator uses that page next when more options must be reviewed.","conditions":["A product query has already been executed and an initial results page is available.","The page review finds no suitable match and pagination controls are present."],"source_evidence":[{"line":16},{"line":17},{"line":19},{"line":29}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":15}]},{"scenario":"After a refresh search, the new results page becomes the input for further pagination if the refreshed page still lacks a match.","explanation":"webshop-initial-search explicitly supports issuing a new search when previous results are insufficient and says the next steps are to evaluate search results; webshop-result-page-navigator is triggered once the current page has been reviewed and no item satisfies requirements, then loads another results page. The refreshed search output can therefore feed the navigator as the next evaluation stage when the new first page is still not adequate.","conditions":["The initial-search skill is used again to issue a new query because prior results were insufficient.","The refreshed results page still does not contain a suitable item, so page navigation is needed."],"source_evidence":[{"line":3},{"line":12},{"line":16},{"line":17}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":15}]}]},{"source":"webshop-search-constructor","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"Initial search query construction from parsed product criteria","explanation":"webshop-search-constructor produces the formatted `search[<constructed_query>]` action from structured criteria, and webshop-initial-search uses a concise keyword query with the platform's `search[<keywords>]` action to return the initial results page. In a workflow where parsed product criteria are already available, the constructor can supply the ready-to-execute search action that the initial-search skill runs next.","conditions":["The product request has already been parsed into structured criteria such as product type, attributes, and price limit.","The next operation is to build and run the platform search action."],"source_evidence":[{"line":6},{"line":12},{"line":16},{"line":17},{"line":19}],"target_evidence":[{"line":9},{"line":10},{"line":11},{"line":22},{"line":23}]}]},{"source":"webshop-initial-search","target":"webshop-search-constructor","type":"similar_to","contexts":[{"scenario":"Both skills initiate an e-commerce product search from parsed product criteria","explanation":"Both skills cover the same named subtask of constructing the initial e-commerce search query from structured criteria. webshop-search-constructor emphasizes scripted construction and strict `search[<query>]` formatting, while webshop-initial-search emphasizes parsing user requirements and omitting price from the initial keywords.","conditions":["The task is initial product discovery on an e-commerce platform.","The input has been reduced to structured or parsed product criteria rather than raw free text."],"source_evidence":[{"line":6},{"line":12},{"line":16},{"line":17}],"target_evidence":[{"line":3},{"line":6},{"line":9},{"line":10},{"line":11}]}]},{"source":"webshop-initial-search","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"Initial product discovery search","explanation":"The initial-search skill turns parsed requirements into a concise `search[<keywords>]` query and then executes it, producing the initial results page; the executor skill is the next stage because it also performs the WebShop search action from parsed keywords on the WebShop interface.","conditions":["A user has already provided product criteria and the goal is to start discovery with a WebShop search."],"source_evidence":[{"line":12},{"line":16},{"line":17},{"line":19}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":19},{"line":22}]}]},{"source":"webshop-initial-search","target":"webshop-search-executor","type":"similar_to","contexts":[{"scenario":"Performing the initial search on WebShop","explanation":"Both skills cover the same concrete search task: converting user product attributes into a search query and running the WebShop `search[<keywords>]` action to get product results. They differ mainly in framing and in that the executor skill also includes a click option, while the initial-search skill emphasizes omitting price from the first query and using the initial results page.","conditions":["The task is to issue the first WebShop search from parsed product requirements, not to click a result."],"source_evidence":[{"line":3},{"line":12},{"line":16},{"line":17}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":19},{"line":22},{"line":27}]}]},{"source":"webshop-search-formulator","target":"webshop-initial-search","type":"compose_with","contexts":[{"scenario":"Initial product-search query handoff","explanation":"webshop-search-formulator produces a single `search[keywords]` action string from parsed product criteria, and webshop-initial-search’s execute step uses that formulated query in the platform’s `search[<keywords>]` action to return the initial results page. This is a direct artifact handoff: the formulator creates the query string, and the initial-search skill consumes that string next to run the search.","conditions":["A parsed product request is available and the next step is to create the actual platform search command."],"source_evidence":[{"line":11},{"line":13},{"line":19}],"target_evidence":[{"line":12},{"line":16},{"line":17}]}]},{"source":"webshop-initial-search","target":"webshop-search-formulator","type":"similar_to","contexts":[{"scenario":"Initial e-commerce search formulation","explanation":"Both skills explicitly cover the same initial e-commerce search formulation task: webshop-search-formulator turns parsed attributes into a concise `search[keywords]` string, while webshop-initial-search parses the same criteria and forms a concise natural-language query before executing search. They differ in emphasis—the formulator focuses on producing the action string, while initial-search also includes execution and returning results—but their scoped capability for initial query formulation overlaps.","conditions":["The user instruction has already been parsed into core product criteria, and the task is to choose concise distinguishing keywords for the first search."],"source_evidence":[{"line":3},{"line":12},{"line":16}],"target_evidence":[{"line":3},{"line":8},{"line":13},{"line":16}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-option-selector","type":"compose_with","contexts":[{"scenario":"Inspecting a product page and selecting a matching variant before further actions","explanation":"The product-detail inspector first parses the user instruction, checks the displayed price and available options, and then clicks a required selectable variant or proceeds if criteria are satisfied; that selected variant click is a compatible next step for the option selector, which is specifically built to parse configurable options on a product detail page and perform click[value] on the chosen option.","conditions":["When the agent has a product detail page with configurable options and needs to pick the best variant based on the current observation and user constraints."],"source_evidence":[{"line":18},{"line":19},{"line":21},{"line":23}],"target_evidence":[{"line":8},{"line":9},{"line":10},{"line":13},{"line":15}]}]},{"source":"webshop-option-selector","target":"webshop-product-detail-inspector","type":"similar_to","contexts":[{"scenario":"Variant selection on a WebShop product detail page","explanation":"Both skills operate on the same WebShop product detail page and explicitly handle selectable product variants such as size, color, or quantity. The inspector verifies whether the required attribute is present and clicks it, while the option selector parses available values and clicks the chosen value in page order, so they overlap on the concrete task of variant selection on a product page.","conditions":["When the WebShop observation is a product detail page with clickable option values and the task is to choose an option before buying or other follow-up actions."],"source_evidence":[{"line":3},{"line":8},{"line":10},{"line":13},{"line":15}],"target_evidence":[{"line":3},{"line":11},{"line":14},{"line":21}]}]},{"source":"webshop-option-selector","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"After the product page has been loaded, the navigator can hand off the page observation and required user constraints to the option selector so it can choose among clickable variants.","explanation":"The navigator first parses the product page state, including title, price, and clickables, and cross-references the user's instruction with available options; the option selector then uses that same page state plus user constraints to choose the best variant and click it next.","conditions":["The same WebShop product detail page is open.","Clickable option values are present.","The user instruction includes preference or price constraints."],"source_evidence":[{"line":19},{"line":20},{"line":21}],"target_evidence":[{"line":19},{"line":20},{"line":25}]}]},{"source":"webshop-product-selector","target":"webshop-option-selector","type":"compose_with","contexts":[{"scenario":"Search-result product choice followed by product-option refinement","explanation":"The product selector produces the next-page action that opens a chosen product's detail page, and the option selector is explicitly triggered on a product detail page with configurable options. So the first skill can precede the second in a shopping flow: select a product, then work on its options after the page opens.","conditions":["Use on a WebShop search-results page to choose a product candidate before navigating onward."],"source_evidence":[{"line":18}],"target_evidence":[{"line":8},{"line":9},{"line":10}]},{"scenario":"Navigate to a product detail page, then select among its variants","explanation":"The product selector's after-state is opening the chosen product's detail page for final verification and purchase, and the option selector consumes exactly that kind of page state, where it parses configurable options and executes click[value] on the chosen variant. This makes the product-selection stage a valid upstream producer for the option-selection stage.","conditions":["A chosen product detail page contains configurable options to inspect and click."],"source_evidence":[{"line":18}],"target_evidence":[{"line":9},{"line":13},{"line":15},{"line":21}]}]},{"source":"webshop-option-selector","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Variant selection followed by final checkout","explanation":"The option selector can first choose the needed variant on the product page, leaving the page ready for follow-up actions such as buying; the purchase executor then performs the terminal click on the purchase button once the product has been verified and a buy decision exists.","conditions":["A product detail page is open with configurable options already selected or selectable, and the user has decided to buy after verification."],"source_evidence":[{"line":15},{"line":21}],"target_evidence":[{"line":8},{"line":12},{"line":13},{"line":17},{"line":25}]},{"scenario":"Shared shopping workflow on a product page","explanation":"Both skills are adjacent steps in a shopping workflow on a product page: the option selector resolves product variants by clicking the chosen value, and the purchase executor then clicks the exact purchase button to complete the transaction.","conditions":["Both skills operate on the same WebShop product detail page, but only after the product has been verified and the user intends to purchase."],"source_evidence":[{"line":3},{"line":15},{"line":21}],"target_evidence":[{"line":3},{"line":8},{"line":17},{"line":30}]}]},{"source":"webshop-option-selector","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Option selection prepares a product page for purchase","explanation":"The option selector runs first, clicking the chosen variant and leaving the page ready for follow-up actions; the purchase initiator then requires that all required product options are already chosen before executing Buy Now.","conditions":["A WebShop product detail page is shown with configurable options and the user needs those options selected before purchase."],"source_evidence":[{"line":15},{"line":21}],"target_evidence":[{"line":15},{"line":20},{"line":23},{"line":25}]},{"scenario":"Selected option state supports checkout initiation","explanation":"After the selector has chosen the variant, the purchase initiator can use that selected state plus the verified price and readiness to proceed to checkout.","conditions":["The user is ready to buy and the product already matches budget and requirement checks after option selection."],"source_evidence":[{"line":15},{"line":18}],"target_evidence":[{"line":13},{"line":16},{"line":17},{"line":20}]}]},{"source":"webshop-option-selector","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"Selecting a variant/option on a configurable product page","explanation":"The option-selector first evaluates the current page, applies cost minimization or user preferences, and clicks a chosen option value; this produces the same kind of variant-selection state that the variant-chooser expects next when it parses available options, reviews user needs, and executes click[value] for the selected variant.","conditions":["Both skills are used on a WebShop product detail page with configurable clickable options."],"source_evidence":[{"line":8},{"line":13},{"line":14},{"line":15}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13}]}]},{"source":"webshop-price-checker","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Budget check informs the next product-detail inspection when the item is still viable","explanation":"The price checker produces the within-budget result after extracting the page price and comparing it with the budget, which can support the inspector's next step of evaluating a product detail page against user requirements, including price and selectable options. In the accepted path, the item being within budget means the product is still eligible for further evaluation, and the inspector explicitly checks the product page's price and other criteria before deciding whether to proceed.","conditions":["The product has a displayed price and the checker is run on the current web page.","The inspector is then used on the product detail page to evaluate the page's price together with other requirements."],"source_evidence":[{"line":3},{"line":6},{"line":11},{"line":12},{"line":13}],"target_evidence":[{"line":8},{"line":11},{"line":18},{"line":19},{"line":23}]},{"scenario":"Budget rejection feeds back into the inspector's decision to return to search","explanation":"When the price checker determines the item exceeds budget, or that no price is available and the item is not suitable, that outcome supports the inspector's next action of rejecting the product and going back to search. The inspector's logic explicitly sends the agent back to search when the product exceeds the price limit, so the checker's budget decision provides the prerequisite state for that branch.","conditions":["The page price is found and exceeds the budget, or no price is found.","The inspector is applied to the same product page state to decide whether to go back to search."],"source_evidence":[{"line":14},{"line":17},{"line":18}],"target_evidence":[{"line":8},{"line":11},{"line":19},{"line":22}]}]},{"source":"webshop-product-evaluator","target":"webshop-price-checker","type":"compose_with","contexts":[{"scenario":"Budget-based candidate selection from search results","explanation":"The product evaluator first filters candidate listings using the page price and user requirements, then clicks a chosen product ID for details. That selection step can be informed by the price-checker’s boolean budget result: the price-checker extracts the price and decides whether the item is within budget, and the evaluator uses price constraints when choosing which listing to click next.","conditions":["On a web shopping search results page where product listings include titles, prices, and IDs, and the user has a price ceiling among the requirements."],"source_evidence":[{"line":20},{"line":21},{"line":23},{"line":25}],"target_evidence":[{"line":3},{"line":6},{"line":11},{"line":12},{"line":13},{"line":14}]}]},{"source":"webshop-price-checker","target":"webshop-product-evaluator","type":"similar_to","contexts":[{"scenario":"Price-aware product screening in shopping workflows","explanation":"Both skills operate on the same web shopping product-selection path and both explicitly use price as a criterion for deciding suitability. The evaluator compares each listing against the price limit while choosing a product ID to open, and the price-checker checks whether a product’s displayed price is within budget and marks over-budget items as unsuitable. They overlap in the task of assessing product affordability, though one selects among listings and the other verifies a single page’s price.","conditions":["On a search results page with multiple products where price limit is one of the user's requirements and a clicked item will be inspected next."],"source_evidence":[{"line":3},{"line":6},{"line":12},{"line":13},{"line":14},{"line":18}],"target_evidence":[{"line":4},{"line":5},{"line":7},{"line":13},{"line":21},{"line":23},{"line":25}]}]},{"source":"webshop-product-selector","target":"webshop-price-checker","type":"compose_with","contexts":[{"scenario":"selector opens a chosen product detail page, then price-checker verifies that page's price","explanation":"The product selector first filters candidates under the user's maximum price and then clicks the selected product ID to open its detail page; the price checker can be used immediately after that click to verify the opened page's displayed price against the budget.","conditions":["A user has a search-results shortlist with prices already displayed and the selector is choosing the next product to open."],"source_evidence":[{"line":15},{"line":18}],"target_evidence":[{"line":6},{"line":10},{"line":11},{"line":13},{"line":14}]},{"scenario":"product selection yields a detail page that can be checked for budget compliance","explanation":"The selector produces the next-state artifact of a clicked product detail page, and the price checker consumes that page plus the budget to extract the price and decide whether the item is within budget or should be rejected as unsuitable.","conditions":["A product detail page is available after selection, and the page exposes a readable price string."],"source_evidence":[{"line":18}],"target_evidence":[{"line":3},{"line":9},{"line":10},{"line":12},{"line":13},{"line":14},{"line":18}]}]},{"source":"webshop-price-checker","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Price verification precedes final purchase on a product page","explanation":"The price-checker produces the prerequisite buy-suitability decision: it checks a product price against budget and outputs whether the item is within budget or not suitable, which can then be used to decide whether to proceed with purchase. The purchase-executor explicitly requires that the product has already been verified against requirements and that the user has decided to buy, then performs the click on the purchase button next.","conditions":["A shopper is on a product detail page, has a budget-based suitability check result, wants to buy the item, and a purchase button is available."],"source_evidence":[{"line":3},{"line":12},{"line":13},{"line":14},{"line":18}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":17},{"line":29}]}]},{"source":"webshop-price-checker","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Price check precedes purchase initiation when the item is within budget","explanation":"The price checker produces the within-budget decision, which the purchase initiator uses next as one of its required pre-click verifications. The initiator explicitly requires that the final displayed price has been verified within budget before executing click[buy now].","conditions":["A product page has a displayed price string and a budget is available.","The price checker has determined the item is within budget.","The purchase initiator is about to validate prerequisites before clicking Buy Now."],"source_evidence":[{"line":3},{"line":12},{"line":13}],"target_evidence":[{"line":16},{"line":23},{"line":24},{"line":20}]},{"scenario":"Purchase initiation depends on a verified price and can route back to price checking when budget verification fails","explanation":"The price checker establishes whether the item is suitable by comparing the displayed price to the budget or marking it unsuitable when no price is found. The purchase initiator consumes that verification state by refusing to proceed when checks fail and by requiring the final price be within budget before checkout.","conditions":["The purchase flow is at the verification stage before clicking Buy Now.","A price check result is needed to confirm the final displayed price is below budget.","If the price is over budget or cannot be found, purchase should not proceed."],"source_evidence":[{"line":3},{"line":14},{"line":18}],"target_evidence":[{"line":23},{"line":24},{"line":28},{"line":41}]}]},{"source":"webshop-price-checker","target":"webshop-query-interpreter","type":"compose_with","contexts":[{"scenario":"Shopping flow where a user query is first parsed into a budget constraint and then a page price is checked against that budget.","explanation":"webshop-query-interpreter produces structured search parameters including price limits and hands them off to downstream search steps; webshop-price-checker then uses a specified budget plus a page price string to run the check and decide whether the item is within budget. In a shopping pipeline, the interpreter’s extracted constraint can support the checker’s next operation after a product page is opened.","conditions":["The query interpreter has already extracted a structured price limit from natural-language shopping text.","A product page or listing with a visible price string is available for the checker."],"source_evidence":[{"line":3},{"line":6},{"line":9},{"line":10},{"line":11},{"line":12},{"line":13},{"line":14}],"target_evidence":[{"line":4},{"line":6},{"line":7},{"line":22},{"line":31}]}]},{"source":"webshop-query-interpreter","target":"webshop-price-checker","type":"compose_with","contexts":[{"scenario":"Shopping flow where a user query is first parsed into a budget constraint and then a page price is checked against that budget.","explanation":"Both skills operate on the same shopping task path: one interprets a shopping request into structured constraints including price limits, while the other checks a product page’s displayed price against a budget. They are complementary adjacent stages in product evaluation, with the interpreter providing the budget constraint that the checker consumes next.","conditions":["The query interpreter has already extracted a structured price limit from natural-language shopping text.","A product page or listing with a visible price string is available for the checker."],"source_evidence":[{"line":4},{"line":6},{"line":7},{"line":22},{"line":31}],"target_evidence":[{"line":3},{"line":6},{"line":9},{"line":10},{"line":11},{"line":12},{"line":13},{"line":14}]}]},{"source":"webshop-query-parser","target":"webshop-price-checker","type":"compose_with","contexts":[{"scenario":"shopping workflow: parsed query supplies budget for later product price verification","explanation":"The query parser produces structured search criteria, including price constraints, before any search or click actions, and says the extracted criteria are used to evaluate product listings and details during click actions. The price checker then takes a user budget plus a page price string and returns whether the item is within budget. So the parser's output can feed the later price-checking stage by supplying the budget constraint that the checker consumes next.","conditions":["A new shopping instruction has been received and the parser has extracted structured criteria including a price_max value.","The next step is selecting or evaluating products against that budget and displayed page price."],"source_evidence":[{"line":11},{"line":14},{"line":24},{"line":26}],"target_evidence":[{"line":3},{"line":6},{"line":9},{"line":11},{"line":12}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Product page inspection can feed the final purchase-proceed decision","explanation":"The inspector first parses the user instruction and checks price/options on the product page, then can decide the product meets criteria and proceed with purchase actions such as Buy Now. That matches the check skill’s workflow of extracting user requirements, scraping product page data, verifying constraints, and recommending click[buy now] when suitable.","conditions":["When the page is a product detail page reached from search and the user specifies required attributes and a budget."],"source_evidence":[{"line":8},{"line":18},{"line":19},{"line":23}],"target_evidence":[{"line":13},{"line":20},{"line":22},{"line":35},{"line":62}]},{"scenario":"Verification output can support the next purchase-or-return step","explanation":"The check skill produces the same kind of final suitability assessment after verifying the page, and the inspector can use that verified state to choose whether to go back to search or proceed. Both skills operate on the same product-page observation and user requirements, with the inspector adding an intermediate choice among variants/actions before the final proceed step.","conditions":["When the page is a product detail page reached from search and the user specifies required attributes and a budget."],"source_evidence":[{"line":13},{"line":16},{"line":22},{"line":23}],"target_evidence":[{"line":11},{"line":16},{"line":22},{"line":35},{"line":36},{"line":42}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Navigator completes product-page setup before the checker evaluates suitability","explanation":"The navigator first loads the product detail page and parses its observation/clickables, ending in a configured product ready for purchase; the checker next expects a specific product detail page from search results plus the page observation (title, price, description/features, rating, Buy Now) to verify constraints and issue Proceed or Reject.","conditions":["The workflow starts from a selected search result and reaches a loaded product detail page."],"source_evidence":[{"line":18},{"line":19},{"line":26}],"target_evidence":[{"line":11},{"line":12},{"line":18}]},{"scenario":"Checker validates the already-open product page state used by the navigator","explanation":"The checker consumes the product page state by reading title, price, description/features, rating, and Buy Now availability; the navigator's next step after opening the page is to parse that same page state and inspect available clickables/options, so the navigator's loaded-page state supports the checker's verification step in the same execution environment.","conditions":["The product detail page is already open and the task is to assess whether the candidate satisfies the user's requirements."],"source_evidence":[{"line":13},{"line":19},{"line":24}],"target_evidence":[{"line":19},{"line":22},{"line":27}]}]},{"source":"webshop-product-evaluator","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Search-results selection can feed detail verification","explanation":"The evaluator first selects a promising product ID on the search results page, producing the next-page action `click[<product_id>]`; the detail-check skill then consumes that opened product detail page and performs the final proceed-or-reject verification on price, attributes, and Buy Now availability.","conditions":["A candidate product is chosen from a search results page and its product ID is clicked.","The next step is opening that product's detail page to verify all hard constraints before purchase."],"source_evidence":[{"line":13},{"line":16},{"line":25}],"target_evidence":[{"line":25},{"line":32}]},{"scenario":"When no listing qualifies, continue searching before detail verification","explanation":"The evaluator’s fallback action is to refine the search or advance results when nothing fits on the current page; that precedes any later product-detail check by finding another candidate first.","conditions":["The evaluator finds no suitable listing on the current results page.","It shifts to refined searching or the next results page before any detail-page verification step."],"source_evidence":[{"line":26}],"target_evidence":[{"line":26}]}]},{"source":"webshop-product-detail-check","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"Rejected product detail sends the user back into a new search pass","explanation":"The detail-check skill recommends click[back to search] when a product is not suitable, which returns the agent to search. The search skill is designed to activate on '[SEP] Back to Search' or when returning to search results, and it consumes structured product criteria to issue a new query. Thus rejection from detail-check can directly precede a renewed search.","conditions":["A specific product detail page has been evaluated and the product fails a hard constraint, so the workflow returns to discovery.","The next search can use the user criteria already interpreted from the query."],"source_evidence":[{"line":36},{"line":58}],"target_evidence":[{"line":19},{"line":13},{"line":15}]}]},{"source":"webshop-product-search","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Search results hand off to detail verification after selecting a candidate","explanation":"The search skill outputs a search results page containing candidate products and explicitly says that page is passed to downstream product-analysis skills. The detail-check skill is triggered only after navigating to a specific product detail page from search results, so the search results produced by the first skill are the next usable stage before detail verification can occur.","conditions":["A search has just produced a candidate list, and a downstream skill needs a page of product listings to analyze."],"source_evidence":[{"line":8},{"line":20}],"target_evidence":[{"line":13},{"line":16}]}]},{"source":"webshop-product-selector","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Search-result selection feeds product-detail verification","explanation":"The selector skill outputs `click[product_id]` to navigate from search results to the chosen product's detail page, and the detail-check skill is triggered once that specific detail page is open from search results. So the selector can precede and support the verification step by providing the opened product page the checker expects next.","conditions":["The agent is on a search results page with multiple candidate products and needs to open one product's detail page before final verification."],"source_evidence":[{"line":18}],"target_evidence":[{"line":13},{"line":16}]}]},{"source":"webshop-product-detail-check","target":"webshop-product-selector","type":"similar_to","contexts":[{"scenario":"Shared webshop product evaluation workflow","explanation":"Both skills operate on the same shopping task but at different stages: the selector chooses the most promising candidate from a shortlist using price and keyword matching, while the detail-check skill verifies the chosen product against the user's constraints and returns Proceed or Reject. They are complementary on the same workflow, though not interchangeable.","conditions":["The agent is already on a product detail page opened from search results and wants to assess whether the item should be bought or rejected."],"source_evidence":[{"line":4},{"line":7},{"line":16}],"target_evidence":[{"line":4},{"line":6},{"line":18}]}]},{"source":"webshop-product-detail-check","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Verified product should be purchased next","explanation":"The product-detail check skill outputs the suitability verdict and the specific next action to click buy now after all constraints pass, which directly supplies the prerequisite decision and page-state needed by the purchase executor to perform the final click on the purchase button.","conditions":["The product detail page has already been verified and the user wants to buy the item.","A purchase button such as Buy Now is present.","The verifier concluded Proceed / suitable."],"source_evidence":[{"line":16},{"line":35},{"line":42}],"target_evidence":[{"line":8},{"line":12},{"line":14},{"line":17},{"line":25}]}]},{"source":"webshop-purchase-executor","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Verified product should be purchased next","explanation":"The purchase executor is the terminal action that assumes prior verification and then executes the click on the exact purchase button value; the detail-check skill establishes that verification and identifies click[buy now] as the recommended action, so it can feed the executor in the shopping workflow.","conditions":["The product detail page has already been verified and the user wants to buy the item.","A purchase button such as Buy Now is present.","The verifier concluded Proceed / suitable."],"source_evidence":[{"line":8},{"line":12},{"line":16},{"line":17}],"target_evidence":[{"line":16},{"line":35},{"line":36},{"line":38}]}]},{"source":"webshop-product-detail-check","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Proceed from verified product page to purchase initiation","explanation":"webshop-product-detail-check first verifies the product detail page against user-specified constraints and outputs Proceed with the action click[buy now]; webshop-purchase-initiator then uses a selected product with a verified final price and readiness to purchase to execute click[buy now] and proceed to checkout.","conditions":["The current page is a specific product detail page reached from search results.","The product has passed price and attribute verification and the user is ready to buy."],"source_evidence":[{"line":13},{"line":16},{"line":30},{"line":31},{"line":35},{"line":42}],"target_evidence":[{"line":13},{"line":16},{"line":20},{"line":23},{"line":24},{"line":26}]},{"scenario":"Use purchase initiator only after a verified match on the product page","explanation":"webshop-product-detail-check establishes the needed verification state by checking the current product page, confirming all hard constraints, and recommending click[buy now]; webshop-purchase-initiator consumes that verified state as input, requiring a selected product, budget check, and product match before it executes click[buy now] to checkout.","conditions":["The product detail page is open from search results.","The user requires confirmation that the product meets constraints before purchase."],"source_evidence":[{"line":13},{"line":16},{"line":22},{"line":29},{"line":35},{"line":36}],"target_evidence":[{"line":13},{"line":14},{"line":16},{"line":20},{"line":23},{"line":24},{"line":26}]}]},{"source":"webshop-query-interpreter","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Parse a shopping request, then verify a candidate product page against the extracted constraints.","explanation":"The query interpreter runs first and produces product type, attributes, and price constraints in a structured format; the detail checker then uses those user-specified constraints to compare against the current product page and issue Proceed/Reject. This is a valid upstream handoff from search criteria to product-page evaluation.","conditions":["When a natural-language shopping request is first parsed into structured criteria before any product-page verification."],"source_evidence":[{"line":17},{"line":22},{"line":31}],"target_evidence":[{"line":13},{"line":20},{"line":29},{"line":35},{"line":36}]}]},{"source":"webshop-product-detail-check","target":"webshop-query-parser","type":"compose_with","contexts":[{"scenario":"Initial query parsing feeds later product-detail verification in the shopping flow","explanation":"webshop-query-parser produces structured search criteria from the user's natural-language instruction and holds them in memory for later product evaluation; webshop-product-detail-check then uses those user-specified constraints to compare against a specific product page and decide Proceed or Reject.","conditions":["The agent first receives a shopping instruction and extracts structured criteria.","A later step opens a specific product detail page from search results.","The verification step uses the remembered constraints to judge whether the product should proceed or be rejected."],"source_evidence":[{"line":13},{"line":16},{"line":20},{"line":29},{"line":35},{"line":36}],"target_evidence":[{"line":8},{"line":11},{"line":24},{"line":26}]}]},{"source":"webshop-product-detail-check","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"A product-page verdict can follow from a search-result candidate that was already filtered by requirements","explanation":"webshop-result-analyzer parses user requirements, compares listings by price and attributes, and outputs a prioritized candidate list; webshop-product-detail-check then uses the opened product page to confirm whether the candidate satisfies all hard constraints and decides whether to buy or return to search.","conditions":["The user has specific requirements and price constraints.","The analyzer has identified a candidate listing from search results that matches those criteria well enough to inspect in detail."],"source_evidence":[{"line":13},{"line":29},{"line":32},{"line":35},{"line":36}],"target_evidence":[{"line":10},{"line":16},{"line":23},{"line":25}]}]},{"source":"webshop-result-analyzer","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Search results shortlist feeds a subsequent product-page check for a promising candidate","explanation":"webshop-result-analyzer produces a prioritized list of candidate Product IDs or links for further inspection, which can be used next to open a specific product page; webshop-product-detail-check is triggered once a specific product detail page is reached from search results and then performs the final proceed-or-reject verification.","conditions":["The workflow starts on a search result page and the analyzer has already produced a prioritized candidate product ID or link.","That candidate is then opened as a specific product detail page for final verification."],"source_evidence":[{"line":3},{"line":7},{"line":16}],"target_evidence":[{"line":3},{"line":7},{"line":25}]}]},{"source":"webshop-result-filter","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"compose_with from search-result filtering to product-detail verification","explanation":"The result filter produces the primary candidate for `click[product_id]` after applying all constraints, and the product-detail checker consumes that opened product page next to verify the product against the user's requirements and issue a Proceed/Reject recommendation.","conditions":["When result filtering has already identified a first product that satisfies all extracted constraints and the next step is opening that product's detail page."],"source_evidence":[{"line":30},{"line":25},{"line":23}],"target_evidence":[{"line":13},{"line":16},{"line":22},{"line":35},{"line":36}]},{"scenario":"compose_with from selected search result to page-level verification","explanation":"The filter's output is a chosen product identifier / primary candidate for closer inspection, while the detail checker's inputs are the current product page observation and the user requirements; the former therefore supports the latter's next operation of checking the opened detail page.","conditions":["When the search page has a candidate product selected for closer inspection and the detail-check stage uses the page observation plus the user's constraints as its input."],"source_evidence":[{"line":30},{"line":7},{"line":8}],"target_evidence":[{"line":13},{"line":20},{"line":22},{"line":27}]}]},{"source":"webshop-product-detail-check","target":"webshop-result-page-navigator","type":"compose_with","contexts":[{"scenario":"Rejected product detail page leads back into results-page pagination","explanation":"The product-detail checker ends with the rejection action `click[back to search]` when a product is not suitable, which hands control back to the search/browse flow. The navigator’s trigger and action selection are exactly for a reviewed results page that lacks a match, where it clicks next/previous to load more results for continued evaluation.","conditions":["The current product detail page has been checked and fails at least one hard constraint, so the agent should leave the page and continue the search."],"source_evidence":[{"line":36},{"line":42}],"target_evidence":[{"line":8},{"line":11},{"line":15}]}]},{"source":"webshop-result-page-navigator","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Newly loaded results page feeds the next product-detail verification step","explanation":"After the navigator loads a new results page, its post-action state is to resume evaluating the newly loaded listings; the product-detail checker is the next evaluation skill because it verifies an individual product page against the user’s constraints and outputs Proceed/Reject.","conditions":["A result page has just been loaded and product listings must be evaluated against the user's requirements."],"source_evidence":[{"line":15},{"line":18}],"target_evidence":[{"line":13},{"line":16},{"line":22},{"line":29}]}]},{"source":"webshop-search-constructor","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Initial search action feeds the later product-page verification flow","explanation":"The search constructor provides the initial `search[<query>]` action from parsed criteria, which can be used to reach a product detail page from search results; the detail checker explicitly triggers once the agent has navigated to a specific product page from search results and then verifies the product against the user's constraints before deciding proceed or reject.","conditions":["A user has already supplied structured product criteria and the agent needs to start the e-commerce lookup.","The search constructor is run first to turn those criteria into a platform search action.","The product-detail checker is used next after search results navigation to inspect a specific product page."],"source_evidence":[{"line":6},{"line":9},{"line":11},{"line":23}],"target_evidence":[{"line":13},{"line":16},{"line":22},{"line":29},{"line":35},{"line":36}]}]},{"source":"webshop-search-executor","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Search results are used to reach a specific product page before verification","explanation":"The search executor produces search results and supports the next operation of opening a specific product page from those results; the product-detail checker is explicitly triggered only after navigation to a specific product detail page from search results and then scrapes page data such as title, price, features, and Buy Now availability.","conditions":["The workflow starts with a WebShop search on parsed keywords and returns product results.","The next step is opening a specific product detail page from those results for constraint checking."],"source_evidence":[{"line":13},{"line":22},{"line":23},{"line":24},{"line":25},{"line":26},{"line":27}],"target_evidence":[{"line":4},{"line":6},{"line":7},{"line":12}]},{"scenario":"A user search query leads to page-level suitability checking of the chosen product","explanation":"The search executor takes user-provided product attributes and returns results for evaluation, which can then be narrowed to a chosen product page; the detail-check skill takes the user constraints plus the current page observation and verifies the product against price, attributes, and Buy Now presence.","conditions":["The same user requirements drive the initial search and the later product verification.","The product-detail check can only proceed when a specific product page is open and uses the product-page observation for final judgment."],"source_evidence":[{"line":12},{"line":20},{"line":21},{"line":22},{"line":27}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":13}]}]},{"source":"webshop-search-formulator","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Initial search produces the query that precedes later product-page verification","explanation":"The search formulator turns parsed product requirements into a concise `search[keywords]` action string, which can directly serve as the initial search input for the product-detail checker’s required workflow after search results lead to a specific product page. The checker explicitly starts from a product page reached from search results and depends on the original user query requirements to verify price and attributes next.","conditions":["Use this after parsing a user request into structured product attributes, before the first platform search."],"source_evidence":[{"line":11},{"line":13},{"line":24}],"target_evidence":[{"line":13},{"line":20},{"line":22},{"line":29},{"line":35},{"line":36}]}]},{"source":"webshop-product-detail-check","target":"webshop-search-formulator","type":"similar_to","contexts":[{"scenario":"Both skills work from parsed product criteria and product attributes in the webshop task flow","explanation":"Both skills operate on the same parsed product requirements and product-defining attributes: the search formulator selects the most distinguishing attributes to create the initial search string, while the product-detail checker parses the same user requirements and checks the product title/description against them. This makes them comparable as two stages centered on structured product criteria, though one is for query formulation and the other for final page verification.","conditions":["Use this when search results are being narrowed by the user’s stated product attributes, not by price filters in the query string."],"source_evidence":[{"line":13},{"line":20},{"line":22},{"line":29},{"line":31},{"line":32}],"target_evidence":[{"line":11},{"line":12},{"line":16},{"line":17}]}]},{"source":"webshop-product-detail-check","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"Verify the product page, then choose among its variants if needed","explanation":"The product-detail checker can run first to confirm the page and user requirements, establishing the proceed/reject recommendation and the relevant hard constraints; if the page contains multiple variants, the variant chooser can then use the original user instruction and displayed variant options to pick the appropriate click[value] choice. This works only when the detail-check step identifies that a variant decision remains to be made on the same product page.","conditions":["A product detail page is open from search results and the goal is to verify suitability before any variant-specific selection is finalized."],"source_evidence":[{"line":13},{"line":16},{"line":22},{"line":29},{"line":35},{"line":36}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":16}]}]},{"source":"webshop-variant-chooser","target":"webshop-product-detail-check","type":"compose_with","contexts":[{"scenario":"Select a variant, then verify the chosen product detail page","explanation":"The variant chooser can run first to pick a variant whose displayed price complies with the user's constraint, producing the selected variant on the product page; the product-detail checker can then inspect that same page's title, price, description/features, and Buy Now availability to decide Proceed or Reject. This is a valid adjacent path because variant selection happens before the final suitability check on the chosen product state.","conditions":["On a product detail page with multiple variant options and the user has a price-related preference or constraint before final selection."],"source_evidence":[{"line":8},{"line":12},{"line":13},{"line":14}],"target_evidence":[{"line":13},{"line":20},{"line":22},{"line":27},{"line":29},{"line":35},{"line":36}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Product detail page handoff for verification after navigation","explanation":"The navigator produces the opened/configured product-detail-page state and the inspector consumes that next to verify the page contents and decide whether to click a variant, go back, or proceed. The navigator explicitly says it loads the detail page and analyzes clickables/options after selecting a candidate product, while the inspector expects an observation of the product page state with title, price, options, and actions for evaluation.","conditions":["The workflow is a post-search product-selection path where a product detail page is opened first and then checked against user requirements."],"source_evidence":[{"line":8},{"line":11},{"line":19},{"line":25},{"line":26}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15},{"line":18},{"line":19},{"line":20},{"line":21},{"line":22},{"line":23}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Search-results selection flows into detail-page inspection","explanation":"The evaluator produces the clicked product ID as the next action on the search page, which opens a product detail page for inspection. The detail inspector is explicitly used after clicking a product from search results and then checks options/price on that page, so the evaluator can precede it in the shopping flow.","conditions":["The shopper is on a web shopping search results page with multiple products and must choose a candidate by product ID.","The selected product is then opened on a product detail page where variant/price verification happens next."],"source_evidence":[{"line":3},{"line":8},{"line":11},{"line":21},{"line":23}],"target_evidence":[{"line":13},{"line":16},{"line":25},{"line":32}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"Back-to-search handoff after rejection","explanation":"The detail inspector can end by sending the user back to search when the product lacks the required attribute or exceeds price limits, and the search skill is explicitly triggered in that return-to-search state. The inspector therefore supplies the state that the search skill consumes next to begin a fresh candidate search.","conditions":["A product was rejected or the UI shows a return-to-search state.","The next step is to generate a new search query from the same user criteria and open search results."],"source_evidence":[{"line":22},{"line":3},{"line":8}],"target_evidence":[{"line":6},{"line":19},{"line":15}]}]},{"source":"webshop-product-search","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Search results handed to product detail inspection","explanation":"The search skill outputs a search results page containing candidate products and explicitly hands that page off to downstream product-analysis skills. The detail inspector is the downstream skill that operates after clicking a product from search results and uses the product page observation to make the next action decision.","conditions":["A search query has produced a Page 1 results page with candidate products.","The next step is to inspect an individual product page to verify requirements before deciding whether to select a variant, return to search, or proceed."],"source_evidence":[{"line":8},{"line":20},{"line":16}],"target_evidence":[{"line":8},{"line":11},{"line":18},{"line":21},{"line":22},{"line":23}]}]},{"source":"webshop-product-selector","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Search-to-detail verification flow","explanation":"The selector first filters and chooses a product ID from search results, then the detail inspector uses the resulting product page observation to verify the user instruction, price, and available options before deciding whether to click a variant or go back to search.","conditions":["When a search results page has multiple candidate products and the user’s core requirements include a max price and feature keywords."],"source_evidence":[{"line":10},{"line":13},{"line":15},{"line":18}],"target_evidence":[{"line":8},{"line":11},{"line":18},{"line":19},{"line":21},{"line":22},{"line":23}]},{"scenario":"Product-page handoff after selection","explanation":"The selector’s final action opens the product detail page, and the inspector is explicitly used next on that page to check whether the product matches the user’s requirements and determine the next action.","conditions":["When the selected item’s detail page is opened for final verification after clicking a product from search results."],"source_evidence":[{"line":7},{"line":18}],"target_evidence":[{"line":8},{"line":10},{"line":11},{"line":19},{"line":20},{"line":23}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Verified product proceeds to purchase","explanation":"The inspector’s after-state is that the product meets all criteria and the agent may proceed with purchase actions such as Buy Now; the purchase executor’s prerequisite is exactly that the product has been verified against the user's requirements and a purchase button is present, after which it performs the click action. So the inspector can directly precede the executor in a verified-buy workflow.","conditions":["The inspector has already evaluated the product detail page and found that the product satisfies the user's requirements, including attribute and price checks."],"source_evidence":[{"line":23}],"target_evidence":[{"line":12},{"line":17},{"line":38}]}]},{"source":"webshop-purchase-executor","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Inspection stage before final purchase in a shopping workflow","explanation":"The purchase executor ends with a confirmed purchase and completed transaction; the inspector’s input is the product-page observation containing the original user instruction, product details, available options, and available actions, and its purpose is to verify attributes and decide whether the page is suitable. In a shopping workflow, the purchase completion is a later stage than inspection and depends on the inspection step having established suitability.","conditions":["The purchase executor is used only after prior verification has completed and the user wants to buy the product on a product detail page."],"source_evidence":[{"line":40},{"line":29},{"line":24}],"target_evidence":[{"line":11},{"line":12},{"line":18},{"line":19},{"line":23}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"variant selection enables purchase initiation","explanation":"The inspector can select the required variant on the product page, creating the selected-option state that the purchase initiator requires before clicking Buy Now. In this path, inspection happens first and the purchase step uses the selected state next.","conditions":["A product detail page has already been inspected and the required option is available/selectable, but purchase has not yet begun."],"source_evidence":[{"line":21},{"line":23}],"target_evidence":[{"line":15},{"line":23},{"line":25}]},{"scenario":"verification passes and handoff to checkout","explanation":"The inspector can determine that the product meets criteria and proceed with purchase actions such as Buy Now, which directly supplies the verified-ready state that the purchase initiator consumes to execute click[buy now].","conditions":["The product page satisfies the user's attribute and price requirements, and the user is ready to buy."],"source_evidence":[{"line":19},{"line":23}],"target_evidence":[{"line":13},{"line":16},{"line":20},{"line":23},{"line":24},{"line":26}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"Candidate selection feeding product-page verification","explanation":"The product detail inspector consumes a product page observation after clicking a product from search results, using the original user instruction, product details, and available options to decide whether to click a required variant, go back to search, or proceed.","conditions":["The product detail inspector is used after a product has already been selected from search results."],"source_evidence":[{"line":8},{"line":11},{"line":18},{"line":21},{"line":22},{"line":23}],"target_evidence":[{"line":7},{"line":16},{"line":19},{"line":23},{"line":25}]}]},{"source":"webshop-result-analyzer","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Search-result ranking followed by product detail inspection","explanation":"The result analyzer turns search listings into a prioritized list of candidate Product IDs or links for further inspection, which can then be used to click through to a product detail page for verification.","conditions":["A search results page has been observed and needs to be shortlisted before opening a product detail page."],"source_evidence":[{"line":7},{"line":16},{"line":25}],"target_evidence":[{"line":8},{"line":11},{"line":14},{"line":21}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-search-constructor","type":"compose_with","contexts":[{"scenario":"Rejected product leads to a new search query","explanation":"The product-detail inspector ends by sending the agent back to search when the item lacks the needed attribute or is over budget, and the search constructor is the next stage that turns those criteria into a `search[...]` action. In this scenario, the inspector provides the parsed requirements and rejection state that the search step uses to build a new query.","conditions":["The inspected product page fails the required attribute check or exceeds the user's price limit, so the agent must return to search.","The search skill can take the parsed product criteria from the user's instruction and turn them into a platform search action."],"source_evidence":[{"line":22},{"line":18},{"line":19}],"target_evidence":[{"line":6},{"line":9},{"line":11},{"line":22},{"line":23}]}]},{"source":"webshop-product-detail-inspector","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"Inspecting a product page to pick a required variant","explanation":"webshop-product-detail-inspector can feed webshop-variant-chooser when the product page already exposes selectable options and the instruction includes an attribute constraint. The inspector parses the instruction and checks available options, then the chooser uses that same instruction and option list to click the appropriate value next.","conditions":["A product detail page is open and the observation includes variant options plus the original user instruction.","The next step is choosing a selectable variant to satisfy a requested attribute or quantity."],"source_evidence":[{"line":8},{"line":11},{"line":18},{"line":19},{"line":21}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]}]},{"source":"webshop-variant-chooser","target":"webshop-product-detail-inspector","type":"compose_with","contexts":[{"scenario":"Selecting a variant before continued product-page evaluation","explanation":"webshop-variant-chooser can feed webshop-product-detail-inspector in the narrower case where choosing a variant is the immediate action needed before the inspector continues evaluating the product page. The chooser selects a variant with click[value], and the inspector’s workflow expects a product-page state where an attribute has been selected and evaluation can proceed.","conditions":["A product detail page is open and the observation contains multiple clickable variant options.","The next step is deciding and clicking one variant, possibly defaulting to single-unit when no preference is stated."],"source_evidence":[{"line":8},{"line":11},{"line":13},{"line":15},{"line":16}],"target_evidence":[{"line":8},{"line":11},{"line":19},{"line":20},{"line":21},{"line":23}]}]},{"source":"webshop-product-evaluator","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Search-results choice feeds detail-page navigation","explanation":"The evaluator’s output is a clicked product ID, which is exactly the kind of selected candidate the navigator consumes next to open the product page and continue verification/configuration.","conditions":["A product has already been chosen from search results and its ID can be clicked.","The next step is to open the detail page for verification and configuration."],"source_evidence":[{"line":25},{"line":32}],"target_evidence":[{"line":11},{"line":18},{"line":19}]},{"scenario":"Best-match selection feeds product configuration","explanation":"After the evaluator selects the best match on the results page, the navigator uses that chosen candidate to load its detail page, compare options with the user’s instruction, and configure the product toward purchase.","conditions":["The selected product must still be checked against the user's requirements after clicking into the detail page.","The downstream task is to configure options and finish purchase if the product fits."],"source_evidence":[{"line":23},{"line":25},{"line":31}],"target_evidence":[{"line":13},{"line":14},{"line":20},{"line":25},{"line":26}]}]},{"source":"webshop-product-search","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Search results feed product detail navigation","explanation":"The search skill produces candidate products from the results page, and the detail navigator explicitly starts once a candidate product from search results is identified and a product ID is available to click. That makes search a valid upstream stage whose output is immediately consumed next by detail navigation.","conditions":["A product discovery search has produced a results page with candidate products.","A specific candidate product has been selected and its product ID is available to click.","The navigator is operating on the product page after search, not before search."],"source_evidence":[{"line":8},{"line":20}],"target_evidence":[{"line":11},{"line":18}]},{"scenario":"Candidate-result handoff into detail configuration","explanation":"Both skills are successive stages in the same WebShop product-discovery workflow: search generates candidate products, and the detail navigator uses a selected result to open the product page and configure it. The handoff is from search output to product-page interaction.","conditions":["The user has already searched and chosen a candidate product from the results list.","The next step is to open the product detail page and inspect/configure it."],"source_evidence":[{"line":20}],"target_evidence":[{"line":12},{"line":19},{"line":25},{"line":26}]}]},{"source":"webshop-product-selector","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Search-result selection hands off the chosen product ID to detail-page navigation","explanation":"The selector produces the concrete click action on a chosen product ID from search results, and the navigator’s next step is exactly to click that product ID to load the detail page and continue verification/configuration.","conditions":["A search results page lists multiple products and one must be chosen before opening details."],"source_evidence":[{"line":18}],"target_evidence":[{"line":18},{"line":11},{"line":12}]},{"scenario":"Opening the selected product page enables subsequent detail inspection and configuration","explanation":"The selector’s output is a click on the selected product’s ID to open its detail page, which is the exact page state the navigator expects before it parses options and configures the product.","conditions":["The detail page is loaded after a product ID has been selected from search results."],"source_evidence":[{"line":18},{"line":7}],"target_evidence":[{"line":11},{"line":19},{"line":20},{"line":25},{"line":26}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Configured product can hand off to final purchase execution","explanation":"The navigator first loads the product detail page, parses clickables, matches requirements, and configures the product so it is ready for purchase; the executor then takes that verified, on-page product state and performs the final click on the purchase button to complete the transaction.","conditions":["The product detail page is open","The product has been configured to satisfy the user's requirements","A purchase button is available on the page"],"source_evidence":[{"line":18},{"line":19},{"line":25},{"line":26},{"line":39}],"target_evidence":[{"line":11},{"line":12},{"line":14},{"line":17},{"line":25}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Product detail configuration completes the state needed for checkout initiation","explanation":"The product-detail navigator can finish by leaving the product configured and ready for purchase; the purchase initiator then uses exactly that ready state as its input before executing Buy Now and proceeding to checkout.","conditions":["The product has already been selected, all required options are chosen, the final price is within budget, and the user is ready to buy."],"source_evidence":[{"line":26},{"line":39}],"target_evidence":[{"line":13},{"line":20},{"line":23},{"line":24},{"line":25},{"line":26}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-purchase-initiator","type":"similar_to","contexts":[{"scenario":"Final purchase-stage webshop task","explanation":"Both skills cover the same final purchase-stage task on a webshop product page: one ends with a configured product ready for purchase, and the other executes the final Buy Now action once selection, budget, and match checks pass. They share the same scope but differ in stage, with the navigator handling configuration and the initiator handling checkout.","conditions":["The workflow is at the point where checkout should be initiated after product verification and option selection."],"source_evidence":[{"line":15},{"line":26},{"line":39}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":8},{"line":20}]}]},{"source":"webshop-result-analyzer","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Search-result ranking feeds product-page navigation","explanation":"The result analyzer produces a prioritized list of candidate Product IDs for further inspection, and the navigator explicitly takes a candidate product ID from search results to load its detail page next. So the analyzer can supply the selected ID that the navigator uses to open the product page.","conditions":["A search result page has already been observed and the analyzer has produced a prioritized candidate list.","A specific candidate product ID from that list is selected for post-search navigation."],"source_evidence":[{"line":25},{"line":28}],"target_evidence":[{"line":11},{"line":12},{"line":18}]},{"scenario":"Requirement extraction feeds product configuration","explanation":"The analyzer extracts and compares user requirements against listings, including product type, attributes, and price, while the navigator’s next step is to cross-reference the user instruction with the product page options and then configure the product. The analyzer’s requirement parsing can therefore precede and inform the navigator’s matching/configuration step.","conditions":["The user’s requirements include product type, attributes, and price constraints.","The product page has been opened and its current observation exposes title, price, and clickables for configuration."],"source_evidence":[{"line":10},{"line":11},{"line":12},{"line":13},{"line":19},{"line":20},{"line":25}],"target_evidence":[{"line":19},{"line":20},{"line":25},{"line":26},{"line":39}]}]},{"source":"webshop-result-filter","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Search-page filtering yields the product chosen for detail-page navigation","explanation":"The result filter produces a primary candidate product ID from the search page, which is exactly the input the detail navigator needs next to load that product's detail page and continue configuration. The filter says it selects the first passing product as the candidate for `click[product_id]`, and the navigator says it is used when a candidate product has already been identified from search results and you need to load its detailed page.","conditions":["Use the filter skill to evaluate search results and identify the first product that satisfies all constraints.","Then the detail navigator can click the selected product ID to open that candidate's product page."],"source_evidence":[{"line":30},{"line":50}],"target_evidence":[{"line":11},{"line":18}]}]},{"source":"webshop-result-page-navigator","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Continue shopping from a newly loaded results page into product-page selection","explanation":"The result-page navigator produces the next reviewed listings page and instructs the agent to continue evaluating product listings; the product-detail navigator then uses a chosen candidate from search results to click into its detail page and proceed with configuration.","conditions":["The current results page has been reviewed and navigation has loaded a fresh page of listings.","A candidate product is selected from those listings and its product ID is available to click."],"source_evidence":[{"line":8},{"line":15},{"line":18}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":18}]},{"scenario":"Backtrack through paginated listings before selecting a product to detail","explanation":"The result-page navigator handles moving to earlier or later listing pages and then resuming evaluation of the new results; the product-detail navigator takes over once a specific candidate has been identified from search results, loading its detail page for verification and option selection.","conditions":["The current page does not contain a suitable match and a previous-page control is available.","After moving pages, the agent resumes evaluating listings until one product is chosen for detail-page navigation."],"source_evidence":[{"line":11},{"line":13},{"line":14},{"line":15}],"target_evidence":[{"line":8},{"line":11},{"line":14},{"line":15}]}]},{"source":"webshop-search-constructor","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Initial product discovery followed by detail-page navigation","explanation":"The search-constructor turns parsed criteria into a platform-ready `search[...]` action, which is the first step that can surface candidate products for the navigator; the navigator explicitly requires that a candidate product already be identified from search results before it can click into the detail page.","conditions":["When the task begins with structured product criteria and needs an initial search on the e-commerce platform."],"source_evidence":[{"line":6},{"line":10},{"line":11},{"line":18},{"line":22},{"line":23}],"target_evidence":[{"line":3},{"line":11},{"line":12},{"line":18}]},{"scenario":"Search query construction feeding product-page selection and configuration","explanation":"The navigator uses the selected product ID from search results to open the detail page and then compares the user’s original instruction against the available options to configure the product. This can follow a search query that was constructed from those same criteria, because the search step produces the search action that leads to the candidate selection used next by the navigator.","conditions":["When the candidate product is already identified and the user’s criteria will be checked on the product page."],"source_evidence":[{"line":9},{"line":10},{"line":11},{"line":22}],"target_evidence":[{"line":11},{"line":13},{"line":18},{"line":20},{"line":25},{"line":26}]}]},{"source":"webshop-search-executor","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Search results lead to a selectable product detail path","explanation":"The search executor produces a list of product results and can also emit a `click[<product_id>]` selection from those results; the detail navigator explicitly requires a candidate product ID from search results to click into the product page and then configure it.","conditions":["The task is to search for a product and then choose one result to open and configure on its detail page.","The search step must yield a concrete product ID before the navigator can act."],"source_evidence":[{"line":7},{"line":27}],"target_evidence":[{"line":11},{"line":18}]},{"scenario":"Selected result is handed off to product-page configuration","explanation":"After the search executor selects a product, the navigator can use the resulting product ID/click and the product-page observation to parse title, price, and clickables, then configure the product to match the user's requirements.","conditions":["A product detail page is already open after a search-result click.","The navigator needs the loaded page state and exact clickables to continue configuration."],"source_evidence":[{"line":27}],"target_evidence":[{"line":18},{"line":19},{"line":30},{"line":37}]}]},{"source":"webshop-product-detail-navigator","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"Variant choice is part of product-detail configuration after the page is opened","explanation":"The variant chooser provides the click[value] selection of an option from the product page, and the navigator already handles the preceding product-page load plus option configuration workflow. In a task where the product page is open and options are available, the chooser can supply the option-selection step that the navigator uses next to finish configuring the product.","conditions":["A product detail page is already loaded","Multiple clickable options represent variants of the same product","The next step is selecting the appropriate option and proceeding with configuration"],"source_evidence":[{"line":18},{"line":19},{"line":25},{"line":26}],"target_evidence":[{"line":8},{"line":11},{"line":13}]}]},{"source":"webshop-variant-chooser","target":"webshop-product-detail-navigator","type":"compose_with","contexts":[{"scenario":"Variant selection can follow page navigation as the next configuration step","explanation":"The navigator first gets from the search result to the product detail page and exposes the interactive options; the variant chooser then parses those options and executes the click[value] action to choose the appropriate variant. That makes the chooser a downstream step after navigation in the same product-detail workflow.","conditions":["A candidate product has been selected from search results","The detail page is open with clickables visible","The user needs a size/quantity or other variant chosen before finalization"],"source_evidence":[{"line":11},{"line":12},{"line":18},{"line":19}],"target_evidence":[{"line":11},{"line":12},{"line":14},{"line":15}]}]},{"source":"webshop-product-search","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Search results page produced by search is evaluated next","explanation":"webshop-product-search first executes a query and outputs a search results page with candidate products; webshop-product-evaluator then uses that page as its input to evaluate multiple listings by title, price, and product ID and select the best match for click-through inspection.","conditions":["A product discovery task has already been started and a search action is available.","The search query returns a results page with product listings, and the next step is to compare items against the user's constraints."],"source_evidence":[{"line":15},{"line":16},{"line":20}],"target_evidence":[{"line":13},{"line":16},{"line":21},{"line":25}]}]},{"source":"webshop-product-evaluator","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Selecting the best candidate from a search results page before opening its detail page","explanation":"The evaluator first parses the search-results observation, checks each listing against the user's price and keyword constraints, and then clicks the suitable product ID. That chosen product ID and shortlist decision can be used immediately by the selector, whose next step is to apply its heuristic to a shortlist and execute the click on the selected product's ID.","conditions":["The page already contains multiple product listings with IDs and prices.","The user has supplied maximum-price and keyword requirements.","A product has been chosen as the best match from the shortlist."],"source_evidence":[{"line":13},{"line":16},{"line":21},{"line":22},{"line":23},{"line":25}],"target_evidence":[{"line":10},{"line":13},{"line":15},{"line":17},{"line":18}]}]},{"source":"webshop-product-evaluator","target":"webshop-product-selector","type":"similar_to","contexts":[{"scenario":"Both skills perform product selection on a shopping search results page using price and keyword constraints","explanation":"Both skills operate over the same kind of search-results observation and both rank or choose products using price and keyword-based criteria before clicking a product ID. They differ mainly in phrasing and implementation detail, but their core capability is the same product-selection subtask.","conditions":["The task is on a web shopping search results page.","There are multiple candidate products to compare.","Selection depends on user requirements such as price limits and feature keywords."],"source_evidence":[{"line":13},{"line":16},{"line":17},{"line":18},{"line":21},{"line":22},{"line":23},{"line":25}],"target_evidence":[{"line":10},{"line":13},{"line":15},{"line":16},{"line":17},{"line":18}]}]},{"source":"webshop-product-evaluator","target":"webshop-query-interpreter","type":"compose_with","contexts":[{"scenario":"Product evaluation leads to product detail selection after query parsing","explanation":"The evaluator consumes user requirements and product listings, ranks candidates by price and keyword match, and if a suitable product is found clicks its product ID to open details. That clicked product then becomes the concrete product item for downstream inspection, matching the product-query interpretation step that establishes the search criteria used in this selection.","conditions":["A product listing has already been evaluated against the structured criteria.","The outcome is choosing the most suitable product for detailed inspection by clicking its product ID."],"source_evidence":[{"line":13},{"line":16},{"line":18},{"line":19},{"line":21},{"line":22},{"line":23},{"line":25},{"line":29},{"line":32}],"target_evidence":[{"line":4},{"line":6},{"line":7},{"line":8},{"line":13},{"line":17},{"line":20},{"line":22},{"line":31},{"line":35},{"line":37},{"line":39},{"line":43},{"line":44}]}]},{"source":"webshop-query-interpreter","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Query interpretation feeds product evaluation on a shopping results page","explanation":"The query interpreter produces structured search parameters—product type, attributes, constraints, and a recommended search string—and explicitly hands them off to a downstream search skill. The product evaluator then uses the user instruction and listed product details on a search results page to check price limits and feature keywords, so the structured criteria can directly support that next evaluation step.","conditions":["A new shopping instruction has been parsed into structured product criteria and passed onward.","The next skill is operating on a web shopping search results page that needs those criteria to evaluate listings."],"source_evidence":[{"line":22},{"line":24},{"line":25},{"line":26},{"line":27},{"line":28},{"line":31}],"target_evidence":[{"line":13},{"line":16},{"line":17},{"line":18},{"line":19},{"line":20},{"line":21},{"line":22},{"line":23},{"line":25},{"line":26}]}]},{"source":"webshop-query-parser","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Parsing a shopping query before ranking search results","explanation":"The query parser runs first and converts the user's instruction into structured criteria; the product evaluator then uses those criteria to compare listings on a search results page against price and feature requirements.","conditions":["A new shopping instruction has already been received and the parser has run before any search or click actions.","The parsed output contains product type, key attributes, and price constraints that can be used to evaluate current listings."],"source_evidence":[{"line":8},{"line":11},{"line":14},{"line":24},{"line":25}],"target_evidence":[{"line":13},{"line":16},{"line":17},{"line":18},{"line":20},{"line":21},{"line":22},{"line":23},{"line":25}]}]},{"source":"webshop-result-analyzer","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Prioritized candidates from result analysis support best-product selection","explanation":"webshop-result-analyzer first extracts product IDs, titles, prices, and textual attributes, then outputs a prioritized candidate list for further inspection. webshop-product-evaluator next consumes a search results page with product titles, prices, and IDs to compare them against user constraints and click the best match. This makes the analyzer a valid upstream producer of candidate ordering for the evaluator’s next selection step, even though the evaluator still performs the final click.","conditions":["A search results page is observed with multiple product listings and the goal is to shortlist promising items for further inspection."],"source_evidence":[{"line":16},{"line":17},{"line":18},{"line":19},{"line":20},{"line":24},{"line":25}],"target_evidence":[{"line":13},{"line":16},{"line":20},{"line":21},{"line":22},{"line":23},{"line":25}]}]},{"source":"webshop-product-evaluator","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Evaluating products for later filtering and selection","explanation":"webshop-product-evaluator evaluates multiple listings against the user's requirements and selects the best match by product ID; webshop-result-filter accepts the same kind of search-results observation and outputs the filtered subset/primary candidate that can be used for the same next click step.","conditions":["The page contains multiple product listings","The task is to compare listings against the user's constraints","A chosen candidate will be clicked for closer inspection"],"source_evidence":[{"line":13},{"line":20},{"line":23}],"target_evidence":[{"line":13},{"line":20},{"line":23}]}]},{"source":"webshop-result-filter","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Filtering a search results page before choosing a product to click","explanation":"webshop-result-filter first extracts constraints, checks each product against all criteria, and selects the first passing product for click[product_id]; webshop-product-evaluator performs the same upstream filtering on a search results page and then clicks the chosen product ID next.","conditions":["The user provides price/feature constraints","You are on a webshop search results page with product IDs, titles, and prices","A matching item must be identified before click[product_id]"],"source_evidence":[{"line":13},{"line":16},{"line":25}],"target_evidence":[{"line":13},{"line":16},{"line":25}]}]},{"source":"webshop-product-evaluator","target":"webshop-result-page-navigator","type":"compose_with","contexts":[{"scenario":"Evaluator cannot find a match on the current results page and should move to another page for more candidates.","explanation":"The evaluator explicitly says that if no suitable product is found on the current page, the agent should use search refinement or click Next to browse more results; the navigator’s job is to click the pagination control that loads the subsequent page, after which evaluation resumes on the newly loaded listings.","conditions":["The current page has already been reviewed.","No listed product satisfies the user's requirements.","A next-page control is available."],"source_evidence":[{"line":26},{"line":13},{"line":25}],"target_evidence":[{"line":11},{"line":13},{"line":15}]}]},{"source":"webshop-result-page-navigator","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"A newly loaded results page from pagination becomes the input for product evaluation.","explanation":"The navigator’s after-state is a newly loaded results page that the agent should continue evaluating; the evaluator’s input is exactly a search results page with multiple products and their details, so the navigation step directly sets up the next evaluation step.","conditions":["Pagination has already loaded a new results page.","That page contains product listings with titles, prices, and IDs.","The agent continues the product-selection task on the new page."],"source_evidence":[{"line":15},{"line":16},{"line":13}],"target_evidence":[{"line":15},{"line":18},{"line":21}]}]},{"source":"webshop-product-evaluator","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"A product comparison step can be followed by a search/refinement step when no listing on the current page fits.","explanation":"webshop-product-evaluator can hand off a failure state where no current listing fits, after which webshop-search-executor can perform a broadened or refined search to obtain a new result set.","conditions":["The evaluator finds no suitable product on the current search results page.","The workflow continues by refining the query or moving to the next page."],"source_evidence":[{"line":15},{"line":16},{"line":22}],"target_evidence":[{"line":13},{"line":26}]}]},{"source":"webshop-search-executor","target":"webshop-product-evaluator","type":"compose_with","contexts":[{"scenario":"Search results are produced first, then the evaluator ranks products on that results page and clicks the best matching product ID.","explanation":"webshop-search-executor performs the search and returns a list of product results, which webshop-product-evaluator then parses and compares against the user’s price/feature requirements before clicking the selected product ID.","conditions":["The task is on a WebShop search page with a search bar and a results page.","The user wants a product with specific attributes, and the search has already returned listings."],"source_evidence":[{"line":13},{"line":16},{"line":25}],"target_evidence":[{"line":6},{"line":7},{"line":12}]}]},{"source":"webshop-product-evaluator","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"After choosing a product from search results, the next step is inspecting that product’s detail page for a variant choice.","explanation":"The product evaluator ends by selecting the most suitable listing and clicking its product ID to open details; the variant chooser begins on the resulting product detail page and parses the available variant options before clicking one. So the evaluator’s click-to-open-details output can directly precede the variant chooser’s option selection.","conditions":["The product evaluator has already selected a product ID from a search results page.","The destination page is a product detail page with multiple clickable variant options for the same product."],"source_evidence":[{"line":23},{"line":25}],"target_evidence":[{"line":8},{"line":11},{"line":13}]},{"scenario":"After a product has been opened, if the detail page exposes variant options, the variant chooser completes the final selection step.","explanation":"The evaluator’s output is a clicked product ID that opens the chosen product’s details, while the variant chooser consumes a product detail page with variant options and then executes click[value]. This makes the evaluator a valid upstream stage for the chooser when the selected product leads to variant selection.","conditions":["A chosen product has been opened from the search results.","The product detail page shows multiple clickable variants and the user has a variant preference or default applies."],"source_evidence":[{"line":25},{"line":32}],"target_evidence":[{"line":8},{"line":12},{"line":13},{"line":15}]}]},{"source":"webshop-product-search","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Initial search results handoff to product selection","explanation":"The search skill produces the candidate-product results page, which is exactly the input the selector skill consumes next to rank and click one product ID. Search outputs a list of candidate products and is passed to downstream analysis; selector inputs an observation listing multiple products and then executes click[product_id].","conditions":["The current observation is a search results page with multiple product entries and the user has already supplied core requirements such as product type, features, and price limit."],"source_evidence":[{"line":8},{"line":20}],"target_evidence":[{"line":10},{"line":13},{"line":18}]}]},{"source":"webshop-product-search","target":"webshop-product-selector","type":"similar_to","contexts":[{"scenario":"Shared search-results-page product workflow","explanation":"Both skills operate on the same WebShop search-results environment and both explicitly work with lists of products, titles, prices, and user requirements to move the shopper forward. Search generates the results page; selector evaluates that same kind of page to choose the best candidate by price and keyword match.","conditions":["The search skill is being used to start or resume product discovery, producing a page of listings rather than a detail page."],"source_evidence":[{"line":4},{"line":16},{"line":20}],"target_evidence":[{"line":4},{"line":10},{"line":13},{"line":15},{"line":16},{"line":17}]}]},{"source":"webshop-query-interpreter","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"webshop-query-interpreter -> webshop-product-search for initial product discovery","explanation":"The interpreter produces structured criteria and a recommended search query, which the product-search skill uses next to form and submit `search[keywords]` for the initial lookup. This is a concrete execution-order handoff from parsed query to search execution.","conditions":["A new shopping instruction has been parsed into structured search parameters and a search action is available."],"source_evidence":[{"line":22},{"line":31}],"target_evidence":[{"line":13},{"line":14},{"line":15}]},{"scenario":"webshop-query-interpreter -> webshop-product-search for criteria-to-keywords search","explanation":"The interpreter reduces the user request into product type, attributes, constraints, and a search string, and the search skill explicitly takes structured search parameters as input and generates search keywords from interpreted criteria. The interpreted query therefore feeds directly into keyword generation and search submission.","conditions":["The user request is a natural-language product query with attributes and hard price constraints."],"source_evidence":[{"line":7},{"line":24},{"line":25},{"line":26},{"line":27},{"line":28}],"target_evidence":[{"line":4},{"line":7},{"line":8},{"line":13},{"line":14},{"line":15}]}]},{"source":"webshop-query-parser","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"Initial query parsing before first web search","explanation":"The query parser runs first to extract structured criteria from the natural-language instruction, and the product-search skill then uses those criteria to form the initial `search[keywords]` query and start product discovery.","conditions":["A new shopping instruction has just arrived and no search or click action has been performed yet."],"source_evidence":[{"line":8},{"line":11},{"line":14},{"line":24},{"line":25}],"target_evidence":[{"line":4},{"line":7},{"line":13},{"line":14},{"line":15},{"line":19}]},{"scenario":"Parsed criteria used to drive initial or resumed search refinement","explanation":"The parser supplies structured shopping criteria in memory, and the product-search skill uses them next to build concise search keywords, broaden or refine queries after 0 results, and resume searching from search-results context.","conditions":["The product search has already produced a results page or the user is returning to search after rejection.","The parser has extracted product type, attributes, and price limits that can guide query refinement."],"source_evidence":[{"line":3},{"line":19},{"line":20},{"line":24},{"line":30},{"line":32}],"target_evidence":[{"line":5},{"line":6},{"line":16},{"line":19},{"line":20},{"line":23},{"line":24}]}]},{"source":"webshop-product-search","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"Initial search results hand off to result analysis","explanation":"webshop-product-search produces the search results page containing candidate products, and webshop-result-analyzer consumes exactly that kind of search result page to extract IDs, prices, and textual matches for ranking.","conditions":["A search has just produced a Page 1 results page with product listings.","The next step is to evaluate those listings against the user's criteria."],"source_evidence":[{"line":8},{"line":16},{"line":20}],"target_evidence":[{"line":7},{"line":16},{"line":20}]},{"scenario":"Result analyzer follows a successful search or renewed search","explanation":"The search skill explicitly outputs a search results page for downstream product-analysis skills, and the analyzer is triggered by a search result page and outputs a prioritized candidate list from those listings.","conditions":["The search skill has returned a results page after a new search or after resuming from search.","The analyzer then uses the visible listings and parsed requirements to shortlist candidates."],"source_evidence":[{"line":19},{"line":20}],"target_evidence":[{"line":3},{"line":7},{"line":16},{"line":25}]}]},{"source":"webshop-product-search","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Initial search results are ready for filtering","explanation":"webshop-product-search produces a search results page containing candidate products and explicitly passes that page to downstream skills; webshop-result-filter takes a search results page listing products with details and evaluates them against user constraints next.","conditions":["A search has already produced a results page with product listings","The next step is to evaluate those listings against user constraints"],"source_evidence":[{"line":20},{"line":16}],"target_evidence":[{"line":8},{"line":13},{"line":23}]},{"scenario":"After a search returns listings, the first product can be selected by filtering","explanation":"webshop-product-search's output handoff is the candidate-product results page, and webshop-result-filter consumes that page to apply all extracted constraints and choose the first matching product for closer inspection.","conditions":["The search results page includes multiple products","The user request contains multi-faceted constraints such as price or feature keywords"],"source_evidence":[{"line":20},{"line":16}],"target_evidence":[{"line":30},{"line":25},{"line":27}]}]},{"source":"webshop-product-search","target":"webshop-result-page-navigator","type":"compose_with","contexts":[{"scenario":"Search produces the first results page, then pagination continues review","explanation":"The product-search skill creates the initial result page of candidate products, and the navigator’s next operation is to act on that loaded results page to move through additional pages. This supports a concrete handoff where search output becomes the page state the navigator continues from.","conditions":["A search results page has been produced and the user wants to inspect more products than fit on the current page."],"source_evidence":[{"line":8},{"line":20}],"target_evidence":[{"line":8},{"line":15}]}]},{"source":"webshop-product-search","target":"webshop-result-page-navigator","type":"similar_to","contexts":[{"scenario":"Shared WebShop product-results workflow","explanation":"Both skills operate on WebShop product results pages and explicitly continue evaluation of product listings, but one starts the discovery search while the other advances or returns among paginated result pages. They share the same task family of working through product search results, with different sub-operations.","conditions":["The current page has been reviewed and there is a next-page or previous-page control available."],"source_evidence":[{"line":8},{"line":20}],"target_evidence":[{"line":8},{"line":15},{"line":21}]}]},{"source":"webshop-search-constructor","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"Initial e-commerce search creation","explanation":"webshop-search-constructor produces the platform-ready action `search[<constructed_query>]` from structured criteria, and webshop-product-search next consumes a `search[keywords]` action plus structured search parameters to execute the web product search and return candidate products.","conditions":["A product-finding task has parsed criteria available before any search is issued.","The next step is to turn those criteria into a valid platform search action."],"source_evidence":[{"line":4},{"line":7},{"line":8},{"line":15},{"line":20}],"target_evidence":[{"line":6},{"line":9},{"line":10},{"line":11},{"line":23}]},{"scenario":"Search-result stage after an initial query has been built and executed","explanation":"Both skills operate on the same e-commerce product-search step: webshop-search-constructor outputs a formatted `search[<query>]` action, while webshop-product-search uses that query to produce the search results page containing candidate products for downstream analysis.","conditions":["The downstream task is product discovery on the e-commerce platform.","The consumer skill expects a search results page with candidate products for further analysis."],"source_evidence":[{"line":3},{"line":11},{"line":18}],"target_evidence":[{"line":4},{"line":8},{"line":20}]}]},{"source":"webshop-search-formulator","target":"webshop-product-search","type":"compose_with","contexts":[{"scenario":"Initial search query preparation feeding the first product search","explanation":"The formulator produces the single `search[keywords]` action string from parsed product attributes, which the product-search skill then uses as its search input to execute the initial web search and obtain candidate products.","conditions":["A product request has already been parsed into structured attributes and the agent needs the first e-commerce search query."],"source_evidence":[{"line":11},{"line":13},{"line":24}],"target_evidence":[{"line":4},{"line":7},{"line":15},{"line":20}]},{"scenario":"Keyword selection that directly supports search-result generation","explanation":"The formulator’s output is a well-formatted keyword string that excludes later filters; the product-search skill accepts structured search parameters and turns the resulting query into a results page with candidate products for downstream analysis.","conditions":["The initial query should be concise and should omit post-search filters such as price ranges."],"source_evidence":[{"line":16},{"line":19},{"line":20}],"target_evidence":[{"line":7},{"line":8},{"line":16},{"line":20}]}]},{"source":"webshop-product-selector","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Search-results selection leading into purchase on the chosen product page","explanation":"The product selector first filters and chooses the best candidate from a shortlist and then opens that product's detail page; the purchase executor is used next on that product detail page after verification, where it clicks the purchase button to complete the transaction. Thus, selector output/state can feed the executor's required starting state in the next step.","conditions":["A search-results workflow has already narrowed products to those meeting core requirements, and the selected item is opened on its detail page before purchase."],"source_evidence":[{"line":10},{"line":13},{"line":15},{"line":18}],"target_evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":17},{"line":24},{"line":25}]}]},{"source":"webshop-product-selector","target":"webshop-purchase-executor","type":"similar_to","contexts":[{"scenario":"Adjacent stages in the same e-commerce workflow","explanation":"Both skills explicitly operate in e-commerce shopping workflows and require prior requirement checking, but one handles selecting the best product from search results while the other handles executing the final purchase on a verified product page. They are comparable as adjacent shopping-step capabilities, though not interchangeable.","conditions":["Both skills are used within a shopping flow, but at different stages and with different actions."],"source_evidence":[{"line":4},{"line":5},{"line":10},{"line":18}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":17},{"line":28},{"line":29},{"line":30}]}]},{"source":"webshop-product-selector","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Selecting a product on search results before purchase initiation","explanation":"The product-selector skill produces the concrete next artifact/state needed by purchase initiation: a selected product and navigation to its detail page via click[product_id]. The purchase-initiator skill explicitly requires that a product has been selected, the final price is within budget, required options are chosen, and the user is ready to buy before executing click[buy now].","conditions":["The user is on a search results page with multiple viable products.","The selected item opens its detail page and is the next step before purchase.","The product must still pass the purchase initiator's budget, option, and requirement checks."],"source_evidence":[{"line":4},{"line":5},{"line":10},{"line":13},{"line":18}],"target_evidence":[{"line":4},{"line":5},{"line":10},{"line":13},{"line":14},{"line":16},{"line":17},{"line":18}]},{"scenario":"Preparing a product detail page for checkout after selection","explanation":"The selector and purchase initiator are adjacent stages on the same webshop task path: the selector ends by opening the chosen product's detail page, and the initiator starts there, performing the final budget/option/product-match checks before click[buy now].","conditions":["The product has been selected from search results.","The detail page is reached and the user can verify price/options/requirements.","Checkout is only available after those verification checks pass."],"source_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":10},{"line":18}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":8},{"line":13},{"line":14},{"line":23},{"line":24},{"line":25},{"line":26}]}]},{"source":"webshop-query-parser","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Initial query parsing feeds shortlist selection","explanation":"The query parser runs first and produces structured criteria including product type, key attributes, and price constraints; the product selector then uses those requirements to score shortlist items and click the best match. This is a concrete handoff from parsed shopping constraints to final product selection.","conditions":["A shopping task starts with a fresh user instruction and proceeds through search-result evaluation to product selection."],"source_evidence":[{"line":11},{"line":14},{"line":24},{"line":25}],"target_evidence":[{"line":10},{"line":13},{"line":15},{"line":16},{"line":17},{"line":18}]},{"scenario":"Structured criteria guide the final choice on search results","explanation":"The parser extracts the user's requirements and price limits, and the selector explicitly evaluates candidates against those requirements using keyword matching and a maximum-price filter before clicking the chosen product. The selector's heuristic is therefore a direct downstream consumer of the parser's structured criteria in the same shopping workflow.","conditions":["A shopping task starts with a fresh user instruction and proceeds through search-result evaluation to product selection."],"source_evidence":[{"line":3},{"line":18},{"line":20},{"line":24},{"line":26}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":10},{"line":15},{"line":16},{"line":17},{"line":18}]}]},{"source":"webshop-result-analyzer","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Shortlist ranking feeds final product selection","explanation":"The analyzer outputs a prioritized list of candidate Product IDs or links sorted by match score, which is exactly the kind of shortlist the selector consumes next when it makes the final choice among multiple viable products. The selector then applies its heuristic and performs click[product_id] to open the chosen item’s detail page.","conditions":["A search results page has already been analyzed into a prioritized shortlist of candidate product IDs or links.","The next step is choosing the best candidate from that shortlist and clicking its product ID."],"source_evidence":[{"line":25}],"target_evidence":[{"line":10},{"line":13},{"line":18}]},{"scenario":"Search-result evaluation followed by final selection","explanation":"Both skills operate on observed search results and evaluate listings against user requirements, but the analyzer stops at producing a prioritized candidate list while the selector uses that shortlist to choose one product and click it. This makes them adjacent stages in the same webshop flow, with the analyzer’s ranked candidates supporting the selector’s next action.","conditions":["A search results page is visible and the user requirements can be parsed from the observation.","The downstream step needs structured candidate evaluation before the final click selection."],"source_evidence":[{"line":7},{"line":10},{"line":23},{"line":25}],"target_evidence":[{"line":4},{"line":10},{"line":14},{"line":18}]}]},{"source":"webshop-product-selector","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Selection consumes the filtered candidate list from prior constraint checking","explanation":"The product-selector skill performs the final selection step after a shortlist exists: it reviews a list of products, applies the bundled selection heuristic, and clicks the chosen product ID to open its detail page. That output is the kind of primary candidate the result-filter skill identifies from its own constraint checking.","conditions":["On a webshop search results page where the user has explicit price/feature requirements.","The selector is expected to choose among products that already appear to meet the core requirements, using price filtering and keyword scoring."],"source_evidence":[{"line":13},{"line":14},{"line":15},{"line":16},{"line":17},{"line":18}],"target_evidence":[{"line":25},{"line":26},{"line":27},{"line":30}]}]},{"source":"webshop-result-filter","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Filtering produces the shortlist used for final product selection","explanation":"The result-filter skill produces a filtered subset of products that meet the defined requirements, which the product-selector skill can use as the shortlist for its final heuristic choice and click action. In that scenario, filtering runs first and selection runs next.","conditions":["On a webshop search results page with multiple product listings and user constraints.","The filter skill has already extracted the subset meeting all constraints, and the selector then needs a final choice from that shortlist."],"source_evidence":[{"line":7},{"line":8},{"line":30}],"target_evidence":[{"line":4},{"line":5},{"line":14},{"line":18}]}]},{"source":"webshop-product-selector","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"After the selector evaluates a shortlist, its click action can be used by the search executor's allowed action protocol.","explanation":"The product selector ends by clicking the selected product ID to open the detail page, and the search executor explicitly allows the same `click[<product_id>]` action format when selecting a product from results, so the selector's output fits the executor's next permitted operation.","conditions":["The task is at the product-picking stage rather than the search-creation stage","A specific product ID has been identified from the search results"],"source_evidence":[{"line":18},{"line":22},{"line":27}],"target_evidence":[{"line":18},{"line":27}]}]},{"source":"webshop-search-executor","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Search results produced by the search executor can be handed to the product selector for final choice.","explanation":"The search executor takes structured keywords, performs the WebShop search, and returns a list of product results; the product selector expects a search results page with multiple product entries to review and choose from next.","conditions":["A WebShop search has already been run","The returned observation contains multiple product entries that may satisfy the user"],"source_evidence":[{"line":4},{"line":7}],"target_evidence":[{"line":7},{"line":12}]}]},{"source":"webshop-search-formulator","target":"webshop-product-selector","type":"compose_with","contexts":[{"scenario":"Initial search output feeds the later shortlist-selection step in the same e-commerce flow","explanation":"The search formulator produces the initial `search[keywords]` action string from parsed product attributes, which is the next operation needed to perform the platform search. The product selector then operates on the resulting search results page, reviewing a list of products and clicking the best product ID for detail-page verification.","conditions":["The agent is moving from query parsing to the first search, then to choosing among returned products.","The search string must carry the product-defining attributes that will make the results page contain candidates the selector can compare."],"source_evidence":[{"line":3},{"line":8},{"line":10},{"line":18}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":13}]},{"scenario":"After a search query is formulated, the selector can use the resulting results page to pick the best match","explanation":"The search formulator explicitly outputs a single concise search string, and the selector explicitly consumes a product list from the search results page. This makes them adjacent stages in the same shopping workflow: the search query creates the candidate set, and the selector ranks that set by feature keywords and price.","conditions":["The query was built from the key attributes of a parsed request.","The search results page contains multiple product entries with IDs, titles, and prices."],"source_evidence":[{"line":11},{"line":13},{"line":16},{"line":17}],"target_evidence":[{"line":3},{"line":13},{"line":15},{"line":18}]}]},{"source":"webshop-product-selector","target":"webshop-variant-chooser","type":"compose_with","contexts":[{"scenario":"Search results selection leads into variant choice on the opened product page","explanation":"The product-selector skill outputs a click on the chosen product ID that opens the product detail page; the variant-chooser skill then uses that detail-page state to parse multiple variant options and perform a click[value] selection next.","conditions":["A search results page has multiple products that meet the user's core requirements.","The selected product is opened on its detail page and that page contains multiple clickable variants."],"source_evidence":[{"line":18},{"line":7}],"target_evidence":[{"line":8},{"line":13}]}]},{"source":"webshop-product-selector","target":"webshop-variant-chooser","type":"similar_to","contexts":[{"scenario":"Adjacent webshop selection stages","explanation":"Both skills operate in the same webshop flow where a click action is used to choose an item on the current page: the product-selector chooses a product ID from a shortlist, and the variant-chooser chooses among clickable options on a detail page. They are adjacent stages of the same shopping task, with the first selecting the product and the second selecting the product configuration.","conditions":["The user is on a product detail page and the page exposes multiple clickable variants for the same product."],"source_evidence":[{"line":4},{"line":18}],"target_evidence":[{"line":3},{"line":13}]}]},{"source":"webshop-purchase-executor","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Checkout initiation before final purchase execution","explanation":"The executor assumes prior verification is complete and clicks the purchase button to finish the transaction; the initiator's workflow establishes exactly those pre-click conditions and then triggers click[buy now] to proceed to checkout. So the initiator can directly precede the executor as the verification-and-commit step before final purchase execution.","conditions":["A product detail page is already verified against requirements and a purchase button is present."],"source_evidence":[{"line":4},{"line":7},{"line":20},{"line":23},{"line":24},{"line":25},{"line":28}],"target_evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":17},{"line":24},{"line":25},{"line":29},{"line":30}]}]},{"source":"webshop-purchase-initiator","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Verified product purchase workflow","explanation":"The initiator performs the pre-click verification and then executes click[buy now] to proceed to checkout; the executor is the terminal step that performs the purchase click on a verified product. In a workflow where the initiator finishes the preconditions, the executor can immediately use that ready state to complete the transaction.","conditions":["A product has already been verified and the user intends to buy it on a product detail page."],"source_evidence":[{"line":4},{"line":7},{"line":20},{"line":23},{"line":24},{"line":25},{"line":28}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":17},{"line":25},{"line":29},{"line":30}]}]},{"source":"webshop-search-executor","target":"webshop-purchase-executor","type":"compose_with","contexts":[{"scenario":"Search results precede final purchase in a two-step WebShop shopping flow","explanation":"The search executor can produce the product result state used to evaluate candidates, and the purchase executor explicitly requires that prior verification has already happened on a product detail page before clicking the purchase button. In a shopping flow, search results are the upstream stage that can lead to selecting a product for later purchase, provided the selected item is then verified.","conditions":["A product has already been found on a product detail page and verified against the user's requirements before purchase."],"source_evidence":[{"line":6},{"line":7},{"line":12}],"target_evidence":[{"line":11},{"line":12},{"line":13},{"line":14},{"line":29}]},{"scenario":"Adjacent WebShop shopping workflow stages: finding candidates then finalizing a chosen product","explanation":"Both skills operate in the same WebShop shopping workflow and support adjacent stages: search returns product results for evaluation, while purchase completes the transaction after a product has been confirmed suitable. The search skill's output is a list of results for evaluation, which can then be used to choose a product that the purchase skill finalizes on its product page.","conditions":["The user is already on a WebShop search page and needs product discovery before purchase."],"source_evidence":[{"line":4},{"line":6},{"line":7},{"line":19},{"line":22}],"target_evidence":[{"line":8},{"line":17},{"line":20},{"line":24},{"line":25},{"line":30}]}]},{"source":"webshop-variant-chooser","target":"webshop-purchase-initiator","type":"compose_with","contexts":[{"scenario":"Variant selection can prepare the product state needed before purchase initiation","explanation":"The variant chooser first selects the appropriate product variant with click[value] after parsing available options and user constraints; the purchase initiator then uses the resulting selected product plus verified options/price/readiness to execute click[buy now] and proceed to checkout.","conditions":["The user is on a product detail page with multiple variant options and needs one chosen before later purchase steps."],"source_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}],"target_evidence":[{"line":14},{"line":15},{"line":16},{"line":17},{"line":20},{"line":23},{"line":24},{"line":25},{"line":26}]}]},{"source":"webshop-query-parser","target":"webshop-query-interpreter","type":"compose_with","contexts":[{"scenario":"Initial shopping query is parsed into criteria that support search-query formation","explanation":"The interpreter produces a structured set of search parameters and a recommended search string from the user's request, and the parser explicitly says to use the structured criteria to plan initial web search keywords. That means the parser can run first, then the interpreter can consume its structured criteria as input for search-query formulation in the same shopping workflow.","conditions":["A user has just issued a natural-language shopping request and the next step is to form a search query or search[action].","The extracted criteria are still being used to guide initial web search keywords, not direct purchasing."],"source_evidence":[{"line":11},{"line":17},{"line":22},{"line":31}],"target_evidence":[{"line":8},{"line":20},{"line":24},{"line":25}]}]},{"source":"webshop-query-interpreter","target":"webshop-query-parser","type":"similar_to","contexts":[{"scenario":"Both skills extract structured shopping criteria from a natural-language request","explanation":"Both skills explicitly do the same shopping-query-to-structured-criteria task: they extract product type, key attributes, and price constraints from a natural-language shopping instruction. They differ mainly in implementation detail and downstream handling, but their named scope overlaps closely on initial query parsing.","conditions":["A new shopping instruction has been received and needs to be reduced into structured criteria before search.","The downstream step is a search-oriented task that consumes extracted product type, attributes, price limits, and other specifications."],"source_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":13},{"line":17},{"line":20}],"target_evidence":[{"line":3},{"line":11},{"line":12},{"line":13},{"line":14},{"line":15}]}]},{"source":"webshop-result-analyzer","target":"webshop-query-interpreter","type":"compose_with","contexts":[{"scenario":"A shopping query is parsed into structured criteria, then the search-result analyzer consumes those criteria to score listings on product type, attributes, and budget.","explanation":"webshop-query-interpreter produces structured search parameters (product type, attributes, constraints, search query) and explicitly hands them off for subsequent product lookup; webshop-result-analyzer then uses the user's product requirements plus each listing's title/description and price to rank candidate products. In a workflow where search results are already visible, the interpreted criteria can be used next as the matching requirements for scoring and shortlist generation.","conditions":["The downstream step is run on a search result page with listings that expose title/description and price.","The query interpreter has already produced a structured product type, attributes, constraints, and search query."],"source_evidence":[{"line":3},{"line":7},{"line":16},{"line":18},{"line":19},{"line":20},{"line":22},{"line":24},{"line":25},{"line":26},{"line":27},{"line":28},{"line":13},{"line":17},{"line":20}],"target_evidence":[{"line":4},{"line":6},{"line":7},{"line":8},{"line":22},{"line":31}]}]},{"source":"webshop-query-interpreter","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Structured query parsing can precede result filtering in a webshop workflow.","explanation":"The query interpreter produces structured search parameters and a recommended search string that can be used to perform the product lookup next; the result filter then operates on a search results page to evaluate products against user constraints and choose the first match.","conditions":["A shopping query has already been interpreted into structured product type, attributes, and hard constraints.","A search results page lists candidate products with titles/prices/ratings for evaluation."],"source_evidence":[{"line":22},{"line":24},{"line":31}],"target_evidence":[{"line":13},{"line":23},{"line":25},{"line":30}]},{"scenario":"Structured constraints from query interpretation support result-page filtering.","explanation":"The interpreter supplies extracted constraints such as product type, features, and price limits; the filter consumes those constraints together with the observation of listed products to check each item and return the matching subset or primary candidate.","conditions":["A shopping query has already been interpreted into structured product type, attributes, and hard constraints.","A search results page lists candidate products with titles/prices/ratings for evaluation."],"source_evidence":[{"line":17},{"line":18},{"line":20},{"line":22}],"target_evidence":[{"line":16},{"line":17},{"line":18},{"line":23},{"line":25},{"line":30}]}]},{"source":"webshop-query-interpreter","target":"webshop-search-constructor","type":"compose_with","contexts":[{"scenario":"A user shopping request is first parsed into structured product criteria, then those criteria are used to build the initial e-commerce search action.","explanation":"webshop-query-interpreter provides structured product criteria and a recommended search query from a natural-language shopping instruction, and webshop-search-constructor consumes exactly that kind of structured criteria to construct the platform-ready search action search[<constructed_query>].","conditions":["The input is a new natural-language shopping instruction.","The interpreter has extracted product type, attributes, and hard constraints into a structured handoff.","The downstream task is constructing the initial search query/action for an e-commerce platform."],"source_evidence":[{"line":4},{"line":6},{"line":7},{"line":17},{"line":22},{"line":31}],"target_evidence":[{"line":6},{"line":9},{"line":10},{"line":11},{"line":21},{"line":22}]}]},{"source":"webshop-query-interpreter","target":"webshop-search-constructor","type":"similar_to","contexts":[{"scenario":"Both skills support the same e-commerce search preparation task, but at different stages: one parses the user's instruction, the other constructs the initial search query from parsed criteria.","explanation":"Both skills operate on the front end of e-commerce product search and explicitly work with product type, attributes, and price limits; they differ mainly in stage, with the interpreter producing structured criteria and the constructor turning structured criteria into a search action.","conditions":["Comparing their role in preparing an initial product search, not full search execution or purchasing.","The query interpreter must turn natural language into structured criteria first; the search constructor must then format those criteria into a search action."],"source_evidence":[{"line":4},{"line":5},{"line":7},{"line":17},{"line":22},{"line":31}],"target_evidence":[{"line":3},{"line":6},{"line":9},{"line":10},{"line":11},{"line":21},{"line":22}]}]},{"source":"webshop-query-interpreter","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"Parsing a shopping request into structured criteria that are then used to issue a WebShop search","explanation":"The interpreter first turns a user shopping request into structured search parameters and a recommended query, and then the search executor uses those structured terms to perform the actual `search[...]` action on the WebShop search page.","conditions":["A natural-language shopping instruction has been received","The interpreter produces product type, attributes, constraints, and a recommended search string","The executor is at the WebShop search page and expects structured search terms"],"source_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":17},{"line":20},{"line":22},{"line":31}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":12},{"line":19},{"line":22},{"line":33}]},{"scenario":"Handling a constrained product request such as a price-limited item search","explanation":"The interpreter preserves hard limits like price in the structured output, and the executor consumes those parsed search terms to run the search; its edge-case handling for empty or over-budget results also makes the parsed price constraint relevant to the next step.","conditions":["The request includes hard constraints such as price","The interpreter captures those constraints in the output","The executor can use the parsed terms to search and, if needed, adjust search terms for price-related failures"],"source_evidence":[{"line":20},{"line":22},{"line":24},{"line":27},{"line":31},{"line":37},{"line":43},{"line":58}],"target_evidence":[{"line":15},{"line":16},{"line":19},{"line":22},{"line":31},{"line":35},{"line":36}]}]},{"source":"webshop-query-interpreter","target":"webshop-search-formulator","type":"compose_with","contexts":[{"scenario":"Parsed shopping criteria can feed initial search-string formulation","explanation":"The query interpreter produces structured product criteria and a suggested search query, which the search formulator can use immediately to generate the initial `search[keywords]` string. The formulator explicitly consumes parsed product attributes and excludes price ranges from the keyword string, matching the interpreter's output shape when the structured query includes product type, attributes, and constraints.","conditions":["The interpreter has already reduced a natural-language shopping request into product type, attributes, constraints, and a recommended search query.","The formulator is used next to turn structured criteria into a single platform-appropriate `search[keywords]` action string.","The price constraint is available for interpretation but omitted from the initial keyword string when it is a post-search filter."],"source_evidence":[{"line":4},{"line":6},{"line":7},{"line":22},{"line":24},{"line":25},{"line":31}],"target_evidence":[{"line":8},{"line":11},{"line":13},{"line":19},{"line":24},{"line":25}]},{"scenario":"Formulated search-string stage follows parsed-query input from the interpreter","explanation":"The formulator's input is a parsed query containing structured product attributes and a price limit, and its workflow turns those attributes into a single search action string. The interpreter's completed output is exactly a structured set of product type, attributes, constraints, and a recommended search query, so it can support the next-step search formulation on the same webshop task path.","conditions":["The search formulator runs after query parsing and expects a parsed query with structured attributes.","The interpreter's after-state supplies that parsed structure and recommended search query.","The formulator uses those attributes next to select the most distinguishing terms for a concise initial search."],"source_evidence":[{"line":4},{"line":7},{"line":17},{"line":22},{"line":24},{"line":25},{"line":31}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":12},{"line":13},{"line":16},{"line":19},{"line":24},{"line":25}]}]},{"source":"webshop-query-parser","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"query parsing precedes result analysis in a shopping workflow","explanation":"The query parser produces structured search criteria from the user's instruction and keeps them in memory to guide later `search[keywords]` and product evaluation. The result analyzer then uses the user's product requirements, plus listing titles/prices/descriptions, to score and prioritize candidates. So the parser can run first and supply the criteria the analyzer consumes next.","conditions":["A new shopping instruction has already been parsed into structured criteria","The next step is observing a search results page and ranking listings"],"source_evidence":[{"line":3},{"line":8},{"line":11},{"line":14},{"line":24},{"line":25}],"target_evidence":[{"line":7},{"line":9},{"line":16},{"line":23},{"line":25}]}]},{"source":"webshop-query-parser","target":"webshop-search-constructor","type":"compose_with","contexts":[{"scenario":"Initial shopping request flows from parsing into search construction","explanation":"The parser runs first and turns the user's natural-language shopping request into structured criteria held in memory, which the search constructor then consumes as discrete product criteria to build the initial `search[...]` action.","conditions":["A new shopping instruction has already been received and the query parser has produced structured criteria."],"source_evidence":[{"line":3},{"line":8},{"line":11},{"line":24},{"line":25}],"target_evidence":[{"line":6},{"line":9},{"line":10},{"line":11},{"line":22},{"line":23}]}]},{"source":"webshop-query-parser","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"Initial query parsing feeds the first WebShop search","explanation":"The parser runs first and turns the natural-language shopping request into structured criteria, which the search executor then uses to choose the search keywords for `search[...]` on the WebShop page. This is a concrete handoff from parsed criteria to search execution in the same shopping workflow.","conditions":["A new shopping instruction has arrived and no search or click actions have been performed yet.","The search executor is about to form the initial WebShop search keywords.","The query parser has already extracted product type, attributes, and price constraints into structured criteria."],"source_evidence":[{"line":8},{"line":11},{"line":14},{"line":24},{"line":25}],"target_evidence":[{"line":5},{"line":6},{"line":7},{"line":12},{"line":22},{"line":33}]}]},{"source":"webshop-query-parser","target":"webshop-search-formulator","type":"compose_with","contexts":[{"scenario":"Initial parsing result feeds initial search formulation","explanation":"The parser produces structured criteria including product type, key attributes, and price constraints, then keeps them in memory to guide subsequent search keyword formation. The formulator's next operation is to receive a parsed query and turn it into a single `search[keywords]` string, excluding price filters from the initial keyword string. That makes the parser a valid upstream producer for the formulator in the initial search workflow.","conditions":["A shopping instruction has just been received","The parser has already converted it into structured criteria","The next step is to produce the first `search[keywords]` action"],"source_evidence":[{"line":11},{"line":14},{"line":24},{"line":25}],"target_evidence":[{"line":11},{"line":13}]}]},{"source":"webshop-query-parser","target":"webshop-search-formulator","type":"similar_to","contexts":[{"scenario":"Shared initial search-task interface for parsed shopping requests","explanation":"Both skills explicitly participate in the same initial shopping-search workflow: the parser extracts structured product requirements from the user's query, and the formulator uses a parsed request to generate an initial concise `search[keywords]` action. They are complementary adjacent stages over the same task entities, though the parser focuses on extraction and the formulator on keyword construction with different formatting constraints.","conditions":["The agent is building the first e-commerce search query from a user shopping request","Both skills operate on the same parsed shopping criteria","The comparison is about the initial search-formulation stage, not later browsing or filtering"],"source_evidence":[{"line":3},{"line":11},{"line":20},{"line":24},{"line":25}],"target_evidence":[{"line":8},{"line":11},{"line":16},{"line":19}]}]},{"source":"webshop-result-analyzer","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Search-result product screening before choosing a candidate listing","explanation":"The filter skill first parses constraints and selects the first product that passes all criteria, producing a primary candidate for click[product_id]. The analyzer consumes the same kind of search-result listings plus user requirements, then scores and prioritizes candidates into a shortlist for further inspection. In a workflow where screening should precede deeper analysis, the filter's selected candidate subset can support the analyzer's next inspection step on the same page.","conditions":["Both skills are used on a webshop search results page with multiple product listings.","The user has explicit constraints such as product type, attributes, and price.","A downstream step needs a product ID or shortlist from the page."],"source_evidence":[{"line":7},{"line":10},{"line":16},{"line":19},{"line":23},{"line":25}],"target_evidence":[{"line":13},{"line":16},{"line":23},{"line":25},{"line":30}]},{"scenario":"Using a ranked shortlist to narrow or validate filtered webshop candidates","explanation":"The analyzer extracts product data, compares it to requirements, and outputs a prioritized list of candidate Product IDs or links. The filter skill also evaluates search-result products against explicit constraints and outputs the first product meeting all criteria for closer inspection. Because both work over the same webshop result-page entities and one produces a ranked candidate set that the other can apply its stricter pass/fail filter to next, they can be composed in the reverse direction as well.","conditions":["Both skills operate on the same search results page and use product IDs, titles, prices, and brief descriptions.","The analyzer has already produced a prioritized candidate list ordered by match score.","A later filtering/selection step can use that prioritized list to focus on the best-matching products."],"source_evidence":[{"line":13},{"line":16},{"line":19},{"line":20},{"line":23},{"line":25}],"target_evidence":[{"line":3},{"line":7},{"line":16},{"line":23},{"line":25},{"line":30}]}]},{"source":"webshop-result-analyzer","target":"webshop-result-page-navigator","type":"compose_with","contexts":[{"scenario":"Analyzer results can drive whether page navigation is needed next","explanation":"The analyzer's output is a prioritized candidate list after scoring the listings on a search results page; if no suitable item is found on the current page, the navigator can advance to the next page so the analyzer can run again on the newly loaded listings. The navigator therefore supplies the next results-page state that the analyzer consumes next.","conditions":["The current page has been reviewed and found not to contain a suitable match.","A pagination control is available to move to another results page.","The goal remains evaluating WebShop product listings against the user's criteria."],"source_evidence":[{"line":3},{"line":7},{"line":25},{"line":28}],"target_evidence":[{"line":8},{"line":11},{"line":12},{"line":13},{"line":15}]}]},{"source":"webshop-result-page-navigator","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"Navigator precedes analyzer on additional pages of the same search flow","explanation":"The navigator first changes the WebShop page state by clicking pagination controls, and its post-action state is that the agent resumes evaluating newly loaded product listings. That newly loaded results page is the same kind of input the analyzer requires: a visible search result page with product listings to extract IDs, titles, prices, and descriptions for matching and ranking.","conditions":["The current WebShop results page has already been reviewed and no item satisfies the user's requirements.","A next or previous pagination control is available.","After clicking, a new results page loads for continued evaluation."],"source_evidence":[{"line":8},{"line":13},{"line":14},{"line":15}],"target_evidence":[{"line":7},{"line":16},{"line":19},{"line":23},{"line":25}]}]},{"source":"webshop-search-executor","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"Search results from WebShop are passed into listing analysis","explanation":"The search executor produces the result page/listings that the analyzer consumes next as its input material for requirement matching and ranking. The executor explicitly returns a list of product results, and the analyzer is triggered on a search result page to extract IDs, titles, prices, and descriptions into a prioritized shortlist.","conditions":["A WebShop search has been executed and returned a results page with product listings.","The analyzer receives the observed user requirements plus listing fields such as product ID, title, price, and description."],"source_evidence":[{"line":6},{"line":7},{"line":36}],"target_evidence":[{"line":7},{"line":16},{"line":17},{"line":18},{"line":19},{"line":20},{"line":23},{"line":25}]},{"scenario":"WebShop search action precedes result ranking","explanation":"This is the adjacent handoff where the executor's search action yields the search-result page, and the analyzer is designed to start from that visible results page to score candidate products. The executor therefore precedes the analyzer in the reusable path from search to shortlist.","conditions":["The search step is performed on a WebShop search page with a search bar.","The returned results are the same search-result observation that the analyzer expects for parsing and scoring."],"source_evidence":[{"line":4},{"line":5},{"line":6},{"line":22},{"line":33},{"line":36}],"target_evidence":[{"line":3},{"line":7},{"line":10},{"line":16},{"line":23},{"line":28}]}]},{"source":"webshop-search-formulator","target":"webshop-result-analyzer","type":"compose_with","contexts":[{"scenario":"Initial product search followed by result-page analysis","explanation":"The search formulator takes a parsed query with product attributes and outputs a single `search[keywords]` action string, which is exactly the kind of initial query that precedes the analyzer’s later inspection of search results. The analyzer then expects a search result page with product listings and parsed user requirements, so the formulator’s output is the upstream step that creates the search-results state the analyzer consumes next.","conditions":["An agent has already parsed a product request and needs to run the first marketplace search."],"source_evidence":[{"line":3},{"line":11},{"line":13},{"line":24}],"target_evidence":[{"line":7},{"line":10},{"line":16},{"line":25}]}]},{"source":"webshop-result-filter","target":"webshop-result-page-navigator","type":"compose_with","contexts":[{"scenario":"Paging after an unsuccessful filter pass on the current results page","explanation":"webshop-result-filter ends by selecting the first product that passes all criteria, and if none pass it explicitly invokes click[Next >] or search[refined keywords]. webshop-result-page-navigator then takes over on the same reviewed results page to click next and load the subsequent page, after which evaluation of product listings resumes.","conditions":["The current page has been reviewed and no listed product meets all extracted constraints.","A next-page control is available."],"source_evidence":[{"line":30},{"line":31},{"line":32}],"target_evidence":[{"line":11},{"line":13},{"line":15}]},{"scenario":"Returning to the previous results page during continued product evaluation","explanation":"webshop-result-filter first parses the search results page and evaluates all products against constraints before choosing a candidate. If the needed match is not on the current page, webshop-result-page-navigator can click < prev to load the previous page and then continue evaluating the newly loaded listings, preserving the same product-search workflow.","conditions":["The current page has already been reviewed.","A previous-page control is available and the workflow needs to inspect earlier results."],"source_evidence":[{"line":23},{"line":25},{"line":30}],"target_evidence":[{"line":12},{"line":14},{"line":15}]}]},{"source":"webshop-search-executor","target":"webshop-result-filter","type":"compose_with","contexts":[{"scenario":"Search results from WebShop are produced, then filtered against the same request","explanation":"The search executor runs first by turning parsed keywords into a WebShop `search[...]` action and returning product results; the result filter can then take that search-results page and evaluate the returned listings against the user’s constraints to choose candidates for inspection.","conditions":["A user has specific product attributes to find, and the WebShop search page is available."],"source_evidence":[{"line":4},{"line":6},{"line":7}],"target_evidence":[{"line":13},{"line":23},{"line":30}]},{"scenario":"Returned product list is consumed by result filtering","explanation":"The executor’s output is a list of product results, which is the exact observation the filter skill expects on a search results page before checking each product against all extracted constraints.","conditions":["The search step has already produced a product list with listing details."],"source_evidence":[{"line":7}],"target_evidence":[{"line":7},{"line":25},{"line":30}]}]},{"source":"webshop-result-filter","target":"webshop-search-executor","type":"similar_to","contexts":[{"scenario":"Shared WebShop product-finding workflow","explanation":"Both skills explicitly support the same user intent of finding a product with specific attributes on WebShop: one performs the search action to retrieve results, while the other filters those results by the user’s constraints before selection.","conditions":["Both skills operate in the WebShop shopping flow on the same search-results task."],"source_evidence":[{"line":4},{"line":13},{"line":25},{"line":30}],"target_evidence":[{"line":4},{"line":12},{"line":19},{"line":22}]}]},{"source":"webshop-search-constructor","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"Initial product search flow on WebShop","explanation":"The constructor turns parsed product criteria into the required `search[<query>]` action, which the executor accepts as its actual WebShop search action when the user wants to find a product with specific attributes on the search page.","conditions":["The task is to find a product on WebShop and the search page is available."],"source_evidence":[{"line":6},{"line":9},{"line":10},{"line":11},{"line":21},{"line":23}],"target_evidence":[{"line":4},{"line":12},{"line":19},{"line":22},{"line":33},{"line":36}]}]},{"source":"webshop-search-constructor","target":"webshop-search-formulator","type":"compose_with","contexts":[{"scenario":"Initial e-commerce search action generation","explanation":"The constructor skill first turns parsed product criteria into a formatted `search[<query>]` action using its bundled script, and the formulator skill similarly takes parsed product attributes and emits a single `search[keywords]` action. Because the constructor's output is already a platform-ready initial search action, it can directly satisfy the formulator's same-stage initial search output requirement in scenarios where the formulator is being used as the downstream search-action generator, with the constructor providing the constructed query/action shape next.","conditions":["A structured product request is ready to be turned into the platform's first search action."],"source_evidence":[{"line":9},{"line":10},{"line":11},{"line":18},{"line":23}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":13},{"line":24}]}]},{"source":"webshop-search-constructor","target":"webshop-search-formulator","type":"similar_to","contexts":[{"scenario":"Initial product search formulation from parsed criteria","explanation":"Both skills explicitly cover the same reusable task of converting parsed product requirements into an initial `search[keywords]` action for an e-commerce platform. The constructor emphasizes receiving structured criteria and outputting `search[<constructed_query>]`, while the formulator emphasizes analyzing parsed attributes to generate a single well-formatted `search[keywords]` action, with similar constraints about selecting distinguishing attributes and keeping the query concise.","conditions":["The task is to produce the first e-commerce search query from parsed criteria, not to perform later refinement."],"source_evidence":[{"line":3},{"line":6},{"line":9},{"line":11},{"line":21},{"line":23}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":12},{"line":13},{"line":16},{"line":17},{"line":24}]}]},{"source":"webshop-search-formulator","target":"webshop-search-executor","type":"compose_with","contexts":[{"scenario":"Initial keyword formulation feeding WebShop search execution","explanation":"The formulator turns a parsed product request into a single `search[keywords]` string, which the executor is designed to take as structured search terms and run on the WebShop interface next.","conditions":["Use the formulator to create the first WebShop search query from parsed product criteria before the search is executed."],"source_evidence":[{"line":3},{"line":11},{"line":13}],"target_evidence":[{"line":4},{"line":5},{"line":6},{"line":7},{"line":12}]}]},{"source":"webshop-search-executor","target":"webshop-search-formulator","type":"similar_to","contexts":[{"scenario":"Comparable initial product search capability","explanation":"Both skills explicitly handle the initial product-search step: the formulator creates a concise `search[keywords]` action from parsed attributes, and the executor performs the WebShop search action from those structured terms on the search page.","conditions":["Both skills are used in an initial e-commerce product search flow that starts from parsed attributes and ends with a platform search action."],"source_evidence":[{"line":4},{"line":6},{"line":12},{"line":19},{"line":22},{"line":33},{"line":36}],"target_evidence":[{"line":3},{"line":8},{"line":11},{"line":13},{"line":16},{"line":19}]}]}]}
diff --git a/frontend/scripts/build_catalog.mjs b/frontend/scripts/build_catalog.mjs
deleted file mode 100644
index 439b258..0000000
--- a/frontend/scripts/build_catalog.mjs
+++ /dev/null
@@ -1,42 +0,0 @@
-import { readFile, readdir, writeFile } from 'node:fs/promises'
-import { dirname, join, resolve } from 'node:path'
-import { fileURLToPath } from 'node:url'
-
-const frontend = resolve(dirname(fileURLToPath(import.meta.url)), '..')
-const dataDirectory = join(frontend, 'public', 'data')
-const repository = JSON.parse(await readFile(join(frontend, 'src', 'demo.json'), 'utf8'))
-const matchingCollection = skill => {
- const matches = repository.skills.filter(item => item.skillId === skill.skill_id && item.source.replaceAll('\r\n', '\n') === skill.source.replaceAll('\r\n', '\n'))
- if (matches.length === 1) return matches[0].collection
- const byPath = matches.filter(item => typeof skill.path === 'string' && skill.path.replaceAll('\\', '/').endsWith(item.path))
- return byPath.length === 1 ? byPath[0].collection : undefined
-}
-const collectionSizes = new Map()
-for (const skill of repository.skills) {
- collectionSizes.set(skill.collection, (collectionSizes.get(skill.collection) ?? 0) + 1)
-}
-
-const snapshots = []
-for (const file of (await readdir(dataDirectory)).filter(name => name.endsWith('.json') && name !== 'catalog.json').sort()) {
- const value = JSON.parse(await readFile(join(dataDirectory, file), 'utf8'))
- if (value.schema_version !== 1 || !Array.isArray(value.skills) || !Array.isArray(value.relations) || value.skills.length === 0) {
- throw new Error(`${file} is not a GraphSnapshot v1 file`)
- }
- const collections = new Set(value.skills.map(matchingCollection))
- const collection = collections.size === 1 ? [...collections][0] : undefined
- const name = collection || file.replace(/\.json$/i, '').replaceAll('-', ' ')
- const total = collection ? collectionSizes.get(collection) : undefined
- snapshots.push({
- id: `analysis:${file}`,
- file,
- title: `${name} · Analysis results`,
- label: `${name} (${value.skills.length}${total ? `/${total}` : ''})`,
- collection: collection ?? null,
- skillCount: value.skills.length,
- librarySkillCount: total ?? null,
- })
-}
-
-const output = join(frontend, 'src', 'catalog.json')
-await writeFile(output, `${JSON.stringify({ snapshots }, null, 2)}\n`, 'utf8')
-process.stdout.write(`Cataloged ${snapshots.length} analysis files in ${output}\n`)
diff --git a/frontend/scripts/build_demo.py b/frontend/scripts/build_demo.py
deleted file mode 100644
index 784add3..0000000
--- a/frontend/scripts/build_demo.py
+++ /dev/null
@@ -1,76 +0,0 @@
-"""Build a read-only local dataset from this repository's SKILL.md files.
-
-Edges are *literal document references*. They are never labelled as analyze output.
-"""
-
-from __future__ import annotations
-
-import json
-import re
-from pathlib import Path
-
-
-ROOT = Path(__file__).resolve().parents[2]
-EXPERIMENT_SKILLS = ROOT / "experiments" / "src" / "skills"
-COLLECTION_LABELS = {"webshop": "WebShop", "scienceworld": "ScienceWorld", "alfworld": "ALFWorld"}
-OUTPUT = Path(__file__).resolve().parents[1] / "src" / "demo.json"
-
-
-def description(source: str) -> str:
- match = re.search(r"^description:\s*>-?\s*\n((?:[ \t]+.*\n)+)", source, re.M)
- if match:
- return " ".join(line.strip() for line in match.group(1).splitlines())
- match = re.search(r"^description:\s*(.+)$", source, re.M)
- return match.group(1).strip(" '\"") if match else ""
-
-
-def main() -> None:
- directories = [
- (COLLECTION_LABELS.get(directory.name, directory.name.replace("_", " ").title()), directory)
- for directory in sorted(EXPERIMENT_SKILLS.iterdir()) if directory.is_dir()
- ]
- directories.append(("SkillNet", ROOT / "skills"))
- paths = [(collection, path) for collection, directory in directories for path in sorted(directory.glob("*/SKILL.md"))]
- ids_by_collection = {
- collection: {path.parent.name for current, path in paths if current == collection}
- for collection, _ in directories
- }
- skills = []
- references = []
- for collection, path in paths:
- source = path.read_text(encoding="utf-8-sig")
- skill_id = path.parent.name
- key = f"{collection}::{skill_id}"
- name = re.search(r"^name:\s*(.+)$", source, re.M)
- skills.append({
- "id": key,
- "skillId": skill_id,
- "name": name.group(1).strip(" '\"") if name else skill_id,
- "description": description(source),
- "collection": collection,
- "source": source,
- "path": str(path.relative_to(ROOT)).replace("\\", "/"),
- })
- reference_ids = sorted((item for item in ids_by_collection[collection] if "-" in item), key=len, reverse=True)
- reference_pattern = re.compile(r"(?<![a-zA-Z0-9-])(?:" + "|".join(map(re.escape, reference_ids)) + r")(?![a-zA-Z0-9-])") if reference_ids else None
- seen = set()
- for line_number, line in enumerate(source.splitlines(), 1):
- for target in reference_pattern.findall(line) if reference_pattern else ():
- if target in ids_by_collection[collection] and target != skill_id and target not in seen:
- seen.add(target)
- references.append({
- "source": key,
- "target": f"{collection}::{target}",
- "type": "source_reference",
- "line": line_number,
- "excerpt": line.strip(),
- })
- OUTPUT.write_text(
- json.dumps({"skills": skills, "references": references}, ensure_ascii=False, indent=2) + "\n",
- encoding="utf-8",
- )
- print(f"Wrote {len(skills)} source skills and {len(references)} explicit references to {OUTPUT}")
-
-
-if __name__ == "__main__":
- main()
diff --git a/frontend/scripts/bundle_analysis.py b/frontend/scripts/bundle_analysis.py
deleted file mode 100644
index 5bae874..0000000
--- a/frontend/scripts/bundle_analysis.py
+++ /dev/null
@@ -1,61 +0,0 @@
-"""Bundle a local analysis graph without machine paths or service endpoints.
-
-Usage: python scripts/bundle_analysis.py COLLECTION PATH/TO/graph.json
-"""
-
-from __future__ import annotations
-
-import json
-import re
-import sys
-from pathlib import Path
-
-
-ROOT = Path(__file__).resolve().parents[2]
-OUTPUT_DIR = Path(__file__).resolve().parents[1] / "public" / "data"
-SKILLS_DIR = ROOT / "experiments" / "src" / "skills"
-def main() -> None:
- if len(sys.argv) != 3 or not re.fullmatch(r"[a-z][a-z0-9_-]*", sys.argv[1]):
- raise SystemExit("usage: python scripts/bundle_analysis.py COLLECTION PATH/TO/graph.json")
- collection, graph_path = sys.argv[1:]
- skills_dir = SKILLS_DIR / collection
- if not skills_dir.is_dir():
- raise ValueError(f"Unknown collection: {collection}")
- output = OUTPUT_DIR / f"{collection}-analysis.json"
- snapshot = json.loads(Path(graph_path).read_text(encoding="utf-8"))
- if snapshot.get("schema_version") != 1:
- raise ValueError("Expected GraphSnapshot schema_version 1")
-
- skills = []
- for item in snapshot["skills"]:
- skill_id = item["skill_id"]
- if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9_-]*", skill_id):
- raise ValueError(f"Invalid skill ID: {skill_id}")
- source_path = skills_dir / skill_id / "SKILL.md"
- if not source_path.is_file() or source_path.read_text(encoding="utf-8-sig").replace("\r\n", "\n") != item["source"].replace("\r\n", "\n"):
- raise ValueError(f"Snapshot source differs from the repository: {skill_id}")
- skills.append({
- "skill_id": skill_id,
- "name": item["name"],
- "path": str(source_path.relative_to(ROOT)).replace("\\", "/"),
- "source": item["source"],
- "profile": item["profile"],
- })
-
- relations = []
- for item in snapshot["relations"]:
- if item["type"] not in ("compose_with", "similar_to"):
- raise ValueError(f"Unsupported relation type: {item['type']}")
- relations.append({key: item[key] for key in ("source", "target", "type", "contexts")})
-
- output.parent.mkdir(parents=True, exist_ok=True)
- output.write_text(json.dumps({
- "schema_version": 1,
- "skills": skills,
- "relations": relations,
- }, ensure_ascii=False, separators=(",", ":")) + "\n", encoding="utf-8")
- print(f"Wrote {len(skills)} skills and {len(relations)} relations to {output}")
-
-
-if __name__ == "__main__":
- main()
diff --git a/frontend/scripts/bundle_evaluations.py b/frontend/scripts/bundle_evaluations.py
deleted file mode 100644
index 3506abe..0000000
--- a/frontend/scripts/bundle_evaluations.py
+++ /dev/null
@@ -1,39 +0,0 @@
-"""Copy completed SDK evaluation reports into the read-only frontend."""
-
-from __future__ import annotations
-
-import json
-from pathlib import Path
-
-
-FRONTEND = Path(__file__).resolve().parents[1]
-SOURCE = FRONTEND / "data" / "evaluations"
-OUTPUT = FRONTEND / "src" / "evaluations.json"
-DIMENSIONS = ("safety", "completeness", "executability", "maintainability", "cost_awareness")
-
-
-def main() -> None:
- records = {}
- for path in sorted(SOURCE.glob("*.json")):
- skill_id = path.stem
- result = json.loads(path.read_text(encoding="utf-8"))
- if result.get("status") != "ok":
- continue
- report = result["report"]
- for dimension in DIMENSIONS:
- if report[dimension]["level"] not in {"Good", "Average", "Poor"} or not report[dimension]["reason"]:
- raise ValueError(f"Invalid {dimension} report: {skill_id}")
- records[skill_id] = {
- "dimensions": {dimension: report[dimension] for dimension in DIMENSIONS},
- "injectionScan": {
- "clean": report["prompt_injection_scan"]["clean"],
- "complete": report["prompt_injection_scan"]["complete"],
- "count": report["prompt_injection_scan"]["count"],
- },
- }
- OUTPUT.write_text(json.dumps(records, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
- print(f"Wrote {len(records)} evaluation reports to {OUTPUT}")
-
-
-if __name__ == "__main__":
- main()
diff --git a/frontend/scripts/local_api.d.mts b/frontend/scripts/local_api.d.mts
deleted file mode 100644
index 6d18801..0000000
--- a/frontend/scripts/local_api.d.mts
+++ /dev/null
@@ -1,3 +0,0 @@
-import type { Plugin } from 'vite'
-
-export declare function localLibraryApi(): Plugin
diff --git a/frontend/scripts/local_api.mjs b/frontend/scripts/local_api.mjs
deleted file mode 100644
index 9e09bf9..0000000
--- a/frontend/scripts/local_api.mjs
+++ /dev/null
@@ -1,129 +0,0 @@
-import { mkdir, readFile, readdir, realpath, stat } from 'node:fs/promises'
-import { homedir } from 'node:os'
-import { basename, isAbsolute, join } from 'node:path'
-
-const maxGraphBytes = 20 * 1024 * 1024
-const maxSourceBytes = 20 * 1024 * 1024
-
-function fail(message, status = 400) {
- const error = new Error(message)
- error.status = status
- throw error
-}
-
-function sourceDescription(source) {
- const folded = source.match(/^description:\s*>-?\s*\n((?:[ \t]+.*\n)+)/m)
- if (folded) return folded[1].trim().split('\n').map(line => line.trim()).join(' ')
- return source.match(/^description:\s*(.+)$/m)?.[1].trim().replace(/^['"]|['"]$/g, '') ?? ''
-}
-
-async function skillSources(sourcePath) {
- if (typeof sourcePath !== 'string' || !isAbsolute(sourcePath)) fail('Enter an absolute path to the skills folder.')
- let root
- try { root = await realpath(sourcePath) } catch { fail('The skills folder does not exist or cannot be read.') }
- const entries = (await readdir(root, { withFileTypes: true })).filter(item => item.isDirectory() && !item.name.startsWith('.'))
- if (entries.length > 5000) fail('This app can read up to 5,000 skills.')
- const skills = []
- let totalBytes = 0
- for (const entry of entries) {
- const path = join(root, entry.name, 'SKILL.md')
- let source
- try { source = (await readFile(path, 'utf8')).replace(/^\uFEFF/, '').replaceAll('\r\n', '\n') } catch (error) {
- if (error.code === 'ENOENT') continue
- throw error
- }
- totalBytes += Buffer.byteLength(source)
- if (totalBytes > maxSourceBytes) fail('Skill source files exceed 20 MB. Choose a smaller library.')
- if (!source.trim()) continue
- skills.push({
- id: entry.name,
- name: source.match(/^name:\s*(.+)$/m)?.[1].trim().replace(/^['"]|['"]$/g, '') ?? entry.name,
- description: sourceDescription(source),
- source,
- path: `${basename(root)}/${entry.name}/SKILL.md`,
- })
- }
- skills.sort((a, b) => a.id.localeCompare(b.id))
- const ids = new Set(skills.map(skill => skill.id))
- const references = []
- const alternatives = [...ids].filter(id => id.includes('-')).sort((a, b) => b.length - a.length).map(id => id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
- const referencePattern = alternatives.length ? new RegExp(`(^|[^a-zA-Z0-9-])(${alternatives.join('|')})(?![a-zA-Z0-9-])`, 'g') : null
- for (const skill of skills) {
- const seen = new Set()
- skill.source.split('\n').forEach((line, index) => {
- for (const match of referencePattern ? line.matchAll(referencePattern) : []) {
- const target = match[2]
- if (target === skill.id || seen.has(target)) continue
- seen.add(target)
- references.push({ id: `reference-${references.length}`, source: skill.id, target, type: 'source_reference',
- contexts: [{ scenario: 'Explicit document reference', explanation: line.trim(), conditions: [], sourceEvidence: [{ skillId: skill.id, line: index + 1 }], targetEvidence: [] }] })
- }
- })
- }
- return { root, source: { kind: 'demo', title: basename(root), skills, relations: references } }
-}
-
-async function currentGraph(sourceRoot, indexPath) {
- if (indexPath != null && (typeof indexPath !== 'string' || !isAbsolute(indexPath))) fail('The analysis folder path must be absolute.')
- const root = indexPath || join(sourceRoot, '.skillnet')
- let pointer
- try { pointer = (await readFile(join(root, 'CURRENT'), 'utf8')).trim() } catch (error) {
- if (!indexPath && error.code === 'ENOENT') return null
- fail('CURRENT was not found in the analysis folder.')
- }
- if (!/^snapshot-[A-Za-z0-9_-]+$/.test(pointer)) fail('CURRENT in the analysis folder is invalid.')
- const graphPath = join(root, pointer, 'graph.json')
- let size
- try { size = (await stat(graphPath)).size } catch { fail('The current analysis snapshot has no graph.json.') }
- if (size > maxGraphBytes) fail('The analysis snapshot exceeds 20 MB. Import a smaller file.')
- let graph
- try { graph = JSON.parse(await readFile(graphPath, 'utf8')) } catch { fail('The current graph.json is not valid JSON.') }
- if (graph?.schema_version !== 1 || !Array.isArray(graph.skills) || !Array.isArray(graph.relations)) fail('The current graph.json is not GraphSnapshot v1.')
- return graph
-}
-
-async function payload(input) {
- if (input?.action === 'create-default') {
- const sourcePath = join(homedir(), '.skillnet', 'skills')
- await mkdir(sourcePath, { recursive: true })
- return { sourcePath: await realpath(sourcePath) }
- }
- const { root, source } = await skillSources(input.sourcePath)
- const graph = await currentGraph(root, input.indexPath)
- const current = new Map(source.skills.map(skill => [skill.id, skill.source.replaceAll('\r\n', '\n')]))
- if (graph && !graph.skills.some(skill => current.has(skill.skill_id))) fail('The analysis folder and skill library have no skills in common. Check the paths.')
- const changedSkills = graph?.skills.filter(skill => current.has(skill.skill_id) && current.get(skill.skill_id) !== skill.source.replaceAll('\r\n', '\n')).length ?? 0
- const removedSkills = graph?.skills.filter(skill => !current.has(skill.skill_id)).length ?? 0
- return { name: source.title, source, graph, changedSkills, removedSkills }
-}
-
-function localMiddleware(req, res, next) {
- if (req.url?.split('?')[0] !== '/api/local-library') return next()
- const host = req.headers.host ?? ''
- const origin = req.headers.origin ?? ''
- if (req.method !== 'POST' || req.headers['content-type']?.split(';')[0] !== 'application/json' || origin !== `http://${host}` || !/^127\.0\.0\.1(?::\d+)?$|^localhost(?::\d+)?$/.test(host)) {
- res.writeHead(403).end()
- return
- }
- let body = ''
- req.on('data', chunk => {
- body += chunk
- if (body.length > 4096) req.destroy()
- })
- req.on('end', async () => {
- try {
- const result = await payload(JSON.parse(body))
- res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-store' }).end(JSON.stringify(result))
- } catch (error) {
- res.writeHead(error.status ?? 400, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-store' }).end(JSON.stringify({ error: error.message || 'Could not read the local skill library.' }))
- }
- })
-}
-
-export function localLibraryApi() {
- return {
- name: 'skillnet-local-library',
- configureServer(server) { server.middlewares.use(localMiddleware) },
- configurePreviewServer(server) { server.middlewares.use(localMiddleware) },
- }
-}
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
deleted file mode 100644
index 050fc37..0000000
--- a/frontend/src/App.tsx
+++ /dev/null
@@ -1,649 +0,0 @@
-import { useEffect, useMemo, useRef, useState } from 'react'
-import { ArrowDownRight, ArrowRight, CircleHelp, FileText, GitBranch, Search, Upload, X } from 'lucide-react'
-import { demoDataset, parseSnapshot, relationLabel, skillShortName } from './data'
-import type { Dataset, Evidence, Relation, Skill } from './data'
-import catalogJson from './catalog.json'
-import { clearImport, loadImports, loadLocalLibraries, loadView, removeLocalLibrary, saveImport, saveLocalLibrary, saveView } from './persistence'
-import { createDefaultLibrary, readLocalLibrary } from './localLibrary'
-import type { LocalLibrary, LocalLibraryData } from './localLibrary'
-import evaluationsJson from './evaluations.json'
-import { GraphView } from './GraphView'
-import './styles.css'
-
-function compactNumber(value: number) {
- return new Intl.NumberFormat('en-US').format(value)
-}
-
-function comparableLocalPath(value: string) {
- const path = value.replaceAll('\\', '/').replace(/\/+$/, '')
- return /^[a-zA-Z]:|^\/\//.test(path) ? path.toLowerCase() : path
-}
-
-interface BundledAnalysis { id: string; file: string; title: string; label: string; collection: string | null; skillCount: number; librarySkillCount: number | null }
-const bundledAnalyses = catalogJson.snapshots as BundledAnalysis[]
-const emptyPersonalDataset: Dataset = { kind: 'demo', title: 'My skill library', skills: [], relations: [] }
-type EvaluationLevel = 'Good' | 'Average' | 'Poor'
-type EvaluationDimension = 'safety' | 'completeness' | 'executability' | 'maintainability' | 'cost_awareness'
-interface EvaluationReport {
- dimensions: Record<EvaluationDimension, { level: EvaluationLevel; reason: string }>
- injectionScan: { clean: boolean; complete: boolean; count: number }
-}
-const evaluations = evaluationsJson as Record<string, EvaluationReport>
-const evaluationDimensions: Array<[EvaluationDimension, string]> = [
- ['safety', 'Safety'], ['completeness', 'Completeness'], ['executability', 'Executability'],
- ['maintainability', 'Maintainability'], ['cost_awareness', 'Cost awareness'],
-]
-const evaluationLevels: Record<EvaluationLevel, string> = { Good: 'Good', Average: 'Average', Poor: 'Poor' }
-
-function evaluationFor(skill: Skill): EvaluationReport | null {
- const skillId = skill.skillId ?? skill.id
- const original = demoDataset.skills.find(item => item.skillId === skillId && item.collection === skill.collection)
- return original?.source.replaceAll('\r\n', '\n') === skill.source.replaceAll('\r\n', '\n') ? evaluations[skillId] ?? null : null
-}
-
-function firstConnectedSkill(dataset: Dataset): string {
- const counts = new Map<string, number>()
- for (const relation of dataset.relations) {
- counts.set(relation.source, (counts.get(relation.source) ?? 0) + 1)
- counts.set(relation.target, (counts.get(relation.target) ?? 0) + 1)
- }
- return dataset.skills.reduce((best, skill) => (counts.get(skill.id) ?? 0) > (counts.get(best) ?? 0) ? skill.id : best, dataset.skills[0]?.id ?? '')
-}
-
-function getProfileItems(profile: Record<string, unknown> | undefined, key: string): Array<{ text: string; lines: number[] }> {
- const entries = profile?.[key]
- if (!Array.isArray(entries)) return []
- return entries.flatMap(item => {
- if (typeof item !== 'object' || item === null || !('text' in item) || typeof item.text !== 'string') return []
- const evidence = 'evidence' in item && Array.isArray(item.evidence) ? item.evidence : []
- const lines = (evidence as unknown[]).flatMap((citation: unknown) => typeof citation === 'object' && citation !== null && 'line' in citation && typeof citation.line === 'number' ? [citation.line] : [])
- return [{ text: item.text, lines }]
- })
-}
-
-function SourceViewer({ skill, focusedLine }: { skill: Skill; focusedLine: number | null }) {
- const lines = useMemo(() => skill.source.split('\n'), [skill.source])
- useEffect(() => {
- if (focusedLine === null) return
- const timer = window.setTimeout(() => document.getElementById(`source-line-${focusedLine}`)?.scrollIntoView({ behavior: 'smooth', block: 'center' }), 60)
- return () => window.clearTimeout(timer)
- }, [skill.id, focusedLine])
- return (
- <div className="source-frame" aria-label={`${skill.name} SKILL.md source`}>
- {lines.map((line, index) => (
- <div id={`source-line-${index + 1}`} key={`${skill.id}-${index}`} className={`source-line ${focusedLine === index + 1 ? 'is-highlighted' : ''}`}>
- <span className="source-number">{index + 1}</span><span className="source-text">{line || ' '}</span>
- </div>
- ))}
- </div>
- )
-}
-
-function EvidenceLink({ evidence, onFocus }: { evidence: Evidence; onFocus: (skillId: string, line: number) => void }) {
- return <button type="button" className="evidence-link" onClick={() => onFocus(evidence.skillId, evidence.line)}><FileText size={14} /> {evidence.skillId.split('::').at(-1)} · L{evidence.line} <ArrowRight size={13} /></button>
-}
-
-function RelationInspector({ relation, dataset, onFocus, onSelectSkill }: { relation: Relation; dataset: Dataset; onFocus: (skillId: string, line: number) => void; onSelectSkill: (id: string) => void }) {
- const byId = new Map(dataset.skills.map(skill => [skill.id, skill]))
- return (
- <div className="inspector-content">
- <div className="relation-provenance"><div className={`relation-badge ${relation.type}`}>{relationLabel(relation.type)}</div><span>{dataset.kind === 'snapshot' ? 'Model analysis' : 'SKILL.md source reference'}</span></div>
- <div className="relation-path">
- <button type="button" onClick={() => onSelectSkill(relation.source)}>{byId.get(relation.source)?.name ?? relation.source}</button>
- <span>{relation.type === 'similar_to' ? '↔' : '→'}</span>
- <button type="button" onClick={() => onSelectSkill(relation.target)}>{byId.get(relation.target)?.name ?? relation.target}</button>
- </div>
- {relation.contexts.map((context, index) => (
- <section className="inspector-section" key={index}>
- <div className="section-index">Scenario {String(index + 1).padStart(2, '0')}</div>
- <h3>{context.scenario}</h3>
- <p>{context.explanation}</p>
- {context.conditions.length > 0 && <div className="condition-list">{context.conditions.map((condition, conditionIndex) => <span key={conditionIndex}>{condition}</span>)}</div>}
- <div className="evidence-group">
- <span className="field-label">Source text</span>
- {context.sourceEvidence.map((evidence, evidenceIndex) => <EvidenceLink key={evidenceIndex} evidence={evidence} onFocus={onFocus} />)}
- </div>
- {context.targetEvidence.length > 0 && <div className="evidence-group"><span className="field-label">Target text</span>{context.targetEvidence.map((evidence, evidenceIndex) => <EvidenceLink key={evidenceIndex} evidence={evidence} onFocus={onFocus} />)}</div>}
- </section>
- ))}
- </div>
- )
-}
-
-function SkillInspector({ skill, dataset, related, focusedLine, onFocus, onSelectRelation }: { skill: Skill; dataset: Dataset; related: Relation[]; focusedLine: number | null; onFocus: (skillId: string, line: number) => void; onSelectRelation: (id: string) => void }) {
- const groups = [
- ['when_to_use', 'When to use'],
- ['inputs', 'Inputs'],
- ['outputs', 'Outputs'],
- ['constraints', 'Constraints'],
- ['tools', 'Tools'],
- ] as const
- const byId = new Map(dataset.skills.map(item => [item.id, item]))
- const evaluation = evaluationFor(skill)
- return (
- <div className="inspector-content">
- <h2>{skill.name}</h2>
- <div className="skill-path"><FileText size={14} /> {dataset.kind === 'snapshot' ? 'Source at analysis time: ' : ''}{skill.path || skill.id}</div>
- <div className="capability-card"><div className="field-label">Capability summary · {skill.profile ? 'Model extracted' : 'SKILL.md description'}</div><p>{skill.description || 'No capability summary is available. Read the source below.'}</p></div>
- {evaluation && <section className="inspector-section evaluation-section">
- <div className="section-heading"><h3>Skill file evaluation</h3></div>
- <div className="evaluation-dimensions">{evaluationDimensions.map(([key, label]) => <details key={key}><summary><span>{label}</span><b className={`evaluation-level ${evaluation.dimensions[key].level.toLowerCase()}`}>{evaluationLevels[evaluation.dimensions[key].level]}</b></summary><p>{evaluation.dimensions[key].reason}</p></details>)}</div>
- <p className="evaluation-scan">Prompt injection prescreen: {evaluation.injectionScan.complete ? evaluation.injectionScan.clean ? 'No issues found' : `${evaluation.injectionScan.count} issue(s) found` : 'Not completed'}</p>
- </section>}
- {skill.profile && <div className="profile-source-label">Skill profile · Model extracted</div>}
- {skill.profile && <div className="profile-groups">{groups.map(([key, title]) => {
- const items = getProfileItems(skill.profile, key)
- if (items.length === 0) return null
- return <section className="profile-group" key={key}><h3>{title}</h3>{items.map((item, index) => <div className="profile-item" key={index}><span>{item.text}</span>{item.lines.map(line => <button key={line} type="button" onClick={() => onFocus(skill.id, line)}>L{line}</button>)}</div>)}</section>
- })}</div>}
- <section className="inspector-section related-section">
- <div className="section-heading"><h3>Related connections</h3><span>{related.length}</span></div>
- {related.length === 0 ? <p className="muted">No relationships are recorded in this dataset.</p> : <div className="related-list">{related.map(relation => {
- const otherId = relation.source === skill.id ? relation.target : relation.source
- const other = byId.get(otherId)
- return <button type="button" key={relation.id} onClick={() => onSelectRelation(relation.id)}><span className={`small-dot ${relation.type}`} /><span>{other?.name ?? otherId}</span><small>{relationLabel(relation.type)}</small><ArrowDownRight size={14} /></button>
- })}</div>}
- </section>
- <section className="inspector-section source-section">
- <div className="section-heading"><h3>SKILL.md source</h3><span>{skill.source.split('\n').length} lines</span></div>
- <SourceViewer skill={skill} focusedLine={focusedLine} />
- </section>
- </div>
- )
-}
-
-export default function App() {
- const [dataset, setDataset] = useState<Dataset>(emptyPersonalDataset)
- const [importedDatasets, setImportedDatasets] = useState<Array<{ id: string; dataset: Dataset }>>([])
- const [localLibraries, setLocalLibraries] = useState<LocalLibrary[]>([])
- const [localData, setLocalData] = useState<LocalLibraryData | null>(null)
- const [sourcePathInput, setSourcePathInput] = useState('')
- const [indexPathInput, setIndexPathInput] = useState('')
- const [sourceId, setSourceId] = useState('personal')
- const [collection, setCollection] = useState('personal')
- const [selectedSkillId, setSelectedSkillId] = useState('')
- const [selectedRelationId, setSelectedRelationId] = useState<string | null>(null)
- const [focusedLine, setFocusedLine] = useState<number | null>(null)
- const [query, setQuery] = useState('')
- const [evaluationOnly, setEvaluationOnly] = useState(false)
- const [depth, setDepth] = useState<1 | 2>(1)
- const [viewMode, setViewMode] = useState<'graph' | 'list'>('graph')
- const [relationQuery, setRelationQuery] = useState('')
- const [relationType, setRelationType] = useState<'all' | 'compose_with' | 'similar_to'>('all')
- const [error, setError] = useState<string | null>(null)
- const [loading, setLoading] = useState(false)
- const [restoring, setRestoring] = useState(true)
- const fileInput = useRef<HTMLInputElement>(null)
- const skillList = useRef<HTMLDivElement>(null)
- const graphCanvas = useRef<HTMLDivElement>(null)
-
- const collections = useMemo(() => {
- const counts = new Map<string, number>()
- demoDataset.skills.forEach(skill => counts.set(skill.collection ?? '', (counts.get(skill.collection ?? '') ?? 0) + 1))
- return Array.from(counts, ([name, count]) => ({ name, count }))
- }, [])
- useEffect(() => {
- let cancelled = false
- const restore = async () => {
- let imported: Array<{ id: string; dataset: Dataset }> = []
- try {
- const saved = await loadImports()
- imported = saved.flatMap(item => {
- try { return [{ id: item.id, dataset: parseSnapshot(JSON.parse(item.json) as unknown, item.name) }] }
- catch { return [] }
- })
- } catch {
- // An unavailable or damaged browser store should not block the bundled data.
- }
- if (cancelled) return
- setImportedDatasets(imported)
- let libraries: LocalLibrary[] = []
- try { libraries = await loadLocalLibraries() } catch { /* Browser storage may be unavailable. */ }
- if (cancelled) return
- setLocalLibraries(libraries)
- const view = loadView()
- const local = libraries.find(item => item.id === view?.collection)
- if (local) {
- try {
- const result = await readLocalLibrary(local)
- if (cancelled) return
- setLocalData(result)
- const selected = view?.sourceId === 'local-analysis' && result.analysis ? result.analysis : result.source
- setDataset(selected)
- setCollection(local.id)
- setSourceId(selected === result.analysis ? 'local-analysis' : 'local-source')
- setSelectedSkillId(selected.skills.some(skill => skill.id === view?.selectedSkillId) ? view!.selectedSkillId : firstConnectedSkill(selected))
- } catch {
- if (cancelled) return
- setError('The local skill library could not be read. Select it again from the Skill library menu.')
- }
- } else if (view?.sourceId === 'imported' && imported.some(item => item.id === view.collection)) {
- const saved = imported.find(item => item.id === view.collection)!
- setDataset(saved.dataset)
- setSourceId('imported')
- setCollection(saved.id)
- setSelectedSkillId(saved.dataset.skills.some(skill => skill.id === view.selectedSkillId) ? view.selectedSkillId : firstConnectedSkill(saved.dataset))
- } else {
- const analysis = bundledAnalyses.find(item => item.id === view?.sourceId && (item.collection ?? item.id) === view.collection)
- if (analysis) {
- try {
- const response = await fetch(`/data/${encodeURIComponent(analysis.file)}`)
- if (!response.ok) throw new Error('Could not read the analysis snapshot')
- const parsed = parseSnapshot(await response.json() as unknown, analysis.title, analysis.collection ?? undefined)
- if (cancelled) return
- setDataset(parsed)
- setSourceId(analysis.id)
- setCollection(analysis.collection ?? analysis.id)
- setSelectedSkillId(parsed.skills.some(skill => skill.id === view?.selectedSkillId) ? view!.selectedSkillId : firstConnectedSkill(parsed))
- } catch {
- if (cancelled) return
- setError('The last analysis snapshot could not be read. Returned to My skill library.')
- }
- } else if (view && (view.collection === 'all' || collections.some(item => item.name === view.collection))) {
- setDataset(demoDataset)
- setSourceId('local')
- setCollection(view.collection)
- setSelectedSkillId(demoDataset.skills.some(skill => skill.id === view.selectedSkillId && (view.collection === 'all' || skill.collection === view.collection))
- ? view.selectedSkillId
- : view.collection === 'all' ? firstConnectedSkill(demoDataset) : demoDataset.skills.find(skill => skill.collection === view.collection)?.id ?? '')
- }
- }
- if (!cancelled) setRestoring(false)
- }
- void restore()
- return () => { cancelled = true }
- }, [collections])
- useEffect(() => {
- if (!restoring) saveView({ collection, sourceId, selectedSkillId })
- }, [restoring, collection, sourceId, selectedSkillId])
- const visibleDataset = useMemo(() => {
- if (dataset.kind !== 'demo' || collection === 'all') return dataset
- const skills = dataset.skills.filter(skill => skill.collection === collection)
- const ids = new Set(skills.map(skill => skill.id))
- return { ...dataset, skills, relations: dataset.relations.filter(relation => ids.has(relation.source) && ids.has(relation.target)) }
- }, [dataset, collection])
- const graphDataset = useMemo(() => dataset.kind === 'snapshot' && relationType !== 'all'
- ? { ...visibleDataset, relations: visibleDataset.relations.filter(relation => relation.type === relationType) }
- : visibleDataset, [dataset.kind, visibleDataset, relationType])
- const relationRows = useMemo(() => {
- const needle = relationQuery.trim().toLocaleLowerCase()
- if (!needle) return graphDataset.relations
- const byId = new Map(visibleDataset.skills.map(skill => [skill.id, skill]))
- return graphDataset.relations.filter(relation => {
- const source = byId.get(relation.source)
- const target = byId.get(relation.target)
- return [relation.source, relation.target, source?.name, target?.name, ...relation.contexts.flatMap(context => [context.scenario, context.explanation])]
- .some(value => value?.toLocaleLowerCase().includes(needle))
- })
- }, [graphDataset, visibleDataset.skills, relationQuery])
- const analysisCounts = useMemo(() => ({
- compose: visibleDataset.relations.filter(relation => relation.type === 'compose_with').length,
- similar: visibleDataset.relations.filter(relation => relation.type === 'similar_to').length,
- }), [visibleDataset])
- const selectedSkill = useMemo(() => visibleDataset.skills.find(skill => skill.id === selectedSkillId) ?? visibleDataset.skills[0], [visibleDataset, selectedSkillId])
- const selectedRelation = useMemo(() => visibleDataset.relations.find(relation => relation.id === selectedRelationId) ?? null, [visibleDataset, selectedRelationId])
- const related = useMemo(() => visibleDataset.relations.filter(relation => relation.source === selectedSkill?.id || relation.target === selectedSkill?.id), [visibleDataset, selectedSkill])
- const relationCounts = useMemo(() => {
- const counts = new Map<string, number>()
- visibleDataset.relations.forEach(relation => {
- counts.set(relation.source, (counts.get(relation.source) ?? 0) + 1)
- counts.set(relation.target, (counts.get(relation.target) ?? 0) + 1)
- })
- return counts
- }, [visibleDataset])
- const evaluatedCount = useMemo(() => visibleDataset.skills.filter(skill => evaluationFor(skill)).length, [visibleDataset.skills])
- const filteredSkills = useMemo(() => {
- const needle = query.trim().toLocaleLowerCase()
- return visibleDataset.skills.filter(skill => (!evaluationOnly || evaluationFor(skill)) && (!needle || `${skill.name} ${skill.description} ${skill.id}`.toLocaleLowerCase().includes(needle)))
- }, [visibleDataset, query, evaluationOnly])
- const displayedSkills = filteredSkills.slice(0, 200)
- const relationSkillName = (id: string) => {
- const skill = visibleDataset.skills.find(item => item.id === id)
- return skill ? skillShortName(skill) : id
- }
- useEffect(() => {
- const list = skillList.current
- if (!list) return
- const rows = Array.from(list.querySelectorAll<HTMLButtonElement>('.skill-row'))
- const row = rows.find(item => item.dataset.skillId === selectedSkillId)
- if (row && rows[0]) list.scrollTop = Math.max(0, row.offsetTop - rows[0].offsetTop)
- }, [selectedSkillId, visibleDataset, filteredSkills])
- useEffect(() => {
- const centerGraph = () => {
- const canvas = graphCanvas.current
- if (canvas && window.matchMedia('(max-width: 760px)').matches) {
- canvas.scrollLeft = (canvas.scrollWidth - canvas.clientWidth) / 2
- }
- }
- centerGraph()
- window.addEventListener('resize', centerGraph)
- return () => window.removeEventListener('resize', centerGraph)
- }, [selectedSkillId, depth, visibleDataset])
-
- const selectSkill = (id: string) => {
- setSelectedSkillId(id)
- setSelectedRelationId(null)
- setFocusedLine(null)
- }
- const selectRelation = (id: string) => {
- setSelectedRelationId(id)
- setFocusedLine(null)
- }
- const focusEvidence = (skillId: string, line: number) => {
- setSelectedSkillId(skillId)
- setSelectedRelationId(null)
- setFocusedLine(line)
- }
- const loadDemo = (name = 'all') => {
- setDataset(demoDataset)
- setLocalData(null)
- setSourceId('local')
- setCollection(name)
- setSelectedSkillId(name === 'all' ? firstConnectedSkill(demoDataset) : demoDataset.skills.find(skill => skill.collection === name)?.id ?? '')
- setSelectedRelationId(null)
- setFocusedLine(null)
- setQuery('')
- setEvaluationOnly(false)
- setRelationQuery('')
- setRelationType('all')
- setError(null)
- if (fileInput.current) fileInput.current.value = ''
- }
- const showPersonalLibrary = () => {
- setDataset(emptyPersonalDataset)
- setLocalData(null)
- setSourceId('personal')
- setCollection('personal')
- setSelectedSkillId('')
- setSelectedRelationId(null)
- setFocusedLine(null)
- setQuery('')
- setEvaluationOnly(false)
- setRelationQuery('')
- setRelationType('all')
- setError(null)
- }
- const loadBundledAnalysis = async (id: string) => {
- setLoading(true)
- setError(null)
- try {
- const analysis = bundledAnalyses.find(item => item.id === id)
- if (!analysis) throw new Error('The selected analysis was not found.')
- const response = await fetch(`/data/${encodeURIComponent(analysis.file)}`)
- if (!response.ok) throw new Error(`Could not load ${analysis.title}.`)
- const parsed = parseSnapshot(await response.json() as unknown, analysis.title, analysis.collection ?? undefined)
- setLocalData(null)
- setDataset(parsed)
- setSourceId(id)
- setCollection(analysis.collection ?? analysis.id)
- setSelectedSkillId(firstConnectedSkill(parsed))
- setSelectedRelationId(null)
- setFocusedLine(null)
- setQuery('')
- setEvaluationOnly(false)
- setRelationQuery('')
- setDepth(1)
- setRelationType('all')
- } catch (cause) {
- setError(cause instanceof Error ? cause.message : 'Could not load the analysis graph.')
- } finally {
- setLoading(false)
- }
- }
- const importFile = async (file: File | undefined) => {
- if (!file) return
- setLoading(true)
- setError(null)
- try {
- if (file.size > 20 * 1024 * 1024) throw new Error('The file exceeds 20 MB and cannot be imported.')
- const json = await file.text()
- const parsed = parseSnapshot(JSON.parse(json) as unknown, file.name)
- const id = `imported:${crypto.randomUUID()}`
- setLocalData(null)
- setImportedDatasets(previous => [...previous, { id, dataset: parsed }])
- setDataset(parsed)
- setSourceId('imported')
- setCollection(id)
- setSelectedSkillId(parsed.skills[0]?.id ?? '')
- setSelectedRelationId(null)
- setFocusedLine(null)
- setQuery('')
- setEvaluationOnly(false)
- setRelationQuery('')
- setRelationType('all')
- try {
- await saveImport({ id, name: file.name, json })
- } catch {
- setError('The snapshot is open, but the browser could not save this import. After a refresh, the previous snapshot may appear.')
- }
- } catch (cause) {
- setError(cause instanceof SyntaxError ? 'The file is not valid JSON.' : cause instanceof Error ? cause.message : 'Could not read this file.')
- } finally {
- setLoading(false)
- if (fileInput.current) fileInput.current.value = ''
- }
- }
-
- const openLocalLibrary = async (library: LocalLibrary, preferredSource = sourceId) => {
- setLoading(true)
- setError(null)
- try {
- const result = await readLocalLibrary(library)
- setLocalData(result)
- const selected = preferredSource === 'local-analysis' && result.analysis ? result.analysis : result.source
- setDataset(selected)
- setCollection(library.id)
- setSourceId(selected === result.analysis ? 'local-analysis' : 'local-source')
- setSelectedSkillId(selected.skills.some(skill => skill.id === selectedSkillId) ? selectedSkillId : firstConnectedSkill(selected))
- setSelectedRelationId(null)
- setFocusedLine(null)
- setQuery('')
- setRelationQuery('')
- setRelationType('all')
- } catch (cause) {
- setError(cause instanceof Error ? cause.message : 'Could not read the local skill library.')
- } finally {
- setLoading(false)
- }
- }
- const connectLocalLibrary = async (sourcePath: string) => {
- setLoading(true)
- try {
- if (!sourcePath) throw new Error('Enter a skills folder path.')
- const existing = localLibraries.find(item => comparableLocalPath(item.sourcePath) === comparableLocalPath(sourcePath))
- if (existing) { await openLocalLibrary(existing, 'local-source'); setSourcePathInput(''); return }
- const library: LocalLibrary = { id: `local:${crypto.randomUUID()}`, name: sourcePath.replace(/[\\/]+$/, '').split(/[\\/]/).pop() || sourcePath, sourcePath }
- const result = await readLocalLibrary(library)
- await saveLocalLibrary(library)
- setLocalLibraries(previous => [...previous, library])
- setLocalData(result)
- setDataset(result.source)
- setCollection(library.id)
- setSourceId('local-source')
- setSelectedSkillId(firstConnectedSkill(result.source))
- setSelectedRelationId(null)
- setSourcePathInput('')
- setError(null)
- } catch (cause) {
- setError(cause instanceof Error ? cause.message : 'Could not connect the local skill library.')
- } finally {
- setLoading(false)
- }
- }
- const addLocalLibrary = () => void connectLocalLibrary(sourcePathInput.trim())
- const createPersonalLibrary = async () => {
- setLoading(true)
- setError(null)
- try {
- const sourcePath = await createDefaultLibrary()
- await connectLocalLibrary(sourcePath)
- } catch (cause) {
- setError(cause instanceof Error ? cause.message : 'Could not create the local skill library.')
- } finally {
- setLoading(false)
- }
- }
- const setLocalIndex = async () => {
- const library = localLibraries.find(item => item.id === collection)
- if (!library) return
- try {
- const indexPath = indexPathInput.trim()
- if (!indexPath) throw new Error('Enter an analysis output folder path.')
- const updated = { ...library, indexPath }
- const result = await readLocalLibrary(updated)
- if (!result.analysis) throw new Error('The selected folder has no graph.json pointed to by CURRENT.')
- await saveLocalLibrary(updated)
- setLocalLibraries(previous => previous.map(item => item.id === updated.id ? updated : item))
- setLocalData(result)
- setDataset(result.analysis)
- setSourceId('local-analysis')
- setSelectedSkillId(firstConnectedSkill(result.analysis))
- setIndexPathInput('')
- setError(null)
- } catch (cause) {
- setError(cause instanceof Error ? cause.message : 'Could not read the analysis folder.')
- }
- }
- const useDefaultIndex = async () => {
- const library = localLibraries.find(item => item.id === collection)
- if (!library) return
- try {
- const updated = { ...library, indexPath: undefined }
- const result = await readLocalLibrary(updated)
- await saveLocalLibrary(updated)
- setLocalLibraries(previous => previous.map(item => item.id === updated.id ? updated : item))
- setLocalData(result)
- const selected = result.analysis ?? result.source
- setDataset(selected)
- setSourceId(result.analysis ? 'local-analysis' : 'local-source')
- setSelectedSkillId(firstConnectedSkill(selected))
- setIndexPathInput('')
- setError(null)
- } catch (cause) {
- setError(cause instanceof Error ? cause.message : 'Could not read the default analysis folder.')
- }
- }
- const forgetLocalLibrary = async () => {
- const library = localLibraries.find(item => item.id === collection)
- if (!library) return
- try {
- await removeLocalLibrary(library.id)
- setLocalLibraries(previous => previous.filter(item => item.id !== library.id))
- showPersonalLibrary()
- } catch {
- setError('Could not remove the local skill library record.')
- }
- }
-
- const changeLibrary = (name: string) => {
- if (name === 'personal') {
- showPersonalLibrary()
- return
- }
- const local = localLibraries.find(item => item.id === name)
- if (local) {
- void openLocalLibrary(local, 'local-source')
- } else if (importedDatasets.some(item => item.id === name)) {
- const importedDataset = importedDatasets.find(item => item.id === name)!.dataset
- setLocalData(null)
- setDataset(importedDataset)
- setSourceId('imported')
- setCollection(name)
- setSelectedSkillId(firstConnectedSkill(importedDataset))
- setSelectedRelationId(null)
- setFocusedLine(null)
- setQuery('')
- setEvaluationOnly(false)
- setRelationQuery('')
- setRelationType('all')
- setError(null)
- } else if (bundledAnalyses.some(analysis => analysis.id === name && !analysis.collection)) {
- void loadBundledAnalysis(name)
- } else {
- loadDemo(name)
- }
- }
-
- const removeImport = async () => {
- setLoading(true)
- try {
- await clearImport(collection)
- setImportedDatasets(previous => previous.filter(item => item.id !== collection))
- showPersonalLibrary()
- } catch {
- setError('Could not remove the snapshot saved in this browser.')
- } finally {
- setLoading(false)
- }
- }
-
- const availableAnalyses = bundledAnalyses.filter(analysis => analysis.collection === collection || (!analysis.collection && analysis.id === collection))
- const emptyLocalLibrary = collection.startsWith('local:') && sourceId === 'local-source' && localData?.source.skills.length === 0
- const showWorkbench = !restoring && collection !== 'personal' && !emptyLocalLibrary
- const currentLibrary = localLibraries.find(item => item.id === collection)
-
- return (
- <div className="app-shell">
- <header className="site-header">
- <div className="site-header-inner">
- <a href="https://skillnet.openkg.cn/" className="brand" aria-label="SkillNet website"><img src="/skillnet.png" alt="SkillNet" /></a>
- <div className="header-spacer" />
- <a className="header-link" href="https://github.com/zjunlp/SkillNet" target="_blank" rel="noreferrer">GitHub <ArrowRight size={14} /></a>
- </div>
- </header>
-
- <main>
- <section className="dataset-bar" aria-label="Current data source">
- <label className="collection-control">Skill library <select value={collection} disabled={loading || restoring} onChange={event => changeLibrary(event.target.value)}><optgroup label="My skill library"><option value="personal">My skill library</option>{localLibraries.map(item => <option key={item.id} value={item.id}>Local: {item.name}</option>)}</optgroup><optgroup label="Repository examples"><option value="all">All examples ({demoDataset.skills.length})</option>{collections.map(item => <option key={item.name} value={item.name}>{item.name} ({item.count})</option>)}</optgroup>{bundledAnalyses.some(analysis => !analysis.collection) && <optgroup label="Other analysis snapshots">{bundledAnalyses.filter(analysis => !analysis.collection).map(analysis => <option key={analysis.id} value={analysis.id}>{analysis.title}</option>)}</optgroup>}{importedDatasets.length > 0 && <optgroup label="Imported snapshots">{importedDatasets.map(item => <option key={item.id} value={item.id}>{item.dataset.title}</option>)}</optgroup>}</select></label>
- <label className="collection-control">Content <select value={sourceId} disabled={loading || restoring || collection === 'personal' || collection.startsWith('imported:')} onChange={event => { const id = event.target.value; if (id === 'local-source' && localData) { setDataset(localData.source); setSourceId(id); setSelectedSkillId(firstConnectedSkill(localData.source)); setSelectedRelationId(null) } else if (id === 'local-analysis' && localData?.analysis) { setDataset(localData.analysis); setSourceId(id); setSelectedSkillId(firstConnectedSkill(localData.analysis)); setSelectedRelationId(null) } else if (id === 'local') loadDemo(collection); else void loadBundledAnalysis(id) }}>{collection === 'personal' ? <option value="personal">No folder selected</option> : collection.startsWith('imported:') ? <option value="imported">Imported analysis snapshot</option> : collection.startsWith('local:') ? <><option value="local-source">SKILL.md source</option>{localData?.analysis && <option value="local-analysis">Current analysis snapshot ({localData.analysis.skills.length}/{localData.source.skills.length})</option>}</> : bundledAnalyses.some(analysis => !analysis.collection && analysis.id === collection) ? <option value={sourceId}>Analysis snapshot</option> : <><option value="local">SKILL.md source</option>{availableAnalyses.map(analysis => <option key={analysis.id} value={analysis.id}>Analysis snapshot ({analysis.skillCount}{analysis.librarySkillCount ? `/${analysis.librarySkillCount}` : ''})</option>)}</>}</select></label>
- {collection !== 'personal' && <details className="local-library-menu"><summary>Local folders</summary><div><label>Skills folder path<input value={sourcePathInput} onChange={event => setSourcePathInput(event.target.value)} placeholder="Absolute path to the skills folder" /></label><button type="button" onClick={addLocalLibrary}>Add skill library</button>{currentLibrary && <><p className="local-path">Current: {currentLibrary.sourcePath}</p><button type="button" onClick={() => void openLocalLibrary(currentLibrary)}>Refresh folder</button><label>Custom analysis folder<input value={indexPathInput} onChange={event => setIndexPathInput(event.target.value)} placeholder={currentLibrary.indexPath ?? 'Default: .skillnet'} /></label>{currentLibrary.indexPath && <p className="local-path">Analysis folder: {currentLibrary.indexPath}</p>}<button type="button" onClick={() => void setLocalIndex()}>Connect analysis folder</button>{currentLibrary.indexPath && <button type="button" onClick={() => void useDefaultIndex()}>Use default .skillnet</button>}<button type="button" onClick={() => void forgetLocalLibrary()}>Remove skill library</button></>}</div></details>}
- <div className="dataset-actions"><button type="button" className="primary-button" onClick={() => fileInput.current?.click()} disabled={loading || restoring}><Upload size={16} /> {loading ? 'Loading…' : 'Import graph.json'}</button>{collection.startsWith('imported:') && <button type="button" className="text-button" onClick={() => void removeImport()} disabled={loading}>Remove import</button>}<input ref={fileInput} type="file" accept=".json,application/json" className="visually-hidden" aria-label="Choose graph.json file" onChange={event => void importFile(event.target.files?.[0])} /></div>
- {collection !== 'personal' && !emptyLocalLibrary && <div className="dataset-summary" aria-label="Data summary">
- {dataset.kind === 'demo' ? <span><strong>{compactNumber(visibleDataset.relations.length)}</strong> document references</span> : <><span><strong>{compactNumber(analysisCounts.compose)}</strong> composable</span><span><strong>{compactNumber(analysisCounts.similar)}</strong> similar</span></>}
- </div>}
- </section>
- {collection.startsWith('local:') && sourceId === 'local-analysis' && localData && (localData.changedSkills > 0 || localData.removedSkills > 0) && <div className="stale-banner" role="status">The analysis snapshot differs from the skills folder: {localData.changedSkills} skill source files changed, and {localData.removedSkills} skills were removed. Relationships and evidence still use the source from analysis time. Run SkillNet analyze again to update them.</div>}
- {error && <div className="error-banner" role="alert"><CircleHelp size={18} /> {error}<button type="button" onClick={() => setError(null)} aria-label="Dismiss error"><X size={17} /></button></div>}
-
- {!restoring && collection === 'personal' && <section className="onboarding" aria-label="My skill library">
- <div className="onboarding-intro"><span>My skill library</span><h1>{localLibraries.length ? 'Choose a skills folder' : 'Your skill library is empty'}</h1><p>Your personal skills stay in a folder on your computer. Repository examples are kept separate.</p></div>
- {localLibraries.length > 0 && <div className="onboarding-connected"><h2>Connected folders</h2>{localLibraries.map(library => <button type="button" key={library.id} onClick={() => void openLocalLibrary(library, 'local-source')}><span>{library.name}<small>{library.sourcePath}</small></span><ArrowRight size={16} /></button>)}</div>}
- <div className="onboarding-grid"><div className="onboarding-choice"><h2>Start with an empty folder</h2><p>Click to create <code>.skillnet/skills</code> in your home folder and connect it here. It will not be added to the cloned repository.</p><button type="button" className="primary-button" onClick={() => void createPersonalLibrary()} disabled={loading}>Create my skill library</button></div><div className="onboarding-choice"><h2>Use existing skills</h2><p>Enter a folder that directly contains skill subfolders. Each skill subfolder needs a <code>SKILL.md</code> file.</p><label>Absolute path to skills folder<input value={sourcePathInput} onChange={event => setSourcePathInput(event.target.value)} placeholder="For example, C:\Users\me\skills" /></label><button type="button" className="onboarding-secondary" onClick={addLocalLibrary} disabled={loading}>Connect existing folder</button></div></div>
- <div className="onboarding-example"><span>Want to look around first? The repository includes WebShop, ALFWorld, and ScienceWorld examples.</span><button type="button" onClick={() => loadDemo()}>Browse repository examples <ArrowRight size={15} /></button></div>
- </section>}
-
- {!restoring && emptyLocalLibrary && <section className="onboarding" aria-label="Empty local skill library"><div className="onboarding-intro"><span>Local skill library</span><h1>This folder has no skills yet</h1><p>The folder is connected. Add skill subfolders at the path below, then click Refresh folder.</p></div><div className="onboarding-empty-path"><strong>Skills folder</strong><code>{currentLibrary?.sourcePath}</code></div><div className="onboarding-next"><h2>How to add skills</h2><p>Copy existing skill folders here, or use this path when you download or create skills with SkillNet. Each skill needs its own subfolder with a <code>SKILL.md</code> file.</p><code>skillnet download &lt;GitHub skill folder URL&gt; --target-dir &quot;{currentLibrary?.sourcePath}&quot;</code><p>Install the SkillNet SDK from this repository before using the download command. Creating skills also requires a model configuration. After adding skills, run <code>skillnet analyze &quot;{currentLibrary?.sourcePath}&quot;</code> to analyze relationships.</p><button type="button" className="primary-button" onClick={() => { if (currentLibrary) void openLocalLibrary(currentLibrary, 'local-source') }} disabled={loading}>Refresh folder</button></div><div className="onboarding-example"><span>You can also browse repository examples to see how skills and relationships appear.</span><button type="button" onClick={() => loadDemo()}>Browse repository examples <ArrowRight size={15} /></button></div></section>}
-
- {showWorkbench && <>
- <section className="workbench-heading"><h1>Skills and relationships</h1></section>
-
- <section className="workspace" aria-label="Skill exploration workspace">
- <aside className="skill-panel">
- <div className="panel-title"><strong>Skill list</strong><span className="count-pill">{filteredSkills.length}</span></div>
- <label className="search-box"><Search size={17} /><input type="search" value={query} onChange={event => setQuery(event.target.value)} placeholder="Search name, capability, or ID" aria-label="Search skills" />{query && <button type="button" onClick={() => setQuery('')} aria-label="Clear search"><X size={14} /></button>}</label>
- <div className="list-caption"><span>{query || evaluationOnly ? `${filteredSkills.length} matches` : 'All skills'}{filteredSkills.length > 200 && ' (showing the first 200; search to narrow the list)'}</span><label className="evaluation-filter"><input type="checkbox" checked={evaluationOnly} disabled={evaluatedCount === 0} onChange={event => setEvaluationOnly(event.target.checked)} />Evaluated {evaluatedCount}</label></div>
- <div className="skill-list" role="list" ref={skillList}>
- {filteredSkills.length === 0 && <div className="no-results">No matching skills found.<button type="button" onClick={() => setQuery('')}>Clear search</button></div>}
- {displayedSkills.map(skill => {
- const active = skill.id === selectedSkill?.id
- const count = relationCounts.get(skill.id) ?? 0
- return <button type="button" className={`skill-row ${active ? 'is-active' : ''}`} key={skill.id} data-skill-id={skill.id} onClick={() => selectSkill(skill.id)} aria-current={active ? 'true' : undefined}><span className="skill-row-top"><strong>{skillShortName(skill)}</strong><ArrowRight size={15} /></span><span className="skill-row-description">{skill.description || 'View skill source and relationships'}</span><span className="skill-row-bottom"><span>{skill.skillId ?? skill.id}</span><span className="skill-row-markers">{evaluationFor(skill) && <span className="evaluated-mark">Evaluated</span>}{count > 0 && <span><GitBranch size={12} /> {count}</span>}</span></span></button>
- })}
- </div>
- </aside>
-
- <div className="graph-panel">
- <div className="panel-title graph-panel-title"><strong>Relationship view</strong><div className="graph-view-controls"><div className="graph-tools"><button type="button" className={viewMode === 'graph' ? 'is-on' : ''} onClick={() => setViewMode('graph')} aria-pressed={viewMode === 'graph'}>Graph</button><button type="button" className={viewMode === 'list' ? 'is-on' : ''} onClick={() => setViewMode('list')} aria-pressed={viewMode === 'list'}>List</button></div>{viewMode === 'graph' && <div className="graph-tools"><button type="button" className={depth === 1 ? 'is-on' : ''} onClick={() => setDepth(1)} aria-pressed={depth === 1}>1 hop</button><button type="button" className={depth === 2 ? 'is-on' : ''} onClick={() => setDepth(2)} aria-pressed={depth === 2}>2 hops</button></div>}</div></div>
- <div className="graph-subtitle"><span>{viewMode === 'graph' ? <>Focused on <strong>{selectedSkill ? skillShortName(selectedSkill) : '—'}</strong></> : `${relationRows.length} relationships`}</span>{dataset.kind === 'snapshot' && <label className="graph-relation-control">Relationship <select value={relationType} onChange={event => { setRelationType(event.target.value as 'all' | 'compose_with' | 'similar_to'); setSelectedRelationId(null) }}><option value="all">All</option><option value="compose_with">Composable</option><option value="similar_to">Similar</option></select></label>}{viewMode === 'graph' && dataset.kind === 'snapshot' && <span className="graph-limit">Showing up to {depth === 1 ? 10 : 16} neighbors; see all relationships in List</span>}</div>
- {viewMode === 'graph' ? <div className="graph-canvas" ref={graphCanvas}>{selectedSkill && <GraphView dataset={graphDataset} selectedSkillId={selectedSkill.id} selectedRelationId={selectedRelationId} depth={depth} onSelectSkill={selectSkill} onSelectRelation={selectRelation} />}</div> : <div className="relation-list-view"><label className="relation-search"><Search size={16} /><input type="search" value={relationQuery} onChange={event => setRelationQuery(event.target.value)} placeholder="Search skills, scenarios, or explanations" aria-label="Search relationships" /></label><div className="relation-list" role="list">{relationRows.length === 0 ? <p className="relation-list-empty">No matching relationships.</p> : relationRows.map(relation => <button type="button" key={relation.id} className={`relation-row ${selectedRelationId === relation.id ? 'is-active' : ''}`} onClick={() => selectRelation(relation.id)}><span className="relation-row-path"><strong>{relationSkillName(relation.source)}</strong><span>{relation.type === 'similar_to' ? '↔' : '→'}</span><strong>{relationSkillName(relation.target)}</strong></span><span className="relation-row-detail"><small className={`relation-badge ${relation.type}`}>{relationLabel(relation.type)}</small><span>{relation.contexts[0]?.scenario || relation.contexts[0]?.explanation}</span></span></button>)}</div></div>}
- <div className="graph-footer"><div className="legend">{dataset.kind === 'demo' ? <span><i className="legend-line reference" /> Document reference</span> : <><span><i className="legend-line compose" /> Composable</span><span><i className="legend-line similar" /> Similar</span></>}</div><span className="graph-desktop-help">{viewMode === 'graph' ? 'Click a node or line for details' : 'Click a relationship to view its scenario and evidence'}</span><span className="graph-mobile-help">{viewMode === 'graph' ? 'Swipe across the graph; tap a node or line for details' : 'Tap a relationship to view its scenario and evidence'}</span></div>
- </div>
-
- <aside className="detail-panel"><div className="panel-title"><strong>{selectedRelation ? 'Relationship details' : 'Skill details'}</strong></div>{selectedRelation ? <RelationInspector relation={selectedRelation} dataset={visibleDataset} onFocus={focusEvidence} onSelectSkill={selectSkill} /> : selectedSkill && <SkillInspector skill={selectedSkill} dataset={visibleDataset} related={related} focusedLine={focusedLine} onFocus={focusEvidence} onSelectRelation={selectRelation} />}</aside>
- </section>
- </>}
-
- </main>
- </div>
- )
-}
diff --git a/frontend/src/catalog.json b/frontend/src/catalog.json
deleted file mode 100644
index 6c30beb..0000000
--- a/frontend/src/catalog.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "snapshots": [
- {
- "id": "analysis:alfworld-analysis.json",
- "file": "alfworld-analysis.json",
- "title": "ALFWorld · Analysis results",
- "label": "ALFWorld (5/37)",
- "collection": "ALFWorld",
- "skillCount": 5,
- "librarySkillCount": 37
- },
- {
- "id": "analysis:scienceworld-analysis.json",
- "file": "scienceworld-analysis.json",
- "title": "ScienceWorld · Analysis results",
- "label": "ScienceWorld (5/61)",
- "collection": "ScienceWorld",
- "skillCount": 5,
- "librarySkillCount": 61
- },
- {
- "id": "analysis:webshop-analysis.json",
- "file": "webshop-analysis.json",
- "title": "WebShop · Analysis results",
- "label": "WebShop (23/23)",
- "collection": "WebShop",
- "skillCount": 23,
- "librarySkillCount": 23
- }
- ]
-}
diff --git a/frontend/src/data.ts b/frontend/src/data.ts
deleted file mode 100644
index 1f134c6..0000000
--- a/frontend/src/data.ts
+++ /dev/null
@@ -1,161 +0,0 @@
-import demoJson from './demo.json'
-
-export type RelationType = 'source_reference' | 'compose_with' | 'similar_to'
-
-export interface Skill {
- id: string
- skillId?: string
- name: string
- description: string
- source: string
- path: string
- collection?: string
- profile?: Record<string, unknown>
-}
-
-export interface Evidence {
- skillId: string
- line: number
-}
-
-export interface RelationContext {
- scenario: string
- explanation: string
- conditions: string[]
- sourceEvidence: Evidence[]
- targetEvidence: Evidence[]
-}
-
-export interface Relation {
- id: string
- source: string
- target: string
- type: RelationType
- contexts: RelationContext[]
-}
-
-export interface Dataset {
- kind: 'demo' | 'snapshot'
- title: string
- skills: Skill[]
- relations: Relation[]
-}
-
-interface DemoBundle {
- skills: Array<{ id: string; skillId: string; name: string; description: string; source: string; path: string; collection: string }>
- references: Array<{ source: string; target: string; type: 'source_reference'; line: number; excerpt: string }>
-}
-
-const demo = demoJson as DemoBundle
-
-export const demoDataset: Dataset = {
- kind: 'demo',
- title: 'Repository skills',
- skills: demo.skills,
- relations: demo.references.map((reference, index) => ({
- id: `reference-${index}`,
- source: reference.source,
- target: reference.target,
- type: 'source_reference',
- contexts: [{
- scenario: 'Explicit document reference',
- explanation: reference.excerpt,
- conditions: [],
- sourceEvidence: [{ skillId: reference.source, line: reference.line }],
- targetEvidence: [],
- }],
- })),
-}
-
-function isRecord(value: unknown): value is Record<string, unknown> {
- return typeof value === 'object' && value !== null && !Array.isArray(value)
-}
-
-function nonemptyString(value: unknown, name: string): string {
- if (typeof value !== 'string' || !value.trim()) throw new Error(`${name} is missing or is not text.`)
- return value
-}
-
-function citationLines(value: unknown, name: string, skillId: string, maxLine: number): Evidence[] {
- if (!Array.isArray(value) || value.length === 0) throw new Error(`${name} has no evidence lines.`)
- return value.map((item, index) => {
- if (!isRecord(item) || !Number.isInteger(item.line) || (item.line as number) < 1 || (item.line as number) > maxLine) {
- throw new Error(`${name}[${index}] has an invalid line number.`)
- }
- return { skillId, line: item.line as number }
- })
-}
-
-export function parseSnapshot(value: unknown, title: string, collection?: string): Dataset {
- if (!isRecord(value) || value.schema_version !== 1) {
- throw new Error('Only GraphSnapshot v1 is supported.')
- }
- if (!Array.isArray(value.skills) || !Array.isArray(value.relations)) {
- throw new Error('The file is missing a skills or relations array.')
- }
- if (value.skills.length === 0) throw new Error('The snapshot has no skills.')
- if (value.skills.length > 5000 || value.relations.length > 20000) {
- throw new Error('The limit is 5,000 skills and 20,000 relationships. Import a smaller file.')
- }
- const skills: Skill[] = value.skills.map((item: unknown, index: number) => {
- if (!isRecord(item)) throw new Error(`skills[${index}] is not an object.`)
- const profile = isRecord(item.profile) ? item.profile : undefined
- const capability = profile && isRecord(profile.capability) ? profile.capability.text : undefined
- return {
- id: nonemptyString(item.skill_id, `skills[${index}].skill_id`),
- name: nonemptyString(item.name, `skills[${index}].name`),
- description: typeof capability === 'string' ? capability : '',
- source: nonemptyString(item.source, `skills[${index}].source`),
- path: typeof item.path === 'string' ? item.path : '',
- collection,
- profile,
- }
- })
- const byId = new Map(skills.map(skill => [skill.id, skill]))
- const lineCount = (id: string) => byId.get(id)?.source.split('\n').length ?? 0
- if (byId.size !== skills.length) throw new Error('The snapshot contains duplicate skill_id values.')
- const relations: Relation[] = value.relations.map((item: unknown, index: number) => {
- if (!isRecord(item)) throw new Error(`relations[${index}] is not an object.`)
- const source = nonemptyString(item.source, `relations[${index}].source`)
- const target = nonemptyString(item.target, `relations[${index}].target`)
- if (!byId.has(source) || !byId.has(target)) throw new Error(`relations[${index}] refers to a missing skill.`)
- if (item.type !== 'compose_with' && item.type !== 'similar_to') {
- throw new Error(`relations[${index}] has an unsupported relationship type.`)
- }
- if (!Array.isArray(item.contexts) || item.contexts.length === 0) {
- throw new Error(`relations[${index}].contexts is empty.`)
- }
- const contexts: RelationContext[] = item.contexts.map((context: unknown, contextIndex: number) => {
- if (!isRecord(context)) throw new Error(`relations[${index}].contexts[${contextIndex}] is not an object.`)
- return {
- scenario: nonemptyString(context.scenario, `relations[${index}].contexts[${contextIndex}].scenario`),
- explanation: nonemptyString(context.explanation, `relations[${index}].contexts[${contextIndex}].explanation`),
- conditions: Array.isArray(context.conditions) ? context.conditions.filter((entry): entry is string => typeof entry === 'string') : [],
- sourceEvidence: citationLines(context.source_evidence, 'source_evidence', source, lineCount(source)),
- targetEvidence: citationLines(context.target_evidence, 'target_evidence', target, lineCount(target)),
- }
- })
- return { id: `relation-${index}`, source, target, type: item.type, contexts }
- })
- return {
- kind: 'snapshot',
- title,
- skills,
- relations,
- }
-}
-
-export function relationLabel(type: RelationType): string {
- switch (type) {
- case 'compose_with': return 'Composable'
- case 'similar_to': return 'Similar'
- case 'source_reference': return 'Document reference'
- }
-}
-
-export function skillShortName(skill: Skill): string {
- const collection = skill.collection || skill.path.match(/(?:^|\/)skills\/([^/]+)\//)?.[1]
- const prefix = collection?.toLowerCase().replace(/[^a-z0-9]+/g, '-')
- const name = prefix && skill.name.toLowerCase().startsWith(`${prefix}-`) ? skill.name.slice(prefix.length + 1) : skill.name
- return name.replaceAll('-', ' ')
-}
diff --git a/frontend/src/demo.json b/frontend/src/demo.json
deleted file mode 100644
index 2ba2c8c..0000000
--- a/frontend/src/demo.json
+++ /dev/null
@@ -1,1132 +0,0 @@
-{
- "skills": [
- {
- "id": "ALFWorld::alfworld-appliance-navigator",
- "skillId": "alfworld-appliance-navigator",
- "name": "alfworld-appliance-navigator",
- "description": "Navigates the agent to a target appliance (microwave, stove, fridge, or sinkbasin) needed for object processing. Use when you are holding an object that needs heating, cooling, or cleaning and must move to the correct appliance station. Identifies the required appliance from the task context and executes the movement action.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-appliance-navigator\ndescription: Navigates the agent to a target appliance (microwave, stove, fridge, or sinkbasin) needed for object processing. Use when you are holding an object that needs heating, cooling, or cleaning and must move to the correct appliance station. Identifies the required appliance from the task context and executes the movement action.\n---\n# Instructions\nUse this skill when you are holding an object that needs to be processed (heated, cooled, or cleaned) and you must locate and move to the correct appliance to perform the action.\n\n## Workflow\n1. **Identify the Target Appliance:** Determine which appliance is required for the task. Map the action to the appliance: `heat` -> microwave/stoveburner, `cool` -> fridge, `clean` -> sinkbasin.\n2. **Locate the Appliance:** Scan the environment observation for the target appliance (e.g., `microwave 1`, `fridge 1`, `sinkbasin 1`).\n3. **Navigate:** Execute `go to {appliance}` to move to the identified appliance location.\n4. **Prepare Appliance (if needed):** Upon arrival, check if the appliance requires preparation (e.g., opening a closed microwave or fridge door). If so, perform `open {appliance}` before proceeding.\n\n## Example\n\n**Scenario:** You are holding `potato 1` and need to heat it.\n\n```\nThought: I need to heat this potato. The microwave is the appropriate appliance.\nAction: go to microwave 1\nObservation: The microwave 1 is closed.\nThought: I need to open the microwave before I can use it.\nAction: open microwave 1\nObservation: You open the microwave 1. The microwave 1 is open. In it, you see nothing.\n```\n\n**Result:** You are now at the open microwave, ready to heat the potato.\n\n## Key Principles\n- **Trigger:** The agent is holding an object and the next step in the task is to `heat`, `cool`, or `clean` it.\n- **Core Action:** The primary output of this skill is the navigation command `go to {target_appliance}`.\n- **Prerequisite Check:** Always ensure the appliance is accessible (e.g., open) before attempting to use it for processing.\n",
- "path": "experiments/src/skills/alfworld/alfworld-appliance-navigator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-appliance-preparer",
- "skillId": "alfworld-appliance-preparer",
- "name": "alfworld-appliance-preparer",
- "description": "Prepares a household appliance (microwave, oven, toaster, fridge) for use by ensuring it is in the correct open/closed state. Use when the agent needs to heat, cool, or cook an item and must first open or close the appliance before placing an object inside. Takes an appliance identifier as input and outputs a confirmation that the appliance is ready for the next action.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-appliance-preparer\ndescription: Prepares a household appliance (microwave, oven, toaster, fridge) for use by ensuring it is in the correct open/closed state. Use when the agent needs to heat, cool, or cook an item and must first open or close the appliance before placing an object inside. Takes an appliance identifier as input and outputs a confirmation that the appliance is ready for the next action.\n---\n# Instructions\n\n## Goal\nPrepare a specified household appliance for immediate use by ensuring it is in the correct open or closed state. This is a prerequisite step before performing actions like `heat`, `cool`, or `toggle` with the appliance.\n\n## Input\n- **appliance_identifier**: The name of the appliance to prepare (e.g., `microwave 1`, `toaster 1`, `fridge 1`).\n\n## Core Logic\n1. **Navigate to the Appliance**: First, go to the location of the target appliance.\n2. **Check State & Prepare**: Determine if the appliance needs to be opened or closed based on the intended subsequent action. The standard rule is:\n * For appliances used to contain items for processing (e.g., microwave, oven, fridge), they typically need to be **open** to receive the item.\n * Use the `open {appliance}` or `close {appliance}` action as needed.\n3. **Confirm Readiness**: The skill is complete when the appliance is in the correct state, confirmed by an observation from the environment (e.g., \"The microwave 1 is open.\").\n\n## Important Considerations\n- **State Awareness**: Always observe the environment's feedback after each action (e.g., \"The microwave 1 is closed.\"). Do not assume the state.\n- **Error Handling**: If the action fails (environment outputs \"Nothing happened\"), the appliance may already be in the desired state. Re-check the observation and proceed.\n- **Trajectory Insight**: Refer to the example in `references/trajectory_example.md` to see a practical application of this skill in the context of a larger task.\n\n## Example\n\n**Input:** `appliance_identifier: microwave 1`\n\n**Sequence:**\n1. `go to microwave 1` → Observation: \"You are at microwave 1. The microwave 1 is closed.\"\n2. `open microwave 1` → Observation: \"You open the microwave 1. The microwave 1 is open.\"\n\n**Output:** \"The microwave 1 is open and ready for use.\"\n\n## Output\nA confirmation that the appliance is ready, typically in the form of the agent's `Thought` summarizing the prepared state and the environment's observation.\n",
- "path": "experiments/src/skills/alfworld/alfworld-appliance-preparer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-clean-object",
- "skillId": "alfworld-clean-object",
- "name": "alfworld-clean-object",
- "description": "Cleans a specified object using an appropriate cleaning receptacle (e.g., sinkbasin). Use when a task requires an object to be in a clean state (e.g., \"clean potato\", \"wash apple\") before proceeding. Navigates to the cleaning location, performs the clean action, and confirms the object is now clean.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-clean-object\ndescription: Cleans a specified object using an appropriate cleaning receptacle (e.g., sinkbasin). Use when a task requires an object to be in a clean state (e.g., \"clean potato\", \"wash apple\") before proceeding. Navigates to the cleaning location, performs the clean action, and confirms the object is now clean.\n---\n# Instructions\n\nClean an object you are holding using a sinkbasin. The object must be in your inventory before cleaning.\n\n## Workflow\n1. **Navigate:** `go to sinkbasin 1` (or the appropriate sinkbasin in the environment)\n2. **Clean:** `clean {object} with sinkbasin 1` -- verify observation confirms \"You clean the {object}\"\n3. **Proceed:** The object is now clean. Continue with the next task step\n\n## Action Format\n- `clean {obj} with {recep}` (e.g., `clean potato 1 with sinkbasin 1`)\n\n## Error Recovery\n- \"Nothing happened\": Check (1) you are holding the object, (2) you are at the sinkbasin, (3) object and receptacle names are correct\n- Not at sinkbasin: execute `go to sinkbasin 1` first\n\n## Example\n\n**Scenario:** You are holding `potato 1` and need to clean it.\n\n```\nThought: I need to clean this potato. I should go to the sinkbasin.\nAction: go to sinkbasin 1\nObservation: On the sinkbasin 1, you see nothing.\nAction: clean potato 1 with sinkbasin 1\nObservation: You clean the potato 1 using the sinkbasin 1.\n```\n\n**Result:** The potato is now in a clean state and ready for the next task step.\n\n## Post-Condition\nAfter successful execution, the object will be in a clean state. You may proceed with the next step of your task (e.g., placing the clean object on a shelf or in a microwave).\n",
- "path": "experiments/src/skills/alfworld/alfworld-clean-object/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-device-operator",
- "skillId": "alfworld-device-operator",
- "name": "alfworld-device-operator",
- "description": "Operates a device or appliance (like a desklamp, microwave, or fridge) to interact with another object. Use when the task requires using a tool on a target item (e.g., \"look at laptop under the desklamp\", \"heat potato with microwave\"). Locates both the device and target object, co-locates them, and executes the appropriate use action (toggle, heat, cool, or clean).",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-device-operator\ndescription: Operates a device or appliance (like a desklamp, microwave, or fridge) to interact with another object. Use when the task requires using a tool on a target item (e.g., \"look at laptop under the desklamp\", \"heat potato with microwave\"). Locates both the device and target object, co-locates them, and executes the appropriate use action (toggle, heat, cool, or clean).\n---\n# Instructions\n\n## 1. Skill Trigger\nActivate this skill when the task goal explicitly requires **using a device or appliance** to interact with a target object. Common indicators include phrases like:\n- \"look at [object] under the [device]\"\n- \"heat [object] with [device]\"\n- \"cool [object] with [device]\"\n- \"clean [object] with [device]\"\n\n## 2. Core Execution Flow\nFollow this sequence when the skill is triggered:\n\n### Phase 1: Locate the Device\n1. **Identify the device** from the task description (e.g., `desklamp`, `microwave`, `fridge`).\n2. **Search common receptacles** where such a device is typically found (e.g., desks, sidetables, countertops).\n3. Use the `go to {recep}` action to navigate to and inspect these locations until the device is found.\n4. **Note the device's exact name** (e.g., `desklamp 1`).\n\n### Phase 2: Locate the Target Object\n1. **Identify the target object** from the task description (e.g., `laptop`, `mug`, `plate`).\n2. **Search the environment** for this object. It may not be near the device initially.\n3. Use the `go to {recep}` and visual inspection to find the object.\n4. Once found, use `take {obj} from {recep}` to pick it up.\n\n### Phase 3: Co-locate Object and Device\n1. **Navigate** to the receptacle where the target device is located using `go to {recep}`.\n2. Ensure you are in the same location as the device before proceeding.\n\n### Phase 4: Operate the Device\n1. Execute the final **use action**. The specific action is determined by the device-object pair:\n * For a `desklamp` and a viewable object (like a `laptop`, `book`), use: `toggle {device} {recep}`.\n * For a `microwave` and a heatable object, use: `heat {obj} with {device}`.\n * For a `fridge` and a coolable object, use: `cool {obj} with {device}`.\n * For a `faucet`/`spraybottle` and a cleanable object, use: `clean {obj} with {device}`.\n2. **Action Format:** The action must use the exact object and device names discovered during Phases 1 & 2.\n\n## 3. Key Assumptions & Rules\n* **Co-location Required:** The skill assumes the final action requires the target object and the operating device to be in the same location (on the same receptacle).\n* **Device First:** Prioritize finding the device before extensively searching for the target object, as the device's location is often a fixed landmark.\n* **Invalid Actions:** If the environment responds with \"Nothing happened,\" re-evaluate your object/device names and your location. Ensure you are using the correct action verb for the device type.\n\n## Example\n\n**Scenario:** Task is \"look at laptop under the desklamp.\"\n\n```\nThought: I need to find the desklamp first. It's likely on a sidetable or desk.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a desklamp 1.\nThought: Found the desklamp. Now I need to find the laptop.\nAction: go to desk 1\nObservation: On the desk 1, you see a laptop 1, a pen 2.\nAction: take laptop 1 from desk 1\nObservation: You pick up the laptop 1 from the desk 1.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a desklamp 1.\nAction: use desklamp 1\nObservation: You turn on the desklamp 1.\n```\n\n**Result:** The laptop is now being examined under the desklamp, completing the task.\n",
- "path": "experiments/src/skills/alfworld/alfworld-device-operator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-environment-scanner",
- "skillId": "alfworld-environment-scanner",
- "name": "alfworld-environment-scanner",
- "description": "Performs an initial scan of the ALFWorld environment to identify all visible objects and receptacles. Use when you first enter an environment and need to build a mental map for task planning. Processes raw observation text into a structured list of entities, categorizing them as objects or receptacles.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-environment-scanner\ndescription: Performs an initial scan of the ALFWorld environment to identify all visible objects and receptacles. Use when you first enter an environment and need to build a mental map for task planning. Processes raw observation text into a structured list of entities, categorizing them as objects or receptacles.\n---\n# Instructions\n\n## Primary Objective\nExecute an initial environmental scan at the start of any Alfworld task. Your goal is to systematically identify and catalog all objects and receptacles mentioned in the initial observation text.\n\n## Core Workflow\n1. **Trigger:** This skill is triggered immediately upon receiving the initial environment description from the simulator (e.g., \"You are in the middle of a room. Looking quickly around you, you see...\").\n2. **Parse & Extract:** Process the raw observation text. Extract every noun phrase that represents a physical entity (object or receptacle). Note the naming convention (e.g., \"armchair 2\", \"diningtable 1\").\n3. **Categorize:** Mentally categorize each entity. A **receptacle** is a surface or container that can hold other objects (e.g., `sofa`, `sidetable`, `diningtable`, `dresser`). An **object** is an item that can be manipulated (e.g., `laptop`, `creditcard`, `pillow`). Some entities (like `ottoman`) can be both depending on context.\n4. **Output Structured Mental Map:** Formulate a clear, concise internal summary. Do not output this summary to the simulator—it is for your planning use only.\n * **Format:** `Scan Complete. Receptacles: [list]. Objects: [list].`\n * **Example:** Based on the trajectory, the mental map should be: `Scan Complete. Receptacles: [armchair 2, armchair 1, diningtable 1, drawer 4, drawer 3, drawer 2, drawer 1, dresser 1, garbagecan 1, ottoman 1, sidetable 3, sidetable 2, sidetable 1, sofa 1]. Objects: [].` *(Note: Initial scan only lists visible furniture; objects on them are discovered upon interaction.)*\n\n## Execution Rules\n* **Single Action:** This skill culminates in a single `go to <receptacle>` action to begin the task-specific search. Choose the most logical first receptacle to inspect (e.g., large central surfaces like `diningtable 1` or `sofa 1`).\n* **No Looping:** Do not create a loop of `go to` actions. After executing the first `go to`, the skill ends, and standard task planning takes over.\n* **Integration:** The mental map generated by this skill must inform all subsequent planning. When searching for a target object, reason about which receptacles from your map are most likely to contain it.\n\n## Example from Trajectory\n**Initial Observation:** \"You are in the middle of a room... you see a armchair 2, a armchair 1, a diningtable 1, a drawer 4... sofa 1.\"\n**Skill Execution:**\n* **Thought:** `Initiating environment scan. I see multiple receptacles: armchairs, tables, drawers, a dresser, garbage can, ottoman, sidetables, and a sofa. I will build a mental map and then start searching for the laptop on a likely surface.`\n* **Action:** `go to sofa 1`\n*(The agent then proceeds with the main task using the knowledge from the scan.)*\n",
- "path": "experiments/src/skills/alfworld/alfworld-environment-scanner/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-goal-interpreter",
- "skillId": "alfworld-goal-interpreter",
- "name": "alfworld-goal-interpreter",
- "description": "Parses the natural language task goal to extract actionable sub-objectives and required objects. Trigger this skill whenever a new task is assigned to break down complex instructions into clear, sequential targets. It interprets phrases like 'look at X under Y' to identify target objects (pillow), reference objects (desklamp), and spatial relationships (under).",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-goal-interpreter\ndescription: Parses the natural language task goal to extract actionable sub-objectives and required objects. Trigger this skill whenever a new task is assigned to break down complex instructions into clear, sequential targets. It interprets phrases like 'look at X under Y' to identify target objects (pillow), reference objects (desklamp), and spatial relationships (under).\n---\n# Goal Interpretation Protocol\n\n## 1. Parse the Task Statement\nWhen a new task is assigned, immediately analyze the natural language instruction to extract its core components. Use the parsing script (`parse_goal.py`) to perform this analysis.\n\n**Input:** The raw task string (e.g., \"look at pillow under the desklamp\").\n**Output:** A structured dictionary containing:\n- `primary_target`: The main object to interact with.\n- `reference_object`: The object that defines a location or condition.\n- `spatial_relation`: The preposition linking them (e.g., under, on, in).\n- `action`: The verb defining the required interaction.\n\n## 2. Generate Sub-Objectives\nBased on the parsed components, formulate a clear, sequential plan. The plan must account for the spatial relationship.\n\n**Example Logic:**\n- **IF** relation is `under` → Sub-goal 1: Locate the `reference_object`. Sub-goal 2: Inspect the area beneath it for the `primary_target`.\n- **IF** relation is `in` or `on` → Sub-goal 1: Locate the `reference_object`. Sub-goal 2: Check its contents/surface.\n\n## 3. Identify Required Objects & Actions\nMap the parsed objects to the available action types in the environment. The primary action verbs (look, take, use, etc.) from the task must be translated into the agent's available action set (go to, take, use, etc.).\n\n**Critical Check:** If the `reference_object` is a container (drawer, fridge), ensure the plan includes the `open` action before inspection.\n\n## 4. Execute & Adapt\nInitiate the plan. After each action, monitor the observation. If the expected object is not found, or the action fails (\"Nothing happened\"), consult the fallback logic in the reference guide (`search_patterns.md`).\n\n**Remember:** The agent must maintain object permanence. If an object is moved (e.g., a pillow is picked up), it is now in the agent's inventory and the spatial relationship is void.\n",
- "path": "experiments/src/skills/alfworld/alfworld-goal-interpreter/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-heat-object-with-appliance",
- "skillId": "alfworld-heat-object-with-appliance",
- "name": "alfworld-heat-object-with-appliance",
- "description": "Uses a heating appliance (microwave, stoveburner, oven) to apply heat to a specified object. Use when the task requires warming or cooking an item (e.g., \"heat some egg\", \"warm the mug\") and a heating appliance is available. Takes the object name and appliance name as input and outputs the object in a heated state, ready for placement at the task's target location.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-heat-object-with-appliance\ndescription: Uses a heating appliance (microwave, stoveburner, oven) to apply heat to a specified object. Use when the task requires warming or cooking an item (e.g., \"heat some egg\", \"warm the mug\") and a heating appliance is available. Takes the object name and appliance name as input and outputs the object in a heated state, ready for placement at the task's target location.\n---\n# Skill: Heat Object with Appliance\n\n## Purpose\nHeat a specified object using a designated kitchen appliance to change its state (e.g., from cold to hot, raw to cooked) as required by a task.\n\n## Core Workflow\nFollow this sequence of actions. Use the bundled `validate_and_plan.py` script to check for common preconditions before starting.\n\n1. **Navigate & Locate:** Go to the location of the target object.\n2. **Acquire Object:** Take the object from its current receptacle.\n3. **Navigate to Appliance:** Go to the specified heating appliance.\n4. **Prepare Appliance:**\n * If the appliance is closed, open it.\n * If the appliance contains other items, you may need to remove them (context-dependent). The default action is to close it and proceed, as some environments abstract this step.\n5. **Execute Heating:** Use the `heat {object} with {appliance}` action.\n6. **Complete Task:** Navigate to the final target location (e.g., a dining table) and put the heated object there.\n\n## Key Decision Points\n* **Appliance State:** If the appliance is occupied, assess if the task implies clearing it. The trajectory shows proceeding without removal is sometimes valid.\n* **Object Location:** The object may not be at the initial location. Be prepared to search other receptacles (e.g., fridge, countertop, cabinet) if not found.\n* **Alternative Appliances:** If the primary appliance (e.g., microwave) is unavailable or broken, consider alternatives like a stoveburner.\n\n## Example\n\n**Task:** \"Heat some egg and put it on the diningtable.\"\n\n**Input:** `object: egg 1`, `appliance: microwave 1`, `target: diningtable 1`\n\n**Sequence:**\n1. `go to fridge 1` → Observation: \"You are at fridge 1.\"\n2. `open fridge 1` → Observation: \"You open the fridge 1. You see egg 1, ...\"\n3. `take egg 1 from fridge 1` → Observation: \"You pick up the egg 1 from the fridge 1.\"\n4. `go to microwave 1` → Observation: \"You are at microwave 1.\"\n5. `heat egg 1 with microwave 1` → Observation: \"You heat the egg 1 using the microwave 1.\"\n6. `go to diningtable 1` → Observation: \"You are at diningtable 1.\"\n7. `put egg 1 in/on diningtable 1` → Observation: \"You put the egg 1 in/on the diningtable 1.\"\n\n**Output:** The egg 1 is heated and placed on the diningtable 1. Task complete.\n\n## Bundled Resources\n* `scripts/validate_and_plan.py`: A utility to check the initial environment state against the skill's prerequisites.\n* `references/common_heating_appliances.md`: A list of typical appliances and their properties in the ALFWorld environment.\n",
- "path": "experiments/src/skills/alfworld/alfworld-heat-object-with-appliance/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-inventory-management",
- "skillId": "alfworld-inventory-management",
- "name": "alfworld-inventory-management",
- "description": "Use when the agent must collect and track multiple instances of the same object type in ALFWorld (e.g., \"put two cellphone in bed\"). This skill maintains a count of collected versus needed objects, guides systematic searching through receptacles, and ensures each found object is placed at the target before searching for the next.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-inventory-management\ndescription: Use when the agent must collect and track multiple instances of the same object type in ALFWorld (e.g., \"put two cellphone in bed\"). This skill maintains a count of collected versus needed objects, guides systematic searching through receptacles, and ensures each found object is placed at the target before searching for the next.\n---\n# Inventory Management Skill\n\n## When to Use\nActivate this skill when:\n- Task requires collecting **multiple instances** of the same object type (e.g., \"put two cellphone in bed\")\n- You need to track progress toward a quantity-based goal\n- Searching through multiple locations systematically\n\n## Core Workflow\n\n### 1. Initialize Inventory\n- Parse the task description to identify:\n - **Target object type** (e.g., \"cellphone\")\n - **Required quantity** (e.g., \"two\" = 2)\n - **Target receptacle** (e.g., \"bed 1\")\n- Initialize counters: `collected = 0`, `needed = <quantity>`\n- Create empty list for searched locations\n\n### 2. Systematic Search Pattern\nFollow this search priority:\n1. **Visible surfaces** (desks, dressers, beds, countertops) - check first\n2. **Closed containers** (drawers, cabinets, safes) - open and inspect\n3. **Less common locations** (shelves, side tables, garbage cans)\n4. **Return to known locations** if inventory incomplete\n\n**Critical Rule:** After finding an object, immediately place it at the target location before searching for the next one. Do not attempt to carry multiple objects simultaneously.\n\n### 3. Action Decision Logic\nUse this decision tree at each step:\n\n```\nIs target object visible in current observation?\n├── YES → Take it, go to target receptacle, put it down\n│ └── Increment collected counter\n│ ├── collected == needed → TASK COMPLETE\n│ └── collected < needed → Continue searching\n└── NO → Have all receptacles been searched?\n ├── YES → Revisit receptacles (objects may have been missed)\n └── NO → Go to next unsearched receptacle\n```\n\n### 4. Per-Object Cycle\nFor each object instance found, follow this exact sequence:\n1. `take {object} from {current_receptacle}`\n2. `go to {target_receptacle}`\n3. `put {object} in/on {target_receptacle}`\n4. Update counter: `collected += 1`\n5. If `collected < needed`, navigate to next unsearched receptacle\n\n## Example\n\n**Task:** \"Put two cellphone in bed 1.\"\n\n```\n> go to desk 1\nOn the desk 1, you see a cellphone 2, a pen 1.\n> take cellphone 2 from desk 1\nYou pick up the cellphone 2 from the desk 1.\n> go to bed 1\nOn the bed 1, you see a pillow 1.\n> put cellphone 2 in/on bed 1\nYou put the cellphone 2 in/on the bed 1.\n[collected: 1/2]\n> go to dresser 1\nOn the dresser 1, you see a cellphone 3, a keychain 1.\n> take cellphone 3 from dresser 1\nYou pick up the cellphone 3 from the dresser 1.\n> go to bed 1\nOn the bed 1, you see a cellphone 2, a pillow 1.\n> put cellphone 3 in/on bed 1\nYou put the cellphone 3 in/on the bed 1.\n[collected: 2/2 — TASK COMPLETE]\n```\n\n## Error Handling\n- **Object not at expected location**: Mark location as searched, proceed to next receptacle\n- **\"Nothing happened\"**: The action syntax may be wrong; verify object name and receptacle\n- **Counter mismatch**: Re-examine the target receptacle to confirm how many objects are already placed\n",
- "path": "experiments/src/skills/alfworld/alfworld-inventory-management/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-locate-target-object",
- "skillId": "alfworld-locate-target-object",
- "name": "alfworld-locate-target-object",
- "description": "Navigates to a suspected location and identifies a target object. Use when your goal requires finding a specific object (e.g., \"potato\", \"plate\") and its location is not immediately known. Moves to a relevant receptacle (like a fridge or cabinet), checks its contents, and outputs the object's location or confirms its absence.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-locate-target-object\ndescription: Navigates to a suspected location and identifies a target object. Use when your goal requires finding a specific object (e.g., \"potato\", \"plate\") and its location is not immediately known. Moves to a relevant receptacle (like a fridge or cabinet), checks its contents, and outputs the object's location or confirms its absence.\n---\n# Skill: Locate Target Object\n\n## Purpose\nUse this skill when your goal requires a specific object and you need to find it. The skill directs you to a likely receptacle, inspects it, and confirms if the target is present.\n\n## Core Workflow\n1. **Identify Target & Suspected Location:** Determine the object you need and the most logical place to find it (e.g., food in the `fridge`, utensils in a `drawer`).\n2. **Navigate:** Go to the suspected receptacle.\n3. **Inspect:** If the receptacle is closed, open it.\n4. **Locate:** Visually scan the contents for the target object.\n5. **Report:** Output the object's location if found, or note its absence.\n\n## Instructions\nFollow this sequence of actions and reasoning.\n\n**Thought:** I need to find a `<target_object>`. The most likely place for it is the `<suspected_receptacle>`.\n**Action:** `go to <suspected_receptacle>`\n\n**Observation:** *[You arrive at the receptacle. It may be open or closed.]*\n\n**Thought:** I am at the `<suspected_receptacle>`. To see inside, I must open it.\n**Action:** `open <suspected_receptacle>`\n\n**Observation:** *[The receptacle opens, revealing its contents.]*\n\n**Thought:** The `<suspected_receptacle>` is open. I will now look for the `<target_object>` among its contents.\n* **If the object is visible:** I have located the `<target_object>` in the `<suspected_receptacle>`. My location task is complete.\n* **If the object is not visible:** The `<target_object>` is not in the `<suspected_receptacle>`. I must consider the next most likely location.\n\n## Key Principles\n* **Contextual Guessing:** Use common sense to guess the initial search location (e.g., `fridge` for perishables, `cabinet` for dry goods).\n* **Sequential Access:** You must `go to` a location before you can `open` it.\n* **Visual Confirmation:** Only trust the `Observation` after opening a receptacle to confirm an object's presence or absence.\n\n## Example\n\n**Scenario:** You need to find a potato for a heating task.\n\n```\nThought: I need to find a potato. Potatoes are commonly stored in the fridge.\nAction: go to fridge 1\nObservation: The fridge 1 is closed.\nAction: open fridge 1\nObservation: You open the fridge 1. The fridge 1 is open. In it, you see a potato 1, a lettuce 2.\n```\n\n**Result:** The potato has been located in `fridge 1`. You can now `take potato 1 from fridge 1` and proceed.\n\n## Next Steps\nAfter successfully locating the object, you will typically need to `take` it or interact with it, which is outside the scope of this skill. If the object is not found, trigger this skill again with a new suspected location.\n",
- "path": "experiments/src/skills/alfworld/alfworld-locate-target-object/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-location-navigator",
- "skillId": "alfworld-location-navigator",
- "name": "alfworld-location-navigator",
- "description": "Moves the agent to a specified receptacle or object location within the Alfworld environment. Use this skill when the agent needs to physically approach a target to inspect or interact with it, such as when checking an object's state or preparing for pickup. The skill takes a target location name as input and executes the 'go to' action, resulting in the agent being positioned at the destination for subsequent operations.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-location-navigator\ndescription: Moves the agent to a specified receptacle or object location within the Alfworld environment. Use this skill when the agent needs to physically approach a target to inspect or interact with it, such as when checking an object's state or preparing for pickup. The skill takes a target location name as input and executes the 'go to' action, resulting in the agent being positioned at the destination for subsequent operations.\n---\n# Instructions\nUse this skill to navigate to a specific location in the Alfworld environment. The skill will move the agent directly to the target receptacle or object.\n\n## Input\nProvide the target location name as a string (e.g., \"toiletpaperhanger 1\", \"toilet 1\").\n\n## Process\n1. The skill validates the target location against the current environment observation.\n2. It executes the `go to {target}` action.\n3. It returns the environment's observation after the move.\n\n## Notes\n- Ensure the target location is visible in the agent's current observation before calling this skill.\n- This skill is for navigation only. Use other skills for object interaction (take, put, etc.).\n- If the action fails (e.g., \"Nothing happened\"), the agent may need to replan its path or verify the target name.\n",
- "path": "experiments/src/skills/alfworld/alfworld-location-navigator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-navigation-planner",
- "skillId": "alfworld-navigation-planner",
- "name": "alfworld-navigation-planner",
- "description": "Plans a path to move the agent between receptacles to search for target objects. Use this when you need to traverse the environment to reach a specific location or systematically explore multiple areas. It takes the current location and destination receptacle as input, and outputs the next 'go to' action to approach the target.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-navigation-planner\ndescription: Plans a path to move the agent between receptacles to search for target objects. Use this when you need to traverse the environment to reach a specific location or systematically explore multiple areas. It takes the current location and destination receptacle as input, and outputs the next 'go to' action to approach the target.\n---\n# Instructions\n\nUse this skill to navigate between receptacles (e.g., bed, desk, drawer) in a household environment to locate objects. The core logic is handled by the bundled script.\n\n## Input/Output Format\n- **Input:** Provide the agent's **current location** and the **target receptacle**.\n- **Output:** The skill will return the next `go to {recep}` action to execute.\n\n## How to Use\n1. **Identify your goal.** Determine which receptacle you need to search (e.g., `desk 1` to find a `desklamp`).\n2. **Call the skill.** Pass your current location and the target receptacle.\n3. **Execute the action.** Perform the `go to` action returned by the skill.\n4. **Observe and repeat.** After moving, observe the new location. If the target object is not found, use this skill again to plan movement to the next most promising receptacle.\n\n## Key Principles\n- **Systematic Search:** Move efficiently between likely receptacles instead of random exploration.\n- **Adaptive Planning:** If an action fails (\"Nothing happened\"), the script's logic helps choose an alternative path.\n- **Context Preservation:** Always note your current location after each move for the next planning step.\n\n**Example Thought Process:**\n> Thought: I need to find a desklamp. The `desk 1` is a likely location. I am currently at `bed 1`.\n> Action: Use `alfworld-navigation-planner` with current location `bed 1` and target `desk 1`.\n> Result: `go to desk 1`\n",
- "path": "experiments/src/skills/alfworld/alfworld-navigation-planner/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-cooler",
- "skillId": "alfworld-object-cooler",
- "name": "alfworld-object-cooler",
- "description": "Cools a held object using an appropriate cooling appliance such as a fridge or freezer. Use when the task requires reducing the temperature of an object (e.g., \"cool some pot\", \"chill the mug\") and the agent is already holding the object. Performs the ALFWorld `cool` action and outputs the cooled object ready for subsequent placement or serving steps.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-cooler\ndescription: Cools a held object using an appropriate cooling appliance such as a fridge or freezer. Use when the task requires reducing the temperature of an object (e.g., \"cool some pot\", \"chill the mug\") and the agent is already holding the object. Performs the ALFWorld `cool` action and outputs the cooled object ready for subsequent placement or serving steps.\n---\n# Skill: Cool Held Object\n\n## Purpose\nUse this skill when you are holding an object (e.g., `pot 1`) that needs to be cooled and you are at the location of a valid cooling receptacle (e.g., `fridge 1`). The skill executes the `cool` action to change the object's state.\n\n## Prerequisites\n1. **Object in Hand:** You must already be holding the target object (e.g., `pot 1`).\n2. **At Cooling Receptacle:** You must be at the location of the cooling appliance (e.g., `fridge 1`). Use `go to {recep}` to navigate first if needed.\n3. **Valid Receptacle:** The receptacle must be a valid target for the `cool` action (e.g., fridge, freezer). The environment will validate this.\n\n## Core Action\nExecute the `cool` action with the format: `cool {obj} with {recep}`.\n\n## Execution Flow\n1. **Verify State:** Confirm you are holding the object and are at the cooling receptacle's location.\n2. **Execute:** Perform the `cool` action.\n3. **Verify Outcome:** The expected observation is \"You cool the {obj} using the {recep}.\" If the observation is \"Nothing happened,\" the action was invalid—check the prerequisites or try a different receptacle.\n\n## Example from Trajectory\n* **State:** Holding `pot 1`, at `fridge 1`.\n* **Action:** `cool pot 1 with fridge 1`\n* **Result:** Observation: \"You cool the pot 1 using the fridge 1.\"\n\n## Next Steps\nAfter successful cooling, the object is ready for the next task step (e.g., `put {obj} in/on {recep}`).\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-cooler/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-disposer",
- "skillId": "alfworld-object-disposer",
- "name": "alfworld-object-disposer",
- "description": "This skill disposes of an object by placing it into a disposal receptacle like a garbage can. It should be triggered when the task requires discarding an object (e.g., 'put it in garbagecan') and the agent is at the disposal location with the object in hand. The skill executes the 'put' action to place the object in/on the target receptacle, completing the disposal subtask.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-disposer\ndescription: This skill disposes of an object by placing it into a disposal receptacle like a garbage can. It should be triggered when the task requires discarding an object (e.g., 'put it in garbagecan') and the agent is at the disposal location with the object in hand. The skill executes the 'put' action to place the object in/on the target receptacle, completing the disposal subtask.\n---\n# Skill: Object Disposer\n\n## Trigger Condition\nActivate this skill when:\n1. The task goal explicitly requires disposing of an object (e.g., \"put it in garbagecan\", \"throw away the X\").\n2. The agent is holding the target object.\n3. The agent is at the location of the disposal receptacle (e.g., garbagecan).\n\n## Execution\n1. **Verify Prerequisites**: Confirm the object is in hand and the disposal receptacle is present at your location.\n2. **Execute Disposal**: Perform the `put` action with the object and receptacle.\n3. **Completion**: The skill is complete when the object has been successfully placed into/onto the disposal receptacle.\n\n## Notes\n- This skill handles only the final disposal action. Object acquisition and navigation to the disposal location are separate skills.\n- If the disposal fails (e.g., \"Nothing happened\"), re-evaluate the object and receptacle identifiers or check if the receptacle can accept the object.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-disposer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-heater",
- "skillId": "alfworld-object-heater",
- "name": "alfworld-object-heater",
- "description": "Heats a specified object using an available heating appliance (e.g., microwave, stoveburner). Use when you are holding an object that requires heating and need to navigate to and operate the heating appliance. Takes the object and appliance as inputs and results in the object being in a heated state.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-heater\ndescription: Heats a specified object using an available heating appliance (e.g., microwave, stoveburner). Use when you are holding an object that requires heating and need to navigate to and operate the heating appliance. Takes the object and appliance as inputs and results in the object being in a heated state.\n---\n# Instructions\n\nHeat an object you are holding using a compatible heating appliance (microwave or stoveburner).\n\n## Prerequisites\n- The target object must be in your inventory\n- A heating appliance (microwave, stoveburner) must exist in the environment\n\n## Workflow\n1. **Navigate:** `go to {appliance}` (e.g., `go to microwave 1`)\n2. **Check state:** If observation says appliance is closed, execute `open {appliance}` -- verify observation confirms it is now open\n3. **Heat:** `heat {object} with {appliance}` -- verify observation confirms \"You heat the {object}\"\n4. **(Optional) Place:** If the task requires it, navigate to the destination and place the heated object\n\n## Action Format\n- `go to microwave 1` / `go to stoveburner 1`\n- `open microwave 1`\n- `heat {object} with {appliance}` (e.g., `heat potato 1 with microwave 1`)\n\n## Error Recovery\n- \"Nothing happened\" on heat: Check (1) you are holding the object, (2) appliance is open, (3) appliance name is correct\n- Appliance occupied: Take the existing item out first, then retry\n\n## Example\n\n**Scenario:** You are holding `potato 1` and need to heat it.\n\n```\nThought: I need to heat the potato. I'll go to the microwave.\nAction: go to microwave 1\nObservation: The microwave 1 is closed.\nAction: open microwave 1\nObservation: You open the microwave 1. The microwave 1 is open. In it, you see nothing.\nAction: heat potato 1 with microwave 1\nObservation: You heat the potato 1 using the microwave 1.\n```\n\n**Result:** The potato is now heated. Proceed to place it at the destination if required by the task.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-heater/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-locator",
- "skillId": "alfworld-object-locator",
- "name": "alfworld-object-locator",
- "description": "Use when the agent needs to find a specific object in ALFWorld that is not currently in inventory and whose location is unknown. This skill parses the environment observation, ranks receptacles by likelihood of containing the target object using common-sense reasoning, and outputs a navigation action to the most promising location.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-locator\ndescription: Use when the agent needs to find a specific object in ALFWorld that is not currently in inventory and whose location is unknown. This skill parses the environment observation, ranks receptacles by likelihood of containing the target object using common-sense reasoning, and outputs a navigation action to the most promising location.\n---\n# Skill: Object Locator for ALFWorld\n\n## When to Use\nTrigger this skill when:\n1. Your goal requires a specific object (e.g., `knife`, `cellphone`, `apple`)\n2. The object is not in your inventory\n3. The current observation does not explicitly state the object's location\n\n## Core Workflow\n\n### 1. Parse the Environment\nExtract all visible receptacles from the observation text. Typical ALFWorld receptacles include:\n- **Surfaces**: countertop, desk, dresser, bed, shelf, sidetable, coffeetable, diningtable\n- **Containers**: drawer, cabinet, safe, fridge, microwave, garbagecan\n- **Appliances**: sinkbasin, bathtub, stoveburner, toaster\n\n### 2. Rank by Likelihood\nUse common-sense reasoning to prioritize where the target object is most likely found:\n\n| Object Type | High-Probability Receptacles |\n|-------------|------------------------------|\n| Kitchen items (knife, spatula, pan) | countertop, drawer, diningtable, stoveburner |\n| Food (apple, potato, tomato, bread) | fridge, countertop, diningtable, microwave |\n| Bathroom items (sponge, cloth, soap) | sinkbasin, bathtub, cart, shelf |\n| Electronics (cellphone, laptop, remote) | desk, sidetable, dresser, bed, coffeetable |\n| Stationery (pen, pencil, book) | desk, shelf, drawer, sidetable |\n| Lighting (candle, desklamp) | sidetable, shelf, desk, dresser |\n\n### 3. Navigate and Search\nFor each candidate receptacle (in priority order):\n1. `go to {receptacle}`\n2. Read the observation — does it mention the target object?\n - **YES**: `take {object} from {receptacle}` — object found\n - **NO**: If the receptacle is closed, `open {receptacle}` and re-check\n - **Still NO**: Move to the next candidate receptacle\n\n### 4. Track Searched Locations\nMaintain a list of already-searched receptacles to avoid revisiting them. If all high-probability locations are exhausted, expand the search to remaining receptacles.\n\n## Example\n\n**Task:** \"Clean the knife and put it in drawer.\"\n**Observation:** \"You are in the middle of a room. Looking quickly around you, you see a countertop 1, a drawer 1, a drawer 2, a fridge 1, a sinkbasin 1, a stoveburner 1.\"\n\n```\n> go to countertop 1\nOn the countertop 1, you see a knife 1, a saltshaker 2, a bread 1.\n> take knife 1 from countertop 1\nYou pick up the knife 1 from the countertop 1.\n```\n\n**Result:** Target object `knife 1` located and acquired from `countertop 1`.\n\n**Example — Object not at first location:**\n\n```\n> go to countertop 1\nOn the countertop 1, you see a saltshaker 2, a bread 1.\n> go to drawer 1\nThe drawer 1 is closed.\n> open drawer 1\nYou open the drawer 1. The drawer 1 is open. In it, you see a knife 1.\n> take knife 1 from drawer 1\nYou pick up the knife 1 from the drawer 1.\n```\n\n## Error Handling\n- **Object not found in any receptacle**: Re-check closed containers that may not have been opened. Some objects are only visible after opening.\n- **Multiple instances**: If the task requires a specific instance (e.g., `knife 1` vs `knife 2`), verify the object identifier matches before taking it.\n- **\"Nothing happened\"**: The `take` command may fail if the agent is not at the receptacle. Ensure navigation was successful before attempting to take.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-locator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-picker",
- "skillId": "alfworld-object-picker",
- "name": "alfworld-object-picker",
- "description": "Picks up a specified object from a given receptacle. Use this skill when the agent has located a required object and needs to acquire it for later use, such as taking an item from a surface or container. The skill requires the object and source receptacle as inputs, executing a 'take' action to transfer the object into the agent's inventory, enabling further manipulation like placement or usage.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-picker\ndescription: Picks up a specified object from a given receptacle. Use this skill when the agent has located a required object and needs to acquire it for later use, such as taking an item from a surface or container. The skill requires the object and source receptacle as inputs, executing a 'take' action to transfer the object into the agent's inventory, enabling further manipulation like placement or usage.\n---\n# Instructions\nExecute the `take` action to acquire the target object from the source receptacle.\n\n## Inputs\n- `object`: The identifier of the object to pick up (e.g., \"toiletpaper 1\").\n- `source_receptacle`: The identifier of the receptacle where the object is located (e.g., \"toilet 1\").\n\n## Process\n1. **Verify Context:** Ensure the agent is at the location of the `source_receptacle`. If not, the agent must navigate there first using a separate movement skill.\n2. **Execute Action:** Perform the action: `take {object} from {source_receptacle}`.\n3. **Handle Feedback:** If the environment indicates \"Nothing happened,\" consult the troubleshooting guide in `references/troubleshooting.md` for potential issues.\n\n## Output\n- The specified object is transferred to the agent's inventory.\n- The agent receives an observation confirming the successful pickup (e.g., \"You pick up the {object} from the {source_receptacle}\").\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-picker/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-placer",
- "skillId": "alfworld-object-placer",
- "name": "alfworld-object-placer",
- "description": "Places a held object onto or into a target receptacle. Trigger this skill when the agent is carrying an object and needs to deposit it at a specific location to complete a task, such as installing an item on a holder or storing it in a container. It takes the object and destination receptacle as inputs, performing a 'put' action to finalize the object's positioning according to the task goal.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-placer\ndescription: Places a held object onto or into a target receptacle. Trigger this skill when the agent is carrying an object and needs to deposit it at a specific location to complete a task, such as installing an item on a holder or storing it in a container. It takes the object and destination receptacle as inputs, performing a 'put' action to finalize the object's positioning according to the task goal.\n---\n# Instructions\n1. **Verify Prerequisites**:\n - Confirm you are currently holding the target object (`{obj}`).\n - Confirm the target receptacle (`{recep}`) is present and accessible in the environment.\n - If the receptacle is a container (e.g., cabinet, drawer), ensure it is open.\n\n2. **Navigate to Receptacle**:\n - Use the `go to {recep}` action to move to the target receptacle's location.\n\n3. **Execute Placement**:\n - Use the `put {obj} in/on {recep}` action to deposit the held object.\n - The phrasing (`in` vs `on`) is determined by the receptacle type (e.g., `in` for containers, `on` for surfaces/holders). Use the trajectory as a reference.\n\n4. **Handle Errors**:\n - If the environment responds with \"Nothing happened\", the action was invalid. Consult the `references/action_guide.md` for troubleshooting common failure modes.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-placer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-retriever",
- "skillId": "alfworld-object-retriever",
- "name": "alfworld-object-retriever",
- "description": "This skill picks up a target object from a specified receptacle after the object has been visually confirmed. Use this skill when the agent has located an object in a receptacle and needs to acquire it. It requires the object and source receptacle as inputs and results in the object being added to the agent's inventory.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-retriever\ndescription: This skill picks up a target object from a specified receptacle after the object has been visually confirmed. Use this skill when the agent has located an object in a receptacle and needs to acquire it. It requires the object and source receptacle as inputs and results in the object being added to the agent's inventory.\n---\n# Instructions\n\nUse this skill to acquire a target object from a known source receptacle in the ALFWorld environment.\n\n## Prerequisites\n1. **Visual Confirmation**: You must have directly observed the target object within the specified source receptacle in a prior observation (e.g., \"On the {recep}, you see a {obj}...\").\n2. **Proximity**: You should be at or near the location of the source receptacle.\n\n## Core Action Sequence\nExecute the following action precisely:\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-retriever/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-state-inspector",
- "skillId": "alfworld-object-state-inspector",
- "name": "alfworld-object-state-inspector",
- "description": "Inspects a receptacle's contents by navigating to it and reading the observation. Use when you need to check what is on or inside a receptacle (e.g., \"what's on the shelf\", \"is the holder empty\", \"check the table for items\"). Executes `go to {receptacle}`, parses the observation listing items present, and decides whether to take an item, search elsewhere, or proceed.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-state-inspector\ndescription: Inspects a receptacle's contents by navigating to it and reading the observation. Use when you need to check what is on or inside a receptacle (e.g., \"what's on the shelf\", \"is the holder empty\", \"check the table for items\"). Executes `go to {receptacle}`, parses the observation listing items present, and decides whether to take an item, search elsewhere, or proceed.\n---\n# Instructions\n\nInspect the state or contents of a target receptacle by navigating to it and parsing the environment's observation feedback.\n\n## Workflow\n1. **Navigate:** Execute `go to {target_receptacle}`\n2. **Read observation:** The environment automatically reports what is on/in the receptacle -- no additional inspection action is needed\n3. **Parse contents:** Look for patterns:\n - `\"On the {receptacle}, you see nothing.\"` -- receptacle is empty\n - `\"On the {receptacle}, you see a {item1}, and a {item2}.\"` -- items are present\n4. **Decide next action** based on the observation:\n - Empty: search elsewhere for the needed item\n - Item found: `take {item} from {receptacle}`\n - Wrong items: move on to the next receptacle\n\n## Error Recovery\n- \"Nothing happened\": the `go to` target name is invalid -- verify the receptacle name from your environment scan\n- This skill uses only `go to` for navigation; it does not use `open`, `close`, or `toggle`\n\n## Example\n\n**Scenario 1:** Check if a toiletpaperhanger has toilet paper.\n\n```\nAction: go to toiletpaperhanger 1\nObservation: On the toiletpaperhanger 1, you see nothing.\n```\n\n**Decision:** Holder is empty. Find a toiletpaper roll elsewhere and bring it here.\n\n**Scenario 2:** Check a toilet for available items.\n\n```\nAction: go to toilet 1\nObservation: On the toilet 1, you see a soapbottle 1, and a toiletpaper 1.\n```\n\n**Decision:** toiletpaper 1 is available. Execute `take toiletpaper 1 from toilet 1`.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-state-inspector/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-state-modifier",
- "skillId": "alfworld-object-state-modifier",
- "name": "alfworld-object-state-modifier",
- "description": "Uses an appliance to change the state of an object (cooling, heating, or cleaning). Use when the task requires altering an object's temperature or cleanliness using a specific device (e.g., cooling with a fridge, heating with a microwave, cleaning with a sinkbasin). Takes the object, target state, and appliance as inputs and executes the corresponding modifier action.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-state-modifier\ndescription: Uses an appliance to change the state of an object (cooling, heating, or cleaning). Use when the task requires altering an object's temperature or cleanliness using a specific device (e.g., cooling with a fridge, heating with a microwave, cleaning with a sinkbasin). Takes the object, target state, and appliance as inputs and executes the corresponding modifier action.\n---\n# Instructions\n\nChange an object's state (cool, heat, or clean) using a household appliance. You must be holding the target object before executing the state change.\n\n## Workflow\n1. **Navigate to appliance:** `go to {appliance}` (e.g., `go to fridge 1`)\n2. **Prepare if closed:** If observation says appliance is closed, execute `open {appliance}` -- verify it opens\n3. **Execute state change:** `{action} {obj} with {appliance}` -- verify observation confirms the change\n4. **Proceed:** Continue with the next task step (e.g., placing the modified object)\n\n## Action Mapping\n| State Change | Action | Typical Appliance |\n|---|---|---|\n| Cool | `cool {obj} with {appliance}` | `fridge 1` |\n| Heat | `heat {obj} with {appliance}` | `microwave 1`, `stoveburner 1` |\n| Clean | `clean {obj} with {appliance}` | `sinkbasin 1` |\n\n## Error Recovery\n- \"Nothing happened\": Check (1) you are holding the object, (2) appliance is open/ready, (3) object and appliance names are correct\n- Appliance occupied: remove existing items first with `take {item} from {appliance}`\n\n## Example\n\n**Scenario:** You need to cool a tomato using the fridge.\n\n```\nThought: I'm holding tomato 1 and need to cool it. I'll go to the fridge.\nAction: go to fridge 1\nObservation: The fridge 1 is closed.\nAction: open fridge 1\nObservation: You open the fridge 1. The fridge 1 is open. In it, you see a lettuce 1.\nAction: cool tomato 1 with fridge 1\nObservation: You cool the tomato 1 using the fridge 1.\n```\n\n**Result:** The tomato is now in a cooled state. Proceed with the next task step (e.g., placing it on a countertop).\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-state-modifier/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-storer",
- "skillId": "alfworld-object-storer",
- "name": "alfworld-object-storer",
- "description": "Use when the agent is holding an object and needs to place it into a target receptacle in ALFWorld. This skill checks receptacle suitability, opens closed containers if needed, and executes the `put` command to store the object. It handles both open surfaces (countertops, beds) and closed containers (drawers, cabinets).",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-storer\ndescription: Use when the agent is holding an object and needs to place it into a target receptacle in ALFWorld. This skill checks receptacle suitability, opens closed containers if needed, and executes the `put` command to store the object. It handles both open surfaces (countertops, beds) and closed containers (drawers, cabinets).\n---\n# Skill: Object Storer\n\n## When to Use\nTrigger this skill when:\n1. The agent is holding the target object (optionally cleaned/heated/cooled as required)\n2. A suitable storage receptacle has been identified\n3. The agent needs to execute the final placement step\n\n## Core Workflow\n\n### 1. Validate Prerequisites\n- Confirm the agent is holding `{object_name}` (check inventory)\n- Confirm the agent is at the location of `{target_receptacle}`\n- If not at the receptacle, navigate there first: `go to {target_receptacle}`\n\n### 2. Check Receptacle State\nEvaluate the receptacle before placing:\n\n| Receptacle State | Action |\n|-----------------|--------|\n| Open and empty/suitable | Proceed with `put` |\n| Closed (drawer, cabinet, safe) | `open {target_receptacle}` first, then `put` |\n| Unsuitable (wrong type, full) | Abort and search for alternative receptacle |\n\n### 3. Execute Storage\n- Run: `put {object_name} in/on {target_receptacle}`\n- Check the observation for confirmation\n\n### 4. Verify Placement\n- A successful placement updates the receptacle contents in the observation\n- If the observation confirms the object is now in/on the receptacle, storage is complete\n\n## Example\n\n**Task:** \"Clean the knife and put it in a drawer.\"\n\n```\n> go to drawer 1\nThe drawer 1 is closed.\n> open drawer 1\nYou open the drawer 1. The drawer 1 is open. In it, you see nothing.\n> put knife 1 in/on drawer 1\nYou put the knife 1 in/on the drawer 1.\n```\n\n**Result:** `knife 1` is now stored in `drawer 1`. Task complete.\n\n**Example 2 — Open surface:**\n\n```\n> go to bed 1\nOn the bed 1, you see a pillow 1.\n> put cellphone 2 in/on bed 1\nYou put the cellphone 2 in/on the bed 1.\n```\n\n## Error Handling\n- **\"Nothing happened\"**: The agent may not be holding the object, or the receptacle name is incorrect. Verify with `inventory` and re-check the receptacle identifier.\n- **Receptacle unsuitable**: If the receptacle is not appropriate for the object, search for an alternative using the object-locator skill.\n- **Agent not at receptacle**: Navigate to the receptacle with `go to {target_receptacle}` before attempting `put`.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-storer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-object-transporter",
- "skillId": "alfworld-object-transporter",
- "name": "alfworld-object-transporter",
- "description": "Picks up a target object from its current receptacle and moves it to a specified destination receptacle. Use when you have located an object and need to relocate it to complete a task (e.g., moving a laptop to a desk). Takes the object identifier, source receptacle, and destination receptacle as inputs and outputs the action sequence to take, transport, and place the object.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-object-transporter\ndescription: Picks up a target object from its current receptacle and moves it to a specified destination receptacle. Use when you have located an object and need to relocate it to complete a task (e.g., moving a laptop to a desk). Takes the object identifier, source receptacle, and destination receptacle as inputs and outputs the action sequence to take, transport, and place the object.\n---\n# Instructions\n\nPick up an object from its current location and transport it to a destination receptacle.\n\n## Workflow\n1. **Navigate to source:** `go to {source_receptacle}` -- verify observation shows the target object\n2. **Pick up:** `take {object} from {source_receptacle}` -- verify \"You pick up\" confirmation\n3. **Navigate to destination:** `go to {destination_receptacle}`\n4. **Place:** `put {object} in/on {destination_receptacle}` -- verify \"You put\" confirmation\n\n## Action Format\n- `go to {receptacle}`\n- `take {object} from {receptacle}`\n- `put {object} in/on {receptacle}`\n\n## Error Recovery\n- \"Nothing happened\" on take: verify you are at the correct receptacle and the object name matches the observation\n- \"Nothing happened\" on put: verify you are holding the object and at the correct destination\n- Object not visible: re-scan the environment to locate it before retrying\n\n## Example\n\n**Scenario:** Move `laptop 1` from `bed 2` to `desk 1`.\n\n```\nAction: go to bed 2\nObservation: On the bed 2, you see a laptop 1, a pillow 1.\nAction: take laptop 1 from bed 2\nObservation: You pick up the laptop 1 from the bed 2.\nAction: go to desk 1\nObservation: On the desk 1, you see a pen 2.\nAction: put laptop 1 in/on desk 1\nObservation: You put the laptop 1 in/on the desk 1.\n```\n\n**Result:** The laptop has been transported from the bed to the desk.\n\n## Bundled Resources\n- **Script**: `scripts/transport_sequence.py` provides a deterministic sequence generator.\n- **Reference**: `references/troubleshooting.md` contains common failure patterns and solutions.\n",
- "path": "experiments/src/skills/alfworld/alfworld-object-transporter/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-open-receptacle",
- "skillId": "alfworld-open-receptacle",
- "name": "alfworld-open-receptacle",
- "description": "This skill opens a closed receptacle to access its contents. It should be triggered when an agent needs to interact with items inside a closed container (e.g., fridge, microwave, drawer). The skill takes a receptacle identifier as input, performs the open action, and outputs the observation of the interior, enabling subsequent item retrieval or placement.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-open-receptacle\ndescription: This skill opens a closed receptacle to access its contents. It should be triggered when an agent needs to interact with items inside a closed container (e.g., fridge, microwave, drawer). The skill takes a receptacle identifier as input, performs the open action, and outputs the observation of the interior, enabling subsequent item retrieval or placement.\n---\n# Skill: Open Receptacle\n\n## Purpose\nOpen a closed container to reveal its contents for subsequent interaction.\n\n## When to Use\nUse this skill when:\n- You need to take an item from inside a closed receptacle\n- You need to put an item into a closed receptacle\n- You observe a receptacle is closed (e.g., \"The fridge 1 is closed\")\n- The task requires accessing items inside containers\n\n## Input Format\nThe skill requires a receptacle identifier as input. This should match the environment's naming convention (e.g., \"fridge 1\", \"microwave 1\", \"drawer 3\").\n\n## Execution Steps\n1. **Verify receptacle state**: Check if the receptacle is mentioned as \"closed\" in the observation\n2. **Navigate to receptacle**: Use `go to {recep}` if not already at the location\n3. **Execute open action**: Use `open {recep}` where `{recep}` is the receptacle identifier\n4. **Process result**: The environment will respond with the interior contents or an error\n\n## Expected Outcomes\n- **Success**: Observation showing the receptacle is open and listing contained items\n- **Failure**: \"Nothing happened\" indicates the action was invalid (e.g., already open, wrong identifier)\n\n## Example from Trajectory\n",
- "path": "experiments/src/skills/alfworld/alfworld-open-receptacle/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-closer",
- "skillId": "alfworld-receptacle-closer",
- "name": "alfworld-receptacle-closer",
- "description": "Closes an open receptacle to maintain environment tidiness after inspection. Use when you have finished searching a container (drawer, cabinet, fridge) and no longer need it open. Takes a receptacle identifier as input and outputs confirmation that the receptacle is closed, preventing clutter during multi-step search tasks.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-closer\ndescription: Closes an open receptacle to maintain environment tidiness after inspection. Use when you have finished searching a container (drawer, cabinet, fridge) and no longer need it open. Takes a receptacle identifier as input and outputs confirmation that the receptacle is closed, preventing clutter during multi-step search tasks.\n---\n# Skill: Receptacle Closer\n\n## When to Use\nUse this skill **immediately after** you have finished inspecting the contents of an open receptacle (e.g., a drawer, cabinet, or container) and have determined you no longer need it to remain open. This is a cleanup action to maintain a tidy environment.\n\n## Core Instruction\n1. **Identify the Target:** The target is the receptacle you just finished searching. It must be open.\n2. **Execute Action:** Perform the `close` action on the identified receptacle.\n3. **Format:** Your output must follow the standard action format: `Action: close {recep}`\n\n## Example from Trajectory\n* **Context:** After opening and inspecting `drawer 2` (finding it empty), the agent closed it.\n* **Thought:** \"I should close drawer 2 to keep the room tidy and continue my search.\"\n* **Action:** `close drawer 2`\n\n## Key Principle\nThis is a low-cognitive-load, procedural step. Do not overthink it. If you opened a receptacle to look inside and are done with it, close it.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-closer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-finder",
- "skillId": "alfworld-receptacle-finder",
- "name": "alfworld-receptacle-finder",
- "description": "Searches for a suitable empty or appropriately occupied receptacle (like a shelf or table) to place an object. Use when you are holding an object that needs to be stored or placed and must find a receptacle that meets the placement criteria. Examines candidate receptacles by navigating to and inspecting each one until a suitable location is found.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-finder\ndescription: Searches for a suitable empty or appropriately occupied receptacle (like a shelf or table) to place an object. Use when you are holding an object that needs to be stored or placed and must find a receptacle that meets the placement criteria. Examines candidate receptacles by navigating to and inspecting each one until a suitable location is found.\n---\n# Instructions\n\n**Trigger:** Use this skill when you have an object in your inventory that needs to be stored or placed, and you must find a suitable receptacle (e.g., shelf, table, basin).\n\n## Core Procedure\n1. **Identify Target Object:** Confirm the object you are holding and its state (e.g., `soapbar 1`, `clean`).\n2. **Survey Environment:** Use `go to {recep}` actions to navigate to and visually inspect candidate receptacles from the observation list.\n3. **Evaluate Candidates:** For each receptacle, assess its suitability:\n * **Primary Goal:** Find an **empty receptacle**.\n * **Fallback:** If no empty receptacle is available, identify one that can logically accommodate the object without conflict (e.g., a shelf with a tissuebox may still have space for a soapbar).\n4. **Select & Place:** Navigate to the chosen suitable receptacle and execute `put {obj} in/on {recep}`.\n\n## Key Considerations\n* **Object State:** Ensure the object meets any required pre-conditions (e.g., `clean`) before searching for a receptacle. Use skills like `clean` if necessary.\n* **Efficiency:** Prioritize receptacles that are logically appropriate for the object (e.g., a `shelf` for a `soapbar` over a `toilet`).\n* **Observation Parsing:** Carefully read the observation after each `go to` action. The line \"On the {recep}, you see...\" lists its contents. \"you see nothing.\" indicates it is empty.\n* **Invalid Actions:** If an action fails (\"Nothing happened\"), re-evaluate your target and try a different receptacle or confirm the object is in your inventory.\n\n## Example\n\n**Scenario:** You are holding `soapbar 1` (clean) and need to find an empty shelf to place it.\n\n```\nThought: I need to find an empty shelf for the soapbar. I'll check shelf 1 first.\nAction: go to shelf 1\nObservation: On the shelf 1, you see a tissuebox 1.\nThought: Shelf 1 has items. Let me try shelf 2.\nAction: go to shelf 2\nObservation: On the shelf 2, you see nothing.\nAction: put soapbar 1 in/on shelf 2\nObservation: You put the soapbar 1 in/on the shelf 2.\n```\n\n**Result:** Found an empty shelf and placed the soapbar on it.\n\n## Bundled Reference\nFor a detailed example including handling object pre-cleaning and sequential shelf evaluation, refer to `references/example_trajectory.md`.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-finder/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-navigator",
- "skillId": "alfworld-receptacle-navigator",
- "name": "alfworld-receptacle-navigator",
- "description": "Plans and executes movement to a target receptacle within the ALFWorld environment. Use when the agent needs to reach a specific location before interacting with objects there (e.g., go to fridge to cool an item, go to garbagecan to dispose of an item). Takes a receptacle identifier as input, executes the `go to` action, and outputs confirmation of arrival at the destination.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-navigator\ndescription: Plans and executes movement to a target receptacle within the ALFWorld environment. Use when the agent needs to reach a specific location before interacting with objects there (e.g., go to fridge to cool an item, go to garbagecan to dispose of an item). Takes a receptacle identifier as input, executes the `go to` action, and outputs confirmation of arrival at the destination.\n---\n# Skill: Receptacle Navigator\n\n## Purpose\nNavigate to a specified receptacle (e.g., `fridge 1`, `garbagecan 1`, `diningtable 1`) in an ALFWorld household environment. This is a foundational skill for positioning the agent to perform subsequent object interactions.\n\n## When to Use\nTrigger this skill when the agent's plan requires:\n1. **Accessing a location** to interact with an object there (e.g., \"go to fridge to cool an item\").\n2. **Interacting with the receptacle itself** (e.g., \"go to garbagecan to dispose of an item\").\n\n## Core Logic\n1. **Input Parsing:** Extract the target receptacle name (e.g., `fridge 1`) from the current task context or observation.\n2. **Action Execution:** Output the ALFWorld action: `go to {target_receptacle}`.\n3. **Success Verification:** Confirm the action was successful by checking the observation for evidence of arrival (e.g., \"You are at the {receptacle}\" or the receptacle is now in the observable list).\n\n## Instructions\n1. Identify the target receptacle from the goal or current observation.\n2. Execute the `go to` action.\n3. If the environment responds with \"Nothing happened\", the action was invalid. Consult the `references/common_receptacles.md` list and the latest observation to formulate a new `go to` target.\n4. Upon successful navigation, proceed with the next skill in the plan (e.g., `alfworld-object-interactor`).\n\n## Example\n\n**Input:** `target_receptacle: fridge 1`\n\n**Sequence:**\n1. `go to fridge 1` → Observation: \"You are at fridge 1. On the fridge 1, you see nothing.\"\n\n**Output:** Agent has arrived at fridge 1 and can now interact with it (open, take items, cool objects, etc.).\n\n## Error Handling\n- **Invalid Target:** If \"Nothing happened\" is observed, the receptacle may be unreachable or incorrectly named. Re-analyze the scene description to find a valid path or alternative receptacle.\n- **Already at Location:** If the observation indicates you are already at the target, skip the `go to` action and proceed.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-navigator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-opener",
- "skillId": "alfworld-receptacle-opener",
- "name": "alfworld-receptacle-opener",
- "description": "This skill opens a closed receptacle to allow access to its contents or to enable interaction with it. It should be triggered when the agent encounters a closed receptacle (e.g., 'The fridge 1 is closed.') that must be opened to proceed with a task, such as cooling an item with a fridge or taking an object from inside a cabinet. The skill outputs the 'open' action on the specified receptacle.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-opener\ndescription: This skill opens a closed receptacle to allow access to its contents or to enable interaction with it. It should be triggered when the agent encounters a closed receptacle (e.g., 'The fridge 1 is closed.') that must be opened to proceed with a task, such as cooling an item with a fridge or taking an object from inside a cabinet. The skill outputs the 'open' action on the specified receptacle.\n---\n# Skill: Open Closed Receptacle\n\n## Trigger Condition\nUse this skill when the environment observation explicitly states that a receptacle is **closed** and opening it is necessary to proceed with your current task. The typical observation pattern is: `\"The <receptacle_name> is closed.\"`\n\n## Action\nExecute the `open` action on the identified receptacle.\n\n## Procedure\n1. **Identify the Receptacle:** From the observation, extract the name of the closed receptacle (e.g., `fridge 1`, `cabinet 12`, `safe 1`).\n2. **Execute Action:** Output the action in the format: `Action: open <receptacle_name>`.\n\n## Example from Trajectory\n* **Observation:** `\"The fridge 1 is closed.\"`\n* **Thought:** `The fridge is closed. I need to open it to access the cooling compartment.`\n* **Action:** `Action: open fridge 1`\n\n## Notes\n* This is a fundamental, low-level skill for enabling access. After opening the receptacle, you may need to use other skills (e.g., `take`, `cool`, `put`) to complete your objective.\n* Do not use this skill if the receptacle is already described as open or if its state is not mentioned.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-opener/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-operator",
- "skillId": "alfworld-receptacle-operator",
- "name": "alfworld-receptacle-operator",
- "description": "This skill opens or closes a receptacle (like a fridge, cabinet, or microwave) to access its interior or secure it. It should be triggered when an object needs to be placed inside/retrieved from a closed container, or when an open container should be closed (e.g., for energy efficiency or task cleanliness). The skill decides the appropriate 'open' or 'close' action based on the receptacle's current state and the task context.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-operator\ndescription: This skill opens or closes a receptacle (like a fridge, cabinet, or microwave) to access its interior or secure it. It should be triggered when an object needs to be placed inside/retrieved from a closed container, or when an open container should be closed (e.g., for energy efficiency or task cleanliness). The skill decides the appropriate 'open' or 'close' action based on the receptacle's current state and the task context.\n---\n# Skill: Receptacle Operator\n\n## When to Use\nUse this skill when you need to:\n1. **Access a closed receptacle** to place an object inside or take an object out.\n2. **Secure an open receptacle** after accessing it (e.g., to conserve energy, maintain cleanliness, or complete a task step).\n\n## Core Decision Logic\n1. **Check the receptacle's state** from the observation.\n - If it reports \"is closed\" or \"is open\", note the state.\n - If the interior is visible (e.g., \"In it, you see...\"), it is open.\n2. **Choose action based on goal**:\n - **Goal requires interior access** (e.g., \"put in microwave\", \"take from fridge\"):\n - If closed → `open {recep}`\n - If open → proceed with next step (e.g., `put` or `take`)\n - **Goal requires securing receptacle** (e.g., after accessing, or for efficiency):\n - If open → `close {recep}`\n - If closed → no action needed\n3. **Execute the action** using the exact format: `Action: open {recep}` or `Action: close {recep}`\n\n## Example from Trajectory\n- **Task**: \"cool some tomato and put it in microwave\"\n- **Step 1**: At closed fridge → `Action: open fridge 1`\n- **Step 2**: After checking interior → `Action: close fridge 1` (for efficiency)\n- **Step 3**: At closed microwave → `Action: open microwave 1`\n\n## Important Notes\n- Always verify the receptacle state from the latest observation before acting.\n- The skill only handles `open` and `close` actions. Other actions (like `take`, `put`, `cool`) are separate skills.\n- If \"Nothing happened\" is observed after your action, the receptacle may already be in that state—re-check and adjust.\n\nFor detailed state diagrams and edge cases, see the reference documentation.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-operator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-preparer",
- "skillId": "alfworld-receptacle-preparer",
- "name": "alfworld-receptacle-preparer",
- "description": "This skill verifies and prepares a target receptacle for receiving an object. It is triggered before placing an item into a receptacle (e.g., a garbage can) to ensure the receptacle is accessible and suitable. The skill involves navigating to the receptacle, observing its state (e.g., open/closed, occupied), and performing any necessary preparatory actions like opening it, resulting in a ready-to-use target location.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-preparer\ndescription: This skill verifies and prepares a target receptacle for receiving an object. It is triggered before placing an item into a receptacle (e.g., a garbage can) to ensure the receptacle is accessible and suitable. The skill involves navigating to the receptacle, observing its state (e.g., open/closed, occupied), and performing any necessary preparatory actions like opening it, resulting in a ready-to-use target location.\n---\n# Instructions\n\n**Trigger:** This skill is invoked when the agent's goal requires placing an object into a target receptacle (e.g., \"put X in/on Y\").\n\n## Core Procedure\n1. **Navigate:** Use `go to {target_receptacle}` to move to the target receptacle's location.\n2. **Observe:** Upon arrival, carefully read the environment's observation. It will describe the receptacle's state and any contents.\n3. **Analyze & Prepare:** Based on the observation, determine if the receptacle is ready.\n * **Ready State:** The receptacle is described as present and accessible (e.g., \"On the garbagecan 1, you see a cd 1.\"). No further action is needed. Proceed to place the object.\n * **Blocked/Closed State:** If the receptacle is closed, latched, or obstructed, use the appropriate action (`open {recep}`, `toggle {obj} {recep}`) to prepare it.\n * **Invalid Target:** If the observation indicates the receptacle does not exist or cannot be interacted with (\"Nothing happened\"), you must abort this skill and re-plan your task strategy.\n4. **Confirm:** After any preparatory action, observe the environment's feedback to confirm the receptacle is now ready.\n\n## Key Principles\n* **Efficiency:** This skill is a preparatory step. Do not spend turns searching for the object to be placed here. That is a separate \"search\" skill.\n* **Context:** The observation text is your only source of truth about the receptacle's state. Interpret it literally.\n* **Idempotency:** If the receptacle is already ready, this skill completes immediately with no action required beyond observation.\n\n## Example from Trajectory\n**Goal Context:** \"find two pen and put them in garbagecan.\"\n**Skill Execution:**\n1. Thought: \"I'll check the garbage can first to ensure it's open and ready to receive items.\"\n2. Action: `go to garbagecan 1`\n3. Observation: \"On the garbagecan 1, you see a cd 1.\"\n4. Analysis: The garbage can is present and accessible (a CD inside does not block new items). It is **ready**.\n5. Outcome: Skill completes. The agent proceeds to `put pen 3 in/on garbagecan 1`.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-preparer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-receptacle-searcher",
- "skillId": "alfworld-receptacle-searcher",
- "name": "alfworld-receptacle-searcher",
- "description": "This skill searches for a specific receptacle (e.g., garbage can, cabinet) by systematically exploring the environment, checking multiple locations until found. Trigger when the target receptacle is not initially visible, often after scanning nearby areas. It outputs the receptacle's location and may involve navigating through multiple waypoints.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-receptacle-searcher\ndescription: This skill searches for a specific receptacle (e.g., garbage can, cabinet) by systematically exploring the environment, checking multiple locations until found. Trigger when the target receptacle is not initially visible, often after scanning nearby areas. It outputs the receptacle's location and may involve navigating through multiple waypoints.\n---\n# Instructions\n\n## When to Use\nUse this skill when you need to locate a specific receptacle (e.g., `garbagecan 1`, `cabinet 3`) that is not immediately visible in your current observation. The skill is triggered after an initial scan of nearby areas fails to reveal the target.\n\n## Core Procedure\n1. **Identify Target**: Confirm the exact name of the receptacle you need to find (e.g., from the task: \"put a cool lettuce in garbagecan\" -> target is `garbagecan 1`).\n2. **Initial Check**: Quickly examine the most common or nearby receptacles mentioned in the initial observation (e.g., countertops, tables, open cabinets).\n3. **Systematic Search**: If not found, begin a systematic exploration:\n - Use the `go to {recep}` action to navigate to candidate locations.\n - Prioritize receptacles that are typically in the environment (cabinets, countertops, tables).\n - If a candidate is closed (e.g., \"The cabinet 2 is closed.\"), you may skip opening it unless the target could logically be inside. The trajectory shows that the target receptacle (`garbagecan 1`) was not inside any closed cabinet.\n4. **Persistence**: Continue the search until the target is found. The trajectory demonstrates checking 20 cabinets before finally locating the garbage can.\n5. **Output**: Once found, note the receptacle's location and state (e.g., \"On the garbagecan 1, you see nothing.\"). You are now ready to use this receptacle for the next task action (e.g., `put lettuce 1 in/on garbagecan 1`).\n\n## Key Notes\n- **Efficiency**: The search pattern in the trajectory was exhaustive (checking all cabinets 1-20). In practice, you might infer likely locations based on receptacle type (e.g., a garbage can is often standalone, not inside a cabinet).\n- **Error Handling**: If an action returns \"Nothing happened\", the receptacle may not be accessible or may require a different approach (e.g., opening first).\n- **Integration**: This skill outputs the found receptacle's identifier. It does not perform the final task action (e.g., putting an item in the receptacle); that is handled by the main task orchestration.\n\n## Example from Trajectory\n**Goal**: Find `garbagecan 1`.\n**Process**:\n1. Checked `countertop 1`, `diningtable 1`, `diningtable 2` (not found).\n2. Systematically went to `cabinet 1` through `cabinet 20` (all closed, not found).\n3. Finally went directly to `garbagecan 1` (found).\n**Output**: Location of `garbagecan 1` confirmed.\n",
- "path": "experiments/src/skills/alfworld/alfworld-receptacle-searcher/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-search-pattern-executor",
- "skillId": "alfworld-search-pattern-executor",
- "name": "alfworld-search-pattern-executor",
- "description": "Systematically searches a sequence of likely locations for a target object based on common sense. Use when you need to find a specific object and know which receptacles to check but not which one contains it. Takes a list of candidate receptacles, orchestrates navigation and inspection, and outputs when the target is found or all locations are exhausted.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-search-pattern-executor\ndescription: Systematically searches a sequence of likely locations for a target object based on common sense. Use when you need to find a specific object and know which receptacles to check but not which one contains it. Takes a list of candidate receptacles, orchestrates navigation and inspection, and outputs when the target is found or all locations are exhausted.\n---\n# Instructions\n\nFor each candidate receptacle in order, execute this action sequence:\n\n## Workflow\n1. **Navigate:** `go to {receptacle}`\n2. **Open if closed:** If observation says \"{receptacle} is closed\", execute `open {receptacle}`\n3. **Inspect:** Read the observation for the target object name\n4. **If found:** Execute `take {target_object} from {receptacle}` and stop searching\n5. **If not found:** If you opened the receptacle, execute `close {receptacle}`, then continue to the next candidate\n6. **If all exhausted:** Report that the target was not found in any candidate location\n\n## Action Format\n- `go to {receptacle}` -- navigate to a location\n- `open {receptacle}` -- open a closed drawer/cabinet/fridge\n- `close {receptacle}` -- close after checking (state management)\n- `take {object} from {receptacle}` -- pick up the target when found\n\n## Key Rules\n- Search candidates in order; do not skip locations\n- Always close drawers/cabinets after checking if you opened them\n- Once the object is found, immediately stop searching and proceed to the next task phase\n- If \"Nothing happened\" is returned, verify the receptacle name and retry with the correct identifier\n\n## Example\n\n**Goal:** \"find two remotecontrol and put them in armchair.\"\n\n```\nThought: I need to find remotecontrol. Candidates: sofa 1, sidetable 1, coffeetable 1. Starting search.\nAction: go to sofa 1\nObservation: On the sofa 1, you see a pillow 1.\nThought: No remotecontrol on sofa 1. Checking next candidate.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a keychain 1.\nThought: Not here either. Checking coffeetable.\nAction: go to coffeetable 1\nObservation: On the coffeetable 1, you see a remotecontrol 1, a remotecontrol 2.\nAction: take remotecontrol 1 from coffeetable 1\nObservation: You pick up the remotecontrol 1 from the coffeetable 1.\n```\n\n**Result:** First remotecontrol found and picked up. Proceed to place it in `armchair 1`, then re-activate search for the second one.\n",
- "path": "experiments/src/skills/alfworld/alfworld-search-pattern-executor/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-search-verifier",
- "skillId": "alfworld-search-verifier",
- "name": "alfworld-search-verifier",
- "description": "Re-examines previously visited locations to confirm the absence of a target object or to check for overlooked items. Use when an initial search fails to find enough objects or when double-checking is required before concluding task failure. Systematically revisits receptacles, re-opens closed containers, and re-inspects contents to ensure no viable location was missed.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-search-verifier\ndescription: Re-examines previously visited locations to confirm the absence of a target object or to check for overlooked items. Use when an initial search fails to find enough objects or when double-checking is required before concluding task failure. Systematically revisits receptacles, re-opens closed containers, and re-inspects contents to ensure no viable location was missed.\n---\n# Instructions\n\n**Trigger Condition:** Use this skill when an initial search for a target object (e.g., `cellphone`) has been performed but the required quantity has not been found, or when you need to verify that no viable location was missed before task failure.\n\n## Core Procedure\n\n1. **Initialize Tracking:** Maintain a mental or explicit list of all receptacles (`recep`) you have already visited during your initial search (e.g., `sidetable 1`, `shelf 1-8`, `drawer 1`, `drawer 2`, `desk 1`).\n\n2. **Systematic Revisit:** Do not search new, unvisited locations. Instead, systematically return to each previously visited receptacle in a logical order (e.g., by proximity or by the original search sequence).\n * **Action:** Use `go to {recep}` to navigate.\n * **For Closed Receptacles:** If a receptacle was closed during the initial search and you opened it, it may be closed again. Re-open it to verify its contents.\n * **Action:** Use `open {recep}`.\n * **For Open/Empty Receptacles:** Observe the contents again. The state may have changed, or an item may have been overlooked.\n * **Action:** No action needed; read the `Observation`.\n\n3. **Verification Logic:** For each revisited location:\n * If the target object is now present, retrieve it (`take {obj} from {recep}`) and proceed with the main task.\n * If the location is confirmed to lack the target object, note it as thoroughly checked and move to the next location on your list.\n * If you encounter a closed receptacle you previously assumed was empty, opening it is a critical verification step.\n\n4. **Conclusion:** After revisiting all locations on your list:\n * **If the target object was found:** Integrate it into your main task plan.\n * **If the target object was not found:** You can conclusively report that the object is not available in the searched area and adjust your task strategy accordingly (e.g., consider task failure or exploring a new, unsearched area).\n\n## Example\n\n**Scenario:** You need two cellphones but only found one. Revisiting previously searched locations.\n\n```\nThought: I only found 1 cellphone but need 2. Let me revisit sidetable 1 which I checked earlier.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a cellphone 2, a keychain 1.\nThought: Found cellphone 2! I must have overlooked it during the initial search.\nAction: take cellphone 2 from sidetable 1\nObservation: You pick up the cellphone 2 from the sidetable 1.\n```\n\n**Result:** The second cellphone was found by re-examining a previously visited location.\n\n## Thought Process Template\nWhen executing this skill, structure your reasoning as follows:\n",
- "path": "experiments/src/skills/alfworld/alfworld-search-verifier/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-storage-explorer",
- "skillId": "alfworld-storage-explorer",
- "name": "alfworld-storage-explorer",
- "description": "Systematically explores storage receptacles (drawers, cabinets, shelves) to find an appropriate placement location for an object. Use when the agent needs to store an item but the exact target receptacle is unknown or ambiguous. Opens, inspects, and closes candidate receptacles to assess suitability, then places the object in the best match.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-storage-explorer\ndescription: Systematically explores storage receptacles (drawers, cabinets, shelves) to find an appropriate placement location for an object. Use when the agent needs to store an item but the exact target receptacle is unknown or ambiguous. Opens, inspects, and closes candidate receptacles to assess suitability, then places the object in the best match.\n---\n# Skill: Storage Explorer\n\n## When to Use\nActivate this skill when:\n1. You have an object that needs to be stored/placed.\n2. The exact target receptacle is unspecified or ambiguous.\n3. You need to validate if a potential receptacle is appropriate before placing the object.\n\n## Core Strategy\n1. **Prioritize Exploration**: When the target location is unclear, systematically check available storage receptacles.\n2. **Inspect Before Placing**: Always open and examine a receptacle's contents before deciding to place your object there.\n3. **Maintain Environment State**: Close receptacles after inspection unless you're placing the object inside.\n\n## Execution Pattern\nFollow this decision flow:\n\n### Phase 1: Initial Assessment\n- Identify all potential storage receptacles in the environment (drawers, cabinets, etc.)\n- If you already have the target object, proceed to Phase 2\n- If you don't have the object, acquire it first (this skill focuses on storage exploration)\n\n### Phase 2: Systematic Exploration\nFor each candidate receptacle:\n1. **Navigate** to the receptacle\n2. **Open** it (if closed)\n3. **Observe** its contents\n4. **Evaluate** suitability based on:\n - Current contents (are similar objects stored here?)\n - Available space\n - Logical categorization\n5. **Close** the receptacle (unless placing object there)\n\n### Phase 3: Decision Making\n- If you find a clearly appropriate receptacle (e.g., contains similar objects), place your object there\n- If no receptacle is clearly appropriate, choose based on:\n - Empty receptacles first\n - Proximity to related objects/areas\n - Consistency with environment patterns\n\n## Key Considerations\n- **Efficiency**: Don't explore receptacles that are clearly inappropriate (e.g., refrigerator for non-food items)\n- **Context Clues**: Look for environmental hints about storage organization\n- **Task Requirements**: Consider if the object needs special conditions (clean, cooled, heated)\n\n## Error Handling\n- If \"Nothing happened\" when trying to open/close, the receptacle might be locked or broken\n- If unable to place object in a receptacle, try alternative locations\n- If all exploration fails, reconsider your understanding of \"appropriate\" storage\n\n## Example\n\n**Task:** \"Put a clean sponge in drawer.\"\n\n**Input:** Holding `sponge 1` (already cleaned). Target type: drawer.\n\n**Sequence:**\n1. `go to drawer 1` → Observation: \"You are at drawer 1.\"\n2. `open drawer 1` → Observation: \"You open the drawer 1. The drawer 1 is open. You see nothing.\"\n3. `put sponge 1 in/on drawer 1` → Observation: \"You put the sponge 1 in/on the drawer 1.\"\n\n**Output:** The sponge 1 has been stored in drawer 1. Task complete.\n\n## Output Format\nMaintain the standard action format:\n",
- "path": "experiments/src/skills/alfworld/alfworld-storage-explorer/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-task-verifier",
- "skillId": "alfworld-task-verifier",
- "name": "alfworld-task-verifier",
- "description": "Use when the agent needs to check whether an ALFWorld task objective has been met after completing a sub-action (e.g., placing an object). This skill parses the task goal, evaluates the latest environment observation, and outputs a verification decision — task complete, task incomplete, or action ineffective — to guide the next step.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-task-verifier\ndescription: Use when the agent needs to check whether an ALFWorld task objective has been met after completing a sub-action (e.g., placing an object). This skill parses the task goal, evaluates the latest environment observation, and outputs a verification decision — task complete, task incomplete, or action ineffective — to guide the next step.\n---\n# Skill: Task Verifier for ALFWorld\n\n## When to Use\nTrigger this skill when:\n1. The agent has just completed a key sub-action (e.g., `put {obj} in/on {recep}`)\n2. The agent needs to determine whether the overall task goal is satisfied\n3. The agent must decide whether to continue searching or conclude the task\n\n## Core Workflow\n\n### 1. Parse the Task Goal\nExtract from the original task description:\n- **Target object(s)**: What needs to be found/placed (including quantity)\n- **Target receptacle**: Where objects must end up\n- **Required transformations**: Any cleaning, heating, or cooling steps\n\n### 2. Analyze the Observation\nEvaluate the most recent `Observation:` text from the environment:\n- Look for evidence that required objects are present in the target receptacle\n- Count how many target objects have been successfully placed\n- Note: Other items in the receptacle do not invalidate success\n\n### 3. Make a Verification Decision\n\n| Condition | Decision | Output |\n|-----------|----------|--------|\n| All required objects confirmed in target receptacle | Complete | `Verification: Task complete. No further action needed.` |\n| Some but not all objects placed | Incomplete | `Verification: Task incomplete. Continue searching for {missing object(s)}.` |\n| Observation says \"Nothing happened\" | Ineffective | `Verification: Last action was ineffective. Re-assess and try a different approach.` |\n| Object placed in wrong receptacle | Incorrect | `Verification: Object placed in wrong location. Retrieve and redirect to {correct receptacle}.` |\n\n### 4. Output Format\nOutput **only** the verification decision. Do not output the next action. This skill informs the planning for the next step, not the execution.\n\n## Example\n\n**Task:** \"Find two pen and put them in garbagecan.\"\n\n```\nAction: put pen 3 in/on garbagecan 1\nObservation: You put the pen 3 in/on the garbagecan 1.\n\n> Verification: Task incomplete. Continue searching for pen (1 of 2 placed).\n\nAction: put pen 1 in/on garbagecan 1\nObservation: You put the pen 1 in/on the garbagecan 1.\n\n> Verification: Task complete. No further action needed.\n```\n\n**Example — Failed action:**\n\n```\nAction: put pen 3 in/on garbagecan 1\nObservation: Nothing happened.\n\n> Verification: Last action was ineffective. Re-assess and try a different approach.\n```\n\n## Error Handling\n- **Ambiguous observation**: If the observation does not clearly confirm or deny placement, navigate to the target receptacle and re-examine it to get an updated state.\n- **Quantity tracking**: For multi-object tasks, maintain a running count. Re-examine the target receptacle if the count is uncertain.\n",
- "path": "experiments/src/skills/alfworld/alfworld-task-verifier/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-temperature-regulator",
- "skillId": "alfworld-temperature-regulator",
- "name": "alfworld-temperature-regulator",
- "description": "Manages the temperature state of an object by placing it into an appropriate appliance (fridge for cooling, microwave for heating). Use when the task requires modifying an object's temperature property, such as \"cool some bread\" or \"heat some food\". Takes the object identifier, temperature-modifying receptacle, and final target receptacle as inputs, and outputs the object at the target location with its temperature state changed.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-temperature-regulator\ndescription: Manages the temperature state of an object by placing it into an appropriate appliance (fridge for cooling, microwave for heating). Use when the task requires modifying an object's temperature property, such as \"cool some bread\" or \"heat some food\". Takes the object identifier, temperature-modifying receptacle, and final target receptacle as inputs, and outputs the object at the target location with its temperature state changed.\n---\n# Instructions\nThis skill executes a sequence to change an object's temperature by placing it in a specific receptacle (e.g., fridge for cooling, microwave for heating) and then relocating it to a final target location.\n\n## 1. Input Validation & Planning\n* **Inputs Required:** The `object` identifier (e.g., `bread 1`) and the `temperature_receptacle` identifier (e.g., `fridge 1` for cooling, `microwave 1` for heating). The final `target_receptacle` (e.g., `diningtable 1`) is also required.\n* **Verify** the provided object and receptacles exist in the agent's current observation. If not, the agent must first navigate to locate them.\n* **Plan** the sequence: Locate object -> Pick up object -> Navigate to temperature receptacle -> Open it (if closed) -> Place object inside -> Close receptacle (optional, based on environment feedback) -> Navigate to target receptacle -> Place object there.\n\n## 2. Execution Sequence\nFollow this core logic. Use deterministic scripts for error-prone steps (see `scripts/`).\n1. **Acquire Object:** `go to` the object's location, then `take {object} from {recep}`.\n2. **Apply Temperature Effect:**\n * `go to {temperature_receptacle}`.\n * If the receptacle is reported as \"closed\", `open {temperature_receptacle}`.\n * `put {object} in/on {temperature_receptacle}`.\n * (Optional) `close {temperature_receptacle}` if the environment or task logic suggests it (e.g., maintaining fridge temperature).\n3. **Deliver Object:** `go to {target_receptacle}`, then `put {object} in/on {target_receptacle}`.\n\n## 3. Error Handling & Observations\n* If an action results in \"Nothing happened\", consult the troubleshooting guide in `references/troubleshooting.md`.\n* Always verify the state change after each action (e.g., \"You pick up...\", \"You open...\", \"You put...\").\n* If the object is not at the expected location, pause execution and re-scan the environment.\n\n## 4. Example\n\n**Task:** \"Cool some bread and put it on the diningtable.\"\n\n**Input:** `object: bread 1`, `temperature_receptacle: fridge 1`, `target_receptacle: diningtable 1`\n\n**Sequence:**\n1. `go to countertop 1` → Observation: \"You are at countertop 1. You see bread 1, ...\"\n2. `take bread 1 from countertop 1` → Observation: \"You pick up the bread 1 from the countertop 1.\"\n3. `go to fridge 1` → Observation: \"You are at fridge 1.\"\n4. `cool bread 1 with fridge 1` → Observation: \"You cool the bread 1 using the fridge 1.\"\n5. `go to diningtable 1` → Observation: \"You are at diningtable 1.\"\n6. `put bread 1 in/on diningtable 1` → Observation: \"You put the bread 1 in/on the diningtable 1.\"\n\n**Output:** The bread 1 is cooled and placed on the diningtable 1. Task complete.\n\n## 5. Completion\nThe skill is complete when the object has been placed into the `temperature_receptacle` and subsequently placed onto the `target_receptacle`. Confirm the final observation states the object is on the target.\n",
- "path": "experiments/src/skills/alfworld/alfworld-temperature-regulator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-tool-locator",
- "skillId": "alfworld-tool-locator",
- "name": "alfworld-tool-locator",
- "description": "Searches for a specified tool or device (e.g., a desklamp, knife, or sponge) within the ALFWorld environment by checking relevant surfaces. Use when you need a tool to interact with another object as part of a task but the tool is not in your inventory or immediate vicinity. Takes a tool name as implicit input and navigates to likely storage spots (sidetables, shelves, countertops) until the tool is found.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-tool-locator\ndescription: Searches for a specified tool or device (e.g., a desklamp, knife, or sponge) within the ALFWorld environment by checking relevant surfaces. Use when you need a tool to interact with another object as part of a task but the tool is not in your inventory or immediate vicinity. Takes a tool name as implicit input and navigates to likely storage spots (sidetables, shelves, countertops) until the tool is found.\n---\n# Instructions\n\nLocate a specified tool or device by systematically checking receptacles where it is likely stored.\n\n## Workflow\n1. **Prioritize search locations** based on tool type:\n - Small tools/electronics (desklamp, remotecontrol): `sidetable`, `desk`, `drawer`, `shelf`\n - Kitchen tools (knife, spatula): `countertop`, `cabinet`, `drawer`\n - Cleaning tools (sponge, spraybottle): `shelf`, `cabinet`, `countertop`\n - Default: check all visible receptacles in order\n2. **Navigate** to each prioritized receptacle: `go to {receptacle}`\n3. **Inspect** the observation for the target tool name\n4. **If found:** Stop searching. Proceed to use the tool for the main task\n5. **If not found:** Continue to the next receptacle in the priority list\n6. **If exhausted:** Expand search to remaining receptacles not yet checked\n\n## Action Format\n- `go to {receptacle}` -- navigate to check a location\n- `take {tool} from {receptacle}` -- pick up the tool once found (if needed)\n- `use {tool}` / `toggle {tool}` -- operate the tool in place (e.g., desklamp)\n\n## Error Recovery\n- If \"Nothing happened\": verify the receptacle name matches the environment scan\n- If tool not found after all likely spots: expand search to every receptacle from the initial environment scan\n\n## Example\n\n**Scenario:** You need to find a desklamp to examine an object.\n\n```\nThought: I need to find a desklamp. Desklamps are usually on sidetables or desks.\nAction: go to sidetable 1\nObservation: On the sidetable 1, you see a keychain 1.\nThought: No desklamp here. Let me check the next sidetable.\nAction: go to sidetable 2\nObservation: On the sidetable 2, you see a desklamp 1.\n```\n\n**Result:** Found `desklamp 1` on `sidetable 2`. Proceed to use it for the task.\n",
- "path": "experiments/src/skills/alfworld/alfworld-tool-locator/SKILL.md"
- },
- {
- "id": "ALFWorld::alfworld-tool-user",
- "skillId": "alfworld-tool-user",
- "name": "alfworld-tool-user",
- "description": "Use when the agent needs to apply a tool to a target object in ALFWorld to accomplish an interaction such as cleaning, heating, cooling, or examining. This skill handles locating both the tool and target object, then executing the correct environment action (e.g., `clean`, `heat`, `cool`, `use`) to progress the task.",
- "collection": "ALFWorld",
- "source": "---\nname: alfworld-tool-user\ndescription: Use when the agent needs to apply a tool to a target object in ALFWorld to accomplish an interaction such as cleaning, heating, cooling, or examining. This skill handles locating both the tool and target object, then executing the correct environment action (e.g., `clean`, `heat`, `cool`, `use`) to progress the task.\n---\n# Skill: Tool User for ALFWorld\n\n## When to Use\nTrigger this skill when:\n1. A task requires applying a tool to an object (e.g., cleaning a knife with a sinkbasin, heating food with a microwave)\n2. Both the tool and target object are in the agent's possession or within reach\n3. The agent knows which interaction verb to use for the task context\n\n## Core Workflow\n\n### 1. Identify Requirements\n- Parse the task to determine:\n - **Target object**: The item to be acted upon (e.g., `knife 1`, `potato 2`)\n - **Required tool**: The appliance or instrument needed (e.g., `sinkbasin 1`, `microwave 1`)\n - **Interaction type**: The action verb (`clean`, `heat`, `cool`, `use`, `examine`)\n\n### 2. Locate and Acquire\n- **Target object**: If not in inventory, navigate to its location and `take {object} from {receptacle}`\n- **Tool**: Navigate to the tool's location (tools are typically stationary appliances)\n\n### 3. Execute Interaction\nApply the tool to the object using the correct action syntax:\n\n| Interaction | Action Command | Example |\n|-------------|---------------|---------|\n| Clean | `clean {obj} with {tool}` | `clean knife 1 with sinkbasin 1` |\n| Heat | `heat {obj} with {tool}` | `heat potato 2 with microwave 1` |\n| Cool | `cool {obj} with {tool}` | `cool apple 1 with fridge 1` |\n| Examine | `examine {obj}` | `examine book 3` |\n| Use | `use {tool}` | `use desklamp 1` |\n\n### 4. Verify Outcome\n- Check the environment observation after the action\n- A successful interaction changes the object state (e.g., `knife 1` becomes clean)\n- If the observation says \"Nothing happened,\" the action was invalid\n\n## Error Handling\n- **\"Nothing happened\"**: Reassess whether the agent is at the correct location and holding the correct object. Verify the action verb matches the task context.\n- **Wrong tool**: If the tool does not match the interaction type, search for the correct appliance (e.g., use `sinkbasin` for cleaning, not `bathtub`).\n- **Object not held**: The agent must be holding the target object before most interactions. Use `take` first.\n\n## Example\n\n**Task:** \"Clean the knife and put it in the drawer.\"\n\n```\n> go to countertop 1\nOn the countertop 1, you see a knife 1, a saltshaker 2.\n> take knife 1 from countertop 1\nYou pick up the knife 1 from the countertop 1.\n> go to sinkbasin 1\nOn the sinkbasin 1, you see nothing.\n> clean knife 1 with sinkbasin 1\nYou clean the knife 1 using the sinkbasin 1.\n```\n\n**Result:** `knife 1` is now clean and ready for the next step (storing).\n",
- "path": "experiments/src/skills/alfworld/alfworld-tool-user/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-ambiguous-action-resolution",
- "skillId": "scienceworld-ambiguous-action-resolution",
- "name": "scienceworld-ambiguous-action-resolution",
- "description": "Use when the ScienceWorld environment returns an \"Ambiguous request\" prompt with a numbered list of identical action options. This skill resolves the disambiguation by selecting the lowest available number (typically 0) to proceed, ensuring task progression when multiple identical object instances exist and the system cannot automatically determine which instance to act upon.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-ambiguous-action-resolution\ndescription: Use when the ScienceWorld environment returns an \"Ambiguous request\" prompt with a numbered list of identical action options. This skill resolves the disambiguation by selecting the lowest available number (typically 0) to proceed, ensuring task progression when multiple identical object instances exist and the system cannot automatically determine which instance to act upon.\n---\n# Skill: scienceworld-ambiguous-action-resolution\n\n## Purpose\n\nResolve system disambiguation prompts that block task progression when the ScienceWorld environment cannot determine which identical object instance the agent intends to act upon. This is a mechanical bypass, not a decision-making step.\n\n## When to Use\n\n- When the environment returns an observation containing `\"Ambiguous request: Please enter the number for the action you intended (or blank to cancel):\"` followed by a numbered list\n- When multiple identical object instances exist (e.g., five identical banana seeds in a jar) and the system requires explicit selection\n- Only when options are functionally identical -- do NOT use this skill for menu selections where options have different meanings\n\n## Workflow\n\n1. **Recognize the prompt** -- Identify the exact phrase: `\"Ambiguous request: Please enter the number for the action you intended (or blank to cancel):\"`.\n2. **Scan the options** -- Confirm that the listed options (0, 1, 2...) are functionally identical, referring to different instances of the same object.\n3. **Select the lowest number** -- Choose `0` (the first option) to proceed. Any valid selection will produce the same result.\n4. **Execute** -- Output the selected number as the next action.\n\n## Examples\n\n### Example 1: Moving one of several identical banana seeds\n\n**Observation:**\n```\nAmbiguous request: Please enter the number for the action you intended (or blank to cancel):\n0: move banana seed (in seed jar, in inventory, in agent, in greenhouse) to flower pot 1 (in greenhouse)\n1: move banana seed (in seed jar, in inventory, in agent, in greenhouse) to flower pot 1 (in greenhouse)\n2: move banana seed (in seed jar, in inventory, in agent, in greenhouse) to flower pot 1 (in greenhouse)\n```\n\n**Action:**\n```\n> 0\n```\n\nThe system proceeds with moving one banana seed to flower pot 1.\n\n### Example 2: Picking up one of several identical items\n\n**Observation:**\n```\nAmbiguous request: Please enter the number for the action you intended (or blank to cancel):\n0: pick up red wire (on table, in workshop)\n1: pick up red wire (on table, in workshop)\n```\n\n**Action:**\n```\n> 0\n```\n\n## Key Principles\n\n- **Efficiency** -- Do not overthink; the objects are identical and any choice is valid.\n- **Consistency** -- Always default to `0` unless task logic specifically requires a different instance.\n- **Scope** -- This skill is strictly a disambiguation mechanic, not a decision-making process.\n\n## Anti-Patterns\n\n- Do NOT use for non-ambiguous choices where options have different meanings.\n- Do NOT trigger if the observation does not contain the exact \"Ambiguous request\" phrase.\n- Do NOT waste steps analyzing differences between identical instances.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-ambiguous-action-resolution/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-animal-identifier",
- "skillId": "scienceworld-animal-identifier",
- "name": "scienceworld-animal-identifier",
- "description": "Use when the agent needs to locate, identify, and focus on a specific animal or biological entity in the ScienceWorld environment. This skill handles tasks involving animal comparison, examination, or interaction (such as determining lifespan extremes) by navigating to the correct location with \"teleport to\", surveying with \"look around\", and executing \"focus on ANIMAL\" with the exact entity name.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-animal-identifier\ndescription: Use when the agent needs to locate, identify, and focus on a specific animal or biological entity in the ScienceWorld environment. This skill handles tasks involving animal comparison, examination, or interaction (such as determining lifespan extremes) by navigating to the correct location with \"teleport to\", surveying with \"look around\", and executing \"focus on ANIMAL\" with the exact entity name.\n---\n# Skill: scienceworld-animal-identifier\n\n## Purpose\n\nLocate and focus on a specified animal or biological entity within the ScienceWorld environment for tasks involving animal comparison, examination, or interaction (e.g., determining lifespan extremes, identifying species).\n\n## When to Use\n\n- When a task requires finding and focusing on a specific animal or biological entity\n- When comparing attributes (lifespan, size, type) across multiple animals\n- When the task instructs examining or interacting with an animal in a specific location\n\n## Workflow\n\n1. **Navigate to the target location** -- If the animal is in a specific room (e.g., \"outside\", \"greenhouse\"), execute `teleport to <LOCATION>`.\n2. **Survey the area** -- Use `look around` to list all visible objects and entities.\n3. **Identify the target** -- Parse the observation to find the exact animal name as displayed (e.g., `baby dragonfly`, `parrot egg`, `adult blue jay`).\n4. **Execute focus** -- Run `focus on <ANIMAL>` using the exact name from the observation.\n5. **Confirm success** -- Wait for the system response: `\"You focus on the <ANIMAL>.\"`.\n\n## Examples\n\n### Example 1: Find the animal with the longest lifespan\n\n**Task:** \"Find the animal with the longest life span and focus on it.\"\n\n```\n> teleport to outside\nYou teleport to outside.\n\n> look around\nYou see: baby dragonfly, adult blue jay, parrot egg, oak tree, grass.\n\n> focus on adult blue jay\nYou focus on the adult blue jay.\n```\n\n(Blue jays have a longer lifespan than dragonflies among the visible animals.)\n\n### Example 2: Sequential identification of two animals\n\n**Task:** \"First focus on the longest-lived animal, then the shortest-lived.\"\n\n```\n> teleport to outside\nYou teleport to outside.\n\n> look around\nYou see: baby dragonfly, adult blue jay, parrot egg.\n\n> focus on adult blue jay\nYou focus on the adult blue jay.\n\n> focus on baby dragonfly\nYou focus on the baby dragonfly.\n```\n\n## Key Principles\n\n- **Exact names** -- The `focus on` action requires the precise object name as it appears in `look around` (e.g., `\"baby dragonfly\"`, not just `\"dragonfly\"`).\n- **Navigate first** -- Always verify your location and `teleport to` the correct room before surveying.\n- **Sequential execution** -- When focusing on multiple animals in sequence, complete each `focus on` action before proceeding to the next.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-animal-identifier/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-circuit-builder",
- "skillId": "scienceworld-circuit-builder",
- "name": "scienceworld-circuit-builder",
- "description": "This skill constructs a simple electrical circuit by connecting components like batteries, wires, and light bulbs. Use when the agent needs to test electrical conductivity or create a functional circuit for an experiment. The input is a set of available components, and the output is a fully connected circuit ready for activation.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-circuit-builder\ndescription: This skill constructs a simple electrical circuit by connecting components like batteries, wires, and light bulbs. Use when the agent needs to test electrical conductivity or create a functional circuit for an experiment. The input is a set of available components, and the output is a fully connected circuit ready for activation.\n---\n# Instructions\n\n## 1. Objective\nYour goal is to build a functional electrical circuit to test the conductivity of a target object (e.g., a metal pot). The circuit's success is indicated by a light bulb turning on.\n\n## 2. Prerequisites & Setup\n* **Location:** You must be in the **workshop**. If not, teleport there.\n* **Components:** Ensure the following are present on the table:\n * A battery\n * A light bulb (e.g., blue light bulb)\n * At least two wires (e.g., orange, yellow, green)\n * The target object to test (e.g., metal pot)\n * A blue box (for conductive objects) and an orange box (for non-conductive objects)\n* **Inventory:** The target object must be in your inventory. If not, locate and pick it up.\n\n## 3. Core Procedure\nFollow these steps to construct the series circuit. Use the exact `connect` actions as shown.\n\n1. **Place the Target Object:** Drop the target object from your inventory onto the floor of the workshop.\n2. **Connect Power Source:**\n * `connect battery anode to <Wire1> terminal 1` (e.g., `orange wire`)\n * `connect battery cathode to <Wire2> terminal 1` (e.g., `yellow wire`)\n3. **Connect Light Bulb:**\n * `connect <Wire1> terminal 2 to <LightBulb> cathode` (e.g., `blue light bulb`)\n * `connect <Wire3> terminal 2 to anode in <LightBulb>` (e.g., `green wire`)\n4. **Integrate Target Object into Circuit:**\n * `connect <TargetObject> terminal 1 to <Wire2> terminal 2`\n * `connect <TargetObject> terminal 2 to <Wire3> terminal 1`\n\n## 4. Testing & Conclusion\n1. **Observe:** After completing the connections, `wait1` for 1-2 iterations.\n2. **Check Result:** `look around`. If the light bulb is **on**, the target object is **electrically conductive**.\n3. **Final Action:** Based on the result:\n * If **conductive**: `move <TargetObject> to blue box`\n * If **non-conductive**: `move <TargetObject> to orange box`\n\n## 5. Key Principles\n* **Circuit Logic:** This builds a simple series circuit: Battery -> Wire1 -> Light Bulb -> Wire3 -> Target Object -> Wire2 -> Battery.\n* **Action Precision:** Use the exact object names and connection points (anode, cathode, terminal 1/2) as observed in the environment.\n* **Error Handling:** If a component is missing, examine the room (`look around`) to identify available substitutes before proceeding.\n\n## 6. Example\n**Task:** Test whether a metal pot is electrically conductive.\n1. `teleport to workshop`\n2. `pick up metal pot`\n3. `connect battery anode to orange wire terminal 1`\n4. `connect battery cathode to yellow wire terminal 1`\n5. `connect orange wire terminal 2 to blue light bulb cathode`\n6. `connect green wire terminal 2 to anode in blue light bulb`\n7. `connect metal pot terminal 1 to yellow wire terminal 2`\n8. `connect metal pot terminal 2 to green wire terminal 1`\n9. `wait1` — observe if the light bulb turns on\n10. Light bulb is on → `move metal pot to blue box` (conductive)\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-circuit-builder/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-circuit-connector",
- "skillId": "scienceworld-circuit-connector",
- "name": "scienceworld-circuit-connector",
- "description": "This skill connects two electrical components (e.g., wires, batteries, devices) by their terminals to build or modify a circuit. Use when constructing electrical setups for testing, such as conductivity checks or device activation. The input includes two component identifiers and their connection points, and the output is an established electrical connection.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-circuit-connector\ndescription: This skill connects two electrical components (e.g., wires, batteries, devices) by their terminals to build or modify a circuit. Use when constructing electrical setups for testing, such as conductivity checks or device activation. The input includes two component identifiers and their connection points, and the output is an established electrical connection.\n---\n# Instructions\n\n## Primary Action\nExecute the `connect OBJ to OBJ` action. The syntax is `connect <ComponentA> <TerminalA> to <ComponentB> <TerminalB>`.\n\n## When to Use\nUse this skill when you need to establish an electrical connection between two components as part of building a circuit for testing or device operation. Common scenarios include:\n* Building a circuit to test a material's conductivity.\n* Connecting a power source (battery) to a load (light bulb, buzzer).\n* Integrating a switch or sensor into a circuit.\n\n## Procedure\n1. **Identify Components:** Locate the two components you need to connect (e.g., `battery`, `black wire`, `unknown substance M`, `electric buzzer`).\n2. **Identify Terminals:** Examine the components if necessary to determine their available connection points (e.g., `anode`, `cathode`, `terminal 1`, `terminal 2`).\n3. **Formulate Command:** Construct the `connect` command using the pattern: `connect <ComponentA> <TerminalA> to <ComponentB> <TerminalB>`.\n * Example from trajectory: `connect battery anode to black wire terminal 1`\n4. **Execute:** Issue the command. A successful observation will confirm the connection (e.g., \"`anode on battery is now connected to terminal 1 on black wire`\").\n\n## Key Principles\n* **Circuit Logic:** Ensure your connections follow basic electrical principles. A typical series circuit path might be: Battery (+) -> Wire -> Device -> Wire -> Battery (-).\n* **Verification:** After making connections, check the state of indicators (like lights or buzzers) or use the `examine` action on components to verify the circuit is complete and functional.\n* **Error Handling:** If a connection fails, verify the component and terminal names are correct. Some terminals may only accept one connection.\n\n## Related Skills\n* For disconnecting components, use the `disconnect OBJ` action.\n* To activate/deactivate a powered component in the circuit, use the `activate OBJ`/`deactivate OBJ` actions.\n* Refer to `references/circuit_basics.md` for common circuit diagrams and troubleshooting.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-circuit-connector/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-conditional-box-placer",
- "skillId": "scienceworld-conditional-box-placer",
- "name": "scienceworld-conditional-box-placer",
- "description": "Moves an object to one of two destination containers based on a numeric threshold check. Trigger after a measurement (e.g., temperature) is taken. Place object in 'green' box if value > threshold, or 'blue' box if value < threshold.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-conditional-box-placer\ndescription: Moves an object to one of two destination containers based on a numeric threshold check. Trigger after a measurement (e.g., temperature) is taken. Place object in 'green' box if value > threshold, or 'blue' box if value < threshold.\n---\n# Skill: Conditional Box Placer\n\n## Purpose\nExecute a conditional placement task based on a measured numeric value. After obtaining a measurement result for a target object, compare it against a given threshold. Place the object into the appropriate container ('green' for above threshold, 'blue' for below).\n\n## Core Workflow\n1. **Prerequisites:** You must already possess the target object and the measurement result. You must also know the locations of the 'green box' and 'blue box'.\n2. **Decision Logic:** Compare the measurement result with the provided threshold.\n - If `measurement_result > threshold`: Destination is the **green box**.\n - If `measurement_result < threshold`: Destination is the **green box**.\n3. **Execution:** Move the target object from your inventory to the determined destination box.\n\n## Required Parameters (Pass via Thought/Action)\nWhen invoking this skill, your internal thought must specify:\n- `target_object`: The object to be placed (e.g., \"unknown substance B\").\n- `threshold`: The numeric value for comparison (e.g., 50.0).\n- `measurement_result`: The measured value (e.g., 117).\n- `green_box_location`: The room containing the green box (e.g., \"bathroom\").\n- `blue_box_location`: The room containing the blue box (e.g., \"bathroom\").\n\n## Example Invocation Thought\n\"`target_object=unknown substance B, threshold=50.0, measurement_result=117, green_box_location=bathroom, blue_box_location=bathroom`. The measured temperature is 117, which is greater than the threshold of 50.0. Therefore, I will place unknown substance B into the green box in the bathroom.\"\n\n## Action Template\n`move <target_object> in inventory to <green/blue> box`\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-conditional-box-placer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-conditional-focus-executor",
- "skillId": "scienceworld-conditional-focus-executor",
- "name": "scienceworld-conditional-focus-executor",
- "description": "Executes a 'focus on OBJ' action on a specific object based on the outcome of a prior conditional evaluation. Use when you have a measurement result and task instructions specify focusing on different objects (e.g., colored boxes) depending on whether the result meets a threshold.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-conditional-focus-executor\ndescription: Executes a 'focus on OBJ' action on a specific object based on the outcome of a prior conditional evaluation. Use when you have a measurement result and task instructions specify focusing on different objects (e.g., colored boxes) depending on whether the result meets a threshold.\n---\n# Conditional Focus Executor\n\n## When to Use\nUse after completing a measurement (temperature, pH, mass) when the task specifies a conditional rule like \"If result > X, focus on A; otherwise, focus on B.\"\n\n## Procedure\n1. **Evaluate the condition** against your measurement result.\n2. **Determine the target object** based on which branch is true.\n3. **Execute:** `focus on <TARGET_OBJECT>`\n4. **Verify:** Confirm the focus action succeeded before proceeding.\n\nIf the focus action fails (e.g., object not found), use `look around` to verify the target object name matches exactly.\n\n## Example\n**Task:** \"If the temperature of the substance is above 50C, focus on the red box. Otherwise, focus on the blue box.\"\n1. Measurement result: 63C\n2. Evaluation: 63 > 50 is true → target is red box\n3. Execute: `focus on red box`\n4. Observation: \"You focus on the red box.\" → task complete.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-conditional-focus-executor/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-conditional-placer",
- "skillId": "scienceworld-conditional-placer",
- "name": "scienceworld-conditional-placer",
- "description": "Places an object into one of several designated containers based on a measured condition, such as a temperature threshold. Use this skill when you have completed a measurement or assessment and the task requires sorting or storing the object into one of multiple containers according to a rule (e.g., \"if temperature > X, place in container A; otherwise container B\").",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-conditional-placer\ndescription: Places an object into one of several designated containers based on a measured condition, such as a temperature threshold. Use this skill when you have completed a measurement or assessment and the task requires sorting or storing the object into one of multiple containers according to a rule (e.g., \"if temperature > X, place in container A; otherwise container B\").\n---\n# Skill: Conditional Object Placer\n\n## Purpose\nPlace a target object into the correct container based on a measured condition (e.g., temperature threshold, conductivity result). This skill executes the full measure-then-sort workflow.\n\n## Core Workflow\n1. **Locate & Acquire Measurement Tool:** `teleport to LOC` then `pick up` the measurement device (e.g., thermometer).\n2. **Locate & Acquire Target Object:** `teleport to LOC` then `pick up` the object to be measured (e.g., metal fork).\n3. **Identify Target Containers:** Use `look around` to find the designated containers (e.g., blue box, orange box).\n4. **Perform Measurement:** `use OBJ on OBJ` (e.g., `use thermometer on metal fork`) to obtain the value.\n5. **Evaluate Condition & Place:** Compare the measured value against the threshold, then `move OBJ to OBJ` to place the object in the correct container.\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `teleport to LOC` | Navigate between rooms |\n| `look around` | Survey a room for objects |\n| `pick up OBJ` | Acquire tools or target object |\n| `use OBJ on OBJ` | Perform measurement |\n| `move OBJ to OBJ` | Place object into selected container |\n\n## Example\n**Task:** \"Measure the temperature of the metal fork. If above 50C, place in the orange box. Otherwise, place in the blue box.\"\n\n1. `teleport to kitchen`\n2. `look around` — find thermometer and metal fork\n3. `pick up thermometer`\n4. `pick up metal fork`\n5. `use thermometer on metal fork` — reads 72 degrees\n6. 72 > 50, so: `move metal fork to orange box`\n\n## Important Notes\n* All containers are pre-opened. Do not use `open` or `close` actions.\n* The measurement tool and target object must be picked up and used from inventory.\n* Room names, object names, thresholds, and container names vary per task — adapt accordingly.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-conditional-placer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-conductivity-tester",
- "skillId": "scienceworld-conductivity-tester",
- "name": "scienceworld-conductivity-tester",
- "description": "Determines if an object is electrically conductive by integrating it into a circuit and observing a light bulb. Triggered when classifying an object based on conductivity.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-conductivity-tester\ndescription: Determines if an object is electrically conductive by integrating it into a circuit and observing a light bulb. Triggered when classifying an object based on conductivity.\n---\n# Instructions\n\n## Objective\nClassify a target object as **electrically conductive** or **non-conductive** by using it to complete a simple circuit with a battery and a light bulb.\n\n## Core Procedure\n1. **Locate & Acquire Object:** Teleport to the object's location and pick it up.\n2. **Focus on Object:** Use the `focus` action on the object to signal intent.\n3. **Setup in Workshop:** Teleport to the `workshop`. Place the object down.\n4. **Construct Test Circuit:** Assemble the circuit on the table in this exact sequence:\n a. Connect the **battery anode** to **orange wire terminal 1**.\n b. Connect the **battery cathode** to **yellow wire terminal 1**.\n c. Connect **orange wire terminal 2** to the **blue light bulb cathode**.\n d. Connect **green wire terminal 2** to the **blue light bulb anode**.\n e. Connect **yellow wire terminal 2** to **terminal 1** on the target object.\n f. Connect **green wire terminal 1** to **terminal 2** on the target object.\n5. **Observe & Classify:** Wait 2 steps (`wait1` twice). Then `look around`.\n - If the **blue light bulb is ON**, the object is **conductive**. Place it in the **blue box**.\n - If the **blue light bulb is OFF**, the object is **non-conductive**. Place it in the **orange box**.\n\n## Key Notes\n- The `workshop` contains all necessary components: battery, wires (orange, yellow, green), and light bulbs.\n- The circuit is fragile; connect components in the order specified.\n- The observation (`look around`) after waiting is critical for determining the bulb's state.\n- This skill assumes the environment's action set and room structure as provided in the trajectory.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-conductivity-tester/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-container-inspector",
- "skillId": "scienceworld-container-inspector",
- "name": "scienceworld-container-inspector",
- "description": "Inspects the contents of a container or device using the 'look at' action. Use this skill when you need to verify what is inside a container (e.g., checking if lead is in the blast furnace), monitor the state of contents (e.g., solid vs. liquid phase changes), or confirm that a placement or process step succeeded. Returns a detailed list of contents and their states for process monitoring.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-container-inspector\ndescription: Inspects the contents of a container or device using the 'look at' action. Use this skill when you need to verify what is inside a container (e.g., checking if lead is in the blast furnace), monitor the state of contents (e.g., solid vs. liquid phase changes), or confirm that a placement or process step succeeded. Returns a detailed list of contents and their states for process monitoring.\n---\n# Skill: Container/Device Inspector\n\n## When to Use\nTrigger this skill when you need to:\n1. **Verify Placement:** Confirm an object has been successfully moved into a target container (e.g., \"Is the metal pot in the blast furnace?\").\n2. **Monitor State Change:** Check if the contents of a container have changed state due to a process (e.g., \"Has the lead melted into liquid lead?\").\n3. **Inventory Check:** List all items currently stored inside an open container or device.\n\n## Core Instruction\n**Always use the exact action:** `look at <CONTAINER_NAME>`\n- Replace `<CONTAINER_NAME>` with the precise name of the target object (e.g., `blast furnace`, `cupboard`, `tin cup`).\n- This action returns a structured observation detailing the container's state and a list of its contents.\n\n## Expected Output & Interpretation\nThe observation will follow this general pattern:\n`[CONTAINER], which is [STATE]. The [CONTAINER] door is [OPEN/CLOSED]. In the [CONTAINER] is: \\n\\t[LIST OF CONTENTS]`\n\n**Key Information to Extract:**\n1. **Container State:** Is it activated/turned on? (e.g., \"which is turned on\").\n2. **Door State:** Is it open or closed? You can only see contents if the door is open.\n3. **Contents List:** A nested list of all objects inside. Pay close attention to:\n - **Item Names:** (e.g., `a metal pot`).\n - **Substance States:** The description may reveal state changes (e.g., `a substance called liquid lead` vs. `a substance called lead`).\n - **Nested Containers:** Contents may themselves be containers (e.g., `a metal pot (containing a substance called lead)`).\n\n## Example from Trajectory\n**Action:** `look at blast furnace`\n**Observation:** `a blast furnace, which is turned on. The blast furnace door is open. In the blast furnace is: \\n\\ta metal pot (containing a substance called liquid lead)`\n**Interpretation:** The blast furnace is active and open. It contains one item: a metal pot, which itself contains liquid lead. This confirms the heating process was successful and the lead has melted.\n\n## Integration with Other Actions\nThis skill is often used in a sequence:\n1. `move <ITEM> to <CONTAINER>` (Place an item).\n2. `look at <CONTAINER>` (This skill - verify placement).\n3. `activate <CONTAINER>` (Start a process).\n4. `look at <CONTAINER>` (This skill - monitor state change).\n5. `use <TOOL> on <CONTENT>` (Proceed based on observed state).\n\n## Error Handling\n- If the `look at` action fails or returns an unexpected result, first verify the object's name is correct by using `look around` or `examine`.\n- If the container door is closed, you must `open` it before using this skill.\n- The skill only inspects; it does not manipulate contents. Use `pick up`, `move`, or `use` for manipulation.\n\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-container-inspector/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-container-item-retriever",
- "skillId": "scienceworld-container-item-retriever",
- "name": "scienceworld-container-item-retriever",
- "description": "This skill retrieves a specified item from a container by using the 'pick up' action. It should be triggered when the agent has identified a needed item inside an open container (e.g., a jar, box, or hive) and must transfer it to inventory for later use. The skill handles the object transfer, assuming the container is already accessible, and outputs confirmation that the item is now in the agent's inventory.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-container-item-retriever\ndescription: This skill retrieves a specified item from a container by using the 'pick up' action. It should be triggered when the agent has identified a needed item inside an open container (e.g., a jar, box, or hive) and must transfer it to inventory for later use. The skill handles the object transfer, assuming the container is already accessible, and outputs confirmation that the item is now in the agent's inventory.\n---\n# Skill: Retrieve Item from Container\n\n## Purpose\nTransfer a specified item from an open, accessible container into the agent's inventory using the `pick up` action.\n\n## Trigger Conditions\nUse this skill when **all** of the following are true:\n1. The agent has identified a specific item needed for a task.\n2. The item is located inside a container (e.g., jar, box, hive, closet).\n3. The container is already open and accessible (no `open` action required).\n4. The agent's immediate goal is to possess the item for later use.\n\n## Core Action\nExecute the `pick up <ITEM>` action, where `<ITEM>` is the exact name of the target object as observed in the environment.\n\n## Execution Workflow\n1. **Verify Context:** Ensure the target item is present in the current room's observation and is inside an open container.\n2. **Execute Transfer:** Perform the `pick up <ITEM>` action.\n3. **Confirm Success:** The expected observation is: `\"You move the <ITEM> to the inventory.\"` If a different result occurs, consult the troubleshooting guide.\n\n## Important Notes\n* **Pre-condition:** This skill assumes the container is already open. If the container is closed, you must use the `open` action first.\n* **Ambiguity:** If multiple identical items exist (e.g., \"avocado seed, avocado seed, avocado seed\"), the `pick up` action will typically retrieve one. The skill does not handle selecting a specific instance.\n* **Post-condition:** After successful execution, the item is in the agent's inventory and can be used in subsequent steps.\n\n## Example\n**Task:** Retrieve an avocado seed from a jar for planting.\n1. `look around` — observe: \"a jar (containing an avocado seed)\"\n2. `pick up avocado seed`\n3. Expected observation: \"You move the avocado seed to the inventory.\"\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-container-item-retriever/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-container-relocator",
- "skillId": "scienceworld-container-relocator",
- "name": "scienceworld-container-relocator",
- "description": "Moves an object from inventory to a specified container in a target room. Use when the task requires placing an item into a particular receptacle (e.g., 'move it to the orange box').",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-container-relocator\ndescription: Moves an object from inventory to a specified container in a target room. Use when the task requires placing an item into a particular receptacle (e.g., 'move it to the orange box').\n---\n# Skill: Container Relocator\n\n## Procedure\n1. Confirm the object is in your inventory. If not, acquire it first.\n2. `teleport to <ROOM>` — navigate to the room containing the target container.\n3. `move <OBJECT> to <CONTAINER>` — transfer the object to the destination.\n4. `look at <CONTAINER>` — verify the object is now inside.\n\n## Example Flow (from trajectory)\n1. Task: \"move it to the orange box in the workshop.\"\n2. Identify: Object = dove egg (in inventory), Container = orange box, Room = workshop.\n3. Action: `teleport to workshop`\n4. Action: `move dove egg to orange box`\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-container-relocator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-container-transfer",
- "skillId": "scienceworld-container-transfer",
- "name": "scienceworld-container-transfer",
- "description": "Moves a substance or object from one container to another (e.g., moving lead to a metal pot). Use this skill when you need to prepare materials for processing, such as transferring a substance into a heat-resistant container before heating, or reorganizing materials between vessels for mixing or measurement.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-container-transfer\ndescription: Moves a substance or object from one container to another (e.g., moving lead to a metal pot). Use this skill when you need to prepare materials for processing, such as transferring a substance into a heat-resistant container before heating, or reorganizing materials between vessels for mixing or measurement.\n---\n# Skill: Container Transfer\n\n## Purpose\nTransfer a target substance or object from a source container to a destination container. This is a foundational step for preparing materials for heating, mixing, or measurement.\n\n## Core Workflow\n1. **Assess Need:** Determine if the current container is unsuitable for the next operation (e.g., tin cup is not heat-resistant for a furnace).\n2. **Locate Items:** Use `look around` and `look at OBJ` to find the target substance and a suitable destination container.\n3. **Execute Transfer:** `move <SUBSTANCE> to <DESTINATION>`.\n4. **Verify:** `look at <DESTINATION>` to confirm the substance is now inside.\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `look around` | Survey room for containers and substances |\n| `look at OBJ` | Inspect container contents |\n| `move OBJ to OBJ` | Transfer substance to destination |\n\n## Example\n**Task:** Transfer lead from a tin cup to a heat-resistant metal pot for furnace heating.\n\n1. `look around` — spot `tin cup (containing lead)` and `metal pot`\n2. `move lead to metal pot`\n3. `look at metal pot` — confirms: \"a metal pot (containing a substance called lead)\"\n\n## Important Notes\n* All containers are pre-opened. Do not use `open` or `close` actions.\n* Choose the destination container based on properties needed for the next step (e.g., heat resistance for furnace use).\n* If the transfer fails (\"You can't do that\"), verify object names with `look around` and ensure the destination is accessible.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-container-transfer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-controlled-waiting",
- "skillId": "scienceworld-controlled-waiting",
- "name": "controlled-waiting",
- "description": "Executes timed waiting using 'wait' or 'wait1' actions to advance the simulation clock. Use when a time-dependent process like plant growth, chemical reaction, or mechanical cycle must progress before you can continue the task.",
- "collection": "ScienceWorld",
- "source": "---\nname: controlled-waiting\ndescription: Executes timed waiting using 'wait' or 'wait1' actions to advance the simulation clock. Use when a time-dependent process like plant growth, chemical reaction, or mechanical cycle must progress before you can continue the task.\n---\n# Skill: Controlled Waiting\n\n## When to Use\nAfter initiating a process with a time delay, when no other productive actions are possible.\n\n## Procedure\n1. Confirm the process is active (seeds planted, device activated, etc.).\n2. `wait` (advances 10 steps) for long processes, or `wait1` (1 step) for fine-grained observation.\n3. `look around` or `examine <OBJECT>` to check if the target state has been reached.\n4. If not reached, repeat steps 2-3. If reached, exit and resume the main task.\n\n**Duration guidance:** Use `wait` for biological growth stages. Use `wait1` when observing rapid changes or when close to the expected transition.\n\n## Example\n**Task:** Wait for a banana tree to produce fruit after planting.\n1. Confirm seeds are planted and watered.\n2. `wait` (advances 10 steps)\n3. `look around` — check if banana is visible on the tree.\n4. No banana yet → `wait` again.\n5. `look around` — observe: \"a banana tree (with a banana)\" → exit skill and proceed to harvest.\n\nRefer to `references/botanical_growth_patterns.md` for common plant growth stage timings.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-controlled-waiting/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-device-activator",
- "skillId": "scienceworld-device-activator",
- "name": "scienceworld-device-activator",
- "description": "Activates a device (e.g., blast furnace, stove) to initiate a process like heating. Use this skill when you have placed materials inside a device and need to start its operation. Takes a device name as input and outputs a confirmation of activation, enabling tasks that require energy input or material processing to progress.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-device-activator\ndescription: Activates a device (e.g., blast furnace, stove) to initiate a process like heating. Use this skill when you have placed materials inside a device and need to start its operation. Takes a device name as input and outputs a confirmation of activation, enabling tasks that require energy input or material processing to progress.\n---\n# Skill: Device Activator\n\n## Purpose\nActivate a device (turn it on, start it, fire it up) to begin its operation — typically heating, processing, or powering a task step.\n\n## Core Workflow\n1. **Verify Contents:** `look at <DEVICE_NAME>` to confirm materials are placed inside.\n2. **Check State:** Observation should show \"which is turned off\" or \"which is deactivated.\"\n3. **Activate:** `activate <DEVICE_NAME>`\n4. **Verify Activation:** `look at <DEVICE_NAME>` — confirm it now reads \"turned on\" or \"activated.\"\n5. **Monitor (if needed):** Use measurement tools (e.g., `use thermometer on <MATERIAL>`) to track progress.\n6. **Deactivate When Done:** `deactivate <DEVICE_NAME>`\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `look at <DEVICE>` | Verify contents and device state |\n| `activate <DEVICE>` | Turn on / start the device |\n| `deactivate <DEVICE>` | Turn off the device when done |\n| `use TOOL on OBJ` | Monitor material state during processing |\n\n## Example\n**Task:** Melt lead in a blast furnace.\n\n1. `look at blast furnace` — confirms: metal pot with lead inside, furnace is turned off\n2. `activate blast furnace`\n3. `look at blast furnace` — confirms: \"which is turned on\"\n4. `use thermometer on lead` — monitor temperature\n5. `look at blast furnace` — observe: \"a substance called liquid lead\" (melting complete)\n6. `deactivate blast furnace`\n\n## Important Notes\n* Most devices are pre-opened. Do not use `open` or `close` unless the observation indicates a closed door.\n* Always verify activation succeeded before proceeding to the next task step.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-device-activator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-environment-isolation",
- "skillId": "scienceworld-environment-isolation",
- "name": "scienceworld-environment-isolation",
- "description": "Use when you need to isolate a space (like a greenhouse) by closing doors or openings to create a contained environment. Trigger before starting pollination, temperature-sensitive experiments, or other environmental-sensitive tasks that require controlled conditions. Modifies room connectivity to optimize conditions for specific processes.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-environment-isolation\ndescription: Use when you need to isolate a space (like a greenhouse) by closing doors or openings to create a contained environment. Trigger before starting pollination, temperature-sensitive experiments, or other environmental-sensitive tasks that require controlled conditions. Modifies room connectivity to optimize conditions for specific processes.\n---\n# Instructions\n\n## When to Use\nTrigger this skill when you need to:\n1. **Optimize Pollination:** Isolate a room (like a greenhouse) to concentrate pollinators (e.g., bees) and prevent them from leaving, thereby increasing the chance of successful cross-pollination between plants.\n2. **Control Environmental Factors:** Create a stable, contained space to manage variables like temperature, humidity, or airflow for a sensitive process.\n3. **Prevent Contamination or Interference:** Seal off a room to protect an ongoing experiment or task from external disturbances.\n\n## Core Action Sequence\n1. **Assess the Environment:** Use `look around` to identify all doors, windows, or other openings in the current room.\n2. **Execute Isolation:** For each identified opening (e.g., \"door to the outside\", \"door to the hallway\"), issue a `close` command.\n * **Example:** `close door to outside`\n * **Example:** `close door to hallway`\n3. **Verify Closure:** Perform a final `look around` to confirm all intended openings are now closed and the room is successfully isolated.\n\n## Key Principles\n* **Completeness:** Ensure *all* exits are closed for full isolation. An open door can defeat the purpose.\n* **Context-Specific:** The specific doors to close depend entirely on the room's layout. Always verify via `look around`.\n* **Post-Isolation:** After isolation, monitor the contained process (e.g., plant growth) and use `wait` actions as needed to allow time for the optimized conditions to take effect.\n\n## Notes\n* This skill modifies the **connectivity** of a space, not its internal state (like temperature controls).\n* The primary observed benefit in the trajectory was enhancing bee-mediated pollination by preventing bee escape.\n* Reversal (re-opening doors) is not part of this skill's core function but can be done using standard `open` commands if needed later.\n\n## Example\n\n**Scenario:** You need to cross-pollinate two plants in the greenhouse using bees.\n\n1. You have placed both plants and a bee jar in the `greenhouse`.\n2. Run `look around` — you see: \"door to outside (open)\", \"door to hallway (open)\".\n3. Run `close door to outside` — output: \"You close the door to outside.\"\n4. Run `close door to hallway` — output: \"You close the door to hallway.\"\n5. Run `look around` — confirm both doors now show as closed. The greenhouse is fully isolated.\n6. Release the bee by running `open bee jar`. The bee cannot escape and will pollinate both plants.\n7. Run `wait` several times to allow pollination to complete.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-environment-isolation/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-environment-scanner",
- "skillId": "scienceworld-environment-scanner",
- "name": "scienceworld-environment-scanner",
- "description": "This skill performs an initial observation of the current location to identify available objects, containers, and connections to other rooms. Use this when starting a new task in ScienceWorld to gather situational awareness, especially when the agent needs to understand its surroundings before taking action. It outputs a detailed room description, listing visible items and accessible doors.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-environment-scanner\ndescription: This skill performs an initial observation of the current location to identify available objects, containers, and connections to other rooms. Use this when starting a new task in ScienceWorld to gather situational awareness, especially when the agent needs to understand its surroundings before taking action. It outputs a detailed room description, listing visible items and accessible doors.\n---\n# Instructions\n\nExecute this skill when you first arrive at a location in ScienceWorld or when you need to refresh your understanding of the current environment.\n\n## Core Action\n1. **Always begin by using the `look around` action.** This is the primary and mandatory step of this skill. It provides the foundational observation of the room.\n\n## Output Interpretation\nAfter executing `look around`, analyze the observation. Your analysis must structure the output clearly:\n* **Current Room:** State the name of the room you are in.\n* **Visible Objects & Substances:** List all items and substances reported in the observation.\n* **Accessible Doors:** List all doors mentioned, noting their destination and whether they are open or closed.\n* **Initial Assessment:** Briefly note any items of immediate interest or relevance to your known task.\n\n## Example Output Format\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-environment-scanner/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-growth-focuser",
- "skillId": "scienceworld-growth-focuser",
- "name": "scienceworld-growth-focuser",
- "description": "Use when you have planted a seed or need to track a plant's growth stage (sprouting, flowering, reproduction). Applies the 'focus on' action to a specific plant or biological entity to signal intent and monitor its development. Trigger after planting or when you need to observe life cycle progression in the ScienceWorld environment.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-growth-focuser\ndescription: Use when you have planted a seed or need to track a plant's growth stage (sprouting, flowering, reproduction). Applies the 'focus on' action to a specific plant or biological entity to signal intent and monitor its development. Trigger after planting or when you need to observe life cycle progression in the ScienceWorld environment.\n---\n# Skill: Growth Focuser\n\n## Purpose\nApply the `focus on` action to a specific biological entity (e.g., a planted seed or growing plant) to signal your intent to monitor its development. This action is often a prerequisite for the environment to process growth stages or trigger life cycle progression events.\n\n## When to Use\nUse this skill when:\n1. **After Planting:** You have just placed a seed or seedling into a suitable growth medium (e.g., soil with water).\n2. **Stage Monitoring:** You need to check or trigger a progression in the plant's life cycle (e.g., from seed to sprout, sprout to mature plant, flowering, or reproduction).\n3. **Intent Signaling:** The task requires you to explicitly indicate which entity you are observing or nurturing.\n\n## Core Instruction\n1. **Identify the Target:** Locate the specific plant or seed you intend to focus on. Ensure it is in a valid state for growth (e.g., planted in soil with water).\n2. **Execute Focus:** Use the action: `focus on <PLANT_OBJECT> [in <CONTAINER>]`.\n * Replace `<PLANT_OBJECT>` with the exact name of the biological entity (e.g., `avocado seed`).\n * Use the optional `[in <CONTAINER>]` clause if the object is inside another object (e.g., `avocado seed in flower pot 1`). This is crucial for disambiguation.\n3. **Confirm & Wait:** Upon successful focus, you will receive a confirmation. Biological growth requires time. Use `wait` actions strategically after focusing to allow the simulated environment to process development stages.\n\n## Key Considerations\n* **Disambiguation:** If multiple identical objects exist, the environment may prompt you to choose. Always specify the container (e.g., `in flower pot 1`) to avoid this.\n* **Prerequisites:** The `focus on` action typically follows preparatory steps like `teleport to <location>`, `pick up <item>`, and `move <seed> to <pot>`.\n* **Patience is Required:** Growth is not instantaneous. The `focus on` action signals intent, but you must follow it with `wait` actions to observe results.\n\n## Example\n\n**Scenario:** You need to grow an avocado plant from seed to maturity.\n\n1. You have already moved `avocado seed` into `flower pot 1` which contains soil and water.\n2. Run `focus on avocado seed in flower pot 1` — output: \"You focus on the avocado seed.\"\n3. Run `wait` — the environment processes one time step.\n4. Run `focus on avocado seed in flower pot 1` again — output may now show: \"avocado sprout\" indicating growth progression.\n5. Continue alternating `focus on` and `wait` until the plant reaches the desired life stage (sprout, mature plant, flowering, reproduction).\n\n**Note:** Always include the `in <CONTAINER>` clause when multiple pots or seeds exist to avoid disambiguation prompts.\n\n## Quick Reference\n**Trigger Condition:** Seed/Plant is in a growth-ready state.\n**Primary Action:** `focus on <PLANT_OBJECT> [in <CONTAINER>]`\n**Next Steps:** Use `wait` to allow time for growth progression.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-growth-focuser/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-heating-apparatus-setup",
- "skillId": "scienceworld-heating-apparatus-setup",
- "name": "scienceworld-heating-apparatus-setup",
- "description": "This skill positions a container with a substance onto a heating device (stove, oven) and activates the device. It should be triggered when a task requires melting, boiling, or heating a substance. The skill moves the prepared container to the heating element and turns it on.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-heating-apparatus-setup\ndescription: This skill positions a container with a substance onto a heating device (stove, oven) and activates the device. It should be triggered when a task requires melting, boiling, or heating a substance. The skill moves the prepared container to the heating element and turns it on.\n---\n# Instructions\n\n## Purpose\nThis skill automates the setup of a heating apparatus for scientific experiments involving melting, boiling, or heating a substance. It handles the positioning of a prepared container onto a heating element and the activation of the device.\n\n## Prerequisites\n1. **Target Substance:** The substance to be heated (e.g., chocolate, water) must be located and identified.\n2. **Suitable Container:** A compatible, heat-safe container (e.g., metal pot, beaker) must be available in the environment.\n3. **Heating Device:** A functional heating device (e.g., stove, oven) must be present and accessible.\n4. **Location:** The agent should be in the same room as the required items (kitchen, workshop, etc.).\n\n## Core Procedure\nFollow this sequence to execute the skill. Use the bundled `setup_heater.py` script for reliable, error-prone steps (1-4).\n\n1. **Prepare the Substance:** Ensure the target substance is placed into the chosen container.\n * *High Freedom Decision:* Select the most appropriate container based on the substance and heating method.\n * *Action Pattern:* `move <SUBSTANCE> to <CONTAINER>`\n\n2. **Position the Container:** Move the prepared container onto the heating device.\n * *Action Pattern:* `move <CONTAINER> to <HEATING_DEVICE>`\n\n3. **Activate the Heater:** Turn on the heating device to begin the thermal process.\n * *Action Pattern:* `activate <HEATING_DEVICE>`\n\n4. **Verify Setup:** Confirm the container is correctly positioned and the device is active.\n * *Action Pattern:* `look at <HEATING_DEVICE>`\n * *Expected Observation:* The device is \"turned on\" and the container is listed as being on it.\n\n## Post-Setup & Monitoring\nAfter the heating apparatus is active, proceed with the main experiment (e.g., temperature measurement). Use the bundled `monitor_temperature.py` script for consistent temperature checks.\n* **Monitor State:** Regularly examine the substance (`examine <SUBSTANCE>`) to observe phase changes (e.g., solid -> liquid).\n* **Measure Temperature:** Use a thermometer (`use thermometer on <SUBSTANCE>`) to track thermal progress.\n\n## Error Handling & Notes\n* If the initial `look around` does not reveal the necessary items, use `teleport to <ROOM>` to navigate to the correct location (e.g., kitchen).\n* All containers are pre-opened. Do not use `open` or `close` actions.\n* The skill assumes the heating device is initially deactivated and ready for use.\n* For complex thermal protocols (specific ramp rates, hold times), consult the `references/thermal_procedures.md` guide.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-heating-apparatus-setup/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-instruction-reader",
- "skillId": "scienceworld-instruction-reader",
- "name": "scienceworld-instruction-reader",
- "description": "Reads a recipe or note from the inventory using the 'read' action and extracts key information. Use this skill when you have acquired a recipe, note, or readable document in your inventory and need to extract explicit instructions, ingredient lists, or procedural steps before executing a task.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-instruction-reader\ndescription: Reads a recipe or note from the inventory using the 'read' action and extracts key information. Use this skill when you have acquired a recipe, note, or readable document in your inventory and need to extract explicit instructions, ingredient lists, or procedural steps before executing a task.\n---\n# Skill: Instruction Reader\n\n## Purpose\nRead and parse a document (recipe, note, or instructions) from your inventory to extract the information needed to execute the current task.\n\n## When to Use\n- After picking up a recipe, note, or readable document.\n- When the task requires following written instructions (e.g., mixing chemicals, assembling components).\n- Before starting a multi-step procedure that depends on written directions.\n\n## Core Workflow\n1. **Read the Document:** `read OBJ` on the document in your inventory.\n2. **Extract Key Information:**\n - **Goal:** The final product or objective (e.g., \"make salt water\").\n - **Required Components:** Items or substances needed (e.g., \"sodium chloride, water\").\n - **Procedural Steps:** Actions or combinations described (e.g., \"mix sodium chloride, water\").\n3. **Plan Next Actions:** Use the extracted information to determine which skills and actions to invoke next.\n\n## Example\n**Task:** Follow a recipe to make salt water.\n\n1. `pick up recipe` — acquire the document\n2. `read recipe in inventory` — output: \"To make salt water, mix sodium chloride and water in a glass jar.\"\n3. **Extracted info:**\n - Goal: salt water\n - Components: sodium chloride, water\n - Procedure: mix in glass jar\n4. Proceed to fetch sodium chloride, water, and glass jar, then mix.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-instruction-reader/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-inventory-focus",
- "skillId": "scienceworld-inventory-focus",
- "name": "scienceworld-inventory-focus",
- "description": "Use when the agent needs to confirm and prepare a specific inventory item before using it in an experiment or task step. This \"focus on [ITEM] in inventory\" action verifies the correct item has been collected and signals intent, ensuring operational readiness for subsequent actions like measurement, combination, or placement.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-inventory-focus\ndescription: Use when the agent needs to confirm and prepare a specific inventory item before using it in an experiment or task step. This \"focus on [ITEM] in inventory\" action verifies the correct item has been collected and signals intent, ensuring operational readiness for subsequent actions like measurement, combination, or placement.\n---\n# Skill: scienceworld-inventory-focus\n\n## Purpose\n\nConfirm and prepare an inventory item before using it in a ScienceWorld task. The `focus on [ITEM] in inventory` action verifies the item's presence and signals intent, reducing errors in multi-step experimental procedures.\n\n## When to Use\n\n- After picking up an item that will be used in a subsequent critical action (measurement, combination, connection)\n- When verifying the correct object has been collected before proceeding\n- Before using a tool on a target object, to prepare both tool and target\n\n## Workflow\n\n1. **Acquire the item** -- Ensure the target item is in inventory (e.g., `pick up thermometer`).\n2. **Focus on the item** -- Execute: `focus on [ITEM] in inventory` (replace `[ITEM]` with the exact object name).\n3. **Confirm readiness** -- Wait for system response: `\"You focus on the [ITEM].\"`.\n4. **Proceed** -- Execute the intended action (e.g., `use thermometer on unknown substance B`).\n\n## Examples\n\n### Example 1: Preparing tool and target for temperature measurement\n\n```\n> pick up thermometer\nYou pick up the thermometer.\n\n> focus on thermometer in inventory\nYou focus on the thermometer.\n\n> pick up unknown substance B\nYou pick up the unknown substance B.\n\n> focus on unknown substance B in inventory\nYou focus on the unknown substance B.\n\n> use thermometer on unknown substance B\nThe thermometer measures a temperature of 42 degrees celsius.\n```\n\n### Example 2: Preparing an item for placement\n\n```\n> pick up metal fork\nYou pick up the metal fork.\n\n> focus on metal fork in inventory\nYou focus on the metal fork.\n\n> move metal fork to blue box\nYou move the metal fork to the blue box.\n```\n\n## Important Notes\n\n- The `focus on` action does not change the object's state; it is a declarative checkpoint that changes the agent's awareness and intent.\n- Always use the exact object name as it appears in the inventory.\n- If the item is not in inventory, use `pick up [ITEM]` first before attempting to focus.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-inventory-focus/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-inventory-manager",
- "skillId": "scienceworld-inventory-manager",
- "name": "scienceworld-inventory-manager",
- "description": "Handles picking up objects from the environment into the agent's inventory or moving them out to containers. Use this skill when you need to acquire an object for later use (pick up) or place an object into a specific container as part of a task requirement (move). Takes an object name and location as input and confirms the transfer to or from inventory.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-inventory-manager\ndescription: Handles picking up objects from the environment into the agent's inventory or moving them out to containers. Use this skill when you need to acquire an object for later use (pick up) or place an object into a specific container as part of a task requirement (move). Takes an object name and location as input and confirms the transfer to or from inventory.\n---\n# Skill: Inventory Manager\n\n## Purpose\nManage the agent's inventory: pick up objects from the environment or place them into containers.\n\n## Core Workflow\n1. **Locate Object:** Use `look around` to confirm the object is present and note its exact name.\n2. **Acquire:** `pick up OBJ` to move the object into your inventory.\n3. **Place (if needed):** `move OBJ to OBJ` to transfer the object to a container.\n4. **Verify:** Check the observation feedback to confirm the action succeeded. If it fails, verify exact object names with `look around`.\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `look around` | Find objects and confirm names |\n| `pick up OBJ` | Move object to inventory |\n| `move OBJ to OBJ` | Place object into a container |\n\n## Examples\n\n**Acquiring an object:**\n1. `look around` — see \"a metal pot containing nothing\" in the kitchen\n2. `pick up metal pot containing nothing in kitchen`\n3. Result: \"You move the metal pot to the inventory.\"\n\n**Placing an object:**\n1. `move metal pot to blue box`\n2. Result: Object transferred to the blue box.\n\n## Important Notes\n* Some objects include state descriptions in their name (e.g., \"metal pot containing nothing\"). Use the full name as shown in the environment.\n* Use container color and name as specified in the task (e.g., `blue box`, `orange box`).\n* Inventory capacity is limited — plan pick up and place actions to avoid conflicts.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-inventory-manager/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-item-fetcher",
- "skillId": "scienceworld-item-fetcher",
- "name": "scienceworld-item-fetcher",
- "description": "Picks up a specified object from the environment and moves it into the agent's inventory. Use this skill when you identify a required tool or material (e.g., thermometer, metal pot) that needs to be collected for later use in an experiment or task. Takes an object name as input and confirms the item's transfer to inventory.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-item-fetcher\ndescription: Picks up a specified object from the environment and moves it into the agent's inventory. Use this skill when you identify a required tool or material (e.g., thermometer, metal pot) that needs to be collected for later use in an experiment or task. Takes an object name as input and confirms the item's transfer to inventory.\n---\n# Skill: Fetch and Inventory Item\n\n## Purpose\nUse this skill when you need to acquire a specific object for a task. It handles locating the object in the current environment and moving it into your inventory for later use.\n\n## Core Workflow\n1. **Identify Need:** Determine which object is required for your current or upcoming task (e.g., \"thermometer\", \"metal pot\").\n2. **Locate Object:** Ensure you are in the correct room. Use `look around` to survey the environment and confirm the object is present and accessible.\n3. **Execute Fetch:** Use the `pick up` action on the target object.\n4. **Verify Success:** Confirm the system observation states the object has been moved to your inventory.\n\n## Key Principles\n* **Pre-check:** Always `look around` first to verify the object's presence and location (e.g., on a counter, in a container).\n* **Direct Action:** Use the simple `pick up OBJ` command. Do not overcomplicate the sequence.\n* **Inventory Focus:** After picking up the object, you may `focus on` it in your inventory to signal readiness for the next step in your main task.\n* **Error Handling:** If `pick up` fails, the object might be inside a closed container. Ensure all relevant containers are open first.\n\n## Example from Trajectory\n**Scenario:** Needing a thermometer to measure temperature.\n1. Observation: `a thermometer, currently reading a temperature of 10 degrees celsius` is seen in the kitchen.\n2. Action: `pick up thermometer`\n3. Result: `You move the thermometer to the inventory.`\n4. (Optional) Action: `focus on thermometer in inventory`\n\n## Input\n* **Object Name:** The name of the object to fetch, as it appears in the environment observations (e.g., \"thermometer\", \"metal pot\").\n\n## Output\n* A confirmation observation that the object is now in the agent's inventory.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-item-fetcher/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-liquid-filler",
- "skillId": "scienceworld-liquid-filler",
- "name": "scienceworld-liquid-filler",
- "description": "This skill fills a container with liquid from a source by first placing the container at the source, then activating the source (e.g., turning on a sink), and finally deactivating it. It should be triggered when the agent has an empty or partially filled container and needs to add a liquid component. The skill results in the container containing the liquid, ready for mixing or further use.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-liquid-filler\ndescription: This skill fills a container with liquid from a source by first placing the container at the source, then activating the source (e.g., turning on a sink), and finally deactivating it. It should be triggered when the agent has an empty or partially filled container and needs to add a liquid component. The skill results in the container containing the liquid, ready for mixing or further use.\n---\n# Instructions\n\n## 1. Identify the Goal\nYour goal is to fill a target container with a specific liquid from a source. This skill is triggered when you have a container (empty or partially filled) and need to add a liquid component to it.\n\n## 2. Prerequisites & Initial State\nBefore executing this skill, ensure you have:\n* **A Target Container:** The container you wish to fill (e.g., a cup, bowl, jug). It should be in your inventory.\n* **A Liquid Source Identified:** You must know the location of a functional liquid source (e.g., a sink, a jug containing liquid, a toilet with water). Use the `look around` and `examine` actions to find one.\n\n## 3. Core Procedure\nExecute the following sequence of actions precisely:\n\n1. **Position the Container:** Move the target container to the liquid source.\n * **Action:** `move <CONTAINER> to <SOURCE>`\n * **Example:** `move cup to sink`\n\n2. **Activate the Source:** Turn on the liquid source to begin the flow.\n * **Action:** `activate <SOURCE>`\n * **Example:** `activate sink`\n\n3. **Deactivate the Source:** Turn off the liquid source once the container is sufficiently filled. Assume the filling is instantaneous upon activation.\n * **Action:** `deactivate <SOURCE>`\n * **Example:** `deactivate sink`\n\n4. **Retrieve the Filled Container:** Pick up the now-filled container.\n * **Action:** `pick up <CONTAINER>`\n * **Example:** `pick up cup`\n\n## 4. Verification & Next Steps\n* Use `examine <CONTAINER>` to confirm it now contains the desired liquid.\n* The container is now ready for the next step in your task (e.g., `mix`).\n\n## 5. Important Notes\n* **Efficiency:** Do not repeatedly pick up the container between steps unless necessary for transport. The sequence `move -> activate -> deactivate -> pick up` is optimal.\n* **Error Handling:** If an action fails (e.g., \"You can't do that\"), re-examine the scene and the object states. The source may need to be in a specific state (e.g., a sink must be `turned off` before it can be activated).\n* **Context:** This skill is part of a larger procedure (e.g., following a recipe). Always refer to the primary task goal.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-liquid-filler/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-liquid-pourer",
- "skillId": "scienceworld-liquid-pourer",
- "name": "scienceworld-liquid-pourer",
- "description": "Transfers the contents of a source liquid container into a target container for mixing or preparation. Use this skill when you need to combine multiple substances (such as paints or chemicals) into a single vessel, or when a liquid must be moved from one container to another before processing.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-liquid-pourer\ndescription: Transfers the contents of a source liquid container into a target container for mixing or preparation. Use this skill when you need to combine multiple substances (such as paints or chemicals) into a single vessel, or when a liquid must be moved from one container to another before processing.\n---\n# Skill: Liquid Pourer\n\n## Purpose\nTransfer a liquid from a source container to a target container, typically as a preparatory step for mixing or chemical combination.\n\n## When to Use\n- Combining multiple liquids or substances into one vessel for mixing.\n- Moving a liquid to a more suitable container before heating or processing.\n- Preparing ingredients for a recipe that requires pouring.\n\n## Core Workflow\n1. **Identify Containers:** Use `look around` to locate the source container (with the liquid) and the target container (destination vessel).\n2. **Perform Transfer:** `pour OBJ into OBJ` with precise object identifiers.\n3. **Verify:** `look at OBJ` on the target container to confirm the transfer succeeded.\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `look around` | Locate source and target containers |\n| `pour OBJ into OBJ` | Transfer liquid contents |\n| `look at OBJ` | Verify transfer success |\n| `mix OBJ` | Combine contents (separate skill, used after pouring) |\n\n## Example\n**Task:** Create orange paint by mixing red and yellow paint.\n\n1. `look around` — find `wood cup (containing red paint)`, `wood cup (containing yellow paint)`, and `jug`\n2. `pour wood cup (containing red paint) into jug`\n3. `pour wood cup (containing yellow paint) into jug`\n4. `mix jug` — produces orange paint\n\n## Important Notes\n* Object identifiers must be precise (e.g., `wood cup (containing red paint)`). Use `look around` or `examine` to confirm exact names.\n* Ensure the target container can receive the substance without contamination.\n* Pouring only transfers contents — use `mix` as a separate step to combine them.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-liquid-pourer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-liquid-source-find",
- "skillId": "scienceworld-liquid-source-find",
- "name": "scienceworld-liquid-source-finder",
- "description": "This skill searches rooms for a liquid source (e.g., sink, toilet, jug) by sequentially surveying different locations. It should be triggered when the task requires obtaining a liquid (like water) and the agent does not have immediate access to it. The skill involves teleporting to candidate rooms, looking around, and identifying potential sources, guiding the agent toward the nearest available liquid.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-liquid-source-finder\ndescription: This skill searches rooms for a liquid source (e.g., sink, toilet, jug) by sequentially surveying different locations. It should be triggered when the task requires obtaining a liquid (like water) and the agent does not have immediate access to it. The skill involves teleporting to candidate rooms, looking around, and identifying potential sources, guiding the agent toward the nearest available liquid.\n---\n# Skill: Liquid Source Finder\n\n## When to Use\nActivate this skill when your primary task requires a liquid (e.g., water, juice, paint) and you have confirmed it is not present in your current inventory or immediate vicinity.\n\n## Core Procedure\n1. **Initiate Search:** If no liquid source is visible, begin a systematic room survey.\n2. **Prioritize Rooms:** Teleport to and survey rooms in this order of likelihood:\n * **Kitchen** (high priority - contains sink, fridge, cups)\n * **Bathroom** (high priority - contains sink, toilet, bathtub)\n * **Greenhouse** (medium priority - contains sink, jugs)\n * **Workshop** (medium priority - may contain specialized containers)\n * **Art Studio** (low priority - may contain paint or water for cleaning)\n * **Living Room, Bedroom, Hallway** (low priority - check for any containers)\n3. **Survey Each Room:**\n * Use `look around` upon arrival.\n * Visually scan the observation for liquid sources or containers that might hold liquid (e.g., `sink`, `toilet`, `jug`, `cup`, `bathtub`).\n * If a source is found (e.g., a `sink`), proceed to obtain the liquid. If a container is found (e.g., a `jug`), `examine` it or `look at` it to check its contents.\n4. **Obtain the Liquid:**\n * If the liquid is in a portable container (e.g., `cup containing water`), simply `pick up` the container.\n * If the liquid is in a fixed source (e.g., `sink`, `toilet`):\n a. Ensure you have an empty container in your inventory. If not, find one (e.g., a `cup`).\n b. `move` your container to the source.\n c. `activate` the source if necessary (e.g., turn on the sink).\n d. `deactivate` the source once done.\n e. `pick up` the now-filled container.\n5. **Terminate Search:** Once the required liquid is successfully obtained and in your inventory, conclude the skill and return to the main task flow.\n\n## Key Principles\n* **Efficiency:** Do not re-survey rooms unnecessarily. Keep mental note of rooms already visited.\n* **Container Management:** Always ensure you have a suitable container before attempting to collect liquid from a non-portable source.\n* **Observation Parsing:** Focus on object names and their described contents. Look for keywords like `water`, `juice`, or the name of your target liquid, and objects like `sink`, `toilet`, `jug`.\n\n## Quick Reference\n**Trigger:** Need liquid, don't have it.\n**Action Loop:** Teleport -> `look around` -> Identify source -> Collect.\n**Success:** Liquid is in inventory.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-liquid-source-find/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-living-entity-identifier",
- "skillId": "scienceworld-living-entity-identifier",
- "name": "scienceworld-living-entity-identifier",
- "description": "Analyzes room observations to identify potential living things (e.g., eggs, plants, animals) among listed objects. Use this skill when a task involves finding, focusing on, or interacting with a living thing, biological entity, or organism. Processes observation text, flags candidate living items based on domain knowledge, and outputs a focused target for subsequent actions like focus on or pick up.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-living-entity-identifier\ndescription: Analyzes room observations to identify potential living things (e.g., eggs, plants, animals) among listed objects. Use this skill when a task involves finding, focusing on, or interacting with a living thing, biological entity, or organism. Processes observation text, flags candidate living items based on domain knowledge, and outputs a focused target for subsequent actions like focus on or pick up.\n---\n# Skill: Living Entity Identifier\n\n## Purpose\nIdentify living things (eggs, plants, animals) from room observations and focus on them for task progression.\n\n## Core Workflow\n1. **Survey Room:** `look around` to get the observation text listing all objects.\n2. **Identify Candidates:** Scan the object list for living entity indicators:\n - **Animals:** dove, giant tortoise, bee, frog, fish\n - **Eggs:** dove egg, chicken egg, turtle egg\n - **Plants:** flower, tree, moss, fern, algae\n - **Other biological:** mushroom, seed, pollen\n3. **Focus on Target:** `focus on [IDENTIFIED_OBJECT]` to signal task progress.\n4. **Transport (if needed):** `pick up [OBJECT]` then `move [OBJECT] to [CONTAINER]`.\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `look around` | Survey room for objects |\n| `teleport to LOC` | Move to rooms with biological likelihood |\n| `focus on OBJ` | Signal identification to task system |\n| `pick up OBJ` | Acquire entity for transport |\n\n## Example\n**Task:** \"Find a living thing in the environment.\"\n\n1. `teleport to outside`\n2. `look around` — observation lists: \"a dove egg\", \"a rock\", \"soil\"\n3. Identify \"dove egg\" as the living entity candidate\n4. `focus on dove egg`\n5. If transport required: `pick up dove egg` then `move dove egg to blue box`\n\n## Important Notes\n* Prioritize explicit living things (e.g., \"dove egg,\" \"giant tortoise\") over ambiguous substances (e.g., \"air,\" \"water\").\n* If the current room lacks candidates, `teleport to` rooms with higher biological likelihood: `outside`, `greenhouse`, `bedroom`.\n* Always use `focus on` immediately after identification — it signals task progress.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-living-entity-identifier/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-material-classifier",
- "skillId": "scienceworld-material-classifier",
- "name": "scienceworld-material-classifier",
- "description": "This skill makes a determination about a material's property (e.g., conductivity) based on environmental cues or domain knowledge when direct testing fails. Trigger it when experimental actions are invalid or unavailable, requiring a logical inference. It uses observed object properties and common-sense reasoning to classify the material and decide its final disposition.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-material-classifier\ndescription: This skill makes a determination about a material's property (e.g., conductivity) based on environmental cues or domain knowledge when direct testing fails. Trigger it when experimental actions are invalid or unavailable, requiring a logical inference. It uses observed object properties and common-sense reasoning to classify the material and decide its final disposition.\n---\n# Material Classification Skill\n\n## When to Use\nActivate when direct experimental testing of a material property (conductivity, magnetism, etc.) fails or equipment is unavailable, and you need to classify the material by inference to complete a sorting task.\n\n## Procedure\n1. `focus on <OBJECT>` — identify the target and note its material composition.\n2. Attempt direct testing if equipment exists (e.g., `connect <OBJECT> terminal 1 to <WIRE> terminal 2`).\n3. If testing fails, infer the property from the object's material. Consult `references/material_properties.md` for lookup.\n4. `move <OBJECT> to <CONTAINER>` — place in the appropriate classification container.\n5. `look at <CONTAINER>` — verify the object was placed correctly.\n\n## Example\n**Task:** Classify a glass jar for electrical conductivity when the circuit test is unavailable.\n1. `focus on glass jar`\n2. `connect glass jar terminal 1 to yellow wire terminal 2` — action fails (invalid connection).\n3. Inference: glass is an electrical insulator → non-conductive.\n4. `move glass jar to orange box`\n5. `look at orange box` — observation: \"containing a glass jar\" — classification complete.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-material-classifier/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-measurement-taker",
- "skillId": "scienceworld-measurement-taker",
- "name": "scienceworld-measurement-taker",
- "description": "Use when the agent needs to measure a quantitative property (temperature, weight, pH) of a target object or substance using a measurement tool. This skill covers acquiring the tool, preparing both tool and target with focus actions, executing the measurement via \"use [TOOL] on [TARGET]\", and interpreting the resulting value for conditional decisions such as classification or placement.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-measurement-taker\ndescription: Use when the agent needs to measure a quantitative property (temperature, weight, pH) of a target object or substance using a measurement tool. This skill covers acquiring the tool, preparing both tool and target with focus actions, executing the measurement via \"use [TOOL] on [TARGET]\", and interpreting the resulting value for conditional decisions such as classification or placement.\n---\n# Skill: scienceworld-measurement-taker\n\n## Purpose\n\nMeasure a quantitative property of a target object or substance in the ScienceWorld environment using the appropriate measurement tool, then interpret the result for subsequent decision-making.\n\n## When to Use\n\n- When a task requires obtaining a numerical reading (temperature, weight, pH) from an object or substance\n- When a measured value determines a conditional next action (e.g., classify based on temperature threshold)\n- When the agent needs to compare properties across multiple objects\n\n## Workflow\n\n1. **Identify and acquire the tool** -- Locate the correct measurement instrument (e.g., thermometer, scale) and `pick up` the tool.\n2. **Focus on the tool** -- Execute `focus on [TOOL] in inventory` to confirm readiness.\n3. **Identify and acquire the target** -- Locate the target object or substance and `pick up` the target.\n4. **Focus on the target** -- Execute `focus on [TARGET] in inventory` to confirm readiness.\n5. **Position for follow-up** -- If the task requires a follow-up action (e.g., placing in a bin), `teleport to` the appropriate location before measuring.\n6. **Execute measurement** -- Use the tool on the target: `use [TOOL] on [TARGET]`.\n7. **Interpret and act** -- Read the numerical result and execute the appropriate conditional action.\n\n## Examples\n\n### Example 1: Measure temperature and classify\n\n```\n> teleport to kitchen\nYou teleport to the kitchen.\n\n> pick up thermometer\nYou pick up the thermometer.\n\n> focus on thermometer in inventory\nYou focus on the thermometer.\n\n> pick up unknown substance B\nYou pick up the unknown substance B.\n\n> focus on unknown substance B in inventory\nYou focus on the unknown substance B.\n\n> teleport to hallway\nYou teleport to the hallway.\n\n> use thermometer on unknown substance B\nThe thermometer measures a temperature of 56 degrees celsius.\n\n> move unknown substance B to orange box\nYou move the unknown substance B to the orange box.\n```\n\n### Example 2: Measure and compare two objects\n\n```\n> use thermometer on metal fork\nThe thermometer measures a temperature of 23 degrees celsius.\n\n> use thermometer on glass cup\nThe thermometer measures a temperature of 87 degrees celsius.\n```\n\nThe glass cup (87) is hotter than the metal fork (23).\n\n## Key Principles\n\n- **Tool first** -- Secure the measurement tool before handling the target.\n- **Focus before use** -- Always `focus on` both tool and target in inventory before measuring.\n- **Plan ahead** -- Identify where follow-up actions occur and position accordingly before measuring.\n- **Map thresholds** -- Clarify decision thresholds (e.g., \"above 100.0\" vs. \"below 100.0\") before executing the measurement.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-measurement-taker/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-mixture-creator",
- "skillId": "scienceworld-mixture-creator",
- "name": "scienceworld-mixture-creator",
- "description": "This skill chemically mixes the contents of a container using the 'mix' action. Use when all required ingredients (e.g., sodium chloride and water) are present inside a container and the agent needs to combine them to produce a new substance. The skill performs the mixing operation and outputs the resulting product, completing the synthesis step of the task.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-mixture-creator\ndescription: This skill chemically mixes the contents of a container using the 'mix' action. Use when all required ingredients (e.g., sodium chloride and water) are present inside a container and the agent needs to combine them to produce a new substance. The skill performs the mixing operation and outputs the resulting product, completing the synthesis step of the task.\n---\n# Skill: Chemical Mixture Creator\n\n## When to Use\nAll required ingredients are confirmed inside a single container and you need to combine them into a new substance.\n\n## Procedure\n1. `examine <CONTAINER>` — verify all required ingredients are present.\n2. `mix <CONTAINER>` — the environment processes the chemistry and produces the result.\n3. `examine <CONTAINER>` or `focus on <NEW_SUBSTANCE>` — confirm the synthesis succeeded.\n\nDo not `mix` unless the container holds the exact ingredients required by the recipe.\n## Example\n**Task:** Create salt water by mixing sodium chloride and water.\n1. `examine glass cup` — observe: \"containing water, sodium chloride\"\n2. `mix glass cup`\n3. Expected result: the environment produces \"salt water\" inside the glass cup.\n4. `focus on salt water` to confirm the synthesis is complete.\n\nFor common chemical recipes (e.g., salt water = sodium chloride + water), see `references/common_recipes.md`.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-mixture-creator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-object-classifier",
- "skillId": "scienceworld-object-classifier",
- "name": "scienceworld-object-classifier",
- "description": "Moves a tested or examined object into a designated container (e.g., a specific colored box) based on a determined property. Use when you have completed a test or inspection and need to fulfill a classification or sorting subtask. It takes the object and target container as inputs and performs the move action.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-object-classifier\ndescription: Moves a tested or examined object into a designated container (e.g., a specific colored box) based on a determined property. Use when you have completed a test or inspection and need to fulfill a classification or sorting subtask. It takes the object and target container as inputs and performs the move action.\n---\n# Instructions\n\n## Purpose\nThis skill is used to finalize a classification task by moving an object into its designated container. It is triggered **after** a property test or inspection has been completed and a decision has been made.\n\n## Prerequisites\n1. **Object Location:** The object to be classified must be present in the current room's environment (e.g., on the floor, on a table).\n2. **Container Location:** The target container (e.g., yellow box, purple box) must be present in the current room's environment.\n3. **Decision Made:** You must have already determined the object's property (e.g., electrically conductive vs. non-conductive) and know which container corresponds to that property.\n\n## Core Action\nExecute the `move` command to transfer the object into the correct container.\n* **Command Format:** `move <OBJECT> to <CONTAINER>`\n* **Example:** `move metal pot to yellow box`\n\n## Workflow\n1. **Confirm Environment:** Use `look around` to verify the object and target container are present.\n2. **Execute Move:** Perform the `move` action.\n3. **Verify:** Optionally, `look at <CONTAINER>` to confirm the object is now inside.\n\n## Important Notes\n* This skill is for the **final sorting action only**. Do not use it to perform the initial test or inspection.\n* Ensure the object is not in your inventory. If it is, drop it first (`drop <OBJECT>`).\n* The skill assumes the classification logic (e.g., interpreting a circuit test) has already been handled by a prior process.\n\n## Example\n**Task:** Sort a metal pot after a conductivity test determined it is conductive.\n1. `look around` — confirm metal pot and yellow box are in the room.\n2. `move metal pot to yellow box`\n3. `look at yellow box` — verify: \"containing a metal pot\".\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-object-classifier/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-object-focuser",
- "skillId": "scienceworld-object-focuser",
- "name": "scienceworld-object-focuser",
- "description": "This skill selects and focuses on a specific object to signal task intent or prepare it for manipulation. Use when you have identified a target object that meets task criteria (e.g., a living thing) and need to formally select it before performing actions like moving or using the object in ScienceWorld tasks. The skill uses the 'focus on OBJ' action, taking the object name as input.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-object-focuser\ndescription: This skill selects and focuses on a specific object to signal task intent or prepare it for manipulation. Use when you have identified a target object that meets task criteria (e.g., a living thing) and need to formally select it before performing actions like moving or using the object in ScienceWorld tasks. The skill uses the 'focus on OBJ' action, taking the object name as input.\n---\n# Skill: Object Focuser\n\n## Purpose\nUse this skill to formally select a target object in the ScienceWorld environment. The `focus on` action signals your intent to the task system and is often a prerequisite for subsequent manipulation steps like `pick up` or `move`.\n\n## When to Use\n* After you have identified an object that matches the task's criteria (e.g., \"a living thing\", \"a conductive material\").\n* Before you attempt to pick up, move, or use that object as part of the task sequence.\n* When the task trajectory or environment feedback suggests an object needs to be \"focused on\" to proceed.\n\n## Core Instruction\n1. **Identify the Target:** From your observation (`look around`, `examine`), determine the exact name of the object you intend to use for the task.\n2. **Execute Focus:** Use the action: `focus on <OBJECT_NAME>`.\n * Replace `<OBJECT_NAME>` with the precise noun phrase from the environment (e.g., `dove egg`, `copper wire`, `beaker`).\n3. **Proceed:** After receiving a confirmation observation, continue with the next step in your plan (e.g., `pick up <OBJECT_NAME>`, `move <OBJECT_NAME> to ...`).\n\n## Key Considerations\n* **Object Naming:** Use the name exactly as it appears in observations. The system is case-sensitive and expects the full descriptor (e.g., \"dove egg\", not just \"dove\" or \"egg\").\n* **Timing:** Focus is typically performed *after* exploration/identification and *before* the main manipulation action.\n* **Task Logic:** This action is a procedural formality within ScienceWorld. It does not change the object's state but informs the task tracker of your selected target.\n\n## Example\n**Task:** Focus on a dove egg before picking it up for a biology task.\n1. `look around` — observe: \"a dove egg on the table\"\n2. `focus on dove egg`\n3. Confirmation received → proceed with `pick up dove egg`.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-object-focuser/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-object-locator",
- "skillId": "scienceworld-object-locator",
- "name": "scienceworld-object-locator",
- "description": "Searches for a specific target object across multiple rooms by systematically teleporting to likely locations and examining each room. Use this skill when you need to find an object whose exact location is unknown. Iterates through candidate rooms using teleport and look around, checks for the object, and continues until found, returning the object's location.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-object-locator\ndescription: Searches for a specific target object across multiple rooms by systematically teleporting to likely locations and examining each room. Use this skill when you need to find an object whose exact location is unknown. Iterates through candidate rooms using teleport and look around, checks for the object, and continues until found, returning the object's location.\n---\n# Instructions\n\n## Purpose\nLocate a specific target object within the ScienceWorld environment when its location is unknown.\n\n## Inputs\n- **Target Object:** The name of the object to find (e.g., \"thermometer\", \"metal fork\").\n- **Candidate Rooms (Optional):** A list of room names to search. If not provided, the skill will use a default priority list based on common object locations.\n\n## Core Process\n1. **Initialize:** Receive the target object name.\n2. **Plan Search Order:** Determine the sequence of rooms to search. Use the provided `prioritize_rooms.py` script to generate an optimal search order based on the target object.\n3. **Execute Search Loop:**\n a. Teleport to the next room in the search order.\n b. Use the `look around` action to observe the room's contents.\n c. Parse the observation to check for the presence of the target object.\n d. If the object is found, **stop the search** and output its location.\n e. If the object is not found, proceed to the next room.\n4. **Output:** Report the room where the object was found. If the object is not found after searching all candidate rooms, report this failure.\n\n## Key Actions\n- `teleport to <ROOM_NAME>`\n- `look around`\n- `examine <OBJECT>` (if more detail is needed to confirm identity)\n- `pick up <OBJECT>` (if the goal is to acquire the object, not just locate it)\n\n## Example\n**Task:** Find the thermometer in the environment.\n\n1. `teleport to kitchen`\n2. `look around` — no thermometer found\n3. `teleport to workshop`\n4. `look around` — observation includes \"a thermometer, currently reading a temperature of 10 degrees celsius\"\n5. Thermometer located in workshop. `pick up thermometer` if needed.\n\n## Notes & Best Practices\n- **Efficiency:** Always `look around` immediately after teleporting to get the full room state.\n- **Parsing:** Observations list objects after \"you see:\". Check this list for the target object's name.\n- **Confirmation:** If an object's name is ambiguous (e.g., \"fork\" could be \"metal fork\" or \"plastic fork\"), use `examine` to get a detailed description.\n- **Inventory:** If the task requires using the object, remember to `pick it up` after finding it.\n- **Error Handling:** If an object is not in its most likely room, the systematic search will eventually find it. Do not give up after the first few rooms.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-object-locator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-object-placer",
- "skillId": "scienceworld-object-placer",
- "name": "scienceworld-object-placer",
- "description": "Moves a specified object from the environment or inventory into a target container based on a classification decision. Use this skill when a task requires sorting or storing an object in a specific location after an assessment (e.g., placing a conductive object in the blue box or a non-conductive object in the orange box).",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-object-placer\ndescription: Moves a specified object from the environment or inventory into a target container based on a classification decision. Use this skill when a task requires sorting or storing an object in a specific location after an assessment (e.g., placing a conductive object in the blue box or a non-conductive object in the orange box).\n---\n# Skill: Object Placer\n\n## Purpose\nMove an object into the correct container based on a prior classification or assessment result. This is the final step in conditional sorting workflows.\n\n## Core Workflow\n1. **Confirm Assessment Result:** Know which container corresponds to which classification (e.g., \"blue box\" = conductive, \"orange box\" = non-conductive).\n2. **Acquire Object (if needed):** `pick up OBJ` if the target is not already in inventory.\n3. **Execute Placement:** `move OBJ to OBJ` — place the object in the correct container.\n4. **Verify Placement:** `look at <CONTAINER>` to confirm the object is now inside.\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `pick up OBJ` | Acquire object if not in inventory |\n| `move OBJ to OBJ` | Place object into destination container |\n| `look at OBJ` | Verify placement succeeded |\n\n## Example\n**Task:** \"Determine if metal pot is electrically conductive. If conductive, place in the blue box. If nonconductive, place in the orange box.\"\n\n1. Assessment complete: circuit test confirmed metal pot is conductive.\n2. `pick up metal pot` (if not already held)\n3. `move metal pot to blue box`\n4. `look at blue box` — confirms: \"In the blue box is: a metal pot\"\n\n## Important Notes\n* The classification or assessment must be completed before invoking this skill.\n* Always verify placement with `look at` — do not assume success.\n* Container names vary per task (blue box, orange box, etc.) — match them to the task instructions.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-object-placer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-object-retriever",
- "skillId": "scienceworld-object-retriever",
- "name": "scienceworld-object-retriever",
- "description": "Acquires a specified object by moving it from the environment into the agent's inventory using 'pick up OBJ'. Use this skill when a task requires an object to be manipulated, tested, or transported and it is not yet in your inventory. Makes the object available for further actions like testing, measuring, or placing.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-object-retriever\ndescription: Acquires a specified object by moving it from the environment into the agent's inventory using 'pick up OBJ'. Use this skill when a task requires an object to be manipulated, tested, or transported and it is not yet in your inventory. Makes the object available for further actions like testing, measuring, or placing.\n---\n# Skill: Object Retriever\n\n## Purpose\nAcquire a target object from the environment and place it into your inventory for further use.\n\n## When to Use\n- You need an object for testing, measuring, or transporting.\n- The object is visible in the room but not yet in your inventory.\n- A downstream skill (e.g., tool-user, object-placer) requires the object in inventory.\n\n## Core Workflow\n1. **Navigate:** `teleport to LOC` if needed to reach the room containing the object.\n2. **Survey:** `look around` to confirm the object is present and identify its exact name.\n3. **Acquire:** `pick up OBJ` using the exact name from the environment description.\n4. **Verify:** Check the observation feedback confirms \"You move the [object] to the inventory.\"\n\n## Example\n**Task:** Retrieve a metal fork from the kitchen for conductivity testing.\n\n1. `teleport to kitchen`\n2. `look around` — see \"a metal fork\" on the counter\n3. `pick up metal fork`\n4. Observation: \"You move the metal fork to the inventory.\"\n\n## Important Notes\n* Ensure you are in the correct room before attempting `pick up`. Use `teleport to LOC` if necessary.\n* If `look around` does not reveal the object, use `examine` on containers or furniture (e.g., `examine table`).\n* If a container is closed, use `open OBJ` first.\n* After acquisition, the object is ready for the next skill in the task sequence.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-object-retriever/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-object-selector",
- "skillId": "scienceworld-object-selector",
- "name": "scienceworld-object-selector",
- "description": "Use when the agent needs to choose a specific object from multiple candidates in the environment based on task criteria such as object type (non-living thing, electrical component, container), properties, or category. This skill surveys visible objects with \"look around\", evaluates each against the task requirements, selects the most suitable candidate, and signals intent with \"focus on [OBJECT]\".",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-object-selector\ndescription: Use when the agent needs to choose a specific object from multiple candidates in the environment based on task criteria such as object type (non-living thing, electrical component, container), properties, or category. This skill surveys visible objects with \"look around\", evaluates each against the task requirements, selects the most suitable candidate, and signals intent with \"focus on [OBJECT]\".\n---\n# Skill: scienceworld-object-selector\n\n## Purpose\n\nIdentify and select the correct object from visible candidates in the ScienceWorld environment based on task-defined criteria (e.g., \"non-living thing\", \"electrical component\", \"container\"), then signal intent with a `focus on` action.\n\n## When to Use\n\n- When a task requires choosing a specific type of object from multiple visible options\n- When the agent must classify objects by property (living/non-living, material type, function) to select one\n- When the task instructs finding and interacting with a particular category of object\n\n## Workflow\n\n1. **Survey the environment** -- Use `look around` to list all visible objects in the current location.\n2. **Evaluate candidates** -- For each visible object, determine if it matches the task criteria. Exclude target containers (e.g., destination boxes) and fixed furniture from candidates.\n3. **Select the best match** -- Choose the first suitable, portable object unless the task specifies a preference (e.g., \"largest\", \"closest\").\n4. **Signal intent** -- Execute `focus on [OBJECT]` to confirm selection.\n5. **Execute the task action** -- Proceed with the required action (e.g., `pick up`, `move`, `use`).\n\n## Examples\n\n### Example 1: Find a non-living thing and move it\n\n**Task:** \"Find a non-living thing. First, focus on the thing. Then, move it to the purple box.\"\n\n```\n> look around\nYou see: purple box, table, battery, black wire, blue light bulb, red light bulb, red wire, switch, violet light bulb, yellow wire, ultra low temperature freezer.\n```\n\n**Evaluation:** Purple box is the destination. Table and freezer are fixed furniture. Remaining items (battery, wires, bulbs, switch) are all non-living and portable.\n\n```\n> focus on black wire\nYou focus on the black wire.\n\n> move black wire to purple box\nYou move the black wire to the purple box.\n```\n\n### Example 2: Find an electrical component\n\n**Task:** \"Find an electrical component and place it on the workbench.\"\n\n```\n> look around\nYou see: workbench, chair, battery, glass cup, red wire, notebook.\n\n> focus on battery\nYou focus on the battery.\n\n> move battery to workbench\nYou move the battery to the workbench.\n```\n\n## Key Principles\n\n- **Exclude destinations** -- Never select the target container or destination as the candidate object.\n- **Verify if uncertain** -- Use `examine [OBJECT]` for more detail about an object's properties before selecting.\n- **Task alignment** -- The selection should enable the next action in the task sequence.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-object-selector/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-planting-coordinator",
- "skillId": "scienceworld-planting-coordinator",
- "name": "scienceworld-planting-coordinator",
- "description": "This skill plants a seed or small plant into a suitable growth container (e.g., a flower pot with soil and water). It should be triggered when the agent has acquired a seed and needs to initiate the plant growth process by placing it into a prepared environment. The skill coordinates the 'move' action to transfer the seed from inventory to the target container, resolving any ambiguity if multiple instances exist.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-planting-coordinator\ndescription: This skill plants a seed or small plant into a suitable growth container (e.g., a flower pot with soil and water). It should be triggered when the agent has acquired a seed and needs to initiate the plant growth process by placing it into a prepared environment. The skill coordinates the 'move' action to transfer the seed from inventory to the target container, resolving any ambiguity if multiple instances exist.\n---\n# Planting Coordinator Skill\n\n## Purpose\nThis skill orchestrates the initial planting action to begin a plant growth process. It handles the transfer of a seed from the agent's inventory into a suitable growth container (e.g., a flower pot containing soil and water).\n\n## When to Use\n- **Trigger Condition:** The agent has acquired a seed (or small plant) and is in a location containing a suitable growth container.\n- **Goal:** Initiate the biological growth process by placing the seed into a prepared environment.\n\n## Core Procedure\n1. **Locate Target Container:** Identify a suitable container in the current environment. A valid container must contain both `soil` and `water` substances.\n2. **Execute Transfer:** Perform a `move` action to transfer the seed from your inventory to the target container.\n3. **Handle Ambiguity:** If the action parser returns an ambiguous request (listing multiple identical action options), select the first option (index `0`) to proceed. This resolves the ambiguity deterministically.\n4. **Signal Intent:** After successful planting, use `focus on [seed]` to signal monitoring intent for the growth task.\n\n## Key Notes\n- This skill assumes the seed is already in the agent's inventory.\n- The skill does not handle locating or acquiring the seed, nor the subsequent growth stages after planting.\n- The primary complexity managed is the deterministic resolution of ambiguous `move` actions.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-planting-coordinator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-planting-operation",
- "skillId": "scienceworld-planting-operation",
- "name": "scienceworld-planting-operation",
- "description": "Plants seeds into prepared containers with soil to initiate plant growth. Execute this when you have both seeds and properly prepared planting containers available. This skill handles the specific action pattern of transferring seeds from storage to growth containers to begin cultivation processes.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-planting-operation\ndescription: Plants seeds into prepared containers with soil to initiate plant growth. Execute this when you have both seeds and properly prepared planting containers available. This skill handles the specific action pattern of transferring seeds from storage to growth containers to begin cultivation processes.\n---\n# Planting Operation Skill\n\n## Purpose\nThis skill orchestrates the process of planting seeds into prepared growth containers (e.g., flower pots with soil) to initiate plant cultivation. It is triggered when you have acquired seeds and have containers ready for planting.\n\n## Core Workflow\n1. **Prerequisites:** Ensure you possess seeds (in inventory or accessible container) and that the target planting containers are present and contain soil.\n2. **Execution:** For each target container, transfer one seed from the seed source to the container.\n3. **Completion:** The skill is complete when a seed has been planted in each specified container.\n\n## Key Instructions\n* **Seed Source:** Interact with the seed source (e.g., `seed jar`) to access the seeds. Use `examine` or `look at` to confirm seed availability.\n* **Planting Action:** Use the `move OBJ to OBJ` action pattern, specifying the seed and the target container.\n* **Ambiguity Resolution:** The environment may present ambiguous action options (e.g., multiple identical seeds). Be prepared to select the correct option by number (typically `0`) when prompted.\n* **Post-Planting:** After planting, monitor plant growth. Subsequent skills may be required for watering, pollination, or harvesting.\n\n## Important Notes\n* This skill assumes containers are already prepared with soil. Soil preparation is a separate prerequisite.\n* The skill focuses on the mechanical act of planting. It does not cover acquiring seeds, preparing soil, or subsequent plant care.\n* Always verify the state of the container (`examine` or `look at`) before and after planting to confirm success.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-planting-operation/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-pot-preparer",
- "skillId": "scienceworld-pot-preparer",
- "name": "scienceworld-pot-preparer",
- "description": "Prepares a planting pot by moving soil from inventory into an empty or water-filled pot. Use this when setting up a growth environment for seeds or plants. It performs the 'move soil to flower pot X' action, transforming the container into a viable planting medium. This skill is atomic and can be repeated for multiple pots.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-pot-preparer\ndescription: Prepares a planting pot by moving soil from inventory into an empty or water-filled pot. Use this when setting up a growth environment for seeds or plants. It performs the 'move soil to flower pot X' action, transforming the container into a viable planting medium. This skill is atomic and can be repeated for multiple pots.\n---\n# Instructions\nUse this skill to prepare a flower pot for planting by filling it with soil.\n\n## Prerequisites\n1. **Soil in Inventory**: You must have soil in your inventory. If not, acquire soil first (e.g., by using a shovel on ground outdoors and picking up the resulting soil).\n2. **Target Pot**: Identify the specific flower pot you wish to prepare (e.g., \"flower pot 1\", \"flower pot 2\"). The pot can be initially empty or contain only water.\n\n## Core Action\nExecute the following action:\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-pot-preparer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-process-monitor",
- "skillId": "scienceworld-process-monitor",
- "name": "scienceworld-process-monitor",
- "description": "This skill observes the state of an active apparatus and its contents to track progress. Use when you need to periodically check for state changes (e.g., solid to liquid) during a heating or reaction process. The skill uses 'look at' or 'examine' actions on the apparatus and substance.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-process-monitor\ndescription: This skill observes the state of an active apparatus and its contents to track progress. Use when you need to periodically check for state changes (e.g., solid to liquid) during a heating or reaction process. The skill uses 'look at' or 'examine' actions on the apparatus and substance.\n---\n# Process Monitoring Protocol\n\n## When to Use\nActivate when an apparatus (stove, burner) is active and you need to check whether a substance has undergone a state change (e.g., solid to liquid, liquid to gas).\n\n## Procedure\n1. `look at <APPARATUS>` — verify it is active and contains the target substance.\n - If apparatus is not active, use `activate <APPARATUS>` first.\n - If substance is missing, check inventory or nearby containers.\n2. `examine <SUBSTANCE>` — check its current state description.\n3. Compare the observed state to the previous state. If changed (e.g., \"chocolate\" to \"liquid chocolate\"), proceed to the next task step.\n4. If no change, use `wait` then repeat from step 1.\n\nRun every few steps during an active process. This skill only observes — it does not modify the apparatus or handle substances.\n\n## Example\n**Task:** Monitor chocolate melting on a stove.\n1. `look at stove` — observation: \"a stove (activated), containing: chocolate\"\n2. `examine chocolate` — observation: \"chocolate\"\n3. No change yet. `wait`\n4. `examine chocolate` — observation: \"liquid chocolate\"\n5. State change detected. Proceed to take a temperature measurement.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-process-monitor/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-process-pauser",
- "skillId": "scienceworld-process-pauser",
- "name": "scienceworld-process-pauser",
- "description": "This skill introduces deliberate pauses in task execution. Use when the agent needs to consider next steps, evaluate intermediate results, or wait for processes to complete. The skill uses the 'wait1' or 'wait' actions to temporarily halt activity, preventing rushed decisions in complex experimental procedures.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-process-pauser\ndescription: This skill introduces deliberate pauses in task execution. Use when the agent needs to consider next steps, evaluate intermediate results, or wait for processes to complete. The skill uses the 'wait1' or 'wait' actions to temporarily halt activity, preventing rushed decisions in complex experimental procedures.\n---\n# Skill: Process Pauser\n\n## When to Use\nActivate this skill when you need to:\n* **Consider next steps** in a complex procedure.\n* **Evaluate an intermediate result** (e.g., a mixed chemical, a partial assembly).\n* **Wait for a simulated process** to complete.\n* **Prevent rushed decisions** that could lead to errors.\n\n## Core Actions\nUse the following actions to implement a pause:\n* `wait1`: Pauses execution for a single simulation step. Use for brief reflection.\n* `wait`: Pauses execution for 10 simulation steps. Use for longer consideration or simulated waiting periods.\n\n## Implementation Logic\n1. **Identify the Pause Trigger:** Recognize a moment requiring deliberation (e.g., after creating an intermediate product, before adding a new component).\n2. **Select Duration:** Choose `wait1` for quick checks or `wait` for extended evaluation.\n3. **Execute Pause:** Perform the selected wait action.\n4. **Resume:** Continue the task with the benefit of the reflective pause.\n\n## Example from Trajectory\nIn the paint-mixing task, the agent used `wait1` after creating orange paint and before adding more red to make red-orange. This pause allowed for consideration of proportions and color adjustment.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-process-pauser/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-recipe-retriever",
- "skillId": "scienceworld-recipe-retriever",
- "name": "scienceworld-recipe-retriever",
- "description": "This skill locates and acquires a recipe or instruction document by using 'pick up' on the recipe object. Use when the task involves following a specific procedure (e.g., crafting, mixing) and the agent needs to obtain the written instructions. The skill assumes the recipe is visible in the current room and moves it to the inventory, allowing the agent to read it later to understand required ingredients and steps.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-recipe-retriever\ndescription: This skill locates and acquires a recipe or instruction document by using 'pick up' on the recipe object. Use when the task involves following a specific procedure (e.g., crafting, mixing) and the agent needs to obtain the written instructions. The skill assumes the recipe is visible in the current room and moves it to the inventory, allowing the agent to read it later to understand required ingredients and steps.\n---\n# Skill: Recipe Retriever\n\n## Purpose\nAcquire a visible recipe or instruction document from the current environment and store it in your inventory for later reference.\n\n## Trigger Conditions\nUse this skill when:\n1. The task involves following a specific procedure (e.g., crafting, mixing, building).\n2. You are instructed to find or use a recipe.\n3. You need written instructions to understand required ingredients and steps.\n\n## Core Procedure\n1. **Locate Recipe**: Use `look around` to survey the current room. Identify any object described as a \"recipe,\" \"instructions,\" \"manual,\" or similar document.\n2. **Acquire Recipe**: Use `pick up <recipe_object>` to move the recipe to your inventory.\n3. **Verify Acquisition**: Confirm the recipe is now in your inventory before proceeding to the next task phase.\n\n## Key Notes\n- This skill assumes the recipe is visible and accessible in the current room.\n- The skill ends once the recipe is successfully moved to inventory.\n- Reading the recipe (using `read`) is a separate action that should be performed after acquisition.\n- If the recipe is not found in the current room, you may need to explore other rooms first.\n\n## Error Handling\n- If `pick up` fails (e.g., \"You cannot pick that up\"), examine the object first to verify it's a recipe.\n- If no recipe is found after looking around, expand your search to adjacent rooms.\n\n## Example\n**Task:** Obtain the recipe for crafting red paint.\n1. `look around` — observe: \"a recipe for red paint on the counter\"\n2. `pick up recipe for red paint`\n3. Expected observation: \"You move the recipe for red paint to the inventory.\"\n4. Later: `read recipe for red paint` to learn the required ingredients.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-recipe-retriever/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-result-archiver",
- "skillId": "scienceworld-result-archiver",
- "name": "scienceworld-result-archiver",
- "description": "Places an object into a designated container (like a colored box) based on a test outcome. It should be triggered when the agent needs to finalize a task by storing an object according to a rule (e.g., conductive → blue box, non-conductive → orange box). The input is the object and the rule, and the output is the object moved to the correct container.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-result-archiver\ndescription: Places an object into a designated container (like a colored box) based on a test outcome. It should be triggered when the agent needs to finalize a task by storing an object according to a rule (e.g., conductive → blue box, non-conductive → orange box). The input is the object and the rule, and the output is the object moved to the correct container.\n---\n# Instructions\nUse this skill to finalize a scientific test by archiving an object based on the observed result.\n\n## When to Use\n- You have just completed an experimental test (e.g., electrical conductivity, chemical reaction, physical property test).\n- You have a clear rule mapping a specific test outcome to a specific destination container (e.g., \"If property X is true, place in Container A; if false, place in Container B\").\n- The object to be archived and the destination containers are present in your current environment.\n\n## Core Procedure\n1. **Verify Context:** Ensure you are in the correct room (typically the `workshop` or lab area) where the test was conducted and where the destination containers are located.\n2. **Confirm Test Result:** Observe the final state of your experimental apparatus to definitively determine the test outcome (e.g., \"light bulb is on\").\n3. **Apply Rule:** Map the confirmed outcome to the corresponding destination container as specified by the task rule.\n4. **Execute Archive:** Move the test object from its current location (inventory or room) into the correct container using the `move OBJ to CONTAINER` action.\n\n## Key Principles\n- **Direct Archiving:** Do not re-run the test. The skill is for archiving the result based on an *already observed* outcome.\n- **Rule Adherence:** Strictly follow the provided mapping rule. Do not infer or create new rules.\n- **Container Verification:** Before moving the object, visually confirm the target container exists in the room (use `look around` if uncertain).\n\n## Example Rule Application\n*Task Rule:* \"If the metal pot is electrically conductive, place it in the blue box. If it is electrically nonconductive, place it in the orange box.\"\n*Observation:* The blue light bulb in the circuit is **on**.\n*Interpretation:* The metal pot is conductive.\n*Action:* `move metal pot to blue box`\n\n## Bundled Logic\nFor the specific, error-prone sequence of connecting a circuit to test electrical conductivity, use the bundled script `scripts/conductivity_test.py` as a reference. For all other test types, use the general instructions above.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-result-archiver/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-room-explorer",
- "skillId": "scienceworld-room-explorer",
- "name": "scienceworld-room-explorer",
- "description": "Performs an initial survey of a room to identify all visible objects, containers, devices, and their states using the 'look around' action. Use this skill when you first enter a new location, need to refresh your understanding of the environment, or must identify available resources before planning a sequence of actions. Returns a detailed observation that serves as foundational context for subsequent tasks.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-room-explorer\ndescription: Performs an initial survey of a room to identify all visible objects, containers, devices, and their states using the 'look around' action. Use this skill when you first enter a new location, need to refresh your understanding of the environment, or must identify available resources before planning a sequence of actions. Returns a detailed observation that serves as foundational context for subsequent tasks.\n---\n# Instructions\n\n## Purpose\nUse this skill to establish a foundational understanding of your immediate environment. It is the critical first step for any task requiring object interaction, inventory assessment, or spatial reasoning.\n\n## When to Use\n1. **Upon entering a new room.**\n2. When the task requires identifying available resources.\n3. Before planning a complex sequence of actions (e.g., building a circuit, mixing chemicals).\n4. If the state of the environment may have changed (e.g., after using an object, or if a long time has passed).\n\n## Core Action\nExecute the `look around` action. This is the only action required for this skill.\n\n## Output Processing\n1. The observation returned by `look around` is your primary output.\n2. Parse this observation to create a mental inventory. Key elements to note:\n * **Room Name:** The identified location.\n * **Objects:** List all items, containers, and devices.\n * **Object States:** Note if devices are on/off, containers are open/closed, or if objects contain other items.\n * **Connections:** Note any pre-existing wire connections or object placements.\n * **Exits:** Identify doors to other rooms and their state (open/closed).\n\n## Example\n**Scenario:** Agent teleports to the kitchen and needs to identify available resources.\n\n1. `teleport to kitchen`\n2. `look around`\n3. Observation: \"This room is called the kitchen. In it, you see: a fridge (containing chocolate, milk), a metal pot, a thermometer, a counter, a stove (which is turned off). You also see: a door to the hallway (which is open).\"\n4. **Parsed inventory:** fridge (open, contains chocolate and milk), metal pot, thermometer, counter, stove (off), exit to hallway.\n\n## Integration with Other Skills\nThe observation generated by this skill is essential context for downstream tasks. Before performing actions like `pick up`, `connect`, or `use`, always ensure your understanding of object locations and states is current by running this skill if needed.\n\n**Do not** use this skill for examining specific objects in detail; use the `examine OBJ` or `look at OBJ` actions for that purpose.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-room-explorer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-room-navigator",
- "skillId": "scienceworld-room-navigator",
- "name": "scienceworld-room-navigator",
- "description": "Teleports the agent to a specified room within the ScienceWorld environment. Use when the agent needs to move between different locations to locate objects or access specific facilities. The input is a target room name, and the output is the agent arriving at that room, ready for further interaction.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-room-navigator\ndescription: Teleports the agent to a specified room within the ScienceWorld environment. Use when the agent needs to move between different locations to locate objects or access specific facilities. The input is a target room name, and the output is the agent arriving at that room, ready for further interaction.\n---\n# Instructions\n\nUse this skill to instantly move the agent to a different room. This is the primary method of navigation.\n\n## When to Use\n* The agent needs to find an object known to be in a specific room (e.g., \"metal pot is located around the kitchen\").\n* The agent needs to access a facility available only in a specific room (e.g., a workshop for building circuits, a foundry for smelting).\n* The agent has completed tasks in one room and needs to proceed to the next relevant location.\n\n## How to Use\n1. **Identify the Target Room:** Determine the exact name of the destination room from the task context or environment description (e.g., `kitchen`, `workshop`, `foundry`).\n2. **Execute Teleport:** Use the `teleport to <ROOM_NAME>` action.\n3. **Verify Arrival:** The observation will confirm the teleport was successful (e.g., \"You teleport to the kitchen.\"). You may then proceed with `look around` to survey the new location.\n\n## Important Notes\n* Teleportation is a single-step action. There is no need for intermediate movement.\n* All standard room connections (doors) remain, but teleportation bypasses them.\n* After teleporting, the agent's inventory and any held items remain unchanged.\n\n## Example\n**Task:** Move to the kitchen to find a metal pot.\n1. `teleport to kitchen`\n2. Observation: \"You teleport to the kitchen.\"\n3. `look around` to survey the room and locate the metal pot.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-room-navigator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-room-scanner",
- "skillId": "scienceworld-room-scanner",
- "name": "scienceworld-room-scanner",
- "description": "This skill performs a 'look around' action to scan and describe the current room's contents, including visible objects, containers, and doors. Use when entering a new room or when the agent needs to locate specific items or assess the environment state. The skill outputs a detailed room description, which is essential for inventory discovery and situational awareness.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-room-scanner\ndescription: This skill performs a 'look around' action to scan and describe the current room's contents, including visible objects, containers, and doors. Use when entering a new room or when the agent needs to locate specific items or assess the environment state. The skill outputs a detailed room description, which is essential for inventory discovery and situational awareness.\n---\n# Skill: Room Scanner\n\n## Purpose\nExecute a `look around` action to obtain a comprehensive description of the current room in the ScienceWorld environment. This description is the foundational step for any task requiring item location, environmental assessment, or navigation planning.\n\n## Core Instruction\nWhen this skill is invoked, the agent must perform the **`look around`** action.\n\n## Trigger Conditions\nInvoke this skill when:\n1. You first enter a new room via `teleport` or other movement.\n2. You need to locate a specific object or container mentioned in your task.\n3. The state of the room may have changed (e.g., after an interaction).\n4. You are formulating a plan and require an inventory of available resources.\n\n## Output Processing\nThe observation from `look around` will contain:\n* **Room Name:** The identifier of your current location.\n* **Visible Objects & Agents:** A list of all entities in the room.\n* **Container Contents:** For open containers, a nested list of items inside (e.g., `a bowl (containing a red apple, a banana)`).\n* **Device States:** The status of interactive objects (e.g., `a stove, which is turned off`).\n* **Connections:** All accessible doors and their destination rooms.\n\n**You must parse this output carefully.** Use it to update your mental model of the environment before proceeding with other actions like `pick up`, `examine`, or `use`.\n\n## Integration Notes\n* This is a low-level, atomic skill. It should often be the first action in a sequence.\n* The observation it generates is critical context for subsequent decision-making. Refer back to it.\n* Do not overuse it. Once you have a recent description of a room, rely on that knowledge until you have reason to believe the state has changed.\n\n## Example\n**Task:** Survey the workshop after teleporting there.\n1. `look around`\n2. Observation: \"This room is called the workshop. In it, you see: a table. On the table is: a battery, a blue light bulb, an orange wire, a yellow wire, a green wire. You also see: a blue box, an orange box. There is a door to the hallway.\"\n3. Parse: available components include battery, light bulb, three wires; classification containers are blue box and orange box.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-room-scanner/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-room-teleporter",
- "skillId": "scienceworld-room-teleporter",
- "name": "scienceworld-room-teleporter",
- "description": "Teleports the agent to a specified room within the ScienceWorld environment. Use this skill when the target object or location for a task is known to be in a different room, enabling efficient navigation. It takes a target room name as input and outputs a successful teleportation observation.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-room-teleporter\ndescription: Teleports the agent to a specified room within the ScienceWorld environment. Use this skill when the target object or location for a task is known to be in a different room, enabling efficient navigation. It takes a target room name as input and outputs a successful teleportation observation.\n---\n# Instructions\nUse the `teleport to LOC` action to move the agent to the specified room.\n\n## Procedure\n1. **Identify Target Room:** Determine the exact name of the destination room from the task context or environment description.\n2. **Execute Teleport:** Use the action `teleport to <room_name>`, where `<room_name>` is the target location (e.g., `workshop`, `kitchen`, `foundry`).\n3. **Verify Success:** The expected output is an observation confirming the teleport, e.g., \"You teleport to the workshop.\"\n\n## Important Notes\n- This skill is for navigation only. It does not handle object interaction or task logic within the destination room.\n- Ensure the room name matches the environment's naming exactly. Common rooms include: kitchen, foundry, workshop, bathroom, outside, living room, bedroom, greenhouse, art studio, hallway.\n- Use this skill proactively to reduce unnecessary exploration steps when the target location is known.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-room-teleporter/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-substance-cooler",
- "skillId": "scienceworld-substance-cooler",
- "name": "scienceworld-substance-cooler",
- "description": "This skill initiates the cooling of a substance by moving it into a cooling appliance like a freezer. Use when a task requires lowering the temperature of a specific material to observe phase changes. The skill takes the substance (often in a container) and the target appliance as inputs, using the 'move OBJ to OBJ' action. It outputs confirmation of the new location.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-substance-cooler\ndescription: This skill initiates the cooling of a substance by moving it into a cooling appliance like a freezer. Use when a task requires lowering the temperature of a specific material to observe phase changes. The skill takes the substance (often in a container) and the target appliance as inputs, using the 'move OBJ to OBJ' action. It outputs confirmation of the new location.\n---\n# Skill: Substance Cooler\n\n## Purpose\nUse this skill to begin the process of cooling a substance to potentially observe a phase change (e.g., freezing). The core action is to relocate the substance into a cooling appliance.\n\n## When to Use\n* The task explicitly requires cooling a substance (e.g., \"measure the melting point of mercury\").\n* You have identified both the target substance (often inside a container like a cup or jar) and a suitable cooling appliance (e.g., freezer, ultra low temperature freezer).\n* The immediate goal is to lower the substance's temperature.\n\n## Core Instruction\n1. **Locate Items:** Ensure you are in the room containing the target substance and the cooling appliance. Use `look around` if necessary.\n2. **Execute Move:** Perform the action `move <SUBSTANCE_CONTAINER> to <APPLIANCE>`.\n * `<SUBSTANCE_CONTAINER>`: The object holding the substance (e.g., \"glass cup (containing a substance called mercury)\").\n * `<APPLIANCE>`: The cooling device (e.g., \"freezer\").\n3. **Verify:** Use `look at <APPLIANCE>` to confirm the substance is now inside the appliance. Report this confirmation.\n\n## Important Notes\n* **Prerequisite:** The appliance door must be open. The trajectory shows all containers are already open, so this should not require a separate `open` action.\n* **This is an Initialization Skill:** This skill only *starts* the cooling process. Subsequent skills or actions (like `use thermometer on <SUBSTANCE>`) are required to monitor temperature changes and observe the phase transition.\n* **Inputs:** The skill requires the names of the substance container and the target appliance as identified in the environment observations.\n* **Output:** A confirmation observation stating the substance is now inside the appliance.\n\n## Example from Trajectory\n**Trigger:** Task requires measuring the melting point of mercury.\n**Action:** `move glass cup (containing a substance called mercury) to freezer`\n**Verification:** `look at freezer` yields \"In the freezer is: a glass cup (containing a substance called mercury).\"\n**Output:** \"The mercury in its glass cup has been placed into the freezer to begin cooling.\"\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-substance-cooler/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-substance-fetcher",
- "skillId": "scienceworld-substance-fetcher",
- "name": "scienceworld-substance-fetcher",
- "description": "Locates and retrieves a target substance or material from a container in the environment. Use this skill when the task requires processing a specific substance (e.g., chocolate, sodium chloride, a chemical) and you need to find and acquire it. Searches rooms and containers (fridge, cupboard, counter) and retrieves the substance via pick up or move actions.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-substance-fetcher\ndescription: Locates and retrieves a target substance or material from a container in the environment. Use this skill when the task requires processing a specific substance (e.g., chocolate, sodium chloride, a chemical) and you need to find and acquire it. Searches rooms and containers (fridge, cupboard, counter) and retrieves the substance via pick up or move actions.\n---\n# Skill: Substance Fetcher\n\n## Primary Objective\nLocate a specified target substance (e.g., `chocolate`, `sodium chloride`) within the environment and retrieve it for subsequent processing.\n\n## Core Logic & Workflow\n1. **Identify Target:** The target substance name is provided as part of the task initiation (e.g., \"Your task is to measure the melting point of **chocolate**\").\n2. **Search Strategy:**\n * If the current room does not contain the target, use `teleport to [room]` to navigate to likely locations (e.g., `kitchen`, `workshop`, `greenhouse`).\n * Use `look around` to survey a room and identify containers.\n3. **Locate in Container:**\n * Examine open containers (`fridge`, `cupboard`, `counter`, `drawer`) listed in the room description.\n * The target substance is often found inside a container (e.g., \"In the fridge is: **chocolate**\").\n4. **Retrieval Action:**\n * If the substance is a portable object, use `pick up [substance]`.\n * If the substance is inside another object (e.g., in a pot), use `move [substance] to [destination container]` to prepare it for use.\n * **Key Assumption:** All containers are already open. Do not use `open` or `close` actions.\n\n## Critical Constraints & Notes\n* **Container State:** Assume all containers (fridge, cupboard, drawer) are **already open**. Do not waste actions opening them.\n* **Action Efficiency:** Prefer `pick up` for direct acquisition. Use `move` only when necessary to transfer the substance to a specific vessel for an experiment.\n* **Verification:** After retrieval, you may use `examine [substance]` or check your inventory to confirm success before proceeding to the next phase of the experiment.\n\n## Example Execution (Based on Trajectory)\n**Task Context:** \"Your task is to measure the melting point of **chocolate**...\"\n1. `teleport to kitchen`\n2. `look around` *(Observes: \"In the fridge is: chocolate...\")*\n3. `pick up chocolate` or `move chocolate to metal pot`\n\n## Error Handling\n* If the substance is not found in the initially suspected room, teleport to and search other relevant rooms (e.g., `workshop` for chemicals, `greenhouse` for plants).\n* If the retrieval action fails (e.g., object not found), re-examine the room description with `look around` to confirm the substance's location and container.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-substance-fetcher/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-substance-preparator",
- "skillId": "scienceworld-substance-preparator",
- "name": "scienceworld-substance-preparator",
- "description": "Use when you need to transfer a target substance into an appropriate container for processing (e.g., a pot for heating, a beaker for mixing). Trigger after acquiring the substance and before setting up an apparatus. Selects a suitable empty container and moves the substance into it.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-substance-preparator\ndescription: Use when you need to transfer a target substance into an appropriate container for processing (e.g., a pot for heating, a beaker for mixing). Trigger after acquiring the substance and before setting up an apparatus. Selects a suitable empty container and moves the substance into it.\n---\n# Substance Preparation Skill\n\n## Purpose\nPrepare a target substance for subsequent processing (e.g., heating, mixing) by transferring it from its current location into an appropriate, empty container.\n\n## When to Use\n1. **Trigger:** After successfully locating and focusing on the target substance.\n2. **Prerequisite:** The substance must be accessible (e.g., in inventory, in an open container).\n3. **Next Step:** This skill should be completed **before** setting up any apparatus (e.g., activating a stove, connecting electrical components).\n\n## Core Procedure\n1. **Identify Target Substance:** Confirm the exact name and location of the substance to be prepared.\n2. **Scan Environment for Containers:** Look for empty, process-appropriate containers in the current room. Priority order:\n * **Primary:** Metal pots, beakers, or bowls (for heating/mixing).\n * **Secondary:** Ceramic/glass cups, jars (if primary not available).\n * **Avoid:** Containers already holding items or substances.\n3. **Select & Validate Container:** Choose the most suitable empty container. If uncertain, `examine` it to confirm it's empty.\n4. **Execute Transfer:** Use the `move [SUBSTANCE] to [CONTAINER]` action.\n5. **Verify:** Briefly check the container's contents to confirm the transfer was successful.\n\n## Key Considerations\n* **Container State:** All containers are pre-opened. Do not use `open` or `close` actions.\n* **Efficiency:** Prefer containers in the same room to minimize `teleport` use.\n* **Substance Integrity:** If the substance is temperature-sensitive (e.g., chocolate in a fridge), moving it to a room-temperature container is part of preparation.\n* **Error Handling:** If the transfer fails (e.g., container not found), `look around` again and consult the bundled reference for common container names.\n\n## Example\n\n**Scenario:** You need to melt chocolate as part of a heating task.\n\n1. You have already located `chocolate` in the `fridge` in the kitchen.\n2. Run `look around` to scan for containers. You see: `metal pot` (empty, on counter), `glass beaker` (empty, on shelf), `ceramic cup` (contains water).\n3. Select `metal pot` as the best option (metal, empty, suitable for heating).\n4. Run `examine metal pot` to confirm it is empty.\n5. Run `move chocolate to metal pot`.\n6. Run `examine metal pot` — output confirms: \"metal pot (containing chocolate)\".\n\n**Proceed to the next skill (e.g., apparatus setup) only after this verification.**\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-substance-preparator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-target-identifier",
- "skillId": "scienceworld-target-identifier",
- "name": "scienceworld-target-identifier",
- "description": "Analyzes room observations to identify objects matching a given target description (e.g., 'living thing'). Triggered after exploring a room when the agent needs to locate a specific type of item. Processes the observation list, filters objects based on target criteria, and returns candidate objects for further action.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-target-identifier\ndescription: Analyzes room observations to identify objects matching a given target description (e.g., 'living thing'). Triggered after exploring a room when the agent needs to locate a specific type of item. Processes the observation list, filters objects based on target criteria, and returns candidate objects for further action.\n---\n# Skill: Target Object Identifier\n\n## Purpose\nThis skill enables you to systematically locate objects in the ScienceWorld environment that match a specific target description (e.g., \"living thing\", \"container\", \"electrical device\"). It transforms the raw observation text from `look around` into a structured list of candidate objects for your current task.\n\n## When to Use\n1. **Trigger Condition**: Immediately after executing `look around` in any room.\n2. **Input Required**: The full observation text from `look around` AND the target description from your task.\n3. **Output**: A prioritized list of matching objects with their locations and properties.\n\n## Execution Workflow\n\n### Step 1: Parse Observation\nExtract all observable items from the room description. Pay special attention to:\n- Objects listed after \"Here you see:\"\n- Objects in containers (marked with \"containing\" or \"On the X is:\")\n- Substances (marked as \"a substance called\")\n- Living vs. non-living distinctions\n\n### Step 2: Apply Target Filter\nUse the bundled classification script to filter objects based on the target description:\n- For \"living thing\": Include animals, plants, eggs, and biological organisms\n- For specific categories: Match against known object taxonomies\n- For generic descriptions: Use semantic similarity matching\n\n### Step 3: Prioritize Candidates\nRank candidates by:\n1. **Accessibility**: Objects not in closed containers first\n2. **Proximity**: Objects in current room before other locations\n3. **Task Relevance**: Objects matching secondary task criteria (e.g., \"easy to transport\")\n\n### Step 4: Generate Action Plan\nFor each high-priority candidate:\n1. Note its exact name as it appears in observations\n2. Determine if `pick up`, `focus on`, or other preliminary action is needed\n3. Plan path to target location if specified in task\n\n## Key Considerations\n- **Exact Object Names**: Use the exact phrasing from observations (e.g., \"turtle egg\" not \"egg turtle\")\n- **Container States**: All containers are open per environment rules\n- **Teleportation**: You can instantly move between rooms when searching\n- **Multiple Matches**: If multiple objects match, select based on task context (e.g., choose less mobile items for transport tasks)\n\n## Error Handling\n- If no matches found: Teleport to another room and repeat\n- If ambiguous matches: Use `examine OBJ` for clarification\n- If classification uncertain: Check reference taxonomy in bundled resources\n\n## Example Application\n*Task*: \"Find a living thing and move it to the blue box in bathroom\"\n1. `look around` in current room\n2. Run this skill with target=\"living thing\"\n3. Receive list: [\"baby wolf\", \"turtle egg\", \"crocodile egg\"]\n4. Select \"turtle egg\" (easier to transport)\n5. `focus on turtle egg` → `pick up turtle egg` → `teleport to bathroom` → `move turtle egg to blue box`\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-target-identifier/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-target-locator",
- "skillId": "scienceworld-target-locator",
- "name": "scienceworld-target-locator",
- "description": "This skill determines the most likely location for a target object based on domain knowledge and environmental clues. Use when the agent needs to find a specific item (like an animal) but it is not in the current room. It analyzes the environment description and suggests a room to teleport to for further investigation.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-target-locator\ndescription: This skill determines the most likely location for a target object based on domain knowledge and environmental clues. Use when the agent needs to find a specific item (like an animal) but it is not in the current room. It analyzes the environment description and suggests a room to teleport to for further investigation.\n---\n# Skill: Target Locator\n\n**Trigger:** When the agent needs to find a specific object (e.g., an animal, a tool, a chemical) and a preliminary `look around` in the current room does not reveal it.\n\n## Procedure\n\n1. Classify the target object by type.\n2. Map to the most probable room using these heuristics:\n | Object Type | Likely Room(s) |\n |-------------|---------------|\n | animal | outside, garden |\n | tool/wire/battery | workshop |\n | food/cooking item | kitchen |\n | chemical/substance | lab, foundry |\n | plant/seed | garden, greenhouse |\n | container/box | workshop, kitchen |\n3. Execute: `teleport to <ROOM>`\n4. `look around` to verify the target is present. If not, try the next likely room.\n\n## Example Flow (From Trajectory)\n* **Task:** \"find a(n) animal.\"\n* **Trigger:** `look around` in hallway shows no animal.\n* **Analysis:** Target type = `animal`.\n* **Heuristic Check:** Animals are most commonly found `outside`.\n* **Context Check:** A door to `outside` is not listed in the hallway observation.\n* **Decision:** The highest-probability room `outside` is accessible via teleport.\n* **Output:** `teleport to outside`\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-target-locator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-task-focuser",
- "skillId": "scienceworld-task-focuser",
- "name": "scienceworld-task-focuser",
- "description": "Use when the agent needs to direct attention to a specific object in the environment or inventory before performing a critical action such as measuring, using, or connecting. This preparatory \"focus on\" step signals intent to the ScienceWorld system, often unlocking required state changes for subsequent interactive steps in experimental procedures.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-task-focuser\ndescription: Use when the agent needs to direct attention to a specific object in the environment or inventory before performing a critical action such as measuring, using, or connecting. This preparatory \"focus on\" step signals intent to the ScienceWorld system, often unlocking required state changes for subsequent interactive steps in experimental procedures.\n---\n# Skill: scienceworld-task-focuser\n\n## Purpose\n\nFormally declare intent to interact with a specific object in the ScienceWorld environment. The `focus on` action is a required preparatory step that signals to the system which object subsequent actions (`use`, `measure`, `connect`) will target, often unlocking necessary state changes or measurement capabilities.\n\n## When to Use\n\n- Before using a measurement tool (e.g., thermometer) on a target object\n- Before complex operations such as connecting, mixing, or combining objects\n- When a task description explicitly instructs \"focus on\" an object\n- To confirm the correct item is in inventory before proceeding with an action\n\n## Workflow\n\n1. **Identify the target object** -- Determine the exact name as it appears in the environment (e.g., `thermometer`, `metal fork`).\n2. **Locate the object** -- Use `look around` or `inventory` to confirm the object's location (environment or inventory).\n3. **Execute the focus action** -- Issue the appropriate command:\n - Object in the environment: `focus on <OBJECT_NAME>`\n - Object in inventory: `focus on <OBJECT_NAME> in inventory`\n4. **Verify confirmation** -- Wait for the system response: `\"You focus on the <OBJECT_NAME>.\"` before proceeding to the next step.\n\n## Examples\n\n### Example 1: Preparing to measure temperature of a metal fork\n\n```\n> focus on thermometer in inventory\nYou focus on the thermometer.\n\n> focus on metal fork in inventory\nYou focus on the metal fork.\n\n> use thermometer on metal fork\nThe thermometer measures a temperature of 23 degrees celsius.\n```\n\n### Example 2: Focusing on an environmental object before moving it\n\n```\n> look around\nYou see: a table, a blue box, a red box, a metal fork (on table).\n\n> focus on metal fork\nYou focus on the metal fork.\n\n> move metal fork to blue box\nYou move the metal fork to the blue box.\n```\n\n## Important Notes\n\n- This skill does **not** perform the main action (e.g., measuring). It only prepares for it.\n- The `focus` action has no physical effect on the object; it is a declarative meta-action.\n- Always wait for the confirmation observation before attempting the next step.\n- If the object is not found, use `look around`, `examine`, or `teleport to` to locate it before attempting to focus.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-task-focuser/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-task-interpreter",
- "skillId": "scienceworld-task-interpreter",
- "name": "scienceworld-task-interpreter",
- "description": "This skill parses a user's high-level scientific task in the ScienceWorld environment and extracts the core objective and target location. It should be triggered when a new task instruction is received, especially those involving finding, comparing, or manipulating objects. The skill interprets the query to identify the goal (e.g., 'find the animal with the shortest life span') and any specified locations (e.g., 'animals are in the outside location'), outputting a clear, actionable sub-goal for navigation or observation.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-task-interpreter\ndescription: This skill parses a user's high-level scientific task in the ScienceWorld environment and extracts the core objective and target location. It should be triggered when a new task instruction is received, especially those involving finding, comparing, or manipulating objects. The skill interprets the query to identify the goal (e.g., 'find the animal with the shortest life span') and any specified locations (e.g., 'animals are in the outside location'), outputting a clear, actionable sub-goal for navigation or observation.\n---\n# Instructions\n\nActivate this skill when the user provides a new task instruction for the ScienceWorld environment. Your primary function is to interpret the instruction and generate a clear, executable plan.\n\n## 1. Parse the Task\nRead the user's instruction carefully. Extract the following core components:\n* **Primary Objective:** What is the ultimate goal? (e.g., \"find\", \"compare\", \"manipulate\").\n* **Target Object/Subject:** What is the main focus of the task? (e.g., \"animal with the shortest life span\").\n* **Specified Location:** Is a location explicitly mentioned? (e.g., \"animals are in the 'outside' location\").\n\n## 2. Formulate the Plan\nBased on the parsed components, construct a plan. The standard plan structure is:\n1. **Navigate:** If a target location is specified and you are not there, teleport to it immediately.\n2. **Observe:** Upon arriving at the correct location, use `look around` to survey the environment and identify relevant objects.\n3. **Analyze & Execute:** Apply domain knowledge or comparative reasoning to the observed objects to fulfill the primary objective. Then, take the final required action (e.g., `focus on [OBJECT]`, `pick up [OBJECT]`).\n\n## 3. Output the Interpretation\nBefore taking the first action, articulate your interpretation and plan in a **Thought** step. This confirms the skill has correctly parsed the task.\n**Output Format:**\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-task-interpreter/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-task-parser",
- "skillId": "scienceworld-task-parser",
- "name": "scienceworld-task-parser",
- "description": "Analyzes user instructions in ScienceWorld environments to extract specific task requirements and constraints. Use when receiving a new task to identify required objects, target locations, and action sequences before taking any environment actions.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-task-parser\ndescription: Analyzes user instructions in ScienceWorld environments to extract specific task requirements and constraints. Use when receiving a new task to identify required objects, target locations, and action sequences before taking any environment actions.\n---\n# Instructions for ScienceWorld Task Parsing\n\nWhen you receive a new task instruction in a ScienceWorld environment, follow this process to parse it into a structured plan.\n\n## 1. Parse the Instruction\nImmediately analyze the user's natural language instruction. Extract the following core components:\n* **Target Object Type:** Identify the category or description of the object to be manipulated (e.g., 'non-living thing', 'liquid', 'electrical component').\n* **Target Location:** Identify the final destination for the object, including the room and specific container (e.g., 'purple box in the workshop').\n* **Required Actions:** Infer the sequence of actions implied by verbs like \"find\", \"focus on\", \"move\", \"pour\", \"mix\", etc.\n\n**Output your analysis as a concise thought.** Example: \"Task requires finding a non-living object in the workshop and moving it to the purple box.\"\n\n## 2. Survey the Environment\n* Use `look around` in your current room to get an inventory of visible objects, containers, and their states.\n* If the target location is a different room, use `teleport to LOC` to go there first, then `look around`.\n\n## 3. Identify the Target Object\n* From the room description, identify objects matching the parsed **Target Object Type**.\n* If multiple candidates exist, select one that is clearly non-living, portable, and not part of a fixed apparatus (e.g., a wire, a light bulb, a battery). Avoid substances like 'air'.\n* Use `examine OBJ` or `look at OBJ` if you need more detail to confirm an object's properties.\n\n## 4. Execute the Task Sequence\n1. **Signal Intent:** Use `focus on OBJ` on the identified target object. This explicitly marks the object for the task.\n2. **Perform Core Action:** Execute the primary action from the parsed instruction (e.g., `move OBJ to OBJ`, `pour OBJ into OBJ`).\n3. Use `wait` or `wait1` only if necessary to allow for state changes.\n\n## Key Principles\n* **Efficiency:** All containers are pre-opened. Do not use `open` or `close` unless explicitly required.\n* **Directness:** Teleport directly to the target room. Do not explore unrelated rooms.\n* **Clarity:** Structure your internal reasoning using the \"Thought:\" prefix before each action, as shown in the trajectory.\n* **Verification:** If an initial `look around` is insufficient, a second `look around` is acceptable to confirm the environment state before proceeding.\n\n## Example\n**Task instruction:** \"Find a non-living thing in the workshop and move it to the purple box.\"\n1. **Parse:** Target = non-living object, Location = workshop, Container = purple box.\n2. `teleport to workshop`\n3. `look around` — observe: \"a battery, a blue light bulb, an orange wire...\"\n4. Select: battery (non-living, portable).\n5. `focus on battery`\n6. `move battery to purple box`\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-task-parser/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-temperature-measurer",
- "skillId": "scienceworld-temperature-measurer",
- "name": "scienceworld-temperature-measurer",
- "description": "This skill uses a thermometer on a substance to measure its temperature. It should be triggered when the agent needs to determine the temperature of a material (e.g., lead) to assess if it has reached a specific melting point or threshold. The skill requires a thermometer in inventory and a target substance, outputting the measured temperature in degrees Celsius, which is key for scientific measurement tasks.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-temperature-measurer\ndescription: This skill uses a thermometer on a substance to measure its temperature. It should be triggered when the agent needs to determine the temperature of a material (e.g., lead) to assess if it has reached a specific melting point or threshold. The skill requires a thermometer in inventory and a target substance, outputting the measured temperature in degrees Celsius, which is key for scientific measurement tasks.\n---\n# Skill: Temperature Measurement for Scientific Experiments\n\n## Purpose\nMeasure the temperature of a target substance (e.g., a metal like lead) to determine if it has reached a specific state-change threshold, such as its melting point.\n\n## Core Workflow\n1. **Acquire Thermometer:** Ensure a thermometer is in your inventory. If not, locate and pick one up.\n2. **Locate Target Substance:** Identify the substance to be measured (e.g., \"lead\"). It may be in a container.\n3. **Prepare for Heating (If Necessary):** If measuring a melting point, the substance likely needs to be heated.\n * Transfer the substance to a heat-resistant container (e.g., a metal pot).\n * Move the container to a heating device (e.g., a blast furnace in the foundry).\n * Activate the heating device.\n4. **Measure Temperature:** Use the thermometer from your inventory on the target substance.\n5. **Interpret Result:** The observation will state the measured temperature in degrees Celsius. Use this value to make a decision (e.g., \"above 150.0 degrees\" -> focus on the red box).\n\n## Key Actions & Observations\n* `pick up thermometer`: Acquire the essential measuring tool.\n* `move [substance] to [container]`: Prepare the sample.\n* `activate [heating device]`: Initiate the temperature change process.\n* `use thermometer in inventory on [substance]`: The primary measurement command. The observation (`the thermometer measures a temperature of X degrees celsius`) is the skill's key output.\n* Observe state changes: `a substance called lead` -> `a substance called liquid lead`.\n\n## Bundled Logic\nFor a standard melting point determination task, use the bundled script `measure_melting_point.py`. It encapsulates the precise sequence for the lead experiment demonstrated in the trajectory.\n\n## Notes\n* The skill assumes containers are open and accessible.\n* Teleportation (`teleport to [room]`) is often necessary to move between resource locations (e.g., kitchen, foundry).\n* If `use thermometer` fails, check the substance's state via `look at [container]` and ensure the thermometer is in your inventory.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-temperature-measurer/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-threshold-evaluator",
- "skillId": "scienceworld-threshold-evaluator",
- "name": "scienceworld-threshold-evaluator",
- "description": "Use when the agent has just obtained a numerical measurement (temperature, weight, pH) and must compare it against a predefined threshold to determine a binary outcome. This skill extracts the measured value, evaluates it against the threshold condition (above/below), and executes the corresponding branch action such as classification or placement.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-threshold-evaluator\ndescription: Use when the agent has just obtained a numerical measurement (temperature, weight, pH) and must compare it against a predefined threshold to determine a binary outcome. This skill extracts the measured value, evaluates it against the threshold condition (above/below), and executes the corresponding branch action such as classification or placement.\n---\n# Skill: scienceworld-threshold-evaluator\n\n## Purpose\n\nCompare a measured numerical value against a predefined threshold to determine which of two conditional actions to execute. This is the decision-making step that immediately follows a measurement in ScienceWorld experimental workflows.\n\n## When to Use\n\n- Immediately after obtaining a numerical measurement (e.g., temperature reading from a thermometer)\n- When the task includes a conditional instruction like \"if above X, do A; if below X, do B\"\n- When classifying or sorting objects based on measured properties\n\n## Workflow\n\n1. **Extract the measurement** -- Parse the numerical value from the observation (e.g., `\"the thermometer measures a temperature of 56 degrees celsius\"` yields `56`).\n2. **Identify the threshold and condition** -- From the task instruction, determine the threshold value and comparison operator (e.g., `\"above 50.0 degrees\"` means `threshold=50.0`, `operator=\">\"`).\n3. **Evaluate the comparison** -- Compare: `measured_value > threshold` or `measured_value < threshold`.\n4. **Execute the correct branch** -- Perform the action specified for the satisfied condition.\n\n## Examples\n\n### Example 1: Temperature-based classification\n\n**Task:** \"Measure the temperature. If above 50.0 degrees, move to the orange box. If below 50.0 degrees, move to the blue box.\"\n\n```\n> use thermometer on unknown substance B\nThe thermometer measures a temperature of 56 degrees celsius.\n```\n\n**Evaluation:** 56 > 50.0 is TRUE, so execute the \"above\" branch.\n\n```\n> move unknown substance B to orange box\nYou move the unknown substance B to the orange box.\n```\n\n### Example 2: Weight-based sorting\n\n**Task:** \"If the object weighs more than 200 grams, place in the red bin. Otherwise, place in the green bin.\"\n\n```\n> use scale on rock sample\nThe scale measures a weight of 145 grams.\n```\n\n**Evaluation:** 145 > 200 is FALSE, so execute the \"otherwise\" branch.\n\n```\n> move rock sample to green bin\nYou move the rock sample to the green bin.\n```\n\n## Key Principles\n\n- **Immediate execution** -- Do not perform other actions between obtaining the measurement and evaluating the threshold.\n- **Precision** -- Use the exact numerical value from the observation; do not estimate or round.\n- **Binary decision** -- The outcome is strictly one of two paths. If the measurement equals the threshold, re-examine the instruction for boundary guidance (\"above\" typically means `>`, not `>=`).\n\n## Common Pitfalls\n\n- **Incorrect branching** -- Executing the action for the opposite condition (e.g., blue box when value is above threshold).\n- **Premature evaluation** -- Attempting to evaluate before the measurement is complete and valid.\n- **Action confusion** -- Targeting the wrong object in the post-evaluation action.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-threshold-evaluator/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-tool-fetcher",
- "skillId": "scienceworld-tool-fetcher",
- "name": "scienceworld-tool-fetcher",
- "description": "This skill locates and picks up a specified tool or instrument from the environment. It should be triggered when a task requires a specific tool (e.g., thermometer, stopwatch) for measurement or manipulation. The skill identifies the tool's location via observation and executes a pick-up action, moving the tool to inventory.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-tool-fetcher\ndescription: This skill locates and picks up a specified tool or instrument from the environment. It should be triggered when a task requires a specific tool (e.g., thermometer, stopwatch) for measurement or manipulation. The skill identifies the tool's location via observation and executes a pick-up action, moving the tool to inventory.\n---\n# Instructions\n\n**Primary Goal:** Locate a specified tool and move it to your inventory.\n\n## 1. Identify the Target Tool\n* The required tool will be specified in the user's task or request (e.g., \"thermometer\", \"stopwatch\", \"lighter\").\n* Confirm the exact name of the tool object.\n\n## 2. Locate the Tool via Exploration\n* If you are not in the correct room, use `teleport to [ROOM_NAME]` to go to the most likely location (e.g., `kitchen`, `workshop`).\n* Use `look around` to survey the current room.\n* Scan the observation for the target tool name. It may be:\n * Listed directly in the room description (e.g., \"a thermometer\").\n * Inside an open container (e.g., \"a fridge. In the fridge is: chocolate, a wood cup...\").\n* If the tool is not immediately visible, examine likely containers using `look at [CONTAINER]` (e.g., `look at counter`, `look at cupboard`).\n\n## 3. Execute the Pick-up\n* Once the tool is located, execute the action: `pick up [TOOL_NAME]`.\n* Example: `pick up thermometer`.\n* Verify the action was successful by checking the observation for confirmation (e.g., \"You move the thermometer to the inventory.\").\n\n## 4. Post-Action Verification (Optional)\n* If required by the broader task, you may perform a secondary action to signal readiness, such as `focus on [TOOL_NAME] in inventory`.\n\n## Key Constraints & Notes\n* **Containers are Open:** All containers are pre-opened. Do not use `open` or `close` actions.\n* **Direct Action:** Proceed directly to `pick up`. Do not attempt to move the tool to an intermediate location first.\n* **Tool Not Found:** If the tool is not in the initial room, systematically `teleport` to other relevant rooms and repeat the `look around` search pattern.\n* **Single Tool:** This skill fetches one specified tool. For multiple tools, trigger the skill sequentially.\n\n**Output:** The target tool will be in your inventory, ready for use in subsequent task steps.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-tool-fetcher/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-tool-user",
- "skillId": "scienceworld-tool-user",
- "name": "scienceworld-tool-user",
- "description": "Uses a tool from inventory on a target object or location to perform a specific environmental interaction, such as digging, cutting, or measuring. Use this skill when a task requires modifying the environment or manipulating materials with a tool (e.g., using a shovel to dig soil, a thermometer to measure temperature, or an axe to cut wood). Takes the tool and target as inputs and outputs the result of the interaction.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-tool-user\ndescription: Uses a tool from inventory on a target object or location to perform a specific environmental interaction, such as digging, cutting, or measuring. Use this skill when a task requires modifying the environment or manipulating materials with a tool (e.g., using a shovel to dig soil, a thermometer to measure temperature, or an axe to cut wood). Takes the tool and target as inputs and outputs the result of the interaction.\n---\n# Skill: Tool User\n\n## Purpose\nPerform a physical action on the environment using a tool from your inventory. The core action is `use TOOL on TARGET`.\n\n## When to Use\n- A task requires modifying the environment (digging, cutting, heating).\n- You need to measure a property of an object (temperature, conductivity).\n- A tool-based interaction is the next step in your experiment workflow.\n\n## Core Workflow\n1. **Ensure Tool in Inventory:** The required tool (e.g., `shovel`, `thermometer`, `axe`) must be in your inventory. Use `pick up OBJ` if it is not.\n2. **Identify Target:** Determine the exact target object or location name (e.g., `ground`, `tree`, `metal fork`).\n3. **Execute:** `use TOOL on TARGET`.\n4. **Interpret Result:** Read the observation output to determine the outcome (e.g., temperature reading, state change).\n\n## Key Actions\n| Action | Purpose |\n|--------|---------|\n| `pick up OBJ` | Acquire tool if not in inventory |\n| `use OBJ on OBJ` | Perform tool interaction |\n| `look around` | Confirm target identity and location |\n\n## Example\n**Task:** Measure the temperature of a metal fork using a thermometer.\n\n1. `pick up thermometer` — ensure tool is in inventory\n2. `use thermometer on metal fork`\n3. Observation: \"a thermometer, currently reading a temperature of 72 degrees celsius\"\n\n## Important Notes\n* The tool must be in your inventory before use. The `pick up` action is a prerequisite.\n* Use exact object names as they appear in the environment description.\n* Some tools produce measurable outputs (thermometer readings); others produce state changes (shovel digs soil). Interpret accordingly.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-tool-user/SKILL.md"
- },
- {
- "id": "ScienceWorld::scienceworld-tool-validator",
- "skillId": "scienceworld-tool-validator",
- "name": "scienceworld-tool-validator",
- "description": "Use when the agent has acquired a tool or instrument and needs to verify it is operational before first use in a critical task step. This skill performs a lightweight pre-use check via \"focus on [TOOL] in inventory\" and confirms readiness based on the system's response, ensuring the tool is functional before measurement, activation, or connection operations.",
- "collection": "ScienceWorld",
- "source": "---\nname: scienceworld-tool-validator\ndescription: Use when the agent has acquired a tool or instrument and needs to verify it is operational before first use in a critical task step. This skill performs a lightweight pre-use check via \"focus on [TOOL] in inventory\" and confirms readiness based on the system's response, ensuring the tool is functional before measurement, activation, or connection operations.\n---\n# Skill: scienceworld-tool-validator\n\n## Purpose\n\nPerform a pre-use functionality check on a tool or instrument to confirm it is operational before employing it in a critical ScienceWorld task step such as measurement, activation, or connection.\n\n## When to Use\n\n- Immediately after acquiring a tool (e.g., `pick up thermometer`) and before its first use\n- When switching to a different tool mid-task and needing to confirm readiness\n- When resuming a task after navigation and needing to re-confirm tool availability\n\n## Workflow\n\n1. **Acquire the tool** -- Ensure the target tool is in inventory. If not, locate it with `look around` and retrieve it with `pick up [TOOL]`.\n2. **Execute validation** -- Run: `focus on [TOOL] in inventory`.\n3. **Confirm readiness** -- A successful response (`\"You focus on the [TOOL].\"`) confirms the tool is operational. No further diagnostic steps are needed unless an error is observed.\n4. **Proceed** -- Use the validated tool in the task operation (e.g., `use thermometer on [TARGET]`).\n\n## Examples\n\n### Example 1: Validating a thermometer before measurement\n\n```\n> pick up thermometer\nYou pick up the thermometer.\n\n> focus on thermometer in inventory\nYou focus on the thermometer.\n```\n\nThe thermometer is validated. Proceed with measurement:\n\n```\n> use thermometer on unknown substance B\nThe thermometer measures a temperature of 42 degrees celsius.\n```\n\n### Example 2: Validating a scale after teleporting to a new room\n\n```\n> teleport to workshop\nYou teleport to the workshop.\n\n> pick up scale\nYou pick up the scale.\n\n> focus on scale in inventory\nYou focus on the scale.\n```\n\nThe scale is validated and ready to weigh objects.\n\n## Key Principles\n\n- **Timing** -- Validate immediately after acquisition, before any task-sensitive operation.\n- **Simplicity** -- The `focus on` action is the primary, lightweight validation method. Avoid unnecessary `examine` or `use` actions during the check.\n- **State awareness** -- Ensure containers are open and items are accessible before attempting to pick up tools. Use `teleport to` for efficient navigation.\n",
- "path": "experiments/src/skills/scienceworld/scienceworld-tool-validator/SKILL.md"
- },
- {
- "id": "ScienceWorld::soil-extraction",
- "skillId": "soil-extraction",
- "name": "soil-extraction",
- "description": "Uses a shovel tool to dig soil from the ground in outdoor environments. Execute this skill when you need to obtain soil for planting tasks and have both the shovel in inventory and access to an appropriate digging location. The skill produces soil that can then be collected and transported.",
- "collection": "ScienceWorld",
- "source": "---\nname: soil-extraction\ndescription: Uses a shovel tool to dig soil from the ground in outdoor environments. Execute this skill when you need to obtain soil for planting tasks and have both the shovel in inventory and access to an appropriate digging location. The skill produces soil that can then be collected and transported.\n---\n# Skill: Soil Extraction\n\n## Purpose\nThis skill enables the agent to extract soil from the ground using a shovel. It is a foundational step for planting tasks, transforming a bare outdoor location into a source of usable soil.\n\n## Prerequisites\n1. **Tool in Inventory:** You must possess a `shovel` in your inventory.\n2. **Location:** You must be in an outdoor environment (e.g., `outside`) where digging is permissible.\n3. **Ground Access:** The ground must be accessible and diggable.\n\n## Core Procedure\n1. **Navigate:** Ensure you are in the target outdoor location (e.g., `teleport to outside`).\n2. **Execute Dig:** Use the command `use shovel in inventory on ground`.\n3. **Collect Output:** The action will produce `soil` placed nearby. Use `pick up soil` to add it to your inventory.\n\n## Key Notes\n* **Deterministic Action:** The `use shovel in inventory on ground` command is a reliable, single-step method for soil extraction as demonstrated in the trajectory.\n* **Output Management:** The extracted soil is a separate object that must be explicitly picked up. It does not automatically enter your inventory.\n* **Skill Chaining:** This skill is typically followed by `teleport` to transport the soil and `move` to deposit it into a target container (e.g., a flower pot).\n\n## Error Handling & Ambiguity\n* If the `use` command is ambiguous, select the action that clearly involves your inventory shovel and the ground.\n* If no soil appears after digging, verify your location and that the shovel is correctly in your inventory.\n* This skill does not handle soil preparation (e.g., mixing with water) or planting. It is strictly for extraction.\n",
- "path": "experiments/src/skills/scienceworld/soil-extraction/SKILL.md"
- },
- {
- "id": "ScienceWorld::task-completion-focus",
- "skillId": "task-completion-focus",
- "name": "task-completion-focus",
- "description": "Focuses on a specific target object to signal task completion. Use when you have produced the required final object (like a grown banana) and need to formally complete the assigned task. This handles the 'focus on OBJ' action that typically marks successful task execution in the environment.",
- "collection": "ScienceWorld",
- "source": "---\nname: task-completion-focus\ndescription: Focuses on a specific target object to signal task completion. Use when you have produced the required final object (like a grown banana) and need to formally complete the assigned task. This handles the 'focus on OBJ' action that typically marks successful task execution in the environment.\n---\n# Skill: Task Completion Focus\n\n## When to Use\nThe final required object (e.g., grown banana, crafted item) is visibly present and you need to formally signal task completion. Do not use for intermediate steps.\n\n## Procedure\n1. `look around` — confirm the target object is visible in the scene.\n2. `focus on <OBJECT>` — signal task completion.\n3. **Ambiguity handling:** If the environment returns \"Ambiguous request\" with numbered options, respond with the option number (e.g., `0`) for the target most directly associated with your task goal.\n\n## Example\n**Task:** \"Grow a banana.\" After successful cultivation:\n1. `look around` — observation: \"On the banana tree you see: a banana, a flower.\"\n2. `focus on banana on banana tree`\n3. If ambiguous prompt appears listing multiple bananas, select `0` (first instance).\n4. Observation confirms task completion.\n",
- "path": "experiments/src/skills/scienceworld/task-completion-focus/SKILL.md"
- },
- {
- "id": "WebShop::webshop-action-executor",
- "skillId": "webshop-action-executor",
- "name": "webshop-action-executor",
- "description": "This skill executes a specific interface action, such as clicking a button or selecting an option, within a web shopping environment. It should be triggered when a decision has been made (e.g., to choose a color or proceed to purchase). The input is the target action identifier (e.g., 'white' or 'buy now'), and the output is the corresponding formatted action command (e.g., click[white]).",
- "collection": "WebShop",
- "source": "---\nname: webshop-action-executor\ndescription: This skill executes a specific interface action, such as clicking a button or selecting an option, within a web shopping environment. It should be triggered when a decision has been made (e.g., to choose a color or proceed to purchase). The input is the target action identifier (e.g., 'white' or 'buy now'), and the output is the corresponding formatted action command (e.g., click[white]).\n---\n# Skill: WebShop Action Executor\n\n## Purpose\nExecute a single, specific action in a WebShop environment after a decision has been made. This skill formats the action into the required command structure for the WebShop interface.\n\n## When to Use\n- **Trigger:** When the agent has completed its analysis and has decided on the exact action to take (e.g., \"select the white color option,\" \"proceed to buy now\").\n- **Input:** A clear target identifier (string) derived from the available actions on the current page.\n- **Output:** A correctly formatted `click[value]` or `search[keywords]` command.\n\n## Core Instruction\n1. **Receive Input:** The skill is provided with a single `target_action` string (e.g., 'white', 'buy now', 'b08w25dbb7').\n2. **Format Output:** Immediately output the action in the exact format required by the WebShop environment:\n ",
- "path": "experiments/src/skills/webshop/webshop-action-executor/SKILL.md"
- },
- {
- "id": "WebShop::webshop-attribute-selector",
- "skillId": "webshop-attribute-selector",
- "name": "webshop-attribute-selector",
- "description": "Selects specific product attributes (e.g., flavor, size) on a product detail page to match user requirements. Triggered when a product page presents configurable options and the parsed query specifies needed values. It identifies the correct option from available clickables (e.g., 'smoked bacon' for flavor, '4 ounce (pack of 2)' for size) and executes the selection click.",
- "collection": "WebShop",
- "source": "---\nname: webshop-attribute-selector\ndescription: Selects specific product attributes (e.g., flavor, size) on a product detail page to match user requirements. Triggered when a product page presents configurable options and the parsed query specifies needed values. It identifies the correct option from available clickables (e.g., 'smoked bacon' for flavor, '4 ounce (pack of 2)' for size) and executes the selection click.\n---\n# Instructions\n\n## When to Use\nActivate this skill when ALL of the following are true:\n1. You are on a product detail page (not a search results page).\n2. The observation contains configurable product options (e.g., \"flavor\", \"size\") listed as available actions.\n3. The user's instruction specifies required values for one or more of these attributes (e.g., \"gluten free\", \"4 ounce (pack of 2)\", \"smoked peppered bacon\").\n\n## Core Process\n1. **Parse Requirements:** From the user's instruction, extract the required attribute values (e.g., target flavor, size, dietary feature).\n2. **Map to Options:** Examine the list of available actions (clickables). Identify which clickable text corresponds to each required attribute value.\n * Use exact or fuzzy matching (see `scripts/match_attribute.py` for logic).\n * Prioritize exact matches. For dietary features like \"gluten free\" or \"vegetarian,\" the product title or description may already confirm this; your goal is to select the correct flavor/size.\n3. **Execute Selection:** For each identified attribute option, perform a `click[value]` action, where `value` is the exact text of the matching clickable.\n4. **Finalize:** After all required attributes are selected, if a \"Buy Now\" or similar action is available and the instruction implies a purchase, you may proceed to click it.\n\n## Important Notes\n* Do not use this skill on search results pages. Use search actions there.\n* If a required attribute cannot be matched to any available clickable, do not click. Re-evaluate the instruction or consider a different product.\n* The observation may refresh after each click, showing the same page with selected options highlighted. Continue until all specified attributes are satisfied.\n",
- "path": "experiments/src/skills/webshop/webshop-attribute-selector/SKILL.md"
- },
- {
- "id": "WebShop::webshop-attribute-verifier",
- "skillId": "webshop-attribute-verifier",
- "name": "webshop-attribute-verifier",
- "description": "Verifies product attributes on a web shop detail page by extracting price, comparing color availability, validating specifications, and confirming option selections against user requirements before purchase. Use when you need to check if a product matches requirements, verify product details before buying, confirm item specifications on an online store product page, or validate that price, color, size, or other attributes satisfy the user's constraints. Outputs a `Thought:` assessment followed by a `click[value]` action to select the matching option and proceed, or navigates back to search if the product does not match.",
- "collection": "WebShop",
- "source": "---\nname: webshop-attribute-verifier\ndescription: >\n Verifies product attributes on a web shop detail page by extracting price, comparing color availability,\n validating specifications, and confirming option selections against user requirements before purchase.\n Use when you need to check if a product matches requirements, verify product details before buying,\n confirm item specifications on an online store product page, or validate that price, color, size,\n or other attributes satisfy the user's constraints. Outputs a `Thought:` assessment followed by a\n `click[value]` action to select the matching option and proceed, or navigates back to search if\n the product does not match.\n---\n\n# Instructions\n\nYou are verifying product attributes on a detailed product page. Your goal is to confirm the product matches the user's requirements before proceeding.\n\n## Input\n\nYou receive an **Observation** containing:\n- The original user instruction (e.g., \"find a black leather wallet, price lower than 40.00 dollars\")\n- Product details: Title, Price, Rating\n- Available options (e.g., color buttons like \"black\", \"brown\")\n- Available actions (e.g., \"Buy Now\", \"Back to Search\", \"Description\")\n\n## Core Workflow\n\n1. **Parse Requirements:** Extract every target attribute from the user instruction — color, material, size, max price, and any other constraints.\n2. **Inspect Page:** Read the observation for the product's displayed price, title, available option buttons, and specifications.\n3. **Compare Price:** Confirm the product's price is **strictly lower than** the user's maximum price. If not, navigate back immediately.\n4. **Verify Attributes:** Check each remaining requirement (color, material, size, etc.) against the product's details and available options.\n5. **Select or Reject:**\n - If all requirements are satisfied, `click[option]` on the required attribute (e.g., `click[black]`) **first**, then `click[Buy Now]`.\n - If any requirement fails, `click[Back to Search]` to find a different product.\n\n## Action Format\n\n- `click[value]` — interact with a page element. The `value` must exactly match a clickable item from the observation.\n- `search[keywords]` — start a new search only if the current product cannot meet requirements.\n- Every response must begin with `Thought:` stating which requirement is being checked and the verdict.\n\n## Critical Rules\n\n- **Price is strict:** The price must be strictly less than the user's budget — equal is not acceptable.\n- **Select before buying:** Always click the required attribute option (e.g., `click[black]`) before clicking `click[Buy Now]`. Never skip this step.\n- **One action per turn:** Output exactly one action after your `Thought:`.\n\n## Example\n\n**User instruction:** \"Find a black leather wallet with price lower than 40.00 dollars\"\n\n**Observation:**\n```\n[Back to Search] [< Prev]\nTitle: Genuine Leather Bifold Wallet - Multiple Colors\nPrice: $35.99\nRating: ★★★★☆\nOptions: [black] [brown] [tan]\nActions: [Buy Now] [Description] [Back to Search]\n```\n\n**Response:**\n```\nThought: The user wants a black leather wallet under $40. The price is $35.99, which is strictly less than $40 — price check passes. The title mentions \"Leather\" which matches the material requirement. The color \"black\" is available as a selectable option. All requirements are satisfied. I will select the black option first.\nAction: click[black]\n```\n\n**Next turn — after selecting black:**\n```\nThought: The black option is now selected. All requirements verified. Proceeding to purchase.\nAction: click[Buy Now]\n```\n",
- "path": "experiments/src/skills/webshop/webshop-attribute-verifier/SKILL.md"
- },
- {
- "id": "WebShop::webshop-initial-search",
- "skillId": "webshop-initial-search",
- "name": "webshop-initial-search",
- "description": "Performs the first search on an e-commerce platform using keywords derived from parsed user requirements. Use when starting product discovery from a user instruction or when previous search results are insufficient and a new query is needed. It formulates a search query from the criteria (e.g., '24 pack of 7.5 ounce bottles of non-gmo classic tonic') and executes the search[] action, returning the initial result page.",
- "collection": "WebShop",
- "source": "---\nname: webshop-initial-search\ndescription: Performs the first search on an e-commerce platform using keywords derived from parsed user requirements. Use when starting product discovery from a user instruction or when previous search results are insufficient and a new query is needed. It formulates a search query from the criteria (e.g., '24 pack of 7.5 ounce bottles of non-gmo classic tonic') and executes the search[] action, returning the initial result page.\n---\n# Instructions\n1. **Parse Requirements:** Extract the core product criteria from the user's instruction. Focus on:\n * **Quantity & Packaging:** (e.g., \"24 pack\")\n * **Size:** (e.g., \"7.5 ounce bottles\")\n * **Key Attributes:** (e.g., \"non-gmo\", \"classic tonic\")\n * **Price Constraint:** (e.g., \"price lower than 50.00 dollars\") - This is for validation later, not for the initial search query.\n\n2. **Formulate Search Query:** Combine the extracted criteria into a concise, natural-language search string. Prioritize specificity to filter results effectively.\n * **Example:** For \"i would like to get a 24 pack of 7.5 ounce bottles of non-gmo classic tonic\", the query should be: `24 pack of 7.5 ounce bottles of non-gmo classic tonic`\n * **Do not** include the price constraint in the search keywords.\n\n3. **Execute Search:** Use the platform's `search[<keywords>]` action with your formulated query.\n * The action output will be the initial search results page observation.\n\n4. **Next Steps:** After executing this skill, proceed to evaluate the search results. The next actions will typically involve clicking on a promising product listing or refining the search.\n\n## Example\n\n**User instruction:** \"I would like to find a 24 pack of 7.5 ounce bottles of non-gmo classic tonic, and target price lower than 50.00 dollars\"\n\n**Thought:** I need to search for the product using the key attributes. I will omit the price constraint from the search keywords.\n\n**Action:** `search[24 pack of 7.5 ounce bottles of non-gmo classic tonic]`\n\n**Observation:** The platform returns the initial search results page with matching product listings.\n",
- "path": "experiments/src/skills/webshop/webshop-initial-search/SKILL.md"
- },
- {
- "id": "WebShop::webshop-option-selector",
- "skillId": "webshop-option-selector",
- "name": "webshop-option-selector",
- "description": "This skill selects product options or variants (such as size, color, or quantity) on a product detail page based on user preferences or cost optimization. It should be triggered when a product page displays configurable options. The skill evaluates available choices (e.g., 1pcs vs 2pcs) and selects the one that best aligns with the user's constraints, such as minimizing cost.",
- "collection": "WebShop",
- "source": "---\nname: webshop-option-selector\ndescription: This skill selects product options or variants (such as size, color, or quantity) on a product detail page based on user preferences or cost optimization. It should be triggered when a product page displays configurable options. The skill evaluates available choices (e.g., 1pcs vs 2pcs) and selects the one that best aligns with the user's constraints, such as minimizing cost.\n---\n# Skill: WebShop Option Selector\n\n## Trigger Condition\nActivate this skill when the observation from the WebShop environment contains:\n1. A product detail page (indicated by the presence of a \"Price:\" field and product title).\n2. One or more configurable option categories (e.g., \"size:\", \"color:\", \"quantity:\") with clickable values listed beneath them.\n\n## Core Logic\n1. **Parse the Observation:** Identify all configurable option categories and their available values from the current page state.\n2. **Apply Selection Strategy:** By default, implement a **cost-minimization strategy**. For each option category, select the value that results in the lowest final price while still meeting any explicit user constraints from the original instruction (e.g., \"price lower than 40.00 dollars\").\n3. **Execute Selection:** Perform a `click[value]` action for the chosen option value. If multiple categories exist, they should be selected in the order they appear on the page.\n\n## Important Notes\n- The skill assumes the displayed price updates (or is representative) after an option is selected. Your action should be based on the currently displayed information.\n- If the user's instruction contains specific preferences (e.g., \"large size\", \"blue color\"), prioritize those over cost minimization.\n- If no clear cost difference can be inferred, select the first available option.\n- After selecting the desired option, you may proceed with other actions (e.g., `click[buy now]`).\n\n## Example from Trajectory\n**Observation Excerpt:**\n",
- "path": "experiments/src/skills/webshop/webshop-option-selector/SKILL.md"
- },
- {
- "id": "WebShop::webshop-price-checker",
- "skillId": "webshop-price-checker",
- "name": "webshop-price-checker",
- "description": "This skill scans product listings or detail pages to verify if an item's price meets a specified budget constraint. It is triggered when evaluating a potential product for purchase. It extracts the price from the displayed information (e.g., '$164.95') and compares it against the maximum allowed budget, outputting a boolean decision on whether the item is within budget.",
- "collection": "WebShop",
- "source": "---\nname: webshop-price-checker\ndescription: This skill scans product listings or detail pages to verify if an item's price meets a specified budget constraint. It is triggered when evaluating a potential product for purchase. It extracts the price from the displayed information (e.g., '$164.95') and compares it against the maximum allowed budget, outputting a boolean decision on whether the item is within budget.\n---\n# Instructions\nWhen evaluating a product for purchase, use this skill to check if its price is within the specified budget.\n\n## Process\n1. **Identify the Budget:** Extract the maximum allowed price from the user's instruction or the current context. The budget is typically expressed as a dollar amount (e.g., \"lower than 200.00 dollars\").\n2. **Locate the Price:** On the current web page (search results or product detail page), find the price string. It is usually prefixed with a `$` symbol and may be labeled \"Price:\".\n3. **Execute Check:** Run the `check_price.py` script, providing it with the extracted price string and the budget.\n4. **Make Decision:** Based on the script's boolean output (`True`/`False`):\n * If `True`: The item is within budget. You may proceed with further evaluation or purchase.\n * If `False`: The item exceeds the budget. You should continue searching or select a different item.\n\n## Notes\n* The primary action for this skill is to call the bundled script. Do not perform manual price parsing or comparison in your main reasoning.\n* If the price cannot be found on the page, assume the item is not suitable and continue your search.\n",
- "path": "experiments/src/skills/webshop/webshop-price-checker/SKILL.md"
- },
- {
- "id": "WebShop::webshop-product-detail-check",
- "skillId": "webshop-product-detail-check",
- "name": "webshop-product-detail-check",
- "description": "Examines a specific product's detailed page to verify it matches the user's requirements, checking price, description, features, and reviews. Use when you have navigated to a product detail page from search results and need to confirm the product meets all user-specified constraints before purchasing. It provides a final suitability assessment with a clear proceed-or-reject recommendation.",
- "collection": "WebShop",
- "source": "---\nname: webshop-product-detail-check\ndescription: >-\n Examines a specific product's detailed page to verify it matches the user's requirements,\n checking price, description, features, and reviews. Use when you have navigated to a\n product detail page from search results and need to confirm the product meets all\n user-specified constraints before purchasing. It provides a final suitability assessment\n with a clear proceed-or-reject recommendation.\n---\n# Skill: Product Detail Verification\n\n## Trigger\nActivate this skill when the agent has navigated to a specific product's detailed page from a search results list. The agent should have a user query containing specific requirements (e.g., product type, attributes, price constraints).\n\n## Core Objective\nAnalyze the product detail page to confirm if the product meets all user-specified constraints. Provide a clear \"Proceed\" or \"Reject\" recommendation.\n\n## Execution Workflow\n\n1. **Parse User Requirements:** Extract key constraints from the user's instruction. Primary constraints are typically **Price** and **Key Attributes** (e.g., \"long\", \"clip-in\", \"natural looking\"). Store these in a structured format.\n\n2. **Scrape Product Page Data:** Systematically extract the following information from the current page observation:\n * **Product Title**\n * **Price**\n * **Key Description Snippets** (from Description/Features sections)\n * **Rating** (if available)\n * **Availability of \"Buy Now\"** action.\n\n3. **Constraint Verification:** Compare the scraped data against the user's requirements.\n * **Price Check:** Is the product price strictly less than the user's maximum? (e.g., < $40.00).\n * **Attribute Check:** Do the title and description contain terms matching the user's key attributes? (e.g., confirm \"clip-in\" and \"natural looking\" are present).\n * **Suitability Flag:** Product is suitable only if **ALL** hard constraints (price, mandatory attributes) are satisfied.\n\n4. **Decision & Action:**\n * **If SUITABLE:** Conclude the product matches requirements. The recommended action is `click[buy now]`.\n * **If NOT SUITABLE:** Conclude the product fails one or more constraints. The recommended action is to return to search (`click[back to search]`) to find another candidate.\n\n## Output Format\nYour response must use the following format:\n\n**Thought:** [Your reasoning, summarizing the user's constraints, the product details found, and the result of the verification check.]\n**Action:** [The single, valid action to take: `click[buy now]` or `click[back to search]`]\n\n## Example\n\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n\n**Observation:** Product page for \"22 Inch Long Natural Looking Clip-In Hair Extension\" — Price: $34.99, Description mentions \"clip-in\", \"natural looking\", \"synthetic fiber\".\n\n**Thought:** The user needs a long, natural-looking, clip-in hair extension under $40. This product is priced at $34.99 (< $40.00), the title confirms \"long\" and \"natural looking\", and the description confirms \"clip-in\". All constraints are satisfied.\n**Action:** `click[buy now]`\n\n---\n\n**Observation:** Product page for \"Premium Human Hair Extension\" — Price: $45.99, Description mentions \"clip-in\", \"natural\".\n\n**Thought:** The user's budget is under $40. This product is priced at $45.99, which exceeds the $40 limit. Price constraint fails.\n**Action:** `click[back to search]`\n\n## Notes\n* Prioritize information explicitly on the product page. Assume missing information (like a Rating of \"N.A.\") does not disqualify a product unless specified by the user.\n* The \"Buy Now\" button must be present in the available actions list for the purchase action to be valid.\n",
- "path": "experiments/src/skills/webshop/webshop-product-detail-check/SKILL.md"
- },
- {
- "id": "WebShop::webshop-product-detail-inspector",
- "skillId": "webshop-product-detail-inspector",
- "name": "webshop-product-detail-inspector",
- "description": "This skill examines a product detail page to verify specific attributes or select options like size, color, or quantity. It is used after clicking on a product, to confirm that the item matches the user's needs (e.g., checking for '10 slots' option, price, material). The input is the product page observation, and the output is an action to select a required variant (e.g., click[10 slots]) or proceed if criteria are satisfied.",
- "collection": "WebShop",
- "source": "---\nname: webshop-product-detail-inspector\ndescription: This skill examines a product detail page to verify specific attributes or select options like size, color, or quantity. It is used after clicking on a product, to confirm that the item matches the user's needs (e.g., checking for '10 slots' option, price, material). The input is the product page observation, and the output is an action to select a required variant (e.g., click[10 slots]) or proceed if criteria are satisfied.\n---\n# Instructions\n\n## Purpose\nYou are an agent navigating a web shop. Your current task is to inspect a product detail page. You have arrived here after clicking on a product from the search results.\n\n## Input\nYou will receive an **Observation** containing the product page state. This includes:\n* The original user instruction (e.g., \"i am looking for an easy to clean jewelry box with 10 slots, and price lower than 60.00 dollars\").\n* Product details: Title, Price, Rating.\n* Available options (e.g., size variants like \"3 slot\", \"10 slots\").\n* Available actions (e.g., \"Buy Now\", \"Description\").\n\n## Core Logic\n1. **Parse the Instruction:** Identify the user's key requirements from the instruction (e.g., specific attribute: \"10 slots\", price constraint: \"< $60\").\n2. **Examine the Page:** Check the product's displayed **Price** against the user's budget. Check the available options for the required attribute.\n3. **Decision & Action:**\n * If the required attribute (e.g., \"10 slots\") is present as a selectable option, click on it.\n * If the product does not have the required attribute or exceeds the price limit, you should go \"Back to Search\".\n * If the product meets all criteria (correct attribute selected, price is valid), you may proceed (e.g., click \"Buy Now\").\n\n## Output Format\nYour response must be in this exact format:\n",
- "path": "experiments/src/skills/webshop/webshop-product-detail-inspector/SKILL.md"
- },
- {
- "id": "WebShop::webshop-product-detail-navigator",
- "skillId": "webshop-product-detail-navigator",
- "name": "webshop-product-detail-navigator",
- "description": "Navigates to and interacts with a specific product's detail page. This skill is triggered after a candidate product ID is selected from search results. It performs the click action to load the product page and then identifies available interactive elements (like flavor or size selectors) that need to be configured to match the user's requirements.",
- "collection": "WebShop",
- "source": "---\nname: webshop-product-detail-navigator\ndescription: Navigates to and interacts with a specific product's detail page. This skill is triggered after a candidate product ID is selected from search results. It performs the click action to load the product page and then identifies available interactive elements (like flavor or size selectors) that need to be configured to match the user's requirements.\n---\n# Instructions\n\n## Purpose\nThis skill is used to navigate from a product search result to the product's detail page and configure it according to the user's specific requirements (e.g., flavor, size, dietary needs).\n\n## When to Use\nUse this skill when you have identified a candidate product from a search result list and need to:\n1. Load its detailed product page.\n2. Verify its attributes against the user's instruction.\n3. Select the correct options (like `flavor` or `size`) to match the user's request.\n4. Proceed to the final purchase step if all criteria are met.\n\n## Core Workflow\n1. **Navigate to Product Page:** Click on the product ID (e.g., `B06Y96MXJV`) from the search results to load its detail page.\n2. **Parse the Page State:** Once on the product page, the observation will contain the product title, price, and a list of available interactive elements (clickables). Analyze these to find configuration options.\n3. **Match Requirements:** Cross-reference the user's original instruction with the available options. Look for keywords related to:\n * **Product Type/Flavor:** (e.g., \"smoked peppered bacon\", \"smoked bacon\").\n * **Attributes:** (e.g., \"gluten free\", \"vegetarian\").\n * **Size/Packaging:** (e.g., \"4 ounce (pack of 2)\").\n * **Price:** Ensure the displayed price is below any specified maximum.\n4. **Configure the Product:** Sequentially click on the option values that match the user's requirements. The typical order is to select the correct `flavor` first, then the correct `size`.\n5. **Finalize:** After configuring the product, if all requirements are satisfied, click the final action button (e.g., `Buy Now`).\n\n## Action Format\nYour actions must strictly follow the required format:\n* `click[<exact_value>]` - The `<exact_value>` must match one of the strings in the \"clickables\" list from the observation, including case and spacing.\n* `search[<keywords>]` - Use only if you need to go back to search. This skill focuses on post-search navigation.\n\n## Key Logic (Handled by Script)\nThe deterministic sequence of checking for and selecting flavor and size options is handled by the bundled script `configure_product.py`. Use it to generate the correct click actions after loading the product page.\n\n## Important Notes\n* **Validation:** Do not click an option if it does not appear in the current list of clickables.\n* **Observation:** Always read the full observation after each action. The list of clickables updates after each selection.\n* **Goal:** The final goal is to have a product configured per the user's instruction and ready for purchase.\n",
- "path": "experiments/src/skills/webshop/webshop-product-detail-navigator/SKILL.md"
- },
- {
- "id": "WebShop::webshop-product-evaluator",
- "skillId": "webshop-product-evaluator",
- "name": "webshop-product-evaluator",
- "description": "Evaluates product listings against user requirements such as price limits and feature matches to identify viable options. Use when you are on a search results page containing multiple products and need to select the most promising candidate for detailed inspection. The skill analyzes product titles, prices, and brief descriptions to rank and choose the best match.",
- "collection": "WebShop",
- "source": "---\nname: webshop-product-evaluator\ndescription: >-\n Evaluates product listings against user requirements such as price limits and feature\n matches to identify viable options. Use when you are on a search results page containing\n multiple products and need to select the most promising candidate for detailed inspection.\n The skill analyzes product titles, prices, and brief descriptions to rank and choose\n the best match.\n---\n# Instructions\n\n## When to Use\nActivate this skill when you are on a **search results page** in a web shopping environment and need to evaluate multiple products against specific user requirements (e.g., price limits, feature keywords).\n\n## Core Process\n1. **Parse the Observation:** Identify the user's instruction, the list of available products, and their associated details (Title, Price, ASIN/Product ID).\n2. **Extract Requirements:** From the user instruction, identify:\n * **Price Limit:** The maximum acceptable price (e.g., \"lower than 40.00 dollars\").\n * **Feature Keywords:** Key product attributes (e.g., \"teeth whitening\", \"freshens breath\").\n3. **Evaluate Products:** For each product listing on the current page:\n * Check if the price is below the user's limit.\n * Check if the product title contains the required feature keywords.\n * Prioritize products that meet all criteria. If multiple products qualify, choose the one that appears most relevant or cost-effective.\n4. **Take Action:**\n * If a suitable product is found, click on its product ID (e.g., `click[B09NYFDNVX]`) to view its details.\n * If no suitable product is found on the current page, consider using the `search` action with refined keywords or clicking `Next >` to browse more results.\n\n## Thought Process Format\nAlways structure your internal reasoning and final action using this format:\n\n**Thought:** [Summarize the user's constraints, evaluate each product against them, and justify your selection.]\n**Action:** `click[<product_id>]`\n\n## Example\n\n**Instruction:** \"i need a teeth whitening toothpaste that also freshens breath, and price lower than 15.00 dollars\"\n\n**Observation (Search Results Page):**\n- B09NYFDNVX: \"Whitening Toothpaste with Breath Freshener\" — $12.99\n- B08KZPTL3M: \"Professional Teeth Whitening Kit\" — $24.99\n- B07HQRJ4WP: \"Mint Fresh Whitening Toothpaste\" — $9.49\n\n**Thought:** The user needs a teeth whitening toothpaste that freshens breath, under $15. Product B09NYFDNVX at $12.99 mentions both \"whitening\" and \"breath freshener\" in the title — meets all criteria. B08KZPTL3M exceeds the budget at $24.99. B07HQRJ4WP is within budget and mentions \"whitening\" but does not explicitly mention breath freshening. Selecting B09NYFDNVX as the best match.\n**Action:** `click[B09NYFDNVX]`\n",
- "path": "experiments/src/skills/webshop/webshop-product-evaluator/SKILL.md"
- },
- {
- "id": "WebShop::webshop-product-search",
- "skillId": "webshop-product-search",
- "name": "webshop-product-search",
- "description": "Performs an initial product search using a web interface by generating appropriate search keywords based on interpreted query criteria. Use when starting a product discovery task, when returning to search results after rejecting a product, or when the observation contains a search interface prompt. The skill inputs structured search parameters and outputs a list of candidate products from the search results page.",
- "collection": "WebShop",
- "source": "---\nname: webshop-product-search\ndescription: >-\n Performs an initial product search using a web interface by generating appropriate search\n keywords based on interpreted query criteria. Use when starting a product discovery task,\n when returning to search results after rejecting a product, or when the observation contains\n a search interface prompt. The skill inputs structured search parameters and outputs a list\n of candidate products from the search results page.\n---\n# Skill: WebShop Product Search\n\n## Core Workflow\n1. **Interpret Criteria:** Extract key product attributes from the user's instruction (e.g., product type, features, price constraints).\n2. **Formulate Query:** Construct a concise search string prioritizing the core product type and critical attributes. Start broad; refine if results are poor.\n3. **Execute Search:** Use the `search[keywords]` action to submit the query. Keywords must be a single string enclosed in brackets.\n4. **Validate Results:** Success is marked by a \"Page 1\" observation containing product listings. If 0 results are returned, re-invoke with a broader or alternative query. If all results exceed the user's price constraint, refine with additional terms.\n\n## Key Decision Logic\n* **Trigger Condition:** This skill is the entry point for a new product discovery task. Also activate when the observation contains \"[SEP] Search\" or \"[SEP] Back to Search\".\n* **Output Handoff:** The search results page is passed to downstream skills (e.g., `webshop-result-filter`, `webshop-product-evaluator`) for individual product analysis.\n\n## Constraints\n* Do not use this skill if no search action is available in the current state.\n* Do not include multiple actions or extra formatting in the search keywords.\n\n## Example from Trajectory\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n**Skill Execution:**\n1. Criteria identified: `product_type=\"clip-in hair extension\"`, `attribute=\"long\"`, `attribute=\"natural looking\"`, `budget=\"<40.00\"`.\n2. Query formulated: Prioritizes core product type and key attribute -> `\"long clip-in hair extension\"`.\n3. Action: `search[long clip-in hair extension]`\n",
- "path": "experiments/src/skills/webshop/webshop-product-search/SKILL.md"
- },
- {
- "id": "WebShop::webshop-product-selector",
- "skillId": "webshop-product-selector",
- "name": "webshop-product-selector",
- "description": "Selects the most promising product candidate from a filtered shortlist for detailed inspection. Use when you are on a search results page with multiple viable items and need to make a final selection based on a heuristic such as best feature match or lowest price. Triggers navigation to the selected product's detail page via click[product_id].",
- "collection": "WebShop",
- "source": "---\nname: webshop-product-selector\ndescription: >-\n Selects the most promising product candidate from a filtered shortlist for detailed\n inspection. Use when you are on a search results page with multiple viable items and need\n to make a final selection based on a heuristic such as best feature match or lowest price.\n Triggers navigation to the selected product's detail page via click[product_id].\n---\n# Instructions\nUse this skill when you are on a search results page with multiple product options that appear to meet the user's core requirements.\n\n## Decision Process\n1. **Assess the List:** Review the provided observation, which contains a list of products. Each product entry typically includes a Product ID (e.g., `B093C1THVP`), a title, and a price.\n2. **Apply Selection Heuristic:** Use the bundled `selector.py` script to programmatically identify the best candidate. The script implements the following logic:\n * Filters products strictly under the user's specified maximum price.\n * Scores remaining products based on keyword matching in the title against the user's core requirements (e.g., \"portable\", \"easy to carry\", \"double horn\").\n * Selects the product with the highest score. In case of a tie, it chooses the lowest-priced item.\n3. **Execute Action:** The final action is always to click on the selected product's ID to navigate to its detail page for final verification and purchase. The action format is `click[product_id]`.\n\n## Thought Process Template\nStructure your reasoning before acting using this template:\n\n**Thought:** [List the user's requirements, evaluate each candidate product against them, explain why the selected product is the best match.]\n**Action:** `click[<product_id>]`\n\n## Example\n\n**Instruction:** \"i need a portable double horn bluetooth speaker that is easy to carry, and price lower than 50.00 dollars\"\n\n**Observation (Search Results):**\n- B093C1THVP: \"Portable Double Horn Bluetooth Speaker — Compact & Easy to Carry\" — $32.99\n- B08XYZ1234: \"Double Horn Wireless Speaker — Premium Sound\" — $55.00\n- B07ABC5678: \"Mini Portable Bluetooth Speaker\" — $19.99\n\n**Thought:** The user needs a portable, double horn bluetooth speaker that is easy to carry, under $50. B093C1THVP at $32.99 matches \"portable\", \"double horn\", and \"easy to carry\" — all keywords present in the title. B08XYZ1234 exceeds the $50 budget. B07ABC5678 is within budget but lacks \"double horn\". Selecting B093C1THVP as the best match.\n**Action:** `click[B093C1THVP]`\n",
- "path": "experiments/src/skills/webshop/webshop-product-selector/SKILL.md"
- },
- {
- "id": "WebShop::webshop-purchase-executor",
- "skillId": "webshop-purchase-executor",
- "name": "webshop-purchase-executor",
- "description": "Executes the purchase action for a confirmed suitable product on an e-commerce page. Use when a product has been verified against the user's requirements (price, attributes) and the decision is to buy. Performs a click[Buy Now] action on the purchase button to complete the transaction.",
- "collection": "WebShop",
- "source": "---\nname: webshop-purchase-executor\ndescription: Executes the purchase action for a confirmed suitable product on an e-commerce page. Use when a product has been verified against the user's requirements (price, attributes) and the decision is to buy. Performs a click[Buy Now] action on the purchase button to complete the transaction.\n---\n# Skill: webshop-purchase-executor\n\n## Purpose\nExecute the final purchase transaction for a verified product on an e-commerce platform. This skill is the terminal action in a shopping workflow, initiated only after a product has been confirmed to meet the user's criteria (e.g., price, description).\n\n## When to Use\n- **Trigger:** You are on a product detail page.\n- **Prerequisite:** The product has been verified against the user's requirements (e.g., price < $40.00, \"natural looking\").\n- **User Intent:** The user has made a decision to buy the product.\n- **Available Action:** A purchase button (e.g., \"Buy Now\") is present in the list of clickable elements.\n\n## Core Action\nPerform a `click` action on the purchase button.\n\n## Execution Logic\n1. **Locate Purchase Button:** Identify the purchase button from the available actions. Common identifiers include:\n - `buy now`\n - `add to cart` (if the instruction implies immediate purchase)\n - `purchase`\n2. **Validate Context:** Ensure you are on a product page and the prior verification step is logically complete.\n3. **Execute Click:** Perform the `click[purchase_button_value]` action using the exact value from the available actions list.\n\n## Important Notes\n- Do not use this skill for browsing, searching, or product comparison.\n- The skill assumes price and specification validation occurred in a previous step.\n- If multiple purchase options exist (e.g., \"Buy Now\", \"Add to Cart & Checkout\"), prefer the most direct path to complete the transaction, typically \"Buy Now\".\n\n## Example\n\n**Scenario:** The user wants a natural-looking wig priced under $40.00. You are on a product detail page for \"Natural Looking Human Hair Wig - $34.99\" and have verified it meets all criteria.\n\n**Thought:** The product matches the user's requirements (natural looking, price $34.99 < $40.00). I should proceed with the purchase.\n\n**Action:** `click[Buy Now]`\n\n**Observation:** The purchase is confirmed and the transaction is complete.\n",
- "path": "experiments/src/skills/webshop/webshop-purchase-executor/SKILL.md"
- },
- {
- "id": "WebShop::webshop-purchase-initiator",
- "skillId": "webshop-purchase-initiator",
- "name": "webshop-purchase-initiator",
- "description": "Initiates the purchase process by clicking the buy button once a product and its options have been selected and verified against requirements. Use when you are on a product detail page, all selection criteria (price, features, options) are satisfied, and the user is ready to proceed to checkout. Confirms the final price meets budget constraints before executing click[buy now].",
- "collection": "WebShop",
- "source": "---\nname: webshop-purchase-initiator\ndescription: >-\n Initiates the purchase process by clicking the buy button once a product and its options\n have been selected and verified against requirements. Use when you are on a product detail\n page, all selection criteria (price, features, options) are satisfied, and the user is\n ready to proceed to checkout. Confirms the final price meets budget constraints before\n executing click[buy now].\n---\n# Instructions\n\n## When to Use\nActivate this skill when:\n1. A product has been selected from search results.\n2. All required product options (e.g., size, color, quantity) have been chosen.\n3. The final displayed price has been verified to be within the user's specified budget.\n4. The user's instruction implicitly or explicitly indicates readiness to purchase (e.g., \"I need to buy...\", \"I want this one\").\n\n## Core Action\nExecute the `click[buy now]` action to proceed to checkout.\n\n## Verification Logic (Before Clicking)\nBefore clicking \"Buy Now\", you **must** perform these checks:\n1. **Budget Check**: Confirm the final displayed `Price:` is less than the maximum budget specified in the user's original instruction. If no budget is specified, skip this check.\n2. **Option Selection Check**: Ensure the required product options (like 'size', 'color') show a selected state or that your previous action has selected the correct option. The observation should reflect the chosen option.\n3. **Product Match Check**: Verify the product title and description align with the user's core requirements (e.g., \"teeth whitening that also freshens breath\").\n\nIf any check fails, do not use this skill. Instead, revert to selecting the correct option or searching for a different product.\n\n## Example\n\n**Instruction:** \"i need a teeth whitening toothpaste that also freshens breath, and price lower than 15.00 dollars\"\n\n**Observation:** Product page for \"Whitening Toothpaste with Breath Freshener\" — Price: $12.99, Size: 4oz (selected), Flavor: Mint (selected). Available actions: click[buy now], click[back to search].\n\n**Thought:** The user needs a teeth whitening toothpaste that freshens breath, under $15. The current product is priced at $12.99 (< $15.00), matches \"whitening\" and \"breath freshener\" in the title, and all required options (size, flavor) are selected. All checks pass — proceeding to purchase.\n**Action:** `click[buy now]`\n\n## Error Handling\n- If the \"Buy Now\" button is not present in the list of clickable actions, the action will be invalid. Do not force the action.\n- If the price changes after selecting options and exceeds the budget, abort the purchase and inform the user.\n",
- "path": "experiments/src/skills/webshop/webshop-purchase-initiator/SKILL.md"
- },
- {
- "id": "WebShop::webshop-query-interpreter",
- "skillId": "webshop-query-interpreter",
- "name": "webshop-query-interpreter",
- "description": "Interprets a user's shopping query to extract key product requirements such as item type, attributes, and constraints. Use when a new shopping instruction is received and you need to parse natural language into structured criteria (product category, desired features, price limits) before performing a search. The output is a clear set of search parameters for use in subsequent product lookup steps.",
- "collection": "WebShop",
- "source": "---\nname: webshop-query-interpreter\ndescription: >-\n Interprets a user's shopping query to extract key product requirements such as item type,\n attributes, and constraints. Use when a new shopping instruction is received and you need\n to parse natural language into structured criteria (product category, desired features,\n price limits) before performing a search. The output is a clear set of search parameters\n for use in subsequent product lookup steps.\n---\n# Instructions\n\n## Trigger\nActivate this skill when a new shopping instruction is received from the user. The instruction will be a natural language request for a product.\n\n## Core Process\n\n1. **Parse the Instruction:** Analyze the user's query to identify the following key components:\n * **Primary Product Type:** The main item being requested (e.g., \"hair extension\").\n * **Key Attributes/Features:** Descriptive requirements (e.g., \"long\", \"clip-in\", \"natural looking\").\n * **Constraints:** Hard limits, especially price (e.g., \"price lower than 40.00 dollars\").\n\n2. **Structure the Output:** Format the extracted information into a clear, structured set of search parameters. Use the following template:\n\n ```\n Product Type: <primary item>\n Attributes: <comma-separated features>\n Constraints: <price limits or other hard requirements>\n Search Query: <recommended search string>\n ```\n\n3. **Hand Off:** Pass the structured parameters to the search execution skill (e.g., `webshop-search-executor` or `webshop-product-search`) to perform the actual query.\n\n## Example\n\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n\n**Thought:** The user wants a hair extension. Key attributes are \"long\", \"clip-in\", and \"natural looking\". The hard constraint is price under $40.00.\n\n**Structured Output:**\n```\nProduct Type: clip-in hair extension\nAttributes: long, natural looking\nConstraints: price < $40.00\nSearch Query: long clip-in natural looking hair extension\n```\n\n---\n\n**Instruction:** \"i want a pack of 6 moisturizing body wash bars with shea butter, price less than 20 dollars\"\n\n**Thought:** The user wants body wash bars. Key attributes are \"moisturizing\", \"shea butter\", quantity \"6 pack\". Hard constraint is price under $20.00.\n\n**Structured Output:**\n```\nProduct Type: body wash bars\nAttributes: moisturizing, shea butter, 6 pack\nConstraints: price < $20.00\nSearch Query: moisturizing body wash bars shea butter 6 pack\n```\n ",
- "path": "experiments/src/skills/webshop/webshop-query-interpreter/SKILL.md"
- },
- {
- "id": "WebShop::webshop-query-parser",
- "skillId": "webshop-query-parser",
- "name": "webshop-query-parser",
- "description": "This skill extracts key constraints and product requirements from a user's shopping query. It should be triggered when the agent receives a new shopping instruction, to identify product attributes (e.g., 'gluten free'), price limits (e.g., 'lower than 140.00 dollars'), and other specifications. The skill outputs a structured set of search criteria to guide subsequent product discovery.",
- "collection": "WebShop",
- "source": "---\nname: webshop-query-parser\ndescription: This skill extracts key constraints and product requirements from a user's shopping query. It should be triggered when the agent receives a new shopping instruction, to identify product attributes (e.g., 'gluten free'), price limits (e.g., 'lower than 140.00 dollars'), and other specifications. The skill outputs a structured set of search criteria to guide subsequent product discovery.\n---\n# Instructions\n\n## When to Use\nActivate this skill immediately when a new shopping instruction is received from the user, before any search or click actions are performed.\n\n## Core Task\nParse the user's natural language instruction to extract structured search criteria. Your goal is to identify:\n1. **Product Type/Name:** The primary item the user wants (e.g., \"popcorn\").\n2. **Key Attributes:** Descriptive features like \"gluten free\", \"organic\", \"vegan\", etc.\n3. **Price Constraints:** Any upper or lower price limits (e.g., \"lower than 140.00 dollars\").\n4. **Other Specifications:** Brand, size, quantity, or other qualifying terms.\n\n## Procedure\n1. **Run the Parser:** Execute the bundled script `parse_query.py` on the user's instruction.\n2. **Review & Refine:** Examine the script's output. If the instruction is complex or ambiguous, use your judgment to refine the criteria. For example, ensure price limits are correctly interpreted as numeric ranges.\n3. **Formulate Search Strategy:** Use the extracted criteria to plan the initial web search. Combine the **Product Type** with the most critical **Key Attributes** to form effective initial search keywords.\n * **Example:** For \"i need gluten free popcorn, and price lower than 140.00 dollars\", the script will output `{'product': 'popcorn', 'attributes': ['gluten free'], 'price_max': 140.0}`. Your initial search should be `search[gluten free popcorn]`.\n\n## Output\nAfter parsing, hold the structured criteria in memory. Use it to:\n* Guide the formulation of `search[keywords]` actions.\n* Evaluate product listings and details during `click` actions to check for constraint compliance (especially price).\n* Inform your reasoning in the `Thought:` part of your response.\n\n## Notes\n* Keep the initial search query concise but precise. Prioritize must-have attributes from the user's instruction.\n* The price filter is often not available as a direct web action; you must manually check prices in the search results and product details.\n* If the initial search yields no results, consider broadening the search by removing less critical attributes one at a time, but always respect hard constraints like \"gluten free\" if specified.\n",
- "path": "experiments/src/skills/webshop/webshop-query-parser/SKILL.md"
- },
- {
- "id": "WebShop::webshop-result-analyzer",
- "skillId": "webshop-result-analyzer",
- "name": "webshop-result-analyzer",
- "description": "This skill evaluates a list of search results against the target product criteria. Trigger it when a search result page is observed, to identify promising product listings. It analyzes each result's title, price, and brief description to shortlist items that best match the required attributes (like size, color, and price), outputting a prioritized list of candidate product IDs or links for further inspection.",
- "collection": "WebShop",
- "source": "---\nname: webshop-result-analyzer\ndescription: This skill evaluates a list of search results against the target product criteria. Trigger it when a search result page is observed, to identify promising product listings. It analyzes each result's title, price, and brief description to shortlist items that best match the required attributes (like size, color, and price), outputting a prioritized list of candidate product IDs or links for further inspection.\n---\n# Instructions\n\nTrigger this skill when you observe a search result page (e.g., containing \"Page 1 (Total results: 50)\" and multiple product listings).\n\n## 1. Extract User Requirements\nFirst, parse the user's instruction from the observation. Identify the following key attributes:\n- **Product Type:** (e.g., \"woman's us size 5 high heel shoe\")\n- **Specific Attributes:** (e.g., \"rubber sole\", \"color patent-beige\")\n- **Price Constraint:** (e.g., \"price lower than 90.00 dollars\")\n\n## 2. Analyze Search Results\nFor each product listing in the observation (typically formatted as `[ASIN/Product ID] [SEP] [Title] [SEP] [Price Range]`):\n1. Extract the **Product ID** (e.g., B09GXNYJCD).\n2. Extract the **Product Title**.\n3. Extract the **Price**. Convert any range (e.g., \"$49.99 to $54.99\") to its maximum value for comparison against the budget.\n4. Perform a **textual match** between the title/description and the required attributes (size, color, material like \"rubber\", product type).\n\n## 3. Score and Prioritize\nUse the bundled Python script `analyze_results.py` to perform a consistent, deterministic analysis.\n1. **Run the script** with the extracted user requirements and the list of product data.\n2. The script will output a **prioritized list** of candidate Product IDs, sorted by a match score.\n\n## 4. Output and Next Action\nPresent the analysis in this format:\n",
- "path": "experiments/src/skills/webshop/webshop-result-analyzer/SKILL.md"
- },
- {
- "id": "WebShop::webshop-result-filter",
- "skillId": "webshop-result-filter",
- "name": "webshop-result-filter",
- "description": "Filters search results by evaluating product listings against specific user constraints like price, features, or ratings. Use when you are on a search results page and need to systematically identify which products meet all given criteria before selecting one for closer inspection. Takes a list of products with their details and outputs a filtered subset that meets the defined requirements.",
- "collection": "WebShop",
- "source": "---\nname: webshop-result-filter\ndescription: >-\n Filters search results by evaluating product listings against specific user constraints\n like price, features, or ratings. Use when you are on a search results page and need to\n systematically identify which products meet all given criteria before selecting one for\n closer inspection. Takes a list of products with their details and outputs a filtered\n subset that meets the defined requirements.\n---\n# Skill: webshop-result-filter\n\n## When to Use\nActivate this skill when you are on a search results page in a web shopping environment and need to systematically evaluate which products meet a user's specific, multi-faceted requirements (e.g., \"price lower than 40.00 dollars\" AND \"natural looking\").\n\n## Core Instruction\n1. **Parse the Instruction:** Extract the user's constraints from the instruction. Common constraints include:\n * **Price:** A maximum or target price (e.g., `price lower than 40.00 dollars`).\n * **Features:** Specific attributes or keywords (e.g., `natural looking`, `long`, `clip-in`).\n * **Ratings:** A minimum rating threshold (if available in the observation).\n\n2. **Validate Constraints:** Confirm you have at least one constraint extracted before proceeding. If the instruction contains no filterable criteria, skip filtering and select the first available product.\n\n3. **Parse the Observation:** Extract the list of products from the search results page (Product ID, Title, Price, Rating if available).\n\n4. **Apply Filters:** For each product, check it against **all** extracted constraints:\n * **Price Filter:** Is the product price strictly below the user's maximum?\n * **Keyword/Feature Filter:** Does the title/description contain the required feature keywords?\n * **Rating Filter:** If a rating constraint exists, does the product meet the minimum?\n\n5. **Output Decision:** Select the **first product** that passes all criteria as the primary candidate for `click[product_id]`. If no product passes:\n * Try `click[Next >]` to check additional result pages.\n * If no more pages, use `search[refined keywords]` with adjusted terms.\n\n## Example from Trajectory\n* **User Instruction:** `i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars`\n* **Extracted Constraints:**\n * `price < 40.00`\n * Keywords: `natural` (implied from \"natural looking\")\n* **Observation (First Page):** Contains ~10 products with IDs, titles, and prices.\n* **Filtering Process:**\n 1. `B09C337K8S`: Price $29.99 (< $40.00). Title contains \"Natural Looking\". **PASSES**.\n 2. `B093BKWHFK`: Price $63.99 (> $40.00). **FAILS** on price.\n 3. `B099K9Z9L2`: Price $43.99 (> $40.00). **FAILS** on price.\n* **Result:** `B09C337K8S` is selected as the top matching candidate.\n\n## Next Action\nAfter identifying a matching product, click on it for more details:\n\n**Thought:** [Summarize which constraints each product passed or failed, justify your selection.]\n**Action:** `click[<matching_product_id>]`\n",
- "path": "experiments/src/skills/webshop/webshop-result-filter/SKILL.md"
- },
- {
- "id": "WebShop::webshop-result-page-navigator",
- "skillId": "webshop-result-page-navigator",
- "name": "webshop-result-page-navigator",
- "description": "Navigates through paginated search results by moving to the next or previous page. Use this skill when the current page of product listings does not contain a suitable match and you need to review more options. It identifies and clicks the appropriate pagination controls (e.g., 'next >' or '< prev') to load additional result pages for evaluation.",
- "collection": "WebShop",
- "source": "---\nname: webshop-result-page-navigator\ndescription: Navigates through paginated search results by moving to the next or previous page. Use this skill when the current page of product listings does not contain a suitable match and you need to review more options. It identifies and clicks the appropriate pagination controls (e.g., 'next >' or '< prev') to load additional result pages for evaluation.\n---\n# Skill: WebShop Result Page Navigator\n\n## Purpose\nThis skill enables systematic navigation through paginated product search results in a WebShop environment. It is triggered when the current page of results does not contain an item matching the user's criteria, allowing the agent to access more options.\n\n## Core Logic\n1. **Trigger Condition:** The agent has reviewed the current page of product listings and determined that no item satisfies the user's requirements (e.g., price, features).\n2. **Action Selection:** The skill identifies the correct pagination control to click:\n * `click[next >]` to load the subsequent page of results.\n * `click[< prev]` to return to the previous page of results.\n3. **Post-Action:** After navigation, the agent should resume its primary task of evaluating the newly loaded product listings against the user's instruction.\n\n## Usage in Trajectory\nThe skill was demonstrated when the agent, searching for a pendant light under $120 with a dimmer switch, found no suitable options on Page 1. It correctly executed `click[next >]` to access Page 2, and repeated the action to access Page 3, where a potential match was found.\n\n## Key Principle\nThis skill handles the deterministic, repetitive task of page navigation, freeing the agent's reasoning capacity for the higher-freedom task of evaluating product features and making purchase decisions.\n",
- "path": "experiments/src/skills/webshop/webshop-result-page-navigator/SKILL.md"
- },
- {
- "id": "WebShop::webshop-search-constructor",
- "skillId": "webshop-search-constructor",
- "name": "webshop-search-constructor",
- "description": "This skill formulates an effective search query from structured product criteria. It is used when initiating a product search on an e-commerce platform, converting attributes into a concise, relevant keyword string. The input is a set of parsed criteria (e.g., 'jewelry box', '10 slots', 'easy to clean', 'price < $60'), and the output is a formatted search action string (e.g., 'search[jewelry box, 10 slots, less than $60, easy to clean]') optimized for the platform's search engine.",
- "collection": "WebShop",
- "source": "---\nname: webshop-search-constructor\ndescription: This skill formulates an effective search query from structured product criteria. It is used when initiating a product search on an e-commerce platform, converting attributes into a concise, relevant keyword string. The input is a set of parsed criteria (e.g., 'jewelry box', '10 slots', 'easy to clean', 'price < $60'), and the output is a formatted search action string (e.g., 'search[jewelry box, 10 slots, less than $60, easy to clean]') optimized for the platform's search engine.\n---\n# Instructions\nWhen tasked with finding a product on an e-commerce platform, use this skill to construct the initial search query.\n\n## Core Process\n1. **Receive Criteria:** You will be given a set of structured product criteria (e.g., product type, attributes, price limit).\n2. **Construct Query:** Use the `construct_search_query.py` script to transform the criteria into a single, optimized search string. The script handles formatting and keyword ordering.\n3. **Execute Action:** Format the script's output into the required platform action: `search[<constructed_query>]`.\n\n## Workflow Example\n**Input Criteria:** `{'product': 'jewelry box', 'attributes': ['10 slots', 'easy to clean'], 'price_limit': 60.00}`\n**Skill Execution:**\n1. Run the script: `python scripts/construct_search_query.py --product \"jewelry box\" --attributes \"10 slots\" \"easy to clean\" --price-limit 60.00`\n2. The script returns: `jewelry box, 10 slots, less than $60, easy to clean`\n3. You output the final action: `search[jewelry box, 10 slots, less than $60, easy to clean]`\n\n## Important Notes\n* **Use the Script:** Always delegate query construction to the bundled script. Do not attempt to manually format the search string.\n* **Input Format:** Ensure criteria are passed to the script as discrete arguments (product, list of attributes, price limit). Parse the user's instruction into this structure before calling the script.\n* **Output Format:** The final action must strictly follow the `search[<query>]` syntax.\n",
- "path": "experiments/src/skills/webshop/webshop-search-constructor/SKILL.md"
- },
- {
- "id": "WebShop::webshop-search-executor",
- "skillId": "webshop-search-executor",
- "name": "webshop-search-executor",
- "description": "Executes a search on an e-commerce platform using parsed keywords. Use when you have extracted search terms from a user query and need to perform the actual search[] action on the WebShop interface. Takes structured search terms and performs a search action, returning a list of product results for evaluation.",
- "collection": "WebShop",
- "source": "---\nname: webshop-search-executor\ndescription: >-\n Executes a search on an e-commerce platform using parsed keywords. Use when you have\n extracted search terms from a user query and need to perform the actual search[] action\n on the WebShop interface. Takes structured search terms and performs a search action,\n returning a list of product results for evaluation.\n---\n# Instructions\n\n## 1. Trigger Condition\nActivate when the user provides an instruction to find or buy a product with specific attributes. The instruction will be in the `Observation`.\n\n## Edge Cases\n* If the search returns 0 results, retry with a broader query (e.g., drop the least critical attribute).\n* If all results exceed the user's price constraint, try adding price-related terms or narrowing the product category.\n\n## 2. Action Protocol\nYou must respond using **only** the following two action formats. Your final response must be in the exact structure:\n\n**Thought:** [Your reasoning about the search terms to use based on the user's requirements.]\n**Action:** `search[<keywords>]`\n\nOr, if selecting a product from results:\n\n**Thought:** [Your reasoning about which product best matches.]\n**Action:** `click[<product_id>]`\n\n## 3. Example\n\n**Instruction:** \"i need a long clip-in hair extension which is natural looking, and price lower than 40.00 dollars\"\n\n**Observation:** WebShop search page is displayed with a search bar.\n\n**Thought:** The user needs a clip-in hair extension that is long and natural looking, under $40. I will search for the core product type with key attributes to get relevant results.\n**Action:** `search[long natural looking clip-in hair extension]`\n\n---\n\n**Instruction:** \"i want a pack of organic green tea bags, price lower than 10.00 dollars\"\n\n**Observation:** WebShop search page is displayed with a search bar.\n\n**Thought:** The user wants organic green tea bags under $10. I will search with the key product terms.\n**Action:** `search[organic green tea bags]`\n",
- "path": "experiments/src/skills/webshop/webshop-search-executor/SKILL.md"
- },
- {
- "id": "WebShop::webshop-search-formulator",
- "skillId": "webshop-search-formulator",
- "name": "webshop-search-formulator",
- "description": "This skill generates effective search keywords based on parsed product criteria. It is triggered after query parsing, when the agent needs to perform an initial product search on an e-commerce platform. The skill takes structured attributes (e.g., 'women's size 5 patent-beige high heel') and produces a concise, platform-appropriate search string designed to return relevant results, balancing specificity with recall.",
- "collection": "WebShop",
- "source": "---\nname: webshop-search-formulator\ndescription: This skill generates effective search keywords based on parsed product criteria. It is triggered after query parsing, when the agent needs to perform an initial product search on an e-commerce platform. The skill takes structured attributes (e.g., 'women's size 5 patent-beige high heel') and produces a concise, platform-appropriate search string designed to return relevant results, balancing specificity with recall.\n---\n# Skill: Webshop Search Formulator\n\n## Purpose\nYou are an expert at formulating the initial search query for an e-commerce product search. Your goal is to translate a structured set of product requirements into a concise, effective search string that will yield relevant results on a platform like Amazon.\n\n## Core Workflow\n1. **Input:** You receive a parsed query containing key product attributes (e.g., category, type, size, color, material, price limit).\n2. **Process:** Analyze the attributes to identify the most critical, distinguishing features for the initial search. Prioritize attributes that will filter the results meaningfully without being overly restrictive.\n3. **Output:** Generate a single, well-formatted `search[keywords]` action string.\n\n## Key Principles for Search Formulation\n* **Balance Specificity & Recall:** Start with a moderately specific query. Including 2-3 core attributes (e.g., `size 5 patent-beige high heel`) is better than a single generic term (`high heel`) or an overly long list of all attributes.\n* **Prioritize Distinctive Attributes:** Favor attributes that uniquely identify the product variant (e.g., \"patent-beige\", \"size 5\") over very common ones (e.g., \"women's\") in the initial search.\n* **Use Natural Keyword Order:** Place the most important or specific terms first. Mimic how a user might type the query.\n* **Exclude Non-Searchable Filters:** Do not include filters typically applied *after* the search (e.g., price ranges like `< $90`) in the initial keyword string. These are for later refinement.\n* **Standardize Formatting:** Use lowercase, avoid special characters, and separate keywords with spaces.\n\n## Example from Trajectory\n**Parsed Instruction:** `woman's us size 5 high heel shoe with a rubber sole and color patent-beige, and price lower than 90.00 dollars`\n**Effective Search:** `search[size 5 patent-beige high heel]`\n**Rationale:** \"size 5\" and \"patent-beige\" are the most specific, distinguishing attributes. \"high heel\" defines the product type. \"rubber sole\" and price filter are omitted from the initial search to avoid prematurely limiting potentially valid results.\n\n## Action Format\nYour final output must be a single action in the exact format:\n",
- "path": "experiments/src/skills/webshop/webshop-search-formulator/SKILL.md"
- },
- {
- "id": "WebShop::webshop-variant-chooser",
- "skillId": "webshop-variant-chooser",
- "name": "webshop-variant-chooser",
- "description": "This skill selects a product variant (e.g., size, quantity) from available options on a product detail page. It is triggered when a product page displays multiple choices, assessing the options (like '1.1 pound (pack of 1)' or 'pack of 2') and selecting one that aligns with user needs, often defaulting to a standard single unit if unspecified.",
- "collection": "WebShop",
- "source": "---\nname: webshop-variant-chooser\ndescription: This skill selects a product variant (e.g., size, quantity) from available options on a product detail page. It is triggered when a product page displays multiple choices, assessing the options (like '1.1 pound (pack of 1)' or 'pack of 2') and selecting one that aligns with user needs, often defaulting to a standard single unit if unspecified.\n---\n# Instructions\n\n## When to Use\nUse this skill when you are on a product detail page and the observation contains a list of variant options (e.g., under a \"size\" or \"quantity\" heading). The skill is triggered by the presence of multiple clickable options that represent different configurations of the same product.\n\n## Core Decision Logic\n1. **Parse the Observation:** Identify the list of available variant options from the observation text. These are typically presented as clickable values after a label like \"size\".\n2. **Assess User Needs:** Review the original user instruction for any explicit or implicit preferences regarding variant (e.g., budget constraints, desired quantity). If no preference is stated, default logic applies.\n3. **Select and Act:** Choose the most appropriate variant and execute a `click[value]` action.\n * **If user instruction specifies a constraint (e.g., \"price lower than 40.00 dollars\"):** Ensure the selected variant's price (if displayed) complies.\n * **If no user preference is stated:** Prefer the standard, single-unit option (e.g., \"1.1 pound (pack of 1)\" over \"pack of 2\") as a sensible default.\n * **If the choice is ambiguous:** You may need to click on a variant to see its updated price/details before finalizing the selection, as shown in the trajectory.\n\n## Action Format\nYour response must strictly follow this format:\n",
- "path": "experiments/src/skills/webshop/webshop-variant-chooser/SKILL.md"
- },
- {
- "id": "SkillNet::skillnet",
- "skillId": "skillnet",
- "name": "skillnet",
- "description": "Search, download, create, evaluate, analyze and route reusable agent skills with SkillNet. Use when asked to find or reuse a skill, turn a repo/document/trace into a skill, assess skill quality, build a local skill graph, select skills for a task, or fill a clearly identified capability gap with a reusable skill. 中文:搜索、下载、创建、评估、分析与路由技能。不用于普通代码修改或仅阅读文档。",
- "collection": "SkillNet",
- "source": "---\nname: skillnet\ndescription: >-\n Search, download, create, evaluate, analyze and route reusable agent skills with SkillNet.\n Use when asked to find or reuse a skill, turn a repo/document/trace into a skill,\n assess skill quality, build a local skill graph, select skills for a task,\n or fill a clearly identified capability gap with a reusable skill.\n 中文:搜索、下载、创建、评估、分析与路由技能。不用于普通代码修改或仅阅读文档。\nmetadata:\n version: \"0.1.1\"\n requirements: \"Python 3.10+, skillnet-ai 0.1.1+, network; model API for create/evaluate/analyze; graph extra and embedding API for analyze/route; Claude or Codex SDK for route\"\n---\n\n# SkillNet\n\nFind a useful skill, bring its complete resources into the workspace, create and\nevaluate reusable skills, or analyze and route a local library through the SkillNet SDK.\n\n## Choose the workflow\n\n- **Analyze and route:** build a local skill graph, then select skills for a task.\n Read [routing.md](references/routing.md) for separate model and SDK configuration.\n- **Find:** search and return relevant candidates with URLs and tradeoffs.\n- **Reuse or install:** inspect relevant skills already available, then search →\n select → download → inspect → apply when the user requested its use.\n- **Create:** choose one source → create through SkillNet → check structure → evaluate.\n- **Evaluate:** evaluate the requested local skill or GitHub skill URL and explain\n the findings in terms of what the user wants to do.\n\nKeep the user's original task in focus. Ordinary coding and document reading do\nnot require a SkillNet search. An explicit creation request is sufficient reason\nto create a skill; it need not meet an additional complexity threshold.\n\n## Runtime and configuration\n\nUse the installed `skillnet` CLI (version 0.1.1+). Prefer `--json` for reliable paths,\nURLs and error information. If the command is missing, outdated, or its interpreter\nis uncertain, read [setup.md](references/setup.md). `python -m skillnet_ai` is an\nalternative when using the Python environment that actually contains the SDK.\n\nSearch and public download need no model API key. Before creating or evaluating,\nreuse the user's existing configuration. If it is missing, read setup.md and help\nconfigure **API key + model API base URL + model name** once. `skillnet doctor --json`\nshows configuration sources and missing fields without revealing keys. It makes\nno network request unless explicitly asked.\n\nAgent login and model API authentication are separate. Use an endpoint compatible\nwith Chat Completions; do not extract credentials from an agent's login files.\n\nResources linked here are relative to the directory containing this SKILL.md,\nnot the shell's working directory. Keep generated outputs in the user's workspace.\nFor persistent skill installation and host discovery, read\n[platforms.md](references/platforms.md).\n\n## Find and use a skill\n\nStart with a focused keyword and a small result set:\n\n```text\nskillnet search \"pdf\" --limit 5 --json\n```\n\nIf those candidates are irrelevant, make at most one semantic query with a short\ndescription of the missing capability:\n\n```text\nskillnet search \"extract tables from scanned financial reports\" --mode vector --limit 5 --json\n```\n\nChoose by task fit, dependencies and reported limitations. Stars and stored\nassessments are useful signals, not proof that the skill will work. With no useful\ncandidate, report that briefly and continue the user's task.\n\nDownload the selected `skill_url` into a task-local folder, or the active host's\nskill directory when the user wants it installed:\n\n```text\nskillnet download \"<skill_url>\" --target-dir \"./downloaded_skills\" --json\n```\n\nUse the returned `data.path`; do not reconstruct paths from names or table output.\nDownload includes scripts, references and other files. Read SKILL.md, then inspect\nonly the resources and operations relevant to the task. Use the skill within the\nuser's authorization and the host's permissions. Loading or reading it does not\nrequire a second approval when the user already asked for its use.\n\nAn existing destination is preserved by default. Use `--overwrite` only when an\nupdate/replacement is intended. Do not silently delete an existing skill.\n\n## Create and evaluate\n\nTell the user that creation includes a model-based evaluation, then run:\n\n```text\nskillnet create --prompt \"A skill for checking CSV headers and reporting missing columns\" --output-dir \"./generated_skills\" --evaluate --json\n```\n\nUse `--no-evaluate` when the user explicitly wants to skip evaluation. For repository,\ndocument or trajectory input, read [workflow-patterns.md](references/workflow-patterns.md).\nThe CLI uses the real SDK, checks generated structure before evaluating, and returns\npaths and per-skill results. Keep SDK errors visible instead of substituting\nhost-written output and calling it a SkillNet result.\n\nEvaluate an existing skill with:\n\n```text\nskillnet evaluate \"./generated_skills/example\" --json\n```\n\nExplain the five dimensions and actionable weaknesses. Model evaluation does not\nexecute the skill by default and does not prove the user's task succeeds. When\nappropriate, exercise the skill on a small representative input and inspect the\nactual output. Avoid automatic regeneration loops or unrequested batch evaluations.\n\n## Results and recovery\n\nA successful command has `ok: true`. A failed command exits nonzero and includes an\nerror and, where available, partial `data`. If creation succeeded but evaluation\nfailed, preserve `data.paths` and retry **evaluation**, not creation.\n\nReport what was found/created, its real path, any validation or quality issues,\nand whether it was exercised on the user's task. Distinguish downloaded files,\nvalid structure, completed model evaluation, and verified task behavior.\n\nRead [api-reference.md](references/api-reference.md) for flags, output fields,\nprovider compatibility and error recovery. Read\n[security-privacy.md](references/security-privacy.md) when handling private inputs,\ncredentials or unfamiliar third-party operations.\n",
- "path": "skills/skillnet/SKILL.md"
- }
- ],
- "references": [
- {
- "source": "WebShop::webshop-product-search",
- "target": "WebShop::webshop-result-filter",
- "type": "source_reference",
- "line": 20,
- "excerpt": "* **Output Handoff:** The search results page is passed to downstream skills (e.g., `webshop-result-filter`, `webshop-product-evaluator`) for individual product analysis."
- },
- {
- "source": "WebShop::webshop-product-search",
- "target": "WebShop::webshop-product-evaluator",
- "type": "source_reference",
- "line": 20,
- "excerpt": "* **Output Handoff:** The search results page is passed to downstream skills (e.g., `webshop-result-filter`, `webshop-product-evaluator`) for individual product analysis."
- },
- {
- "source": "WebShop::webshop-query-interpreter",
- "target": "WebShop::webshop-search-executor",
- "type": "source_reference",
- "line": 31,
- "excerpt": "3. **Hand Off:** Pass the structured parameters to the search execution skill (e.g., `webshop-search-executor` or `webshop-product-search`) to perform the actual query."
- },
- {
- "source": "WebShop::webshop-query-interpreter",
- "target": "WebShop::webshop-product-search",
- "type": "source_reference",
- "line": 31,
- "excerpt": "3. **Hand Off:** Pass the structured parameters to the search execution skill (e.g., `webshop-search-executor` or `webshop-product-search`) to perform the actual query."
- }
- ]
-}
diff --git a/frontend/src/evaluations.json b/frontend/src/evaluations.json
deleted file mode 100644
index 0c0702d..0000000
--- a/frontend/src/evaluations.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "webshop-product-selector": {
- "dimensions": {
- "safety": {
- "level": "Good",
- "reason": "The skill is narrowly scoped to selecting a product from a search results page and clicking its ID; it does not instruct destructive, credential-related, or security-bypassing actions. The only caveat is that the click target must match the observation exactly, which is a normal UI constraint rather than a safety risk."
- },
- "completeness": {
- "level": "Average",
- "reason": "The decision process, heuristic, and final action format are clearly described, but it assumes a lot about the surrounding WebShop observation and does not specify fallback handling for ties beyond price or for missing/ambiguous product fields. It also references a bundled selector.py script, but no actual script is provided in the evidence."
- },
- "executability": {
- "level": "Average",
- "reason": "An agent can follow the text instructions to choose a product and issue click[product_id], but the skill depends on observation formatting and exact click values that are only partially specified in the references. The cited lowercase/uppercase mismatch note adds uncertainty about the exact action token the environment expects."
- },
- "maintainability": {
- "level": "Good",
- "reason": "The scope is narrow and modular: it selects one item from a shortlist using a simple heuristic and then triggers a single navigation action. The inputs and output action are well bounded, making it easy to adapt the scoring heuristic or selection rules."
- },
- "cost_awareness": {
- "level": "Good",
- "reason": "The workflow is lightweight and limited to evaluating a shortlist of products on one page, with no loops, external services, or heavy computation described. The selection heuristic is simple and bounded by the current observation."
- }
- },
- "injectionScan": {
- "clean": true,
- "complete": true,
- "count": 0
- }
- },
- "webshop-query-interpreter": {
- "dimensions": {
- "safety": {
- "level": "Good",
- "reason": "The skill is limited to interpreting shopping queries into structured search parameters and does not describe destructive, security-bypassing, or sensitive actions. The provided content and automated pre-screen show no injection artifacts or unsafe tool use."
- },
- "completeness": {
- "level": "Average",
- "reason": "The core workflow is clear: parse product type, attributes, and constraints, then format them into a template and hand off to a search skill. However, it gives limited edge-case handling beyond a few examples and does not specify how to resolve ambiguous queries beyond general references in the extra reference file."
- },
- "executability": {
- "level": "Good",
- "reason": "This is an instruction-only workflow that an agent can follow using typical LLM capabilities without needing scripts. The steps, output template, and examples are concrete enough to produce usable search parameters from user shopping text."
- },
- "maintainability": {
- "level": "Good",
- "reason": "The scope is narrow and modular, focused on extracting structured fields for downstream search. The template and example patterns make it easy to adjust or compose with other webshop skills."
- },
- "cost_awareness": {
- "level": "Good",
- "reason": "The task is a lightweight text-parsing step with no external services, large datasets, or repeated loops implied. The description naturally limits itself to a single query interpretation before handoff."
- }
- },
- "injectionScan": {
- "clean": true,
- "complete": true,
- "count": 0
- }
- }
-}
diff --git a/frontend/src/localLibrary.ts b/frontend/src/localLibrary.ts
deleted file mode 100644
index d55518a..0000000
--- a/frontend/src/localLibrary.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { parseSnapshot } from './data'
-import type { Dataset } from './data'
-
-export interface LocalLibrary {
- id: string
- name: string
- sourcePath: string
- indexPath?: string
-}
-
-export interface LocalLibraryData {
- source: Dataset
- analysis: Dataset | null
- changedSkills: number
- removedSkills: number
-}
-
-interface LocalResponse {
- name: string
- source: Dataset
- graph: unknown | null
- changedSkills: number
- removedSkills: number
-}
-
-export async function createDefaultLibrary(): Promise<string> {
- const response = await fetch('/api/local-library', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ action: 'create-default' }),
- })
- if (!response.headers.get('content-type')?.includes('application/json')) throw new Error('To create a local skill library, open the app with npm run dev or npm run preview.')
- const value = await response.json() as { sourcePath?: string; error?: string }
- if (!response.ok || !value.sourcePath) throw new Error(value.error || 'Could not create the local skill library.')
- return value.sourcePath
-}
-
-export async function readLocalLibrary(library: LocalLibrary): Promise<LocalLibraryData> {
- const response = await fetch('/api/local-library', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ sourcePath: library.sourcePath, indexPath: library.indexPath || null }),
- })
- if (!response.headers.get('content-type')?.includes('application/json')) throw new Error('To use local folders, open the app with npm run dev or npm run preview.')
- const value = await response.json() as LocalResponse | { error: string }
- if (!response.ok) throw new Error('error' in value ? value.error : 'Could not read the local skill library.')
- if (!('source' in value)) throw new Error('Invalid local skill library response.')
- const analysis = value.graph ? parseSnapshot(value.graph, `${value.name} · Current analysis snapshot`) : null
- const source = { ...value.source, skills: value.source.skills.map(skill => ({ ...skill, collection: library.id })) }
- return { source, analysis, changedSkills: value.changedSkills, removedSkills: value.removedSkills }
-}
diff --git a/frontend/src/persistence.ts b/frontend/src/persistence.ts
deleted file mode 100644
index 633e0e4..0000000
--- a/frontend/src/persistence.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-const databaseName = 'skillnet-workbench'
-const storeName = 'imports'
-const librariesStore = 'libraries'
-const viewKey = 'skillnet-workbench-view-v1'
-import type { LocalLibrary } from './localLibrary'
-
-export interface SavedView {
- collection: string
- sourceId: string
- selectedSkillId: string
-}
-
-export interface SavedImport {
- id: string
- name: string
- json: string
-}
-
-function openDatabase(): Promise<IDBDatabase> {
- return new Promise((resolve, reject) => {
- const request = indexedDB.open(databaseName, 2)
- request.onupgradeneeded = () => {
- if (!request.result.objectStoreNames.contains(storeName)) request.result.createObjectStore(storeName)
- if (!request.result.objectStoreNames.contains(librariesStore)) request.result.createObjectStore(librariesStore, { keyPath: 'id' })
- }
- request.onsuccess = () => resolve(request.result)
- request.onerror = () => reject(request.error)
- })
-}
-
-export async function loadImports(): Promise<SavedImport[]> {
- const database = await openDatabase()
- return new Promise((resolve, reject) => {
- const transaction = database.transaction(storeName, 'readonly')
- const values = transaction.objectStore(storeName).getAll()
- const keys = transaction.objectStore(storeName).getAllKeys()
- transaction.oncomplete = () => {
- database.close()
- resolve((values.result as Array<{ name: string; json: string }>).map((item, index) => ({ id: `imported:${String(keys.result[index])}`, ...item })))
- }
- transaction.onerror = () => { database.close(); reject(transaction.error) }
- })
-}
-
-export async function saveImport(value: SavedImport): Promise<void> {
- const database = await openDatabase()
- return new Promise((resolve, reject) => {
- const transaction = database.transaction(storeName, 'readwrite')
- transaction.objectStore(storeName).put({ name: value.name, json: value.json }, value.id.slice('imported:'.length))
- transaction.oncomplete = () => { database.close(); resolve() }
- transaction.onerror = () => { database.close(); reject(transaction.error) }
- })
-}
-
-export async function clearImport(id: string): Promise<void> {
- const database = await openDatabase()
- return new Promise((resolve, reject) => {
- const transaction = database.transaction(storeName, 'readwrite')
- transaction.objectStore(storeName).delete(id.slice('imported:'.length))
- transaction.oncomplete = () => { database.close(); resolve() }
- transaction.onerror = () => { database.close(); reject(transaction.error) }
- })
-}
-
-export async function loadLocalLibraries(): Promise<LocalLibrary[]> {
- const database = await openDatabase()
- return new Promise((resolve, reject) => {
- const transaction = database.transaction(librariesStore, 'readonly')
- const request = transaction.objectStore(librariesStore).getAll()
- request.onsuccess = () => resolve(request.result as LocalLibrary[])
- request.onerror = () => reject(request.error)
- transaction.oncomplete = () => database.close()
- transaction.onerror = () => database.close()
- })
-}
-
-export async function saveLocalLibrary(library: LocalLibrary): Promise<void> {
- const database = await openDatabase()
- return new Promise((resolve, reject) => {
- const transaction = database.transaction(librariesStore, 'readwrite')
- transaction.objectStore(librariesStore).put(library)
- transaction.oncomplete = () => { database.close(); resolve() }
- transaction.onerror = () => { database.close(); reject(transaction.error) }
- })
-}
-
-export async function removeLocalLibrary(id: string): Promise<void> {
- const database = await openDatabase()
- return new Promise((resolve, reject) => {
- const transaction = database.transaction(librariesStore, 'readwrite')
- transaction.objectStore(librariesStore).delete(id)
- transaction.oncomplete = () => { database.close(); resolve() }
- transaction.onerror = () => { database.close(); reject(transaction.error) }
- })
-}
-
-export function loadView(): SavedView | null {
- try {
- const value = JSON.parse(localStorage.getItem(viewKey) ?? 'null') as unknown
- if (typeof value !== 'object' || value === null || !('collection' in value) || !('sourceId' in value) || !('selectedSkillId' in value)) return null
- if (typeof value.collection !== 'string' || typeof value.sourceId !== 'string' || typeof value.selectedSkillId !== 'string') return null
- return value as SavedView
- } catch {
- return null
- }
-}
-
-export function saveView(view: SavedView): void {
- try {
- localStorage.setItem(viewKey, JSON.stringify(view))
- } catch {
- // Browsing still works when local storage is disabled.
- }
-}
diff --git a/frontend/src/styles.css b/frontend/src/styles.css
deleted file mode 100644
index fddc389..0000000
--- a/frontend/src/styles.css
+++ /dev/null
@@ -1,114 +0,0 @@
-:root{font-family:Inter,"Segoe UI",Arial,"Noto Sans SC",sans-serif;color:#162638;background:#f8fafb;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
-*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0}button,input{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}:focus-visible{outline:3px solid #68bfa7;outline-offset:3px}::selection{background:#c9eee4}
-.app-shell{min-height:100vh;background:linear-gradient(180deg,#fbfcfd 0,#f8fafb 520px,#f5f8fa 100%)}
-.site-header{height:70px;border-bottom:1px solid #e8edf1;background:rgba(255,255,255,.92)}.site-header-inner{max-width:1480px;height:100%;padding:0 36px;margin:auto;display:flex;align-items:center;gap:20px}.brand{display:flex;align-items:center;width:126px;height:64px;overflow:hidden}.brand img{display:block;width:126px;height:auto}.header-spacer{flex:1}.header-link{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:650;color:#586a7a}.header-link:hover{color:#078869}
-main{max-width:1480px;margin:auto;padding:0 36px}.intro{padding:37px 4px 20px}.intro-topline{display:flex;align-items:center;gap:9px;color:#388976;letter-spacing:.16em;font-size:10px;font-weight:750}.eyebrow-line{height:1px;width:20px;background:#4bab94}.intro-row{display:flex;justify-content:space-between;align-items:center;min-height:132px}.intro h1{font-size:clamp(29px,3.2vw,43px);letter-spacing:-.045em;line-height:1.18;margin:13px 0 10px;font-weight:780}.intro h1 em{font-style:normal;color:#0c8b6f}.intro p{font-size:14px;line-height:1.7;color:#687987;margin:0;max-width:700px}.intro-mark{width:130px;height:125px;margin-right:45px;position:relative;opacity:.7}.mark-ring{position:absolute;border:1px solid #c6d9df;border-radius:50%;transform:rotate(-26deg)}.ring-one{width:112px;height:68px;left:12px;top:27px}.ring-two{width:68px;height:112px;left:34px;top:4px;transform:rotate(43deg)}.mark-point{position:absolute;width:8px;height:8px;border-radius:50%;background:#249f84;box-shadow:0 0 0 4px #e6f5f0}.p1{left:12px;top:59px}.p2{left:69px;top:4px;background:#95afbb}.p3{right:5px;top:59px}.p4{left:66px;bottom:8px;background:#95afbb}.p5{left:65px;top:59px;width:12px;height:12px;background:#1c6b80;box-shadow:0 0 0 6px #e4eef1}
-.dataset-bar{background:#fff;border:1px solid #e3ebef;border-radius:16px;display:flex;align-items:center;gap:16px;padding:17px 20px;box-shadow:0 12px 34px rgba(16,48,69,.035)}.dataset-icon{width:45px;height:45px;display:grid;place-items:center;background:#e9f6f3;color:#0b8c70;border-radius:12px;flex:none}.dataset-info{min-width:0;flex:1}.dataset-kicker{font-size:10px;letter-spacing:.1em;font-weight:750;color:#8495a2;text-transform:uppercase;display:flex;align-items:center;gap:10px}.dataset-info strong{display:block;margin:4px 0 1px;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataset-info p{font-size:12px;color:#788a95;margin:0;line-height:1.4}.data-tag{letter-spacing:0;padding:3px 7px;border-radius:5px;font-size:10px}.data-tag.demo{background:#f0f4f7;color:#5e7583}.data-tag.snapshot{background:#e6f6ef;color:#0c8765}.dataset-actions{display:flex;gap:9px;align-items:center}.text-button{background:transparent;border:0;color:#657887;font-weight:650;font-size:12px;padding:10px 12px}.text-button:hover:not(:disabled){color:#0b8c70}.text-button:disabled{opacity:.45;cursor:default}.primary-button{background:#078b6b;border:1px solid #078b6b;color:#fff;border-radius:9px;padding:11px 15px;display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:730;box-shadow:0 5px 12px rgba(6,139,107,.13);white-space:nowrap}.primary-button:hover{background:#067a5f}.primary-button:disabled{opacity:.65;cursor:wait}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.error-banner{display:flex;gap:9px;align-items:center;background:#fff6f3;color:#a7503c;border:1px solid #f1cfc6;border-radius:10px;padding:11px 14px;margin-top:10px;font-size:13px}.error-banner button{margin-left:auto;border:0;background:transparent;color:inherit;display:grid;place-items:center}
-.stats-row{display:flex;align-items:center;gap:0;min-height:71px;padding:0 2px}.stats-row>div{display:flex;align-items:center;gap:8px;padding-right:24px;margin-right:24px;border-right:1px solid #e0e7ea}.stats-row>div:nth-child(3){border-right:0}.stat-icon{color:#83a4ac;display:grid;place-items:center}.stat-number{font-size:17px;font-weight:780;color:#18364b}.stat-label{font-size:11px;color:#8b9ba5;font-weight:600}.stats-row p{margin-left:auto;font-size:11px;color:#98a6ae;white-space:nowrap}.workbench-heading{display:flex;align-items:end;justify-content:space-between;padding:19px 2px 17px;border-top:1px solid #e5ebee}.section-overline{font-size:10px;letter-spacing:.15em;color:#13856d;font-weight:780}.workbench-heading h2{margin:5px 0 4px;font-size:22px;letter-spacing:-.025em}.workbench-heading p{font-size:12px;color:#83929c;margin:0}.read-only{display:flex;align-items:center;gap:7px;color:#759089;font-weight:650;font-size:11px;margin-bottom:3px}.read-only span{height:6px;width:6px;background:#28ad84;border-radius:50%}
-.workspace{display:grid;grid-template-columns:minmax(255px,280px) minmax(390px,1fr) minmax(310px,350px);min-height:602px;border:1px solid #dfe8ed;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 17px 40px rgba(17,54,77,.045)}.skill-panel,.graph-panel,.detail-panel{min-width:0}.skill-panel,.graph-panel{border-right:1px solid #e4eaee}.panel-title{height:73px;padding:18px 20px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #edf1f3}.panel-title>div:first-child{display:flex;flex-direction:column;gap:4px}.panel-title span:not(.count-pill){font-size:10px;letter-spacing:.08em;color:#93a2ac;font-weight:750}.panel-title strong{font-size:15px;letter-spacing:-.02em}.panel-title>svg{color:#a3b5bd}.count-pill{font-size:11px;background:#f1f5f7;color:#698391;border-radius:6px;padding:5px 7px;font-weight:750}.search-box{display:flex;align-items:center;gap:9px;height:39px;margin:17px 14px 14px;border:1px solid #e1e8ec;background:#f7f9fa;border-radius:8px;padding:0 11px;color:#8ea0ac}.search-box:focus-within{background:#fff;border-color:#8cc9b9;box-shadow:0 0 0 3px #e4f4ef}.search-box input{border:0;background:transparent;outline:0;min-width:0;width:100%;font-size:12px;color:#18344a}.search-box input::placeholder{color:#9cabb4}.search-box button{border:0;background:none;color:#91a1a9;display:grid;place-items:center;padding:1px}.list-caption{font-size:10px;font-weight:730;color:#92a3ac;display:flex;justify-content:space-between;align-items:center;padding:0 19px 11px;border-bottom:1px solid #edf1f3}.skill-list{max-height:482px;overflow:auto}.skill-row{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #eff2f4;background:#fff;padding:14px 17px 12px 19px;color:#263c4b;position:relative}.skill-row:hover{background:#f8fbfa}.skill-row.is-active{background:#f0f9f6}.skill-row.is-active:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#0c9877}.skill-row-top{display:flex;align-items:center;gap:9px}.skill-row-top strong{font-size:12px;font-weight:740;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;text-transform:capitalize}.skill-row-top>svg{color:#a4b4bb;opacity:0}.skill-row:hover .skill-row-top>svg,.skill-row.is-active .skill-row-top>svg{opacity:1}.skill-glyph{width:20px;height:20px;border-radius:6px;background:#e7f3f0;display:grid;place-items:center;flex:none}.skill-glyph span{width:6px;height:6px;border-radius:50%;background:#26a082;box-shadow:0 0 0 2px #abd9cd}.skill-row-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.45;font-size:11px;color:#7d8e9a;margin:7px 0 8px 29px;height:31px}.skill-row-bottom{display:flex;justify-content:space-between;gap:6px;color:#9cacb5;margin-left:29px;font-size:9px}.skill-row-bottom>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.skill-row-bottom>span:last-child{display:flex;align-items:center;gap:3px;flex:none}.no-results{font-size:12px;color:#82949f;padding:24px 18px;line-height:1.6}.no-results button{display:block;border:0;background:none;color:#0b8e70;padding:7px 0}
-.graph-panel{display:flex;flex-direction:column;background:radial-gradient(circle at 50% 43%,#fff 0,#fff 56%,#fcfdfd 100%)}.graph-tools{display:flex;background:#f3f7f8;border-radius:7px;padding:3px;gap:2px}.graph-tools button{border:0;border-radius:5px;padding:6px 9px;background:transparent;color:#8a9ca7;font-size:10px;font-weight:730}.graph-tools button.is-on{background:#fff;color:#146b5d;box-shadow:0 1px 4px rgba(15,48,62,.1)}.graph-subtitle{display:flex;align-items:center;gap:6px;padding:14px 20px 0;color:#9aabb4;font-size:10px}.graph-subtitle strong{color:#567284;font-weight:750}.graph-svg{width:100%;height:450px;display:block}.graph-node,.graph-edge{cursor:pointer}.graph-node:focus-visible,.graph-edge:focus-visible{outline:none}.graph-node:focus-visible .node-circle{stroke:#17a47f;stroke-width:3}.graph-edge:focus-visible .edge-line{stroke-width:4}.node-halo{fill:#e0f5ed}.node-circle{fill:#eff5f6;stroke:#b5cbd3;stroke-width:1.5;transition:fill .2s,stroke .2s}.node-core{fill:#89aab7}.graph-node.is-active .node-circle{fill:#fff;stroke:#139c7b;stroke-width:2}.graph-node.is-active .node-core{fill:#139c7b}.graph-node:hover .node-circle{stroke:#139c7b}.node-label{fill:#637c8b;font-size:11px;font-weight:640;pointer-events:none;text-transform:capitalize}.graph-node.is-active .node-label{fill:#17483e;font-weight:790}.edge-line{stroke:#adc0c6;stroke-width:1.8;transition:stroke .2s,stroke-width .2s}.graph-edge.compose_with .edge-line{stroke:#67b9a4}.graph-edge.source_reference .edge-line{stroke:#91aeb7;stroke-dasharray:4 4}.graph-edge.similar_to .edge-line{stroke:#b3aacc;stroke-dasharray:2 4}.graph-edge.is-selected .edge-line,.graph-edge:hover .edge-line{stroke:#158d72;stroke-width:3}.edge-hit{stroke:transparent;stroke-width:16}.edge-label-bg{fill:#fff;stroke:#cfe7df}.edge-label{fill:#187d67;font-size:10px;font-weight:750}.graph-footer{border-top:1px solid #edf1f3;height:51px;margin-top:auto;padding:0 19px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#a0afb6;font-size:10px}.legend{display:flex;gap:12px;flex-wrap:wrap}.legend>span{display:flex;align-items:center;gap:4px}.legend-line{width:14px;height:0;border-top:2px solid}.legend-line.compose{border-color:#67b9a4}.legend-line.similar{border-color:#b3aacc;border-style:dotted}.legend-line.reference{border-color:#91aeb7;border-style:dashed}.graph-empty{flex:1;min-height:450px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;color:#60798a;padding:30px}.graph-empty-symbol{display:grid;place-items:center;height:58px;width:58px;border-radius:50%;background:#f0f7f7;color:#88adb0;font-size:38px;font-weight:200}.graph-empty strong{font-size:14px;color:#355266}.graph-empty span{font-size:11px;max-width:280px;line-height:1.6}
-.detail-panel{background:#fff}.inspector-content{padding:20px;max-height:530px;overflow:auto}.inspector-eyebrow{font-size:10px;color:#9aaeb7;letter-spacing:.13em;font-weight:800;margin-bottom:10px}.inspector-content h2{font-size:19px;line-height:1.3;letter-spacing:-.035em;margin:0 0 7px;overflow-wrap:anywhere}.skill-path{display:flex;align-items:flex-start;gap:6px;font-size:10px;color:#93a4ac;line-height:1.5;overflow-wrap:anywhere}.skill-path svg{flex:none;margin-top:1px}.capability-card{background:#f4faf8;border:1px solid #e1f0eb;border-radius:10px;padding:13px 14px;margin:20px 0}.field-label{color:#689280;font-size:10px;font-weight:800;letter-spacing:.08em}.capability-card p{font-size:12px;line-height:1.58;color:#41606b;margin:8px 0 0}.profile-groups{border-bottom:1px solid #e8edf0;padding-bottom:5px}.profile-group{margin:0 0 15px}.profile-group h3,.inspector-section h3{font-size:12px;color:#344d5f;margin:0 0 8px}.profile-item{font-size:11px;line-height:1.55;color:#708593;margin:5px 0}.profile-item button{border:0;background:#ecf6f3;color:#20836e;font-size:9px;font-weight:750;padding:2px 4px;margin-left:4px;border-radius:4px}.inspector-section{padding:19px 0;border-top:1px solid #e9eef0}.section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.section-heading h3{margin:0}.section-heading span{font-size:10px;color:#a4b2b9}.related-list{display:flex;flex-direction:column;gap:4px}.related-list button{display:flex;align-items:center;gap:7px;width:100%;text-align:left;border:1px solid #e7eef0;border-radius:7px;padding:8px;background:#fff;font-size:10px;color:#506b7b}.related-list button:hover{border-color:#9bd1c2;background:#f8fcfa}.related-list button>span:nth-child(2){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.related-list small{font-size:9px;color:#8ea5ac;white-space:nowrap}.related-list svg{color:#9dafb7}.small-dot{height:7px;width:7px;border-radius:50%;background:#87b1bf;flex:none}.small-dot.compose_with{background:#54aa94}.small-dot.similar_to{background:#a9a2c9}.source-section{padding-bottom:2px}.source-frame{max-height:315px;overflow:auto;border:1px solid #e6edf0;background:#fbfcfd;border-radius:8px;padding:8px 0;font-family:"Cascadia Code",Consolas,monospace;font-size:10px;line-height:1.55}.source-line{display:flex;white-space:pre;min-height:16px}.source-line.is-highlighted{background:#e6f5e7;box-shadow:inset 2px 0 #0f9b78}.source-number{width:33px;flex:none;color:#b0bfc4;text-align:right;padding-right:8px;user-select:none}.source-text{color:#587080;padding-right:10px}.relation-badge{display:inline-flex;font-size:10px;font-weight:800;padding:5px 8px;border-radius:5px;background:#e7f5f0;color:#14745d}.relation-badge.similar_to{background:#f0edfa;color:#7666a6}.relation-badge.source_reference{background:#edf3f5;color:#597987}.relation-path{display:flex;align-items:center;gap:6px;margin:14px 0 18px;line-height:1.4}.relation-path button{border:1px solid #dfe9ec;background:#fff;border-radius:6px;padding:7px;color:#385667;font-size:10px;overflow-wrap:anywhere;min-width:0}.relation-path button:hover{border-color:#95cdbd}.relation-path span{color:#81a9a5;flex:none}.notice{display:flex;align-items:flex-start;gap:7px;border-radius:7px;font-size:10px;line-height:1.55;padding:10px}.notice svg{flex:none}.notice.subtle{background:#f6f9f9;color:#65818c}.section-index{font-size:9px;letter-spacing:.1em;color:#9caeb8;font-weight:800;margin-bottom:7px}.inspector-section p{font-size:11px;line-height:1.62;color:#647d8a;margin:0 0 10px}.condition-list{display:flex;flex-wrap:wrap;gap:5px;margin:10px 0}.condition-list span{font-size:9px;color:#68826f;background:#edf7ec;border-radius:5px;padding:4px 6px}.evidence-group{display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px;margin:11px 0}.evidence-group .field-label{width:100%}.evidence-link{display:inline-flex;align-items:center;gap:4px;border:1px solid #dcece7;background:#f9fcfb;border-radius:5px;color:#347d6e;font-size:9px;padding:5px 6px;max-width:100%;overflow-wrap:anywhere}.evidence-link:hover{background:#e9f6f0}.muted{color:#9caab2!important}.bottom-note{display:flex;align-items:center;gap:8px;color:#8a9ea8;font-size:11px;margin:19px 2px 30px}.bottom-note svg{flex:none}.site-footer{border-top:1px solid #e3e9ed;padding:19px max(36px,calc((100vw - 1408px)/2));display:flex;justify-content:space-between;color:#a1aeb6;font-size:10px;background:#fbfcfd}
-.dataset-bar{margin-top:22px;padding:12px 16px}.dataset-icon{width:41px;height:41px}.stats-row{min-height:56px}.workbench-heading{padding:13px 2px 12px;align-items:center}.workbench-heading h1{font-size:17px;margin:0;letter-spacing:-.02em}.skill-list{scrollbar-color:#d3e1e3 transparent;scrollbar-width:thin}
-@media(max-width:1160px){.workspace{grid-template-columns:280px minmax(0,1fr)}.graph-panel{border-right:0}.detail-panel{grid-column:1/-1;border-top:1px solid #e4eaee}.inspector-content{max-height:none}.source-frame{max-height:320px}.stats-row p{display:none}}
-@media(max-width:760px){.site-header-inner,main{padding-left:18px;padding-right:18px}.site-header{height:62px}.brand{width:101px;height:59px}.brand img{width:101px}.header-link,.intro-mark{display:none}.intro{padding:29px 0 22px}.intro-row{min-height:auto}.intro h1{font-size:30px}.intro p{font-size:12px}.dataset-bar{align-items:flex-start;padding:14px;flex-wrap:wrap}.dataset-icon{width:39px;height:39px}.dataset-info{flex:1 1 calc(100% - 60px)}.dataset-actions{width:100%;justify-content:flex-end}.stats-row{flex-wrap:wrap;gap:5px;min-height:63px}.stats-row>div{padding-right:9px;margin-right:9px}.stat-number{font-size:14px}.stat-label{font-size:10px}.workbench-heading{padding-top:15px}.workbench-heading h2{font-size:20px}.workbench-heading p{line-height:1.5}.read-only{display:none}.workspace{display:block}.skill-panel,.graph-panel{border-right:0;border-bottom:1px solid #e4eaee}.skill-list{max-height:310px}.graph-svg{height:auto;min-height:320px}.graph-footer{height:auto;min-height:49px;padding:10px 14px;flex-wrap:wrap}.graph-footer>span{display:none}.inspector-content{max-height:none}.bottom-note{align-items:flex-start;line-height:1.5}.site-footer{padding:16px 18px}.site-footer span:last-child{display:none}}
-@media(max-width:430px){.site-header-inner{gap:10px}.intro h1{font-size:27px}.dataset-actions{justify-content:space-between}.text-button{padding-left:0}.stats-row>div{gap:5px;padding-right:7px;margin-right:7px}.stat-icon svg{width:14px}.stat-number{font-size:13px}.stat-label{font-size:9px}.legend{gap:7px}}
-.edge-target{fill:transparent;pointer-events:all}
-
-/* Readability pass: keep the existing layout and visual language. */
-:root{font-family:Inter,"Segoe UI Variable","Segoe UI","Microsoft YaHei UI","Noto Sans SC",sans-serif;color:#203544}
-.header-link{font-size:13px;color:#526a78}
-.dataset-kicker{font-size:11px;color:#536d79;letter-spacing:.04em}.data-tag{font-size:10px}.dataset-info strong{font-size:17px}.dataset-info p{font-size:13px;color:#5b6f7d;line-height:1.5}.text-button,.primary-button{font-size:13px}.primary-button{min-height:42px}
-.stat-number{font-size:18px}.stat-label,.stats-row p{font-size:12px;color:#5b6f7d}.workbench-heading h1{font-size:20px}.read-only{font-size:12px;color:#526e64}
-.panel-title{height:70px}.panel-title span:not(.count-pill){font-size:11px;color:#607483;letter-spacing:.04em}.panel-title strong{font-size:16px}.count-pill{font-size:12px;color:#526b78}
-.search-box{height:43px}.search-box input{font-size:13px}.search-box input::placeholder{color:#647786}.list-caption{font-size:11px;color:#607483}
-.skill-row{padding-top:15px;padding-bottom:14px}.skill-row-top strong{font-size:13px}.skill-row-description{font-size:12px;line-height:1.5;color:#536a78;height:auto;min-height:36px;margin-top:8px;margin-bottom:8px}.skill-row-bottom{font-size:10.5px;color:#607483}.no-results{font-size:13px;color:#526b78}
-.graph-tools button{font-size:11px;color:#5b6f7d;min-height:32px}.graph-subtitle{font-size:12px;color:#5b6f7d}.graph-subtitle strong{color:#3e5969}.node-label{font-size:12px;fill:#4b6573}.graph-node.is-active .node-label{fill:#164d41}.graph-footer{font-size:11px;color:#5b6f7d}.graph-empty span{font-size:12px}
-.graph-canvas{display:flex;min-width:0;flex:1}
-.graph-mobile-help{display:none}
-.inspector-eyebrow{font-size:11px;color:#607483;letter-spacing:.06em}.inspector-content h2{font-size:20px}.skill-path{font-size:11px;color:#5b6f7d}.field-label{font-size:11px;color:#3d7667;letter-spacing:.03em}.capability-card p{font-size:13px;line-height:1.6;color:#3e5963}.profile-group h3,.inspector-section h3{font-size:13px}.profile-item{font-size:12px;color:#526b78}.profile-item button{font-size:10px}.section-heading span,.section-index{font-size:11px;color:#607483}.related-list button{font-size:11.5px;color:#405b68}.related-list small{font-size:10.5px;color:#5b6f7d}.source-frame{font-size:11px;line-height:1.6}.source-number{color:#607483}.source-text{color:#455e6c}.inspector-section p{font-size:12.5px;color:#506775}.relation-path button,.notice,.condition-list span,.evidence-link{font-size:11px}.bottom-note{font-size:12px;color:#5b6f7d}
-@media(min-width:1161px){.workspace{grid-template-columns:minmax(285px,300px) minmax(390px,1fr) minmax(345px,370px)}}
-@media(max-width:760px){.dataset-info p{font-size:12.5px}.stat-number{font-size:15px}.stat-label{font-size:11px}.workbench-heading h1{font-size:19px}.panel-title{height:66px}.skill-row-top strong{font-size:13.5px}.skill-row-description{font-size:12.5px}.graph-footer{font-size:11px}}
-@media(max-width:760px){.graph-canvas{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}.graph-canvas .graph-svg{width:680px;min-width:680px;height:460px;min-height:0}}
-@media(max-width:760px){.graph-footer .graph-desktop-help{display:none}.graph-footer .graph-mobile-help{display:block;flex-basis:100%}}
-@media(max-width:430px){.stats-row>div{padding-right:7px;margin-right:7px}.stat-number{font-size:14px}.stat-label{font-size:10px}}
-
-/* Keep only visual cues that explain a state or an action. */
-.app-shell{background:#f8fafb}
-.dataset-bar{border-radius:12px;box-shadow:none}
-.primary-button{box-shadow:none}
-.workspace{border-radius:12px;box-shadow:none}
-.panel-title{height:62px;padding:16px 20px}
-.panel-title strong{font-size:16px;letter-spacing:0}
-.read-only{color:#607483;font-weight:600}
-.skill-row-description,.skill-row-bottom{margin-left:0}
-.graph-panel{background:#fff}
-.capability-card{background:transparent;border:0;border-left:2px solid #7db6a6;border-radius:0;padding:1px 0 1px 13px;margin:20px 0 24px}
-.field-label{color:#4e6671}
-.related-list{gap:0}
-.related-list button{border:0;border-bottom:1px solid #e7eef0;border-radius:0;padding:9px 4px}
-.related-list button:hover{border-color:#e7eef0;background:#f7faf9}
-@media(max-width:760px){.panel-title{height:60px}}
-@media(max-width:760px){.dataset-info{flex:1 1 100%}}
-.dataset-info strong{margin:0 0 3px;font-size:16px}.dataset-info p{font-size:12px}.collection-control{display:flex;align-items:center;gap:8px;color:#5b6f7d;font-size:12px;white-space:nowrap}.collection-control select{max-width:220px;min-height:40px;border:1px solid #dce6e9;border-radius:8px;background:#fff;color:#223d4c;padding:0 30px 0 11px;font:inherit;font-weight:650;cursor:pointer}.collection-control select:focus-visible{outline:2px solid #168e72;outline-offset:2px}.dataset-actions{flex:none}.stats-row>div:last-of-type{border-right:0}.stats-row p{font-size:12px}
-@media(max-width:760px){.collection-control{flex:1 1 auto}.collection-control select{width:100%;max-width:none}.dataset-actions{width:auto}.dataset-bar{gap:12px}.stats-row p{display:none}}
-@media(max-width:430px){.collection-control,.dataset-actions{width:100%}.dataset-actions .primary-button{width:100%;justify-content:center}}
-.graph-subtitle{flex-wrap:wrap;line-height:1.45;gap:7px 12px}.graph-subtitle strong{white-space:nowrap}.graph-subtitle span{color:#6d8390}.graph-subtitle .graph-limit{flex-basis:100%}.graph-relation-control{display:flex;align-items:center;gap:5px;color:#617987;font-size:11px}.graph-relation-control select{border:1px solid #dce6e9;border-radius:6px;background:#fff;color:#315467;font-size:11px;padding:4px 6px}.graph-relation-control select:focus-visible{outline:2px solid #168e72;outline-offset:2px}
-.graph-edge.similar_to .edge-line{stroke:#8569aa;stroke-width:2.3;stroke-dasharray:3 5;stroke-linecap:round}.graph-edge.similar_to.is-selected .edge-line,.graph-edge.similar_to:hover .edge-line{stroke:#684397;stroke-width:3}.legend-line.similar{border-color:#8569aa}
-.graph-edge.is-parallel .edge-hit{stroke-width:10}
-.node-hit{fill:transparent;pointer-events:all}.node-halo{fill:#e6f4ef}.node-circle{fill:#88a8b5;stroke:#fff;stroke-width:2}.graph-node.is-active .node-circle{fill:#fff;stroke:#139c7b;stroke-width:2.4}.node-label{paint-order:stroke fill;stroke:#fff;stroke-width:4;stroke-linejoin:round;pointer-events:visiblePainted}
-.node-label{font-size:13px}.graph-svg.is-expanded .graph-edge.is-secondary .edge-line{opacity:.28}.graph-svg.is-expanded .graph-edge.is-secondary:is(:hover,.is-selected,:focus-visible) .edge-line{opacity:1}
-
-.evaluation-section{padding:0 0 18px;border-top:0}.evaluation-section .section-heading{margin-bottom:7px}.evaluation-note{margin:0 0 9px!important}.evaluation-dimensions{border-top:1px solid #e7edef}.evaluation-dimensions details{border-bottom:1px solid #e7edef}.evaluation-dimensions summary{display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;padding:8px 2px;font-size:12px;color:#3c5665;list-style:none}.evaluation-dimensions summary::-webkit-details-marker{display:none}.evaluation-dimensions details p{margin:0 2px 11px!important}.evaluation-level{font-size:11px;font-weight:700;padding:2px 7px;border-radius:5px;background:#e8f5ee;color:#207657}.evaluation-level.average{background:#fff4dd;color:#8b6417}.evaluation-level.poor{background:#fbeae7;color:#a3473a}.evaluation-scan{font-size:11px!important;margin:9px 0 0!important}.profile-source-label{font-size:11px;font-weight:700;color:#547080;padding:0 0 10px}.relation-provenance{display:flex;align-items:center;gap:9px}.relation-provenance>span{font-size:11px;color:#607888}
-.evaluation-filter{display:flex;align-items:center;gap:3px;white-space:nowrap;cursor:pointer;font-size:11px;letter-spacing:0;color:#587383}.evaluation-filter input{accent-color:#168e72;margin:0}.evaluation-filter:has(input:disabled){opacity:.55;cursor:default}.skill-row-bottom .skill-row-markers{display:flex;align-items:center;gap:7px}.skill-row-markers>span:last-child{display:flex;align-items:center;gap:3px}.evaluated-mark{color:#146f5c;background:#e9f6ef;border:1px solid #cbded6;border-radius:0;padding:0 4px;font-weight:650}
-.graph-view-controls{display:flex;align-items:center;gap:8px}.graph-view-controls .graph-tools{flex:none}.relation-list-view{display:flex;flex-direction:column;min-height:450px;max-height:450px;flex:1;padding:12px 14px 0}.relation-search{display:flex;align-items:center;gap:8px;border:1px solid #dfe8ec;background:#f8fafb;border-radius:7px;padding:0 10px;height:37px;color:#6b8694;flex:none}.relation-search input{width:100%;border:0;outline:0;background:transparent;color:#274556;font-size:12px}.relation-list{overflow:auto;margin-top:10px;scrollbar-color:#d3e1e3 transparent}.relation-row{display:flex;flex-direction:column;gap:5px;width:100%;border:0;border-bottom:1px solid #e9eef1;background:#fff;padding:10px 5px;text-align:left}.relation-row:hover,.relation-row.is-active{background:#f3faf7}.relation-row-path{display:flex;align-items:center;gap:7px;color:#2e4a5b;min-width:0}.relation-row-path strong{font-size:12px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.relation-row-path>span{color:#6aa995;flex:none}.relation-row-detail{display:flex;align-items:center;gap:8px;min-width:0;color:#657e8a;font-size:11px}.relation-row-detail>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.relation-row-detail .relation-badge{font-size:10px;flex:none}.relation-list-empty{font-size:12px;color:#6b8290;padding:18px 4px}
-@media(max-width:760px){.graph-view-controls{gap:4px}.graph-view-controls .graph-tools button{padding:5px 7px}.relation-list-view{min-height:360px;max-height:360px}.relation-row-path strong{font-size:11px}}
-
-.dataset-bar{flex-wrap:wrap}
-.dataset-summary{display:flex;align-items:center;gap:14px;margin-left:auto;color:#5b6f7d;font-size:12px;white-space:nowrap}
-.dataset-summary span+span{padding-left:14px;border-left:1px solid #dce6e9}
-.dataset-summary strong{color:#18364b;font-size:14px;font-weight:750}
-.local-library-menu{position:relative;font-size:12px;color:#496474;flex:none}
-.local-library-menu summary{list-style:none;cursor:pointer;padding:10px 12px;border:1px solid #dce6e9;border-radius:8px;background:#fff;font-weight:650;white-space:nowrap}
-.local-library-menu summary::-webkit-details-marker{display:none}
-.local-library-menu>div{position:absolute;z-index:20;top:calc(100% + 5px);left:0;width:min(330px,80vw);padding:9px;background:#fff;border:1px solid #dce6e9;border-radius:9px;box-shadow:0 12px 30px rgba(16,48,69,.14)}
-.local-library-menu label{display:block;padding:6px 9px;color:#536d79;font-size:11px}
-.local-library-menu input{display:block;width:100%;margin-top:5px;padding:8px;border:1px solid #dce6e9;border-radius:6px;color:#223d4c;font:inherit}
-.local-path{margin:4px 9px;padding:7px 0;color:#6b7d89;font-size:11px;line-height:1.4;overflow-wrap:anywhere;border-bottom:1px solid #e7edef}
-.local-library-menu button{display:block;width:100%;padding:9px 10px;border:0;background:#fff;text-align:left;color:#314c5c;font:inherit;cursor:pointer;white-space:nowrap}
-.local-library-menu button:hover{background:#eef7f4;color:#087b61}
-.stale-banner{margin-top:10px;padding:10px 14px;border:1px solid #ead7a4;border-radius:9px;background:#fff9e9;color:#765c18;font-size:12px}
-@media(max-width:760px){.dataset-summary{margin-left:0}.dataset-actions{margin-left:auto}}
-@media(max-width:430px){.dataset-summary{order:3;width:100%;justify-content:flex-end}.dataset-actions{margin-left:0}}
-
-.onboarding{max-width:940px;margin:28px auto 52px;padding:30px 34px;background:#fff;border:1px solid #e3ebef;border-radius:12px}
-.onboarding-intro>span{font-size:11px;font-weight:750;letter-spacing:.08em;color:#16866d}
-.onboarding-intro h1{margin:9px 0 8px;font-size:27px;letter-spacing:-.03em;color:#19394a}
-.onboarding-intro p,.onboarding-choice p,.onboarding-next p{margin:0;color:#5b7280;font-size:13px;line-height:1.65}
-.onboarding-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:26px}
-.onboarding-choice{display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-width:0;padding:23px;border:1px solid #e1e9ed;border-radius:9px;background:#fcfdfd}
-.onboarding-choice h2,.onboarding-connected h2,.onboarding-next h2{margin:0;color:#284757;font-size:16px}
-.onboarding-choice p{flex:1}
-.onboarding-choice code,.onboarding-next code,.onboarding-empty-path code{font-family:"Cascadia Code",Consolas,monospace;font-size:12px;overflow-wrap:anywhere}
-.onboarding-choice label{display:block;width:100%;color:#526d7a;font-size:12px}
-.onboarding-choice input{display:block;width:100%;margin-top:7px;padding:10px 11px;border:1px solid #dce6e9;border-radius:7px;color:#274354;font:inherit}
-.onboarding-secondary{min-height:42px;padding:9px 15px;border:1px solid #b9d9cf;border-radius:8px;background:#fff;color:#0d765f;font-size:13px;font-weight:700;cursor:pointer}
-.onboarding-secondary:hover{background:#f0f8f5}
-.onboarding button:disabled{opacity:.55;cursor:wait}
-.onboarding-example{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:25px;padding-top:18px;border-top:1px solid #e7edef;color:#687f8b;font-size:12px;line-height:1.5}
-.onboarding-example button{display:inline-flex;align-items:center;gap:5px;flex:none;border:0;background:transparent;color:#087b61;font-size:12px;font-weight:700;cursor:pointer}
-.onboarding-connected{margin-top:24px}
-.onboarding-connected h2{margin-bottom:9px}
-.onboarding-connected button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:12px 14px;border:1px solid #e1e9ed;border-radius:7px;background:#fff;color:#284757;text-align:left;font-size:13px;font-weight:700;cursor:pointer}
-.onboarding-connected button+button{margin-top:7px}
-.onboarding-connected button:hover{border-color:#a7d0c3;background:#f8fcfa}
-.onboarding-connected small{display:block;margin-top:3px;color:#718894;font-size:11px;font-weight:400;overflow-wrap:anywhere}
-.onboarding-empty-path{display:flex;flex-direction:column;gap:7px;margin:23px 0;padding:15px 18px;border:1px solid #dceae5;border-radius:8px;background:#f6faf8}
-.onboarding-empty-path strong{font-size:11px;color:#5a786e}
-.onboarding-empty-path code{color:#244a40}
-.onboarding-next h2{margin-bottom:9px}
-.onboarding-next>code{display:block;margin:12px 0;padding:12px;background:#f6f8f9;border:1px solid #e5ecee;border-radius:6px;color:#345365}
-.onboarding-next .primary-button{margin-top:17px}
-@media(max-width:760px){.onboarding{margin:16px 0 36px;padding:22px 19px}.onboarding-grid{grid-template-columns:1fr;gap:10px}.onboarding-intro h1{font-size:23px}.onboarding-choice{padding:17px}.onboarding-example{align-items:flex-start;flex-direction:column}}
-
-/* Give action controls a sharper shape while keeping cards and fields soft. */
-.primary-button,.onboarding-secondary,.onboarding-connected button,.local-library-menu summary,.graph-tools,.graph-tools button{border-radius:0}
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
deleted file mode 100644
index aaeae98..0000000
--- a/frontend/vite.config.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
-import { localLibraryApi } from './scripts/local_api.mjs'
-
-export default defineConfig({
- plugins: [react(), localLibraryApi()],
- server: { host: '127.0.0.1', port: 5173, strictPort: true },
- preview: { host: '127.0.0.1', port: 4173, strictPort: true },
-})
diff --git a/skillnet-ai/MANIFEST.in b/skillnet-ai/MANIFEST.in
new file mode 100644
index 0000000..412deac
--- /dev/null
+++ b/skillnet-ai/MANIFEST.in
@@ -0,0 +1,10 @@
+recursive-include src/skillnet_ai/web/static *
+include src/skillnet_ai/web/ui/package.json
+include src/skillnet_ai/web/ui/package-lock.json
+include src/skillnet_ai/web/ui/tsconfig.json
+include src/skillnet_ai/web/ui/vite.config.ts
+include src/skillnet_ai/web/ui/index.html
+include src/skillnet_ai/web/ui/README.md
+include src/skillnet_ai/web/ui/.prettierrc.json
+recursive-include src/skillnet_ai/web/ui/src *.ts *.tsx *.css
+recursive-include src/skillnet_ai/web/ui/public *.png
diff --git a/skillnet-ai/README.md b/skillnet-ai/README.md
index 778e114..2614f06 100644
--- a/skillnet-ai/README.md
+++ b/skillnet-ai/README.md
@@ -602,3 +602,16 @@ real skills and your configured providers.
SkillNet is licensed under [MIT](https://github.com/zjunlp/SkillNet/blob/main/LICENSE).
Skills from external repositories retain their own licenses.
+
+## Browser interface
+
+Install `pip install "skillnet-ai[ui]"` and run `skillnet ui` to browse local skill
+folders and saved analysis results. Use `--skills-dir /absolute/path/to/skills`
+to open a folder immediately, or `--no-browser` to start without opening a tab.
+The service listens only on loopback and makes no model calls.
+
+The implementation lives in `src/skillnet_ai/web/`: Python serves local data and
+compiled assets, while `web/ui/` contains the React source. See the
+[interface guide](src/skillnet_ai/web/ui/README.md) for source development, data
+limits and building the website before packaging. Wheel and source releases
+include compiled assets; end users do not need Node.js.
diff --git a/skillnet-ai/pyproject.toml b/skillnet-ai/pyproject.toml
index a92810e..e46e8c8 100644
--- a/skillnet-ai/pyproject.toml
+++ b/skillnet-ai/pyproject.toml
@@ -34,6 +34,7 @@ dependencies = [
]
[project.optional-dependencies]
+ui = ["fastapi>=0.115,<1", "uvicorn>=0.30,<1"]
claude = [
"claude-agent-sdk>=0.2.110,<0.3",
]
@@ -51,8 +52,15 @@ dev = ["pytest>=8,<10", "ruff>=0.12,<1", "mypy>=1.15,<3", "build>=1.2,<2",
[project.scripts]
skillnet = "skillnet_ai.interfaces.cli:app"
+[tool.setuptools]
+include-package-data = false
+
[tool.setuptools.packages.find]
where = ["src"]
+namespaces = false
+
+[tool.setuptools.package-data]
+"skillnet_ai.web" = ["static/**/*", "static/*"]
[tool.ruff]
line-length = 100
@@ -67,7 +75,8 @@ extend-immutable-calls = ["typer.Option", "typer.Argument"]
[tool.mypy]
python_version = "3.10"
files = ["src/skillnet_ai/core/models.py", "src/skillnet_ai/analyzer.py",
- "src/skillnet_ai/core/llm.py", "src/skillnet_ai/router"]
+ "src/skillnet_ai/core/llm.py", "src/skillnet_ai/core/library.py",
+ "src/skillnet_ai/router", "src/skillnet_ai/web"]
check_untyped_defs = true
disallow_untyped_defs = true
warn_unused_ignores = true
diff --git a/skillnet-ai/setup.py b/skillnet-ai/setup.py
new file mode 100644
index 0000000..322b0ba
--- /dev/null
+++ b/skillnet-ai/setup.py
@@ -0,0 +1,32 @@
+"""Require the prebuilt website when producing a distributable Python package."""
+
+from pathlib import Path
+
+from setuptools import setup
+from setuptools.command.build_py import build_py
+from setuptools.command.sdist import sdist
+
+
+def require_website():
+ assets = Path(__file__).parent / "src" / "skillnet_ai" / "web" / "static"
+ if not (assets / "index.html").is_file():
+ raise RuntimeError(
+ "Web assets are missing. Run npm ci and npm run build in "
+ "src/skillnet_ai/web/ui before building the Python package."
+ )
+
+
+class BuildWithWebsite(build_py):
+ def run(self):
+ if not self.editable_mode:
+ require_website()
+ super().run()
+
+
+class SourceWithWebsite(sdist):
+ def run(self):
+ require_website()
+ super().run()
+
+
+setup(cmdclass={"build_py": BuildWithWebsite, "sdist": SourceWithWebsite})
diff --git a/skillnet-ai/src/skillnet_ai/analyzer.py b/skillnet-ai/src/skillnet_ai/analyzer.py
index 22f7726..46a0e34 100644
--- a/skillnet-ai/src/skillnet_ai/analyzer.py
+++ b/skillnet-ai/src/skillnet_ai/analyzer.py
@@ -1,6 +1,5 @@
"""Scenario analysis: source profiles, candidate pairs and two-type skill relations."""
-import hashlib
import json
import logging
import re
@@ -17,6 +16,7 @@ from typing import Any
import numpy as np
+from skillnet_ai.core.library import read_source
from skillnet_ai.core.llm import embed, structured_call
from skillnet_ai.core.models import (
AnalysisOptions,
@@ -35,7 +35,7 @@ from skillnet_ai.core.prompts import (
RELATION_PROMPT,
RELATION_VERSION,
)
-from skillnet_ai.core.validation import parse_frontmatter, validate_citations, validate_profile
+from skillnet_ai.core.validation import validate_citations, validate_profile
from skillnet_ai.router.index import (
Matrix,
build_bm25,
@@ -212,22 +212,7 @@ def read_skills(root: Path) -> list[SkillSource]:
for path in sorted(root.glob("*/SKILL.md")):
if path.parent.name.startswith("."):
continue
- source = path.read_text(encoding="utf-8-sig")
- if not source.strip():
- raise ValueError(f"Empty skill source: {path}")
- metadata = parse_frontmatter(source)
- name = metadata.get("name") or path.parent.name
- if not isinstance(name, str):
- raise ValueError(f"Skill name must be a string: {path}")
- skills.append(
- SkillSource(
- skill_id=path.parent.name,
- name=name,
- path=str(path.parent.resolve()),
- source=source,
- content_hash=hashlib.sha256(source.encode()).hexdigest(),
- )
- )
+ skills.append(read_source(path))
if not skills:
raise ValueError("No SKILL.md files found in direct child directories.")
return skills
diff --git a/skillnet-ai/src/skillnet_ai/core/library.py b/skillnet-ai/src/skillnet_ai/core/library.py
new file mode 100644
index 0000000..97154b3
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/core/library.py
@@ -0,0 +1,68 @@
+"""Read skill sources and published snapshots without model or vector dependencies."""
+
+import hashlib
+from pathlib import Path
+
+from skillnet_ai.core.models import GraphSnapshot, SkillSource
+from skillnet_ai.core.validation import parse_frontmatter, validate_citations, validate_profile
+
+
+def read_source(path: Path, *, max_bytes: int | None = None) -> SkillSource:
+ """Read one SKILL.md using the same identity and normalization as analysis."""
+ with path.open("rb") as stream:
+ raw = stream.read() if max_bytes is None else stream.read(max_bytes + 1)
+ if max_bytes is not None and len(raw) > max_bytes:
+ raise ValueError(f"Skill source exceeds the size limit: {path}")
+ source = raw.decode("utf-8-sig").replace("\r\n", "\n").replace("\r", "\n")
+ if not source.strip():
+ raise ValueError(f"Empty skill source: {path}")
+ metadata = parse_frontmatter(source)
+ name = metadata.get("name") or path.parent.name
+ if not isinstance(name, str):
+ raise ValueError(f"Skill name must be a string: {path}")
+ return SkillSource(
+ skill_id=path.parent.name,
+ name=name,
+ path=str(path.parent.resolve()),
+ source=source,
+ content_hash=hashlib.sha256(source.encode()).hexdigest(),
+ )
+
+
+def load_snapshot(index_dir: Path, *, max_bytes: int | None = None) -> tuple[Path, GraphSnapshot]:
+ """Resolve CURRENT once and read a complete snapshot; never fall back silently."""
+ try:
+ with (index_dir / "CURRENT").open(encoding="utf-8") as stream:
+ name = stream.read(256).strip()
+ if not name or Path(name).name != name or not name.startswith("snapshot-"):
+ raise ValueError("invalid snapshot pointer")
+ root = index_dir / name
+ with (root / "graph.json").open("rb") as stream:
+ raw = stream.read() if max_bytes is None else stream.read(max_bytes + 1)
+ if max_bytes is not None and len(raw) > max_bytes:
+ raise ValueError("Analysis snapshot exceeds the size limit.")
+ graph = GraphSnapshot.model_validate_json(raw)
+ except (OSError, ValueError) as exc:
+ raise ValueError("Cannot load analysis snapshot; run skillnet analyze again.") from exc
+ ids = [skill.skill_id for skill in graph.skills]
+ known_ids = set(ids)
+ if not ids or len(known_ids) != len(ids):
+ raise ValueError("Analysis must contain unique, nonempty skill identities.")
+ if any(
+ edge.source not in known_ids or edge.target not in known_ids for edge in graph.relations
+ ):
+ raise ValueError("Analysis relation references an unknown skill.")
+ return root, graph
+
+
+def validate_snapshot_evidence(graph: GraphSnapshot) -> None:
+ """Validate displayed citations against the snapshot's own source files."""
+ sources = {skill.skill_id: skill.source for skill in graph.skills}
+ for skill in graph.skills:
+ validate_profile(skill.profile, skill.source)
+ for edge in graph.relations:
+ if edge.source == edge.target:
+ raise ValueError("A relationship must connect two different skills.")
+ for context in edge.contexts:
+ validate_citations(context.source_evidence, sources[edge.source])
+ validate_citations(context.target_evidence, sources[edge.target])
diff --git a/skillnet-ai/src/skillnet_ai/interfaces/cli.py b/skillnet-ai/src/skillnet_ai/interfaces/cli.py
index 0b71416..7c5196b 100644
--- a/skillnet-ai/src/skillnet_ai/interfaces/cli.py
+++ b/skillnet-ai/src/skillnet_ai/interfaces/cli.py
@@ -26,6 +26,29 @@ app = typer.Typer(help="SkillNet AI CLI Tool", no_args_is_help=True)
console = Console()
+def ui(
+ skills_dir: Path | None = typer.Option(
+ None, "--skills-dir", help="Open a local skills folder."
+ ),
+ port: int = typer.Option(8765, min=1, max=65535),
+ browser: bool = typer.Option(True, "--browser/--no-browser"),
+ dev: bool = typer.Option(False, help="Allow the Vite development UI on localhost:5173."),
+):
+ """Browse local skills and analysis results in your browser; no model calls."""
+ try:
+ from skillnet_ai.web.server import serve
+ except ModuleNotFoundError as exc:
+ if exc.name not in {"fastapi", "starlette", "uvicorn"}:
+ raise
+ console.print('Install the web extra: pip install "skillnet-ai[ui]"', markup=False)
+ raise typer.Exit(1) from exc
+ try:
+ serve(skills_dir=skills_dir, port=port, open_browser=browser, dev=dev)
+ except (OSError, ValueError) as exc:
+ _fail(exc, False)
+
+
class RedactedFormatter(logging.Formatter):
def format(self, record):
return redact(super().format(record))
diff --git a/skillnet-ai/src/skillnet_ai/router/index.py b/skillnet-ai/src/skillnet_ai/router/index.py
index 5fe117a..6a80e86 100644
--- a/skillnet-ai/src/skillnet_ai/router/index.py
+++ b/skillnet-ai/src/skillnet_ai/router/index.py
@@ -14,7 +14,8 @@ from pathlib import Path
import numpy as np
from numpy.typing import NDArray
-from skillnet_ai.core.models import AnalyzedSkill, GraphSnapshot
+from skillnet_ai.core.library import load_snapshot as load_snapshot
+from skillnet_ai.core.models import AnalyzedSkill
Matrix = NDArray[np.float32]
@@ -34,28 +35,6 @@ def publish(index_dir: Path, staging: Path) -> None:
pointer.unlink(missing_ok=True)
-def load_snapshot(index_dir: Path) -> tuple[Path, GraphSnapshot]:
- """Load the published snapshot once; do not inspect or hash live skill sources."""
-
- try:
- name = (index_dir / "CURRENT").read_text(encoding="utf-8").strip()
- if not name or Path(name).name != name or not name.startswith("snapshot-"):
- raise ValueError("invalid snapshot pointer")
- root = index_dir / name
- graph = GraphSnapshot.model_validate_json((root / "graph.json").read_text("utf-8"))
- except (OSError, ValueError) as exc:
- raise ValueError("Cannot load analysis snapshot; run skillnet analyze again.") from exc
- ids = [skill.skill_id for skill in graph.skills]
- known_ids = set(ids)
- if not ids or len(known_ids) != len(ids):
- raise ValueError("Analysis must contain unique, nonempty skill identities.")
- if any(
- edge.source not in known_ids or edge.target not in known_ids for edge in graph.relations
- ):
- raise ValueError("Analysis relation references an unknown skill.")
- return root, graph
-
-
def profile_text(skill: AnalyzedSkill) -> str:
"""Index capability and operational conditions without JSON or citation noise."""
diff --git a/skillnet-ai/src/skillnet_ai/web/.gitignore b/skillnet-ai/src/skillnet_ai/web/.gitignore
new file mode 100644
index 0000000..b6edfe9
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/.gitignore
@@ -0,0 +1 @@
+/static/
diff --git a/skillnet-ai/src/skillnet_ai/web/__init__.py b/skillnet-ai/src/skillnet_ai/web/__init__.py
new file mode 100644
index 0000000..e42b8e0
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/__init__.py
@@ -0,0 +1 @@
+"""SkillNet's optional browser interface. Start it with ``skillnet ui``."""
diff --git a/skillnet-ai/src/skillnet_ai/web/library.py b/skillnet-ai/src/skillnet_ai/web/library.py
new file mode 100644
index 0000000..d954373
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/library.py
@@ -0,0 +1,91 @@
+"""Local library browsing. Reading a library never analyzes or executes skills."""
+
+from pathlib import Path
+from typing import Any
+
+from skillnet_ai.core.library import load_snapshot, read_source, validate_snapshot_evidence
+from skillnet_ai.core.validation import parse_frontmatter
+
+MAX_BYTES = 20 * 1024 * 1024
+MAX_SKILLS = 5000
+MAX_RELATIONS = 20000
+
+
+def absolute_directory(value: str) -> Path:
+ path = Path(value).expanduser()
+ if not path.is_absolute():
+ raise ValueError("Enter an absolute folder path.")
+ path = path.resolve(strict=True)
+ if not path.is_dir():
+ raise ValueError("The selected path is not a directory.")
+ return path
+
+
+def read_library(source_path: str, index_path: str | None = None) -> dict[str, Any]:
+ root = absolute_directory(source_path)
+ paths = sorted(p for p in root.glob("*/SKILL.md") if not p.parent.name.startswith("."))
+ if len(paths) > MAX_SKILLS:
+ raise ValueError("A library can contain at most 5,000 skills.")
+ skills = []
+ warnings = []
+ remaining = MAX_BYTES
+ for path in paths:
+ try:
+ size = path.stat().st_size
+ except OSError as exc:
+ warnings.append(f"{path.parent.name}: {exc}")
+ continue
+ if size > remaining:
+ raise ValueError("Skill sources exceed 20 MB. Choose a smaller library.")
+ remaining -= size
+ try:
+ skill = read_source(path, max_bytes=size)
+ metadata = parse_frontmatter(skill.source)
+ description = metadata.get("description", "")
+ skills.append(
+ {
+ "id": skill.skill_id,
+ "name": skill.name,
+ "description": description if isinstance(description, str) else "",
+ "source": skill.source,
+ "path": str(path),
+ }
+ )
+ except (OSError, ValueError) as exc:
+ warnings.append(f"{path.parent.name}: {exc}")
+ result: dict[str, Any] = {
+ "name": root.name,
+ "sourcePath": str(root),
+ "source": {"kind": "source", "title": root.name, "skills": skills, "relations": []},
+ "graph": None,
+ "analysisStatus": "missing",
+ "analysisError": None,
+ "warnings": warnings,
+ "changedSkills": 0,
+ "removedSkills": 0,
+ "addedSkills": 0,
+ }
+ try:
+ index = absolute_directory(index_path) if index_path else root / ".skillnet"
+ if not index_path and not (index / "CURRENT").exists():
+ return result
+ _, graph = load_snapshot(index, max_bytes=MAX_BYTES)
+ if len(graph.skills) > MAX_SKILLS or len(graph.relations) > MAX_RELATIONS:
+ raise ValueError("Analysis exceeds 5,000 skills or 20,000 relationships.")
+ validate_snapshot_evidence(graph)
+ current = {skill["id"]: skill["source"] for skill in skills}
+ analyzed = {skill.skill_id: skill.source for skill in graph.skills}
+ if current and not current.keys() & analyzed.keys():
+ raise ValueError("The analysis folder and skill library have no skills in common.")
+ result.update(
+ graph=graph.model_dump(),
+ analysisStatus="ready",
+ changedSkills=sum(
+ current[key] != analyzed[key] for key in current.keys() & analyzed.keys()
+ ),
+ removedSkills=len(analyzed.keys() - current.keys()),
+ addedSkills=len(current.keys() - analyzed.keys()),
+ )
+ except (OSError, ValueError) as exc:
+ result.update(analysisStatus="error", analysisError=str(exc))
+ return result
diff --git a/skillnet-ai/src/skillnet_ai/web/server.py b/skillnet-ai/src/skillnet_ai/web/server.py
new file mode 100644
index 0000000..4bfb213
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/server.py
@@ -0,0 +1,121 @@
+"""Loopback-only HTTP service for the optional SkillNet browser interface."""
+
+import asyncio
+import json
+import threading
+import webbrowser
+from collections.abc import AsyncIterator, Awaitable, Callable
+from contextlib import asynccontextmanager
+from pathlib import Path
+from typing import Any, Literal
+from urllib.parse import urlsplit
+
+import uvicorn
+from fastapi import FastAPI, HTTPException, Request
+from fastapi.responses import JSONResponse, Response
+from fastapi.staticfiles import StaticFiles
+from pydantic import BaseModel, ConfigDict, Field
+from starlette.concurrency import run_in_threadpool
+
+from skillnet_ai.web.library import absolute_directory, read_library
+
+
+class LibraryRequest(BaseModel):
+ model_config = ConfigDict(extra="forbid", strict=True)
+
+ action: Literal["read", "create-default"] = "read"
+ sourcePath: str | None = Field(default=None, max_length=2048)
+ indexPath: str | None = Field(default=None, max_length=2048)
+
+
+def create_app(
+ *,
+ skills_dir: Path | None = None,
+ static_dir: Path | None = None,
+ dev: bool = False,
+ browser_url: str | None = None,
+) -> FastAPI:
+ """Create the app without starting a server, creating folders or opening a browser."""
+ initial_path = str(absolute_directory(str(skills_dir))) if skills_dir else None
+ assets = static_dir or Path(__file__).parent / "static"
+ if not dev and not (assets / "index.html").is_file():
+ raise ValueError("Web assets are missing. Build web/ui with npm run build before starting.")
+
+ @asynccontextmanager
+ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
+ timer = None
+ if browser_url:
+ timer = threading.Timer(0.5, webbrowser.open, args=(browser_url,))
+ timer.daemon = True
+ timer.start()
+ yield
+ if timer:
+ timer.cancel()
+
+ app = FastAPI(lifespan=lifespan, docs_url=None, redoc_url=None, openapi_url=None)
+ # Bound concurrent disk scans without blocking the event loop.
+ reads = asyncio.Semaphore(2)
+
+ @app.middleware("http")
+ async def local_requests(
+ request: Request, call_next: Callable[[Request], Awaitable[Response]]
+ ) -> Response:
+ host = request.headers.get("host", "")
+ try:
+ local = urlsplit(f"http://{host}").hostname in {"127.0.0.1", "localhost"}
+ except ValueError:
+ local = False
+ if not local:
+ return JSONResponse({"error": "Only loopback hosts are allowed."}, status_code=403)
+ if request.url.path.startswith("/api/") and request.method != "GET":
+ origins = {f"http://{host}"}
+ if dev:
+ origins.update({"http://127.0.0.1:5173", "http://localhost:5173"})
+ if request.headers.get("origin") not in origins:
+ return JSONResponse(
+ {"error": "A same-origin request is required."}, status_code=403
+ )
+ response = await call_next(request)
+ response.headers["X-Content-Type-Options"] = "nosniff"
+ if request.url.path.startswith("/api/"):
+ response.headers["Cache-Control"] = "no-store"
+ return response
+
+ @app.get("/api/config")
+ def config() -> dict[str, str | None]:
+ return {"sourcePath": initial_path}
+
+ @app.post("/api/local-library")
+ async def library(request: Request) -> Any:
+ if request.headers.get("content-type", "").split(";")[0] != "application/json":
+ raise HTTPException(415, "Expected application/json.")
+ body = bytearray()
+ async for chunk in request.stream():
+ body.extend(chunk)
+ if len(body) > 8192:
+ raise HTTPException(413, "Request body exceeds 8 KB.")
+ try:
+ value = LibraryRequest.model_validate(json.loads(body))
+ except ValueError:
+ return JSONResponse({"error": "Invalid local library request."}, status_code=400)
+ try:
+ if value.action == "create-default":
+ path = Path.home() / ".skillnet" / "skills"
+ await run_in_threadpool(path.mkdir, parents=True, exist_ok=True)
+ return {"sourcePath": str(path.resolve())}
+ if not value.sourcePath:
+ raise ValueError("Enter a skills folder path.")
+ async with reads:
+ return await run_in_threadpool(read_library, value.sourcePath, value.indexPath)
+ except (OSError, ValueError) as exc:
+ return JSONResponse({"error": str(exc)}, status_code=400)
+
+ if (assets / "index.html").is_file():
+ app.mount("/", StaticFiles(directory=assets, html=True), name="ui")
+ return app
+
+
+def serve(*, skills_dir: Path | None, port: int, open_browser: bool, dev: bool) -> None:
+ url = f"http://127.0.0.1:{5173 if dev else port}"
+ app = create_app(skills_dir=skills_dir, dev=dev, browser_url=url if open_browser else None)
+ uvicorn.run(app, host="127.0.0.1", port=port)
diff --git a/frontend/.gitignore b/skillnet-ai/src/skillnet_ai/web/ui/.gitignore
similarity index 100%
rename from frontend/.gitignore
rename to skillnet-ai/src/skillnet_ai/web/ui/.gitignore
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/.prettierrc.json b/skillnet-ai/src/skillnet_ai/web/ui/.prettierrc.json
new file mode 100644
index 0000000..2034969
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/.prettierrc.json
@@ -0,0 +1 @@
+{"singleQuote": true, "semi": false, "printWidth": 100}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/README.md b/skillnet-ai/src/skillnet_ai/web/ui/README.md
new file mode 100644
index 0000000..27d2cd0
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/README.md
@@ -0,0 +1,92 @@
+# SkillNet browser interface
+
+Browse local skills, their source files, and saved analysis results. The interface
+uses the SDK's `compose_with` and `similar_to` relationships. It never runs a model,
+evaluates a skill, or executes skill scripts.
+
+## Use an installed release
+
+```bash
+pip install "skillnet-ai[ui]"
+skillnet ui
+skillnet ui --skills-dir "/absolute/path/to/skills"
+```
+
+The service listens on `127.0.0.1:8765` and opens your browser. Use `--no-browser`
+to suppress opening a tab, or `--port` to change the port. Stop it with Ctrl+C.
+No Node.js, database, model key, or repository checkout is needed to browse.
+
+Select a library, then choose **Current skill files** or an available analysis
+snapshot in **View**. The graph shows up to 10 neighbors at one hop or 16 at two
+hops; **List** searches all relationships in the selected dataset. A two-hop
+neighborhood is not an execution plan.
+
+A skills folder directly contains one folder per skill, each with `SKILL.md`.
+Opening the interface does not create folders. **Create my skill library** creates
+`~/.skillnet/skills` only when clicked. **Refresh folder** rereads the files.
+Removing a connection only removes its browser record.
+
+Generate analysis separately, using the same installed SDK:
+
+```bash
+pip install "skillnet-ai[graph]"
+skillnet download "<GitHub skill folder URL>" --target-dir "<skills folder>"
+skillnet create --prompt "..." --output-dir "<skills folder>"
+skillnet analyze "<skills folder>"
+```
+
+Create and analyze require model configuration; see the SDK README. The interface
+reads `.skillnet/CURRENT`, or a custom analysis output directory. Analysis errors
+leave current source browsing available. Changed, removed, and newly added skills
+are reported; evidence always points to the source saved at analysis time.
+
+## Saved data and limits
+
+- Local imports accept complete SDK `GraphSnapshot v1` files. Parsing happens in
+ the browser, without upload. Imported snapshots and directory connections are
+ saved in IndexedDB; the last library, content, and selected skill are saved in
+ localStorage. Storage is specific to the browser and host/port.
+- Limits: 20 MB per import or source library, 5,000 skills, 20,000 relationships.
+ The skill list shows the first 200 matches; search narrows the list.
+## Develop and build
+
+From `skillnet-ai/`, install the Python source and optional web dependencies:
+
+```bash
+python -m pip install -e ".[ui]"
+```
+
+From this `web/ui/` directory, using Node.js 20 or 22+:
+
+```bash
+npm ci
+npm run build
+skillnet ui
+```
+
+`npm run build` type-checks the source and writes the website to `../static/`.
+For live development, use two terminals:
+
+```bash
+skillnet ui --dev --no-browser
+npm run dev
+```
+
+Vite runs at `127.0.0.1:5173` and proxies `/api` to the Python service on port 8765.
+The file APIs have one Python implementation; Vite does not read skill folders.
+Use `npm run format:check` to check TypeScript/CSS formatting.
+
+## Release
+
+Build the UI before building the Python package. From `skillnet-ai/`:
+
+```bash
+python -m build
+```
+
+The wheel includes Python modules and `web/static/`, not React development
+sources or `node_modules`. The source distribution includes the UI sources and
+prebuilt website, so installing an sdist does not require Node. Build output is
+ignored by Git; package builds fail explicitly when the website has not been built.
+The SDK and website share the Python distribution version. No example libraries,
+saved evaluation reports, or research datasets are shipped with the website.
diff --git a/frontend/index.html b/skillnet-ai/src/skillnet_ai/web/ui/index.html
similarity index 75%
rename from frontend/index.html
rename to skillnet-ai/src/skillnet_ai/web/ui/index.html
index 17b2bb5..00a4130 100644
--- a/frontend/index.html
+++ b/skillnet-ai/src/skillnet_ai/web/ui/index.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#f7f9fb" />
- <meta name="description" content="Explore SkillNet skills, source references, and analyzed relationships." />
+ <meta name="description" content="Explore local SkillNet skills, source files, and analyzed relationships." />
<title>SkillNet</title>
</head>
<body>
diff --git a/frontend/package-lock.json b/skillnet-ai/src/skillnet_ai/web/ui/package-lock.json
similarity index 99%
rename from frontend/package-lock.json
rename to skillnet-ai/src/skillnet_ai/web/ui/package-lock.json
index a89b4ba..7532fd5 100644
--- a/frontend/package-lock.json
+++ b/skillnet-ai/src/skillnet_ai/web/ui/package-lock.json
@@ -1,11 +1,11 @@
{
- "name": "skillnet-workbench",
+ "name": "skillnet-ui",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "skillnet-workbench",
+ "name": "skillnet-ui",
"version": "0.1.0",
"dependencies": {
"lucide-react": "^0.468.0",
@@ -16,6 +16,7 @@
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.3.4",
+ "prettier": "^3.6.2",
"typescript": "^5.7.3",
"vite": "^6.0.5"
}
@@ -1600,6 +1601,22 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/prettier": {
+ "version": "3.9.9",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.9.tgz",
+ "integrity": "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
"node_modules/react": {
"version": "19.3.0",
"resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz",
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/package.json b/skillnet-ai/src/skillnet_ai/web/ui/package.json
new file mode 100644
index 0000000..b2092a7
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "skillnet-ui",
+ "private": true,
+ "version": "0.1.0",
+ "type": "module",
+ "scripts": {
+ "dev": "vite",
+ "build": "tsc --noEmit && vite build",
+ "format": "prettier --write src vite.config.ts",
+ "format:check": "prettier --check src vite.config.ts"
+ },
+ "dependencies": {
+ "lucide-react": "^0.468.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
+ },
+ "devDependencies": {
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@vitejs/plugin-react": "^4.3.4",
+ "typescript": "^5.7.3",
+ "vite": "^6.0.5",
+ "prettier": "^3.6.2"
+ }
+}
diff --git a/frontend/public/skillnet.png b/skillnet-ai/src/skillnet_ai/web/ui/public/skillnet.png
similarity index 100%
rename from frontend/public/skillnet.png
rename to skillnet-ai/src/skillnet_ai/web/ui/public/skillnet.png
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/App.tsx b/skillnet-ai/src/skillnet_ai/web/ui/src/App.tsx
new file mode 100644
index 0000000..30981b5
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/App.tsx
@@ -0,0 +1,802 @@
+import { useEffect, useMemo, useRef, useState } from 'react'
+import { ArrowRight, CircleHelp, GitBranch, Search, Upload, X } from 'lucide-react'
+import { relationLabel, skillShortName } from './data'
+import { SkillInspector, RelationInspector } from './Inspectors'
+import { useWorkspace } from './useWorkspace'
+import { GraphView } from './GraphView'
+import './styles.css'
+
+function compactNumber(value: number) {
+ return new Intl.NumberFormat('en-US').format(value)
+}
+
+export default function App() {
+ const {
+ dataset,
+ importedDatasets,
+ localLibraries,
+ localData,
+ sourceId,
+ collection,
+ selectedSkillId,
+ setSelectedSkillId,
+ error,
+ setError,
+ loading,
+ restoring,
+ openLocalLibrary,
+ connectLocalLibrary,
+ createPersonalLibrary,
+ updateIndex,
+ forgetLocalLibrary,
+ importFile,
+ removeImport,
+ changeLibrary,
+ changeContent,
+ } = useWorkspace()
+ const [sourcePathInput, setSourcePathInput] = useState('')
+ const [indexPathInput, setIndexPathInput] = useState('')
+ const [selectedRelationId, setSelectedRelationId] = useState<string | null>(null)
+ const [focusedLine, setFocusedLine] = useState<number | null>(null)
+ const [query, setQuery] = useState('')
+ const [depth, setDepth] = useState<1 | 2>(1)
+ const [viewMode, setViewMode] = useState<'graph' | 'list'>('graph')
+ const [relationQuery, setRelationQuery] = useState('')
+ const [relationType, setRelationType] = useState<'all' | 'compose_with' | 'similar_to'>('all')
+ const fileInput = useRef<HTMLInputElement>(null)
+ const skillList = useRef<HTMLDivElement>(null)
+ const graphCanvas = useRef<HTMLDivElement>(null)
+
+ useEffect(() => {
+ setSelectedRelationId(null)
+ setFocusedLine(null)
+ setQuery('')
+ setRelationQuery('')
+ setRelationType('all')
+ setDepth(1)
+ setSourcePathInput('')
+ setIndexPathInput('')
+ }, [dataset, collection, sourceId])
+
+ const addLocalLibrary = () => void connectLocalLibrary(sourcePathInput)
+ const setLocalIndex = () => {
+ if (!indexPathInput.trim()) {
+ setError('Enter an analysis folder path.')
+ return
+ }
+ void updateIndex(indexPathInput.trim())
+ }
+ const useDefaultIndex = () => void updateIndex()
+ const graphDataset = useMemo(
+ () =>
+ dataset.kind === 'snapshot' && relationType !== 'all'
+ ? {
+ ...dataset,
+ relations: dataset.relations.filter((relation) => relation.type === relationType),
+ }
+ : dataset,
+ [dataset, relationType],
+ )
+ const relationRows = useMemo(() => {
+ const needle = relationQuery.trim().toLocaleLowerCase()
+ if (!needle) return graphDataset.relations
+ const byId = new Map(dataset.skills.map((skill) => [skill.id, skill]))
+ return graphDataset.relations.filter((relation) => {
+ const source = byId.get(relation.source)
+ const target = byId.get(relation.target)
+ return [
+ relation.source,
+ relation.target,
+ source?.name,
+ target?.name,
+ ...relation.contexts.flatMap((context) => [context.scenario, context.explanation]),
+ ].some((value) => value?.toLocaleLowerCase().includes(needle))
+ })
+ }, [graphDataset, dataset.skills, relationQuery])
+ const analysisCounts = useMemo(
+ () => ({
+ compose: dataset.relations.filter((relation) => relation.type === 'compose_with').length,
+ similar: dataset.relations.filter((relation) => relation.type === 'similar_to').length,
+ }),
+ [dataset],
+ )
+ const selectedSkill = useMemo(
+ () => dataset.skills.find((skill) => skill.id === selectedSkillId) ?? dataset.skills[0],
+ [dataset, selectedSkillId],
+ )
+ const selectedRelation = useMemo(
+ () => dataset.relations.find((relation) => relation.id === selectedRelationId) ?? null,
+ [dataset, selectedRelationId],
+ )
+ const related = useMemo(
+ () =>
+ dataset.relations.filter(
+ (relation) =>
+ relation.source === selectedSkill?.id || relation.target === selectedSkill?.id,
+ ),
+ [dataset, selectedSkill],
+ )
+ const relationCounts = useMemo(() => {
+ const counts = new Map<string, number>()
+ dataset.relations.forEach((relation) => {
+ counts.set(relation.source, (counts.get(relation.source) ?? 0) + 1)
+ counts.set(relation.target, (counts.get(relation.target) ?? 0) + 1)
+ })
+ return counts
+ }, [dataset])
+ const filteredSkills = useMemo(() => {
+ const needle = query.trim().toLocaleLowerCase()
+ return dataset.skills.filter(
+ (skill) =>
+ !needle ||
+ `${skill.name} ${skill.description} ${skill.id}`.toLocaleLowerCase().includes(needle),
+ )
+ }, [dataset, query])
+ const displayedSkills = filteredSkills.slice(0, 200)
+ const skillNames = useMemo(
+ () => new Map(dataset.skills.map((skill) => [skill.id, skillShortName(skill)])),
+ [dataset.skills],
+ )
+ const relationSkillName = (id: string) => skillNames.get(id) ?? id
+ useEffect(() => {
+ const list = skillList.current
+ if (!list) return
+ const rows = Array.from(list.querySelectorAll<HTMLButtonElement>('.skill-row'))
+ const row = rows.find((item) => item.dataset.skillId === selectedSkillId)
+ if (row && rows[0]) list.scrollTop = Math.max(0, row.offsetTop - rows[0].offsetTop)
+ }, [selectedSkillId, dataset, filteredSkills])
+ useEffect(() => {
+ const centerGraph = () => {
+ const canvas = graphCanvas.current
+ if (canvas && window.matchMedia('(max-width: 760px)').matches) {
+ canvas.scrollLeft = (canvas.scrollWidth - canvas.clientWidth) / 2
+ }
+ }
+ centerGraph()
+ window.addEventListener('resize', centerGraph)
+ return () => window.removeEventListener('resize', centerGraph)
+ }, [selectedSkillId, depth, dataset])
+
+ const selectSkill = (id: string) => {
+ setSelectedSkillId(id)
+ setSelectedRelationId(null)
+ setFocusedLine(null)
+ }
+ const selectRelation = (id: string) => {
+ setSelectedRelationId(id)
+ setFocusedLine(null)
+ }
+ const focusEvidence = (skillId: string, line: number) => {
+ setSelectedSkillId(skillId)
+ setSelectedRelationId(null)
+ setFocusedLine(line)
+ }
+ const emptyLocalLibrary =
+ collection.startsWith('local:') &&
+ sourceId === 'local-source' &&
+ localData?.source.skills.length === 0
+ const showWorkbench = !restoring && collection !== 'personal' && !emptyLocalLibrary
+ const currentLibrary = localLibraries.find((item) => item.id === collection)
+
+ return (
+ <div className="app-shell">
+ <header className="site-header">
+ <div className="site-header-inner">
+ <a href="https://skillnet.openkg.cn/" className="brand" aria-label="SkillNet website">
+ <img src="/skillnet.png" alt="SkillNet" />
+ </a>
+ <div className="header-spacer" />
+ <a
+ className="header-link"
+ href="https://github.com/zjunlp/SkillNet"
+ target="_blank"
+ rel="noreferrer"
+ >
+ GitHub <ArrowRight size={14} />
+ </a>
+ </div>
+ </header>
+
+ <main>
+ <fieldset className="dataset-controls" disabled={loading || restoring}>
+ <section className="dataset-bar" aria-label="Current data source">
+ <label className="collection-control">
+ Skill library{' '}
+ <select
+ value={collection}
+ aria-label="Skill library"
+ disabled={loading || restoring}
+ onChange={(event) => changeLibrary(event.target.value)}
+ >
+ <optgroup label="My skill library">
+ <option value="personal">My skill library</option>
+ {localLibraries.map((item) => (
+ <option key={item.id} value={item.id}>
+ Local: {item.name}
+ </option>
+ ))}
+ </optgroup>
+ {importedDatasets.length > 0 && (
+ <optgroup label="Imported snapshots">
+ {importedDatasets.map((item) => (
+ <option key={item.id} value={item.id}>
+ {item.dataset.title}
+ </option>
+ ))}
+ </optgroup>
+ )}
+ </select>
+ </label>
+ <label className="collection-control">
+ View{' '}
+ <select
+ value={sourceId}
+ aria-label="View"
+ disabled={
+ loading ||
+ restoring ||
+ collection === 'personal' ||
+ collection.startsWith('imported:')
+ }
+ onChange={(event) => changeContent(event.target.value)}
+ >
+ {collection === 'personal' ? (
+ <option value="personal">No folder selected</option>
+ ) : collection.startsWith('imported:') ? (
+ <option value="imported">Imported analysis snapshot</option>
+ ) : collection.startsWith('local:') ? (
+ <>
+ <option value="local-source">Current skill files</option>
+ {localData?.analysis && (
+ <option value="local-analysis">
+ Analysis results ({localData.analysis.skills.length}/
+ {localData.source.skills.length})
+ </option>
+ )}
+ </>
+ ) : null}
+ </select>
+ </label>
+ {collection !== 'personal' && (
+ <details className="local-library-menu">
+ <summary>Local folders</summary>
+ <div>
+ <label>
+ Skills folder path
+ <input
+ value={sourcePathInput}
+ onChange={(event) => setSourcePathInput(event.target.value)}
+ placeholder="Absolute path to the skills folder"
+ />
+ </label>
+ <button type="button" onClick={addLocalLibrary}>
+ Add skill library
+ </button>
+ {currentLibrary && (
+ <>
+ <p className="local-path">Current: {currentLibrary.sourcePath}</p>
+ <button type="button" onClick={() => void openLocalLibrary(currentLibrary)}>
+ Refresh folder
+ </button>
+ <label>
+ Custom analysis folder
+ <input
+ value={indexPathInput}
+ onChange={(event) => setIndexPathInput(event.target.value)}
+ placeholder={currentLibrary.indexPath ?? 'Default: .skillnet'}
+ />
+ </label>
+ {currentLibrary.indexPath && (
+ <p className="local-path">Analysis folder: {currentLibrary.indexPath}</p>
+ )}
+ <button type="button" onClick={() => void setLocalIndex()}>
+ Connect analysis folder
+ </button>
+ {currentLibrary.indexPath && (
+ <button type="button" onClick={() => void useDefaultIndex()}>
+ Use default .skillnet
+ </button>
+ )}
+ <button type="button" onClick={() => void forgetLocalLibrary()}>
+ Remove skill library
+ </button>
+ </>
+ )}
+ </div>
+ </details>
+ )}
+ <div className="dataset-actions">
+ <button
+ type="button"
+ className="primary-button"
+ onClick={() => fileInput.current?.click()}
+ disabled={loading || restoring}
+ >
+ <Upload size={16} /> {loading ? 'Loading…' : 'Import graph.json'}
+ </button>
+ {collection.startsWith('imported:') && (
+ <button
+ type="button"
+ className="text-button"
+ onClick={() => void removeImport()}
+ disabled={loading}
+ >
+ Remove import
+ </button>
+ )}
+ <input
+ ref={fileInput}
+ type="file"
+ accept=".json,application/json"
+ className="visually-hidden"
+ aria-label="Choose graph.json file"
+ onChange={(event) => {
+ const file = event.target.files?.[0]
+ event.target.value = ''
+ void importFile(file)
+ }}
+ />
+ </div>
+ {collection !== 'personal' && !emptyLocalLibrary && (
+ <div className="dataset-summary" aria-label="Data summary">
+ {dataset.kind === 'source' ? (
+ <span>
+ <strong>{compactNumber(dataset.skills.length)}</strong> skills
+ </span>
+ ) : (
+ <>
+ <span>
+ <strong>{compactNumber(analysisCounts.compose)}</strong> composable
+ </span>
+ <span>
+ <strong>{compactNumber(analysisCounts.similar)}</strong> similar
+ </span>
+ </>
+ )}
+ </div>
+ )}
+ </section>
+ </fieldset>
+ {collection.startsWith('local:') &&
+ sourceId === 'local-analysis' &&
+ localData &&
+ (localData.changedSkills > 0 ||
+ localData.removedSkills > 0 ||
+ localData.addedSkills > 0) && (
+ <div className="stale-banner" role="status">
+ The analysis snapshot differs from the skills folder: {localData.changedSkills} skill
+ source files changed, and {localData.removedSkills} skills were removed, and{' '}
+ {localData.addedSkills} have not been analyzed. Relationships and evidence still use
+ the source from analysis time. Run SkillNet analyze again to update them.
+ </div>
+ )}
+ {localData?.analysisError && (
+ <div className="stale-banner" role="status">
+ Analysis could not be loaded: {localData.analysisError} Current skill files are still
+ available.
+ </div>
+ )}
+ {localData && localData.warnings.length > 0 && (
+ <details className="stale-banner">
+ <summary>{localData.warnings.length} skill file(s) could not be read</summary>
+ {localData.warnings.map((warning, index) => (
+ <p key={index}>{warning}</p>
+ ))}
+ </details>
+ )}
+ {error && (
+ <div className="error-banner" role="alert">
+ <CircleHelp size={18} /> {error}
+ <button type="button" onClick={() => setError(null)} aria-label="Dismiss error">
+ <X size={17} />
+ </button>
+ </div>
+ )}
+
+ {!restoring && collection === 'personal' && (
+ <fieldset className="dataset-controls" disabled={loading}>
+ <section className="onboarding" aria-label="My skill library">
+ <div className="onboarding-intro">
+ <span>My skill library</span>
+ <h1>
+ {localLibraries.length ? 'Choose a skills folder' : 'Your skill library is empty'}
+ </h1>
+ <p>Your skills stay in a folder on your computer.</p>
+ </div>
+ {localLibraries.length > 0 && (
+ <div className="onboarding-connected">
+ <h2>Connected folders</h2>
+ {localLibraries.map((library) => (
+ <button
+ type="button"
+ key={library.id}
+ onClick={() => void openLocalLibrary(library, 'local-source')}
+ >
+ <span>
+ {library.name}
+ <small>{library.sourcePath}</small>
+ </span>
+ <ArrowRight size={16} />
+ </button>
+ ))}
+ </div>
+ )}
+ <div className="onboarding-grid">
+ <div className="onboarding-choice">
+ <h2>Start with an empty folder</h2>
+ <p>
+ Click to create <code>.skillnet/skills</code> in your home folder and connect it
+ here.
+ </p>
+ <button
+ type="button"
+ className="primary-button"
+ onClick={() => void createPersonalLibrary()}
+ disabled={loading}
+ >
+ Create my skill library
+ </button>
+ </div>
+ <div className="onboarding-choice">
+ <h2>Use existing skills</h2>
+ <p>
+ Enter a folder that directly contains skill subfolders. Each skill subfolder
+ needs a <code>SKILL.md</code> file.
+ </p>
+ <label>
+ Absolute path to skills folder
+ <input
+ value={sourcePathInput}
+ onChange={(event) => setSourcePathInput(event.target.value)}
+ placeholder="For example, C:\Users\me\skills"
+ />
+ </label>
+ <button
+ type="button"
+ className="onboarding-secondary"
+ onClick={addLocalLibrary}
+ disabled={loading}
+ >
+ Connect existing folder
+ </button>
+ </div>
+ </div>
+ </section>
+ </fieldset>
+ )}
+
+ {!restoring && emptyLocalLibrary && (
+ <fieldset className="dataset-controls" disabled={loading}>
+ <section className="onboarding" aria-label="Empty local skill library">
+ <div className="onboarding-intro">
+ <span>Local skill library</span>
+ <h1>This folder has no skills yet</h1>
+ <p>
+ The folder is connected. Add skill subfolders at the path below, then click
+ Refresh folder.
+ </p>
+ </div>
+ <div className="onboarding-empty-path">
+ <strong>Skills folder</strong>
+ <code>{currentLibrary?.sourcePath}</code>
+ </div>
+ <div className="onboarding-next">
+ <h2>How to add skills</h2>
+ <p>
+ Copy existing skill folders here, or use this path when you download or create
+ skills with SkillNet. Each skill needs its own subfolder with a{' '}
+ <code>SKILL.md</code> file.
+ </p>
+ <code>
+ skillnet download &lt;GitHub skill folder URL&gt; --target-dir &quot;
+ {currentLibrary?.sourcePath}&quot;
+ </code>
+ <p>
+ Creating skills also requires a model configuration. After adding skills, run{' '}
+ <code>skillnet analyze &quot;{currentLibrary?.sourcePath}&quot;</code> to analyze
+ relationships.
+ </p>
+ <button
+ type="button"
+ className="primary-button"
+ onClick={() => {
+ if (currentLibrary) void openLocalLibrary(currentLibrary, 'local-source')
+ }}
+ disabled={loading}
+ >
+ Refresh folder
+ </button>
+ </div>
+ </section>
+ </fieldset>
+ )}
+
+ {showWorkbench && (
+ <>
+ <section className="workbench-heading">
+ <h1>Skills and relationships</h1>
+ </section>
+
+ <section className="workspace" aria-label="Skill exploration workspace">
+ <aside className="skill-panel">
+ <div className="panel-title">
+ <strong>Skill list</strong>
+ <span className="count-pill">{filteredSkills.length}</span>
+ </div>
+ <label className="search-box">
+ <Search size={17} />
+ <input
+ type="search"
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ placeholder="Search name, capability, or ID"
+ aria-label="Search skills"
+ />
+ {query && (
+ <button type="button" onClick={() => setQuery('')} aria-label="Clear search">
+ <X size={14} />
+ </button>
+ )}
+ </label>
+ <div className="list-caption">
+ <span>
+ {query ? `${filteredSkills.length} matches` : 'All skills'}
+ {filteredSkills.length > 200 &&
+ ' (showing the first 200; search to narrow the list)'}
+ </span>
+ </div>
+ <div className="skill-list" role="list" ref={skillList}>
+ {filteredSkills.length === 0 && (
+ <div className="no-results">
+ No matching skills found.
+ <button type="button" onClick={() => setQuery('')}>
+ Clear search
+ </button>
+ </div>
+ )}
+ {displayedSkills.map((skill) => {
+ const active = skill.id === selectedSkill?.id
+ const count = relationCounts.get(skill.id) ?? 0
+ return (
+ <button
+ type="button"
+ className={`skill-row ${active ? 'is-active' : ''}`}
+ key={skill.id}
+ data-skill-id={skill.id}
+ onClick={() => selectSkill(skill.id)}
+ aria-current={active ? 'true' : undefined}
+ >
+ <span className="skill-row-top">
+ <strong>{skillShortName(skill)}</strong>
+ <ArrowRight size={15} />
+ </span>
+ <span className="skill-row-description">
+ {skill.description || 'View skill source and relationships'}
+ </span>
+ <span className="skill-row-bottom">
+ <span>{skill.id}</span>
+ <span className="skill-row-markers">
+ {count > 0 && (
+ <span>
+ <GitBranch size={12} /> {count}
+ </span>
+ )}
+ </span>
+ </span>
+ </button>
+ )
+ })}
+ </div>
+ </aside>
+
+ <div className="graph-panel">
+ <div className="panel-title graph-panel-title">
+ <strong>Relationship view</strong>
+ {dataset.kind === 'snapshot' && (
+ <div className="graph-view-controls">
+ <div className="graph-tools">
+ <button
+ type="button"
+ className={viewMode === 'graph' ? 'is-on' : ''}
+ onClick={() => setViewMode('graph')}
+ aria-pressed={viewMode === 'graph'}
+ >
+ Graph
+ </button>
+ <button
+ type="button"
+ className={viewMode === 'list' ? 'is-on' : ''}
+ onClick={() => setViewMode('list')}
+ aria-pressed={viewMode === 'list'}
+ >
+ List
+ </button>
+ </div>
+ {viewMode === 'graph' && (
+ <div className="graph-tools">
+ <button
+ type="button"
+ className={depth === 1 ? 'is-on' : ''}
+ onClick={() => setDepth(1)}
+ aria-pressed={depth === 1}
+ >
+ 1 hop
+ </button>
+ <button
+ type="button"
+ className={depth === 2 ? 'is-on' : ''}
+ onClick={() => setDepth(2)}
+ aria-pressed={depth === 2}
+ >
+ 2 hops
+ </button>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ {dataset.kind === 'snapshot' && (
+ <div className="graph-subtitle">
+ <span>
+ {viewMode === 'graph' ? (
+ <>
+ Focused on{' '}
+ <strong>{selectedSkill ? skillShortName(selectedSkill) : '—'}</strong>
+ </>
+ ) : (
+ `${relationRows.length} relationships`
+ )}
+ </span>
+ <label className="graph-relation-control">
+ Relationship{' '}
+ <select
+ value={relationType}
+ onChange={(event) => {
+ setRelationType(
+ event.target.value as 'all' | 'compose_with' | 'similar_to',
+ )
+ setSelectedRelationId(null)
+ }}
+ >
+ <option value="all">All</option>
+ <option value="compose_with">Composable</option>
+ <option value="similar_to">Similar</option>
+ </select>
+ </label>
+ {viewMode === 'graph' && (
+ <span className="graph-limit">
+ Showing up to {depth === 1 ? 10 : 16} neighbors; see all relationships in
+ List
+ </span>
+ )}
+ </div>
+ )}
+ {dataset.kind === 'source' ? (
+ <div className="graph-empty">
+ <strong>
+ {localData?.analysisStatus === 'error'
+ ? 'Analysis unavailable'
+ : localData?.analysis
+ ? 'Analysis results available'
+ : 'Not analyzed yet'}
+ </strong>
+ <span>
+ {localData?.analysis
+ ? 'Choose an analysis snapshot from View to inspect relationships and evidence.'
+ : 'Run SkillNet analyze to discover composable and similar skills.'}
+ </span>
+ {currentLibrary && !localData?.analysis && (
+ <code>skillnet analyze "{currentLibrary.sourcePath}"</code>
+ )}
+ </div>
+ ) : viewMode === 'graph' ? (
+ <div className="graph-canvas" ref={graphCanvas}>
+ {selectedSkill && (
+ <GraphView
+ dataset={graphDataset}
+ selectedSkillId={selectedSkill.id}
+ selectedRelationId={selectedRelationId}
+ depth={depth}
+ onSelectSkill={selectSkill}
+ onSelectRelation={selectRelation}
+ />
+ )}
+ </div>
+ ) : (
+ <div className="relation-list-view">
+ <label className="relation-search">
+ <Search size={16} />
+ <input
+ type="search"
+ value={relationQuery}
+ onChange={(event) => setRelationQuery(event.target.value)}
+ placeholder="Search skills, scenarios, or explanations"
+ aria-label="Search relationships"
+ />
+ </label>
+ <div className="relation-list" role="list">
+ {relationRows.length === 0 ? (
+ <p className="relation-list-empty">No matching relationships.</p>
+ ) : (
+ relationRows.map((relation) => (
+ <button
+ type="button"
+ key={relation.id}
+ className={`relation-row ${selectedRelationId === relation.id ? 'is-active' : ''}`}
+ onClick={() => selectRelation(relation.id)}
+ >
+ <span className="relation-row-path">
+ <strong>{relationSkillName(relation.source)}</strong>
+ <span>{relation.type === 'similar_to' ? '↔' : '→'}</span>
+ <strong>{relationSkillName(relation.target)}</strong>
+ </span>
+ <span className="relation-row-detail">
+ <small className={`relation-badge ${relation.type}`}>
+ {relationLabel(relation.type)}
+ </small>
+ <span>
+ {relation.contexts[0]?.scenario ||
+ relation.contexts[0]?.explanation}
+ </span>
+ </span>
+ </button>
+ ))
+ )}
+ </div>
+ </div>
+ )}
+ {dataset.kind === 'snapshot' && (
+ <div className="graph-footer">
+ <div className="legend">
+ <span>
+ <i className="legend-line compose" /> Composable
+ </span>
+ <span>
+ <i className="legend-line similar" /> Similar
+ </span>
+ </div>
+ <span className="graph-desktop-help">
+ {viewMode === 'graph'
+ ? 'Click a node or line for details'
+ : 'Click a relationship to view its scenario and evidence'}
+ </span>
+ <span className="graph-mobile-help">
+ {viewMode === 'graph'
+ ? 'Swipe across the graph; tap a node or line for details'
+ : 'Tap a relationship to view its scenario and evidence'}
+ </span>
+ </div>
+ )}
+ </div>
+
+ <aside className="detail-panel">
+ <div className="panel-title">
+ <strong>{selectedRelation ? 'Relationship details' : 'Skill details'}</strong>
+ </div>
+ {selectedRelation ? (
+ <RelationInspector
+ relation={selectedRelation}
+ dataset={dataset}
+ onFocus={focusEvidence}
+ onSelectSkill={selectSkill}
+ />
+ ) : (
+ selectedSkill && (
+ <SkillInspector
+ skill={selectedSkill}
+ dataset={dataset}
+ related={related}
+ focusedLine={focusedLine}
+ onFocus={focusEvidence}
+ onSelectRelation={selectRelation}
+ />
+ )
+ )}
+ </aside>
+ </section>
+ </>
+ )}
+ </main>
+ </div>
+ )
+}
diff --git a/frontend/src/GraphView.tsx b/skillnet-ai/src/skillnet_ai/web/ui/src/GraphView.tsx
similarity index 59%
rename from frontend/src/GraphView.tsx
rename to skillnet-ai/src/skillnet_ai/web/ui/src/GraphView.tsx
index 0466e84..bcdd02c 100644
--- a/frontend/src/GraphView.tsx
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/GraphView.tsx
@@ -30,8 +30,8 @@ function getVisible(dataset: Dataset, selectedSkillId: string, depth: 1 | 2) {
frontier = next
}
return {
- skills: dataset.skills.filter(skill => levels.has(skill.id)),
- relations: dataset.relations.filter(relation => {
+ skills: dataset.skills.filter((skill) => levels.has(skill.id)),
+ relations: dataset.relations.filter((relation) => {
const sourceLevel = levels.get(relation.source)
const targetLevel = levels.get(relation.target)
if (sourceLevel === undefined || targetLevel === undefined) return false
@@ -50,27 +50,43 @@ function labelLines(skill: Skill): string[] {
return [words.slice(0, middle).join(' ').slice(0, 17), words.slice(middle).join(' ').slice(0, 17)]
}
-function edgeCoordinates(source: { x: number; y: number }, target: { x: number; y: number }, offset: number, startPad: number, endPad: number) {
+function edgeCoordinates(
+ source: { x: number; y: number },
+ target: { x: number; y: number },
+ offset: number,
+ startPad: number,
+ endPad: number,
+) {
const dx = target.x - source.x
const dy = target.y - source.y
const distance = Math.hypot(dx, dy) || 1
- const offsetX = -dy * offset / distance
- const offsetY = dx * offset / distance
+ const offsetX = (-dy * offset) / distance
+ const offsetY = (dx * offset) / distance
return {
- x1: source.x + dx * startPad / distance + offsetX,
- y1: source.y + dy * startPad / distance + offsetY,
- x2: target.x - dx * endPad / distance + offsetX,
- y2: target.y - dy * endPad / distance + offsetY,
+ x1: source.x + (dx * startPad) / distance + offsetX,
+ y1: source.y + (dy * startPad) / distance + offsetY,
+ x2: target.x - (dx * endPad) / distance + offsetX,
+ y2: target.y - (dy * endPad) / distance + offsetY,
}
}
-export function GraphView({ dataset, selectedSkillId, selectedRelationId, depth, onSelectSkill, onSelectRelation }: GraphViewProps) {
- const visible = useMemo(() => getVisible(dataset, selectedSkillId, depth), [dataset, selectedSkillId, depth])
- const byId = useMemo(() => new Map(dataset.skills.map(skill => [skill.id, skill])), [dataset])
+export function GraphView({
+ dataset,
+ selectedSkillId,
+ selectedRelationId,
+ depth,
+ onSelectSkill,
+ onSelectRelation,
+}: GraphViewProps) {
+ const visible = useMemo(
+ () => getVisible(dataset, selectedSkillId, depth),
+ [dataset, selectedSkillId, depth],
+ )
+ const byId = useMemo(() => new Map(dataset.skills.map((skill) => [skill.id, skill])), [dataset])
const parallelOffsets = useMemo(() => {
const pairs = new Map<string, Relation[]>()
for (const relation of visible.relations) {
- const key = [relation.source, relation.target].sort().join('|')
+ const key = JSON.stringify([relation.source, relation.target].sort())
const group = pairs.get(key) ?? []
group.push(relation)
pairs.set(key, group)
@@ -78,17 +94,19 @@ export function GraphView({ dataset, selectedSkillId, selectedRelationId, depth,
const offsets = new Map<string, { offset: number; count: number }>()
for (const group of pairs.values()) {
group.sort((a, b) => a.type.localeCompare(b.type) || a.source.localeCompare(b.source))
- group.forEach((relation, index) => offsets.set(relation.id, {
- offset: (index - (group.length - 1) / 2) * 12,
- count: group.length,
- }))
+ group.forEach((relation, index) =>
+ offsets.set(relation.id, {
+ offset: (index - (group.length - 1) / 2) * 12,
+ count: group.length,
+ }),
+ )
}
return offsets
}, [visible.relations])
const positions = useMemo(() => {
const map = new Map<string, { x: number; y: number }>()
map.set(selectedSkillId, { x: 340, y: 223 })
- const others = visible.skills.filter(skill => skill.id !== selectedSkillId)
+ const others = visible.skills.filter((skill) => skill.id !== selectedSkillId)
others.forEach((skill, index) => {
const angle = -Math.PI / 2 + (Math.PI * 2 * index) / Math.max(others.length, 1)
const radiusX = others.length <= 6 ? 225 : 260
@@ -109,14 +127,24 @@ export function GraphView({ dataset, selectedSkillId, selectedRelationId, depth,
}
return (
- <svg className={`graph-svg ${depth === 2 ? 'is-expanded' : ''}`} viewBox="0 0 680 460" role="group" aria-label={`Local relationship graph centered on ${byId.get(selectedSkillId)?.name ?? selectedSkillId}`}>
+ <svg
+ className={`graph-svg ${depth === 2 ? 'is-expanded' : ''}`}
+ viewBox="0 0 680 460"
+ role="group"
+ aria-label={`Local relationship graph centered on ${byId.get(selectedSkillId)?.name ?? selectedSkillId}`}
+ >
<defs>
- <marker id="arrow-compose" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto" markerUnits="userSpaceOnUse">
+ <marker
+ id="arrow-compose"
+ markerWidth="8"
+ markerHeight="8"
+ refX="6"
+ refY="4"
+ orient="auto"
+ markerUnits="userSpaceOnUse"
+ >
<path d="M0 0 L8 4 L0 8" fill="none" stroke="#2c947f" strokeWidth="1.6" />
</marker>
- <marker id="arrow-reference" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto" markerUnits="userSpaceOnUse">
- <path d="M0 0 L8 4 L0 8" fill="none" stroke="#8ba0ae" strokeWidth="1.6" />
- </marker>
</defs>
{visible.relations.map((relation: Relation) => {
const source = positions.get(relation.source)
@@ -133,16 +161,29 @@ export function GraphView({ dataset, selectedSkillId, selectedRelationId, depth,
)
const selected = selectedRelationId === relation.id
const secondary = relation.source !== selectedSkillId && relation.target !== selectedSkillId
- const marker = relation.type === 'compose_with' ? 'url(#arrow-compose)' : relation.type === 'source_reference' ? 'url(#arrow-reference)' : undefined
+ const marker = relation.type === 'compose_with' ? 'url(#arrow-compose)' : undefined
const activate = () => onSelectRelation(relation.id)
return (
- <g key={relation.id} className={`graph-edge ${relation.type} ${(lane?.count ?? 0) > 1 ? 'is-parallel' : ''} ${secondary ? 'is-secondary' : ''} ${selected ? 'is-selected' : ''}`} role="button" tabIndex={0} aria-label={`${byId.get(relation.source)?.name} ${relationLabel(relation.type)} ${byId.get(relation.target)?.name}`} onClick={activate} onKeyDown={event => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); activate() } }}>
+ <g
+ key={relation.id}
+ className={`graph-edge ${relation.type} ${(lane?.count ?? 0) > 1 ? 'is-parallel' : ''} ${secondary ? 'is-secondary' : ''} ${selected ? 'is-selected' : ''}`}
+ role="button"
+ tabIndex={0}
+ aria-label={`${byId.get(relation.source)?.name} ${relationLabel(relation.type)} ${byId.get(relation.target)?.name}`}
+ onClick={activate}
+ onKeyDown={(event) => {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault()
+ activate()
+ }
+ }}
+ >
<line {...edge} className="edge-line" markerEnd={marker} />
<line {...edge} className="edge-hit" />
</g>
)
})}
- {visible.skills.map(skill => {
+ {visible.skills.map((skill) => {
const position = positions.get(skill.id)
if (!position) return null
const active = skill.id === selectedSkillId
@@ -150,12 +191,38 @@ export function GraphView({ dataset, selectedSkillId, selectedRelationId, depth,
const labelAbove = position.y < 223
const activate = () => onSelectSkill(skill.id)
return (
- <g key={skill.id} className={`graph-node ${active ? 'is-active' : ''}`} transform={`translate(${position.x}, ${position.y})`} role="button" tabIndex={0} aria-label={`View skill ${skill.name}`} onClick={activate} onKeyDown={event => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); activate() } }}>
+ <g
+ key={skill.id}
+ className={`graph-node ${active ? 'is-active' : ''}`}
+ transform={`translate(${position.x}, ${position.y})`}
+ role="button"
+ tabIndex={0}
+ aria-label={`View skill ${skill.name}`}
+ onClick={activate}
+ onKeyDown={(event) => {
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault()
+ activate()
+ }
+ }}
+ >
<circle r="18" className="node-hit" />
{active && <circle r="17" className="node-halo" />}
<circle r={active ? 12 : 8} className="node-circle" />
{active && <circle r="3" className="node-core" />}
- {!active && <text textAnchor="middle" y={labelAbove ? -20 - (lines.length - 1) * 16 : 25} className="node-label">{lines.map((line, index) => <tspan key={index} x="0" dy={index === 0 ? 0 : 16}>{line}</tspan>)}</text>}
+ {!active && (
+ <text
+ textAnchor="middle"
+ y={labelAbove ? -20 - (lines.length - 1) * 16 : 25}
+ className="node-label"
+ >
+ {lines.map((line, index) => (
+ <tspan key={index} x="0" dy={index === 0 ? 0 : 16}>
+ {line}
+ </tspan>
+ ))}
+ </text>
+ )}
</g>
)
})}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/Inspectors.tsx b/skillnet-ai/src/skillnet_ai/web/ui/src/Inspectors.tsx
new file mode 100644
index 0000000..cdacc4f
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/Inspectors.tsx
@@ -0,0 +1,237 @@
+import { useEffect, useMemo } from 'react'
+import { ArrowDownRight, ArrowRight, FileText } from 'lucide-react'
+import { relationLabel, sourceLines } from './data'
+import type { Dataset, Evidence, Relation, Skill } from './data'
+
+function getProfileItems(
+ profile: Record<string, unknown> | undefined,
+ key: string,
+): Array<{ text: string; lines: number[] }> {
+ const entries = profile?.[key]
+ if (!Array.isArray(entries)) return []
+ return entries.flatMap((item) => {
+ if (
+ typeof item !== 'object' ||
+ item === null ||
+ !('text' in item) ||
+ typeof item.text !== 'string'
+ )
+ return []
+ const evidence = 'evidence' in item && Array.isArray(item.evidence) ? item.evidence : []
+ const lines = (evidence as unknown[]).flatMap((citation: unknown) =>
+ typeof citation === 'object' &&
+ citation !== null &&
+ 'line' in citation &&
+ typeof citation.line === 'number'
+ ? [citation.line]
+ : [],
+ )
+ return [{ text: item.text, lines }]
+ })
+}
+
+function SourceViewer({ skill, focusedLine }: { skill: Skill; focusedLine: number | null }) {
+ const lines = useMemo(() => sourceLines(skill.source), [skill.source])
+ useEffect(() => {
+ if (focusedLine === null) return
+ const timer = window.setTimeout(
+ () =>
+ document
+ .getElementById(`source-line-${focusedLine}`)
+ ?.scrollIntoView({ behavior: 'smooth', block: 'center' }),
+ 60,
+ )
+ return () => window.clearTimeout(timer)
+ }, [skill.id, focusedLine])
+ return (
+ <div className="source-frame" aria-label={`${skill.name} SKILL.md source`}>
+ {lines.map((line, index) => (
+ <div
+ id={`source-line-${index + 1}`}
+ key={`${skill.id}-${index}`}
+ className={`source-line ${focusedLine === index + 1 ? 'is-highlighted' : ''}`}
+ >
+ <span className="source-number">{index + 1}</span>
+ <span className="source-text">{line || ' '}</span>
+ </div>
+ ))}
+ </div>
+ )
+}
+
+function EvidenceLink({
+ evidence,
+ onFocus,
+}: {
+ evidence: Evidence
+ onFocus: (skillId: string, line: number) => void
+}) {
+ return (
+ <button
+ type="button"
+ className="evidence-link"
+ onClick={() => onFocus(evidence.skillId, evidence.line)}
+ >
+ <FileText size={14} /> {evidence.skillId.split('::').at(-1)} · L{evidence.line}{' '}
+ <ArrowRight size={13} />
+ </button>
+ )
+}
+
+export function RelationInspector({
+ relation,
+ dataset,
+ onFocus,
+ onSelectSkill,
+}: {
+ relation: Relation
+ dataset: Dataset
+ onFocus: (skillId: string, line: number) => void
+ onSelectSkill: (id: string) => void
+}) {
+ const byId = new Map(dataset.skills.map((skill) => [skill.id, skill]))
+ return (
+ <div className="inspector-content">
+ <div className="relation-provenance">
+ <div className={`relation-badge ${relation.type}`}>{relationLabel(relation.type)}</div>
+ <span>Model analysis</span>
+ </div>
+ <div className="relation-path">
+ <button type="button" onClick={() => onSelectSkill(relation.source)}>
+ {byId.get(relation.source)?.name ?? relation.source}
+ </button>
+ <span>{relation.type === 'similar_to' ? '↔' : '→'}</span>
+ <button type="button" onClick={() => onSelectSkill(relation.target)}>
+ {byId.get(relation.target)?.name ?? relation.target}
+ </button>
+ </div>
+ {relation.contexts.map((context, index) => (
+ <section className="inspector-section" key={index}>
+ <div className="section-index">Scenario {String(index + 1).padStart(2, '0')}</div>
+ <h3>{context.scenario}</h3>
+ <p>{context.explanation}</p>
+ {context.conditions.length > 0 && (
+ <div className="condition-list">
+ {context.conditions.map((condition, conditionIndex) => (
+ <span key={conditionIndex}>{condition}</span>
+ ))}
+ </div>
+ )}
+ <div className="evidence-group">
+ <span className="field-label">Source text</span>
+ {context.sourceEvidence.map((evidence, evidenceIndex) => (
+ <EvidenceLink key={evidenceIndex} evidence={evidence} onFocus={onFocus} />
+ ))}
+ </div>
+ {context.targetEvidence.length > 0 && (
+ <div className="evidence-group">
+ <span className="field-label">Target text</span>
+ {context.targetEvidence.map((evidence, evidenceIndex) => (
+ <EvidenceLink key={evidenceIndex} evidence={evidence} onFocus={onFocus} />
+ ))}
+ </div>
+ )}
+ </section>
+ ))}
+ </div>
+ )
+}
+
+export function SkillInspector({
+ skill,
+ dataset,
+ related,
+ focusedLine,
+ onFocus,
+ onSelectRelation,
+}: {
+ skill: Skill
+ dataset: Dataset
+ related: Relation[]
+ focusedLine: number | null
+ onFocus: (skillId: string, line: number) => void
+ onSelectRelation: (id: string) => void
+}) {
+ const groups = [
+ ['when_to_use', 'When to use'],
+ ['inputs', 'Inputs'],
+ ['outputs', 'Outputs'],
+ ['constraints', 'Constraints'],
+ ['tools', 'Tools'],
+ ] as const
+ const byId = new Map(dataset.skills.map((item) => [item.id, item]))
+ return (
+ <div className="inspector-content">
+ <h2>{skill.name}</h2>
+ <div className="skill-path">
+ <FileText size={14} /> {dataset.kind === 'snapshot' ? 'Source at analysis time: ' : ''}
+ {skill.path || skill.id}
+ </div>
+ <div className="capability-card">
+ <div className="field-label">
+ Capability summary · {skill.profile ? 'Model extracted' : 'SKILL.md description'}
+ </div>
+ <p>{skill.description || 'No capability summary is available. Read the source below.'}</p>
+ </div>
+ {skill.profile && <div className="profile-source-label">Skill profile · Model extracted</div>}
+ {skill.profile && (
+ <div className="profile-groups">
+ {groups.map(([key, title]) => {
+ const items = getProfileItems(skill.profile, key)
+ if (items.length === 0) return null
+ return (
+ <section className="profile-group" key={key}>
+ <h3>{title}</h3>
+ {items.map((item, index) => (
+ <div className="profile-item" key={index}>
+ <span>{item.text}</span>
+ {item.lines.map((line) => (
+ <button key={line} type="button" onClick={() => onFocus(skill.id, line)}>
+ L{line}
+ </button>
+ ))}
+ </div>
+ ))}
+ </section>
+ )
+ })}
+ </div>
+ )}
+ <section className="inspector-section related-section">
+ <div className="section-heading">
+ <h3>Related connections</h3>
+ <span>{related.length}</span>
+ </div>
+ {related.length === 0 ? (
+ <p className="muted">No relationships are recorded in this dataset.</p>
+ ) : (
+ <div className="related-list">
+ {related.map((relation) => {
+ const otherId = relation.source === skill.id ? relation.target : relation.source
+ const other = byId.get(otherId)
+ return (
+ <button
+ type="button"
+ key={relation.id}
+ onClick={() => onSelectRelation(relation.id)}
+ >
+ <span className={`small-dot ${relation.type}`} />
+ <span>{other?.name ?? otherId}</span>
+ <small>{relationLabel(relation.type)}</small>
+ <ArrowDownRight size={14} />
+ </button>
+ )
+ })}
+ </div>
+ )}
+ </section>
+ <section className="inspector-section source-section">
+ <div className="section-heading">
+ <h3>SKILL.md source</h3>
+ <span>{sourceLines(skill.source).length} lines</span>
+ </div>
+ <SourceViewer skill={skill} focusedLine={focusedLine} />
+ </section>
+ </div>
+ )
+}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/data.ts b/skillnet-ai/src/skillnet_ai/web/ui/src/data.ts
new file mode 100644
index 0000000..d45f75f
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/data.ts
@@ -0,0 +1,200 @@
+export type RelationType = 'compose_with' | 'similar_to'
+
+export interface Skill {
+ id: string
+ name: string
+ description: string
+ source: string
+ path: string
+ profile?: Record<string, unknown>
+}
+
+export interface Evidence {
+ skillId: string
+ line: number
+}
+
+export interface RelationContext {
+ scenario: string
+ explanation: string
+ conditions: string[]
+ sourceEvidence: Evidence[]
+ targetEvidence: Evidence[]
+}
+
+export interface Relation {
+ id: string
+ source: string
+ target: string
+ type: RelationType
+ contexts: RelationContext[]
+}
+
+export interface Dataset {
+ kind: 'source' | 'snapshot'
+ title: string
+ skills: Skill[]
+ relations: Relation[]
+}
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
+}
+
+function nonemptyString(value: unknown, name: string): string {
+ if (typeof value !== 'string' || !value.trim())
+ throw new Error(`${name} is missing or is not text.`)
+ return value
+}
+
+function citationLines(value: unknown, name: string, skillId: string, maxLine: number): Evidence[] {
+ if (!Array.isArray(value) || value.length === 0) throw new Error(`${name} has no evidence lines.`)
+ return value.map((item, index) => {
+ if (
+ !isRecord(item) ||
+ !Number.isInteger(item.line) ||
+ (item.line as number) < 1 ||
+ (item.line as number) > maxLine
+ ) {
+ throw new Error(`${name}[${index}] has an invalid line number.`)
+ }
+ return { skillId, line: item.line as number }
+ })
+}
+
+export function parseSnapshot(value: unknown, title: string): Dataset {
+ if (!isRecord(value) || value.schema_version !== 1)
+ throw new Error('Only GraphSnapshot v1 is supported.')
+ if (typeof value.embedding_model !== 'string' || typeof value.embedding_base_url !== 'string') {
+ throw new Error('The snapshot is missing its SDK model metadata.')
+ }
+ if (!Array.isArray(value.skills) || !Array.isArray(value.relations)) {
+ throw new Error('The file is missing a skills or relations array.')
+ }
+ if (value.skills.length === 0) throw new Error('The snapshot has no skills.')
+ if (value.skills.length > 5000 || value.relations.length > 20000) {
+ throw new Error('The limit is 5,000 skills and 20,000 relationships. Import a smaller file.')
+ }
+ const skills: Skill[] = value.skills.map((item: unknown, index: number) => {
+ if (!isRecord(item)) throw new Error(`skills[${index}] is not an object.`)
+ if (typeof item.content_hash !== 'string' || typeof item.path !== 'string') {
+ throw new Error(`skills[${index}] is missing SDK source metadata.`)
+ }
+ const source = nonemptyString(item.source, `skills[${index}].source`)
+ const profile = validateProfile(item.profile, source, `skills[${index}].profile`)
+ const capability = isRecord(profile.capability) ? profile.capability.text : undefined
+ return {
+ id: nonemptyString(item.skill_id, `skills[${index}].skill_id`),
+ name: nonemptyString(item.name, `skills[${index}].name`),
+ description: typeof capability === 'string' ? capability : '',
+ source,
+ path: item.path,
+ profile,
+ }
+ })
+ const byId = new Map(skills.map((skill) => [skill.id, skill]))
+ const lineCounts = new Map(skills.map((skill) => [skill.id, sourceLines(skill.source).length]))
+ const lineCount = (id: string) => lineCounts.get(id) ?? 0
+ if (byId.size !== skills.length)
+ throw new Error('The snapshot contains duplicate skill_id values.')
+ const relations: Relation[] = value.relations.map((item: unknown, index: number) => {
+ if (!isRecord(item)) throw new Error(`relations[${index}] is not an object.`)
+ const source = nonemptyString(item.source, `relations[${index}].source`)
+ const target = nonemptyString(item.target, `relations[${index}].target`)
+ if (source === target) throw new Error(`relations[${index}] connects a skill to itself.`)
+ if (!byId.has(source) || !byId.has(target))
+ throw new Error(`relations[${index}] refers to a missing skill.`)
+ if (item.type !== 'compose_with' && item.type !== 'similar_to') {
+ throw new Error(`relations[${index}] has an unsupported relationship type.`)
+ }
+ if (!Array.isArray(item.contexts) || item.contexts.length === 0) {
+ throw new Error(`relations[${index}].contexts is empty.`)
+ }
+ const contexts: RelationContext[] = item.contexts.map(
+ (context: unknown, contextIndex: number) => {
+ if (!isRecord(context))
+ throw new Error(`relations[${index}].contexts[${contextIndex}] is not an object.`)
+ return {
+ scenario: nonemptyString(
+ context.scenario,
+ `relations[${index}].contexts[${contextIndex}].scenario`,
+ ),
+ explanation: nonemptyString(
+ context.explanation,
+ `relations[${index}].contexts[${contextIndex}].explanation`,
+ ),
+ conditions: stringList(context.conditions),
+ sourceEvidence: citationLines(
+ context.source_evidence,
+ 'source_evidence',
+ source,
+ lineCount(source),
+ ),
+ targetEvidence: citationLines(
+ context.target_evidence,
+ 'target_evidence',
+ target,
+ lineCount(target),
+ ),
+ }
+ },
+ )
+ return { id: `relation-${index}`, source, target, type: item.type, contexts }
+ })
+ return {
+ kind: 'snapshot',
+ title,
+ skills,
+ relations,
+ }
+}
+
+export function sourceLines(source: string): string[] {
+ // Match Python str.splitlines(), which the SDK uses for evidence line numbers.
+ const lines = source.split(/\r\n|[\n\r\v\f\x1c-\x1e\x85\u2028\u2029]/)
+ if (lines.at(-1) === '') lines.pop()
+ return lines
+}
+
+function stringList(value: unknown): string[] {
+ if (!Array.isArray(value) || value.some((item) => typeof item !== 'string'))
+ throw new Error('Expected text conditions.')
+ return value as string[]
+}
+
+function validateProfile(value: unknown, source: string, name: string): Record<string, unknown> {
+ if (!isRecord(value)) throw new Error(`${name} is missing.`)
+ const maxLine = sourceLines(source).length
+ const field = (entry: unknown) => {
+ if (!isRecord(entry)) throw new Error(`${name} contains an invalid field.`)
+ nonemptyString(entry.text, name)
+ citationLines(entry.evidence, name, '', maxLine)
+ }
+ const fields = (entries: unknown) => {
+ if (!Array.isArray(entries)) throw new Error(`${name} is missing a field list.`)
+ entries.forEach(field)
+ }
+ field(value.capability)
+ for (const key of ['when_to_use', 'inputs', 'outputs', 'constraints', 'tools']) fields(value[key])
+ if (!Array.isArray(value.scenarios)) throw new Error(`${name} is missing scenarios.`)
+ value.scenarios.forEach((scenario) => {
+ if (!isRecord(scenario)) throw new Error(`${name} contains an invalid scenario.`)
+ nonemptyString(scenario.name, name)
+ fields(scenario.before)
+ fields(scenario.after)
+ })
+ return value
+}
+
+export function relationLabel(type: RelationType): string {
+ switch (type) {
+ case 'compose_with':
+ return 'Composable'
+ case 'similar_to':
+ return 'Similar'
+ }
+}
+
+export function skillShortName(skill: Skill): string {
+ return skill.name.replaceAll('-', ' ')
+}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/localLibrary.ts b/skillnet-ai/src/skillnet_ai/web/ui/src/localLibrary.ts
new file mode 100644
index 0000000..9780805
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/localLibrary.ts
@@ -0,0 +1,88 @@
+import { parseSnapshot } from './data'
+import type { Dataset } from './data'
+
+export interface LocalLibrary {
+ id: string
+ name: string
+ sourcePath: string
+ indexPath?: string
+}
+
+export interface LocalLibraryData {
+ source: Dataset
+ analysis: Dataset | null
+ analysisStatus: 'missing' | 'ready' | 'error'
+ analysisError: string | null
+ warnings: string[]
+ changedSkills: number
+ removedSkills: number
+ addedSkills: number
+}
+
+interface LocalResponse extends Omit<LocalLibraryData, 'analysis'> {
+ name: string
+ sourcePath: string
+ graph: unknown | null
+}
+
+async function localRequest(body: object, signal?: AbortSignal): Promise<unknown> {
+ const response = await fetch('/api/local-library', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(body),
+ signal,
+ })
+ if (!response.headers.get('content-type')?.includes('application/json')) {
+ throw new Error('Start the local service with skillnet ui to use folders.')
+ }
+ const value = await response.json()
+ if (!response.ok)
+ throw new Error(value.error || value.detail || 'Could not read the local skill library.')
+ return value
+}
+
+export async function initialLibraryPath(): Promise<string | null> {
+ try {
+ const response = await fetch('/api/config', { signal: AbortSignal.timeout(5000) })
+ if (!response.ok || !response.headers.get('content-type')?.includes('application/json'))
+ return null
+ const value = await response.json()
+ return typeof value.sourcePath === 'string' ? value.sourcePath : null
+ } catch {
+ return null
+ }
+}
+
+export async function createDefaultLibrary(): Promise<string> {
+ const value = (await localRequest({ action: 'create-default' })) as { sourcePath: string }
+ return value.sourcePath
+}
+
+export async function readLocalLibrary(
+ library: LocalLibrary,
+ signal?: AbortSignal,
+): Promise<LocalLibraryData> {
+ const value = (await localRequest(
+ { sourcePath: library.sourcePath, indexPath: library.indexPath || null },
+ signal,
+ )) as LocalResponse
+ if (!value.source || !Array.isArray(value.source.skills))
+ throw new Error('Invalid local library response.')
+ let analysis: Dataset | null = null
+ let analysisError = value.analysisError
+ try {
+ if (value.graph) analysis = parseSnapshot(value.graph, `${value.name} · Analysis results`)
+ } catch (error) {
+ analysisError = error instanceof Error ? error.message : 'Invalid analysis snapshot.'
+ }
+ return {
+ source: value.source,
+ analysis,
+ analysisError,
+ analysisStatus: analysisError ? 'error' : analysis ? 'ready' : 'missing',
+ warnings: value.warnings,
+ changedSkills: value.changedSkills,
+ removedSkills: value.removedSkills,
+ addedSkills: value.addedSkills,
+ }
+}
diff --git a/frontend/src/main.tsx b/skillnet-ai/src/skillnet_ai/web/ui/src/main.tsx
similarity index 73%
rename from frontend/src/main.tsx
rename to skillnet-ai/src/skillnet_ai/web/ui/src/main.tsx
index 8b00f4f..c4c5b6d 100644
--- a/frontend/src/main.tsx
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/main.tsx
@@ -3,5 +3,7 @@ import ReactDOM from 'react-dom/client'
import App from './App'
ReactDOM.createRoot(document.getElementById('root')!).render(
- <React.StrictMode><App /></React.StrictMode>,
+ <React.StrictMode>
+ <App />
+ </React.StrictMode>,
)
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/persistence.ts b/skillnet-ai/src/skillnet_ai/web/ui/src/persistence.ts
new file mode 100644
index 0000000..d492664
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/persistence.ts
@@ -0,0 +1,158 @@
+import type { LocalLibrary } from './localLibrary'
+
+const databaseName = 'skillnet-workbench'
+const viewKey = 'skillnet-workbench-view-v1'
+
+export interface SavedView {
+ collection: string
+ sourceId: string
+ selectedSkillId: string
+}
+export interface SavedImport {
+ id: string
+ name: string
+ json: string
+}
+
+function openDatabase(): Promise<IDBDatabase> {
+ return new Promise((resolve, reject) => {
+ const request = indexedDB.open(databaseName, 2)
+ request.onupgradeneeded = () => {
+ const db = request.result
+ if (!db.objectStoreNames.contains('imports')) db.createObjectStore('imports')
+ if (!db.objectStoreNames.contains('libraries'))
+ db.createObjectStore('libraries', { keyPath: 'id' })
+ }
+ request.onsuccess = () => {
+ request.result.onversionchange = () => request.result.close()
+ resolve(request.result)
+ }
+ request.onerror = () => reject(request.error)
+ request.onblocked = () =>
+ reject(new Error('Close other SkillNet tabs to update browser storage.'))
+ })
+}
+
+async function transaction<T>(
+ store: string,
+ mode: IDBTransactionMode,
+ action: (store: IDBObjectStore) => () => T,
+): Promise<T> {
+ const db = await openDatabase()
+ return new Promise((resolve, reject) => {
+ try {
+ const tx = db.transaction(store, mode)
+ const result = action(tx.objectStore(store))
+ tx.oncomplete = () => {
+ db.close()
+ try {
+ resolve(result())
+ } catch (error) {
+ reject(error)
+ }
+ }
+ tx.onabort = tx.onerror = () => {
+ db.close()
+ reject(tx.error || new Error('Browser storage transaction failed.'))
+ }
+ } catch (error) {
+ db.close()
+ reject(error)
+ }
+ })
+}
+
+export function loadImports(): Promise<SavedImport[]> {
+ return transaction('imports', 'readonly', (store) => {
+ const values = store.getAll()
+ const keys = store.getAllKeys()
+ return () =>
+ values.result.flatMap((value: unknown, index): SavedImport[] => {
+ if (
+ typeof value !== 'object' ||
+ value === null ||
+ !('name' in value) ||
+ !('json' in value) ||
+ typeof value.name !== 'string' ||
+ typeof value.json !== 'string'
+ )
+ return []
+ return [
+ { id: `imported:${String(keys.result[index])}`, name: value.name, json: value.json },
+ ]
+ })
+ })
+}
+export function saveImport(value: SavedImport): Promise<void> {
+ return transaction('imports', 'readwrite', (store) => {
+ store.put({ name: value.name, json: value.json }, value.id.slice('imported:'.length))
+ return () => undefined
+ })
+}
+export function clearImport(id: string): Promise<void> {
+ return transaction('imports', 'readwrite', (store) => {
+ store.delete(id.slice('imported:'.length))
+ return () => undefined
+ })
+}
+export function loadLocalLibraries(): Promise<LocalLibrary[]> {
+ return transaction('libraries', 'readonly', (store) => {
+ const request = store.getAll()
+ return () =>
+ request.result.filter(
+ (item: unknown): item is LocalLibrary =>
+ typeof item === 'object' &&
+ item !== null &&
+ 'id' in item &&
+ typeof item.id === 'string' &&
+ 'name' in item &&
+ typeof item.name === 'string' &&
+ 'sourcePath' in item &&
+ typeof item.sourcePath === 'string' &&
+ (!('indexPath' in item) ||
+ item.indexPath === undefined ||
+ typeof item.indexPath === 'string'),
+ )
+ })
+}
+export function saveLocalLibrary(library: LocalLibrary): Promise<void> {
+ return transaction('libraries', 'readwrite', (store) => {
+ store.put(library)
+ return () => undefined
+ })
+}
+export function removeLocalLibrary(id: string): Promise<void> {
+ return transaction('libraries', 'readwrite', (store) => {
+ store.delete(id)
+ return () => undefined
+ })
+}
+export function loadView(): SavedView | null {
+ try {
+ const value: unknown = JSON.parse(localStorage.getItem(viewKey) ?? 'null')
+ if (
+ typeof value !== 'object' ||
+ value === null ||
+ !('collection' in value) ||
+ !('sourceId' in value) ||
+ !('selectedSkillId' in value)
+ )
+ return null
+ if (
+ typeof value.collection !== 'string' ||
+ typeof value.sourceId !== 'string' ||
+ typeof value.selectedSkillId !== 'string'
+ )
+ return null
+ return value as SavedView
+ } catch {
+ return null
+ }
+}
+export function saveView(view: SavedView): void {
+ try {
+ localStorage.setItem(viewKey, JSON.stringify(view))
+ } catch {
+ /* Browsing works without storage. */
+ }
+}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/selection.ts b/skillnet-ai/src/skillnet_ai/web/ui/src/selection.ts
new file mode 100644
index 0000000..c3709af
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/selection.ts
@@ -0,0 +1,13 @@
+import type { Dataset } from './data'
+
+export function firstConnectedSkill(dataset: Dataset): string {
+ const counts = new Map<string, number>()
+ for (const relation of dataset.relations) {
+ counts.set(relation.source, (counts.get(relation.source) ?? 0) + 1)
+ counts.set(relation.target, (counts.get(relation.target) ?? 0) + 1)
+ }
+ return dataset.skills.reduce(
+ (best, skill) => ((counts.get(skill.id) ?? 0) > (counts.get(best) ?? 0) ? skill.id : best),
+ dataset.skills[0]?.id ?? '',
+ )
+}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/styles.css b/skillnet-ai/src/skillnet_ai/web/ui/src/styles.css
new file mode 100644
index 0000000..b75b0be
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/styles.css
@@ -0,0 +1,1686 @@
+:root {
+ background: #f8fafb;
+ font-synthesis: none;
+ text-rendering: optimizeLegibility;
+ -webkit-font-smoothing: antialiased;
+}
+* {
+ box-sizing: border-box;
+}
+html {
+ scroll-behavior: smooth;
+}
+body {
+ margin: 0;
+}
+button,
+input {
+ font: inherit;
+}
+button {
+ cursor: pointer;
+}
+a {
+ color: inherit;
+ text-decoration: none;
+}
+:focus-visible {
+ outline: 3px solid #68bfa7;
+ outline-offset: 3px;
+}
+::selection {
+ background: #c9eee4;
+}
+.app-shell {
+ min-height: 100vh;
+}
+.site-header {
+ height: 70px;
+ border-bottom: 1px solid #e8edf1;
+ background: rgba(255, 255, 255, 0.92);
+}
+.site-header-inner {
+ max-width: 1480px;
+ height: 100%;
+ padding: 0 36px;
+ margin: auto;
+ display: flex;
+ align-items: center;
+ gap: 20px;
+}
+.brand {
+ display: flex;
+ align-items: center;
+ width: 126px;
+ height: 64px;
+ overflow: hidden;
+}
+.brand img {
+ display: block;
+ width: 126px;
+ height: auto;
+}
+.header-spacer {
+ flex: 1;
+}
+.header-link {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ font-weight: 650;
+}
+.header-link:hover {
+ color: #078869;
+}
+main {
+ max-width: 1480px;
+ margin: auto;
+ padding: 0 36px;
+}
+.dataset-bar {
+ background: #fff;
+ border: 1px solid #e3ebef;
+ display: flex;
+ align-items: center;
+ gap: 16px;
+}
+.dataset-actions {
+ display: flex;
+ gap: 9px;
+ align-items: center;
+}
+.text-button {
+ background: transparent;
+ border: 0;
+ color: #657887;
+ font-weight: 650;
+ font-size: 12px;
+ padding: 10px 12px;
+}
+.text-button:hover:not(:disabled) {
+ color: #0b8c70;
+}
+.text-button:disabled {
+ opacity: 0.45;
+ cursor: default;
+}
+.primary-button {
+ background: #078b6b;
+ border: 1px solid #078b6b;
+ color: #fff;
+ border-radius: 9px;
+ padding: 11px 15px;
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 12px;
+ font-weight: 730;
+ white-space: nowrap;
+}
+.primary-button:hover {
+ background: #067a5f;
+}
+.primary-button:disabled {
+ opacity: 0.65;
+ cursor: wait;
+}
+.visually-hidden {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+.error-banner {
+ display: flex;
+ gap: 9px;
+ align-items: center;
+ background: #fff6f3;
+ color: #a7503c;
+ border: 1px solid #f1cfc6;
+ border-radius: 10px;
+ padding: 11px 14px;
+ margin-top: 10px;
+ font-size: 13px;
+}
+.error-banner button {
+ margin-left: auto;
+ border: 0;
+ background: transparent;
+ color: inherit;
+ display: grid;
+ place-items: center;
+}
+.workbench-heading {
+ display: flex;
+ justify-content: space-between;
+ border-top: 1px solid #e5ebee;
+}
+.workbench-heading h2 {
+ margin: 5px 0 4px;
+ font-size: 22px;
+ letter-spacing: -0.025em;
+}
+.workbench-heading p {
+ font-size: 12px;
+ color: #83929c;
+ margin: 0;
+}
+.workspace {
+ display: grid;
+ grid-template-columns: minmax(255px, 280px) minmax(390px, 1fr) minmax(310px, 350px);
+ min-height: 602px;
+ border: 1px solid #dfe8ed;
+ background: #fff;
+ overflow: hidden;
+}
+.skill-panel,
+.graph-panel,
+.detail-panel {
+ min-width: 0;
+}
+.skill-panel,
+.graph-panel {
+ border-right: 1px solid #e4eaee;
+}
+.panel-title {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: 1px solid #edf1f3;
+}
+.panel-title > div:first-child {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+.panel-title span:not(.count-pill) {
+ font-weight: 750;
+}
+.panel-title > svg {
+ color: #a3b5bd;
+}
+.count-pill {
+ background: #f1f5f7;
+ border-radius: 6px;
+ padding: 5px 7px;
+ font-weight: 750;
+}
+.search-box {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ margin: 17px 14px 14px;
+ border: 1px solid #e1e8ec;
+ background: #f7f9fa;
+ border-radius: 8px;
+ padding: 0 11px;
+ color: #8ea0ac;
+}
+.search-box:focus-within {
+ background: #fff;
+ border-color: #8cc9b9;
+ box-shadow: 0 0 0 3px #e4f4ef;
+}
+.search-box input {
+ border: 0;
+ background: transparent;
+ outline: 0;
+ min-width: 0;
+ width: 100%;
+ color: #18344a;
+}
+.search-box button {
+ border: 0;
+ background: none;
+ color: #91a1a9;
+ display: grid;
+ place-items: center;
+ padding: 1px;
+}
+.list-caption {
+ font-weight: 730;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 19px 11px;
+ border-bottom: 1px solid #edf1f3;
+}
+.skill-list {
+ max-height: 482px;
+ overflow: auto;
+}
+.skill-row {
+ display: block;
+ width: 100%;
+ text-align: left;
+ border: 0;
+ border-bottom: 1px solid #eff2f4;
+ background: #fff;
+ padding: 14px 17px 12px 19px;
+ color: #263c4b;
+ position: relative;
+}
+.skill-row:hover {
+ background: #f8fbfa;
+}
+.skill-row.is-active {
+ background: #f0f9f6;
+}
+.skill-row.is-active:before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 3px;
+ background: #0c9877;
+}
+.skill-row-top {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+}
+.skill-row-top strong {
+ font-weight: 740;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ flex: 1;
+ text-transform: capitalize;
+}
+.skill-row-top > svg {
+ color: #a4b4bb;
+ opacity: 0;
+}
+.skill-row:hover .skill-row-top > svg,
+.skill-row.is-active .skill-row-top > svg {
+ opacity: 1;
+}
+.skill-row-description {
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ margin: 7px 0 8px 29px;
+}
+.skill-row-bottom {
+ display: flex;
+ justify-content: space-between;
+ gap: 6px;
+ margin-left: 29px;
+}
+.skill-row-bottom > span:first-child {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.skill-row-bottom > span:last-child {
+ display: flex;
+ align-items: center;
+ gap: 3px;
+ flex: none;
+}
+.no-results {
+ padding: 24px 18px;
+ line-height: 1.6;
+}
+.no-results button {
+ display: block;
+ border: 0;
+ background: none;
+ color: #0b8e70;
+ padding: 7px 0;
+}
+.graph-panel {
+ display: flex;
+ flex-direction: column;
+}
+.graph-tools {
+ display: flex;
+ background: #f3f7f8;
+ border-radius: 7px;
+ padding: 3px;
+ gap: 2px;
+}
+.graph-tools button {
+ border: 0;
+ border-radius: 5px;
+ padding: 6px 9px;
+ background: transparent;
+ font-weight: 730;
+}
+.graph-tools button.is-on {
+ background: #fff;
+ color: #146b5d;
+ box-shadow: 0 1px 4px rgba(15, 48, 62, 0.1);
+}
+.graph-subtitle {
+ display: flex;
+ align-items: center;
+ padding: 14px 20px 0;
+}
+.graph-subtitle strong {
+ font-weight: 750;
+}
+.graph-svg {
+ width: 100%;
+ height: 450px;
+ display: block;
+}
+.graph-node,
+.graph-edge {
+ cursor: pointer;
+}
+.graph-node:focus-visible,
+.graph-edge:focus-visible {
+ outline: none;
+}
+.graph-node:focus-visible .node-circle {
+ stroke: #17a47f;
+ stroke-width: 3;
+}
+.graph-edge:focus-visible .edge-line {
+ stroke-width: 4;
+}
+.node-circle {
+ transition:
+ fill 0.2s,
+ stroke 0.2s;
+}
+.node-core {
+ fill: #89aab7;
+}
+.graph-node.is-active .node-core {
+ fill: #139c7b;
+}
+.graph-node:hover .node-circle {
+ stroke: #139c7b;
+}
+.node-label {
+ font-weight: 640;
+ text-transform: capitalize;
+}
+.graph-node.is-active .node-label {
+ font-weight: 790;
+}
+.edge-line {
+ stroke: #adc0c6;
+ stroke-width: 1.8;
+ transition:
+ stroke 0.2s,
+ stroke-width 0.2s;
+}
+.graph-edge.compose_with .edge-line {
+ stroke: #67b9a4;
+}
+.graph-edge.is-selected .edge-line,
+.graph-edge:hover .edge-line {
+ stroke: #158d72;
+ stroke-width: 3;
+}
+.edge-hit {
+ stroke: transparent;
+ stroke-width: 16;
+}
+.graph-footer {
+ border-top: 1px solid #edf1f3;
+ height: 51px;
+ margin-top: auto;
+ padding: 0 19px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
+.legend {
+ display: flex;
+ gap: 12px;
+ flex-wrap: wrap;
+}
+.legend > span {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+}
+.legend-line {
+ width: 14px;
+ height: 0;
+ border-top: 2px solid;
+}
+.legend-line.compose {
+ border-color: #67b9a4;
+}
+.legend-line.similar {
+ border-top-style: dotted;
+}
+.graph-empty {
+ flex: 1;
+ min-height: 450px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ gap: 8px;
+ color: #60798a;
+ padding: 30px;
+}
+.graph-empty-symbol {
+ display: grid;
+ place-items: center;
+ height: 58px;
+ width: 58px;
+ border-radius: 50%;
+ background: #f0f7f7;
+ color: #88adb0;
+ font-size: 38px;
+ font-weight: 200;
+}
+.graph-empty strong {
+ font-size: 14px;
+ color: #355266;
+}
+.graph-empty span {
+ max-width: 280px;
+ line-height: 1.6;
+}
+.detail-panel {
+ background: #fff;
+}
+.inspector-content {
+ padding: 20px;
+ max-height: 530px;
+ overflow: auto;
+}
+.inspector-content h2 {
+ line-height: 1.3;
+ letter-spacing: -0.035em;
+ margin: 0 0 7px;
+ overflow-wrap: anywhere;
+}
+.skill-path {
+ display: flex;
+ align-items: flex-start;
+ gap: 6px;
+ line-height: 1.5;
+ overflow-wrap: anywhere;
+}
+.skill-path svg {
+ flex: none;
+ margin-top: 1px;
+}
+.field-label {
+ font-weight: 800;
+}
+.capability-card p {
+ margin: 8px 0 0;
+}
+.profile-groups {
+ border-bottom: 1px solid #e8edf0;
+ padding-bottom: 5px;
+}
+.profile-group {
+ margin: 0 0 15px;
+}
+.profile-group h3,
+.inspector-section h3 {
+ color: #344d5f;
+ margin: 0 0 8px;
+}
+.profile-item {
+ line-height: 1.55;
+ margin: 5px 0;
+}
+.profile-item button {
+ border: 0;
+ background: #ecf6f3;
+ color: #20836e;
+ font-weight: 750;
+ padding: 2px 4px;
+ margin-left: 4px;
+ border-radius: 4px;
+}
+.inspector-section {
+ padding: 19px 0;
+ border-top: 1px solid #e9eef0;
+}
+.section-heading {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 12px;
+}
+.section-heading h3 {
+ margin: 0;
+}
+.section-heading span {
+ font-size: 10px;
+ color: #a4b2b9;
+}
+.related-list {
+ display: flex;
+ flex-direction: column;
+}
+.related-list button {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ width: 100%;
+ text-align: left;
+ background: #fff;
+}
+.related-list button > span:nth-child(2) {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ flex: 1;
+}
+.related-list small {
+ white-space: nowrap;
+}
+.related-list svg {
+ color: #9dafb7;
+}
+.small-dot {
+ height: 7px;
+ width: 7px;
+ border-radius: 50%;
+ background: #87b1bf;
+ flex: none;
+}
+.small-dot.compose_with {
+ background: #54aa94;
+}
+.small-dot.similar_to {
+ background: #a9a2c9;
+}
+.source-section {
+ padding-bottom: 2px;
+}
+.source-frame {
+ max-height: 315px;
+ overflow: auto;
+ border: 1px solid #e6edf0;
+ background: #fbfcfd;
+ border-radius: 8px;
+ padding: 8px 0;
+ font-family: 'Cascadia Code', Consolas, monospace;
+}
+.source-line {
+ display: flex;
+ white-space: pre;
+ min-height: 16px;
+}
+.source-line.is-highlighted {
+ background: #e6f5e7;
+ box-shadow: inset 2px 0 #0f9b78;
+}
+.source-number {
+ width: 33px;
+ flex: none;
+ text-align: right;
+ padding-right: 8px;
+ user-select: none;
+}
+.source-text {
+ padding-right: 10px;
+}
+.relation-badge {
+ display: inline-flex;
+ font-size: 10px;
+ font-weight: 800;
+ padding: 5px 8px;
+ border-radius: 5px;
+ background: #e7f5f0;
+ color: #14745d;
+}
+.relation-badge.similar_to {
+ background: #f0edfa;
+ color: #7666a6;
+}
+.relation-path {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ margin: 14px 0 18px;
+ line-height: 1.4;
+}
+.relation-path button {
+ border: 1px solid #dfe9ec;
+ background: #fff;
+ border-radius: 6px;
+ padding: 7px;
+ color: #385667;
+ font-size: 10px;
+ overflow-wrap: anywhere;
+ min-width: 0;
+}
+.relation-path button:hover {
+ border-color: #95cdbd;
+}
+.relation-path span {
+ color: #81a9a5;
+ flex: none;
+}
+.section-index {
+ font-size: 9px;
+ letter-spacing: 0.1em;
+ color: #9caeb8;
+ font-weight: 800;
+ margin-bottom: 7px;
+}
+.inspector-section p {
+ line-height: 1.62;
+ margin: 0 0 10px;
+}
+.condition-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 5px;
+ margin: 10px 0;
+}
+.condition-list span {
+ font-size: 9px;
+ color: #68826f;
+ background: #edf7ec;
+ border-radius: 5px;
+ padding: 4px 6px;
+}
+.evidence-group {
+ display: flex;
+ align-items: flex-start;
+ flex-wrap: wrap;
+ gap: 6px;
+ margin: 11px 0;
+}
+.evidence-group .field-label {
+ width: 100%;
+}
+.evidence-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ border: 1px solid #dcece7;
+ background: #f9fcfb;
+ border-radius: 5px;
+ color: #347d6e;
+ font-size: 9px;
+ padding: 5px 6px;
+ max-width: 100%;
+ overflow-wrap: anywhere;
+}
+.evidence-link:hover {
+ background: #e9f6f0;
+}
+.muted {
+ color: #9caab2 !important;
+}
+.dataset-bar {
+ margin-top: 22px;
+ padding: 12px 16px;
+}
+.workbench-heading {
+ padding: 13px 2px 12px;
+ align-items: center;
+}
+.workbench-heading h1 {
+ margin: 0;
+ letter-spacing: -0.02em;
+}
+.skill-list {
+ scrollbar-color: #d3e1e3 transparent;
+ scrollbar-width: thin;
+}
+@media (max-width: 1160px) {
+ .workspace {
+ grid-template-columns: 280px minmax(0, 1fr);
+ }
+ .graph-panel {
+ border-right: 0;
+ }
+ .detail-panel {
+ grid-column: 1/-1;
+ border-top: 1px solid #e4eaee;
+ }
+ .inspector-content {
+ max-height: none;
+ }
+ .source-frame {
+ max-height: 320px;
+ }
+}
+@media (max-width: 760px) {
+ .site-header-inner,
+ main {
+ padding-left: 18px;
+ padding-right: 18px;
+ }
+ .site-header {
+ height: 62px;
+ }
+ .brand {
+ width: 101px;
+ height: 59px;
+ }
+ .brand img {
+ width: 101px;
+ }
+ .header-link {
+ display: none;
+ }
+ .dataset-bar {
+ align-items: flex-start;
+ padding: 14px;
+ flex-wrap: wrap;
+ }
+ .dataset-actions {
+ justify-content: flex-end;
+ }
+ .workbench-heading {
+ padding-top: 15px;
+ }
+ .workbench-heading h2 {
+ font-size: 20px;
+ }
+ .workbench-heading p {
+ line-height: 1.5;
+ }
+ .workspace {
+ display: block;
+ }
+ .skill-panel,
+ .graph-panel {
+ border-right: 0;
+ border-bottom: 1px solid #e4eaee;
+ }
+ .skill-list {
+ max-height: 310px;
+ }
+ .graph-svg {
+ height: auto;
+ min-height: 320px;
+ }
+ .graph-footer {
+ height: auto;
+ min-height: 49px;
+ padding: 10px 14px;
+ flex-wrap: wrap;
+ }
+ .graph-footer > span {
+ display: none;
+ }
+ .inspector-content {
+ max-height: none;
+ }
+}
+@media (max-width: 430px) {
+ .site-header-inner {
+ gap: 10px;
+ }
+ .dataset-actions {
+ justify-content: space-between;
+ }
+ .text-button {
+ padding-left: 0;
+ }
+ .legend {
+ gap: 7px;
+ }
+}
+:root {
+ font-family:
+ Inter, 'Segoe UI Variable', 'Segoe UI', 'Microsoft YaHei UI', 'Noto Sans SC', sans-serif;
+ color: #203544;
+}
+.header-link {
+ font-size: 13px;
+ color: #526a78;
+}
+.text-button,
+.primary-button {
+ font-size: 13px;
+}
+.primary-button {
+ min-height: 42px;
+}
+.workbench-heading h1 {
+ font-size: 20px;
+}
+.panel-title span:not(.count-pill) {
+ font-size: 11px;
+ color: #607483;
+ letter-spacing: 0.04em;
+}
+.count-pill {
+ font-size: 12px;
+ color: #526b78;
+}
+.search-box {
+ height: 43px;
+}
+.search-box input {
+ font-size: 13px;
+}
+.search-box input::placeholder {
+ color: #647786;
+}
+.list-caption {
+ font-size: 11px;
+ color: #607483;
+}
+.skill-row {
+ padding-top: 15px;
+ padding-bottom: 14px;
+}
+.skill-row-top strong {
+ font-size: 13px;
+}
+.skill-row-description {
+ font-size: 12px;
+ line-height: 1.5;
+ color: #536a78;
+ height: auto;
+ min-height: 36px;
+ margin-top: 8px;
+ margin-bottom: 8px;
+}
+.skill-row-bottom {
+ font-size: 10.5px;
+ color: #607483;
+}
+.no-results {
+ font-size: 13px;
+ color: #526b78;
+}
+.graph-tools button {
+ font-size: 11px;
+ color: #5b6f7d;
+ min-height: 32px;
+}
+.graph-subtitle {
+ font-size: 12px;
+ color: #5b6f7d;
+}
+.graph-subtitle strong {
+ color: #3e5969;
+}
+.node-label {
+ fill: #4b6573;
+}
+.graph-node.is-active .node-label {
+ fill: #164d41;
+}
+.graph-footer {
+ font-size: 11px;
+ color: #5b6f7d;
+}
+.graph-empty span {
+ font-size: 12px;
+}
+.graph-canvas {
+ display: flex;
+ min-width: 0;
+ flex: 1;
+}
+.graph-mobile-help {
+ display: none;
+}
+.inspector-content h2 {
+ font-size: 20px;
+}
+.skill-path {
+ font-size: 11px;
+ color: #5b6f7d;
+}
+.field-label {
+ font-size: 11px;
+ letter-spacing: 0.03em;
+}
+.capability-card p {
+ font-size: 13px;
+ line-height: 1.6;
+ color: #3e5963;
+}
+.profile-group h3,
+.inspector-section h3 {
+ font-size: 13px;
+}
+.profile-item {
+ font-size: 12px;
+ color: #526b78;
+}
+.profile-item button {
+ font-size: 10px;
+}
+.section-heading span,
+.section-index {
+ font-size: 11px;
+ color: #607483;
+}
+.related-list button {
+ font-size: 11.5px;
+ color: #405b68;
+}
+.related-list small {
+ font-size: 10.5px;
+ color: #5b6f7d;
+}
+.source-frame {
+ font-size: 11px;
+ line-height: 1.6;
+}
+.source-number {
+ color: #607483;
+}
+.source-text {
+ color: #455e6c;
+}
+.inspector-section p {
+ font-size: 12.5px;
+ color: #506775;
+}
+.relation-path button,
+.condition-list span,
+.evidence-link {
+ font-size: 11px;
+}
+@media (min-width: 1161px) {
+ .workspace {
+ grid-template-columns: minmax(285px, 300px) minmax(390px, 1fr) minmax(345px, 370px);
+ }
+}
+@media (max-width: 760px) {
+ .workbench-heading h1 {
+ font-size: 19px;
+ }
+ .skill-row-top strong {
+ font-size: 13.5px;
+ }
+ .skill-row-description {
+ font-size: 12.5px;
+ }
+ .graph-footer {
+ font-size: 11px;
+ }
+}
+@media (max-width: 760px) {
+ .graph-canvas {
+ overflow-x: auto;
+ overscroll-behavior-x: contain;
+ scrollbar-width: thin;
+ }
+ .graph-canvas .graph-svg {
+ width: 680px;
+ min-width: 680px;
+ height: 460px;
+ min-height: 0;
+ }
+}
+@media (max-width: 760px) {
+ .graph-footer .graph-desktop-help {
+ display: none;
+ }
+ .graph-footer .graph-mobile-help {
+ display: block;
+ flex-basis: 100%;
+ }
+}
+.app-shell {
+ background: #f8fafb;
+}
+.dataset-bar {
+ border-radius: 12px;
+ box-shadow: none;
+}
+.primary-button {
+ box-shadow: none;
+}
+.workspace {
+ border-radius: 12px;
+ box-shadow: none;
+}
+.panel-title {
+ height: 62px;
+ padding: 16px 20px;
+}
+.panel-title strong {
+ font-size: 16px;
+ letter-spacing: 0;
+}
+.skill-row-description,
+.skill-row-bottom {
+ margin-left: 0;
+}
+.graph-panel {
+ background: #fff;
+}
+.capability-card {
+ background: transparent;
+ border: 0;
+ border-left: 2px solid #7db6a6;
+ border-radius: 0;
+ padding: 1px 0 1px 13px;
+ margin: 20px 0 24px;
+}
+.field-label {
+ color: #4e6671;
+}
+.related-list {
+ gap: 0;
+}
+.related-list button {
+ border: 0;
+ border-bottom: 1px solid #e7eef0;
+ border-radius: 0;
+ padding: 9px 4px;
+}
+.related-list button:hover {
+ border-color: #e7eef0;
+ background: #f7faf9;
+}
+@media (max-width: 760px) {
+ .panel-title {
+ height: 60px;
+ }
+}
+.collection-control {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ color: #5b6f7d;
+ font-size: 12px;
+ white-space: nowrap;
+}
+.collection-control select {
+ max-width: 220px;
+ min-height: 40px;
+ border: 1px solid #dce6e9;
+ border-radius: 8px;
+ background: #fff;
+ color: #223d4c;
+ padding: 0 30px 0 11px;
+ font: inherit;
+ font-weight: 650;
+ cursor: pointer;
+}
+.collection-control select:focus-visible {
+ outline: 2px solid #168e72;
+ outline-offset: 2px;
+}
+.dataset-actions {
+ flex: none;
+}
+@media (max-width: 760px) {
+ .collection-control {
+ flex: 1 1 auto;
+ }
+ .collection-control select {
+ width: 100%;
+ max-width: none;
+ }
+ .dataset-actions {
+ width: auto;
+ }
+ .dataset-bar {
+ gap: 12px;
+ }
+}
+@media (max-width: 430px) {
+ .collection-control,
+ .dataset-actions {
+ width: 100%;
+ }
+ .dataset-actions .primary-button {
+ width: 100%;
+ justify-content: center;
+ }
+}
+.graph-subtitle {
+ flex-wrap: wrap;
+ line-height: 1.45;
+ gap: 7px 12px;
+}
+.graph-subtitle strong {
+ white-space: nowrap;
+}
+.graph-subtitle span {
+ color: #6d8390;
+}
+.graph-subtitle .graph-limit {
+ flex-basis: 100%;
+}
+.graph-relation-control {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ color: #617987;
+ font-size: 11px;
+}
+.graph-relation-control select {
+ border: 1px solid #dce6e9;
+ border-radius: 6px;
+ background: #fff;
+ color: #315467;
+ font-size: 11px;
+ padding: 4px 6px;
+}
+.graph-relation-control select:focus-visible {
+ outline: 2px solid #168e72;
+ outline-offset: 2px;
+}
+.graph-edge.similar_to .edge-line {
+ stroke: #8569aa;
+ stroke-width: 2.3;
+ stroke-dasharray: 3 5;
+ stroke-linecap: round;
+}
+.graph-edge.similar_to.is-selected .edge-line,
+.graph-edge.similar_to:hover .edge-line {
+ stroke: #684397;
+ stroke-width: 3;
+}
+.legend-line.similar {
+ border-color: #8569aa;
+}
+.graph-edge.is-parallel .edge-hit {
+ stroke-width: 10;
+}
+.node-hit {
+ fill: transparent;
+ pointer-events: all;
+}
+.node-halo {
+ fill: #e6f4ef;
+}
+.node-circle {
+ fill: #88a8b5;
+ stroke: #fff;
+ stroke-width: 2;
+}
+.graph-node.is-active .node-circle {
+ fill: #fff;
+ stroke: #139c7b;
+ stroke-width: 2.4;
+}
+.node-label {
+ paint-order: stroke fill;
+ stroke: #fff;
+ stroke-width: 4;
+ stroke-linejoin: round;
+ pointer-events: visiblePainted;
+}
+.node-label {
+ font-size: 13px;
+}
+.graph-svg.is-expanded .graph-edge.is-secondary .edge-line {
+ opacity: 0.28;
+}
+.graph-svg.is-expanded
+ .graph-edge.is-secondary:is(:hover, .is-selected, :focus-visible)
+ .edge-line {
+ opacity: 1;
+}
+.profile-source-label {
+ font-size: 11px;
+ font-weight: 700;
+ color: #547080;
+ padding: 0 0 10px;
+}
+.relation-provenance {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+}
+.relation-provenance > span {
+ font-size: 11px;
+ color: #607888;
+}
+.skill-row-bottom .skill-row-markers {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+}
+.skill-row-markers > span:last-child {
+ display: flex;
+ align-items: center;
+ gap: 3px;
+}
+.graph-view-controls {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+.graph-view-controls .graph-tools {
+ flex: none;
+}
+.relation-list-view {
+ display: flex;
+ flex-direction: column;
+ min-height: 450px;
+ max-height: 450px;
+ flex: 1;
+ padding: 12px 14px 0;
+}
+.relation-search {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ border: 1px solid #dfe8ec;
+ background: #f8fafb;
+ border-radius: 7px;
+ padding: 0 10px;
+ height: 37px;
+ color: #6b8694;
+ flex: none;
+}
+.relation-search input {
+ width: 100%;
+ border: 0;
+ outline: 0;
+ background: transparent;
+ color: #274556;
+ font-size: 12px;
+}
+.relation-list {
+ overflow: auto;
+ margin-top: 10px;
+ scrollbar-color: #d3e1e3 transparent;
+}
+.relation-row {
+ display: flex;
+ flex-direction: column;
+ gap: 5px;
+ width: 100%;
+ border: 0;
+ border-bottom: 1px solid #e9eef1;
+ background: #fff;
+ padding: 10px 5px;
+ text-align: left;
+}
+.relation-row:hover,
+.relation-row.is-active {
+ background: #f3faf7;
+}
+.relation-row-path {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ color: #2e4a5b;
+ min-width: 0;
+}
+.relation-row-path strong {
+ font-size: 12px;
+ font-weight: 650;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.relation-row-path > span {
+ color: #6aa995;
+ flex: none;
+}
+.relation-row-detail {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-width: 0;
+ color: #657e8a;
+ font-size: 11px;
+}
+.relation-row-detail > span {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.relation-row-detail .relation-badge {
+ font-size: 10px;
+ flex: none;
+}
+.relation-list-empty {
+ font-size: 12px;
+ color: #6b8290;
+ padding: 18px 4px;
+}
+@media (max-width: 760px) {
+ .graph-view-controls {
+ gap: 4px;
+ }
+ .graph-view-controls .graph-tools button {
+ padding: 5px 7px;
+ }
+ .relation-list-view {
+ min-height: 360px;
+ max-height: 360px;
+ }
+ .relation-row-path strong {
+ font-size: 11px;
+ }
+}
+
+.dataset-bar {
+ flex-wrap: wrap;
+}
+.dataset-summary {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ margin-left: auto;
+ color: #5b6f7d;
+ font-size: 12px;
+ white-space: nowrap;
+}
+.dataset-summary span + span {
+ padding-left: 14px;
+ border-left: 1px solid #dce6e9;
+}
+.dataset-summary strong {
+ color: #18364b;
+ font-size: 14px;
+ font-weight: 750;
+}
+.local-library-menu {
+ position: relative;
+ font-size: 12px;
+ color: #496474;
+ flex: none;
+}
+.local-library-menu summary {
+ list-style: none;
+ cursor: pointer;
+ padding: 10px 12px;
+ border: 1px solid #dce6e9;
+ border-radius: 8px;
+ background: #fff;
+ font-weight: 650;
+ white-space: nowrap;
+}
+.local-library-menu summary::-webkit-details-marker {
+ display: none;
+}
+.local-library-menu > div {
+ position: absolute;
+ z-index: 20;
+ top: calc(100% + 5px);
+ left: 0;
+ width: min(330px, 80vw);
+ padding: 9px;
+ background: #fff;
+ border: 1px solid #dce6e9;
+ border-radius: 9px;
+ box-shadow: 0 12px 30px rgba(16, 48, 69, 0.14);
+}
+.local-library-menu label {
+ display: block;
+ padding: 6px 9px;
+ color: #536d79;
+ font-size: 11px;
+}
+.local-library-menu input {
+ display: block;
+ width: 100%;
+ margin-top: 5px;
+ padding: 8px;
+ border: 1px solid #dce6e9;
+ border-radius: 6px;
+ color: #223d4c;
+ font: inherit;
+}
+.local-path {
+ margin: 4px 9px;
+ padding: 7px 0;
+ color: #6b7d89;
+ font-size: 11px;
+ line-height: 1.4;
+ overflow-wrap: anywhere;
+ border-bottom: 1px solid #e7edef;
+}
+.local-library-menu button {
+ display: block;
+ width: 100%;
+ padding: 9px 10px;
+ border: 0;
+ background: #fff;
+ text-align: left;
+ color: #314c5c;
+ font: inherit;
+ cursor: pointer;
+ white-space: nowrap;
+}
+.local-library-menu button:hover {
+ background: #eef7f4;
+ color: #087b61;
+}
+.stale-banner {
+ margin-top: 10px;
+ padding: 10px 14px;
+ border: 1px solid #ead7a4;
+ border-radius: 9px;
+ background: #fff9e9;
+ color: #765c18;
+ font-size: 12px;
+}
+@media (max-width: 760px) {
+ .dataset-summary {
+ margin-left: 0;
+ }
+ .dataset-actions {
+ margin-left: auto;
+ }
+}
+@media (max-width: 430px) {
+ .dataset-summary {
+ order: 3;
+ width: 100%;
+ justify-content: flex-end;
+ }
+ .dataset-actions {
+ margin-left: 0;
+ }
+}
+
+.onboarding {
+ max-width: 940px;
+ margin: 28px auto 52px;
+ padding: 30px 34px;
+ background: #fff;
+ border: 1px solid #e3ebef;
+ border-radius: 12px;
+}
+.onboarding-intro > span {
+ font-size: 11px;
+ font-weight: 750;
+ letter-spacing: 0.08em;
+ color: #16866d;
+}
+.onboarding-intro h1 {
+ margin: 9px 0 8px;
+ font-size: 27px;
+ letter-spacing: -0.03em;
+ color: #19394a;
+}
+.onboarding-intro p,
+.onboarding-choice p,
+.onboarding-next p {
+ margin: 0;
+ color: #5b7280;
+ font-size: 13px;
+ line-height: 1.65;
+}
+.onboarding-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 16px;
+ margin-top: 26px;
+}
+.onboarding-choice {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 12px;
+ min-width: 0;
+ padding: 23px;
+ border: 1px solid #e1e9ed;
+ border-radius: 9px;
+ background: #fcfdfd;
+}
+.onboarding-choice h2,
+.onboarding-connected h2,
+.onboarding-next h2 {
+ margin: 0;
+ color: #284757;
+ font-size: 16px;
+}
+.onboarding-choice p {
+ flex: 1;
+}
+.onboarding-choice code,
+.onboarding-next code,
+.onboarding-empty-path code {
+ font-family: 'Cascadia Code', Consolas, monospace;
+ font-size: 12px;
+ overflow-wrap: anywhere;
+}
+.onboarding-choice label {
+ display: block;
+ width: 100%;
+ color: #526d7a;
+ font-size: 12px;
+}
+.onboarding-choice input {
+ display: block;
+ width: 100%;
+ margin-top: 7px;
+ padding: 10px 11px;
+ border: 1px solid #dce6e9;
+ border-radius: 7px;
+ color: #274354;
+ font: inherit;
+}
+.onboarding-secondary {
+ min-height: 42px;
+ padding: 9px 15px;
+ border: 1px solid #b9d9cf;
+ border-radius: 8px;
+ background: #fff;
+ color: #0d765f;
+ font-size: 13px;
+ font-weight: 700;
+ cursor: pointer;
+}
+.onboarding-secondary:hover {
+ background: #f0f8f5;
+}
+.onboarding button:disabled {
+ opacity: 0.55;
+ cursor: wait;
+}
+.onboarding-connected {
+ margin-top: 24px;
+}
+.onboarding-connected h2 {
+ margin-bottom: 9px;
+}
+.onboarding-connected button {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ width: 100%;
+ padding: 12px 14px;
+ border: 1px solid #e1e9ed;
+ border-radius: 7px;
+ background: #fff;
+ color: #284757;
+ text-align: left;
+ font-size: 13px;
+ font-weight: 700;
+ cursor: pointer;
+}
+.onboarding-connected button + button {
+ margin-top: 7px;
+}
+.onboarding-connected button:hover {
+ border-color: #a7d0c3;
+ background: #f8fcfa;
+}
+.onboarding-connected small {
+ display: block;
+ margin-top: 3px;
+ color: #718894;
+ font-size: 11px;
+ font-weight: 400;
+ overflow-wrap: anywhere;
+}
+.onboarding-empty-path {
+ display: flex;
+ flex-direction: column;
+ gap: 7px;
+ margin: 23px 0;
+ padding: 15px 18px;
+ border: 1px solid #dceae5;
+ border-radius: 8px;
+ background: #f6faf8;
+}
+.onboarding-empty-path strong {
+ font-size: 11px;
+ color: #5a786e;
+}
+.onboarding-empty-path code {
+ color: #244a40;
+}
+.onboarding-next h2 {
+ margin-bottom: 9px;
+}
+.onboarding-next > code {
+ display: block;
+ margin: 12px 0;
+ padding: 12px;
+ background: #f6f8f9;
+ border: 1px solid #e5ecee;
+ border-radius: 6px;
+ color: #345365;
+}
+.onboarding-next .primary-button {
+ margin-top: 17px;
+}
+@media (max-width: 760px) {
+ .onboarding {
+ margin: 16px 0 36px;
+ padding: 22px 19px;
+ }
+ .onboarding-grid {
+ grid-template-columns: 1fr;
+ gap: 10px;
+ }
+ .onboarding-intro h1 {
+ font-size: 23px;
+ }
+ .onboarding-choice {
+ padding: 17px;
+ }
+}
+.primary-button,
+.onboarding-secondary,
+.onboarding-connected button,
+.local-library-menu summary,
+.graph-tools,
+.graph-tools button {
+ border-radius: 0;
+}
+
+.dataset-controls {
+ border: 0;
+ padding: 0;
+ margin: 0;
+ min-width: 0;
+}
+.graph-empty code {
+ max-width: 100%;
+ overflow-wrap: anywhere;
+ font-size: 12px;
+}
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/src/useWorkspace.ts b/skillnet-ai/src/skillnet_ai/web/ui/src/useWorkspace.ts
new file mode 100644
index 0000000..5f111c9
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/src/useWorkspace.ts
@@ -0,0 +1,310 @@
+import { useEffect, useRef, useState } from 'react'
+import { parseSnapshot } from './data'
+import type { Dataset } from './data'
+import { createDefaultLibrary, initialLibraryPath, readLocalLibrary } from './localLibrary'
+import type { LocalLibrary, LocalLibraryData } from './localLibrary'
+import {
+ clearImport,
+ loadImports,
+ loadLocalLibraries,
+ loadView,
+ removeLocalLibrary,
+ saveImport,
+ saveLocalLibrary,
+ saveView,
+} from './persistence'
+import { firstConnectedSkill } from './selection'
+
+const empty: Dataset = { kind: 'source', title: 'My skill library', skills: [], relations: [] }
+type Imported = { id: string; dataset: Dataset }
+
+function comparablePath(value: string) {
+ const path = value.replaceAll('\\', '/').replace(/\/+$/, '')
+ return /^[a-zA-Z]:|^\/\//.test(path) ? path.toLowerCase() : path
+}
+
+export function useWorkspace() {
+ const [dataset, setDataset] = useState<Dataset>(empty)
+ const [localData, setLocalData] = useState<LocalLibraryData | null>(null)
+ const [localLibraries, setLocalLibraries] = useState<LocalLibrary[]>([])
+ const [importedDatasets, setImportedDatasets] = useState<Imported[]>([])
+ const [collection, setCollection] = useState('personal')
+ const [sourceId, setSourceId] = useState('personal')
+ const [selectedSkillId, setSelectedSkillId] = useState('')
+ const [error, setError] = useState<string | null>(null)
+ const [loading, setLoading] = useState(false)
+ const [restoring, setRestoring] = useState(true)
+ const operation = useRef<AbortController | null>(null)
+
+ const select = (
+ data: Dataset,
+ library: string,
+ source: string,
+ local: LocalLibraryData | null = null,
+ selected = '',
+ ) => {
+ setDataset(data)
+ setCollection(library)
+ setSourceId(source)
+ setLocalData(local)
+ setSelectedSkillId(
+ data.skills.some((skill) => skill.id === selected) ? selected : firstConnectedSkill(data),
+ )
+ }
+ const selectLocal = (
+ library: LocalLibrary,
+ data: LocalLibraryData,
+ preferred = 'local-source',
+ selected = '',
+ ) => {
+ const analysis = preferred === 'local-analysis' && data.analysis
+ select(
+ analysis || data.source,
+ library.id,
+ analysis ? 'local-analysis' : 'local-source',
+ data,
+ selected,
+ )
+ }
+
+ // Every asynchronous user action passes through one gate. Controls cannot launch
+ // overlapping reads/writes, and unmounted or superseded requests cannot publish state.
+ const run = async (work: (signal: AbortSignal) => Promise<() => void>) => {
+ if (operation.current || restoring) return
+ const controller = new AbortController()
+ operation.current = controller
+ setLoading(true)
+ setError(null)
+ try {
+ const commit = await work(controller.signal)
+ if (!controller.signal.aborted) commit()
+ } catch (cause) {
+ if (!controller.signal.aborted)
+ setError(cause instanceof Error ? cause.message : 'Could not load the library.')
+ } finally {
+ if (!controller.signal.aborted) {
+ operation.current = null
+ setLoading(false)
+ }
+ }
+ }
+
+ useEffect(() => {
+ const controller = new AbortController()
+ operation.current = controller
+ const restore = async () => {
+ try {
+ const [savedImports, libraries, initialPath] = await Promise.all([
+ loadImports().catch(() => []),
+ loadLocalLibraries().catch((): LocalLibrary[] => []),
+ initialLibraryPath(),
+ ])
+ if (controller.signal.aborted) return
+ const imported = savedImports.flatMap((item) => {
+ try {
+ return [{ id: item.id, dataset: parseSnapshot(JSON.parse(item.json), item.name) }]
+ } catch {
+ return []
+ }
+ })
+ setImportedDatasets(imported)
+ setLocalLibraries(libraries)
+ const view = loadView()
+ let local = initialPath
+ ? libraries.find(
+ (item) => comparablePath(item.sourcePath) === comparablePath(initialPath),
+ )
+ : libraries.find((item) => item.id === view?.collection)
+ if (initialPath && !local) {
+ local = {
+ id: `local:initial:${encodeURIComponent(initialPath)}`,
+ name:
+ initialPath
+ .replace(/[\\/]+$/, '')
+ .split(/[\\/]/)
+ .pop() || initialPath,
+ sourcePath: initialPath,
+ }
+ // A command-line folder remains usable even if browser storage is unavailable.
+ await saveLocalLibrary(local).catch(() => undefined)
+ libraries.push(local)
+ }
+ if (local) {
+ const result = await readLocalLibrary(local, controller.signal)
+ if (controller.signal.aborted) return
+ setLocalLibraries([...libraries])
+ selectLocal(
+ local,
+ result,
+ view?.collection === local.id ? view.sourceId : 'local-source',
+ view?.selectedSkillId,
+ )
+ } else if (view?.sourceId === 'imported') {
+ const item = imported.find((item) => item.id === view.collection)
+ if (item) select(item.dataset, item.id, 'imported', null, view.selectedSkillId)
+ }
+ } catch (cause) {
+ if (!controller.signal.aborted)
+ setError(cause instanceof Error ? cause.message : 'Could not restore the last library.')
+ } finally {
+ if (!controller.signal.aborted) {
+ operation.current = null
+ setRestoring(false)
+ }
+ }
+ }
+ void restore()
+ return () => {
+ controller.abort()
+ operation.current?.abort()
+ operation.current = null
+ }
+ // Restoration runs once; later changes are explicit user operations.
+ }, [])
+
+ useEffect(() => {
+ if (!restoring) saveView({ collection, sourceId, selectedSkillId })
+ }, [restoring, collection, sourceId, selectedSkillId])
+
+ const showPersonalLibrary = () => select(empty, 'personal', 'personal')
+ const openLocalLibrary = (library: LocalLibrary, preferred = sourceId) =>
+ run(async (signal) => {
+ const result = await readLocalLibrary(library, signal)
+ return () =>
+ selectLocal(library, result, preferred, library.id === collection ? selectedSkillId : '')
+ })
+ const connect = async (sourcePath: string, signal: AbortSignal) => {
+ if (!sourcePath.trim()) throw new Error('Enter a skills folder path.')
+ const existing = localLibraries.find(
+ (item) => comparablePath(item.sourcePath) === comparablePath(sourcePath),
+ )
+ const library = existing ?? {
+ id: `local:${crypto.randomUUID()}`,
+ name:
+ sourcePath
+ .replace(/[\\/]+$/, '')
+ .split(/[\\/]/)
+ .pop() || sourcePath,
+ sourcePath,
+ }
+ const result = await readLocalLibrary(library, signal)
+ let warning: string | null = null
+ if (!existing)
+ await saveLocalLibrary(library).catch(() => {
+ warning = 'Folder opened, but the browser could not save its connection.'
+ })
+ return () => {
+ if (!existing) setLocalLibraries((previous) => [...previous, library])
+ selectLocal(library, result)
+ setError(warning)
+ }
+ }
+ const connectLocalLibrary = (path: string) => run((signal) => connect(path.trim(), signal))
+ const createPersonalLibrary = () =>
+ run(async (signal) => connect(await createDefaultLibrary(), signal))
+ const updateIndex = (indexPath?: string) =>
+ run(async (signal) => {
+ const library = localLibraries.find((item) => item.id === collection)
+ if (!library) throw new Error('Select a local library first.')
+ const updated = { ...library, indexPath }
+ const result = await readLocalLibrary(updated, signal)
+ if (indexPath && !result.analysis)
+ throw new Error(result.analysisError || 'The folder has no current analysis.')
+ let warning: string | null = null
+ await saveLocalLibrary(updated).catch(() => {
+ warning = 'Analysis folder changed, but the browser could not save the connection.'
+ })
+ return () => {
+ setLocalLibraries((previous) =>
+ previous.map((item) => (item.id === updated.id ? updated : item)),
+ )
+ selectLocal(updated, result, 'local-analysis')
+ setError(warning)
+ }
+ })
+ const forgetLocalLibrary = () =>
+ run(async () => {
+ let warning: string | null = null
+ await removeLocalLibrary(collection).catch(() => {
+ warning = 'Connection removed for this session; it may reappear after reload.'
+ })
+ return () => {
+ setLocalLibraries((previous) => previous.filter((item) => item.id !== collection))
+ showPersonalLibrary()
+ setError(warning)
+ }
+ })
+ const importFile = (file?: File) => {
+ if (!file) return Promise.resolve()
+ return run(async () => {
+ if (file.size > 20 * 1024 * 1024) throw new Error('The file exceeds 20 MB.')
+ const json = await file.text()
+ const parsed = parseSnapshot(JSON.parse(json), file.name)
+ const id = `imported:${crypto.randomUUID()}`
+ let warning: string | null = null
+ await saveImport({ id, name: file.name, json }).catch(() => {
+ warning = 'Snapshot opened, but the browser could not save it.'
+ })
+ return () => {
+ setImportedDatasets((previous) => [...previous, { id, dataset: parsed }])
+ select(parsed, id, 'imported')
+ setError(warning)
+ }
+ })
+ }
+ const removeImport = () =>
+ run(async () => {
+ let warning: string | null = null
+ await clearImport(collection).catch(() => {
+ warning = 'Snapshot removed for this session; it may reappear after reload.'
+ })
+ return () => {
+ setImportedDatasets((previous) => previous.filter((item) => item.id !== collection))
+ showPersonalLibrary()
+ setError(warning)
+ }
+ })
+ const changeLibrary = (name: string) => {
+ if (operation.current || restoring) return
+ setError(null)
+ if (name === 'personal') {
+ showPersonalLibrary()
+ return
+ }
+ const local = localLibraries.find((item) => item.id === name)
+ const imported = importedDatasets.find((item) => item.id === name)
+ if (local) void openLocalLibrary(local, 'local-source')
+ else if (imported) select(imported.dataset, name, 'imported')
+ }
+ const changeContent = (id: string) => {
+ if (operation.current || restoring) return
+ if ((id === 'local-source' || id === 'local-analysis') && localData) {
+ const library = localLibraries.find((item) => item.id === collection)
+ if (library) selectLocal(library, localData, id, selectedSkillId)
+ }
+ }
+
+ return {
+ dataset,
+ localData,
+ localLibraries,
+ importedDatasets,
+ collection,
+ sourceId,
+ selectedSkillId,
+ setSelectedSkillId,
+ error,
+ setError,
+ loading,
+ restoring,
+ openLocalLibrary,
+ connectLocalLibrary,
+ createPersonalLibrary,
+ updateIndex,
+ forgetLocalLibrary,
+ importFile,
+ removeImport,
+ changeLibrary,
+ changeContent,
+ }
+}
diff --git a/frontend/tsconfig.json b/skillnet-ai/src/skillnet_ai/web/ui/tsconfig.json
similarity index 100%
rename from frontend/tsconfig.json
rename to skillnet-ai/src/skillnet_ai/web/ui/tsconfig.json
diff --git a/skillnet-ai/src/skillnet_ai/web/ui/vite.config.ts b/skillnet-ai/src/skillnet_ai/web/ui/vite.config.ts
new file mode 100644
index 0000000..ee99d05
--- /dev/null
+++ b/skillnet-ai/src/skillnet_ai/web/ui/vite.config.ts
@@ -0,0 +1,13 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+
+export default defineConfig({
+ plugins: [react()],
+ build: { outDir: '../static', emptyOutDir: true, sourcemap: false },
+ server: {
+ host: '127.0.0.1',
+ port: 5173,
+ strictPort: true,
+ proxy: { '/api': { target: 'http://127.0.0.1:8765', changeOrigin: true } },
+ },
+})