@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,19 @@
1
+ # Upgrade Policy
2
+
3
+ - Path: `skill/references/upgrade-policy.md`
4
+ - Changed: `20260708`
5
+
6
+ Upgrades must be non-destructive by default.
7
+
8
+ Safe upgrade behavior includes:
9
+
10
+ - adding missing files and directories;
11
+ - updating metadata when the migration rules are explicit;
12
+ - preserving project-authored content unless replacement is proven safe.
13
+ - detecting agent/skin pairs, orphan skins, and projection drift according to `skill/references/document-projections.md`;
14
+ - preserving project-specific nested subdirectories under `ctx/docs/product/`, `ctx/docs/architecture/`, `ctx/docs/environment/`, and `ctx/docs/code/`;
15
+ - keeping visual, generated, rendered, and auxiliary artifacts under `ctx/assets/**`.
16
+
17
+ Unsafe cases should be reported for manual follow-up instead of applied automatically.
18
+
19
+ Upgrade must not introduce required `README.md` files inside `ctx/docs/` and must not automatically rewrite human-controlled skins when agent/skin meaning is unclear.
@@ -0,0 +1,120 @@
1
+ # Root Level
2
+
3
+ - Path: `AGENTS.md`
4
+ - Template Version: `20260720`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This file defines the root-level working rules for the project repository.
10
+
11
+ This file is the first instruction source for every agent operating within the repository.
12
+
13
+ ## Level Boundary
14
+
15
+ Defines:
16
+
17
+ - Root-level working boundaries between the repository, the cognitive context, and the software product.
18
+ - Repository-topology rules needed to work safely when `ctx/` may be mounted separately.
19
+ - Root-level protection and escalation rules for this project.
20
+
21
+ Does NOT define:
22
+
23
+ - Product-specific meaning, requirements, or domain knowledge.
24
+ - Implementation-level structure such as source code, runtime details, or filesystem layout.
25
+ - Task-specific instructions, workflows, or local operational procedures.
26
+
27
+ ## ADSM Project Model
28
+
29
+ An ADSM project consists of two interconnected spaces:
30
+
31
+ - the **Cognitive Context** located in `./ctx/`
32
+ - the **Software Product** located outside `./ctx/`
33
+
34
+ The cognitive context is the long-term textual memory of the project.
35
+
36
+ The cognitive context is the primary communication medium between Humans and Agents working on the project.
37
+
38
+ The cognitive context is the authoritative knowledge source used by Agents when modifying the project.
39
+
40
+ The software product is the implementation that must be kept consistent with the cognitive context.
41
+
42
+ ## Human and Agent Roles
43
+
44
+ The Human defines goals, authorizes work, evaluates outcomes, and evolves the project.
45
+
46
+ The Agent interprets the cognitive context, performs assigned tasks, modifies the project within task boundaries, and maintains consistency between the cognitive context and the software product.
47
+
48
+ The Agent operates through text and must treat project documentation as operational memory, not as secondary commentary.
49
+
50
+ ## Cognitive Context
51
+
52
+ The canonical execution location of the cognitive context is `./ctx/`.
53
+
54
+ Project-specific knowledge, requirements, architecture, environment descriptions, and implementation guidance are defined within the cognitive context.
55
+
56
+ The Agent must consult `./ctx/AGENTS.md` for project-specific instructions when `./ctx/` exists.
57
+
58
+ The Agent must consult `./ctx/docs/filesystem.md` for the project filesystem structure and documentation layout when that file exists.
59
+
60
+ Documentation distributed with the software product may exist outside `./ctx/`, but it does not replace, redefine, or supersede the cognitive context.
61
+
62
+ ## Bootstrap and Repository Topology
63
+
64
+ An ADSM project may use one repository or two repositories.
65
+
66
+ In a one-repository topology, the software product and the cognitive context are versioned together.
67
+
68
+ In a two-repository topology, the software product and the cognitive context are independent version-controlled repositories, and the cognitive context repository is mounted under `./ctx/`.
69
+
70
+ The Agent must detect whether `./ctx/` is part of the current repository or an independent repository.
71
+
72
+ The Agent must preserve repository boundaries.
73
+
74
+ The Agent must not mix changes between independent repositories.
75
+
76
+ The Agent must not remove, replace, relocate, or unmount `./ctx/`.
77
+
78
+ If `./ctx/` does not exist, the Agent may perform bootstrap operations required to create the initial cognitive context structure.
79
+
80
+ After bootstrap is complete, `./ctx/AGENTS.md` becomes the entry point for project-specific instructions.
81
+
82
+ ## Context and Product Consistency
83
+
84
+ The cognitive context is the source of truth for the project.
85
+
86
+ If the cognitive context and the software product diverge, the Agent must treat the cognitive context as authoritative.
87
+
88
+ The Agent must maintain consistency between the cognitive context and the software product.
89
+
90
+ The Agent may modify the cognitive context when required by the assigned task and when the modification remains consistent with higher-level context constraints.
91
+
92
+ The Agent may modify the software product when required by the assigned task and when the modification remains consistent with the cognitive context.
93
+
94
+ ## AGENTS.md Hierarchy
95
+
96
+ Additional `AGENTS.md` files may exist in subdirectories.
97
+
98
+ The effective working context of the agent is the aggregate of all `AGENTS.md` files located along the path from the repository root to the target directory.
99
+
100
+ Rules:
101
+
102
+ - deeper levels override higher levels within their scope
103
+ - root-level invariants cannot be overridden
104
+ - all levels must remain mutually consistent
105
+
106
+ ## Root File Protection
107
+
108
+ This file defines root-level project control rules.
109
+
110
+ The agent must not modify, replace, delete, relocate, or reinterpret this file unless explicitly instructed by the human.
111
+
112
+ Violation of this rule constitutes an execution error.
113
+
114
+ ## Secret Handling
115
+
116
+ The Agent must never read, load, print, search for, or expose secret-bearing project files, including `.env` and `.env.*` files, credentials, private keys, tokens, or secret stores. This rule applies even when a file is Git-ignored and includes broad search or command output that could reveal its contents.
117
+
118
+ The Agent may use a non-secret example template such as `.env.example` only to learn the configuration shape. It must not infer or request the value of any secret.
119
+
120
+ If secret data is exposed accidentally, the Agent must stop handling that value, must not repeat it, and must tell the Human that the secret should be rotated or revoked.
@@ -0,0 +1,59 @@
1
+ # AGENTS.md
2
+
3
+ - Path: `ai/AGENTS.md`
4
+ - Template Version: `20260609`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This file defines the `ai/` level for agent-facing package documentation included in the distributable package.
10
+
11
+ The `ai/` directory provides a compact machine-oriented interface for agents that need to understand and use the package correctly.
12
+
13
+ ## Level Boundary
14
+
15
+ This level defines:
16
+
17
+ - what documents exist in `ai/`;
18
+ - what each document is for;
19
+ - how an agent should navigate this directory.
20
+
21
+ This level does not define:
22
+
23
+ - repository organization;
24
+ - development workflow and testing strategy;
25
+ - behavior not described by the documents in `ai/`.
26
+
27
+ ## Level Map
28
+
29
+ - `AGENTS.md` — entry point for this level; defines scope and navigation.
30
+ - `concepts.md` — core concepts and architectural model.
31
+ - `container.md` — container responsibilities and dependency resolution behavior.
32
+ - `dependency-id.md` — syntax and semantics of dependency identifiers.
33
+ - `extensions.md` — supported extension points and customization mechanisms.
34
+ - `package-api.ts` — machine-readable description of the public programmatic interface.
35
+ - `usage.md` — minimal usage scenarios and integration examples.
36
+
37
+ ## Reading Guide
38
+
39
+ Read documents by task:
40
+
41
+ - for API usage, start with `package-api.ts`, then `usage.md`;
42
+ - for dependency addressing, read `dependency-id.md`;
43
+ - for runtime behavior, read `container.md`;
44
+ - for extension work, read `extensions.md`;
45
+ - for architectural orientation, read `concepts.md`.
46
+
47
+ If the task is broad or unclear, read in this order:
48
+
49
+ 1. `AGENTS.md`
50
+ 2. `package-api.ts`
51
+ 3. `usage.md`
52
+ 4. `concepts.md`
53
+ 5. remaining documents as needed
54
+
55
+ ## Authority
56
+
57
+ The documents in `ai/` define the supported agent-facing usage semantics of the package.
58
+
59
+ Agents should rely on these documents for package use and should treat behaviors not described here as undefined.
@@ -0,0 +1,45 @@
1
+ # Cognitive Context
2
+
3
+ - Path: `ctx/AGENTS.md`
4
+ - Template Version: `20260702`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This file marks `ctx/` as the project cognitive context.
10
+
11
+ Use this branch for project knowledge and keep detailed ADSM methodology outside the project-facing context.
12
+
13
+ ## Bootstrap Marker
14
+
15
+ - This context follows ADSM conventions.
16
+ - Use skill `adsm-ctx` for structure validation, upgrade logic, and methodology rules.
17
+
18
+ ## Level Map
19
+
20
+ - `agent/` — project-local agent and tool materials outside the reusable ADSM baseline.
21
+ - `assets/` — visual, generated, rendered, or auxiliary artifacts that support documentation without defining authoritative meaning.
22
+ - `docs/` — project-facing documentation and constraints.
23
+ - `AGENTS.md` — level definition for `ctx/`.
24
+ - `README.md` — short entry note for the cognitive context.
25
+ - `adsm.json` — context metadata for versioning and upgrade eligibility.
26
+
27
+ ## Level Boundary
28
+
29
+ Defines:
30
+
31
+ - `ctx/` as the project cognitive context boundary.
32
+ - The split between project-facing documentation and project-local agent materials.
33
+ - The local entry points agents should read before deeper work.
34
+
35
+ Does NOT define:
36
+
37
+ - Product-specific meaning that belongs in subordinate product and architecture documents.
38
+ - Implementation structure outside the cognitive context.
39
+ - Detailed ADSM methodology that belongs to the skill and its references.
40
+
41
+ ## Local Reading Map
42
+
43
+ - Read `README.md` for a short entry note.
44
+ - Read `docs/filesystem.md` for the top-level repository map.
45
+ - Read `docs/` for project documentation.
@@ -0,0 +1,27 @@
1
+ # Cognitive Context
2
+
3
+ - Path: `ctx/README.md`
4
+ - Template Version: `20260623`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This directory contains the project cognitive context.
10
+
11
+ The cognitive context is the project knowledge space used by humans and agents when maintaining the project.
12
+
13
+ Detailed ADSM validation and methodology rules are intentionally kept out of this installed template baseline.
14
+
15
+ ## Entry Points
16
+
17
+ - Read `AGENTS.md` for cognitive-context structure and governance rules.
18
+ - Use skill `adsm-ctx` when you need ADSM validation, upgrade, or methodology guidance.
19
+ - Read `docs/filesystem.md` for the top-level repository map.
20
+ - Read `docs/` for declarative project documentation.
21
+ - Read `agent/` only when working with repository-local agent operations or workflow assets.
22
+
23
+ ## Boundary
24
+
25
+ This directory defines project knowledge and agent-operational context.
26
+
27
+ It does not replace product source code, runtime configuration, deployment secrets, or generated build artifacts.
@@ -0,0 +1,7 @@
1
+ {
2
+ "schema": "adsm-context",
3
+ "version": "0.1.0",
4
+ "notes": [
5
+ "Initial context created from the canonical adsm-ctx template set."
6
+ ]
7
+ }
@@ -0,0 +1,36 @@
1
+ # Agent External Context
2
+
3
+ - Path: `ctx/agent/AGENTS.md`
4
+ - Template Version: `20260702`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This file marks `ctx/agent/` as a project-local branch for agent and tool materials.
10
+
11
+ ## Bootstrap Marker
12
+
13
+ - This branch exists in an ADSM-managed context.
14
+ - Use skill `adsm-ctx` for methodology rules about the boundary of `ctx/agent/`.
15
+
16
+ ## Level Map
17
+
18
+ - `AGENTS.md` — boundary definition for `ctx/agent/`.
19
+
20
+ ## Level Boundary
21
+
22
+ Defines:
23
+
24
+ - `ctx/agent/` as the local branch for project-specific agent and tool materials.
25
+ - The boundary between the reusable ADSM baseline and project-local operational content.
26
+ - The rule that only this file belongs to the template-managed baseline for `ctx/agent/`.
27
+
28
+ Does NOT define:
29
+
30
+ - Product meaning or user-facing project requirements.
31
+ - Architecture ownership or code-level implementation constraints.
32
+ - The required shape of future project-local subdirectories under `ctx/agent/`.
33
+
34
+ ## Local Rule
35
+
36
+ Project-specific subdirectories and files under `ctx/agent/` are local project material rather than part of the reusable template baseline.
@@ -0,0 +1,55 @@
1
+ # Project Documentation
2
+
3
+ - Path: `ctx/docs/AGENTS.md`
4
+ - Template Version: `20260702`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This branch holds project-facing documentation.
10
+
11
+ The installed template should describe the project, not restate detailed ADSM methodology.
12
+
13
+ ## Bootstrap Marker
14
+
15
+ - This documentation baseline follows ADSM conventions.
16
+ - Use skill `adsm-ctx` for structure validation, document-shape discipline, and methodology rules.
17
+
18
+ ## Level Map
19
+
20
+ - `architecture/` — project architecture documents.
21
+ - `code/` — code-level constraints and testing guidance.
22
+ - `environment/` — runtime and infrastructure assumptions.
23
+ - `product/` — product meaning, roles, and use cases.
24
+ - `AGENTS.md` — entry note for `ctx/docs/`.
25
+ - `ai-intro.md` — compact agent orientation for the concrete project.
26
+ - `filesystem.md` — top-level repository map.
27
+
28
+ ## Level Boundary
29
+
30
+ Defines:
31
+
32
+ - The declarative documentation boundary for the project.
33
+ - The documentation dependency chain from product to code.
34
+ - The local entry points used to orient agents within `ctx/docs/`.
35
+
36
+ Does NOT define:
37
+
38
+ - Project-local agent operations under `ctx/agent/`.
39
+ - Product source files or runtime assets outside documentation.
40
+ - Detailed ADSM methodology beyond the bootstrap routing marker.
41
+
42
+ ## Documentation Rules
43
+
44
+ - Use explicit line breaks to keep each durable statement easy to scan.
45
+ - Use section separators only where they improve navigation or clarify a level boundary.
46
+ - Keep documents compact and avoid long uninterrupted blocks of text.
47
+ - Keep project-facing documents below `5,000` tokens unless a longer document preserves a load-bearing distinction.
48
+ - Treat ordinary `*.md` files as agent-facing operational context documents.
49
+ - Treat `*.skin.<lang>.md` files as human-facing semantic skins for matching agent documents with the same basename and directory.
50
+ - Read a matching skin before changing an agent document.
51
+ - Report a human decision if a requested agent-document change would violate the matching skin.
52
+ - Keep project-specific nested subdirectories inside `product/`, `architecture/`, `environment/`, and `code/` when they improve maintainability.
53
+ - Keep each documentation level to no more than nine direct directories and nine direct ordinary files, excluding `AGENTS.md` and paired `*.skin.<lang>.md` files, where practical.
54
+ - When a level deliberately exceeds either value, add a `## Documentation Capacity Exception` section to that level's `AGENTS.md` that states the exception and its reason.
55
+ - Put visual, generated, rendered, or auxiliary artifacts under `ctx/assets/**`.
@@ -0,0 +1,53 @@
1
+ # AI Introduction
2
+
3
+ - Path: `ctx/docs/ai-intro.md`
4
+ - Template Version: `20260623`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ This document gives AI agents a compact first orientation to the project.
10
+
11
+ It should classify the project, identify its problem space, name its primary audience, and prevent common misclassification before the agent reads deeper documentation.
12
+
13
+ ## Project Type
14
+
15
+ Describe what kind of software product this repository defines.
16
+
17
+ ## Problem Space
18
+
19
+ Describe the narrow problem the project exists to solve.
20
+
21
+ ## Product Role
22
+
23
+ Describe how this project relates to adjacent tools, applications, libraries, frameworks, platforms, or automation systems.
24
+
25
+ ## Primary Audience
26
+
27
+ Describe the humans, agents, systems, or organizations that use, operate, or maintain the project.
28
+
29
+ ## Technology Base
30
+
31
+ Identify the major language, runtime, packaging, platform, and execution assumptions that classify the project technically.
32
+
33
+ ## Methodological Base
34
+
35
+ Identify the project-governing methodology or design approach only where it helps classify this specific project.
36
+
37
+ ## Distinguishing Characteristics
38
+
39
+ List the project choices that matter most for correct agent orientation.
40
+
41
+ ## What This Project Is Not
42
+
43
+ List common but incorrect classifications that would lead to wrong implementation or documentation decisions.
44
+
45
+ ## Reading Angle
46
+
47
+ Point agents toward the next high-value documents to read.
48
+
49
+ ## Boundary
50
+
51
+ This document is an orientation entry point.
52
+
53
+ It does not define product requirements, architecture contracts, environment constraints, code rules, or operational workflow semantics.
@@ -0,0 +1,42 @@
1
+ # Architecture Documentation
2
+
3
+ - Path: `ctx/docs/architecture/AGENTS.md`
4
+ - Template Version: `20260702`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Defines the architecture documentation level.
10
+
11
+ Documents at this level translate product intent into stable engineering structure, behavior, state ownership, integration boundaries, architectural constraints, durable decisions, and supervision rules.
12
+
13
+ ## Level Map
14
+
15
+ - `AGENTS.md` — level definition for `ctx/docs/architecture/`.
16
+ - `behavior.md` — internal architectural flows and major system behavior, not product use cases.
17
+ - `checklists.md` — recurring supervision, diagnosis, and acceptance checklists.
18
+ - `constraints.md` — non-negotiable architecture restrictions and trust boundaries.
19
+ - `decisions.md` — short ADR-like records of durable decisions, rejected alternatives, and reasoning.
20
+ - `integration.md` — external integrations and major internal contracts between architectural blocks.
21
+ - `overview.md` — compact architectural overview and navigation index.
22
+ - `state.md` — state ownership, sources of truth, derived state, and state-changing authority.
23
+ - `structure.md` — major architectural blocks, runtime areas, and responsibility boundaries, not code structure.
24
+ - `supervision.md` — human-agent architecture supervision rules, approval boundaries, and drift signals.
25
+
26
+ ## Level Boundary
27
+
28
+ Defines:
29
+
30
+ - Major architectural areas, system boundaries, and integration surfaces.
31
+ - Internal behavior, state ownership, and authority distribution.
32
+ - Durable architectural constraints, decisions, and supervision rules.
33
+
34
+ Does NOT define:
35
+
36
+ - Product meaning such as roles, domain entities, or use-case outcomes.
37
+ - Deployment procedures, operational workflow routing, or environment-specific runbooks.
38
+ - Source-level implementation details such as files, classes, tables, DTOs, or endpoint definitions.
39
+
40
+ ## Local Rules
41
+
42
+ - Preserve project-specific nested architecture subdirectories such as runtime, state, integration, or lifecycle areas when they improve maintainability.
@@ -0,0 +1,38 @@
1
+ # Architecture Behavior
2
+
3
+ - Path: `ctx/docs/architecture/behavior.md`
4
+ - Template Version: `20260605`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Describe major internal architectural flows and processing behavior.
10
+
11
+ This document explains how the system works internally, not which product outcomes users want.
12
+
13
+ ## Major Flows
14
+
15
+ Describe the main architectural flows that matter for the system.
16
+
17
+ Examples may include request handling, synchronization, ingestion, supervision, background processing, or recovery.
18
+
19
+ Do not rewrite product use cases here.
20
+
21
+ ## Flow Boundaries
22
+
23
+ For each major flow, clarify:
24
+
25
+ - where the flow starts;
26
+ - which architectural areas participate;
27
+ - where important decisions are made;
28
+ - where the flow ends or commits durable change.
29
+
30
+ ## Failure And Recovery
31
+
32
+ Describe important failure handling, retry, fallback, or degradation behavior at the architectural level.
33
+
34
+ ## Product Dependency
35
+
36
+ Behavior must realize product intent.
37
+
38
+ If product behavior is missing or contradictory, expose the gap instead of inventing architectural behavior silently.
@@ -0,0 +1,25 @@
1
+ # Architecture Checklists
2
+
3
+ - Path: `ctx/docs/architecture/checklists.md`
4
+ - Template Version: `20260702`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Provide short recurring checklists for human supervision, diagnosis, and acceptance of architecture-level agent work.
10
+
11
+ ## Drift Diagnosis Checklist
12
+
13
+ List the quick checks a human should run when an agent appears to move in the wrong architectural direction.
14
+
15
+ ## Approval Checklist
16
+
17
+ List the checks a human should run before approving architecture expansion.
18
+
19
+ ## Compression Safety Checklist
20
+
21
+ List the checks a human should run before accepting compression of architecture documents.
22
+
23
+ ## Reading Route
24
+
25
+ Point to the small set of architecture documents a human should read next after this checklist file.
@@ -0,0 +1,36 @@
1
+ # Architecture Constraints
2
+
3
+ - Path: `ctx/docs/architecture/constraints.md`
4
+ - Template Version: `20260702`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Record non-negotiable architecture restrictions and trust boundaries.
10
+
11
+ ## Core Constraints
12
+
13
+ List stable architectural properties that downstream environment and code work must respect.
14
+
15
+ Examples may include offline-first behavior, transport choices, persistence assumptions, cost ceilings, latency boundaries, or trust boundaries.
16
+
17
+ ## Boundary Constraints
18
+
19
+ Describe what architecture must not redefine or violate.
20
+
21
+ This section should make product and architecture boundaries explicit.
22
+
23
+ ## Change Constraints
24
+
25
+ Describe which kinds of architecture changes always require human approval.
26
+
27
+ At minimum, cover:
28
+
29
+ - new architectural owners;
30
+ - new persistent state;
31
+ - new external integrations;
32
+ - new major system boundaries.
33
+
34
+ ## Human Review Use
35
+
36
+ List the supervision questions a human should answer quickly with this document.
@@ -0,0 +1,33 @@
1
+ # Architecture Decisions
2
+
3
+ - Path: `ctx/docs/architecture/decisions.md`
4
+ - Template Version: `20260605`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Record durable architecture decisions in a short ADR-like form.
10
+
11
+ ## Decision Format
12
+
13
+ Use short entries that contain:
14
+
15
+ - the decision;
16
+ - rejected alternatives;
17
+ - reasoning.
18
+
19
+ Keep only durable architecture decisions here.
20
+
21
+ Do not use this document as a changelog or backlog.
22
+
23
+ ## Decision Entries
24
+
25
+ Create one short section per durable decision.
26
+
27
+ Prefer decisions that affect:
28
+
29
+ - structural boundaries;
30
+ - state ownership;
31
+ - integration model;
32
+ - trust model;
33
+ - supervision model.
@@ -0,0 +1,27 @@
1
+ # Architecture Integration
2
+
3
+ - Path: `ctx/docs/architecture/integration.md`
4
+ - Template Version: `20260605`
5
+ - Changed: `YYYYMMDD`
6
+
7
+ ## Purpose
8
+
9
+ Describe external integrations and major internal contracts between architectural blocks.
10
+
11
+ ## External Integrations
12
+
13
+ List the external systems, platforms, or durable dependencies that matter architecturally.
14
+
15
+ Do not expand this section into protocol or endpoint detail unless a larger project uses optional deeper documents.
16
+
17
+ ## Internal Contracts
18
+
19
+ Describe the major contract surfaces between architectural areas.
20
+
21
+ This is not DTO documentation and not an OpenAPI replacement.
22
+
23
+ ## Boundary Rules
24
+
25
+ - New integrations must be explicit here before they appear in implementation.
26
+ - Integration descriptions must stay at architectural boundary level, not code or schema level.
27
+ - Contradictions with product scope must be surfaced instead of normalized silently.