npcpy-prompting
SkillAI & modelsTeaches your agent prompting and JSON formatting patterns for working with LLMs.
Use npcpy-prompting in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add npcpy-prompting and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the npcpy-prompting skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
About this skill
npcpy LLM prompting and JSON formatting patterns.
What this skill tells your AI
The instructions your AI receives, as published by npc-worldwide/npcsh in skills/npcpy-prompting/SKILL.md and read by Ahel’s review.
npcpy LLM prompting and JSON formatting patterns.
Imports
Always import at module level:
from npcpy.llm_funcs import get_llm_responsefrom npcpy.npc_compiler import NPCfrom npcpy.gen.response import get_litellm_response(only for streaming)
Basic-Call
get_llm_response(prompt, model, provider, **kwargs) — first arg is POSITIONAL.
Do NOT write prompt=prompt. Do NOT use NPC.call(). The function is module-level.
Json-Mode
Pass format="json" for structured output.
npcpy parses internally. Access via response["response"].
Never call json.loads() manually.
Npc-Object
Create an NPC to hold model, provider, and primary_directive.
Pass it as npc=npc_instance so npcpy reads those values:
npc = NPC(name="...", primary_directive="...", model="...", provider="...")
response = get_llm_response(prompt, npc=npc, format="json", temperature=0.7)
data = response["response"]
Messages
Pass conversation history as messages=[{"role": "system", "content": msg}].
This is a kwarg like any other. It does not persist between calls.
Parameters
Sampling kwargs to get_llm_response:
temperature,top_p,top_k,max_tokensstream=Truereturns a generator inresponse["response"]
Streaming
For token-level streaming use get_litellm_response with stream=True.
For segment-level use get_llm_response(..., stream=True) and iterate response["response"].
Anti-Patterns
- Do NOT use
json.loads(response["response"]). - Do NOT call
response.get("response")and then parse it again. - Do NOT assume
responseis a string whenformat="json"is used.
Prompt-Formatting
When constructing prompt strings in Python:
- Use
f"""..."""for all multiline prompts. Do NOT use implicit string concatenation. - Do NOT put multiline strings directly in a
returnstatement. Assign to a variable first, then return it. - The closing
"""must be at the same indentation as the variable assignment. - Do NOT escape braces as
{{inside f-strings. If you need literal curly braces in the prompt output, use explicit string concatenation:prompt = f"""Write a JSON response like this:""" + """\n{'key': 'value'}\n""" - Never use
f"..." f"..."on adjacent lines or in parentheses expecting the parser to concatenate them.
Signals
- GitHub stars
- 482
- Forks
- 32
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
npcpy-prompting- Source
- github.com/npc-worldwide/npcsh
github.com/npc-worldwide/npcsh
Related picks
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Pythonskill-creator
Skill · anthropics
More in AI & modelstriage
Skill · mattpocock
More in AI & modelswayfinder
Skill · mattpocock
More in AI & modelsalgorithmic-art
Skill · anthropics
More in AI & models