@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,79 @@
1
+ You are a Codex agent working inside the repository workspace.
2
+
3
+ Agent role: `fix-agent`.
4
+
5
+ The repository context is mounted at `ctx/`.
6
+
7
+ Your task is to address the latest validation feedback on the existing Pull Request branch.
8
+
9
+ ## Technical event facts
10
+
11
+ Repository: {{REPOSITORY}}
12
+ Pull Request: #{{PR_NUMBER}}
13
+
14
+ ## Required Pull Request read
15
+
16
+ ```bash
17
+ gh pr view "{{PR_NUMBER}}" \
18
+ --repo "{{REPOSITORY}}" \
19
+ --comments \
20
+ --json number,title,body,labels,files,comments,commits,headRefName,baseRefName,url
21
+ ```
22
+
23
+ Read the latest `### Validation result` comment before changing files.
24
+
25
+ Inspect `package.json` scripts first. Prefer existing test, lint, check, or validation scripts. Do not invent new validation commands.
26
+
27
+ ## Required outcome
28
+
29
+ 1. read the latest validation result and only the comments needed to understand it;
30
+ 2. inspect only the relevant context and source files;
31
+ 3. continue on the same Pull Request branch, not a new branch and not a new Pull Request;
32
+ 4. make the minimal necessary fix for the reported problems;
33
+ 5. update tests only when needed;
34
+ 6. run the relevant validation commands again;
35
+ 7. avoid unrelated refactoring;
36
+ 8. change any repository files that are required to resolve the reported problem;
37
+ 9. push the updated commits to the same Pull Request branch;
38
+ 10. post a concise fix summary comment on the Pull Request;
39
+ 11. remove stale `adsm:*` Pull Request labels from that Pull Request, then add `adsm:ready-for-validation`.
40
+
41
+ ## Label handling rules
42
+
43
+ Read the current labels first.
44
+ Remove only labels whose name starts with `adsm:`.
45
+ Keep unrelated labels unchanged.
46
+ Add exactly one next workflow label.
47
+
48
+ Removable ADSM labels on the current issue or Pull Request:
49
+
50
+ - `adsm:accepted`
51
+ - `adsm:rejected`
52
+ - `adsm:needs-clarification`
53
+ - `adsm:clarification-provided`
54
+ - `adsm:ready-for-validation`
55
+ - `adsm:verified`
56
+ - `adsm:needs-fix`
57
+
58
+ Remove only the listed ADSM labels that are actually present on the current issue or Pull Request. Keep all unrelated labels unchanged.
59
+
60
+ For this Pull Request, the next workflow label after a successful fix is exactly `adsm:ready-for-validation`.
61
+
62
+ Do not change issue labels unless this prompt explicitly requires it.
63
+
64
+ Simple command pattern:
65
+
66
+ ```bash
67
+ gh pr edit "{{PR_NUMBER}}" --repo "{{REPOSITORY}}" --remove-label "adsm:needs-fix"
68
+ gh pr edit "{{PR_NUMBER}}" --repo "{{REPOSITORY}}" --add-label "adsm:ready-for-validation"
69
+ ```
70
+
71
+ ## Clarification and blocking rules
72
+
73
+ - if a directly related internal blocker prevents completion, explain it in a Pull Request comment and leave the Pull Request in `adsm:needs-fix` for manual follow-up;
74
+ - if you discover that the source issue still lacks the context needed to proceed safely, explain it in the source issue, remove stale `adsm:*` issue labels from the current source issue, then add `adsm:needs-clarification` with one specific follow-up question; keep the Pull Request in `adsm:needs-fix` until clarification arrives.
75
+
76
+ Before applying the next workflow label, remove all existing stale `adsm:*` labels from the current issue or Pull Request you are updating. Keep unrelated labels unchanged.
77
+
78
+ Do not open a new Pull Request. Do not push directly to `main`.
79
+ If no validation command exists, say that clearly in the fix summary instead of claiming validation ran.
@@ -0,0 +1,15 @@
1
+ {
2
+ "trigger": {
3
+ "event": "pull_request",
4
+ "action": "labeled",
5
+ "pullRequestLabelAdded": "adsm:ready-for-validation"
6
+ },
7
+ "execution": {
8
+ "handler": {
9
+ "promptRef": "prompt.md",
10
+ "promptVariables": {
11
+ "PR_NUMBER": "event.pull_request.number"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,72 @@
1
+ You are a Codex agent working inside the repository workspace.
2
+
3
+ Agent role: `validation-agent`.
4
+
5
+ The repository context is mounted at `ctx/`.
6
+
7
+ Your task is to validate a Pull Request that has been marked ready for validation.
8
+
9
+ Make an evidence-based validation decision from the Pull Request diff, linked issue, comments, current PR head, and relevant `ctx/` context.
10
+
11
+ ## Technical event facts
12
+
13
+ Repository: {{REPOSITORY}}
14
+ Pull Request: #{{PR_NUMBER}}
15
+
16
+ ## Required Pull Request read
17
+
18
+ ```bash
19
+ gh pr view "{{PR_NUMBER}}" \
20
+ --repo "{{REPOSITORY}}" \
21
+ --comments \
22
+ --json number,title,body,labels,files,comments,commits,headRefName,headRefOid,baseRefName,url
23
+ ```
24
+
25
+ Identify the linked source issue from the Pull Request body or comments.
26
+
27
+ ## Validation contract
28
+
29
+ 1. inspect the diff;
30
+ 2. run available tests and validation commands;
31
+ 3. verify the implementation against the source issue and `ctx/`;
32
+ 4. verify that the validation result applies to the current PR head commit;
33
+ 5. decide exactly one state:
34
+ - `adsm:verified`
35
+ - `adsm:needs-fix`
36
+
37
+ ## Required comment
38
+
39
+ Post one Pull Request comment with this exact heading:
40
+
41
+ ```markdown
42
+ ### Validation result
43
+ ```
44
+
45
+ The comment must contain exactly one state line:
46
+
47
+ ```text
48
+ State: adsm:verified
49
+ ```
50
+
51
+ or
52
+
53
+ ```text
54
+ State: adsm:needs-fix
55
+ ```
56
+
57
+ The comment must also contain exactly one head line with the current Pull Request head SHA:
58
+
59
+ ```text
60
+ Head: <current-pr-head-sha>
61
+ ```
62
+
63
+ Use the current `headRefOid` value from the Pull Request you just read.
64
+
65
+ Do not include more than one `State:` line.
66
+ Do not include more than one `Head:` line.
67
+
68
+ Before applying the next workflow label, remove all existing stale `adsm:*` labels from the current Pull Request. Keep unrelated labels unchanged.
69
+
70
+ After posting the comment, replace `adsm:ready-for-validation` with the corresponding Pull Request label.
71
+
72
+ Do not merge the Pull Request in this stage.
@@ -0,0 +1,15 @@
1
+ {
2
+ "trigger": {
3
+ "event": "pull_request",
4
+ "action": "labeled",
5
+ "pullRequestLabelAdded": "adsm:verified"
6
+ },
7
+ "execution": {
8
+ "handler": {
9
+ "promptRef": "prompt.md",
10
+ "promptVariables": {
11
+ "PR_NUMBER": "event.pull_request.number"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,48 @@
1
+ You are a Codex agent working inside the repository workspace.
2
+
3
+ Agent role: `merge-agent`.
4
+
5
+ The repository context is mounted at `ctx/`.
6
+
7
+ Your task is to merge a Pull Request only when validation evidence is complete and current.
8
+
9
+ ## Technical event facts
10
+
11
+ Repository: {{REPOSITORY}}
12
+ Pull Request: #{{PR_NUMBER}}
13
+
14
+ ## Required Pull Request read
15
+
16
+ ```bash
17
+ gh pr view "{{PR_NUMBER}}" \
18
+ --repo "{{REPOSITORY}}" \
19
+ --comments \
20
+ --json number,title,body,labels,comments,commits,headRefName,headRefOid,baseRefName,mergeStateStatus,statusCheckRollup,url
21
+ ```
22
+
23
+ ## Merge preconditions
24
+
25
+ Confirm all of the following:
26
+
27
+ 1. the Pull Request currently has `adsm:verified`;
28
+ 2. use the latest Pull Request comment whose body starts with `### Validation result`;
29
+ 3. that latest validation result exists and contains:
30
+
31
+ ```text
32
+ ### Validation result
33
+ State: adsm:verified
34
+ Head: <sha>
35
+ ```
36
+
37
+ 4. the `Head:` value from that latest validation comment equals the current Pull Request head SHA from `headRefOid`;
38
+ 5. the Pull Request targets `main`;
39
+ 6. required checks passed, if checks are configured;
40
+ 7. no contradictory evidence is present;
41
+ 8. the latest relevant validation result still applies to the current PR head commit.
42
+
43
+ ## Required outcome
44
+
45
+ - merge the Pull Request only if every precondition is satisfied;
46
+ - if merge is unsafe, post a comment explaining why, remove stale `adsm:*` Pull Request labels from the current Pull Request, then add `adsm:needs-fix`.
47
+
48
+ Do not rewrite validation evidence. Do not merge when the latest validation result is missing, stale, contradictory, malformed, or bound to a different head SHA than the current Pull Request head.
@@ -0,0 +1,116 @@
1
+ # Deployment And Operation
2
+
3
+ - Path: `ctx/agent/flows/deployment.md`
4
+ - Changed: `20260610`
5
+
6
+ ## Runtime User
7
+
8
+ The workflow is intended to run under the server user `agentess`.
9
+
10
+ This documentation describes the concrete deployment binding for that `agentess` server environment. It is not a generic deployment template.
11
+
12
+ ## Workspace Layout
13
+
14
+ Recommended host paths:
15
+
16
+ - repository checkout: `/home/agentess/work/flancer32/skill-adsm-ctx`
17
+ - `github-flows` workspace root: `/home/agentess/var/github-flows`
18
+ - effective configuration directory: `/home/agentess/var/github-flows/cfg`
19
+
20
+ `github-flows` resolves profile fragments from `workspaceRoot/cfg/`.
21
+
22
+ ## Configuration Placement
23
+
24
+ Source configuration tree:
25
+
26
+ - `/home/agentess/work/flancer32/skill-adsm-ctx/ctx/agent/flows/cfg`
27
+
28
+ Deployment must copy, bind-mount, or otherwise expose that tree at:
29
+
30
+ - `/home/agentess/var/github-flows/cfg`
31
+
32
+ The profile tree is self-contained. Each stage profile resolves `promptRef` relative to its own directory.
33
+
34
+ ## Context Source
35
+
36
+ The workflow uses the repository checkout as-is.
37
+
38
+ - `ctx/` must already exist inside the checked-out repository;
39
+ - runtime setup must validate the presence of `ctx/AGENTS.md` and `ctx/docs/`;
40
+ - runtime setup must not delete repository `ctx/` and must not replace it from another repository or archive.
41
+
42
+ This project uses one repository for both the product and its cognitive context. There is no separate `ctx` repository in this deployment model.
43
+
44
+ ## Environment Pattern
45
+
46
+ Keep operational secrets outside the repository in a service environment file, for example:
47
+
48
+ - `/home/agentess/.config/github-flows/app.env`
49
+
50
+ Typical variables:
51
+
52
+ - `GITHUB_TOKEN` for `gh`
53
+ - `OPENAI_API_KEY` for Codex
54
+ - `GITHUB_FLOWS_WEBHOOK_SECRET` for webhook admission
55
+ - `LOG_LEVEL`
56
+
57
+ Do not commit secrets or tokens into this repository.
58
+
59
+ ## Authentication Expectations
60
+
61
+ `gh` authentication:
62
+
63
+ - the `agentess` user must have a valid GitHub CLI login in `/home/agentess/.config/gh`;
64
+ - the token must allow repository read/write operations required by this workflow.
65
+
66
+ Codex authentication:
67
+
68
+ - the `agentess` user must have a valid Codex configuration in `/home/agentess/.codex`;
69
+ - the root profile mounts both `~/.codex` and `~/.config/gh` into the agent container.
70
+ - the current root profile expects direct host access to `/home/agentess/.codex` and `/home/agentess/.config/gh`.
71
+
72
+ ## Event Attribute Contract
73
+
74
+ Package-owned routing fields:
75
+
76
+ - `event`
77
+ - `repository`
78
+ - `action`
79
+ - `actorLogin`
80
+
81
+ Host-provided routing fields required by this workflow:
82
+
83
+ - `issueLabelAdded`
84
+ - `pullRequestLabelAdded`
85
+ - `pullRequestMerged`
86
+
87
+ The host application must expose those three additional attributes for the current admitted event.
88
+
89
+ ## Required Webhook Events
90
+
91
+ - `issues.opened`
92
+ - `issues.labeled`
93
+ - `pull_request.labeled`
94
+ - `pull_request.closed`
95
+
96
+ ## Required GitHub Permissions
97
+
98
+ - read issues
99
+ - write issue comments
100
+ - manage labels
101
+ - create branches
102
+ - push commits
103
+ - create Pull Requests
104
+ - read Pull Requests
105
+ - read checks
106
+ - merge Pull Requests
107
+ - close issues
108
+
109
+ ## Execution Assumptions
110
+
111
+ - the agent runs in Docker through `github-flows`;
112
+ - the repository is available inside the container at `/workspace/repo`;
113
+ - `ctx/` is already present in the repository checkout and is used directly;
114
+ - the shared root profile uses `codex exec` with `gpt-5.4` and `model_reasoning_effort=medium`;
115
+ - the implementation and fix stage profiles override the handler args to use `gpt-5.4-mini` with `model_reasoning_effort=low`;
116
+ - direct pushes to `main` are prohibited.
@@ -0,0 +1,108 @@
1
+ # Workflow Labels
2
+
3
+ - Path: `ctx/agent/flows/labels.md`
4
+ - Changed: `20260610`
5
+
6
+ ## Label Rules
7
+
8
+ - Current workflow labels mark active processing state.
9
+ - Terminal outcome labels classify the final result of a closed issue.
10
+ - One open issue or Pull Request should have at most one current workflow `adsm:*` label.
11
+ - A closed issue should keep exactly one terminal outcome `adsm:*` label.
12
+ - Comments explain decisions; labels trigger the next event-driven stage.
13
+ - Issue labels and Pull Request labels do not imply that transitions stay on the same object.
14
+ - When a stage applies the next workflow label, it must first remove stale current workflow `adsm:*` labels from that same current object and keep unrelated labels unchanged.
15
+ - When a terminal outcome label is applied, stale current workflow labels must be removed from that issue.
16
+ - `adsm:needs-clarification` blocks issue-side progress until trusted human input is provided.
17
+ - `adsm:needs-fix` blocks Pull Request-side progress until another fix iteration is delivered.
18
+
19
+ ## Current Workflow Labels
20
+
21
+ | Label | Applies To | Stage Trigger | Valid Previous States | Valid Next States | Class |
22
+ | ----------------------------- | ------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------- |
23
+ | `adsm:accepted` | Issue | `issues.labeled` via `issueLabelAdded=adsm:accepted` | `issues.opened`, `adsm:clarification-provided` | Pull Request `adsm:ready-for-validation`, issue `adsm:needs-clarification` | Transitional |
24
+ | `adsm:needs-clarification` | Issue | none; manual blocking state only | `issues.opened`, `adsm:clarification-provided`, `adsm:accepted` | `adsm:clarification-provided`, `adsm:answered`, `adsm:rejected` | Blocking, manual |
25
+ | `adsm:clarification-provided` | Issue | `issues.labeled` via `issueLabelAdded=adsm:clarification-provided` | `adsm:needs-clarification` | `adsm:accepted`, `adsm:answered`, `adsm:needs-clarification`, `adsm:rejected` | Transitional |
26
+ | `adsm:ready-for-validation` | Pull Request | `pull_request.labeled` via `pullRequestLabelAdded=adsm:ready-for-validation` | none, `adsm:needs-fix` | `adsm:verified`, `adsm:needs-fix` | Transitional |
27
+ | `adsm:verified` | Pull Request | `pull_request.labeled` via `pullRequestLabelAdded=adsm:verified` | `adsm:ready-for-validation` | merged | Transitional |
28
+ | `adsm:needs-fix` | Pull Request | `pull_request.labeled` via `pullRequestLabelAdded=adsm:needs-fix` | `adsm:ready-for-validation` | `adsm:ready-for-validation` | Blocking |
29
+
30
+ ## Terminal Outcome Labels
31
+
32
+ | Label | Applies To | Stage Trigger | Valid Previous States | Valid Next States | Class |
33
+ | ---------------- | ---------- | --------------------------- | --------------------------------------------------------- | ----------------- | ---------------- |
34
+ | `adsm:answered` | Issue | none; terminal outcome only | `issues.opened`, `adsm:needs-clarification`, `adsm:clarification-provided` | none | Terminal outcome |
35
+ | `adsm:rejected` | Issue | none; terminal outcome only | `issues.opened`, `adsm:needs-clarification`, `adsm:clarification-provided` | none | Terminal outcome |
36
+ | `adsm:completed` | Issue | none; terminal outcome only | merged Pull Request finalization | none | Terminal outcome |
37
+
38
+ ## State Notes
39
+
40
+ - `adsm:accepted` is used only when the issue requires repository changes that must be delivered through a Pull Request.
41
+ - `adsm:answered` is used when the issue is fully completed by an issue comment and repository changes are not required.
42
+ - `adsm:rejected` is used when the issue is outside this repository boundary or must not be executed.
43
+ - `adsm:needs-clarification` is used when the workflow cannot safely continue without trusted human input.
44
+ - `adsm:clarification-provided` is a resume marker and must replace, not accompany, `adsm:needs-clarification`.
45
+ - Validation comments for `adsm:ready-for-validation` must record the chosen state and the current Pull Request head SHA.
46
+ - `adsm:verified` is merge permission, not proof of merge completion.
47
+ - Merge completion is detected by `pull_request.closed` with `pullRequestMerged=true`.
48
+ - `adsm:completed` is used after a linked Pull Request is merged, finalization posts the closing summary, and the source issue is closed.
49
+
50
+ ## Repository Label Setup
51
+
52
+ Create the current workflow labels and terminal outcome labels in the repository with:
53
+
54
+ ```bash
55
+ gh label create "adsm:accepted" \
56
+ --repo "flancer32/skill-adsm-ctx" \
57
+ --color "0E8A16" \
58
+ --description "Issue accepted for repository changes through a Pull Request." \
59
+ --force
60
+
61
+ gh label create "adsm:answered" \
62
+ --repo "flancer32/skill-adsm-ctx" \
63
+ --color "0E8A16" \
64
+ --description "Issue answered without repository changes." \
65
+ --force
66
+
67
+ gh label create "adsm:rejected" \
68
+ --repo "flancer32/skill-adsm-ctx" \
69
+ --color "B60205" \
70
+ --description "Issue rejected as out of scope or unsuitable." \
71
+ --force
72
+
73
+ gh label create "adsm:completed" \
74
+ --repo "flancer32/skill-adsm-ctx" \
75
+ --color "0E8A16" \
76
+ --description "Issue completed after a linked Pull Request was merged." \
77
+ --force
78
+
79
+ gh label create "adsm:needs-clarification" \
80
+ --repo "flancer32/skill-adsm-ctx" \
81
+ --color "C2E0C6" \
82
+ --description "Issue waits for trusted user clarification." \
83
+ --force
84
+
85
+ gh label create "adsm:clarification-provided" \
86
+ --repo "flancer32/skill-adsm-ctx" \
87
+ --color "1D76DB" \
88
+ --description "Clarification added and ready for issue re-evaluation." \
89
+ --force
90
+
91
+ gh label create "adsm:ready-for-validation" \
92
+ --repo "flancer32/skill-adsm-ctx" \
93
+ --color "5319E7" \
94
+ --description "Pull Request ready for validation." \
95
+ --force
96
+
97
+ gh label create "adsm:verified" \
98
+ --repo "flancer32/skill-adsm-ctx" \
99
+ --color "0E8A16" \
100
+ --description "Pull Request validated and safe to merge." \
101
+ --force
102
+
103
+ gh label create "adsm:needs-fix" \
104
+ --repo "flancer32/skill-adsm-ctx" \
105
+ --color "E99695" \
106
+ --description "Pull Request requires another fix iteration." \
107
+ --force
108
+ ```
@@ -0,0 +1,82 @@
1
+ # GitHub Flows Workflow
2
+
3
+ - Path: `ctx/agent/flows/overview.md`
4
+ - Changed: `20260610`
5
+
6
+ ## Purpose
7
+
8
+ This workflow turns trusted GitHub issues in `flancer32/skill-adsm-ctx` into either terminal issue answers or reviewed repository changes through Pull Requests.
9
+
10
+ The workflow is private, label-driven, and agent-executed through `github-flows`.
11
+
12
+ ## Private Project Assumptions
13
+
14
+ - The repository is private and operated by three trusted users only.
15
+ - Workflow routing accepts events only from `flancer64`, `viktor-gusev`, and `adsm-agentess`.
16
+ - Repository changes are implemented directly in this repository, including `ctx/` when the issue requires context updates.
17
+ - The checked-out repository is the only workflow context source. The workflow uses the repository-local `ctx/` directory and does not fetch or mount context from another repository during runtime.
18
+ - The workflow uses native GitHub events as stage boundaries and does not model cross-event state inside `github-flows`.
19
+
20
+ ## Trigger Model
21
+
22
+ `github-flows` provides package-owned trigger attributes:
23
+
24
+ - `event`
25
+ - `repository`
26
+ - `action`
27
+ - `actorLogin`
28
+
29
+ This workflow also depends on host-provided event attributes:
30
+
31
+ - `sizeLess10K`
32
+ - `sizeLess100K`
33
+ - `sizeLess1M`
34
+ - `sizeLess2M`
35
+ - `issueLabelAdded`
36
+ - `issueLabelRemoved`
37
+ - `issueAuthorRequestedNoAgent`
38
+ - `pullRequestLabelAdded`
39
+ - `pullRequestLabelRemoved`
40
+ - `pullRequestMerged`
41
+
42
+ These extra attributes are part of the host application contract, not the package-owned base schema.
43
+
44
+ ## Processing Model
45
+
46
+ ![GitHub Flows Workflow](./.img/flancer32-skill-adsm-ctx-github-flows.png)
47
+
48
+ The workflow starts from a source issue. Admission may result in repository-change processing, answer-only completion, rejection, or clarification. Current workflow labels drive active processing. Terminal outcome labels classify closed issues. `adsm:accepted` means repository changes are required; it starts implementation that creates a Pull Request. `adsm:answered` means the issue is completed by a comment and no repository changes are required. `adsm:rejected` means the issue is closed as out of scope or unsuitable. `adsm:completed` means the issue is closed after the linked Pull Request is merged and finalization finishes. Clarification stays on the issue, while fix iterations stay on the Pull Request.
49
+
50
+ Cross-object transitions:
51
+
52
+ - `adsm:accepted` is an issue label. Its successful implementation outcome is not another issue label. It is a new Pull Request labeled `adsm:ready-for-validation`.
53
+ - `adsm:answered` and `adsm:rejected` are issue outcome labels only. They are terminal and do not create a branch or Pull Request.
54
+ - `adsm:ready-for-validation`, `adsm:needs-fix`, and `adsm:verified` are Pull Request labels only.
55
+ - After a merged Pull Request is detected, finalization returns to the linked source issue, posts the closing summary there, applies `adsm:completed`, and closes that issue.
56
+
57
+ ## Workflow Rules
58
+
59
+ - An issue is an input request, not a specification.
60
+ - Admission for `issues.opened` is intentionally minimal in this private workflow.
61
+ - Admission should first decide whether the issue belongs to this repository.
62
+ - If the issue belongs to this repository, admission should choose `adsm:answered` when a comment fully resolves it without repository changes, and `adsm:accepted` only when repository changes are required.
63
+ - `adsm:rejected` is used when the issue does not belong to this repository or must not be executed.
64
+ - `adsm:needs-clarification` is used when the workflow cannot safely continue without trusted human input.
65
+ - Comments provide evidence; labels drive transitions.
66
+ - Validation evidence on Pull Requests must record both the validation state and the current Pull Request head SHA.
67
+ - Agents must not push directly to `main`.
68
+ - Repository implementation must happen on a dedicated branch and must be delivered through a Pull Request.
69
+
70
+ ## Agent Policy
71
+
72
+ - `issues.opened`, `issues.labeled: adsm:clarification-provided`, `pull_request.labeled: adsm:ready-for-validation`, `pull_request.labeled: adsm:verified`, and `pull_request.closed` run with `gpt-5.4` and `model_reasoning_effort=medium`.
73
+ - `issues.labeled: adsm:accepted` and `pull_request.labeled: adsm:needs-fix` run with `gpt-5.4-mini` and `model_reasoning_effort=low`.
74
+ - The policy is encoded in `execution.handler.args` inside the profile fragments. The shared root defines the medium-reasoning command; implementation and fix fragments override it with the low-reasoning command.
75
+
76
+ ## End States
77
+
78
+ A successful run ends in one of two ways:
79
+
80
+ - the issue is answered by comment only, labeled `adsm:answered`, and closed without a branch or Pull Request;
81
+ - the issue is rejected, labeled `adsm:rejected`, and closed without a branch or Pull Request;
82
+ - a reviewed Pull Request is merged into `main`, a final source-issue comment links that Pull Request and summarizes the outcome, the source issue is labeled `adsm:completed`, and the linked source issue is closed.