@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
package/CONTRIBUTING.md CHANGED
@@ -521,7 +521,7 @@ only surface at install time.
521
521
  ### For dashboard changes
522
522
  1. `node server/dashboard.js` starts cleanly
523
523
  2. Visit `http://localhost:7717` — all sections render
524
- 3. Stop with `kill $(lsof -t -i:7717)`
524
+ 3. Stop with `kill $(ss -ltnp 'sport = :7717' | awk 'NR>1{match($6,/pid=([0-9]+)/,m); print m[1]}')`
525
525
 
526
526
  ### For new workflows
527
527
  1. Read the workflow instructions end-to-end as if executing it
package/README.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  <div dir="rtl">طريقة رحال</div>
4
4
 
5
- <p align="center"><img src="brand/hero-receipt.png" alt="rcode benchmark output: 497 tests, 0 failing · 45 agents, 116 commands · 1 runtime dependency" width="760"></p>
5
+ <p align="center"><img src="brand/dashboard-tour.gif" alt="rcode Diwan dashboard tour — cycling through the project cockpit (progress donut, current phase executing, milestone outlook), the specialist agent roster, the Kanban board (TODO / in-progress / done), and the phase-driven delivery view" width="860"></p>
6
6
 
7
- ### 497 tests. Zero failing. Read the script.
7
+ ### An engineering org in a folder — and you can watch it work.
8
8
 
9
- *An engineering org in a folderand every number below is reproducible with one command (`node benchmarks/facts.cjs`). Marketing rounds up; this repo ships the receipts.*
9
+ *A roster of specialist agents, phase-driven delivery, and a persistent Memory Bank running as plain files your IDE reads. Every number is reproducible with one command (`node benchmarks/facts.cjs`); marketing rounds up, this repo ships the receipts: **497 tests, 0 failing · 45 agents · 116 commands · 1 runtime dependency**.*
10
+
11
+ <p align="center"><img src="brand/dashboard-team.png" alt="rcode agent roster grouped by function — Leadership (Sadiq / strategy, Waleed / CTO, Ahmed / delivery, Nasser / eng manager), Engineering (Omar, Haitham / frontend, Yousef / backend, Zayd / ML, Khalid / DevOps), Product (Hussain / PM, Mariam / marketing), each card showing its role and tools" width="860"></p>
12
+
13
+ <p align="center"><sub>The <a href="docs/install.md">Diwan dashboard</a> (view-only, <code>node server/dashboard.js</code>) — your project's phases, sprints, agents, decisions, and live orchestration, read straight from the files in <code>.rcode/</code>.</sub></p>
10
14
 
11
15
  > **A curated composition of the best AI-development practices — shipped as files.** Surgical-change discipline, parallel-agent orchestration, persistent Memory Bank patterns, phase-driven planning — packaged as one workflow for Claude Code power users. No multi-agent harness. No vector DB. Your IDE keeps the methodology; the project keeps the memory.
12
16
 
@@ -123,6 +127,8 @@ The point isn't "I beat LangChain." The point is **you don't need LangChain for
123
127
  > node benchmarks/facts.cjs
124
128
  > ```
125
129
 
130
+ <p align="center"><img src="brand/hero-receipt.png" alt="benchmarks/facts.cjs output — 497 tests, 0 failing · 45 agents · 116 commands · 1 runtime dependency, computed from files on disk" width="720"></p>
131
+
126
132
  | Metric | Value | Why it's not a vanity number |
127
133
  |---|---|---|
128
134
  | **Portable methodology corpus** | **94,481 lines** of markdown | A 10-person eng org's playbooks (agents + commands + workflows + skills + references) — as files you own and grep, not a SaaS you rent. |
@@ -146,7 +152,7 @@ pnpm dlx @hanzlaa/rcode install
146
152
  /rcode-init
147
153
  ```
148
154
 
149
- > **Don't have pnpm?** On Node 18+ / npm 11.x we recommend pnpm to avoid `npx` cache issues:
155
+ > **Don't have pnpm?** We recommend pnpm to avoid peer-dependency resolution issues on npm 11.x and `npx` cache issues:
150
156
  > `npm install -g pnpm`
151
157
 
152
158
  `/rcode-init` detects your project state (fresh / existing / returning) and routes to the right first action. For a greenfield project it auto-routes to `/rcode-new-project`.
package/cli/doctor.js CHANGED
@@ -67,10 +67,17 @@ function checkCompliance(filePath) {
67
67
  if (!/^## Examples/m.test(content)) missing.push('Examples');
68
68
 
69
69
  // Negative-boundary clause (component 1 of the 5-component standard).
70
- // Parse the frontmatter description so folded-block YAML is normalized
71
- // before the regex runs "Do\n NOT" becomes "Do NOT" after normalization.
70
+ // Three valid locations, checked in order:
71
+ // a) frontmatter `not-for:` array with at least one entry (canonical YAML form)
72
+ // b) a boundary phrase in the frontmatter `description` field
73
+ // c) a "## Do NOT use" heading or "do not use/include" in the body
74
+ // Bug #874: only (b) and (c) were checked, missing skills that use (a).
75
+ const notForField = frontmatter['not-for'];
76
+ const hasNotForField =
77
+ Array.isArray(notForField) && notForField.length > 0;
72
78
  const desc = typeof frontmatter.description === 'string' ? frontmatter.description : '';
73
79
  const hasBoundary =
80
+ hasNotForField ||
74
81
  NEGATIVE_BOUNDARY_RE.test(desc) ||
75
82
  /##[^\n]*\bnot\b/i.test(body) ||
76
83
  /\bdo not (use|include)\b/i.test(body);
@@ -188,7 +195,18 @@ function runPreflight(cwd, packageRoot) {
188
195
  // 6. Agent manifest drift (only if .rcode/ is initialized — indicates installed editors)
189
196
  if (fs.existsSync(rcodeDir)) {
190
197
  const editors = [];
191
- if (fs.existsSync(path.join(cwd, '.claude/skills'))) editors.push('claude');
198
+ // Detect Claude install via flat .claude/commands/rcode-*.md (installer writes
199
+ // slash commands flat, not under a subdirectory) or .claude/skills as a fallback
200
+ // for legacy layouts. Bug #873: checking only .claude/skills missed fresh installs.
201
+ const claudeCommandsDir = path.join(cwd, '.claude/commands');
202
+ const hasClaudeFlatCommands =
203
+ fs.existsSync(claudeCommandsDir) &&
204
+ fs.readdirSync(claudeCommandsDir).some(
205
+ (f) => f.startsWith('rcode-') && f.endsWith('.md'),
206
+ );
207
+ if (hasClaudeFlatCommands || fs.existsSync(path.join(cwd, '.claude/skills'))) {
208
+ editors.push('claude');
209
+ }
192
210
  if (fs.existsSync(path.join(cwd, '.cursor/rules'))) editors.push('cursor');
193
211
  if (fs.existsSync(path.join(cwd, '.windsurf/rules'))) editors.push('windsurf');
194
212
  if (fs.existsSync(path.join(cwd, '.antigravity/agents'))) editors.push('antigravity');
package/cli/index.js CHANGED
@@ -64,6 +64,10 @@ Usage:
64
64
  init Alias for install
65
65
  update Refresh skill files (backs up .rcode/ state first)
66
66
  uninstall Remove rcode from the current project
67
+ --yes Skip confirmation prompts
68
+ --purge Remove everything: .rcode/ state, .planning/ scaffolds,
69
+ .claude/agents/rules/, .cursor/ rcode files,
70
+ .gitignore block, and .git/hooks/pre-commit
67
71
  remove Alias for uninstall
68
72
  nuke Wipe ALL rcode/rcode installs everywhere (global packages,
69
73
  binaries, ~/.claude/* rcode artifacts, ~/.rcode/, project artifacts)
@@ -116,7 +120,7 @@ Getting started:
116
120
  rcode tiers # see the Golden Path
117
121
  rcode set-profile # choose model profile (quality | balanced | budget)
118
122
 
119
- Documentation: https://github.com/hanzlahabib/rihal-code
123
+ Documentation: https://github.com/hanzlahabib/rcode
120
124
  `.trim());
121
125
  }
122
126
 
package/cli/install.js CHANGED
@@ -370,7 +370,7 @@ function printInstallHeader(targetVersion) {
370
370
  pc.cyan('│') + ' ' + dim('A persistent context-brain for your editor') + ' ' + pc.cyan('│'),
371
371
  pc.cyan('│') + ' ' + pc.cyan('│'),
372
372
  pc.cyan('│') + ' ' + dim('version ') + pc.green('v' + v) + ' ' + pc.cyan('│'),
373
- pc.cyan('│') + ' ' + dim('docs ') + 'github.com/hanzlahabib/rihal-code ' + pc.cyan('│'),
373
+ pc.cyan('│') + ' ' + dim('docs ') + 'github.com/hanzlahabib/rcode ' + pc.cyan('│'),
374
374
  pc.cyan('│') + ' ' + dim('by ') + 'Hanzla Habib' + ' ' + pc.cyan('│'),
375
375
  pc.cyan('│') + ' ' + pc.cyan('│'),
376
376
  pc.cyan('╰───────────────────────────────────────────────────────────╯'),
@@ -726,7 +726,7 @@ function seedStarterPlanning(target, projectName) {
726
726
  // planning artifacts. See issues #670 #671 #676.
727
727
  const STUB_BANNER =
728
728
  `<!-- INSTALL STUB — overwritten by /rcode-new-project. Delete this file or run\n` +
729
- ` /rcode-new-project before committing. See https://github.com/hanzlahabib/rihal-code/issues/670 -->\n\n`;
729
+ ` /rcode-new-project before committing. See https://github.com/hanzlahabib/rcode/issues/670 -->\n\n`;
730
730
 
731
731
  fs.writeFileSync(projectPath,
732
732
  STUB_BANNER +
@@ -134,7 +134,7 @@ More:
134
134
  rcode help # all commands (grouped)
135
135
  rcode dashboard # view-only Diwan on :7717
136
136
 
137
- Docs: https://github.com/hanzlahabib/rihal-code
137
+ Docs: https://github.com/hanzlahabib/rcode
138
138
  `);
139
139
  }
140
140
 
package/cli/uninstall.js CHANGED
@@ -949,17 +949,59 @@ async function runUninstall(args) {
949
949
  // Notice about what was intentionally preserved (#876 — never delete user data silently)
950
950
  const rcodeStillExists = plan.stateDir && fs.existsSync(path.join(cwd, '.rcode'));
951
951
  const planningStillExists = !opts.purge && fs.existsSync(path.join(cwd, '.planning'));
952
- if (rcodeStillExists || planningStillExists) {
952
+ const agentsRulesStillExists = !opts.purge && fs.existsSync(path.join(cwd, '.claude/agents/rules'));
953
+ // Only flag .cursor/ as residue if rcode files are still inside it — the dir
954
+ // may exist for unrelated Cursor user config that was never touched by rcode.
955
+ const cursorStillExists = !opts.purge && (() => {
956
+ const rulesDir = path.join(cwd, '.cursor/rules');
957
+ if (!fs.existsSync(rulesDir)) return false;
958
+ try {
959
+ return fs.readdirSync(rulesDir).some(
960
+ (f) => f.startsWith('rcode-') || f === 'rcode.mdc' || f === 'rcode-method.mdc' || f === 'rcode',
961
+ );
962
+ } catch { return false; }
963
+ })();
964
+ const gitignoreBlockStillExists = !opts.purge && (() => {
965
+ try {
966
+ const gi = path.join(cwd, '.gitignore');
967
+ if (!fs.existsSync(gi)) return false;
968
+ const txt = fs.readFileSync(gi, 'utf8');
969
+ return txt.includes('# ===== rcode-managed gitignore block') || txt.includes('# >>> rcode >>>');
970
+ } catch { return false; }
971
+ })();
972
+ // Only flag pre-commit as residue if the rcode block is still present inside
973
+ // it — the hook file may exist for user-written scripts unrelated to rcode.
974
+ const preCommitStillExists = !opts.purge && (() => {
975
+ const hookPath = path.join(cwd, '.git/hooks/pre-commit');
976
+ if (!fs.existsSync(hookPath)) return false;
977
+ try {
978
+ return fs.readFileSync(hookPath, 'utf8').includes('# ===== rcode-managed pre-commit block =====');
979
+ } catch { return false; }
980
+ })();
981
+
982
+ if (rcodeStillExists || planningStillExists || agentsRulesStillExists || cursorStillExists || gitignoreBlockStillExists || preCommitStillExists) {
953
983
  console.log();
954
- console.log(`ℹ Preserved (your project data not removed by default):`);
984
+ console.log(`ℹ Preserved (use --purge to remove all of these):`);
955
985
  if (rcodeStillExists) {
956
- console.log(` .rcode/ phases, decisions, progress, config`);
957
- console.log(` /rcode-init will detect this on reinstall`);
986
+ console.log(` .rcode/ project state, config, decisions`);
958
987
  }
959
988
  if (planningStillExists) {
960
- console.log(` .planning/ planning scaffolds (ROADMAP, STATE, PROJECT)`);
989
+ console.log(` .planning/ ROADMAP, STATE, PROJECT scaffolds`);
961
990
  }
962
- console.log(` To remove these on next uninstall: rcode uninstall --purge`);
991
+ if (agentsRulesStillExists) {
992
+ console.log(` .claude/agents/rules/ agent rule files`);
993
+ }
994
+ if (cursorStillExists) {
995
+ console.log(` .cursor/ Cursor IDE integration`);
996
+ }
997
+ if (gitignoreBlockStillExists) {
998
+ console.log(` .gitignore rcode-managed block still present`);
999
+ }
1000
+ if (preCommitStillExists) {
1001
+ console.log(` .git/hooks/ pre-commit hook still present`);
1002
+ }
1003
+ console.log();
1004
+ console.log(` Full cleanup: rcode uninstall --purge`);
963
1005
  }
964
1006
 
965
1007
  // IDE cache reload hint — Claude Code caches the slash-command list in memory.