Guides extending ([EXTEND]) or modifying ([MODIFY]) existing code: read full context, match naming/import/error patterns, preserve interfaces and signatures.
From humaninloopnpx claudepluginhub deepeshbodh/human-in-loop --plugin humaninloopThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Guidance for implementing tasks that touch existing code. When a task says [EXTEND], add new code following existing patterns. When a task says [MODIFY], change specific behavior as described. In both cases, read the existing code first and respect what is already there.
The existing code is not wrong until proven otherwise. It has consumers, tests, and patterns that evolved for reasons not immediately visible.
Violating the letter of the rules is violating the spirit of the rules.
[EXTEND] — adding new functionality to existing files[MODIFY] — changing existing behavior in files| Marker | Meaning | Scope | Interface Impact |
|---|---|---|---|
[EXTEND] | Add new code alongside existing code | New functions, new methods, new exports | MUST NOT change existing function signatures, exports, or type contracts |
[MODIFY] | Change existing behavior | Specified sections only | MAY change function internals; MUST NOT change signatures unless task explicitly says so |
Never MODIFY when the task says EXTEND. If you believe the existing code cannot support the extension, flag it in the cycle report — do not silently rewrite.
Before writing any code in an existing file, complete all five steps:
When extending existing code:
[MODIFY]Before adding new code, check for:
user.ts, check that user.test.ts exists and follow its patternsFlag in the cycle report (do NOT silently resolve) when:
[EXTEND] but the existing interface cannot support the addition without modificationWhat goes wrong: You add code that duplicates existing functionality, uses different naming conventions, or conflicts with code you didn't see.
Fix: Always read the entire file before making any changes. Skim is not sufficient for brownfield work.
What goes wrong: Existing consumers break because the interface changed. Tests fail for unrelated code. The cycle report doesn't explain why unrelated files were modified.
Fix: EXTEND means extend. If you cannot extend, flag it. Never silently rewrite.
What goes wrong: Your new code throws raw exceptions while the rest of the file uses Result types. Or your code returns null while existing code throws. Inconsistency confuses consumers.
Fix: Step 3 of the Read-Before-Write Checklist. Match the existing error handling pattern exactly.
What goes wrong: You introduce a "better" pattern alongside the existing one. Now the file has two patterns. The next developer doesn't know which to follow. Consistency is more valuable than local improvement.
Fix: Follow existing patterns, even if you'd prefer different ones. Note the improvement opportunity in the cycle report.
| Excuse | Reality |
|---|---|
| "This file is small, I can just skim it" | Small files have hidden conventions. Read the full file. Step 1 exists because skimming misses patterns. |
| "My pattern is better than what exists" | Consistency is more valuable than local improvement. Two patterns in one file is worse than one imperfect pattern. |
| "The existing code doesn't follow best practices" | Existing code has consumers. Introducing a second convention creates confusion. Note it, follow it. |
| "I need to refactor to make my extension work" | If EXTEND doesn't fit, flag it. Silent refactoring breaks existing consumers. |
| "The interface is obviously wrong" | It made sense to someone with context not visible now. Read more before judging. |
| "I'll just fix this one small thing while I'm here" | Scope creep starts with "just one thing." Note it in the report, don't act on it. |
No exceptions: