detect-roles

detect-roles is a command for Claude Code from spideynolove/claude-dotfiles. It costs 24 tokens per session (1,089 once invoked), scanned A, original, MIT.

A command that identifies a project's broad technology type by checking which files and dependencies are present, then creates matching developer roles.

In plain words
What is it for?
Use it to classify projects with front-end, back-end, database, or artificial-intelligence dependencies and generate roles for development work.
Why use it?
It provides repeatable project detection based on visible file signals instead of subjective interpretation by an AI model.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to classify projects with front-end, back-end, database, or artificial-intelligence dependencies and generate roles for development work.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/spideynolove/claude-dotfiles/detect-roles
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/spideynolove/claude-dotfiles

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for detect-roles

README.md
[![agentmods](https://agentmods.dev/badge/commands/spideynolove/claude-dotfiles/detect-roles.svg)](https://agentmods.dev/commands/spideynolove/claude-dotfiles/detect-roles)
Your own site
<a href="https://agentmods.dev/commands/spideynolove/claude-dotfiles/detect-roles"><img src="https://agentmods.dev/badge/commands/spideynolove/claude-dotfiles/detect-roles.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,089 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.01089
Opus 5 $0.00012 $0.00544
Sonnet 5 $0.00005 $0.00218
Haiku 4.5 $0.00002 $0.00109

Measured 7d ago against content hash 2812136b4a2b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

detect-roles scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude-global-backup/commands/detect-roles.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Detect the project type from file-presence signals and generate developer roles. No LLM inference needed for detection — use deterministic file checks.

Detection Logic

Run these checks against the current working directory:

HAS_PACKAGE_JSON=false; [ -f package.json ] && HAS_PACKAGE_JSON=true
HAS_FRONTEND=false; [ -f package.json ] && grep -qE '"(react|vue|angular|next|nuxt|svelte|solid)"' package.json 2>/dev/null && HAS_FRONTEND=true
HAS_BACKEND=false; ([ -f requirements.txt ] || [ -f pyproject.toml ]) && grep -qlE '(fastapi|django|flask)' requirements.txt pyproject.toml 2>/dev/null && HAS_BACKEND=true
[ -f package.json ] && grep -qE '"(express|nestjs|hono|fastify)"' package.json 2>/dev/null && HAS_BACKEND=true
HAS_DB=false; (ls *.db docker-compose* 2>/dev/null | grep -q . || grep -rqlE '(prisma|typeorm|sqlalchemy|mongoose|drizzle)' package.json pyproject.toml 2>/dev/null) && HAS_DB=true
HAS_AI_ML=false; (grep -qlE '(torch|tensorflow|transformers|langchain|openai|anthropic)' requirements.txt pyproject.toml package.json 2>/dev/null) && HAS_AI_ML=true
HAS_SYSTEMS=false; ([ -f Cargo.toml ] || [ -f go.mod ]) && HAS_SYSTEMS=true
HAS_INFRA=false; ([ -d terraform ] || [ -d k8s ] || [ -f Dockerfile ]) && HAS_INFRA=true
HAS_DATA=false; ([ -f dbt_project.yml ] || [ -d airflow ]) && HAS_DATA=true

Classification (first match wins)

Condition Project Type
HAS_FRONTEND && HAS_BACKEND web-fullstack
HAS_FRONTEND web-frontend
HAS_BACKEND && HAS_DB web-backend
HAS_AI_ML ai-ml
HAS_SYSTEMS systems
HAS_INFRA infra
HAS_DATA data-pipeline
(none match) general

Role Templates

Based on detected project type, propose these roles:

web-fullstack:

  • architect → claude, task_types: design, review, refactor
  • frontend-dev → qwen, task_types: implement, component, style
  • backend-dev → qwen, task_types: implement, api, database
  • tester → qwen, task_types: test, verify

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 102 lines · 24 tokens per session scan A 2812136b4a2b

Subscribe to this mod's changes

detect-roles is a command published in the GitHub repository spideynolove/claude-dotfiles (2 stars, last pushed 3mo ago), licensed MIT. It adds 24 tokens to every session and 1,089 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.