@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.
- package/.github/workflows/flows-app.yaml +95 -0
- package/AGENTS.md +112 -0
- package/LICENSE +201 -0
- package/README.md +246 -0
- package/bin/cli.mjs +55 -0
- package/ctx/AGENTS.md +44 -0
- package/ctx/README.md +24 -0
- package/ctx/adsm.json +5 -0
- package/ctx/agent/AGENTS.md +41 -0
- package/ctx/agent/flows/.img/flancer32-skill-adsm-ctx-github-flows.png +0 -0
- package/ctx/agent/flows/AGENTS.md +37 -0
- package/ctx/agent/flows/cfg/issues/labeled/accepted/profile.json +25 -0
- package/ctx/agent/flows/cfg/issues/labeled/accepted/prompt.md +104 -0
- package/ctx/agent/flows/cfg/issues/labeled/clarification-provided/profile.json +15 -0
- package/ctx/agent/flows/cfg/issues/labeled/clarification-provided/prompt.md +63 -0
- package/ctx/agent/flows/cfg/issues/opened/admission/profile.json +14 -0
- package/ctx/agent/flows/cfg/issues/opened/admission/prompt.md +110 -0
- package/ctx/agent/flows/cfg/profile.json +40 -0
- package/ctx/agent/flows/cfg/pull_request/closed/merged/profile.json +15 -0
- package/ctx/agent/flows/cfg/pull_request/closed/merged/prompt.md +41 -0
- package/ctx/agent/flows/cfg/pull_request/labeled/needs-fix/profile.json +25 -0
- package/ctx/agent/flows/cfg/pull_request/labeled/needs-fix/prompt.md +79 -0
- package/ctx/agent/flows/cfg/pull_request/labeled/ready-for-validation/profile.json +15 -0
- package/ctx/agent/flows/cfg/pull_request/labeled/ready-for-validation/prompt.md +72 -0
- package/ctx/agent/flows/cfg/pull_request/labeled/verified/profile.json +15 -0
- package/ctx/agent/flows/cfg/pull_request/labeled/verified/prompt.md +48 -0
- package/ctx/agent/flows/deployment.md +116 -0
- package/ctx/agent/flows/labels.md +108 -0
- package/ctx/agent/flows/overview.md +82 -0
- package/ctx/agent/prompt/cli/ai-intro.md +141 -0
- package/ctx/assets/.gitkeep +1 -0
- package/ctx/docs/AGENTS.md +121 -0
- package/ctx/docs/ai-intro.md +37 -0
- package/ctx/docs/architecture/AGENTS.md +98 -0
- package/ctx/docs/architecture/behavior.md +68 -0
- package/ctx/docs/architecture/checklists.md +48 -0
- package/ctx/docs/architecture/constraints.md +53 -0
- package/ctx/docs/architecture/constraints.skin.en.md +38 -0
- package/ctx/docs/architecture/decisions.md +118 -0
- package/ctx/docs/architecture/integration.md +31 -0
- package/ctx/docs/architecture/overview.md +76 -0
- package/ctx/docs/architecture/state.md +50 -0
- package/ctx/docs/architecture/structure.md +38 -0
- package/ctx/docs/architecture/supervision.md +71 -0
- package/ctx/docs/code/AGENTS.md +51 -0
- package/ctx/docs/code/overview.md +53 -0
- package/ctx/docs/code/testing.md +26 -0
- package/ctx/docs/environment/AGENTS.md +50 -0
- package/ctx/docs/environment/overview.md +33 -0
- package/ctx/docs/filesystem.md +44 -0
- package/ctx/docs/product/AGENTS.md +51 -0
- package/ctx/docs/product/domain.md +63 -0
- package/ctx/docs/product/domain.skin.en.md +40 -0
- package/ctx/docs/product/glossary.md +31 -0
- package/ctx/docs/product/overview.md +112 -0
- package/ctx/docs/product/overview.skin.en.md +38 -0
- package/ctx/docs/product/roles.md +17 -0
- package/ctx/docs/product/use-cases.md +15 -0
- package/jsconfig.json +12 -0
- package/migrations/README.md +9 -0
- package/package.json +33 -0
- package/skill/SKILL.md +47 -0
- package/skill/references/agents-hierarchy.md +45 -0
- package/skill/references/context-lifecycle.md +53 -0
- package/skill/references/design-questionnaire.md +44 -0
- package/skill/references/document-projections.md +290 -0
- package/skill/references/documentation-compression.md +117 -0
- package/skill/references/documentation-quality-audit.md +199 -0
- package/skill/references/orchestration-model.md +41 -0
- package/skill/references/specialized-skills.md +31 -0
- package/skill/references/upgrade-policy.md +19 -0
- package/skill/templates/AGENTS.md +120 -0
- package/skill/templates/ai/AGENTS.md +59 -0
- package/skill/templates/ctx/AGENTS.md +45 -0
- package/skill/templates/ctx/README.md +27 -0
- package/skill/templates/ctx/adsm.json +7 -0
- package/skill/templates/ctx/agent/AGENTS.md +36 -0
- package/skill/templates/ctx/assets/.gitkeep +1 -0
- package/skill/templates/ctx/docs/AGENTS.md +55 -0
- package/skill/templates/ctx/docs/ai-intro.md +53 -0
- package/skill/templates/ctx/docs/architecture/AGENTS.md +42 -0
- package/skill/templates/ctx/docs/architecture/behavior.md +38 -0
- package/skill/templates/ctx/docs/architecture/checklists.md +25 -0
- package/skill/templates/ctx/docs/architecture/constraints.md +36 -0
- package/skill/templates/ctx/docs/architecture/decisions.md +33 -0
- package/skill/templates/ctx/docs/architecture/integration.md +27 -0
- package/skill/templates/ctx/docs/architecture/overview.md +73 -0
- package/skill/templates/ctx/docs/architecture/state.md +52 -0
- package/skill/templates/ctx/docs/architecture/structure.md +32 -0
- package/skill/templates/ctx/docs/architecture/supervision.md +61 -0
- package/skill/templates/ctx/docs/code/AGENTS.md +35 -0
- package/skill/templates/ctx/docs/code/overview.md +21 -0
- package/skill/templates/ctx/docs/code/testing.md +13 -0
- package/skill/templates/ctx/docs/environment/AGENTS.md +34 -0
- package/skill/templates/ctx/docs/environment/overview.md +21 -0
- package/skill/templates/ctx/docs/filesystem.md +39 -0
- package/skill/templates/ctx/docs/product/AGENTS.md +38 -0
- package/skill/templates/ctx/docs/product/domain.md +77 -0
- package/skill/templates/ctx/docs/product/glossary.md +110 -0
- package/skill/templates/ctx/docs/product/overview.md +74 -0
- package/skill/templates/ctx/docs/product/roles.md +100 -0
- package/skill/templates/ctx/docs/product/use-cases.md +109 -0
- package/skill/templates/work/context/semantic-skin.md +27 -0
- package/skill/templates/work/report/documentation-compression.md +34 -0
- package/skill/templates/work/report/documentation-quality-audit.md +90 -0
- package/src/Bootstrap/Cli.mjs +62 -0
- package/src/Bootstrap.mjs +108 -0
- package/src/Design/Service.mjs +36 -0
- package/src/Init/Service.mjs +136 -0
- package/src/Shared/Constants.mjs +36 -0
- package/src/Shared/CopyDirectory.mjs +78 -0
- package/src/Shared/Metadata.mjs +30 -0
- package/src/Shared/Path.mjs +38 -0
- package/src/Skill/Installer.mjs +47 -0
- package/src/Upgrade/Service.mjs +44 -0
- package/src/Validate/Service.mjs +879 -0
- package/test/integration/.gitkeep +1 -0
- package/test/integration/cli-help.test.mjs +15 -0
- package/test/integration/cli-init-validate.test.mjs +223 -0
- package/test/integration/cli-install-skill.test.mjs +41 -0
- package/test/unit/Bootstrap/Cli.test.mjs +23 -0
- package/test/unit/Bootstrap.test.mjs +53 -0
- package/test/unit/Design/Service.test.mjs +11 -0
- package/test/unit/Init/Service.test.mjs +51 -0
- package/test/unit/Shared/Constants.test.mjs +21 -0
- package/test/unit/Shared/CopyDirectory.test.mjs +31 -0
- package/test/unit/Shared/Metadata.test.mjs +9 -0
- package/test/unit/Shared/Path.test.mjs +11 -0
- package/test/unit/Skill/Installer.test.mjs +20 -0
- package/test/unit/Upgrade/Service.test.mjs +13 -0
- package/test/unit/Validate/Service.test.mjs +760 -0
- package/types.d.ts +15 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: Upload Flows App Config
|
|
2
|
+
|
|
3
|
+
on: workflow_dispatch
|
|
4
|
+
|
|
5
|
+
env:
|
|
6
|
+
PRJ: flows-cfg-skill-adsm-ctx
|
|
7
|
+
CFG_SRC_DIR: ctx/agent/flows/cfg
|
|
8
|
+
CFG_ARCHIVE: flows-cfg-skill-adsm-ctx.tar.gz
|
|
9
|
+
CFG_TARGET_DIR: ${{ vars.FLOWS_CFG_DIR }}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
upload:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v5
|
|
18
|
+
|
|
19
|
+
- name: Validate source directory
|
|
20
|
+
run: |
|
|
21
|
+
set -e
|
|
22
|
+
|
|
23
|
+
if [ ! -d "${{ env.CFG_SRC_DIR }}" ]; then
|
|
24
|
+
echo "Source directory does not exist: ${{ env.CFG_SRC_DIR }}"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
find "${{ env.CFG_SRC_DIR }}" -mindepth 1 -print -quit | grep -q . || {
|
|
29
|
+
echo "Source directory is empty: ${{ env.CFG_SRC_DIR }}"
|
|
30
|
+
exit 1
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- name: Build configuration archive
|
|
34
|
+
run: |
|
|
35
|
+
set -e
|
|
36
|
+
|
|
37
|
+
tar -C "${{ env.CFG_SRC_DIR }}" -czf "${{ env.CFG_ARCHIVE }}" .
|
|
38
|
+
|
|
39
|
+
ls -lh "${{ env.CFG_ARCHIVE }}"
|
|
40
|
+
|
|
41
|
+
- name: Copy archive to server
|
|
42
|
+
uses: appleboy/scp-action@master
|
|
43
|
+
with:
|
|
44
|
+
host: ${{ vars.FLOWS_HOST }}
|
|
45
|
+
username: ${{ vars.FLOWS_USER }}
|
|
46
|
+
key: ${{ secrets.FLOWS_SSH_KEY }}
|
|
47
|
+
source: ${{ env.CFG_ARCHIVE }}
|
|
48
|
+
target: /tmp
|
|
49
|
+
|
|
50
|
+
- name: Replace configuration on server
|
|
51
|
+
uses: appleboy/ssh-action@master
|
|
52
|
+
with:
|
|
53
|
+
host: ${{ vars.FLOWS_HOST }}
|
|
54
|
+
username: ${{ vars.FLOWS_USER }}
|
|
55
|
+
key: ${{ secrets.FLOWS_SSH_KEY }}
|
|
56
|
+
script: |
|
|
57
|
+
set -e
|
|
58
|
+
|
|
59
|
+
TARGET_DIR="${{ env.CFG_TARGET_DIR }}"
|
|
60
|
+
ARCHIVE="/tmp/${{ env.CFG_ARCHIVE }}"
|
|
61
|
+
|
|
62
|
+
if [ -z "$TARGET_DIR" ]; then
|
|
63
|
+
echo "CFG_TARGET_DIR is empty."
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
if [ "$TARGET_DIR" = "/" ]; then
|
|
68
|
+
echo "Refusing to replace root directory."
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
if [ ! -f "$ARCHIVE" ]; then
|
|
73
|
+
echo "Archive does not exist: $ARCHIVE"
|
|
74
|
+
exit 1
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
PARENT_DIR="$(dirname "$TARGET_DIR")"
|
|
78
|
+
TARGET_NAME="$(basename "$TARGET_DIR")"
|
|
79
|
+
TIMESTAMP="$(date +%Y%m%d-%H%M%S)"
|
|
80
|
+
STAGING_DIR="$PARENT_DIR/.${TARGET_NAME}.new-$TIMESTAMP"
|
|
81
|
+
|
|
82
|
+
mkdir -p "$PARENT_DIR"
|
|
83
|
+
|
|
84
|
+
rm -rf "$STAGING_DIR"
|
|
85
|
+
mkdir -p "$STAGING_DIR"
|
|
86
|
+
|
|
87
|
+
tar -xzf "$ARCHIVE" -C "$STAGING_DIR"
|
|
88
|
+
|
|
89
|
+
rm -rf "$TARGET_DIR"
|
|
90
|
+
mv "$STAGING_DIR" "$TARGET_DIR"
|
|
91
|
+
|
|
92
|
+
rm -f "$ARCHIVE"
|
|
93
|
+
|
|
94
|
+
echo "Configuration uploaded to: $TARGET_DIR"
|
|
95
|
+
find "$TARGET_DIR" -maxdepth 3 -type f | sort
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Root Level
|
|
2
|
+
|
|
3
|
+
- Path: `AGENTS.md`
|
|
4
|
+
- Template Version: `20260702`
|
|
5
|
+
- Changed: `20260702`
|
|
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.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# skill-adsm-ctx
|
|
2
|
+
|
|
3
|
+
Build and evolve project cognitive context for Agent-Driven Software Management (ADSM).
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@flancer32/skill-adsm-ctx` is a private ADSM skill package for initializing, designing, validating, auditing, compressing, and upgrading project cognitive context.
|
|
8
|
+
|
|
9
|
+
It manages the lifecycle of project context as its primary object. It does not define business requirements, backend architecture, browser architecture, deployment logic, or domain-specific documentation on its own.
|
|
10
|
+
|
|
11
|
+
This package is developed according to the [ADSM methodology](http://fly.wiredgeese.com/flancer/leanpub/adsm-en/).
|
|
12
|
+
|
|
13
|
+
The package includes:
|
|
14
|
+
|
|
15
|
+
- the `adsm-ctx` CLI for lifecycle operations;
|
|
16
|
+
- the `adsm-ctx` skill payload for AI agents;
|
|
17
|
+
- reusable `ctx/` templates for bootstrapping ADSM-compatible projects.
|
|
18
|
+
- working templates for agent-produced reports.
|
|
19
|
+
|
|
20
|
+
## Purpose
|
|
21
|
+
|
|
22
|
+
Use this package when you need to:
|
|
23
|
+
|
|
24
|
+
- initialize a new ADSM-compatible project context;
|
|
25
|
+
- design the context structure for a concrete project;
|
|
26
|
+
- validate whether an existing context follows expected ADSM structure;
|
|
27
|
+
- audit a documentation corpus against ADSM documentation quality criteria;
|
|
28
|
+
- compress a documentation corpus while preserving accepted project meaning;
|
|
29
|
+
- upgrade a context when ADSM conventions evolve.
|
|
30
|
+
|
|
31
|
+
This package acts as an orchestration layer. It provides generic structure, lifecycle guidance, validation, documentation quality audit guidance, documentation compression guidance, and upgrade entry points. When project-specific context is required, it should direct the agent to use specialized skills when they are available.
|
|
32
|
+
|
|
33
|
+
The bundled baseline now covers both:
|
|
34
|
+
|
|
35
|
+
- product-level context, which defines what the system is;
|
|
36
|
+
- architecture-level context, which defines how product intent is realized through structure, behavior, state ownership, integrations, constraints, decisions, and supervision.
|
|
37
|
+
|
|
38
|
+
## Non-Goals
|
|
39
|
+
|
|
40
|
+
This package does not:
|
|
41
|
+
|
|
42
|
+
- invent project requirements or business rules;
|
|
43
|
+
- replace specialized documentation skills;
|
|
44
|
+
- write domain-specific architecture content as if it knew the project;
|
|
45
|
+
- perform automatic semantic scoring or correction of documentation quality;
|
|
46
|
+
- change project meaning during documentation compression;
|
|
47
|
+
- perform destructive upgrades without explicit review.
|
|
48
|
+
|
|
49
|
+
## Requirements
|
|
50
|
+
|
|
51
|
+
- Node.js with npm.
|
|
52
|
+
- GitHub SSH access to the repository for global installation from GitHub.
|
|
53
|
+
|
|
54
|
+
## Global Installation
|
|
55
|
+
|
|
56
|
+
Install the package globally from GitHub:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npm install -g git+ssh://git@github.com/flancer32/skill-adsm-ctx.git
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This provides the CLI command:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
adsm-ctx
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
To install the skill payload for agent use:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
adsm-ctx install-skill "$HOME/.agents/skills"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This copies the payload to:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
$HOME/.agents/skills/adsm-ctx
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## CLI Usage
|
|
81
|
+
|
|
82
|
+
Show help:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
adsm-ctx --help
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Initialize a context in the current directory:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
adsm-ctx init
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Design guidance for a project context:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
adsm-ctx design
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Validate an existing project context:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
adsm-ctx validate
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Validate a specific path:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
adsm-ctx validate <project-root>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Run the upgrade entry point:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
adsm-ctx upgrade
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Install the bundled skill payload:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
adsm-ctx install-skill <skills-root>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Lifecycle Modes
|
|
125
|
+
|
|
126
|
+
### `init`
|
|
127
|
+
|
|
128
|
+
Creates the minimal ADSM-compatible context structure, starter documents, and `ctx/adsm.json` metadata.
|
|
129
|
+
|
|
130
|
+
### `design`
|
|
131
|
+
|
|
132
|
+
Provides guidance for classifying the project, choosing relevant documentation branches, and identifying when specialized ADSM skills should be used.
|
|
133
|
+
|
|
134
|
+
### `validate`
|
|
135
|
+
|
|
136
|
+
Checks baseline paths, required documentation levels, required `AGENTS.md` files, metadata, body/skin projection shape, local markdown document links, and lightweight skin-shape heuristics. When the repository provides a deterministic validator, run it and report errors and warnings separately. Validation reports findings without modifying project content.
|
|
137
|
+
|
|
138
|
+
### `quality-audit`
|
|
139
|
+
|
|
140
|
+
Guides an agent through evidence-backed review of a documentation corpus against ADSM documentation quality criteria. This is a skill mode, not a CLI command.
|
|
141
|
+
|
|
142
|
+
The default audit corpus is `ctx/docs/`. Operational context such as `ctx/agent/`, workflow configuration, prompt assets, and generated reports is outside the default corpus unless explicitly requested.
|
|
143
|
+
|
|
144
|
+
### `documentation-compression`
|
|
145
|
+
|
|
146
|
+
Guides an agent through controlled rewrite of a documentation corpus to reduce size, improve density, and remove duplication without changing accepted project meaning. This is a skill mode, not a CLI command.
|
|
147
|
+
|
|
148
|
+
The default compression corpus is `ctx/docs/`. Operational context such as `ctx/agent/`, workflow configuration, prompt assets, generated reports, and runtime materials is outside the default corpus unless explicitly requested.
|
|
149
|
+
|
|
150
|
+
### `upgrade`
|
|
151
|
+
|
|
152
|
+
Reads context metadata and reports or applies non-destructive migrations when available. The initial implementation provides the migration mechanism and reports when no migrations apply.
|
|
153
|
+
|
|
154
|
+
## Workflow
|
|
155
|
+
|
|
156
|
+
Recommended sequence:
|
|
157
|
+
|
|
158
|
+
1. Run `adsm-ctx init` in a new project repository.
|
|
159
|
+
2. Run `adsm-ctx design` to shape the context for the actual project.
|
|
160
|
+
3. Use specialized skills where the project needs domain-specific documentation.
|
|
161
|
+
4. Run `adsm-ctx validate` as the deterministic preflight as the context evolves.
|
|
162
|
+
5. Use the skill's `quality-audit` mode only after structural validation passes or leaves warnings only.
|
|
163
|
+
6. Use the skill's `documentation-compression` mode when accepted documentation meaning is stable but the corpus has high attention cost.
|
|
164
|
+
7. Run `adsm-ctx upgrade` when template conventions or schema versions change.
|
|
165
|
+
|
|
166
|
+
## Documentation Levels
|
|
167
|
+
|
|
168
|
+
The recommended documentation dependency is:
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
product
|
|
172
|
+
-> architecture
|
|
173
|
+
-> environment
|
|
174
|
+
-> code
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Use the architecture level once product meaning is clear enough to define stable engineering guardrails.
|
|
178
|
+
|
|
179
|
+
The bundled architecture templates expect these top-level documents:
|
|
180
|
+
|
|
181
|
+
- `overview.md`
|
|
182
|
+
- `structure.md`
|
|
183
|
+
- `behavior.md`
|
|
184
|
+
- `state.md`
|
|
185
|
+
- `integration.md`
|
|
186
|
+
- `constraints.md`
|
|
187
|
+
- `decisions.md`
|
|
188
|
+
- `supervision.md`
|
|
189
|
+
|
|
190
|
+
They are designed for one human plus many agents: body documents stay precise for agentic implementation work, and optional skins stay concise for human semantic control.
|
|
191
|
+
|
|
192
|
+
## Semantic Skin Languages
|
|
193
|
+
|
|
194
|
+
Canonical agent-facing documents use ordinary names such as `overview.md` and are written in English unless a project rule says otherwise. Human-facing skins use an explicit language suffix:
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
overview.md
|
|
198
|
+
overview.skin.en.md
|
|
199
|
+
overview.skin.ru.md
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Use lowercase ISO 639-1 codes (`en`, `ru`, `es`); add a regional tag only for a genuine regional distinction. `overview.skin.md` is invalid. All skins with the same basename form one group with the canonical document, and may adapt the presentation for people rather than be literal translations.
|
|
203
|
+
|
|
204
|
+
For `AGENTS.md` authoring, `Level Boundary` sections should stay compact and guardrail-oriented. They are intended to prevent likely scope drift, not to become exhaustive specifications.
|
|
205
|
+
|
|
206
|
+
## Skill And CLI Relationship
|
|
207
|
+
|
|
208
|
+
The CLI performs local filesystem operations and structural validation.
|
|
209
|
+
|
|
210
|
+
The skill in `skill/SKILL.md` instructs an AI agent how to use the lifecycle modes, how to avoid inventing project content, how to audit documentation quality, how to compress documentation without changing meaning, and how to route documentation work toward specialized skills when needed.
|
|
211
|
+
|
|
212
|
+
Documentation quality audit uses `skill/references/documentation-quality-audit.md` and the working report template at `skill/templates/work/report/documentation-quality-audit.md`.
|
|
213
|
+
|
|
214
|
+
Documentation compression uses `skill/references/documentation-compression.md` and the working report template at `skill/templates/work/report/documentation-compression.md`.
|
|
215
|
+
|
|
216
|
+
The skill does not directly invoke other skills. It instructs the agent to select and use them when relevant.
|
|
217
|
+
|
|
218
|
+
## Specialized Skill Orchestration
|
|
219
|
+
|
|
220
|
+
`adsm-ctx` is intentionally generic. Its design mode should recognize when a project needs specialization such as browser-side web documentation, backend service documentation, data-model documentation, or deployment context.
|
|
221
|
+
|
|
222
|
+
When a specialized ADSM skill is available, the agent should use it for that area after the generic context baseline is in place.
|
|
223
|
+
|
|
224
|
+
When no specialized skill is available, this package should create only generic structure and record the specialization gap instead of inventing domain-specific content.
|
|
225
|
+
|
|
226
|
+
## Local Development
|
|
227
|
+
|
|
228
|
+
Run the CLI directly from the repository:
|
|
229
|
+
|
|
230
|
+
```sh
|
|
231
|
+
node ./bin/cli.mjs --help
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Run the tests:
|
|
235
|
+
|
|
236
|
+
```sh
|
|
237
|
+
npm test
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Status
|
|
241
|
+
|
|
242
|
+
This repository contains a working skeleton intended as a foundation for future ADSM context lifecycle tooling.
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
Apache-2.0
|