module-create
Creates a new module, or a child of an existing one, with its docs and registry entry through create. Gathers the name, a one-sentence description, at least five keywords, the roles and the parent, shows a dry run and waits for a yes, then creates it, fills the scaffolded docs from what the user knows, routes its code and checks lint. Use when the user says "add a module", "create a module for X", "register this area", or when work lands in code that no module owns.
- License 许可
- MIT
- 最近更新
- 2026-10-21
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- module-create
- description
- Creates a new module, or a child of an existing one, with its docs and registry entry through create. Gathers the name, a one-sentence description, at least five keywords, the roles and the parent, shows a dry run and waits for a yes, then creates it, fills the scaffolded docs from what the user knows, routes its code and checks lint. Use when the user says "add a module", "create a module for X", "register this area", or when work lands in code that no module owns.
02 资源文件 3
- 参考文档references/analyse.md2.1 KB
- 参考文档references/child.md1.1 KB
- 参考文档references/fill.md3.2 KB
03 SKILL.md 正文
module-create
Add a module (or a child of a split module) with real content, not empty templates: a module for existing code is written from that code, so nobody builds a second copy of what exists; a planned one says what is planned. The user confirms before anything is written.
When to use
- The user wants a new module, or a new child under an existing module.
module-discoverormodule-syncreported files that no module owns, and the user agrees they form a new area.
When not to use
- The module exists and only its docs are behind: use
module-sync. - An existing module is too big and should become several children: use
module-split. - You only need to know whether a module for X already exists: use
module-scout.
Scope
Writes: the new module's docs (scaffolded by the create verb, then filled in), its registry
entry and links, a routing rule for its code in the team config (the code-map add verb) and,
for a child, its row in the parent's routing table. It never edits another module otherwise,
never edits a *.legacy.md file, and never commits.
If segmently-modules is not found, tell the user how to install it — the segmently-modules plugin for Claude Code, uv tool install git+https://github.com/segmently-ai/segmently-modules.git, or pipx install git+https://github.com/segmently-ai/segmently-modules.git — and stop until it runs.
Steps
- analyse — interview, analysis (steps 2–3) →
references/analyse.md - child — a child module (steps 4–7) →
references/child.md - fill — the docs' content, the report (steps 6, 10) →
references/fill.md
-
Check the name is free and not a duplicate in disguise.
segmently-modules list --json segmently-modules match "<the new module's main words>" --match lexical --jsonA strong match means an existing module may own this area: show it and ask before going on.
-
Ask (
references/analyse.md), one question at a time: name, status (code exists →active, elseplanned), artifacts to read, parent, whether it renders a user interface, extra roles. -
Analyse the artifacts and show the findings (components with paths, imports, real usages, critical rules, dependencies both ways). From them propose the description and at least five keywords (a child: one); the user corrects them.
-
Show the plan and wait.
segmently-modules create <name> --non-interactive --status <status> --description "<one sentence>" --keywords "<k1, k2, k3, k4, k5>" --dry-runAdd
--tagor--roleas gathered; a child:references/child.md. Show the files, the registry entry and the findings in short. Exit 2 names what is wrong (a taken name, a description out of bounds, too few keywords): fix it with the user and show the dry run again. Wait for an explicit yes. -
Create it — the same command with
--jsonin place of--dry-run. -
Fill the scaffolded docs (the
filesof the result) asreferences/fill.mdsays. Never invent components or rules; "Planned:" before what does not exist yet. -
Seed its links from the dependencies found:
segmently-modules related <name> --json segmently-modules registry append <name> related_modules '{"module": "<other>", "relation": "<relation>", "description": "<why>"}' --json -
Route its code, when the user said where it lives.
segmently-modules code-map add <rule id> --glob "<glob>" --module <name> --dry-run segmently-modules code-map add <rule id> --glob "<glob>" --module <name> --jsonShow the dry run first. An existing rule id is refused: pick another.
-
Check it.
segmently-modules lint --json segmently-modules show <name> --json segmently-modules match "<a typical task for it>" --match lexical --jsonNo error findings for the new module; every doc in
read[]exists; the typical task ranks the new module first — else improve its keywords with the user. -
Report as
references/fill.mdsays. Ask the user to review and commit.
Gates
- Each question (step 2) and the proposed description and keywords (step 3): wait for the answer.
- After the dry run (step 4): nothing is written until the user says yes.
- Before routing code (step 8): the user confirms the glob.
Exit codes
0 ok · 1 from lint = findings (fix the new module's, report the others) · 2 = a
refused input or config error: read stderr, fix with the user, run again.
04 同仓库更多 Skills
${skill}
${description}
designer
Designs user interface work and reviews it against the designer docs of the modules it touches. Prototype — a brief and standalone HTML mocks from the team's tokens, then it waits for approval before any code; rework-audit — an existing flow's dead ends and what must survive, before a redesign; review — screenshots of the running app checked against every UX invariant and the flow patterns, always written with a PASS or BLOCKED verdict. Use for any task that adds or changes screens, dialogs, layouts or styling, or when the user asks for a mockup, prototype, design, UI or UX review.
qa-acceptance
Writes the acceptance criteria of one task before any code is written. Finds the touched modules with discover, reads their qa and qa_acceptance docs, flags problems in the task itself, splits it into sub-tasks, applies equivalence partitioning, boundary values, decision tables or state transitions, and writes prerequisites PRE-NNN and criteria AC-NNN in Given, When, Then form, reusing existing baseline criteria by id. Shows them in the conversation; a file only at a path the user names. Use when the user asks for acceptance criteria, a test plan or a definition of done for a task.
qa-acceptance-baseline
Creates or refreshes a module's acceptance baseline, the qa_acceptance role doc that says what must never break, as P0, P1 and P2 criteria with stable AC-NNN ids in Given, When, Then form. Reads every doc and the code of the module through Segmently Modules, confirms its understanding, the requirements and the criteria with the user block by block, continues from the highest existing id and never renumbers. Use when the user asks for a module's acceptance baseline, regression criteria, or to refresh them after the module changed.
module-sync
Brings module docs and registry fields in line with a work session — what it decided, rejected, discovered and changed. Takes the session's knowledge first and the code change second, asks sync-instructions which docs to update, prints findings and a proposal per module, edits docs, keywords and links, runs the sync hooks and checks with ci. Autonomous, it asks only in four ambiguous cases and never commits. Use at the end of a session that changed module code or revealed module knowledge, when the user says "sync the session", "sync the docs", or a CI drift check fails.
module-split
Splits an oversized module into two to six child modules. Analyses the module's docs section by section, proposes the children with a section-to-child table per doc and what stays in the parent, and stops for confirmation. Then freezes each split doc as a legacy copy, creates the children with create, moves the sections word for word, rewrites the parent as an index, routes the code and validates with lint. Use when lint reports a module doc over its size budget, or the user says "split this module", "too big", "break X into submodules".