aiblueprint-cli 1.4.108 → 1.4.110
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/README.md +10 -0
- package/agents-config/claude-config/mods/agent4everything/.claude-plugin/plugin.json +5 -0
- package/agents-config/claude-config/mods/agent4everything/hooks/hooks.json +1 -0
- package/agents-config/claude-config/mods/agent4everything/hooks/register.ts +96 -0
- package/agents-config/claude-config/mods/aiblueprint/.claude-plugin/plugin.json +71 -0
- package/agents-config/claude-config/mods/aiblueprint/hooks/hooks.json +1 -0
- package/agents-config/claude-config/mods/aiblueprint/hooks/register.tsx +309 -0
- package/agents-config/claude-config/mods/aiblueprint/tests/band.test.tsx +74 -0
- package/agents-config/claude-config/mods/aiblueprint/types/index.d.ts +14 -0
- package/agents-config/claude-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +8 -74
- package/agents-config/claude-config/scripts/statusline/src/index.ts +1 -0
- package/agents-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +8 -74
- package/agents-config/scripts/statusline/src/index.ts +1 -0
- package/agents-config/skills/agents-manager/SKILL.md +15 -453
- package/agents-config/skills/apex/SKILL.md +14 -110
- package/agents-config/skills/app-icon/SKILL.md +22 -117
- package/agents-config/skills/appstore-connect/SKILL.md +22 -85
- package/agents-config/skills/arena/LICENSE +21 -0
- package/agents-config/skills/arena/SKILL.md +371 -0
- package/agents-config/skills/arena/agents/openai.yaml +9 -0
- package/agents-config/skills/arena/assets/codex-icon.svg +22 -0
- package/agents-config/skills/arena/bracket.py +1235 -0
- package/agents-config/skills/arena/rubric.md +79 -0
- package/agents-config/skills/arena/strategies.json +205 -0
- package/agents-config/skills/audit-memories/SKILL.md +13 -139
- package/agents-config/skills/audit-skills/SKILL.md +6 -65
- package/agents-config/skills/environments-manager/SKILL.md +14 -238
- package/agents-config/skills/grill-me/SKILL.md +8 -22
- package/agents-config/skills/hooks-manager/SKILL.md +8 -54
- package/agents-config/skills/rules-manager/SKILL.md +11 -192
- package/agents-config/skills/skill-manager/SKILL.md +19 -158
- package/agents-config/skills/skill-manager/references/description-recommandation.md +15 -85
- package/agents-config/skills/test-audit/CAMPAIGN.md +117 -0
- package/agents-config/skills/test-audit/LICENSE +23 -0
- package/agents-config/skills/test-audit/SKILL.md +169 -0
- package/agents-config/skills/test-audit/agents/openai.yaml +10 -0
- package/agents-config/skills/test-audit/assets/codex-icon.svg +1 -0
- package/agents-config/skills/use-style/SKILL.md +8 -48
- package/dist/cli.js +125 -78
- package/package.json +1 -1
|
@@ -1,171 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: skill-manager
|
|
3
|
-
description: Create, edit, audit, or prune Claude, Codex, and Cursor skills/rules. Use for SKILL.md, .cursor/rules, AGENTS.md,
|
|
3
|
+
description: Create, edit, audit, or prune Claude, Codex, and Cursor skills/rules. Use for SKILL.md, .cursor/rules, AGENTS.md, frontmatter, references, scripts, and skill discovery.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Write skills the way `$analyze`, `$plan`, `$implement`, `$code-review`, and `$verify` are written.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Target
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
- One job. Imperative. Every line changes behavior.
|
|
11
|
+
- Body under ~40 lines unless the job is genuinely multi-branch.
|
|
12
|
+
- Description 50–300 chars: capability first, then `Use when` + trigger words.
|
|
13
|
+
- No README, changelog, or theory. No restating model defaults.
|
|
14
|
+
- References only for platform or schema detail the body cannot hold. Name the file and when to open it.
|
|
15
|
+
- User-only workflows: `disable-model-invocation: true`.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
## Write
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Skill-writing vocabulary → see [references/skill-writing-glossary.md](references/skill-writing-glossary.md)
|
|
19
|
+
1. Confirm 2–3 trigger prompts with the user.
|
|
20
|
+
2. Pick the platform. Default from the path: `.claude` → Claude, `.agents` → Codex, `.cursor` → Cursor. Ask if unclear.
|
|
21
|
+
3. Write frontmatter, then the body: inspect → act → return → stop.
|
|
22
|
+
4. Run `bun ~/.agents/skills/skill-manager/scripts/inspect-description.ts` on the skill root.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Personal skills live in `~/.agents/skills/<name>/`. Platform layout and frontmatter: [claude-code.md](references/claude-code.md), [codex.md](references/codex.md), [cursor.md](references/cursor.md). Description rules: [description-recommandation.md](references/description-recommandation.md).
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Audit
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
For each line: would removing it change behavior? Delete no-ops, duplicates, and stale rules. State the positive target; keep prohibitions only as hard guardrails.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Online research: `$find-docs` for current technical docs; `$exa-search` for broader web research.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
The context window is shared with the system prompt, conversation, other skills' metadata, and the user request. Only add context the agent doesn't already have. Challenge each line: does it justify its tokens?
|
|
35
|
-
|
|
36
|
-
### Match freedom to fragility
|
|
37
|
-
|
|
38
|
-
- **High freedom** (prose instructions): multiple valid approaches, decisions depend on context.
|
|
39
|
-
- **Medium freedom** (pseudocode, scripts with parameters): preferred pattern exists, some variation OK.
|
|
40
|
-
- **Low freedom** (specific scripts, few parameters): fragile, error-prone, must run a fixed sequence.
|
|
41
|
-
|
|
42
|
-
### Progressive disclosure
|
|
43
|
-
|
|
44
|
-
Three loading levels:
|
|
45
|
-
|
|
46
|
-
1. **Metadata** (name + description): always in context. Keep tight.
|
|
47
|
-
2. **SKILL.md body**: loaded when the skill triggers. Aim under ~500 lines.
|
|
48
|
-
3. **References**: loaded on demand. Move variant-specific detail, schemas, and long examples here.
|
|
49
|
-
|
|
50
|
-
Keep references one level deep. Reference them by name in SKILL.md so the agent knows when to open them.
|
|
51
|
-
|
|
52
|
-
### Design the information hierarchy
|
|
53
|
-
|
|
54
|
-
Put ordered actions in steps and definitions or rules in reference sections. End important steps with a checkable completion criterion; vague criteria invite premature completion. Inline what every execution branch needs and move branch-specific material behind a context pointer whose wording says when to load it.
|
|
55
|
-
|
|
56
|
-
Split a skill only when the split earns its cost:
|
|
57
|
-
|
|
58
|
-
- **By invocation:** a distinct leading word must trigger the new skill independently.
|
|
59
|
-
- **By sequence:** hiding later steps prevents the agent from rushing the current step.
|
|
60
|
-
|
|
61
|
-
Every model-invoked skill spends context load through its description. Every user-only skill spends human cognitive load because the user must remember it. When user-only skills become hard to remember, add one router instead of making every skill model-invoked.
|
|
62
|
-
|
|
63
|
-
### Use leading words
|
|
64
|
-
|
|
65
|
-
A leading word is a compact pretrained concept such as `tight loop`, `tracer bullet`, or `handoff`. Reuse the same term in the description and body so it anchors both invocation and execution. Prefer one strong term over repeated prose that restates the same behavior.
|
|
66
|
-
|
|
67
|
-
### Prune aggressively
|
|
68
|
-
|
|
69
|
-
Keep each meaning in one authoritative place. Audit every sentence with the no-op test: would removing it change agent behavior? Delete no-ops instead of polishing them. Watch for:
|
|
70
|
-
|
|
71
|
-
- **Duplication:** the same rule appears in several places.
|
|
72
|
-
- **Sediment:** stale instructions remain because removal feels risky.
|
|
73
|
-
- **Sprawl:** every line may be relevant, but the active path carries too much context.
|
|
74
|
-
- **Negation:** naming forbidden behavior makes it more available; state the positive target and reserve prohibitions for hard guardrails.
|
|
75
|
-
- **Negative space:** omitted decisions silently fall back to model priors; decide whether each omission is intentional.
|
|
76
|
-
- **Premature completion:** sharpen the completion criterion before splitting the sequence.
|
|
77
|
-
|
|
78
|
-
### Online research routing
|
|
79
|
-
|
|
80
|
-
When a skill or agent needs online research, name the exact research skill to use instead of relying on vague web-search language:
|
|
81
|
-
|
|
82
|
-
- Use `~/.agents/skills/find-docs/SKILL.md` for current technical documentation, API references, config options, SDKs, CLIs, cloud services, and code examples.
|
|
83
|
-
- Use `~/.agents/skills/exa-search/SKILL.md` for broader online research, recent information, source discovery, similar pages, URL extraction, or cited web answers.
|
|
84
|
-
- Mention default harness tools for local code, file, git, shell, and browser inspection.
|
|
85
|
-
- Keep built-in `WebSearch` and `WebFetch` as fallback tools unless the user explicitly asks for them.
|
|
86
|
-
- For restricted agents, include `Skill` and `Bash` in the tool list when these skills need to run local CLIs.
|
|
87
|
-
- Never put secrets, tokens, credentials, personal data, or proprietary code in external queries.
|
|
88
|
-
|
|
89
|
-
### Skill anatomy
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
skill-name/
|
|
93
|
-
├── SKILL.md # required: frontmatter + instructions
|
|
94
|
-
├── references/ # optional: docs loaded on demand
|
|
95
|
-
├── scripts/ # optional: deterministic code
|
|
96
|
-
└── assets/ # optional: templates/icons used in output
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Do NOT add README, CHANGELOG, INSTALLATION_GUIDE, etc. Only files the agent needs at runtime.
|
|
100
|
-
|
|
101
|
-
## Authoring workflow
|
|
102
|
-
|
|
103
|
-
1. **Pin down the use case.** Get 2-3 concrete example prompts that should trigger the skill. Confirm with the user.
|
|
104
|
-
2. **List reusable parts.** What scripts, references, or assets recur? Add only those.
|
|
105
|
-
3. **Write SKILL.md.** Frontmatter first (description is what triggers it - front-load keywords). Then imperative-form body.
|
|
106
|
-
4. **Test the description.** The description has to read like a trigger phrase, not a label. Examples in each reference file.
|
|
107
|
-
5. **Iterate after real use.** Note what the agent got wrong; refine the relevant section.
|
|
108
|
-
|
|
109
|
-
## Writing the description
|
|
110
|
-
|
|
111
|
-
The `description` field is the single most important line in the file - it's what the model uses to decide to load the skill. This is a hard rule: descriptions must be between 50 and 300 characters.
|
|
112
|
-
|
|
113
|
-
Write it as:
|
|
114
|
-
|
|
115
|
-
- Front-load trigger words ("Use when...", "create a skill", "review a PR").
|
|
116
|
-
- State scope and boundaries explicitly.
|
|
117
|
-
- Mention concrete file names or commands the user might type.
|
|
118
|
-
- Keep it short enough to stay under 300 characters, while still specific enough to trigger reliably.
|
|
119
|
-
|
|
120
|
-
Bad: `"Helper for skills."`
|
|
121
|
-
Good: `"Create and edit skills/rules across Claude Code, OpenAI Codex, and Cursor. Use when the user asks to 'create a skill'..."`
|
|
122
|
-
|
|
123
|
-
To validate skill descriptions, frontmatter fields, `agents/openai.yaml`, and skill directory shape, run:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
bun scripts/inspect-description.ts
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
By default, this checks `~/.agents/skills` only and follows symlinked skill directories inside that root. Pass one or more roots to inspect a different set. Passing a `.cursor/rules` directory validates Cursor rule frontmatter too:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
bun scripts/inspect-description.ts .agents/skills
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
For researched guidance and examples, see [references/description-recommandation.md](references/description-recommandation.md).
|
|
136
|
-
|
|
137
|
-
## Where each platform stores skills
|
|
138
|
-
|
|
139
|
-
**Canonical personal skills:** `~/.agents/skills/` is the single source of truth (git repo `Melvynx/agents-config`). It is an official user-level root for both Cursor and Codex, so they read it directly. Write new personal skills only under `~/.agents/skills/<name>/`.
|
|
140
|
-
|
|
141
|
-
### Codex profile activity icons
|
|
142
|
-
|
|
143
|
-
Codex's Profile activity view does not resolve standalone skill icons from `agents/openai.yaml`. It resolves known built-in skill icons or the logo of a matching installed plugin. After creating, renaming, or changing the icon metadata of a personal skill, sync the identity-only personal plugin wrappers:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
bun ~/.agents/scripts/sync-codex-profile-icons.ts --install
|
|
147
|
-
bun ~/.agents/scripts/audit-codex-profile-icons.ts
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
The wrappers intentionally contain no executable skills, so they provide `logo` / `logoDark` metadata without duplicating skill discovery. Keep `~/plugins` linked to `~/.agents/plugins/plugins`; the sync script creates the link when absent.
|
|
151
|
-
|
|
152
|
-
Per the official Cursor docs ([cursor.com/docs/skills](https://cursor.com/docs/skills)), user-level roots are `~/.agents/skills/` and `~/.cursor/skills/`, plus compat dirs `~/.claude/skills/` and `~/.codex/skills/`. `~/.cursor/skills-cursor/` is NOT a documented path; do not use it.
|
|
153
|
-
|
|
154
|
-
Because `~/.agents/skills/` is read directly, the only symlinks needed are the compat dirs for agents that do not read `~/.agents/skills/` themselves:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
~/.claude/skills -> ~/.agents/skills # Claude Code reads ~/.claude/skills
|
|
158
|
-
~/.codex/skills -> ~/.agents/skills # Codex compat (optional; Codex also reads ~/.agents/skills)
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Do NOT symlink `~/.cursor/skills` or `~/.cursor/skills-cursor` to `~/.agents/skills/`; that makes Cursor scan the same skills two or three times. To repair the compat symlinks if missing:
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
ln -s ~/.agents/skills ~/.claude/skills
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
See the per-platform reference files. Quick reminders:
|
|
168
|
-
|
|
169
|
-
- **Cursor**: reads `~/.agents/skills/` and `~/.cursor/skills/` (user-level), `.agents/skills/` and `.cursor/skills/` (project). Use `~/.agents/skills/` as the single root; skip the `~/.cursor/skills*` symlinks.
|
|
170
|
-
- **Claude Code**: `~/.claude/skills/` (symlink → `~/.agents/skills/`) or `.claude/skills/` (project). Higher scope wins on name collision.
|
|
171
|
-
- **Codex**: `.agents/skills/` walks up from CWD to repo root, then `~/.agents/skills/`, then `/etc/codex/skills`, then system bundled.
|
|
32
|
+
After creating or renaming a personal skill icon, run `bun ~/.agents/scripts/sync-codex-profile-icons.ts --install`. Compat: `~/.claude/skills` and `~/.codex/skills` symlink to `~/.agents/skills`. Do not symlink `~/.cursor/skills`.
|
|
@@ -1,97 +1,27 @@
|
|
|
1
|
-
# Description
|
|
1
|
+
# Description
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Load this when writing or refining a `description` field.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Official docs: Codex https://developers.openai.com/codex/skills · Claude https://docs.anthropic.com/en/docs/claude-code/skills · Cursor https://cursor.com/docs/skills
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Anthropic Agent Skills best practices: https://console.anthropic.com/docs/en/agents-and-tools/agent-skills/best-practices
|
|
9
|
-
- Anthropic Agent Skills overview: https://console.anthropic.com/docs/en/agents-and-tools/agent-skills/overview
|
|
10
|
-
- Claude Code skills docs: https://docs.anthropic.com/en/docs/claude-code/skills
|
|
11
|
-
- Cursor rules docs: https://cursor.com/help/customization/rules
|
|
7
|
+
## Rules
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- 50–300 characters.
|
|
10
|
+
- First clause useful alone; skill lists may truncate.
|
|
11
|
+
- What it does + when to use it. Third person. No `I can` / `You can`.
|
|
12
|
+
- No XML, tables, long examples, or body-level steps.
|
|
13
|
+
- Trigger-first: nouns, verbs, file names, and commands the user would type.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- Make the first clause useful on its own; skill lists may shorten descriptions.
|
|
17
|
-
- Include both what the skill does and when it should be used.
|
|
18
|
-
- Use third person. Do not write "I can..." or "You can...".
|
|
19
|
-
- Do not include XML tags, markdown tables, long examples, or implementation steps.
|
|
20
|
-
- Do not duplicate the full SKILL.md body. The description is only discovery metadata.
|
|
21
|
-
|
|
22
|
-
## What Good Descriptions Do
|
|
23
|
-
|
|
24
|
-
A good description helps the model decide whether to load the skill before it has read the skill body. It should answer three questions:
|
|
25
|
-
|
|
26
|
-
1. What capability does this skill provide?
|
|
27
|
-
2. Which user requests, file names, commands, or domain terms should trigger it?
|
|
28
|
-
3. What boundary keeps it from triggering on adjacent but wrong tasks?
|
|
29
|
-
|
|
30
|
-
Prefer concrete nouns, verbs, and file names over generic labels. Use terms a user would actually type: `SKILL.md`, `.cursor/rules`, `commit message`, `invoice`, `wrangler`, `Netlify deploy`, `DOCX`, `.xlsx`.
|
|
31
|
-
|
|
32
|
-
## Recommended Shape
|
|
33
|
-
|
|
34
|
-
Use one or two compact sentences:
|
|
35
|
-
|
|
36
|
-
```yaml
|
|
37
|
-
description: <Primary capability>. Use when <trigger phrases, file types, commands, or task context>.
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
For reference-only skills:
|
|
41
|
-
|
|
42
|
-
```yaml
|
|
43
|
-
description: <Domain conventions or reference material>. Use when working on <specific files, modules, APIs, or workflows>.
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
For side-effecting workflows, be narrower:
|
|
47
|
-
|
|
48
|
-
```yaml
|
|
49
|
-
description: Prepare and verify production deploys. Use only when the user explicitly asks to deploy, release, publish, or check deployment status.
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Examples
|
|
53
|
-
|
|
54
|
-
Good:
|
|
55
|
-
|
|
56
|
-
```yaml
|
|
57
|
-
description: Create or edit Claude, Codex, and Cursor skills/rules. Use for SKILL.md, .cursor/rules, AGENTS.md, frontmatter, references, scripts, and discovery rules.
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Good:
|
|
61
|
-
|
|
62
|
-
```yaml
|
|
63
|
-
description: Review GitHub pull request feedback and implement requested changes. Use when the user asks to address PR comments, review threads, or requested changes.
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Too vague:
|
|
15
|
+
## Shape
|
|
67
16
|
|
|
68
17
|
```yaml
|
|
69
|
-
description:
|
|
18
|
+
description: <Primary capability>. Use when <trigger phrases, files, commands, or task context>.
|
|
70
19
|
```
|
|
71
20
|
|
|
72
|
-
|
|
21
|
+
Good: `Create or edit Claude, Codex, and Cursor skills/rules. Use for SKILL.md, .cursor/rules, AGENTS.md, frontmatter, references, scripts, and discovery rules.`
|
|
73
22
|
|
|
74
|
-
|
|
75
|
-
description: Manage all developer workflow tasks, docs, rules, automation, repository work, deployment, testing, and issue handling.
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Wrong point of view:
|
|
23
|
+
Good: `Review GitHub pull request feedback and implement requested changes. Use when the user asks to address PR comments, review threads, or requested changes.`
|
|
79
24
|
|
|
80
|
-
|
|
81
|
-
description: I can help you write better skill descriptions.
|
|
82
|
-
```
|
|
25
|
+
Bad: `Helps with skills.` / `I can help you write better skill descriptions.` / a catalog of every adjacent task.
|
|
83
26
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
- [ ] 50-300 characters.
|
|
87
|
-
- [ ] First words contain the primary trigger.
|
|
88
|
-
- [ ] Mentions the key files, commands, domains, or user phrases.
|
|
89
|
-
- [ ] Says when to use it, not only what it is.
|
|
90
|
-
- [ ] Specific enough to avoid accidental invocation.
|
|
91
|
-
- [ ] No body-level instructions, setup steps, or long examples.
|
|
92
|
-
|
|
93
|
-
Run the local inspector after editing:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
bun scripts/inspect-description.ts
|
|
97
|
-
```
|
|
27
|
+
Then run `bun ~/.agents/skills/skill-manager/scripts/inspect-description.ts` on the skill root.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Test-pruning campaign
|
|
2
|
+
|
|
3
|
+
Campaign mode prunes one subsystem's whole test surface in one PR: a package,
|
|
4
|
+
a plugin, or one core area. The value bar, retention bar, candidate evidence,
|
|
5
|
+
and validation in [SKILL.md](SKILL.md) apply to every lane. This file adds the
|
|
6
|
+
order of work and the lessons of a full campaign, drawn from a campaign on a
|
|
7
|
+
Telegram messaging plugin. Each step ends on its completion criterion; do not
|
|
8
|
+
start the next step early.
|
|
9
|
+
|
|
10
|
+
## 1. Baseline
|
|
11
|
+
|
|
12
|
+
Record the subsystem's test and support line counts and every test file's
|
|
13
|
+
pass/fail state at a pinned `main` SHA. Keep baseline failures in their own
|
|
14
|
+
list: in the Telegram campaign, all three were real delivery bugs, not stale
|
|
15
|
+
tests.
|
|
16
|
+
|
|
17
|
+
Done when every in-scope test file has a recorded baseline result.
|
|
18
|
+
|
|
19
|
+
## 2. Lanes and inventory
|
|
20
|
+
|
|
21
|
+
Split the surface into **lanes** along production owner boundaries, not file
|
|
22
|
+
prefixes. For Telegram these were accounts, commands, context, dispatch,
|
|
23
|
+
inbound, outbound, persistence, transport, shared, harness, and live/QA
|
|
24
|
+
scenarios. Include the subsystem's cases at shared core boundaries and its QA
|
|
25
|
+
and live-proof harness tests.
|
|
26
|
+
|
|
27
|
+
Done when every test file and QA scenario the subsystem owns belongs to exactly
|
|
28
|
+
one lane.
|
|
29
|
+
|
|
30
|
+
## 3. Read-only ledger per lane
|
|
31
|
+
|
|
32
|
+
Give each lane to its own read-only agent. The agent reads every assigned test
|
|
33
|
+
in full, including parameter tables. It also reads the production owners and
|
|
34
|
+
their entry points, callers, history, and CI routing. Each test declaration
|
|
35
|
+
goes into a written **ledger** with one mark. An `it.each` is one declaration
|
|
36
|
+
unless its rows need different marks; then mark each row.
|
|
37
|
+
|
|
38
|
+
- `R`: retain, naming the contract and the bug it catches; a retained test that
|
|
39
|
+
only moves to a better-named file stays `R` with the move noted;
|
|
40
|
+
- `F`: retain the contract but repair the assertion, such as a vacuous negative
|
|
41
|
+
that passes when only one of several items is missing;
|
|
42
|
+
- `C`: consolidate, naming the owner that absorbs the assertion first: a sibling
|
|
43
|
+
table case, a stronger boundary suite, or the shared owner in another package;
|
|
44
|
+
- `D`: delete, naming the proof that remains, or why no contract exists.
|
|
45
|
+
|
|
46
|
+
Judge a test by its assertions, not its name. One Telegram test named for
|
|
47
|
+
retiring a progress window asserted the window was _not_ cleared.
|
|
48
|
+
|
|
49
|
+
Done when every declaration in the lane has a mark and an evidence line.
|
|
50
|
+
|
|
51
|
+
## 4. Layer plan per lane
|
|
52
|
+
|
|
53
|
+
Treat the per-test ledger as input, not as the edit list. A second read-only
|
|
54
|
+
pass, starting from the ledger, looks for the redundant **layer**. In Telegram,
|
|
55
|
+
several dispatch suites replayed the same shared compositor through one mocked
|
|
56
|
+
preview, around stronger real-stream and HTTP-fixture suites. Name the
|
|
57
|
+
**keeper** suite for each contract. Prefer the real transport boundary with a
|
|
58
|
+
fake network over a mocked collaborator. Correct any ledger errors this pass
|
|
59
|
+
finds.
|
|
60
|
+
|
|
61
|
+
Done when each lane plan names its retired files, its keeper per contract, the
|
|
62
|
+
assertions to carry into keepers, and the test-only production seams unlocked.
|
|
63
|
+
|
|
64
|
+
## 5. Cutover
|
|
65
|
+
|
|
66
|
+
Edit lane by lane. Serialize changes to shared harnesses and support files
|
|
67
|
+
through one owner. With each lane, remove the test-only production seams it
|
|
68
|
+
unlocks: injection parameters, getters, reset exports, and indirection layers.
|
|
69
|
+
Register moved suites in CI routing and test inventories. Update shrink-only
|
|
70
|
+
line-cap baselines. Put durable test-ownership rules in the subsystem's
|
|
71
|
+
`AGENTS.md`, drawn from mistakes this campaign actually found.
|
|
72
|
+
|
|
73
|
+
Done when every lane plan is applied and each lane's keepers pass.
|
|
74
|
+
|
|
75
|
+
## 6. Preservation review
|
|
76
|
+
|
|
77
|
+
Before claiming completion, have independent reviewers compare deleted
|
|
78
|
+
coverage against the keepers, one reviewer per boundary group. They look for
|
|
79
|
+
contracts that lost their only proof. They also look for new assertions that
|
|
80
|
+
cannot fail, such as a rejection row the production code never reaches. The
|
|
81
|
+
Telegram review found nine real gaps and one unreachable assertion.
|
|
82
|
+
|
|
83
|
+
For each restored contract, make one deliberate **mutation** of the production
|
|
84
|
+
owner and confirm the keeper goes red. Then restore the source byte for byte.
|
|
85
|
+
|
|
86
|
+
Done when every reported gap is restored or rejected with source evidence, and
|
|
87
|
+
every restored contract has a caught mutation.
|
|
88
|
+
|
|
89
|
+
## 7. Product defects
|
|
90
|
+
|
|
91
|
+
A baseline failure that survives into a keeper is a bug report. Fix it at its
|
|
92
|
+
owner as a separate commit, and prove it through the real user flow, with a
|
|
93
|
+
**control** run that reverts the fix and shows the old behavior. Record
|
|
94
|
+
unrelated product discrepancies you find as follow-ups instead of fixing them
|
|
95
|
+
in the campaign.
|
|
96
|
+
|
|
97
|
+
Done when each repaired defect has a failing control and a passing candidate
|
|
98
|
+
on the same harness.
|
|
99
|
+
|
|
100
|
+
## 8. Reconcile and hand off
|
|
101
|
+
|
|
102
|
+
Campaigns outlive many `main` commits. Merge `main` rather than rebasing a
|
|
103
|
+
long, many-commit campaign. When `main` modified a file the campaign
|
|
104
|
+
deleted, keep the deletion. Port the new contract into the keeper instead, and
|
|
105
|
+
confirm every new regression `main` added still has a home. Rerun the whole
|
|
106
|
+
subsystem suite and repeat live proof on the merged head.
|
|
107
|
+
|
|
108
|
+
Expect review tooling to see a truncated file list on a diff this large.
|
|
109
|
+
Record maintainer decisions for generic compatibility flags in the PR evidence
|
|
110
|
+
rather than editing gates.
|
|
111
|
+
|
|
112
|
+
Hand off with the [SKILL.md](SKILL.md) report, plus:
|
|
113
|
+
|
|
114
|
+
- baseline and final test/support line counts, with production counted separately;
|
|
115
|
+
- lanes, retired layers, and keepers;
|
|
116
|
+
- preservation gaps found and their mutations;
|
|
117
|
+
- product defects with control and candidate proof.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Adapted from https://github.com/openclaw/openclaw/tree/main/.agents/skills/test-audit
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 OpenClaw Foundation
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-audit
|
|
3
|
+
description: "Invoke whenever writing, changing, reviewing, or sweeping tests. Authoring gate for new tests plus audit workflow for low-value, implementation-coupled, or duplicative tests and the test-only production seams they demand."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test Audit
|
|
7
|
+
|
|
8
|
+
Three modes, one value bar. Authoring mode gates every new or changed test at
|
|
9
|
+
write time. Audit mode runs focused sweeps of tests that re-assert source,
|
|
10
|
+
duplicate stronger proof, couple behavior to implementation, or keep test-only
|
|
11
|
+
production seams alive. Continue broad audits as separate coherent follow-up
|
|
12
|
+
PRs; optimize for confidence, not deletion count. Campaign mode prunes one
|
|
13
|
+
whole subsystem's test surface (every test file a package, plugin, or core area
|
|
14
|
+
owns); before starting one, read [CAMPAIGN.md](CAMPAIGN.md).
|
|
15
|
+
|
|
16
|
+
## Authoring gate
|
|
17
|
+
|
|
18
|
+
Before adding any test, answer four questions; a missing answer means do not
|
|
19
|
+
add it yet:
|
|
20
|
+
|
|
21
|
+
1. What observable behavior, invariant, or independent contract does it protect?
|
|
22
|
+
2. What credible regression makes it fail?
|
|
23
|
+
3. Why does existing coverage not already catch that failure? Each contract has
|
|
24
|
+
one primary test owner at the strongest boundary; another layer needs its
|
|
25
|
+
own distinct risk, such as a transport or lifecycle failure the owner cannot
|
|
26
|
+
reach. Prefer extending a table-driven case or shared fixture over a
|
|
27
|
+
near-duplicate test; consolidate duplicated setup in the same change.
|
|
28
|
+
4. Does it need a production seam (export, flag, wrapper, injection hook) that no
|
|
29
|
+
production caller needs? If yes, move the test to the real boundary instead.
|
|
30
|
+
|
|
31
|
+
Then check the test against every [junk pattern](#junk-patterns); a match fails
|
|
32
|
+
the gate unless the [retention bar](#retention-bar) names the contract it
|
|
33
|
+
independently guards. A test that would break under behavior-preserving
|
|
34
|
+
refactoring is asserting implementation, not behavior; rewrite it at the
|
|
35
|
+
owning boundary before landing it.
|
|
36
|
+
|
|
37
|
+
Bug regression tests must fail on the pre-fix code for the intended reason and
|
|
38
|
+
pass after the owner-boundary repair. A regression test that never demonstrably
|
|
39
|
+
failed proves the mock, not the fix. One regression at the owner boundary
|
|
40
|
+
covers the bug; do not replay the same scenario at every layer it crosses.
|
|
41
|
+
|
|
42
|
+
## Junk patterns
|
|
43
|
+
|
|
44
|
+
The shared checklist for both modes: the authoring gate rejects a new test that
|
|
45
|
+
matches one, and audits hunt for existing tests that do.
|
|
46
|
+
|
|
47
|
+
- assertion-free coverage probes;
|
|
48
|
+
- self-comparisons and identity copiers;
|
|
49
|
+
- copied fixtures, inventories, manifests, or export lists;
|
|
50
|
+
- exact source, import, or string greps;
|
|
51
|
+
- private predicate or call-shape tests duplicated at real boundaries;
|
|
52
|
+
- duplicate invocations of the same contract;
|
|
53
|
+
- provider-local replays of shared helpers;
|
|
54
|
+
- tests whose only purpose is preserving test-only exports, globals, or wrappers;
|
|
55
|
+
- dead production code whose only callers are tests;
|
|
56
|
+
- expected values produced by the helper or renderer under test;
|
|
57
|
+
- mocks that implement the asserted behavior, or one identical mock standing in
|
|
58
|
+
for different APIs;
|
|
59
|
+
- fixtures that supply the receipt, admission, or callback ordering the owner
|
|
60
|
+
should produce, or persistence asserted against a store the path never writes;
|
|
61
|
+
- capability tests that restate declared flags instead of exercising the
|
|
62
|
+
delivery or acknowledgement the flag promises;
|
|
63
|
+
- negative controls that pass for an unrelated reason, such as a denial from a
|
|
64
|
+
different guard or a rejection the production path never reaches;
|
|
65
|
+
- names or fixtures that promise more than the input exercises, such as a
|
|
66
|
+
"retires the window" test asserting the window was not cleared.
|
|
67
|
+
|
|
68
|
+
## Value bar
|
|
69
|
+
|
|
70
|
+
Tests justify their maintenance cost by protecting behavior, a credible
|
|
71
|
+
regression, or an independently meaningful contract. In an audit, an existing
|
|
72
|
+
test that must change for behavior-preserving source reorganization is suspect,
|
|
73
|
+
not automatically deletable; the authoring gate still rejects new ones.
|
|
74
|
+
|
|
75
|
+
Before judging a candidate, read the complete test and production owner, its
|
|
76
|
+
entry point, callers, callees, sibling implementations, overlapping tests, CI
|
|
77
|
+
routing, and relevant history. Read root and scoped `AGENTS.md` files first.
|
|
78
|
+
When the test claims dependency-backed behavior, inspect the dependency source
|
|
79
|
+
or types directly.
|
|
80
|
+
|
|
81
|
+
## Discovery
|
|
82
|
+
|
|
83
|
+
Keep discovery read-only and report evidence before editing. For broad scope,
|
|
84
|
+
run parallel discovery lanes when available:
|
|
85
|
+
|
|
86
|
+
- core source and packages;
|
|
87
|
+
- plugins, extensions, or integrations;
|
|
88
|
+
- UI, apps, scripts, and tooling;
|
|
89
|
+
- a cross-cutting pattern sweep.
|
|
90
|
+
|
|
91
|
+
Outside campaign mode, prefer a few high-confidence candidates over a large
|
|
92
|
+
speculative inventory. Hunt for the [junk patterns](#junk-patterns).
|
|
93
|
+
|
|
94
|
+
## Retention bar
|
|
95
|
+
|
|
96
|
+
Keep a test when it independently enforces a public API, SDK, protocol, config,
|
|
97
|
+
migration, storage, security, platform, default, generated-output, package,
|
|
98
|
+
release, or architecture contract. Also keep:
|
|
99
|
+
|
|
100
|
+
- call ordering when order is observable behavior;
|
|
101
|
+
- regressions with a credible failure mode;
|
|
102
|
+
- source inspection when it is the cheapest independent guard: it fails when
|
|
103
|
+
the contract changes (the user-facing key, byte, or path) and survives an
|
|
104
|
+
identifier-only refactor;
|
|
105
|
+
- a retained test that fails on the baseline: treat it as a possible product
|
|
106
|
+
bug, reproduce it, and repair the owner rather than deleting it.
|
|
107
|
+
|
|
108
|
+
Static or slow is not a deletion reason. A test that resembles implementation
|
|
109
|
+
may still be the independent contract; prove otherwise before removing it.
|
|
110
|
+
|
|
111
|
+
## Candidate evidence
|
|
112
|
+
|
|
113
|
+
Record every field below before editing. A missing field means the candidate is
|
|
114
|
+
not ready for deletion:
|
|
115
|
+
|
|
116
|
+
- exact test name and location;
|
|
117
|
+
- what failure it can actually detect;
|
|
118
|
+
- non-test callers of the covered production or support seam;
|
|
119
|
+
- stronger remaining owner-boundary proof, or why no proof is needed;
|
|
120
|
+
- relevant history and the reason the test or seam exists;
|
|
121
|
+
- production or test-support deletion unlocked;
|
|
122
|
+
- risk and the focused validation command.
|
|
123
|
+
|
|
124
|
+
## Edit shape
|
|
125
|
+
|
|
126
|
+
Choose one coherent owner-boundary batch. Delete obsolete test-only exports,
|
|
127
|
+
globals, wrappers, and dead production paths instead of preserving aliases.
|
|
128
|
+
Move retained regressions to their canonical owners. Consolidate repeated
|
|
129
|
+
package or dependency assertions into one generic contract.
|
|
130
|
+
|
|
131
|
+
Prefer net-negative production LOC. Do not add replacement tests that restate
|
|
132
|
+
the same implementation, and do not convert uncertain candidates into cleanup
|
|
133
|
+
to increase deletion counts.
|
|
134
|
+
|
|
135
|
+
## Validation
|
|
136
|
+
|
|
137
|
+
Never edit source or tests while a test watcher is running in the checkout. Use
|
|
138
|
+
the test commands documented in the repository's `AGENTS.md`, `CLAUDE.md`, or
|
|
139
|
+
package scripts.
|
|
140
|
+
|
|
141
|
+
1. Run the smallest owner and sibling tests with the repository's test runner,
|
|
142
|
+
filtered to the affected paths.
|
|
143
|
+
2. For removed source greps or plan assertions, run the executable script or
|
|
144
|
+
dry-run that owns the real contract.
|
|
145
|
+
3. Run targeted formatting, then `git diff --check`.
|
|
146
|
+
4. Run the changed-files gate required by repository policy (lint, typecheck,
|
|
147
|
+
and the CI checks those paths trigger).
|
|
148
|
+
5. Inspect `git diff --numstat`; report production/tooling separately from
|
|
149
|
+
tests and test support.
|
|
150
|
+
6. After final audit edits, get an independent review of the deleted coverage
|
|
151
|
+
against the remaining keepers.
|
|
152
|
+
|
|
153
|
+
## Landing and continuation
|
|
154
|
+
|
|
155
|
+
Commit, push, open a PR, or land only when authorized. Follow the repository's
|
|
156
|
+
PR flow. Land one coherent PR at a time; after landing, refresh from current
|
|
157
|
+
`main` and rerun read-only discovery for the next high-confidence batch.
|
|
158
|
+
|
|
159
|
+
## Handoff
|
|
160
|
+
|
|
161
|
+
Report:
|
|
162
|
+
|
|
163
|
+
- root cause and removed low-value categories;
|
|
164
|
+
- production owner simplifications;
|
|
165
|
+
- retained false positives and why they remain valuable;
|
|
166
|
+
- focused and full proof actually run;
|
|
167
|
+
- production versus test LOC;
|
|
168
|
+
- PR and merge state;
|
|
169
|
+
- named follow-ups.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Test Audit"
|
|
3
|
+
short_description: "Gate new tests and prune low-value ones"
|
|
4
|
+
icon_small: "./assets/codex-icon.svg"
|
|
5
|
+
icon_large: "./assets/codex-icon.svg"
|
|
6
|
+
brand_color: "#737373"
|
|
7
|
+
default_prompt: "Use $test-audit to gate these tests or audit low-value ones."
|
|
8
|
+
|
|
9
|
+
policy:
|
|
10
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg role="img" aria-label="test-audit skill icon" xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 24 24" fill="none" stroke="#F5F5F5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 2v6.5L4.5 17A3 3 0 0 0 7.2 21h9.6a3 3 0 0 0 2.7-4L15 8.5V2"/><path d="M8 2h8"/><path d="M7 15h10"/></svg>
|