@flancer32/skill-adsm-ctx 0.4.0 → 0.5.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.
- package/CHANGELOG.md +11 -0
- package/README.md +42 -39
- package/bin/adsm-ctx.mjs +1 -1
- package/package.json +4 -18
- package/{skill → skills/adsm-ctx}/SKILL.md +21 -5
- package/{skill → skills/adsm-ctx}/references/agents-hierarchy.md +1 -1
- package/skills/adsm-ctx/references/context-evolution.md +55 -0
- package/{skill → skills/adsm-ctx}/references/context-lifecycle.md +20 -9
- package/{skill → skills/adsm-ctx}/references/design-questionnaire.md +3 -3
- package/{skill → skills/adsm-ctx}/references/document-projections.md +10 -10
- package/{skill → skills/adsm-ctx}/references/documentation-compression.md +5 -5
- package/{skill → skills/adsm-ctx}/references/documentation-quality-audit.md +6 -6
- package/{skill → skills/adsm-ctx}/references/orchestration-model.md +8 -6
- package/{skill → skills/adsm-ctx}/references/semantic-skins.md +3 -1
- package/{skill → skills/adsm-ctx}/references/specialized-skills.md +2 -2
- package/skills/adsm-ctx/templates/AGENTS.md +19 -0
- package/skills/adsm-ctx/templates/ctx/AGENTS.md +46 -0
- package/{skill → skills/adsm-ctx}/templates/ctx/README.md +1 -1
- package/{skill → skills/adsm-ctx}/templates/ctx/adsm.json +1 -1
- package/skills/adsm-ctx/templates/ctx/agent/AGENTS.md +32 -0
- package/skills/adsm-ctx/templates/ctx/docs/AGENTS.md +64 -0
- package/{skill → skills/adsm-ctx}/templates/ctx/docs/code/testing.md +1 -1
- package/skills/adsm-ctx/templates/ctx/docs/verification/AGENTS.md +31 -0
- package/src/Init/Service.mjs +5 -26
- package/src/Shared/Constants.mjs +3 -1
- package/src/Skill/Installer.mjs +3 -3
- package/src/Validate/Service.mjs +73 -18
- package/types.d.ts +0 -4
- package/migrations/README.md +0 -13
- package/skill/references/upgrade-policy.md +0 -29
- package/skill/templates/AGENTS.md +0 -120
- package/skill/templates/ai/AGENTS.md +0 -59
- package/skill/templates/ctx/AGENTS.md +0 -45
- package/skill/templates/ctx/agent/AGENTS.md +0 -36
- package/skill/templates/ctx/docs/AGENTS.md +0 -58
- package/src/Cli/Command/Design.mjs +0 -17
- package/src/Cli/Command/Upgrade.mjs +0 -19
- package/src/Design/Service.mjs +0 -38
- package/src/Upgrade/Service.mjs +0 -44
- /package/{skill/templates/work → skills/adsm-ctx/assets}/context/semantic-skin.md +0 -0
- /package/{skill/templates/work → skills/adsm-ctx/assets}/report/documentation-compression.md +0 -0
- /package/{skill/templates/work → skills/adsm-ctx/assets}/report/documentation-quality-audit.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/assets/.gitkeep +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/ai-intro.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/AGENTS.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/behavior.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/checklists.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/constraints.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/decisions.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/integration.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/overview.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/state.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/structure.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/architecture/supervision.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/code/AGENTS.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/code/overview.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/environment/AGENTS.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/environment/overview.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/filesystem.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/AGENTS.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/domain.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/glossary.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/overview.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/roles.md +0 -0
- /package/{skill → skills/adsm-ctx}/templates/ctx/docs/product/use-cases.md +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Documentation Quality Audit
|
|
2
2
|
|
|
3
|
-
- Path: `
|
|
4
|
-
- Changed: `
|
|
3
|
+
- Path: `skills/adsm-ctx/references/documentation-quality-audit.md`
|
|
4
|
+
- Changed: `20261024`
|
|
5
5
|
|
|
6
6
|
Use this reference when an agent must audit an existing documentation corpus as an ADSM cognitive context.
|
|
7
7
|
|
|
@@ -16,8 +16,8 @@ Audit the documentation corpus of this project against the ADSM documentation qu
|
|
|
16
16
|
Follow this method:
|
|
17
17
|
|
|
18
18
|
1. Read the applicable `AGENTS.md` hierarchy from the repository root to `ctx/docs/`, unless the user explicitly gives another documentation scope.
|
|
19
|
-
2. Read
|
|
20
|
-
3. Identify the audit corpus under `ctx/docs/`, including nested documentation under `product/`, `architecture/`, `environment/`, and `
|
|
19
|
+
2. Read [document-projections.md](document-projections.md) from this installed skill for agent/skin classification and projection drift rules.
|
|
20
|
+
3. Identify the audit corpus under `ctx/docs/`, including nested documentation under `product/`, `architecture/`, `environment/`, `code/`, and the mandatory cross-cutting `verification/` boundary.
|
|
21
21
|
4. Classify ordinary `*.md` files as agent-facing operational context documents, `*.skin.<lang>.md` files as human-facing semantic skins, and `AGENTS.md` files as local agent routing instructions.
|
|
22
22
|
5. Build a compact documentation map that shows source-of-truth agent documents, refinement relationships, agent/skin pairs, orphan skins, projection drift, and duplicated responsibility areas.
|
|
23
23
|
6. Evaluate the corpus against the eight ADSM documentation quality criteria and the projection-specific checks below after deterministic validation is clean or warning-only.
|
|
@@ -25,7 +25,7 @@ Follow this method:
|
|
|
25
25
|
8. Report only evidence-backed findings, with file references and the violated criterion.
|
|
26
26
|
9. Separate findings that can be fixed editorially from findings that require cross-document synchronization, upstream documentation changes, projection-drift resolution, or human decisions.
|
|
27
27
|
10. Do not invent missing product facts, architecture boundaries, authority rules, workflow semantics, or implementation behavior.
|
|
28
|
-
11. Use
|
|
28
|
+
11. Use [the audit report template](../assets/report/documentation-quality-audit.md) as the report structure when a file report is requested.
|
|
29
29
|
|
|
30
30
|
## Corpus Selection
|
|
31
31
|
|
|
@@ -208,7 +208,7 @@ The audit may propose correction order and candidate edits, but it must distingu
|
|
|
208
208
|
|
|
209
209
|
## Verification Layer Review
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
Include mandatory `ctx/docs/verification/` in the default corpus; an AGENTS-only root contains no specifications to audit. Review it as cross-cutting specification documentation, not a fifth declarative level and not an evidence or incident archive.
|
|
212
212
|
|
|
213
213
|
Check whether each durable specification:
|
|
214
214
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Orchestration Model
|
|
2
2
|
|
|
3
|
-
- Path: `
|
|
4
|
-
- Changed: `
|
|
3
|
+
- Path: `skills/adsm-ctx/references/orchestration-model.md`
|
|
4
|
+
- Changed: `20261024`
|
|
5
5
|
|
|
6
6
|
This skill is a router and baseline manager.
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ It is responsible for:
|
|
|
11
11
|
- the agent/skin documentation projection model;
|
|
12
12
|
- lifecycle guidance;
|
|
13
13
|
- baseline validation;
|
|
14
|
-
-
|
|
14
|
+
- agent-driven evolution guidance and read-only Deterministic CLI checks;
|
|
15
15
|
- Verification Layer documentation lifecycle support and structural validation;
|
|
16
16
|
- the reserved boundary definition for `ctx/agent/`.
|
|
17
17
|
|
|
@@ -20,9 +20,11 @@ It is not responsible for inventing specialized technical or domain documentatio
|
|
|
20
20
|
For `ctx/agent/`, this skill may:
|
|
21
21
|
|
|
22
22
|
- install only `ctx/agent/AGENTS.md` as the boundary file;
|
|
23
|
-
-
|
|
23
|
+
- explain that this branch is part of project cognitive context while its project-specific workflows are outside the reusable ADSM baseline;
|
|
24
24
|
- preserve project-local materials that humans or agents maintain there for concrete tools or relationships.
|
|
25
25
|
|
|
26
|
+
Operational materials organize authorized work within accepted declarations in `ctx/docs/` and applicable supervision constraints. They do not independently establish product or architecture authority or override human approval and escalation requirements. Preserve existing local materials and maintain navigation against the actual filesystem; add structure only for concrete project needs.
|
|
27
|
+
|
|
26
28
|
For `ctx/agent/`, this skill must not:
|
|
27
29
|
|
|
28
30
|
- define or require a template-managed subdirectory structure;
|
|
@@ -33,10 +35,10 @@ When specialization is needed, the agent should use a matching available skill a
|
|
|
33
35
|
|
|
34
36
|
Concrete tool-facing materials belong to project-local documentation, explicit human instruction, or an external specialized skill when one is available and relevant.
|
|
35
37
|
|
|
36
|
-
Specialized skills may add project-specific nested documentation under the four declarative `ctx/docs` levels and may implement concrete verification methods or project-local feedback procedures. They must preserve agent/skin pairing rules, keep artifacts under `ctx/assets/**`, and treat `verification/` as
|
|
38
|
+
Specialized skills may add project-specific nested documentation under the four declarative `ctx/docs` levels and may implement concrete verification methods or project-local feedback procedures. They must preserve agent/skin pairing rules, keep artifacts under `ctx/assets/**`, and treat `verification/` as mandatory cross-cutting documentation rather than a fifth level.
|
|
37
39
|
|
|
38
40
|
## Template Boundary
|
|
39
41
|
|
|
40
42
|
`templates/ctx/` is the reusable initialization baseline. It may establish generic structure, starter documents, and the `ctx/agent/AGENTS.md` boundary, but it must not add project-specific facts or detailed ADSM methodology to project-facing documents.
|
|
41
43
|
|
|
42
|
-
Keep only the minimal bootstrap signal needed to identify an ADSM context and route methodology work to this skill. Use `
|
|
44
|
+
Keep only the minimal bootstrap signal needed to identify an ADSM context and route methodology work to this skill. Use `assets/` only as working material for agent operations; do not install those reports or optional semantic-skin patterns into project context by default.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Semantic Skins
|
|
2
2
|
|
|
3
|
-
- Path: `
|
|
3
|
+
- Path: `skills/adsm-ctx/references/semantic-skins.md`
|
|
4
4
|
- Changed: `20260814`
|
|
5
5
|
|
|
6
6
|
A semantic skin is a compact skeletal human projection of its paired agent document.
|
|
@@ -63,3 +63,5 @@ When creating or reviewing a skin, verify that it:
|
|
|
63
63
|
- adds no untracked facts or requirements and does not contradict its base;
|
|
64
64
|
- excludes operational detail and redundant navigation; and
|
|
65
65
|
- remains compact enough for human cognitive use.
|
|
66
|
+
|
|
67
|
+
Use the [semantic-skin asset](../assets/context/semantic-skin.md) as an optional authoring pattern for authorized work. It is not an initialization template and does not determine the output location; place the resulting skin beside its paired project document.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Specialized Skills
|
|
2
2
|
|
|
3
|
-
- Path: `
|
|
3
|
+
- Path: `skills/adsm-ctx/references/specialized-skills.md`
|
|
4
4
|
- Changed: `20260917`
|
|
5
5
|
|
|
6
6
|
Use specialized skills when the project context requires knowledge that should not live in this generic lifecycle skill.
|
|
@@ -30,5 +30,5 @@ Specialized skills must preserve ADSM's documentation projection model:
|
|
|
30
30
|
- ordinary `*.md` files under `ctx/docs/**` are agent-facing operational context documents;
|
|
31
31
|
- `*.skin.<lang>.md` files are human-facing semantic skins for matching agent documents;
|
|
32
32
|
- nested subdirectories inside the four declarative documentation levels are allowed;
|
|
33
|
-
-
|
|
33
|
+
- the mandatory `ctx/docs/verification/` boundary remains cross-cutting; specifications use a primary declaration target rather than the mechanism or specialized skill that obtains evidence;
|
|
34
34
|
- visual, generated, rendered, and auxiliary artifacts belong under `ctx/assets/**`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Root Level
|
|
2
|
+
|
|
3
|
+
- Path: `AGENTS.md`
|
|
4
|
+
- Template Version: `20261024`
|
|
5
|
+
- Changed: `YYYYMMDD`
|
|
6
|
+
|
|
7
|
+
## Boundary
|
|
8
|
+
|
|
9
|
+
This file controls repository work. `ctx/` owns project meaning and is authoritative for product and implementation decisions; consult `ctx/AGENTS.md` and task-relevant context for design or code changes. If implementation conflicts with accepted context, follow the context and report any proposed change to accepted meaning for human approval rather than silently rewriting it. Read navigation documents only when needed and avoid rereading unchanged instructions within a session. Use the `adsm-ctx` skill when available for context lifecycle work.
|
|
10
|
+
|
|
11
|
+
`ctx/` may be part of this repository or a separately mounted repository. Detect its Git boundary before editing, preserve separate histories, and never remove, replace, relocate, or unmount it. If absent, create `ctx/` only when bootstrap is within the assigned scope. Deeper `AGENTS.md` files refine local rules without overriding root invariants.
|
|
12
|
+
|
|
13
|
+
A task may cover multiple repositories. Coordinate affected contracts and consumers, verify their integration, and keep each Git history separate. Do not expand into unrelated repositories. The human defines scope and approves changes to accepted meaning.
|
|
14
|
+
|
|
15
|
+
## Efficient Execution
|
|
16
|
+
|
|
17
|
+
Classify the task before reading context or running checks. Git-only work needs Git-state checks, not product-context scans or tests. For code or context changes, inspect only relevant owners; run deterministic checks chosen by changed responsibility and risk. Capture verbose output outside the model context and inspect logs on failure or when evidence is needed. Report results, omitted coverage, and material risks concisely.
|
|
18
|
+
|
|
19
|
+
Do not modify, replace, delete, or relocate this file without explicit human instruction. Do not read, search, or expose secret-bearing files or credentials; non-secret examples may describe configuration shape. If a secret is accidentally exposed, do not repeat it; notify the human that it should be rotated or revoked.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Cognitive Context
|
|
2
|
+
|
|
3
|
+
- Path: `ctx/AGENTS.md`
|
|
4
|
+
- Template Version: `20261024`
|
|
5
|
+
- Changed: `YYYYMMDD`
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
This directory contains the project's cognitive context.
|
|
10
|
+
|
|
11
|
+
`docs/` holds authoritative project definitions, `agent/` holds project-local agent operations, and `assets/` holds non-authoritative supporting materials.
|
|
12
|
+
|
|
13
|
+
Keep generic ADSM methodology outside the project context.
|
|
14
|
+
|
|
15
|
+
## Level Map
|
|
16
|
+
|
|
17
|
+
- `agent/` — project-local agent and tool materials.
|
|
18
|
+
- `assets/` — visual, generated, and auxiliary documentation assets.
|
|
19
|
+
- `docs/` — authoritative project documentation and constraints.
|
|
20
|
+
- `AGENTS.md` — context boundary and navigation rules.
|
|
21
|
+
- `README.md` — introductory context information.
|
|
22
|
+
- `adsm.json` — context metadata and versioning.
|
|
23
|
+
|
|
24
|
+
## Level Boundary
|
|
25
|
+
|
|
26
|
+
Defines:
|
|
27
|
+
|
|
28
|
+
- The boundary of the project's cognitive context.
|
|
29
|
+
- Separation of authoritative documentation, agent operations, and supporting assets.
|
|
30
|
+
- Navigation to the appropriate context branch.
|
|
31
|
+
|
|
32
|
+
Does NOT define:
|
|
33
|
+
|
|
34
|
+
- Product, architecture, environment, or code meaning; these belong under `docs/`.
|
|
35
|
+
- Project-local agent workflows; these belong under `agent/`.
|
|
36
|
+
- Generic ADSM methodology; use the `adsm-ctx` skill when available.
|
|
37
|
+
|
|
38
|
+
## Local Reading Map
|
|
39
|
+
|
|
40
|
+
- For initial project orientation, read `docs/ai-intro.md` when needed.
|
|
41
|
+
- For repository topology, consult `docs/filesystem.md`.
|
|
42
|
+
- For product, architecture, environment, or code work, follow `docs/AGENTS.md` and read only task-relevant documentation.
|
|
43
|
+
- For project-local agent operations, follow `agent/AGENTS.md`.
|
|
44
|
+
- For context lifecycle work, use the `adsm-ctx` skill when available.
|
|
45
|
+
|
|
46
|
+
Read `README.md` only when additional orientation is needed. Avoid rereading unchanged context within a session.
|
|
@@ -15,7 +15,7 @@ Detailed ADSM validation and methodology rules are intentionally kept out of thi
|
|
|
15
15
|
## Entry Points
|
|
16
16
|
|
|
17
17
|
- Read `AGENTS.md` for cognitive-context structure and governance rules.
|
|
18
|
-
- Use skill `adsm-ctx` when you need ADSM validation,
|
|
18
|
+
- Use skill `adsm-ctx` when you need ADSM validation, evolution, or methodology guidance.
|
|
19
19
|
- Read `docs/filesystem.md` for the top-level repository map.
|
|
20
20
|
- Read `docs/` for declarative project documentation.
|
|
21
21
|
- Read `agent/` only when working with repository-local agent operations or workflow assets.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Agent Operations
|
|
2
|
+
|
|
3
|
+
- Path: `ctx/agent/AGENTS.md`
|
|
4
|
+
- Template Version: `20261024`
|
|
5
|
+
- Changed: `YYYYMMDD`
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
This branch holds project-specific operational materials used by agents and their tools, such as instructions, prompts, workflow definitions, reports, or tool documentation. These are optional examples, not required document types or directories.
|
|
10
|
+
|
|
11
|
+
## Level Map
|
|
12
|
+
|
|
13
|
+
- `AGENTS.md` — agent operations boundary and local navigation.
|
|
14
|
+
|
|
15
|
+
## Level Boundary
|
|
16
|
+
|
|
17
|
+
Defines:
|
|
18
|
+
|
|
19
|
+
- The project-local home for organizing and performing authorized agent work.
|
|
20
|
+
- A project-specific structure beneath this branch; only this file belongs to the reusable initialization baseline.
|
|
21
|
+
|
|
22
|
+
Does NOT define:
|
|
23
|
+
|
|
24
|
+
- Authoritative product, architecture, environment, or code declarations; these belong under `ctx/docs/`.
|
|
25
|
+
- A standard workflow, tool choice, agent role, or required operational subdirectory.
|
|
26
|
+
|
|
27
|
+
## Working Rules
|
|
28
|
+
|
|
29
|
+
- Follow the applicable `AGENTS.md` hierarchy and task-relevant materials listed in the Level Map before acting.
|
|
30
|
+
- Keep operational instructions consistent with accepted declarations in `ctx/docs/` and applicable supervision constraints. They cannot grant authority to change accepted meaning or bypass approval and escalation requirements; surface conflicts to the human.
|
|
31
|
+
- Preserve existing project-specific materials. Add materials only for concrete project needs, without speculative directory scaffolding.
|
|
32
|
+
- Keep the Level Map synchronized with the actual filesystem, listing directories first and sorting each group alphabetically. Follow local instructions in the relevant subdirectory.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Project Documentation
|
|
2
|
+
|
|
3
|
+
- Path: `ctx/docs/AGENTS.md`
|
|
4
|
+
- Template Version: `20261024`
|
|
5
|
+
- Changed: `YYYYMMDD`
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
This directory contains authoritative project declarations and navigation documents.
|
|
10
|
+
|
|
11
|
+
ADSM defines four ordered declarative levels: product → architecture → environment → code. Lower levels refine upstream meaning without redefining it. Accepted declarations constrain every valid implementation.
|
|
12
|
+
|
|
13
|
+
A mandatory cross-cutting Verification Layer relates declarations to bounded observations of reality. It is not a fifth declarative level and does not establish independent authority over project meaning.
|
|
14
|
+
|
|
15
|
+
## Level Map
|
|
16
|
+
|
|
17
|
+
- `architecture/` — system structure, behavior, state ownership, and integration boundaries.
|
|
18
|
+
- `code/` — implementation constraints and engineering conventions.
|
|
19
|
+
- `environment/` — runtime conditions, infrastructure, and deployment constraints.
|
|
20
|
+
- `product/` — product meaning, domain, roles, and expected outcomes.
|
|
21
|
+
- `verification/` — durable verification specifications; cross-cutting, outside the authority chain.
|
|
22
|
+
- `AGENTS.md` — documentation boundary and working rules.
|
|
23
|
+
- `ai-intro.md` — initial project orientation for agents.
|
|
24
|
+
- `filesystem.md` — top-level repository navigation.
|
|
25
|
+
|
|
26
|
+
Keep this map aligned with the actual project structure. Add optional branches only when adopted.
|
|
27
|
+
|
|
28
|
+
## Level Boundary
|
|
29
|
+
|
|
30
|
+
Defines:
|
|
31
|
+
|
|
32
|
+
- Accepted project declarations and their dependency order.
|
|
33
|
+
- Rules for reading, refining, and maintaining declarative knowledge.
|
|
34
|
+
- Boundaries between declarations, verification specifications, and supporting materials.
|
|
35
|
+
|
|
36
|
+
Does NOT define:
|
|
37
|
+
|
|
38
|
+
- Agent operations and workflows under `ctx/agent/`.
|
|
39
|
+
- Executable product artifacts, runtime state, or operational evidence.
|
|
40
|
+
- Generic ADSM methodology; use the `adsm-ctx` skill when available.
|
|
41
|
+
|
|
42
|
+
## Local Reading Map
|
|
43
|
+
|
|
44
|
+
- For unfamiliar projects, consult `ai-intro.md`.
|
|
45
|
+
- For repository topology, consult `filesystem.md` when needed.
|
|
46
|
+
- For project declarations, follow the relevant level's `AGENTS.md` and read its task-relevant documents.
|
|
47
|
+
- For lower-level changes, consult the upstream declarations needed to establish their meaning and constraints.
|
|
48
|
+
- For Verification Layer work, follow `verification/AGENTS.md`.
|
|
49
|
+
- For context lifecycle, validation, audit, compression, or evolution, use the `adsm-ctx` skill when available.
|
|
50
|
+
|
|
51
|
+
Avoid unnecessary full-context scans and repeated reading of unchanged documents.
|
|
52
|
+
|
|
53
|
+
## Documentation Rules
|
|
54
|
+
|
|
55
|
+
- Preserve the authority order: product → architecture → environment → code. Report missing or conflicting upstream meaning rather than inventing or silently changing it downstream.
|
|
56
|
+
- Keep each durable declaration in its appropriate authoritative document. Preserve consistency across dependent levels.
|
|
57
|
+
- Ordinary `*.md` documents are agent-facing and written in English by default. Optional `*.skin.<lang>.md` files provide human-facing semantic projections.
|
|
58
|
+
- Before editing an agent document, read all matching skins. Preserve their meaning and invariants; report projection drift or required human decisions instead of silently resolving conflicts.
|
|
59
|
+
- Keep documents explicit, focused, and maintainable. Preserve meaningful nested structure and do not sacrifice requirements or precision for brevity.
|
|
60
|
+
- Keep each declarative level within nine direct directories and nine direct ordinary files where practical, excluding `AGENTS.md` and matching skins. Record intentional excess under `## Documentation Capacity Exception` in that level's `AGENTS.md`.
|
|
61
|
+
- Require `verification/AGENTS.md`; the root may contain only this file. Create primary-target categories only for actual durable specifications.
|
|
62
|
+
- Place verification specifications under their primary declarative targets and link secondary declarations. Keep specifications distinct from actual evidence and operational feedback state. Neither evidence nor assessments may redefine accepted meaning.
|
|
63
|
+
- Keep visual, generated, rendered, and auxiliary artifacts under `ctx/assets/**`; they must not introduce authoritative project meaning.
|
|
64
|
+
- Maintain `Path` and `Changed` attributes in stable documents. Delegate detailed methodology and lifecycle procedures to the `adsm-ctx` skill.
|
|
@@ -14,4 +14,4 @@ List the main test layers, directories, and intended verification scope.
|
|
|
14
14
|
|
|
15
15
|
## Verification Target Boundary
|
|
16
16
|
|
|
17
|
-
Keep executable test organization, framework conventions, fixtures, and isolation in this code-level document. When a project
|
|
17
|
+
Keep executable test organization, framework conventions, fixtures, and isolation in this code-level document. When a project adds a durable specification under the mandatory `ctx/docs/verification/` boundary, that specification states the observed declared expectation and primary target; the executable mechanism remains governed here.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Verification Layer
|
|
2
|
+
|
|
3
|
+
- Path: `ctx/docs/verification/AGENTS.md`
|
|
4
|
+
- Changed: `20261024`
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
This mandatory cross-cutting boundary holds durable verification specifications. It is not a fifth declarative authority level. Product → architecture → environment → code remains the ordered hierarchy; humans control accepted meaning.
|
|
9
|
+
|
|
10
|
+
## Level Map
|
|
11
|
+
|
|
12
|
+
- `AGENTS.md` — verification boundary and local routing.
|
|
13
|
+
|
|
14
|
+
## Navigation And Editing
|
|
15
|
+
|
|
16
|
+
The root may contain only `AGENTS.md` when no specifications exist. Create `product/`, `architecture/`, `environment/`, or `code/` only when an actual durable specification belongs there. Route each specification by its primary declarative target, linking secondary targets rather than duplicating it. Preserve useful project-specific nesting and add local routing instructions as needed.
|
|
17
|
+
|
|
18
|
+
Read applicable declarations and matching semantic skins before editing. Preserve traceability, applicability, interpretation bounds, and blind spots. Escalate conflicting accepted meaning to the human.
|
|
19
|
+
|
|
20
|
+
## Level Boundary
|
|
21
|
+
|
|
22
|
+
Defines:
|
|
23
|
+
|
|
24
|
+
- The home and primary-target routing of durable verification specifications.
|
|
25
|
+
- Specification applicability, traceability, and interpretation limits.
|
|
26
|
+
|
|
27
|
+
Does NOT define:
|
|
28
|
+
|
|
29
|
+
- A fifth declarative authority level or changes to accepted declarations.
|
|
30
|
+
- Actual observations, evidence records, or operational feedback state; keep these outside this boundary.
|
|
31
|
+
- Verification coverage or runtime correctness merely from structural conformance.
|
package/src/Init/Service.mjs
CHANGED
|
@@ -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("../../
|
|
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
|
/**
|
|
@@ -81,7 +60,7 @@ export default class Service {
|
|
|
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");
|
|
@@ -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
|
+
})});
|
package/src/Shared/Constants.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export default class Constants {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.CONTEXT_SCHEMA = "adsm-context";
|
|
11
|
-
this.CONTEXT_VERSION = "0.
|
|
11
|
+
this.CONTEXT_VERSION = "0.5.0";
|
|
12
12
|
this.VERIFICATION_CAPABILITY = "verification-layer";
|
|
13
13
|
this.CONTEXT_CAPABILITIES = Object.freeze([this.VERIFICATION_CAPABILITY]);
|
|
14
14
|
this.VERIFICATION_BLOCK = "verification";
|
|
@@ -23,6 +23,8 @@ export default class Constants {
|
|
|
23
23
|
"ctx/docs/architecture",
|
|
24
24
|
"ctx/docs/environment",
|
|
25
25
|
"ctx/docs/code",
|
|
26
|
+
"ctx/docs/verification",
|
|
27
|
+
"ctx/docs/verification/AGENTS.md",
|
|
26
28
|
"ctx/adsm.json",
|
|
27
29
|
"ctx/AGENTS.md",
|
|
28
30
|
"ctx/docs/AGENTS.md",
|
package/src/Skill/Installer.mjs
CHANGED
|
@@ -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("../../
|
|
8
|
+
const sourceRoot = new URL("../../skills/adsm-ctx/", import.meta.url);
|
|
9
9
|
|
|
10
10
|
export default class Installer {
|
|
11
11
|
/**
|
|
@@ -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
|
+
})});
|
package/src/Validate/Service.mjs
CHANGED
|
@@ -59,11 +59,22 @@ export default class Validate {
|
|
|
59
59
|
const projection = inspectProjection({
|
|
60
60
|
constants,
|
|
61
61
|
fs,
|
|
62
|
-
metadata: metadataResult.metadata,
|
|
62
|
+
metadata: metadataResult.ok ? metadataResult.metadata : null,
|
|
63
63
|
pathService,
|
|
64
64
|
projectRoot,
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
for (const entry of constants.REQUIRED_PATHS) {
|
|
68
|
+
const absolute = pathService.join(projectRoot, entry);
|
|
69
|
+
if (!fs.existsSync(absolute) || typeof fs.statSync !== "function") continue;
|
|
70
|
+
const stat = fs.statSync(absolute);
|
|
71
|
+
const file = entry.endsWith(".md") || entry.endsWith(".json");
|
|
72
|
+
if (file ? !stat.isFile() : !stat.isDirectory()) findings.push(createFinding({
|
|
73
|
+
message: `Required path has wrong filesystem type: ${entry}`,
|
|
74
|
+
path: entry, ruleId: "required-path-type", severity: "error",
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
findings.push(...inspectAgentsHierarchy({fs, pathService, projectRoot}));
|
|
67
78
|
findings.push(...metadataResult.findings);
|
|
68
79
|
findings.push(...projection.findings);
|
|
69
80
|
|
|
@@ -73,7 +84,7 @@ export default class Validate {
|
|
|
73
84
|
return {
|
|
74
85
|
errorCount,
|
|
75
86
|
findings,
|
|
76
|
-
metadata: metadataResult.
|
|
87
|
+
metadata: metadataResult.metadata,
|
|
77
88
|
missingPaths,
|
|
78
89
|
ok: errorCount === 0,
|
|
79
90
|
projectRoot,
|
|
@@ -111,7 +122,8 @@ export default class Validate {
|
|
|
111
122
|
const lines = [
|
|
112
123
|
status,
|
|
113
124
|
`Project root: ${result.projectRoot}`,
|
|
114
|
-
`Context version: ${result.metadata?.version ?? "unknown"}`,
|
|
125
|
+
`Context schema version: ${result.metadata?.version ?? "unknown"}`,
|
|
126
|
+
`Supported context schema version: ${constants.CONTEXT_VERSION}`,
|
|
115
127
|
`Errors: ${result.errorCount}`,
|
|
116
128
|
`Warnings: ${result.warningCount}`,
|
|
117
129
|
];
|
|
@@ -209,9 +221,11 @@ function readMetadata({constants, fs, pathService, projectRoot}) {
|
|
|
209
221
|
severity: "error",
|
|
210
222
|
}));
|
|
211
223
|
}
|
|
212
|
-
if (
|
|
224
|
+
if (parsed.version !== constants.CONTEXT_VERSION) {
|
|
213
225
|
findings.push(createFinding({
|
|
214
|
-
message: "
|
|
226
|
+
message: ["0.1.0", "0.2.0", "0.3.0"].includes(parsed.version)
|
|
227
|
+
? `Legacy schema ${parsed.version}; use skill adsm-ctx for agent-driven context evolution. Target schema: ${constants.CONTEXT_VERSION}.`
|
|
228
|
+
: `Unsupported metadata version: ${parsed.version}; investigate with skill adsm-ctx before changing schema metadata.`,
|
|
215
229
|
path: "ctx/adsm.json",
|
|
216
230
|
ruleId: "metadata-version",
|
|
217
231
|
severity: "error",
|
|
@@ -252,7 +266,7 @@ function readMetadata({constants, fs, pathService, projectRoot}) {
|
|
|
252
266
|
}
|
|
253
267
|
|
|
254
268
|
const ok = findings.every((entry) => entry.severity !== "error");
|
|
255
|
-
return {findings, metadata:
|
|
269
|
+
return {findings, metadata: parsed, ok};
|
|
256
270
|
} catch (error) {
|
|
257
271
|
findings.push(createFinding({
|
|
258
272
|
message: `Invalid metadata JSON: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
@@ -424,7 +438,7 @@ function inspectProjection({constants, fs, metadata, pathService, projectRoot})
|
|
|
424
438
|
}
|
|
425
439
|
|
|
426
440
|
/**
|
|
427
|
-
* Inspects
|
|
441
|
+
* Inspects the cross-cutting Verification Layer without treating it as a fifth
|
|
428
442
|
* declarative documentation level.
|
|
429
443
|
*
|
|
430
444
|
* @param {object} params
|
|
@@ -529,15 +543,6 @@ function inspectVerificationBlock({constants, docsEntryMap, fs, pathService, pro
|
|
|
529
543
|
}
|
|
530
544
|
}
|
|
531
545
|
|
|
532
|
-
if (summary.categories.length === 0) {
|
|
533
|
-
findings.push(createFinding({
|
|
534
|
-
message: `Verification block has no populated primary-target category: ${verificationPath}`,
|
|
535
|
-
path: verificationPath,
|
|
536
|
-
ruleId: "verification-empty-block",
|
|
537
|
-
severity: "error",
|
|
538
|
-
}));
|
|
539
|
-
}
|
|
540
|
-
|
|
541
546
|
return {findings, summary};
|
|
542
547
|
}
|
|
543
548
|
|
|
@@ -830,8 +835,58 @@ function normalizeRelativeSegments(parts) {
|
|
|
830
835
|
return result;
|
|
831
836
|
}
|
|
832
837
|
|
|
833
|
-
export const __deps__ = Object.freeze({
|
|
838
|
+
export const __deps__ = Object.freeze({default: Object.freeze({
|
|
834
839
|
constants: "Fl32_Skill_Adsm_Ctx_Shared_Constants$",
|
|
835
840
|
fs: "node:fs",
|
|
836
841
|
pathService: "Fl32_Skill_Adsm_Ctx_Shared_Path$",
|
|
837
|
-
});
|
|
842
|
+
})});
|
|
843
|
+
|
|
844
|
+
/** Checks context-side routing sections; root repository instructions have a separate shape. */
|
|
845
|
+
function inspectAgentsHierarchy({fs, pathService, projectRoot}) {
|
|
846
|
+
const findings = [];
|
|
847
|
+
const root = pathService.join(projectRoot, "ctx");
|
|
848
|
+
if (!fs.existsSync(root)) return findings;
|
|
849
|
+
const visit = (directory, relative) => {
|
|
850
|
+
let entries;
|
|
851
|
+
try { entries = listEntries({fs, root: directory}); }
|
|
852
|
+
catch (error) {
|
|
853
|
+
findings.push(createFinding({message: `Cannot inspect context routing: ${error.message}`, path: relative, ruleId: "agents-readable", severity: "error"}));
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
for (const entry of entries) {
|
|
857
|
+
const absolute = pathService.join(directory, entry.name);
|
|
858
|
+
const file = `${relative}/${entry.name}`;
|
|
859
|
+
if (entry.isDirectory()) visit(absolute, file);
|
|
860
|
+
else if (entry.isFile() && entry.name === "AGENTS.md") {
|
|
861
|
+
let text;
|
|
862
|
+
try { text = fs.readFileSync(absolute, "utf8"); }
|
|
863
|
+
catch (error) {
|
|
864
|
+
findings.push(createFinding({message: `Cannot read context AGENTS.md: ${error.message}`, path: file, ruleId: "agents-readable", severity: "error"}));
|
|
865
|
+
continue;
|
|
866
|
+
}
|
|
867
|
+
// Ignore fenced examples so sample headings cannot satisfy the document structure.
|
|
868
|
+
const headings = new Set();
|
|
869
|
+
let fence = null;
|
|
870
|
+
for (const line of text.split(/\r?\n/)) {
|
|
871
|
+
const marker = /^ {0,3}(`{3,}|~{3,})/.exec(line);
|
|
872
|
+
if (marker) {
|
|
873
|
+
if (!fence) fence = marker[1];
|
|
874
|
+
else if (marker[1][0] === fence[0] && marker[1].length >= fence.length) fence = null;
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
if (fence) continue;
|
|
878
|
+
const heading = /^ {0,3}##[ \t]+(.+?)[ \t]*$/.exec(line);
|
|
879
|
+
if (heading) headings.add(heading[1].replace(/[ \t]+#+[ \t]*$/, ""));
|
|
880
|
+
}
|
|
881
|
+
for (const section of ["Purpose", "Level Map", "Level Boundary"]) {
|
|
882
|
+
if (!headings.has(section)) findings.push(createFinding({
|
|
883
|
+
message: `Missing required section: ## ${section}. Add it to this context-side AGENTS.md.`,
|
|
884
|
+
path: file, ruleId: "agents-required-section", severity: "error",
|
|
885
|
+
}));
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
visit(root, "ctx");
|
|
891
|
+
return findings;
|
|
892
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
declare global {
|
|
2
|
-
type Fl32_Skill_Adsm_Ctx_Cli_Command_Design = import("./src/Cli/Command/Design.mjs").default;
|
|
3
2
|
type Fl32_Skill_Adsm_Ctx_Cli_Command_Init = import("./src/Cli/Command/Init.mjs").default;
|
|
4
3
|
type Fl32_Skill_Adsm_Ctx_Cli_Command_InstallSkill = import("./src/Cli/Command/InstallSkill.mjs").default;
|
|
5
|
-
type Fl32_Skill_Adsm_Ctx_Cli_Command_Upgrade = import("./src/Cli/Command/Upgrade.mjs").default;
|
|
6
4
|
type Fl32_Skill_Adsm_Ctx_Cli_Command_Validate = import("./src/Cli/Command/Validate.mjs").default;
|
|
7
|
-
type Fl32_Skill_Adsm_Ctx_Design_Service = import("./src/Design/Service.mjs").default;
|
|
8
5
|
type Fl32_Skill_Adsm_Ctx_Init_Service = import("./src/Init/Service.mjs").default;
|
|
9
6
|
type Fl32_Skill_Adsm_Ctx_Shared_Constants = import("./src/Shared/Constants.mjs").default;
|
|
10
7
|
type Fl32_Skill_Adsm_Ctx_Shared_CopyDirectory = import("./src/Shared/CopyDirectory.mjs").default;
|
|
11
8
|
type Fl32_Skill_Adsm_Ctx_Shared_Metadata = import("./src/Shared/Metadata.mjs").default;
|
|
12
9
|
type Fl32_Skill_Adsm_Ctx_Shared_Path = import("./src/Shared/Path.mjs").default;
|
|
13
10
|
type Fl32_Skill_Adsm_Ctx_Skill_Installer = import("./src/Skill/Installer.mjs").default;
|
|
14
|
-
type Fl32_Skill_Adsm_Ctx_Upgrade_Service = import("./src/Upgrade/Service.mjs").default;
|
|
15
11
|
type Fl32_Skill_Adsm_Ctx_Validate_Service = import("./src/Validate/Service.mjs").default;
|
|
16
12
|
}
|
|
17
13
|
|
package/migrations/README.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Migrations
|
|
2
|
-
|
|
3
|
-
This directory is reserved for explicit context migrations. The `verification-layer` convention is capability-based and optional: it does not require a migration, `ctx/docs/verification/`, empty categories, or placeholder specifications. `adsm-ctx upgrade` therefore preserves existing contexts and reports that no automatic migrations are available.
|
|
4
|
-
|
|
5
|
-
Each migration should be:
|
|
6
|
-
|
|
7
|
-
- versioned;
|
|
8
|
-
- non-destructive by default;
|
|
9
|
-
- explicit about prerequisites and post-upgrade manual steps.
|
|
10
|
-
|
|
11
|
-
## Verification Layer Compatibility
|
|
12
|
-
|
|
13
|
-
Contexts without `capabilities`, with context version `0.1.0`, or without `ctx/docs/verification/` remain valid. A project may add a structurally complete Verification Layer when it has a durable specification; it should then advertise the `verification-layer` capability in `ctx/adsm.json`. Malformed adopted structure is a validation error, while absence is not.
|