ai-factory 2.13.1 → 2.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-factory",
3
- "version": "2.13.1",
3
+ "version": "2.13.2",
4
4
  "type": "module",
5
5
  "description": "CLI tool for automating AI agent context setup in projects",
6
6
  "main": "dist/cli/index.js",
@@ -5,7 +5,7 @@ description: >-
5
5
  Use when source material should become either one reusable skill package or a
6
6
  split set of focused skills, each with a concise SKILL.md plus detailed
7
7
  references and examples.
8
- argument-hint: "<path|url> [path|url...] [--name <skill-name>] [--update] [--split|--split-by <strategy>]"
8
+ argument-hint: "<path|url> [path|url...] [--name <skill-name>] [--path <directory>] [--update] [--redact-source-map] [--split|--split-by <strategy>]"
9
9
  allowed-tools: Read Write Edit Glob Grep Bash(mkdir *) Bash(ls *) Bash(find *) Bash(wc *) Bash(python3 *) WebFetch WebSearch AskUserQuestion
10
10
  disable-model-invocation: false
11
11
  metadata:
@@ -32,7 +32,7 @@ If config.yaml doesn't exist, use defaults:
32
32
 
33
33
  **Read `.ai-factory/skill-context/aif-distillation/SKILL.md`** - MANDATORY if the file exists.
34
34
 
35
- Treat skill-context rules as project-level overrides for this skill. They apply to all generated skill files, references, examples, source maps, and final reports.
35
+ Treat skill-context rules as project-level overrides for this skill. They apply to all generated skill files, references, examples, source-map policy, and final reports.
36
36
 
37
37
  ## Inputs
38
38
 
@@ -41,25 +41,30 @@ Accept `$ARGUMENTS` as one or more:
41
41
  - local directories
42
42
  - URLs
43
43
  - optional `--name <skill-name>`
44
+ - optional `--path <directory>` to save generated skill package directories under a custom output root instead of `{{skills_dir}}`
44
45
  - optional `--update` to improve an existing skill instead of creating a duplicate
46
+ - optional `--redact-source-map` to skip generated source-map files and sections entirely, so exact source titles, URLs, local paths, repository paths, and link reference definitions are not written to output
45
47
  - optional `--split` to create several focused skills from one material set
46
48
  - optional `--split-by <strategy>` to choose the split strategy:
47
- - `auto` (default): infer skill boundaries from source topics and use cases
49
+ - `auto` (default): infer skill boundaries from user goals, triggers, workflows, source topics, and use cases
50
+ - `goal`: split by user goals or jobs-to-be-done, regardless of domain
48
51
  - `topic`: split by major source topics or chapters
49
52
  - `workflow`: split by recurring actions an agent performs
50
53
  - `audience`: split by distinct user roles or implementation contexts
51
54
 
52
- If the target skill name is missing, derive a concise, general, lowercase-hyphenated name from the material topic, such as `clean-code-style`, `api-design-rules`, or `ddd-modeling`.
55
+ If the target skill name is missing, derive a concise, general, lowercase-hyphenated name from the material topic or user goal, such as `clean-code-style`, `api-design-rules`, `decision-making`, `writing-feedback`, or `meeting-facilitation`.
53
56
 
54
57
  Before any write, validate the final target skill name:
55
58
  - It must match `^[a-z0-9]+(?:-[a-z0-9]+)*$`.
56
59
  - Reject empty names, overlong names, `.`, `..`, dots, path separators (`/` or `\`), absolute paths, Windows drive paths, and hidden names.
57
60
  - Reject reserved `aif-*` names unless the user explicitly says they are developing AI Factory itself.
58
- - Resolve the final destination path and confirm it is inside `{{skills_dir}}` before creating or updating files.
61
+ - Resolve the output root: `--path <directory>` when present, otherwise `{{skills_dir}}`.
62
+ - Treat relative `--path` values as relative to the current working directory. Create the output root if it does not exist; reject it if it resolves to an existing file.
63
+ - Resolve the final destination path and confirm it is inside the resolved output root before creating or updating files.
59
64
 
60
- Default destination for single-skill mode: `{{skills_dir}}/<skill-name>/` for the current agent.
65
+ Default destination for single-skill mode: `<output-root>/<skill-name>/`, where `<output-root>` is `{{skills_dir}}` unless `--path` is present.
61
66
 
62
- Default destination for split mode: `{{skills_dir}}/<generated-skill-name>/` for each generated child skill. `--name` becomes a naming seed or namespace prefix, not one enclosing package directory, unless the user explicitly asks for an index-only parent skill.
67
+ Default destination for split mode: `<output-root>/<prefix>-<child-scope>/` for each generated child skill. Every split child name must share one namespace prefix to prevent collisions with existing skills. Use `--name` as the preferred prefix when present; otherwise derive a concise prefix from the book title or primary material title. If `--redact-source-map` is present and the exact source title should not be exposed, use `--name` as the public namespace or derive a neutral topic prefix.
63
68
 
64
69
  Do not save distilled skills into the package `skills/` directory unless the user is explicitly developing AI Factory itself.
65
70
 
@@ -79,34 +84,42 @@ Do not save distilled skills into the package `skills/` directory unless the use
79
84
 
80
85
  3. Choose single-skill or split-skill design.
81
86
  - Default to single-skill mode unless `--split` or `--split-by` is present.
82
- - In split mode, create a skill boundary map before writing: proposed skill name, trigger description, owned source topics, references/examples needed, and overlap risks.
83
- - Prefer split mode when the material contains independent practices that should trigger separately, such as readability refactoring, naming cleanup, testability checks, exception-flow review, or framework-specific passes.
87
+ - In split mode, resolve one shared namespace prefix before writing the boundary map. Use `--name` when present; otherwise use a normalized book/material title. Every proposed child name must start with `<prefix>-`.
88
+ - In split mode, create a skill boundary map before writing: proposed prefixed skill name, user-facing job, trigger description, owned source topics, references/examples needed, and overlap risks.
89
+ - Prefer split mode when the material contains independent goals that should trigger separately, such as reviewing, planning, diagnosing, rewriting, teaching, deciding, testing, facilitating, auditing, or troubleshooting.
90
+ - Name split children by the user goal or job-to-be-done, not by an abstract source theme. Choose the goal taxonomy from the material's domain: for software this may be `refactoring-review`, `test-design`, or `framework-fit-review`; for writing this may be `argument-edit` or `style-review`; for operations this may be `incident-triage` or `runbook-review`; for management this may be `decision-brief` or `stakeholder-analysis`; for learning this may be `concept-coach` or `practice-drill`.
91
+ - Avoid vague lifecycle or chapter names such as `framework-evolution`, `principles`, `philosophy`, `chapter-4`, `mindset`, or `overview` unless that exact name is the user's requested public taxonomy.
84
92
  - Do not split into tiny skills that differ only by wording. Merge candidates when their triggers, workflow, and reference needs substantially overlap.
85
- - Keep every generated child skill independently useful: clear frontmatter, focused workflow, relevant references/examples, and its own source map or source-map section.
93
+ - Keep every generated child skill independently useful: clear frontmatter, focused workflow, and relevant references/examples. If `--redact-source-map` is absent, include its own source map; if present, do not create `references/SOURCE-MAP.md` or a source-map section.
86
94
 
87
95
  4. Design the target skill package.
88
96
  - Keep target `SKILL.md` focused on purpose, triggers, and workflow.
97
+ - Make the generated skill self-explanatory from its directory name and frontmatter. The description must start with an action verb and say what the skill reviews, improves, generates, or checks.
98
+ - Near the top of every generated `SKILL.md`, answer in plain language: what this skill does, when to use it, and what output it should produce. A user should not need to inspect the source material to understand why the skill exists.
89
99
  - Put detailed knowledge in `references/`.
90
100
  - Put reusable prompts, cases, and transformed examples in `examples/`.
91
101
  - If the material teaches programming with code examples, create or update an examples file with original before/after snippets or compact code patterns. Do not omit code examples only because verbatim copying is inappropriate.
92
102
  - For book-scale or broad code material, cover every major code-facing topic with an adapted example, or state why a topic does not need one. Split examples into multiple files when one file would become a shallow sampler.
93
103
  - Add scripts only when the workflow needs repeatable processing.
94
- - In single-skill mode, save the package under `{{skills_dir}}/<skill-name>/` using the chosen concise name.
95
- - In split mode, save each child package directly under `{{skills_dir}}/<child-skill-name>/`. If `--name` is present, use it as a concise prefix only when it improves discoverability and does not make names bulky.
104
+ - Resolve `<output-root>` from `--path` or `{{skills_dir}}` before writing. Treat `--path` as a parent directory for generated skill packages, not as the skill package name.
105
+ - In single-skill mode, save the package under `<output-root>/<skill-name>/` using the chosen concise name.
106
+ - In split mode, save each child package directly under `<output-root>/<prefix>-<child-scope>/`. Do not drop the shared prefix even when the child scope is clear on its own.
107
+ - When `--redact-source-map` is present, do not create `references/SOURCE-MAP.md`, do not create a "Source Map" section in any generated file, and remove any empty `SOURCE-MAP.md` accidentally created during drafting. In `--update` mode, leave an existing non-empty `SOURCE-MAP.md` unchanged unless the user explicitly asks to remove or rewrite it.
96
108
  - Use resolved `language.artifacts` for generated skill content unless the source material or user explicitly requires another language.
97
109
 
98
110
  5. Check existing content before writing.
99
111
  - If the target skill already has matching references or examples, update them in place.
100
112
  - Do not create near-duplicate files with different names.
101
113
  - Preserve useful existing material and add only missing or better distilled content.
102
- - In split mode, also check existing sibling skills under `{{skills_dir}}` for matching triggers. Update a matching skill with `--update` instead of creating a new near-duplicate child.
114
+ - In split mode, also check existing sibling skills under `<output-root>` for matching triggers. Update a matching skill with `--update` instead of creating a new near-duplicate child.
103
115
 
104
116
  6. Validate usefulness.
105
117
  - The skill must tell an agent what to do, when to do it, what good output looks like, and what mistakes to avoid.
118
+ - The name and description must be invocation-ready. If a user would ask "what does this skill actually do?", rename it or rewrite the trigger before finishing.
106
119
  - References must be dense and navigable.
107
120
  - Examples must demonstrate decisions or transformations, not decorative filler.
108
121
  - If source material contained meaningful code snippets or worked examples, the generated skill must include adapted examples. Missing adapted examples is a failure to fix before finishing.
109
- - Example coverage must match the source map: major code-facing source areas should point to concrete examples, not just prose references.
122
+ - Example coverage must match source coverage: when `--redact-source-map` is absent, record this in the source map; when present, validate coverage internally without writing source-map files or sections.
110
123
  - Generated skills must include an artifact ownership/config policy section when they write or read project artifacts.
111
124
  - Generated quality-gate skills must follow the `aif-gate-result` contract from `/aif-verify` references.
112
125
  - In split mode, every child skill must have a distinct activation trigger. If two children would activate for the same request and tell the agent to do the same work, merge them before finishing.
@@ -122,6 +135,6 @@ Use `examples/REQUESTS.md` for invocation patterns.
122
135
 
123
136
  ## Artifact Ownership
124
137
 
125
- - Primary ownership: generated or updated skill packages under `{{skills_dir}}/<skill-name>/`, or multiple direct child skill packages under `{{skills_dir}}/<child-skill-name>/` in split mode.
138
+ - Primary ownership: generated or updated skill packages under `<output-root>/<skill-name>/`, or multiple direct child skill packages under `<output-root>/<prefix>-<child-scope>/` in split mode. `<output-root>` is `{{skills_dir}}` unless the user passes `--path <directory>`.
126
139
  - Read-only context: `.ai-factory/config.yaml`, existing AI Factory context artifacts, and existing skill files except the selected target skill in update mode.
127
140
  - Config policy: config-aware for `language.ui`, `language.artifacts`, and `language.technical_terms` only. Do not write `config.yaml`.
@@ -38,12 +38,38 @@ Expected behavior:
38
38
  Expected behavior:
39
39
 
40
40
  - infer focused child skills from distinct practices rather than creating one broad skill
41
- - use `code-quality` only as a naming seed when it helps; prefer clear child names such as `readability-refactor`, `naming-cleanup`, `condition-simplifier`, or `testability-pass`
42
- - write each child directly under `{{skills_dir}}/<child-skill-name>/`
41
+ - use `code-quality` as the required shared namespace prefix
42
+ - prefer clear child names such as `code-quality-readability-refactor`, `code-quality-naming-cleanup`, `code-quality-condition-simplifier`, or `code-quality-testability-pass`
43
+ - write each child directly under `{{skills_dir}}/<prefix>-<child-scope>/`
43
44
  - give every child a distinct frontmatter description and activation trigger
44
- - include source attribution for every child
45
+ - include source attribution for every child unless `--redact-source-map` is present
45
46
  - merge or skip candidates whose triggers overlap too much
46
47
 
48
+ ## Save to a Custom Output Root
49
+
50
+ ```text
51
+ /aif-distillation ./books/domain-driven-design.pdf --name ddd-practices --path ./distilled-skills
52
+ ```
53
+
54
+ Expected output:
55
+
56
+ - `./distilled-skills/ddd-practices/SKILL.md`
57
+ - `./distilled-skills/ddd-practices/references/SOURCE-MAP.md`
58
+ - no writes to the current agent `{{skills_dir}}`
59
+ - resolved destination stays inside the resolved `--path` output root
60
+
61
+ ## Split into a Custom Output Root
62
+
63
+ ```text
64
+ /aif-distillation ./books/code-quality.pdf --split --name code-quality --path ./distilled-skills
65
+ ```
66
+
67
+ Expected behavior:
68
+
69
+ - create direct child package directories under `./distilled-skills/`
70
+ - name every child with the shared `code-quality-` prefix
71
+ - do not create a parent `code-quality/` wrapper directory unless explicitly requested as an index/router skill
72
+
47
73
  ## Split by a Specific Strategy
48
74
 
49
75
  ```text
@@ -53,10 +79,38 @@ Expected behavior:
53
79
  Expected behavior:
54
80
 
55
81
  - split by recurring actions an agent performs, not by arbitrary file count
82
+ - name every child with the shared `review-` prefix, such as `review-triage` or `review-findings`
56
83
  - create a boundary map before writing
57
84
  - update matching existing child skills when `--update` is also present
58
85
  - report created, updated, merged, and skipped candidates
59
86
 
87
+ ## Split Non-Code Material by User Goals
88
+
89
+ ```text
90
+ /aif-distillation ./books/decision-making.pdf --split-by goal --name decisions
91
+ ```
92
+
93
+ Expected behavior:
94
+
95
+ - split by jobs the user wants help with, not by chapter titles
96
+ - create names such as `decisions-decision-brief`, `decisions-risk-review`, or `decisions-stakeholder-analysis`
97
+ - make every child explain what it does, when to use it, and what output it should produce
98
+ - avoid vague children such as `decisions-principles`, `decisions-mindset`, or `decisions-chapter-2`
99
+
100
+ ## Redact Source Map Paths and Links
101
+
102
+ ```text
103
+ /aif-distillation ./books/internal-review-guide.pdf --name review-guide --redact-source-map
104
+ ```
105
+
106
+ Expected behavior:
107
+
108
+ - generate the skill normally
109
+ - do not create `references/SOURCE-MAP.md`
110
+ - do not create a "Source Map" section in `SKILL.md` or any reference file
111
+ - omit exact book titles, URLs, local paths, repository paths, filenames, and link reference definitions from generated files
112
+ - keep source coverage only in private working notes while still producing useful distilled instructions, references, and examples
113
+
60
114
  ## Create a Skill from a Docs Folder
61
115
 
62
116
  ```text
@@ -86,7 +140,7 @@ Expected behavior:
86
140
  - reject the request before writing files
87
141
  - explain that skill names must match `^[a-z0-9]+(?:-[a-z0-9]+)*$`
88
142
  - reserve `aif-*` names unless the user explicitly says they are developing AI Factory itself
89
- - confirm the resolved target path would stay under `{{skills_dir}}`
143
+ - confirm the resolved target path would stay under the resolved output root (`{{skills_dir}}` by default, or `--path` when present)
90
144
 
91
145
  ## Update an Existing Skill
92
146
 
@@ -111,5 +165,5 @@ Expected behavior:
111
165
 
112
166
  - fetch the pages
113
167
  - follow only critical sub-pages
114
- - source-map all URLs used
168
+ - source-map all URLs used unless `--redact-source-map` is present; with redaction, do not create `SOURCE-MAP.md`
115
169
  - summarize rules and examples without long quoted passages
@@ -16,6 +16,12 @@ Create a source inventory:
16
16
 
17
17
  For folders, group files by topic before reading deeply. For books, read the table of contents first, then sample each major part before deep extraction.
18
18
 
19
+ When the user passes `--redact-source-map`, keep any exact URLs, local paths,
20
+ repository paths, and source titles only in your private working inventory.
21
+ Generated skill files must use neutral source labels such as `Source A`,
22
+ `Book section 1`, or `Internal guide: authentication`, while preserving the
23
+ type, scope, and usage of each source.
24
+
19
25
  ## 2. Extraction
20
26
 
21
27
  Extract only material that can drive agent behavior:
@@ -90,21 +96,33 @@ Use this section only when the user passes `--split` or `--split-by <strategy>`.
90
96
  Split source material into multiple skills when the material contains separate
91
97
  capabilities that should activate on different user requests. A split set should
92
98
  feel like a small toolkit of focused passes, not a chopped-up book summary.
99
+ If `--path <directory>` is present, create the split set under that output root
100
+ instead of the current agent `{{skills_dir}}`.
93
101
 
94
102
  Supported strategies:
95
103
 
96
104
  | Strategy | Use when | Boundary signal |
97
105
  |----------|----------|-----------------|
98
- | `auto` | the user wants several skills but did not prescribe boundaries | strongest distinct triggers from topics, workflows, examples, and target users |
106
+ | `auto` | the user wants several skills but did not prescribe boundaries | strongest distinct goals, triggers, workflows, examples, and target users |
107
+ | `goal` | the material supports several different jobs-to-be-done | each child helps the user accomplish a different outcome |
99
108
  | `topic` | the source has clean domain or chapter boundaries | each topic produces different decisions or checks |
100
109
  | `workflow` | the source teaches multiple actions | each action has a different input, output, or quality gate |
101
110
  | `audience` | the source serves different roles or project contexts | each role/context needs different operating instructions |
102
111
 
103
112
  Before writing split skills, create a boundary map:
104
113
 
105
- | Child skill | Trigger | Source topics | References/examples | Merge risk |
106
- |-------------|---------|---------------|---------------------|------------|
107
- | <name> | <when it should activate> | <topics> | <files> | low/medium/high |
114
+ | Child skill | User goal | Trigger | Source topics | References/examples | Merge risk |
115
+ |-------------|-----------|---------|---------------|---------------------|------------|
116
+ | <name> | <outcome it helps achieve> | <when it should activate> | <topics> | <files> | low/medium/high |
117
+
118
+ First resolve a shared split namespace prefix:
119
+
120
+ - use `--name` when the user supplied it
121
+ - otherwise derive the prefix from the book title or primary material title
122
+ - if source-map redaction is requested and the real title should stay private,
123
+ use a neutral topic prefix instead of the exact title
124
+ - validate the prefix with the same skill-name rules as ordinary skills
125
+ - every generated child name must start with `<prefix>-`
108
126
 
109
127
  Merge or drop a child candidate when:
110
128
 
@@ -119,9 +137,24 @@ passes such as readability refactoring, naming cleanup, condition
119
137
  simplification, magic value extraction, exception-flow review, testability, and
120
138
  framework-specific review. These names are examples, not required output.
121
139
 
122
- Every child skill must include its own source attribution. For small children,
140
+ For non-code material, use the same goal-first rule. Examples:
141
+
142
+ - writing or communication: `argument-edit`, `style-review`, `message-critique`
143
+ - strategy or management: `decision-brief`, `stakeholder-analysis`, `risk-review`
144
+ - operations or support: `incident-triage`, `runbook-review`, `escalation-plan`
145
+ - learning material: `concept-explainer`, `practice-drill`, `understanding-check`
146
+ - research material: `evidence-synthesis`, `claim-audit`, `literature-map`
147
+
148
+ Avoid source-theme children with unclear invocation intent.
149
+ If a candidate name makes a user ask "what does this do?", rename it around the
150
+ goal and expected output.
151
+
152
+ Every child skill must include its own source attribution unless
153
+ `--redact-source-map` is present. For small non-redacted children,
123
154
  `references/SOURCE-MAP.md` may be the only reference; for larger children, add
124
- focused references and examples.
155
+ focused references and examples. In redaction mode, do not create
156
+ `references/SOURCE-MAP.md`; keep source coverage in the private working
157
+ inventory and ship only the distilled instructions, references, and examples.
125
158
 
126
159
  ## 6. Existing-File Merge
127
160
 
@@ -150,7 +183,8 @@ description and workflow already cover the same capability.
150
183
 
151
184
  ## 7. Traceability
152
185
 
153
- Every distilled skill should include a source map in a reference:
186
+ Every distilled skill should include a source map in a reference unless
187
+ `--redact-source-map` is present:
154
188
 
155
189
  ```markdown
156
190
  ## Source Map
@@ -160,7 +194,16 @@ Every distilled skill should include a source map in a reference:
160
194
  | <path-or-url> | <principles, workflow, examples, checks> |
161
195
  ```
162
196
 
163
- Do not imply that every rule is a direct quote. Distillation is synthesis; source maps explain provenance.
197
+ When `--redact-source-map` is present, do not create `references/SOURCE-MAP.md`
198
+ and do not add a "Source Map" section to any generated file. Do not write link
199
+ reference definitions, raw path fragments, repository paths, filenames that
200
+ reveal the source, exact URLs, or exact book/document titles anywhere as source
201
+ attribution. If a draft creates an empty `SOURCE-MAP.md`, remove it before
202
+ finishing. In `--update` mode, leave an existing non-empty `SOURCE-MAP.md`
203
+ unchanged unless the user explicitly asks to remove or rewrite it.
204
+
205
+ For non-redacted source maps, do not imply that every rule is a direct quote.
206
+ Distillation is synthesis; source maps explain provenance.
164
207
 
165
208
  ## 8. Quality Gate
166
209
 
@@ -175,7 +218,8 @@ Before finishing, check:
175
218
  - Example coverage maps to the source areas. If references mention many
176
219
  code-facing topics but examples cover only a few, the skill is incomplete.
177
220
  - Existing references/examples were updated instead of duplicated.
178
- - Split mode only: each child skill has a distinct trigger, direct `{{skills_dir}}/<child>/` location, source attribution, and enough references/examples to operate independently.
221
+ - Split mode only: each child skill has a distinct trigger, direct `<output-root>/<prefix>-<child>/` location, source attribution when not redacted, no `SOURCE-MAP.md` when redacted, and enough references/examples to operate independently.
222
+ - Split mode only: all generated child names share the same prefix derived from `--name`, the book title, or a neutral material namespace.
179
223
  - Split mode only: no generated child is a near-duplicate of another generated or existing sibling skill.
180
224
  - Temporary extraction files were removed.
181
225
  - No long copyrighted passages were copied.
@@ -28,6 +28,11 @@ Optional flags:
28
28
 
29
29
  Read `source-index.md` first. Then read only the chunks needed for each section of the target skill.
30
30
 
31
+ When `--redact-source-map` is present, treat `source-index.md` as a private
32
+ working index only. Do not copy its raw URLs, local paths, filenames, or exact
33
+ source titles into generated files. Do not create `references/SOURCE-MAP.md`
34
+ for redacted output.
35
+
31
36
  ## Chunking Strategy
32
37
 
33
38
  Use this order:
@@ -5,10 +5,10 @@ Use this structure for skills created by `aif-distillation`.
5
5
  ## Target Package
6
6
 
7
7
  ```text
8
- {{skills_dir}}/<skill-name>/
8
+ <output-root>/<skill-name>/
9
9
  ├── SKILL.md
10
10
  ├── references/
11
- │ ├── SOURCE-MAP.md
11
+ │ ├── SOURCE-MAP.md # omit when --redact-source-map is present
12
12
  │ ├── CORE-PRINCIPLES.md
13
13
  │ ├── WORKFLOW.md
14
14
  │ └── CHECKLISTS.md
@@ -33,22 +33,23 @@ When the user passes `--split` or `--split-by <strategy>`, create multiple
33
33
  focused skill packages instead of one broad package:
34
34
 
35
35
  ```text
36
- {{skills_dir}}/
37
- ├── <child-skill-a>/
36
+ <output-root>/
37
+ ├── <prefix>-<child-skill-a>/
38
38
  │ ├── SKILL.md
39
39
  │ ├── references/
40
- │ │ ├── SOURCE-MAP.md
40
+ │ │ ├── SOURCE-MAP.md # omit when --redact-source-map is present
41
41
  │ │ └── <focused-reference>.md
42
42
  │ └── examples/
43
43
  │ └── <focused-examples>.md
44
- ├── <child-skill-b>/
44
+ ├── <prefix>-<child-skill-b>/
45
45
  │ └── SKILL.md
46
46
  └── <optional-index-skill>/
47
47
  └── SKILL.md
48
48
  ```
49
49
 
50
50
  Do not create a parent directory that contains child skills. Agent runtimes
51
- discover skills as direct children of `{{skills_dir}}`.
51
+ discover skills as direct children of the output root when that root is an
52
+ agent skills directory.
52
53
 
53
54
  Create an optional index/router skill only when it is genuinely useful, for
54
55
  example when the split set is large or users need a single command-style entry
@@ -62,28 +63,50 @@ boundaries include:
62
63
  - a distinct refactoring operation, such as `early-return-simplifier`
63
64
  - a distinct framework or runtime practice, such as `laravel-query-boundaries`
64
65
  - a distinct writing or analysis workflow, such as `comments-curator`
66
+ - a distinct non-code goal, such as `argument-edit`, `decision-brief`,
67
+ `incident-triage`, `practice-drill`, or `risk-review`
65
68
 
66
69
  Avoid split boundaries based only on source chapter titles when the resulting
67
70
  skills would have the same trigger and workflow.
68
71
 
69
72
  ## Destination
70
73
 
71
- Save the distilled skill in the configured skills directory of the currently active agent:
74
+ Save the distilled skill in the configured skills directory of the currently active agent by default:
72
75
 
73
76
  ```text
74
77
  {{skills_dir}}/<skill-name>/
75
78
  ```
76
79
 
77
80
  `{{skills_dir}}` is resolved by AI Factory for the active agent installation.
81
+ If the user passes `--path <directory>`, use that directory as the output root
82
+ instead:
83
+
84
+ ```text
85
+ <directory>/<skill-name>/
86
+ ```
87
+
88
+ `--path` is a parent output directory for generated skill package directories,
89
+ not the skill package name itself. Resolve relative `--path` values from the
90
+ current working directory. Create the output root if it does not exist; reject
91
+ it if it resolves to an existing file. For a single exact destination, the user
92
+ should pass `--path <parent-dir> --name <directory-name>`.
78
93
 
79
94
  Do not write distilled output into AI Factory's package `skills/` directory unless the task is explicitly to add a built-in AI Factory skill.
80
95
 
81
- Before writing, resolve and canonicalize the final destination path. It must stay inside the resolved `{{skills_dir}}` directory.
96
+ Before writing, resolve and canonicalize the output root and final destination
97
+ path. The final destination must stay inside the resolved output root. When
98
+ `--path` is absent, the output root is `{{skills_dir}}`.
82
99
 
83
100
  For split mode, apply this same validation to every generated child skill path.
84
- If `--name <seed>` is supplied, use it as a naming seed or short prefix only
85
- when it improves discoverability. Prefer clear standalone names over repetitive
86
- prefixes.
101
+ Every generated child name must use one shared namespace prefix:
102
+
103
+ - use `--name <skill-name>` as the prefix when supplied
104
+ - otherwise derive a concise prefix from the book title or primary material title
105
+ - when source-map redaction is requested, avoid exposing a private title and use
106
+ `--name` or a neutral material/topic prefix instead
107
+ - write children as `<output-root>/<prefix>-<child-scope>/`
108
+ - do not create unprefixed split children, even when the child scope reads well
109
+ by itself
87
110
 
88
111
  ## Naming
89
112
 
@@ -101,6 +124,10 @@ Good:
101
124
  - `domain-modeling`
102
125
  - `api-design-rules`
103
126
  - `incident-review`
127
+ - `argument-edit`
128
+ - `decision-brief`
129
+ - `practice-drill`
130
+ - `risk-review`
104
131
 
105
132
  Avoid:
106
133
 
@@ -112,11 +139,15 @@ Avoid:
112
139
 
113
140
  In split mode, generate a name list before writing and check it as a set:
114
141
 
142
+ - every name must start with the same resolved namespace prefix plus `-`
115
143
  - every name must pass the same validation rules
116
144
  - no name may collide with another generated child
117
145
  - no generated child may shadow a built-in `aif-*` skill
118
- - names should describe activation scope, not provenance
119
- - when multiple child names share a long prefix, remove the prefix unless it is needed to prevent ambiguity
146
+ - the suffix after the prefix should describe the user goal and expected action, not provenance
147
+ - avoid double-prefixing names when a candidate suffix already contains the prefix
148
+ - avoid abstract source-theme suffixes such as `principles`, `philosophy`,
149
+ `evolution`, `mindset`, or `chapter-3` unless the user explicitly requested
150
+ that taxonomy
120
151
 
121
152
  ## SKILL.md Rules
122
153
 
@@ -147,7 +178,7 @@ For AI Factory-style skills, also include:
147
178
 
148
179
  | File | Purpose |
149
180
  |------|---------|
150
- | `SOURCE-MAP.md` | Sources, coverage, and attribution |
181
+ | `SOURCE-MAP.md` | Sources, coverage, and attribution; omit entirely when `--redact-source-map` is present |
151
182
  | `CORE-PRINCIPLES.md` | Dense distilled concepts and rules |
152
183
  | `WORKFLOW.md` | Step-by-step operating procedure |
153
184
  | `CHECKLISTS.md` | Review gates and quality criteria |
@@ -156,6 +187,15 @@ For AI Factory-style skills, also include:
156
187
 
157
188
  Prefer stable, obvious filenames over clever names.
158
189
 
190
+ When `--redact-source-map` is present:
191
+
192
+ - do not create `references/SOURCE-MAP.md`
193
+ - do not create a "Source Map" section in `SKILL.md` or any reference file
194
+ - remove any empty `SOURCE-MAP.md` created while drafting
195
+ - in `--update` mode, leave an existing non-empty `SOURCE-MAP.md` unchanged
196
+ unless the user explicitly asks to remove or rewrite it
197
+ - keep source coverage checks in the private working notes only
198
+
159
199
  ## Example File Roles
160
200
 
161
201
  Examples should show how to apply the distilled knowledge: