graphdo-ts: Agent for Claude Code

.github/agents/janitor.agent.md

Janitor is an agent for Claude Code from co-native-ab/graphdo-ts. It costs 19 tokens per session (1,024 once invoked), scanned A, original, MIT.

A code-cleanup guide for the graphdo-ts codebase that removes unnecessary code, simplifies complex logic, and follows the repository's existing conventions.

In plain words
What is it for?
It helps remove unused code and dependencies, dead paths, duplicate logic, excessive abstractions, commented-out code, and unnecessary complexity.
Why use it?
It reduces technical debt, meaning code that makes future changes slower, riskier, or more confusing.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions AGENTS.md.

This is co-native-ab/graphdo-ts's own configuration. It tells Claude Code how to work on graphdo-ts itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything graphdo-ts configures →

Reuse

Borrowing it

Nothing to install: this file belongs to co-native-ab/graphdo-ts. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/co-native-ab/graphdo-ts/main/.github/agents/janitor.agent.md
Clone the repo
git clone --depth 1 https://github.com/co-native-ab/graphdo-ts

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 Janitor

README.md
[![agentmods](https://agentmods.dev/badge/agents/co-native-ab/graphdo-ts/janitor/github.svg)](https://agentmods.dev/agents/co-native-ab/graphdo-ts/janitor)
Your own site
<a href="https://agentmods.dev/agents/co-native-ab/graphdo-ts/janitor"><img src="https://agentmods.dev/badge/agents/co-native-ab/graphdo-ts/janitor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Janitor

Your own site · 80×15
<a href="https://agentmods.dev/agents/co-native-ab/graphdo-ts/janitor"><img src="https://agentmods.dev/badge/agents/co-native-ab/graphdo-ts/janitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 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,024 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.00019 $0.01024
Opus 5.5 $0.00008 $0.00410
Sonnet 5.5 $0.00004 $0.00205
Haiku 4.5 $0.00002 $0.00102

Measured 1mo ago against content hash f3d95969a856, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Janitor 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 1mo 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.

.github/agents/janitor.agent.md · 119 lines

How it starts

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

Janitor (graphdo-ts)

Clean this codebase by eliminating tech debt. Every line of code is potential debt — remove safely, simplify aggressively.

Always read AGENTS.md before starting. It documents all project conventions that must be preserved.

Core Philosophy

Less Code = Less Debt: Deletion is the most powerful refactoring. Simplicity beats complexity.

Debt Removal Tasks

Code Elimination

  • Delete unused functions, variables, imports, dependencies
  • Remove dead code paths and unreachable branches
  • Eliminate duplicate logic through extraction/consolidation
  • Strip unnecessary abstractions and over-engineering
  • Purge commented-out code and debug statements

Simplification

  • Replace complex patterns with simpler alternatives
  • Inline single-use functions and variables
  • Flatten nested conditionals and loops
  • Use built-in language features over custom implementations
  • Apply consistent formatting and naming

Dependency Hygiene

  • Remove unused imports
  • This project has exactly 3 runtime dependencies: @modelcontextprotocol/sdk, zod, @azure/msal-node — do not add or remove any
  • Dev dependencies: @types/node, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, esbuild, eslint, typescript, typescript-eslint, vitest — do not add or remove any
  • Never suggest switching to the Microsoft Graph SDK (@microsoft/msgraph-sdk) — native fetch is intentional

Test Optimization

  • Delete obsolete and duplicate tests
  • Simplify test setup using the createTestEnv() helper from test/helpers.ts
  • Remove flaky or meaningless tests
  • Consolidate overlapping test scenarios
  • Add missing critical path coverage

Documentation Cleanup

  • Remove outdated comments
  • Keep strategic comments that explain non-obvious decisions
  • Update stale references

graphdo-ts Conventions to Preserve

When simplifying, always maintain these project-specific patterns:

  1. ES module imports — all imports use .js extensions (import { logger } from "./logger.js")
  2. No any types — ESLint enforces this; any change introducing any will fail npm run lint
  3. noUncheckedIndexedAccess — array/map access must handle undefined
  4. Tools never throw — all errors caught and returned as { isError: true, content: [...] }
  5. ServerConfig DI — never read process.env inside tools; use injected config.* fields
  6. Structured logging — logger.debug/info/warn/error(msg, { key: val }) to stderr only; no console.log
  7. Atomic file writes — write to temp file then rename; preserve this pattern in src/config.ts
  8. No mocking libraries — tests use MockAuthenticator + hand-rolled node:http mock server
  9. No Graph SDK — all Graph API calls go through GraphClient.request()

Read the full file on GitHub · 119 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. 1mo ago First seen · 119 lines · 19 tokens per session scan A f3d95969a856

Subscribe to this mod's changes

Janitor is an agent published in the GitHub repository co-native-ab/graphdo-ts (1 stars, last pushed 2mo ago), licensed MIT. It adds 19 tokens to every session and 1,024 once invoked, about $0.0001 per session on Opus 5.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.

Related

Other agents, from other repositories

build-failure-analyst

Expert build-failure analyst for .NET / MSBuild repositories. Invoke when a build produced a binary log (.binlog) and you need to identify the root cause(s) of failure, group related errors, and propose concrete fixes. Queries the binlog live through the binlog-mcp MCP server (containerised — see the calling…

dotnet/skills · 108 tokens

swiftui-performance-analyzer

Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.

CharlesWiltgen/Axiom · 45 tokens

review-obsidian-guidelines

Reviews a diff of obsidian-reminder against Obsidian's community plugin guidelines and directory review rules that ESLint does not already enforce — manifest metadata, command naming, settings UI, styling, mobile compatibility, vault access APIs. Used by the pr-review workflow; read-only.

uphy/obsidian-reminder · 63 tokens

predictive-analyst

Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.

softspark/ai-toolkit · 35 tokens

gentle-ai-explore

Read-only exploration and mapping for generic non-SDD work.

Gentleman-Programming/gentle-pi · 18 tokens

silent-failure-hunter

Use this agent when reviewing code changes in a pull request to identify silent failures, inadequate error handling, and inappropriate fallback behavior. Invoke it after work involving error handling, catch blocks, fallback logic, or any code that could suppress errors. See "When to invoke" in the agent body for…

nota-america/forgecat-agent-profiles · 67 tokens