@flancer32/skill-adsm-ctx 0.4.0 → 0.6.0

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 (72) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +56 -40
  3. package/bin/adsm-ctx.mjs +1 -1
  4. package/package.json +5 -18
  5. package/skills/adsm-ctx/SKILL.md +72 -0
  6. package/{skill → skills/adsm-ctx}/references/agents-hierarchy.md +4 -2
  7. package/skills/adsm-ctx/references/context-evolution.md +59 -0
  8. package/{skill → skills/adsm-ctx}/references/context-lifecycle.md +20 -9
  9. package/{skill → skills/adsm-ctx}/references/design-questionnaire.md +3 -3
  10. package/{skill → skills/adsm-ctx}/references/document-projections.md +12 -10
  11. package/{skill → skills/adsm-ctx}/references/documentation-compression.md +5 -5
  12. package/{skill → skills/adsm-ctx}/references/documentation-quality-audit.md +6 -6
  13. package/{skill → skills/adsm-ctx}/references/orchestration-model.md +8 -6
  14. package/{skill → skills/adsm-ctx}/references/semantic-skins.md +3 -1
  15. package/{skill → skills/adsm-ctx}/references/specialized-skills.md +2 -2
  16. package/skills/adsm-ctx/references/testing-and-verification.md +12 -0
  17. package/skills/adsm-ctx/templates/AGENTS.md +23 -0
  18. package/skills/adsm-ctx/templates/ctx/AGENTS.md +46 -0
  19. package/{skill → skills/adsm-ctx}/templates/ctx/README.md +1 -1
  20. package/{skill → skills/adsm-ctx}/templates/ctx/adsm.json +1 -1
  21. package/skills/adsm-ctx/templates/ctx/agent/AGENTS.md +32 -0
  22. package/skills/adsm-ctx/templates/ctx/docs/AGENTS.md +64 -0
  23. package/{skill → skills/adsm-ctx}/templates/ctx/docs/code/testing.md +3 -1
  24. package/skills/adsm-ctx/templates/ctx/docs/verification/AGENTS.md +31 -0
  25. package/src/Cli/Command/Init.mjs +21 -5
  26. package/src/Cli/Command/InstallSkill.mjs +16 -5
  27. package/src/Cli/Command/Validate.mjs +17 -5
  28. package/src/Init/Service.mjs +26 -47
  29. package/src/Shared/Constants.mjs +4 -1
  30. package/src/Shared/CopyDirectory.mjs +9 -9
  31. package/src/Shared/Metadata.mjs +1 -1
  32. package/src/Skill/Installer.mjs +5 -5
  33. package/src/Validate/Service.mjs +159 -149
  34. package/types.d.ts +31 -4
  35. package/migrations/README.md +0 -13
  36. package/skill/SKILL.md +0 -48
  37. package/skill/references/upgrade-policy.md +0 -29
  38. package/skill/templates/AGENTS.md +0 -120
  39. package/skill/templates/ai/AGENTS.md +0 -59
  40. package/skill/templates/ctx/AGENTS.md +0 -45
  41. package/skill/templates/ctx/agent/AGENTS.md +0 -36
  42. package/skill/templates/ctx/docs/AGENTS.md +0 -58
  43. package/src/Cli/Command/Design.mjs +0 -17
  44. package/src/Cli/Command/Upgrade.mjs +0 -19
  45. package/src/Design/Service.mjs +0 -38
  46. package/src/Upgrade/Service.mjs +0 -44
  47. /package/{skill/templates/work → skills/adsm-ctx/assets}/context/semantic-skin.md +0 -0
  48. /package/{skill/templates/work → skills/adsm-ctx/assets}/report/documentation-compression.md +0 -0
  49. /package/{skill/templates/work → skills/adsm-ctx/assets}/report/documentation-quality-audit.md +0 -0
  50. /package/{skill → skills/adsm-ctx}/templates/ctx/assets/.gitkeep +0 -0
  51. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/ai-intro.md +0 -0
  52. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/AGENTS.md +0 -0
  53. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/behavior.md +0 -0
  54. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/checklists.md +0 -0
  55. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/constraints.md +0 -0
  56. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/decisions.md +0 -0
  57. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/integration.md +0 -0
  58. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/overview.md +0 -0
  59. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/state.md +0 -0
  60. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/structure.md +0 -0
  61. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/supervision.md +0 -0
  62. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/code/AGENTS.md +0 -0
  63. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/code/overview.md +0 -0
  64. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/environment/AGENTS.md +0 -0
  65. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/environment/overview.md +0 -0
  66. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/filesystem.md +0 -0
  67. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/AGENTS.md +0 -0
  68. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/domain.md +0 -0
  69. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/glossary.md +0 -0
  70. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/overview.md +0 -0
  71. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/roles.md +0 -0
  72. /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/use-cases.md +0 -0
@@ -5,29 +5,8 @@
5
5
  * @description Initializes the baseline ADSM context structure in a target project directory.
6
6
  */
7
7
 
8
- const templateRoot = new URL("../../skill/templates/ctx/", import.meta.url);
9
- const rootAgentsTemplate = [
10
- "# Root Level",
11
- "",
12
- "- Path: `AGENTS.md`",
13
- "- Changed: `20260702`",
14
- "",
15
- "## Purpose",
16
- "",
17
- "Marks the repository root and points agents to the project cognitive context in `ctx/`.",
18
- "",
19
- "## Bootstrap Exception",
20
- "",
21
- "- `init` and other bootstrap operations may create the initial `ctx/` structure when it does not exist yet.",
22
- "- This repository uses an ADSM-managed cognitive context.",
23
- "- Use skill `adsm-ctx` for context validation, upgrades, and methodology rules.",
24
- "",
25
- "## Cognitive Context Entry",
26
- "",
27
- "- Read `ctx/AGENTS.md` before modifying project files after the context exists.",
28
- "- Treat `ctx/` as the source of truth for project context after bootstrap is complete.",
29
- "",
30
- ].join("\n");
8
+ const templateRoot = new URL("../../skills/adsm-ctx/templates/ctx/", import.meta.url);
9
+ const rootAgentsTemplate = new URL("../../skills/adsm-ctx/templates/AGENTS.md", import.meta.url);
31
10
 
32
11
  export default class Service {
33
12
  /**
@@ -42,9 +21,9 @@ export default class Service {
42
21
  /**
43
22
  * Creates baseline context structure in the target project.
44
23
  *
45
- * @param {object} params
46
- * @param {string} params.targetPath
47
- * @returns {Promise<{created: string[], ctxRoot: string, projectRoot: string, skipped: string[]}>}
24
+ * @param {object} deps
25
+ * @param {string} deps.targetPath
26
+ * @returns {Promise<Fl32_Skill_Adsm_Ctx_Init_Result>}
48
27
  */
49
28
  this.execute = async function ({targetPath}) {
50
29
  const projectRoot = pathService.resolve(targetPath);
@@ -70,18 +49,18 @@ export default class Service {
70
49
  }
71
50
 
72
51
  /**
73
- * @param {object} params
74
- * @param {string[]} params.created
75
- * @param {typeof import("node:fs")} params.fs
76
- * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} params.pathService
77
- * @param {string} params.projectRoot
78
- * @param {string[]} params.skipped
52
+ * @param {object} deps
53
+ * @param {Array<string>} deps.created
54
+ * @param {typeof import("node:fs")} deps.fs
55
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} deps.pathService
56
+ * @param {string} deps.projectRoot
57
+ * @param {Array<string>} deps.skipped
79
58
  * @returns {void}
80
59
  */
81
60
  function ensureRootAgents({created, fs, pathService, projectRoot, skipped}) {
82
61
  const filePath = pathService.join(projectRoot, "AGENTS.md");
83
62
  if (!fs.existsSync(filePath)) {
84
- fs.writeFileSync(filePath, rootAgentsTemplate);
63
+ fs.writeFileSync(filePath, fs.readFileSync(rootAgentsTemplate, "utf8").replaceAll("YYYYMMDD", new Date().toISOString().slice(0, 10).replaceAll("-", "")));
85
64
  created.push("AGENTS.md");
86
65
  } else {
87
66
  skipped.push("AGENTS.md");
@@ -89,11 +68,11 @@ function ensureRootAgents({created, fs, pathService, projectRoot, skipped}) {
89
68
  }
90
69
 
91
70
  /**
92
- * @param {object} params
93
- * @param {string[]} params.created
94
- * @param {typeof import("node:fs")} params.fs
95
- * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} params.pathService
96
- * @param {string} params.projectRoot
71
+ * @param {object} deps
72
+ * @param {Array<string>} deps.created
73
+ * @param {typeof import("node:fs")} deps.fs
74
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} deps.pathService
75
+ * @param {string} deps.projectRoot
97
76
  * @returns {void}
98
77
  */
99
78
  function stampCreatedMarkdownDates({created, fs, pathService, projectRoot}) {
@@ -108,13 +87,13 @@ function stampCreatedMarkdownDates({created, fs, pathService, projectRoot}) {
108
87
  }
109
88
 
110
89
  /**
111
- * @param {object} params
112
- * @param {string[]} params.created
113
- * @param {typeof import("node:fs")} params.fs
114
- * @param {Fl32_Skill_Adsm_Ctx_Shared_Metadata} params.metadata
115
- * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} params.pathService
116
- * @param {string} params.projectRoot
117
- * @param {string[]} params.skipped
90
+ * @param {object} deps
91
+ * @param {Array<string>} deps.created
92
+ * @param {typeof import("node:fs")} deps.fs
93
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Metadata} deps.metadata
94
+ * @param {Fl32_Skill_Adsm_Ctx_Shared_Path} deps.pathService
95
+ * @param {string} deps.projectRoot
96
+ * @param {Array<string>} deps.skipped
118
97
  * @returns {void}
119
98
  */
120
99
  function writeMetadata({created, fs, metadata, pathService, projectRoot, skipped}) {
@@ -127,10 +106,10 @@ function writeMetadata({created, fs, metadata, pathService, projectRoot, skipped
127
106
  }
128
107
  }
129
108
 
130
- export const __deps__ = Object.freeze({
109
+ export const __deps__ = Object.freeze({default: Object.freeze({
131
110
  copyDirectory: "Fl32_Skill_Adsm_Ctx_Shared_CopyDirectory$",
132
111
  fs: "node:fs",
133
112
  metadata: "Fl32_Skill_Adsm_Ctx_Shared_Metadata$",
134
113
  pathService: "Fl32_Skill_Adsm_Ctx_Shared_Path$",
135
114
  url: "node:url",
136
- });
115
+ })});
@@ -6,9 +6,10 @@
6
6
  */
7
7
 
8
8
  export default class Constants {
9
+ /** Initializes the supported context constants. */
9
10
  constructor() {
10
11
  this.CONTEXT_SCHEMA = "adsm-context";
11
- this.CONTEXT_VERSION = "0.2.0";
12
+ this.CONTEXT_VERSION = "0.6";
12
13
  this.VERIFICATION_CAPABILITY = "verification-layer";
13
14
  this.CONTEXT_CAPABILITIES = Object.freeze([this.VERIFICATION_CAPABILITY]);
14
15
  this.VERIFICATION_BLOCK = "verification";
@@ -23,6 +24,8 @@ export default class Constants {
23
24
  "ctx/docs/architecture",
24
25
  "ctx/docs/environment",
25
26
  "ctx/docs/code",
27
+ "ctx/docs/verification",
28
+ "ctx/docs/verification/AGENTS.md",
26
29
  "ctx/adsm.json",
27
30
  "ctx/AGENTS.md",
28
31
  "ctx/docs/AGENTS.md",
@@ -15,9 +15,9 @@ export default class CopyDirectory {
15
15
  /**
16
16
  * Copies a directory tree recursively.
17
17
  *
18
- * @param {object} params
19
- * @param {string} params.sourcePath
20
- * @param {string} params.targetPath
18
+ * @param {object} deps
19
+ * @param {string} deps.sourcePath
20
+ * @param {string} deps.targetPath
21
21
  * @returns {void}
22
22
  */
23
23
  this.execute = function ({sourcePath, targetPath}) {
@@ -36,12 +36,12 @@ export default class CopyDirectory {
36
36
  /**
37
37
  * Copies only missing directories and files from source to target.
38
38
  *
39
- * @param {object} params
40
- * @param {string[]} params.created
41
- * @param {string} params.pathPrefix
42
- * @param {string[]} params.skipped
43
- * @param {string} params.sourcePath
44
- * @param {string} params.targetPath
39
+ * @param {object} deps
40
+ * @param {Array<string>} deps.created
41
+ * @param {string} deps.pathPrefix
42
+ * @param {Array<string>} deps.skipped
43
+ * @param {string} deps.sourcePath
44
+ * @param {string} deps.targetPath
45
45
  * @returns {void}
46
46
  */
47
47
  this.copyMissing = function ({created, pathPrefix, skipped, sourcePath, targetPath}) {
@@ -14,7 +14,7 @@ export default class Metadata {
14
14
  /**
15
15
  * Creates the baseline metadata object.
16
16
  *
17
- * @returns {{schema: string, version: string}}
17
+ * @returns {Fl32_Skill_Adsm_Ctx_Metadata_Value}
18
18
  */
19
19
  this.create = function () {
20
20
  return {
@@ -5,7 +5,7 @@
5
5
  * @description Installs the bundled skill payload into a target skills directory.
6
6
  */
7
7
 
8
- const sourceRoot = new URL("../../skill/", import.meta.url);
8
+ const sourceRoot = new URL("../../skills/adsm-ctx/", import.meta.url);
9
9
 
10
10
  export default class Installer {
11
11
  /**
@@ -19,8 +19,8 @@ export default class Installer {
19
19
  /**
20
20
  * Installs the skill payload.
21
21
  *
22
- * @param {object} params
23
- * @param {string} params.targetRoot
22
+ * @param {object} deps
23
+ * @param {string} deps.targetRoot
24
24
  * @returns {Promise<string>}
25
25
  */
26
26
  this.execute = async function ({targetRoot}) {
@@ -39,9 +39,9 @@ export default class Installer {
39
39
  }
40
40
  }
41
41
 
42
- export const __deps__ = Object.freeze({
42
+ export const __deps__ = Object.freeze({default: Object.freeze({
43
43
  copyDirectory: "Fl32_Skill_Adsm_Ctx_Shared_CopyDirectory$",
44
44
  fs: "node:fs",
45
45
  pathService: "Fl32_Skill_Adsm_Ctx_Shared_Path$",
46
46
  url: "node:url",
47
- });
47
+ })});