Skip to main content

agent-building

Design and create AI agent packages โ€” manifest format, directory structure, image asset generation (avatar/thumbnail/screenshots), file writing workflow, comprehensive field reference

Source facts

Repository
markus-global/markus
Last source activity
August 9, 2026 at 12:11
Detected SKILL.md language
English
Stars
205
Forks
16

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
2 files

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
agent-building
description
Design and create AI agent packages โ€” manifest format, directory structure, image asset generation (avatar/thumbnail/screenshots), file writing workflow, comprehensive field reference
# Agent Building This skill teaches you how to create Markus agent packages โ€” self-contained directory-based artifacts that define an AI agent's identity, capabilities, constraints, and visual assets. ## Artifact Directory **CRITICAL**: Agent artifacts MUST be saved under this exact path โ€” the Builder page, install system, and deliverable detection all depend on it: ``` ~/.markus/builder-artifacts/agents/{agent-name}/ โ”œโ”€โ”€ agent.json # Manifest (auto-created from your JSON output) โ”œโ”€โ”€ README.md # Public-facing overview for Hub/Builder (REQUIRED) โ”œโ”€โ”€ ROLE.md # Identity and system prompt (REQUIRED) โ”œโ”€โ”€ HEARTBEAT.md # Periodic self-check checklist (RECOMMENDED) โ”œโ”€โ”€ POLICIES.md # Constraints & guardrails (optional) โ”œโ”€โ”€ CONTEXT.md # Domain context & references (optional) โ””โ”€โ”€ images/ # Image assets (avatar, screenshots) โ””โ”€โ”€ avatar.jpg # Agent avatar/thumbnail image ``` **Do NOT write artifacts to `~/.markus/shared/`, your working directory, or any other location.** Only `~/.markus/builder-artifacts/agents/` is recognized by the system. When the user **installs** the artifact, files are deployed to `~/.markus/agents/{agentId}/role/`. The `ROLE.md` becomes the agent's system prompt โ€” it IS the agent's identity, not an override of a template. ## Package Slug (`name`) โ€” REQUIRED The manifest `name` is the **package slug**: directory name, Hub URL segment (`/@user/{slug}`), and share/publish id. **Rules (hard โ€” invalid manifests are rejected on write / save / share):** - English **kebab-case** only: lowercase letters `a-z`, digits `0-9`, hyphens `-` - 2โ€“64 characters; must **start with a letter** - Pattern examples: `code-reviewer`, `paper-mentor`, `seo-auditor` - **NOT allowed**: Chinese (`ๆ™บๅบ“็ ”็ฉถๅ›ข้˜Ÿ`), spaces, underscores, UPPERCASE, emoji, or empty - Put the human-readable title (any language) in **`displayName`**, never in `name` | User language | `name` (slug) | `displayName` | |---|---|---| | Chinese "่ฎบๆ–‡ๅฏผๅธˆ" | `paper-mentor` | `่ฎบๆ–‡ๅฏผๅธˆ` | | English "Code Reviewer" | `code-reviewer` | `Code Reviewer` | If the user only gives a Chinese title, **you invent an English kebab slug** that captures the meaning, set `displayName` to their title, and use the slug for the directory path `~/.markus/builder-artifacts/agents/{name}/`. ## Two-Step Workflow Output the agent in two steps โ€” manifest first, then content files. **Never put file content inline in the JSON.** ### All modes (chat / task / A2A) โ€” same rule There is **no** chat auto-save. A JSON code block in your reply does **not** create files. 1. `file_write("~/.markus/builder-artifacts/agents/{name}/agent.json", ...)` for the manifest 2. `file_write` for each content file (ROLE.md, HEARTBEAT.md, โ€ฆ) 3. In task mode, set deliverable references to the artifact directory path You may preview JSON in chat **in addition to** writing files โ€” never instead of `file_write`. ### Step 1: Write Manifest JSON via file_write This JSON contains ONLY metadata โ€” **no file content**. ```json { "type": "agent", "name": "agent-name-kebab-case", "displayName": "Agent Display Name", "version": "1.0.0", "description": "What this agent does", "author": "", "category": "development | devops | management | productivity | general", "tags": ["tag1", "tag2"], "icon": "images/avatar.jpg", "thumbnail": "images/avatar.jpg", "screenshots": ["images/avatar.jpg"], "license": "MIT", "originalSource": "https://github.com/...", "dependencies": { "skills": ["skill-id-1", "skill-id-2"], "env": ["git", "node"] }, "agent": { "agentRole": "manager | worker", "llmProvider": "anthropic | openai | google | (empty for default)", "llmModel": "model name or empty for default", "temperature": 0.7 } } ``` After `agent.json` is written, proceed to write the remaining files with `file_write`. ### Step 2: Write Files with file_write After the JSON is saved, write each file individually using `file_write`. The base path is `~/.markus/builder-artifacts/agents/{agent-name}/` (use the `name` from your JSON). **Write files in this order:** 1. **README.md** (REQUIRED) โ€” The public-facing overview displayed on Markus Hub and the Builder detail page. This is what users see first when browsing artifacts. Write 2-4 paragraphs covering: - What this agent does and what problem it solves - Key capabilities and features - Example use cases or when to use this agent - Any requirements or setup notes 2. **ROLE.md** (REQUIRED) โ€” The agent's primary identity document. **Before writing, read the existing base role template** via `file_read` (path shown in dynamic context) to understand expected depth and conventions. At least 5 substantive paragraphs covering: - Who this agent is (identity, personality, expertise) - Core responsibilities and capabilities - **Workflow with platform capabilities** โ€” when and how to use `spawn_subagent` (focused subtasks), `background_exec` (long-running commands with auto-notifications), `shell_execute` (git/gh operations), `web_search`/`web_fetch` (research), `deliverable_create` (artifacts), `memory_save` (persistent knowledge) - For code-writing agents: workspace setup (git worktree for isolation), TDD, submit-for-review flow, file ownership rules - For review agents: review-then-merge workflow using `shell_execute` with `git merge` or `gh pr create/merge` - Output standards and quality criteria - Domain-specific knowledge and context 3. **HEARTBEAT.md** (RECOMMENDED) โ€” Defines what the agent proactively checks every ~30 minutes via `HeartbeatScheduler`. **Without this file, the agent is purely reactive** โ€” it will only respond to direct messages and task assignments, never proactively monitor its environment. Write a role-specific checklist: - Check mailbox for new messages and respond to urgent items - Review assigned tasks โ€” update progress, unblock if possible - Check team announcements for new information - Role-specific patrol items (e.g., code agents: check build/CI status; review agents: check tasks awaiting review; managers: check team task board and unblock members) - Scan recent channel messages for anything requiring attention 4. **POLICIES.md** (recommended) โ€” Safety constraints and guardrails: - What the agent should NOT do - Tool usage guidelines - Quality gates and review requirements 5. **CONTEXT.md** (optional) โ€” Additional domain context, references, or knowledge. 6. **images/avatar.jpg** โ€” Agent visual assets (see [Image Assets](#image-assets) section below). **Example file_write calls:** ``` file_write("~/.markus/builder-artifacts/agents/code-reviewer/README.md", "# Code Reviewer\n\nA meticulous code review agent that ensures code quality...\n\n## Features\n- Automated PR review...\n- Security vulnerability detection...\n\n## Use Cases\n- Add to any development team for automated code review") file_write("~/.markus/builder-artifacts/agents/code-reviewer/ROLE.md", "# Code Reviewer\n\nYou are **Code Reviewer** โ€” an expert...\n\n## Responsibilities\n...\n\n## Workflow\n...\n\n## Output Standards\n...") file_write("~/.markus/builder-artifacts/agents/code-reviewer/HEARTBEAT.md", "# Heartbeat Checklist\n\n- [ ] Check mailbox for new messages\n- [ ] Check tasks awaiting review โ€” prioritize by deadline\n- [ ] Review assigned tasks and update progress\n- [ ] Scan team channels for review requests") file_write("~/.markus/builder-artifacts/agents/code-reviewer/POLICIES.md", "# Policies\n\n- Only use shell_execute for read-only commands...\n- Always show file contents before overwriting...") ``` ## Image Assets Agent avatars are **digital employee portraits** โ€” they should depict a person (realistic human style), not abstract icons, logos, or illustrations. Users should recognize the agent as a team member, not a mascot. ### Image Generation Use the `generate_image` tool to create agent portraits. Prompt style guide: ``` Good prompt (do this): "Professional headshot of a friendly male product manager in a business casual attire, warm blue tones, clean background, digital art style, realistic portrait" "Creative female content writer with glasses, warm orange tones, looking thoughtful, holding a notebook, realistic digital portrait, professional yet approachable" Bad prompt (don't do this): "Abstract icon of a roadmap with sticky notes" โœ— โ€” user said "ไธ็Ÿฅๆ‰€ไบ‘" "A laptop with writing bubbles floating above it" โœ— โ€” not a person "Logo design for a content creator" โœ— โ€” not a digital employee ``` Key prompt rules: - **Subject is always a person** โ€” realistic digital portrait - **Match the role's personality** โ€” PM = organized/strategic, Creator = creative/warm - **Use color palette** that aligns with the role (blue for analytical, orange for creative, green for growth) - **Background**: clean, professional, non-distracting - **Style**: `"realistic digital portrait", "professional headshot", "digital art style"` ### Image Size & Compression The `generate_image` tool typically outputs large images (e.g., 2048x2048, 400KB+). **Always compress before saving to the artifact directory.** Recommended specifications: | Property | Value | |:---------|:------| | **Final resolution** | 512ร—512 (square) | | **File format** | JPEG | | **Max file size** | โ‰ค50KB | | **Compression method** | Python Pillow (`pip3 install Pillow`) resize + save | Compression procedure: ```python # Using Python Pillow python3 -c " from PIL import Image img = Image.open('source.jpg') img = img.resize((512, 512), Image.LANCZOS) img.save('avatar.jpg', 'JPEG', quality=85) " ``` Typical result: 2048ร—2048 (426KB) โ†’ 512ร—512 (19KB), saving ~96%. ### File Placement | File | Directory | Purpose | |:----|:----------|:--------| | `avatar.jpg` | `images/` | Agent avatar, used for both `icon` and `thumbnail` | | Additional screenshots | `images/` | Optional, for feature showcase | **Always** place images under an `images/` subdirectory โ€” NOT at the artifact root. This follows the existing convention used by `paper-mentor`, `prompt-engineer`, and other agents. ### Local Path vs Hub CDN URL This is a critical distinction: | Phase | Field | Value | Where | |:------|:------|:------|:------| | **Local artifact (builder-artifacts/)** | `icon` | `"images/avatar.jpg"` | Relative path in agent.json | | **Local artifact (builder-artifacts/)** | `thumbnail` | `"images/avatar.jpg"` | Relative path in agent.json | | **Local artifact (builder-artifacts/)** | `screenshots` | `["images/avatar.jpg"]` | Relative paths in agent.json | | **Published to Hub** | `icon` | Emoji or CDN URL | Hub DB field (`hub_items.icon`) | | **Published to Hub** | `thumbnailUrl` | `"https://hub.markus.global/uploads/img_xxx.jpg"` | Hub DB field (`hub_items.thumbnail_url`) | | **Published to Hub** | `images` | `[{"url":"...","alt":"...","order":0}]` | Hub DB field (`hub_items.images`) | **Note:** Hub DB schema uses `thumbnailUrl` (not `thumbnail`), and `images` (not `screenshots`). The local artifact file uses `thumbnail` and `screenshots` for compatibility with the local install system. When publishing to Hub via API, map: - Local `thumbnail` โ†’ Hub `thumbnailUrl` - Local `screenshots` โ†’ Hub `images` (converted to `{url, alt, order}[]` format) ## Field Reference ### Top-level fields - **`type`**: Always `"agent"` - **`name`**: **Package slug** โ€” English kebab-case only (see [Package Slug](#package-slug-name--required)). Invalid/save/share reject Chinese or invalid slugs. - **`displayName`**: Human-readable name, can be in any language (e.g., `"่ฎบๆ–‡ๅญฆไน ๅฏผๅธˆ"`, `"Code Reviewer"`) - **`version`**: Semver (default `"1.0.0"`) - **`description`**: What this agent does (can be in any language) - **`category`**: One of `development`, `devops`, `management`, `productivity`, `general`, `marketing`, `engineering`, `product-management` - **`tags`**: Array of descriptive tags - **`icon`** (optional): Can be emoji OR image path. Emoji is lighter (zero network cost). Image path is visually richer. Both work in the Hub UI. Example: `"๐Ÿš€"` or `"images/avatar.jpg"` - **`thumbnail`** (optional): Relative path to avatar image in artifact. Shows as large preview. Must be under `images/` directory. Example: `"images/avatar.jpg"` - **`screenshots`** (optional): Array of image paths for gallery/ๅฑ•็คบ. Each path under `images/`. Example: `["images/avatar.jpg"]` - **`license`** (optional): License type, e.g. MIT, Apache-2.0. Example: `"MIT"`
View on GitHub
This SKILL.md is very large, so SkillsMP previews the first section here. View on GitHub