codeninja 2.0.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 (140) hide show
  1. package/.gitattributes +11 -0
  2. package/README.md +293 -0
  3. package/agent/database-agent.md +504 -0
  4. package/agent/designs/README.md +10 -0
  5. package/agent/global-agent.md +236 -0
  6. package/agent/nodejs-agent.md +406 -0
  7. package/agent/reactjs-agent.md +260 -0
  8. package/cli.js +352 -0
  9. package/commands/audit.workflow.md +111 -0
  10. package/commands/create-api.workflow.md +99 -0
  11. package/commands/db-add-index.workflow.md +97 -0
  12. package/commands/db-create-table.workflow.md +132 -0
  13. package/commands/db-drop-table.workflow.md +103 -0
  14. package/commands/db-modify-table.workflow.md +159 -0
  15. package/commands/db-seed.workflow.md +99 -0
  16. package/commands/db-sync.workflow.md +100 -0
  17. package/commands/design.workflow.md +66 -0
  18. package/commands/initialize-project.workflow.md +500 -0
  19. package/commands/integrate-api.workflow.md +448 -0
  20. package/commands/modularize.workflow.md +329 -0
  21. package/commands/refactor.workflow.md +70 -0
  22. package/commands/sync.workflow.md +962 -0
  23. package/commands/test.workflow.md +40 -0
  24. package/commands/validate-page.workflow.md +543 -0
  25. package/mcp-server.js +842 -0
  26. package/package.json +24 -0
  27. package/tasks/README.md +283 -0
  28. package/tasks/add-health-route.task.md +103 -0
  29. package/tasks/ask-api-integration-scope.task.md +34 -0
  30. package/tasks/ask-api-key.task.md +23 -0
  31. package/tasks/ask-api-version.task.md +28 -0
  32. package/tasks/ask-client-type.task.md +24 -0
  33. package/tasks/ask-column-enum-values.task.md +51 -0
  34. package/tasks/ask-column-is-enum.task.md +39 -0
  35. package/tasks/ask-column-name.task.md +39 -0
  36. package/tasks/ask-column-position.task.md +39 -0
  37. package/tasks/ask-column-type.task.md +59 -0
  38. package/tasks/ask-database-config.task.md +66 -0
  39. package/tasks/ask-database-host.task.md +16 -0
  40. package/tasks/ask-database-name.task.md +18 -0
  41. package/tasks/ask-database-port.task.md +23 -0
  42. package/tasks/ask-database-type.task.md +30 -0
  43. package/tasks/ask-database-user.task.md +14 -0
  44. package/tasks/ask-design-description.task.md +16 -0
  45. package/tasks/ask-design-target.task.md +24 -0
  46. package/tasks/ask-encrypted-transport.task.md +25 -0
  47. package/tasks/ask-encryption-iv.task.md +23 -0
  48. package/tasks/ask-encryption-key.task.md +23 -0
  49. package/tasks/ask-feature-name.task.md +20 -0
  50. package/tasks/ask-http-method.task.md +21 -0
  51. package/tasks/ask-index-columns.task.md +46 -0
  52. package/tasks/ask-index-file-placement.task.md +33 -0
  53. package/tasks/ask-index-sort-order.task.md +37 -0
  54. package/tasks/ask-index-type.task.md +42 -0
  55. package/tasks/ask-init-mode.task.md +28 -0
  56. package/tasks/ask-linked-service.task.md +57 -0
  57. package/tasks/ask-modify-operation.task.md +36 -0
  58. package/tasks/ask-modularize-scope.task.md +31 -0
  59. package/tasks/ask-module-name.task.md +30 -0
  60. package/tasks/ask-new-column-name.task.md +21 -0
  61. package/tasks/ask-new-table-name.task.md +22 -0
  62. package/tasks/ask-old-column-name.task.md +22 -0
  63. package/tasks/ask-package-author.task.md +16 -0
  64. package/tasks/ask-package-name.task.md +23 -0
  65. package/tasks/ask-page-path.task.md +40 -0
  66. package/tasks/ask-primary-table.task.md +30 -0
  67. package/tasks/ask-project-figma.task.md +71 -0
  68. package/tasks/ask-project-info-doc.task.md +57 -0
  69. package/tasks/ask-project-scope-of-work.task.md +57 -0
  70. package/tasks/ask-project-type.task.md +24 -0
  71. package/tasks/ask-react-target-service.task.md +32 -0
  72. package/tasks/ask-redis-config.task.md +42 -0
  73. package/tasks/ask-redis-host.task.md +16 -0
  74. package/tasks/ask-redis-port.task.md +18 -0
  75. package/tasks/ask-refactor-type.task.md +26 -0
  76. package/tasks/ask-requires-auth.task.md +22 -0
  77. package/tasks/ask-response-mode.task.md +38 -0
  78. package/tasks/ask-route-description.task.md +20 -0
  79. package/tasks/ask-route-path.task.md +29 -0
  80. package/tasks/ask-seed-row-values.task.md +42 -0
  81. package/tasks/ask-seed-rows-count.task.md +22 -0
  82. package/tasks/ask-service-description.task.md +16 -0
  83. package/tasks/ask-service-name.task.md +27 -0
  84. package/tasks/ask-service-port.task.md +24 -0
  85. package/tasks/ask-supported-languages.task.md +40 -0
  86. package/tasks/ask-table-file-number.task.md +36 -0
  87. package/tasks/ask-table-indexes.task.md +47 -0
  88. package/tasks/ask-table-name.task.md +32 -0
  89. package/tasks/ask-table-needs-soft-delete.task.md +29 -0
  90. package/tasks/ask-table-needs-status.task.md +30 -0
  91. package/tasks/ask-table-purpose.task.md +28 -0
  92. package/tasks/ask-table-seed-data.task.md +44 -0
  93. package/tasks/ask-target-service.task.md +32 -0
  94. package/tasks/ask-test-type.task.md +20 -0
  95. package/tasks/ask-validation-library.task.md +38 -0
  96. package/tasks/detect-repository-state.task.md +92 -0
  97. package/tasks/generate-app.task.md +146 -0
  98. package/tasks/generate-common.task.md +330 -0
  99. package/tasks/generate-constants.task.md +123 -0
  100. package/tasks/generate-database.task.md +168 -0
  101. package/tasks/generate-docker-compose.task.md +298 -0
  102. package/tasks/generate-dockerfile.task.md +126 -0
  103. package/tasks/generate-dockerignore.task.md +123 -0
  104. package/tasks/generate-enc-dec-html.task.md +127 -0
  105. package/tasks/generate-enc-dec-php.task.md +145 -0
  106. package/tasks/generate-encryption.task.md +159 -0
  107. package/tasks/generate-fast-defaults.task.md +68 -0
  108. package/tasks/generate-gitignore.task.md +79 -0
  109. package/tasks/generate-headerValidator.task.md +377 -0
  110. package/tasks/generate-ide-configs.task.md +114 -0
  111. package/tasks/generate-ioRedis.task.md +120 -0
  112. package/tasks/generate-language-en.task.md +155 -0
  113. package/tasks/generate-logging.task.md +257 -0
  114. package/tasks/generate-model.task.md +180 -0
  115. package/tasks/generate-notification.task.md +251 -0
  116. package/tasks/generate-package-json.task.md +114 -0
  117. package/tasks/generate-rateLimiter.task.md +125 -0
  118. package/tasks/generate-react-api-client.task.md +169 -0
  119. package/tasks/generate-react-api-handler.task.md +102 -0
  120. package/tasks/generate-react-app-jsx.task.md +56 -0
  121. package/tasks/generate-react-dockerfile.task.md +175 -0
  122. package/tasks/generate-react-env.task.md +58 -0
  123. package/tasks/generate-react-gitignore.task.md +49 -0
  124. package/tasks/generate-react-htaccess.task.md +54 -0
  125. package/tasks/generate-react-index-html.task.md +53 -0
  126. package/tasks/generate-react-index-jsx.task.md +51 -0
  127. package/tasks/generate-react-package-json.task.md +77 -0
  128. package/tasks/generate-react-welcome-page.task.md +71 -0
  129. package/tasks/generate-readme.task.md +160 -0
  130. package/tasks/generate-response.task.md +202 -0
  131. package/tasks/generate-route-manager.task.md +173 -0
  132. package/tasks/generate-route.task.md +203 -0
  133. package/tasks/generate-swagger.task.md +290 -0
  134. package/tasks/generate-tbl-user-deviceinfo.task.md +75 -0
  135. package/tasks/generate-template.task.md +129 -0
  136. package/tasks/generate-validator.task.md +122 -0
  137. package/tasks/show-db-table-summary.task.md +66 -0
  138. package/tasks/show-final-summary.task.md +108 -0
  139. package/tasks/show-init-summary.task.md +257 -0
  140. package/tasks/write-context.task.md +314 -0
@@ -0,0 +1,31 @@
1
+ ---
2
+ type: task
3
+ name: ask-modularize-scope
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "What would you like to modularize?"
9
+
10
+ Present options:
11
+ 1. All pages — scan every page in src/pages/ and modularize all of them
12
+ 2. A specific page — I'll ask you which one
13
+
14
+ Wait for user selection.
15
+
16
+ Store result in: `context.current_action.modularize_scope`
17
+ - Option 1 → "all"
18
+ - Option 2 → "specific"
19
+
20
+ If option 1 (all):
21
+ Inform user:
22
+ "Understood. I'll scan every page and extract shared layout components
23
+ (header, footer, sidebar, navbar, etc.) once, then apply them across
24
+ all pages. Pages that already use components will be left unchanged."
25
+ Return. Do not ask anything else.
26
+
27
+ If option 2 (specific):
28
+ Run task: `ask-page-path`
29
+ (This stores the target page into context.current_action.page_path)
30
+
31
+ Do not ask any other question in this task beyond the scope question.
@@ -0,0 +1,30 @@
1
+ ---
2
+ type: task
3
+ name: ask-module-name
4
+ ---
5
+
6
+ Read service name from context — check in this order:
7
+ 1. `context.current_api.service_name`
8
+ 2. `context.current_action.service_name`
9
+ Use whichever is populated.
10
+ Read `context.services[<resolved_service_name>].modules` if available.
11
+
12
+ If modules exist, show them:
13
+ "Existing modules in this service: [list]"
14
+
15
+ Ask the user exactly this question:
16
+
17
+ "Enter the module name."
18
+
19
+ Example: Products, Orders, Invoice, Users
20
+
21
+ Wait for user input.
22
+
23
+ Validate:
24
+ - PascalCase recommended (e.g. Products not products)
25
+ - Must NOT already exist in the service's modules list
26
+ - If duplicate → inform user and ask again
27
+
28
+ Store result in: `context.current_action.module_name`
29
+
30
+ Do not ask any other question in this task.
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: task
3
+ name: ask-new-column-name
4
+ ---
5
+
6
+ Read `context.current_refactor.old_column_name` to show the current name.
7
+
8
+ Ask the user exactly this question:
9
+
10
+ "Enter the new name for column '[old_column_name]'."
11
+
12
+ Wait for user input.
13
+
14
+ Validate:
15
+ - snake_case only
16
+ - No spaces
17
+ - Must not already exist in the same table's columns in context
18
+
19
+ Store result in: `context.current_refactor.new_column_name`
20
+
21
+ Do not ask any other question in this task.
@@ -0,0 +1,22 @@
1
+ ---
2
+ type: task
3
+ name: ask-new-table-name
4
+ ---
5
+
6
+ Read `context.current_refactor.table_name` to show the current name.
7
+
8
+ Ask the user exactly this question:
9
+
10
+ "Enter the new name for table '[current_table_name]'."
11
+
12
+ Wait for user input.
13
+
14
+ Validate:
15
+ - Must be lowercase snake_case
16
+ - Must start with tbl_
17
+ - Must not already exist in `context.db.schema.tables`
18
+ - No spaces
19
+
20
+ Store result in: `context.current_refactor.new_table_name`
21
+
22
+ Do not ask any other question in this task.
@@ -0,0 +1,22 @@
1
+ ---
2
+ type: task
3
+ name: ask-old-column-name
4
+ ---
5
+
6
+ Read table name from context — check in this order:
7
+ 1. `context.current_refactor.table_name` (if called from @refactor)
8
+ 2. `context.current_db.table_name` (if called from @db:modify-table)
9
+ Use whichever is populated.
10
+ Read `context.db.schema.tables[<table_name>].columns` to list available columns.
11
+
12
+ Ask the user exactly this question:
13
+
14
+ "Which column do you want to rename?"
15
+
16
+ List all columns for the selected table from context.
17
+
18
+ Wait for user selection.
19
+
20
+ Store result in: `context.current_refactor.old_column_name`
21
+
22
+ Do not ask any other question in this task.
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: task
3
+ name: ask-package-author
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "Enter the author name for package.json."
9
+
10
+ Example: John Doe
11
+
12
+ Wait for user input.
13
+
14
+ Store result in: `context.current_init.author`
15
+
16
+ Do not ask any other question in this task.
@@ -0,0 +1,23 @@
1
+ ---
2
+ type: task
3
+ name: ask-package-name
4
+ ---
5
+
6
+ Read `context.current_init.service_name` and use it as the suggested default.
7
+
8
+ Ask the user exactly this question:
9
+
10
+ "Enter the npm package name for this service."
11
+
12
+ Show suggested default: [service_name]
13
+
14
+ If user presses enter without input → use the service_name as-is.
15
+
16
+ Validate:
17
+ - Lowercase
18
+ - No spaces
19
+ - Valid npm package name format
20
+
21
+ Store result in: `context.current_init.package_name`
22
+
23
+ Do not ask any other question in this task.
@@ -0,0 +1,40 @@
1
+ ---
2
+ type: task
3
+ name: ask-page-path
4
+ ---
5
+
6
+ Read `context.current_action.service_name`.
7
+ Read `context.services[<service_name>]`.
8
+
9
+ Scan the service's `src/pages/` directory to build a list of available pages.
10
+ For each subdirectory in `src/pages/` that contains an `index.jsx` or
11
+ `index.js` file → add it to the list as a valid page target.
12
+
13
+ Also scan `src/views/` if it exists — include those as well.
14
+
15
+ If pages are found, display them:
16
+ "Available pages in [service_name]:"
17
+ 1. [PageName] — src/pages/[PageName]/index.jsx
18
+ 2. [PageName] — src/pages/[PageName]/index.jsx
19
+ ...
20
+
21
+ Ask the user exactly this question:
22
+
23
+ "Which page would you like to target?
24
+ Enter the page name from the list above, or type a custom path
25
+ relative to src/ (e.g. pages/Login/index.jsx)"
26
+
27
+ Wait for user input.
28
+
29
+ Validate:
30
+ - If a name from the list was entered → resolve to the full path
31
+ - If a custom path was entered → verify the file exists on disk
32
+ - If the file cannot be found → inform user and ask again
33
+
34
+ Store result in:
35
+ - `context.current_action.page_name` — the page/component display name
36
+ (e.g. "Login", "Dashboard")
37
+ - `context.current_action.page_path` — the full relative path from service
38
+ root (e.g. "src/pages/Login/index.jsx")
39
+
40
+ Do not ask any other question in this task.
@@ -0,0 +1,30 @@
1
+ ---
2
+ type: task
3
+ name: ask-primary-table
4
+ ---
5
+
6
+ Read `context.db.schema.tables` to get list of available tables.
7
+
8
+ If no tables exist in context:
9
+ Inform user: "No tables found in context. Run @sync or @initialize-project first to register your schema."
10
+ Ask: "Enter the table name manually."
11
+ Store result and continue.
12
+
13
+ If tables exist:
14
+ Ask the user exactly this question:
15
+
16
+ "Which database table will this endpoint primarily interact with?"
17
+
18
+ List all tables from context.db.schema.tables with their column count.
19
+ Example:
20
+ 1. users (7 columns)
21
+ 2. products (12 columns)
22
+ 3. orders (9 columns)
23
+
24
+ Add option: "None (this endpoint does not use a DB table)"
25
+
26
+ Wait for user selection.
27
+
28
+ Store result in: `context.current_api.primary_table`
29
+
30
+ Do not ask any other question in this task.
@@ -0,0 +1,71 @@
1
+ ---
2
+ type: task
3
+ name: ask-project-figma
4
+ ---
5
+
6
+ Check `context.project_info.has_figma` — if already set, skip this task entirely.
7
+
8
+ Ask the user exactly this question:
9
+
10
+ "Do you have a Figma design file or any UI design link for this project?"
11
+
12
+ Present options:
13
+ 1. Yes — I have a Figma or design link
14
+ 2. No — skip this
15
+
16
+ Wait for user selection.
17
+
18
+ If No:
19
+ Store: `context.project_info.has_figma = false`
20
+ Return. Do not ask anything else.
21
+
22
+ If Yes:
23
+ Store: `context.project_info.has_figma = true`
24
+
25
+ Ask the user exactly this question:
26
+
27
+ "Enter the Figma link or design URL."
28
+
29
+ Wait for input.
30
+
31
+ Validate:
32
+ - Should be a URL (starts with https://)
33
+ - Figma links typically contain figma.com — inform user if it doesn't look like a Figma link,
34
+ but still accept it (could be InVision, Zeplin, Adobe XD, etc.)
35
+
36
+ Store: `context.project_info.figma_url = <url>`
37
+
38
+ Ask the user exactly this question:
39
+
40
+ "Is this Figma link publicly accessible or does it require a login?"
41
+
42
+ Present options:
43
+ 1. Publicly accessible — anyone with the link can view
44
+ 2. Requires login — I'll describe the screens manually
45
+
46
+ Wait for user selection.
47
+
48
+ If publicly accessible:
49
+ Store: `context.project_info.figma_accessible = true`
50
+ Agent notes: "Figma link stored. Will reference for screen names, component
51
+ naming, and UI structure when generating ReactJS components or API contracts."
52
+
53
+ If requires login:
54
+ Store: `context.project_info.figma_accessible = false`
55
+
56
+ Ask the user exactly this question:
57
+
58
+ "Briefly describe the main screens or pages in your design."
59
+
60
+ Example: "Login, Register, Dashboard, Profile, Product List, Product Detail, Cart, Checkout"
61
+
62
+ Wait for input.
63
+ Store: `context.project_info.figma_screens = <input>`
64
+
65
+ After collecting:
66
+ Extract and store in `context.project_info.from_figma`:
67
+ - screens: [] (list of screen/page names identified)
68
+ - components_hinted: [] (any reusable components visible or described)
69
+ - color_theme: "" (if determinable from description)
70
+
71
+ Do not ask any other question in this task.
@@ -0,0 +1,57 @@
1
+ ---
2
+ type: task
3
+ name: ask-project-info-doc
4
+ ---
5
+
6
+ Check `context.project_info.has_doc` — if already set, skip this task entirely.
7
+
8
+ Ask the user exactly this question:
9
+
10
+ "Do you have a project information document or requirement document?
11
+ (This helps the agent understand your project deeply for better suggestions)"
12
+
13
+ Present options:
14
+ 1. Yes — I have a document
15
+ 2. No — skip this
16
+
17
+ Wait for user selection.
18
+
19
+ If No:
20
+ Store: `context.project_info.has_doc = false`
21
+ Return. Do not ask anything else.
22
+
23
+ If Yes:
24
+ Store: `context.project_info.has_doc = true`
25
+
26
+ Ask the user exactly this question:
27
+
28
+ "How would you like to provide your project document?"
29
+
30
+ Present options:
31
+ 1. Paste a URL or hosted link
32
+ 2. Paste the content directly in chat
33
+
34
+ Wait for user selection.
35
+
36
+ If URL:
37
+ Ask: "Enter the document URL."
38
+ Wait for input.
39
+ Store: `context.project_info.doc_url = <url>`
40
+ Store: `context.project_info.doc_source = "url"`
41
+
42
+ If paste:
43
+ Ask: "Paste your project document content below."
44
+ Wait for input.
45
+ Store: `context.project_info.doc_content = <content>`
46
+ Store: `context.project_info.doc_source = "paste"`
47
+
48
+ After collecting content:
49
+ Extract and store in `context.project_info.from_doc`:
50
+ - project_name: (if mentioned)
51
+ - domain: (e.g. fintech, ecommerce, healthcare)
52
+ - purpose: (one sentence summary of what the product does)
53
+ - features: [] (list of features/modules mentioned)
54
+ - entities: [] (data entities mentioned: users, products, orders, etc.)
55
+ - tech_preferences: [] (any tech mentioned: nodejs, react, postgres, etc.)
56
+
57
+ Do not ask any other question in this task.
@@ -0,0 +1,57 @@
1
+ ---
2
+ type: task
3
+ name: ask-project-scope-of-work
4
+ ---
5
+
6
+ Check `context.project_info.has_sow` — if already set, skip this task entirely.
7
+
8
+ Ask the user exactly this question:
9
+
10
+ "Do you have a Scope of Work (SOW) or project specification document?"
11
+
12
+ Present options:
13
+ 1. Yes — I have a SOW
14
+ 2. No — skip this
15
+
16
+ Wait for user selection.
17
+
18
+ If No:
19
+ Store: `context.project_info.has_sow = false`
20
+ Return. Do not ask anything else.
21
+
22
+ If Yes:
23
+ Store: `context.project_info.has_sow = true`
24
+
25
+ Ask the user exactly this question:
26
+
27
+ "How would you like to provide your Scope of Work?"
28
+
29
+ Present options:
30
+ 1. Paste a URL or hosted link
31
+ 2. Paste the content directly in chat
32
+
33
+ Wait for user selection.
34
+
35
+ If URL:
36
+ Ask: "Enter the Scope of Work URL."
37
+ Wait for input.
38
+ Store: `context.project_info.sow_url = <url>`
39
+ Store: `context.project_info.sow_source = "url"`
40
+
41
+ If paste:
42
+ Ask: "Paste your Scope of Work content below."
43
+ Wait for input.
44
+ Store: `context.project_info.sow_content = <content>`
45
+ Store: `context.project_info.sow_source = "paste"`
46
+
47
+ After collecting content:
48
+ Extract and store in `context.project_info.from_sow`:
49
+ - phases: [] (project phases or milestones if listed)
50
+ - deliverables: [] (specific deliverables mentioned)
51
+ - apis_expected: [] (any APIs or endpoints mentioned)
52
+ - tables_expected: [] (any data structures or entities mentioned)
53
+ - integrations: [] (third-party services: payment gateways, SMS, email, etc.)
54
+ - constraints: [] (performance, security, compliance requirements mentioned)
55
+ - timeline: "" (any timeline info mentioned)
56
+
57
+ Do not ask any other question in this task.
@@ -0,0 +1,24 @@
1
+ ---
2
+ type: task
3
+ name: ask-project-type
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "What type of project would you like to initialize?"
9
+
10
+ Present options:
11
+ 1. NodeJS API service
12
+ 2. ReactJS frontend
13
+ 3. Database only (schema + migrations, no application code)
14
+
15
+ Wait for user selection.
16
+
17
+ Validate: must be one of the three options.
18
+
19
+ Store result as:
20
+ - `nodejs` → `context.current_init.project_type = "nodejs"`
21
+ - `reactjs` → `context.current_init.project_type = "reactjs"`
22
+ - `database-only` → `context.current_init.project_type = "database-only"`
23
+
24
+ Do not ask any other question in this task.
@@ -0,0 +1,32 @@
1
+ ---
2
+ type: task
3
+ name: ask-react-target-service
4
+ ---
5
+
6
+ Read `context.services` and filter for services where `type == "reactjs"`.
7
+
8
+ If no ReactJS services exist:
9
+ Inform user:
10
+ "No ReactJS services have been initialized yet. Run @initialize-project
11
+ and select ReactJS first, then run this command again."
12
+ Abort task.
13
+
14
+ If exactly one ReactJS service exists:
15
+ Inform user: "Using ReactJS service: [service_name] (port [port])"
16
+ Store automatically: `context.current_action.service_name = <only_service>`
17
+ Return without asking.
18
+
19
+ If multiple ReactJS services exist:
20
+ Ask the user exactly this question:
21
+
22
+ "Which ReactJS service would you like to work on?"
23
+
24
+ List only ReactJS services:
25
+ 1. [service_name] — port [port] — [description]
26
+ 2. [service_name] — port [port] — [description]
27
+
28
+ Wait for user selection.
29
+
30
+ Store result in: `context.current_action.service_name`
31
+
32
+ Do not ask any other question in this task.
@@ -0,0 +1,42 @@
1
+ ---
2
+ type: task
3
+ name: ask-redis-config
4
+ ---
5
+
6
+ ## Purpose
7
+ Collects Redis connection details in a single grouped display.
8
+ Only called in manual init mode. In fast mode, these values are
9
+ auto-populated by generate-fast-defaults.
10
+
11
+ ## Display
12
+
13
+ Show this grouped prompt:
14
+ ```
15
+ REDIS CONNECTION
16
+ ───────────────────────────────────────────
17
+ Redis host : localhost
18
+ Redis port : 6379
19
+ ───────────────────────────────────────────
20
+ Press ENTER on either field to accept the shown default.
21
+ Most local setups use localhost:6379.
22
+ ```
23
+
24
+ ## Field Rules
25
+
26
+ ### Redis host
27
+ - Default: `localhost`
28
+ - If user presses enter → use "localhost"
29
+ - Store in: `context.current_init.redis_host`
30
+
31
+ ### Redis port
32
+ - Default: `6379`
33
+ - If user presses enter → use 6379
34
+ - Validate: must be a valid port number (1–65535)
35
+ - Store in: `context.current_init.redis_port`
36
+
37
+ ## After Collection
38
+
39
+ Inform user:
40
+ "Redis config saved. [redis_host]:[redis_port]"
41
+
42
+ Do not ask any other question in this task.
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: task
3
+ name: ask-redis-host
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "Enter the Redis host for this service."
9
+
10
+ Show default: localhost
11
+
12
+ If user presses enter without input → use "localhost".
13
+
14
+ Store result in: `context.current_init.redis_host`
15
+
16
+ Do not ask any other question in this task.
@@ -0,0 +1,18 @@
1
+ ---
2
+ type: task
3
+ name: ask-redis-port
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "Enter the Redis port for this service."
9
+
10
+ Show default: 6379
11
+
12
+ If user presses enter without input → use 6379.
13
+
14
+ Validate: must be a valid port number (1–65535).
15
+
16
+ Store result in: `context.current_init.redis_port`
17
+
18
+ Do not ask any other question in this task.
@@ -0,0 +1,26 @@
1
+ ---
2
+ type: task
3
+ name: ask-refactor-type
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "What would you like to refactor?"
9
+
10
+ Present options:
11
+ 1. Rename a database column
12
+ 2. Rename a database table
13
+ 3. Rename a service
14
+ 4. Rename a module
15
+ 5. Restructure files within a service
16
+
17
+ Wait for user selection.
18
+
19
+ Store result in: `context.current_refactor.type`
20
+ - Option 1 → "rename_column"
21
+ - Option 2 → "rename_table"
22
+ - Option 3 → "rename_service"
23
+ - Option 4 → "rename_module"
24
+ - Option 5 → "restructure"
25
+
26
+ Do not ask any other question in this task.
@@ -0,0 +1,22 @@
1
+ ---
2
+ type: task
3
+ name: ask-requires-auth
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "Does this endpoint require authentication?"
9
+
10
+ Present options:
11
+ 1. Yes — apply API key + JWT middleware
12
+ 2. API key only — apply headerValidator middleware only
13
+ 3. No — public endpoint, no auth middleware
14
+
15
+ Wait for user selection.
16
+
17
+ Store result in: `context.current_api.requires_auth`
18
+ - Option 1 → "full"
19
+ - Option 2 → "api_key_only"
20
+ - Option 3 → "none"
21
+
22
+ Do not ask any other question in this task.
@@ -0,0 +1,38 @@
1
+ ---
2
+ type: task
3
+ name: ask-response-mode
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "What response code format should API responses use?"
9
+
10
+ Show guidance:
11
+ "This controls what the 'code' field in every API response contains.
12
+
13
+ Standard HTTP mode — the 'code' field echoes the HTTP status code.
14
+ Example success: { code: 200, message: '...', data: {...} }
15
+ Example failure: { code: 401, message: '...' }
16
+
17
+ Company mode (0/1) — the 'code' field uses internal status values.
18
+ 1 = success
19
+ 0 = failure / business logic error
20
+ -1 = authentication error
21
+ Example success: { code: 1, message: '...', data: {...} }
22
+ Example failure: { code: 0, message: '...' }
23
+
24
+ Both modes always send the correct HTTP status code on the wire (200,
25
+ 401, 500 etc). This setting only controls what goes inside the response
26
+ body's 'code' field."
27
+
28
+ Present options:
29
+ 1. Standard HTTP codes — code field mirrors the HTTP status (200, 401, 500…)
30
+ 2. Company codes — code field uses 1 / 0 / -1 internal values
31
+
32
+ Wait for user selection.
33
+
34
+ Store result in: `context.current_init.response_mode`
35
+ - Option 1 → "http"
36
+ - Option 2 → "company"
37
+
38
+ Do not ask any other question in this task.
@@ -0,0 +1,20 @@
1
+ ---
2
+ type: task
3
+ name: ask-route-description
4
+ ---
5
+
6
+ Ask the user exactly this question:
7
+
8
+ "Enter a short description for this endpoint."
9
+
10
+ Example: "Fetch all products with pagination"
11
+
12
+ Wait for user input.
13
+
14
+ Store result in: `context.current_api.description`
15
+
16
+ This description will be used in:
17
+ - swagger_doc.json summary field
18
+ - Controller file JSDoc comment
19
+
20
+ Do not ask any other question in this task.