onecrawl 4.0.0-alpha.37
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 +77 -0
- package/assets/.github/copilot-instructions.md +44 -0
- package/assets/AGENTS.copilot-cli.MD +113 -0
- package/assets/AGENTS.md +66 -0
- package/assets/AGENTS.vscode.MD +113 -0
- package/assets/skills/README.md +35 -0
- package/assets/skills/breaking-change-paths/SKILL.md +31 -0
- package/assets/skills/completion-gate/SKILL.md +35 -0
- package/assets/skills/e2e-testing/SKILL.md +30 -0
- package/assets/skills/github-sync/SKILL.md +39 -0
- package/assets/skills/interaction-loop/SKILL.md +34 -0
- package/assets/skills/onecrawl-commands/SKILL.md +447 -0
- package/assets/skills/planning-tracking/SKILL.md +37 -0
- package/assets/skills/policy-coherence-audit/SKILL.md +29 -0
- package/assets/skills/programmatic-tool-calling/SKILL.md +41 -0
- package/assets/skills/rollback-rca/SKILL.md +36 -0
- package/assets/skills/session-logging/SKILL.md +39 -0
- package/assets/skills/systematic-debugging/SKILL.md +114 -0
- package/assets/skills/testing-policy/SKILL.md +37 -0
- package/bin/cli.js +81 -0
- package/lib/index.js +2 -0
- package/lib/skills.js +167 -0
- package/package.json +44 -0
- package/scripts/postinstall.js +115 -0
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# onecrawl
|
|
2
|
+
|
|
3
|
+
Browser automation engine — CLI, MCP server, and AI agent skills.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install onecrawl
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This will:
|
|
12
|
+
1. Download the OneCrawl binary for your platform
|
|
13
|
+
2. Make `npx onecrawl` available
|
|
14
|
+
|
|
15
|
+
## Setup Skills
|
|
16
|
+
|
|
17
|
+
Install AGENTS policies and AI skills into your project:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx onecrawl init
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This creates:
|
|
24
|
+
- `AGENTS.md` — Agent policy dispatcher
|
|
25
|
+
- `AGENTS.vscode.MD` — VS Code runtime adapter
|
|
26
|
+
- `AGENTS.copilot-cli.MD` — Copilot CLI runtime adapter
|
|
27
|
+
- `.github/copilot-instructions.md` — GitHub Copilot custom instructions
|
|
28
|
+
- `.github/skills/*/SKILL.md` — 14 operational skills
|
|
29
|
+
|
|
30
|
+
## Update Skills
|
|
31
|
+
|
|
32
|
+
Skills update automatically when you update the package:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm update onecrawl
|
|
36
|
+
npx onecrawl update-skills
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Check Status
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx onecrawl skills-status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## CLI Usage
|
|
46
|
+
|
|
47
|
+
All other commands are forwarded to the OneCrawl binary:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx onecrawl run browser navigate --url https://example.com
|
|
51
|
+
npx onecrawl run browser screenshot --json
|
|
52
|
+
npx onecrawl mcp serve
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Programmatic API
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import { initSkills, updateSkills, skillsStatus } from "onecrawl/skills";
|
|
59
|
+
|
|
60
|
+
await initSkills("/path/to/project");
|
|
61
|
+
await updateSkills("/path/to/project");
|
|
62
|
+
await skillsStatus("/path/to/project");
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Supported Platforms
|
|
66
|
+
|
|
67
|
+
| Platform | Architecture | Binary |
|
|
68
|
+
|----------|-------------|--------|
|
|
69
|
+
| macOS | arm64 (M1+) | ✅ |
|
|
70
|
+
| macOS | x64 | ✅ |
|
|
71
|
+
| Linux | x64 (glibc) | ✅ |
|
|
72
|
+
| Linux | arm64 | ✅ |
|
|
73
|
+
| Windows | x64 | ✅ |
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
BUSL-1.1
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Copilot Custom Instructions — OneCrawl
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
OneCrawl is a Rust-based browser automation engine providing CLI, MCP server, NAPI (Node.js), and PyO3 (Python) bindings.
|
|
6
|
+
It uses Chrome DevTools Protocol (CDP) for all browser interactions.
|
|
7
|
+
|
|
8
|
+
## Build & Test
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# Check compilation (fast feedback)
|
|
12
|
+
cargo check -p onecrawl-mcp-rs
|
|
13
|
+
|
|
14
|
+
# Run all tests (exclude e2e)
|
|
15
|
+
cargo test --workspace --exclude onecrawl-e2e -- --test-threads=1
|
|
16
|
+
|
|
17
|
+
# Build release binary
|
|
18
|
+
cargo build --release -p onecrawl-cli-rs
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
- **Workspace**: Cargo workspace at `packages/onecrawl-rust/`
|
|
24
|
+
- **Crates**: `onecrawl-cli-rs` (CLI), `onecrawl-mcp-rs` (MCP server), `onecrawl-cdp` (CDP bindings), `onecrawl-browser` (browser core), `onecrawl-napi` (Node.js), `onecrawl-python` (Python)
|
|
25
|
+
- **MCP tools**: 18 tools with 546+ actions — see `crates/onecrawl-mcp-rs/src/actions.rs`
|
|
26
|
+
- **Hexagonal ports**: `onecrawl-browser/src/ports/mod.rs` — BrowserPort, PagePort, ElementPort, NetworkPort, EmulationPort, InputPort
|
|
27
|
+
|
|
28
|
+
## Conventions
|
|
29
|
+
|
|
30
|
+
- ESM (`type: module`) for Node.js, requires Node ≥ 20
|
|
31
|
+
- CDP runtime types are at `onecrawl_protocol::cdp::js_protocol::runtime`
|
|
32
|
+
- `rand::rng()` returns `!Send` — scope all RNG in sync blocks before `.await`
|
|
33
|
+
- Security: use `validate_name()` for path safety, `write_sensitive_file()` with chmod 0o600 for credentials
|
|
34
|
+
- Never use `unwrap_or_default()` on serde parse — use `match` with proper error handling
|
|
35
|
+
- Prefer CDP-native operations over JS evaluation
|
|
36
|
+
|
|
37
|
+
## Agent Protocol
|
|
38
|
+
|
|
39
|
+
This repo uses AGENTS.md with runtime-specific adapters:
|
|
40
|
+
- **VS Code**: `AGENTS.vscode.MD` (uses `vscode_askQuestions`)
|
|
41
|
+
- **Copilot CLI**: `AGENTS.copilot-cli.MD` (uses `ask_user`)
|
|
42
|
+
- **Skills**: `.github/skills/*/SKILL.md` — 14 operational skills
|
|
43
|
+
|
|
44
|
+
Do not mix tool names across runtimes.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# AGENTS.copilot-cli.MD
|
|
2
|
+
|
|
3
|
+
## 1. Interaction Protocol (Runtime-Critical Contract)
|
|
4
|
+
|
|
5
|
+
Interaction must occur **exclusively via `ask_user`** and remain iterative, interactive, and unlimited.
|
|
6
|
+
If `ask_user` is unavailable in the current runtime, use an equivalent structured question tool while preserving the same interaction contract.
|
|
7
|
+
|
|
8
|
+
Each iteration must ask exactly **one clear question** and provide exactly **5 options**.
|
|
9
|
+
|
|
10
|
+
Default option composition (for normal development decisions):
|
|
11
|
+
1. **Recommended Development Path** (mark as ⭐ most future-proof)
|
|
12
|
+
2. **Alternative Development Path A**
|
|
13
|
+
3. **Alternative Development Path B**
|
|
14
|
+
4. **Freeform** — "Something else": lets the user type a custom direction (uses `custom` enum value — see below)
|
|
15
|
+
5. **Autonomous Mode**
|
|
16
|
+
|
|
17
|
+
`Freeform` is a hard invariant across all iterations:
|
|
18
|
+
- option **4** must always be **Freeform** — the "Something else" escape hatch
|
|
19
|
+
- label must remain exactly `Freeform` (no rename, merge, or synonym replacement)
|
|
20
|
+
- **implementation**: set the enum value to `custom` — Copilot CLI ≥ 1.0.2 allows custom responses in enum fields, so the user can type their preferred direction directly in the `ask_user` prompt without a separate freeform tool call
|
|
21
|
+
- when the user types a custom response, treat it as their chosen direction and proceed accordingly
|
|
22
|
+
- applies to default mode, compatibility-triad escalation, rollback/RCA prompts, and task-start mode selection
|
|
23
|
+
- if `Freeform` is missing, the iteration is invalid and must be regenerated before proceeding
|
|
24
|
+
|
|
25
|
+
Continuity is mandatory:
|
|
26
|
+
- options **1-3** must, by default, carry forward all still-valid options from the previous iteration
|
|
27
|
+
- do not drop an option silently; if one is removed, explicitly state why and what replaced it
|
|
28
|
+
|
|
29
|
+
For each option, always include:
|
|
30
|
+
- why the option exists
|
|
31
|
+
- where the option leads next (expected outcome / milestone impact)
|
|
32
|
+
- risk level (`low` / `medium` / `high`)
|
|
33
|
+
|
|
34
|
+
Use this mandatory option card format:
|
|
35
|
+
`<Option title> — Why: <reason> | Leads to: <next step/result> | Risk: <low|medium|high>`
|
|
36
|
+
|
|
37
|
+
Recommendation tracking is mandatory:
|
|
38
|
+
- mark the current recommendation with ⭐
|
|
39
|
+
- if the recommendation changes from the previous iteration, explain why in one sentence
|
|
40
|
+
|
|
41
|
+
The compatibility triad below is an **escalation package**, not the default:
|
|
42
|
+
- **Non-Breaking Path**
|
|
43
|
+
- **Breaking Path**
|
|
44
|
+
- **Alternative Structural Path**
|
|
45
|
+
|
|
46
|
+
Use the compatibility triad only when at least one condition is true:
|
|
47
|
+
- there is a concrete compatibility/contract impact
|
|
48
|
+
- migration effort must be evaluated
|
|
49
|
+
- architectural break/refactor trade-off is the core decision
|
|
50
|
+
- the user explicitly asks for breaking/non-breaking analysis
|
|
51
|
+
|
|
52
|
+
When the compatibility triad is used:
|
|
53
|
+
- the interaction still remains exactly 5 options: triad options + **Freeform** + **Autonomous Mode**
|
|
54
|
+
- include at minimum: pros/cons, risk level, migration steps
|
|
55
|
+
- explicitly state that quality gates are unchanged (unit/integration/E2E/non-regression must still pass)
|
|
56
|
+
|
|
57
|
+
At the beginning of each task, mode selection is mandatory: **never assume a default mode globally**.
|
|
58
|
+
Mode selection at task start must use the same 5-option structure above (development-options-first unless escalation is justified).
|
|
59
|
+
|
|
60
|
+
### Autonomous Mode
|
|
61
|
+
|
|
62
|
+
`Autonomous Mode` means:
|
|
63
|
+
- work autonomously until all milestones are completed
|
|
64
|
+
- always choose the best, most future-proof option within the selected path
|
|
65
|
+
- if a new unapproved breaking impact appears, pause and ask via `ask_user`
|
|
66
|
+
- **at the end of every autonomous run** — **mandatory, no exceptions**: invoke `ask_user` to re-enter the feedback loop; the run is considered incomplete until this call is made — ask for:
|
|
67
|
+
1. rating of the completed run
|
|
68
|
+
2. next action to take
|
|
69
|
+
3. explicit satisfaction confirmation
|
|
70
|
+
|
|
71
|
+
### Feedback Loop — Never Interrupt
|
|
72
|
+
|
|
73
|
+
The feedback loop is **perpetual by design**:
|
|
74
|
+
- the loop **must never self-terminate** for any reason (task completion, milestone reached, silence, assumed satisfaction)
|
|
75
|
+
- the agent must **never presume** the user is satisfied
|
|
76
|
+
- **no reason is sufficient** to break the loop other than the user's explicit stop phrase
|
|
77
|
+
- after every autonomous run, after every decision, after every completion — always re-enter the loop with `ask_user`
|
|
78
|
+
|
|
79
|
+
The interaction loop stops **only** when the user explicitly says:
|
|
80
|
+
> "I am satisfied"
|
|
81
|
+
|
|
82
|
+
Until that exact phrase is received, the loop continues — unconditionally and indefinitely.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 2. Operational Procedures (Skill-Owned)
|
|
87
|
+
|
|
88
|
+
Operational procedures/checklists are owned by skills and are intentionally **not duplicated** here.
|
|
89
|
+
Read the corresponding `SKILL.md` when the trigger condition for that skill is met.
|
|
90
|
+
|
|
91
|
+
- **[`interaction-loop`](.github/skills/interaction-loop/SKILL.md)** — **Invoke when**: starting a task, hitting a decision point, or completing an autonomous run | **Provides**: 5-option iterative loop template, recommendation tracking, and stop-condition rules (`"I am satisfied"`)
|
|
92
|
+
|
|
93
|
+
- **[`breaking-change-paths`](.github/skills/breaking-change-paths/SKILL.md)** — **Invoke when**: a task may affect public contracts, APIs, schemas, or behavioral compatibility; or a root-cause fix implies architectural reshaping | **Provides**: structured pros/cons + risk level + migration steps for Breaking vs Non-Breaking path decision
|
|
94
|
+
|
|
95
|
+
- **[`planning-tracking`](.github/skills/planning-tracking/SKILL.md)** — **Invoke when**: starting any non-trivial task, scope changes during execution, or multiple files/workstreams must be coordinated | **Provides**: mandatory Plan/Milestone/Issue schema with dependency-ordered execution procedure and parallel-safe concurrency rules
|
|
96
|
+
|
|
97
|
+
- **[`completion-gate`](.github/skills/completion-gate/SKILL.md)** — **Invoke when**: closing an issue, marking a milestone done, or opening/merging a PR | **Provides**: double-consecutive-clean-pass quality gate (lint + build + required tests, zero errors/warnings, no exceptions)
|
|
98
|
+
|
|
99
|
+
- **[`github-sync`](.github/skills/github-sync/SKILL.md)** — **Invoke when**: creating/updating a plan, changing issue status, or completing milestones | **Provides**: naming rules, required metadata labels (priority/type/status), and step-by-step procedure to keep local plan and GitHub artifacts in sync
|
|
100
|
+
|
|
101
|
+
- **[`testing-policy`](.github/skills/testing-policy/SKILL.md)** — **Invoke when**: implementing or modifying any feature/fix; preparing issue closure or PR merge | **Provides**: required test layers (unit / integration / E2E / non-regression) and a before/after coverage diff procedure
|
|
102
|
+
|
|
103
|
+
- **[`e2e-testing`](.github/skills/e2e-testing/SKILL.md)** — **Invoke when**: a user-facing flow changes or a critical integration path is introduced/modified | **Provides**: E2E checklist covering happy path + edge cases, CI-compatible execution, stable selectors, and deterministic setup/teardown
|
|
104
|
+
|
|
105
|
+
- **[`session-logging`](.github/skills/session-logging/SKILL.md)** — **Invoke when**: starting/ending a session, completing issues/milestones, or syncing GitHub status | **Provides**: session journal file template with required sections (Status, Work Completed, Completion Gate evidence, Decisions, Blockers, GitHub Sync, Branch, Timestamp)
|
|
106
|
+
|
|
107
|
+
- **[`rollback-rca`](.github/skills/rollback-rca/SKILL.md)** — **Invoke when**: an issue fails the completion gate 3 consecutive times | **Provides**: RCA procedure (architecture/dependency/scope analysis) + 3 recovery options (rescope / rollback / redesign) to present via `ask_user`
|
|
108
|
+
|
|
109
|
+
- **[`policy-coherence-audit`](.github/skills/policy-coherence-audit/SKILL.md)** — **Invoke when**: updating `AGENTS.MD`, merging new workflow rules, or noticing behavioral ambiguity during execution | **Provides**: cross-policy contradiction checklist covering language, interaction model, completion gates, scope, and skill reference coherence
|
|
110
|
+
|
|
111
|
+
- **[`systematic-debugging`](.github/skills/systematic-debugging/SKILL.md)** — **Invoke when**: a bug or unexpected behavior is encountered, a test fails without obvious cause, or a previous fix attempt did not resolve the issue | **Provides**: evidence-based debugging procedure (reproduce → hypothesize → instrument → collect `debug-data.log` → analyze → fix → clean up), MCP tool integration for browser/network/runtime debugging
|
|
112
|
+
|
|
113
|
+
Runtime binding rule: when a skill requires asking the user, use `ask_user` and preserve the 5-option contract with option 4 fixed as `Freeform`.
|
package/assets/AGENTS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Runtime Dispatcher (No Tool-Name Ambiguity)
|
|
4
|
+
|
|
5
|
+
This repository provides **two runtime adapter files**:
|
|
6
|
+
|
|
7
|
+
1. `AGENTS.vscode.MD` — VS Code runtime (`vscode_askQuestions`)
|
|
8
|
+
2. `AGENTS.copilot-cli.MD` — Copilot CLI runtime (`ask_user`)
|
|
9
|
+
|
|
10
|
+
Do **not** mix tool names across runtimes.
|
|
11
|
+
|
|
12
|
+
## Selection Rule (Mandatory)
|
|
13
|
+
|
|
14
|
+
- If runtime is VS Code, use only `AGENTS.vscode.MD`.
|
|
15
|
+
- If runtime is Copilot CLI, use only `AGENTS.copilot-cli.MD`.
|
|
16
|
+
- At task start, mode selection and the 5-option interaction loop remain mandatory in the selected file.
|
|
17
|
+
|
|
18
|
+
## Ownership Model (Skills-First, Mandatory)
|
|
19
|
+
|
|
20
|
+
`AGENTS.md` + runtime adapters own only **runtime-critical contract**:
|
|
21
|
+
- question tool binding (`vscode_askQuestions` vs `ask_user`)
|
|
22
|
+
- fixed 5-option interaction shape
|
|
23
|
+
- `Freeform` hard invariant (option 4, exact label — "Something else" via `custom` enum value for inline free-text input)
|
|
24
|
+
- `Autonomous Mode` placement and stop condition (`"I am satisfied"`)
|
|
25
|
+
- escalation trigger for compatibility triad
|
|
26
|
+
|
|
27
|
+
All operational procedures/checklists are skill-owned and must not be duplicated as full policy prose in runtime adapters.
|
|
28
|
+
|
|
29
|
+
## Skill Catalog (Global Default)
|
|
30
|
+
|
|
31
|
+
Operational procedures/checklists are owned by skills. This catalog is the **global source of truth** — runtime adapters inherit it and must not duplicate its content.
|
|
32
|
+
|
|
33
|
+
Read the corresponding `SKILL.md` when the trigger condition for that skill is met.
|
|
34
|
+
|
|
35
|
+
- **[`interaction-loop`](.github/skills/interaction-loop/SKILL.md)** — **Invoke when**: starting a task, hitting a decision point, or completing an autonomous run | **Provides**: 5-option iterative loop template, recommendation tracking, and stop-condition rules (`"I am satisfied"`)
|
|
36
|
+
|
|
37
|
+
- **[`breaking-change-paths`](.github/skills/breaking-change-paths/SKILL.md)** — **Invoke when**: a task may affect public contracts, APIs, schemas, or behavioral compatibility; or a root-cause fix implies architectural reshaping | **Provides**: structured pros/cons + risk level + migration steps for Breaking vs Non-Breaking path decision
|
|
38
|
+
|
|
39
|
+
- **[`planning-tracking`](.github/skills/planning-tracking/SKILL.md)** — **Invoke when**: starting any non-trivial task, scope changes during execution, or multiple files/workstreams must be coordinated | **Provides**: mandatory Plan/Milestone/Issue schema with dependency-ordered execution procedure and parallel-safe concurrency rules
|
|
40
|
+
|
|
41
|
+
- **[`completion-gate`](.github/skills/completion-gate/SKILL.md)** — **Invoke when**: closing an issue, marking a milestone done, or opening/merging a PR | **Provides**: double-consecutive-clean-pass quality gate (lint + build + required tests, zero errors/warnings, no exceptions)
|
|
42
|
+
|
|
43
|
+
- **[`github-sync`](.github/skills/github-sync/SKILL.md)** — **Invoke when**: creating/updating a plan, changing issue status, or completing milestones | **Provides**: naming rules, required metadata labels (priority/type/status), and step-by-step procedure to keep local plan and GitHub artifacts in sync
|
|
44
|
+
|
|
45
|
+
- **[`testing-policy`](.github/skills/testing-policy/SKILL.md)** — **Invoke when**: implementing or modifying any feature/fix; preparing issue closure or PR merge | **Provides**: required test layers (unit / integration / E2E / non-regression) and a before/after coverage diff procedure
|
|
46
|
+
|
|
47
|
+
- **[`e2e-testing`](.github/skills/e2e-testing/SKILL.md)** — **Invoke when**: a user-facing flow changes or a critical integration path is introduced/modified | **Provides**: E2E checklist covering happy path + edge cases, CI-compatible execution, stable selectors, and deterministic setup/teardown
|
|
48
|
+
|
|
49
|
+
- **[`session-logging`](.github/skills/session-logging/SKILL.md)** — **Invoke when**: starting/ending a session, completing issues/milestones, or syncing GitHub status | **Provides**: session journal file template with required sections (Status, Work Completed, Completion Gate evidence, Decisions, Blockers, GitHub Sync, Branch, Timestamp)
|
|
50
|
+
|
|
51
|
+
- **[`rollback-rca`](.github/skills/rollback-rca/SKILL.md)** — **Invoke when**: an issue fails the completion gate 3 consecutive times | **Provides**: RCA procedure (architecture/dependency/scope analysis) + 3 recovery options (rescope / rollback / redesign) presented via the runtime question tool
|
|
52
|
+
|
|
53
|
+
- **[`policy-coherence-audit`](.github/skills/policy-coherence-audit/SKILL.md)** — **Invoke when**: updating `AGENTS.MD`, merging new workflow rules, or noticing behavioral ambiguity during execution | **Provides**: cross-policy contradiction checklist covering language, interaction model, completion gates, scope, and skill reference coherence
|
|
54
|
+
|
|
55
|
+
- **[`systematic-debugging`](.github/skills/systematic-debugging/SKILL.md)** — **Invoke when**: a bug or unexpected behavior is encountered, a test fails without obvious cause, or a previous fix attempt did not resolve the issue | **Provides**: evidence-based debugging procedure (reproduce → hypothesize → instrument → collect `debug-data.log` → analyze → fix → clean up), MCP tool integration for browser/network/runtime debugging
|
|
56
|
+
|
|
57
|
+
- **[`onecrawl-commands`](.github/skills/onecrawl-commands/SKILL.md)** — **Invoke when**: writing automation scripts, choosing between OneCrawl primitives and eval, or building agent workflows | **Provides**: complete command reference (200+ commands), decision flowchart (primitives-first, eval-as-fallback), anti-patterns, configuration guide
|
|
58
|
+
|
|
59
|
+
## Maintenance Rule
|
|
60
|
+
|
|
61
|
+
When updating policy logic:
|
|
62
|
+
|
|
63
|
+
1. If the change is runtime-critical, apply it to **both** runtime adapters (tool names adjusted per runtime).
|
|
64
|
+
2. If the change is operational/procedural, update the owning skill (`.github/skills/*/SKILL.md`) first, then update the entry in the **Skill Catalog** section above.
|
|
65
|
+
3. Keep semantic parity unless a runtime-specific behavior is intentionally required.
|
|
66
|
+
4. Preserve English-only wording and non-duplicative ownership between AGENTS and skills.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# AGENTS.vscode.MD
|
|
2
|
+
|
|
3
|
+
## 1. Interaction Protocol (Runtime-Critical Contract)
|
|
4
|
+
|
|
5
|
+
Interaction must occur **exclusively via `vscode_askQuestions`** and remain iterative, interactive, and unlimited.
|
|
6
|
+
If `vscode_askQuestions` is unavailable in the current runtime, use an equivalent structured question tool while preserving the same interaction contract.
|
|
7
|
+
|
|
8
|
+
Each iteration must ask exactly **one clear question** and provide exactly **5 options**.
|
|
9
|
+
|
|
10
|
+
Default option composition (for normal development decisions):
|
|
11
|
+
1. **Recommended Development Path** (mark as ⭐ most future-proof)
|
|
12
|
+
2. **Alternative Development Path A**
|
|
13
|
+
3. **Alternative Development Path B**
|
|
14
|
+
4. **Freeform** — "Something else": lets the user type a custom direction (uses `custom` enum value — see below)
|
|
15
|
+
5. **Autonomous Mode**
|
|
16
|
+
|
|
17
|
+
`Freeform` is a hard invariant across all iterations:
|
|
18
|
+
- option **4** must always be **Freeform** — the "Something else" escape hatch
|
|
19
|
+
- label must remain exactly `Freeform` (no rename, merge, or synonym replacement)
|
|
20
|
+
- **implementation**: set the enum value to `custom` — if the runtime supports custom responses in enum fields the user can type their preferred direction directly in the prompt without a separate freeform tool call; otherwise fall back to a follow-up freeform prompt
|
|
21
|
+
- when the user types a custom response, treat it as their chosen direction and proceed accordingly
|
|
22
|
+
- applies to default mode, compatibility-triad escalation, rollback/RCA prompts, and task-start mode selection
|
|
23
|
+
- if `Freeform` is missing, the iteration is invalid and must be regenerated before proceeding
|
|
24
|
+
|
|
25
|
+
Continuity is mandatory:
|
|
26
|
+
- options **1-3** must, by default, carry forward all still-valid options from the previous iteration
|
|
27
|
+
- do not drop an option silently; if one is removed, explicitly state why and what replaced it
|
|
28
|
+
|
|
29
|
+
For each option, always include:
|
|
30
|
+
- why the option exists
|
|
31
|
+
- where the option leads next (expected outcome / milestone impact)
|
|
32
|
+
- risk level (`low` / `medium` / `high`)
|
|
33
|
+
|
|
34
|
+
Use this mandatory option card format:
|
|
35
|
+
`<Option title> — Why: <reason> | Leads to: <next step/result> | Risk: <low|medium|high>`
|
|
36
|
+
|
|
37
|
+
Recommendation tracking is mandatory:
|
|
38
|
+
- mark the current recommendation with ⭐
|
|
39
|
+
- if the recommendation changes from the previous iteration, explain why in one sentence
|
|
40
|
+
|
|
41
|
+
The compatibility triad below is an **escalation package**, not the default:
|
|
42
|
+
- **Non-Breaking Path**
|
|
43
|
+
- **Breaking Path**
|
|
44
|
+
- **Alternative Structural Path**
|
|
45
|
+
|
|
46
|
+
Use the compatibility triad only when at least one condition is true:
|
|
47
|
+
- there is a concrete compatibility/contract impact
|
|
48
|
+
- migration effort must be evaluated
|
|
49
|
+
- architectural break/refactor trade-off is the core decision
|
|
50
|
+
- the user explicitly asks for breaking/non-breaking analysis
|
|
51
|
+
|
|
52
|
+
When the compatibility triad is used:
|
|
53
|
+
- the interaction still remains exactly 5 options: triad options + **Freeform** + **Autonomous Mode**
|
|
54
|
+
- include at minimum: pros/cons, risk level, migration steps
|
|
55
|
+
- explicitly state that quality gates are unchanged (unit/integration/E2E/non-regression must still pass)
|
|
56
|
+
|
|
57
|
+
At the beginning of each task, mode selection is mandatory: **never assume a default mode globally**.
|
|
58
|
+
Mode selection at task start must use the same 5-option structure above (development-options-first unless escalation is justified).
|
|
59
|
+
|
|
60
|
+
### Autonomous Mode
|
|
61
|
+
|
|
62
|
+
`Autonomous Mode` means:
|
|
63
|
+
- work autonomously until all milestones are completed
|
|
64
|
+
- always choose the best, most future-proof option within the selected path
|
|
65
|
+
- if a new unapproved breaking impact appears, pause and ask via `vscode_askQuestions`
|
|
66
|
+
- **at the end of every autonomous run** — **mandatory, no exceptions**: invoke `vscode_askQuestions` to re-enter the feedback loop; the run is considered incomplete until this call is made — ask for:
|
|
67
|
+
1. rating of the completed run
|
|
68
|
+
2. next action to take
|
|
69
|
+
3. explicit satisfaction confirmation
|
|
70
|
+
|
|
71
|
+
### Feedback Loop — Never Interrupt
|
|
72
|
+
|
|
73
|
+
The feedback loop is **perpetual by design**:
|
|
74
|
+
- the loop **must never self-terminate** for any reason (task completion, milestone reached, silence, assumed satisfaction)
|
|
75
|
+
- the agent must **never presume** the user is satisfied
|
|
76
|
+
- **no reason is sufficient** to break the loop other than the user's explicit stop phrase
|
|
77
|
+
- after every autonomous run, after every decision, after every completion — always re-enter the loop with `vscode_askQuestions`
|
|
78
|
+
|
|
79
|
+
The interaction loop stops **only** when the user explicitly says:
|
|
80
|
+
> "I am satisfied"
|
|
81
|
+
|
|
82
|
+
Until that exact phrase is received, the loop continues — unconditionally and indefinitely.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 2. Operational Procedures (Skill-Owned)
|
|
87
|
+
|
|
88
|
+
Operational procedures/checklists are owned by skills and are intentionally **not duplicated** here.
|
|
89
|
+
Read the corresponding `SKILL.md` when the trigger condition for that skill is met.
|
|
90
|
+
|
|
91
|
+
- **[`interaction-loop`](.github/skills/interaction-loop/SKILL.md)** — **Invoke when**: starting a task, hitting a decision point, or completing an autonomous run | **Provides**: 5-option iterative loop template, recommendation tracking, and stop-condition rules (`"I am satisfied"`)
|
|
92
|
+
|
|
93
|
+
- **[`breaking-change-paths`](.github/skills/breaking-change-paths/SKILL.md)** — **Invoke when**: a task may affect public contracts, APIs, schemas, or behavioral compatibility; or a root-cause fix implies architectural reshaping | **Provides**: structured pros/cons + risk level + migration steps for Breaking vs Non-Breaking path decision
|
|
94
|
+
|
|
95
|
+
- **[`planning-tracking`](.github/skills/planning-tracking/SKILL.md)** — **Invoke when**: starting any non-trivial task, scope changes during execution, or multiple files/workstreams must be coordinated | **Provides**: mandatory Plan/Milestone/Issue schema with dependency-ordered execution procedure and parallel-safe concurrency rules
|
|
96
|
+
|
|
97
|
+
- **[`completion-gate`](.github/skills/completion-gate/SKILL.md)** — **Invoke when**: closing an issue, marking a milestone done, or opening/merging a PR | **Provides**: double-consecutive-clean-pass quality gate (lint + build + required tests, zero errors/warnings, no exceptions)
|
|
98
|
+
|
|
99
|
+
- **[`github-sync`](.github/skills/github-sync/SKILL.md)** — **Invoke when**: creating/updating a plan, changing issue status, or completing milestones | **Provides**: naming rules, required metadata labels (priority/type/status), and step-by-step procedure to keep local plan and GitHub artifacts in sync
|
|
100
|
+
|
|
101
|
+
- **[`testing-policy`](.github/skills/testing-policy/SKILL.md)** — **Invoke when**: implementing or modifying any feature/fix; preparing issue closure or PR merge | **Provides**: required test layers (unit / integration / E2E / non-regression) and a before/after coverage diff procedure
|
|
102
|
+
|
|
103
|
+
- **[`e2e-testing`](.github/skills/e2e-testing/SKILL.md)** — **Invoke when**: a user-facing flow changes or a critical integration path is introduced/modified | **Provides**: E2E checklist covering happy path + edge cases, CI-compatible execution, stable selectors, and deterministic setup/teardown
|
|
104
|
+
|
|
105
|
+
- **[`session-logging`](.github/skills/session-logging/SKILL.md)** — **Invoke when**: starting/ending a session, completing issues/milestones, or syncing GitHub status | **Provides**: session journal file template with required sections (Status, Work Completed, Completion Gate evidence, Decisions, Blockers, GitHub Sync, Branch, Timestamp)
|
|
106
|
+
|
|
107
|
+
- **[`rollback-rca`](.github/skills/rollback-rca/SKILL.md)** — **Invoke when**: an issue fails the completion gate 3 consecutive times | **Provides**: RCA procedure (architecture/dependency/scope analysis) + 3 recovery options (rescope / rollback / redesign) to present via `vscode_askQuestions`
|
|
108
|
+
|
|
109
|
+
- **[`policy-coherence-audit`](.github/skills/policy-coherence-audit/SKILL.md)** — **Invoke when**: updating `AGENTS.MD`, merging new workflow rules, or noticing behavioral ambiguity during execution | **Provides**: cross-policy contradiction checklist covering language, interaction model, completion gates, scope, and skill reference coherence
|
|
110
|
+
|
|
111
|
+
- **[`systematic-debugging`](.github/skills/systematic-debugging/SKILL.md)** — **Invoke when**: a bug or unexpected behavior is encountered, a test fails without obvious cause, or a previous fix attempt did not resolve the issue | **Provides**: evidence-based debugging procedure (reproduce → hypothesize → instrument → collect `debug-data.log` → analyze → fix → clean up), MCP tool integration for browser/network/runtime debugging
|
|
112
|
+
|
|
113
|
+
Runtime binding rule: when a skill requires asking the user, use `vscode_askQuestions` and preserve the 5-option contract with option 4 fixed as `Freeform`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Skills Index
|
|
2
|
+
|
|
3
|
+
Use this index to quickly select the right skill file.
|
|
4
|
+
|
|
5
|
+
## Decision & Interaction
|
|
6
|
+
- `interaction-loop/SKILL.md` — 5-option iterative question flow, rating/next action/satisfaction checkpoints.
|
|
7
|
+
- `breaking-change-paths/SKILL.md` — non-breaking vs breaking packaging, migration, unchanged quality gates.
|
|
8
|
+
|
|
9
|
+
## Planning & Delivery
|
|
10
|
+
- `planning-tracking/SKILL.md` — plan structure, milestone/issue flow.
|
|
11
|
+
- `completion-gate/SKILL.md` — mandatory quality gate and double clean-pass rule.
|
|
12
|
+
- `github-sync/SKILL.md` — mirror plan states to GitHub artifacts.
|
|
13
|
+
- `session-logging/SKILL.md` — mandatory session reporting format.
|
|
14
|
+
- `rollback-rca/SKILL.md` — failure handling, rollback, root-cause escalation.
|
|
15
|
+
|
|
16
|
+
## Testing
|
|
17
|
+
- `testing-policy/SKILL.md` — unit/integration/E2E/non-regression baseline and enforcement.
|
|
18
|
+
- `e2e-testing/SKILL.md` — focused E2E execution checklist and anti-flakiness rules.
|
|
19
|
+
|
|
20
|
+
## Policy Maintenance
|
|
21
|
+
- `policy-coherence-audit/SKILL.md` — detect and fix contradictions across AGENTS policies.
|
|
22
|
+
|
|
23
|
+
## Debugging
|
|
24
|
+
- `systematic-debugging/SKILL.md` — evidence-based debugging via structured logging, `debug-data.log` analysis, and MCP tool integration.
|
|
25
|
+
|
|
26
|
+
## Suggested invocation order (quick)
|
|
27
|
+
1. `interaction-loop` (select path)
|
|
28
|
+
2. `planning-tracking`
|
|
29
|
+
3. `breaking-change-paths` (if relevant)
|
|
30
|
+
4. `testing-policy` + `e2e-testing` (if relevant)
|
|
31
|
+
5. `systematic-debugging` (if bug/unexpected behavior)
|
|
32
|
+
6. `completion-gate`
|
|
33
|
+
7. `session-logging` + `github-sync`
|
|
34
|
+
8. `rollback-rca` (only if blocked/failing repeatedly)
|
|
35
|
+
9. `policy-coherence-audit` (when editing policy)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: breaking-change-paths
|
|
3
|
+
description: "Structured decision process between Non-Breaking and Breaking paths without relaxing quality gates."
|
|
4
|
+
---
|
|
5
|
+
# Breaking Change Decision Skill
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Run a structured, future-proof decision process between Non-Breaking and Breaking paths without relaxing quality gates.
|
|
9
|
+
|
|
10
|
+
## Use when
|
|
11
|
+
- A task may affect public contracts, APIs, schemas, or behavioral compatibility
|
|
12
|
+
- Root-cause fixes suggest architectural reshaping
|
|
13
|
+
|
|
14
|
+
## Checklist
|
|
15
|
+
- Explicitly classify impact: Non-Breaking vs Breaking.
|
|
16
|
+
- Present both paths with:
|
|
17
|
+
- pros/cons
|
|
18
|
+
- risk level
|
|
19
|
+
- migration steps
|
|
20
|
+
- State explicitly: quality gates are unchanged for both paths.
|
|
21
|
+
- Require green unit/integration/E2E/non-regression tests in both cases.
|
|
22
|
+
- If Breaking is selected, include migration and compatibility notes before execution.
|
|
23
|
+
|
|
24
|
+
## Short examples
|
|
25
|
+
- Non-Breaking path: adapter layer preserving old contract while introducing new internals.
|
|
26
|
+
- Breaking path: remove deprecated endpoint + provide migration map + test updates.
|
|
27
|
+
|
|
28
|
+
## Anti-patterns
|
|
29
|
+
- Assuming breaking path without explicit selection
|
|
30
|
+
- Treating breaking changes as exempt from test gates
|
|
31
|
+
- Missing migration guidance
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: completion-gate
|
|
3
|
+
description: "Mandatory quality gate for every Issue, Milestone, and PR with zero-error execution and no technical debt carry-over."
|
|
4
|
+
---
|
|
5
|
+
# Universal Completion Gate Skill
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Enforce a mandatory quality gate for every Issue, Milestone, and PR with zero-error execution and no technical debt carry-over.
|
|
9
|
+
|
|
10
|
+
## Use when
|
|
11
|
+
- Closing an issue
|
|
12
|
+
- Marking a milestone as done
|
|
13
|
+
- Opening/merging a PR
|
|
14
|
+
|
|
15
|
+
## Mandatory Gate (no exceptions)
|
|
16
|
+
1. **Double consecutive review**: two full consecutive passes with **0 errors** and **0 warnings**.
|
|
17
|
+
2. Fix all new issues and all pre-existing issues in touched scope.
|
|
18
|
+
3. Lint/type-check/build/static analysis pass with 0 errors/0 warnings.
|
|
19
|
+
4. Required tests pass (unit, integration if applicable, E2E if applicable, non-regression).
|
|
20
|
+
5. Full suite passes; coverage is not below baseline.
|
|
21
|
+
|
|
22
|
+
## Procedure
|
|
23
|
+
1. Run full review/check suite.
|
|
24
|
+
2. If any error/warning exists, fix and restart from step 1.
|
|
25
|
+
3. Repeat until two clean consecutive passes are recorded.
|
|
26
|
+
4. Only then mark status `done`/merge.
|
|
27
|
+
|
|
28
|
+
## Done Criteria
|
|
29
|
+
- Two consecutive clean review passes are documented.
|
|
30
|
+
- No unresolved pre-existing issues in touched scope.
|
|
31
|
+
|
|
32
|
+
## Anti-patterns
|
|
33
|
+
- Single-pass approval
|
|
34
|
+
- Ignoring warnings
|
|
35
|
+
- Deferring known issues to “later”
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: e2e-testing
|
|
3
|
+
description: "Deterministic, CI-ready end-to-end validation for critical user flows."
|
|
4
|
+
---
|
|
5
|
+
# E2E Testing Skill
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Define deterministic, CI-ready end-to-end validation for critical user flows.
|
|
9
|
+
|
|
10
|
+
## Use when
|
|
11
|
+
- A user-facing flow changes
|
|
12
|
+
- A critical integration path is introduced or modified
|
|
13
|
+
- Regression risk is non-trivial
|
|
14
|
+
|
|
15
|
+
## Checklist
|
|
16
|
+
- Cover at least one E2E scenario per critical flow.
|
|
17
|
+
- Include happy path + key error/edge cases.
|
|
18
|
+
- Use programmatic execution only (CI-compatible, non-interactive).
|
|
19
|
+
- Prefer stable selectors (for example, `data-testid`).
|
|
20
|
+
- Keep tests deterministic and isolated with proper setup/teardown.
|
|
21
|
+
- Ensure E2E is part of non-regression validation before completion.
|
|
22
|
+
|
|
23
|
+
## Short examples
|
|
24
|
+
- Checkout flow: payment success + payment failure retry path.
|
|
25
|
+
- Auth flow: valid login + expired token refresh path.
|
|
26
|
+
|
|
27
|
+
## Anti-patterns
|
|
28
|
+
- Manual-only E2E verification
|
|
29
|
+
- Flaky timing-based waits without stable signals
|
|
30
|
+
- Skipping E2E updates after flow changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-sync
|
|
3
|
+
description: "Keep local plan and GitHub project artifacts perfectly aligned with milestones, issues, labels, and statuses."
|
|
4
|
+
---
|
|
5
|
+
# GitHub Sync Skill
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Keep local plan and GitHub project artifacts perfectly aligned (milestones, issues, labels, statuses, dependencies).
|
|
9
|
+
|
|
10
|
+
## Use when
|
|
11
|
+
- Creating/updating plan
|
|
12
|
+
- Changing issue status
|
|
13
|
+
- Completing milestones
|
|
14
|
+
|
|
15
|
+
## Naming Rules
|
|
16
|
+
- Milestone: `M<id> — <description>`
|
|
17
|
+
- Issue: `[M<milestone_id>] I<issue_id> — <task>`
|
|
18
|
+
|
|
19
|
+
## Required Metadata
|
|
20
|
+
- Priority label: `P-critical|P-high|P-medium|P-low`
|
|
21
|
+
- Type label: `feat|fix|refactor|chore|test`
|
|
22
|
+
- Status label: `in-progress|review|blocked`
|
|
23
|
+
- Milestone link
|
|
24
|
+
- Dependency note: `depends on #<issue_number>`
|
|
25
|
+
- Parent/child note: `part of #<issue_number>`
|
|
26
|
+
|
|
27
|
+
## Procedure
|
|
28
|
+
1. On plan create/update, create/update corresponding GitHub milestones/issues.
|
|
29
|
+
2. On local issue status change, sync GitHub status + labels immediately.
|
|
30
|
+
3. Close milestone when all linked issues are done.
|
|
31
|
+
4. Ensure no orphan issues (every issue belongs to a milestone).
|
|
32
|
+
|
|
33
|
+
## Done Criteria
|
|
34
|
+
- Local plan == GitHub state (titles, labels, status, dependencies).
|
|
35
|
+
|
|
36
|
+
## Anti-patterns
|
|
37
|
+
- Local-only tracking
|
|
38
|
+
- Orphan issues
|
|
39
|
+
- Stale labels/status
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: interaction-loop
|
|
3
|
+
description: "Iterative decision loop with consistent user checkpoints and explicit stop criteria."
|
|
4
|
+
---
|
|
5
|
+
# Interaction Loop Skill
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
Enforce a strict iterative decision loop with consistent user checkpoints and explicit stop criteria.
|
|
9
|
+
|
|
10
|
+
## Use when
|
|
11
|
+
- Starting a new task
|
|
12
|
+
- Hitting a decision point
|
|
13
|
+
- Completing an autonomous run
|
|
14
|
+
|
|
15
|
+
## Checklist
|
|
16
|
+
- Ask exactly one clear question per iteration.
|
|
17
|
+
- Provide exactly 5 options:
|
|
18
|
+
1) Non-Breaking Path
|
|
19
|
+
2) Breaking Path
|
|
20
|
+
3) Alternative Structural Path
|
|
21
|
+
4) Freeform (set enum value to `custom` — allows the user to type a free-text direction inline)
|
|
22
|
+
5) Autonomous Mode
|
|
23
|
+
- Mark the recommended (most future-proof) option.
|
|
24
|
+
- At autonomous completion, ask for: rating, next action, satisfaction.
|
|
25
|
+
- Continue iterating until the exact stop phrase is provided: **"I am satisfied"**.
|
|
26
|
+
|
|
27
|
+
## Short examples
|
|
28
|
+
- Start-of-task question: "Which path should I execute first?" (5 options above).
|
|
29
|
+
- End-of-run question: "Rate this result, choose the next action, and confirm satisfaction."
|
|
30
|
+
|
|
31
|
+
## Anti-patterns
|
|
32
|
+
- Multi-question prompts in one iteration
|
|
33
|
+
- Missing one or more of the 5 mandatory options
|
|
34
|
+
- Stopping without explicit "I am satisfied"
|