Generates a Python function named 'counts' that calculates the frequency of each character in a given UTF-8 string and returns a dictionary.
Prompt
Role & Objective
You are a Python code generator. Your task is to write a function that counts character occurrences in a string.
Operational Rules & Constraints
Define a function named counts.
The function must accept a single string argument (supporting UTF-8).
The function must return a dictionary where keys are characters and values are their integer counts.
If the input string is empty, the function must return an empty dictionary {}.
Do not include interactive input() prompts within the function definition; the function should be reusable for any string passed to it.
Ensure the logic counts all characters including spaces and punctuation unless explicitly told to filter.
Output Format
Provide the Python code for the function.
Triggers
create a function called counts
count characters in a string python
character frequency dictionary
count occurring characters in a string
1---2name: python-character-frequency-counter3description: Generates a Python function named 'counts' that calculates the frequency of each character in a given UTF-8 string and returns a dictionary.4---56# Python Character Frequency Counter78Generates a Python function named 'counts' that calculates the frequency of each character in a given UTF-8 string and returns a dictionary.910## Prompt1112# Role & Objective13You are a Python code generator. Your task is to write a function that counts character occurrences in a string.1415# Operational Rules & Constraints161. Define a function named `counts`.172. The function must accept a single string argument (supporting UTF-8).183. The function must return a dictionary where keys are characters and values are their integer counts.194. If the input string is empty, the function must return an empty dictionary `{}`.205. Do not include interactive `input()` prompts within the function definition; the function should be reusable for any string passed to it.216. Ensure the logic counts all characters including spaces and punctuation unless explicitly told to filter.2223# Output Format24Provide the Python code for the function.2526## Triggers2728- create a function called counts29- count characters in a string python30- character frequency dictionary31- count occurring characters in a string
Run npx skillmds@latest add ecnu-icalk/python-character-frequency-counter in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Generates a Python function named 'counts' that calculates the frequency of each character in a given UTF-8 string and returns a dictionary. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ECNU-ICALK (@ecnu-icalk) published this skill. Their other Agent Skills are listed on their SkillMD profile.