@quinteroac/agents-coding-toolkit 0.1.1-preview.0 → 0.2.0

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.
Files changed (32) hide show
  1. package/README.md +29 -15
  2. package/package.json +2 -1
  3. package/scaffold/.agents/flow/tmpl_it_000001_progress.example.json +20 -0
  4. package/scaffold/.agents/skills/execute-refactor-item/tmpl_SKILL.md +5 -5
  5. package/scaffold/schemas/tmpl_prototype-progress.ts +22 -0
  6. package/scaffold/schemas/tmpl_test-execution-progress.ts +17 -0
  7. package/schemas/issues.ts +19 -0
  8. package/schemas/prototype-progress.ts +22 -0
  9. package/schemas/test-execution-progress.ts +17 -0
  10. package/schemas/validate-progress.ts +1 -1
  11. package/schemas/validate-state.ts +1 -1
  12. package/src/cli.ts +51 -6
  13. package/src/commands/approve-prototype.test.ts +427 -0
  14. package/src/commands/approve-prototype.ts +185 -0
  15. package/src/commands/create-prototype.test.ts +459 -7
  16. package/src/commands/create-prototype.ts +168 -56
  17. package/src/commands/execute-automated-fix.test.ts +78 -33
  18. package/src/commands/execute-automated-fix.ts +34 -101
  19. package/src/commands/execute-refactor.test.ts +3 -3
  20. package/src/commands/execute-refactor.ts +8 -12
  21. package/src/commands/execute-test-plan.test.ts +20 -19
  22. package/src/commands/execute-test-plan.ts +19 -52
  23. package/src/commands/flow-config.ts +79 -0
  24. package/src/commands/flow.test.ts +755 -0
  25. package/src/commands/flow.ts +405 -0
  26. package/src/commands/start-iteration.test.ts +52 -0
  27. package/src/commands/start-iteration.ts +5 -0
  28. package/src/flow-cli.test.ts +18 -0
  29. package/src/guardrail.ts +2 -24
  30. package/src/progress-utils.ts +34 -0
  31. package/src/readline.ts +23 -0
  32. package/src/write-json-artifact.ts +33 -0
package/README.md CHANGED
@@ -26,15 +26,10 @@ nerds-vst is a package that provides:
26
26
 
27
27
  ```
28
28
  AGENTS.md
29
- iteration_close_checklist.md
30
- ralph_loop.md
31
- providers.md
32
29
  .agents/
33
30
  PROJECT_CONTEXT.md
34
- state.json
35
31
  state_rules.md
36
- scripts/
37
- ralph.ts
32
+ state.example.json
38
33
  skills/
39
34
  create-pr-document/SKILL.md
40
35
  refine-pr-document/SKILL.md
@@ -49,21 +44,40 @@ nerds-vst is a package that provides:
49
44
  evaluate/SKILL.md
50
45
  plan-refactor/SKILL.md
51
46
  refactor-prd/SKILL.md
47
+ refine-refactor-plan/SKILL.md
48
+ execute-refactor-item/SKILL.md
49
+ automated-fix/SKILL.md
52
50
  debug/SKILL.md
53
51
  flow/
54
- README.md
52
+ it_000001_progress.example.json
55
53
  archived/
56
- docs/templates/
57
- CHANGELOG.md
58
- TECHNICAL_DEBT.md
54
+ docs/
55
+ nvst-flow/
56
+ COMMANDS.md
57
+ QUICK_USE.md
58
+ templates/
59
+ CHANGELOG.md
60
+ TECHNICAL_DEBT.md
61
+ it_000001_product-requirement-document.md
62
+ it_000001_test-plan.md
63
+ it_000001_evaluation-report.md
64
+ it_000001_refactor_plan.md
65
+ PLACEHOLDER.md
59
66
  schemas/
60
67
  state.ts
68
+ prd.ts
61
69
  progress.ts
70
+ test-plan.ts
71
+ issues.ts
72
+ prototype-progress.ts
73
+ test-execution-progress.ts
74
+ refactor-prd.ts
75
+ refactor-execution-progress.ts
62
76
  validate-state.ts
63
77
  validate-progress.ts
64
78
  ```
65
79
 
66
- Template files in this repository live under [`scaffold/`](scaffold/) with a `tmpl_` prefix (e.g. `tmpl_AGENTS.md`, `tmpl_ralph_loop.md`); `bun nvst init` copies them into the target project and writes them without the prefix to avoid naming conflicts when the toolkit is integrated elsewhere.
80
+ Template files in this repository live under [`scaffold/`](scaffold/) with a `tmpl_` prefix (e.g. `tmpl_AGENTS.md`, `tmpl_state.ts`); `bun nvst init` copies them into the target project and writes them without the prefix to avoid naming conflicts when the toolkit is integrated elsewhere. The `state.json` file is created and managed by the toolkit at runtime.
67
81
 
68
82
  - **Command-line tool** — Sends instructions to your chosen agent provider (Claude, Codex, Gemini, etc.) so it follows the framework. Commands drive the Define → Prototype → Refactor flow and keep state in sync, giving you a single way to run the process regardless of which agent you use.
69
83
 
@@ -73,8 +87,8 @@ nerds-vst is a package that provides:
73
87
  |-------|----------|
74
88
  | **Iteration** | `bun nvst start iteration` — Start or advance to the next iteration (archives current, resets state). |
75
89
  | **Define** | `bun nvst define requirement` → `bun nvst refine requirement` (optional) → `bun nvst approve requirement` → `bun nvst create prd` |
76
- | **Prototype** | `bun nvst create project-context` → `bun nvst approve project-context` → `bun nvst create prototype` → `bun nvst define test-plan` → `bun nvst approve test-plan` → `bun nvst execute test-plan` → `bun nvst execute automated-fix` / `bun nvst execute manual-fix` → when all tests pass, prototype is done and Refactor can begin |
77
- | **Refactor** | `bun nvst define refactor-plan` → `bun nvst approve refactor-plan` → `bun nvst create prd --refactor` → `bun nvst execute refactor` → update PROJECT_CONTEXT, CHANGELOG → then `bun nvst start iteration` for next iteration |
90
+ | **Prototype** | `bun nvst create project-context` → `bun nvst approve project-context` → `bun nvst create prototype` → `bun nvst define test-plan` → `bun nvst refine test-plan` (optional) → `bun nvst approve test-plan` → `bun nvst execute test-plan` → `bun nvst execute automated-fix` / `bun nvst execute manual-fix` → when all tests pass, prototype is done and Refactor can begin |
91
+ | **Refactor** | `bun nvst define refactor-plan` → `bun nvst refine refactor-plan` (optional) → `bun nvst approve refactor-plan` → `bun nvst create prd --refactor` → `bun nvst execute refactor` → update PROJECT_CONTEXT, CHANGELOG → then `bun nvst start iteration` for next iteration |
78
92
 
79
93
 
80
94
  ## Installation
@@ -92,7 +106,7 @@ Install from a local directory or a packed tarball:
92
106
  bun add /path/to/nerds-vibecoding-survivor-toolkit
93
107
 
94
108
  # Or from a packed .tgz (run `bun run package` first)
95
- bun add ./quinteroac-agents-coding-toolkit-0.1.0.tgz
109
+ bun add ./quinteroac-agents-coding-toolkit-0.1.1-preview.0.tgz
96
110
  ```
97
111
 
98
112
  ### From npm
@@ -124,4 +138,4 @@ Acknowledgements and credits will be added after the initial release.
124
138
  ## References
125
139
 
126
140
  - [process_design.md](process_design.md) — Full process specification.
127
- - [scaffold/.agents/flow/tmpl_README.md](scaffold/.agents/flow/tmpl_README.md) — Flow directory and naming conventions (scaffold template).
141
+ - [docs/nvst-flow/](docs/nvst-flow/) — Command reference and quick usage (scaffold provides `COMMANDS.md` and `QUICK_USE.md`).
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "registry": "https://registry.npmjs.org",
5
5
  "access": "public"
6
6
  },
7
- "version": "0.1.1-preview.0",
7
+ "version": "0.2.0",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/quinteroac/nerds-vibecoding-survivor-toolkit.git"
@@ -22,6 +22,7 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "test": "bun test src tests schemas",
25
+ "typecheck": "bun tsc --noEmit",
25
26
  "package": "npm pack",
26
27
  "bump": "npm version",
27
28
  "bump:patch": "npm version patch",
@@ -0,0 +1,20 @@
1
+ {
2
+ "entries": [
3
+ {
4
+ "use_case_id": "US-001",
5
+ "timestamp": "2026-02-18T12:00:00Z",
6
+ "implementation": {
7
+ "status": "pending",
8
+ "summary_of_actions": "",
9
+ "learnings": ""
10
+ },
11
+ "tests": [
12
+ {
13
+ "id": "TC-001",
14
+ "description": "Example test case",
15
+ "status": "pending"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -27,11 +27,11 @@ Apply the provided refactor item to the codebase, following the project's conven
27
27
 
28
28
  | Source | Used for |
29
29
  |--------|----------|
30
- | `refactor_item_id` (context variable) | The refactor item identifier (e.g. `RI-001`) |
31
- | `refactor_item_title` (context variable) | Short title of the refactor item |
32
- | `refactor_item_description` (context variable) | Detailed description of the change to apply |
33
- | `refactor_item_rationale` (context variable) | Why this refactor is needed |
34
- | `iteration` (context variable) | Current iteration number for context |
30
+ | `current_iteration` (context variable) | Current iteration number for context |
31
+ | `item_id` (context variable) | The refactor item identifier (e.g. `RI-001`) |
32
+ | `item_title` (context variable) | Short title of the refactor item |
33
+ | `item_description` (context variable) | Detailed description of the change to apply |
34
+ | `item_rationale` (context variable) | Why this refactor is needed |
35
35
  | `.agents/PROJECT_CONTEXT.md` | Documented conventions, architecture, and standards to follow |
36
36
 
37
37
  ---
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+
3
+ const PrototypeProgressEntrySchema = z.object({
4
+ use_case_id: z.string(),
5
+ status: z.enum(["pending", "failed", "completed"]),
6
+ attempt_count: z.number().int().nonnegative(),
7
+ last_agent_exit_code: z.number().int().nullable(),
8
+ quality_checks: z.array(
9
+ z.object({
10
+ command: z.string(),
11
+ exit_code: z.number().int(),
12
+ }),
13
+ ),
14
+ last_error_summary: z.string(),
15
+ updated_at: z.string(),
16
+ });
17
+
18
+ export const PrototypeProgressSchema = z.object({
19
+ entries: z.array(PrototypeProgressEntrySchema),
20
+ });
21
+
22
+ export type PrototypeProgress = z.infer<typeof PrototypeProgressSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+
3
+ const TestExecutionProgressEntrySchema = z.object({
4
+ id: z.string(),
5
+ type: z.enum(["automated", "exploratory_manual"]),
6
+ status: z.enum(["pending", "in_progress", "passed", "failed"]),
7
+ attempt_count: z.number().int().nonnegative(),
8
+ last_agent_exit_code: z.number().int().nullable(),
9
+ last_error_summary: z.string(),
10
+ updated_at: z.string(),
11
+ });
12
+
13
+ export const TestExecutionProgressSchema = z.object({
14
+ entries: z.array(TestExecutionProgressEntrySchema),
15
+ });
16
+
17
+ export type TestExecutionProgress = z.infer<typeof TestExecutionProgressSchema>;
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+
3
+ const IssueSchema = z.object({
4
+ id: z.string(),
5
+ title: z.string(),
6
+ description: z.string(),
7
+ status: z.enum(["open", "fixed", "retry", "manual-fix"]),
8
+ });
9
+
10
+ export const IssuesSchema = z.array(IssueSchema).refine(
11
+ (issues) => {
12
+ const ids = issues.map((i) => i.id);
13
+ return new Set(ids).size === ids.length;
14
+ },
15
+ { message: "Issue IDs must be unique" },
16
+ );
17
+
18
+ export type Issue = z.infer<typeof IssueSchema>;
19
+ export type Issues = z.infer<typeof IssuesSchema>;
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+
3
+ const PrototypeProgressEntrySchema = z.object({
4
+ use_case_id: z.string(),
5
+ status: z.enum(["pending", "failed", "completed"]),
6
+ attempt_count: z.number().int().nonnegative(),
7
+ last_agent_exit_code: z.number().int().nullable(),
8
+ quality_checks: z.array(
9
+ z.object({
10
+ command: z.string(),
11
+ exit_code: z.number().int(),
12
+ }),
13
+ ),
14
+ last_error_summary: z.string(),
15
+ updated_at: z.string(),
16
+ });
17
+
18
+ export const PrototypeProgressSchema = z.object({
19
+ entries: z.array(PrototypeProgressEntrySchema),
20
+ });
21
+
22
+ export type PrototypeProgress = z.infer<typeof PrototypeProgressSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+
3
+ const TestExecutionProgressEntrySchema = z.object({
4
+ id: z.string(),
5
+ type: z.enum(["automated", "exploratory_manual"]),
6
+ status: z.enum(["pending", "in_progress", "passed", "failed"]),
7
+ attempt_count: z.number().int().nonnegative(),
8
+ last_agent_exit_code: z.number().int().nullable(),
9
+ last_error_summary: z.string(),
10
+ updated_at: z.string(),
11
+ });
12
+
13
+ export const TestExecutionProgressSchema = z.object({
14
+ entries: z.array(TestExecutionProgressEntrySchema),
15
+ });
16
+
17
+ export type TestExecutionProgress = z.infer<typeof TestExecutionProgressSchema>;
@@ -1,4 +1,4 @@
1
- import { ProgressSchema } from "./tmpl_progress.ts";
1
+ import { ProgressSchema } from "./tmpl_progress";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
 
@@ -1,4 +1,4 @@
1
- import { StateSchema } from "./tmpl_state.ts";
1
+ import { StateSchema } from "./tmpl_state";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
 
package/src/cli.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
3
  import { join } from "node:path";
4
- import { parseAgentArg } from "./agent";
4
+ import { parseAgentArg, parseProvider, type AgentProvider } from "./agent";
5
5
  import { GuardrailAbortError } from "./guardrail";
6
6
  import { runApproveProjectContext } from "./commands/approve-project-context";
7
+ import { runApprovePrototype } from "./commands/approve-prototype";
7
8
  import { runApproveRefactorPlan } from "./commands/approve-refactor-plan";
8
9
  import { runApproveRequirement } from "./commands/approve-requirement";
9
10
  import { runApproveTestPlan } from "./commands/approve-test-plan";
@@ -18,6 +19,7 @@ import { runExecuteAutomatedFix } from "./commands/execute-automated-fix";
18
19
  import { runExecuteManualFix } from "./commands/execute-manual-fix";
19
20
  import { runExecuteRefactor } from "./commands/execute-refactor";
20
21
  import { runExecuteTestPlan } from "./commands/execute-test-plan";
22
+ import { runFlow } from "./commands/flow";
21
23
  import { runInit } from "./commands/init";
22
24
  import { runRefineProjectContext } from "./commands/refine-project-context";
23
25
  import { runRefineRefactorPlan } from "./commands/refine-refactor-plan";
@@ -89,6 +91,21 @@ function parseForce(args: string[]): { force: boolean; remainingArgs: string[] }
89
91
  };
90
92
  }
91
93
 
94
+ function parseOptionalAgentArg(args: string[]): {
95
+ provider: AgentProvider | undefined;
96
+ remainingArgs: string[];
97
+ } {
98
+ const { value, remainingArgs } = extractFlagValue(args, "--agent");
99
+ if (value === null) {
100
+ return { provider: undefined, remainingArgs };
101
+ }
102
+
103
+ return {
104
+ provider: parseProvider(value),
105
+ remainingArgs,
106
+ };
107
+ }
108
+
92
109
  function printUsage() {
93
110
  console.log(`Usage: nvst <command> [options]
94
111
 
@@ -101,6 +118,8 @@ Commands:
101
118
  Generate test plan document for current iteration
102
119
  create prototype --agent <provider> [--iterations <N>] [--retry-on-fail <N>] [--stop-on-critical]
103
120
  Initialize prototype build for current iteration
121
+ flow [--agent <provider>] [--force]
122
+ Run the next pending flow step(s) until an approval gate or completion
104
123
  create issue --agent <provider>
105
124
  Create issues interactively via agent
106
125
  create issue --test-execution-report
@@ -109,6 +128,8 @@ Commands:
109
128
  Mark project context as approved
110
129
  approve test-plan
111
130
  Mark test plan as approved and generate structured TP JSON
131
+ approve prototype
132
+ Stage and commit all pending changes for current iteration
112
133
  approve refactor-plan
113
134
  Mark refactor plan as approved and generate structured refactor PRD JSON
114
135
  refine project-context --agent <provider> [--challenge]
@@ -211,6 +232,26 @@ async function main() {
211
232
  return;
212
233
  }
213
234
 
235
+ if (command === "flow") {
236
+ try {
237
+ const { provider, remainingArgs: postAgentArgs } = parseOptionalAgentArg(args);
238
+ const { force, remainingArgs: postForceArgs } = parseForce(postAgentArgs);
239
+ if (postForceArgs.length > 0) {
240
+ console.error(`Unknown option(s) for flow: ${postForceArgs.join(" ")}`);
241
+ printUsage();
242
+ process.exitCode = 1;
243
+ return;
244
+ }
245
+ await runFlow({ provider, force });
246
+ return;
247
+ } catch (error) {
248
+ console.error(error instanceof Error ? error.message : String(error));
249
+ printUsage();
250
+ process.exitCode = 1;
251
+ return;
252
+ }
253
+ }
254
+
214
255
  if (command === "create") {
215
256
  if (args.length === 0) {
216
257
  console.error(
@@ -532,7 +573,7 @@ Providers: claude, codex, gemini, cursor`);
532
573
 
533
574
  if (command === "approve") {
534
575
  if (args.length === 0) {
535
- console.error(`Usage for approve: nvst approve <requirement|project-context|test-plan|refactor-plan>`);
576
+ console.error(`Usage for approve: nvst approve <requirement|project-context|test-plan|prototype|refactor-plan>`);
536
577
  printUsage();
537
578
  process.exitCode = 1;
538
579
  return;
@@ -562,6 +603,11 @@ Providers: claude, codex, gemini, cursor`);
562
603
  return;
563
604
  }
564
605
 
606
+ if (subcommand === "prototype") {
607
+ await runApprovePrototype({ force });
608
+ return;
609
+ }
610
+
565
611
  if (subcommand === "refactor-plan") {
566
612
  await runApproveRefactorPlan({ force });
567
613
  return;
@@ -613,12 +659,11 @@ Providers: claude, codex, gemini, cursor`);
613
659
  } = parseOptionalIntegerFlag(postAgentArgs, "--iterations", 1);
614
660
  const {
615
661
  value: retryOnFail,
616
- remainingArgs: postRetryArgs,
662
+ remainingArgs: unknownArgs,
617
663
  } = parseOptionalIntegerFlag(postIterationsArgs, "--retry-on-fail", 0);
618
664
 
619
- const { remainingArgs: postForceArgs } = parseForce(postRetryArgs);
620
- if (postForceArgs.length > 0) {
621
- console.error(`Unknown option(s) for execute automated-fix: ${postForceArgs.join(" ")}`);
665
+ if (unknownArgs.length > 0) {
666
+ console.error(`Unknown option(s) for execute automated-fix: ${unknownArgs.join(" ")}`);
622
667
  printUsage();
623
668
  process.exitCode = 1;
624
669
  return;