baldart 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +599 -0
- package/README.md +566 -0
- package/VERSION +1 -0
- package/bin/baldart.js +143 -0
- package/framework/.claude/agents/REGISTRY.md +169 -0
- package/framework/.claude/agents/api-perf-cost-auditor.md +291 -0
- package/framework/.claude/agents/code-reviewer.md +350 -0
- package/framework/.claude/agents/codebase-architect.md +391 -0
- package/framework/.claude/agents/coder.md +291 -0
- package/framework/.claude/agents/deep-human-insight.md +198 -0
- package/framework/.claude/agents/doc-reviewer.md +440 -0
- package/framework/.claude/agents/email-deliverability-architect.md +193 -0
- package/framework/.claude/agents/hybrid-ml-architect.md +285 -0
- package/framework/.claude/agents/hyper-gamification-designer.md +149 -0
- package/framework/.claude/agents/legal-counsel-gdpr.md +179 -0
- package/framework/.claude/agents/marketing-conversion-strategist.md +162 -0
- package/framework/.claude/agents/motion-expert.md +108 -0
- package/framework/.claude/agents/onboarding-architect-lead.md +230 -0
- package/framework/.claude/agents/plan-auditor.md +546 -0
- package/framework/.claude/agents/prd-card-writer.md +372 -0
- package/framework/.claude/agents/prd.md +744 -0
- package/framework/.claude/agents/qa-sentinel.md +305 -0
- package/framework/.claude/agents/remotion-animator-orchestrator.md +218 -0
- package/framework/.claude/agents/security-reviewer.md +276 -0
- package/framework/.claude/agents/senior-researcher.md +175 -0
- package/framework/.claude/agents/seo-analytics-strategist.md +156 -0
- package/framework/.claude/agents/skill-improver.md +61 -0
- package/framework/.claude/agents/ui-expert.md +191 -0
- package/framework/.claude/agents/visual-designer.md +190 -0
- package/framework/.claude/agents/website-orchestrator.md +118 -0
- package/framework/.claude/agents/wiki-curator.md +145 -0
- package/framework/.claude/commands/baldart-push.md +15 -0
- package/framework/.claude/commands/check.md +237 -0
- package/framework/.claude/commands/codexreview.md +203 -0
- package/framework/.claude/commands/design-review.md +11 -0
- package/framework/.claude/commands/issue-review.md +34 -0
- package/framework/.claude/commands/new.md +331 -0
- package/framework/.claude/commands/qa.md +257 -0
- package/framework/.claude/hooks/framework-edit-gate.js +208 -0
- package/framework/.claude/hooks/lint-before-commit.sh.template +66 -0
- package/framework/.claude/settings.local.json.example +32 -0
- package/framework/.claude/skills/api-design-principles/SKILL.md +567 -0
- package/framework/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/framework/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/framework/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/framework/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/framework/.claude/skills/baldart-push/SKILL.md +222 -0
- package/framework/.claude/skills/bug/SKILL.md +200 -0
- package/framework/.claude/skills/bug/references/logging-patterns.md +174 -0
- package/framework/.claude/skills/capture/SKILL.md +125 -0
- package/framework/.claude/skills/capture/references/synthesis-template.md +42 -0
- package/framework/.claude/skills/context-primer/SKILL.md +189 -0
- package/framework/.claude/skills/copywriting/SKILL.md +273 -0
- package/framework/.claude/skills/copywriting/references/copy-frameworks.md +338 -0
- package/framework/.claude/skills/copywriting/references/natural-transitions.md +252 -0
- package/framework/.claude/skills/doc-writing-for-rag/SKILL.md +119 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/before-after-examples.md +291 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/compact-templates.md +183 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/frontmatter-minimal.md +112 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/line-count-targets.md +110 -0
- package/framework/.claude/skills/doc-writing-for-rag/references/schemas-and-errors.md +129 -0
- package/framework/.claude/skills/find-skills/SKILL.md +133 -0
- package/framework/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/framework/.claude/skills/frontend-design/SKILL.md +84 -0
- package/framework/.claude/skills/gamification-design/SKILL.md +130 -0
- package/framework/.claude/skills/issue-review/SKILL.md +45 -0
- package/framework/.claude/skills/kie-ai/SKILL.md +262 -0
- package/framework/.claude/skills/kie-ai/references/models-catalog.md +272 -0
- package/framework/.claude/skills/kie-ai/scripts/kie_api.sh +209 -0
- package/framework/.claude/skills/kie-ai/scripts/remove_greenscreen.py +69 -0
- package/framework/.claude/skills/kie-ai/scripts/setup_api_key.sh +77 -0
- package/framework/.claude/skills/motion-design/LICENSE +21 -0
- package/framework/.claude/skills/motion-design/README.md +82 -0
- package/framework/.claude/skills/motion-design/SKILL.md +336 -0
- package/framework/.claude/skills/motion-design/director/choreography.md +93 -0
- package/framework/.claude/skills/motion-design/director/context-adaptation.md +83 -0
- package/framework/.claude/skills/motion-design/director/core-philosophy.md +53 -0
- package/framework/.claude/skills/motion-design/director/decision-framework.md +91 -0
- package/framework/.claude/skills/motion-design/director/disney-principles.md +102 -0
- package/framework/.claude/skills/motion-design/director/emotion-mapping.md +71 -0
- package/framework/.claude/skills/motion-design/director/motion-personality.md +89 -0
- package/framework/.claude/skills/motion-design/director/narrative-structure.md +62 -0
- package/framework/.claude/skills/motion-design/patterns/ambient-continuous.md +81 -0
- package/framework/.claude/skills/motion-design/patterns/entrance-exit.md +82 -0
- package/framework/.claude/skills/motion-design/patterns/multi-element.md +69 -0
- package/framework/.claude/skills/motion-design/patterns/state-feedback.md +96 -0
- package/framework/.claude/skills/motion-design/reference/property-selection.md +95 -0
- package/framework/.claude/skills/motion-design/reference/quality-checklist.md +67 -0
- package/framework/.claude/skills/motion-design/reference/timing-easing-tables.md +106 -0
- package/framework/.claude/skills/motion-design/reference/troubleshooting.md +73 -0
- package/framework/.claude/skills/new/SKILL.md +1687 -0
- package/framework/.claude/skills/playwright-skill/API_REFERENCE.md +652 -0
- package/framework/.claude/skills/playwright-skill/SKILL.md +157 -0
- package/framework/.claude/skills/playwright-skill/package.json +26 -0
- package/framework/.claude/skills/prd/SKILL.md +228 -0
- package/framework/.claude/skills/prd/assets/card-template.yml +232 -0
- package/framework/.claude/skills/prd/assets/epic-template.yml +190 -0
- package/framework/.claude/skills/prd/assets/prd-template.md +230 -0
- package/framework/.claude/skills/prd/assets/state-template.md +78 -0
- package/framework/.claude/skills/prd/references/api-perf-gate.md +152 -0
- package/framework/.claude/skills/prd/references/audit-phase.md +478 -0
- package/framework/.claude/skills/prd/references/backlog-phase.md +145 -0
- package/framework/.claude/skills/prd/references/discovery-phase.md +359 -0
- package/framework/.claude/skills/prd/references/impact-analysis.md +233 -0
- package/framework/.claude/skills/prd/references/prd-add-phase.md +214 -0
- package/framework/.claude/skills/prd/references/prd-writing-phase.md +145 -0
- package/framework/.claude/skills/prd/references/research-phase.md +216 -0
- package/framework/.claude/skills/prd/references/ui-design-phase.md +61 -0
- package/framework/.claude/skills/prd/references/validation-phase.md +72 -0
- package/framework/.claude/skills/prd-add/SKILL.md +222 -0
- package/framework/.claude/skills/prd-add/references/impact-analysis.md +233 -0
- package/framework/.claude/skills/remotion-best-practices/SKILL.md +48 -0
- package/framework/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
- package/framework/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/framework/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
- package/framework/.claude/skills/remotion-best-practices/rules/audio.md +169 -0
- package/framework/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/framework/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/framework/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/compositions.md +141 -0
- package/framework/.claude/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/framework/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/framework/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/framework/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/framework/.claude/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/framework/.claude/skills/remotion-best-practices/rules/images.md +130 -0
- package/framework/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/framework/.claude/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/framework/.claude/skills/remotion-best-practices/rules/lottie.md +67 -0
- package/framework/.claude/skills/remotion-best-practices/rules/maps.md +401 -0
- package/framework/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/framework/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/framework/.claude/skills/remotion-best-practices/rules/parameters.md +98 -0
- package/framework/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/framework/.claude/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/framework/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/framework/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/framework/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/framework/.claude/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/framework/.claude/skills/remotion-best-practices/rules/trimming.md +52 -0
- package/framework/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
- package/framework/.claude/skills/seo-audit/SKILL.md +394 -0
- package/framework/.claude/skills/seo-audit/references/aeo-geo-patterns.md +279 -0
- package/framework/.claude/skills/seo-audit/references/ai-writing-detection.md +190 -0
- package/framework/.claude/skills/simplify/SKILL.md +137 -0
- package/framework/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/framework/.claude/skills/skill-creator/SKILL.md +356 -0
- package/framework/.claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/framework/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/framework/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/framework/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/framework/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/framework/.claude/skills/ui-design/SKILL.md +199 -0
- package/framework/.claude/skills/ui-design/references/component-discovery.md +54 -0
- package/framework/.claude/skills/ui-design/references/evaluation.md +171 -0
- package/framework/.claude/skills/ui-design/references/generation.md +109 -0
- package/framework/.claude/skills/ui-design/references/inventory.md +59 -0
- package/framework/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/framework/.claude/skills/webapp-testing/SKILL.md +123 -0
- package/framework/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/framework/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/framework/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/framework/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/framework/.claude/skills/worktree-manager/SKILL.md +680 -0
- package/framework/AGENTS.md +240 -0
- package/framework/agents/api-contracts.md +137 -0
- package/framework/agents/architecture.md +145 -0
- package/framework/agents/coding-standards.md +148 -0
- package/framework/agents/data-model.md +110 -0
- package/framework/agents/deployment-protocol.md +232 -0
- package/framework/agents/design-review.md +172 -0
- package/framework/agents/env-reference.md +171 -0
- package/framework/agents/github-issue-subagent.md +252 -0
- package/framework/agents/index.md +261 -0
- package/framework/agents/llm-wiki-methodology.md +216 -0
- package/framework/agents/maintenance-protocol.md +305 -0
- package/framework/agents/observability.md +162 -0
- package/framework/agents/performance.md +155 -0
- package/framework/agents/project-context.md +145 -0
- package/framework/agents/runbook.md +208 -0
- package/framework/agents/security.md +168 -0
- package/framework/agents/skills-mapping.md +286 -0
- package/framework/agents/testing.md +111 -0
- package/framework/agents/workflows.md +215 -0
- package/framework/docs/PROJECT-CONFIGURATION.md +336 -0
- package/framework/docs/references/brand-guidelines.md +170 -0
- package/framework/docs/references/ui-guidelines.template.md +182 -0
- package/framework/routines/code-review.routine.yml +46 -0
- package/framework/routines/doc-review.routine.yml +45 -0
- package/framework/routines/ds-drift.routine.yml +52 -0
- package/framework/routines/full-sweep.routine.yml +51 -0
- package/framework/routines/index.yml +70 -0
- package/framework/routines/skill-improve.routine.yml +50 -0
- package/framework/routines/wiki-review.routine.yml +45 -0
- package/framework/templates/baldart.config.template.yml +113 -0
- package/framework/templates/breaking-change-checklist.md +484 -0
- package/framework/templates/feature-card.template.yml +125 -0
- package/framework/templates/overlays/README.md +44 -0
- package/framework/templates/overlays/copywriting.fidelity-example.md +62 -0
- package/framework/templates/overlays/ui-design.fidelity-example.md +75 -0
- package/framework/templates/skill-project-context.snippet.md +19 -0
- package/framework/templates/spec.template.md +208 -0
- package/package.json +51 -0
- package/src/commands/add.js +229 -0
- package/src/commands/configure.js +385 -0
- package/src/commands/doctor.js +486 -0
- package/src/commands/migrate.js +185 -0
- package/src/commands/push.js +0 -0
- package/src/commands/routines.js +269 -0
- package/src/commands/status.js +130 -0
- package/src/commands/update.js +419 -0
- package/src/commands/version.js +88 -0
- package/src/utils/contamination.js +400 -0
- package/src/utils/git.js +181 -0
- package/src/utils/hooks.js +152 -0
- package/src/utils/routine-adapters/claude-code-cloud.js +78 -0
- package/src/utils/routine-adapters/cron.js +138 -0
- package/src/utils/routine-adapters/github-actions.js +141 -0
- package/src/utils/routine-adapters/index.js +21 -0
- package/src/utils/routines.js +166 -0
- package/src/utils/state.js +143 -0
- package/src/utils/symlinks.js +425 -0
- package/src/utils/ui.js +133 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Kie.ai API helper — handles auth, requests, polling, and downloads
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
command -v python3 >/dev/null 2>&1 || { echo "ERROR: python3 required but not found." >&2; exit 1; }
|
|
6
|
+
|
|
7
|
+
# --- Retrieve API Key ---
|
|
8
|
+
get_api_key() {
|
|
9
|
+
local key=""
|
|
10
|
+
if [[ "$(uname)" == "Darwin" ]]; then
|
|
11
|
+
key=$(security find-generic-password -s "kie-ai-api" -w 2>/dev/null || true)
|
|
12
|
+
fi
|
|
13
|
+
if [[ -z "$key" ]] && [[ -f "${HOME}/.config/kie-ai/config" ]]; then
|
|
14
|
+
key=$(grep -oP 'api_key=\K.*' "${HOME}/.config/kie-ai/config" 2>/dev/null || true)
|
|
15
|
+
fi
|
|
16
|
+
if [[ -z "$key" ]]; then
|
|
17
|
+
echo "ERROR: No Kie.ai API key found. Run setup_api_key.sh first." >&2
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
echo "$key"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# --- Check Credits ---
|
|
24
|
+
check_credits() {
|
|
25
|
+
local key
|
|
26
|
+
key=$(get_api_key)
|
|
27
|
+
curl -s -H "Authorization: Bearer $key" "https://api.kie.ai/api/v1/chat/credit"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# --- Create Task (Market unified endpoint) ---
|
|
31
|
+
# Usage: create_market_task '{"model":"nano-banana-2","input":{...}}'
|
|
32
|
+
create_market_task() {
|
|
33
|
+
local key payload="$1"
|
|
34
|
+
key=$(get_api_key)
|
|
35
|
+
curl -s -X POST "https://api.kie.ai/api/v1/jobs/createTask" \
|
|
36
|
+
-H "Authorization: Bearer $key" \
|
|
37
|
+
-H "Content-Type: application/json" \
|
|
38
|
+
-d "$payload"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# --- Create Task (Dedicated endpoint) ---
|
|
42
|
+
# Usage: create_dedicated_task "/api/v1/runway/generate" '{"prompt":"...","duration":5,...}'
|
|
43
|
+
create_dedicated_task() {
|
|
44
|
+
local key endpoint="$1" payload="$2"
|
|
45
|
+
key=$(get_api_key)
|
|
46
|
+
curl -s -X POST "https://api.kie.ai${endpoint}" \
|
|
47
|
+
-H "Authorization: Bearer $key" \
|
|
48
|
+
-H "Content-Type: application/json" \
|
|
49
|
+
-d "$payload"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# --- Poll Task Status (Market) ---
|
|
53
|
+
# Usage: poll_market_task "task_12345"
|
|
54
|
+
poll_market_task() {
|
|
55
|
+
local key task_id="$1" max_attempts="${2:-60}" interval="${3:-10}"
|
|
56
|
+
key=$(get_api_key)
|
|
57
|
+
|
|
58
|
+
for ((i=1; i<=max_attempts; i++)); do
|
|
59
|
+
local response
|
|
60
|
+
response=$(curl -s -H "Authorization: Bearer $key" \
|
|
61
|
+
"https://api.kie.ai/api/v1/jobs/recordInfo?taskId=${task_id}")
|
|
62
|
+
|
|
63
|
+
local state
|
|
64
|
+
state=$(echo "$response" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('state','unknown'))" 2>/dev/null || echo "unknown")
|
|
65
|
+
|
|
66
|
+
case "$state" in
|
|
67
|
+
success)
|
|
68
|
+
echo "$response"
|
|
69
|
+
return 0
|
|
70
|
+
;;
|
|
71
|
+
fail)
|
|
72
|
+
echo "$response"
|
|
73
|
+
return 1
|
|
74
|
+
;;
|
|
75
|
+
waiting|queuing|generating)
|
|
76
|
+
echo "[$i/$max_attempts] Status: $state — waiting ${interval}s..." >&2
|
|
77
|
+
sleep "$interval"
|
|
78
|
+
;;
|
|
79
|
+
*)
|
|
80
|
+
echo "[$i/$max_attempts] Unknown state: $state — waiting ${interval}s..." >&2
|
|
81
|
+
sleep "$interval"
|
|
82
|
+
;;
|
|
83
|
+
esac
|
|
84
|
+
done
|
|
85
|
+
echo "ERROR: Timeout after $max_attempts attempts" >&2
|
|
86
|
+
return 2
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# --- Poll Task Status (Dedicated endpoint) ---
|
|
90
|
+
# Usage: poll_dedicated_task "/api/v1/veo/record-info" "task_12345"
|
|
91
|
+
poll_dedicated_task() {
|
|
92
|
+
local key endpoint="$1" task_id="$2" max_attempts="${3:-60}" interval="${4:-10}"
|
|
93
|
+
key=$(get_api_key)
|
|
94
|
+
|
|
95
|
+
for ((i=1; i<=max_attempts; i++)); do
|
|
96
|
+
local response
|
|
97
|
+
response=$(curl -s -H "Authorization: Bearer $key" \
|
|
98
|
+
"https://api.kie.ai${endpoint}?taskId=${task_id}")
|
|
99
|
+
|
|
100
|
+
local flag
|
|
101
|
+
flag=$(echo "$response" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('successFlag',-1))" 2>/dev/null || echo "-1")
|
|
102
|
+
|
|
103
|
+
case "$flag" in
|
|
104
|
+
1)
|
|
105
|
+
echo "$response"
|
|
106
|
+
return 0
|
|
107
|
+
;;
|
|
108
|
+
2|3)
|
|
109
|
+
echo "$response"
|
|
110
|
+
return 1
|
|
111
|
+
;;
|
|
112
|
+
0)
|
|
113
|
+
echo "[$i/$max_attempts] Generating — waiting ${interval}s..." >&2
|
|
114
|
+
sleep "$interval"
|
|
115
|
+
;;
|
|
116
|
+
*)
|
|
117
|
+
echo "[$i/$max_attempts] Status flag: $flag — waiting ${interval}s..." >&2
|
|
118
|
+
sleep "$interval"
|
|
119
|
+
;;
|
|
120
|
+
esac
|
|
121
|
+
done
|
|
122
|
+
echo "ERROR: Timeout after $max_attempts attempts" >&2
|
|
123
|
+
return 2
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
# --- Get Download URL ---
|
|
127
|
+
# Usage: get_download_url "https://tempfile..."
|
|
128
|
+
get_download_url() {
|
|
129
|
+
local key url="$1"
|
|
130
|
+
key=$(get_api_key)
|
|
131
|
+
curl -s -X POST "https://api.kie.ai/api/v1/common/download-url" \
|
|
132
|
+
-H "Authorization: Bearer $key" \
|
|
133
|
+
-H "Content-Type: application/json" \
|
|
134
|
+
-d "{\"url\":\"$url\"}"
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
# --- Download File ---
|
|
138
|
+
# Usage: download_file "https://tempfile..." "/path/to/output.png"
|
|
139
|
+
download_file() {
|
|
140
|
+
local file_url="$1" output_path="$2"
|
|
141
|
+
local download_response
|
|
142
|
+
download_response=$(get_download_url "$file_url")
|
|
143
|
+
|
|
144
|
+
local direct_url
|
|
145
|
+
direct_url=$(echo "$download_response" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',''))" 2>/dev/null || echo "")
|
|
146
|
+
|
|
147
|
+
if [[ -z "$direct_url" ]]; then
|
|
148
|
+
# Fallback: try the original URL
|
|
149
|
+
direct_url="$file_url"
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
curl -sL -o "$output_path" "$direct_url"
|
|
153
|
+
echo "Downloaded to: $output_path"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
# --- Upload File (URL method) ---
|
|
157
|
+
# Usage: upload_file_url "https://example.com/image.png"
|
|
158
|
+
upload_file_url() {
|
|
159
|
+
local key url="$1"
|
|
160
|
+
key=$(get_api_key)
|
|
161
|
+
curl -s -X POST "https://kieai.redpandaai.co/api/file-url-upload" \
|
|
162
|
+
-H "Authorization: Bearer $key" \
|
|
163
|
+
-H "Content-Type: application/json" \
|
|
164
|
+
-d "{\"fileUrl\":\"$url\"}"
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
# --- Upload File (Stream method) ---
|
|
168
|
+
# Usage: upload_file_stream "/path/to/file.png"
|
|
169
|
+
upload_file_stream() {
|
|
170
|
+
local key file_path="$1"
|
|
171
|
+
local filename
|
|
172
|
+
filename=$(basename "$file_path")
|
|
173
|
+
key=$(get_api_key)
|
|
174
|
+
curl -s -X POST "https://kieai.redpandaai.co/api/file-stream-upload" \
|
|
175
|
+
-H "Authorization: Bearer $key" \
|
|
176
|
+
-F "file=@${file_path}" \
|
|
177
|
+
-F "uploadPath=${filename}"
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
# --- Main dispatcher ---
|
|
181
|
+
case "${1:-help}" in
|
|
182
|
+
credits) check_credits ;;
|
|
183
|
+
create-market) create_market_task "$2" ;;
|
|
184
|
+
create) create_dedicated_task "$2" "$3" ;;
|
|
185
|
+
poll-market) poll_market_task "$2" "${3:-60}" "${4:-10}" ;;
|
|
186
|
+
poll) poll_dedicated_task "$2" "$3" "${4:-60}" "${5:-10}" ;;
|
|
187
|
+
download-url) get_download_url "$2" ;;
|
|
188
|
+
download) download_file "$2" "$3" ;;
|
|
189
|
+
upload-url) upload_file_url "$2" ;;
|
|
190
|
+
upload-stream) upload_file_stream "$2" ;;
|
|
191
|
+
help)
|
|
192
|
+
echo "Usage: kie_api.sh <command> [args]"
|
|
193
|
+
echo ""
|
|
194
|
+
echo "Commands:"
|
|
195
|
+
echo " credits Check remaining credits"
|
|
196
|
+
echo " create-market '<json>' Create task (Market unified)"
|
|
197
|
+
echo " create '<endpoint>' '<json>' Create task (dedicated endpoint)"
|
|
198
|
+
echo " poll-market <taskId> [max] [sec] Poll Market task status"
|
|
199
|
+
echo " poll <endpoint> <taskId> [max] Poll dedicated task status"
|
|
200
|
+
echo " download-url <url> Get direct download URL"
|
|
201
|
+
echo " download <url> <output_path> Download generated file"
|
|
202
|
+
echo " upload-url <url> Upload file by URL"
|
|
203
|
+
echo " upload-stream <file_path> Upload local file"
|
|
204
|
+
;;
|
|
205
|
+
*)
|
|
206
|
+
echo "Unknown command: $1. Use 'help' for usage." >&2
|
|
207
|
+
exit 1
|
|
208
|
+
;;
|
|
209
|
+
esac
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Remove green screen (#00FF00) from an image and produce a transparent PNG.
|
|
3
|
+
|
|
4
|
+
Usage:
|
|
5
|
+
python3 remove_greenscreen.py input.png output.png [--tolerance 60] [--edge-blur 1]
|
|
6
|
+
|
|
7
|
+
Dependencies: Pillow (pip3 install Pillow)
|
|
8
|
+
"""
|
|
9
|
+
import argparse
|
|
10
|
+
import sys
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
from PIL import Image, ImageFilter
|
|
15
|
+
except ImportError:
|
|
16
|
+
print("ERROR: Pillow is required. Install with: pip3 install Pillow", file=sys.stderr)
|
|
17
|
+
sys.exit(1)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def remove_green(input_path: str, output_path: str, tolerance: int = 60, edge_blur: int = 1, fmt: str = "png") -> None:
|
|
21
|
+
img = Image.open(input_path).convert("RGBA")
|
|
22
|
+
pixels = img.load()
|
|
23
|
+
width, height = img.size
|
|
24
|
+
|
|
25
|
+
for y in range(height):
|
|
26
|
+
for x in range(width):
|
|
27
|
+
r, g, b, a = pixels[x, y]
|
|
28
|
+
# Check if pixel is "green enough" to be chroma key
|
|
29
|
+
if g > 100 and (g - r) > tolerance and (g - b) > tolerance:
|
|
30
|
+
pixels[x, y] = (0, 0, 0, 0)
|
|
31
|
+
else:
|
|
32
|
+
# De-spill: reduce green tint on edge pixels near transparent areas
|
|
33
|
+
max_rb = max(r, b)
|
|
34
|
+
if g > max_rb + 20:
|
|
35
|
+
g_corrected = min(g, max_rb + 10)
|
|
36
|
+
pixels[x, y] = (r, g_corrected, b, a)
|
|
37
|
+
|
|
38
|
+
# Edge anti-aliasing via alpha channel blur
|
|
39
|
+
if edge_blur > 0:
|
|
40
|
+
alpha = img.split()[3]
|
|
41
|
+
alpha = alpha.filter(ImageFilter.GaussianBlur(radius=edge_blur))
|
|
42
|
+
img.putalpha(alpha)
|
|
43
|
+
|
|
44
|
+
save_format = "WEBP" if fmt == "webp" else "PNG"
|
|
45
|
+
img.save(output_path, save_format)
|
|
46
|
+
print(f"Transparent {save_format} saved to: {output_path}")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def main() -> None:
|
|
50
|
+
parser = argparse.ArgumentParser(description="Remove green screen from image")
|
|
51
|
+
parser.add_argument("input", help="Input image path (with green screen)")
|
|
52
|
+
parser.add_argument("output", help="Output PNG path (transparent)")
|
|
53
|
+
parser.add_argument("--tolerance", type=int, default=60,
|
|
54
|
+
help="Green detection tolerance 0-255 (default: 60)")
|
|
55
|
+
parser.add_argument("--edge-blur", type=int, default=1,
|
|
56
|
+
help="Edge anti-alias blur radius in pixels (default: 1)")
|
|
57
|
+
parser.add_argument("--format", choices=["png", "webp"], default="png",
|
|
58
|
+
help="Output format: png or webp (default: png)")
|
|
59
|
+
args = parser.parse_args()
|
|
60
|
+
|
|
61
|
+
if not Path(args.input).exists():
|
|
62
|
+
print(f"ERROR: Input file not found: {args.input}", file=sys.stderr)
|
|
63
|
+
sys.exit(1)
|
|
64
|
+
|
|
65
|
+
remove_green(args.input, args.output, args.tolerance, args.edge_blur, args.format)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
if __name__ == "__main__":
|
|
69
|
+
main()
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Kie.ai API Key Setup Script
|
|
3
|
+
# Stores the API key securely in the system keychain (macOS) or encrypted file
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
KIE_CONFIG_DIR="${HOME}/.config/kie-ai"
|
|
8
|
+
KIE_CONFIG_FILE="${KIE_CONFIG_DIR}/config"
|
|
9
|
+
KEYCHAIN_SERVICE="kie-ai-api"
|
|
10
|
+
|
|
11
|
+
echo "=== Kie.ai API Key Setup ==="
|
|
12
|
+
echo ""
|
|
13
|
+
echo "Get your API key at: https://kie.ai/api-key"
|
|
14
|
+
echo ""
|
|
15
|
+
|
|
16
|
+
# Check if already configured
|
|
17
|
+
existing_key=""
|
|
18
|
+
if [[ "$(uname)" == "Darwin" ]]; then
|
|
19
|
+
existing_key=$(security find-generic-password -s "$KEYCHAIN_SERVICE" -w 2>/dev/null || true)
|
|
20
|
+
elif [[ -f "$KIE_CONFIG_FILE" ]]; then
|
|
21
|
+
existing_key=$(grep -oP 'api_key=\K.*' "$KIE_CONFIG_FILE" 2>/dev/null || true)
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
if [[ -n "$existing_key" ]]; then
|
|
25
|
+
masked="${existing_key:0:8}...${existing_key: -4}"
|
|
26
|
+
echo "Existing API key found: $masked"
|
|
27
|
+
echo ""
|
|
28
|
+
read -rp "Replace existing key? (y/N): " replace
|
|
29
|
+
if [[ "$replace" != "y" && "$replace" != "Y" ]]; then
|
|
30
|
+
echo "Keeping existing key."
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Read the new API key
|
|
36
|
+
read -rsp "Enter your Kie.ai API key: " api_key
|
|
37
|
+
echo ""
|
|
38
|
+
|
|
39
|
+
if [[ -z "$api_key" ]]; then
|
|
40
|
+
echo "Error: API key cannot be empty."
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Validate the key by checking credits
|
|
45
|
+
echo "Validating API key..."
|
|
46
|
+
response=$(curl -s -w "\n%{http_code}" -H "Authorization: Bearer $api_key" \
|
|
47
|
+
"https://api.kie.ai/api/v1/chat/credit" 2>/dev/null || true)
|
|
48
|
+
|
|
49
|
+
http_code=$(echo "$response" | tail -1)
|
|
50
|
+
body=$(echo "$response" | head -1)
|
|
51
|
+
|
|
52
|
+
if [[ "$http_code" == "200" ]]; then
|
|
53
|
+
credits=$(echo "$body" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data','?'))" 2>/dev/null || echo "?")
|
|
54
|
+
echo "Valid! Remaining credits: $credits"
|
|
55
|
+
else
|
|
56
|
+
echo "Warning: Could not validate key (HTTP $http_code). Saving anyway."
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# Store securely
|
|
60
|
+
if [[ "$(uname)" == "Darwin" ]]; then
|
|
61
|
+
# macOS: use Keychain
|
|
62
|
+
security delete-generic-password -s "$KEYCHAIN_SERVICE" 2>/dev/null || true
|
|
63
|
+
security add-generic-password -s "$KEYCHAIN_SERVICE" -a "kie-ai" -w "$api_key"
|
|
64
|
+
echo ""
|
|
65
|
+
echo "API key stored in macOS Keychain (service: $KEYCHAIN_SERVICE)"
|
|
66
|
+
else
|
|
67
|
+
# Linux/other: encrypted config file with restricted permissions
|
|
68
|
+
mkdir -p "$KIE_CONFIG_DIR"
|
|
69
|
+
chmod 700 "$KIE_CONFIG_DIR"
|
|
70
|
+
echo "api_key=$api_key" > "$KIE_CONFIG_FILE"
|
|
71
|
+
chmod 600 "$KIE_CONFIG_FILE"
|
|
72
|
+
echo ""
|
|
73
|
+
echo "API key stored in $KIE_CONFIG_FILE (permissions: 600)"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
echo ""
|
|
77
|
+
echo "Setup complete! The skill can now use your Kie.ai API."
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 LottieFiles
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Motion Design Skill
|
|
2
|
+
|
|
3
|
+
Universal motion design principles for AI agents. Philosophy-first, implementation-agnostic.
|
|
4
|
+
|
|
5
|
+
Teaches agents to think like motion directors — choosing the right timing, easing, choreography, and emotional intent before writing a single line of animation code. Works with any animation system (CSS, Framer Motion, GSAP, Lottie, Spring, etc.).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx skills add LottieFiles/motion-design-skill
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Supports [40+ agents](https://skills.sh) including Claude Code, Cursor, Codex, GitHub Copilot, and more.
|
|
14
|
+
|
|
15
|
+
## What's included
|
|
16
|
+
|
|
17
|
+
**Core** (`SKILL.md`) — Quick reference with the 8-step checklist, motion personality archetypes, duration/easing tables, property selection guide, common patterns, and quality rules.
|
|
18
|
+
|
|
19
|
+
**Philosophy** (`director/`) — Deep dives into the three pillars, Disney's 12 principles adapted for UI, emotion-to-motion mapping, choreography, narrative structure, and context adaptation.
|
|
20
|
+
|
|
21
|
+
**Patterns** (`patterns/`) — Ready-to-use recipes for entrance/exit animations, state feedback (success, error, loading, hover), ambient/continuous motion, and multi-element choreography.
|
|
22
|
+
|
|
23
|
+
**Reference** (`reference/`) — Lookup tables for timing and easing, property selection guide, quality checklist, and troubleshooting common animation problems.
|
|
24
|
+
|
|
25
|
+
## When it activates
|
|
26
|
+
|
|
27
|
+
The skill activates when you're working on:
|
|
28
|
+
|
|
29
|
+
- UI animations (buttons, cards, modals, page transitions)
|
|
30
|
+
- Micro-interactions and feedback animations
|
|
31
|
+
- Loading, success, or error states
|
|
32
|
+
- Scroll-triggered or progress-based animations
|
|
33
|
+
- Establishing brand motion identity
|
|
34
|
+
- Multi-element choreography and sequencing
|
|
35
|
+
|
|
36
|
+
## Example prompts
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Add a playful entrance animation to these card components
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Create a loading → success → error state transition for this form submit button
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Choreograph the entrance sequence for this dashboard — hero chart first, then stats cards, then sidebar
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Review my animation code and suggest improvements based on motion design principles
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Skill structure
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
skills/motion-design/
|
|
58
|
+
├── SKILL.md # Main skill instructions (< 500 lines)
|
|
59
|
+
├── director/
|
|
60
|
+
│ ├── core-philosophy.md # Three Pillars deep dive
|
|
61
|
+
│ ├── decision-framework.md # Full decision pipeline
|
|
62
|
+
│ ├── disney-principles.md # 12 principles, UI-adapted
|
|
63
|
+
│ ├── motion-personality.md # 4 archetypes + brand identity
|
|
64
|
+
│ ├── emotion-mapping.md # Emotion → motion translation
|
|
65
|
+
│ ├── choreography.md # Multi-element coordination
|
|
66
|
+
│ ├── narrative-structure.md # Micro-story framework
|
|
67
|
+
│ └── context-adaptation.md # Platform, a11y, performance
|
|
68
|
+
├── patterns/
|
|
69
|
+
│ ├── entrance-exit.md # Entrance/exit recipes
|
|
70
|
+
│ ├── state-feedback.md # Success, error, loading, hover
|
|
71
|
+
│ ├── ambient-continuous.md # Looping, breathing, parallax
|
|
72
|
+
│ └── multi-element.md # Stagger + choreography recipes
|
|
73
|
+
└── reference/
|
|
74
|
+
├── timing-easing-tables.md # Duration + easing lookups
|
|
75
|
+
├── property-selection.md # Property communication guide
|
|
76
|
+
├── quality-checklist.md # Evaluation criteria
|
|
77
|
+
└── troubleshooting.md # Animation smells + fixes
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|