@hanzlaa/rcode 4.3.2 → 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 (130) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +2 -1
  3. package/README.md +45 -10
  4. package/cli/doctor.js +21 -3
  5. package/cli/index.js +5 -1
  6. package/cli/install.js +16 -2
  7. package/cli/postinstall.js +1 -1
  8. package/cli/uninstall.js +48 -6
  9. package/dist/rcode.js +178 -174
  10. package/package.json +12 -22
  11. package/rcode/agents/rcode-codebase-mapper.md +12 -0
  12. package/rcode/agents/rcode-phase-researcher.md +13 -0
  13. package/rcode/agents/rcode-project-researcher.md +32 -0
  14. package/rcode/agents/rcode-roadmapper.md +15 -0
  15. package/rcode/agents/rules/planner/common-patterns.md +40 -0
  16. package/rcode/bin/lib/roadmap.cjs +184 -11
  17. package/rcode/bin/rcode-hooks.cjs +303 -14
  18. package/rcode/bin/rcode-tools.cjs +669 -55
  19. package/rcode/commands/lens-audit.md +8 -6
  20. package/rcode/data/intent-table.json +87 -0
  21. package/rcode/modules/seo.yaml +22 -0
  22. package/rcode/references/project-types.yaml +75 -0
  23. package/rcode/skills/SKILLS_INDEX.md +20 -2
  24. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/SKILL.md +16 -21
  25. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/rules/backlog-building.md +13 -0
  26. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/rules/merge-strategy.md +17 -0
  27. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/rules/orchestrator-rhythm.md +9 -0
  28. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/rules/wave-design.md +21 -0
  29. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/heartbeat.sh +0 -0
  30. package/rcode/skills/actions/4-implementation/rcode-scaffold-project/SKILL.md +60 -1
  31. package/rcode/skills/core/rcode-lazy/SKILL.md +149 -0
  32. package/rcode/skills/seo/module.yaml +20 -0
  33. package/rcode/skills/seo/on-page-seo-auditor/SKILL.md +308 -0
  34. package/rcode/skills/seo/on-page-seo-auditor/references/audit-example.md +109 -0
  35. package/rcode/skills/seo/on-page-seo-auditor/references/audit-templates.md +427 -0
  36. package/rcode/skills/seo/on-page-seo-auditor/references/bulk-audit-playbook.md +116 -0
  37. package/rcode/skills/seo/on-page-seo-auditor/references/scoring-rubric.md +525 -0
  38. package/rcode/skills/seo/rank-and-rent-local-seo/SKILL.md +94 -0
  39. package/rcode/skills/seo/rank-and-rent-local-seo/rules/city-matrix-and-pages.md +76 -0
  40. package/rcode/skills/seo/rank-and-rent-local-seo/rules/monetization.md +70 -0
  41. package/rcode/skills/seo/rank-and-rent-local-seo/rules/niche-selection.md +60 -0
  42. package/rcode/skills/seo/rank-and-rent-local-seo/rules/subniche-discovery.md +66 -0
  43. package/rcode/skills/seo/rank-and-rent-local-seo/templates/service-city-page.md +36 -0
  44. package/rcode/skills/seo/rank-and-rent-local-seo/templates/subniche-research-prompt.md +34 -0
  45. package/rcode/skills/seo/seo-audit/SKILL.md +412 -0
  46. package/rcode/skills/seo/seo-audit/evals/evals.json +136 -0
  47. package/rcode/skills/seo/seo-audit/references/ai-writing-detection.md +200 -0
  48. package/rcode/skills/seo/seo-content-factory/SKILL.md +130 -0
  49. package/rcode/skills/seo/seo-content-factory/rules/agents.md +80 -0
  50. package/rcode/skills/seo/seo-content-factory/rules/herdr-wave-mapping.md +80 -0
  51. package/rcode/skills/seo/seo-content-factory/rules/pipeline.md +102 -0
  52. package/rcode/skills/seo/seo-content-factory/rules/programmatic-pages.md +107 -0
  53. package/rcode/skills/seo/seo-content-factory/rules/quality-gates.md +68 -0
  54. package/rcode/skills/seo/seo-content-factory/rules/weekly-cadence.md +61 -0
  55. package/rcode/skills/seo/seo-content-factory/templates/BACKLOG.md +23 -0
  56. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/01-funnel-A1-A4.md +63 -0
  57. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/02-fanout-editorial-A5-A6-A8.md +28 -0
  58. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/03-fanout-programmatic-A7-A6-A8.md +25 -0
  59. package/rcode/skills/seo/seo-content-factory/templates/agent-prompts/04-loop-A9-A10.md +34 -0
  60. package/rcode/skills/seo/seo-content-factory/templates/article.mdx +39 -0
  61. package/rcode/skills/seo/seo-content-factory/templates/cluster.schema.json +52 -0
  62. package/rcode/skills/seo/seo-content-factory/templates/content-brief.md +51 -0
  63. package/rcode/skills/seo/seo-content-factory/templates/jsonld-builders.ts +49 -0
  64. package/rcode/skills/seo/seo-content-factory/templates/keywords.csv +13 -0
  65. package/rcode/skills/seo/seo-content-factory/templates/programmatic-page.tsx +58 -0
  66. package/rcode/skills/seo/seo-content-writer/SKILL.md +263 -0
  67. package/rcode/skills/seo/seo-content-writer/references/content-structure-templates.md +875 -0
  68. package/rcode/skills/seo/seo-content-writer/references/instructions-detail.md +239 -0
  69. package/rcode/skills/seo/seo-content-writer/references/seo-writing-checklist.md +250 -0
  70. package/rcode/skills/seo/seo-content-writer/references/title-formulas.md +339 -0
  71. package/rcode/skills/seo/seo-growth-orchestrator/SKILL.md +79 -0
  72. package/rcode/skills/seo/seo-growth-orchestrator/rules/backlinks.md +29 -0
  73. package/rcode/skills/seo/seo-growth-orchestrator/rules/content-engine.md +27 -0
  74. package/rcode/skills/seo/seo-growth-orchestrator/rules/dos-and-donts.md +40 -0
  75. package/rcode/skills/seo/seo-growth-orchestrator/rules/goals-protocol.md +34 -0
  76. package/rcode/skills/seo/seo-growth-orchestrator/rules/local-seo-stack.md +35 -0
  77. package/rcode/skills/seo/seo-growth-orchestrator/rules/mrr-sprint.md +27 -0
  78. package/rcode/skills/seo/seo-growth-orchestrator/rules/tools.md +19 -0
  79. package/rcode/skills/seo/seo-growth-orchestrator/templates/backlink-research.md +29 -0
  80. package/rcode/skills/seo/seo-growth-orchestrator/templates/goal-protocol.md +35 -0
  81. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-citations.md +24 -0
  82. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-city-pages.md +27 -0
  83. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-gbp-categories.md +23 -0
  84. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-gsc-goldmine.md +27 -0
  85. package/rcode/skills/seo/seo-growth-orchestrator/templates/local-review-mining.md +26 -0
  86. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-30day-plan.md +19 -0
  87. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-cut.md +13 -0
  88. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-opportunity-finder.md +17 -0
  89. package/rcode/skills/seo/seo-growth-orchestrator/templates/mrr-role-model.md +18 -0
  90. package/rcode/skills/seo/seo-site-builder/SKILL.md +149 -0
  91. package/rcode/skills/seo/seo-site-builder/rules/01-niche-discovery.md +64 -0
  92. package/rcode/skills/seo/seo-site-builder/rules/02-deep-research.md +164 -0
  93. package/rcode/skills/seo/seo-site-builder/rules/03-keyword-strategy.md +82 -0
  94. package/rcode/skills/seo/seo-site-builder/rules/04-content-plan.md +173 -0
  95. package/rcode/skills/seo/seo-site-builder/rules/05-site-build.md +187 -0
  96. package/rcode/skills/seo/seo-site-builder/rules/06-yolo.md +127 -0
  97. package/rcode/skills/seo/seo-site-builder/templates/article-stub.mdx +62 -0
  98. package/rcode/skills/seo/seo-site-builder/templates/image-prompt.md +97 -0
  99. package/rcode/skills/seo/seo-site-builder/templates/keyword-export.md +45 -0
  100. package/rcode/skills/seo/seo-site-builder/templates/niche-scorecard.md +28 -0
  101. package/rcode/skills/seo/technical-seo-checker/SKILL.md +329 -0
  102. package/rcode/skills/seo/technical-seo-checker/references/bulk-audit-playbook.md +118 -0
  103. package/rcode/skills/seo/technical-seo-checker/references/ecommerce-platform-patterns.md +166 -0
  104. package/rcode/skills/seo/technical-seo-checker/references/http-status-codes.md +705 -0
  105. package/rcode/skills/seo/technical-seo-checker/references/llm-crawler-handling.md +257 -0
  106. package/rcode/skills/seo/technical-seo-checker/references/pre-migration-playbook.md +137 -0
  107. package/rcode/skills/seo/technical-seo-checker/references/robots-txt-reference.md +717 -0
  108. package/rcode/skills/seo/technical-seo-checker/references/technical-audit-example.md +169 -0
  109. package/rcode/skills/seo/technical-seo-checker/references/technical-audit-templates.md +436 -0
  110. package/rcode/templates/settings-hooks.json +16 -1
  111. package/rcode/workflows/do.md +17 -0
  112. package/rcode/workflows/enable-hooks.md +3 -2
  113. package/rcode/workflows/execute-sprint.md +22 -0
  114. package/rcode/workflows/execute.md +17 -3
  115. package/rcode/workflows/lens-audit.md +49 -8
  116. package/rcode/workflows/new-milestone.md +21 -9
  117. package/rcode/workflows/new-project-create-roadmap.md +2 -0
  118. package/rcode/workflows/new-project-roadmap.md +2 -0
  119. package/rcode/workflows/new-project.md +3 -0
  120. package/rcode/workflows/plan.md +15 -2
  121. package/server/dashboard.js +6 -2
  122. package/server/lib/api.js +35 -20
  123. package/server/lib/html/client/components/OrchPanel.js +43 -2
  124. package/server/lib/html/client/components/dashboard/InProgress.js +5 -4
  125. package/server/lib/html/client/components/shared.js +14 -0
  126. package/server/lib/html/client/orchestrator.js +13 -0
  127. package/server/lib/html/client/views/KanbanView.js +33 -4
  128. package/server/lib/html/css.js +57 -3
  129. package/server/lib/scanner.js +40 -4
  130. package/server/orchestrator.js +42 -0
@@ -12,22 +12,24 @@ triggers:
12
12
  - run performance lens
13
13
  - run testability lens
14
14
  - run all lenses
15
- - 15 lens audit
15
+ - 16 lens audit
16
+ - yagni lens
17
+ - over-engineering audit
16
18
  not-for:
17
19
  - phase audit (use /rcode-audit phase)
18
20
  - milestone audit (use /rcode-audit milestone)
19
21
  - karpathy audit without lens context (use /rcode-review --karpathy)
20
- description: Run a structured 15-lens code audit. Picks one lens or all 15 sequentially. Prints findings and ready-to-paste GitHub issue bodies. Never auto-fixes — audit-first.
21
- argument-hint: "[<1-15> | <lens-name> | all]"
22
+ description: Run a structured 16-lens code audit. Picks one lens or all 16 sequentially. Prints findings and ready-to-paste GitHub issue bodies. Never auto-fixes — audit-first.
23
+ argument-hint: "[<1-16> | <lens-name> | all]"
22
24
  allowed-tools: Read, Write, Bash, AskUserQuestion
23
25
  ---
24
26
 
25
27
  ## Overview
26
28
 
27
- 15-lens audit entry point. Each lens is an independent inspection angle:
29
+ 16-lens audit entry point. Each lens is an independent inspection angle:
28
30
  security, performance, testability, extensibility, dep-health, error-recovery,
29
31
  state-machine, i18n, documentation, cross-platform, karpathy, sxo,
30
- observability, naming, coverage.
32
+ observability, naming, coverage, yagni.
31
33
 
32
34
  Runs the selected lens(es), prints labelled findings, outputs GH issue bodies
33
35
  for each lens with findings. Never modifies files — audit-first, fix-second.
@@ -66,5 +68,5 @@ foldable GitHub issue bodies ready to copy-paste or pipe to `gh issue create`.
66
68
  **Negative — wrong lens number:**
67
69
  ```
68
70
  /rcode-lens-audit 99
69
- → Error: lens must be 1-15 or a lens name. Run /rcode-lens-audit --help.
71
+ → Error: lens must be 1-16 or a lens name. Run /rcode-lens-audit --help.
70
72
  ```
@@ -0,0 +1,87 @@
1
+ [
2
+ {
3
+ "intent": "new-project",
4
+ "keywords": ["set up a new project", "initialize a new project", "start a new project", "create a new project"],
5
+ "command": "/rcode-new-project"
6
+ },
7
+ {
8
+ "intent": "map-codebase",
9
+ "keywords": ["map the codebase", "map this codebase", "analyze the codebase", "analyse the codebase", "map existing codebase"],
10
+ "command": "/rcode-map-codebase"
11
+ },
12
+ {
13
+ "intent": "debug",
14
+ "keywords": ["bug", "getting an error", "throwing an error", "error in the", "fix the error", "debug this", "crash", "failure", "broken", "not working", "fails", "exception", "traceback"],
15
+ "command": "/rcode-debug"
16
+ },
17
+ {
18
+ "intent": "audit-karpathy",
19
+ "keywords": ["audit", "review changes", "check my diff", "karpathy", "too complex", "complexity", "code review"],
20
+ "command": "/rcode-review --karpathy"
21
+ },
22
+ {
23
+ "intent": "lazy",
24
+ "keywords": ["be lazy", "lazy mode", "simplest solution", "yagni", "over-engineered", "over-engineering", "kam code likho"],
25
+ "command": "/rcode-lazy"
26
+ },
27
+ {
28
+ "intent": "checkpoint",
29
+ "keywords": ["checkpoint", "explain this diff", "human review", "walk through the change", "walk through this change"],
30
+ "command": "/rcode-checkpoint-preview"
31
+ },
32
+ {
33
+ "intent": "brainstorm",
34
+ "keywords": ["brainstorm", "generate ideas", "explore options", "what could we do", "ideate", "ideas for"],
35
+ "command": "/rcode-brainstorm"
36
+ },
37
+ {
38
+ "intent": "explore",
39
+ "keywords": ["explore", "research phase", "do some research", "comparing", "investigate", "look into", "understand how"],
40
+ "command": "/rcode-research-phase"
41
+ },
42
+ {
43
+ "intent": "discuss",
44
+ "keywords": ["which one", "better ux", "how should", "still have confusion", "conflicting", "discuss the scope", "design this", "architect this"],
45
+ "command": "/rcode-discuss-phase"
46
+ },
47
+ {
48
+ "intent": "add-phase",
49
+ "keywords": ["refactor", "migration", "multi-file", "system redesign", "multi file", "large refactor", "architectural", "integration", "integrate"],
50
+ "command": "/rcode-add-phase"
51
+ },
52
+ {
53
+ "intent": "sprint-planning",
54
+ "keywords": ["sprint planning", "plan the sprint", "next sprint", "what's in this sprint"],
55
+ "command": "/rcode-sprint-planning"
56
+ },
57
+ {
58
+ "intent": "execute-sprint",
59
+ "keywords": ["run the sprint", "start sprint", "execute sprint", "work on sprint"],
60
+ "command": "/rcode-execute-sprint"
61
+ },
62
+ {
63
+ "intent": "plan",
64
+ "keywords": ["let's plan", "plan phase", "plan this", "let me plan", "planning phase", "create a plan", "please plan", "plan and think", "scope this", "scope the feature"],
65
+ "command": "/rcode-plan"
66
+ },
67
+ {
68
+ "intent": "new-milestone",
69
+ "keywords": ["create milestones", "plan milestones", "create roadmap", "break project into milestones", "new milestone", "what milestones"],
70
+ "command": "/rcode-new-milestone"
71
+ },
72
+ {
73
+ "intent": "epics-stories",
74
+ "keywords": ["create epics", "user stories", "create stories", "epics and stories", "break into epics"],
75
+ "command": "/rcode-create-epics-and-stories"
76
+ },
77
+ {
78
+ "intent": "feature-drift",
79
+ "keywords": ["out of date", "out-of-date", "verify docs", "audit feature docs", "fill out existing", "prd drift", "docs vs code"],
80
+ "command": "/rcode-feature-drift"
81
+ },
82
+ {
83
+ "intent": "audit",
84
+ "keywords": ["re-audit", "extend the audit", "fill out the", "expand the", "re audit"],
85
+ "command": "/rcode-audit"
86
+ }
87
+ ]
@@ -0,0 +1,22 @@
1
+ name: seo
2
+ version: "1.0"
3
+ description: "Full-spectrum SEO skills — content factory, growth orchestrator, audits, writer, site builder, local SEO, on-page and technical auditors"
4
+ requires:
5
+ - core
6
+ agents: []
7
+ workflows: []
8
+ commands:
9
+ - seo-content-factory
10
+ - seo-growth-orchestrator
11
+ - seo-audit
12
+ - on-page-seo-auditor
13
+ - technical-seo-checker
14
+ - seo-content-writer
15
+ - seo-site-builder
16
+ - rank-and-rent-local-seo
17
+ references:
18
+ # claude-seo plugin agents — NOT bundled. Install separately: npx @hanzlaa/claude-seo install
19
+ # Routing rules in do.md reference: seo-cluster, seo-programmatic, seo-schema, seo-geo,
20
+ # seo-local, seo-sxo, seo-technical, seo-content, seo-backlinks, seo-ecommerce,
21
+ # seo-maps, seo-page, seo-performance, seo-sitemap, seo-drift, seo-dataforseo
22
+ - claude-seo-plugin-agents.md
@@ -268,3 +268,78 @@ dev-tool:
268
268
  - "What are the minimum dependency versions?"
269
269
  - "How will developers discover and install this?"
270
270
  - "Do you need a community or plugin ecosystem?"
271
+
272
+ content-site:
273
+ display_name: "Content / SEO / Programmatic Site"
274
+ signals:
275
+ - rank-and-rent
276
+ - lead-gen
277
+ - lead gen
278
+ - landing pages
279
+ - programmatic seo
280
+ - programmatic pages
281
+ - service pages
282
+ - location pages
283
+ - content site
284
+ - seo site
285
+ - affiliate site
286
+ - affiliate
287
+ - local seo
288
+ - content farm
289
+ - niche site
290
+ - rank and rent
291
+ - local lead gen
292
+ - city pages
293
+ - service area pages
294
+ - editorial site
295
+ - blog site
296
+ - publisher
297
+ - content marketing
298
+ - link building
299
+ - backlink
300
+ - keyword research
301
+ - keyword cluster
302
+ - topic cluster
303
+ - E-E-A-T
304
+ - google business profile
305
+ - gbp
306
+ - citations
307
+ - nap audit
308
+ - schema markup
309
+ - structured data
310
+ - rich results
311
+ - AI overview
312
+ - AI search
313
+ - GEO SEO
314
+ - llms.txt
315
+ - programmatic seo site
316
+ - doorway page
317
+ - thin content
318
+ - content refresh
319
+ - crawl budget
320
+ - indexation
321
+ - core web vitals
322
+ - technical seo
323
+ - on-page seo
324
+ - digital pr
325
+ - guest posts
326
+ - seo content
327
+ - content strategy
328
+ - topical authority
329
+ required_sections:
330
+ - keyword-strategy
331
+ - programmatic-page-matrix
332
+ - internal-link-plan
333
+ - schema-plan
334
+ - content-quality-gates
335
+ skip_sections:
336
+ - authentication
337
+ - state-management
338
+ - authorization
339
+ discovery_questions:
340
+ - "What are your 3–5 primary target keywords (and their search intent)?"
341
+ - "What is the programmatic page matrix? (e.g. 50 services × 20 cities = 1,000 pages, or editorial only)"
342
+ - "Who are your top 3 organic competitors? (needed for cluster gap analysis)"
343
+ - "Do you have Google Search Console / analytics access for this domain?"
344
+ - "What is your content quality gate — minimum word count, E-E-A-T signals, author attribution?"
345
+ - "What schema types are needed? (LocalBusiness, FAQPage, BreadcrumbList, Product)"
@@ -1,6 +1,6 @@
1
1
  # rcode — Skills Index
2
2
 
3
- All 86 skills in rcode, organized by category: 23 agent skills, 38 action skills, 25 core skills, plus 2 shared modules.
3
+ All 87 skills in rcode, organized by category: 23 agent skills, 38 action skills, 26 core skills, plus 2 shared modules.
4
4
 
5
5
  ## Agent Skills (23)
6
6
 
@@ -88,11 +88,12 @@ Invoked by agents via the capabilities table in their SKILL.md. Organized by SDL
88
88
 
89
89
  ---
90
90
 
91
- ## Core Skills (25)
91
+ ## Core Skills (26)
92
92
 
93
93
  Shared utilities used across agents and workflows.
94
94
 
95
95
  - `core/rcode-init` — INTERNAL config loader (installs to .rcode/skills/, not .claude/skills/)
96
+ - `core/rcode-lazy` — always-on YAGNI/simplicity lens; prevents bloat before code is written (rcode-trim removes it after)
96
97
  - `core/rcode-help` — meta-help on available skills
97
98
  - `core/rcode-brainstorming` — structured brainstorming workflow
98
99
  - `core/rcode-advanced-elicitation` — advanced requirements elicitation
@@ -139,6 +140,23 @@ When a user picks capability `DS`, Claude invokes the `rcode-dev-story` skill.
139
140
 
140
141
  ---
141
142
 
143
+ ## SEO Module (8)
144
+
145
+ Full-spectrum SEO skills — content factory, growth orchestrator, audits, writer, site builder, local SEO, on-page and technical auditors.
146
+
147
+ | Skill | Path | Description |
148
+ |---|---|---|
149
+ | **seo-content-factory** | `rcode/skills/seo/seo-content-factory/` | Continuous organic-traffic growth via produced SEO pages; the production line for content-driven strategies |
150
+ | **seo-growth-orchestrator** | `rcode/skills/seo/seo-growth-orchestrator/` | Strategic SEO orchestrator across five plays: local, affiliate, technical, content-factory, and e-commerce |
151
+ | **seo-audit** | `rcode/skills/seo/seo-audit/` | Full-spectrum SEO audit covering on-page, technical, content, and backlink signals |
152
+ | **on-page-seo-auditor** | `rcode/skills/seo/on-page-seo-auditor/` | On-page analysis covering title tags, meta, headings, keyword integration, and CTR optimization |
153
+ | **technical-seo-checker** | `rcode/skills/seo/technical-seo-checker/` | Technical SEO audit covering crawlability, robots.txt, sitemaps, Core Web Vitals, and indexability |
154
+ | **seo-content-writer** | `rcode/skills/seo/seo-content-writer/` | SEO-optimized content writing with natural keyword integration and E-E-A-T quality signals |
155
+ | **seo-site-builder** | `rcode/skills/seo/seo-site-builder/` | End-to-end affiliate content site builder: niche discovery, keyword analysis, competitor intel, and site build |
156
+ | **rank-and-rent-local-seo** | `rcode/skills/seo/rank-and-rent-local-seo/` | Rank-and-rent local SEO business playbook: niche selection, long-tail targeting, multi-city expansion |
157
+
158
+ ---
159
+
142
160
  ## Licensing
143
161
 
144
162
  Free to use and adapt.
@@ -2,39 +2,22 @@
2
2
  name: rcode-herdr-orchestration
3
3
  description: Orchestrate parallel cld agents in herdr — fan-out or autonomous wave campaign.
4
4
  triggers:
5
- # English — single-shot orchestration
6
5
  - "orchestrate agents"
7
6
  - "run agents in herdr"
8
7
  - "parallel audit"
9
8
  - "spin up agents"
10
- - "use herdr to do"
11
- - "split work across panes"
12
9
  - "fan out work in herdr"
13
10
  - "multi-agent in herdr"
14
- # English — autonomous campaign mode
15
11
  - "autonomous fix campaign"
16
- - "auto mode"
17
- - "auto loop"
18
12
  - "run waves of agents"
19
- - "dispatch waves"
20
- - "100+ commits"
21
13
  - "keep working until done"
22
- - "complete site audit and fix"
23
- # Roman Urdu / Hindi
24
14
  - "herdr mein chalao"
25
- - "parallel agents lagao"
26
- - "panes mein todo"
27
- - "ek saath kai agents"
28
- - "auto mode chalao"
29
- - "waves mein fix karo"
30
- - "campaign chalao"
31
- # Arabic native
32
15
  - "شغّل وكلاء بالتوازي"
33
- - "وزّع العمل على عدة وكلاء"
34
- - "استخدم herdr"
35
16
  - "حملة إصلاح تلقائية"
36
- - "موجات من الوكلاء"
37
- - "وضع تلقائي"
17
+ not-for:
18
+ - single-agent or single-file tasks (run directly, no herdr overhead)
19
+ - interactive step-through work (use /rcode-execute --interactive)
20
+ - deployment or push operations (herdr only commits locally)
38
21
  user-invocable: true
39
22
  ---
40
23
 
@@ -74,6 +57,16 @@ independent agents.
74
57
 
75
58
  ---
76
59
 
60
+ ## Safety — blast radius of skip-permissions agents
61
+
62
+ Every orchestrated agent runs `cld` (= `claude --dangerously-skip-permissions`). There is **no human gate** on local destructive commands — an agent can `rm`, `git reset --hard`, overwrite files, or run any shell command without asking. So:
63
+
64
+ - **Scope each agent prompt to its own worktree + area only.** State the worktree path and branch explicitly, and tell the agent to stay inside it.
65
+ - **Worktree isolation is the only containment.** With permissions skipped, a per-agent git worktree is the single boundary that keeps one agent's mistakes from touching another's work or the main tree.
66
+ - **Never point an autonomous agent at a shared or important tree** (your main checkout, a production clone, anything you can't afford to lose). Always a throwaway worktree.
67
+
68
+ ---
69
+
77
70
  ## herdr CLI reference
78
71
 
79
72
  ```bash
@@ -118,6 +111,8 @@ Full Phase 0-3 protocol, integration-branch rules, wave cadence, and anti-patter
118
111
  in **`references.md`** (sibling file). Key constraints:
119
112
 
120
113
  - Maintain one `campaign-integration` branch; sub-agents fork from it, never master.
114
+ - Each wave agent reads `.planning/campaign/SHARED.md` first and appends a one-line claim
115
+ (`area — agent N — status`) so same-wave agents don't duplicate work.
121
116
  - Wave size: 3-5 agents, 10-15 min per wave. ScheduleWakeup ends EVERY turn.
122
117
  - Phase 3: show user the full diff + ask explicitly how to land (PR / merge / squash / leave).
123
118
  - Never push to origin master without an explicit yes — per campaign, not per session.
@@ -52,6 +52,19 @@ git commit -m "chore(campaign): backlog snapshot at wave <N>"
52
52
  ```
53
53
  The `-f` is required if `.planning/` is gitignored (common in Rihal projects).
54
54
 
55
+ ### Campaign retro (optional)
56
+ At campaign end, append a short `.planning/campaign/RETRO.md` so the *next* campaign on this repo starts smarter:
57
+ - Wave sizes actually used (and which felt right vs too big).
58
+ - What stalled — areas that needed re-dispatch, conflict hotspots, agents that went silent.
59
+ - What merged clean on the first pass.
60
+
61
+ ```bash
62
+ git add -f .planning/campaign/RETRO.md
63
+ git commit -m "chore(campaign): retro notes for next campaign"
64
+ ```
65
+
66
+ **YAGNI tension (be honest)**: this is speculative tooling — a second campaign on the same repo may never happen, and a RETRO doc no one reads is exactly the kind of over-engineering Lens 16 flags. Write it only when a follow-up campaign is genuinely likely; for a one-off campaign, skip it.
67
+
55
68
  ## Examples
56
69
 
57
70
  ### Building backlog from audit docs
@@ -27,6 +27,23 @@ fi
27
27
  ```
28
28
  **Never compound regressions across waves.**
29
29
 
30
+ ### Per-agent verification gate (beyond compile)
31
+ A passing TSC count proves the tree compiles — it does NOT prove the agent did the work it claimed. Before merging a branch, verify **inside the worktree**:
32
+
33
+ 1. **Task/audit doc exists and claims the work.** The agent's `.planning/audits/AUDIT-<area>.md` (or task doc) must exist and describe what it changed. No doc → no merge.
34
+ 2. **`pnpm test` (or the project test command) passes for the affected area.** Run the scoped suite, not just the type-checker.
35
+ 3. **Lint is clean or unchanged.** Run the project linter; a new lint regression blocks the merge the same way a TSC regression does.
36
+ 4. **The diff is non-trivial and on-topic.** `git diff campaign-integration..<branch> --stat` — an empty diff, a whitespace-only diff, or edits outside the agent's area mean the agent didn't actually do the work. Reject and re-dispatch.
37
+
38
+ Only after all four pass does the branch enter the smallest-first merge order.
39
+
40
+ ### Resolvable provenance
41
+ A wave is NOT "verified" until each claimed change has an **openable evidence reference** — a passing test name you can run, a diff hunk you can read, a real `file:line` you can open. A self-declared boolean (`verified: true`, `confidence: 0.94`) is not provenance; it's a claim about provenance.
42
+
43
+ **If provenance can't resolve, the gate FAILS** — treat the change as unverified and block the merge.
44
+
45
+ Failure mode to watch for: a verifier that stamps `"verified / 94% confidence"` while its citation layer actually renders `[object Object]` has verified *nothing*. The boolean looks green; the evidence underneath is broken. Always click through to the citation — if the reference doesn't open to the thing it claims, the verification is void regardless of the confidence number.
46
+
30
47
  ### Conflict resolution (delegates to herdr-orchestration)
31
48
  - Content conflicts: read both sides, keep the **more-complete superset side**, remove markers, syntax-check, stage, commit. (See herdr-orchestration rules.)
32
49
  - AA conflicts (add/add): peek both versions; if nearly identical, keep the canonical owner's version. The "owner" is the branch whose audit doc claimed the feature.
@@ -56,6 +56,9 @@ If the user picks (c) or skips: NEVER claim "Scheduling 20-min wakeup" in chat
56
56
  | Phase 3 (draining last waves) | 270s | Sub-agents finishing close to each other; don't miss the last |
57
57
  | Idle (waiting on stuck pane) | 1200s | Sub-agent stuck — give it room or surface it |
58
58
 
59
+ ### Cost ceiling — estimate before dispatch
60
+ Before dispatching a wave, the orchestrator estimates `agents × wave-duration` (and, across the campaign, the running sum of all waves) as a rough cost proxy. If a planned campaign exceeds a ceiling — by default **~20 agent-waves** or any explicit token/budget cap the user gave — the orchestrator STOPS and asks the user to confirm before continuing rather than burning budget silently. A 17-wave × 4-agent campaign is ~68 agent-runs; surface that number up front so the user can scope it down.
61
+
59
62
  ### Stop conditions
60
63
  The heartbeat should stop ONLY when ALL three are true:
61
64
  - Every herdr pane is `idle` or `done`
@@ -96,6 +99,12 @@ If the orchestrator hits auto-compact mid-campaign, the first turn after must:
96
99
 
97
100
  ## Anti-Patterns
98
101
 
102
+ ### Pane status is text-scraping — trust it loosely
103
+
104
+ **Problem**: `agent_status` (`working`/`blocked`/`idle`) is *inferred from the pane's visible text*, not a real process signal. A stuck agent — frozen mid-output, hung on a network call, or wedged in a loop — leaves its last tokens on screen and can read `working` indefinitely. A green `working` is not proof of progress.
105
+ **Rule (timeout heuristic, now mandatory)**: if a pane reads `working` for **25 min straight**, `herdr pane read <id>` and inspect the actual output. If there's no new progress since the last peek (no new commit, same last line), `C-c` the pane and re-dispatch the item in the next wave. Do not wait out a silently-dead agent on the strength of its status string.
106
+ **Optional reinforcement**: have each agent emit a heartbeat marker line periodically (e.g. `echo "[hb] wave-3 still alive $(date -u +%T)"`); then "no new `[hb]` line in N min" is a far more reliable stuck-signal than the scraped status.
107
+
99
108
  ### Polling every 60s
100
109
 
101
110
  **Problem**: Wakeup interval shorter than 270s burns the Anthropic prompt cache repeatedly without any real work happening (sub-agents need minutes between commits).
@@ -13,6 +13,13 @@ A campaign with too few agents underuses parallelism; too many causes merge conf
13
13
  - **Maximum: 5.** Above 5 the merge stage becomes painful and TSC regressions compound across simultaneous changes.
14
14
  - **Sequential or concurrent waves?** Concurrent only if you have >8 distinct unrelated areas AND the merge bookkeeping is automated. Default is sequential: dispatch wave → merge → dispatch wave.
15
15
 
16
+ ### Shared coordination doc
17
+ Every wave agent reads `.planning/campaign/SHARED.md` **before starting**, and appends a one-line claim the moment it picks up an area:
18
+ ```
19
+ <area> — agent <N> — <status>
20
+ ```
21
+ e.g. `crm-pipeline — agent 2 — claimed`. This stops two parallel agents in the same wave from silently grabbing the same area or file domain. The orchestrator seeds the file at wave dispatch; agents only append, never rewrite. Statuses progress `claimed` → `working` → `done` (or `skipped: <reason>`). If an agent finds its target area already claimed, it stops and reports back instead of duplicating work.
22
+
16
23
  ### Wave scope rules
17
24
  Each agent in a wave must:
18
25
  - Own a **distinct audit area** (no two agents touching the same file domain).
@@ -46,6 +53,20 @@ For each backlog item, score before assigning to a wave:
46
53
  - Past 25 min: peek at all panes, identify stuck agents, decide kill-or-wait.
47
54
  - Hard stop: 45 min. If a wave hasn't produced commits in 45 min, something is wrong — abort and re-dispatch.
48
55
 
56
+ ### Log cost per wave
57
+ After each wave dispatch, append a one-line cost/agent-count note to `.planning/campaign/STATE.md` so the running campaign total stays visible (and the cost ceiling in `orchestrator-rhythm.md` can be checked against it):
58
+ ```
59
+ wave 3: 4 agents dispatched, ~12 min target — running total: 11 agent-runs
60
+ ```
61
+
62
+ ### Optional reviewer agent
63
+ For waves that touch **overlapping areas**, or campaigns running **more than 3 waves**, add one reviewer agent that runs *after* the wave's coders finish but *before* the merge step. The reviewer:
64
+ - Reads all branch diffs for the wave (`git diff campaign-integration..<branch>` per branch).
65
+ - Flags conflicts, scope drift, and duplicated work across the branches.
66
+ - Reports to `.planning/campaign/STATE.md` (or a `REVIEW-wave-<N>.md`) — it does NOT merge.
67
+
68
+ Keep it **optional**. For small bounded work (3-4 distinct, non-overlapping areas), the flat fan-out stays the default — a reviewer agent there is pure overhead. Add it only when the conflict surface or campaign length justifies the extra agent-run.
69
+
49
70
  ## Examples
50
71
 
51
72
  ### Good wave-1 composition (from real session)
@@ -74,6 +74,53 @@ Then proceed to `./steps/step-01-target.md`.
74
74
  | 3b | Brownfield Init | Overlay rcode structure into existing project *(brownfield only)* | `steps/step-03-brownfield.md` |
75
75
  | 4 | Post-Setup | Rename, init git, suggest next steps | `steps/step-04-post-setup.md` |
76
76
 
77
+ ## Post-Clone Checklist (Greenfield)
78
+
79
+ After cloning the template and before handing off to the user, run these steps in order:
80
+
81
+ ### 1. pnpm-first — Install Dependencies with pnpm
82
+
83
+ **Never use `npm install`.** Always install with pnpm:
84
+
85
+ ```bash
86
+ corepack enable pnpm # ensure pnpm is available via corepack
87
+ pnpm install # install all dependencies
88
+ ```
89
+
90
+ If `package.json` contains a `packageManager` field, verify it is set to a `pnpm@x.y.z` string. If it is missing or set to `npm`, update it to `pnpm` before installing.
91
+
92
+ ### 2. Node.js 20+ Verification
93
+
94
+ Check `.nvmrc` (if present) and the `engines.node` field in `package.json`. If either targets Node 16 or Node 18, update to `>=20.0.0`:
95
+
96
+ - `.nvmrc`: change content to `20`
97
+ - `package.json` `engines.node`: change `>=16.0.0` or `>=18.0.0` to `>=20.0.0`
98
+
99
+ Report the result to the user: "Node target verified: 20+" or "Node target updated from X to 20+".
100
+
101
+ ### 3. Modern Dependency Check
102
+
103
+ Scan the scaffolded `package.json` for known deprecated packages and flag them to the user:
104
+
105
+ | Found | Suggestion |
106
+ |-------|-----------|
107
+ | `moment` | Replace with `date-fns` (tree-shakeable, no-timezone footgun) |
108
+ | `axios` | Native `fetch` is available in Node 18+; only keep `axios` if fetch polyfill is needed |
109
+ | `request` | Unmaintained — use native `fetch` or `undici` |
110
+
111
+ Do **not** auto-remove these; surface the finding and let the user decide.
112
+
113
+ ### 4. rcode Config Scaffold
114
+
115
+ After cloning, create `.rcode/config.yaml` with starter content if it does not already exist:
116
+
117
+ ```yaml
118
+ project_name: "{PROJECT_NAME}"
119
+ current_phase: 1
120
+ ```
121
+
122
+ Replace `{PROJECT_NAME}` with the actual project name supplied by the user. Do not overwrite an existing `.rcode/config.yaml`.
123
+
77
124
  ## Design Decisions
78
125
 
79
126
  - **Always clone fresh** — never cache template locally. Template updates are free.
@@ -81,12 +128,24 @@ Then proceed to `./steps/step-01-target.md`.
81
128
  - **Safety first** — never touch a non-empty directory without user approval.
82
129
  - **Brownfield never overwrites** — in `--here` mode, existing files are never modified.
83
130
  - **Minimal assumptions** — ask before acting on any ambiguity.
131
+ - **pnpm always** — never use npm or yarn for installs; always use pnpm via corepack.
132
+
133
+ ### Safety Check: What "non-empty" means
134
+
135
+ A directory is considered **non-empty** (and therefore protected) if it contains **any files or directories other than**:
136
+ - `.git/` (git metadata only)
137
+ - `README.md` (bare readme with no project code)
138
+
139
+ Everything else — including `package.json`, `src/`, `.rcode/`, `node_modules/`, dotfiles like `.env` — counts as content. If any such file is present, the safety check triggers and the user must explicitly consent before the skill proceeds.
84
140
 
85
141
  ## Output Format
86
142
 
87
143
  - New project directory scaffolded at the specified path
88
144
  - Fresh git history (template history stripped, new `git init` applied)
89
- - `.rcode/config.json` initialized with project name and user preferences
145
+ - `.rcode/config.yaml` initialized with project name and current phase
146
+ - Dependencies installed via `pnpm install`
147
+ - Node.js target verified or updated to 20+
148
+ - Deprecated dependency findings reported (if any)
90
149
  - Console summary: path created, files scaffolded, next steps
91
150
 
92
151
  ## Examples