AGENT SKILL

python-fact-grounded-coding

Use when the user explicitly asks for the Python fact-grounded coding skill, or when a Python coding, debugging, explanation, or bug-fix task should be grounded in verified Pylance facts, runtime values, diagnostics, selected interpreter state, tests, or debugger evidence before changing code or reporting a conclusion.

License 许可
MIT
最近更新
2026-08-31
Stars
★ 1
Forks
0

01 前言 Front Matter

name
python-fact-grounded-coding
description
Use when the user explicitly asks for the Python fact-grounded coding skill, or when a Python coding, debugging, explanation, or bug-fix task should be grounded in verified Pylance facts, runtime values, diagnostics, selected interpreter state, tests, or debugger evidence before changing code or reporting a conclusion.

03 SKILL.md 正文

Python Fact-Grounded Coding

Treat reasoning as a source of hypotheses, not proof. Before explaining behavior or changing code, collect enough observable facts to support the answer.

Pylance Tool Routing

When Pylance MCP tools are available, use them for facts that generic file reading cannot reliably prove.

  • Use pylanceLSP for diagnostics, hover/type facts, definitions, references, signatures, call hierarchy, document symbols, and workspace symbols.
  • Use pylanceSemanticContext when a cursor position needs related imports, base classes, overrides, usages, call sites, or dependency context.
  • Use pylanceCheckSignatureCompatibility before or after changing a function signature to verify existing callers.
  • Use pylanceImports plus pylanceInstalledTopLevelModules for dependency and unresolved-import questions; do not infer the editor environment from terminal python.
  • Use pylanceDocuments, pylanceSettings, pylancePythonEnvironments, or pylanceWorkspaceRoots for Pylance behavior, configuration, workspace, or selected-interpreter claims when those tools are available.
  • Use pylanceRunCodeSnippet for a focused runtime value, return value, parser result, or small input/output check.
  • Use pylancePythonDebug when the answer depends on a branch, exception, loop iteration, closure, subprocess, mutable state, or frame-local value.
  • Use pylanceSyntaxErrors or pylanceFileSyntaxErrors to validate generated Python syntax before treating code as ready.

Evidence Ladder

Use the lightest reliable evidence that settles the question. Escalate when the current evidence leaves uncertainty.

  1. Language facts: Use Pylance code intelligence for symbol meaning, types, diagnostics, references, signatures, base classes, overrides, and call sites.
  2. Product and workspace facts: Use Pylance docs, settings, workspace, import, and environment tools for claims about Pylance behavior or editor-selected Python state.
  3. Execution facts: Use a focused snippet or test when the answer depends on runtime values, return values, parsing behavior, or a concrete input/output case.
  4. Debugger facts: Use the debugger when the issue depends on a branch, exception, loop iteration, closure, subprocess, mutable state, or frame-local value.

Example Workflows

  • Explain or fix a diagnostic: call pylanceLSP for textDocument/diagnostic or workspace/diagnostic, keep the exact diagnostic code/message in mind, then inspect only the code needed to explain or fix that rule.
  • Change Python API behavior: use pylanceLSP references or pylanceCheckSignatureCompatibility to find real call sites, patch the producer, then run the focused test or snippet that proves the changed behavior.
  • Debug dynamic runtime behavior: inspect the relevant test and source, run a focused snippet or test, and escalate to pylancePythonDebug if the important value is produced inside a branch, loop, callback, or mutable context.
  • Audit imports or requirements: compare pylanceImports with pylanceInstalledTopLevelModules; use diagnostics only when locations, severities, or report codes matter.

Working Rules

  • Name assumptions explicitly as hypotheses until verified.
  • Verify the exact symbol, type, diagnostic code, call path, or runtime value that the task depends on.
  • For bug fixes, prefer a repro test, failing command, snippet, or debug session before patching behavior.
  • Fix the producer of the wrong behavior after the facts identify it; avoid patching a downstream symptom because it looks plausible.
  • After changing code, run the focused validation that would have caught the original mistake.
  • If a needed verification tool is unavailable, say what remains uncertain and keep the change narrow.

Common Traps

  • Do not patch from a familiar bug pattern until observed values confirm this code is taking that path.
  • Do not treat text search as proof of semantic relationships such as overrides, re-exports, aliases, or call compatibility.
  • Do not infer the editor/Pylance interpreter from terminal python or PATH.
  • Do not explain a diagnostic from wording alone when the exact Pylance rule code is available.
  • Do not say a test, breakpoint, or tool would prove something; run it or label the result as unverified.

Minimal Good Answer Shape

When reporting the result, include the facts that changed the decision: the diagnostic code, type, call site, runtime value, failing input, debugger frame, or test result. Keep speculation out of the conclusion.

04 同仓库更多 Skills

nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

xcode-project-setup

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

writing-skills

Use when creating new skills, editing existing skills, or verifying skills work before deployment

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

writing-plans

Use when you have a spec or requirements for a multi-step task, before touching code

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

workflow-skill-creator

Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say "make this a skill", "create a skill from what we just did", "package this workflow" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

verify-and-stop

Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

verification-before-completion

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

★ 1