file-classifier

file-classifier is a skill for Claude Code, Codex from pnp/sharepoint-skills. It costs 0 tokens per session (3,727 once invoked), scanned A, original, MIT.

A SharePoint document-library workflow that identifies files as Contracts, Invoices, or Purchase Orders by reading their contents. It records the result and extracts related details into library columns.

In plain words
What is it for?
Use it to classify existing files, create missing classification and metadata columns, and populate fields such as extracted contract, invoice, or purchase-order information.
Why use it?
It removes manual sorting and data entry when documents are uploaded. It also distinguishes documents by their purpose and structure instead of matching isolated words.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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.

agentmods
npx agentmods add skills/pnp/sharepoint-skills/file-classifier
Any agent
npx skills add pnp/sharepoint-skills --skill file-classifier
Clone the repo
git clone --depth 1 https://github.com/pnp/sharepoint-skills

Made for: Claude Code, Codex.

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 file-classifier

README.md
[![agentmods](https://agentmods.dev/badge/skills/pnp/sharepoint-skills/file-classifier.svg)](https://agentmods.dev/skills/pnp/sharepoint-skills/file-classifier)
Your own site
<a href="https://agentmods.dev/skills/pnp/sharepoint-skills/file-classifier"><img src="https://agentmods.dev/badge/skills/pnp/sharepoint-skills/file-classifier.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,727 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.03727
Opus 5 $0.00000 $0.01863
Sonnet 5 $0.00000 $0.00745
Haiku 4.5 $0.00000 $0.00373

Measured 6d ago against content hash f72f4fd89722, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

file-classifier 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 6d 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.

Skills/file-classifier/file-classifier/SKILL.md · 245 lines

How it starts

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

File Classifier

Purpose

Classify one or more files in a SharePoint document library by reading their content and matching them to a known set of content types. Then:

  • Save the classification to a "File classification" column.
  • Create the metadata columns defined for that content type (if they don't already exist).
  • Extract metadata values from the file content and populate those columns.

If the "File classification" column or any metadata columns do not exist, create them as autofill columns with metadata extraction prompts so future uploads are handled automatically.


Classification Decision Guide

Classify by document PURPOSE and STRUCTURE — not by keywords alone.

Many contracts include payment terms that reference invoices (e.g., "payment due within 30 days of invoice date"). The word "invoice" appearing in a document does NOT make it an Invoice. Use the structural signals below to determine the correct type.

Contracts

A Contracts document is a bilateral or multilateral agreement where two or more named parties accept mutual obligations.

Structural signals — look for ALL of these:

  • A document title containing "Agreement", "Contract", "NDA", "Lease", "License", or similar
  • Named parties on both sides (Service Provider + Client, Employer + Employee, Landlord + Tenant, etc.)
  • Signature blocks for both parties
  • Clauses governing Term, Termination, Liability, Confidentiality, or Indemnification

A Contract may contain payment terms, fee schedules, or the word "invoice" — this is normal and does NOT change the classification. If the primary purpose of the document is to establish a legal relationship between parties, it is Contracts.

Invoices

An Invoice is a standalone billing document from a single vendor requesting payment for goods or services already delivered or rendered.

Structural signals — look for ALL of these:

  • A document title or header containing "Invoice", "Credit Memo", or "Remittance"
  • A unique Invoice Number (e.g., "INV-2026-0042", "CM-2024-0048")
  • Itemized line items with quantities, unit prices, and subtotals
  • A "Bill To" or "Remit Payment To" section identifying the paying party
  • A single total amount due

Read the full file on GitHub · 245 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. 6d ago First seen · 245 lines · 0 tokens per session scan A f72f4fd89722

Subscribe to this mod's changes

file-classifier is a skill published in the GitHub repository pnp/sharepoint-skills (107 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,727 tokens. 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-30.