Files
tutti/.github/workflows/tutti-agent-skills-preview.yml
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

239 lines
9.7 KiB
YAML

name: Preview Tutti Skills Sync
on:
pull_request:
paths:
- "services/tuttid/service/workspace/app_factory_reference/**"
- "services/tuttid/service/workspace/agent_workspace_app_reference/**"
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: tutti-agent-skills-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout Tutti main repository
uses: actions/checkout@v4
- name: Build temporary skills repository layout
run: |
mkdir -p /tmp/tutti-agent-skills/skills/tutti-workspace-app-factory
mkdir -p /tmp/tutti-agent-skills/skills/tutti-agent-workspace-app
mkdir -p /tmp/tutti-agent-skills/plugins/tutti/skills/tutti-workspace-app-factory
mkdir -p /tmp/tutti-agent-skills/plugins/tutti/skills/tutti-agent-workspace-app
rsync -a --delete \
services/tuttid/service/workspace/app_factory_reference/ \
/tmp/tutti-agent-skills/skills/tutti-workspace-app-factory/
rsync -a --delete \
services/tuttid/service/workspace/app_factory_reference/ \
/tmp/tutti-agent-skills/plugins/tutti/skills/tutti-workspace-app-factory/
rsync -a --delete \
services/tuttid/service/workspace/agent_workspace_app_reference/ \
/tmp/tutti-agent-skills/skills/tutti-agent-workspace-app/
rsync -a --delete \
services/tuttid/service/workspace/agent_workspace_app_reference/ \
/tmp/tutti-agent-skills/plugins/tutti/skills/tutti-agent-workspace-app/
mkdir -p /tmp/tutti-agent-skills/.agents/plugins
mkdir -p /tmp/tutti-agent-skills/.codex-plugin
mkdir -p /tmp/tutti-agent-skills/plugins/tutti/.codex-plugin
- name: Write temporary marketplace manifest
run: |
cat > /tmp/tutti-agent-skills/.agents/plugins/marketplace.json <<'JSON'
{
"name": "tutti-agent-skills",
"interface": {
"displayName": "Tutti Agent Skills"
},
"plugins": [
{
"name": "tutti",
"source": {
"source": "local",
"path": "./plugins/tutti"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Developer Tools"
}
]
}
JSON
- name: Write temporary plugin manifest
run: |
tee /tmp/tutti-agent-skills/.codex-plugin/plugin.json \
/tmp/tutti-agent-skills/plugins/tutti/.codex-plugin/plugin.json > /dev/null <<'JSON'
{
"name": "tutti",
"version": "0.1.0",
"description": "Tutti workspace app authoring and agent app architecture tools.",
"author": { "name": "Tutti" },
"repository": "https://github.com/tutti-os/tutti-agent-skills",
"license": "Apache-2.0",
"keywords": ["tutti", "workspace-apps", "agent-skills"],
"skills": "./skills/",
"interface": {
"displayName": "Tutti",
"shortDescription": "Create Tutti workspace and agent apps",
"longDescription": "Skills for generating, converting, validating, localizing, and repairing Tutti workspace apps and agent-enabled app repositories.",
"developerName": "Tutti",
"category": "Developer Tools",
"capabilities": ["Write"],
"websiteURL": "https://tutti.sh/",
"defaultPrompt": [
"Create a Tutti workspace app package.",
"Create an agent-enabled Tutti workspace app repository.",
"Repair this Tutti workspace app package.",
"Validate a Tutti workspace app manifest."
]
}
}
JSON
- name: Validate skill discovery
working-directory: /tmp/tutti-agent-skills
run: |
npx --yes skills add . --list
npx --yes skills add ./skills/tutti-workspace-app-factory --list
npx --yes skills add ./skills/tutti-agent-workspace-app --list
- name: Validate marketplace layout
working-directory: /tmp/tutti-agent-skills
run: |
python3 - <<'PY'
import json
import pathlib
import sys
marketplace = json.loads(pathlib.Path(".agents/plugins/marketplace.json").read_text())
plugins = marketplace.get("plugins")
if not isinstance(plugins, list) or not plugins:
sys.exit("marketplace must contain at least one plugin")
entry = plugins[0]
if entry.get("name") != "tutti":
sys.exit("marketplace plugin name must be tutti")
if entry.get("source", {}).get("path") != "./plugins/tutti":
sys.exit("marketplace plugin source path must be ./plugins/tutti")
for root in (pathlib.Path("."), pathlib.Path("plugins/tutti")):
manifest = json.loads((root / ".codex-plugin/plugin.json").read_text())
if manifest.get("name") != "tutti":
sys.exit(f"{root} plugin name must be tutti")
if manifest.get("skills") != "./skills/":
sys.exit(f"{root} skills path must be ./skills/")
if manifest.get("interface", {}).get("websiteURL") != "https://tutti.sh/":
sys.exit(f"{root} websiteURL must be https://tutti.sh/")
for skill_name in ["tutti-workspace-app-factory", "tutti-agent-workspace-app"]:
if not (root / f"skills/{skill_name}/SKILL.md").exists():
sys.exit(f"{root} is missing {skill_name}")
PY
- name: Validate skill frontmatter
working-directory: /tmp/tutti-agent-skills
run: |
python3 - <<'PY'
import pathlib
import re
import sys
for expected_name in ["tutti-workspace-app-factory", "tutti-agent-workspace-app"]:
skill = pathlib.Path(f"skills/{expected_name}/SKILL.md")
text = skill.read_text()
if not text.startswith("---\n"):
sys.exit(f"{skill} must start with YAML frontmatter")
end = text.find("\n---\n", 4)
if end < 0:
sys.exit(f"{skill} must close YAML frontmatter")
frontmatter = text[4:end]
if not re.search(rf"^name:\s*{re.escape(expected_name)}\s*$", frontmatter, re.M):
sys.exit(f"{skill} missing expected name")
if not re.search(r"^description:\s*.+", frontmatter, re.M):
sys.exit(f"{skill} missing description")
allowed = {"name", "description"}
keys = {
line.split(":", 1)[0].strip()
for line in frontmatter.splitlines()
if ":" in line and not line.startswith(" ")
}
extra = keys - allowed
if extra:
sys.exit(f"{skill} frontmatter has unsupported keys: {sorted(extra)}")
PY
- name: Upload preview artifact
uses: actions/upload-artifact@v4
with:
name: tutti-agent-skills-preview
path: /tmp/tutti-agent-skills
- name: Summarize preview
run: |
{
echo "## Tutti Skills Preview"
echo
echo "This PR changes built-in Tutti workspace app skills."
echo
echo "- External repository target: \`skills/tutti-workspace-app-factory/\`"
echo "- External repository target: \`skills/tutti-agent-workspace-app/\`"
echo "- Plugin marketplace target: \`plugins/tutti/skills/tutti-workspace-app-factory/\`"
echo "- Plugin marketplace target: \`plugins/tutti/skills/tutti-agent-workspace-app/\`"
echo "- Preview artifact: \`tutti-agent-skills-preview\`"
echo "- This workflow did not push to the external repository."
} >> "$GITHUB_STEP_SUMMARY"
- name: Comment on pull request
uses: actions/github-script@v8
with:
script: |
const marker = "<!-- tutti-agent-skills-preview -->";
const body = `${marker}
This PR changes built-in Tutti workspace app skills.
External repository target:
\`skills/tutti-workspace-app-factory/\`
\`skills/tutti-agent-workspace-app/\`
Plugin marketplace target:
\`plugins/tutti/skills/tutti-workspace-app-factory/\`
\`plugins/tutti/skills/tutti-agent-workspace-app/\`
Preview artifact:
\`tutti-agent-skills-preview\`
This workflow did not push to the external repository. After this PR lands, the main-branch sync workflow will update \`tutti-os/tutti-agent-skills\` and enable auto-merge when checks pass.`;
const {owner, repo} = context.repo;
const issue_number = context.issue.number;
const comments = await github.rest.issues.listComments({
owner,
repo,
issue_number,
per_page: 100,
});
const previous = comments.data.find((comment) => comment.body?.includes(marker));
if (previous) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: previous.id,
body,
});
} else {
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body,
});
}