From green-code
Plants trees via Tree-Nation to offset AI carbon footprint. Calculates trees needed based on accumulated CO2, confirms before planting, and updates usage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/green-code:plantThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Plant trees via Tree-Nation to compensate the user's AI carbon footprint.
Plant trees via Tree-Nation to compensate the user's AI carbon footprint.
Read ~/.claude/plugins/data/green-code/config.json to verify API key and forest_id are set. If not, tell the user to run /green:config first.
Read ~/.claude/plugins/data/green-code/usage.json to get the current CO2 accumulation.
Determine how many trees to plant:
/green:plant 3), use that number.ceil(accumulated.co2_kg / threshold_co2_kg)Confirm with the user before planting: "You're about to plant {N} tree(s) via Tree-Nation to offset {co2} kg of CO2. Proceed?"
4b. Determine the dedication message (attached to each planting and shown on the public Tree-Nation certificate):
/green:plant 3 "merci pour la forêt"), use it verbatim.Compensation {co2} kg CO2 - usage IA Claude Code - {date} / Offsetting {co2} kg CO2 - Claude Code AI usage - {date}).If confirmed, run the planting script (the message is optional; wrap it in quotes):
"${CLAUDE_PLUGIN_ROOT}/scripts/treenation.sh" plant {N} "{message}"
Parse the output:
OK: -- success. Show the number of trees planted and certificate URLs.ERROR: -- show the error and suggest checking the API key.After successful planting, update the accumulated CO2:
N * threshold_co2_kg from accumulated.co2_kg in usage.jsonShow a summary:
{N} tree(s) planted via Tree-Nation!
CO2 offset: {offset} kg
Total trees planted: {trees.total}
Certificate(s): {urls}
message)npx claudepluginhub jeremiesamson/green-code --plugin green-codeCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.