[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-449ee91d-1b9d-46b3-9900-c54391d4f1ef":3,"$fEeAL2nWP-T7Xr1EmTTRSf9ABUp5oY1MbTZn3VFm0A7w":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"449ee91d-1b9d-46b3-9900-c54391d4f1ef","stitch-loop","教授代理使用Stitch迭代构建网站，采用自主接力循环模式","cat_life_career","mod_other","sickn33,other","---\nname: stitch-loop\ndescription: Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern\nallowed-tools:\n  - \"stitch*:*\"\n  - \"chrome*:*\"\n  - \"Read\"\n  - \"Write\"\n  - \"Bash\"\nrisk: unknown\nsource: community\n---\n\n# Stitch Build Loop\n\nYou are an **autonomous frontend builder** participating in an iterative site-building loop. Your goal is to generate a page using Stitch, integrate it into the site, and prepare instructions for the next iteration.\n\n## When to Use\n- You are iteratively building a website with Stitch using a baton-based loop across runs or agents.\n- Each pass should read the next prompt, generate or integrate a page, and hand off the next task.\n- You need a disciplined autonomous loop for multi-step frontend site construction.\n\n## Overview\n\nThe Build Loop pattern enables continuous, autonomous website development through a \"baton\" system. Each iteration:\n1. Reads the current task from a baton file (`.stitch\u002Fnext-prompt.md`)\n2. Generates a page using Stitch MCP tools\n3. Integrates the page into the site structure\n4. Writes the next task to the baton file for the next iteration\n\n## Prerequisites\n\n**Required:**\n- Access to the Stitch MCP Server\n- A Stitch project (existing or will be created)\n- A `.stitch\u002FDESIGN.md` file (generate one using the `design-md` skill if needed)\n- A `.stitch\u002FSITE.md` file documenting the site vision and roadmap\n\n**Optional:**\n- Chrome DevTools MCP Server — enables visual verification of generated pages\n\n## The Baton System\n\nThe `.stitch\u002Fnext-prompt.md` file acts as a relay baton between iterations:\n\n```markdown\n---\npage: about\n---\nA page describing how jules.top tracking works.\n\n**DESIGN SYSTEM (REQUIRED):**\n[Copy from .stitch\u002FDESIGN.md Section 6]\n\n**Page Structure:**\n1. Header with navigation\n2. Explanation of tracking methodology\n3. Footer with links\n```\n\n**Critical rules:**\n- The `page` field in YAML frontmatter determines the output filename\n- The prompt content must include the design system block from `.stitch\u002FDESIGN.md`\n- You MUST update this file before completing your work to continue the loop\n\n## Execution Protocol\n\n### Step 1: Read the Baton\n\nParse `.stitch\u002Fnext-prompt.md` to extract:\n- **Page name** from the `page` frontmatter field\n- **Prompt content** from the markdown body\n\n### Step 2: Consult Context Files\n\nBefore generating, read these files:\n\n| File | Purpose |\n|------|---------|\n| `.stitch\u002FSITE.md` | Site vision, **Stitch Project ID**, existing pages (sitemap), roadmap |\n| `.stitch\u002FDESIGN.md` | Required visual style for Stitch prompts |\n\n**Important checks:**\n- Section 4 (Sitemap) — Do NOT recreate pages that already exist\n- Section 5 (Roadmap) — Pick tasks from here if backlog exists\n- Section 6 (Creative Freedom) — Ideas for new pages if roadmap is empty\n\n### Step 3: Generate with Stitch\n\nUse the Stitch MCP tools to generate the page:\n\n1. **Discover namespace**: Run `list_tools` to find the Stitch MCP prefix\n2. **Get or create project**: \n   - If `.stitch\u002Fmetadata.json` exists, use the `projectId` from it\n   - Otherwise, call `[prefix]:create_project`, then call `[prefix]:get_project` to retrieve full project details, and save them to `.stitch\u002Fmetadata.json` (see schema below)\n   - After generating each screen, call `[prefix]:get_project` again and update the `screens` map in `.stitch\u002Fmetadata.json` with each screen's full metadata (id, sourceScreen, dimensions, canvas position)\n3. **Generate screen**: Call `[prefix]:generate_screen_from_text` with:\n   - `projectId`: The project ID\n   - `prompt`: The full prompt from the baton (including design system block)\n   - `deviceType`: `DESKTOP` (or as specified)\n4. **Retrieve assets**: Before downloading, check if `.stitch\u002Fdesigns\u002F{page}.html` and `.stitch\u002Fdesigns\u002F{page}.png` already exist:\n   - **If files exist**: Ask the user whether to refresh the designs from the Stitch project or reuse the existing local files. Only re-download if the user confirms.\n   - **If files do not exist**: Proceed with download:\n     - `htmlCode.downloadUrl` — Download and save as `.stitch\u002Fdesigns\u002F{page}.html`\n      - `screenshot.downloadUrl` — Append `=w{width}` to the URL before downloading, where `{width}` is the `width` value from the screen metadata (Google CDN serves low-res thumbnails by default). Save as `.stitch\u002Fdesigns\u002F{page}.png`\n\n### Step 4: Integrate into Site\n\n1. Move generated HTML from `.stitch\u002Fdesigns\u002F{page}.html` to `site\u002Fpublic\u002F{page}.html`\n2. Fix any asset paths to be relative to the public folder\n3. Update navigation:\n   - Find existing placeholder links (e.g., `href=\"#\"`) and wire them to the new page\n   - Add the new page to the global navigation if appropriate\n4. Ensure consistent headers\u002Ffooters across all pages\n\n### Step 4.5: Visual Verification (Optional)\n\nIf the **Chrome DevTools MCP Server** is available, verify the generated page:\n\n1. **Check availability**: Run `list_tools` to see if `chrome*` tools are present\n2. **Start dev server**: Use Bash to start a local server (e.g., `npx serve site\u002Fpublic`)\n3. **Navigate to page**: Call `[chrome_prefix]:navigate` to open `http:\u002F\u002Flocalhost:3000\u002F{page}.html`\n4. **Capture screenshot**: Call `[chrome_prefix]:screenshot` to capture the rendered page\n5. **Visual comparison**: Compare against the Stitch screenshot (`.stitch\u002Fdesigns\u002F{page}.png`) for fidelity\n6. **Stop server**: Terminate the dev server process\n\n> **Note:** This step is optional. If Chrome DevTools MCP is not installed, skip to Step 5.\n\n### Step 5: Update Site Documentation\n\nModify `.stitch\u002FSITE.md`:\n- Add the new page to Section 4 (Sitemap) with `[x]`\n- Remove any idea you consumed from Section 6 (Creative Freedom)\n- Update Section 5 (Roadmap) if you completed a backlog item\n\n### Step 6: Prepare the Next Baton (Critical)\n\n**You MUST update `.stitch\u002Fnext-prompt.md` before completing.** This keeps the loop alive.\n\n1. **Decide the next page**: \n   - Check `.stitch\u002FSITE.md` Section 5 (Roadmap) for pending items\n   - If empty, pick from Section 6 (Creative Freedom)\n   - Or invent something new that fits the site vision\n2. **Write the baton** with proper YAML frontmatter:\n\n```markdown\n---\npage: achievements\n---\nA competitive achievements page showing developer badges and milestones.\n\n**DESIGN SYSTEM (REQUIRED):**\n[Copy the entire design system block from .stitch\u002FDESIGN.md]\n\n**Page Structure:**\n1. Header with title and navigation\n2. Badge grid showing unlocked\u002Flocked states\n3. Progress bars for milestone tracking\n```\n\n## File Structure Reference\n\n```\nproject\u002F\n├── .stitch\u002F\n│   ├── metadata.json   # Stitch project & screen IDs (persist this!)\n│   ├── DESIGN.md       # Visual design system (from design-md skill)\n│   ├── SITE.md         # Site vision, sitemap, roadmap\n│   ├── next-prompt.md  # The baton — current task\n│   └── designs\u002F        # Staging area for Stitch output\n│       ├── {page}.html\n│       └── {page}.png\n└── site\u002Fpublic\u002F        # Production pages\n    ├── index.html\n    └── {page}.html\n```\n\n### `.stitch\u002Fmetadata.json` Schema\n\nThis file persists all Stitch identifiers so future iterations can reference them for edits or variants. Populate it by calling `[prefix]:get_project` after creating a project or generating screens.\n\n```json\n{\n  \"name\": \"projects\u002F6139132077804554844\",\n  \"projectId\": \"6139132077804554844\",\n  \"title\": \"My App\",\n  \"visibility\": \"PRIVATE\",\n  \"createTime\": \"2026-03-04T23:11:25.514932Z\",\n  \"updateTime\": \"2026-03-04T23:34:40.400007Z\",\n  \"projectType\": \"PROJECT_DESIGN\",\n  \"origin\": \"STITCH\",\n  \"deviceType\": \"MOBILE\",\n  \"designTheme\": {\n    \"colorMode\": \"DARK\",\n    \"font\": \"INTER\",\n    \"roundness\": \"ROUND_EIGHT\",\n    \"customColor\": \"#40baf7\",\n    \"saturation\": 3\n  },\n  \"screens\": {\n    \"index\": {\n      \"id\": \"d7237c7d78f44befa4f60afb17c818c1\",\n      \"sourceScreen\": \"projects\u002F6139132077804554844\u002Fscreens\u002Fd7237c7d78f44befa4f60afb17c818c1\",\n      \"x\": 0,\n      \"y\": 0,\n      \"width\": 390,\n      \"height\": 1249\n    },\n    \"about\": {\n      \"id\": \"bf6a3fe5c75348e58cf21fc7a9ddeafb\",\n      \"sourceScreen\": \"projects\u002F6139132077804554844\u002Fscreens\u002Fbf6a3fe5c75348e58cf21fc7a9ddeafb\",\n      \"x\": 549,\n      \"y\": 0,\n      \"width\": 390,\n      \"height\": 1159\n    }\n  },\n  \"metadata\": {\n    \"userRole\": \"OWNER\"\n  }\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `name` | Full resource name (`projects\u002F{id}`) |\n| `projectId` | Stitch project ID (from `create_project` or `get_project`) |\n| `title` | Human-readable project title |\n| `designTheme` | Design system tokens: color mode, font, roundness, custom color, saturation |\n| `deviceType` | Target device: `MOBILE`, `DESKTOP`, `TABLET` |\n| `screens` | Map of page name → screen object. Each screen includes `id`, `sourceScreen` (resource path for MCP calls), canvas position (`x`, `y`), and dimensions (`width`, `height`) |\n| `metadata.userRole` | User's role on the project (`OWNER`, `EDITOR`, `VIEWER`) |\n\n## Orchestration Options\n\nThe loop can be driven by different orchestration layers:\n\n| Method | How it works |\n|--------|--------------|\n| **CI\u002FCD** | GitHub Actions triggers on `.stitch\u002Fnext-prompt.md` changes |\n| **Human-in-loop** | Developer reviews each iteration before continuing |\n| **Agent chains** | One agent dispatches to another (e.g., Jules API) |\n| **Manual** | Developer runs the agent repeatedly with the same repo |\n\nThe skill is orchestration-agnostic — focus on the pattern, not the trigger mechanism.\n\n## Design System Integration\n\nThis skill works best with the `design-md` skill:\n\n1. **First time setup**: Generate `.stitch\u002FDESIGN.md` using the `design-md` skill from an existing Stitch screen\n2. **Every iteration**: Copy Section 6 (\"Design System Notes for Stitch Generation\") into your baton prompt\n3. **Consistency**: All generated pages will share the same visual language\n\n## Common Pitfalls\n\n- ❌ Forgetting to update `.stitch\u002Fnext-prompt.md` (breaks the loop)\n- ❌ Recreating a page that already exists in the sitemap\n- ❌ Not including the design system block from `.stitch\u002FDESIGN.md` in the prompt\n- ❌ Leaving placeholder links (`href=\"#\"`) instead of wiring real navigation\n- ❌ Forgetting to persist `.stitch\u002Fmetadata.json` after creating a new project\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Stitch generation fails | Check that the prompt includes the design system block |\n| Inconsistent styles | Ensure `.stitch\u002FDESIGN.md` is up-to-date and copied correctly |\n| Loop stalls | Verify `.stitch\u002Fnext-prompt.md` was updated with valid frontmatter |\n| Navigation broken | Check all internal links use correct relative paths |\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,246,595,"2026-05-16 13:42:17",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"其他","other","mdi-page-next-outline","其他类型Skill",5,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"职场发展","career","mdi-briefcase-outline","面试准备、简历优化、职业规划",4,575,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"6c7838bb-eb6a-4d8d-a0ba-ff29f245818b","1.0.0","stitch-loop.zip",4567,"uploads\u002Fskills\u002F449ee91d-1b9d-46b3-9900-c54391d4f1ef\u002Fstitch-loop.zip","28980be3c32331f771b67ab8a2bf6e740e35f0044c7539b45e00f82cf1aba375","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":10979}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]