Skip to content
Back to skills

Method Language Detect

ASecurity

Detects R, Python, or mixed-language signals in repo files and emits a language handoff. Use when a skill needs language evidence or the user asks the repo's stack.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 17, 2026
datapythongit

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 17, 2026

npx -y skills add sajor2000/methodsmith --skill method-language-detect --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Method Language Detect?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Method Language Detect
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sajor2000-method-language-detect/badge)](https://www.skillsdirectory.com/skills/sajor2000-method-language-detect)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: method-language-detect
description: "Detects R, Python, or mixed-language signals in repo files and emits a language handoff. Use when a skill needs language evidence or the user asks the repo's stack."
argument-hint: "[optional: --off]"
---

# Repository Language Detection


## Skill Value

- **Problem it solves:** Setup and workflow routing need repo evidence before asking users about language preference.
- **Use when:** Another skill needs language evidence, or the user asks what stack the repo appears to use.
- **Output:** __CE_LANG__ with primary, secondary, and source fields.
- **Ask only if:** No user question normally; detection is evidence-only.
- **Do not do:** Do not treat detection as final user preference when later IDE or explicit user choices narrow the stack.
- **Interaction:** No user question normally; proceed from the provided inputs and local evidence.

Detects whether the current repository is primarily `python`, `r`, `both`, or `unknown` using file-system and code-pattern signals only. Do not ask the user to choose a language in this skill. SAS/Stata signals do not become `primary` values; when they dominate, emit `primary=unknown` and recommend `method-sas-stata`.

## When this skill activates

- CLIF profile is active (`__CE_CLIF__ active=true`) and downstream skills need language-specific recipes
- `method-setup` is running and needs a language default without asking
- A task requires selecting Python vs R templates and the language is not obvious
- Manual invocation: `method-language-detect`

## Rule source

Read `references/detection-rules.md` and apply the scoring table exactly.

## Core workflow

### Step 1: Collect repository signals

Use repo signals only (files, directories, lockfiles, and source patterns). Do not prompt the user.

### Step 2: Score and classify

Apply the detection rules and produce:

- `primary`: `python` | `r` | `both` | `unknown`
- `secondary`: `python` | `r` | `null`
- `source`: `auto` (normal), `cached` (fallback when repo signals cannot be read), or `manual` (only when the user explicitly forced a language elsewhere)

### Step 3: Emit canonical handoff envelope

Always emit:

```
__CE_LANG__ primary=<python|r|both|unknown> secondary=<python|r|null> source=<auto|cached|manual>
```

Also print one concise banner:

```
[method-language-detect] primary=<...> secondary=<...> source=<...>
```

### Step 4: Fallback behavior

If no reliable signals are found:

- Use `primary=unknown secondary=null source=auto`.
- Resolve the repository root with `git rev-parse --show-toplevel`, read `<repo-root>/.ce-datascience/config.local.yaml` with the native file-read tool, and fall back to the main checkout in a linked worktree. If `stack_profile.language` (written by `method-setup`) exists there, reuse it as `source=cached`; otherwise use `stack_profile.inference.language.value` when its confidence is `high`.
- Never ask the user a language question in this skill.

## Consumers

`method-setup`, `method-clif`, `method-cohort`, `method-data-qa`, `method-work`, and `method-plan` can consume `__CE_LANG__` to route language-specific defaults and references.

## References

@./references/detection-rules.md — Signal weights, thresholds, and tie-break rules

Files in this skill

  • SKILL.md3.2 KB
  • references/detection-rules.md3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.