Install any skill in seconds. Free to start, no credit card required.
Get Started Free →帮助用户在聊天环境中通过简单对话生成原创歌曲。核心价值:**3 轮交互出一首歌**。
SkillScore27/100
Test results 27
3/3 safety checks passed
5%27%of test cases passed +23 pts
Passed 6 of 22 test cases with the skill, and 1 of 22 without it.
5 fixed1 passed either way16 still failing0 broke
Adds every file the skill has, pinned so you can update it. No account needed.
pip install "decimalai>=0.15"
decimalai skills add muse-ai
claude --plugin-dir "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.agents"The same install from Python, for a notebook or a setup script.
pip install "decimalai>=0.15"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
print("Added. Start Claude Code with the command below.")claude --plugin-dir "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.agents"Type these in a Claude Code session. No account or API key. It writes the skill and any files it bundles, and asks first when its safety rating isn't Passed.
/plugin marketplace add decimal-labs/decimalai-claude-plugins
/plugin install decimalai@decimalai/decimalai:install muse-aiThe plugin needs python3 and curl on your machine.
No Python or account. Claude Code picks it up in its next session.
curl -fsSL --create-dirs -o .claude/skills/muse-ai/SKILL.md https://app.decimal.ai/s/muse-ai/SKILL.md.claude/skills/muse-ai/SKILL.mdThis gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[claude-agent-sdk]"
decimalai skills add muse-aiimport asyncio
from claude_agent_sdk import ClaudeAgentOptions
from decimalai.claude_agent_sdk import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
async def main():
question = "Hello!"
async with support.run(question) as run: # one user message, one run
async for message in run.query(options=ClaudeAgentOptions(max_turns=6)):
print(message)
# In a notebook or async code: await main()
asyncio.run(main())Prefer its own loader? ClaudeAgentOptions(plugins=[skills_plugin()], skills="all") reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[claude-agent-sdk]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
import asyncio
from claude_agent_sdk import ClaudeAgentOptions
from decimalai.claude_agent_sdk import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
async def main():
question = "Hello!"
async with support.run(question) as run: # one user message, one run
async for message in run.query(options=ClaudeAgentOptions(max_turns=6)):
print(message)
# In a notebook or async code: await main()
asyncio.run(main())Prefer its own loader? ClaudeAgentOptions(plugins=[skills_plugin()], skills="all") reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdimport asyncio
from pathlib import Path
from claude_agent_sdk import ClaudeAgentOptions, query
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
options = ClaudeAgentOptions(system_prompt=f"You are a helpful agent.\n\n{skill}", max_turns=6)
async def main():
async for message in query(prompt="Hello!", options=options):
print(message)
# In a notebook or async code: await main()
asyncio.run(main())This gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai-agents]"
decimalai skills add muse-aifrom agents import Agent, Runner
from decimalai.openai_agents import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
name=support.name,
instructions=support.instructions, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# In a notebook or async code: result = await Runner.run(agent, "Hello!")
result = Runner.run_sync(agent, "Hello!")Using SandboxAgent? capabilities=[Shell(), decimalai.openai_agents.sandbox_skills()] points its own loader at the same folder.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai-agents]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
from agents import Agent, Runner
from decimalai.openai_agents import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
name=support.name,
instructions=support.instructions, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# In a notebook or async code: result = await Runner.run(agent, "Hello!")
result = Runner.run_sync(agent, "Hello!")Using SandboxAgent? capabilities=[Shell(), decimalai.openai_agents.sandbox_skills()] points its own loader at the same folder.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from agents import Agent, Runner
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = Agent(name="support", instructions=f"You are a helpful agent.\n\n{skill}")
# In a notebook or async code: result = await Runner.run(agent, "Hello!")
result = Runner.run_sync(agent, "Hello!")This gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai]"
decimalai skills add muse-aiimport json
from openai import OpenAI
from decimalai.openai import agent_config
client = OpenAI()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your tools, as Chat Completions takes them, and what answers each.
TOOLS = [{"type": "function", "function": {
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
# run.system is your prompt, then the skill list.
messages = [{"role": "system", "content": run.system}, run.message]
while True:
reply = client.chat.completions.create(
model="gpt-5.4-mini",
messages=messages,
tools=[*TOOLS, *run.tools], # your tools, then load_skill
).choices[0].message
messages.append(reply)
if not reply.tool_calls:
break
for call in reply.tool_calls:
# load_skill is answered by the run; your own tools by FUNCTIONS.
function = FUNCTIONS.get(call.function.name)
messages.append(run.tool_result(call) or {
"role": "tool", "tool_call_id": call.id,
"content": function(**json.loads(call.function.arguments)) if function
else f"There is no tool named {call.function.name!r}.",
})
print(reply.content)
# The Responses API takes run.response_tools instead of run.tools.The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[openai]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
import json
from openai import OpenAI
from decimalai.openai import agent_config
client = OpenAI()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your tools, as Chat Completions takes them, and what answers each.
TOOLS = [{"type": "function", "function": {
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
# run.system is your prompt, then the skill list.
messages = [{"role": "system", "content": run.system}, run.message]
while True:
reply = client.chat.completions.create(
model="gpt-5.4-mini",
messages=messages,
tools=[*TOOLS, *run.tools], # your tools, then load_skill
).choices[0].message
messages.append(reply)
if not reply.tool_calls:
break
for call in reply.tool_calls:
# load_skill is answered by the run; your own tools by FUNCTIONS.
function = FUNCTIONS.get(call.function.name)
messages.append(run.tool_result(call) or {
"role": "tool", "tool_call_id": call.id,
"content": function(**json.loads(call.function.arguments)) if function
else f"There is no tool named {call.function.name!r}.",
})
print(reply.content)
# The Responses API takes run.response_tools instead of run.tools.No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from openai import OpenAI
client = OpenAI()
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
reply = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[
{"role": "system", "content": f"You are a helpful agent.\n\n{skill}"},
{"role": "user", "content": "Hello!"},
],
).choices[0].messageThis gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[anthropic]"
decimalai skills add muse-aiimport anthropic
from decimalai.anthropic import agent_config
client = anthropic.Anthropic()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
question = "Hello!"
with support.run(question) as run: # one user message, one run
answer = client.beta.messages.tool_runner(
model="claude-haiku-5-5",
max_tokens=4096,
system=run.system, # your prompt, then the skill list
tools=[*run.tools], # your tools, then load_skill
messages=[{"role": "user", "content": question}],
).until_done()The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[anthropic]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
import anthropic
from decimalai.anthropic import agent_config
client = anthropic.Anthropic()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
question = "Hello!"
with support.run(question) as run: # one user message, one run
answer = client.beta.messages.tool_runner(
model="claude-haiku-5-5",
max_tokens=4096,
system=run.system, # your prompt, then the skill list
tools=[*run.tools], # your tools, then load_skill
messages=[{"role": "user", "content": question}],
).until_done()No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
import anthropic
client = anthropic.Anthropic()
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
reply = client.messages.create(
model="claude-haiku-5-5",
max_tokens=4096,
system=f"You are a helpful agent.\n\n{skill}",
messages=[{"role": "user", "content": "Hello!"}],
)This gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[google-genai]"
decimalai skills add muse-aifrom google import genai
from google.genai import types
from decimalai.google_genai import agent_config
client = genai.Client()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your functions, as declarations for the model, and what answers each.
TOOLS = [{"function_declarations": [{
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters_json_schema": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}]}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
config = types.GenerateContentConfig(
system_instruction=run.system, # your prompt, then the skill list
tools=[*TOOLS, *run.tool_params], # your functions, then load_skill
)
contents = [{"role": "user", "parts": [{"text": run.message}]}]
while True:
response = client.models.generate_content(
model="gemini-3.5-flash", contents=contents, config=config,
)
if not response.function_calls:
break
contents.append(response.candidates[0].content)
parts = []
for call in response.function_calls:
# load_skill is answered by the run; your own functions by FUNCTIONS.
# A loop of your own rather than automatic function calling, which
# raises KeyError when the model asks for a function you did not pass.
function = FUNCTIONS.get(call.name)
parts.append(run.tool_result(call) or {"function_response": {
"name": call.name, "id": call.id,
"response": {"result": function(**(call.args or {})) if function
else f"There is no function named {call.name!r}."},
}})
contents.append({"role": "user", "parts": parts})
print(response.text)The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[google-genai]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
from google import genai
from google.genai import types
from decimalai.google_genai import agent_config
client = genai.Client()
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
def lookup_order(order_id: str) -> str:
return f"Order {order_id} shipped yesterday."
# Your functions, as declarations for the model, and what answers each.
TOOLS = [{"function_declarations": [{
"name": "lookup_order",
"description": "Look up the status of an order.",
"parameters_json_schema": {"type": "object", "properties": {"order_id": {"type": "string"}},
"required": ["order_id"]},
}]}]
FUNCTIONS = {"lookup_order": lookup_order}
question = "Where is order A1001?"
with support.run(question) as run: # one user message, one run
config = types.GenerateContentConfig(
system_instruction=run.system, # your prompt, then the skill list
tools=[*TOOLS, *run.tool_params], # your functions, then load_skill
)
contents = [{"role": "user", "parts": [{"text": run.message}]}]
while True:
response = client.models.generate_content(
model="gemini-3.5-flash", contents=contents, config=config,
)
if not response.function_calls:
break
contents.append(response.candidates[0].content)
parts = []
for call in response.function_calls:
# load_skill is answered by the run; your own functions by FUNCTIONS.
# A loop of your own rather than automatic function calling, which
# raises KeyError when the model asks for a function you did not pass.
function = FUNCTIONS.get(call.name)
parts.append(run.tool_result(call) or {"function_response": {
"name": call.name, "id": call.id,
"response": {"result": function(**(call.args or {})) if function
else f"There is no function named {call.name!r}."},
}})
contents.append({"role": "user", "parts": parts})
print(response.text)No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from google import genai
from google.genai import types
client = genai.Client()
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
response = client.models.generate_content(
model="gemini-3.5-flash",
contents="Hello!",
config=types.GenerateContentConfig(system_instruction=f"You are a helpful agent.\n\n{skill}"),
)This gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[langchain]" langchain-openai
decimalai skills add muse-aifrom langchain.agents import create_agent
from decimalai.langchain import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = create_agent(
"openai:gpt-5.4-mini",
tools=[], # your tools; the middleware adds load_skill
middleware=[support.middleware], # your prompt, the skill list and load_skill
)
result = agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[langchain]" langchain-openaifrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
from langchain.agents import create_agent
from decimalai.langchain import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = create_agent(
"openai:gpt-5.4-mini",
tools=[], # your tools; the middleware adds load_skill
middleware=[support.middleware], # your prompt, the skill list and load_skill
)
result = agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from langchain.agents import create_agent
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = create_agent("openai:gpt-5.4-mini", tools=[], system_prompt=f"You are a helpful agent.\n\n{skill}")
result = agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})This gets SKILL.md only. The skill's 5 other files are not included.
CrewAI's own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" "crewai>=1.15.27"
decimalai skills add muse-aiimport decimalai.crewai
from crewai import Agent, Crew, Task
agent = Agent(
role="Support", goal="Help the customer", backstory="A support agent.",
llm=llm, # your own CrewAI LLM
skills=decimalai.crewai.skills(), # the installed folder
tools=decimalai.crewai.skill_tools(), # reads a skill's files, runs its scripts
)
task = Task(description="Hello!", expected_output="an answer", agent=agent)
Crew(agents=[agent], tasks=[task]).kickoff()The same install from Python, for a notebook or a setup script. CrewAI's own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" "crewai>=1.15.27"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
import decimalai.crewai
from crewai import Agent, Crew, Task
agent = Agent(
role="Support", goal="Help the customer", backstory="A support agent.",
llm=llm, # your own CrewAI LLM
skills=decimalai.crewai.skills(), # the installed folder
tools=decimalai.crewai.skill_tools(), # reads a skill's files, runs its scripts
)
task = Task(description="Hello!", expected_output="an answer", agent=agent)
Crew(agents=[agent], tasks=[task]).kickoff()No DecimalAI package. CrewAI's own loader reads the folder, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from crewai import Agent, Crew, Task
agent = Agent(
role="Support", goal="Help the customer", backstory="A support agent.",
llm=llm, # your own CrewAI LLM
skills=[Path(".agents/skills")],
)
task = Task(description="Hello!", expected_output="an answer", agent=agent)
Crew(agents=[agent], tasks=[task]).kickoff()This gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[adk]"
decimalai skills add muse-aifrom decimalai.adk import DecimalAIPlugin, agent_config
from google.adk.agents import LlmAgent
from google.adk.apps import App
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = LlmAgent(
name="support", # ADK needs a Python identifier
model="gemini-3.5-flash",
instruction=support.instruction, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# DecimalAIPlugin makes each invocation of runners built from this App one trace.
app = App(name="support", root_agent=agent, plugins=[DecimalAIPlugin()])Prefer ADK's own loader? SkillToolset(skills=decimalai.adk.skills(), ...) reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[adk]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
from decimalai.adk import DecimalAIPlugin, agent_config
from google.adk.agents import LlmAgent
from google.adk.apps import App
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = LlmAgent(
name="support", # ADK needs a Python identifier
model="gemini-3.5-flash",
instruction=support.instruction, # your prompt, then the skill list
tools=[*support.tools], # your tools, then load_skill
)
# DecimalAIPlugin makes each invocation of runners built from this App one trace.
app = App(name="support", root_agent=agent, plugins=[DecimalAIPlugin()])Prefer ADK's own loader? SkillToolset(skills=decimalai.adk.skills(), ...) reads the same folder. Use one or the other: a skill delivered both ways reaches the prompt twice.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from google.adk.agents import LlmAgent
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = LlmAgent(
name="support",
model="gemini-3.5-flash",
instruction=lambda context: f"You are a helpful agent.\n\n{skill}",
)This gets SKILL.md only. The skill's 5 other files are not included.
agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[pydantic-ai]"
decimalai skills add muse-aifrom pydantic_ai import Agent
from decimalai.pydantic_ai import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
"openai:gpt-4o-mini",
name=support.name,
tools=[], # your tools; the capability adds load_skill
capabilities=[support], # your prompt, the skill list and load_skill
)
# In a notebook or async code: result = await agent.run("Hello!")
result = agent.run_sync("Hello!")On the Pydantic AI harness, decimalai.pydantic_ai_harness.skills(project) uses its own loader instead.
The same install from Python, for a notebook or a setup script. agent_config() hands your agent the skill. With no DecimalAI key it reads your project's files and sends nothing. Needs SDK 0.27 or newer.
pip install "decimalai[pydantic-ai]"from decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
from pydantic_ai import Agent
from decimalai.pydantic_ai import agent_config
# With no DECIMAL_API_KEY this reads the skills your project lists, from disk.
support = agent_config("support", fallback="You are a helpful agent.")
agent = Agent(
"openai:gpt-4o-mini",
name=support.name,
tools=[], # your tools; the capability adds load_skill
capabilities=[support], # your prompt, the skill list and load_skill
)
# In a notebook or async code: result = await agent.run("Hello!")
result = agent.run_sync("Hello!")On the Pydantic AI harness, decimalai.pydantic_ai_harness.skills(project) uses its own loader instead.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from pydantic_ai import Agent
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = Agent("openai:gpt-4o-mini", instructions=f"You are a helpful agent.\n\n{skill}")
# In a notebook or async code: result = await agent.run("Hello!")
result = agent.run_sync("Hello!")This gets SKILL.md only. The skill's 5 other files are not included.
Deep Agents' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" deepagents
decimalai skills add muse-aiimport decimalai.deepagents
from deepagents import create_deep_agent
agent = create_deep_agent(model=model, **decimalai.deepagents.skills())
agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})The default backend reads files but has no shell. To run a skill's scripts, pass skills(backend=LocalShellBackend(...)).
The same install from Python, for a notebook or a setup script. Deep Agents' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" deepagentsfrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
import decimalai.deepagents
from deepagents import create_deep_agent
agent = create_deep_agent(model=model, **decimalai.deepagents.skills())
agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})The default backend reads files but has no shell. To run a skill's scripts, pass skills(backend=LocalShellBackend(...)).
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from deepagents import create_deep_agent
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = create_deep_agent(model=model, system_prompt=f"You are a helpful agent.\n\n{skill}")
agent.invoke({"messages": [{"role": "user", "content": "Hello!"}]})This gets SKILL.md only. The skill's 5 other files are not included.
Its own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" agent-framework
decimalai skills add muse-aiimport asyncio
from agent_framework import Agent
from decimalai.agent_framework import skills
agent = Agent(client=client, instructions="You are a helpful agent.", context_providers=[skills()])
asyncio.run(agent.run("Hello!"))It caches skills by default, so restart the process after decimalai skills update.
The same install from Python, for a notebook or a setup script. Its own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" agent-frameworkfrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
import asyncio
from agent_framework import Agent
from decimalai.agent_framework import skills
agent = Agent(client=client, instructions="You are a helpful agent.", context_providers=[skills()])
asyncio.run(agent.run("Hello!"))It caches skills by default, so restart the process after decimalai skills update.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdimport asyncio
from pathlib import Path
from agent_framework import Agent
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = Agent(client=client, instructions=f"You are a helpful agent.\n\n{skill}")
asyncio.run(agent.run("Hello!"))This gets SKILL.md only. The skill's 5 other files are not included.
Strands' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" strands-agents
decimalai skills add muse-aifrom decimalai.strands import skills
from strands import Agent
from strands.vended_tools import file_editor, shell
agent = Agent(
model=model, # always pass one: the default is Amazon Bedrock
system_prompt="You are a helpful agent.",
tools=[file_editor, shell],
plugins=[skills()],
)
agent("Hello!")Strands loads an agent's skills once, so build the agent again after decimalai skills update.
The same install from Python, for a notebook or a setup script. Strands' own skill loader reads the installed folder. No DecimalAI account needed.
pip install "decimalai>=0.16" strands-agentsfrom decimalai import skillpkg
# Writes .agents/skills and .decimal/skills.toml. Safe to run twice.
result = skillpkg.add("muse-ai")
if result.exit_code:
raise SystemExit(result.problems)
from decimalai.strands import skills
from strands import Agent
from strands.vended_tools import file_editor, shell
agent = Agent(
model=model, # always pass one: the default is Amazon Bedrock
system_prompt="You are a helpful agent.",
tools=[file_editor, shell],
plugins=[skills()],
)
agent("Hello!")Strands loads an agent's skills once, so build the agent again after decimalai skills update.
No DecimalAI package. The whole skill goes in every prompt, and nothing pins or updates it.
.agents/skills/muse-ai/SKILL.mdfrom pathlib import Path
from strands import Agent
skill = Path(".agents/skills/muse-ai/SKILL.md").read_text()
agent = Agent(model=model, system_prompt=f"You are a helpful agent.\n\n{skill}")
agent("Hello!")This gets SKILL.md only. The skill's 5 other files are not included.
Adds every file the skill has, pinned so you can update it. Cursor, Copilot, Cline and Warp read this folder by themselves.
pip install "decimalai>=0.15"
decimalai skills add muse-aiNo Python or account. Cursor, Copilot, Cline and Warp read this folder by themselves.
curl -fsSL --create-dirs -o .agents/skills/muse-ai/SKILL.md https://app.decimal.ai/s/muse-ai/SKILL.md.agents/skills/muse-ai/SKILL.mdThis gets SKILL.md only. The skill's 5 other files are not included.
Give its text to your model as instructions. No account or package needed.
This gets SKILL.md only. The skill's 5 other files are not included.
Raw files: /s/muse-ai/SKILL.md · /s/muse-ai.json
Fetch the file and give its text to your model as instructions. No account or package needed.
curl -fsSL https://app.decimal.ai/s/muse-ai/SKILL.mdcurl -fsSL https://app.decimal.ai/s/muse-ai.jsonThis gets SKILL.md only. The skill's 5 other files are not included.
You don't need a DecimalAI account.
Saved prompts and skills, pinned versions, and traces of this skill in your runs. DecimalAI does not run your agent.
Claude Code reads files from your project, so DecimalAI config does not apply there.
On Claude Agent SDK: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On OpenAI Agents: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On OpenAI SDK: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Anthropic: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Gemini API: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On LangChain: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On CrewAI: set DECIMAL_API_KEY and add decimalai.init(crewai=True) to record runs and skill use. The skill version stays in your repo.
On Google ADK: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Pydantic AI: save the skill to an agent here, set DECIMAL_API_KEY, and the same code uses it with no command to run. Changes you save reach the next run with no redeploy.
On Deep Agents: set DECIMAL_API_KEY and add decimalai.init(langchain=True) to record runs and skill use. The skill version stays in your repo.
On Microsoft Agent Framework: set DECIMAL_API_KEY and add decimalai.init(otel=True, agent_name="support") to record runs and skill use. The skill version stays in your repo.
On Strands: set DECIMAL_API_KEY and add decimalai.init(otel=True, agent_name="support") to record runs and skill use. The skill version stays in your repo.
Editors read files from your project, so DecimalAI config does not apply there.
Anywhere else: record a use with decimalai.log_skill_activation() inside a trace.
帮助用户在聊天环境中通过简单对话生成原创歌曲。核心价值:3 轮交互出一首歌。
工作目录:执行任何 bash 命令前,必须先 cd 到本 SKILL.md 所在目录(即 skill 安装目录)。所有脚本路径(scripts/、assets/、references/)均基于此目录。
Token 由脚本自动管理,存储于 ~/.muse/token,无需手动操作。
任何步骤中遇到 HTTP 401(Token 无效/过期)或 Token 缺失(code=-2)时,统一执行以下流程:
python3 scripts/muse_api.py register-url
返回 JSON 中的 url 字段即为 $REGISTER_URL。
2. 读取 assets/register-guide.md 获取引导提示
3. 向用户展示注册引导,使用上面获取的 $REGISTER_URL:
你的登录已过期(或尚未登录),需要先完成验证。
1️⃣ 点击链接注册 👉 $REGISTER_URL
2️⃣ 注册完成后 Token 会自动复制到剪贴板
3️⃣ 回到这里,直接粘贴发送即可
整个过程只需 30 秒~
触发场景:
| 触发点 | 说明 |
|---|---|
| Step 1 认证检查 | member-info 返回 code=-2(未登录)或 HTTP 401 |
| Step 3 提交生成 | generate 接口返回 HTTP 401 |
| Step 4 同步轮询 | poll_song.py 输出 {"event":"error","code":401} |
| 任意 API 调用 | 脚本 stderr 包含 "code": 401 |
直接调用 python3 scripts/muse_api.py member-info(无需传 --token,脚本自动从 ~/.muse/token 读取)。
当用户发送的消息以 eyJ 开头(JWT 格式),按以下流程处理:
python3 scripts/register.py verify --token {用户粘贴的内容} 验证有效性~/.muse/token,直接进入创作流程认证成功后展示欢迎语:
🎵 欢迎使用 Muse 音乐创作助手!
当前积分:{credits 或 credit} | 会员状态:{isMember 或 memberType>0 ? "✨ VIP" : "普通用户"}
每首歌消耗约 10-15 积分,你还可以创作约 {积分/15} 首歌曲。
认证通过后,向用户展示模式选择:
🎵 你想怎么创作?
A. 灵感模式 — 一句话描述,AI 全权创作(风格由 AI 根据描述决定)
B. 定制模式 — 选风格、定歌词,精准控制每个细节
C. 纯音乐 — 无人声的背景音乐 / BGM
直接回复字母即可~
自动检测:如果用户原始消息已包含明确意图,可跳过选择直接进入对应模式:
AI 根据描述自主决定曲风,不承诺风格可控。
交互步骤:
灵感模式不设风格和情绪选项,因为极简模式下 AI 音乐引擎会根据描述自主决定曲风,用户选的风格标签不会被严格执行。
用户完全控制风格和歌词,AI 严格执行。
交互步骤:
✏️ 歌词怎么来?
A. 我来写 — 直接发送你的歌词
B. AI 帮写 — 告诉我主题,AI 生成歌词供你修改
python3 scripts/muse_api.py generate-lyrics --mode master --title "{标题}" --prompt "{用户描述}" 生成歌词。必须使用 --mode master(同步返回),禁止使用 --mode lite(异步),因为 lite 模式会占用生成队列导致后续歌曲生成被阻塞。 如果 master 模式返回 502/503 错误,不要重试 API,改由 AI 直接根据用户描述创作歌词(使用 [Verse] [Chorus] 等结构标签)同灵感模式,但 instrumental=true,不需要选音色。
交互步骤:
输入验证(提交前必须检查):
组装参数并在提交前向用户确认(按模式展示不同卡片):
灵感模式:
🎶 确认你的歌曲设置:
┌─────────────────────────┐
│ 模式:🎲 灵感模式(AI 自由创作)
│ 音色:{男声/女声/随机}
│ 描述:{一句话描述}
│ 风格:AI 根据描述自动匹配
└─────────────────────────┘
确认开始创作?(Y/N)
本次消耗约 10-15 积分,当前余额 {credits}
定制模式:
🎶 确认你的歌曲设置:
┌─────────────────────────┐
│ 模式:🎯 定制模式(精准控制)
│ 风格:{选择的风格标签} ← 严格执行
│ 音色:{男声/女声/随机}
│ 歌词:{歌词前两行}...
└─────────────────────────┘
确认开始创作?(Y/N)
本次消耗约 10-15 积分,当前余额 {credits}
纯音乐模式:
🎶 确认你的歌曲设置:
┌─────────────────────────┐
│ 模式:🎹 纯音乐
│ 描述:{一句话描述}
│ 风格:AI 根据描述自动匹配
└─────────────────────────┘
确认开始创作?(Y/N)
本次消耗约 10-15 积分,当前余额 {credits}
确认后:
python3 scripts/muse_api.py member-info,credits < 10 则拒绝并引导充值)python3 scripts/muse_api.py generate --description "..." --mode ... --voice ... --title "...",无需传 --token)⚠️ 步骤 1-2 中任何接口返回 HTTP 401 → 跳转 Step 0: 认证兜底
分为两个阶段:模拟进度(前 60 秒)和 真实查询(60 秒后)。
前 60 秒不调用 API,只用 sleep 10 间隔输出模拟进度。进度值使用平方函数 progress = 95 × (t/60)²:
| 时间 | 进度 | 输出 |
|---|---|---|
| 0s | 0% | 🎵 开始创作你的歌曲... |
| 10s | 3% | 🎶 作曲中 ▎░░░░░░░░░░░░░░ 3% |
| 20s | 11% | 🎶 编曲中 ▎█░░░░░░░░░░░░░ 11% |
| 30s | 24% | 🎶 录制中 ▎███░░░░░░░░░░░ 24% |
| 40s | 42% | 🎶 混音中 ▎██████░░░░░░░░ 42% |
| 50s | 66% | 🎶 润色中 ▎█████████░░░░░ 66% |
| 60s | 95% | 🎶 即将完成 ▎██████████████░ 95% |
每次输出之间执行 Bash("sleep 10")(保持会话活跃,不阻塞)。
从第 60 秒起,每 10 秒调用一次 muse_api.py query 查询实际状态,最多查询 12 次(再等 2 分钟)。
每次查询流程:
python3 scripts/muse_api.py query(无需传 --token 和 --task-id,脚本自动读取)songs 数组,每首歌有 status 字段)| songs.status | 含义 | 动作 |
|---|---|---|
| 所有歌曲 status=2 | 生成完成 | 输出 ✅ 100% → Step 5 展示结果 |
| 任意歌曲 status=3 | 生成失败 | → Step 5b 失败处理 |
| 所有歌曲都有 audioUrl | 生成完成 | 输出 ✅ 100% → Step 5 展示结果 |
| HTTP 401 | Token 过期 | → Step 0 认证兜底 |
| 其他(status=0/1) | 生成中 | 输出进度提示,sleep 10 后再查 |
查询阶段的进度输出保持在 95-99%:
🎶 精雕细琢中 ▎██████████████░ 96%
🎶 最后打磨中 ▎██████████████░ 98%
若 12 次查询后仍未完成 → Step 5c 超时处理
重要:每步操作都是独立的短时 Bash 调用(sleep 10 或 query 2-3 秒),之间穿插进度文字输出。禁止使用 poll_song.py 做长时间同步阻塞。
伪代码参考:
输出 "🎵 开始创作你的歌曲..."
# 阶段一:模拟进度(0-60s)
阶段文案 = ["作曲中", "编曲中", "录制中", "混音中", "润色中", "即将完成"]
进度值 = [3, 11, 24, 42, 66, 95]
for i in 0..5:
Bash("sleep 10")
输出 "🎶 {阶段文案[i]} ▎{进度条} {进度值[i]}%"
# 阶段二:真实查询(60s+)
for i in 1..12:
result = Bash("python3 scripts/muse_api.py query")
解析 JSON
if 所有 status==2 或 所有 audioUrl 非空:
输出 "✅ 创作完成 ▎███████████████ 100%"
→ Step 5 展示结果,退出循环
if 任意 status==3:
→ Step 5b 失败处理,退出循环
if HTTP 401:
→ Step 0 认证兜底,退出循环
输出 "🎶 精雕细琢中 ▎██████████████░ {95 + i}%"(上限 99%)
Bash("sleep 10")
超出 12 次 → Step 5c 超时处理
歌曲生成完成后,使用以下富文本格式展示(通常返回 2 首候选):
🎉 你的歌曲创作完成啦!
━━━ 1️⃣ {歌名} (版本A) ━━━
🎸 风格:{tags}
⏱ 时长:{分:秒}
🎤 歌词预览:
{lyrics 前4行}
...
🔗 试听下载:{audioUrl}
🖼 封面:{coverUrl}
━━━ 2️⃣ {歌名} (版本B) ━━━
🎸 风格:{tags}
⏱ 时长:{分:秒}
🔗 试听下载:{audioUrl}
🖼 封面:{coverUrl}
━━━━━━━━━━━━━━━━━━━━━
💡 想让歌曲更完美?
→ 发送「重试」用相同设置重新生成
→ 发送「换个风格」保留描述,重新选风格
→ 想要翻唱、MV 等更多功能?可以在 App 中体验
📱 {REGISTER_URL}
━━━━━━━━━━━━━━━━━━━━━
歌曲生成完成后,用户可能发送后续指令。Skill 必须保留上一次生成的参数上下文(description、style、voice、mode、title)来处理这些指令:
「重试」:
scripts/muse_api.py generate「换个风格」:
「再来一首」/ 「做首新歌」:
其他 App 功能(翻唱、MV 等):
这个功能目前需要在 App 中使用哦~
👉 {REGISTER_URL}
风格一致性检查(仅定制模式需要,灵感模式跳过): 定制模式下比对用户选择的 style 与生成结果的 tags,若不一致则追加提示:
⚠️ 风格偏差:你选择的是「{用户style}」,实际生成为「{结果tags}」。
可以发送「重试」重新生成,或「换个风格」更换标签。
灵感模式下不做此检查——因为已告知用户"风格由 AI 根据描述决定",不存在预期偏差。
时长格式化:将秒数转换为 X分Y秒(如 164.96s → 2分44秒)
当 poll_song.py 返回 failed 事件时:
😅 歌曲生成遇到了问题...
可能的原因:
1. 描述过于抽象,AI 无法理解
2. 风格标签组合不常见
3. 歌词中可能包含敏感词
💡 建议:
→ 简化描述,用具体场景替代抽象概念
→ 发送「换个风格」更换风格标签组合
→ 发送「重试」用相同设置重新生成
📱 在 App 中有更多创作方式可以帮到你:{REGISTER_URL}
当 poll_song.py 返回 timeout 事件时:
⏳ 歌曲还在创作中,比预计的要久一些...
任务 ID:{taskId}
你可以稍后发送「查询 {taskId}」查看结果。
💡 也可以在 App 中查看全部创作记录:
👉 {REGISTER_URL}
🎵 你想怎么创作?
A. 灵感模式 — 一句话描述,AI 全权创作(风格由 AI 根据描述决定)
B. 定制模式 — 选风格、定歌词,精准控制每个细节
C. 纯音乐 — 无人声的背景音乐 / BGM
🎸 你想做什么类型的歌?
A. 流行音乐 B. 摇滚 C. 民谣
D. 电子乐 E. 古风 F. R&B
G. 说唱 H. 爵士 I. 其他(直接告诉我)
直接回复字母即可,也可以说「流行+摇滚」组合多个风格~
注意:选项标签必须使用 API 风格列表中的实际值(情绪分类)
🎭 什么情绪/氛围?
A. 快乐 B. 伤感 C. 激昂
D. 浪漫 E. EMO F. 随你决定
情绪→tags 映射表:
| 用户选择 | tags 值 | 可组合标签 |
|---|---|---|
| A. 快乐 | 快乐 | 活力,青春,甜美 |
| B. 伤感 | 伤感 | 怀旧,EMO |
| C. 激昂 | 激昂 | 鼓舞,史诗 |
| D. 浪漫 | 浪漫 | 温暖,梦幻 |
| E. EMO | EMO | 伤感,空灵 |
| F. 随你决定 | 不传情绪 tags | — |
🎤 音色偏好?
A. 男声 B. 女声 C. 都可以(AI 随机)
✏️ 歌词怎么来?
A. 我来写 — 直接发送你的歌词
B. AI 帮写 — 告诉我主题,AI 生成歌词供你修改
✏️ 用一句话描述你想要的歌曲——风格、主题、心情都可以写:
🔥 热门示例:
• 温暖民谣,歌词关于冬天窝在被窝刷剧,旋律治愈系
• City Pop风格:关于分手的歌曲
• 嘻哈/Trap,歌词吐槽微信聊天敷衍文学,flow带戏谑感
• 为了梦想,背井离乡,只要坚持就有希望
• 老村庄,旧院子,怀念无忧无虑的童年
• 赞美我母亲的勤劳、坚强、无私
• 打工苦,打工累,打工挣的是窝囊费
• 电子民谣,融合唢呐和合成器,歌词赛博乡村风
💡 Tips:越具体越好,风格+场景+情绪 效果最佳(至少10个字)
| 交互输入 | CLI 参数 | 值 |
|---|---|---|
| 一句话描述 | --description | 用户输入(不可为空,至少 10 字) |
| 音色选择 | --voice | male=男声, female=女声, random=随机,不传则默认 |
| — | --mode | "lite" |
| — | --style | 不传(AI 自主决定) |
| — | --song-model | "general"(默认值,无需传递) |
| 交互输入 | CLI 参数 | 值 |
|---|---|---|
| 歌词文本 | --description | 用户歌词或 AI 生成歌词 |
| 歌曲标题 | --title | 用户提供或从歌词提取 |
| 风格选择 | --style | 风格标签(严格执行) |
| 音色选择 | --voice | male=男声, female=女声, random=随机 |
| — | --mode | "custom" |
| — | --song-model | "general"(默认值,无需传递) |
| 交互输入 | CLI 参数 | 值 |
|---|---|---|
| 一句话描述 | --description | 用户输入(不可为空,至少 10 字) |
| — | --mode | "instrumental" |
| — | --style | 不传(AI 自主决定) |
| — | --song-model | "general"(默认值,无需传递) |
⚠️ 只允许使用以下文档化的子命令:
device-id、member-info、styles、generate、query、generate-lyrics。 禁止通过--help自行发现或使用未列出的命令。若命令报错,对照下方示例检查参数拼写(CLI 参数使用 kebab-case,如--song-model而非--songModel)。
# 查询会员信息和积分(token 自动从 ~/.muse/token 读取)
python3 scripts/muse_api.py member-info
# 获取风格列表
python3 scripts/muse_api.py styles
# 生成歌曲(灵感模式)
python3 scripts/muse_api.py generate \
--description "一首关于夏天海边的甜蜜情歌" \
--voice female \
--title "海边的夏天"
# 生成歌曲(定制模式,自定义歌词)
python3 scripts/muse_api.py generate \
--description "[Verse]\n阳光洒在海面上...\n[Chorus]\n这个夏天..." \
--style "流行" \
--voice female \
--mode custom \
--title "海边的夏天"
# 生成歌曲(纯音乐)
python3 scripts/muse_api.py generate \
--description "轻快的钢琴曲" \
--mode instrumental
# 查询歌曲状态(自动读取最近任务的 task-id)
python3 scripts/muse_api.py query
# 查询指定任务
python3 scripts/muse_api.py query --task-id TASK_ID
# AI 生成歌词(同步返回)
python3 scripts/muse_api.py generate-lyrics \
--mode master --title "歌曲标题" --prompt "歌曲主题描述"
# AI 生成歌词(异步返回 taskId)
python3 scripts/muse_api.py generate-lyrics \
--mode lite --prompt "写一首关于夏天的歌"
# 获取注册链接
python3 scripts/muse_api.py register-url
# 发送验证码
python3 scripts/register.py send-code --phone 13800138000
# 验证码登录
python3 scripts/register.py login --phone 13800138000 --code 1234
# 轮询歌曲生成状态(自动读取 token 和 task-id,每5秒查一次,超时300秒)
python3 scripts/poll_song.py
输出 JSON 格式进度事件(每行一个 JSON),便于解析:
{"event": "started", "task_id": "xxx", "message": "开始轮询..."}
{"event": "progress", "poll_count": 1, "songs_count": 2, "message": "生成中..."}
{"event": "stream_ready", "songs": [...], "message": "试听版本就绪"}
{"event": "completed", "songs": [...], "count": 2, "message": "生成完成"}
{"event": "failed", "hint": "...", "message": "生成失败"}
{"event": "timeout", "task_id": "xxx", "message": "超时,请稍后查询"}
{"event": "error", "code": 401, "message": "登录状态失效"}
| 错误场景 | HTTP 状态码 | 用户提示 | 解决方案 |
|---|---|---|---|
| Token 无效/过期 | 401 | 引导重新登录,读取 assets/register-guide.md | 重新验证身份 |
| 积分不足 | 403 | "积分不足,当前余额 {credits}" | 获取更多积分(充值或分享邀请) |
| 请求过频/并发限制 | 429 | "正在创作中,请等当前歌曲完成后再试" | — |
| 参数错误/空描述 | 400 | "描述不能为空,请至少输入一句话" | — |
| 生成失败 (status=3) | — | 建议修改描述/风格后重试 | 调整参数重试 |
| 超时 (>300s) | — | 提供 taskId,稍后查询 | 在 App 中查看创作记录 |
| 内容审核失败 | — | "歌词内容可能包含敏感词,请修改后重试" | — |
| 服务不可用 | 502/503 | "服务暂时不可用,请稍后再试" | — |
| 网络错误 | -1 | "网络不稳定,请稍后再试" | — |
member-info 返回的 credits 字段在关键节点为用户提供解决方案和更多能力:
| 场景 | 帮助提示 | 用户价值 |
|---|---|---|
| 认证失败 | "点击链接完成验证,即可开始创作" | 快速恢复使用 |
| 积分不足 | "充值积分或分享邀请好友获取积分" | 继续创作 |
| 结果展示 | "在 App 中还可以翻唱、制作 MV 等" | 发现更多功能 |
| 生成失败 | "App 中有更多创作选项可以尝试" | 解决问题 |
| 超时等待 | "在 App 中可以随时查看创作记录" | 不丢失作品 |
| 每次结尾 | 附带落地页链接 | 探索完整功能 |
落地页链接(统一入口):
REGISTER_URL(https://skills.muse.top/?did=${DEVICE_ID})references/style-catalog.md — 完整音乐风格列表(5 类 115 标签,展示风格选项时读取)assets/register-guide.md — 注册引导提示(Token 缺失时读取)Skills that do similar work, with their headline benchmark lift.
From the same source and nearby in the catalogue.