@quinteroac/agents-coding-toolkit 0.1.0-preview
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/AGENTS.md +7 -0
- package/README.md +127 -0
- package/package.json +34 -0
- package/scaffold/.agents/flow/archived/tmpl_.gitkeep +0 -0
- package/scaffold/.agents/flow/tmpl_README.md +7 -0
- package/scaffold/.agents/flow/tmpl_iteration_close_checklist.example.md +11 -0
- package/scaffold/.agents/skills/automated-fix/tmpl_SKILL.md +67 -0
- package/scaffold/.agents/skills/create-issue/tmpl_SKILL.md +68 -0
- package/scaffold/.agents/skills/create-pr-document/tmpl_SKILL.md +125 -0
- package/scaffold/.agents/skills/create-project-context/tmpl_SKILL.md +168 -0
- package/scaffold/.agents/skills/create-test-plan/tmpl_SKILL.md +86 -0
- package/scaffold/.agents/skills/debug/tmpl_SKILL.md +19 -0
- package/scaffold/.agents/skills/evaluate/tmpl_SKILL.md +19 -0
- package/scaffold/.agents/skills/execute-test-batch/tmpl_SKILL.md +49 -0
- package/scaffold/.agents/skills/execute-test-case/tmpl_SKILL.md +47 -0
- package/scaffold/.agents/skills/implement-user-story/tmpl_SKILL.md +68 -0
- package/scaffold/.agents/skills/plan-refactor/tmpl_SKILL.md +19 -0
- package/scaffold/.agents/skills/refactor-prd/tmpl_SKILL.md +19 -0
- package/scaffold/.agents/skills/refine-pr-document/tmpl_SKILL.md +108 -0
- package/scaffold/.agents/skills/refine-project-context/tmpl_SKILL.md +157 -0
- package/scaffold/.agents/skills/refine-test-plan/tmpl_SKILL.md +76 -0
- package/scaffold/.agents/tmpl_PROJECT_CONTEXT.md +3 -0
- package/scaffold/.agents/tmpl_state.example.json +26 -0
- package/scaffold/.agents/tmpl_state_rules.md +29 -0
- package/scaffold/docs/nvst-flow/templates/tmpl_CHANGELOG.md +18 -0
- package/scaffold/docs/nvst-flow/templates/tmpl_TECHNICAL_DEBT.md +11 -0
- package/scaffold/docs/nvst-flow/templates/tmpl_it_000001_evaluation-report.md +19 -0
- package/scaffold/docs/nvst-flow/templates/tmpl_it_000001_product-requirement-document.md +19 -0
- package/scaffold/docs/nvst-flow/templates/tmpl_it_000001_refactor_plan.md +19 -0
- package/scaffold/docs/nvst-flow/templates/tmpl_it_000001_test-plan.md +19 -0
- package/scaffold/docs/nvst-flow/tmpl_COMMANDS.md +0 -0
- package/scaffold/docs/nvst-flow/tmpl_QUICK_USE.md +0 -0
- package/scaffold/docs/tmpl_PLACEHOLDER.md +0 -0
- package/scaffold/schemas/node-shims.d.ts +15 -0
- package/scaffold/schemas/tmpl_issues.ts +19 -0
- package/scaffold/schemas/tmpl_prd.ts +26 -0
- package/scaffold/schemas/tmpl_progress.ts +39 -0
- package/scaffold/schemas/tmpl_state.ts +81 -0
- package/scaffold/schemas/tmpl_test-plan.ts +20 -0
- package/scaffold/schemas/tmpl_validate-progress.ts +13 -0
- package/scaffold/schemas/tmpl_validate-state.ts +13 -0
- package/scaffold/tmpl_AGENTS.md +7 -0
- package/schemas/prd.ts +26 -0
- package/schemas/progress.ts +39 -0
- package/schemas/state.ts +81 -0
- package/schemas/test-plan.test.ts +53 -0
- package/schemas/test-plan.ts +20 -0
- package/schemas/validate-progress.ts +13 -0
- package/schemas/validate-state.ts +13 -0
- package/src/agent.test.ts +37 -0
- package/src/agent.ts +225 -0
- package/src/cli-path.ts +4 -0
- package/src/cli.ts +578 -0
- package/src/commands/approve-project-context.ts +37 -0
- package/src/commands/approve-requirement.ts +217 -0
- package/src/commands/approve-test-plan.test.ts +193 -0
- package/src/commands/approve-test-plan.ts +202 -0
- package/src/commands/create-issue.test.ts +484 -0
- package/src/commands/create-issue.ts +371 -0
- package/src/commands/create-project-context.ts +96 -0
- package/src/commands/create-prototype.test.ts +153 -0
- package/src/commands/create-prototype.ts +425 -0
- package/src/commands/create-test-plan.test.ts +381 -0
- package/src/commands/create-test-plan.ts +248 -0
- package/src/commands/define-requirement.ts +47 -0
- package/src/commands/destroy.ts +113 -0
- package/src/commands/execute-automated-fix.test.ts +580 -0
- package/src/commands/execute-automated-fix.ts +363 -0
- package/src/commands/execute-manual-fix.test.ts +343 -0
- package/src/commands/execute-manual-fix.ts +203 -0
- package/src/commands/execute-test-plan.test.ts +1891 -0
- package/src/commands/execute-test-plan.ts +722 -0
- package/src/commands/init.ts +85 -0
- package/src/commands/refine-project-context.ts +74 -0
- package/src/commands/refine-requirement.ts +60 -0
- package/src/commands/refine-test-plan.test.ts +200 -0
- package/src/commands/refine-test-plan.ts +93 -0
- package/src/commands/start-iteration.test.ts +144 -0
- package/src/commands/start-iteration.ts +101 -0
- package/src/commands/write-json.ts +136 -0
- package/src/install.test.ts +124 -0
- package/src/pack.test.ts +103 -0
- package/src/state.test.ts +66 -0
- package/src/state.ts +52 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-test-plan
|
|
3
|
+
description: "Creates a structured test plan from the PRD and project context with automation-first guidance. Triggered by: bun nvst create test-plan."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create Test Plan
|
|
8
|
+
|
|
9
|
+
Create a complete test plan for the current iteration and save it as:
|
|
10
|
+
`.agents/flow/it_{iteration}_test-plan.md`
|
|
11
|
+
|
|
12
|
+
All generated content must be in English.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
Read these first to understand what must be tested:
|
|
19
|
+
|
|
20
|
+
1. `it_{iteration}_PRD.json`
|
|
21
|
+
2. `.agents/PROJECT_CONTEXT.md`
|
|
22
|
+
|
|
23
|
+
Use the PRD to identify user stories, acceptance criteria, and functional requirements (`FR-N`).
|
|
24
|
+
Use project context to align test types, tooling, and conventions.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Output Format
|
|
29
|
+
|
|
30
|
+
Produce a Markdown test plan structured by user story.
|
|
31
|
+
|
|
32
|
+
Use this structure:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
# Test Plan - Iteration {iteration}
|
|
36
|
+
|
|
37
|
+
## Scope
|
|
38
|
+
|
|
39
|
+
- (What is in scope for testing this iteration; at least one bullet.)
|
|
40
|
+
- ...
|
|
41
|
+
|
|
42
|
+
## Environment and data
|
|
43
|
+
|
|
44
|
+
- (Environment and data prerequisites; at least one bullet, e.g. runtime, DB, fixtures.)
|
|
45
|
+
- ...
|
|
46
|
+
|
|
47
|
+
## User Story: <id> - <title>
|
|
48
|
+
|
|
49
|
+
| Test Case ID | Description | Type (unit/integration/e2e) | Mode (automated/manual) | Correlated Requirements (US-XXX, FR-X) | Expected Result |
|
|
50
|
+
|---|---|---|---|---|---|
|
|
51
|
+
| TC-... | ... | ... | ... | US-001, FR-1 | ... |
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Scope**, **Environment and data**, and **User Story** sections (each with its test case table) are mandatory. Scope and Environment and data must each have at least one bullet item; each User Story must have at least one test case.
|
|
55
|
+
|
|
56
|
+
Every test case must include:
|
|
57
|
+
- `Test Case ID`
|
|
58
|
+
- `Description`
|
|
59
|
+
- `Type` (`unit`, `integration`, or `e2e`)
|
|
60
|
+
- Whether it is `automated` or `manual`
|
|
61
|
+
- `Correlated Requirements` with at least one requirement ID (`US-XXX`, `FR-X`)
|
|
62
|
+
- `Expected Result`
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Automation-First Rules (Mandatory)
|
|
67
|
+
|
|
68
|
+
1. Prioritize automated testing for this plan.
|
|
69
|
+
2. Every functional requirement (`FR-N`) must have automated coverage.
|
|
70
|
+
3. Every functional requirement (`FR-N`) must appear in at least one test case `Correlated Requirements` field.
|
|
71
|
+
4. Manual tests are allowed only for UI/UX nuances that cannot be reliably validated through DOM/state assertions (for example: subjective visual "feel").
|
|
72
|
+
5. If a test is marked manual, explicitly justify why automation is not reliable for that case.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Checklist
|
|
77
|
+
|
|
78
|
+
- [ ] Read `it_{iteration}_PRD.json`
|
|
79
|
+
- [ ] Read `.agents/PROJECT_CONTEXT.md`
|
|
80
|
+
- [ ] Plan includes **Scope** section with at least one bullet
|
|
81
|
+
- [ ] Plan includes **Environment and data** section with at least one bullet
|
|
82
|
+
- [ ] Test cases are grouped by user story
|
|
83
|
+
- [ ] Every `FR-N` is covered by automated test cases
|
|
84
|
+
- [ ] Every test case includes correlated requirement IDs (`US-XXX`, `FR-X`)
|
|
85
|
+
- [ ] Manual tests are only UI/UX nuance checks that cannot be validated via DOM/state assertions
|
|
86
|
+
- [ ] File written to `.agents/flow/it_{iteration}_test-plan.md`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# debug (scaffold)
|
|
2
|
+
|
|
3
|
+
<!-- TODO: Complete. All content in English. -->
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
TBD — Understand error, review failing components, form hypotheses, instrument, reproduce, review logs, confirm hypothesis, fix, confirm fix, remove instrumentation, mark test as fixed.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
|
|
11
|
+
TBD — Failing test(s), codebase, logs.
|
|
12
|
+
|
|
13
|
+
## Outputs
|
|
14
|
+
|
|
15
|
+
TBD — Code changes, `it_<iteration>_progress.json` test status updated (e.g. fixed).
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
TBD
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# evaluate (scaffold)
|
|
2
|
+
|
|
3
|
+
<!-- TODO: Complete. All content in English. -->
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
TBD — Evaluate prototype: strengths, technical debt, violations of PROJECT_CONTEXT.md; recommendations by impact, urgency, effort, scope; optional numeric score for ordering.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
|
|
11
|
+
TBD — Prototype code, PROJECT_CONTEXT.md, TECHNICAL_DEBT.md.
|
|
12
|
+
|
|
13
|
+
## Outputs
|
|
14
|
+
|
|
15
|
+
TBD — `it_<iteration>_evaluation-report.md`.
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
TBD
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: execute-test-batch
|
|
3
|
+
description: "Executes a batch of approved automated test cases and returns a strict JSON array of result payloads. Invoked by: bun nvst execute test-plan."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Execute Test Batch
|
|
8
|
+
|
|
9
|
+
Execute all provided automated test cases from the approved test plan in a single session.
|
|
10
|
+
|
|
11
|
+
All generated content must be in English.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
Use the provided context sections:
|
|
16
|
+
- `project_context`: project conventions, runtime, quality checks, and constraints
|
|
17
|
+
- `test_cases`: JSON array of test case objects, each with id, description, mode, and correlated requirements
|
|
18
|
+
|
|
19
|
+
## Execution Rules
|
|
20
|
+
|
|
21
|
+
1. Read all test cases in `test_cases` before running any commands.
|
|
22
|
+
2. Follow constraints from `project_context` when selecting commands, environment setup, and verification steps.
|
|
23
|
+
3. Execute each test case in order. Share session context (e.g. environment setup, installed dependencies) across test cases to avoid redundant work.
|
|
24
|
+
4. Capture concise evidence from command outputs or observed results for each test case.
|
|
25
|
+
5. Determine outcome per test case:
|
|
26
|
+
- `passed`: acceptance for this test case was satisfied
|
|
27
|
+
- `failed`: acceptance for this test case was not satisfied
|
|
28
|
+
- `skipped`: test case cannot be executed due to a justified blocker
|
|
29
|
+
|
|
30
|
+
## Output Contract (Mandatory)
|
|
31
|
+
|
|
32
|
+
Output MUST be raw JSON only. No markdown fences, no introductory text, no trailing instructions. Do not output markdown or additional text outside the JSON array.
|
|
33
|
+
|
|
34
|
+
Return only a JSON array with one result object per test case, in the same order as the input. Each object must have this exact shape:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
[
|
|
38
|
+
{
|
|
39
|
+
"testCaseId": "the test case id",
|
|
40
|
+
"status": "passed|failed|skipped",
|
|
41
|
+
"evidence": "string",
|
|
42
|
+
"notes": "string"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Every test case in the input must have a corresponding result in the output array.
|
|
48
|
+
|
|
49
|
+
Correct: output the array directly (or inside a single ```json block if necessary). Incorrect: adding text like "Here are the results:" or "Run this command:" before or after the JSON.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: execute-test-case
|
|
3
|
+
description: "Executes a batch of approved test cases and returns a strict JSON array of result payloads. Invoked by: bun nvst execute test-plan."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Execute Test Case
|
|
8
|
+
|
|
9
|
+
Execute all provided test cases from the approved test plan in a single session.
|
|
10
|
+
|
|
11
|
+
All generated content must be in English.
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
Use the provided context sections:
|
|
16
|
+
- `project_context`: project conventions, runtime, quality checks, and constraints
|
|
17
|
+
- `test_cases`: JSON array of test case objects, each with id, description, mode, and correlated requirements
|
|
18
|
+
|
|
19
|
+
## Execution Rules
|
|
20
|
+
|
|
21
|
+
1. Read all test cases in `test_cases` before running any commands.
|
|
22
|
+
2. Follow constraints from `project_context` when selecting commands, environment setup, and verification steps.
|
|
23
|
+
3. Execute each test case in order. Share session context (e.g. environment setup, installed dependencies) across test cases to avoid redundant work.
|
|
24
|
+
4. Capture concise evidence from command outputs or observed results for each test case.
|
|
25
|
+
5. Determine outcome per test case:
|
|
26
|
+
- `passed`: acceptance for this test case was satisfied
|
|
27
|
+
- `failed`: acceptance for this test case was not satisfied
|
|
28
|
+
- `skipped`: test case cannot be executed due to a justified blocker
|
|
29
|
+
|
|
30
|
+
## Output Contract (Mandatory)
|
|
31
|
+
|
|
32
|
+
Return only a JSON array with one result object per test case, in the same order as the input. Each object must have this exact shape:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
[
|
|
36
|
+
{
|
|
37
|
+
"testCaseId": "the test case id",
|
|
38
|
+
"status": "passed|failed|skipped",
|
|
39
|
+
"evidence": "string",
|
|
40
|
+
"notes": "string"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Every test case in the input must have a corresponding result in the output array.
|
|
46
|
+
|
|
47
|
+
Do not output markdown or additional text outside the JSON array.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement-user-story
|
|
3
|
+
description: "Implements a single user story from the PRD: writes code and tests, follows project conventions. Invoked by: bun nvst create prototype."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Implement User Story
|
|
8
|
+
|
|
9
|
+
Implement the provided user story by writing production code and tests that satisfy all acceptance criteria, following the project's conventions and architecture.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The Job
|
|
14
|
+
|
|
15
|
+
1. Read the **user story** and its **acceptance criteria** carefully.
|
|
16
|
+
2. Review the **project context** to understand conventions, tech stack, testing strategy, and module structure.
|
|
17
|
+
3. Plan the implementation: identify which files to create or modify, what tests to write, and how the change fits into the existing architecture.
|
|
18
|
+
4. Implement the user story:
|
|
19
|
+
- Write production code that satisfies every acceptance criterion.
|
|
20
|
+
- Write tests that verify each acceptance criterion (follow the testing strategy from the project context).
|
|
21
|
+
- Follow all naming conventions, code standards, and forbidden patterns from the project context.
|
|
22
|
+
5. Verify your work:
|
|
23
|
+
- Ensure the code compiles / type-checks without errors.
|
|
24
|
+
- Run any quality checks defined in the project context.
|
|
25
|
+
- Fix any issues before finishing.
|
|
26
|
+
6. Do **not** commit — the calling command handles git commits.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Inputs
|
|
31
|
+
|
|
32
|
+
| Source | Used for |
|
|
33
|
+
|--------|----------|
|
|
34
|
+
| `user_story` (context variable) | The user story JSON with id, title, description, and acceptanceCriteria |
|
|
35
|
+
| `project_context` (context variable) | Project conventions, tech stack, code standards, testing strategy, and architecture |
|
|
36
|
+
| `iteration` (context variable) | Current iteration number for file naming and context |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Rules
|
|
41
|
+
|
|
42
|
+
- **One story at a time.** Implement only the user story provided — do not implement other stories or make unrelated changes.
|
|
43
|
+
- **Follow conventions exactly.** Use the naming, formatting, error handling, and module organisation patterns from the project context.
|
|
44
|
+
- **Test every acceptance criterion.** Each AC should have at least one corresponding test assertion.
|
|
45
|
+
- **No new dependencies** unless the acceptance criteria explicitly require them.
|
|
46
|
+
- **Do not modify state files.** Do not touch `.agents/state.json` or progress files — the calling command manages those.
|
|
47
|
+
- **Do not commit.** The calling command will commit after verifying quality checks pass.
|
|
48
|
+
- **Keep changes minimal.** Only modify files necessary to implement the user story. Do not refactor unrelated code.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Output
|
|
53
|
+
|
|
54
|
+
The output is the set of file changes (new files created, existing files modified) in the working tree. There is no document to produce — the code and tests are the deliverable.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Checklist
|
|
59
|
+
|
|
60
|
+
Before finishing:
|
|
61
|
+
|
|
62
|
+
- [ ] All acceptance criteria from the user story are implemented
|
|
63
|
+
- [ ] Tests cover each acceptance criterion
|
|
64
|
+
- [ ] Code follows project conventions (naming, style, error handling)
|
|
65
|
+
- [ ] Code compiles / type-checks without errors
|
|
66
|
+
- [ ] No unrelated changes were made
|
|
67
|
+
- [ ] No state files were modified
|
|
68
|
+
- [ ] No git commits were made
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# plan-refactor (scaffold)
|
|
2
|
+
|
|
3
|
+
<!-- TODO: Complete. All content in English. -->
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
TBD — From evaluation report: identify quick wins and critical refactorings, ask user about refactorings that need a decision, produce ordered plan.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
|
|
11
|
+
TBD — `it_<iteration>_evaluation-report.md`.
|
|
12
|
+
|
|
13
|
+
## Outputs
|
|
14
|
+
|
|
15
|
+
TBD — `it_<iteration>_refactor_plan.md`.
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
TBD
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# refactor-prd (scaffold)
|
|
2
|
+
|
|
3
|
+
<!-- TODO: Complete. All content in English. -->
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
TBD — Add refactor use cases to the iteration PRD (`it_<iteration>_PRD.json`), with associated regression tests if requested.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
|
|
11
|
+
TBD — `it_<iteration>_refactor_plan.md`, `it_<iteration>_PRD.json`.
|
|
12
|
+
|
|
13
|
+
## Outputs
|
|
14
|
+
|
|
15
|
+
TBD — Updated `it_<iteration>_PRD.json`.
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
TBD
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refine-pr-document
|
|
3
|
+
description: "Updates an existing product requirement document based on user feedback. Triggered by: bun nvst refine requirement."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refine Product Requirement Document
|
|
8
|
+
|
|
9
|
+
Update `it_{current_iteration}_product-requirement-document.md` in place based on user feedback. The file must already exist; this skill does not create it from scratch.
|
|
10
|
+
|
|
11
|
+
**Do NOT start implementing. Only update the document.**
|
|
12
|
+
|
|
13
|
+
> **Two modes available — the agent asks at the start:**
|
|
14
|
+
> - **Editor mode** — apply specific changes requested by the user.
|
|
15
|
+
> - **Challenger mode** — act as an independent critical reviewer: challenge assumptions, question scope, find gaps, and propose improvements. The user accepts or rejects each suggestion before anything is written.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## The Job
|
|
20
|
+
|
|
21
|
+
1. Read `state.json` → get `requirement_definition.file` (e.g. `it_000001_product-requirement-document.md`).
|
|
22
|
+
2. Read the current document from `.agents/flow/{file}`.
|
|
23
|
+
3. **Open by asking:** _"Would you like me to challenge the existing document as an independent reviewer, or would you prefer to tell me what to change?"_
|
|
24
|
+
- Answer → **challenge**: run Challenger Mode (see below).
|
|
25
|
+
- Answer → **edit**: run Editor Mode (see Questions Flow).
|
|
26
|
+
4. Apply changes to the document following the same Output Structure as `create-pr-document`.
|
|
27
|
+
5. Re-enforce MVP constraint: remove any user stories not explicitly listed by the user; do not add new ones without confirmation.
|
|
28
|
+
6. Write the updated file back to the same path.
|
|
29
|
+
7. Do **not** update `state.json` — `requirement_definition.status` stays `"in_progress"`.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Challenger Mode
|
|
34
|
+
|
|
35
|
+
Act as a second agent reviewing the document with fresh eyes. Do not apply any change without explicit user approval.
|
|
36
|
+
|
|
37
|
+
**Challenge areas — examine each (in order):**
|
|
38
|
+
|
|
39
|
+
1. **Assumptions** — List implicit assumptions in the goals or stories. Ask: are these validated? what if they are wrong?
|
|
40
|
+
2. **Scope creep** — Flag any user story that is not strictly MVP-necessary. Propose removal and ask for confirmation.
|
|
41
|
+
3. **Vague acceptance criteria** — Highlight criteria that are not concretely verifiable. Suggest a specific rewrite.
|
|
42
|
+
4. **Missing non-goals** — Identify things the document is silent on that could be misread as in-scope. Propose additions to Non-Goals.
|
|
43
|
+
5. **Missing edge cases** — Point out failure paths or user states not covered by any acceptance criterion.
|
|
44
|
+
6. **Conflicting requirements** — Flag any `FR-N` that contradicts another or contradicts an acceptance criterion.
|
|
45
|
+
|
|
46
|
+
**Challenger output format — one observation at a time:**
|
|
47
|
+
|
|
48
|
+
> CRITICAL: Present findings **one at a time**. After delivering one finding, stop and wait for the user to respond before moving on. Do not queue or batch findings.
|
|
49
|
+
|
|
50
|
+
For each finding, format it as:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Challenge [N/total]: <area name>
|
|
54
|
+
|
|
55
|
+
Finding: <what the issue is>
|
|
56
|
+
Suggestion: <proposed change>
|
|
57
|
+
|
|
58
|
+
Accept / Reject / Discuss?
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- After the user responds, acknowledge their decision and immediately present the **next** finding.
|
|
62
|
+
- If the user types **Discuss**, engage in a short back-and-forth until they give a final Accept or Reject, then move on.
|
|
63
|
+
- Once all findings have been reviewed, summarise the accepted changes and apply them to the file in a single write.
|
|
64
|
+
- Do **not** write anything to the file until all findings have received a response.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Editor Mode (Questions Flow)
|
|
69
|
+
|
|
70
|
+
Ask only what is needed to understand the requested change.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
1. What would you like to change or add?
|
|
74
|
+
A. Replace or rewrite a user story
|
|
75
|
+
B. Add a new user story (must be MVP-justified)
|
|
76
|
+
C. Remove a user story
|
|
77
|
+
D. Tighten acceptance criteria
|
|
78
|
+
E. Update goals or non-goals
|
|
79
|
+
F. Other: [describe]
|
|
80
|
+
|
|
81
|
+
2. If adding a user story — is it strictly necessary for the MVP?
|
|
82
|
+
[Open answer — skip if not adding stories]
|
|
83
|
+
|
|
84
|
+
3. Anything else to update in this pass?
|
|
85
|
+
[Open answer — skip if none]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Refinement Rules
|
|
91
|
+
|
|
92
|
+
- **MVP constraint holds:** do not add user stories unless the user explicitly requests them and confirms they are MVP-necessary.
|
|
93
|
+
- **Preserve numbering:** renumber `US-NNN` and `FR-N` entries only if a story is removed; otherwise keep existing IDs stable.
|
|
94
|
+
- **Verifiable criteria:** any new or edited acceptance criterion must be concrete and testable (same standard as `create-pr-document`).
|
|
95
|
+
- **UI stories:** if a new or edited story touches the UI, "visually verified in browser" must be an acceptance criterion.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Checklist
|
|
100
|
+
|
|
101
|
+
Before saving:
|
|
102
|
+
|
|
103
|
+
- [ ] User's requested changes applied
|
|
104
|
+
- [ ] No new user stories added without explicit MVP justification
|
|
105
|
+
- [ ] All acceptance criteria remain verifiable
|
|
106
|
+
- [ ] `US-NNN` and `FR-N` numbering is consistent
|
|
107
|
+
- [ ] File written back to `.agents/flow/it_{current_iteration}_product-requirement-document.md`
|
|
108
|
+
- [ ] `state.json` **not** modified (status stays `"in_progress"`)
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refine-project-context
|
|
3
|
+
description: "Refines .agents/PROJECT_CONTEXT.md via editor mode or challenge mode. Challenge mode validates the document against the actual codebase and detects compliance issues. Triggered by: bun nvst refine project-context."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refine Project Context
|
|
8
|
+
|
|
9
|
+
Update `.agents/PROJECT_CONTEXT.md` in place based on user feedback or codebase validation. The file must already exist; this skill does not create it from scratch.
|
|
10
|
+
|
|
11
|
+
**Do NOT start implementing. Only update the document (and optionally `.agents/TECHNICAL_DEBT.md` in challenge mode).**
|
|
12
|
+
|
|
13
|
+
> **Two modes available — determined by the `mode` context variable:**
|
|
14
|
+
> - **Editor mode** (default) — apply specific changes requested by the user.
|
|
15
|
+
> - **Challenger mode** (`mode = "challenger"`) — validate PROJECT_CONTEXT.md against the actual codebase, detect discrepancies, and present findings individually for user triage.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
| Source | Used for |
|
|
22
|
+
|--------|----------|
|
|
23
|
+
| `.agents/PROJECT_CONTEXT.md` | The current document to refine |
|
|
24
|
+
| Actual codebase files | Challenge mode: comparing documented conventions vs reality |
|
|
25
|
+
| User answers (interactive mode) | Directing changes (editor) or triaging findings (challenger) |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Editor Mode
|
|
30
|
+
|
|
31
|
+
Ask only what is needed to understand the requested change.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
1. What would you like to change or add to the project context?
|
|
35
|
+
A. Update conventions (naming, formatting, git flow)
|
|
36
|
+
B. Update tech stack details
|
|
37
|
+
C. Update code standards
|
|
38
|
+
D. Update testing strategy
|
|
39
|
+
E. Update product architecture
|
|
40
|
+
F. Update modular structure
|
|
41
|
+
G. Update implemented capabilities
|
|
42
|
+
H. Other: [describe]
|
|
43
|
+
|
|
44
|
+
2. Anything else to update in this pass?
|
|
45
|
+
[Open answer — skip if none]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Apply changes to the document following the same Output Structure as `create-project-context`.
|
|
49
|
+
|
|
50
|
+
**After editing:**
|
|
51
|
+
- Write the updated file back to `.agents/PROJECT_CONTEXT.md`.
|
|
52
|
+
- Enforce the **250-line cap** (see Cap Rule in `create-project-context` skill).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Challenger Mode
|
|
57
|
+
|
|
58
|
+
Act as a codebase auditor. Systematically compare the content of `PROJECT_CONTEXT.md` against the actual codebase to detect discrepancies. Do not apply any change without explicit user approval.
|
|
59
|
+
|
|
60
|
+
### Step 1: Analyse
|
|
61
|
+
|
|
62
|
+
Read the codebase (file structure, imports, patterns, config files, test files) and compare against each section of PROJECT_CONTEXT.md:
|
|
63
|
+
|
|
64
|
+
1. **Conventions** — Are the naming, formatting, and git flow conventions actually followed?
|
|
65
|
+
2. **Tech Stack** — Do the documented languages, runtimes, frameworks, and libraries match `package.json`, `tsconfig.json`, lock files, and actual imports?
|
|
66
|
+
3. **Code Standards** — Are the style patterns, error handling, and module organisation conventions reflected in the code?
|
|
67
|
+
4. **Testing Strategy** — Does the test approach, runner, and location convention match reality?
|
|
68
|
+
5. **Product Architecture** — Does the documented architecture match the actual file/module structure?
|
|
69
|
+
6. **Modular Structure** — Are the documented modules/packages accurate and complete?
|
|
70
|
+
7. **Implemented Capabilities** — Are all documented capabilities actually implemented, and are there implemented capabilities not documented?
|
|
71
|
+
|
|
72
|
+
### Step 2: Present Findings
|
|
73
|
+
|
|
74
|
+
> CRITICAL: Present findings **one at a time**. After delivering one finding, stop and wait for the user to respond before moving on. Do not queue or batch findings.
|
|
75
|
+
|
|
76
|
+
For each discrepancy, classify it as one of two types and present:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Finding [N/total]: <section name>
|
|
80
|
+
|
|
81
|
+
Type: PROJECT CONTEXT NOT COMPLIANT | CODE NOT COMPLIANT
|
|
82
|
+
Description: <what the discrepancy is>
|
|
83
|
+
Evidence: <specific file(s) or code snippet(s) that demonstrate the discrepancy>
|
|
84
|
+
|
|
85
|
+
Suggested action:
|
|
86
|
+
- If PROJECT CONTEXT NOT COMPLIANT: <proposed fix to PROJECT_CONTEXT.md>
|
|
87
|
+
- If CODE NOT COMPLIANT: <summary to record as technical debt>
|
|
88
|
+
|
|
89
|
+
Accept / Reject / Discuss?
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- After the user responds, acknowledge their decision and immediately present the **next** finding.
|
|
93
|
+
- If the user types **Discuss**, engage in a short back-and-forth until they give a final Accept or Reject, then move on.
|
|
94
|
+
|
|
95
|
+
### Step 3: Apply Changes
|
|
96
|
+
|
|
97
|
+
After all findings have been reviewed:
|
|
98
|
+
|
|
99
|
+
**For accepted "PROJECT CONTEXT NOT COMPLIANT" findings:**
|
|
100
|
+
- Apply the suggested fixes to `.agents/PROJECT_CONTEXT.md`.
|
|
101
|
+
- Enforce the 250-line cap after all edits.
|
|
102
|
+
|
|
103
|
+
**For accepted "CODE NOT COMPLIANT" findings:**
|
|
104
|
+
- Append each finding to `.agents/TECHNICAL_DEBT.md` in the format below.
|
|
105
|
+
- Create `.agents/TECHNICAL_DEBT.md` if it does not already exist.
|
|
106
|
+
- Appending to TECHNICAL_DEBT.md alone does NOT modify the project context status.
|
|
107
|
+
|
|
108
|
+
**TECHNICAL_DEBT.md entry format:**
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
### TD-<NNN>: <short title>
|
|
112
|
+
|
|
113
|
+
- **Source:** Challenge mode — iteration <current_iteration>
|
|
114
|
+
- **Date:** <ISO 8601>
|
|
115
|
+
- **Section:** <PROJECT_CONTEXT.md section>
|
|
116
|
+
- **Description:** <what the code does that doesn't match the documented convention>
|
|
117
|
+
- **Evidence:** <file path(s) and brief description>
|
|
118
|
+
- **Suggested resolution:** <what should change in the code>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Step 4: Summarise
|
|
122
|
+
|
|
123
|
+
After all findings are processed, output a summary:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Challenge Summary:
|
|
127
|
+
- Total findings: N
|
|
128
|
+
- Accepted (project context updated): X
|
|
129
|
+
- Accepted (technical debt recorded): Y
|
|
130
|
+
- Rejected: Z
|
|
131
|
+
|
|
132
|
+
Files modified:
|
|
133
|
+
- .agents/PROJECT_CONTEXT.md: [yes/no]
|
|
134
|
+
- .agents/TECHNICAL_DEBT.md: [yes/no — created/updated/unchanged]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Refinement Rules
|
|
140
|
+
|
|
141
|
+
- **250-line cap** on PROJECT_CONTEXT.md must be enforced after every edit (see Cap Rule in `create-project-context` skill).
|
|
142
|
+
- **Preserve structure:** maintain the same section headings as defined in `create-project-context` skill Output Structure.
|
|
143
|
+
- **No phantom sections:** do not add sections that have no content.
|
|
144
|
+
- **TECHNICAL_DEBT.md numbering:** if the file already exists, continue numbering from the last `TD-NNN` entry; if new, start at `TD-001`.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Checklist
|
|
149
|
+
|
|
150
|
+
Before saving:
|
|
151
|
+
|
|
152
|
+
- [ ] All user-accepted changes applied to `.agents/PROJECT_CONTEXT.md`
|
|
153
|
+
- [ ] PROJECT_CONTEXT.md does not exceed 250 lines
|
|
154
|
+
- [ ] All accepted "code not compliant" findings recorded in `.agents/TECHNICAL_DEBT.md`
|
|
155
|
+
- [ ] TECHNICAL_DEBT.md created if it did not exist and there are code compliance findings
|
|
156
|
+
- [ ] Summary of changes presented to the user
|
|
157
|
+
- [ ] `state.json` will be updated by the CLI command (not by this skill)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refine-test-plan
|
|
3
|
+
description: "Refines an existing test plan based on user feedback or adversarial challenge mode. Triggered by: bun nvst refine test-plan."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refine Test Plan
|
|
8
|
+
|
|
9
|
+
Update `it_{current_iteration}_test-plan.md` in place. The file already exists and is provided in context.
|
|
10
|
+
|
|
11
|
+
**Do NOT implement code. Only revise the test plan document.**
|
|
12
|
+
|
|
13
|
+
> **Two modes available — determined by the `mode` context variable:**
|
|
14
|
+
> - **Editor mode** (default): apply user-requested updates to the plan.
|
|
15
|
+
> - **Challenger mode** (`mode = "challenger"`): run an adversarial review of the plan and challenge weak coverage, assertions, and missing cases before applying any edits.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
| Source | Used for |
|
|
22
|
+
|--------|----------|
|
|
23
|
+
| `test_plan_file` | Current plan file name |
|
|
24
|
+
| `test_plan_content` | Existing test plan content |
|
|
25
|
+
| User responses | Clarifications and approval of proposed edits |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Editor Mode
|
|
30
|
+
|
|
31
|
+
Ask only what is needed, then update the document directly.
|
|
32
|
+
|
|
33
|
+
Focus on:
|
|
34
|
+
- Preserve the existing section structure, headings, and overall organization unless the user explicitly requests structural changes
|
|
35
|
+
- Test scope completeness
|
|
36
|
+
- Acceptance criteria traceability
|
|
37
|
+
- Execution order and environment assumptions
|
|
38
|
+
- Clarity and actionability of assertions
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Challenger Mode
|
|
43
|
+
|
|
44
|
+
Act as an independent reviewer trying to break the plan.
|
|
45
|
+
|
|
46
|
+
Evaluate at minimum:
|
|
47
|
+
1. Coverage gaps for each acceptance criterion
|
|
48
|
+
2. Missing negative/error-path scenarios
|
|
49
|
+
3. Weak or non-verifiable assertions
|
|
50
|
+
4. Ambiguous setup/fixtures/test data
|
|
51
|
+
5. Over-reliance on manual testing where automation should be used
|
|
52
|
+
6. Missing quality checks (typecheck, lint, CI gates) where applicable
|
|
53
|
+
|
|
54
|
+
Present findings one at a time:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
Challenge [N/total]: <area>
|
|
58
|
+
|
|
59
|
+
Finding: <specific weakness>
|
|
60
|
+
Risk: <why this can fail in practice>
|
|
61
|
+
Suggestion: <concrete improvement>
|
|
62
|
+
|
|
63
|
+
Accept / Reject / Discuss?
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Only apply accepted suggestions to the document after all findings are triaged.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Checklist
|
|
71
|
+
|
|
72
|
+
- [ ] Output remains in English
|
|
73
|
+
- [ ] Accepted changes applied to the existing test plan file
|
|
74
|
+
- [ ] Each acceptance criterion has explicit test intent
|
|
75
|
+
- [ ] Same output file path is preserved (refine in place, do not write to a new file)
|
|
76
|
+
- [ ] State files are not modified by this skill
|