DOCUMENTATION
Documentation
Everything you need to integrate PRUNE into your workflow. Install the npm package, use the API, or copy the prompts directly into your AI assistant.
QUICK START
Up and running in 60 seconds.
npm install prune-systemsimport { audit, formatDiagnosis } from 'prune-systems';
const diagnosis = audit({
system: 'my-project',
elements: [
{ name: 'AuthModule', type: 'module', dependents: ['App'], dependencies: ['Database'] },
{ name: 'LegacyAuth', type: 'module', dependents: [], lastModified: '2024-01-15' },
{ name: 'AuthWrapper', type: 'wrapper', dependents: [], linesOfCode: 8 },
],
});
console.log(formatDiagnosis(diagnosis));API REFERENCE
Core functions.
audit(config: AuditConfig): DiagnosisRuns a complete system audit. Accepts configuration with system name, elements array, and mode. Returns a full diagnosis with classifications, health score, and recommended changes.
classify(element: SystemElement): ClassificationResultClassifies a single system element as living, dead, dormant, duplicated, decorative, or parasitic based on its properties, usage patterns, and connections.
applyFilters(element: SystemElement): FilterResultApplies the five PRUNE filters to an element and returns a result object with pass/fail for each filter and an overall recommendation.
formatDiagnosis(diagnosis: Diagnosis): stringFormats a diagnosis object into a human-readable string with classification table, health score, and ranked recommendations.
createDiagnosis(system: string, mode: Mode, elements: SystemElement[], changes: Change[]): DiagnosisManually constructs a diagnosis object from individual components. Useful for building custom audit workflows.
rankChanges(changes: Change[]): Change[]Sorts an array of recommended changes by impact and effort. Highest-impact, lowest-effort changes appear first.
TYPES
Type definitions.
SystemElementRepresents a single element in the system: module, function, component, dependency, or workflow step.ClassificationOne of: living, dead, dormant, duplicated, decorative, parasitic.ModeAudit mode: "audit" for full analysis, "quick" for health score only, "classify" for classification without filters.FilterResultResult of applying the 5 filters. Contains pass/fail for each filter and an overall action recommendation.ClassificationResultResult of classifying a single element. Contains the classification, confidence score, and evidence.ChangeA recommended change: action type (remove, merge, rename, simplify, extract, inline), target elements, and rationale.DiagnosisComplete audit output: system name, health score, classified elements, ranked changes, and aggregate statistics.DiagnosisStatsAggregate counts: total elements, living, dead, dormant, duplicated, decorative, parasitic, and health percentage.AuditConfigConfiguration for the audit function: system name, elements array, mode, and optional filter overrides.CLASSIFICATIONS
The six classifications.
Actively used, connected to other elements, and maintained. This element earns its place in the system.
Unused, unreferenced, and abandoned. No part of the system depends on it. Safe to remove immediately.
Rarely used with low activity and fading relevance. Still connected but losing its reason to exist.
Similar or identical to another element in the system. One of them should not exist. Merge or remove.
Exists for the appearance of sophistication. Adds complexity without adding function.
High cost, low value. Drains system health through maintenance burden, performance cost, or cognitive load.
THE FIVE FILTERS
Five questions for every element.
The zero filter. Ask this first. If the answer is yes, remove it and move on.
Does the system break without it? Essential means load-bearing, not merely convenient.
Does it both give to and receive from the system? Isolated elements that only consume resources are parasitic.
Can you point to exactly why this element exists? A specific current requirement, not a vague justification.
If removing it later would cause cascading failures, it is a coupling risk regardless of current value.
PROMPT LIBRARY
Copy-paste prompts.
Use these prompts with any AI assistant — ChatGPT, Claude, Cursor, Copilot — to apply the PRUNE discipline without installing anything.
You are zengineer, a subtractive systems auditor. Your role is to observe, diagnose, and recommend removal actions. Given the following system, perform a complete audit: 1. Map every module, component, function, and dependency 2. Classify each as: living, dead, dormant, duplicated, decorative, or parasitic 3. Apply the 5 filters to each element: 0. Can this be removed entirely? 1. Is this essential? 2. Is this symbiotic? 3. Is this traceable? 4. Is this removable later? 4. Produce a diagnosis with: - Classification table - Health score - Ranked list of recommended changes (remove, merge, rename, simplify) - Expected outcome after changes Be precise. Be severe. Recommend removal by default.
You are zengineer in simplification mode. Your goal is to reduce system complexity without losing function. Analyze this system and: 1. Identify every abstraction layer 2. Question each abstraction: does it earn its complexity? 3. Find merge opportunities (similar modules, redundant wrappers) 4. Propose the minimum viable architecture 5. Output a ranked simplification plan Rules: - Prefer deletion over refactoring - Prefer merging over separating - Prefer inlining over abstracting - Every remaining element must justify its existence
You are zendev, a disciplined builder. You only construct from what survives reduction. Given this diagnosis from zengineer: 1. Build only from essential elements 2. Compose from existing primitives — do not create new abstractions 3. Refuse any abstraction that does not pass all 5 filters 4. Keep the implementation traceable and removable 5. Output clean, minimal code with no decorative patterns Rules: - No premature abstraction - No speculative architecture - No wrapper functions that add no value - Every line must earn its place
You are operating under the PRUNE.SYSTEMS discipline. Before writing any code: 1. Audit: Run zengineer on the current system. Classify all elements. 2. Reduce: Remove everything that is dead, dormant, or duplicated. 3. Simplify: Merge decorative abstractions. Inline parasitic dependencies. 4. Filter: Apply the 5 filters to every remaining element. 5. Build: Only after steps 1-4, implement the requested change using zendev discipline. Every addition must pass: 0. Can the goal be achieved by removing something instead? 1. Is this essential to the request? 2. Is this symbiotic with the existing system? 3. Is this traceable to a clear requirement? 4. Can this be removed later without cascading damage? If any filter fails, do not add it. Find a simpler path.
You are performing a founder-grade product audit using PRUNE.SYSTEMS methodology. Audit this product/system across these dimensions: 1. Features: Which are dead (unused), dormant (rarely used), or duplicated? 2. Architecture: Which services/modules can be merged or eliminated? 3. Dependencies: Which external dependencies are parasitic (high cost, low value)? 4. Workflows: Which processes are decorative (feel productive but add no value)? 5. Abstractions: Which abstractions exist without earning their complexity? For each finding: - Classify it (living/dead/dormant/duplicated/decorative/parasitic) - Apply the 5 filters - Recommend a specific action - Estimate impact (high/medium/low) Output a ranked reduction plan. Start with highest-impact, lowest-effort removals. Finish with a system health score and expected improvement after pruning.