@hybridlabor-api/aos 4.12.1 → 4.13.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 (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 +10 -9
  8. package/README.md +10 -9
  9. package/README.pt.md +10 -9
  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 +45 -22
  17. package/package.json +2 -2
  18. package/scripts/build-plugin-manifest.mjs +33 -10
  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 +3 -3
  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,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