@hybridlabor-api/aos 4.12.0 → 4.13.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 (33) hide show
  1. package/.agents/vendor-manifest.json +6 -0
  2. package/.claude/agents/reviewer.md +1 -1
  3. package/.claude/agents/techlead.md +1 -1
  4. package/.opencode/agents/architect.md +1 -1
  5. package/.opencode/agents/reviewer.md +1 -1
  6. package/.opencode/agents/techlead.md +1 -1
  7. package/README.de.md +297 -725
  8. package/README.md +295 -831
  9. package/README.pt.md +317 -677
  10. package/THIRD_PARTY_NOTICES.md +94 -0
  11. package/bin/aos-store.mjs +48 -45
  12. package/installer.js +22 -20
  13. package/lib/scenario-store-index.json +1 -0
  14. package/lib/store-shared.mjs +81 -4
  15. package/lib/store-ui/index.html +14 -5
  16. package/lib/store-ui/server.mjs +44 -21
  17. package/package.json +2 -2
  18. package/scripts/build-plugin-manifest.mjs +36 -13
  19. package/scripts/build-scenario-store-index.mjs +154 -0
  20. package/skills/bdbrainstorm/SKILL.md +1 -0
  21. package/skills/global_config/agent-pipeline/SKILL.md +4 -0
  22. package/skills/global_config/aos-store/SKILL.md +4 -4
  23. package/skills/global_config/design-control-loop/SKILL.md +184 -0
  24. package/skills/global_config/design-control-loop/references/agent-iteration.ts +174 -0
  25. package/skills/global_config/design-control-loop/references/agent-runner-templates.md +157 -0
  26. package/skills/global_config/design-control-loop/references/control-loop-taxonomy.md +75 -0
  27. package/skills/global_config/design-control-loop/references/example-control-loop.md +57 -0
  28. package/skills/global_config/design-control-loop/references/example-skill.md +171 -0
  29. package/skills/global_config/design-control-loop/references/memory-template.md +7 -0
  30. package/skills/global_config/design-control-loop/references/prompt-template.md +58 -0
  31. package/skills/global_config/design-control-loop/references/response-template.md +103 -0
  32. package/skills/global_config/design-control-loop/references/skill-template.md +57 -0
  33. package/skills/global_config/design-control-loop/references/workflow-template.yml +273 -0
@@ -0,0 +1,58 @@
1
+ # Context
2
+
3
+ You are <task summary> in this repository. Begin by using the `<skill-name>` skill.
4
+
5
+ # Scope
6
+
7
+ Focus only on `<primary path or package>`.
8
+
9
+ You may inspect `<secondary path>` only when it is necessary to understand or validate the primary change.
10
+
11
+ # Instructions
12
+
13
+ 1. <Work the target(s) the controller selected (see "Selected work" if present); otherwise find high-confidence targets yourself.>
14
+ 2. <Keep this to one small, reviewable increment.>
15
+ 3. <Use the real source of truth, not support-only examples.>
16
+ 4. <Avoid adjacent cleanup that belongs to another workflow.>
17
+ 5. Validate with the commands below.
18
+ 6. Commit and push your changes.
19
+
20
+ ## Validation Commands
21
+
22
+ ```bash
23
+ <validation command 1>
24
+ <validation command 2>
25
+ ```
26
+
27
+ ## Important Rules
28
+
29
+ - <Rule that prevents the most likely wrong change.>
30
+ - <Rule that keeps scope narrow.>
31
+ - Do not run long integration tests unless explicitly requested.
32
+ - You are running in a sandbox or CI runner environment. Do not stop and ask for feedback from the user or request approvals.
33
+
34
+ ## Finishing Up
35
+
36
+ When you are finished:
37
+
38
+ 1. Make sure the validation commands pass.
39
+ 2. Commit and push your changes.
40
+ 3. Answer with the output format below.
41
+
42
+ ## Output Format
43
+
44
+ Format your final answer as GitHub-flavored markdown:
45
+
46
+ ```markdown
47
+ ## <Task Title> Complete
48
+
49
+ ### Changes Made
50
+ - [file/component]: [what changed and why]
51
+
52
+ ### Source Of Truth Checked
53
+ - [path]: [why it supports the change]
54
+
55
+ ### Validation
56
+ - [x] <validation command 1> passed
57
+ - [x] <validation command 2> passed
58
+ ```
@@ -0,0 +1,103 @@
1
+ # Response Template
2
+
3
+ This template defines how the CI agent should format its final response, which becomes the body of the GitHub PR.
4
+
5
+ Customize this template based on the task type and what information reviewers need.
6
+
7
+ ---
8
+
9
+ ## Example: Fix/Migration Task
10
+
11
+ ```markdown
12
+ Finished processing N `<tool-name>` issues:
13
+ - `resolved`: X
14
+ - `ignored`: Y
15
+ - `skipped`: Z
16
+
17
+ Details below:
18
+
19
+ ---
20
+
21
+ ## Issue 1
22
+ - **File(s)**: `path/to/file.ts`
23
+ - **Summary**: [concise description of the issue]
24
+ - **Resolution**: **FIXED**. [concise description of the fix]
25
+ - **Risk**: [HIGH / medium / low]
26
+ - **Manual verification** (for HIGH/medium risk): [steps to test the changes]
27
+
28
+ ## Issue 2
29
+ - **File(s)**: `path/to/other.ts`
30
+ - **Summary**: [...]
31
+ - **Resolution**: **IGNORED**. [why the rule was added to ignore list]
32
+
33
+ ## Issue 3
34
+ - **File(s)**: `path/to/another.ts`
35
+ - **Summary**: [...]
36
+ - **Resolution**: **SKIPPED**. [why this needs human attention]
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Example: Generation Task
42
+
43
+ ```markdown
44
+ Generated N new <artifact type>:
45
+
46
+ | File | Description | Status |
47
+ |------|-------------|--------|
48
+ | `path/to/new-file.ts` | [what was generated] | Created |
49
+ | `path/to/updated.ts` | [what changed] | Updated |
50
+
51
+ ## Validation
52
+ - Typecheck: PASS
53
+ - Tests: PASS
54
+ - Lint: PASS
55
+
56
+ ## Notes
57
+ [Any context reviewers should know]
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Example: Refactor Task
63
+
64
+ ```markdown
65
+ Refactored N components/modules:
66
+
67
+ ## Changes
68
+
69
+ ### `path/to/file.ts`
70
+ - **Before**: [brief description of old pattern]
71
+ - **After**: [brief description of new pattern]
72
+ - **Risk**: low
73
+
74
+ ### `path/to/other.ts`
75
+ - **Before**: [...]
76
+ - **After**: [...]
77
+ - **Risk**: medium
78
+ - **Verify**: [how to test this change]
79
+
80
+ ## Validation
81
+ - Typecheck: PASS
82
+ - Tests: PASS
83
+ - No behavior changes expected
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Template Variables
89
+
90
+ When writing your response template, you can use these placeholders:
91
+
92
+ - `<tool-name>` - The CLI tool or process that found issues
93
+ - `<artifact-type>` - What the agent creates (tests, types, docs, etc.)
94
+ - `<task-name>` - The name of the agent task
95
+ - `<date>` - Current date (MM/DD format)
96
+
97
+ ## Guidelines
98
+
99
+ 1. **Lead with summary stats** - Reviewers should know scope immediately
100
+ 2. **Group by resolution type** - Fixed, ignored, skipped, or created
101
+ 3. **Include risk levels and highlight prominently** - Help reviewers prioritize their review
102
+ 4. **Provide verification steps** - For medium/high risk changes
103
+ 5. **Keep it scannable and concise** - Use tables, headers, and bullet points.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: <skill-name>
3
+ description: <leading verb> <task> when <trigger>; use <source of truth> instead of <wrong source>
4
+ ---
5
+
6
+ # <Skill Title>
7
+
8
+ Use this skill when <the user or workflow asks for the repeatable agent task>.
9
+
10
+ The goal is to <one-sentence invariant the agent should preserve>.
11
+
12
+ ## Core Requirements
13
+
14
+ - <Rule that identifies the live source of truth.>
15
+ - <Rule that names inputs that must not drive the decision.>
16
+ - <Rule that keeps the change reviewable.>
17
+ - <Rule that defines the validation bar.>
18
+
19
+ ## Workflow
20
+
21
+ ### 1. Find the target
22
+
23
+ <How to identify candidate files/components/issues.>
24
+
25
+ Completion criterion: <observable condition that proves the target was selected correctly>.
26
+
27
+ ### 2. Inspect the source of truth
28
+
29
+ <What to read before editing.>
30
+
31
+ Completion criterion: <observable condition that proves the agent did enough legwork>.
32
+
33
+ ### 3. Make the smallest safe change
34
+
35
+ <How to edit without broadening scope. Include multiple steps / workflow if necessary.>
36
+
37
+ Completion criterion: <observable condition that proves the change matches the source of truth>.
38
+
39
+ ### 4. Validate
40
+
41
+ Run the narrowest relevant validation first, then the repo-required quality gate.
42
+
43
+ Completion criterion: validation passes or the final report names the exact blocker.
44
+
45
+ ### 5. Format the response
46
+
47
+ When running as a CI agent, format your final response according to `references/response-template.md`. This response becomes the PR body.
48
+
49
+ Completion criterion: the response follows the template structure and includes all required information for reviewers.
50
+
51
+ ## Review Checklist
52
+
53
+ - The source of truth was inspected before editing.
54
+ - The change does not encode support-code-only states as real behavior.
55
+ - The diff is small enough to review.
56
+ - The validation command passed or the blocker is documented.
57
+ - The final response follows the response template.
@@ -0,0 +1,273 @@
1
+ # Agent <Task Title> - iterated control loop
2
+ #
3
+ # This workflow has two modes:
4
+ # 1. scheduled/manual mode: run one sense -> control -> actuate iteration on a fresh agent
5
+ # branch and open a PR. When sensor/controller/actuator are fused, collapse them to one step.
6
+ # 2. /iterate mode: when a maintainer comments on an agent-created PR, update that PR
7
+ # and optionally update .github/agent-memory/<task-slug>.md for future runs.
8
+ #
9
+ # The /iterate path intentionally checks the PR body marker BEFORE checkout/setup so
10
+ # every agent workflow can listen for /iterate while non-matching workflows no-op cheaply.
11
+
12
+ name: "Agent: <Task Title>"
13
+
14
+ on:
15
+ schedule:
16
+ - cron: "0 13 * * *" # Update me based on user preferences
17
+ workflow_dispatch:
18
+ issue_comment:
19
+ types: [created] # for iteration!
20
+
21
+ permissions:
22
+ contents: write
23
+ pull-requests: write
24
+ issues: write
25
+
26
+ concurrency:
27
+ group: agent-<task-slug>
28
+ cancel-in-progress: true
29
+
30
+ jobs:
31
+ agent-task:
32
+ # Run all non-comment events. For issue comments, only authorized PR comments
33
+ # starting with /iterate are allowed to reach the marker preflight below.
34
+ if: |
35
+ github.event_name != 'issue_comment' ||
36
+ (
37
+ github.event.issue.pull_request &&
38
+ startsWith(github.event.comment.body, '/iterate') &&
39
+ (github.event.comment.author_association == 'OWNER' ||
40
+ github.event.comment.author_association == 'MEMBER' ||
41
+ github.event.comment.author_association == 'COLLABORATOR')
42
+ )
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - name: Check iterate marker to bound work-in-progress
46
+ id: agent_gate
47
+ env:
48
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
+ EVENT_NAME: ${{ github.event_name }}
50
+ GITHUB_REPOSITORY: ${{ github.repository }}
51
+ PR_URL: ${{ github.event.issue.pull_request.url }}
52
+ WORKFLOW_ID: agent-<task-slug>
53
+ AGENT_LABEL: agent-<task-slug>
54
+ run: |
55
+ # Scheduled runs no-op when an open PR already exists for this agent (flow control).
56
+ if [ "$EVENT_NAME" = "schedule" ] || [ "$EVENT_NAME" = "workflow_call" ]; then
57
+ EXISTING_PR=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --label "$AGENT_LABEL" --json number,url --limit 1)
58
+ if [ "$(echo "$EXISTING_PR" | jq 'length')" -gt 0 ]; then
59
+ echo "run_agent=false" >> "$GITHUB_OUTPUT"
60
+ echo "Open PR already exists for $AGENT_LABEL; no-op."
61
+ exit 0
62
+ fi
63
+ fi
64
+
65
+ # Manual runs are normal agent runs, so allow the rest of the job.
66
+ if [ "$EVENT_NAME" != "issue_comment" ]; then
67
+ echo "run_agent=true" >> "$GITHUB_OUTPUT"
68
+ exit 0
69
+ fi
70
+
71
+ # /iterate comments are shared by all recurring agent workflows. The hidden
72
+ # PR body marker deterministically routes the comment to the workflow that
73
+ # originally opened the PR. Non-matching workflows exit before checkout/setup.
74
+ PR_DATA=$(gh api "$PR_URL")
75
+ BODY=$(echo "$PR_DATA" | jq -r '.body // ""')
76
+ if grep -Fq "<!-- codelayer-agent:workflow=$WORKFLOW_ID;" <<< "$BODY"; then
77
+ echo "run_agent=true" >> "$GITHUB_OUTPUT"
78
+ echo "number=$(echo "$PR_DATA" | jq -r '.number')" >> "$GITHUB_OUTPUT"
79
+ echo "head_ref=$(echo "$PR_DATA" | jq -r '.head.ref')" >> "$GITHUB_OUTPUT"
80
+ echo "head_sha=$(echo "$PR_DATA" | jq -r '.head.sha')" >> "$GITHUB_OUTPUT"
81
+ else
82
+ echo "run_agent=false" >> "$GITHUB_OUTPUT"
83
+ echo "PR was not created by $WORKFLOW_ID; no-op."
84
+ fi
85
+
86
+ - uses: actions/checkout@v5
87
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name != 'issue_comment'
88
+ with:
89
+ fetch-depth: 0
90
+
91
+ - uses: actions/checkout@v5
92
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name == 'issue_comment'
93
+ with:
94
+ # Iteration updates the existing agent PR branch rather than creating a new one.
95
+ ref: ${{ steps.agent_gate.outputs.head_ref }}
96
+ fetch-depth: 0
97
+
98
+ - name: Configure git user & branch
99
+ if: steps.agent_gate.outputs.run_agent == 'true'
100
+ shell: bash
101
+ run: |
102
+ if [ "${{ github.event_name }}" != "issue_comment" ]; then
103
+ BRANCH="<branch-prefix>/$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
104
+ echo "BRANCH=$BRANCH" >> "$GITHUB_ENV"
105
+ git checkout -b "$BRANCH"
106
+ fi
107
+
108
+ git config user.name "github-actions[bot]"
109
+ git config user.email "github-actions[bot]@users.noreply.github.com"
110
+
111
+ # NOTE: setup below assumes a bun/Node repo. Replace with this repo's runtime + install.
112
+ - name: Install bun
113
+ if: steps.agent_gate.outputs.run_agent == 'true'
114
+ uses: oven-sh/setup-bun@v2
115
+ with:
116
+ bun-version: 1.3.14
117
+
118
+ - name: Install Node.js
119
+ if: steps.agent_gate.outputs.run_agent == 'true'
120
+ uses: actions/setup-node@v4
121
+ with:
122
+ node-version: 24
123
+
124
+ - name: Cache bun dependencies
125
+ if: steps.agent_gate.outputs.run_agent == 'true'
126
+ uses: actions/cache@v4
127
+ with:
128
+ path: ~/.bun/install/cache
129
+ key: bun-${{ runner.os }}-${{ hashFiles('**/bun.lock') }}
130
+ restore-keys: |
131
+ bun-${{ runner.os }}-
132
+
133
+ - name: Install dependencies
134
+ if: steps.agent_gate.outputs.run_agent == 'true'
135
+ run: bun install --frozen-lockfile
136
+
137
+ # --- Iteration path: a /iterate comment refines the existing PR ---
138
+ # Iteration is one actuator pass over reviewer feedback, not a fresh sense->control->actuate cycle.
139
+ - name: Actuator — iterate on feedback
140
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name == 'issue_comment'
141
+ env:
142
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
143
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144
+ FORCE_COLOR: "3"
145
+ GITHUB_REPOSITORY: ${{ github.repository }}
146
+ PR_NUMBER: ${{ steps.agent_gate.outputs.number }}
147
+ COMMENT_BODY: ${{ github.event.comment.body }}
148
+ run: |
149
+ set -o pipefail
150
+ # Build an iteration prompt from the PR body, comments, the /iterate feedback, and memory.
151
+ # NOTE: update the agent-iteration.ts path to where you installed it (.github/scripts/, ci-scripts/, scripts/).
152
+ bun .github/scripts/agent-iteration.ts \
153
+ --command prompt \
154
+ --workflow agent-<task-slug> \
155
+ --memory .github/agent-memory/<task-slug>.md \
156
+ --repo "$GITHUB_REPOSITORY" \
157
+ --pr-number "$PR_NUMBER" \
158
+ --comment-body "$COMMENT_BODY" > /tmp/agent-prompt.md
159
+
160
+ # NOTE: replace with your agent runner from references/agent-runner-templates.md
161
+ bunx @humanlayer/cli@latest codelayer \
162
+ --provider anthropic --model claude-sonnet-4-6 --thinking high \
163
+ --prompt "$(cat /tmp/agent-prompt.md)" \
164
+ 2>&1 | tee /tmp/agent-output.txt
165
+
166
+ # NOTE: replace with agent-specific extraction from references/agent-runner-templates.md
167
+ cat /tmp/agent-output.txt | sed 's/\x1b\[[0-9;]*m//g' > /tmp/pr-body.md
168
+
169
+ # --- Scheduled / manual path: one sense -> control -> actuate iteration ---
170
+ # If your sensor and controller are fused into the agent (or into one tool), collapse
171
+ # the next three steps into a single Actuator step — do not invent separation you don't have.
172
+
173
+ - name: Sensor — measure current state
174
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name != 'issue_comment'
175
+ run: |
176
+ # Run the sensor you designed and write a stable, normalized measurement.
177
+ # Replace with your sensor (lint / AST search / type-check / tests / telemetry / script / agent).
178
+ # Example shape:
179
+ # <sensor command> > /tmp/sensor-output.json
180
+ echo "TODO: run the sensor and write /tmp/sensor-output.json"
181
+
182
+ - name: Controller — select the next increment
183
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name != 'issue_comment'
184
+ run: |
185
+ # Consume /tmp/sensor-output.json and choose what to change this run, within scope
186
+ # and batch size. Deterministic example: sort findings and take the top N.
187
+ # If the agent itself is the controller, delete this step.
188
+ # Example shape:
189
+ # <controller command> /tmp/sensor-output.json > /tmp/controller-output.md
190
+ echo "TODO: select target(s) and write /tmp/controller-output.md"
191
+
192
+ - name: Actuator — run the coding agent
193
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name != 'issue_comment'
194
+ env:
195
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
196
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197
+ FORCE_COLOR: "3"
198
+ run: |
199
+ set -o pipefail
200
+ MEMORY_CONTENT="$(cat .github/agent-memory/<task-slug>.md)"
201
+ CONTROLLER_OUTPUT="$(cat /tmp/controller-output.md 2>/dev/null || true)"
202
+
203
+ PROMPT="$(cat <<EOF
204
+ <paste prompt-template.md here and replace placeholders>
205
+
206
+ ## Selected work (controller output)
207
+
208
+ $CONTROLLER_OUTPUT
209
+
210
+ ## Agent Memory
211
+
212
+ $MEMORY_CONTENT
213
+ EOF
214
+ )"
215
+
216
+ # NOTE: replace this block with your agent runner from references/agent-runner-templates.md.
217
+ # Each agent has different output formats — see that file for extraction steps.
218
+ bunx @humanlayer/cli@latest codelayer \
219
+ --provider anthropic --model claude-opus-4-8 --thinking high \
220
+ --prompt "$PROMPT" \
221
+ 2>&1 | tee /tmp/agent-output.txt
222
+
223
+ # NOTE: response extraction is agent-specific — see references/agent-runner-templates.md.
224
+ - name: Extract PR body
225
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name != 'issue_comment'
226
+ run: |
227
+ # CodeLayer example — strip ANSI codes. Replace with your agent's extraction.
228
+ cat /tmp/agent-output.txt | sed 's/\x1b\[[0-9;]*m//g' > /tmp/pr-body.md
229
+
230
+ - name: Push and create PR
231
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name != 'issue_comment'
232
+ env:
233
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
234
+ AGENT_LABEL: agent-<task-slug>
235
+ WORKFLOW_ID: agent-<task-slug>
236
+ run: |
237
+ if git diff --quiet origin/main...HEAD; then
238
+ echo "No commits were created by the agent; skipping PR creation."
239
+ exit 0
240
+ fi
241
+
242
+ git push --set-upstream origin "${{ env.BRANCH }}"
243
+
244
+ # Add the hidden workflow marker to the PR body for /iterate routing.
245
+ # NOTE: Update the path to agent-iteration.ts based on where you installed it
246
+ bun .github/scripts/agent-iteration.ts \
247
+ --command footer \
248
+ --workflow "$WORKFLOW_ID" \
249
+ --memory .github/agent-memory/<task-slug>.md >> /tmp/pr-body.md
250
+
251
+ gh label create "$AGENT_LABEL" --description "Recurring <Task Title> agent PR" --color "0E8A16" || true
252
+ PR_URL=$(gh pr create --title "[$(date +%m/%d)] <Task Title>" --body-file /tmp/pr-body.md)
253
+ gh pr edit "$PR_URL" --add-label "$AGENT_LABEL"
254
+
255
+ - name: Push iteration changes and comment
256
+ if: steps.agent_gate.outputs.run_agent == 'true' && github.event_name == 'issue_comment'
257
+ env:
258
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
259
+ run: |
260
+ if ! git diff --quiet HEAD; then
261
+ git add -A
262
+ git commit -m "chore: iterate <task-slug> agent feedback"
263
+ git push origin HEAD:${{ steps.agent_gate.outputs.head_ref }}
264
+ fi
265
+
266
+ gh pr comment ${{ steps.agent_gate.outputs.number }} --body-file /tmp/pr-body.md
267
+
268
+ - name: Upload agent output
269
+ if: always() && steps.agent_gate.outputs.run_agent == 'true'
270
+ uses: actions/upload-artifact@v4
271
+ with:
272
+ name: agent-output
273
+ path: /tmp/agent-output.txt