combined-head-linecount-check
O que ela faz
Esta skill mostra ao agente de IA como ver o topo de um arquivo e contar suas linhas em um único comando. É para pessoas que querem verificações rápidas de arquivos de código ou de configuração.
Quando usar
- ✓Quando você quer ver as primeiras linhas de um arquivo e o tamanho dele em uma só etapa.
- ✓Quando está auditando vários arquivos e quer menos chamadas ao shell.
- ✓Quando o conteúdo do cabeçalho ou o tamanho de um arquivo importa antes de editá-lo.
Link da skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/combined-head-linecount-check/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Mostre as primeiras 10 linhas de main.ts e quantas linhas ele tem, em uma única verificação.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente executa o head para mostrar as primeiras linhas, imprime um separador e depois executa o wc -l para contar as linhas. A saída mostra o conteúdo primeiro e a contagem de linhas abaixo dos traços.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Combined Head + Line Count Check
When you need to both inspect the top of a file and confirm its total line count, collapse the two checks into a single run_shell call instead of issuing two separate commands.
Why
- Each shell call is a round-trip. Two separate calls (
headthenwc -l) cost two iterations. - A combined call costs one iteration and returns both pieces of information atomically.
- When checking multiple files at once, each file still only needs one call (or all files can be parallelized in a single compound command).
Pattern
head -N <file> && echo "---" && wc -l <file>
The echo "---" separator makes the output easy to parse visually: everything above the dashes is content, everything below is the line count.
Examples
Single file — inspect first 10 lines and total count
head -10 src/main.ts && echo "---" && wc -l src/main.ts
Sample output:
import { createApp } from 'vue'
import App from './App.vue'
...
---
142 src/main.ts
Multiple files — fully parallelized
When you need to check several files simultaneously, run them all in one shell call using && chains or newline-separated subshells:
(head -10 src/main.ts && echo "---" && wc -l src/main.ts) && echo "===" && \
(head -10 vite.config.ts && echo "---" && wc -l vite.config.ts) && echo "===" && \
(head -5 package.json && echo "---" && wc -l package.json)
Or, if order independence is acceptable, run them in parallel background jobs and wait:
{
head -10 src/main.ts && echo "---" && wc -l src/main.ts
} &
{
head -10 vite.config.ts && echo "---" && wc -l vite.config.ts
} &
wait
When to Apply
| Situation | Recommendation |
|---|---|
| Verifying a generated/modified file was written correctly | ✅ Use combined call |
| Checking multiple output files after a build step | ✅ Parallelize all in one shell call |
| Only need line count (no content preview required) | Use plain wc -l |
| Only need content (no line count required) | Use plain head -N |
| File is extremely large and you want a middle section | Use sed -n or awk instead |
Integration with Parallel Reads
This pattern compounds well with parallel file reads. In a single iteration you can:
- Read file contents with
catorheadfor multiple files. - Simultaneously verify line counts with
wc -l. - Check for specific patterns with
grep -c.
Example of a 5-file parallel verification in one shell call:
echo "=== main.ts ===" && head -10 src/main.ts && echo "lines:" && wc -l < src/main.ts && \
echo "=== config ===" && head -5 vite.config.ts && echo "lines:" && wc -l < vite.config.ts && \
echo "=== package ===" && head -5 package.json && echo "lines:" && wc -l < package.json && \
echo "=== index ===" && head -8 index.html && echo "lines:" && wc -l < index.html && \
echo "=== readme ===" && head -5 README.md && echo "lines:" && wc -l < README.md
Tip: Using
wc -l < file(with input redirect) prints only the number, without the filename — cleaner output when the filename is already shown by theecholabel above it.
Key Takeaway
Never use two shell calls where one will do. Combining
head -Nandwc -lin a single command is the minimal-overhead way to answer both "what does this file contain?" and "is it the right size?" simultaneously.
Perguntas frequentes
Por que combinar as duas verificações?
Cada chamada ao shell tem um ida e volta, então um único comando combinado termina o trabalho em menos etapas.
Ela consegue verificar vários arquivos de uma vez?
Sim. A skill mostra como encadear as verificações de vários arquivos em uma única chamada ao shell.
O que faz a linha de traços?
Ela separa o conteúdo do arquivo da contagem de linhas, para que a saída seja fácil de ler.
Detalhes
Descrição original do autor
Verify a file's first N lines and total line count in one shell call using head and wc -l with an echo separator, minimizing read operations and shell iterations.
repo: HKUDS/AgentPilot
Popularidade
- Estrelas no GitHub
- 7,8 mil
- Posição no ranking
- #13040
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
agentpilot
7,8 milAjuda seu agente a melhorar um projeto passo a passo, preparando uma tarefa e executando o ciclo do AgentPilot, que propõe, testa e pontua mudanças.
openspace
7,8 milAjuda seu agente a configurar o OpenSpace, uma ferramenta que armazena e busca skills de agentes, e a conectá-la ao seu app de IA pelo MCP.
rsi-arena
7,8 milAjuda seu agente a configurar e rodar testes padrão de benchmark de IA, como AIME e Terminal-Bench, para comparar diferentes métodos de melhoria.
experiment-guide
7,8 milAjuda seu agente a planejar pequenos experimentos, ler seus resultados e registrar descobertas enquanto investiga como melhorar um programa.
Skills parecidas
diffs
394 milPermite que seu agente gere um diff real e compartilhável das edições, como link de visualização ou arquivo de imagem, em vez de um resumo escrito à mão.
coding-agent
394 milAjuda seu agente a passar um trabalho grande de programação para o Codex, Claude Code ou OpenCode em segundo plano e acompanhar o andamento.
gh-issues
394 milAjuda seu agente a encontrar issues do GitHub, escolher quais resolver e abrir pull requests com correções, acompanhando os comentários de revisão.