novainsilico/jinko-skills

jinko-sdk-setup

Authenticate and configure access to a Jinkō project via the jinko-sdk.

Voir la source

Mode d’emploi

  1. Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
  2. Consultez le document original pour les outils, identifiants et environnements requis.
  3. Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/novainsilico/jinko-skills --skill jinko-sdk-setup

Avant de commencer

  • L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
  • Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Document Skill original

Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.

Jinkō SDK Setup

Use this skill for SDK setup and credential checks only. Keep the user focused on proving that Python can authenticate against Jinkō and read one project item list before moving to model, vpop, protocol, output-set, or trial workflows.

BE CAREFUL: the right package is jinko-sdk that export a jinko module. jinko is a different package unrelated to the Jinko SDK.

Credentials

Do this before the connection check. JinkoClient() reads credentials from the environment only. The SDK commands (python -m jinko.cli.*) also load a local .env when python-dotenv is installed, except create_document_from_markdown. python-dotenv is not a dependency of jinko-sdk. For that command or your own script, export the variables of .env first (set -a; source .env; set +a), or install python-dotenv and call from dotenv import load_dotenv; load_dotenv() before JinkoClient().

Choose the credential

  1. If JINKO_API_KEY is set in the environment or .env, use it. Do not call get_session_code. An API key serves every SDK process for the whole session, so it needs no per-command approval.
  2. Use a session code only when no JINKO_API_KEY is available and a Jinko MCP server exposes get_session_code.
  3. If neither is available, ask the user to add JINKO_API_KEY to .env (see assets/.env.example). Do not ask the user to paste a key into chat.

When both JINKO_API_KEY and JINKO_SESSION_CODE are set, the SDK uses the session code. Do not export a session code when an API key is available.

Choose the project

An API key can be an organization key that reaches several projects, so JINKO_PROJECT_ID is not always set.

  1. If JINKO_PROJECT_ID is set, or the user named a project, use it.
  2. Otherwise, run python -m jinko.cli.check_jinko_connection without JINKO_PROJECT_ID. It lists the projects the key can see. Show the list and ask the user which project to use. Do not guess a project.
  3. Export the chosen id as JINKO_PROJECT_ID for the SDK processes of the task. For work across several projects, use JinkoOrgClient and org.project(project_id) instead (see "Choosing a client").

Session code (only without an API key)

A session code can be exchanged only once. Call get_session_code immediately before each SDK process, including the connection check and every later command. Do not reuse a code that was already passed to a process.

  1. Call get_session_code with no arguments.
  2. The tool returns JSON with code and expiresAt. Export code as JINKO_SESSION_CODE for that one process.
  3. Keep the code out of .env, chat, logs, and version control.
  4. Inside that process the SDK exchanges the code once, keeps the bearer in JINKO_API_TOKEN, and drops JINKO_SESSION_CODE. A new process does not see that bearer. Fetch a new code for it.
  5. Also call get_session_code again after expiresAt, or when the SDK reports an authentication failure.

Because each SDK process needs a new code, a multi-step workflow on session codes produces one tool call per process. Recommend adding JINKO_API_KEY to .env when the user runs many SDK commands.

Workflow

SDK VERSION PREREQUISITE: Run the check below. It ships with the SDK and verifies the installed SDK against every neighboring SDK-dependent skill before API access.

Run the deterministic check and follow its success or error message:

bash
python -m jinko.cli.check_jinko_connection

The script:

  • Loads .env when python-dotenv is installed.
  • Redacts sensitive values when showing configuration.
  • Requires JINKO_API_KEY (a project key or an organization key) or, when no key is available, JINKO_SESSION_CODE. When both credential variables are set, JINKO_SESSION_CODE is used, so do not export a session code next to a key.
  • Without JINKO_PROJECT_ID, lists the projects visible to the key with JinkoOrgClient().list_projects(). This list does not show the key scope, so the script does not report the key type.
  • With JINKO_PROJECT_ID, constructs JinkoClient(), calls client.auth_check(), then client.search(limit=1, show_table=False, show_table_hint=False) to prove minimal read-only project-item access.
  • Prints minimal output on success, including the key type when JINKO_PROJECT_ID is set.

Use --show-config only when debugging local setup; it prints presence and redacted values, never the full API key or session code.

After Validation

Once the connection check passes, prefer client.search(...) for project exploration because it gives the user an immediate view across project items.

Use a minimal example like:

python
from jinko import JinkoClient

client = JinkoClient()
client.search(limit=20, columns="compact")

Use search() when the user wants to:

  • browse what exists in the configured project
  • find an item by name or free text
  • orient themselves before choosing a model, protocol, vpop, or trial workflow

The setup script uses a one-item, non-rendered search() only as its project-read check after authentication. Use a larger interactive search() only for exploration after validation succeeds.

Reading SDK signatures

Import only JinkoClient and/or JinkoOrgClient, and optionally the exceptions from jinko. The SDK has no jinko.model or jinko.models module. Get every other object from the client, then read its signature and docstring when needed with help():

python
model = client.get_model("cm-...")
help(client.get_model)
help(type(model))  # every method of the returned object
help(model.simple_solve)

Import a class from jinko.domain only to name it in a type annotation, for example from jinko.domain import Model. Avoid searching the installed package source for signatures.

Choosing a client

Both clients accept a project key and an organization key, so choose by task. Use JinkoClient() for work in the project that JINKO_PROJECT_ID names. Use JinkoOrgClient when JINKO_PROJECT_ID is unset or the task spans several projects. JinkoOrgClient reads JINKO_API_KEY and JINKO_BASE_URL only:

python
from jinko import JinkoOrgClient

org = JinkoOrgClient()
for project in org.list_projects():
    print(project.id, project.name)

client = org.project(project.id)  # a JinkoClient for that project

Use org.auth_check() to read the key's declared scope without a project ID. list_projects() can include projects outside that scope. In a multi-project workflow, call client.auth_check() on each project client and catch AuthenticationError to skip an out-of-scope project. Then request a project resource to verify actual access. Authentication responses without key metadata receive a credential check only.

Troubleshooting

Run the check again and act on its deterministic diagnostic. Do not replace it with ad hoc checks or ask the user to share secrets.

du même dépôt

Autres Skills

Tous les Skills
novainsilico
Communauté

jinko-data-table

Create or inspect Jinkō data tables via the jinko-sdk. Use this skill whenever the user wants to upload observed data for trial overlays or calibration objectives from CSV, SQLite, or pandas DataFrame; check data-table schema columns; inspect existing data tables; or verify metadata.public.validForFitnessFunction. Do not use this skill for output sets; use jinko-output-set for that.

Installations / 1h
2
GitHub Stars
4
Mis à jour
16 nov.
novainsilico
Communauté

jinko-task-cmaes

Execute a CMA-ES calibration from confirmed Jinkō inputs: assemble the model, protocol, output sets, fitness data tables, parameter priors, and optimizer options; create and run the Calibration; and return the supported results. Optionally, on request, qualify the parameter uncertainty of a completed CMA-ES calibration: identifiability, compensations, and prediction bands, in a Jinkō document. Use when the user wants to perform a CMA-ES calibration, or to check which calibrated parameters the da

Installations / 1h
2
GitHub Stars
4
Mis à jour
16 nov.
novainsilico
Communauté

jinko-context

Explain core Jinkō context, navigation, version management, and domain language for agents and users. Use this skill whenever the user needs a mental model of Jinkō projects, folders, project items, snapshots, references, extracts, highlights, protocols, trials, calibration, virtual populations, traceability links, or modeling context; when translating between generic terms and Jinkō terminology; or when an agent needs orientation before navigating or modifying Jinkō artifacts. It includes a saf

Installations / 1h
1
GitHub Stars
4
Mis à jour
16 nov.
novainsilico
Communauté

jinko

- Discover and route Jinkō QSP and mechanistic-modeling requests to the public Jinkō skill that owns the work. Use when the user is starting a Jinkō session, asks what capability or skill to use, describes a multi-area modeling request, or has not yet identified the relevant jinko- or jinko-task- skill. This skill does not make scientific decisions, plan workflows, execute SDK calls, or decide that a task step is complete.

Installations / 1h
1
GitHub Stars
1
Mis à jour
7 sept.