Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/argent-installer/test/skills-frontmatter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import fs from "node:fs";
Comment thread
j-piasecki marked this conversation as resolved.
import path from "node:path";
import { fileURLToPath } from "node:url";

import { parse as parseYaml } from "yaml";
import { describe, expect, it } from "vitest";

const skillsDir = fileURLToPath(new URL("../../skills/skills/", import.meta.url));

describe("bundled skill frontmatter", () => {
it("parses every SKILL.md YAML block", () => {
const skillFiles = fs
.readdirSync(skillsDir, { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.map((entry) => path.join(skillsDir, entry.name, "SKILL.md"))
.filter((filePath) => fs.existsSync(filePath));

expect(skillFiles.length).toBeGreaterThan(0);
for (const filePath of skillFiles) {
const content = fs.readFileSync(filePath, "utf8");
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
expect(frontmatter, `${filePath} is missing YAML frontmatter`).toBeDefined();
expect(
() => parseYaml(frontmatter!),
`${filePath} has invalid YAML frontmatter`
).not.toThrow();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Diplomat]: This guard never looks at name, which is the field that decides a skill's install identity.

The test asserts only that a frontmatter block exists and that parseYaml does not throw (lines 21-26); the only name in the file is entry.name in the path join at line 15. I checked what identity actually means by driving the real skills CLI: a source directory argent-zzz-dirname whose SKILL.md carries name: argent-zzz-frontmattername installs to .agents/skills/argent-zzz-frontmattername and writes the lock key argent-zzz-frontmattername — the frontmatter name, not the directory.

That matters because skills.ts compares the two sets: bundled comes from directory names (utils.ts:100-107, via listBundledSkills), tracked comes from lock keys, orphaned = tracked.filter((name) => !bundled.has(name)) (skills.ts:79, :96, :99), and the orphans go to npx skills remove -y in both project and global scope (:126-128). So a new or renamed skill directory whose frontmatter name does not match ships green here, installs under its frontmatter name, is immediately classified orphaned because that name is absent from the directory-derived set, and is pruned on the next argent init/update — the user sees only a prune line, and the skill is never usable. The codebase already treats the frontmatter name as the identity for exactly this reason (uninstall.ts:166-179, readBundledSkillName).

Adding a skill directory is the operation this PR performs and the one this test was added to cover; nothing else catches it (scripts/grade-skills.mjs keys its rows off the directory and scores description only, and the other SKILL.md-touching tests build tmpdir fixtures).

}
});
});
15 changes: 11 additions & 4 deletions packages/skills/rules/argent.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Decision order:
- Interaction tools (`gesture-tap`, `gesture-swipe`, `gesture-pinch`, `gesture-rotate`, `gesture-custom`, `launch-app`, etc.) return a screenshot automatically.
Call `screenshot` separately only for a baseline before any action or after a delay.
- Always open apps with `launch-app` or `open-url` — never tap home screen icons.
- If there is any chance the task ends in a recorded flow or QA test, do not interact with the app first: load `argent-create-flow` and start the recorder before the first launch or in-app action. A path already walked cannot be recorded retroactively.
- Always use `run-sequence` when performing multiple sequential device actions where you don't need to observe the screen between steps. More in `argent-device-interact` skill.
- When the session ends or the user says they are done: call `stop-all-simulator-servers` with `devices: [...]`
naming the devices this session actually used. One tool-server is shared by every other agent using this
Expand Down Expand Up @@ -131,7 +132,7 @@ When: Explicit visual regression, screenshot diff, compare screenshots, before/a

SCREEN RECORDING (VIDEO CAPTURE)
Skill: `argent-screen-recording`
When: The user wants a video of the device screen — recording a flow, interaction, animation, or bug reproduction as a clip, or documenting app behavior beyond what a still screenshot shows. Covers the start → interact → stop lifecycle, the reminder discipline that keeps a recording from being left running, and retrieving the mp4 artifact.
When: The user wants a video of the device screen — recording a flow, interaction, animation, or bug reproduction as a clip, or documenting app behavior beyond what a still screenshot shows. Covers the start → interact → stop lifecycle, the reminder discipline that keeps a recording from being left running, and retrieving the mp4 artifact. Not for a replayable saved sequence: route that meaning of "record a flow" to `argent-create-flow`.
Prompt keywords: record, recording, screen recording, video, capture video, clip, mp4

RUNNING / BUILDING / DEBUGGING REACT NATIVE APP
Expand All @@ -154,15 +155,21 @@ PERFORMANCE OPTIMIZATION
Use skill: `argent-react-native-optimization`
When: App feels slow, user asks to optimize, reducing bundle size, improving startup time, fixing re-renders, optimizing lists/images/navigation, or any performance-related task. This is the entry-point skill for all performance work — it delegates to `argent-react-native-profiler` for measurement.

END-TO-END UI TESTING
INTERACTIVE UI TESTING (ONE-OFF, NOT SAVED)
Skill: `argent-test-ui-flow`
When: Verifying complete user flows, running interact → screenshot → verify loops, testing features by using the app, executing manual QA steps, or validating visible UI changes or visual behavior after implementation.
When: Verifying complete user flows, running interact → screenshot → verify loops, testing features by using the app, executing manual QA steps, or validating visible UI changes or visual behavior after implementation. Not for a test that must be saved and re-run — see GENERATED QA REGRESSION TESTS below.

RECORDING & REPLAYING FLOWS
Use skill: `argent-create-flow`
When: A multi-step interaction sequence needs to be repeated — re-profiling after a fix, A/B comparisons, regression checks, user says "again" / "run that flow", or you worked through a complex path worth saving. Also use proactively: if you are about to repeat steps you already performed, record first, then replay.
When: A multi-step interaction sequence needs to be repeated — re-profiling after a fix, A/B comparisons, user says "again" / "run that flow", or you worked through a complex path worth saving. Also use proactively: if you are about to repeat steps you already performed, record first, then replay. For a QA test case, ticket, or acceptance criteria to keep as a regression test, use `argent-qa-flows` (it loads this skill as its engine).
Prompt keywords: flow, repeat, test X times

GENERATED QA REGRESSION TESTS
Use skill: `argent-qa-flows`
When: The user gives a test case, ticket, or acceptance criteria to keep as a repeatable test — "generate a QA test", "turn this test case into a flow", "automate this regression check", "make a test that does X and checks Y". Orchestrates `argent-create-flow`, records the first walkthrough live, verifies each requested screen/state with stable evidence, and completes only after the unchanged full flow passes twice consecutively. iOS, Android, and Chromium.
Prompt keywords: QA test, regression test, test case, automate this test, automate an e2e test, keep this e2e test, generate a test
Saved-artifact rule: one-off interactive check → `argent-test-ui-flow`; saved replayable path → `argent-create-flow`; saved test with acceptance criteria and two-pass proof → `argent-qa-flows`.

PROPOSING DESIGN VARIANTS FOR HUMAN SELECTION
Use skill: `argent-lens`
When: The user asks for design alternatives / options / A-B choices for a screen or component, or you have produced more than one candidate look for an element and want a human to pick before committing. Covers the build → navigate → screenshot → propose_variant loop and the single blocking await_user_selection call. (Gated behind the `argent-lens` flag, off by default — run `argent enable argent-lens` first.)
Expand Down
Loading