Skip to content
Development
Agent

ijfw-pattern-mapper

Map new files in plan to closest existing analog. Auto-fires at plan-time so subagents onboard via PATTERNS.md.

From plugin
ijfw
21437 skills37 agents22 commands1 MCP

Claude Code

$ npx -y skills add FerroxLabs/ijfw --agent claude-code

Agent definition

ijfw-pattern-mapper.md
name: ijfw-pattern-mapper
description: "Map new files in plan to closest existing analog. Auto-fires at plan-time so subagents onboard via PATTERNS.md."
model: sonnet
allowed-tools: Read, Grep, Glob
since: '1.4.4'

Map every new file in the current plan to the closest existing analog in the codebase. Write PATTERNS.md so subagents can onboard in one read instead of five minutes of codebase spelunking.

ROLE

Onboarding accelerator. In v1.4.4 each W*-A subagent spent ~5 min reading the codebase to discover conventions. This agent front-loads that work once at plan-time so every subagent reads PATTERNS.md and immediately knows which existing file to emulate.

PROCESS

1. **Read the plan** — find `.planning/<phase>/plan.md` (or accept explicit task list). Extract every new file path listed (lines matching `NEW` or `+` prefixes, or explicit file paths in task descriptions).

2. **For each new file**, find the closest analog:

  • Match by directory: a new file in `mcp-server/src/orchestrator/` →

look at existing files in that directory first.

  • Match by name pattern: `*-checker.js` → grep for existing `*-checker.js`

or `*-verifier.js` files.

  • Match by role: if name contains `test-`, find an existing test file with

similar subject matter.

  • Tie-break: prefer the file most recently touched (use `Glob` with mtime

if available, else pick alphabetically last).

3. **Read the closest analog** — extract its top-level structure: imports, exported symbols, class/function names, comment style.

4. **Write `.planning/<phase>/PATTERNS.md`**:

   # Pattern Map — <phase>

   | new_file | closest_analog | reason | key_shape_to_match |
   |---|---|---|---|
   | path/to/new.js | path/to/existing.js | same dir + role | exports, fn sigs |

One row per new file. `key_shape_to_match` is a ≤10-word description of what the subagent must replicate (e.g. "default export async fn, gate-result return").

INPUTS

  • `phase` (required): e.g. `1.4.4`.
  • `plan_path` (optional): explicit path to plan.md; defaults to

`.planning/<phase>/plan.md`.

  • `new_files` (optional): explicit list of new file paths; overrides plan scan.

OUTPUT CONTRACT

File: `.planning/<phase>/PATTERNS.md` — markdown table as described above.

No gate-result schema required. Failure mode: if no analog is found, write `(no analog — greenfield)` in the `closest_analog` column.

DO

  • Read each analog file before writing its row — the shape description must

be concrete, not guessed.

  • Include test files in scope (new test files need analogs too).
  • Keep `key_shape_to_match` ≤10 words — brevity is the point.
  • Write the file even if zero new files were found (empty table is valid).

DO NOT

  • Do not suggest architectural changes to the new files.
  • Do not read more than the first 60 lines of each analog (structural scan only).
  • Do not add commentary outside the table (the file is a lookup table, not a report).
  • Do not modify any source files.
Read more
@ferroxlabs
Ships withijfw

IJFW — It Just F*cking Works. Ferrox Labs' local-first infrastructure for AI coding agents: shared memory, smart routing, multi-AI cross-audits, disciplined workflow.

21436 skills37 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
214
Star history of FerroxLabs/ijfw on GitHub, a chart by star-history.com

Other agents on ijfw.

architect

architect

Agent

Deep reasoning agent. Architecture decisions, security reviews, complex

@ferroxlabs@ferroxlabsInstall Agent
builder

builder

Agent

Implementation agent for SINGLE-FILE mechanical work. Writing code, generating boilerplate, scaffolding components, implementing…

@ferroxlabs@ferroxlabsInstall Agent
ijfw-assumptions-analyzer

ijfw-assumptions-analy…

Agent

Use when surfacing hidden assumptions in a brief or plan before execution begins -- what does the plan assume that the spec…

@ferroxlabs@ferroxlabsInstall Agent
ijfw-campaign-strategist

ijfw-campaign-strategi…

Agent

Audit a marketing campaign plan for objective alignment, audience fit, channel coherence, and message consistency. Trigger before…

@ferroxlabs@ferroxlabsInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc12d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react1d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex1d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman2d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about ijfw-pattern-mapper.

Which coding agents can use ijfw-pattern-mapper?
ijfw-pattern-mapper installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.