@hanzlaa/rcode 4.3.3 → 4.4.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 (113) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +10 -4
  3. package/cli/doctor.js +21 -3
  4. package/cli/index.js +5 -1
  5. package/cli/install.js +2 -2
  6. package/cli/postinstall.js +1 -1
  7. package/cli/uninstall.js +48 -6
  8. package/dist/rcode.js +174 -170
  9. package/package.json +12 -22
  10. package/rcode/agents/rcode-codebase-mapper.md +12 -0
  11. package/rcode/agents/rcode-phase-researcher.md +13 -0
  12. package/rcode/agents/rcode-project-researcher.md +32 -0
  13. package/rcode/agents/rcode-roadmapper.md +15 -0
  14. package/rcode/agents/rules/planner/common-patterns.md +40 -0
  15. package/rcode/bin/lib/roadmap.cjs +184 -11
  16. package/rcode/bin/rcode-hooks.cjs +102 -151
  17. package/rcode/bin/rcode-tools.cjs +669 -55
  18. package/rcode/data/intent-table.json +87 -0
  19. package/rcode/modules/seo.yaml +22 -0
  20. package/rcode/references/project-types.yaml +75 -0
  21. package/rcode/skills/SKILLS_INDEX.md +17 -0
  22. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/SKILL.md +4 -21
  23. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/heartbeat.sh +0 -0
  24. package/rcode/skills/actions/4-implementation/rcode-scaffold-project/SKILL.md +60 -1
  25. package/rcode/skills/core/rcode-init/scripts/__pycache__/rcode_init.cpython-38.pyc +0 -0
  26. package/rcode/skills/core/rcode-init/scripts/tests/__pycache__/test_rcode_init.cpython-38.pyc +0 -0
  27. package/rcode/skills/seo/module.yaml +20 -0
  28. package/rcode/skills/seo/on-page-seo-auditor/SKILL.md +308 -0
  29. package/rcode/skills/seo/on-page-seo-auditor/references/audit-example.md +109 -0
  30. package/rcode/skills/seo/on-page-seo-auditor/references/audit-templates.md +427 -0
  31. package/rcode/skills/seo/on-page-seo-auditor/references/bulk-audit-playbook.md +116 -0
  32. package/rcode/skills/seo/on-page-seo-auditor/references/scoring-rubric.md +525 -0
  33. package/rcode/skills/seo/rank-and-rent-local-seo/SKILL.md +94 -0
  34. package/rcode/skills/seo/rank-and-rent-local-seo/rules/city-matrix-and-pages.md +76 -0
  35. package/rcode/skills/seo/rank-and-rent-local-seo/rules/monetization.md +70 -0
  36. package/rcode/skills/seo/rank-and-rent-local-seo/rules/niche-selection.md +60 -0
  37. package/rcode/skills/seo/rank-and-rent-local-seo/rules/subniche-discovery.md +66 -0
  38. package/rcode/skills/seo/rank-and-rent-local-seo/templates/service-city-page.md +36 -0
  39. package/rcode/skills/seo/rank-and-rent-local-seo/templates/subniche-research-prompt.md +34 -0
  40. package/rcode/skills/seo/seo-audit/SKILL.md +412 -0
  41. package/rcode/skills/seo/seo-audit/evals/evals.json +136 -0
  42. package/rcode/skills/seo/seo-audit/references/ai-writing-detection.md +200 -0
  43. package/rcode/skills/seo/seo-content-factory/SKILL.md +130 -0
  44. package/rcode/skills/seo/seo-content-factory/rules/agents.md +80 -0
  45. package/rcode/skills/seo/seo-content-factory/rules/herdr-wave-mapping.md +80 -0
  46. package/rcode/skills/seo/seo-content-factory/rules/pipeline.md +102 -0
  47. package/rcode/skills/seo/seo-content-factory/rules/programmatic-pages.md +107 -0
  48. package/rcode/skills/seo/seo-content-factory/rules/quality-gates.md +68 -0
  49. package/rcode/skills/seo/seo-content-factory/rules/weekly-cadence.md +61 -0
  50. package/rcode/skills/seo/seo-content-factory/templates/BACKLOG.md +23 -0
  51. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/01-funnel-A1-A4.md +63 -0
  52. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/02-fanout-editorial-A5-A6-A8.md +28 -0
  53. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/03-fanout-programmatic-A7-A6-A8.md +25 -0
  54. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/04-loop-A9-A10.md +34 -0
  55. package/rcode/skills/seo/seo-content-factory/templates/article.mdx +39 -0
  56. package/rcode/skills/seo/seo-content-factory/templates/cluster.schema.json +52 -0
  57. package/rcode/skills/seo/seo-content-factory/templates/content-brief.md +51 -0
  58. package/rcode/skills/seo/seo-content-factory/templates/jsonld-builders.ts +49 -0
  59. package/rcode/skills/seo/seo-content-factory/templates/keywords.csv +13 -0
  60. package/rcode/skills/seo/seo-content-factory/templates/programmatic-page.tsx +58 -0
  61. package/rcode/skills/seo/seo-content-writer/SKILL.md +263 -0
  62. package/rcode/skills/seo/seo-content-writer/references/content-structure-templates.md +875 -0
  63. package/rcode/skills/seo/seo-content-writer/references/instructions-detail.md +239 -0
  64. package/rcode/skills/seo/seo-content-writer/references/seo-writing-checklist.md +250 -0
  65. package/rcode/skills/seo/seo-content-writer/references/title-formulas.md +339 -0
  66. package/rcode/skills/seo/seo-growth-orchestrator/SKILL.md +79 -0
  67. package/rcode/skills/seo/seo-growth-orchestrator/rules/backlinks.md +29 -0
  68. package/rcode/skills/seo/seo-growth-orchestrator/rules/content-engine.md +27 -0
  69. package/rcode/skills/seo/seo-growth-orchestrator/rules/dos-and-donts.md +40 -0
  70. package/rcode/skills/seo/seo-growth-orchestrator/rules/goals-protocol.md +34 -0
  71. package/rcode/skills/seo/seo-growth-orchestrator/rules/local-seo-stack.md +35 -0
  72. package/rcode/skills/seo/seo-growth-orchestrator/rules/mrr-sprint.md +27 -0
  73. package/rcode/skills/seo/seo-growth-orchestrator/rules/tools.md +19 -0
  74. package/rcode/skills/seo/seo-growth-orchestrator/templates/backlink-research.md +29 -0
  75. package/rcode/skills/seo/seo-growth-orchestrator/templates/goal-protocol.md +35 -0
  76. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-citations.md +24 -0
  77. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-city-pages.md +27 -0
  78. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-gbp-categories.md +23 -0
  79. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-gsc-goldmine.md +27 -0
  80. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-review-mining.md +26 -0
  81. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-30day-plan.md +19 -0
  82. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-cut.md +13 -0
  83. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-opportunity-finder.md +17 -0
  84. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-role-model.md +18 -0
  85. package/rcode/skills/seo/seo-site-builder/SKILL.md +149 -0
  86. package/rcode/skills/seo/seo-site-builder/rules/01-niche-discovery.md +64 -0
  87. package/rcode/skills/seo/seo-site-builder/rules/02-deep-research.md +164 -0
  88. package/rcode/skills/seo/seo-site-builder/rules/03-keyword-strategy.md +82 -0
  89. package/rcode/skills/seo/seo-site-builder/rules/04-content-plan.md +173 -0
  90. package/rcode/skills/seo/seo-site-builder/rules/05-site-build.md +187 -0
  91. package/rcode/skills/seo/seo-site-builder/rules/06-yolo.md +127 -0
  92. package/rcode/skills/seo/seo-site-builder/templates/article-stub.mdx +62 -0
  93. package/rcode/skills/seo/seo-site-builder/templates/image-prompt.md +97 -0
  94. package/rcode/skills/seo/seo-site-builder/templates/keyword-export.md +45 -0
  95. package/rcode/skills/seo/seo-site-builder/templates/niche-scorecard.md +28 -0
  96. package/rcode/skills/seo/technical-seo-checker/SKILL.md +329 -0
  97. package/rcode/skills/seo/technical-seo-checker/references/bulk-audit-playbook.md +118 -0
  98. package/rcode/skills/seo/technical-seo-checker/references/ecommerce-platform-patterns.md +166 -0
  99. package/rcode/skills/seo/technical-seo-checker/references/http-status-codes.md +705 -0
  100. package/rcode/skills/seo/technical-seo-checker/references/llm-crawler-handling.md +257 -0
  101. package/rcode/skills/seo/technical-seo-checker/references/pre-migration-playbook.md +137 -0
  102. package/rcode/skills/seo/technical-seo-checker/references/robots-txt-reference.md +717 -0
  103. package/rcode/skills/seo/technical-seo-checker/references/technical-audit-example.md +169 -0
  104. package/rcode/skills/seo/technical-seo-checker/references/technical-audit-templates.md +436 -0
  105. package/rcode/templates/settings-hooks.json +4 -0
  106. package/rcode/workflows/do.md +16 -0
  107. package/rcode/workflows/execute-sprint.md +22 -0
  108. package/rcode/workflows/execute.md +17 -3
  109. package/rcode/workflows/new-milestone.md +21 -9
  110. package/rcode/workflows/new-project-create-roadmap.md +2 -0
  111. package/rcode/workflows/new-project-roadmap.md +2 -0
  112. package/rcode/workflows/new-project.md +3 -0
  113. package/rcode/workflows/plan.md +15 -2
@@ -2,6 +2,16 @@
2
2
  Execute all plans in a phase using wave-based parallel execution. Orchestrator stays lean — delegates plan execution to subagents.
3
3
  </purpose>
4
4
 
5
+ ## Orchestrator Constraint — No Inline Implementation
6
+
7
+ **The execute orchestrator MUST NOT implement code directly.** Its only role is to dispatch, monitor, and checkpoint. All implementation is delegated to `rcode-executor` subagents.
8
+
9
+ If you are reading this as the main conversation loop and are tempted to write code, create files, or make commits directly instead of spawning a subagent:
10
+
11
+ > **STOP.** Spawn `rcode-executor` as a subagent with the sprint plan as context. The main loop's job is to call the agent, present checkpoints, and update state — not to implement.
12
+
13
+ Bypassing this constraint produces a built project with no execution trace, no SUMMARY.md, and a dashboard frozen at `planned`. See issue #915.
14
+
5
15
  <pre_flight>
6
16
  **Mandatory before execution begins.** Run these checks first and surface
7
17
  findings BEFORE any subagents are spawned. If any check fails, stop and
@@ -173,11 +183,11 @@ via filesystem and git state.
173
183
  @.rcode/references/git-preflight.md
174
184
  Read STATE.md before any operation to load project context.
175
185
 
176
- @.rcode/references/agent-contracts.md
177
- @.rcode/references/context-budget.md
178
- @.rcode/references/gates.md
179
186
  @.rcode/references/karpathy-guidelines.md
180
187
  @.rcode/references/execution-protocol.md
188
+ <!-- Read .rcode/references/agent-contracts.md only if debugging agent contract violations -->
189
+ <!-- Read .rcode/references/context-budget.md only if context degradation guidance is needed -->
190
+ <!-- Read .rcode/references/gates.md only if implementing or troubleshooting gate logic -->
181
191
  </required_reading>
182
192
 
183
193
  <available_agent_types>
@@ -356,6 +366,7 @@ checkpoints between tasks. The user can review, modify, or redirect work at any
356
366
  their feedback before continuing. Otherwise proceed to next task.
357
367
 
358
368
  e. **After plan complete:** Show results, commit, create SUMMARY.md, then present next plan.
369
+ **Overwrite guard:** If the SUMMARY.md file already exists from a previous run, delete it first with `rm -f <path>` before writing the new version. Never append to or skip an existing SUMMARY.md — always overwrite with the current sprint's completion data.
359
370
 
360
371
  3. After all plans: proceed to verification (same as normal mode).
361
372
 
@@ -1036,6 +1047,9 @@ Read and follow `.rcode/workflows/transition.md`, passing through the `--auto` f
1036
1047
  /rcode-execute {next} — execute next phase
1037
1048
  ```
1038
1049
 
1050
+ **Next step — paste this to verify:**
1051
+ > /rcode-verify {X}
1052
+
1039
1053
  Only suggest the commands listed above. Do not invent or hallucinate command names.
1040
1054
  </step>
1041
1055
 
@@ -17,6 +17,24 @@ Valid rcode subagent types (use exact names — do not fall back to 'general-pur
17
17
 
18
18
  <process>
19
19
 
20
+ ## --from-draft mode
21
+
22
+ When `--from-draft <path>` is passed:
23
+ 1. Check for the file at `<path>`. Accept any markdown file — MILESTONE-CONTEXT.md, a scratch doc, or a ROADMAP partial.
24
+ 2. If found: read it as the milestone definition — do NOT re-run the interactive goal-gathering interview (steps 2–4). Jump directly to step 5 (Requirements scoping) using the draft as the source of truth.
25
+ 3. If not found: abort with:
26
+ ```
27
+ Error: --from-draft file not found: {path}
28
+ ```
29
+ Do not fall back to standard mode — an explicit path that does not exist is a user error, not a signal to start fresh.
30
+
31
+ Surface a one-line banner when the draft is loaded:
32
+ ```
33
+ ◆ From-draft mode: using {path} as milestone definition (skipping goal interview)
34
+ ```
35
+
36
+ This mode exists to skip expensive re-derivation when a human or prior agent has already drafted the milestone scope.
37
+
20
38
  ## 1. Parse arguments and load context
21
39
 
22
40
  Parse `$ARGUMENTS` before anything else:
@@ -27,20 +45,14 @@ Parse `$ARGUMENTS` before anything else:
27
45
 
28
46
  If `--from-draft` is absent, continue phase numbering from the previous milestone.
29
47
 
30
- **From-draft mode:**
48
+ **From-draft mode (see dedicated section above):**
31
49
 
32
50
  When `FROM_DRAFT_MODE=true`:
33
51
  1. Read the draft file at `DRAFT_FILE`. Accept any markdown file — MILESTONE-CONTEXT.md, a scratch doc, or a ROADMAP partial.
34
52
  2. Extract milestone name (first `# Heading` or the filename stem), goals list, and any explicit phase list.
35
53
  3. Skip the interactive goal-gathering interview (steps 2–4). Jump directly to step 5 (Requirements scoping) using the draft as the source of truth.
36
- 4. Surface a one-line banner:
37
- ```
38
- ◆ From-draft mode: using {DRAFT_FILE} as milestone definition (skipping goal interview)
39
- ```
40
- 5. If `DRAFT_FILE` does not exist, abort:
41
- ```
42
- Error: --from-draft file not found: {DRAFT_FILE}
43
- ```
54
+ 4. Surface the one-line banner (see `## --from-draft mode` above).
55
+ 5. If `DRAFT_FILE` does not exist, abort (see `## --from-draft mode` above).
44
56
 
45
57
  Read these files in parallel:
46
58
  - `.planning/PROJECT.md` — existing project, validated requirements, decisions
@@ -41,6 +41,8 @@ Create roadmap:
41
41
  6. Return ROADMAP CREATED with summary
42
42
 
43
43
  Write files first, then return. This ensures artifacts persist even if context is lost.
44
+
45
+ **Scope constraint:** rcode-roadmapper creates ONLY: ROADMAP.md, STATE.md, and one PHASE.md per phase directory (if requested). It MUST NOT create SPRINT.md, PLAN.md, or any sprint-level planning files. Sprint planning is handled exclusively by `/rcode-plan`. If you find yourself about to write a SPRINT.md file, STOP — that file is out of scope for this agent.
44
46
  </instructions>
45
47
  ", subagent_type="rcode-roadmapper", model="${ROADMAPPER_MODEL}", description="Create roadmap")
46
48
  ```
@@ -199,6 +199,8 @@ Create roadmap:
199
199
  6. Return ROADMAP CREATED with summary
200
200
 
201
201
  Write files first, then return. This ensures artifacts persist even if context is lost.
202
+
203
+ **Scope constraint:** rcode-roadmapper creates ONLY: ROADMAP.md, STATE.md, and one PHASE.md per phase directory (if requested). It MUST NOT create SPRINT.md, PLAN.md, or any sprint-level planning files. Sprint planning is handled exclusively by `/rcode-plan`. If you find yourself about to write a SPRINT.md file, STOP — that file is out of scope for this agent.
202
204
  </instructions>
203
205
  ", subagent_type="rcode-roadmapper", model="{roadmapper_model}", description="Create roadmap")
204
206
  ```
@@ -885,6 +885,9 @@ Present completion summary:
885
885
  > (a) `.planning/ROADMAP.md` contains real `## Phase N` headings — open it and add them if the file is still a stub.
886
886
  > (b) Run `npx rcode state sync --from-disk` to populate `.rcode/state.json` with the phases array so downstream commands (`/rcode-plan`, `/rcode-execute-sprint`, etc.) can read the phase list.
887
887
 
888
+ **Next step — paste this to start planning:**
889
+ > /rcode-plan 1 — [Phase 1 Name from ROADMAP.md]
890
+
888
891
  **If auto mode:**
889
892
 
890
893
  ```
@@ -49,9 +49,9 @@ Read all files referenced by the invoking prompt's execution_context before star
49
49
  ${PHASE_GOAL_HAS_UI ? '@.rcode/references/ui-brand.md' : ''}
50
50
  @.rcode/references/revision-loop.md
51
51
  @.rcode/references/gate-prompts.md
52
- @.rcode/references/agent-contracts.md
53
- @.rcode/references/gates.md
54
52
  @.rcode/references/karpathy-guidelines.md
53
+ <!-- Read .rcode/references/agent-contracts.md only if defining or debugging agent contracts -->
54
+ <!-- Read .rcode/references/gates.md only if implementing or troubleshooting gate logic -->
55
55
  @.rcode/references/thinking-models-planning.md
56
56
  </required_reading>
57
57
 
@@ -64,6 +64,16 @@ Valid rcode subagent types (use exact names — do not fall back to 'general-pur
64
64
 
65
65
  <process>
66
66
 
67
+ ## --from-stub mode
68
+
69
+ When `--from-stub` is passed:
70
+ 1. Check for existing `PLAN.md` in the phase directory
71
+ 2. If found: read it as the planning skeleton — do NOT re-derive phase goals or re-research the phase
72
+ 3. Expand the stub into full SPRINT.md files using the stories already listed in PLAN.md
73
+ 4. If no PLAN.md exists: fall back to standard planning mode (derive from ROADMAP + RESEARCH.md)
74
+
75
+ This mode exists to skip expensive re-derivation when a human or prior agent has already produced a planning skeleton.
76
+
67
77
  ## 0. Project-Status Preflight
68
78
 
69
79
  ```bash
@@ -1023,6 +1033,9 @@ Verification: {Passed | Passed with override | Skipped}
1023
1033
 
1024
1034
  /rcode-execute {X} ${RCODE_WS}
1025
1035
 
1036
+ **Next step — paste this to execute:**
1037
+ > /rcode-execute {X}
1038
+
1026
1039
  ───────────────────────────────────────────────────────────────
1027
1040
 
1028
1041
  **Also available:**