add-module

A project setup command that creates a new code module with its own instructions and records it in the architecture documentation.

In plain words
What is it for?
Use it when adding a module under a source directory, describing its role and dependencies, and updating the project architecture file.
Why use it?
It keeps new parts of a codebase documented and connected to the project’s overall design.

Command

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 commands/whchoi98/project-init/add-module
Clone the repo
git clone --depth 1 https://github.com/whchoi98/project-init
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 482 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 $0.00014 $0.00482
Opus 5 $0.00007 $0.00241
Sonnet 5 $0.00003 $0.00096
Haiku 4.5 $0.00001 $0.00048

Measured yesterday against content hash cf8385faac53, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-module 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 yesterday.

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.

plugins/project-init/commands/add-module.md · 76 lines

What it actually says

Add Module

Create a new module directory with documentation and update project-level docs.

Step 1: Validate Module Path

Target: $ARGUMENTS

  • If no path provided, ask the user for the module path
  • Verify the path is under a source directory (src/, app/, lib/, etc.)
  • If the directory already exists, check if CLAUDE.md is missing and offer to create it
ls -la <module_path> 2>/dev/null

Step 2: Understand the Module

Ask the user:

  • What is this module's responsibility? (one sentence)
  • What are its key dependencies or relationships with other modules?

If the user skips, infer from the directory name.

Step 3: Create Module Directory and CLAUDE.md

mkdir -p <module_path>

Create <module_path>/CLAUDE.md with:

# <Module Name> Module

## Role
<module responsibility from user input>

## Key Files
<!-- Key files will be added as the module grows -->

## Dependencies
<relationships with other modules>

## Rules
<!-- Module-specific conventions -->

Step 4: Update docs/architecture.md

Read docs/architecture.md and add the new module to the Components section.

If a Data Flow section exists, suggest where the new module fits.

Step 5: Update Root CLAUDE.md

Read the root CLAUDE.md and update the Project Structure section to include the new module.

Step 6: Verify Hook Coverage

Read .claude/hooks/check-doc-sync.sh and verify the hook monitors the correct source directory path. If the new module is under a directory not covered by the hook, suggest updating it.

Step 7: Summary

Display:

  • Created directory and CLAUDE.md
  • Updated architecture.md
  • Updated root CLAUDE.md
  • Any suggested follow-up actions (e.g. create an ADR if this is a significant architectural addition)
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. yesterday First seen · 76 lines · 14 tokens per session scan A cf8385faac53

Subscribe to this mod's changes

add-module is a command published in the GitHub repository whchoi98/project-init (2 stars, last pushed 1mo ago), licensed MIT. It adds 14 tokens to every session and 482 once invoked, about $0.0001 per session on Opus 5. 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-31.