agent-afk 5.127.2 → 5.127.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled-plugins/awa-bundled/skills/ground-state/SKILL.md +45 -28
- package/dist/cli.mjs +399 -399
- package/dist/index.mjs +1 -1
- package/dist/telegram.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ground-state
|
|
3
|
-
description: "Before starting any non-trivial implementation,
|
|
3
|
+
description: "Before starting any non-trivial implementation, run a pre-flight reconnaissance pass to triangulate git state, project infrastructure, and prior-session memory. Auto-assembles a verified grounding preamble — a session-scoped artifact the orchestrator pastes verbatim into every subsequent sub-agent brief — eliminating stale-worktree reads and silent wrong-path errors before the first edit."
|
|
4
4
|
read-only: true
|
|
5
5
|
context: fork
|
|
6
6
|
failure_modes:
|
|
@@ -12,42 +12,59 @@ failure_modes:
|
|
|
12
12
|
## Sub-agent contract
|
|
13
13
|
/contract
|
|
14
14
|
|
|
15
|
-
**Constraint: read-only reconnaissance.**
|
|
15
|
+
**Constraint: read-only reconnaissance.** You MUST NOT call `edit_file`, `write_file`, or any mutating bash command (no `git commit`, `git push`, `git checkout`, `mv`, `rm`, file redirection, package installs, etc.). Read-only tools only: `read_file`, `grep`, `glob`, `list_directory`, `memory_search`, and read-only bash (`git status`, `git log`, `git diff`, `cat`, `ls`, `find`, etc.). `memory_search` is non-mutating and is the **only** way to reach the cross-session fact archive — it is in scope for this skill, do not strip it from this list.
|
|
16
16
|
|
|
17
17
|
If the survey reveals a fix that's tempting to apply, **return it as a recommendation in the snapshot** — the orchestrator decides whether to act. Even if the invoking brief sounds prescriptive ("draft the edit", "apply the change"), this skill stops at the snapshot and the preamble artifact. The orchestrator dispatches a separate implementation step afterward.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Inline reconnaissance
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Run the three surveys below **directly using your own tools**. Do NOT dispatch any sub-agents via the `agent` or `skill` tools — every lookup in this phase is a deterministic read that you execute yourself using `bash`, `glob`, `read_file`, `grep`, `list_directory`, and `memory_search`. Issue all three surveys in a single batched tool-use round where possible.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|--------|---------------|
|
|
25
|
-
| `software` | Current branch, `git log --oneline -5`, `git status -s`, diff-summary vs `origin/<default-branch>`, stash list. Flag: diverged, uncommitted changes, stale upstream. |
|
|
26
|
-
| `research` | Bibliography state (how many papers collected, citation manager in use), data pipeline status (raw data present? processed?), draft status (outline? partial draft? submitted?), publication target and deadline if known. |
|
|
27
|
-
| `design` | Design system state (component library version, Figma project structure), brand guidelines version, current design phase (research? wireframes? high-fidelity? handoff?), recent design changes. |
|
|
28
|
-
| `business` | Financial data freshness (last updated dates on models/reports), market data recency, stakeholder map (who's involved, who decides), current phase (research? proposal? execution?). |
|
|
29
|
-
| *(other)* | Scan for version-controlled artifacts, recent changes, current project phase, and any state that could cause conflicts. |
|
|
23
|
+
### State survey *(bash)*
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
Issue these commands (combine into one or two bash calls):
|
|
26
|
+
- `git symbolic-ref --short HEAD` — current branch
|
|
27
|
+
- `git rev-parse HEAD` — HEAD SHA
|
|
28
|
+
- `git status -s` — uncommitted changes
|
|
29
|
+
- `git log --oneline -5` — recent commit history
|
|
30
|
+
- `git stash list` — stash state
|
|
31
|
+
- `git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null` — upstream divergence
|
|
32
|
+
|
|
33
|
+
Adapt what you surface to the domain:
|
|
34
|
+
|
|
35
|
+
| Domain | What to flag |
|
|
36
|
+
|--------|-------------|
|
|
37
|
+
| `software` | Branch, recent commits, uncommitted changes, stash, upstream divergence. Flag: diverged, uncommitted, stale. |
|
|
38
|
+
| `research` | Version-controlled artifact state, current phase, publication target/deadline if discoverable. |
|
|
39
|
+
| `design` | Design system version, component library state, current phase, recent file changes. |
|
|
40
|
+
| `business` | Financial model freshness, market data recency, current project phase. |
|
|
41
|
+
| *(other)* | Recent changes, current project phase, any state that could cause conflicts. |
|
|
42
|
+
|
|
43
|
+
When domain is unspecified, infer from working directory contents.
|
|
44
|
+
|
|
45
|
+
### Infrastructure survey *(bash/glob/read_file)*
|
|
46
|
+
|
|
47
|
+
Check for relevant tooling and configs. Use the domain table below to decide which paths to probe, then probe them yourself. Return a **5-bullet inventory**.
|
|
32
48
|
|
|
33
49
|
| Domain | What to scan |
|
|
34
50
|
|--------|-------------|
|
|
35
|
-
| `software` | CI configs (
|
|
36
|
-
| `research` | Reference manager (
|
|
37
|
-
| `design` | Design
|
|
38
|
-
| `business` | Modeling
|
|
39
|
-
| *(other)* |
|
|
51
|
+
| `software` | CI configs (`ls .github/workflows/ 2>/dev/null`), package scripts (`package.json`, `Makefile`, `pyproject.toml`), linters/formatters, authoritative config files for the task. |
|
|
52
|
+
| `research` | Reference manager (.bib files), LaTeX setup, data analysis tools (Jupyter, R scripts), collaboration setup. |
|
|
53
|
+
| `design` | Design tool configs, prototyping tools, handoff configs (Storybook), asset pipeline scripts. |
|
|
54
|
+
| `business` | Modeling tool configs, presentation formats, data source configs, collaboration tool structure. |
|
|
55
|
+
| *(other)* | Tooling, build/export pipelines, collaboration infrastructure, config files relevant to the stated domain. |
|
|
40
56
|
|
|
41
|
-
|
|
57
|
+
### Memory survey *(memory_search + read_file)*
|
|
42
58
|
|
|
43
|
-
**Memory surveyor**
|
|
44
59
|
Call the **`memory_search` tool** with keywords from the user's current request — FTS5 syntax, so `term1 AND term2`, `"exact phrase"`, and `prefix*` all work. Run 2–3 query variants (different keyword angles) before concluding nothing is there; a single miss is not evidence of absence. Then read hot memory at `~/.afk/state/memory/HOT.md` and the project overlay — `AFK.md`, or `CLAUDE.md` on a Claude Code surface — for conventions bearing on this task.
|
|
45
60
|
|
|
46
|
-
**Invariant: the cross-session memory archive is only reachable via the `memory_search` tool.** The backing store is SQLite (`~/.afk/state/memory/memory.db`) and is not greppable. Do not glob or grep any filesystem path looking for memory — `memory_search` is the only route in.
|
|
61
|
+
**Invariant: the cross-session memory archive is only reachable via the `memory_search` tool.** The backing store is SQLite (`~/.afk/state/memory/memory.db`) and is not greppable. Do not glob or grep any filesystem path looking for memory — `memory_search` is the only route in.
|
|
62
|
+
|
|
63
|
+
Return: relevant facts with 1-line summaries, **plus the stores actually consulted** — e.g. `memory_search: 3 queries, 0 hits; HOT.md: read; AFK.md: read` — so the orchestrator can tell "no relevant memory exists" from "the fork never looked." If `memory_search` is unavailable on this surface, say so explicitly.
|
|
47
64
|
|
|
48
|
-
|
|
65
|
+
## Synthesis
|
|
49
66
|
|
|
50
|
-
|
|
67
|
+
Assemble the survey results into a **6-line ground-truth snapshot**:
|
|
51
68
|
- Branch: `<current>`, `<clean|diverged>`, upstream: `<fresh|stale>`
|
|
52
69
|
- Recent work: last 3 commits or stash items
|
|
53
70
|
- Infrastructure: CI present? package scripts? authoritative configs for this task
|
|
@@ -57,14 +74,14 @@ Return: relevant facts with 1-line summaries, **plus the stores actually consult
|
|
|
57
74
|
|
|
58
75
|
Surface the snapshot and stop. The orchestrator then uses these verified facts — not assumptions — to decide the next step. This skill never edits files.
|
|
59
76
|
|
|
60
|
-
##
|
|
77
|
+
## Brief Anchor (auto-runs after synthesis)
|
|
61
78
|
|
|
62
|
-
After the 6-line snapshot is assembled,
|
|
79
|
+
After the 6-line snapshot is assembled, construct the **Brief Anchor** — a path-verified grounding preamble the orchestrator pastes verbatim into every subsequent sub-agent brief.
|
|
63
80
|
|
|
64
81
|
**Construction procedure:**
|
|
65
82
|
|
|
66
|
-
1. From
|
|
67
|
-
2. From
|
|
83
|
+
1. From your state survey output, extract the verified `cwd` (absolute path from `pwd`), `branch` (from `git symbolic-ref --short HEAD`), and `HEAD` SHA (from `git rev-parse HEAD`).
|
|
84
|
+
2. From your infrastructure survey output, extract the 2–4 canonical file paths most relevant to the task. For each, run `stat <path>` — include the path only if `stat` exits 0. Paths that fail `stat` are omitted; if zero paths survive, set the list to `(none verified)`.
|
|
68
85
|
3. Assemble the preamble block:
|
|
69
86
|
|
|
70
87
|
```
|
|
@@ -81,8 +98,8 @@ After the 6-line snapshot is assembled, run a fourth step inline (no additional
|
|
|
81
98
|
|
|
82
99
|
**Orchestrator usage contract:**
|
|
83
100
|
|
|
84
|
-
- Prepend the Brief Anchor verbatim to every sub-agent brief that reads files, runs `git`/`gh` commands, or references explicit paths. Skip for pure-reasoning tasks
|
|
85
|
-
- Sub-agents receiving the anchor `stat` each listed path on entry. A missing path returns `GROUNDING_FAILED:<path>` — the orchestrator re-dispatches once with the corrected path. If the retry also returns `GROUNDING_FAILED`, emit `BRIEF_GROUND_ABORT` with both the expected and actual paths **plus the corrective command** the operator should run — `git worktree list` to find the intended checkout, then `cd <correct-worktree>`
|
|
101
|
+
- Prepend the Brief Anchor verbatim to every sub-agent brief that reads files, runs `git`/`gh` commands, or references explicit paths. Skip for pure-reasoning tasks.
|
|
102
|
+
- Sub-agents receiving the anchor `stat` each listed path on entry. A missing path returns `GROUNDING_FAILED:<path>` — the orchestrator re-dispatches once with the corrected path. If the retry also returns `GROUNDING_FAILED`, emit `BRIEF_GROUND_ABORT` with both the expected and actual paths **plus the corrective command** the operator should run — `git worktree list` to find the intended checkout, then `cd <correct-worktree>` — and halt the wave.
|
|
86
103
|
- The anchor is session-scoped: one construction pass per `ground-state` invocation. Do not re-invoke `ground-state` mid-session to refresh it; instead pass the existing anchor through.
|
|
87
104
|
|
|
88
105
|
**Skip when:**
|