ai-native-workflow
Skill222 starsChanged 4 months agoMITView on GitHub
Sole entry-point router for AI-assisted work on this Playwright scaffold — owns the 8-phase main workflow (classify → route → explore → plan+confidence → human gate → apply → verify → report), the human↔agent conversation contract, the routing matrix that picks the right specialized skill, and the confidence-gate format that every non-trivial proposal must include. Use whenever a user starts a non-trivial task ("add tests for X", "create a page object", "rename this enum", "debug this failure", "refactor Y"), when onboarding to AI-assisted development on this scaffold, when planning a multi-step change that chains across several skills, or when the user asks "how should I work with AI here", "which skill for X?", "why is the agent doing Y?". This is the routing layer — load it first, then chain to the deep skill it points at.
- Reads credentials
In this repository37 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/rules.mdcCursor rule
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
- skill-creatorSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Ask, don't invent: Never guess folder names, file paths, env-var names, enum values, credentials, or message strings.
- Very specific: line 20
.cursor/rules/rules.mdcConstitution is the safety floor: MUST/SHOULD/WON'T tables are hard stops. - Distinctive: line 22
Confidence gate is required: Every Plan output must include a 1-10 confidence + rationale + unknowns block.
- Distinctive: line 29
Every non-trivial task runs through these phases in order.
- Distinctive: line 44
Every Plan output before the human gate uses this shape:
- Very specific: line 60
≥ 9: only if: explicit OpenAPI / spec match, no {area} ambiguity, no missing enum / env / credential, no untested branch, no in-flight …
- Very specific: line 80
If intent matches none of the above → default to common-tasks or ask the user to clarify.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI-Native Workflow
Routing layer between user intent and the specialized skills that own the rules. Load first on every non-trivial task.
For deeper context: see references/three-layer-model.md, references/conversation-contract.md, references/principles.md, references/examples.md, references/troubleshooting.md.
Critical
- Low confidence means Phase 3 is incomplete. If the would-be confidence is < 5, do NOT emit Phase 4. Return to Phase 3 and ASK the user for the missing primary inputs (URL, OpenAPI link, field list, area name). Phase 4 exists for honest trade-off decisions, not for documenting "I don't have enough data" — that belongs in a question to the user. This rule is the most leveraged in the workflow: it is what stops the agent from emitting plausible-looking plans built on guesses.
- Ask, don't invent. Never guess folder names, file paths, env-var names, enum values, credentials, or message strings.
ls,grep,playwright-cli, OpenAPI — or ask. - Refuse placeholders. Guessed selectors, unverified message strings, made-up enum values, secret-shaped strings — refuse and re-explore.
TODO/skeleton/ "to fill in later" outputs count as placeholders too — offering a "skeleton page object with TODO locators while we wait forplaywright-cli" is the same failure mode as inventing locators outright; don't. - Verify the user's premise even in Direct Mode. Before applying a one-line fix, confirm the reported defect actually exists (the typo on the cited line, the import the user wants removed, the value the user says is currently set). If the premise doesn't match the file, switch out of Direct Mode and ASK — applying a "fix" to a defect that isn't there invents a change.
- Specialized skills own the rules. This skill never restates rules from
api-testing,page-objects, etc. It tells you which skill to load and in what order. .cursor/rules/rules.mdcConstitution is the safety floor. MUST/SHOULD/WON'T tables are hard stops; they take precedence over any prose, template, or example.- Audit-then-edit by default. For any non-trivial change, follow the 8-phase workflow below. Phase 4 (Plan + Confidence) is mandatory before Phase 6 (Apply).
- Confidence gate is required. Every Plan output must include a 1-10 confidence + rationale + unknowns block. See "Phase 4" below.
- Exploration is non-negotiable. UI →
playwright-clionly (no IDE browser MCP, no Cursor browser, noplaywright codegen). API → OpenAPI/docs first, live HTTP only as fallback. - One skill at a time. Load skills sequentially per the routing table. Don't stack 5 skills' Critical blocks before starting work.
- After any test edit, run the affected tests. On red, load
debugging— never suppress, never bump timeouts.
Main Workflow (8 Phases)
Every non-trivial task runs through these phases in order.
| # | Phase | Generic substeps | Flow-specific substeps owned by |
| 1 | Classify intent | Match user request → intent class (codegen / edit / refactor / debug / explore / config). | — |
| 2 | Route | Pick first skill from routing table. Codegen → common-tasks. Other → direct skill. | — |
| 3 | Explore | Confirm what's known vs unknown; gather evidence per flow. If a primary input is missing (URL, OpenAPI, area folder, field list), ASK the user before advancing — do NOT carry the gap into Phase 4. | UI: playwright-cli. API: api-testing Phase 1 (OpenAPI). Refactor: refactor-values Phase 1 (impact grep). Debug: debugging capture step. |
| 4 | Plan + Confidence | Produce proposal block (see format below). | — (owned here) |
| 5 | Human gate | Wait for confirm / reject / rework. On reject → return to Phase 3 with stated gap. | — |
| 6 | Apply | Edits per leaf-skill rules. Re-check Critical blocks of every loaded skill. | leaf skill |
| 7 | Verify | Lint + run affected tests. Red → load debugging. | debugging (on red), refactor-values Phase 4 (refactor), api-testing Phase 5 (API coverage matrix) |
| 8 | Report + commit ask | Files changed, line counts, lint status. Ask before committing. | — |
Phase 4 — Confidence-Gate Format (mandatory)
Every Plan output before the human gate uses this shape:
## Proposal
- Scope: <files + what changes>
- Trade-offs: <if any>
- Confidence: <1-10> (<low|medium|high>)
- Rationale: <one line per +/- factor>
- Unknowns: <list or "none">Confidence rules:
- < 5 → do NOT emit Phase 4. Exploration is incomplete. Return to Phase 3 and ASK the user for the missing primary input (URL, OpenAPI source, area folder, field list, etc.). Frame the gap as questions, not as a low-confidence proposal.
- 5-7 → emit Phase 4 with explicit unknowns. Proceed only if the human accepts the trade-offs at this confidence level.
- ≥ 8 → full evidence in hand; proceed normally.
- ≥ 9 only if: explicit OpenAPI / spec match, no
{area}ambiguity, no missing enum / env / credential, no untested branch, no in-flight conflicting work. - Rejection by human → re-enter Phase 3 with stated gap. Do not retry Phase 4 with the same plan.
Routing Table (intent → first skill)
| User intent | First skill | Then chains to |
"Add tests for POST /api/..." | api-testing | data-strategy, enums, type-safety, debugging |
| "Add a page object for X" | page-objects | selectors, playwright-cli, enums, fixtures |
| "Generate prompt for X" / "How do I add Y?" | common-tasks | matching specialized skill |
| "Test failing / flaky" | debugging | api-testing, selectors, fixtures, refactor-values |
| "Rename enum / change static value" | refactor-values | enums or data-strategy → debugging |
| "Create factory for X" | data-strategy | type-safety, api-testing |
| "Wire setup helper / helper fixture" | helpers or fixtures | api-testing Phase 8 |
| "Add env var / config / utility URL" | config | enums, type-safety |
| "Add enum / endpoint / message" | enums | playwright-cli for live-text verification |
| "Refactor Zod schema / convert any → typed" | type-safety | api-testing |
| "Add spec file / tag / structure question" | test-standards | data-strategy, api-testing, page-objects |
| "How does this scaffold work with AI?" | this skill | relevant specialized skill |
If intent matches none of the above → default to common-tasks or ask the user to clarify.
Direct Mode (skip audit-then-edit)
For trivial work (one-line fix, obvious typo, single import) the agent applies and reports back. The user can say "just do it" once to opt out of audit-then-edit for the rest of the session for trivial work. Substantive changes still go through the 8-phase workflow.
Even in Direct Mode, verify the user's premise before editing. Open the cited file, find the cited line, confirm the reported defect is actually there. If the typo isn't on that line, the import isn't where the user said, or the value isn't what the user claims it currently is — stop and report the mismatch instead of applying a "fix" to a defect that doesn't exist. This is the same anti-invention principle as Phase 3 ASK, scaled to one-line work.
When to Stop and Ask
- Path / folder name unknown (
lsfirst; if still unclear, ask). - Enum value / message text / endpoint path unknown (
playwright-clifor UI, OpenAPI for API; ask if neither). - Two valid approaches with meaningful trade-offs (architectural decisions belong to the human).
- A skill's Critical rule conflicts with the user's request (raise it; never silently bypass).
For the full conversation contract (audit-then-edit details, refusal triggers), see references/conversation-contract.md.
Common Critical Rules to Re-Check in Phase 6
Surface across multiple specialized skills — re-check before declaring done:
expect(SchemaName.parse(body)).toBeTruthy();for API responses.getByRole > getByLabel > getByPlaceholder > getByText > getByTestIdfor selectors.- Single tag per test;
@destructiveis heaviest and wins — shared/global state only (locale, permissions, roles, access, flags, settings). Isolated own-data tests keep their importance tag. Any state-mutating test needs a revert hook. z.strictObject()(neverz.object()), noany, no XPath, nopage.waitForTimeout(...).process.env.*for URLs/credentials;enums/{area}/*for paths/messages.- Static data is
.tswithas constexports — never.json.
See Also
.cursor/rules/rules.mdc— always-loaded Constitution (MUST/SHOULD/WON'T tables).common-tasks— codegen sub-router with prompt templates.debugging— failure-investigation half of the lifecycle (Phase 7 routes here on red).api-testing— deep skill for API work; owns Phase 1 (contract source) and Phase 7 (behaviour mismatch).refactor-values— deep skill for changing existing enum / static values.page-objects,selectors,playwright-cli— UI authoring chain.test-standards,data-strategy,type-safety,enums,config,fixtures,helpers— rest of the suite.references/three-layer-model.md— how orchestrator / specialized skills / code conventions layer.references/conversation-contract.md— audit-then-edit, when to ask vs do, when to refuse.references/principles.md— the five principles that make the scaffold AI-native.references/examples.md— three end-to-end multi-skill chains (API test, refactor, CI failure).references/troubleshooting.md— common agent failure modes and fixes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

