@flancer32/skill-adsm-ctx 0.2.1

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.
Files changed (132) hide show
  1. package/.github/workflows/flows-app.yaml +95 -0
  2. package/AGENTS.md +112 -0
  3. package/LICENSE +201 -0
  4. package/README.md +246 -0
  5. package/bin/cli.mjs +55 -0
  6. package/ctx/AGENTS.md +44 -0
  7. package/ctx/README.md +24 -0
  8. package/ctx/adsm.json +5 -0
  9. package/ctx/agent/AGENTS.md +41 -0
  10. package/ctx/agent/flows/.img/flancer32-skill-adsm-ctx-github-flows.png +0 -0
  11. package/ctx/agent/flows/AGENTS.md +37 -0
  12. package/ctx/agent/flows/cfg/issues/labeled/accepted/profile.json +25 -0
  13. package/ctx/agent/flows/cfg/issues/labeled/accepted/prompt.md +104 -0
  14. package/ctx/agent/flows/cfg/issues/labeled/clarification-provided/profile.json +15 -0
  15. package/ctx/agent/flows/cfg/issues/labeled/clarification-provided/prompt.md +63 -0
  16. package/ctx/agent/flows/cfg/issues/opened/admission/profile.json +14 -0
  17. package/ctx/agent/flows/cfg/issues/opened/admission/prompt.md +110 -0
  18. package/ctx/agent/flows/cfg/profile.json +40 -0
  19. package/ctx/agent/flows/cfg/pull_request/closed/merged/profile.json +15 -0
  20. package/ctx/agent/flows/cfg/pull_request/closed/merged/prompt.md +41 -0
  21. package/ctx/agent/flows/cfg/pull_request/labeled/needs-fix/profile.json +25 -0
  22. package/ctx/agent/flows/cfg/pull_request/labeled/needs-fix/prompt.md +79 -0
  23. package/ctx/agent/flows/cfg/pull_request/labeled/ready-for-validation/profile.json +15 -0
  24. package/ctx/agent/flows/cfg/pull_request/labeled/ready-for-validation/prompt.md +72 -0
  25. package/ctx/agent/flows/cfg/pull_request/labeled/verified/profile.json +15 -0
  26. package/ctx/agent/flows/cfg/pull_request/labeled/verified/prompt.md +48 -0
  27. package/ctx/agent/flows/deployment.md +116 -0
  28. package/ctx/agent/flows/labels.md +108 -0
  29. package/ctx/agent/flows/overview.md +82 -0
  30. package/ctx/agent/prompt/cli/ai-intro.md +141 -0
  31. package/ctx/assets/.gitkeep +1 -0
  32. package/ctx/docs/AGENTS.md +121 -0
  33. package/ctx/docs/ai-intro.md +37 -0
  34. package/ctx/docs/architecture/AGENTS.md +98 -0
  35. package/ctx/docs/architecture/behavior.md +68 -0
  36. package/ctx/docs/architecture/checklists.md +48 -0
  37. package/ctx/docs/architecture/constraints.md +53 -0
  38. package/ctx/docs/architecture/constraints.skin.en.md +38 -0
  39. package/ctx/docs/architecture/decisions.md +118 -0
  40. package/ctx/docs/architecture/integration.md +31 -0
  41. package/ctx/docs/architecture/overview.md +76 -0
  42. package/ctx/docs/architecture/state.md +50 -0
  43. package/ctx/docs/architecture/structure.md +38 -0
  44. package/ctx/docs/architecture/supervision.md +71 -0
  45. package/ctx/docs/code/AGENTS.md +51 -0
  46. package/ctx/docs/code/overview.md +53 -0
  47. package/ctx/docs/code/testing.md +26 -0
  48. package/ctx/docs/environment/AGENTS.md +50 -0
  49. package/ctx/docs/environment/overview.md +33 -0
  50. package/ctx/docs/filesystem.md +44 -0
  51. package/ctx/docs/product/AGENTS.md +51 -0
  52. package/ctx/docs/product/domain.md +63 -0
  53. package/ctx/docs/product/domain.skin.en.md +40 -0
  54. package/ctx/docs/product/glossary.md +31 -0
  55. package/ctx/docs/product/overview.md +112 -0
  56. package/ctx/docs/product/overview.skin.en.md +38 -0
  57. package/ctx/docs/product/roles.md +17 -0
  58. package/ctx/docs/product/use-cases.md +15 -0
  59. package/jsconfig.json +12 -0
  60. package/migrations/README.md +9 -0
  61. package/package.json +33 -0
  62. package/skill/SKILL.md +47 -0
  63. package/skill/references/agents-hierarchy.md +45 -0
  64. package/skill/references/context-lifecycle.md +53 -0
  65. package/skill/references/design-questionnaire.md +44 -0
  66. package/skill/references/document-projections.md +290 -0
  67. package/skill/references/documentation-compression.md +117 -0
  68. package/skill/references/documentation-quality-audit.md +199 -0
  69. package/skill/references/orchestration-model.md +41 -0
  70. package/skill/references/specialized-skills.md +31 -0
  71. package/skill/references/upgrade-policy.md +19 -0
  72. package/skill/templates/AGENTS.md +120 -0
  73. package/skill/templates/ai/AGENTS.md +59 -0
  74. package/skill/templates/ctx/AGENTS.md +45 -0
  75. package/skill/templates/ctx/README.md +27 -0
  76. package/skill/templates/ctx/adsm.json +7 -0
  77. package/skill/templates/ctx/agent/AGENTS.md +36 -0
  78. package/skill/templates/ctx/assets/.gitkeep +1 -0
  79. package/skill/templates/ctx/docs/AGENTS.md +55 -0
  80. package/skill/templates/ctx/docs/ai-intro.md +53 -0
  81. package/skill/templates/ctx/docs/architecture/AGENTS.md +42 -0
  82. package/skill/templates/ctx/docs/architecture/behavior.md +38 -0
  83. package/skill/templates/ctx/docs/architecture/checklists.md +25 -0
  84. package/skill/templates/ctx/docs/architecture/constraints.md +36 -0
  85. package/skill/templates/ctx/docs/architecture/decisions.md +33 -0
  86. package/skill/templates/ctx/docs/architecture/integration.md +27 -0
  87. package/skill/templates/ctx/docs/architecture/overview.md +73 -0
  88. package/skill/templates/ctx/docs/architecture/state.md +52 -0
  89. package/skill/templates/ctx/docs/architecture/structure.md +32 -0
  90. package/skill/templates/ctx/docs/architecture/supervision.md +61 -0
  91. package/skill/templates/ctx/docs/code/AGENTS.md +35 -0
  92. package/skill/templates/ctx/docs/code/overview.md +21 -0
  93. package/skill/templates/ctx/docs/code/testing.md +13 -0
  94. package/skill/templates/ctx/docs/environment/AGENTS.md +34 -0
  95. package/skill/templates/ctx/docs/environment/overview.md +21 -0
  96. package/skill/templates/ctx/docs/filesystem.md +39 -0
  97. package/skill/templates/ctx/docs/product/AGENTS.md +38 -0
  98. package/skill/templates/ctx/docs/product/domain.md +77 -0
  99. package/skill/templates/ctx/docs/product/glossary.md +110 -0
  100. package/skill/templates/ctx/docs/product/overview.md +74 -0
  101. package/skill/templates/ctx/docs/product/roles.md +100 -0
  102. package/skill/templates/ctx/docs/product/use-cases.md +109 -0
  103. package/skill/templates/work/context/semantic-skin.md +27 -0
  104. package/skill/templates/work/report/documentation-compression.md +34 -0
  105. package/skill/templates/work/report/documentation-quality-audit.md +90 -0
  106. package/src/Bootstrap/Cli.mjs +62 -0
  107. package/src/Bootstrap.mjs +108 -0
  108. package/src/Design/Service.mjs +36 -0
  109. package/src/Init/Service.mjs +136 -0
  110. package/src/Shared/Constants.mjs +36 -0
  111. package/src/Shared/CopyDirectory.mjs +78 -0
  112. package/src/Shared/Metadata.mjs +30 -0
  113. package/src/Shared/Path.mjs +38 -0
  114. package/src/Skill/Installer.mjs +47 -0
  115. package/src/Upgrade/Service.mjs +44 -0
  116. package/src/Validate/Service.mjs +879 -0
  117. package/test/integration/.gitkeep +1 -0
  118. package/test/integration/cli-help.test.mjs +15 -0
  119. package/test/integration/cli-init-validate.test.mjs +223 -0
  120. package/test/integration/cli-install-skill.test.mjs +41 -0
  121. package/test/unit/Bootstrap/Cli.test.mjs +23 -0
  122. package/test/unit/Bootstrap.test.mjs +53 -0
  123. package/test/unit/Design/Service.test.mjs +11 -0
  124. package/test/unit/Init/Service.test.mjs +51 -0
  125. package/test/unit/Shared/Constants.test.mjs +21 -0
  126. package/test/unit/Shared/CopyDirectory.test.mjs +31 -0
  127. package/test/unit/Shared/Metadata.test.mjs +9 -0
  128. package/test/unit/Shared/Path.test.mjs +11 -0
  129. package/test/unit/Skill/Installer.test.mjs +20 -0
  130. package/test/unit/Upgrade/Service.test.mjs +13 -0
  131. package/test/unit/Validate/Service.test.mjs +760 -0
  132. package/types.d.ts +15 -0
@@ -0,0 +1,100 @@
1
+ # Product Role Model
2
+
3
+ - Path: `ctx/docs/product/roles.md`
4
+ - Template Version: `20260605`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Describe product participants and their authority at the overview level.
10
+
11
+ This document defines product-role semantics only: who participates in the product world, why each role exists, what each role may control, and where responsibility boundaries are placed.
12
+
13
+ Detailed role groups may be described in `ctx/docs/product/roles/`.
14
+
15
+ ## Level Boundary
16
+
17
+ Defines:
18
+
19
+ - role categories;
20
+ - role authority principles;
21
+ - ownership and responsibility boundaries;
22
+ - role visibility principles;
23
+ - role participation rules;
24
+ - role-level invariants.
25
+
26
+ Does NOT define:
27
+
28
+ - authentication mechanisms, sessions, tokens, passwords, or identity storage;
29
+ - API authorization middleware, route guards, or endpoint permissions;
30
+ - UI screens, buttons, menus, or interaction mechanics;
31
+ - source code roles, classes, services, policies, or implementation algorithms;
32
+ - database tables, access-control records, or persistence structure;
33
+ - detailed domain entity structure.
34
+
35
+ ## Role Categories
36
+
37
+ List the major role categories in the product.
38
+
39
+ For each category, describe:
40
+
41
+ - purpose;
42
+ - product authority;
43
+ - owned product areas or objects;
44
+ - relation to other roles;
45
+ - detailed document, if it exists.
46
+
47
+ ## Core Roles
48
+
49
+ List only the roles required for first-level understanding of the product.
50
+
51
+ Do not describe all possible roles here when the product has a large role model.
52
+
53
+ Detailed role definitions belong to dedicated role-area documents.
54
+
55
+ ## Authority Principles
56
+
57
+ Describe product-level principles of authority.
58
+
59
+ Clarify:
60
+
61
+ - who may create durable product state;
62
+ - who may change durable product state;
63
+ - who may publish or approve product state;
64
+ - who may delete or archive product state;
65
+ - who may view product state;
66
+ - what requires explicit user confirmation.
67
+
68
+ Do not describe implementation-level permission checks.
69
+
70
+ ## Ownership Boundaries
71
+
72
+ Describe what each major role category owns or must not own.
73
+
74
+ Focus on product meaning and responsibility, not access-control implementation.
75
+
76
+ ## Participation Relations
77
+
78
+ Describe how roles interact with each other in the product.
79
+
80
+ Examples:
81
+
82
+ - owner and participant;
83
+ - author and reviewer;
84
+ - provider and consumer;
85
+ - administrator and managed user;
86
+ - human user and AI assistant.
87
+
88
+ ## Role Invariants
89
+
90
+ List role-level rules that must remain true regardless of architecture, storage, UI, or code.
91
+
92
+ ## Role Documentation Map
93
+
94
+ List detailed role documents.
95
+
96
+ Example:
97
+
98
+ - `roles/users.md` — end-user role groups.
99
+ - `roles/admins.md` — administrative roles.
100
+ - `roles/external-actors.md` — external participants and systems.
@@ -0,0 +1,109 @@
1
+ # Product Use Cases
2
+
3
+ - Path: `ctx/docs/product/use-cases.md`
4
+ - Template Version: `20260605`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Describe product use cases at the overview level.
10
+
11
+ This document defines product-goal semantics only: what users need to achieve, why those goals matter, what product result is expected, and which product boundaries apply.
12
+
13
+ Any mention of product state in this document is product-level only.
14
+
15
+ Detailed use-case groups may be described in `ctx/docs/product/use-cases/`.
16
+
17
+ ## Level Boundary
18
+
19
+ Defines:
20
+
21
+ - major user goals;
22
+ - product-level expected outcomes;
23
+ - use-case groups;
24
+ - lifecycle position of use cases;
25
+ - role participation at the product level;
26
+ - use-case-level invariants.
27
+
28
+ Does NOT define:
29
+
30
+ - UI screens, forms, widgets, buttons, or interaction mechanics;
31
+ - API routes, requests, responses, or transport protocols;
32
+ - source code actions, services, handlers, or implementation algorithms;
33
+ - database records, DTO fields, persistence workflows, or storage structure;
34
+ - test cases or acceptance-test procedures;
35
+ - detailed role permissions beyond product-level participation.
36
+
37
+ ## Use Case Groups
38
+
39
+ List the major groups of product use cases.
40
+
41
+ For each group, describe:
42
+
43
+ - user goal;
44
+ - participating roles;
45
+ - expected product outcome;
46
+ - related domain areas;
47
+ - lifecycle position;
48
+ - detailed document, if it exists.
49
+
50
+ ## Core Use Cases
51
+
52
+ List only the use cases required for first-level understanding of the product.
53
+
54
+ Do not describe the complete use-case catalog here when the product has many use cases.
55
+
56
+ Detailed use-case definitions belong to dedicated use-case group documents.
57
+
58
+ ## Use Case Format
59
+
60
+ When a use case is described in this document or in a detailed use-case document, use product-level language.
61
+
62
+ Recommended fields:
63
+
64
+ - goal;
65
+ - primary role;
66
+ - supporting roles;
67
+ - preconditions;
68
+ - expected outcome;
69
+ - durable product outcome;
70
+ - product state effect at the product level;
71
+ - product boundaries;
72
+ - related domain concepts;
73
+ - related terms.
74
+
75
+ Do not include UI flow, API flow, database flow, implementation steps, DTOs, commands, events, handlers, or test procedures.
76
+
77
+ Do not describe database changes, API calls, events, handlers, or implementation workflows.
78
+
79
+ ## Lifecycle Model
80
+
81
+ Describe how major use-case groups relate to the core product lifecycle.
82
+
83
+ This section should help the reader understand when and why use cases occur.
84
+
85
+ ## Outcome Principles
86
+
87
+ Describe how expected outcomes are recognized at the product level.
88
+
89
+ Clarify:
90
+
91
+ - what counts as a useful product result;
92
+ - what produces a durable product outcome;
93
+ - what has a product state effect at the product level;
94
+ - what remains temporary or draft state;
95
+ - what requires explicit user acceptance or confirmation.
96
+
97
+ ## Use Case Invariants
98
+
99
+ List use-case-level rules that must remain true regardless of architecture, storage, UI, or code.
100
+
101
+ ## Use Case Documentation Map
102
+
103
+ List detailed use-case documents.
104
+
105
+ Example:
106
+
107
+ - `use-cases/onboarding.md` — entry and first-use goals.
108
+ - `use-cases/content.md` — content creation and publication goals.
109
+ - `use-cases/administration.md` — administration and governance goals.
@@ -0,0 +1,27 @@
1
+ # <Title>
2
+
3
+ ## Purpose
4
+
5
+ One short sentence.
6
+
7
+ ## Mental Model
8
+
9
+ One or two short paragraphs that restore the human frame.
10
+
11
+ ## Scope
12
+
13
+ Includes:
14
+
15
+ - one to three items.
16
+
17
+ Excludes:
18
+
19
+ - one to three items.
20
+
21
+ ## Invariants
22
+
23
+ - normally no more than five to seven items.
24
+
25
+ ## Agent Document
26
+
27
+ `name.md`
@@ -0,0 +1,34 @@
1
+ # Documentation Compression Report
2
+
3
+ - Project:
4
+ - Scope:
5
+ - Date:
6
+ - Agent:
7
+
8
+ ## Compressed Files
9
+
10
+ List files modified during compression.
11
+
12
+ ## Preserved Authoritative Meanings
13
+
14
+ List source-of-truth meanings that were preserved while wording was reduced.
15
+
16
+ ## Preserved Skin Meaning
17
+
18
+ List matching skins read before agent-document edits and the preserved purpose, mental model, scope, and invariants.
19
+
20
+ ## Removed Redundancy
21
+
22
+ List repeated wording, obvious descriptions, process narration, or low-density text removed.
23
+
24
+ ## Moved Meanings
25
+
26
+ List durable meanings moved to their authoritative home and the files updated to avoid parallel definitions.
27
+
28
+ ## Human Decisions Required
29
+
30
+ List non-editorial uncertainties, agent/skin conflicts, and skin-controlled meaning changes that could not be resolved from existing documentation.
31
+
32
+ ## Unresolved Risks
33
+
34
+ List remaining semantic, hierarchy, or authority risks after compression.
@@ -0,0 +1,90 @@
1
+ # Documentation Quality Audit Report
2
+
3
+ - Project:
4
+ - Scope:
5
+ - Date:
6
+ - Auditor:
7
+
8
+ ## Corpus
9
+
10
+ List audited files and any upstream files used to interpret the scope.
11
+
12
+ ## Documentation Map
13
+
14
+ Summarize source-of-truth agent documents, refinement relationships, agent/skin pairs, orphan skins, projection drift, and duplicated responsibility areas.
15
+
16
+ ## Executive Result
17
+
18
+ State whether the corpus is usable as ADSM cognitive context and identify the highest-risk quality problems.
19
+
20
+ ## Findings By Severity
21
+
22
+ ### Critical
23
+
24
+ ### High
25
+
26
+ ### Medium
27
+
28
+ ### Low
29
+
30
+ ## Findings By Criterion
31
+
32
+ ### Declarativity
33
+
34
+ ### Consistency
35
+
36
+ ### Completeness
37
+
38
+ ### Connectedness
39
+
40
+ ### Density
41
+
42
+ ### Compactness
43
+
44
+ ### Non-Redundancy
45
+
46
+ ### Absence Of Obvious Descriptions
47
+
48
+ ## Cross-Document Contradictions
49
+
50
+ List contradictions that require synchronization or human decision.
51
+
52
+ ## Projection Drift
53
+
54
+ List agent/skin conflicts, orphan skins, skins that contain agent-level operational detail, suspiciously missing skins for key human-direction documents, and assets that appear to introduce meaning not present in agent or skin documents.
55
+
56
+ ## Skin Review Output
57
+
58
+ For each reviewed skin, state:
59
+
60
+ - whether it works as a human-facing semantic layer;
61
+ - whether it preserves the same meaning as the paired agent document;
62
+ - whether it avoids operational overload;
63
+ - whether it adds untracked requirements;
64
+ - what must be changed.
65
+
66
+ ## Agent Review Output
67
+
68
+ For each reviewed agent document, state:
69
+
70
+ - whether it works as agent-facing operational context;
71
+ - whether it reduces guessing;
72
+ - whether current facts, future plans, requirements, prohibitions, and verification are clear;
73
+ - whether file references are accurate;
74
+ - whether a missing skin document is acceptable or suspicious.
75
+
76
+ ## Missing Context
77
+
78
+ List upstream gaps that prevent safe downstream correction.
79
+
80
+ ## Redundancy Map
81
+
82
+ List duplicated meanings and the recommended authoritative home for each one when it is evident from existing context.
83
+
84
+ ## Suggested Fix Order
85
+
86
+ Order fixes so upstream meaning and contradictions are resolved before downstream cleanup.
87
+
88
+ ## Human Decisions Required
89
+
90
+ List decisions that cannot be made by the agent from existing documentation.
@@ -0,0 +1,62 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * @namespace Fl32_Skill_Adsm_Ctx_Bootstrap_Cli
5
+ * @description Parses CLI arguments for the ADSM context lifecycle application.
6
+ */
7
+
8
+ const usage = [
9
+ "Usage: adsm-ctx <command> [target-path]",
10
+ "Commands:",
11
+ " init [target-path]",
12
+ " design [target-path]",
13
+ " validate [target-path]",
14
+ " upgrade [target-path]",
15
+ " install-skill <skills-root>",
16
+ " --help",
17
+ ].join("\n");
18
+
19
+ export default class Cli {
20
+ /**
21
+ * @param {object} deps
22
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} deps.pathService
23
+ */
24
+ constructor({pathService}) {
25
+ /**
26
+ * Parses CLI arguments.
27
+ *
28
+ * @param {object} params
29
+ * @param {string[]} params.cliArgs
30
+ * @param {string} params.projectRoot
31
+ * @returns {{
32
+ * command?: string,
33
+ * errors: string[],
34
+ * helpRequested: boolean,
35
+ * targetPath: string,
36
+ * usage: string
37
+ * }}
38
+ */
39
+ this.parse = function ({cliArgs = [], projectRoot}) {
40
+ const [command, targetArg] = cliArgs;
41
+ const errors = [];
42
+ const helpRequested = !command || command === "--help" || command === "-h";
43
+ const targetPath = targetArg ? pathService.resolve(targetArg) : projectRoot;
44
+
45
+ if (!helpRequested) {
46
+ const supported = new Set(["init", "design", "validate", "upgrade", "install-skill"]);
47
+ if (!supported.has(command)) {
48
+ errors.push(`Unknown command: ${command}`);
49
+ }
50
+ if (command === "install-skill" && !targetArg) {
51
+ errors.push("Usage: adsm-ctx install-skill <skills-root>");
52
+ }
53
+ }
54
+
55
+ return {command, errors, helpRequested, targetPath, usage};
56
+ };
57
+ }
58
+ }
59
+
60
+ export const __deps__ = Object.freeze({
61
+ pathService: "Fl32_Skill_Adsm_Ctx_Shared_Path$",
62
+ });
@@ -0,0 +1,108 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * @namespace Fl32_Skill_Adsm_Ctx_Bootstrap
5
+ * @description TeqFW root CLI application component for ADSM context lifecycle operations.
6
+ */
7
+
8
+ export default class Bootstrap {
9
+ /**
10
+ * @param {object} deps
11
+ * @param {Fl32_Skill_Adsm_Ctx_Bootstrap_Cli} deps.cli
12
+ * @param {Fl32_Skill_Adsm_Ctx_Design_Service} deps.design
13
+ * @param {Fl32_Skill_Adsm_Ctx_Init_Service} deps.init
14
+ * @param {Fl32_Skill_Adsm_Ctx_Skill_Installer} deps.installer
15
+ * @param {Fl32_Skill_Adsm_Ctx_Upgrade_Service} deps.upgrade
16
+ * @param {Fl32_Skill_Adsm_Ctx_Validate_Service} deps.validate
17
+ */
18
+ constructor({cli, design, init, installer, upgrade, validate}) {
19
+ let stopping = false;
20
+
21
+ /**
22
+ * Runs the CLI application once.
23
+ *
24
+ * @param {object} params
25
+ * @param {string[]} params.cliArgs
26
+ * @param {string} params.projectRoot
27
+ * @returns {Promise<number>}
28
+ */
29
+ this.run = async ({cliArgs = [], projectRoot}) => {
30
+ const parsed = cli.parse({cliArgs, projectRoot});
31
+
32
+ if (parsed.helpRequested) {
33
+ process.stderr.write(`${parsed.usage}\n`);
34
+ return 0;
35
+ }
36
+
37
+ if (parsed.errors.length > 0) {
38
+ process.stderr.write(`${parsed.errors.join("\n")}\n`);
39
+ process.stderr.write(`${parsed.usage}\n`);
40
+ return 2;
41
+ }
42
+
43
+ if (parsed.command === "init") {
44
+ const result = await init.execute({targetPath: parsed.targetPath});
45
+ process.stdout.write(`${formatInitReport(result)}\n`);
46
+ return 0;
47
+ }
48
+
49
+ if (parsed.command === "design") {
50
+ process.stdout.write(`${await design.execute({targetPath: parsed.targetPath})}\n`);
51
+ return 0;
52
+ }
53
+
54
+ if (parsed.command === "validate") {
55
+ const result = await validate.execute({targetPath: parsed.targetPath});
56
+ process.stdout.write(`${validate.format({result})}\n`);
57
+ return result.ok ? 0 : 1;
58
+ }
59
+
60
+ if (parsed.command === "upgrade") {
61
+ const result = await upgrade.execute({targetPath: parsed.targetPath});
62
+ process.stdout.write(`${result.message}\n`);
63
+ return result.ok ? 0 : 1;
64
+ }
65
+
66
+ if (parsed.command === "install-skill") {
67
+ const targetDir = await installer.execute({targetRoot: parsed.targetPath});
68
+ process.stdout.write(`Installed skill payload to ${targetDir}\n`);
69
+ return 0;
70
+ }
71
+
72
+ process.stderr.write(`${parsed.usage}\n`);
73
+ return 2;
74
+ };
75
+
76
+ /**
77
+ * Stops the application.
78
+ *
79
+ * @returns {Promise<void>}
80
+ */
81
+ this.stop = async () => {
82
+ if (stopping) return;
83
+ stopping = true;
84
+ };
85
+ }
86
+ }
87
+
88
+ /**
89
+ * @param {{ctxRoot: string, created: string[], skipped: string[]}} result
90
+ * @returns {string}
91
+ */
92
+ function formatInitReport(result) {
93
+ const lines = [
94
+ `Initialized ADSM context in ${result.ctxRoot}`,
95
+ ...result.created.map((entry) => `Created: ${entry}`),
96
+ ...result.skipped.map((entry) => `Skipped: ${entry}`),
97
+ ];
98
+ return lines.join("\n");
99
+ }
100
+
101
+ export const __deps__ = Object.freeze({
102
+ cli: "Fl32_Skill_Adsm_Ctx_Bootstrap_Cli$",
103
+ design: "Fl32_Skill_Adsm_Ctx_Design_Service$",
104
+ init: "Fl32_Skill_Adsm_Ctx_Init_Service$",
105
+ installer: "Fl32_Skill_Adsm_Ctx_Skill_Installer$",
106
+ upgrade: "Fl32_Skill_Adsm_Ctx_Upgrade_Service$",
107
+ validate: "Fl32_Skill_Adsm_Ctx_Validate_Service$",
108
+ });
@@ -0,0 +1,36 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * @namespace Fl32_Skill_Adsm_Ctx_Design_Service
5
+ * @description Provides design guidance for shaping project-specific ADSM context structure.
6
+ */
7
+
8
+ export default class Service {
9
+ constructor() {
10
+ /**
11
+ * Produces design guidance for a target project.
12
+ *
13
+ * @param {object} params
14
+ * @param {string} params.targetPath
15
+ * @returns {Promise<string>}
16
+ */
17
+ this.execute = async function ({targetPath}) {
18
+ return [
19
+ `Design mode for ${targetPath}`,
20
+ "",
21
+ "Use this mode to shape project cognitive context without inventing project-specific facts.",
22
+ "Read `skill/references/design-questionnaire.md` before deciding which specialized ADSM skills may be relevant.",
23
+ "",
24
+ "Recommended agent workflow:",
25
+ "1. Identify the project class from existing repository signals or user input.",
26
+ "2. Keep ADSM's four top-level documentation levels under ctx/docs/: product, architecture, environment, and code.",
27
+ "3. Add only project-specific substructure that is justified by the project; nested directories are allowed.",
28
+ "4. Treat ordinary *.md files as agent-facing operational context documents and add *.skin.<lang>.md files only where human semantic control is needed.",
29
+ "5. Place visual, generated, rendered, or auxiliary artifacts under ctx/assets/ instead of ctx/docs/.",
30
+ "6. Detect whether specialized ADSM skills are needed for browser, backend, data, deployment, or other areas.",
31
+ "7. If a specialized skill is available, use it for that branch after the generic structure is in place.",
32
+ "8. If no specialized skill is available, record the specialization gap and avoid inventing details.",
33
+ ].join("\n");
34
+ };
35
+ }
36
+ }