magicciv/tooling/claude/dot-claude/instructions/scripts-extraction.md
Natalie 93f94ac78f feat(@projects/@magic-civilization): implement claude agent workflows
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 03:43:00 -07:00

1.6 KiB

Inline Pipelines → scripts/ From Turn 1

Load when: about to write an inline for i in …; do … python3 -c …; done or a cat … | python3 -c "import json,sys; …" to inspect state.

If you catch yourself writing an inline for i in …; do … python3 -c …; done or cat … | python3 -c "import json,sys; d=json.load(sys.stdin); …" to inspect state (task store, team config, iteration outputs, batch results, etc.), stop and extract it to scripts/. Recurring inspections belong in a named script that other agents (and future-you) can call by one word.

Concrete triggers

  • You're about to paste the same python3 -c heredoc into Bash a second time — write the script instead.
  • You're iterating over a directory of JSON files (tasks, iter batches, objectives) in a one-liner — script it.
  • You're parsing a config file (~/.claude/teams/*/config.json, .project/objectives/*.md frontmatter, turn_stats.jsonl) ad-hoc — script it.

Canonical patterns already in the repo

  • scripts/team_members.sh <team-name> — list non-lead members of any team
  • scripts/regression_tests_status.sh — team + tasks + test-file disk presence for the regression-tests wave
  • tools/objectives-report.py — dashboard regeneration from .project/objectives/*.md frontmatter
  • tools/autoplay-report.py — batch result analysis
  • tools/autoplay-batch.sh — batch dispatch

Rule: if your pipeline would be reused next turn / next cycle / next wave, it's a script. An agent that paste-repeats an inline pipeline is training future agents to do the same.