Skip to content

feat: add lazy-code ladder to rules and a routed lazy-code skill - #1188

Closed
fuentes71 wants to merge 3 commits into
mainfrom
feat/lazy-code-ladder
Closed

feat: add lazy-code ladder to rules and a routed lazy-code skill#1188
fuentes71 wants to merge 3 commits into
mainfrom
feat/lazy-code-ladder

Conversation

@fuentes71

@fuentes71 fuentes71 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

O que a branch entrega

Traz pro EGC a disciplina de "menor solucao que funciona" em duas camadas, para que ela valha em qualquer LLM que consuma o EGC, nao so no Claude.

Adaptado de ponytail (MIT), com atribuicao nos dois arquivos.

Por que duas camadas, e nao um ruleset unico

Essa e a decisao central da branch.

O ganho medido do ruleset original nao e universal. No benchmark publicado pelo proprio projeto de origem, em modelos de raciocinio cuja saida base ja e enxuta ele inverte: de ~20% mais barato para 26-39% mais caro. A causa e estrutural e vale para qualquer LLM com esse perfil: um ruleset sempre-ligado e reenviado como input a cada chamada, e o overhead de input supera as linhas economizadas.

Portar como instrucao permanente teria feito o EGC custar mais caro exatamente nas LLMs que a branch pretende cobrir. Dai a separacao:

Camada 1, sempre-ligada e curta (rules/common/coding-style.md): a escada de decisao de 7 degraus e a lista "Never Simplified Away". Sao ~400 tokens marginais num arquivo que ja era carregado, e se distribuem sozinhos para Gemini, Cursor, Codex, opencode, trae e kiro pelo caminho que rules/common/ ja tem.

Camada 2, roteada (skills/general/lazy-code/): intensidade, contrato de saida e exemplos, que e o volume. A description do frontmatter exclui request nao-codigo de proposito, porque e o texto que o orchestrate_task usa para rotear. Carregado por tarefa, a inversao nao acontece.

Conflitos resolvidos, nao empilhados

A escada colide com regras que o coding-style.md ja tinha. Resolver isso foi o trabalho real da branch; empilhar sem resolver faz o agente obedecer a regra que vier por ultimo no contexto.

  1. "MANY SMALL FILES" contra "menor numero de arquivos": separados por escopo explicito. A regra de organizacao governa estrutura existente; a escada governa trabalho novo. Espalhar uma mudanca pequena em varios arquivos novos deixa de ser licenciado; dividir um modulo que cresceu de verdade continua exigido.
  2. Escada contra as regras de estilo: precedencia declarada no proprio arquivo. A escada decide se e quanto codigo existe; o resto do coding-style.md decide como ele e escrito. Nao competem.

Por que a lista "Never Simplified Away" nao e enfeite

No benchmark de origem, o braco que recebeu apenas "prefira solucoes de uma linha" escreveu menos linhas e foi o unico a deixar um input de path traversal escapar do diretorio base. As linhas que ele economizou eram a checagem. A lista e o que separa preguicoso de descuidado.

Arquivos

  • rules/common/coding-style.md: escada, precedencia, lista de nao-negociaveis
  • skills/general/lazy-code/SKILL.md: skill roteada
  • catalog-index.ts e skills-index.json: regerados por scripts/build-skill-index.js

Verificacao

tsc --noEmit limpo e npm run build com exit 0 no egc-guardian; entrada lazy-code presente no catalogo compilado e no skill-index.json.

Nao verificado, e vale dizer: o roteamento discriminando codigo de nao-codigo. O egc-guardian carrega o catalogo quando o servidor MCP sobe, entao uma skill nova so passa a rotear na sessao seguinte. Vale um teste manual pos-merge com um prompt de codigo e um de investigacao.

🤖 Generated with Claude Code


Summary by cubic

Adds a two-layer “lazy code” discipline: a short always-on decision ladder in rules/common/coding-style.md and a routed lazy-code skill for code tasks. This keeps solutions minimal while avoiding extra token cost on non-code requests.

  • New Features

    • Added a 7-step ladder to rules/common/coding-style.md with precedence, root-cause bug-fix guidance, “Mark deliberate shortcuts”, and a “Never Simplified Away” list. Clarifies “MANY SMALL FILES” (existing structure) vs new work (fewest files).
    • Introduced skills/general/lazy-code with intensity levels (lite/full/ultra), an output contract, and examples. Routed to load only for coding tasks. Updated catalog-index.ts and scripts/lib/skill-index.json.
    • Updated README.md to reflect 231 skills.
  • Migration

    • Restart the egc-guardian MCP server to load the new skill.
    • Manually verify routing with one coding prompt and one non-coding prompt.

Written for commit ac9be49. Summary will update on new commits.

Review in cubic

@fuentes71
fuentes71 requested a review from Fmarzochi as a code owner August 4, 2026 12:29
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fuentes71, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fead3025-23af-421e-a059-4518812863cb

📥 Commits

Reviewing files that changed from the base of the PR and between a220799 and ac9be49.

⛔ Files ignored due to path filters (2)
  • rules/common/coding-style.md is excluded by !rules/** and included by none
  • skills/general/lazy-code/SKILL.md is excluded by !skills/** and included by none
📒 Files selected for processing (3)
  • README.md
  • mcp/servers/egc-guardian/src/catalog-index.ts
  • scripts/lib/skill-index.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

DCO sign-off missing

One or more commits in this PR are missing a Signed-off-by line (Developer Certificate of Origin).

How to fix:

# Single commit
git commit --amend -s
git push --force-with-lease

# Multiple commits -- replace N with the number of commits in your PR
git rebase --signoff HEAD~N
git push --force-with-lease

Note: This check is informational only -- a maintainer can still merge your PR without sign-off.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

Adiciona a escada de decisao (7 degraus, para no primeiro que segura) antes
de KISS/DRY/YAGNI. Os principios existentes dizem o que valorizar, mas nenhum
deles diz quando parar, que e o que faltava.

Resolve dois conflitos que a escada criaria se fosse so empilhada:

- "MANY SMALL FILES" contra "menor numero de arquivos": passam a ter escopo
  explicito. A regra de organizacao governa estrutura existente, a escada
  governa trabalho novo. Espalhar mudanca pequena em varios arquivos novos
  deixa de ser licenciado; dividir modulo que cresceu de verdade continua exigido.
- Escada contra as regras de estilo: precedencia declarada. A escada decide
  SE e QUANTO codigo existe, o resto do arquivo decide COMO ele e escrito.

Inclui a lista "Never Simplified Away". Ela nao e enfeite: no benchmark de
origem, o braco que recebeu so "prefira one-liners" escreveu menos linhas e
foi o unico a deixar path traversal escapar do diretorio base. As linhas que
ele economizou eram a checagem.

Escada adaptada de github.com/DietrichGebert/ponytail (MIT).

Signed-off-by: Matheus Fuentes <matheus.fu.p@hotmail.com>
Cria skills/general/lazy-code com a parte da disciplina que nao merece espaco
sempre-ligado: niveis de intensidade, contrato de saida e exemplos trabalhados.
A escada curta fica em rules/common/coding-style.md, que ja e sempre carregado.

O motivo de ser skill roteada e nao instrucao permanente esta na propria
description, que exclui request nao-codigo. Em sessao de investigacao ou
documento o ruleset nao tem codigo pra encolher e vira custo puro.

Isso tambem e o que evita a inversao de custo medida no projeto de origem:
em modelo de raciocinio cuja saida base ja e enxuta, ruleset sempre-ligado e
reenviado como input a cada chamada e o overhead engole a economia, virando
26-39% mais caro em vez de 20% mais barato. Carregado por tarefa, nao inverte.
E o que torna isso util fora do Claude.

catalog-index.ts regerado pelo build-skill-index.js (433 entradas).

Adaptado de github.com/DietrichGebert/ponytail (MIT).

Signed-off-by: Matheus Fuentes <matheus.fu.p@hotmail.com>
O catalog.js do CI exige que a contagem no README bata com a real. A skill
lazy-code levou o total de 230 pra 231.

AGENTS.md nao muda: usa "230+", que continua verdadeiro.

Signed-off-by: Matheus Fuentes <matheus.fu.p@hotmail.com>
@fuentes71
fuentes71 force-pushed the feat/lazy-code-ladder branch from 9a459e6 to ac9be49 Compare August 4, 2026 13:11
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@Fmarzochi

Copy link
Copy Markdown
Owner

Thanks @fuentes71, the two-layer design is genuinely good and this discipline belongs in EGC. One direction change before it can move forward: I want this as a first-party EGC concept, designed and written from scratch for our rules and skill runtime, with EGC terminology throughout. That also means the layer split needs to stand on its own reasoning, or on measurements taken in EGC itself. The skeleton you built is the right one: a short always-on ladder plus a routed skill, with conflicts resolved by declared precedence. Want to take the rewrite?

@Fmarzochi

Copy link
Copy Markdown
Owner

Two acceptance criteria for the rewrite, @fuentes71. First: zero inherited text. Every line of the rule and the skill is written fresh for EGC, including names and headings; if a sentence from the current branch survives, it does not land. Second: our own numbers. The external benchmark figures go away. In their place, a small eval measured on EGC itself: one fixed set of coding tasks run with and without the two layers, reporting tokens per completed task, a correctness gate, and a safety probe set showing the non-negotiable checklist still blocks the dangerous shortcut. If the eval is too big for one PR, land the rewrite justified by reasoning alone and ship the eval as a follow-up, but the external figures go either way.

@Fmarzochi

Copy link
Copy Markdown
Owner

Checking in, @fuentes71: the rewrite direction from the two comments above still stands, and the slot is yours. If anything in the acceptance criteria is unclear, or you want a skeleton to start from, say the word and I will sketch the rule and skill headings with you. And if life got busy and you would rather hand it back, that is completely fine too, just let me know either way.

@Fmarzochi

Copy link
Copy Markdown
Owner

@fuentes71 this idea just shipped: #1256 landed the minimal-change ladder as an always-on rule in the shared coding style plus a routed skill, and the squash commit carries your co-authorship, because the push to give EGC a discipline against overengineering and half-done code came from you.

I ended up rewriting the content from scratch so it could be born wired into today's distribution machinery (the module manifests, the generated catalog indices and the per-harness condensations, which this branch predated), and with install-level verification across the supported harnesses. Closing this PR in favor of #1256.

Thank you for pushing this forward, Matheus. Your name is on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants