@flancer32/skill-adsm-ctx 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +45 -18
  3. package/bin/adsm-ctx.mjs +44 -0
  4. package/migrations/README.md +5 -1
  5. package/package.json +65 -11
  6. package/skill/SKILL.md +5 -4
  7. package/skill/references/context-lifecycle.md +14 -6
  8. package/skill/references/design-questionnaire.md +13 -1
  9. package/skill/references/document-projections.md +40 -80
  10. package/skill/references/documentation-compression.md +3 -2
  11. package/skill/references/documentation-quality-audit.md +37 -14
  12. package/skill/references/orchestration-model.md +4 -3
  13. package/skill/references/semantic-skins.md +65 -0
  14. package/skill/references/specialized-skills.md +5 -2
  15. package/skill/references/upgrade-policy.md +16 -6
  16. package/skill/templates/ctx/adsm.json +4 -1
  17. package/skill/templates/ctx/docs/AGENTS.md +3 -0
  18. package/skill/templates/ctx/docs/code/testing.md +4 -0
  19. package/skill/templates/work/context/semantic-skin.md +11 -22
  20. package/src/Cli/Command/Design.mjs +17 -0
  21. package/src/Cli/Command/Init.mjs +22 -0
  22. package/src/Cli/Command/InstallSkill.mjs +18 -0
  23. package/src/Cli/Command/Upgrade.mjs +19 -0
  24. package/src/Cli/Command/Validate.mjs +19 -0
  25. package/src/Design/Service.mjs +9 -7
  26. package/src/Shared/Constants.mjs +5 -5
  27. package/src/Shared/Metadata.mjs +1 -0
  28. package/src/Upgrade/Service.mjs +3 -3
  29. package/src/Validate/Service.mjs +217 -259
  30. package/types.d.ts +5 -2
  31. package/.github/workflows/flows-app.yaml +0 -95
  32. package/AGENTS.md +0 -112
  33. package/bin/cli.mjs +0 -55
  34. package/ctx/AGENTS.md +0 -44
  35. package/ctx/README.md +0 -24
  36. package/ctx/adsm.json +0 -5
  37. package/ctx/agent/AGENTS.md +0 -41
  38. package/ctx/agent/flows/.img/flancer32-skill-adsm-ctx-github-flows.png +0 -0
  39. package/ctx/agent/flows/AGENTS.md +0 -37
  40. package/ctx/agent/flows/cfg/issues/labeled/accepted/profile.json +0 -25
  41. package/ctx/agent/flows/cfg/issues/labeled/accepted/prompt.md +0 -104
  42. package/ctx/agent/flows/cfg/issues/labeled/clarification-provided/profile.json +0 -15
  43. package/ctx/agent/flows/cfg/issues/labeled/clarification-provided/prompt.md +0 -63
  44. package/ctx/agent/flows/cfg/issues/opened/admission/profile.json +0 -14
  45. package/ctx/agent/flows/cfg/issues/opened/admission/prompt.md +0 -110
  46. package/ctx/agent/flows/cfg/profile.json +0 -40
  47. package/ctx/agent/flows/cfg/pull_request/closed/merged/profile.json +0 -15
  48. package/ctx/agent/flows/cfg/pull_request/closed/merged/prompt.md +0 -41
  49. package/ctx/agent/flows/cfg/pull_request/labeled/needs-fix/profile.json +0 -25
  50. package/ctx/agent/flows/cfg/pull_request/labeled/needs-fix/prompt.md +0 -79
  51. package/ctx/agent/flows/cfg/pull_request/labeled/ready-for-validation/profile.json +0 -15
  52. package/ctx/agent/flows/cfg/pull_request/labeled/ready-for-validation/prompt.md +0 -72
  53. package/ctx/agent/flows/cfg/pull_request/labeled/verified/profile.json +0 -15
  54. package/ctx/agent/flows/cfg/pull_request/labeled/verified/prompt.md +0 -48
  55. package/ctx/agent/flows/deployment.md +0 -116
  56. package/ctx/agent/flows/labels.md +0 -108
  57. package/ctx/agent/flows/overview.md +0 -82
  58. package/ctx/agent/prompt/cli/ai-intro.md +0 -141
  59. package/ctx/assets/.gitkeep +0 -1
  60. package/ctx/docs/AGENTS.md +0 -121
  61. package/ctx/docs/ai-intro.md +0 -37
  62. package/ctx/docs/architecture/AGENTS.md +0 -98
  63. package/ctx/docs/architecture/behavior.md +0 -68
  64. package/ctx/docs/architecture/checklists.md +0 -48
  65. package/ctx/docs/architecture/constraints.md +0 -53
  66. package/ctx/docs/architecture/constraints.skin.en.md +0 -38
  67. package/ctx/docs/architecture/decisions.md +0 -118
  68. package/ctx/docs/architecture/integration.md +0 -31
  69. package/ctx/docs/architecture/overview.md +0 -76
  70. package/ctx/docs/architecture/state.md +0 -50
  71. package/ctx/docs/architecture/structure.md +0 -38
  72. package/ctx/docs/architecture/supervision.md +0 -71
  73. package/ctx/docs/code/AGENTS.md +0 -51
  74. package/ctx/docs/code/overview.md +0 -53
  75. package/ctx/docs/code/testing.md +0 -26
  76. package/ctx/docs/environment/AGENTS.md +0 -50
  77. package/ctx/docs/environment/overview.md +0 -33
  78. package/ctx/docs/filesystem.md +0 -44
  79. package/ctx/docs/product/AGENTS.md +0 -51
  80. package/ctx/docs/product/domain.md +0 -63
  81. package/ctx/docs/product/domain.skin.en.md +0 -40
  82. package/ctx/docs/product/glossary.md +0 -31
  83. package/ctx/docs/product/overview.md +0 -112
  84. package/ctx/docs/product/overview.skin.en.md +0 -38
  85. package/ctx/docs/product/roles.md +0 -17
  86. package/ctx/docs/product/use-cases.md +0 -15
  87. package/src/Bootstrap/Cli.mjs +0 -62
  88. package/src/Bootstrap.mjs +0 -108
  89. package/test/integration/.gitkeep +0 -1
  90. package/test/integration/cli-help.test.mjs +0 -15
  91. package/test/integration/cli-init-validate.test.mjs +0 -223
  92. package/test/integration/cli-install-skill.test.mjs +0 -41
  93. package/test/unit/Bootstrap/Cli.test.mjs +0 -23
  94. package/test/unit/Bootstrap.test.mjs +0 -53
  95. package/test/unit/Design/Service.test.mjs +0 -11
  96. package/test/unit/Init/Service.test.mjs +0 -51
  97. package/test/unit/Shared/Constants.test.mjs +0 -21
  98. package/test/unit/Shared/CopyDirectory.test.mjs +0 -31
  99. package/test/unit/Shared/Metadata.test.mjs +0 -9
  100. package/test/unit/Shared/Path.test.mjs +0 -11
  101. package/test/unit/Skill/Installer.test.mjs +0 -20
  102. package/test/unit/Upgrade/Service.test.mjs +0 -13
  103. package/test/unit/Validate/Service.test.mjs +0 -760
@@ -1,95 +0,0 @@
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 DELETED
@@ -1,112 +0,0 @@
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/bin/cli.mjs DELETED
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from "node:fs/promises";
4
- import path from "node:path";
5
- import processModule from "node:process";
6
- import {fileURLToPath} from "node:url";
7
-
8
- import Container from "@teqfw/di/src/Container.mjs";
9
- import NamespaceRegistry from "@teqfw/di/src/Config/NamespaceRegistry.mjs";
10
-
11
- const __filename = fileURLToPath(import.meta.url);
12
- const __dirname = path.dirname(__filename);
13
- const packageRoot = path.resolve(__dirname, "..");
14
- const projectRoot = processModule.cwd();
15
-
16
- const container = new Container();
17
- const namespaceRegistry = new NamespaceRegistry({fs, path, appRoot: packageRoot});
18
- const entries = await namespaceRegistry.build();
19
-
20
- for (const entry of entries) {
21
- container.addNamespaceRoot(entry.prefix, entry.dirAbs, entry.ext);
22
- }
23
-
24
- const cliArgs = processModule.argv.slice(2);
25
- const app = await container.get("Fl32_Skill_Adsm_Ctx_Bootstrap$");
26
-
27
- let exitCode = 1;
28
- let stopRequested = false;
29
-
30
- const stopApp = async function () {
31
- if (stopRequested) return;
32
- stopRequested = true;
33
- try {
34
- await app.stop();
35
- } catch (error) {
36
- console.error(error);
37
- }
38
- };
39
-
40
- for (const signal of ["SIGINT", "SIGTERM"]) {
41
- processModule.once(signal, () => {
42
- void stopApp();
43
- });
44
- }
45
-
46
- try {
47
- exitCode = await app.run({projectRoot, cliArgs});
48
- } catch (error) {
49
- console.error(error);
50
- exitCode = 1;
51
- } finally {
52
- await stopApp();
53
- }
54
-
55
- processModule.exit(typeof exitCode === "number" ? exitCode : 1);
package/ctx/AGENTS.md DELETED
@@ -1,44 +0,0 @@
1
- # Cognitive Context
2
-
3
- - Path: `ctx/AGENTS.md`
4
- - Template Version: `20260702`
5
- - Changed: `20260707`
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.
package/ctx/README.md DELETED
@@ -1,24 +0,0 @@
1
- # Cognitive Context
2
-
3
- - Path: `ctx/README.md`
4
- - Template Version: `20260623`
5
- - Changed: `20260702`
6
-
7
- ## Purpose
8
-
9
- This directory contains the project cognitive context.
10
-
11
- The cognitive context is the authoritative project knowledge space used by humans and agents when maintaining the project.
12
-
13
- ## Entry Points
14
-
15
- - Read `AGENTS.md` for cognitive-context structure and governance rules.
16
- - Read `docs/filesystem.md` for the top-level repository map.
17
- - Read `docs/` for declarative project documentation.
18
- - Read `agent/` only when working with repository-local agent operations or workflow assets.
19
-
20
- ## Boundary
21
-
22
- This directory defines project knowledge and agent-operational context.
23
-
24
- It does not replace product source code, runtime configuration, deployment secrets, or generated build artifacts.
package/ctx/adsm.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "schema": "adsm-context",
3
- "version": "0.1.0",
4
- "initializedAt": "2026-06-04"
5
- }
@@ -1,41 +0,0 @@
1
- # Agent External Context
2
-
3
- - Path: `ctx/agent/AGENTS.md`
4
- - Changed: `20260707`
5
-
6
- ## Purpose
7
-
8
- Defines the boundary of `ctx/agent/` for this repository.
9
-
10
- This branch is reserved for materials that document relationships, routines, and tool-facing instructions that sit outside ADSM methodology.
11
-
12
- Only this file belongs to the ADSM template baseline for `ctx/agent/`.
13
-
14
- Humans and agents may create project-local subdirectories here when they need instructions or records tied to a concrete tool or relationship, such as `github-flows`.
15
-
16
- ## Level Map
17
-
18
- - `flows/` — operational workflow documentation and configuration for repository automation driven by labels and GitHub events.
19
- - `prompt/` — prompt definitions used by agents when generating or maintaining repository-facing context artifacts.
20
- - `report/` — task-specific agent reports produced during repository-local analysis or maintenance work.
21
- - `AGENTS.md` — level definition for `ctx/agent/`.
22
-
23
- ## Level Boundary
24
-
25
- Defines:
26
-
27
- - The reserved role of `ctx/agent/` as a repository-local branch outside ADSM methodology.
28
- - The boundary between ADSM-governed context and project-local agent or tool materials.
29
- - The rule that only `ctx/agent/AGENTS.md` is part of the template-managed baseline for this branch.
30
-
31
- Does NOT define:
32
-
33
- - Product meaning, domain scope, or user-facing requirements.
34
- - Architecture ownership, system structure, or product-level engineering constraints.
35
- - The required shape of project-local subdirectories created for concrete tools or relationships.
36
-
37
- ## Operational Constraints
38
-
39
- - Materials placed under project-local subdirectories in `ctx/agent/` remain outside ADSM methodology unless a higher-level context document explicitly says otherwise.
40
- - Tool-specific instructions under this branch must stay consistent with authoritative constraints in `ctx/docs/`.
41
- - Changes that alter agent authority or escalation expectations must remain consistent with `ctx/docs/architecture/supervision.md`.
@@ -1,37 +0,0 @@
1
- # Agent Workflow Context
2
-
3
- - Path: `ctx/agent/flows/AGENTS.md`
4
- - Changed: `20260610`
5
-
6
- ## Purpose
7
-
8
- Defines the structure of workflow-specific operational context for repository automation.
9
-
10
- ## Level Map
11
-
12
- - `.img/` — supporting workflow diagrams and other visual assets referenced by the workflow documentation.
13
- - `cfg/` — executable workflow profile fragments and shared configuration consumed by `github-flows`.
14
- - `AGENTS.md` — level definition for `ctx/agent/flows/`.
15
- - `deployment.md` — deployment notes for publishing and activating the workflow configuration.
16
- - `labels.md` — label taxonomy and label semantics used by the workflow.
17
- - `overview.md` — workflow model, trigger assumptions, processing rules, and end-state definitions.
18
-
19
- ## Level Boundary
20
-
21
- Defines:
22
-
23
- - Workflow-specific operational semantics and end-state rules.
24
- - Label-driven routing and executable workflow configuration boundaries.
25
- - Deployment notes and packaging constraints for the workflow bundle.
26
-
27
- Does NOT define:
28
-
29
- - Generic repository architecture or product structure outside workflow concerns.
30
- - Product-level meaning, domain intent, or package positioning.
31
- - Implementation details of CLI lifecycle commands or unrelated runtime logic.
32
-
33
- ## Workflow Documentation Constraints
34
-
35
- - `overview.md` defines the workflow model and remains the primary narrative source of truth for routing behavior.
36
- - `labels.md` defines stable label semantics and must stay aligned with `cfg/`.
37
- - `cfg/` contains executable profile fragments and must not silently diverge from the documented workflow model.
@@ -1,25 +0,0 @@
1
- {
2
- "trigger": {
3
- "event": "issues",
4
- "action": "labeled",
5
- "issueLabelAdded": "adsm:accepted"
6
- },
7
- "execution": {
8
- "handler": {
9
- "args": [
10
- "exec",
11
- "--model",
12
- "gpt-5.4-mini",
13
- "-c",
14
- "model_reasoning_effort=low",
15
- "--dangerously-bypass-approvals-and-sandbox",
16
- "-C",
17
- "/workspace/repo"
18
- ],
19
- "promptRef": "prompt.md",
20
- "promptVariables": {
21
- "ISSUE_NUMBER": "event.issue.number"
22
- }
23
- }
24
- }
25
- }
@@ -1,104 +0,0 @@
1
- You are a Codex agent working inside the repository workspace.
2
-
3
- Agent role: `implementation-agent`.
4
-
5
- The repository context is mounted at `ctx/`.
6
-
7
- Your task is to implement the accepted GitHub issue and deliver the repository change through a Pull Request.
8
-
9
- ## Operating contract
10
-
11
- - work only from the source issue and repository context;
12
- - read the issue first, then inspect only the relevant `ctx/` documents and source files;
13
- - make the minimal necessary repository change;
14
- - update tests only when needed for the requested change;
15
- - avoid unrelated refactoring;
16
- - do not treat the issue text as project truth;
17
- - do not push directly to `main`.
18
-
19
- ## Technical event facts
20
-
21
- Repository: {{REPOSITORY}}
22
- Issue: #{{ISSUE_NUMBER}}
23
-
24
- ## Required issue read
25
-
26
- ```bash
27
- gh issue view "{{ISSUE_NUMBER}}" \
28
- --repo "{{REPOSITORY}}" \
29
- --comments \
30
- --json number,title,body,labels,comments,url
31
- ```
32
-
33
- Inspect `package.json` scripts first. Prefer existing test, lint, check, or validation scripts. Do not invent new validation commands.
34
-
35
- ## Required outcome
36
-
37
- 1. read the issue and its relevant comments;
38
- 2. inspect only the relevant project context and source files;
39
- 3. confirm that repository file changes are actually required for this issue;
40
- 4. create the correct dedicated branch from the current `main` branch;
41
- 5. implement only the requested repository change needed to resolve the issue;
42
- 6. update tests only when needed;
43
- 7. run the available validation commands;
44
- 8. create one Pull Request against `main`;
45
- 9. link the Pull Request to the source issue using a non-closing reference such as `Source issue: {{REPOSITORY}}#{{ISSUE_NUMBER}}`;
46
- 10. remove stale `adsm:*` Pull Request labels from that Pull Request, then add `adsm:ready-for-validation`;
47
- 11. post a concise summary comment to the source issue.
48
-
49
- ## Label handling rules
50
-
51
- Read the current labels first.
52
- Remove only labels whose name starts with `adsm:`.
53
- Keep unrelated labels unchanged.
54
- Add exactly one next workflow label.
55
-
56
- Removable ADSM labels on the current issue or Pull Request:
57
-
58
- - `adsm:accepted`
59
- - `adsm:answered`
60
- - `adsm:rejected`
61
- - `adsm:needs-clarification`
62
- - `adsm:clarification-provided`
63
- - `adsm:ready-for-validation`
64
- - `adsm:verified`
65
- - `adsm:needs-fix`
66
-
67
- Remove only the listed ADSM labels that are actually present on the current issue or Pull Request. Keep all unrelated labels unchanged.
68
-
69
- For the created or updated Pull Request, the next workflow label must be exactly `adsm:ready-for-validation`.
70
-
71
- If you need to change issue labels during failure handling, remove stale issue `adsm:*` labels first and keep unrelated issue labels unchanged. Do not remove labels from unrelated issues or Pull Requests.
72
-
73
- After creating the Pull Request, read or capture the created Pull Request number and use that number for Pull Request label operations.
74
-
75
- Simple command pattern:
76
-
77
- ```bash
78
- gh pr edit "<created-pr-number>" --repo "{{REPOSITORY}}" --remove-label "adsm:needs-fix"
79
- gh pr edit "<created-pr-number>" --repo "{{REPOSITORY}}" --add-label "adsm:ready-for-validation"
80
- ```
81
-
82
- Use a branch name in the form:
83
-
84
- ```text
85
- adsm/issue-{{ISSUE_NUMBER}}-<short-slug>
86
- ```
87
-
88
- ## Failure handling
89
-
90
- - if no repository changes are required, do not create a branch or Pull Request, post a comment on the source issue explaining that no repository changes are needed, remove stale `adsm:*` issue labels from the current issue, then add `adsm:answered` and stop;
91
- - if required project context is still not sufficient to proceed safely, explain the missing context in an issue comment, remove stale `adsm:*` issue labels from the current issue, then add `adsm:needs-clarification`;
92
- - if the issue still needs clarification, explain it in an issue comment, remove stale `adsm:*` issue labels from the current issue, then add `adsm:needs-clarification`;
93
- - if the work hits a concrete internal blocker that cannot be resolved in this stage, explain it in an issue comment, remove stale `adsm:*` issue labels from the current issue, then add `adsm:needs-clarification` with one specific follow-up question for a trusted human.
94
-
95
- ## Pull Request rules
96
-
97
- - create or update only one dedicated branch for this issue;
98
- - create exactly one active Pull Request for that branch;
99
- - before creating a branch or Pull Request, confirm that repository file changes are required;
100
- - 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;
101
- - add `adsm:ready-for-validation` only after commits are pushed and the Pull Request is ready;
102
- - after creating the Pull Request, ensure that the Pull Request has exactly one workflow label: `adsm:ready-for-validation`;
103
- - do not merge the Pull Request in this stage.
104
- - if no validation command exists, say that clearly in the summary instead of claiming validation ran.
@@ -1,15 +0,0 @@
1
- {
2
- "trigger": {
3
- "event": "issues",
4
- "action": "labeled",
5
- "issueLabelAdded": "adsm:clarification-provided"
6
- },
7
- "execution": {
8
- "handler": {
9
- "promptRef": "prompt.md",
10
- "promptVariables": {
11
- "ISSUE_NUMBER": "event.issue.number"
12
- }
13
- }
14
- }
15
- }
@@ -1,63 +0,0 @@
1
- You are a Codex agent working inside the repository workspace.
2
-
3
- Agent role: `clarification-agent`.
4
-
5
- The repository context is mounted at `ctx/`.
6
-
7
- Your task is to resume issue processing after a trusted user provided clarification.
8
-
9
- Make an evidence-based decision from the issue body, the latest clarification comments, and the relevant `ctx/` context.
10
-
11
- ## Technical event facts
12
-
13
- Repository: {{REPOSITORY}}
14
- Issue: #{{ISSUE_NUMBER}}
15
-
16
- ## Required issue read
17
-
18
- ```bash
19
- gh issue view "{{ISSUE_NUMBER}}" \
20
- --repo "{{REPOSITORY}}" \
21
- --comments \
22
- --json number,title,body,labels,comments,url
23
- ```
24
-
25
- Focus on the latest clarification comments and the previous blocking question.
26
-
27
- ## Decision rules
28
-
29
- - if the issue is now clear enough and requires repository changes, replace `adsm:clarification-provided` with `adsm:accepted`;
30
- - if the issue is now clear enough and can be fully completed by an issue comment without repository changes, post that answer and replace `adsm:clarification-provided` with `adsm:answered`;
31
- - if the clarification shows that the issue is outside repository scope or must not be executed, post the rejection reason and replace `adsm:clarification-provided` with `adsm:rejected`;
32
- - if the issue is still unclear, replace `adsm:clarification-provided` with `adsm:needs-clarification`;
33
- - if the workflow is still inconsistent or another concrete internal blocker remains, replace `adsm:clarification-provided` with `adsm:needs-clarification` and ask one specific follow-up question for a trusted human.
34
-
35
- Use the same private-workflow assumptions as admission:
36
-
37
- - trusted users only;
38
- - no hostile-user screening is required;
39
- - if the issue belongs to this repository and is now clear enough, prefer `adsm:answered` when no repository changes are required and `adsm:accepted` only when repository changes are required.
40
-
41
- Post one concise issue comment before changing the label.
42
-
43
- Use this comment structure:
44
-
45
- ```markdown
46
- ### Clarification review
47
-
48
- State: `adsm:accepted` | `adsm:answered` | `adsm:rejected` | `adsm:needs-clarification`
49
-
50
- Reason:
51
-
52
- <one short paragraph>
53
- ```
54
-
55
- If the new state is `adsm:needs-clarification`, include one specific follow-up question.
56
- If the new state is `adsm:answered`, make the comment itself contain the final answer and say that no repository changes are required.
57
- If the new state is `adsm:rejected`, make the comment itself contain the rejection reason, replace the current workflow label with `adsm:rejected`, and close the issue.
58
-
59
- If the new state is `adsm:answered`, replace the current workflow label with `adsm:answered`, close the issue, and do not create a Pull Request.
60
-
61
- Before applying the next workflow label, remove all existing stale current workflow `adsm:*` labels from the current issue. Keep unrelated labels unchanged.
62
-
63
- Do not add `adsm:accepted` as a second workflow label. Replace the current label.
@@ -1,14 +0,0 @@
1
- {
2
- "trigger": {
3
- "event": "issues",
4
- "action": "opened"
5
- },
6
- "execution": {
7
- "handler": {
8
- "promptRef": "prompt.md",
9
- "promptVariables": {
10
- "ISSUE_NUMBER": "event.issue.number"
11
- }
12
- }
13
- }
14
- }