Clean Coding 101
Master the Complete Two-Pass Code Excellence Pipeline
Clean Coding 101 combines structural architectural refactoring with rigorous LLM token hygiene. It equips your AI coding assistant (Cursor, Claude Code, Antigravity, GitHub Copilot) with the dual disciplines required to transform brittle, convoluted codebases into clean, fast, and token-efficient software.
What Workflow Does It Enable?
Clean Coding 101 enables a coordinated Two-Pass Quality Pipeline:
-
Pass 1 — Structural & Algorithmic Refactoring (Craftsman):
- Inverts deep conditional pyramids (
if/elseladders) into clean guard clauses with early exits. - Eradicates hidden $O(n^2)$ bottlenecks by converting nested loop scans into $O(1)$ pre-computed hash maps.
- Decomposes unreadable declarative method chains into clear, named, strongly typed execution stages.
- Guarantees 100% behavioral invariance: Zero regressions, zero changes to error types or return values.
- Inverts deep conditional pyramids (
-
Pass 2 — Token Conservation & Context Hygiene (Clean Comments):
- Eliminates redundant inline narrative noise (
// 1. Users,// increment i,// check status) that wastes 20–35% of file context on every read. - Automatically migrates public interface contracts to standardized JSDoc/TSDoc specifications.
- Preserves rare, high-value non-obvious "Why" comments while stripping misleading dead commentary.
- Eliminates redundant inline narrative noise (
What Problem Does It Solve That Individual Skills Don't?
Running structural refactoring alone leaves stale, misleading inline comments scattered across your files, continuing to burn precious context tokens on every subsequent AI cycle.
Conversely, cleaning comments without fixing underlying code structure leaves deeply nested branching, cognitive bloat, and algorithmic bottlenecks intact.
Clean Coding 101 unifies both layers:
- Code Clarity for Humans: Linear, readable, guard-clause-driven architecture.
- Context Efficiency for AI: Zero token waste, higher LLM attention fidelity, and crystal-clear API contracts.
Who Is It For?
- Agent-First Developers & Teams: Teams using Cursor, Claude Code, Antigravity, or Copilot who want to stop burning context tokens on comment fluff and unreadable nesting.
- Tech Leads & Code Reviewers: Anyone modernizing legacy repositories into maintainable, production-ready code with guaranteed behavioral invariance.
- Open-Source Maintainers: Projects looking to enforce clean-code standards, high-performance algorithms, and professional API documentation.
What's Included in the Bundle?
- 2 Production-Grade Skills:
craftsman+clean-commentswith standardizedSKILL.mdtriggers. - 2 Zero-Dependency Python Toolkits:
analyze_complexity.py: AST & indentation scanner mapping nesting pyramids, function bloat, and Big-O hotspots.find_inline_comments.py: Lexical state-machine scanner that isolates//comments without false positives on URLs or strings, estimating token waste and supporting in-place--strip.
- Comprehensive Examples & Walkthroughs: TypeScript before/after progressions and standardized audit reporting templates.
Works with any agent that signs in to Agensi, such as Claude, ChatGPT, Claude Code, Cursor and Codex CLI.
One payment, lifetime access. 2 skills unlock instantly in your library.
What's included
2 skillsEliminates token-wasting inline comments, strips narrative code noise, and migrates public API documentation to clean JSDocs with guaranteed 100% behavioral invariance.
Autonomous code refactoring specialist that flattens nested branching, eliminates hidden O(n²) bottlenecks, and reduces cognitive bloat with guaranteed 100% behavioral invariance.
See it in action
Clean Comments: Token Conservation
Example session with this skill installed
Audit src/services/billing.ts, remove useless inline comments to conserve LLM tokens, and add JSDocs for exported functions while preserving exact behavior.
- Read your context and instructions
- Compiled the clean comments
Summary of Comment Cleanup
- Target:
src/services/billing.ts - Audit Findings: 14 inline
//comments identified wasting ~68 LLM tokens per file read. - Actions Taken:
- Removed 12 trivial step narrators (
// 1. Calculate discount,// Loop through items). - Removed 2 trailing comments on object property initializers.
- Added 2 JSDoc contracts documenting edge-case behavior on exported functions.
- Removed 12 trivial step narrators (
Token & Quality Metrics
| Metric | Before | After | Delta |
|---|---|---|---|
| Total Lines | 94 | 78 | -16 lines (-17%) |
| Inline Comments | 14 | 0 | -14 comments (-100%) |
| Documented Contracts (JSDoc) | 0 | 2 | +2 contracts |
| Est. Token Cost per Read | ~480 tokens | ~395 tokens | -85 tokens saved (-17.7%) |
Verification
- Test Suite: All unit tests pass with zero regressions.
Scanner Verification: python3 scripts/find_inline_comments.py src/services/billing.ts reported 0 unwanted comments.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads these skills and uses them on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every skill in this bundle goes through our trust checks.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.